diff --git a/src/api/wms/productionMain/index.ts b/src/api/wms/productionMain/index.ts index 38e522816..c28218676 100644 --- a/src/api/wms/productionMain/index.ts +++ b/src/api/wms/productionMain/index.ts @@ -61,4 +61,46 @@ export const exportProductionMain = async (params) => { // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/wms/production-main/get-import-template' }) -} \ No newline at end of file +} + +// 关闭 +export const close = (id) => { + return request.put({ url: '/wms/production-main/close?id=' + id }) +} + +// 提交审批 +export const submit = (id) => { + return request.put({ url: '/wms/production-main/submit?id=' + id }) +} + +// 打开 +export const open = (id) => { + return request.put({ url: '/wms/production-main/open?id=' + id }) +} + +// 驳回 +export const reject = (id) => { + return request.put({ url: '/wms/production-main/reject?id=' + id }) +} + +// 驳回 +export const agree = (id) => { + return request.put({ url: '/wms/production-main/agree?id=' + id }) +} + +// 发布 +export const publish = (id) => { + return request.put({ url: '/wms/production-main/publish?id=' + id }) +} + +// 重置 +export const resetting = (id) => { + return request.put({ url: '/wms/production-main/resetting?id=' + id }) +} + + + + + + + diff --git a/src/views/wms/productionManage/productionplan/productionMain/index.vue b/src/views/wms/productionManage/productionplan/productionMain/index.vue index 881c93545..ae8a4dc30 100644 --- a/src/views/wms/productionManage/productionplan/productionMain/index.vue +++ b/src/views/wms/productionManage/productionplan/productionMain/index.vue @@ -67,7 +67,6 @@ :apiUpdate="ProductionDetailApi.updateProductionDetail" :apiPage="ProductionDetailApi.getProductionDetailPage" :apiDelete="ProductionDetailApi.deleteProductionDetail" - :Echo="Echo" @searchTableSuccessDetail="searchTableSuccessDetail" /> @@ -104,21 +103,9 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => if (type == 'tableForm') { // 明细查询页赋值 row[formField] = val[0][searchField] - //row['poLine'] = val[0]['poLine'] - //row['batch'] = val[0]['toBatch'] - //row['altBatch'] = val[0]['altBatch'] - //row['itemCode'] = val[0]['itemCode'] - //row['itemName'] = val[0]['itemName'] - //row['itemDesc1'] = val[0]['itemDesc1'] - //row['itemDesc2'] = val[0]['itemDesc2'] - //row['projectCode'] = val[0]['projectCode'] - //row['qty'] = val[0]['qty'] - //row['uom'] = val[0]['uom'] } else { const setV = {} setV[formField] = val[0][searchField] - //setV['ppNumber'] = val[0]['ppNumber'] - //setV['supplierCode'] = val[0]['supplierCode'] formRef.setValues(setV) } }) @@ -132,10 +119,6 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { }) } -// 子表新增的时候选择表格之后需要会显得字段 -// const Echo = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom'] -const Echo = [] - const { tableObject, tableMethods } = useTable({ getListApi: ProductionMainApi.getProductionMainPage // 分页接口 }) @@ -189,29 +172,75 @@ const isShowMainButton = (row,val) => { // 列表-操作按钮 const butttondata = (row) => { return [ - defaultButtons.mainListPlanOpeBtn({hide:isShowMainButton(row,['5','4'])}), // 打开 - defaultButtons.mainListPlanCloBtn({hide:isShowMainButton(row,['1','2','3','4','6'])}), // 关闭 + defaultButtons.mainListPlanOpeBtn({hide:isShowMainButton(row,['5'])}), // 打开 + defaultButtons.mainListPlanCloBtn({hide:isShowMainButton(row,['1','2','3','4'])}), // 关闭 defaultButtons.mainListPlanSubBtn({hide:isShowMainButton(row,['1'])}), // 提交审批 defaultButtons.mainListPlanTurBtn({hide:isShowMainButton(row,['2'])}), // 驳回 defaultButtons.mainListPlanAppBtn({hide:isShowMainButton(row,['2'])}), // 审批通过 defaultButtons.mainListPlanPubBtn({hide:isShowMainButton(row,['3'])}), // 发布 + defaultButtons.mainListPlanResBtn({hide:isShowMainButton(row,['4'])}), // 重置 defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:production-main:update'}), // 编辑 - defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:production-main:delete'}), // 删除 + // defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:production-main:delete'}), // 删除 ] } // 列表-操作按钮事件 const buttonTableClick = async (val, row) => { if (val == 'mainPlanOpe') { // 打开 - console.log('列表-操作按钮事件-打开') + ProductionMainApi.open(row.id).then(() => { + message.success(t('common.updateSuccess')) + getList() + }).catch(err => { + console.log(err) + }) } else if (val == 'mainPlanClo') { // 关闭 - console.log('列表-操作按钮事件-关闭') + await message.confirm('确认要关闭吗?') + ProductionMainApi.close(row.id).then(() => { + message.success(t('common.updateSuccess')) + getList() + }).catch(err => { + console.log(err) + }) } else if (val == 'mainPlanSub') { // 提交审批 - console.log('列表-操作按钮事件-提交审批') + await message.confirm('确认要提交审批吗?') + ProductionMainApi.submit(row.id).then(() => { + message.success(t('common.updateSuccess')) + getList() + }).catch(err => { + console.log(err) + }) } else if (val == 'mainPlanTur') { // 驳回 - console.log('列表-操作按钮事件-驳回') + await message.confirm('确认要驳回吗?') + ProductionMainApi.reject(row.id).then(() => { + message.success(t('common.updateSuccess')) + getList() + }).catch(err => { + console.log(err) + }) } else if (val == 'mainPlanApp') { // 审批通过 - console.log('列表-操作按钮事件-审批通过') + await message.confirm('确认要审批通过吗?') + ProductionMainApi.agree(row.id).then(() => { + message.success(t('common.updateSuccess')) + getList() + }).catch(err => { + console.log(err) + }) + } else if (val == 'mainPlanPub') { // 发布 + await message.confirm('确认要发布吗?') + ProductionMainApi.publish(row.id).then(() => { + message.success(t('common.updateSuccess')) + getList() + }).catch(err => { + console.log(err) + }) + } else if (val == 'mainPlanRes') { // 重置 + await message.confirm('确认要重置吗?') + ProductionMainApi.resetting(row.id).then(() => { + message.success(t('common.updateSuccess')) + getList() + }).catch(err => { + console.log(err) + }) } else if (val == 'edit') { // 编辑 openForm('update', row) } else if (val == 'delete') { // 删除 @@ -254,7 +283,7 @@ const handleExport = async () => { // 发起导出 exportLoading.value = true const data = await ProductionMainApi.exportProductionMain(setSearchParams) - download.excel(data, '生产计划主.xls') + download.excel(data, '生产计划.xls') } catch { } finally { exportLoading.value = false @@ -281,9 +310,9 @@ const handleDeleteTable = (item, index) => { // 主子数据 提交 const submitForm = async (formType, data) => { - data.subList = tableData.value // 拼接子表数据参数 try { if (formType === 'create') { + data.subList = tableData.value // 拼接子表数据参数 await ProductionMainApi.createProductionMain(data) message.success(t('common.createSuccess')) } else { @@ -307,7 +336,7 @@ const handleImport = () => { // 导入附件弹窗所需的参数 const importTemplateData = reactive({ templateUrl: '', - templateTitle: '生产计划主导入模版.xls' + templateTitle: '生产计划导入模版.xls' }) // 导入成功之后 diff --git a/src/views/wms/productionManage/productionplan/productionMain/productionMain.data.ts b/src/views/wms/productionManage/productionplan/productionMain/productionMain.data.ts index 3d25bae46..addc1c137 100644 --- a/src/views/wms/productionManage/productionplan/productionMain/productionMain.data.ts +++ b/src/views/wms/productionManage/productionplan/productionMain/productionMain.data.ts @@ -137,6 +137,48 @@ export const ProductionMain = useCrudSchemas(reactive([ } }, }, + { + label: '开始日期', + field: 'beginTime', + 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: 'endTime', + 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: 'businessType', @@ -154,7 +196,7 @@ export const ProductionMain = useCrudSchemas(reactive([ }, { label: '备注', - field: 'remrk', + field: 'remark', sort: 'custom', table: { width: 150 @@ -254,48 +296,48 @@ export const ProductionMain = useCrudSchemas(reactive([ }, isForm: false, }, - { - label: '订单号', - field: 'woNumber', - sort: 'custom', - table: { - width: 150 - }, - form: { - // labelMessage: '信息提示说明!!!', - componentProps: { - isSearchList: true, - searchListPlaceholder: '请选择订单号', - searchField: 'number', - searchTitle: '生产订单信息', - searchAllSchemas: WorkMain.allSchemas, - searchPage: WorkMainApi.getWorkMainPage - } - }, - isTable: false, - isForm: false, - }, - { - label: '订单行', - field: 'woLine', - sort: 'custom', - table: { - width: 150 - }, - form: { - // labelMessage: '信息提示说明!!!', - componentProps: { - isSearchList: true, - searchListPlaceholder: '请选择订单行', - searchField: 'lineNumber', - searchTitle: '生产订单信息', - searchAllSchemas: WorkDetail.allSchemas, - searchPage: WorkDetailApi.getWorkDetailPage - } - }, - isTable: false, - isForm: false, - }, + // { + // label: '订单号', + // field: 'woNumber', + // sort: 'custom', + // table: { + // width: 150 + // }, + // form: { + // // labelMessage: '信息提示说明!!!', + // componentProps: { + // isSearchList: true, + // searchListPlaceholder: '请选择订单号', + // searchField: 'number', + // searchTitle: '生产订单信息', + // searchAllSchemas: WorkMain.allSchemas, + // searchPage: WorkMainApi.getWorkMainPage + // } + // }, + // isTable: false, + // isForm: false, + // }, + // { + // label: '订单行', + // field: 'woLine', + // sort: 'custom', + // table: { + // width: 150 + // }, + // form: { + // // labelMessage: '信息提示说明!!!', + // componentProps: { + // isSearchList: true, + // searchListPlaceholder: '请选择订单行', + // searchField: 'lineNumber', + // searchTitle: '生产订单信息', + // searchAllSchemas: WorkDetail.allSchemas, + // searchPage: WorkDetailApi.getWorkDetailPage + // } + // }, + // isTable: false, + // isForm: false, + // }, { label: '最后更新者', field: 'updater', @@ -385,6 +427,12 @@ export const ProductionMainRules = reactive({ status: [ { required: true, message: '请选择状态', trigger: 'change' } ], + beginTime: [ + { required: true, message: '请输入开始日期', trigger: 'blur' } + ], + endTime: [ + { required: true, message: '请输入结束日期', trigger: 'blur' } + ], // businessType: [ // { required: true, message: '请输入业务类型', trigger: 'blur' } // ], @@ -412,7 +460,7 @@ export const ProductionDetail = useCrudSchemas(reactive([ searchPage: ProductionlineitemApi.getProductionlineitemPage, // 查询弹窗所需分页方法 searchCondition: [{ key:'productionLineCode', - value:'prodLine', + value:'productionLine', isMainValue: true }] } @@ -657,8 +705,8 @@ export const ProductionDetail = useCrudSchemas(reactive([ tableForm: { type: 'Select' }, - isTableForm: false, - isForm: false + // isTableForm: false, + // isForm: false }, { label: '操作', @@ -684,9 +732,9 @@ export const ProductionDetailRules = reactive({ // notGoodQty: [ // { required: true, message: '请输入不合格数量', trigger: 'blur' } // ], - // available: [ - // { required: true, message: '请选择是否可用', trigger: 'change' } - // ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], uom: [ { required: true, message: '请选择计量单位', trigger: 'change' } ],