From fee645244e4b61af6056774e8ac375882619d995 Mon Sep 17 00:00:00 2001 From: yufei0306 <13417315+yufei0306@user.noreply.gitee.com> Date: Wed, 10 Apr 2024 14:07:38 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A6=81=E8=B4=A7=E8=AE=A1=E5=88=92=E6=96=B0?= =?UTF-8?q?=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../purchasereceiptRequestMain/index.vue | 2 +- .../purchasePlanMain/index.vue | 74 ++++- .../purchasePlanMain/purchasePlanMain.data.ts | 264 ++++++++++-------- 3 files changed, 210 insertions(+), 130 deletions(-) diff --git a/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue b/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue index b42c76c43..4916ccec7 100644 --- a/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue +++ b/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue @@ -384,7 +384,7 @@ const getSearchTableData = async (number,supplierCode)=>{ tableColumns.forEach((item) => { item.width = item.table?.width || 150 }) - + tableData.value = [] tableObject.tableList.forEach(row=>{ const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...row})) newRow['poLine'] = row['lineNumber'] diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue index 8330d5564..c1aba1df6 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue @@ -28,6 +28,8 @@ { + console.log('searchTableSuccess', formField, searchField, val, formRef, type, row) nextTick(async () => { if (type == 'tableForm') { // 明细查询页赋值 - row[formField] = val[0][searchField] - row['itemCode'] = val[0]['code'] - row['poNumber'] = val[0]['number'] - row['poLine'] = val[0]['lineNumber'] - if (formField == 'poLine') { - row['itemCode'] = val[0]['itemCode'] - row['uom'] = val[0]['uom'] - row['orderQty'] = val[0]['orderQty'] - row['planQty'] = val[0]['orderQty']-val[0]['plannedQty'] - row['available'] = val[0]['available'] - } + val.forEach(item=>{ + if(tableData.value.find(item1=>item1['id'] == item['id'])) return + const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...row})) + + newRow[formField] = item[searchField] + newRow['itemCode'] = item['code'] + newRow['poNumber'] = item['number'] + newRow['poLine'] = item['lineNumber'] + if (formField == 'poLine') { + //添加费用明细--点击确定 + newRow['itemCode'] = item['itemCode'] + newRow['uom'] = item['uom'] + newRow['orderQty'] = item['orderQty'] + newRow['planQty'] = item['orderQty']-item['plannedQty'] + newRow['available'] = item['available'] + } + tableData.value.push(newRow) + }) } else { const setV = {} setV[formField] = val[0][searchField] setV['itemCode'] = val[0]['code'] setV['poNumber'] = val[0]['number'] setV['poLine'] = val[0]['lineNumber'] + if(formField == 'supplierCode'){ setV['supplierCode'] = val[0]['code'] + setV['contacts'] = val[0]['contacts'] + setV['phone'] = val[0]['phone'] await PurchasePlanMainApi.queryPurchasePlan(val[0]['code']).then(res => { let beginTime = res.beginTime var ms = beginTime.substring(0, 2) @@ -123,6 +137,7 @@ var me = endTime.substring(3) setV['endTime'] = new Date(2024, 1, 1, Number(ms), Number(me)) }) + tableData.value = [] } if (formField == 'poLine') { setV['itemCode'] = val[0]['itemCode'] @@ -132,9 +147,46 @@ setV['available'] = val[0]['available'] } formRef.setValues(setV) + console.log('formModel',formRef.formModel) + if(formField == 'poNumber') { + //新增--采购订单-- + // 请求明细数据 + getSearchTableData(val[0]['number'],formField,searchField) + } } }) } + +const getSearchTableData = async (number,formField,searchField)=>{ + const {tableObject ,tableMethods} = useTable({ + defaultParams:{number}, + getListApi: PurchaseDetailApi.getPurchaseDetailPagePoNumber // 分页接口 + }) + // 获得表格的各种操作 + const { getList:getList1 } = tableMethods + await getList1() + const tableColumns = PurchaseDetail.allSchemas.tableFormColumns + tableColumns.forEach((item) => { + item.width = item.table?.width || 150 + }) + tableData.value = [] + tableObject.tableList.forEach(row=>{ + const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...row})) + // 明细查询页赋值 + newRow[formField] = row[searchField] + newRow['itemCode'] = row['itemCode'] + newRow['poNumber'] = row['number'] + newRow['poLine'] = row['lineNumber'] + if (formField == 'poLine') { + newRow['itemCode'] = row['itemCode'] + newRow['uom'] = row['uom'] + newRow['orderQty'] = row['orderQty'] + newRow['planQty'] = row['orderQty']-row['plannedQty'] + newRow['available'] = row['available'] + } + tableData.value.push(newRow) + }) +} // 查询页面返回——详情 const searchTableSuccessDetail = (formField, searchField, val, formRef) => { nextTick(async () => { diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/purchasePlanMain.data.ts b/src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/purchasePlanMain.data.ts index 5cf1ec526..67e525b64 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/purchasePlanMain.data.ts +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/purchasePlanMain.data.ts @@ -49,17 +49,17 @@ export const PurchasePlanMain = useCrudSchemas(reactive([ } }, { - label: '订单号', + label: '采购订单', field: 'poNumber', sort: 'custom', table: { width: 150 }, form: { - // labelMessage: '信息提示说明!!!', + labelMessage: '信息提示说明!!!', componentProps: { isSearchList: true, - searchListPlaceholder: '请选择订单号', + searchListPlaceholder: '请选择采购订单', searchField: 'number', searchTitle: '采购订单信息', searchAllSchemas: PurchaseMain.allSchemas, @@ -81,6 +81,30 @@ export const PurchasePlanMain = useCrudSchemas(reactive([ } } }, + { + label: '收货人', + field: 'contacts', + table: { + width: 150 + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: '联系电话', + field: 'phone', + table: { + width: 150 + }, + form: { + componentProps: { + disabled: true + } + } + }, { label: '送达日期', field: 'deliveryDate', @@ -190,65 +214,65 @@ export const PurchasePlanMain = useCrudSchemas(reactive([ } }, - { - label: '自动发布', - field: 'autoPublish', - dictType: DICT_TYPE.TRUE_FALSE, - dictClass: 'string', - isTable: true, - sort: 'custom', - table: { - width: 150 - }, - form: { - component: 'Switch', - value: "TRUE", - componentProps: { - inactiveValue: 'FALSE', - activeValue: 'TRUE' - } - } - }, - { - label: '自动接收', - field: 'autoAccept', - dictType: DICT_TYPE.TRUE_FALSE, - dictClass: 'string', - isTable: true, - sort: 'custom', - table: { - width: 150 - }, - form: { - component: 'Switch', - value: "TRUE", - componentProps: { - inactiveValue: 'FALSE', - activeValue: 'TRUE' - } - } - }, - { - label: '是否可用', - field: 'available', - dictType: DICT_TYPE.TRUE_FALSE, - dictClass: 'string', - isTable: true, - sort: 'custom', - table: { - width: 150 - }, - form: { - component: 'Switch', - value: 'TRUE', - componentProps: { - inactiveValue: 'FALSE', - activeValue: 'TRUE', - disabled: true - } - }, - isSearch: true, - }, + // { + // label: '自动发布', + // field: 'autoPublish', + // dictType: DICT_TYPE.TRUE_FALSE, + // dictClass: 'string', + // isTable: true, + // sort: 'custom', + // table: { + // width: 150 + // }, + // form: { + // component: 'Switch', + // value: "TRUE", + // componentProps: { + // inactiveValue: 'FALSE', + // activeValue: 'TRUE' + // } + // } + // }, + // { + // label: '自动接收', + // field: 'autoAccept', + // dictType: DICT_TYPE.TRUE_FALSE, + // dictClass: 'string', + // isTable: true, + // sort: 'custom', + // table: { + // width: 150 + // }, + // form: { + // component: 'Switch', + // value: "TRUE", + // componentProps: { + // inactiveValue: 'FALSE', + // activeValue: 'TRUE' + // } + // } + // }, + // { + // label: '是否可用', + // field: 'available', + // dictType: DICT_TYPE.TRUE_FALSE, + // dictClass: 'string', + // isTable: true, + // sort: 'custom', + // table: { + // width: 150 + // }, + // form: { + // component: 'Switch', + // value: 'TRUE', + // componentProps: { + // inactiveValue: 'FALSE', + // activeValue: 'TRUE', + // disabled: true + // } + // }, + // isSearch: true, + // }, { label: '创建者', field: 'creator', @@ -339,6 +363,9 @@ export const PurchasePlanMainRules = reactive({ available: [ { required: true, message: '请选择是否可用', trigger: 'change' } ], + supplierCode: [ + { required: true, message: '请选择供应商代码', trigger: 'change' } + ], poNumber: [ { required: true, message: '请选择采购订单号', trigger: 'change' } ], @@ -377,62 +404,62 @@ export const PurchasePlanDetail = useCrudSchemas(reactive([ } } }, - // { - // label: '订单号', - // field: 'poNumber', - // sort: 'custom', - // table: { - // width: 180 - // }, - // tableForm: { - // isInpuFocusShow: true, - // searchListPlaceholder: '请选择订单号', - // searchField: 'number', - // searchTitle: '采购订单信息', - // searchAllSchemas: PurchaseMain.allSchemas, - // searchPage: PurchaseMainApi.getPurchaseMainPage, - // searchCondition: [{ - // key: 'available', - // value: 'TRUE', - // isMainValue: false - // }, { - // key: 'supplierCode', - // value: 'supplierCode', - // message: '请填写供应商代码!', - // isMainValue: true - // }, { - // key: 'status', - // value: 2, - // isMainValue: false - // } - // ] - // }, - // form: { - // // labelMessage: '信息提示说明!!!', - // componentProps: { - // isSearchList: true, - // searchListPlaceholder: '请选择订单号', - // searchField: 'number', - // searchTitle: '采购订单信息', - // searchAllSchemas: PurchaseMain.allSchemas, - // searchPage: PurchaseMainApi.getPurchaseMainPage, - // searchCondition: [{ - // key: 'available', - // value: 'TRUE', - // isMainValue: false - // },{ - // key: 'supplierCode', - // value: 'supplierCode', - // message: '请填写供应商代码!', - // isMainValue: true - // },{ - // key: 'status', - // value: 2, - // isMainValue: false - // }] - // } - // } - // }, + { + label: '订单号', + field: 'poNumber', + sort: 'custom', + table: { + width: 180 + }, + tableForm: { + isInpuFocusShow: true, + searchListPlaceholder: '请选择订单号', + searchField: 'number', + searchTitle: '采购订单信息', + searchAllSchemas: PurchaseMain.allSchemas, + searchPage: PurchaseMainApi.getPurchaseMainPage, + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + }, { + key: 'supplierCode', + value: 'supplierCode', + message: '请填写供应商代码!', + isMainValue: true + }, { + key: 'status', + value: 2, + isMainValue: false + } + ] + }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, + searchListPlaceholder: '请选择订单号', + searchField: 'number', + searchTitle: '采购订单信息', + searchAllSchemas: PurchaseMain.allSchemas, + searchPage: PurchaseMainApi.getPurchaseMainPage, + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + },{ + key: 'supplierCode', + value: 'supplierCode', + message: '请填写供应商代码!', + isMainValue: true + },{ + key: 'status', + value: 2, + isMainValue: false + }] + } + } + }, { label: '订单行', field: 'poLine', @@ -462,6 +489,7 @@ export const PurchasePlanDetail = useCrudSchemas(reactive([ } }, tableForm: { + multiple:true, isInpuFocusShow: true, searchListPlaceholder: '请选择订单行', searchField: 'lineNumber',