Browse Source

生产计划修改

master
陈薪名 1 year ago
parent
commit
de79caed47
  1. 44
      src/api/wms/productionMain/index.ts
  2. 85
      src/views/wms/productionManage/productionplan/productionMain/index.vue
  3. 146
      src/views/wms/productionManage/productionplan/productionMain/productionMain.data.ts

44
src/api/wms/productionMain/index.ts

@ -61,4 +61,46 @@ export const exportProductionMain = async (params) => {
// 下载用户导入模板 // 下载用户导入模板
export const importTemplate = () => { export const importTemplate = () => {
return request.download({ url: '/wms/production-main/get-import-template' }) return request.download({ url: '/wms/production-main/get-import-template' })
} }
// 关闭
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 })
}

85
src/views/wms/productionManage/productionplan/productionMain/index.vue

@ -67,7 +67,6 @@
:apiUpdate="ProductionDetailApi.updateProductionDetail" :apiUpdate="ProductionDetailApi.updateProductionDetail"
:apiPage="ProductionDetailApi.getProductionDetailPage" :apiPage="ProductionDetailApi.getProductionDetailPage"
:apiDelete="ProductionDetailApi.deleteProductionDetail" :apiDelete="ProductionDetailApi.deleteProductionDetail"
:Echo="Echo"
@searchTableSuccessDetail="searchTableSuccessDetail" @searchTableSuccessDetail="searchTableSuccessDetail"
/> />
@ -104,21 +103,9 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
if (type == 'tableForm') { if (type == 'tableForm') {
// //
row[formField] = val[0][searchField] 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 { } else {
const setV = {} const setV = {}
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
//setV['ppNumber'] = val[0]['ppNumber']
//setV['supplierCode'] = val[0]['supplierCode']
formRef.setValues(setV) 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({ const { tableObject, tableMethods } = useTable({
getListApi: ProductionMainApi.getProductionMainPage // getListApi: ProductionMainApi.getProductionMainPage //
}) })
@ -189,29 +172,75 @@ const isShowMainButton = (row,val) => {
// - // -
const butttondata = (row) => { const butttondata = (row) => {
return [ return [
defaultButtons.mainListPlanOpeBtn({hide:isShowMainButton(row,['5','4'])}), // defaultButtons.mainListPlanOpeBtn({hide:isShowMainButton(row,['5'])}), //
defaultButtons.mainListPlanCloBtn({hide:isShowMainButton(row,['1','2','3','4','6'])}), // defaultButtons.mainListPlanCloBtn({hide:isShowMainButton(row,['1','2','3','4'])}), //
defaultButtons.mainListPlanSubBtn({hide:isShowMainButton(row,['1'])}), // defaultButtons.mainListPlanSubBtn({hide:isShowMainButton(row,['1'])}), //
defaultButtons.mainListPlanTurBtn({hide:isShowMainButton(row,['2'])}), // defaultButtons.mainListPlanTurBtn({hide:isShowMainButton(row,['2'])}), //
defaultButtons.mainListPlanAppBtn({hide:isShowMainButton(row,['2'])}), // defaultButtons.mainListPlanAppBtn({hide:isShowMainButton(row,['2'])}), //
defaultButtons.mainListPlanPubBtn({hide:isShowMainButton(row,['3'])}), // defaultButtons.mainListPlanPubBtn({hide:isShowMainButton(row,['3'])}), //
defaultButtons.mainListPlanResBtn({hide:isShowMainButton(row,['4'])}), //
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:production-main:update'}), // 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) => { const buttonTableClick = async (val, row) => {
if (val == 'mainPlanOpe') { // 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') { // } 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') { // } 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') { // } 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') { // } 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') { // } else if (val == 'edit') { //
openForm('update', row) openForm('update', row)
} else if (val == 'delete') { // } else if (val == 'delete') { //
@ -254,7 +283,7 @@ const handleExport = async () => {
// //
exportLoading.value = true exportLoading.value = true
const data = await ProductionMainApi.exportProductionMain(setSearchParams) const data = await ProductionMainApi.exportProductionMain(setSearchParams)
download.excel(data, '生产计划.xls') download.excel(data, '生产计划.xls')
} catch { } catch {
} finally { } finally {
exportLoading.value = false exportLoading.value = false
@ -281,9 +310,9 @@ const handleDeleteTable = (item, index) => {
// //
const submitForm = async (formType, data) => { const submitForm = async (formType, data) => {
data.subList = tableData.value //
try { try {
if (formType === 'create') { if (formType === 'create') {
data.subList = tableData.value //
await ProductionMainApi.createProductionMain(data) await ProductionMainApi.createProductionMain(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
} else { } else {
@ -307,7 +336,7 @@ const handleImport = () => {
// //
const importTemplateData = reactive({ const importTemplateData = reactive({
templateUrl: '', templateUrl: '',
templateTitle: '生产计划导入模版.xls' templateTitle: '生产计划导入模版.xls'
}) })
// //

146
src/views/wms/productionManage/productionplan/productionMain/productionMain.data.ts

@ -137,6 +137,48 @@ export const ProductionMain = useCrudSchemas(reactive<CrudSchema[]>([
} }
}, },
}, },
{
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: '业务类型', label: '业务类型',
field: 'businessType', field: 'businessType',
@ -154,7 +196,7 @@ export const ProductionMain = useCrudSchemas(reactive<CrudSchema[]>([
}, },
{ {
label: '备注', label: '备注',
field: 'remrk', field: 'remark',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
@ -254,48 +296,48 @@ export const ProductionMain = useCrudSchemas(reactive<CrudSchema[]>([
}, },
isForm: false, isForm: false,
}, },
{ // {
label: '订单号', // label: '订单号',
field: 'woNumber', // field: 'woNumber',
sort: 'custom', // sort: 'custom',
table: { // table: {
width: 150 // width: 150
}, // },
form: { // form: {
// labelMessage: '信息提示说明!!!', // // labelMessage: '信息提示说明!!!',
componentProps: { // componentProps: {
isSearchList: true, // isSearchList: true,
searchListPlaceholder: '请选择订单号', // searchListPlaceholder: '请选择订单号',
searchField: 'number', // searchField: 'number',
searchTitle: '生产订单信息', // searchTitle: '生产订单信息',
searchAllSchemas: WorkMain.allSchemas, // searchAllSchemas: WorkMain.allSchemas,
searchPage: WorkMainApi.getWorkMainPage // searchPage: WorkMainApi.getWorkMainPage
} // }
}, // },
isTable: false, // isTable: false,
isForm: false, // isForm: false,
}, // },
{ // {
label: '订单行', // label: '订单行',
field: 'woLine', // field: 'woLine',
sort: 'custom', // sort: 'custom',
table: { // table: {
width: 150 // width: 150
}, // },
form: { // form: {
// labelMessage: '信息提示说明!!!', // // labelMessage: '信息提示说明!!!',
componentProps: { // componentProps: {
isSearchList: true, // isSearchList: true,
searchListPlaceholder: '请选择订单行', // searchListPlaceholder: '请选择订单行',
searchField: 'lineNumber', // searchField: 'lineNumber',
searchTitle: '生产订单信息', // searchTitle: '生产订单信息',
searchAllSchemas: WorkDetail.allSchemas, // searchAllSchemas: WorkDetail.allSchemas,
searchPage: WorkDetailApi.getWorkDetailPage // searchPage: WorkDetailApi.getWorkDetailPage
} // }
}, // },
isTable: false, // isTable: false,
isForm: false, // isForm: false,
}, // },
{ {
label: '最后更新者', label: '最后更新者',
field: 'updater', field: 'updater',
@ -385,6 +427,12 @@ export const ProductionMainRules = reactive({
status: [ status: [
{ required: true, message: '请选择状态', trigger: 'change' } { required: true, message: '请选择状态', trigger: 'change' }
], ],
beginTime: [
{ required: true, message: '请输入开始日期', trigger: 'blur' }
],
endTime: [
{ required: true, message: '请输入结束日期', trigger: 'blur' }
],
// businessType: [ // businessType: [
// { required: true, message: '请输入业务类型', trigger: 'blur' } // { required: true, message: '请输入业务类型', trigger: 'blur' }
// ], // ],
@ -412,7 +460,7 @@ export const ProductionDetail = useCrudSchemas(reactive<CrudSchema[]>([
searchPage: ProductionlineitemApi.getProductionlineitemPage, // 查询弹窗所需分页方法 searchPage: ProductionlineitemApi.getProductionlineitemPage, // 查询弹窗所需分页方法
searchCondition: [{ searchCondition: [{
key:'productionLineCode', key:'productionLineCode',
value:'prodLine', value:'productionLine',
isMainValue: true isMainValue: true
}] }]
} }
@ -657,8 +705,8 @@ export const ProductionDetail = useCrudSchemas(reactive<CrudSchema[]>([
tableForm: { tableForm: {
type: 'Select' type: 'Select'
}, },
isTableForm: false, // isTableForm: false,
isForm: false // isForm: false
}, },
{ {
label: '操作', label: '操作',
@ -684,9 +732,9 @@ export const ProductionDetailRules = reactive({
// notGoodQty: [ // notGoodQty: [
// { required: true, message: '请输入不合格数量', trigger: 'blur' } // { required: true, message: '请输入不合格数量', trigger: 'blur' }
// ], // ],
// available: [ available: [
// { required: true, message: '请选择是否可用', trigger: 'change' } { required: true, message: '请选择是否可用', trigger: 'change' }
// ], ],
uom: [ uom: [
{ required: true, message: '请选择计量单位', trigger: 'change' } { required: true, message: '请选择计量单位', trigger: 'change' }
], ],

Loading…
Cancel
Save