|
|
@ -55,6 +55,7 @@ |
|
|
|
:apiCreate="Q2Api.createQ2" |
|
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
|
:isBusiness="false" |
|
|
|
@onChange="onChange" |
|
|
|
/> |
|
|
|
|
|
|
|
<!-- 详情 --> |
|
|
@ -77,7 +78,11 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
|
import TableHead from '@/components/TableHead/src/TableHead.vue' |
|
|
|
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' |
|
|
|
import Detail from '@/components/Detail/src/Detail.vue' |
|
|
|
import * as StdcostpriceApi from '@/api/wms/stdcostprice' |
|
|
|
import { formatDate } from '@/utils/formatTime' |
|
|
|
import * as SupplieritemApi from '@/api/wms/supplieritem' |
|
|
|
import * as SupplierApi from '@/api/wms/supplier' |
|
|
|
import * as ItembasicApi from '@/api/wms/itembasic' |
|
|
|
|
|
|
|
import { useUserStore } from '@/store/modules/user' |
|
|
|
const userStore = useUserStore() |
|
|
@ -93,37 +98,126 @@ routeName.value = route.name |
|
|
|
const tableColumns = ref(Q2.allSchemas.tableColumns) |
|
|
|
|
|
|
|
// 查询页面返回 |
|
|
|
const priceObj = ref() |
|
|
|
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
|
|
nextTick(() => { |
|
|
|
nextTick(async () => { |
|
|
|
const setV = {} |
|
|
|
if (formField == 'supplierCode') { |
|
|
|
setV['itemCode'] = '' |
|
|
|
const supplierParams = { |
|
|
|
by: 'ASC', |
|
|
|
filters: [{ column: 'code', action: '==', value: val[0].supplierCode }], |
|
|
|
pageNo: 1, |
|
|
|
pageSize: 500, |
|
|
|
sort: '' |
|
|
|
} |
|
|
|
supplierParams.isSearch = true |
|
|
|
SupplierApi.getSupplierPage(supplierParams).then((res) => { |
|
|
|
if (res.list?.length > 0) { |
|
|
|
formRef.setValues({ |
|
|
|
supplierName: res.list[0].name |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
if (formField == 'itemCode') { |
|
|
|
setV['uom'] = val[0]['supplierUom'] |
|
|
|
} |
|
|
|
// if (formField == 'q1Number') { |
|
|
|
// console.log(123) |
|
|
|
// setV['q1Number'] = val[0]['number'] |
|
|
|
// } |
|
|
|
if (formField == 'purchaseReceiptNumber') { |
|
|
|
setV['wmsQty'] = val[0]['qty'] |
|
|
|
} |
|
|
|
if (formField == 'q1Number') { |
|
|
|
//Q1通知单号 |
|
|
|
let list = [] |
|
|
|
val.forEach((item) => { |
|
|
|
list.push(item[searchField]) |
|
|
|
setV['SupplierCode'] = '' |
|
|
|
setV['SupplierName'] = '' |
|
|
|
setV['itemName'] = '' |
|
|
|
setV['standardCostPrice'] = '' |
|
|
|
setV['qty'] = '' |
|
|
|
setV['claimAmount'] = '' |
|
|
|
|
|
|
|
setV['uom'] = val[0].supplierUom |
|
|
|
const supplieritemParams = { |
|
|
|
by: 'ASC', |
|
|
|
filters: [{ column: 'itemCode', action: '==', value: val[0].itemCode}], |
|
|
|
pageNo: 1, |
|
|
|
pageSize: 500, |
|
|
|
sort: '' |
|
|
|
} |
|
|
|
supplieritemParams.isSearch = true |
|
|
|
SupplieritemApi.getSupplieritemPage(supplieritemParams).then((res) => { |
|
|
|
if (res.list?.length > 0) { |
|
|
|
formRef.formModel.supplierCode = res.list[0].supplierCode |
|
|
|
formRef.formModel.supplierName = res.list[0].supplierName |
|
|
|
Q2.allSchemas.formSchema.forEach((item) => { |
|
|
|
if (item.field == 'supplierCode') { |
|
|
|
item.componentProps.options = res.list |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
const itembasicParams = { |
|
|
|
by: 'ASC', |
|
|
|
filters: [{ column: 'code', action: '==', value: val[0].itemCode }], |
|
|
|
pageNo: 1, |
|
|
|
pageSize: 500, |
|
|
|
sort: '' |
|
|
|
} |
|
|
|
itembasicParams.isSearch = true |
|
|
|
ItembasicApi.getItembasicPage(itembasicParams).then((res) => { |
|
|
|
if (res.list?.length > 0) { |
|
|
|
formRef.setValues({ |
|
|
|
itemName: res.list[0].name |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
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] = list.join(',') |
|
|
|
formRef.setValues(setV) |
|
|
|
} else { |
|
|
|
setV[formField] = val[0][searchField] |
|
|
|
formRef.setValues(setV) |
|
|
|
} |
|
|
|
setV[formField] = val[0][searchField] |
|
|
|
formRef.setValues(setV) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
const onChange = (field, e) => { |
|
|
|
if (field == 'qty') { |
|
|
|
basicFormRef.value.formRef.formModel.claimAmount = ( |
|
|
|
parseFloat(basicFormRef.value.formRef.formModel.qty) * parseFloat(basicFormRef.value.formRef.formModel.standardCostPrice) |
|
|
|
).toFixed(6) |
|
|
|
basicFormRef.value.formRef.formModel.summaryAmount = ( |
|
|
|
parseFloat(basicFormRef.value.formRef.formModel.claimAmount) + parseFloat(basicFormRef.value.formRef.formModel.otherclaimAmount) |
|
|
|
).toFixed(6) |
|
|
|
} |
|
|
|
if (field == 'otherclaimAmount') { |
|
|
|
basicFormRef.value.formRef.formModel.summaryAmount = ( |
|
|
|
parseFloat(basicFormRef.value.formRef.formModel.claimAmount) + parseFloat(basicFormRef.value.formRef.formModel.otherclaimAmount) |
|
|
|
|
|
|
|
).toFixed(6) |
|
|
|
} |
|
|
|
if (field == 'supplierCode') { |
|
|
|
basicFormRef.value.formRef.formModel.supplierName = '' |
|
|
|
const paramsCustomer = { |
|
|
|
by: 'ASC', |
|
|
|
filters: [{ column: 'code', action: '==', value: basicFormRef.value.formRef.formModel.supplierCode }], |
|
|
|
pageNo: 1, |
|
|
|
pageSize: 500, |
|
|
|
sort: '' |
|
|
|
} |
|
|
|
paramsCustomer.isSearch = true |
|
|
|
SupplierApi.getSupplierPage(paramsCustomer).then((res) => { |
|
|
|
if (res.list?.length > 0) { |
|
|
|
basicFormRef.value.formRef.formModel.supplierName = res.list[0].name |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 字段设置 更新主列表字段 |
|
|
|
const updataTableColumns = (val) => { |
|
|
|
tableColumns.value = val |
|
|
|