Browse Source

测试修改

master_hella_20240701
zhaoxuebing 6 months ago
parent
commit
3de9f01d62
  1. 30
      src/api/wms/processproductionRequestMain/index.ts
  2. 132
      src/views/wms/productionManage/processproduction/processproductionRequest/index.vue

30
src/api/wms/processproductionRequestMain/index.ts

@ -54,4 +54,34 @@ export const exportProcessproductionRequestMain = async (params) => {
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/processproduction-request-main/get-import-template' })
}
// 关闭
export const closeProcessproductionRequestMain = async (id) => {
return await request.put({ url: `/wms/processproduction-request-main/close?id=` + id })
}
// 重新添加
export const reAddProcessproductionRequestMain = async (id) => {
return await request.put({ url: `/wms/processproduction-request-main/reAdd?id=` + id })
}
// 提交审批
export const submitProcessproductionRequestMain = async (id) => {
return await request.put({ url: `/wms/processproduction-request-main/submit?id=` + id })
}
// 审批驳回
export const refusedProcessproductionRequestMain = async (id) => {
return await request.put({ url: `/wms/processproduction-request-main/refused?id=` + id })
}
// 审批通过
export const agreeProcessproductionRequestMain = async (id) => {
return await request.put({ url: `/wms/processproduction-request-main/agree?id=` + id })
}
// 处理
export const handleProcessproductionRequestMain = async (id) => {
return await request.put({ url: `/wms/processproduction-request-main/handle?id=` + id })
}

132
src/views/wms/productionManage/processproduction/processproductionRequest/index.vue

@ -166,6 +166,16 @@ const buttonBaseClick = (val, item) => {
}
}
//
const isShowMainButton = (row,val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
// -
const butttondata = (row,$index) => {
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1
@ -173,8 +183,14 @@ const butttondata = (row,$index) => {
return []
}
return [
defaultButtons.mainListEditBtn({hasPermi:'wms:processproduction-request-main:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:processproduction-request-main:delete'}), //
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4']),hasPermi:'wms:processproduction-request-main:close'}), //
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5']),hasPermi:'wms:transferreceipt-request-main:reAdd'}), //
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:transferreceipt-request-main:submit'}), //
defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:transferreceipt-request-main:refused'}), //
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:transferreceipt-request-main:agree'}), //
defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3']),hasPermi:'wms:transferreceipt-request-main:handle'}), //
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:processproduction-request-main:update'}), //
defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:processproduction-request-main:delete'}), //
]
}
@ -182,19 +198,116 @@ const buttondataTable = ref()
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
if (val == 'mainClose') { //
handleClose(row.masterId)
} else if(val == 'mainReAdd'){//
handleReAdd(row.masterId)
} else if(val == ''){ //
handleSubmit(row.masterId)
} else if (val == 'mainTurnDown') { //
handleRefused(row.masterId)
} else if (val == 'mainApprove') { //
handleAgree(row.masterId)
} else if (val == 'mainHandle') { //
handleHandle(row.masterId)
} else if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 关闭按钮操作 */
const handleClose = async (id: number) => {
try {
await message.confirm(t('common.confirmColse'))
tableObject.loading = true
await ProcessproductionRequestMainApi.closeProcessproductionRequestMain(id)
message.success(t('common.closeSuccess'))
tableObject.loading = false
await getList()
} catch {}
}
/** 重新添加按钮操作 */
const handleReAdd = async (id: number) => {
try {
await message.confirm(t('common.confirmReAdd'))
tableObject.loading = true
await ProcessproductionRequestMainApi.reAddProcessproductionRequestMain(id)
message.success(t('common.reAddSuccess'))
tableObject.loading = false
await getList()
} catch {}
}
/** 提交按钮操作 */
const handleSubmit = async (id: number) => {
try {
await message.confirm(t('common.confirmSubmit'))
tableObject.loading = true
await ProcessproductionRequestMainApi.submitProcessproductionRequestMain(id)
message.success(t('common.submitSuccess'))
tableObject.loading = false
await getList()
} catch {}
}
/** 审批驳回按钮操作 */
const handleRefused = async (id: number) => {
try {
await message.confirm(t('common.confirmRefused'))
tableObject.loading = true
await ProcessproductionRequestMainApi.refusedProcessproductionRequestMain(id)
message.success(t('common.refusedSuccess'))
tableObject.loading = false
await getList()
} catch {}
}
/** 审批通过按钮操作 */
const handleAgree = async (id: number) => {
try {
await message.confirm(t('common.confirmAgree'))
tableObject.loading = true
await ProcessproductionRequestMainApi.agreeProcessproductionRequestMain(id)
message.success(t('common.agreeSuccess'))
tableObject.loading = false
await getList()
} catch {}
}
/** 处理按钮操作 */
const handleHandle = async (id: number) => {
try {
await message.confirm(t('common.confirmHandle'))
tableObject.loading = true
await ProcessproductionRequestMainApi.handleProcessproductionRequestMain(id)
message.success(t('common.handleSuccess'))
tableObject.loading = false
await getList()
} catch {}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await ProcessproductionRequestMainApi.deleteProcessproductionRequestMain(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
//
const submitForm = async (formType, data) => {
@ -241,19 +354,6 @@ const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicProcessproductionRequestMain')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await ProcessproductionRequestMainApi.deleteProcessproductionRequestMain(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {

Loading…
Cancel
Save