Browse Source

备料计划

master
陈薪名 1 year ago
parent
commit
438207721f
  1. 41
      src/api/wms/preparetoissueMain/index.ts
  2. 145
      src/views/wms/issueManage/preparetoissueplan/preparetoissueMain/index.vue
  3. 21
      src/views/wms/issueManage/preparetoissueplan/preparetoissueMain/preparetoissueMain.data.ts

41
src/api/wms/preparetoissueMain/index.ts

@ -53,10 +53,51 @@ export const deletePreparetoissueMain = async (id: number) => {
// 导出备料计划主 Excel
export const exportPreparetoissueMain = async (params) => {
if (params.isSearch) {
const data = {...params}
return await request.downloadPost({ url: `/wms/preparetoissue-main/export-excel-senior`, data })
} else {
return await request.download({ url: `/wms/preparetoissue-main/export-excel`, params })
}
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/preparetoissue-main/get-import-template' })
}
// 关闭
export const close = (id) => {
return request.put({ url: '/wms/preparetoissue-main/close?id=' + id })
}
// 提交审批
export const submit = (id) => {
return request.put({ url: '/wms/preparetoissue-main/submit?id=' + id })
}
// 打开
export const open = (id) => {
return request.put({ url: '/wms/preparetoissue-main/open?id=' + id })
}
// 驳回
export const reject = (id) => {
return request.put({ url: '/wms/preparetoissue-main/reject?id=' + id })
}
// 驳回
export const agree = (id) => {
return request.put({ url: '/wms/preparetoissue-main/agree?id=' + id })
}
// 发布
export const publish = (id) => {
return request.put({ url: '/wms/preparetoissue-main/publish?id=' + id })
}
// 重置
export const resetting = (id) => {
return request.put({ url: '/wms/preparetoissue-main/resetting?id=' + id })
}

145
src/views/wms/issueManage/preparetoissueplan/preparetoissueMain/index.vue

@ -33,7 +33,7 @@
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
@ -50,6 +50,7 @@
:apiUpdate="PreparetoissueMainApi.updatePreparetoissueMain"
:apiCreate="PreparetoissueMainApi.createPreparetoissueMain"
:isBusiness="true"
:isShowButton="isShowButton"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess"
@ -80,6 +81,8 @@ import { PreparetoissueMain,PreparetoissueMainRules,PreparetoissueDetail,Prepare
import * as PreparetoissueMainApi from '@/api/wms/preparetoissueMain'
import * as PreparetoissueDetailApi from '@/api/wms/preparetoissueDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as ProductionDetailApi from '@/api/wms/productionDetail'
import * as ProductionlineitemApi from '@/api/wms/productionlineitem'
//
defineOptions({ name: 'PreparetoissueMain' })
@ -92,6 +95,8 @@ const routeName = ref()
routeName.value = route.name
const tableColumns = ref(PreparetoissueMain.allSchemas.tableColumns)
const isShowButton = ref(true)
//
const updataTableColumns = (val) => {
tableColumns.value = val
@ -109,9 +114,53 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
setV[formField] = val[0][searchField]
if (formField == 'productionPlanNumber') {
setV['workshop'] = val[0]['workshop']
setV['prodLine'] = val[0]['production_line']
setV['prodLine'] = val[0]['productionLine']
setV['shift'] = val[0]['shift']
setV['team'] = val[0]['team']
isShowButton.value = false
//
ProductionDetailApi.getProductionDetailPage({
masterId: val[0]['id'],
pageSize: 100,
pageNo: 1,
sort: '',
by: 'ASC'
}).then(res => {
if (res) tableData.value = res.list
// 线 线
tableData.value.map(item => {
ProductionlineitemApi.getProductionlineitemPage({
productionLineCode: val[0]['productionLine'],
itemCode: item.itemCode,
pageSize: 100,
pageNo: 1,
sort: '',
by: 'ASC'
}).then(res => {
item.toLocationCode = res.list[0].rawLocationCode
})
})
// tableform
PreparetoissueDetail.allSchemas.tableFormColumns.map(item => {
if(item.field == 'itemCode') {
item.isInpuFocusShow = false
item.tableForm.isInpuFocusShow = false
item.tableForm.disabled = true
}
if(item.field == 'planQty') {
item.tableForm.disabled = true
}
if(item.field == 'uom') {
item.tableForm.disabled = true
}
if(item.field == 'available') {
item.tableForm.disabled = true
}
})
}).catch(err => {
console.log(err)
message.error('错误')
})
}
formRef.setValues(setV)
}
@ -136,8 +185,8 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:preparetoissue-main:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:preparetoissue-main:import'}), //
defaultButtons.defaultAddBtn({hasPermi:'wms:preparetoissue-main:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:preparetoissue-main:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:preparetoissue-main:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
@ -156,6 +205,7 @@ const HeadButttondata = [
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
resetShow()
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
@ -180,29 +230,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('列表-操作按钮事件-打开')
PreparetoissueMainApi.open(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainPlanClo') { //
console.log('列表-操作按钮事件-关闭')
await message.confirm('确认要关闭吗?')
PreparetoissueMainApi.close(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainPlanSub') { //
console.log('列表-操作按钮事件-提交审批')
await message.confirm('确认要提交审批吗?')
PreparetoissueMainApi.submit(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainPlanTur') { //
console.log('列表-操作按钮事件-驳回')
await message.confirm('确认要驳回吗?')
PreparetoissueMainApi.reject(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainPlanApp') { //
console.log('列表-操作按钮事件-审批通过')
await message.confirm('确认要审批通过吗?')
PreparetoissueMainApi.agree(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainPlanPub') { //
await message.confirm('确认要发布吗?')
PreparetoissueMainApi.publish(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainPlanRes') { //
await message.confirm('确认要重置吗?')
PreparetoissueMainApi.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') { //
@ -315,9 +411,32 @@ const searchFormClick = (searchData) => {
getList() //
}
// /
//
const resetShow = async () => {
isShowButton.value = true // tableform
// tableform
PreparetoissueDetail.allSchemas.tableFormColumns.map(item => {
if(item.field == 'itemCode') {
item.isInpuFocusShow = true
item.tableForm.isInpuFocusShow = true
item.tableForm.disabled = false
}
if(item.field == 'planQty') {
item.tableForm.disabled = false
}
if(item.field == 'uom') {
item.tableForm.disabled = false
}
if(item.field == 'available') {
item.tableForm.disabled = false
}
})
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await PreparetoissueMainApi.importTemplate()
// importTemplateData.templateUrl = await PreparetoissueMainApi.importTemplate()
})
</script>

21
src/views/wms/issueManage/preparetoissueplan/preparetoissueMain/preparetoissueMain.data.ts

@ -80,7 +80,7 @@ export const PreparetoissueMain = useCrudSchemas(reactive<CrudSchema[]>([
width: 150
},
form: {
labelMessage: '该生产线会影响明细中的物品代码,需在基础管理生产线物品关系中维护',
labelMessage: '该生产线会影响明细中的物品代码,工位',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择生产线', // 输入框占位文本
@ -476,7 +476,12 @@ export const PreparetoissueDetail = useCrudSchemas(reactive<CrudSchema[]>([
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '工位信息', // 查询弹窗标题
searchAllSchemas: Workstation.allSchemas, // 查询弹窗所需类
searchPage: WorkStationApi.getWorkstationPage // 查询弹窗所需分页方法
searchPage: WorkStationApi.getWorkstationPage, // 查询弹窗所需分页方法
searchCondition: [{
key:'productionLineCode',
value:'prodLine',
isMainValue: true
}]
}
},
tableForm:{
@ -485,7 +490,12 @@ export const PreparetoissueDetail = useCrudSchemas(reactive<CrudSchema[]>([
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '工位信息', // 查询弹窗标题
searchAllSchemas: Workstation.allSchemas, // 查询弹窗所需类
searchPage: WorkStationApi.getWorkstationPage // 查询弹窗所需分页方法
searchPage: WorkStationApi.getWorkstationPage, // 查询弹窗所需分页方法
searchCondition: [{
key:'productionLineCode',
value:'prodLine',
isMainValue: true
}]
},
},
{
@ -499,6 +509,11 @@ export const PreparetoissueDetail = useCrudSchemas(reactive<CrudSchema[]>([
table: {
width: 180
},
tableForm: {
type: 'FormDateTime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
},
form: {
component: 'DatePicker',
componentProps: {

Loading…
Cancel
Save