From 144904d97fe1a12bced287e63d9e3438816f3453 Mon Sep 17 00:00:00 2001 From: chenfang Date: Thu, 11 Apr 2024 11:51:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BE=9B=E5=BA=94=E5=95=86=E5=8F=91=E8=B4=A7?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E8=B4=A8=E6=A3=80=E4=BF=A1=E6=81=AF=E5=AD=90?= =?UTF-8?q?=E8=A1=A8=E6=96=B0=E5=A2=9E=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../supplierdeliverInspectionDetail/index.ts | 54 ++++ .../supplierdeliverInspectionDetail/index.vue | 244 ++++++++++++++++++ .../supplierdeliverInspectionDetail.data.ts | 89 +++++++ .../supplierdeliverRequestMain/index.vue | 30 +-- 4 files changed, 399 insertions(+), 18 deletions(-) create mode 100644 src/api/wms/supplierdeliverInspectionDetail/index.ts create mode 100644 src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverInspectionDetail/index.vue create mode 100644 src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverInspectionDetail/supplierdeliverInspectionDetail.data.ts diff --git a/src/api/wms/supplierdeliverInspectionDetail/index.ts b/src/api/wms/supplierdeliverInspectionDetail/index.ts new file mode 100644 index 000000000..cd689c6f7 --- /dev/null +++ b/src/api/wms/supplierdeliverInspectionDetail/index.ts @@ -0,0 +1,54 @@ +import request from '@/config/axios' + +export interface SupplierdeliverInspectionDetailVO { + id: number + itemCode: string + uom: string + batch: string + planQty: number + remark: string + extraProperties: string + concurrencyStamp: number + siteId: string +} + +// 查询供应商发货申请质检信息子列表 +export const getSupplierdeliverInspectionDetailPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/wms/supplierdeliver-inspection-detail/senior', data }) + } else { + return await request.get({ url: `/wms/supplierdeliver-inspection-detail/page`, params }) + } +} + +// 查询供应商发货申请质检信息子详情 +export const getSupplierdeliverInspectionDetail = async (id: number) => { + return await request.get({ url: `/wms/supplierdeliver-inspection-detail/get?id=` + id }) +} + +// 新增供应商发货申请质检信息子 +export const createSupplierdeliverInspectionDetail = async (data: SupplierdeliverInspectionDetailVO) => { + return await request.post({ url: `/wms/supplierdeliver-inspection-detail/create`, data }) +} + +// 修改供应商发货申请质检信息子 +export const updateSupplierdeliverInspectionDetail = async (data: SupplierdeliverInspectionDetailVO) => { + return await request.put({ url: `/wms/supplierdeliver-inspection-detail/update`, data }) +} + +// 删除供应商发货申请质检信息子 +export const deleteSupplierdeliverInspectionDetail = async (id: number) => { + return await request.delete({ url: `/wms/supplierdeliver-inspection-detail/delete?id=` + id }) +} + +// 导出供应商发货申请质检信息子 Excel +export const exportSupplierdeliverInspectionDetail = async (params) => { + return await request.download({ url: `/wms/supplierdeliver-inspection-detail/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/wms/supplierdeliver-inspection-detail/get-import-template' }) +} \ No newline at end of file diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverInspectionDetail/index.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverInspectionDetail/index.vue new file mode 100644 index 000000000..522f05e2b --- /dev/null +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverInspectionDetail/index.vue @@ -0,0 +1,244 @@ + + + diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverInspectionDetail/supplierdeliverInspectionDetail.data.ts b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverInspectionDetail/supplierdeliverInspectionDetail.data.ts new file mode 100644 index 000000000..0f5cf23aa --- /dev/null +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverInspectionDetail/supplierdeliverInspectionDetail.data.ts @@ -0,0 +1,89 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' + +// 表单校验 +export const SupplierdeliverInspectionDetailRules = reactive({ + itemCode: [required], + uom: [required], + concurrencyStamp: [required], +}) + +export const SupplierdeliverInspectionDetail = useCrudSchemas(reactive([ + { + label: '代码', + field: 'itemCode', + sort: 'custom', + isSearch: true, + }, + { + label: '计量单位', + field: 'uom', + sort: 'custom', + isSearch: true, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + isSearch: true, + }, + { + label: '计划数量', + field: 'planQty', + sort: 'custom', + isSearch: true, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + isSearch: true, + }, + { + label: '创建时间', + field: 'createTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: true, + 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')] + } + }, + isForm: false, + }, + { + label: '扩展属性', + field: 'extraProperties', + sort: 'custom', + isSearch: true, + }, + { + label: '并发乐观锁', + field: 'concurrencyStamp', + sort: 'custom', + isSearch: true, + form: { + component: 'InputNumber', + value: 0 + }, + }, + { + label: '地点ID', + field: 'siteId', + sort: 'custom', + isSearch: true, + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +])) diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue index 4b63f0065..729446ffb 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue @@ -116,8 +116,8 @@ :formAllSchemas="UploadQualityReport.allSchemas" :tableAllSchemas="UploadQualityReport.allSchemas" :tableData="ploadQualityReportTableData" - @handleAddTable="handleAddTableUploadQualityReport" - @handleDeleteTable="handleDeleteTableUploadQualityReport" + @handleAddTable="SupplierdeliverInspectionDetailApi.createSupplierdeliverInspectionDetail" + @handleDeleteTable="SupplierdeliverInspectionDetailApi.deleteSupplierdeliverInspectionDetail" @submitForm="submitFormUploadQualityReport" :isShowReduceButton="true" /> @@ -142,6 +142,7 @@ import * as SupplierdeliverRequestDetailApi from '@/api/wms/supplierdeliverReque import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as PurchasePlanDetailApi from '@/api/wms/purchasePlanDetail' import * as ItembasicApi from '@/api/wms/itembasic' +import * as SupplierdeliverInspectionDetailApi from '@/api/wms/supplierdeliverInspectionDetail' import { PurchasePlanDetail } from '../purchasePlanMain/purchasePlanMain.data' import { addDay } from '@/utils/formatTime' @@ -577,24 +578,17 @@ const handleUploadQualityReport = async (id: number) => { }) ploadQualityReportTableData.value = [tableFormKeys] } -const handleAddTableUploadQualityReport = ()=>{ - const tableFormKeys = {} - UploadQualityReport.allSchemas.tableFormColumns.forEach((item) => { - tableFormKeys[item.field] = item.default ? item.default : '' - }) - ploadQualityReportTableData.value.push(tableFormKeys) -} -const handleDeleteTableUploadQualityReport = (item, index) => { - ploadQualityReportTableData.value.splice(index, 1) -} -const submitFormUploadQualityReport = (formType, data) => { - console.log("formType==",formType) - console.log("data==",data) +const submitFormUploadQualityReport = async (formType, data) => { + if (formType === 'create') { + await SupplierdeliverInspectionDetailApi.createSupplierdeliverInspectionDetail(data) + message.success(t('common.createSuccess')) + } else { + await SupplierdeliverInspectionDetailApi.updateSupplierdeliverInspectionDetail(data) + message.success(t('common.updateSuccess')) + } ploadQualityReportRef.value.dialogVisible = false - // formLabelRef.value.formLoading = false - // formLabelRef.value.dialogVisible = false - + getList() } /** 提交审批按钮操作 */