|
@ -55,6 +55,7 @@ |
|
|
:apiCreate="Q2Api.createQ2" |
|
|
:apiCreate="Q2Api.createQ2" |
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
:isBusiness="false" |
|
|
:isBusiness="false" |
|
|
|
|
|
@onChange="onChange" |
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
<!-- 详情 --> |
|
|
<!-- 详情 --> |
|
@ -77,7 +78,11 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
import TableHead from '@/components/TableHead/src/TableHead.vue' |
|
|
import TableHead from '@/components/TableHead/src/TableHead.vue' |
|
|
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' |
|
|
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' |
|
|
import Detail from '@/components/Detail/src/Detail.vue' |
|
|
import Detail from '@/components/Detail/src/Detail.vue' |
|
|
|
|
|
import * as StdcostpriceApi from '@/api/wms/stdcostprice' |
|
|
import { formatDate } from '@/utils/formatTime' |
|
|
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' |
|
|
import { useUserStore } from '@/store/modules/user' |
|
|
const userStore = useUserStore() |
|
|
const userStore = useUserStore() |
|
@ -93,36 +98,125 @@ routeName.value = route.name |
|
|
const tableColumns = ref(Q2.allSchemas.tableColumns) |
|
|
const tableColumns = ref(Q2.allSchemas.tableColumns) |
|
|
|
|
|
|
|
|
// 查询页面返回 |
|
|
// 查询页面返回 |
|
|
|
|
|
const priceObj = ref() |
|
|
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
|
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
|
nextTick(() => { |
|
|
nextTick(async () => { |
|
|
const setV = {} |
|
|
const setV = {} |
|
|
if (formField == 'supplierCode') { |
|
|
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') { |
|
|
if (formField == 'itemCode') { |
|
|
setV['uom'] = val[0]['supplierUom'] |
|
|
setV['SupplierCode'] = '' |
|
|
} |
|
|
setV['SupplierName'] = '' |
|
|
// if (formField == 'q1Number') { |
|
|
setV['itemName'] = '' |
|
|
// console.log(123) |
|
|
setV['standardCostPrice'] = '' |
|
|
// setV['q1Number'] = val[0]['number'] |
|
|
setV['qty'] = '' |
|
|
// } |
|
|
setV['claimAmount'] = '' |
|
|
if (formField == 'purchaseReceiptNumber') { |
|
|
|
|
|
setV['wmsQty'] = val[0]['qty'] |
|
|
setV['uom'] = val[0].supplierUom |
|
|
} |
|
|
const supplieritemParams = { |
|
|
if (formField == 'q1Number') { |
|
|
by: 'ASC', |
|
|
//Q1通知单号 |
|
|
filters: [{ column: 'itemCode', action: '==', value: val[0].itemCode}], |
|
|
let list = [] |
|
|
pageNo: 1, |
|
|
val.forEach((item) => { |
|
|
pageSize: 500, |
|
|
list.push(item[searchField]) |
|
|
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 |
|
|
|
|
|
} |
|
|
}) |
|
|
}) |
|
|
setV[formField] = list.join(',') |
|
|
} |
|
|
formRef.setValues(setV) |
|
|
}) |
|
|
} else { |
|
|
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] = val[0][searchField] |
|
|
setV[formField] = val[0][searchField] |
|
|
formRef.setValues(setV) |
|
|
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) => { |
|
|
const updataTableColumns = (val) => { |
|
|