|
|
@ -85,8 +85,6 @@ import * as SupplierApi from '@/api/wms/supplier' |
|
|
|
import * as ItembasicApi from '@/api/wms/itembasic' |
|
|
|
|
|
|
|
import { useUserStore } from '@/store/modules/user' |
|
|
|
import { usePageLoading } from '@/hooks/web/usePageLoading' |
|
|
|
const { loadStart, loadDone } = usePageLoading() |
|
|
|
const userStore = useUserStore() |
|
|
|
|
|
|
|
defineOptions({ name: 'InspectionQ2' }) |
|
|
@ -121,6 +119,8 @@ const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
setV[formField] = val[0][searchField] |
|
|
|
formRef.setValues(setV) |
|
|
|
} |
|
|
|
|
|
|
|
if (formField == 'purchaseReceiptNumber') { |
|
|
@ -131,12 +131,21 @@ const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
|
|
if (result.endsWith(',')) { |
|
|
|
result = result.substring(0, result.length - 1) |
|
|
|
} |
|
|
|
setV['purchaseReceiptNumber'] = '123' |
|
|
|
setV['purchaseReceiptNumber'] = result |
|
|
|
formRef.setValues(setV) |
|
|
|
} |
|
|
|
|
|
|
|
if (formField == 'lightItemCode') { |
|
|
|
setV['lightItemCode'] = val[0].code |
|
|
|
setV['lightItemName'] = val[0].name |
|
|
|
setV[formField] = val[0][searchField] |
|
|
|
formRef.setValues(setV) |
|
|
|
} |
|
|
|
|
|
|
|
if (formField == 'costCode') { |
|
|
|
setV['costCode'] = val[0].costcentreCode |
|
|
|
setV[formField] = val[0][searchField] |
|
|
|
formRef.setValues(setV) |
|
|
|
} |
|
|
|
|
|
|
|
if (formField == 'itemCode') { |
|
|
@ -213,9 +222,10 @@ const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
setV[formField] = val[0][searchField] |
|
|
|
formRef.setValues(setV) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
@ -230,7 +240,10 @@ const onChange = (field, e) => { |
|
|
|
parseFloat(basicFormRef.value.formRef.formModel.claimAmount) + |
|
|
|
parseFloat(basicFormRef.value.formRef.formModel.otherclaimAmount) |
|
|
|
).toFixed(6) |
|
|
|
|
|
|
|
basicFormRef.value.formRef.formModel.remainingAmount = ( |
|
|
|
parseFloat(basicFormRef.value.formRef.formModel.summaryAmount) - |
|
|
|
parseFloat(basicFormRef.value.formRef.formModel.disbursementAmount) |
|
|
|
).toFixed(6) |
|
|
|
} |
|
|
|
if (field == 'claimMultiple') { |
|
|
|
basicFormRef.value.formRef.formModel.claimAmount = ( |
|
|
@ -242,12 +255,20 @@ const onChange = (field, e) => { |
|
|
|
parseFloat(basicFormRef.value.formRef.formModel.claimAmount) + |
|
|
|
parseFloat(basicFormRef.value.formRef.formModel.otherclaimAmount) |
|
|
|
).toFixed(6) |
|
|
|
basicFormRef.value.formRef.formModel.remainingAmount = ( |
|
|
|
parseFloat(basicFormRef.value.formRef.formModel.summaryAmount) - |
|
|
|
parseFloat(basicFormRef.value.formRef.formModel.disbursementAmount) |
|
|
|
).toFixed(6) |
|
|
|
} |
|
|
|
if (field == 'otherclaimAmount') { |
|
|
|
basicFormRef.value.formRef.formModel.summaryAmount = ( |
|
|
|
parseFloat(basicFormRef.value.formRef.formModel.claimAmount) + |
|
|
|
parseFloat(basicFormRef.value.formRef.formModel.otherclaimAmount) |
|
|
|
).toFixed(6) |
|
|
|
basicFormRef.value.formRef.formModel.remainingAmount = ( |
|
|
|
parseFloat(basicFormRef.value.formRef.formModel.summaryAmount) - |
|
|
|
parseFloat(basicFormRef.value.formRef.formModel.disbursementAmount) |
|
|
|
).toFixed(6) |
|
|
|
} |
|
|
|
if (field == 'claimAmount') { |
|
|
|
basicFormRef.value.formRef.formModel.summaryAmount = ( |
|
|
@ -416,18 +437,10 @@ const formsSuccess = async (formType, data) => { |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
if (data.lightQty > data.wmsQty) { |
|
|
|
message.error('数量不能大于记录中的收货数量') |
|
|
|
return |
|
|
|
} |
|
|
|
if (data.lightQty == 0) { |
|
|
|
message.error('数量不能为0') |
|
|
|
return |
|
|
|
} |
|
|
|
if (data.claimAmount == 0) { |
|
|
|
message.error('索赔金额不能为0') |
|
|
|
return |
|
|
|
} |
|
|
|
if (data.activeTime == 0) data.activeTime = null |
|
|
|
if (data.expireTime == 0) data.expireTime = null |
|
|
|
|
|
|
@ -468,18 +481,19 @@ const handleDelete = async (id: number) => { |
|
|
|
} |
|
|
|
|
|
|
|
/** 导出按钮操作 */ |
|
|
|
const exportLoading = ref(false) // 导出的加载中 |
|
|
|
const handleExport = async () => { |
|
|
|
try { |
|
|
|
// 导出的二次确认 |
|
|
|
await message.exportConfirm() |
|
|
|
// 发起导出 |
|
|
|
loadStart() |
|
|
|
exportLoading.value = true |
|
|
|
const excelTitle = ref(route.meta.title) |
|
|
|
const data = await Q2Api.exportQ2(tableObject.params) |
|
|
|
download.excel(data, `【${excelTitle.value}】【${formatDate(new Date())}】.xlsx`) |
|
|
|
} catch { |
|
|
|
} finally { |
|
|
|
loadDone() |
|
|
|
exportLoading.value = false |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|