Browse Source

修改Q2通知单的销售价格取值方式 HL-5882

hella_online_20240906
YEJIAXING-PC\lenovo 3 months ago
parent
commit
b121c2f1e3
  1. 54
      src/views/qms/inspectionQ2/index.vue
  2. 2
      src/views/qms/inspectionQ2/inspectionQ2.data.ts

54
src/views/qms/inspectionQ2/index.vue

@ -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'
@ -171,6 +172,29 @@ const clearSearchInput = (formField) => {
}) })
} }
}) })
SalepriceApi.getSalepricePage(params2).then((res) => {
if (res.list?.length > 0) {
priceObj.value = res.list[0]
basicFormRef.value.formRef.setValues({
standardCostPrice: priceObj.value.price
})
} else {
StdcostpriceApi.getStdcostpricePage(params2).then((res) => {
if (res.list?.length > 0) {
priceObj.value = res.list[0]
basicFormRef.value.formRef.setValues({
standardCostPrice: priceObj.value.price
})
} else {
formRef.setValues({
standardCostPrice: 0
})
}
})
}
})
} }
} }
// //
@ -230,12 +254,25 @@ const searchTableSuccess = (formField, searchField, val, formRef) => {
sort: '' sort: ''
} }
params2.isSearch = true 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 {
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]
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]
@ -304,7 +341,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'] = ''
@ -322,12 +360,26 @@ const searchTableSuccess = (formField, searchField, val, formRef) => {
sort: '' sort: ''
} }
params2.isSearch = true 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 {
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]
formRef.setValues({ formRef.setValues({
standardCostPrice: priceObj.value.price standardCostPrice: priceObj.value.price
}) })
} else {
formRef.setValues({
standardCostPrice: 0
})
}
})
} }
}) })
} }

2
src/views/qms/inspectionQ2/inspectionQ2.data.ts

@ -341,7 +341,7 @@ export const Q2 = useCrudSchemas(
componentProps: { componentProps: {
enterSearch: true, enterSearch: true,
isSearchList: true, // 开启查询弹窗 isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择物料代码', // 输入框占位文本 searchListPlaceholder: '请选择整灯/分总成物料代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段 searchField: 'code', // 查询弹窗赋值字段
searchTitle: '物料基础信息', // 查询弹窗标题 searchTitle: '物料基础信息', // 查询弹窗标题
searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类 searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类

Loading…
Cancel
Save