From 18dcb1ed29685930a964791063d817cdaefbfe3a Mon Sep 17 00:00:00 2001
From: yufei0306 <13417315+yufei0306@user.noreply.gitee.com>
Date: Wed, 10 Apr 2024 16:36:12 +0800
Subject: [PATCH] =?UTF-8?q?=E8=A6=81=E8=B4=A7=E8=AE=A1=E5=88=92---?=
=?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=88=E6=9C=89=E6=95=88=E6=9C=9F=E7=9B=AE?=
=?UTF-8?q?=E5=89=8D=E5=86=99=E6=AD=BB=EF=BC=8C=E8=AE=B0=E5=BE=97=E6=B5=8B?=
=?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=95=B0=E6=8D=AE=EF=BC=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../supplierdeliverRequestMain/index.vue | 81 ++++++-
.../supplierdeliverRequestMain.data.ts | 212 +++++++++---------
2 files changed, 188 insertions(+), 105 deletions(-)
diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue
index 6f933f9f5..4154c55ff 100644
--- a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue
+++ b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue
@@ -46,7 +46,7 @@
+ >
+
+
+
+
nextTick(() => {
console.log("type:",type)
console.log("formField:",formField)
+ console.log(formField, searchField, val, formRef, type, row)
if (type == 'tableForm') {
// 明细查询页赋值
// row[formField] = val[0][searchField]
@@ -165,7 +178,10 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
// row['orderQty'] = val[0]['orderQty']
// row['uom'] = val[0]['uom']
// }
+ //添加费用明细--点击确定
+ const itemCodes = []
val.forEach(item=>{
+ if(tableData.value.find(item1=>item1['id'] == item['id'])) return
const newRow = {...row}
newRow[formField] = item[searchField]
newRow['poNumber'] = item['poNumber']
@@ -173,12 +189,29 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
newRow['poLine'] = item['poLine']
newRow['orderQty'] = item['orderQty']
newRow['uom'] = item['uom']
+ itemCodes.push(item['itemCode'])
tableData.value.push(newRow)
})
+ //有效期
+ ItembasicApi.getItembasicPage({
+ code:itemCodes.join(',')
+ }).then((res)=>{
+ console.log('有效期',res)
+ tableData.value.forEach((item,index)=>{
+ tableData.value[index]['expireTime'] = index==0?1:2
+ })
+ // res.list.forEach((item,index)=>{
+ // const findItem = tableData.value.find(item1=>item1['itemCode']==item['code'])
+ // findItem['expireTime'] = findItem['expireTime']
+ // })
+ })
} else {
const setV = {}
setV[formField] = val[0][searchField]
if(formField == 'ppNumber'){
+ //新增--选择完要货计划,自动展示明细
+ getSearchTableData(val[0]['number'],formField,searchField)
+
// 设置计划到货时间
let beginTime = val[0]['endTime']
let deliveryDate = formatDate(val[0]['deliveryDate'],'YYYY-MM-DD')
@@ -196,6 +229,46 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
}
})
}
+const getSearchTableData = async (number,formField,searchField)=>{
+ const {tableObject ,tableMethods} = useTable({
+ defaultParams:{number},
+ getListApi: PurchasePlanDetailApi.getPurchasePlanDetailPage // 分页接口
+ })
+ // 获得表格的各种操作
+ const { getList:getList1 } = tableMethods
+ await getList1()
+ const tableColumns = PurchasePlanDetail.allSchemas.tableFormColumns
+ tableColumns.forEach((item) => {
+ item.width = item.table?.width || 150
+ })
+ tableData.value = []
+ const itemCodes = []
+ tableObject.tableList.forEach(row=>{
+ const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...row}))
+ newRow[formField] = row[searchField]
+ newRow['poNumber'] = row['poNumber']
+ newRow['itemCode'] = row['itemCode']
+ newRow['poLine'] = row['poLine']
+ newRow['orderQty'] = row['orderQty']
+ newRow['uom'] = row['uom']
+ tableData.value.push(newRow)
+ itemCodes.push(row['itemCode'])
+ })
+
+ //有效期
+ ItembasicApi.getItembasicPage({
+ code:itemCodes.join(',')
+ }).then((res)=>{
+ console.log('有效期',res)
+ tableData.value.forEach((item,index)=>{
+ tableData.value[index]['expireTime'] = index==0?1:2
+ })
+ // res.list.forEach((item,index)=>{
+ // const findItem = tableData.value.find(item1=>item1['itemCode']==item['code'])
+ // findItem['expireTime'] = findItem['expireTime']
+ // })
+ })
+}
// 查询页面返回——详情
const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
nextTick(() => {
@@ -232,6 +305,8 @@ const searchTableSuccessLabel = (formField, searchField, val, formRef, type, row
})
}
+
+
const { tableObject, tableMethods } = useTable({
getListApi: SupplierdeliverRequestMainApi.getSupplierdeliverRequestMainPage // 分页接口
})
diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts
index e57d5b280..13eccf5d8 100644
--- a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts
+++ b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts
@@ -553,7 +553,103 @@ export const SupplierdeliverRequestMainRules = reactive({
*/
export const SupplierdeliverRequestDetail = useCrudSchemas(reactive([
{
- label: '生产日期',
+ label: '订单号',
+ field: 'poNumber',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ // labelMessage: '信息提示说明!!!',
+ componentProps: {
+ isSearchList: true,
+ searchListPlaceholder: '请选择订单号',
+ searchField: 'number',
+ searchTitle: '要货计划信息',
+ searchAllSchemas: PurchasePlanDetail.allSchemas,
+ searchPage: PurchasePlanDetailApi.getPurchasePlanDetailPage,
+ searchCondition: [
+ {
+ key: 'number',
+ value: 'ppNumber',
+ message: '请填写要货计划单号!',
+ isMainValue: true
+ },
+ {
+ key: 'available',
+ value: 'TRUE',
+ isMainValue: false
+ }
+
+ ]
+ }
+ },
+ tableForm: {
+ isInpuFocusShow: true,
+ searchListPlaceholder: '请选择订单号',
+ searchField: 'number',
+ searchTitle: '要货计划信息',
+ searchAllSchemas: PurchasePlanDetail.allSchemas,
+ searchPage: PurchasePlanDetailApi.getPurchasePlanDetailPage,
+ searchCondition: [
+ {
+ key: 'number',
+ value: 'ppNumber',
+ message: '请填写要货计划单号!',
+ isMainValue: true
+ },
+ {
+ key: 'available',
+ value: 'TRUE',
+ isMainValue: false
+ }]
+ }
+ },
+ {
+ label: '订单行',
+ field: 'poLine',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ componentProps: {
+ disabled: true
+ }
+ },
+ tableForm: {
+ disabled: true
+ }
+ },
+ {
+ label: '物料代码',
+ field: 'itemCode',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ componentProps: {
+ disabled: true
+ }
+ },
+ tableForm: {
+ disabled: true
+ }
+ },
+ {
+ label: '批次',
+ field: 'batch',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ tableForm: {
+ disabled: false
+ }
+ },
+ {
+ label: '生产日期1',
field: 'produceDate',
formatter: dateFormatter2,
detail: {
@@ -578,17 +674,7 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive