|
|
@ -63,16 +63,25 @@ |
|
|
|
:apiUpdate="Q2Api.updateQ2" |
|
|
|
:apiCreate="Q2Api.createQ2" |
|
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
|
@clearSearchInput="clearSearchInput" |
|
|
|
:isBusiness="false" |
|
|
|
@onChange="onChange" |
|
|
|
> |
|
|
|
<template #searchQuerypurchaseReceiptNumber> |
|
|
|
<el-form :inline="true"> |
|
|
|
<el-form-item label="供应商物料代码"> |
|
|
|
<el-input v-model="basicFormRef.formRef.formModel.itemCode" placeholder="请输入供应商" disabled></el-input> |
|
|
|
<el-input |
|
|
|
v-model="basicFormRef.formRef.formModel.itemCode" |
|
|
|
placeholder="请输入供应商" |
|
|
|
disabled |
|
|
|
></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="供应商代码"> |
|
|
|
<el-input v-model="basicFormRef.formRef.formModel.supplierCode" placeholder="请输入物料号" disabled></el-input> |
|
|
|
<el-input |
|
|
|
v-model="basicFormRef.formRef.formModel.supplierCode" |
|
|
|
placeholder="请输入物料号" |
|
|
|
disabled |
|
|
|
></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</template> |
|
|
@ -105,6 +114,7 @@ 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' |
|
|
|
import { log } from 'console' |
|
|
|
const { loadStart, loadDone } = usePageLoading() |
|
|
|
const userStore = useUserStore() |
|
|
|
|
|
|
@ -117,7 +127,42 @@ const route = useRoute() // 路由信息 |
|
|
|
const routeName = ref() |
|
|
|
routeName.value = route.name |
|
|
|
const tableColumns = ref(Q2.allSchemas.tableColumns) |
|
|
|
|
|
|
|
const clearSearchInput = (formField) => { |
|
|
|
if (formField == 'itemCode') { |
|
|
|
basicFormRef.value.formRef.setValues({ |
|
|
|
itemName: '', |
|
|
|
SupplierCode: '', |
|
|
|
SupplierName: '' |
|
|
|
}) |
|
|
|
} |
|
|
|
if (formField == 'lightItemCode') { |
|
|
|
basicFormRef.value.formRef.setValues({ |
|
|
|
standardCostPrice: '', |
|
|
|
lightQty: 0, |
|
|
|
claimAmount: '', |
|
|
|
otherClaimAmount: 0, |
|
|
|
summaryAmount: 0, |
|
|
|
disbursementAmount: 0, |
|
|
|
remainingAmount: 0 |
|
|
|
}) |
|
|
|
const params2 = { |
|
|
|
by: 'ASC', |
|
|
|
filters: [{ column: 'itemCode', action: '==', value: basicFormRef.value.formRef.formModel.itemCode }], |
|
|
|
pageNo: 1, |
|
|
|
pageSize: 500, |
|
|
|
sort: '' |
|
|
|
} |
|
|
|
params2.isSearch = true |
|
|
|
StdcostpriceApi.getStdcostpricePage(params2).then((res) => { |
|
|
|
if (res.list?.length > 0) { |
|
|
|
priceObj.value = res.list[0] |
|
|
|
basicFormRef.value.formRef.setValues({ |
|
|
|
standardCostPrice: priceObj.value.price |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
// 查询页面返回 |
|
|
|
const priceObj = ref() |
|
|
|
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
|
@ -147,7 +192,7 @@ const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
|
|
if (formField == 'purchaseReceiptNumber') { |
|
|
|
let result = '' |
|
|
|
for (var i = 0; i < val.length; i++) { |
|
|
|
result += val[i].number + ',' |
|
|
|
result += val[i].receiptNumber + ',' |
|
|
|
} |
|
|
|
if (result.endsWith(',')) { |
|
|
|
result = result.substring(0, result.length - 1) |
|
|
@ -248,6 +293,32 @@ const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
if (val[0].lightItemCode == null) { |
|
|
|
setV['standardCostPrice'] = '' |
|
|
|
setV['lightQty'] = 0 |
|
|
|
setV['claimAmount'] = '' |
|
|
|
setV['otherClaimAmount'] = 0 |
|
|
|
setV['summaryAmount'] = 0 |
|
|
|
setV['disbursementAmount'] = 0 |
|
|
|
setV['remainingAmount'] = 0 |
|
|
|
const params2 = { |
|
|
|
by: 'ASC', |
|
|
|
filters: [{ column: 'itemCode', action: '==', value: val[0].itemCode }], |
|
|
|
pageNo: 1, |
|
|
|
pageSize: 500, |
|
|
|
sort: '' |
|
|
|
} |
|
|
|
params2.isSearch = true |
|
|
|
StdcostpriceApi.getStdcostpricePage(params2).then((res) => { |
|
|
|
if (res.list?.length > 0) { |
|
|
|
priceObj.value = res.list[0] |
|
|
|
formRef.setValues({ |
|
|
|
standardCostPrice: priceObj.value.price |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
setV[formField] = val[0][searchField] |
|
|
|
formRef.setValues(setV) |
|
|
|
} |
|
|
@ -255,8 +326,6 @@ const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
|
|
} |
|
|
|
|
|
|
|
const onChange = (field, e) => { |
|
|
|
console.log('onChange',field) |
|
|
|
console.log(basicFormRef.value.formRef.formModel) |
|
|
|
if (field == 'lightQty') { |
|
|
|
basicFormRef.value.formRef.formModel.claimAmount = ( |
|
|
|
parseFloat(basicFormRef.value.formRef.formModel.lightQty) * |
|
|
@ -265,7 +334,7 @@ const onChange = (field, e) => { |
|
|
|
).toFixed(6) |
|
|
|
basicFormRef.value.formRef.formModel.summaryAmount = ( |
|
|
|
parseFloat(basicFormRef.value.formRef.formModel.claimAmount) + |
|
|
|
parseFloat(basicFormRef.value.formRef.formModel.otherClaimAmount||0) |
|
|
|
parseFloat(basicFormRef.value.formRef.formModel.otherClaimAmount || 0) |
|
|
|
).toFixed(6) |
|
|
|
basicFormRef.value.formRef.formModel.remainingAmount = ( |
|
|
|
parseFloat(basicFormRef.value.formRef.formModel.summaryAmount) - |
|
|
@ -454,7 +523,7 @@ const openForm = (type: string, row?: any) => { |
|
|
|
} |
|
|
|
|
|
|
|
basicFormRef.value.open(type, row) |
|
|
|
if(!row || !row.claimAmount){ |
|
|
|
if (!row || !row.claimAmount) { |
|
|
|
nextTick(() => { |
|
|
|
basicFormRef.value.formRef.setValues({ |
|
|
|
claimAmount: '' |
|
|
@ -472,9 +541,7 @@ const openForm = (type: string, row?: any) => { |
|
|
|
}) |
|
|
|
const currentTime = new Date().getTime() |
|
|
|
const fileId = Q2.allSchemas.formSchema.find((item) => item.field == 'fileId') |
|
|
|
const uploadFile = Q2.allSchemas.formSchema.find( |
|
|
|
(item) => item.field == 'claimAddress' |
|
|
|
) |
|
|
|
const uploadFile = Q2.allSchemas.formSchema.find((item) => item.field == 'claimAddress') |
|
|
|
if (fileId) { |
|
|
|
fileId['value'] = currentTime |
|
|
|
} |
|
|
@ -482,11 +549,8 @@ const openForm = (type: string, row?: any) => { |
|
|
|
uploadFile['componentProps']['upData']['tableId'] = currentTime |
|
|
|
uploadFile['componentProps']['modelValue'] = [] |
|
|
|
} |
|
|
|
} |
|
|
|
else if (type == 'update') { |
|
|
|
const uploadFile = Q2.allSchemas.formSchema.find( |
|
|
|
(item) => item.field == 'claimAddress' |
|
|
|
) |
|
|
|
} else if (type == 'update') { |
|
|
|
const uploadFile = Q2.allSchemas.formSchema.find((item) => item.field == 'claimAddress') |
|
|
|
uploadFile['componentProps']['modelValue'] = row.filePathListView |
|
|
|
} |
|
|
|
} |
|
|
@ -503,10 +567,10 @@ const formsSuccess = async (formType, data) => { |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
if (data.lightQty == 0) { |
|
|
|
message.error('整灯数量不能为0') |
|
|
|
return |
|
|
|
} |
|
|
|
// if (data.lightQty == 0) { |
|
|
|
// message.error('数量不能为0') |
|
|
|
// return |
|
|
|
// } |
|
|
|
if (!data.standardCostPrice) { |
|
|
|
message.error('标准成本价格不能为0或空') |
|
|
|
return |
|
|
|