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