From 4f0b7a45ed5e1d1d7c56e09b4d0fc5b91969fa2d Mon Sep 17 00:00:00 2001 From: gaojs Date: Mon, 8 Apr 2024 16:27:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=A5=E5=BA=9F=E6=8B=86=E8=A7=A3=E4=B8=BB?= =?UTF-8?q?=E8=A1=A8=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mes/dismantlingMain/index.ts | 55 ++++ src/utils/dict.ts | 1 + .../dismantlingMain/dismantlingMain.data.ts | 177 +++++++++++++ src/views/mes/dismantlingMain/index.vue | 244 ++++++++++++++++++ 4 files changed, 477 insertions(+) create mode 100644 src/api/mes/dismantlingMain/index.ts create mode 100644 src/views/mes/dismantlingMain/dismantlingMain.data.ts create mode 100644 src/views/mes/dismantlingMain/index.vue diff --git a/src/api/mes/dismantlingMain/index.ts b/src/api/mes/dismantlingMain/index.ts new file mode 100644 index 000000000..67bb42263 --- /dev/null +++ b/src/api/mes/dismantlingMain/index.ts @@ -0,0 +1,55 @@ +import request from '@/config/axios' + +export interface DismantlingMainVO { + deleteTime: Date + id: number + status: string + concurrencyStamp: number + remark: string + deleter: string + siteId: number + dismantlingBillno: string + productionCode: string + workbillType: string +} + +// 查询报废拆解登记主列表 +export const getDismantlingMainPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/mes/dismantling-main/senior', data }) + } else { + return await request.get({ url: `/mes/dismantling-main/page`, params }) + } +} + +// 查询报废拆解登记主详情 +export const getDismantlingMain = async (id: number) => { + return await request.get({ url: `/mes/dismantling-main/get?id=` + id }) +} + +// 新增报废拆解登记主 +export const createDismantlingMain = async (data: DismantlingMainVO) => { + return await request.post({ url: `/mes/dismantling-main/create`, data }) +} + +// 修改报废拆解登记主 +export const updateDismantlingMain = async (data: DismantlingMainVO) => { + return await request.put({ url: `/mes/dismantling-main/update`, data }) +} + +// 删除报废拆解登记主 +export const deleteDismantlingMain = async (id: number) => { + return await request.delete({ url: `/mes/dismantling-main/delete?id=` + id }) +} + +// 导出报废拆解登记主 Excel +export const exportDismantlingMain = async (params) => { + return await request.download({ url: `/mes/dismantling-main/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/mes/dismantling-main/get-import-template' }) +} \ No newline at end of file diff --git a/src/utils/dict.ts b/src/utils/dict.ts index b94418c4c..a29a1fd4b 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -311,6 +311,7 @@ export enum DICT_TYPE { REWORK_TYPE='rework_type',//工作类型:返工登记、返修登记 REWORK_STATUS='rework_status',//返工返修状态:待返修,返修中,返修完成 REWORK_REPLACE_FLAG = 'rework_replace_flag',//是否有替换件 + DISMANTLING_BILL_TYPE = 'dismantling_bill_type',//工单类型 SUPPLIERINVOICE_REQUEST_STATUS = 'supplierinvoice_request_status', //发票申请状态 SUPPLIERINVOICE_STATUS = 'supplierinvoice_status', //待开票审核状态 } diff --git a/src/views/mes/dismantlingMain/dismantlingMain.data.ts b/src/views/mes/dismantlingMain/dismantlingMain.data.ts new file mode 100644 index 000000000..9e09bf0bb --- /dev/null +++ b/src/views/mes/dismantlingMain/dismantlingMain.data.ts @@ -0,0 +1,177 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' +import {Itembasic} from "@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data"; +import * as ItembasicApi from "@/api/wms/itembasic"; + +// 表单校验 +export const DismantlingMainRules = reactive({ + productionCode: [required], + workbillType: [required], +}) + +export const DismantlingMain = useCrudSchemas(reactive([ + { + label: '删除时间', + field: 'deleteTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: false, + isTable: false, + isForm: false, + isDetail: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')] + } + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + }, + }, + { + label: '主键', + field: 'id', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false, + isDetail:false, + }, + { + label: '并发乐观锁', + field: 'concurrencyStamp', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false, + isDetail:false, + form: { + component: 'InputNumber', + value: 0 + }, + }, + { + label: '创建时间', + field: 'createTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: false, + isTable: false, + isForm: false, + isDetail: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')] + } + }, + isForm: false, + }, + { + label: '删除用户名', + field: 'deleter', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false, + isDetail:false, + }, + { + label: '位置ID', + field: 'siteId', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false, + isDetail:false, + form: { + component: 'InputNumber', + value: 0 + }, + }, + { + label: '单据编号', + field: 'dismantlingBillno', + sort: 'custom', + isSearch: true, + isForm: false, + isDetail: true + }, + { + label: '产品编码', + field: 'productionCode', + sort: 'custom', + isSearch: true, + form: { + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchTitle: '产品编码', // 查询弹窗标题 + searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类 + searchField: 'code', // 查询弹窗赋值字段 + searchPage: ItembasicApi.getItembasicPage, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + }, + { + key: 'type', + action: 'in', // 查询拼接条件 + isSearch: true, // 使用自定义拼接条件 + value: 'BCP,CCP',//,SEMI] + isMainValue: false + }] + } + } + }, + { + label: '工单类型', + field: 'workbillType', + sort: 'custom', + dictType: DICT_TYPE.DISMANTLING_BILL_TYPE, + dictClass: 'string', + isSearch: true, + }, + { + label: '工单状态', + field: 'status', + sort: 'custom', + dictType: DICT_TYPE.QUALIFY_STATUS, + dictClass: 'string', + isForm: true, + isSearch: true, + isTable: true, + form: { + component: 'Switch', + value: '2', + componentProps: { + inactiveValue: '2', + activeValue: '1' + } + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + isSearch: true, + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +])) diff --git a/src/views/mes/dismantlingMain/index.vue b/src/views/mes/dismantlingMain/index.vue new file mode 100644 index 000000000..bf517c993 --- /dev/null +++ b/src/views/mes/dismantlingMain/index.vue @@ -0,0 +1,244 @@ + + +