Commit 4da4545d by wusiyi

feat: 订单添加质检流程 #1009863

parent 262558ab
......@@ -591,6 +591,16 @@ export function getByOperationNoLogApi(operationNo: string) {
)
}
// 快捷质检 查询
export function getQualityScanByOperationNoApi(operationNo: string) {
return axios.get<never, BaseRespData<operateOrderListData>>(
'factory/podOrderOperation/qualityByOperationNo',
{
params: { operationNo },
},
)
}
// 校验库存
export function checkInventoryApi(id: number | string, status: string) {
return axios.get<never, BaseRespData<never>>(
......
......@@ -313,6 +313,7 @@ export interface QualityParams {
qualityIssues: string
qualify_problem_type: number | string
qualityPassed: boolean
source?: number // 0 列表页,1 快捷质检
}
/** 质检不通过原因 */
......
......@@ -46,9 +46,12 @@
<div class="right">
<div
v-if="
['fastProduction', 'fastReceipt', 'productionScan'].includes(
fastKey,
)
[
'fastProduction',
'fastReceipt',
'productionScan',
'qualityScan',
].includes(fastKey)
"
class="input"
>
......@@ -59,13 +62,44 @@
style="width: 660px; margin-right: 10px"
clearable
@keydown.enter="trackCodeInput()"
></el-input>
/>
<el-button type="primary" @click="trackCodeInput()">
查询
</el-button>
</div>
<div v-if="fastKey === 'qualityScan'" class="input">
<el-select
v-model="printDevice"
placeholder="请选择打印机"
clearable
filterable
@change="handlePrinterChange"
>
<el-option
v-for="(item, i) in printList"
:key="i"
:label="item"
:value="item"
></el-option>
</el-select>
<el-button
style="margin-left: 5px"
type="primary"
@click="printPdf"
>
打印操作单
</el-button>
<el-checkbox
v-model="isPrint"
:disabled="!printDevice"
style="margin-left: 10px"
>
自动打印
</el-checkbox>
</div>
<div class="div-text">
<div class="div-content">
<div v-if="fastKey !== 'qualityScan'" class="div-content">
<div :title="String(detail?.userMark)" class="div-item">
<span class="div-item-label" style="font-size: 18px"
>客户:</span
......@@ -97,8 +131,8 @@
</div>
</div>
<div class="div-text">
<b v-if="!showOperationNoRow">生产单信息</b>
<b v-else>操作单信息</b>
<b v-if="showOperationNoRow">操作单信息</b>
<b v-else>生产单信息</b>
<div class="div-content">
<div
v-if="showOperationNoRow"
......@@ -106,7 +140,18 @@
class="div-item"
>
<span class="div-item-label">操作单号:</span>
<div class="div-item-value">{{ operationNoDisplay }}</div>
<div class="div-item-value with-copy">
<span class="div-item-value-text">{{
operationNoDisplay
}}</span>
<el-icon
v-if="operationNoDisplay"
class="copy-icon"
@click="copy(operationNoDisplay)"
>
<DocumentCopy />
</el-icon>
</div>
</div>
<div
v-else
......@@ -119,16 +164,32 @@
</div>
</div>
<div
v-if="fastKey === 'fastReceipt'"
:title="setProductMark(String(detail.productMark))"
v-if="fastKey !== 'fastReceipt'"
:title="detail?.shopNumber ?? ''"
class="div-item"
>
<span class="div-item-label">类型:</span>
<div
class="div-item-value"
style="font-weight: bold; color: red"
>
{{ setProductMark(String(detail.productMark)) }}
<span class="div-item-label">店铺单号:</span>
<div class="div-item-value with-copy">
<span class="div-item-value-text">{{
detail?.shopNumber ?? ''
}}</span>
<el-icon
v-if="detail?.shopNumber"
class="copy-icon"
@click="copy(String(detail.shopNumber))"
>
<DocumentCopy />
</el-icon>
</div>
</div>
<div
v-if="fastKey === 'qualityScan'"
:title="String(detail?.batchArrangeNumber) || ''"
class="div-item"
>
<span class="div-item-label">批次号:</span>
<div class="div-item-value">
{{ detail?.batchArrangeNumber }}
</div>
</div>
<div
......@@ -137,7 +198,9 @@
class="div-item"
>
<span class="div-item-label">商品名称:</span>
<div class="div-item-value">{{ detail.productName || '' }}</div>
<div class="div-item-value">
{{ detail.productName || '' }}
</div>
</div>
<div
v-if="fastKey === 'fastReceipt'"
......@@ -176,20 +239,27 @@
</div>
</div>
<div
v-if="fastKey !== 'fastReceipt'"
v-if="fastKey !== 'fastReceipt' && fastKey !== 'qualityScan'"
:title="detail?.baseSku"
class="div-item"
>
<span class="div-item-label">基版:</span>
<div class="div-item-value">{{ detail?.baseSku }}</div>
</div>
<div :title="detail?.variantSku" class="div-item">
<div
v-if="fastKey === 'qualityScan'"
:title="detail?.baseSku"
class="div-item"
>
<span class="div-item-label">库存SKU:</span>
<div class="div-item-value">{{ detail?.baseSku }}</div>
</div>
<div v-else :title="detail?.variantSku" class="div-item">
<span class="div-item-label">变体SKU:</span>
<div class="div-item-value">{{ detail?.variantSku }}</div>
</div>
<div
v-if="fastKey !== 'fastReceipt'"
v-if="fastKey !== 'fastReceipt' && fastKey !== 'qualityScan'"
:title="
String(showOperationNoRow ? detail?.quantity : detail?.num)
"
......@@ -202,8 +272,8 @@
</div>
<div
v-if="fastKey !== 'fastReceipt'"
:title="String(detail?.size)"
v-if="fastKey !== 'fastReceipt' && fastKey !== 'qualityScan'"
:title="String(detail?.size || '')"
class="div-item"
>
<span class="div-item-label">尺寸:</span>
......@@ -211,7 +281,7 @@
</div>
<div
v-if="detail?.sizeType && fastKey !== 'fastReceipt'"
:title="String(detail?.sizeType)"
:title="String(detail?.sizeType || '')"
class="div-item"
>
<span class="div-item-label">尺码类型:</span>
......@@ -219,16 +289,16 @@
{{ sizeList.find((i) => i.value === detail.sizeType)?.name }}
</div>
</div>
<div
v-if="fastKey !== 'fastReceipt'"
:title="detail?.shopNumber ?? ''"
v-if="fastKey === 'qualityScan'"
:title="String(detail?.statusName || '')"
class="div-item"
>
<span class="div-item-label">店铺单号:</span>
<div class="div-item-value">{{ detail?.shopNumber ?? '' }}</div>
<span class="div-item-label">操作单状态:</span>
<div class="div-item-value" style="color: red">
{{ detail?.statusName }}
</div>
</div>
<div :title="detail?.createTime" class="div-item">
<span class="div-item-label">创建时间:</span>
<div class="div-item-value">{{ detail?.createTime }}</div>
......@@ -243,6 +313,7 @@
'fastProduction',
'fastReceipt',
'productionScan',
'qualityScan',
].includes(fastKey)
? 'visible'
: 'hidden',
......@@ -253,19 +324,29 @@
style="width: 100%; height: 100%; font-size: 18px"
size="large"
type="success"
@click="changeStatus"
@click="
fastKey === 'qualityScan'
? handleQuality(true)
: changeStatus()
"
>
{{
['fastProduction', 'productionScan'].includes(fastKey)
? '生产完成'
: '快捷入库'
}}
{{ sureButtonText }}
</el-button>
<div class="check">
<el-checkbox v-model="isAutoSure"> 自动完成上一单 </el-checkbox>
</div>
</div>
<div v-if="fastKey !== 'fastReceipt'" class="btn-down">
<div v-if="fastKey === 'qualityScan'" class="btn-down">
<el-button
style="width: 100%; height: 100%; font-size: 18px"
type="danger"
size="large"
@click="handleQuality(false)"
>
质检不通过
</el-button>
</div>
<div v-else-if="fastKey !== 'fastReceipt'" class="btn-down">
<div class="check">
<el-checkbox v-model="isDownloadImage" size="large">
扫码下载素材
......@@ -311,6 +392,11 @@
</div>
</div>
</div>
<QualityFailDialog
v-if="fastKey === 'qualityScan'"
ref="qualityFailDialogRef"
@success="handleQualitySuccess"
/>
</el-dialog>
</template>
<script setup lang="tsx">
......@@ -320,22 +406,44 @@ import {
downloadMaterialApi,
} from '@/api/podCnOrder'
import { cardImages, PodOrderRes } from '@/types/api/podCnOrder'
import { checkInventoryApi } from '@/api/factoryOrderNew'
import {
checkInventoryApi,
qualityPodOrderOperationApi,
} from '@/api/factoryOrderNew'
import { showConfirm } from '@/utils/ui'
import { filePath } from '@/api/axios'
import { computed, ref, watch } from 'vue'
import { BaseRespData } from '@/types/api'
import useLodop from '@/utils/hooks/useLodop'
import { print } from '@/components/print'
import { DocumentCopy } from '@element-plus/icons-vue'
import QualityFailDialog from '@/views/order/factoryOrderNew/component/QualityFailDialog.vue'
interface HistoryDataItem {
orderNumber: string
finished: boolean
}
const title = computed(() => {
if (['fastProduction', 'productionScan'].includes(props.fastKey)) {
return '快捷生产'
} else if (props.fastKey === 'fastReceipt') {
return props.dialogTitle
} else {
return '查看详情'
switch (props.fastKey) {
case 'fastProduction':
case 'productionScan':
return '快捷生产'
case 'fastReceipt':
return props.dialogTitle
case 'qualityScan':
return '快捷质检'
default:
return '查看详情'
}
})
const sureButtonText = computed(() => {
switch (props.fastKey) {
case 'fastProduction':
case 'productionScan':
return '生产完成'
case 'qualityScan':
return '质检通过'
default:
return '快捷入库'
}
})
export type FastProductionDetail = PodOrderRes & {
......@@ -354,6 +462,10 @@ const placeholderText = ref('')
const sendNum = ref(0)
const isDownloadImage = ref(false)
const isAutoSure = ref(true)
const printDevice = ref('')
const isPrint = ref(false)
const printList = ref<string[]>([])
const { getCLodop } = useLodop()
const emptyDetail = (): FastProductionDetail => ({
id: -1,
podJomallOrderCnId: -1,
......@@ -402,6 +514,7 @@ const props = withDefaults(
downloadApi?: (
ids: number[],
) => Promise<{ code?: number; message?: string }>
printApi?: (ids: number[]) => Promise<{ code?: number; message?: string }>
defaultAutoSure?: boolean
showOperationNoRow?: boolean
notFoundMessage?: string
......@@ -434,11 +547,14 @@ const props = withDefaults(
completeApi: (ids: number[], detailData: Record<string, unknown>) =>
productionQueryApi(ids[0], Number(detailData.podJomallOrderCnId || -1)),
downloadApi: (ids: number[]) => downloadMaterialApi(ids),
printApi: undefined,
dialogTitle: '',
},
)
const emit = defineEmits(['update:detailVisible', 'close', 'onSuccess'])
const qualityFailDialogRef = ref<InstanceType<typeof QualityFailDialog>>()
const historyKeyFromDetail = (d: FastProductionDetail): string => {
const raw = d as unknown as Record<string, unknown>
const op = raw.operationNo
......@@ -455,6 +571,12 @@ const operationNoDisplay = computed(() => {
return String(v)
})
const copy = (text: string) => {
if (!text) return
navigator.clipboard.writeText(text)
ElMessage.success('复制成功')
}
const parseImages = (value: unknown): cardImages[] => {
if (!value) return []
if (Array.isArray(value)) {
......@@ -525,9 +647,12 @@ watch(
const len = historyData.value
if (
len.length > 0 &&
['fastProduction', 'fastReceipt', 'productionScan'].includes(
props.fastKey,
)
[
'fastProduction',
'fastReceipt',
'productionScan',
'qualityScan',
].includes(props.fastKey)
) {
confirmQuery(len, 0)
}
......@@ -538,9 +663,47 @@ watch(
TrackingNumber.value = ''
isAutoSure.value = props.defaultAutoSure
sendNum.value = 0
if (props.fastKey === 'qualityScan') {
initPrintDevice()
}
}
},
)
const initPrintDevice = () => {
const lodop = getCLodop(null, null)
if (!lodop) {
printList.value = []
return
}
const arr: string[] = []
const length = lodop.GET_PRINTER_COUNT()
for (let i = 0; i < length; i++) {
const name = lodop.GET_PRINTER_NAME(i)
if (name) arr.push(name)
}
printList.value = arr
}
const getPrintData = async () => {
if (!detail.value || detail.value.id === -1 || !props.printApi) return
const res = await props.printApi([detail.value.id])
if (!res.message) return
print(filePath + res.message, printDevice.value)
}
const printPdf = () => {
if (!printDevice.value) return ElMessage.warning('请选择打印机')
if (!detail.value || detail.value.id === -1) {
return ElMessage.warning(props.pleaseScanTip)
}
getPrintData()
}
const handlePrinterChange = (value: string) => {
printDevice.value = value
if (!value) isPrint.value = false
}
watch(
() => props.detailData,
(newVal) => {
......@@ -557,12 +720,30 @@ watch(
)
const confirmQuery = (len: HistoryDataItem[], i: number) => {
const el = len[i]
const pendingText = (() => {
switch (props.fastKey) {
case 'fastProduction':
case 'productionScan':
return '未生产'
case 'qualityScan':
return '未质检'
default:
return '未入库'
}
})()
const successText = (() => {
switch (props.fastKey) {
case 'fastProduction':
case 'productionScan':
return '生产完成'
case 'qualityScan':
return '质检通过'
default:
return '入库完成'
}
})()
showConfirm(
`${props.pendingOrderLabel} ${el.orderNumber} ${
['fastProduction', 'productionScan'].includes(props.fastKey)
? '未生产'
: '未入库'
}完成,取消则不提醒?`,
`${props.pendingOrderLabel} ${el.orderNumber} ${pendingText}完成,取消则不提醒?`,
{
confirmButtonText: '确定',
cancelButtonText: '取消',
......@@ -573,13 +754,7 @@ const confirmQuery = (len: HistoryDataItem[], i: number) => {
TrackingNumber.value = el.orderNumber
await trackCodeInput()
await setData(el.orderNumber)
ElMessage.success(
`${
['fastProduction', 'productionScan'].includes(props.fastKey)
? '生产完成'
: '入库完成'
}`,
)
ElMessage.success(successText)
if (len[i + 1]) {
confirmQuery(len, i + 1)
}
......@@ -606,18 +781,22 @@ const changeStatus = async () => {
if (!detail.value || Object.keys(detail.value).length <= 1) {
return ElMessage.warning(props.pleaseScanTip)
}
showConfirm(
`确定${
['fastProduction', 'productionScan'].includes(props.fastKey)
? '生产完成'
: '入库完成'
}?`,
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
},
).then(() => {
const confirmText = (() => {
switch (props.fastKey) {
case 'fastProduction':
case 'productionScan':
return '生产完成'
case 'qualityScan':
return '质检通过'
default:
return '入库完成'
}
})()
showConfirm(`确定${confirmText}?`, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
setData(historyKeyFromDetail(detail.value))
})
}
......@@ -628,18 +807,31 @@ const setData = async (
if (!detail.value || detail.value?.id === -1) return
try {
const id = detail.value.id
const res = (await props.completeApi(
[id],
detail.value as unknown as Record<string, unknown>,
trigger,
)) as unknown as BaseRespData<
{
factoryOrderNumber?: number
id: number
message?: string
status?: boolean
}[]
>
if (props.fastKey === 'qualityScan') {
const res = await qualityPodOrderOperationApi({
updateParams: [{ id, version: detail.value.version }],
qualityIssues: '',
qualify_problem_type: '',
qualityPassed: true,
source: 1,
})
if (res.code !== 200) return
emit('onSuccess', [{ id, status: true }])
} else {
const res = (await props.completeApi(
[id],
detail.value as unknown as Record<string, unknown>,
trigger,
)) as unknown as BaseRespData<
{
factoryOrderNumber?: number
id: number
message?: string
status?: boolean
}[]
>
emit('onSuccess', res.data)
}
if (orderNumber) {
const index = historyData.value.findIndex(
(el: HistoryDataItem) => el.orderNumber === orderNumber,
......@@ -653,7 +845,6 @@ const setData = async (
)
}
}
emit('onSuccess', res.data)
playAudio('weight_success')
if (trigger === 'auto') {
......@@ -712,6 +903,41 @@ const handleDownload = () => {
}
download()
}
const handleQuality = (passed: boolean) => {
if (
!detail.value ||
Object.keys(detail.value).length <= 1 ||
detail.value.id == -1
) {
return ElMessage.warning(props.pleaseScanTip)
}
qualityFailDialogRef.value?.open(
[{ id: detail.value.id, version: detail.value.version }],
passed,
1,
)
}
const handleQualitySuccess = () => {
const orderNumber = historyKeyFromDetail(detail.value)
if (orderNumber) {
const index = historyData.value.findIndex(
(el: HistoryDataItem) => el.orderNumber === orderNumber,
)
if (index >= 0) {
historyData.value.splice(index, 1)
localStorage.setItem(
props.historyStorageKey,
JSON.stringify(historyData.value),
)
}
}
detail.value = emptyDetail()
TrackingNumber.value = ''
trackingNumberRef.value && trackingNumberRef.value.focus()
emit('onSuccess', [{ id: 0, status: true }])
}
const download = async () => {
if (detail.value && detail.value?.id != -1) {
try {
......@@ -776,20 +1002,6 @@ const trackCodeInput = async () => {
trackingNumberRef.value && trackingNumberRef.value.focus()
return
}
const item = historyData.value.find(
(el: HistoryDataItem) => el.orderNumber === TrackingNumber.value,
)
if (!item) {
// 记录扫单
historyData.value.push({
orderNumber: TrackingNumber.value,
finished: false,
})
localStorage.setItem(
props.historyStorageKey,
JSON.stringify(historyData.value),
)
}
const orderNumber = TrackingNumber.value
......@@ -834,10 +1046,6 @@ const trackCodeInput = async () => {
}
}
if (isDownloadImage.value) {
download()
}
// 工厂订单new 校验库存 生产扫码
if (props.fastKey === 'productionScan') {
try {
......@@ -874,6 +1082,32 @@ const trackCodeInput = async () => {
}
throw inventoryErr
}
}
// 查询成功后再写入缓存
const item = historyData.value.find(
(el: HistoryDataItem) => el.orderNumber === orderNumber,
)
if (!item) {
historyData.value.push({
orderNumber,
finished: false,
})
localStorage.setItem(
props.historyStorageKey,
JSON.stringify(historyData.value),
)
}
if (isDownloadImage.value) {
download()
}
if (props.fastKey === 'qualityScan' && printDevice.value && isPrint.value) {
await getPrintData()
}
if (props.fastKey === 'productionScan') {
await setData(detail.value.id.toString(), 'auto')
}
playAudio('weight_search_success')
......@@ -889,12 +1123,12 @@ const trackCodeInput = async () => {
const onOpened = () => {
trackingNumberRef.value && trackingNumberRef.value.focus()
}
function setProductMark(productMark: string) {
if (!productMark) return ''
if (productMark === 'custom_normal') return 'CB'
if (productMark === 'normal') return 'G'
return ''
}
// function setProductMark(productMark: string) {
// if (!productMark) return ''
// if (productMark === 'custom_normal') return 'CB'
// if (productMark === 'normal') return 'G'
// return ''
// }
</script>
<style lang="scss" scoped>
.detail-div {
......@@ -913,6 +1147,8 @@ function setProductMark(productMark: string) {
height: 100%;
display: flex;
flex-direction: column;
gap: 30px;
padding: 30px 0;
.btn {
margin: 20px 0;
......@@ -970,6 +1206,27 @@ function setProductMark(productMark: string) {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
&.with-copy {
display: flex;
align-items: center;
min-width: 0;
}
.div-item-value-text {
flex: 1;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.copy-icon {
flex-shrink: 0;
margin-left: 6px;
cursor: pointer;
color: #909399;
}
}
}
}
......@@ -989,7 +1246,6 @@ function setProductMark(productMark: string) {
.input {
display: flex;
align-items: center;
margin: 30px 0;
}
}
......@@ -1046,10 +1302,13 @@ function setProductMark(productMark: string) {
.btn {
position: relative;
:deep(.el-button) {
span {
position: relative;
left: -30px;
.btn-sure,
.btn-down {
&:has(.check) {
:deep(.el-button span) {
position: relative;
left: -30px;
}
}
}
......
......@@ -68,6 +68,7 @@ const emit = defineEmits<{
const visible = ref(false)
const submitLoading = ref(false)
const qualityPassed = ref(true)
const source = ref(0) // 0 列表页,1 快捷质检
const formRef = ref<FormInstance>()
const updateParams = ref<{ id: number; version?: number }[]>([])
const reasonOptions = ref<QualityTypeItem[]>([])
......@@ -110,13 +111,17 @@ const handleReasonChange = () => {
formRef.value?.clearValidate('qualify_problem_type')
}
/** qualityPassed: true 质检通过,false 质检不通过 */
const open = (rows: { id: number; version?: number }[], passed: boolean) => {
const open = (
rows: { id: number; version?: number }[],
passed: boolean,
sourceType: number = 0,
) => {
updateParams.value = rows.map((row) => ({
id: row.id,
version: row.version,
}))
qualityPassed.value = passed
source.value = sourceType
form.reasonKey = undefined
form.qualify_problem_type = ''
visible.value = true
......@@ -147,10 +152,13 @@ const handleSubmit = async () => {
? form.qualify_problem_type
: (form.reasonKey as number | string),
qualityPassed: qualityPassed.value,
source: source.value,
}
const res = await qualityPodOrderOperationApi(params)
if (res.code !== 200) return
ElMessage.success('操作成功')
if (source.value !== 1) {
ElMessage.success('操作成功')
}
visible.value = false
emit('success')
} catch (e) {
......
......@@ -638,7 +638,9 @@
>
</span>
<span v-if="['IN_PRODUCTION'].includes(status)" class="item">
<ElButton type="success" @click="handleQuickProduction()"
<ElButton
type="success"
@click="handleQuickProduction('productionScan')"
>快捷生产</ElButton
>
</span>
......@@ -765,7 +767,12 @@
</span>
<!-- 待质检 -->
<span v-if="status === 'PENDING_QUALITY'" class="item">
<ElButton type="primary" @click="() => {}"> 快捷质检 </ElButton>
<ElButton
type="primary"
@click="handleQuickProduction('qualityScan')"
>
快捷质检
</ElButton>
</span>
<span v-if="status === 'PENDING_QUALITY'" class="item">
<ElButton type="success" @click="handleQuality(true)">
......@@ -1147,11 +1154,16 @@
pending-order-label="操作单号"
please-scan-tip="请扫码操作单号"
search-input-audio-tip="请录入操作单号"
history-storage-key="historyFactoryOrderNewData"
:history-storage-key="
fastKey === 'qualityScan'
? 'historyFactoryOrderNewQualityData'
: 'historyFactoryOrderNewData'
"
tracking-placeholder="扫描枪输入操作单号"
:query-api="getOperationByNo"
:complete-api="completeOperationById"
:download-api="downloadOperationById"
:print-api="printOperationById"
@on-success="handleFastProductionSuccess"
@close="fastClose"
/>
......@@ -1371,6 +1383,7 @@ import {
completeDeliveryApi,
productionScanApi,
getByOperationNoLogApi,
getQualityScanByOperationNoApi,
listByNoPodOrderApi,
orderWeighingPodOrderApi,
finishShipmentPodOrderApi,
......@@ -2638,7 +2651,6 @@ const suspendDialogRef = ref<InstanceType<typeof SuspendDialog>>()
const pickCompleteDialogRef = ref<InstanceType<typeof PickCompleteDialog>>()
const pickFailDialogRef = ref<InstanceType<typeof PickFailDialog>>()
const qualityFailDialogRef = ref<InstanceType<typeof QualityFailDialog>>()
const fastQualifyRef = ref<InstanceType<typeof FastQualify>>()
const operateDetailsDialogRef = ref()
const arrangeDialogRef = ref<InstanceType<typeof ArrangeDialog>>()
const createLogisticDialogRef = ref()
......@@ -3515,7 +3527,9 @@ const handleReplenishFail = () => {
})
}
const getOperationByNo = (operationNo: string) =>
getByOperationNoLogApi(operationNo) as Promise<{ data?: unknown }>
(fastKey.value === 'qualityScan'
? getQualityScanByOperationNoApi(operationNo)
: getByOperationNoLogApi(operationNo)) as Promise<{ data?: unknown }>
const completeOperationById = (
ids: number[],
detailData?: Record<string, unknown>,
......@@ -3530,8 +3544,13 @@ const completeOperationById = (
const downloadOperationById = (ids: number[]) =>
downloadOperationMaterialApi(ids)
const printOperationById = (ids: number[]) =>
printNewPodOrderProductionOrderApi(ids) as Promise<{
code?: number
message?: string
}>
const handleFastProductionSuccess = (data: ResultInfoDataItem[]) => {
if (fastKey.value === 'productionScan') {
if (fastKey.value === 'productionScan' || fastKey.value === 'qualityScan') {
ElMessage.success('操作成功')
return
}
......@@ -3584,11 +3603,11 @@ const handleViewDetail = async (item: operateOrderListData) => {
}
}
const isLimitScan = ref(false)
const handleQuickProduction = () => {
detailVisible.value = true
fastKey.value = 'productionScan'
const handleQuickProduction = (key: string) => {
fastKey.value = key
isLimitScan.value = true
detailData.value = {}
detailVisible.value = true
}
const handleSinglePrint = () => {
podDistributionOrderVisible.value = true
......@@ -3696,12 +3715,9 @@ const handleGetOrderInventoryDetail = async () => {
const handleQuality = (qualityPassed: boolean) => {
if (!ensureSelection()) return
const rows = isCardLayout.value ? cardSelectList.value : selectedRows.value
qualityFailDialogRef.value?.open(rows, qualityPassed)
qualityFailDialogRef.value?.open(rows, qualityPassed, 0)
}
const handleFastQualify = () => {
fastQualifyRef.value?.open()
}
const isEnableSorting = ref(false)
// 获取功能开关
const getFunctionSwitch = async () => {
......
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