diff --git a/src/api/wms/purchaseClaimRecordDetail/index.ts b/src/api/wms/purchaseClaimRecordDetail/index.ts new file mode 100644 index 000000000..3566d0afe --- /dev/null +++ b/src/api/wms/purchaseClaimRecordDetail/index.ts @@ -0,0 +1,41 @@ +import request from '@/config/axios' +// 获得采购索赔子分页 +export const getPurchaseClaimRecordDetailPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/wms/purchaseClaim-record-detail/senior', data }) + } else { + return await request.get({ url: `/wms/purchaseClaim-record-detail/page`, params }) + } +} + +// 创建采购索赔子 +export const createPurchaseClaimRecordDetail = async (data) => { + return await request.post({ url: `/wms/purchaseClaim-record-detail/create`, data }) +} + +// 修改采购索赔子 +export const updatePurchaseClaimRecordDetail = async (data) => { + return await request.put({ url: `/wms/purchaseClaim-record-detail/update`, data }) +} +// 删除采购索赔子 +export const deletePurchaseClaimRecordDetail = async (id) => { + return await request.delete({ url: `/wms/purchaseClaim-record-detail/delete?id=` + id }) +} + +// 获得采购索赔子 +export const getPurchaseClaimRecordDetail = async (id) => { + return await request.get({ url: `/wms/purchaseClaim-record-detail/get?id=` + id }) +} + + +// 导出采购索赔子 Excel +export const exportPurchaseClaimRecordDetailExcel = async (params) => { + if (params.isSearch) { + const data = {...params} + return await request.downloadPost({url: `/wms/purchaseClaim-record-detail/export-excel-senior`, data}) + } else { + return await request.download({ url: `/wms/purchaseClaim-record-detail/export-excel`, params }) + } +} diff --git a/src/api/wms/purchaseClaimRecordMain/index.ts b/src/api/wms/purchaseClaimRecordMain/index.ts new file mode 100644 index 000000000..257144e5c --- /dev/null +++ b/src/api/wms/purchaseClaimRecordMain/index.ts @@ -0,0 +1,69 @@ +import request from '@/config/axios' +export interface PurchaseClaimRecordMainVO { + id: number + number: string + supplierCode: string + claimTime: Date + status: string + supplierinvoiceNumber: string + remark: string + available: string + siteId: string + concurrencyStamp: string +} + +// 查询采购索赔主列表 +export const getPurchaseClaimRecordMainPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/wms/purchaseClaim-record-main/senior', data }) + } else { + return await request.get({ url: `/wms/purchaseClaim-record-main/page`, params }) + } +} + +// 查询采购索赔主详情 +export const getPurchaseClaimRecordMain = async (id: number) => { + return await request.get({ url: `/wms/purchaseClaim-record-main/get?id=` + id }) +} + +// 新增采购索赔主 +export const createPurchaseClaimRecordMain = async (data: PurchaseClaimRecordMainVO) => { + return await request.post({ url: `/wms/purchaseClaim-record-main/create`, data }) +} + +// 修改采购索赔主 +export const updatePurchaseClaimRecordMain = async (data: PurchaseClaimRecordMainVO) => { + return await request.put({ url: `/wms/purchaseClaim-record-main/update`, data }) +} + +// 删除采购索赔主 +export const deletePurchaseClaimRecordMain = async (id: number) => { + return await request.delete({ url: `/wms/purchaseClaim-record-main/delete?id=` + id }) +} + +// 提交审批采购索赔 +export const subPurchaseClaimRecordMain = async (id: number) => { + return await request.delete({ url: `/wms/purchaseClaim-record-main/subPurchaseClaimRecordMain?id=` + id }) +} + +// 审批通过采购索赔 +export const agreePurchaseClaimRecordMain = async (id: number) => { + return await request.delete({ url: `/wms/purchaseClaim-record-main/agreePurchaseClaimRecordMain?id=` + id }) +} + +// 审批驳回采购索赔 +export const rejectPurchaseClaimRecordMain = async (id: number) => { + return await request.delete({ url: `/wms/purchaseClaim-record-main/rejectPurchaseClaimRecordMain?id=` + id }) +} + +// 导出采购索赔主 Excel +export const exportPurchaseClaimRecordMain = async (params) => { + return await request.download({ url: `/wms/purchaseClaim-record-main/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/wms/purchaseClaim-record-main/get-import-template' }) +} \ No newline at end of file diff --git a/src/api/wms/purchaseClaimRequestDetail/index.ts b/src/api/wms/purchaseClaimRequestDetail/index.ts index c2242cf33..49edb64be 100644 --- a/src/api/wms/purchaseClaimRequestDetail/index.ts +++ b/src/api/wms/purchaseClaimRequestDetail/index.ts @@ -29,7 +29,6 @@ export const getPurchaseClaimRequestDetail = async (id) => { return await request.get({ url: `/wms/purchase-claim-request-detail/get?id=` + id }) } - // 导出采购索赔子 Excel export const exportPurchaseClaimRequestDetailExcel = async (params) => { if (params.isSearch) { diff --git a/src/api/wms/purchaseClaimRequestMain/index.ts b/src/api/wms/purchaseClaimRequestMain/index.ts index 6836bb2cd..9a7356333 100644 --- a/src/api/wms/purchaseClaimRequestMain/index.ts +++ b/src/api/wms/purchaseClaimRequestMain/index.ts @@ -46,17 +46,17 @@ export const deletePurchaseClaimRequestMain = async (id: number) => { // 提交审批采购索赔 export const subPurchaseClaimRequestMain = async (id: number) => { - return await request.delete({ url: `/wms/purchaseClaim-request-main/subPurchaseClaimRequestMain?id=` + id }) + return await request.post({ url: `/wms/purchaseClaim-request-main/sub?id=` + id }) } // 审批通过采购索赔 export const agreePurchaseClaimRequestMain = async (id: number) => { - return await request.delete({ url: `/wms/purchaseClaim-request-main/agreePurchaseClaimRequestMain?id=` + id }) + return await request.post({ url: `/wms/purchaseClaim-request-main/agree?id=` + id }) } // 审批驳回采购索赔 export const rejectPurchaseClaimRequestMain = async (id: number) => { - return await request.delete({ url: `/wms/purchaseClaim-request-main/rejectPurchaseClaimRequestMain?id=` + id }) + return await request.post({ url: `/wms/purchaseClaim-request-main/reject?id=` + id }) } // 导出采购索赔主 Excel diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue index f1a474657..c0e6c31d8 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue @@ -1185,7 +1185,7 @@ const clearInput = async (field, row, index) => { } const BASE_URL = getJmreportBaseUrl() -const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken()) +const src = ref(BASE_URL + '/jmreport/view/1016548504713515008?token=' + getAccessToken()) getListApi: PurchasePlanDetailApi.getPurchasePlanDetailPage // 分页接口 // 标签打印 diff --git a/src/views/wms/supplierManage/purchaseClaim/purchaseClaimRecord/PurchaseClaimRecordMain.data.ts b/src/views/wms/supplierManage/purchaseClaim/purchaseClaimRecord/PurchaseClaimRecordMain.data.ts new file mode 100644 index 000000000..da43783a0 --- /dev/null +++ b/src/views/wms/supplierManage/purchaseClaim/purchaseClaimRecord/PurchaseClaimRecordMain.data.ts @@ -0,0 +1,349 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' +import * as SupplierApi from '@/api/wms/supplier' +import { Supplier } from '@/views/wms/basicDataManage/supplierManage/supplier/supplier.data' +import * as ItembasicApi from "@/api/wms/itembasic"; +import { + Supplieritem +} from "@/views/wms/basicDataManage/supplierManage/supplieritem/supplieritem.data"; +import * as SupplieritemApi from "@/api/wms/supplieritem"; + +// 表单校验 +export const PurchaseClaimRecordMainRules = reactive({ + supplierCode: [ + { required: true, message: '请选择供应商代码', trigger: 'blur' } + ], + supplierName: [ + { required: true, message: '请输入供应商名称', trigger: 'blur' } + ], +}) + +export const PurchaseClaimRecordMain = useCrudSchemas(reactive([ + { + label: '单据号', + field: 'number', + sort: 'custom', + isSearch: true, + isForm: false, + table: { + width: 150 + }, + }, + { + label: '供应商代码', + field: 'supplierCode', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: {     + enterSearch:true, + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择供应商代码', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '供应商信息', // 查询弹窗标题 + searchAllSchemas: Supplier.allSchemas, // 查询弹窗所需类 + searchPage: SupplierApi.getSupplierPageSCP, // 查询弹窗所需分页方法 + verificationParams: [{ + key: 'code', + action: '==', + value: '', + isMainValue: false, + isSearch: 'true', + isFormModel: true + }], // 失去焦点校验参数 + } + } + }, + { + label: '供应商名称', + field: 'supplierName', + isDetail: true, + isSearch: true, + table: { + width: 180 + }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + disabled:true, + } + } + }, + { + label: '索赔时间', + field: 'claimTime', + sort: 'custom', + formatter: dateFormatter, + table: { + width: 180 + }, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + }, + }, + { + label: '供应商发票申请单号', + field: 'supplierinvoiceNumber', + sort: 'custom', + isSearch: true, + isForm:false, + form: { + componentProps: { + disabled: true + } + }, + table: { + width: 180 + }, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.PURCHASECLAIM_REQUEST_STATUS, + dictClass: 'string', + isTable: true, + isForm:false, + sort: 'custom', + table: { + width: 150 + }, + isSearch: true, + form: { + value: '1', + componentProps: { + disabled: true + } + } + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + isForm:false, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + isSearch: false, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + isForm:false, + table: { + width: 150 + }, + }, + { + label: '操作', + field: 'action', + isForm: false, + isDetail: false, + table: { + width: 150, + fixed: 'right' + } + } +])) +// 表单校验 +export const PurchaseClaimRecordDetailRules = reactive({ + itemCode: [ + { required: true, message: '请输入物料代码', trigger: 'blur' } + ], + claimQty: [ + { required: true, message: '请输入索赔数量', trigger: 'blur' } + ], + claimAmount: [ + { required: true, message: '请输入索赔金额', trigger: 'blur' } + ], +}) + +export const PurchaseClaimRecordDetail = useCrudSchemas(reactive([ + { + label: '物料代码', + field: 'itemCode', + sort: 'custom', + isSearch: false, + table: { + width: 150, + + }, + tableForm:{ + multiple:false,//多选 + isInpuFocusShow: true, // 开启查询弹窗 + searchListPlaceholder: '请选择物料代码',// 输入框占位文本 + searchField: 'itemCode', // 查询弹窗赋值字段 + searchTitle: '供应商物料信息', // 查询弹窗标题 + searchAllSchemas: Supplieritem.allSchemas, // 查询弹窗所需类 + searchPage: SupplieritemApi.getSupplieritemPage, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'available', + value: 'TRUE', + action: '==', + isSearch: true, + isMainValue: false + },{ + key: 'supplierCode', + value: 'supplierCode', + action: '==', + message: '供应商代码不能为空!', + isFormModel:true, // filters中添加筛选的数据--取于formModel + required:true, // 前置添加必有,和isFormModel结合使用 + isSearch: true, + isMainValue: false + }], + verificationPage: ItembasicApi.getItemListByCodes, // tableForm下方输入框校验失去焦点之后是否正确的方法 + isShowTableFormSearch: false, //tableForm下方是否出现输入框 + verificationParams: [{ + key: 'itemCode', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 + }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + disabled:true, + enterSearch: true, + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择物料代码', // 输入框占位文本 + searchField: 'itemCode', // 查询弹窗赋值字段 + searchTitle: '供应商物料信息', // 查询弹窗标题 + searchAllSchemas: Supplieritem.allSchemas, // 查询弹窗所需类 + searchPage: SupplieritemApi.getSupplieritemPage, // 查询弹窗所需分页方法 + searchCondition: [ + { + key: 'available', + value: 'TRUE', + isMainValue: false + },{ + key: 'supplierCode', + value: 'supplierCode', + message: '供应商代码不能为空!', + isMainValue:true + } + ], + verificationParams: [ + { + key: 'itemCode', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true + } + ] // 失去焦点校验参数 + } + } + }, + + { + label: '物料名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + tableForm: { + disabled:true, + type: 'Select' + }, + }, + { + label: '计量单位', + field: 'uom', + sort: 'custom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: false, + isTable: true, + table: { + width: 110 + }, + tableForm: { + disabled:true, + type: 'Select' + }, + }, + { + label: '索赔数量', + field: 'claimQty', + sort: 'custom', + isSearch: false, + isTable: true, + table: { + width: 110 + }, + tableForm: { + type: 'InputNumber', + min: 0, + precision: 0 + } + }, + { + label: '索赔金额', + field: 'claimAmount', + sort: 'custom', + isSearch: false, + isTable: true, + table: { + width: 110 + }, + tableForm: { + type: 'InputNumber', + min: 0, + precision: 5 + } + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false, + hiddenInMain:true, + table: { + width: 150, + fixed: 'right' + }, + isTableForm: false, + } +])) diff --git a/src/views/wms/supplierManage/purchaseClaim/purchaseClaimRecord/index.vue b/src/views/wms/supplierManage/purchaseClaim/purchaseClaimRecord/index.vue new file mode 100644 index 000000000..9da9ec473 --- /dev/null +++ b/src/views/wms/supplierManage/purchaseClaim/purchaseClaimRecord/index.vue @@ -0,0 +1,453 @@ + + + diff --git a/src/views/wms/supplierManage/purchaseClaim/purchaseClaimRequest/PurchaseClaimRequestMain.data.ts b/src/views/wms/supplierManage/purchaseClaim/purchaseClaimRequest/PurchaseClaimRequestMain.data.ts index 37bf58137..d9c899cb3 100644 --- a/src/views/wms/supplierManage/purchaseClaim/purchaseClaimRequest/PurchaseClaimRequestMain.data.ts +++ b/src/views/wms/supplierManage/purchaseClaim/purchaseClaimRequest/PurchaseClaimRequestMain.data.ts @@ -66,6 +66,12 @@ export const PurchaseClaimRequestMain = useCrudSchemas(reactive([ table: { width: 180 }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + disabled:true, + } + } }, { label: '索赔时间', @@ -170,7 +176,7 @@ export const PurchaseClaimRequestMain = useCrudSchemas(reactive([ isForm: false, isDetail: false, table: { - width: 150, + width: 250, fixed: 'right' } } @@ -195,8 +201,6 @@ export const PurchaseClaimRequestDetail = useCrudSchemas(reactive( sort: 'custom', isSearch: false, table: { - width: 150, - }, tableForm:{ multiple:false,//多选 @@ -275,7 +279,10 @@ export const PurchaseClaimRequestDetail = useCrudSchemas(reactive( field: 'itemName', sort: 'custom', table: { - width: 150 + }, + tableForm: { + disabled:true, + type: 'Select' }, }, { @@ -287,11 +294,11 @@ export const PurchaseClaimRequestDetail = useCrudSchemas(reactive( isSearch: false, isTable: true, table: { - width: 110 }, tableForm: { + disabled:true, type: 'Select' - } + }, }, { label: '索赔数量', @@ -300,7 +307,6 @@ export const PurchaseClaimRequestDetail = useCrudSchemas(reactive( isSearch: false, isTable: true, table: { - width: 110 }, tableForm: { type: 'InputNumber', @@ -315,7 +321,6 @@ export const PurchaseClaimRequestDetail = useCrudSchemas(reactive( isSearch: false, isTable: true, table: { - width: 110 }, tableForm: { type: 'InputNumber', @@ -330,7 +335,6 @@ export const PurchaseClaimRequestDetail = useCrudSchemas(reactive( isForm: false, hiddenInMain:true, table: { - width: 150, fixed: 'right' }, isTableForm: false, diff --git a/src/views/wms/supplierManage/purchaseClaim/purchaseClaimRequest/index.vue b/src/views/wms/supplierManage/purchaseClaim/purchaseClaimRequest/index.vue index e123e8d56..c1b32b578 100644 --- a/src/views/wms/supplierManage/purchaseClaim/purchaseClaimRequest/index.vue +++ b/src/views/wms/supplierManage/purchaseClaim/purchaseClaimRequest/index.vue @@ -242,16 +242,16 @@ const butttondata = (row, $index) => { hide: isShowMainButton(row, ['0']), hasPermi: `wms:purchaseClaimRequest:sub` }), // 提交审批 - defaultButtons.mainListPlanTurBtn({ - hide: isShowMainButton(row, ['3']), - hasPermi: `wms:purchaseClaimRequest:reject` - }), // 驳回 defaultButtons.mainListPlanAppBtn({ - hide: isShowMainButton(row, ['3']), + hide: isShowMainButton(row, ['2']), hasPermi: `wms:purchaseClaimRequest:agree` }), // 审批通过 + defaultButtons.mainListPlanTurBtn({ + hide: isShowMainButton(row, ['2']), + hasPermi: `wms:purchaseClaimRequest:reject` + }), // 驳回 defaultButtons.mainListEditBtn({ - hide: isShowMainButton(row, ['0']), + hide: isShowMainButton(row, ['0','2']), hasPermi: `wms:purchaseClaimRequest:update` }) // 编辑 ] @@ -266,6 +266,14 @@ const buttonTableClick = async (val, row) => { // 提交审批 handleSub(row.masterId) } + else if (val == 'mainPlanApp') { + // 审批通过 + handleAgree(row.masterId) + } + else if (val == 'mainPlanTur') { + // 审批驳回 + handleReject(row.masterId) + } else if (val == 'delete') { // 删除 handleDelete(row.masterId) @@ -291,6 +299,42 @@ const handleSub = async (masterId: number) => { } } +/** 审批通过按钮操作 */ +const handleAgree = async (masterId: number) => { + try { + // 关闭的二次确认 + await message.confirm(t('ts.是否审批通过所选中数据?')) + tableObject.loading = true + // 发起关闭 + await PurchaseClaimRequestMainApi.agreePurchaseClaimRequestMain(masterId) + message.success(t('ts.审批通过成功!')) + tableObject.loading = false + // 刷新列表 + await getList() + } catch { + } finally { + tableObject.loading = false + } +} + +/** 审批驳回按钮操作 */ +const handleReject = async (masterId: number) => { + try { + // 关闭的二次确认 + await message.confirm(t('是否审批驳回所选中数据?')) + tableObject.loading = true + // 发起关闭 + await PurchaseClaimRequestMainApi.rejectPurchaseClaimRequestMain(masterId) + message.success(t('审批驳回成功!')) + tableObject.loading = false + // 刷新列表 + await getList() + } catch { + } finally { + tableObject.loading = false + } +} + /** 添加/修改操作 */ const formRef = ref()