Commit 31e26b72 by qinjianhui

Merge branch 'dev' into 'master'

Dev

See merge request !145
parents 64ba7141 8eaf66bb
......@@ -70,6 +70,15 @@ export interface ILogisticsCompany {
basicType: number // int(11)
}
export interface LogisticsWayData {
id: number
name: string
code: string
status: boolean
createTime: string
updateTime: string
}
interface ILogisticsParams {
logType: string
relaId: number | string
......@@ -148,6 +157,15 @@ export function getUniuniList() {
},
)
}
// 根据物流公司筛选物流方式
export function getLogisticsWayListByCompanyId(companyId: number) {
return axios.get<never, BaseRespData<LogisticsWayData[]>>(
'logisticsWay/getUsableWaysByCompanyId',
{
params: { companyId },
},
)
}
// 获取tictok物流承运商
export function getTiktokCarrier() {
return axios.get<never, BaseRespData<{ name: string; id: string,typeCode:string,label:string }[]>>(
......
......@@ -246,9 +246,9 @@ export function productionQueryApi(id: number, podJomallOrderCnId: number) {
},
)
}
export function printProductionOrderApi(orderIds: number[]) {
export function printProductionOrderApi(url: string, orderIds: number[]) {
return axios.post<never, BaseRespData<string>>(
'factory/podJomallOrderProductCn/printProducePdf',
url,
orderIds,
)
}
......@@ -639,10 +639,10 @@ export function updateToWaitShipmentApi(params: {
}
//创建物流订单
export function createLogisticsOrdersApi(orderIds: (string | number)[]) {
export function createLogisticsOrdersApi(orderIdList: (string | number)[], logisticsWayId: number | null) {
return axios.post<never, BaseRespData<never>>(
`factory/podJomallOrderCn/createLogisticsOrders`,
orderIds,
{ orderIdList, logisticsWayId },
)
}
......@@ -791,3 +791,11 @@ export function updateProductOutOfStockApi(params: {
params,
)
}
// 打印普胚生产单
export function printNormalProducePdf(orderIds: number[]) {
return axios.post<never, BaseRespData<string>>(
'factory/podJomallOrderProductCn/printNormalProducePdf',
orderIds,
)
}
......@@ -179,9 +179,9 @@ export function productionQueryApi(id: number, podJomallOrderUsId: number) {
},
)
}
export function printProductionOrderApi(orderIds: number[]) {
export function printProductionOrderApi(url: string, orderIds: number[]) {
return axios.post<never, BaseRespData<string>>(
'factory/podJomallOrderProductUs/printProducePdf',
url,
orderIds,
)
}
......
......@@ -121,11 +121,7 @@
style="display: flex; margin-left: 10px"
>
<div class="text-green">
{{
statisticData?.compareYesterdayShipmentOrderNum.toFixed(
2,
)
}}
{{ statisticData?.compareYesterdayShipmentOrderNum }}
</div>
<div class="up-icon-green"></div>
</div>
......@@ -134,7 +130,7 @@
{{
Math.abs(
statisticData?.compareYesterdayShipmentOrderNum || 0,
).toFixed(2)
)
}}
</div>
<div class="down-icon-red"></div>
......
......@@ -757,6 +757,26 @@ const handleSelectionChange = (val: PodUsOrderListData[]) => {
selection.value = val
}
// 修改行样式方法
const getRowStyle = ({ row }: { row: PodUsOrderListData }) => {
// 如果行被选中,设置背景色为 #fdf6ec
if (selection.value.some((item) => item.id === row.id)) {
return {
backgroundColor: '#fdf6ec',
}
}
return {
backgroundColor: '',
}
}
// 获取行类名方法
const getRowClassName = ({ row }: { row: PodUsOrderListData }) => {
return selection.value.some((item) => item.id === row.id)
? 'row-selected'
: ''
}
/**
* @description: 页面添加回车监听
*/
......@@ -802,7 +822,7 @@ onMounted(() => {
</script>
<template>
<split-div otherSize="35">
<split-div other-size="35">
<template #top>
<el-card>
<ElForm
......@@ -1099,14 +1119,14 @@ onMounted(() => {
</ElFormItem>
<ElFormItem>
<span>
<ElButton link @click="resetSearchForm" style="font-size: 12px"
<ElButton link style="font-size: 12px" @click="resetSearchForm"
><span title="重置查询条件">重置</span></ElButton
>
</span>
</ElFormItem>
<ElFormItem>
<span>
<ElButton type="primary" @click="search" ref="searchBtnRef"
<ElButton ref="searchBtnRef" type="primary" @click="search"
>查询</ElButton
>
</span>
......@@ -1136,7 +1156,8 @@ onMounted(() => {
:serial-numberable="true"
:selectionable="true"
:paginated-data="tableData"
highlight-current-row
:row-style="getRowStyle"
:row-class-name="getRowClassName"
@row-click="rowClick"
@selection-change="handleSelectionChange"
>
......@@ -1172,9 +1193,9 @@ onMounted(() => {
</div>
<div class="pagination">
<el-pagination
size="small"
v-model:current-page="pagination.currentPage"
v-model:page-size="pagination.pageSize"
size="small"
:page-sizes="[50, 100, 150, 200]"
layout="total, sizes, prev, pager, next, jumper"
:total="pagination.total"
......@@ -1363,4 +1384,13 @@ onMounted(() => {
width: 75px;
}
}
// 确保选中行的背景色在 hover 时也保持
:deep(.el-table__body) {
.el-table__row.row-selected:hover {
td {
background-color: #fdf6ec !important;
}
}
}
</style>
......@@ -772,6 +772,27 @@ const handleSelectionChange = (val: PodCnOrderListData[]) => {
selection.value = val
}
// 修改行样式方法
const getRowStyle = ({ row }: { row: PodCnOrderListData }) => {
// 如果行被选中,设置背景色为 #fdf6ec
if (selection.value.some((item) => item.id === row.id)) {
return {
backgroundColor: '#fdf6ec',
}
}
return {
backgroundColor: '',
}
}
// 获取行类名方法
const getRowClassName = ({ row }: { row: PodCnOrderListData }) => {
return selection.value.some((item) => item.id === row.id)
? 'row-selected'
: ''
}
const handleRadioGroupClick = (event: Event) => {
const target = event.target as HTMLElement
const radioButton = target.closest('.el-radio-button')
......@@ -855,7 +876,7 @@ onMounted(() => {
</script>
<template>
<split-div otherSize="35">
<split-div other-size="35">
<template #top>
<el-card>
<ElForm
......@@ -1180,14 +1201,14 @@ onMounted(() => {
</ElFormItem>
<ElFormItem>
<span>
<ElButton link @click="resetSearchForm" style="font-size: 12px"
<ElButton link style="font-size: 12px" @click="resetSearchForm"
><span title="重置查询条件">重置</span></ElButton
>
</span>
</ElFormItem>
<ElFormItem>
<span>
<ElButton type="primary" @click="search" ref="searchBtnRef"
<ElButton ref="searchBtnRef" type="primary" @click="search"
>查询</ElButton
>
</span>
......@@ -1225,7 +1246,8 @@ onMounted(() => {
:serial-numberable="true"
:selectionable="true"
:paginated-data="tableData"
highlight-current-row
:row-style="getRowStyle"
:row-class-name="getRowClassName"
@row-click="rowClick"
@selection-change="handleSelectionChange"
>
......@@ -1268,9 +1290,9 @@ onMounted(() => {
</div>
<div class="pagination">
<el-pagination
size="small"
v-model:current-page="pagination.currentPage"
v-model:page-size="pagination.pageSize"
size="small"
:page-sizes="[50, 100, 150, 200]"
layout="total, sizes, prev, pager, next, jumper"
:total="pagination.total"
......@@ -1459,4 +1481,13 @@ onMounted(() => {
width: 75px;
}
}
// 确保选中行的背景色在 hover 时也保持
:deep(.el-table__body) {
.el-table__row.row-selected:hover {
td {
background-color: #fdf6ec !important;
}
}
}
</style>
......@@ -269,7 +269,7 @@
</template>
<script setup lang="ts">
import { computed, nextTick, ref, watch, defineProps, defineEmits } from 'vue'
import { computed, nextTick, ref, watch } from 'vue'
import useLodop from '@/utils/hooks/useLodop'
import TableView from '@/components/TableView.vue'
import { OrderData, ProductList, IorderItem } from '@/types/api/podMakeOrder'
......@@ -499,14 +499,12 @@ async function barcodeInput() {
console.log('pending', pending)
await submitInspection(pending, async () => {
await inputActive()
await getPackingData(code)
noObj.value = {}
})
} else {
await inputActive()
await getPackingData(code)
}
await inputActive()
await getPackingData(code)
isLock.value = false
}
async function submitInspection(objs?: OrderData, callback?: () => void) {
......@@ -525,12 +523,10 @@ async function submitInspection(objs?: OrderData, callback?: () => void) {
ElMessage.success(res.message)
coverImage.value = ''
testingData.value = {}
await inputActive()
isLock.value = false
callback?.()
} catch (e) {
console.error(e)
await inputActive()
isLock.value = false
}
}
......@@ -591,7 +587,7 @@ async function getPackingData(code: string) {
async function printFile(data: OrderData) {
// await props.printOrderOne(data)
await printOrderOne(data)
noObj.value[data.id!] = data
noObj.value[data.id as number] = data
await inputActive()
}
function printOrderOne(item: OrderData): Promise<void> {
......
<template>
<el-dialog
v-model="createLogisticDialogVisible"
:close-on-click-modal="false"
title="创建物流订单"
>
<div style="display: flex; align-items: center; gap: 20px">
<span style="font-weight: 500">是否自动匹配物流方式</span>
<el-radio-group v-model="isAutoMatch">
<el-radio :value="false"></el-radio>
<el-radio :value="true"></el-radio>
</el-radio-group>
</div>
<div
v-if="!isAutoMatch && logisticCompanyList.length > 0"
style="margin: 10px; border: 1px solid #e0e0e0; display: flex"
>
<div
style="
display: flex;
flex-direction: column;
width: 200px;
font-weight: 500;
"
>
<div
v-for="item in logisticCompanyList"
:key="item.id"
class="logistic-company-item"
:class="{
'selected-logistic-company':
selectedLogisticCompany?.id === item.id,
}"
@click="selectLogisticCompany(item)"
>
{{ item.name }}
</div>
</div>
<div
style="
width: 100%;
min-height: 220px;
display: flex;
justify-content: center;
align-items: flex-start;
"
>
<div
v-if="logisticsWayList.length > 0"
style="
padding: 0 10px;
width: 100%;
display: flex;
align-items: center;
"
>
<el-radio-group v-model="logisticsWayId">
<el-radio
v-for="item in logisticsWayList"
:key="item.id"
:value="item.id"
style="width: 200px; height: 40px"
>
{{ item.name }}
</el-radio>
</el-radio-group>
</div>
<el-empty v-else description="暂无数据" :image-size="80" />
</div>
</div>
<template #footer>
<el-button @click="cancelDialog"> 取消 </el-button>
<el-button type="primary" @click="confirmDialog"> 确定 </el-button>
</template>
</el-dialog>
</template>
<script lang="ts" setup>
import {
getLogisticsCompanyList,
ILogisticsCompany,
getLogisticsWayListByCompanyId,
LogisticsWayData,
} from '@/api/logistics'
import { createLogisticsOrdersApi } from '@/api/podCnOrder'
const createLogisticDialogVisible = ref(false)
const isAutoMatch = ref(false)
const logisticCompanyList = ref<ILogisticsCompany[]>([])
const selectedLogisticCompany = ref<ILogisticsCompany | null>(null)
const logisticsWayList = ref<LogisticsWayData[]>([])
const logisticsWayId = ref<number | null>(null)
const orderIdList = ref<(string | number)[]>([])
const cancelDialog = () => {
logisticsWayList.value = []
logisticCompanyList.value = []
selectedLogisticCompany.value = null
logisticsWayId.value = null
orderIdList.value = []
isAutoMatch.value = false
createLogisticDialogVisible.value = false
}
// 获取物流公司列表
const getLogisticsCompanyListFn = async () => {
const { data } = await getLogisticsCompanyList()
logisticCompanyList.value = data as unknown as ILogisticsCompany[]
if (logisticCompanyList.value.length > 0) {
selectedLogisticCompany.value = logisticCompanyList.value[0]
await getLogisticsWayListFn(selectedLogisticCompany.value.id)
}
}
// 获取物流方式列表
const getLogisticsWayListFn = async (id: number) => {
const { data } = await getLogisticsWayListByCompanyId(id)
logisticsWayList.value = data
}
// 选择物流公司
const selectLogisticCompany = async (item: ILogisticsCompany) => {
selectedLogisticCompany.value = item
await getLogisticsWayListFn(item.id)
}
const confirmDialog = async () => {
await createLogisticsOrdersApi(orderIdList.value, logisticsWayId.value)
.then((res) => {
emits('show-result', res.data)
})
.finally(() => {
logisticsWayList.value = []
logisticCompanyList.value = []
selectedLogisticCompany.value = null
logisticsWayId.value = null
orderIdList.value = []
isAutoMatch.value = false
createLogisticDialogVisible.value = false
})
}
const showDialog = async (ids: (string | number)[]) => {
await getLogisticsCompanyListFn()
orderIdList.value = ids
createLogisticDialogVisible.value = true
}
const emits = defineEmits<{
(
e: 'show-result',
data: Array<{
id: string | number
status: boolean
factoryOrderNumber?: string
message: string
}>,
): void
}>()
defineExpose({
showDialog,
})
watch(isAutoMatch, (newVal) => {
if (newVal) {
getLogisticsCompanyListFn()
}
})
</script>
<style lang="scss" scoped>
.logistic-company-item {
padding: 10px 10px;
cursor: pointer;
&:hover {
background-color: #f0f0f0;
}
}
.selected-logistic-company {
background-color: #f0f0f0;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment