Browse Source

测试采购收货申请主

master
liuchen864 1 year ago
parent
commit
aaf790dea1
  1. 2
      src/api/wms/productreceiptRequestMain/index.ts
  2. 32
      src/api/wms/purchasereceiptRequestMain/index.ts
  3. 14
      src/locales/en-US.ts
  4. 14
      src/locales/zh-CN.ts
  5. 13
      src/utils/disposition/defaultButtons.ts
  6. 101
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue
  7. 4
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/purchasereceiptRequestMain.data.ts

2
src/api/wms/productreceiptRequestMain/index.ts

@ -64,4 +64,4 @@ export const exportProductreceiptRequestMain = async (params) => {
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/productreceipt-request-main/get-import-template' })
}
}

32
src/api/wms/purchasereceiptRequestMain/index.ts

@ -70,4 +70,34 @@ export const exportPurchasereceiptRequestMain = async (params) => {
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/purchasereceipt-request-main/get-import-template' })
}
}
// 关闭采购收货申请主 Excel
export const closeProductreceiptRequestMain = async (id) => {
return await request.put({ url: `/wms/purchasereceipt-request-main/close?id=` + id })
}
// 重新添加采购收货申请主 Excel
export const reAddProductreceiptRequestMain = async (id) => {
return await request.put({ url: `/wms/purchasereceipt-request-main/reAdd?id=` + id })
}
// 提交采购收货申请主 Excel
export const submitProductreceiptRequestMain = async (id) => {
return await request.put({ url: `/wms/purchasereceipt-request-main/submit?id=` + id })
}
// 审批通过采购收货申请主 Excel
export const agreeProductreceiptRequestMain = async (id) => {
return await request.put({ url: `/wms/purchasereceipt-request-main/agree?id=` + id })
}
// 审批驳回采购收货申请主 Excel
export const refusedProductreceiptRequestMain = async (id) => {
return await request.put({ url: `/wms/purchasereceipt-request-main/refused?id=` + id })
}
// 处理驳回采购收货申请主 Excel
export const handleProductreceiptRequestMain = async (id) => {
return await request.put({ url: `/wms/purchasereceipt-request-main/handle?id=` + id })
}

14
src/locales/en-US.ts

@ -54,7 +54,19 @@ export default {
updateTime: 'Update Time',
copy: 'Copy',
copySuccess: 'Copy Success',
copyError: 'Copy Error'
copyError: 'Copy Error',
closeSuccess: 'Close Success',
reAddSuccess: 'ReAdd Success',
submitSuccess: 'Submit Success',
agreeSuccess: 'Agree Success',
refusedSuccess: 'Refused Success',
handleSuccess: 'Handle Success',
confirmColse: 'Confirm Close?',
confirmReAdd: 'Confirm ReAdd?',
confirmAgree: 'Confirm Agree?',
confirmRefused: 'Confirm Refused?',
confirmHandle: 'Confirm Handle?',
confirmSubmit: 'Confirm Submit?',
},
error: {
noPermission: `Sorry, you don't have permission to access this page.`,

14
src/locales/zh-CN.ts

@ -54,7 +54,19 @@ export default {
updateTime: '更新时间',
copy: '复制',
copySuccess: '复制成功',
copyError: '复制失败'
copyError: '复制失败',
closeSuccess: '关闭成功',
reAddSuccess: '重新添加成功',
submitSuccess: '提交成功',
agreeSuccess: '审批通过成功',
refusedSuccess: '审批驳回成功',
handleSuccess: '执行成功',
confirmColse: '确认关闭吗?',
confirmReAdd: '确认重新添加吗?',
confirmAgree: '确认审批通过吗?',
confirmRefused: '确认审批驳回吗?',
confirmHandle: '确认处理吗?',
confirmSubmit: '确认提交吗?',
},
error: {
noPermission: `抱歉,您无权访问此页面。`,

13
src/utils/disposition/defaultButtons.ts

@ -316,6 +316,19 @@ export function mainListApproveBtn(option:any) {
})
}
// 主列表-申请流程-处理按钮
export function mainListHandleBtn(option:any) {
return __defaultBtnOption(option,{
label: '处理',
name: 'mainHandle',
hide: false,
type: 'primary',
color: '',
link: true, // 文本展现按钮
hasPermi: ''
})
}
// 主列表-订单流程-发布按钮
export function mainListOrderPubBtn(option:any) {
return __defaultBtnOption(option,{

101
src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue

@ -148,29 +148,15 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:purchasereceipt-request-main:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:purchasereceipt-request-main:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:purchasereceipt-request-main:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
@ -193,33 +179,31 @@ const isShowMainButton = (row,val) => {
const butttondata = (row) => {
return [
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4','6'])}), //
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5'])}), //
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['5'])}), //
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1'])}), //
defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2'])}), //
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2'])}), //
defaultButtons.mainListEditBtn({hasPermi:'wms:purchasereceipt-request-main:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:purchasereceipt-request-main:delete'}), //
defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3'])}), //
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:purchasereceipt-request-main:update'}), //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'mainClose') { //
console.log('列表-操作按钮事件-关闭')
handleClose(row.id)
} else if (val == 'mainReAdd') { //
console.log('列表-操作按钮事件-重新添加')
handleReAdd(row.id)
} else if (val == 'mainSubmit') { //
console.log('列表-操作按钮事件-提交审批')
handleSubmit(row.id)
} else if (val == 'mainTurnDown') { //
console.log('列表-操作按钮事件-驳回')
handleRefused(row.id)
} else if (val == 'mainApprove') { //
console.log('列表-操作按钮事件-审批通过')
handleAgree(row.id)
} else if (val == 'mainHandle') { //
handleHandle(row.id)
} else if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
@ -236,15 +220,62 @@ const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue)
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
/** 关闭按钮操作 */
const handleClose = async (id: number) => {
try {
await message.confirm(t('common.confirmColse'))
await PurchasereceiptRequestMainApi.closeProductreceiptRequestMain(id)
message.success(t('common.closeSuccess'))
await getList()
} catch {}
}
/** 重新添加按钮操作 */
const handleReAdd = async (id: number) => {
try {
await message.confirm(t('common.confirmReAdd'))
await PurchasereceiptRequestMainApi.reAddProductreceiptRequestMain(id)
message.success(t('common.reAddSuccess'))
await getList()
} catch {}
}
/** 审批通过按钮操作 */
const handleAgree = async (id: number) => {
try {
await message.confirm(t('common.confirmAgree'))
await PurchasereceiptRequestMainApi.agreeProductreceiptRequestMain(id)
message.success(t('common.agreeSuccess'))
await getList()
} catch {}
}
/** 审批驳回按钮操作 */
const handleRefused = async (id: number) => {
try {
await message.confirm(t('common.confirmRefused'))
await PurchasereceiptRequestMainApi.refusedProductreceiptRequestMain(id)
message.success(t('common.refusedSuccess'))
await getList()
} catch {}
}
/** 处理按钮操作 */
const handleHandle = async (id: number) => {
try {
await message.confirm(t('common.confirmHandle'))
await PurchasereceiptRequestMainApi.handleProductreceiptRequestMain(id)
message.success(t('common.handleSuccess'))
await getList()
} catch {}
}
/** 提交按钮操作 */
const handleSubmit = async (id: number) => {
try {
//
await message.delConfirm()
//
await PurchasereceiptRequestMainApi.deletePurchasereceiptRequestMain(id)
message.success(t('common.delSuccess'))
//
await message.confirm(t('common.confirmSubmit'))
await PurchasereceiptRequestMainApi.submitProductreceiptRequestMain(id)
message.success(t('common.closeSuccess'))
await getList()
} catch {}
}

4
src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/purchasereceiptRequestMain.data.ts

@ -418,7 +418,7 @@ export const PurchasereceiptRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
isDetail: false,
isForm: false,
table: {
width: 300,
width: 230,
fixed: 'right'
},
}
@ -995,4 +995,4 @@ export const PurchasereceiptRequestDetailRules = reactive({
itemCode: [
{ required: true, message: '请输入物品代码', trigger: 'change' }
],
})
})

Loading…
Cancel
Save