diff --git a/src/components/Detail/src/Detail.vue b/src/components/Detail/src/Detail.vue index 936e133cd..44149fdbf 100644 --- a/src/components/Detail/src/Detail.vue +++ b/src/components/Detail/src/Detail.vue @@ -54,6 +54,7 @@ :pagination="{ total: tableObjectRef.total }" v-model:pageSize="tableObjectRef.pageSize" v-model:currentPage="tableObjectRef.currentPage" + v-model:sort="tableObjectRef.sort" > @@ -115,6 +116,8 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons' import { formatDate } from '@/utils/formatTime' import * as SupplieritemApi from '@/api/wms/supplieritem' import { getAccessToken } from '@/utils/auth' +import * as PurchaseDetailApi from '@/api/wms/purchaseDetail' +import { PurchaseDetail } from '../../supplierdeliver/purchaseMain/purchaseMain.data' // 采购收货申请 defineOptions({ name: 'PurchasereceiptRequestMain' }) @@ -147,17 +150,23 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => } else if(formField == 'poNumber') { row['poNumber'] = val[0]['number'] } else if(formField == 'poLine'){ - row['poLine'] = val[0]['lineNumber'] - row['itemCode'] = val[0]['itemCode'] - row['uom'] = val[0]['uom'] - let supplierCode = formRef.formModel.supplierCode; - let itemCode = val[0]['itemCode'] - let queryData = { - supplierCode:supplierCode, - itemCode:itemCode - } - SupplieritemApi.getDefaultLocationCode(queryData as SupplieritemApi.SupplieritemVO).then(res =>{ - row['defaultToLocationCode'] = res + //添加费用明细--点击确定 + val.forEach(item=>{ + if(tableData.value.find(item1=>item1['id'] == item['id'])) return + const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...row})) + newRow['poLine'] = item['lineNumber'] + newRow['itemCode'] = item['itemCode'] + newRow['uom'] = item['uom'] + newRow['poNumber'] = item['number'] + let supplierCode = formRef.formModel.supplierCode; + let queryData = { + supplierCode:supplierCode, + itemCode: item['itemCode'] + } + SupplieritemApi.getDefaultLocationCode(queryData as SupplieritemApi.SupplieritemVO).then(res =>{ + newRow['defaultToLocationCode'] = res + tableData.value.push(newRow) + }) }) }else if (formField == 'packQty'){ row['packQty'] = val[0]['packQty'] @@ -165,12 +174,59 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => } } else { const setV = {} + if(formField == 'supplierCode'){ + setV['supplierCode'] = val[0]['code'] + }else if(formField == 'ppNumber') { + //新增--采购订单-- + setV['supplierCode'] = val[0]['supplierCode'] + setV['poNumber'] = val[0]['number'] + const newRow = val[0] + newRow['poNumber'] = val[0]['number'] + // 请求明细数据 + getSearchTableData(val[0]['number']) + // tableData.value = [newRow] + // formRef.handleAddTable() + } setV[formField] = val[0][searchField] - setV['supplierCode'] = val[0]['code'] formRef.setValues(setV) } }) } +const onEnter = async (field,value)=>{ + console.log(field,value) + getSearchTableData(value,true) +} +const getSearchTableData = async (number,isEnter=false)=>{ + const {tableObject ,tableMethods} = useTable({ + defaultParams:{number}, + getListApi: PurchaseDetailApi.getPurchaseDetailPage // 分页接口 + }) + // 获得表格的各种操作 + 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['poLine'] = row['lineNumber'] + newRow['itemCode'] = row['itemCode'] + newRow['uom'] = row['uom'] + newRow['poNumber'] =row['number'] + newRow['defaultToLocationCode'] =row['defaultLocation'] + tableData.value.push(newRow) + if(isEnter){ + //回车--供应商代码 + const setV = {} + setV['poNumber'] = number + setV['supplierCode'] = row.supplierCode + formRef.value.formRef.setValues(setV) + + } + }) +} // 查询页面返回——详情 const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { nextTick(() => { @@ -275,25 +331,25 @@ const butttondata = (row) => { // 列表-操作按钮事件 const buttonTableClick = async (val, row) => { if (val == 'mainClose') { // 关闭 - handleClose(row.id) + handleClose(row.masterId) } else if (val == 'mainReAdd') { // 重新添加 - handleReAdd(row.id) + handleReAdd(row.masterId) } else if (val == 'mainSubmit') { // 提交审批 - handleSubmit(row.id) + handleSubmit(row.masterId) } else if (val == 'mainTurnDown') { // 驳回 - handleRefused(row.id) + handleRefused(row.masterId) } else if (val == 'mainApprove') { // 审批通过 - handleAgree(row.id) + handleAgree(row.masterId) } else if (val == 'mainHandle') { // 处理 - handleHandle(row.id) + handleHandle(row.masterId) } else if (val == 'edit') { // 编辑 openForm('update', row) } else if(val == 'ssbq'){ // 生成标签 // 生成标签 detatableData.params = { - masterId:row.id + masterId:row.masterId } - genLabelId.value = row.id + genLabelId.value = row.masterId await getDetailList() formLabelRef.value.open('create', row, null,'createLabel')//创建标签页面 createLabel 标题 }else if (val == 'point') { diff --git a/src/views/wms/purchasereceiptManage/sparereceipt/sparereceiptRequestMain/sparereceiptRequestMain.data.ts b/src/views/wms/purchasereceiptManage/sparereceipt/sparereceiptRequestMain/sparereceiptRequestMain.data.ts index bc0b477cd..f89e6b02c 100644 --- a/src/views/wms/purchasereceiptManage/sparereceipt/sparereceiptRequestMain/sparereceiptRequestMain.data.ts +++ b/src/views/wms/purchasereceiptManage/sparereceipt/sparereceiptRequestMain/sparereceiptRequestMain.data.ts @@ -51,24 +51,25 @@ export const PurchasereceiptRequestMain = useCrudSchemas(reactive( isSearch: true, }, { - label: '供应商代码', - field: 'supplierCode', + label: '采购订单', + field: 'ppNumber', sort: 'custom', table: { - width: 150 + width: 180 }, - isSearch: true, form: { // labelMessage: '信息提示说明!!!', componentProps: { + enterSearch: true, isSearchList: true, // 开启查询弹窗 - searchListPlaceholder: '请选择供应商代码', // 输入框占位文本 - searchField: 'code', // 查询弹窗赋值字段 - searchTitle: '供应商信息', // 查询弹窗标题 - searchAllSchemas: Supplier.allSchemas, // 查询弹窗所需类 - searchPage: SupplierApi.getSupplierPage // 查询弹窗所需分页方法 + searchListPlaceholder: '请选择采购订单', // 输入框占位文本 + searchField: 'number', // 查询弹窗赋值字段 + searchTitle: '采购订单信息', // 查询弹窗标题 + searchAllSchemas: PurchaseMain.allSchemas, // 查询弹窗所需类 + searchPage: PurchaseMainApi.getPurchaseMainPage, // 查询弹窗所需分页方法 } - } + }, + isForm: true, }, { label: '发货单号', @@ -80,42 +81,62 @@ export const PurchasereceiptRequestMain = useCrudSchemas(reactive( isForm: true, }, { - label: '要货计划单号', - field: 'ppNumber', + label: '供应商代码', + field: 'supplierCode', sort: 'custom', table: { - width: 180 + width: 150 }, + isSearch: true, form: { // labelMessage: '信息提示说明!!!', componentProps: { isSearchList: true, // 开启查询弹窗 - searchListPlaceholder: '请选择要货计划单号', // 输入框占位文本 - searchField: 'number', // 查询弹窗赋值字段 - searchTitle: '要货计划信息', // 查询弹窗标题 - searchAllSchemas: PurchasePlanMain.allSchemas, // 查询弹窗所需类 - searchPage: PurchasePlanMainApi.getPurchasePlanMainPage, // 查询弹窗所需分页方法 - searchCondition: [ - { - key: 'supplierCode', - value: 'supplierCode', - message: '请填写供应商代码!', - isMainValue: true - }, - { - key: 'status', - value: 4, - isMainValue: false - }, - { - key: 'available', - value: "TRUE", - isMainValue: false - }] + searchListPlaceholder: '请选择供应商代码', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '供应商信息', // 查询弹窗标题 + searchAllSchemas: Supplier.allSchemas, // 查询弹窗所需类 + searchPage: SupplierApi.getSupplierPage // 查询弹窗所需分页方法 } - }, - isForm: true, + } }, + // { + // label: '要货计划单号', + // field: 'ppNumber', + // sort: 'custom', + // table: { + // width: 180 + // }, + // form: { + // // labelMessage: '信息提示说明!!!', + // componentProps: { + // isSearchList: true, // 开启查询弹窗 + // searchListPlaceholder: '请选择要货计划单号', // 输入框占位文本 + // searchField: 'number', // 查询弹窗赋值字段 + // searchTitle: '要货计划信息', // 查询弹窗标题 + // searchAllSchemas: PurchasePlanMain.allSchemas, // 查询弹窗所需类 + // searchPage: PurchasePlanMainApi.getPurchasePlanMainPage, // 查询弹窗所需分页方法 + // searchCondition: [ + // { + // key: 'supplierCode', + // value: 'supplierCode', + // message: '请填写供应商代码!', + // isMainValue: true + // }, + // { + // key: 'status', + // value: 4, + // isMainValue: false + // }, + // { + // key: 'available', + // value: "TRUE", + // isMainValue: false + // }] + // } + // }, + // isForm: true, + // }, { label: '承运商', field: 'carrierCode', @@ -142,22 +163,22 @@ export const PurchasereceiptRequestMain = useCrudSchemas(reactive( width: 150 }, }, - { - label: '数据来源', - field: 'sourceType', - dictType: DICT_TYPE.PURCHASERECEIPT_SOURCE_TYPE, - sort: 'custom', - table: { - width: 150 - }, - form: { - value: 'spare_PartsReceipt', - componentProps: { - disabled: true - } - }, - isSearch: false, - }, + // { + // label: '数据来源', + // field: 'sourceType', + // dictType: DICT_TYPE.PURCHASERECEIPT_SOURCE_TYPE, + // sort: 'custom', + // table: { + // width: 150 + // }, + // form: { + // value: 'spare_PartsReceipt', + // componentProps: { + // disabled: true + // } + // }, + // isSearch: false, + // }, { label: '从仓库代码', field: 'fromWarehouseCode', @@ -304,50 +325,50 @@ export const PurchasereceiptRequestMain = useCrudSchemas(reactive( }, isForm: false, }, - { - label: '截止时间', - field: 'dueTime', - formatter: dateFormatter, - detail: { - dateFormat: 'YYYY-MM-DD HH:mm:ss' - }, - sort: 'custom', - table: { - width: 180 - }, - form: { - component: 'DatePicker', - componentProps: { - style: {width:'100%'}, - type: 'datetime', - dateFormat: 'YYYY-MM-DD HH:mm:ss', - valueFormat: 'x', - } - }, - }, - { - label: '部门', - field: 'departmentCode', - sort: 'custom', - table: { - width: 150 - }, - formatter: (_: Recordable, __: TableColumn, cellValue: number) => { - return userDeptArray.find((account) => account.id == cellValue)?.name - }, - form: { - value: userDept.id, - component: 'Select', - api: () => userDeptArray, - componentProps: { - disabled: true, - optionsAlias: { - labelField: 'name', - valueField: 'id' - } - } - } - }, + // { + // label: '截止时间', + // field: 'dueTime', + // formatter: dateFormatter, + // detail: { + // dateFormat: 'YYYY-MM-DD HH:mm:ss' + // }, + // sort: 'custom', + // table: { + // width: 180 + // }, + // form: { + // component: 'DatePicker', + // componentProps: { + // style: {width:'100%'}, + // type: 'datetime', + // dateFormat: 'YYYY-MM-DD HH:mm:ss', + // valueFormat: 'x', + // } + // }, + // }, + // { + // label: '部门', + // field: 'departmentCode', + // sort: 'custom', + // table: { + // width: 150 + // }, + // formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + // return userDeptArray.find((account) => account.id == cellValue)?.name + // }, + // form: { + // value: userDept.id, + // component: 'Select', + // api: () => userDeptArray, + // componentProps: { + // disabled: true, + // optionsAlias: { + // labelField: 'name', + // valueField: 'id' + // } + // } + // } + // }, { label: '状态', field: 'status', @@ -477,6 +498,9 @@ export const PurchasereceiptRequestMain = useCrudSchemas(reactive( //表单校验 export const PurchasereceiptRequestMainRules = reactive({ + ppNumber: [ + { required: true, message: '请输入采购订单', trigger: 'blur' } + ], supplierCode: [ { required: true, message: '请输入供应商代码', trigger: 'blur' } ], @@ -486,9 +510,9 @@ export const PurchasereceiptRequestMainRules = reactive({ toAreaTypes: [ { required: true, message: '请输入到库区类型范围', trigger: 'blur' } ], - departmentCode: [ - { required: true, message: '请输入部门', trigger: 'blur' } - ], + // departmentCode: [ + // { required: true, message: '请输入部门', trigger: 'blur' } + // ], autoCommit: [ { required: true, message: '请选择是否自动提交', trigger: 'change' } ], diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/index.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/index.vue index 317471c07..95fd5b06b 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/index.vue +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/index.vue @@ -218,7 +218,7 @@ const buttonTableClick = async (val, row) => { } else if (val == 'edit') { // 编辑 openForm('update', row) } else if (val == 'delete') { // 删除 - handleDelete(row.id) + handleDelete(row.masterId) } } diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue index 30ba31a82..206fea3ff 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue @@ -289,23 +289,23 @@ const getSearchTableData = async (number,formField,searchField)=>{ // 列表-操作按钮事件 const buttonTableClick = async (val, row) => { if (val == 'mainPurPlanOpe') { // 打开 - handleOpen(row.id) + handleOpen(row.masterId) } else if (val == 'mainPurPlanClo') {// 关闭 - handleClose(row.id) + handleClose(row.masterId) } else if (val == 'mainPurPlanPub') { // 发布 - handlePublish(row.id) + handlePublish(row.masterId) } else if (val == 'mainPurPlanAcc') { // 接受 - handleAcc(row.id) + handleAcc(row.masterId) } else if (val == 'mainPurPlanRej') { // 不接受 - handleRej(row.id) + handleRej(row.masterId) } else if (val == 'mainPurPlanWit') { // 下架 - handleWit(row.id) + handleWit(row.masterId) } else if(val == 'mainPurPlanMod'){ // 修改 - handleReOpen(row.id) + handleReOpen(row.masterId) }else if (val == 'edit') { // 编辑 openForm('update', row) } else if (val == 'delete') { // 删除 - handleDelete(row.id) + handleDelete(row.masterId) } } diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRecordMain/index.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRecordMain/index.vue index efa1778cf..3fe99d4af 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRecordMain/index.vue +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRecordMain/index.vue @@ -157,7 +157,7 @@ const buttonTableClick = async (val, row) => { handlerCreatePurchasereceiptRequest(row.number) }else if (val == 'documentPrint') { // 单据打印 - handleDocumentPrint(row.id) + handleDocumentPrint(row.masterId) } } diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue index 6951269e9..2eb63b41d 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue @@ -444,42 +444,42 @@ const butttondata = (row) => { const buttonTableClick = async (val, row) => { if (val == 'mainPurPlanOpe') { // 打开 - handleOpe(row.id) + handleOpe(row.masterId) } else if (val == 'mainPurPlanClo') { // 关闭 - handleClo(row.id) + handleClo(row.masterId) } else if (val == 'mainPlanUploadQualityReport') { // 上传质量报告 handleUploadQualityReport(row) } else if (val == 'mainPlanSub') { // 提交审批 - handleSub(row.id) + handleSub(row.masterId) } else if (val == 'mainPlanApp') { // 审批通过 - handleApp(row.id) + handleApp(row.masterId) } else if (val == 'mainPlanTur') { // 驳回按钮 - handleTur(row.id) + handleTur(row.masterId) } else if (val == 'genRecords') { // 处理 - genRecords(row.id) + genRecords(row.masterId) } else if (val == 'edit') { // 编辑 openForm('update', row) } else if (val == 'delete') { // 删除 - handleDelete(row.id) + handleDelete(row.masterId) } else if (val == 'ssbq') { - await SupplierdeliverRequestMainApi.selfCheckReport(row.id).then(async (res) => { + await SupplierdeliverRequestMainApi.selfCheckReport(row.masterId).then(async (res) => { if(!res){ message.warning("请先上传自检报告!") return }else{ // 生成标签 detatableData.params = { - masterId:row.id + masterId:row.masterId } - genLabelId.value = row.id + genLabelId.value = row.masterId await getDetailList() formLabelRef.value.open('create', row, null,'createLabel')//创建标签页面 createLabel 标题 } @@ -491,7 +491,7 @@ const buttonTableClick = async (val, row) => { labelPrint(row) } else if (val == 'documentPrint') { // 单据打印 - handleDocumentPrint(row.id) + handleDocumentPrint(row.masterId) } } @@ -598,9 +598,9 @@ const handleUploadQualityReport = async (row) => { console.log('SupplierdeliverInspectionDetail',SupplierdeliverInspectionDetail.allSchemas) const uploadFile = SupplierdeliverInspectionDetail.allSchemas.formSchema.find(item=>item.field=='uploadFile') if(uploadFile){ - uploadFile['componentProps']['upData']['tableId'] = row.id + uploadFile['componentProps']['upData']['tableId'] = row.masterId } - ploadQualityReportRef.value.open('create', null, {masterId:row.id},'上传质量报告')//创建标签页面 createLabel 标题 + ploadQualityReportRef.value.open('create', null, {masterId:row.masterId},'上传质量报告')//创建标签页面 createLabel 标题 const tableFormKeys = {} SupplierdeliverInspectionDetail.allSchemas.tableFormColumns.forEach((item) => { tableFormKeys[item.field] = item.default ? item.default : '' @@ -736,6 +736,7 @@ const submitFormLabel = async (formType, data) => { await SupplierdeliverRequestMainApi.genLabel(data) isCreateLabel.value = true message.success('创建标签成功') + getList() } finally { formLabelRef.value.formLoading = false formLabelRef.value.dialogVisible = false diff --git a/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue b/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue index c7617d4fa..f7b9dc57c 100644 --- a/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue +++ b/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue @@ -329,27 +329,27 @@ const handleImport = () => { // 列表-操作按钮事件 const buttonTableClick = async (val, row) => { if (val == 'mainPurPlanOpe') { // 打开 - handleOpe(row.id) + handleOpe(row.masterId) } else if (val == 'mainPurPlanClo') {// 关闭 - handleClo(row.id) + handleClo(row.masterId) } else if (val == 'mainPlanSub') { // 提交审批 - handleSub(row.id) + handleSub(row.masterId) } else if (val == 'purchase_mainPlanSub') { // 采购审批通过 - handleApp(row.id) + handleApp(row.masterId) } else if (val == 'purchase_mainPlanTur') { // 采购驳回按钮 - handleTur(row.id) + handleTur(row.masterId) } else if (val == 'invoice_sent_out') { // 发票寄出确认 - handleInvoiceSentOut(row.id) + handleInvoiceSentOut(row.masterId) } else if(val == 'finance_mainPlanSub'){ // 财务审批通过 - handleFinanceApp(row.id) + handleFinanceApp(row.masterId) } else if(val == 'finance_mainPlanTur'){ //财务审批拒绝 - handleFinaceTur(row.id) + handleFinaceTur(row.masterId) } else if (val == 'genRecords') { // 处理 - genRecords(row.id) + genRecords(row.masterId) } else if (val == 'edit') { // 编辑 openForm('update', row) } else if (val == 'delete') { // 删除 - handleDelete(row.id) + handleDelete(row.masterId) } } @@ -368,7 +368,7 @@ const handleImport = () => { const openDetail = (row : any, titleName : any, titleValue : any) => { const departmentCode = wsCache.get(CACHE_KEY.DEPT).find((account) => account.id == row.departmentCode)?.name if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode)) - clicKRowId.value = row.id + clicKRowId.value = row.masterId detailRef.value.openDetail(row, titleName, titleValue) } diff --git a/src/views/wms/supplierManage/supplierinvoiceInvoiced/index.vue b/src/views/wms/supplierManage/supplierinvoiceInvoiced/index.vue index 19982feb2..238e38c71 100644 --- a/src/views/wms/supplierManage/supplierinvoiceInvoiced/index.vue +++ b/src/views/wms/supplierManage/supplierinvoiceInvoiced/index.vue @@ -171,9 +171,9 @@ const buttonTableClick = async (val, row) => { if (val == 'edit') { // 编辑 openForm('update', row) } else if (val == 'delete') { // 删除 - handleDelete(row.id) + handleDelete(row.masterId) } else if(val == 'agree'){ - handleAgree(row.id) + handleAgree(row.masterId) } }