|
|
@ -108,6 +108,7 @@ 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 * as SalepriceApi from '@/api/wms/saleprice' |
|
|
|
import { formatDate } from '@/utils/formatTime' |
|
|
|
import * as SupplieritemApi from '@/api/wms/supplieritem' |
|
|
|
import * as SupplierApi from '@/api/wms/supplier' |
|
|
@ -140,10 +141,67 @@ const clearSearchInput = (formField) => { |
|
|
|
item.componentProps.options = [] |
|
|
|
} |
|
|
|
}) |
|
|
|
if (basicFormRef.value.formRef.formModel.lightItemCode) { |
|
|
|
basicFormRef.value.formRef.setValues({ |
|
|
|
lightQty: 0, |
|
|
|
claimAmount: '', |
|
|
|
otherClaimAmount: 0, |
|
|
|
summaryAmount: 0, |
|
|
|
disbursementAmount: 0, |
|
|
|
remainingAmount: 0 |
|
|
|
}) |
|
|
|
|
|
|
|
const params2 = { |
|
|
|
by: 'ASC', |
|
|
|
filters: [ |
|
|
|
{ |
|
|
|
column: 'itemCode', |
|
|
|
action: '==', |
|
|
|
value: basicFormRef.value.formRef.formModel.lightItemCode |
|
|
|
}, |
|
|
|
{ |
|
|
|
column: 'available', |
|
|
|
action: '==', |
|
|
|
value: 'TRUE' |
|
|
|
} |
|
|
|
], |
|
|
|
pageNo: 1, |
|
|
|
pageSize: 500, |
|
|
|
sort: '' |
|
|
|
} |
|
|
|
params2.isSearch = true |
|
|
|
SalepriceApi.getSalepricePage(params2).then((res) => { |
|
|
|
if (res.list?.length > 0) { |
|
|
|
priceObj.value = res.list[0] |
|
|
|
|
|
|
|
basicFormRef.value.formRef.setValues({ |
|
|
|
standardCostPrice: priceObj.value.price |
|
|
|
}) |
|
|
|
} else { |
|
|
|
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 |
|
|
|
}) |
|
|
|
} else { |
|
|
|
basicFormRef.value.formRef.setValues({ |
|
|
|
standardCostPrice: 0 |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
basicFormRef.value.formRef.setValues({ |
|
|
|
standardCostPrice: '' |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
if (formField == 'lightItemCode') { |
|
|
|
basicFormRef.value.formRef.setValues({ |
|
|
|
standardCostPrice: '', |
|
|
|
lightItemName: '', |
|
|
|
lightQty: 0, |
|
|
|
claimAmount: '', |
|
|
@ -152,24 +210,56 @@ const clearSearchInput = (formField) => { |
|
|
|
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 |
|
|
|
}) |
|
|
|
|
|
|
|
if (basicFormRef.value.formRef.formModel.itemCode) { |
|
|
|
const params2 = { |
|
|
|
by: 'ASC', |
|
|
|
filters: [ |
|
|
|
{ |
|
|
|
column: 'itemCode', |
|
|
|
action: '==', |
|
|
|
value: basicFormRef.value.formRef.formModel.itemCode |
|
|
|
}, |
|
|
|
{ |
|
|
|
column: 'available', |
|
|
|
action: '==', |
|
|
|
value: 'TRUE' |
|
|
|
} |
|
|
|
], |
|
|
|
pageNo: 1, |
|
|
|
pageSize: 500, |
|
|
|
sort: '' |
|
|
|
} |
|
|
|
}) |
|
|
|
params2.isSearch = true |
|
|
|
SalepriceApi.getSalepricePage(params2).then((res) => { |
|
|
|
if (res.list?.length > 0) { |
|
|
|
priceObj.value = res.list[0] |
|
|
|
|
|
|
|
basicFormRef.value.formRef.setValues({ |
|
|
|
standardCostPrice: priceObj.value.price |
|
|
|
}) |
|
|
|
} else { |
|
|
|
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 |
|
|
|
}) |
|
|
|
} else { |
|
|
|
basicFormRef.value.formRef.setValues({ |
|
|
|
standardCostPrice: 0 |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
basicFormRef.value.formRef.setValues({ |
|
|
|
standardCostPrice: '' |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// 查询页面返回 |
|
|
@ -181,7 +271,14 @@ const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
|
|
setV['purchaseReceiptNumber'] = '' |
|
|
|
const supplierParams = { |
|
|
|
by: 'ASC', |
|
|
|
filters: [{ column: 'code', action: '==', value: val[0].supplierCode }], |
|
|
|
filters: [ |
|
|
|
{ column: 'code', action: '==', value: val[0].supplierCode }, |
|
|
|
{ |
|
|
|
column: 'available', |
|
|
|
action: '==', |
|
|
|
value: 'TRUE' |
|
|
|
} |
|
|
|
], |
|
|
|
pageNo: 1, |
|
|
|
pageSize: 500, |
|
|
|
sort: '' |
|
|
@ -223,18 +320,39 @@ const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
|
|
setV['remainingAmount'] = 0 |
|
|
|
const params2 = { |
|
|
|
by: 'ASC', |
|
|
|
filters: [{ column: 'itemCode', action: '==', value: val[0].code }], |
|
|
|
filters: [ |
|
|
|
{ column: 'itemCode', action: '==', value: val[0].code }, |
|
|
|
{ |
|
|
|
column: 'available', |
|
|
|
action: '==', |
|
|
|
value: 'TRUE' |
|
|
|
} |
|
|
|
], |
|
|
|
pageNo: 1, |
|
|
|
pageSize: 500, |
|
|
|
sort: '' |
|
|
|
} |
|
|
|
params2.isSearch = true |
|
|
|
StdcostpriceApi.getStdcostpricePage(params2).then((res) => { |
|
|
|
SalepriceApi.getSalepricePage(params2).then((res) => { |
|
|
|
if (res.list?.length > 0) { |
|
|
|
priceObj.value = res.list[0] |
|
|
|
formRef.setValues({ |
|
|
|
standardCostPrice: priceObj.value.price |
|
|
|
}) |
|
|
|
} else { |
|
|
|
params2.isSearch = true |
|
|
|
StdcostpriceApi.getStdcostpricePage(params2).then((res) => { |
|
|
|
if (res.list?.length > 0) { |
|
|
|
priceObj.value = res.list[0] |
|
|
|
formRef.setValues({ |
|
|
|
standardCostPrice: priceObj.value.price |
|
|
|
}) |
|
|
|
} else { |
|
|
|
formRef.setValues({ |
|
|
|
standardCostPrice: 0 |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
setV[formField] = val[0][searchField] |
|
|
@ -270,7 +388,14 @@ const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
|
|
|
|
|
|
const supplieritemParams = { |
|
|
|
by: 'ASC', |
|
|
|
filters: [{ column: 'itemCode', action: '==', value: val[0].itemCode }], |
|
|
|
filters: [ |
|
|
|
{ column: 'itemCode', action: '==', value: val[0].itemCode }, |
|
|
|
{ |
|
|
|
column: 'available', |
|
|
|
action: '==', |
|
|
|
value: 'TRUE' |
|
|
|
} |
|
|
|
], |
|
|
|
pageNo: 1, |
|
|
|
pageSize: 500, |
|
|
|
sort: '' |
|
|
@ -289,7 +414,14 @@ const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
|
|
}) |
|
|
|
const itembasicParams = { |
|
|
|
by: 'ASC', |
|
|
|
filters: [{ column: 'code', action: '==', value: val[0].itemCode }], |
|
|
|
filters: [ |
|
|
|
{ column: 'code', action: '==', value: val[0].itemCode }, |
|
|
|
{ |
|
|
|
column: 'available', |
|
|
|
action: '==', |
|
|
|
value: 'TRUE' |
|
|
|
} |
|
|
|
], |
|
|
|
pageNo: 1, |
|
|
|
pageSize: 500, |
|
|
|
sort: '' |
|
|
@ -303,8 +435,9 @@ const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
if (basicFormRef.value.formRef.formModel.lightItemCode == null|| |
|
|
|
basicFormRef.value.formRef.formModel.lightItemCode == '' |
|
|
|
if ( |
|
|
|
basicFormRef.value.formRef.formModel.lightItemCode == null || |
|
|
|
basicFormRef.value.formRef.formModel.lightItemCode == '' |
|
|
|
) { |
|
|
|
setV['standardCostPrice'] = '' |
|
|
|
setV['lightQty'] = 0 |
|
|
@ -315,18 +448,41 @@ const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
|
|
setV['remainingAmount'] = 0 |
|
|
|
const params2 = { |
|
|
|
by: 'ASC', |
|
|
|
filters: [{ column: 'itemCode', action: '==', value: val[0].itemCode }], |
|
|
|
filters: [ |
|
|
|
{ column: 'itemCode', action: '==', value: val[0].itemCode }, |
|
|
|
{ |
|
|
|
column: 'available', |
|
|
|
action: '==', |
|
|
|
value: 'TRUE' |
|
|
|
} |
|
|
|
], |
|
|
|
pageNo: 1, |
|
|
|
pageSize: 500, |
|
|
|
sort: '' |
|
|
|
} |
|
|
|
params2.isSearch = true |
|
|
|
StdcostpriceApi.getStdcostpricePage(params2).then((res) => { |
|
|
|
console.log(123) |
|
|
|
SalepriceApi.getSalepricePage(params2).then((res) => { |
|
|
|
console.log(456) |
|
|
|
if (res.list?.length > 0) { |
|
|
|
priceObj.value = res.list[0] |
|
|
|
formRef.setValues({ |
|
|
|
standardCostPrice: priceObj.value.price |
|
|
|
}) |
|
|
|
} else { |
|
|
|
params2.isSearch = true |
|
|
|
StdcostpriceApi.getStdcostpricePage(params2).then((res) => { |
|
|
|
if (res.list?.length > 0) { |
|
|
|
priceObj.value = res.list[0] |
|
|
|
formRef.setValues({ |
|
|
|
standardCostPrice: priceObj.value.price |
|
|
|
}) |
|
|
|
} else { |
|
|
|
formRef.setValues({ |
|
|
|
standardCostPrice: 0 |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
@ -401,7 +557,12 @@ const onChange = (field, e) => { |
|
|
|
const paramsCustomer = { |
|
|
|
by: 'ASC', |
|
|
|
filters: [ |
|
|
|
{ column: 'code', action: '==', value: basicFormRef.value.formRef.formModel.supplierCode } |
|
|
|
{ column: 'code', action: '==', value: basicFormRef.value.formRef.formModel.supplierCode }, |
|
|
|
{ |
|
|
|
column: 'available', |
|
|
|
action: '==', |
|
|
|
value: 'TRUE' |
|
|
|
} |
|
|
|
], |
|
|
|
pageNo: 1, |
|
|
|
pageSize: 500, |
|
|
@ -582,10 +743,10 @@ const formsSuccess = async (formType, data) => { |
|
|
|
// message.error('数量不能为0') |
|
|
|
// return |
|
|
|
// } |
|
|
|
if (!data.standardCostPrice) { |
|
|
|
message.error('标准成本价格不能为0或空') |
|
|
|
return |
|
|
|
} |
|
|
|
// if (!data.standardCostPrice) { |
|
|
|
// message.error('标准成本价格不能为0或空') |
|
|
|
// return |
|
|
|
// } |
|
|
|
if (data.activeTime == 0) data.activeTime = null |
|
|
|
if (data.expireTime == 0) data.expireTime = null |
|
|
|
|
|
|
|