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 = () => {
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"
: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'
})
//

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: '业务类型',
field: 'businessType',
@ -154,7 +196,7 @@ export const ProductionMain = useCrudSchemas(reactive<CrudSchema[]>([
},
{
label: '备注',
field: 'remrk',
field: 'remark',
sort: 'custom',
table: {
width: 150
@ -254,48 +296,48 @@ export const ProductionMain = useCrudSchemas(reactive<CrudSchema[]>([
},
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<CrudSchema[]>([
searchPage: ProductionlineitemApi.getProductionlineitemPage, // 查询弹窗所需分页方法
searchCondition: [{
key:'productionLineCode',
value:'prodLine',
value:'productionLine',
isMainValue: true
}]
}
@ -657,8 +705,8 @@ export const ProductionDetail = useCrudSchemas(reactive<CrudSchema[]>([
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' }
],

Loading…
Cancel
Save