From ef0d559612ff1320762be0fcfa57d984c37ce0fd Mon Sep 17 00:00:00 2001 From: yufei0306 <13417315+yufei0306@user.noreply.gitee.com> Date: Tue, 2 Apr 2024 10:30:03 +0800 Subject: [PATCH 01/16] =?UTF-8?q?MES--=E5=B7=A5=E4=BD=8D=E7=AE=A1=E7=90=86?= =?UTF-8?q?--=E8=AF=A6=E6=83=85=E5=AD=90=E9=A1=B5=E9=9D=A2=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0SearchTable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mes/workstation/components/Detail.vue | 106 +++++++++++++++++- src/views/mes/workstation/index.vue | 34 ++++-- 2 files changed, 126 insertions(+), 14 deletions(-) diff --git a/src/views/mes/workstation/components/Detail.vue b/src/views/mes/workstation/components/Detail.vue index 81dc468ec..e73351b0a 100644 --- a/src/views/mes/workstation/components/Detail.vue +++ b/src/views/mes/workstation/components/Detail.vue @@ -138,6 +138,8 @@ @onBlur="onBlur" @formFormDateChange="formFormDateChange" /> + + @@ -299,7 +301,18 @@ const props = defineProps({ type: Boolean, required: false, default: true - } + }, + //是否直接展示搜索表单 + isOpenSearchTable:{ + type: Boolean, + required: false, + default: false + }, + searchTableSchema: { + type: Array, + required: false, + default: null + }, }) const isShowDrawer = ref(false) const detailLoading = ref(false) @@ -381,6 +394,79 @@ const HeadButttondata = ref() // 列表-操作按钮 const buttondata = ref() + +/** isOpenSearchTable 对应 表格弹窗 */ +const initModel = (schema: FormSchema[], formModel: Recordable) => { + const model: Recordable = { ...formModel } + schema.map((v) => { + // 如果是hidden,就删除对应的值 + if (v.hidden) { + delete model[v.field] + } else if (v.component && v.component !== 'Divider') { + const hasField = Reflect.has(model, v.field) + // 如果先前已经有值存在,则不进行重新赋值,而是采用现有的值 + model[v.field] = hasField ? model[v.field] : v.value !== void 0 ? v.value : '' + } + }) + return model +} +const searchTableRef = ref() +const searchTableFormModel = ref({}) +if(props.isOpenSearchTable){ + searchTableFormModel.value = initModel(props.searchTableSchema.formSchema, unref(searchTableFormModel)) +} +const searchTableFormType = ref('') // 表单的类型:create - 新增;update - 修改 + + +// 直接打开表格数据 --> 对应:isOpenSearchTable === true +const opensearchTable = ( + formField, + searchField, + searchTitle, + searchAllSchemas, + searchPage, + searchCondition, + multiple, + type, + row +) => { + const _searchCondition = {} + // 判断查询条件中,是否存在指向主表的数据 + if (searchCondition && searchCondition.length > 0) { + // 转换筛选条件所需 + for (var i=0; i< searchCondition.length; i++ ) { + // 查询条件为主表某字段,需要赋值主表数据,数据来源是详情的,赋值需要从row中获取 + if (searchCondition[i].isMainValue) { + _searchCondition[searchCondition[i].key] = detailData + ? detailData.value[searchCondition[i].value] + : '' + }else{ + _searchCondition[searchCondition[i].key] = searchCondition[i].value + } + } + } + console.log(searchCondition) + console.log(_searchCondition) + searchTableRef.value.open( + searchTitle, + searchAllSchemas, + searchPage, + formField, + searchField, + multiple, + type, + row, + _searchCondition + ) +} +const searchTableSuccess1 = (formField, searchField, val, formRef) => { + console.log('searchTableSuccess1',val) + searchTableFormModel.value[formField] = val.map(item=>item[searchField]).join(',') + console.log('searchTableSuccess1',searchTableFormModel) + submitForm(searchTableFormType.value,searchTableFormModel.value) + emit('searchTableSuccessDetail', formField, searchField, val, formRef) +} + /** 打开弹窗 */ const formRef = ref() const titleNameRef = ref() @@ -512,7 +598,22 @@ const { getList } = tableMethodsRef.value const buttonBaseClick = (val, item) => { if (val == 'add') { // 新增 - openForm('create') + if(props.isOpenSearchTable){ + searchTableFormType.value = 'create' + // 如果需要直接打开表格数据 + const item = props.searchTableSchema.formSchema[0] + opensearchTable( + item.field, item?.componentProps?.searchField, + item?.componentProps?.searchTitle, + item?.componentProps?.searchAllSchemas, + item?.componentProps?.searchPage, + item?.componentProps?.searchCondition, + item?.componentProps?.multiple, + undefined,undefined + ) + }else{ + openForm('create') + } } else if (val == 'import') { // 导入 handleImport() @@ -554,6 +655,7 @@ const openForm = async (type: string, row?: number) => { } // form 提交 const submitForm = async (formType, data) => { + console.log('submitForm',data) try { // 子表新增编辑校验 如果业务需要子表提交校验 需在主页详情组件添加 detailValidate 参数及方法 const rs = (await props.detailValidate) ? await props.detailValidate(data) : true diff --git a/src/views/mes/workstation/index.vue b/src/views/mes/workstation/index.vue index 8c3be7b0c..61ed6f2b0 100644 --- a/src/views/mes/workstation/index.vue +++ b/src/views/mes/workstation/index.vue @@ -52,18 +52,21 @@ { apiPage.value = WorkstationApi.getTeamPage detailAllSchemas.value = Team.allSchemas tabsDeleteApi = WorkstationApi.deleteTeamRelation + tabsCreateApi = WorkstationApi.createTeamRelation }else if(data.prop == 'Equipment'){ apiPage.value = WorkstationApi.getEquipmentPage detailAllSchemas.value = Equipment.allSchemas tabsDeleteApi = WorkstationApi.deleteEquipmentRelation + tabsCreateApi = WorkstationApi.createEquipmentRelation + }else if(data.prop == 'Process'){ apiPage.value = WorkstationApi.getProcessPage detailAllSchemas.value = Process.allSchemas tabsDeleteApi = WorkstationApi.deleteProcessRelation + tabsCreateApi = WorkstationApi.createProcessRelation + }else if(data.prop == 'Opersteps'){ apiPage.value = WorkstationApi.getOperstepsPage detailAllSchemas.value = Opersteps.allSchemas tabsDeleteApi = WorkstationApi.deleteOperstepsRelation + tabsCreateApi = WorkstationApi.createOperstepsRelation } } const teamListRef = ref() From 48f03ef90d7797e64b11f493b05d03bc6b49352c Mon Sep 17 00:00:00 2001 From: bjang03 Date: Tue, 2 Apr 2024 10:30:16 +0800 Subject: [PATCH 02/16] =?UTF-8?q?1=E3=80=81=E5=A2=9E=E5=8A=A0=E6=9C=88?= =?UTF-8?q?=E5=BA=A6=E8=AE=A1=E5=88=92=E4=B8=BB=E8=A1=A8=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mes/ordermonthplan/index.ts | 60 +++++ src/views/mes/ordermonthplan/index.vue | 244 ++++++++++++++++++ .../ordermonthplan/mesOrderMonthMain.data.ts | 86 ++++++ .../mes/workstation/mesOrderMonthMain.data.ts | 83 ++++++ src/views/mes/workstation/workstation.data.ts | 2 +- 5 files changed, 474 insertions(+), 1 deletion(-) create mode 100644 src/api/mes/ordermonthplan/index.ts create mode 100644 src/views/mes/ordermonthplan/index.vue create mode 100644 src/views/mes/ordermonthplan/mesOrderMonthMain.data.ts create mode 100644 src/views/mes/workstation/mesOrderMonthMain.data.ts diff --git a/src/api/mes/ordermonthplan/index.ts b/src/api/mes/ordermonthplan/index.ts new file mode 100644 index 000000000..3c86a1a5c --- /dev/null +++ b/src/api/mes/ordermonthplan/index.ts @@ -0,0 +1,60 @@ +import request from '@/config/axios' + +export interface MesOrderMonthMainVO { + deleteTime: Date + id: number + status: string + concurrencyStamp: number + remark: string + deleter: string + siteId: number + sourceType: string + planMasterCode: string + planSubCode: string + planType: string + checker: string + checkDate: string + factoryCode: string + factoryName: string +} + +// 查询订单计划月主列表 +export const getMesOrderMonthMainPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/plan/mes-order-month-main/senior', data }) + } else { + return await request.get({ url: `/plan/mes-order-month-main/page`, params }) + } +} + +// 查询订单计划月主详情 +export const getMesOrderMonthMain = async (id: number) => { + return await request.get({ url: `/plan/mes-order-month-main/get?id=` + id }) +} + +// 新增订单计划月主 +export const createMesOrderMonthMain = async (data: MesOrderMonthMainVO) => { + return await request.post({ url: `/plan/mes-order-month-main/create`, data }) +} + +// 修改订单计划月主 +export const updateMesOrderMonthMain = async (data: MesOrderMonthMainVO) => { + return await request.put({ url: `/plan/mes-order-month-main/update`, data }) +} + +// 删除订单计划月主 +export const deleteMesOrderMonthMain = async (id: number) => { + return await request.delete({ url: `/plan/mes-order-month-main/delete?id=` + id }) +} + +// 导出订单计划月主 Excel +export const exportMesOrderMonthMain = async (params) => { + return await request.download({ url: `/plan/mes-order-month-main/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/plan/mes-order-month-main/get-import-template' }) +} diff --git a/src/views/mes/ordermonthplan/index.vue b/src/views/mes/ordermonthplan/index.vue new file mode 100644 index 000000000..31e9bca22 --- /dev/null +++ b/src/views/mes/ordermonthplan/index.vue @@ -0,0 +1,244 @@ + + + diff --git a/src/views/mes/ordermonthplan/mesOrderMonthMain.data.ts b/src/views/mes/ordermonthplan/mesOrderMonthMain.data.ts new file mode 100644 index 000000000..b30b0fc88 --- /dev/null +++ b/src/views/mes/ordermonthplan/mesOrderMonthMain.data.ts @@ -0,0 +1,86 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' + +// 表单校验 +export const MesOrderMonthMainRules = reactive({ +}) + +export const MesOrderMonthMain = useCrudSchemas(reactive([ + { + label: '备注', + field: 'remark', + sort: 'custom', + isTable: false + }, + { + 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: 'creator', + sort: 'custom', + isSearch: true, + isForm: false + }, + { + label: '主计划编码', + field: 'planMasterCode', + sort: 'custom', + isSearch: true + }, + { + label: '计划辅助编码', + field: 'planSubCode', + sort: 'custom', + isSearch: true + }, + { + label: '计划类型', + field: 'planType', + sort: 'custom', + isSearch: true, + form: { + component: 'SelectV2' + } + }, + { + label: '审核人', + field: 'checker', + sort: 'custom', + isSearch: true + }, + { + label: '工厂编码', + field: 'factoryCode', + sort: 'custom', + isSearch: true + }, + { + label: '工厂名称', + field: 'factoryName', + sort: 'custom', + isSearch: true + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +])) diff --git a/src/views/mes/workstation/mesOrderMonthMain.data.ts b/src/views/mes/workstation/mesOrderMonthMain.data.ts new file mode 100644 index 000000000..d766ae00a --- /dev/null +++ b/src/views/mes/workstation/mesOrderMonthMain.data.ts @@ -0,0 +1,83 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' + +// 表单校验 +export const MesOrderMonthMainRules = reactive({ +}) + +export const MesOrderMonthMain = useCrudSchemas(reactive([ + { + label: '备注', + field: 'remark', + sort: 'custom', + isTable: false + }, + { + 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: 'creator', + sort: 'custom', + isSearch: true, + isForm: false + }, + { + label: '主计划编码', + field: 'planMasterCode', + sort: 'custom', + isTable: false, + isSearch: true + }, + { + label: '计划辅助编码', + field: 'planSubCode', + sort: 'custom', + isTable: false, + isSearch: true + }, + { + label: '计划类型', + field: 'planType', + sort: 'custom', + isSearch: true, + form: { + component: 'SelectV2' + } + }, + { + label: '工厂编码', + field: 'factoryCode', + sort: 'custom', + isTable: false + }, + { + label: '工厂名称', + field: 'factoryName', + sort: 'custom', + isSearch: true, + isForm: false + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +])) diff --git a/src/views/mes/workstation/workstation.data.ts b/src/views/mes/workstation/workstation.data.ts index e5ac54c59..013f12c8d 100644 --- a/src/views/mes/workstation/workstation.data.ts +++ b/src/views/mes/workstation/workstation.data.ts @@ -228,7 +228,7 @@ export const popList = useCrudSchemas(reactive([ searchField: 'code', // 查询弹窗赋值字段 searchTitle: '仓库信息', // 查询弹窗标题 searchAllSchemas: Team.allSchemas, // 查询弹窗所需类 - searchPage: WorkstationApi.getTeamPage, // 查询弹窗所需分页方法 + searchPage: WorkstationApi.checkTeamPageList, // 查询弹窗所需分页方法 searchCondition: [{ key: 'available', value: 'TRUE', From 741557e41416f5b71bd8dc97c930a42017a82645 Mon Sep 17 00:00:00 2001 From: bjang03 Date: Tue, 2 Apr 2024 10:39:00 +0800 Subject: [PATCH 03/16] =?UTF-8?q?1=E3=80=81=E5=A2=9E=E5=8A=A0=E6=9C=88?= =?UTF-8?q?=E5=BA=A6=E8=AE=A1=E5=88=92=E4=B8=BB=E8=A1=A8=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/mes/workstation/index.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/views/mes/workstation/index.vue b/src/views/mes/workstation/index.vue index 61ed6f2b0..7357c3f9a 100644 --- a/src/views/mes/workstation/index.vue +++ b/src/views/mes/workstation/index.vue @@ -101,7 +101,6 @@ let tabsDeleteApi = WorkstationApi.deleteTeamRelation let tabsCreateApi = WorkstationApi.createTeamRelation const message = useMessage() // 消息弹窗 const { t } = useI18n() // 国际化 -const teamRef = ref() const route = useRoute() // 路由信息 const routeName = ref() routeName.value = route.name From 863f0561ab0e981e1b3ddbf2db0498e2421c0abc Mon Sep 17 00:00:00 2001 From: yufei0306 <13417315+yufei0306@user.noreply.gitee.com> Date: Tue, 2 Apr 2024 11:24:41 +0800 Subject: [PATCH 04/16] =?UTF-8?q?=E9=87=87=E8=B4=AD=E6=94=B6=E8=B4=A7?= =?UTF-8?q?=E7=AE=A1=E7=90=86--=E4=BE=9B=E5=BA=94=E5=95=86=E5=8F=91?= =?UTF-8?q?=E8=B4=A7---=E9=87=87=E8=B4=AD=E8=AE=A2=E5=8D=95---=E6=96=B0?= =?UTF-8?q?=E5=A2=9E--=E6=B7=BB=E5=8A=A0=E6=98=8E=E7=BB=86--=E5=A4=9A?= =?UTF-8?q?=E9=80=89=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/BasicForm/src/BasicForm.vue | 8 +++- .../supplierdeliver/purchaseMain/index.vue | 40 ++++++++++++------- .../purchaseMain/purchaseMain.data.ts | 1 + 3 files changed, 33 insertions(+), 16 deletions(-) diff --git a/src/components/BasicForm/src/BasicForm.vue b/src/components/BasicForm/src/BasicForm.vue index bdeb41002..4977efef5 100644 --- a/src/components/BasicForm/src/BasicForm.vue +++ b/src/components/BasicForm/src/BasicForm.vue @@ -266,6 +266,12 @@ const props = defineProps({ required: false, default: false }, + // TableForm 的第几列按钮 + indexTableColumn :{ + type: Number, + required: false, + default: 0 + } }) const { t } = useI18n() // 国际化 @@ -576,7 +582,7 @@ const handleAddTable = () => { tableAllSchemas.value.tableFormColumns.forEach(item => { tableFormKeys[item.field] = item.default ? item.default : '' }) - inpuFocus(tableAllSchemas.value.tableFormColumns[0],tableFormKeys,0) + inpuFocus(tableAllSchemas.value.tableFormColumns[props.indexTableColumn],tableFormKeys,0) }else{ emit('handleAddTable') } diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/index.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/index.vue index ac0a5bd4d..645d5f1eb 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/index.vue +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/index.vue @@ -28,6 +28,8 @@ 0){ - subList.forEach((item) => { - if(item.itemCode == val[0]['itemCode']){ - flag = true; + const repeatCode = [] //重复数据 + if(tableData.value.length > 0){ + tableData.value.forEach((item) => { + const findIndex = val.findIndex(valItem=>valItem['itemCode']==item.itemCode) + if(findIndex > -1){ + val.splice(findIndex,1) + repeatCode.push(item.itemCode) } }) } - if(flag){ - message.warning("物料代码已经存在"); - return; + if(repeatCode.length>0){ + message.warning(`物料代码${repeatCode.join(',')}已经存在`); } - row[formField] = val[0][searchField] - await ItembasicApi.getItembasicPage({ - code: row['itemCode'] - }).then(res => { - row['uom'] = res.list[0].uom - }) + if(val.length>0){ + val.forEach(item=>{ + const newRow = {...row} + newRow[formField] = item[searchField] + tableData.value.push(newRow) + }) + const itemCodes = val.map(valItem=>valItem['itemCode']) + await ItembasicApi.getItembasicPage({ + code: itemCodes.join(',') + }).then(res => { + row['uom'] = res.list[0].uom + }) + } + } } else { const setV = {} diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/purchaseMain.data.ts b/src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/purchaseMain.data.ts index 023d6051e..8d5b70a15 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/purchaseMain.data.ts +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/purchaseMain.data.ts @@ -400,6 +400,7 @@ export const PurchaseDetail = useCrudSchemas(reactive([ width: 150 }, tableForm:{ + multiple:true,//多选 isInpuFocusShow: true, searchListPlaceholder: '请选择供应商物料', searchField: 'itemCode', From 893e7cf7651472d1bb5fdbd5cc5a1371eb674e9a Mon Sep 17 00:00:00 2001 From: zhaoyiran Date: Tue, 2 Apr 2024 11:47:11 +0800 Subject: [PATCH 05/16] =?UTF-8?q?=E9=87=87=E6=A0=B7=E8=BF=87=E7=A8=8B?= =?UTF-8?q?=E3=80=81=E6=96=B9=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/qms/samplingProcess/index.ts | 4 ++-- src/api/qms/samplingScheme/index.ts | 1 - src/views/qms/samplingProcess/index.vue | 11 +++++------ .../qms/samplingProcess/samplingProcess.data.ts | 5 +++++ src/views/qms/samplingScheme/index.vue | 10 +++++----- .../qms/samplingScheme/samplingScheme.data.ts | 17 +++++++---------- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/api/qms/samplingProcess/index.ts b/src/api/qms/samplingProcess/index.ts index 68a42f63a..96404d545 100644 --- a/src/api/qms/samplingProcess/index.ts +++ b/src/api/qms/samplingProcess/index.ts @@ -3,7 +3,7 @@ import request from '@/config/axios' export interface SamplingProcessVO { id: number code: string - describe: string + description: string sampleType: string evaluationMode: string sampleSize: number @@ -50,4 +50,4 @@ export const exportSamplingProcess = async (params) => { // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/qms/sampling-process/get-import-template' }) -} \ No newline at end of file +} diff --git a/src/api/qms/samplingScheme/index.ts b/src/api/qms/samplingScheme/index.ts index c2b247e56..34dfe4d83 100644 --- a/src/api/qms/samplingScheme/index.ts +++ b/src/api/qms/samplingScheme/index.ts @@ -4,7 +4,6 @@ export interface SamplingSchemeVO { id: number code: string describe: string - status: string available: string } diff --git a/src/views/qms/samplingProcess/index.vue b/src/views/qms/samplingProcess/index.vue index b5108d12f..0d7add0be 100644 --- a/src/views/qms/samplingProcess/index.vue +++ b/src/views/qms/samplingProcess/index.vue @@ -99,10 +99,9 @@ const { getList, setSearchParams } = tableMethods // 列表头部按钮 const HeadButttondata = [ - // defaultButtons.defaultAddBtn({hasPermi:'wms:samplingProcess:create'}), // 新增 - defaultButtons.defaultAddBtn(null), // 新增 - defaultButtons.defaultImportBtn({hasPermi:'wms:samplingProcess:import'}), // 导入 - defaultButtons.defaultExportBtn({hasPermi:'wms:samplingProcess:export'}), // 导出 + defaultButtons.defaultAddBtn({hasPermi:'qms:samplingProcess:create'}), // 新增 + defaultButtons.defaultImportBtn({hasPermi:'qms:samplingProcess:import'}), // 导入 + defaultButtons.defaultExportBtn({hasPermi:'qms:samplingProcess:export'}), // 导出 defaultButtons.defaultFreshBtn(null), // 刷新 defaultButtons.defaultFilterBtn(null), // 筛选 defaultButtons.defaultSetBtn(null), // 设置 @@ -134,8 +133,8 @@ const buttonBaseClick = (val, item) => { // 列表-操作按钮 const butttondata = [ - defaultButtons.mainListEditBtn({hasPermi:'wms:samplingProcess:update'}), // 编辑 - defaultButtons.mainListDeleteBtn({hasPermi:'wms:samplingProcess:delete'}), // 删除 + defaultButtons.mainListEditBtn({hasPermi:'qms:samplingProcess:update'}), // 编辑 + defaultButtons.mainListDeleteBtn({hasPermi:'qms:samplingProcess:delete'}), // 删除 ] // 列表-操作按钮事件 diff --git a/src/views/qms/samplingProcess/samplingProcess.data.ts b/src/views/qms/samplingProcess/samplingProcess.data.ts index a805e2a01..f9e28f4cf 100644 --- a/src/views/qms/samplingProcess/samplingProcess.data.ts +++ b/src/views/qms/samplingProcess/samplingProcess.data.ts @@ -64,6 +64,11 @@ export const SamplingProcess = useCrudSchemas(reactive([ label: '是否可用', field: 'available', sort: 'custom', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + form: { + component: 'SelectV2' + }, }, { label: '创建时间', diff --git a/src/views/qms/samplingScheme/index.vue b/src/views/qms/samplingScheme/index.vue index 547a9671a..9c2a9b8bc 100644 --- a/src/views/qms/samplingScheme/index.vue +++ b/src/views/qms/samplingScheme/index.vue @@ -99,9 +99,9 @@ const { getList, setSearchParams } = tableMethods // 列表头部按钮 const HeadButttondata = [ - defaultButtons.defaultAddBtn({hasPermi:'wms:samplingScheme:create'}), // 新增 - defaultButtons.defaultImportBtn({hasPermi:'wms:samplingScheme:import'}), // 导入 - defaultButtons.defaultExportBtn({hasPermi:'wms:samplingScheme:export'}), // 导出 + defaultButtons.defaultAddBtn({hasPermi:'qms:samplingScheme:create'}), // 新增 + defaultButtons.defaultImportBtn({hasPermi:'qms:samplingScheme:import'}), // 导入 + defaultButtons.defaultExportBtn({hasPermi:'qms:samplingScheme:export'}), // 导出 defaultButtons.defaultFreshBtn(null), // 刷新 defaultButtons.defaultFilterBtn(null), // 筛选 defaultButtons.defaultSetBtn(null), // 设置 @@ -133,8 +133,8 @@ const buttonBaseClick = (val, item) => { // 列表-操作按钮 const butttondata = [ - defaultButtons.mainListEditBtn({hasPermi:'wms:samplingScheme:update'}), // 编辑 - defaultButtons.mainListDeleteBtn({hasPermi:'wms:samplingScheme:delete'}), // 删除 + defaultButtons.mainListEditBtn({hasPermi:'qms:samplingScheme:update'}), // 编辑 + defaultButtons.mainListDeleteBtn({hasPermi:'qms:samplingScheme:delete'}), // 删除 ] // 列表-操作按钮事件 diff --git a/src/views/qms/samplingScheme/samplingScheme.data.ts b/src/views/qms/samplingScheme/samplingScheme.data.ts index bc9feaf8d..77816682b 100644 --- a/src/views/qms/samplingScheme/samplingScheme.data.ts +++ b/src/views/qms/samplingScheme/samplingScheme.data.ts @@ -4,7 +4,7 @@ import { dateFormatter } from '@/utils/formatTime' // 表单校验 export const SamplingSchemeRules = reactive({ code: [required], - status: [required], + // status: [required], available: [required], }) @@ -28,19 +28,16 @@ export const SamplingScheme = useCrudSchemas(reactive([ sort: 'custom', isSearch: true, }, - { - label: '状态', - field: 'status', - sort: 'custom', - isSearch: true, - form: { - component: 'Radio' - }, - }, { label: '是否可用', field: 'available', sort: 'custom', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + isSearch: true, + form: { + component: 'SelectV2' + }, }, { label: '创建时间', From 7a3029f49f5e1e135e13c1af2bb8744fa344d017 Mon Sep 17 00:00:00 2001 From: yufei0306 <13417315+yufei0306@user.noreply.gitee.com> Date: Tue, 2 Apr 2024 13:15:09 +0800 Subject: [PATCH 06/16] =?UTF-8?q?=E9=87=87=E8=B4=AD=E6=94=B6=E8=B4=A7?= =?UTF-8?q?=E7=AE=A1=E7=90=86--=E4=BE=9B=E5=BA=94=E5=95=86=E5=8F=91?= =?UTF-8?q?=E8=B4=A7--=E9=87=87=E8=B4=AD=E8=AE=A2=E5=8D=95--=E6=96=B0?= =?UTF-8?q?=E5=A2=9E--formtable=E4=B8=AD=E8=A1=8C=E5=8F=B7=E5=92=8C?= =?UTF-8?q?=E8=AE=A1=E9=87=8F=E5=8D=95=E4=BD=8D=E5=9B=9E=E6=98=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../supplierdeliver/purchaseMain/index.vue | 6 ++++++ .../supplierdeliver/purchaseMain/purchaseMain.data.ts | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/index.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/index.vue index 645d5f1eb..d1af5fe63 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/index.vue +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/index.vue @@ -115,6 +115,12 @@ val.forEach(item=>{ const newRow = {...row} newRow[formField] = item[searchField] + let lineNumber = 1 + if(tableData.value.length>0){ + lineNumber = 1+(tableData.value[tableData.value.length-1]['lineNumber']) + } + newRow['lineNumber'] = lineNumber + newRow['uom'] = item['supplierUom'] tableData.value.push(newRow) }) const itemCodes = val.map(valItem=>valItem['itemCode']) diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/purchaseMain.data.ts b/src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/purchaseMain.data.ts index 8d5b70a15..5f3eeed5e 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/purchaseMain.data.ts +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/purchaseMain.data.ts @@ -390,6 +390,7 @@ export const PurchaseDetail = useCrudSchemas(reactive([ width: 150 }, tableForm:{ + disabled:true, isSearchList: true, // 开启查询弹窗 } }, @@ -849,9 +850,9 @@ export const PurchaseDetailRules = reactive({ orderQty: [ { required: true, message: '请输入订单数量', trigger: 'blur' } ], - uom: [ - { required: true, message: '请选择计量单位', trigger: 'change' } - ], + // uom: [ + // { required: true, message: '请选择计量单位', trigger: 'change' } + // ], available: [ { required: true, message: '请选择是否可用', trigger: 'change' } ], From 4fc482992910a64357d6267b8ed1f5d887a81a63 Mon Sep 17 00:00:00 2001 From: bjang03 Date: Tue, 2 Apr 2024 13:32:21 +0800 Subject: [PATCH 07/16] =?UTF-8?q?1=E3=80=81=E5=A2=9E=E5=8A=A0=E6=9C=88?= =?UTF-8?q?=E5=BA=A6=E8=AE=A1=E5=88=92=E4=B8=BB=E8=A1=A8=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mes/workstation/components/Detail.vue | 3 +- src/views/mes/workstation/index.vue | 13 +-- src/views/mes/workstation/workstation.data.ts | 85 +++++++++++++++++-- 3 files changed, 89 insertions(+), 12 deletions(-) diff --git a/src/views/mes/workstation/components/Detail.vue b/src/views/mes/workstation/components/Detail.vue index e73351b0a..d950d28da 100644 --- a/src/views/mes/workstation/components/Detail.vue +++ b/src/views/mes/workstation/components/Detail.vue @@ -655,13 +655,12 @@ const openForm = async (type: string, row?: number) => { } // form 提交 const submitForm = async (formType, data) => { - console.log('submitForm',data) try { // 子表新增编辑校验 如果业务需要子表提交校验 需在主页详情组件添加 detailValidate 参数及方法 const rs = (await props.detailValidate) ? await props.detailValidate(data) : true if (!rs) return if (formType === 'create') { - await props.apiCreate(data) + await props.apiCreate(data.list.split(",")) message.success(t('common.createSuccess')) } else { await props.apiUpdate(data) diff --git a/src/views/mes/workstation/index.vue b/src/views/mes/workstation/index.vue index 7357c3f9a..327d30923 100644 --- a/src/views/mes/workstation/index.vue +++ b/src/views/mes/workstation/index.vue @@ -58,7 +58,7 @@ :apiDelete="tabsDeleteApi" :allSchemas="Workstation.allSchemas" :detailAllSchemas="detailAllSchemas" - :searchTableSchema="popList.allSchemas" + :searchTableSchema="tmpPopList" :detailAllSchemasRules="WorkstationRules" :apiPage="apiPage" :tabs="TabsList" @@ -70,7 +70,7 @@ /> @@ -86,7 +86,7 @@ import { TabsList, Team, Workstation, - WorkstationRules, popList + WorkstationRules, teamPopList,equipmentPopList,processPopList,stepPopList } from './workstation.data' import * as WorkstationApi from '@/api/mes/workstation' import * as defaultButtons from '@/utils/disposition/defaultButtons' @@ -273,6 +273,7 @@ const openDetail = (row: any, titleName: any, titleValue: any) => { const detailAllSchemas = ref(Team.allSchemas) const apiPage = ref(WorkstationApi.getTeamPage) const tableKey = ref("Team"); +let tmpPopList = teamPopList.allSchemas // tabs 切换事件 const changeTabs = (data) =>{ tableKey.value = data.prop @@ -281,23 +282,25 @@ const changeTabs = (data) =>{ detailAllSchemas.value = Team.allSchemas tabsDeleteApi = WorkstationApi.deleteTeamRelation tabsCreateApi = WorkstationApi.createTeamRelation + tmpPopList = teamPopList.allSchemas }else if(data.prop == 'Equipment'){ apiPage.value = WorkstationApi.getEquipmentPage detailAllSchemas.value = Equipment.allSchemas tabsDeleteApi = WorkstationApi.deleteEquipmentRelation tabsCreateApi = WorkstationApi.createEquipmentRelation - + tmpPopList = equipmentPopList.allSchemas }else if(data.prop == 'Process'){ apiPage.value = WorkstationApi.getProcessPage detailAllSchemas.value = Process.allSchemas tabsDeleteApi = WorkstationApi.deleteProcessRelation tabsCreateApi = WorkstationApi.createProcessRelation - + tmpPopList = processPopList.allSchemas }else if(data.prop == 'Opersteps'){ apiPage.value = WorkstationApi.getOperstepsPage detailAllSchemas.value = Opersteps.allSchemas tabsDeleteApi = WorkstationApi.deleteOperstepsRelation tabsCreateApi = WorkstationApi.createOperstepsRelation + tmpPopList = stepPopList.allSchemas } } const teamListRef = ref() diff --git a/src/views/mes/workstation/workstation.data.ts b/src/views/mes/workstation/workstation.data.ts index 013f12c8d..c1dd718ab 100644 --- a/src/views/mes/workstation/workstation.data.ts +++ b/src/views/mes/workstation/workstation.data.ts @@ -214,19 +214,19 @@ export const Opersteps = useCrudSchemas(reactive([ isTableForm:true, } ])) -export const popList = useCrudSchemas(reactive([ +export const teamPopList = useCrudSchemas(reactive([ { - label: '多选列表', - field: 'popCheckList', + label: '选择班组', + field: 'list', sort: 'custom', isSearch: false, form: { // labelMessage: '信息提示说明!!!', componentProps: { isSearchList: true, // 开启查询弹窗 - searchListPlaceholder: '请选择仓库代码', // 输入框占位文本 + searchListPlaceholder: '请选择选择班组', // 输入框占位文本 searchField: 'code', // 查询弹窗赋值字段 - searchTitle: '仓库信息', // 查询弹窗标题 + searchTitle: '选择班组', // 查询弹窗标题 searchAllSchemas: Team.allSchemas, // 查询弹窗所需类 searchPage: WorkstationApi.checkTeamPageList, // 查询弹窗所需分页方法 searchCondition: [{ @@ -238,3 +238,78 @@ export const popList = useCrudSchemas(reactive([ } } ])) +export const equipmentPopList = useCrudSchemas(reactive([ + { + label: '选择设备', + field: 'list', + sort: 'custom', + isSearch: false, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + multiple:true, + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '选择设备', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '选择设备', // 查询弹窗标题 + searchAllSchemas: Team.allSchemas, // 查询弹窗所需类 + searchPage: WorkstationApi.checkEquipmentPageList, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + }] + } + } + } +])) +export const processPopList = useCrudSchemas(reactive([ + { + label: '选择工序', + field: 'list', + sort: 'custom', + isSearch: false, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + multiple:true, + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '选择工序', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '选择工序', // 查询弹窗标题 + searchAllSchemas: Team.allSchemas, // 查询弹窗所需类 + searchPage: WorkstationApi.checkProcessPageList, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + }] + } + } + } +])) +export const stepPopList = useCrudSchemas(reactive([ + { + label: '选择操作步骤', + field: 'list', + sort: 'custom', + isSearch: false, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + multiple:true, + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '选择操作步骤', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '选择操作步骤', // 查询弹窗标题 + searchAllSchemas: Team.allSchemas, // 查询弹窗所需类 + searchPage: WorkstationApi.checkOperstepsPageList, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + }] + } + } + } +])) From 94784eb8f84ef205e3f147b7ab6dbe7f3d14df80 Mon Sep 17 00:00:00 2001 From: gaojs Date: Tue, 2 Apr 2024 14:34:03 +0800 Subject: [PATCH 08/16] =?UTF-8?q?=E5=8D=95=E4=BB=B6.=E6=89=B9=E9=87=8F=20?= =?UTF-8?q?=E8=BF=94=E5=B7=A5=E8=BF=94=E4=BF=AE=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mes/reworkBatch/index.ts | 76 +++++ src/api/mes/reworkSingle/index.ts | 16 + src/utils/disposition/defaultButtons.ts | 53 +++ src/views/mes/reworkBatch/index.vue | 318 ++++++++++++++++++ src/views/mes/reworkBatch/reworkBatch.data.ts | 229 +++++++++++++ src/views/mes/reworkSingle/index.vue | 74 +++- 6 files changed, 759 insertions(+), 7 deletions(-) create mode 100644 src/api/mes/reworkBatch/index.ts create mode 100644 src/views/mes/reworkBatch/index.vue create mode 100644 src/views/mes/reworkBatch/reworkBatch.data.ts diff --git a/src/api/mes/reworkBatch/index.ts b/src/api/mes/reworkBatch/index.ts new file mode 100644 index 000000000..0ab7e798c --- /dev/null +++ b/src/api/mes/reworkBatch/index.ts @@ -0,0 +1,76 @@ +import request from '@/config/axios' + +export interface ReworkBatchVO { + deleteTime: Date + id: number + status: string + concurrencyStamp: number + remark: string + deleter: string + siteId: number + reworkType: string + productionCode: string + productionCount: string + reworkAction: string + replaceFlag: string + reworkPersoncode: string + reworkTime: Date + reworkResult: string + reworkbillNo: string +} + +// 查询返工登记批量列表 +export const getReworkBatchPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/mes/rework-batch/senior', data }) + } else { + return await request.get({ url: `/mes/rework-batch/page`, params }) + } +} + +// 查询返工登记批量详情 +export const getReworkBatch = async (id: number) => { + return await request.get({ url: `/mes/rework-batch/get?id=` + id }) +} + +// 新增返工登记批量 +export const createReworkBatch = async (data: ReworkBatchVO) => { + return await request.post({ url: `/mes/rework-batch/create`, data }) +} + +// 修改返工登记批量 +export const updateReworkBatch = async (data: ReworkBatchVO) => { + return await request.put({ url: `/mes/rework-batch/update`, data }) +} + +// 删除返工登记批量 +export const deleteReworkBatch = async (id: number) => { + return await request.delete({ url: `/mes/rework-batch/delete?id=` + id }) +} + +// 中止返工登记单件 +export const suspendReworkSingle = async (id: number) => { + return await request.delete({ url: `/mes/rework-batch/suspend?id=` + id }) +} + +// 领取返工登记单件 +export const receiveReworkSingle = async (id: number) => { + return await request.put({ url: `/mes/rework-batch/receive?id=` + id }) +} + +// 完成返工登记单件 +export const finishReworkSingle = async (id: number) => { + return await request.put({ url: `/mes/rework-batch/finish?id=` + id }) +} + +// 导出返工登记批量 Excel +export const exportReworkBatch = async (params) => { + return await request.download({ url: `/mes/rework-batch/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/mes/rework-batch/get-import-template' }) +} \ No newline at end of file diff --git a/src/api/mes/reworkSingle/index.ts b/src/api/mes/reworkSingle/index.ts index 596a908cc..d84be3231 100644 --- a/src/api/mes/reworkSingle/index.ts +++ b/src/api/mes/reworkSingle/index.ts @@ -49,6 +49,22 @@ export const deleteReworkSingle = async (id: number) => { return await request.delete({ url: `/mes/rework-single/delete?id=` + id }) } +// 中止返工登记单件 +export const suspendReworkSingle = async (id: number) => { + return await request.delete({ url: `/mes/rework-single/suspend?id=` + id }) +} + +// 领取返工登记单件 +export const receiveReworkSingle = async (id: number) => { + return await request.put({ url: `/mes/rework-single/receive?id=` + id }) +} + +// 完成返工登记单件 +export const finishReworkSingle = async (id: number) => { + return await request.put({ url: `/mes/rework-single/finish?id=` + id }) +} + + // 导出返工登记单件 Excel export const exportReworkSingle = async (params) => { return await request.download({ url: `/mes/rework-single/export-excel`, params }) diff --git a/src/utils/disposition/defaultButtons.ts b/src/utils/disposition/defaultButtons.ts index 0b59fdb7b..9095ca7e5 100644 --- a/src/utils/disposition/defaultButtons.ts +++ b/src/utils/disposition/defaultButtons.ts @@ -250,6 +250,59 @@ export function mainListDeleteBtn(option:any) { hasPermi: '' }) } + +// 主列表-中止按钮1 +export function mainListSuspend1Btn(option:any) { + return __defaultBtnOption(option,{ + label: '中止', + name: 'suspend', + hide: false, + type: 'danger', + color: '', + link: true, // 文本展现按钮 + hasPermi: '' + }) +} + +// 主列表-中止按钮2 +export function mainListSuspend2Btn(option:any) { + return __defaultBtnOption(option,{ + label: '中止', + name: 'suspend', + hide: false, + type: 'danger', + color: '', + link: true, // 文本展现按钮 + hasPermi: '' + }) +} + +// 主列表-领取按钮 +export function mainListReceiveBtn(option:any) { + return __defaultBtnOption(option,{ + label: '领取', + name: 'receive', + hide: false, + type: 'primary', + color: '', + link: true, // 文本展现按钮 + hasPermi: '' + }) +} + +// 主列表-完成按钮 +export function mainListFinishBtn(option:any) { + return __defaultBtnOption(option,{ + label: '完成', + name: 'finish', + hide: false, + type: 'primary', + color: '', + link: true, // 文本展现按钮 + hasPermi: '' + }) +} + // 主列表-绑定 export function mainListBindBtn(option:any) { return __defaultBtnOption(option,{ diff --git a/src/views/mes/reworkBatch/index.vue b/src/views/mes/reworkBatch/index.vue new file mode 100644 index 000000000..f2b515fd3 --- /dev/null +++ b/src/views/mes/reworkBatch/index.vue @@ -0,0 +1,318 @@ + + + diff --git a/src/views/mes/reworkBatch/reworkBatch.data.ts b/src/views/mes/reworkBatch/reworkBatch.data.ts new file mode 100644 index 000000000..cb89615e5 --- /dev/null +++ b/src/views/mes/reworkBatch/reworkBatch.data.ts @@ -0,0 +1,229 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' +import * as ItembasicApi from '@/api/wms/itembasic' +import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data' + +// 表单校验 +export const ReworkBatchRules = reactive({ + reworkType: [required], + productionCode:[required], + replaceFlag:[required], + status:[required], +}) + +export const ReworkBatch = 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')] + } + }, + }, + { + 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: 'reworkbillNo', + sort: 'custom', + isSearch: true, + isForm: false, + isDetail: true + }, + { + label: '工作类型', + field: 'reworkType', + sort: 'custom', + isSearch: true, + dictType: DICT_TYPE.REWORK_TYPE, + dictClass: 'string', + }, + { + 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: 'productionCount', + sort: 'custom', + isSearch: true, + form: { + component: 'InputNumber', + value: 0 + }, + }, + { + label: '返修动作', + field: 'reworkAction', + sort: 'custom', + isSearch: true, + }, + { + label: '是否有替换件', + field: 'replaceFlag', + sort: 'custom', + isSearch: true, + dictType: DICT_TYPE.REWORK_REPLACE_FLAG, + dictClass: 'string', + }, + { + label: '返修人员', + field: 'reworkPersoncode', + sort: 'custom', + isSearch: true, + }, + { + label: '返修时间', + field: 'reworkTime', + 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')] + } + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + }, + }, + { + label: '返修结果', + field: 'reworkResult', + sort: 'custom', + isSearch: true, + }, + + { + label: '状态', + field: 'status', + sort: 'custom', + isSearch: true, + dictType: DICT_TYPE.REWORK_STATUS, + dictClass: 'string', + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + isSearch: false, + isTable: false, + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +])) diff --git a/src/views/mes/reworkSingle/index.vue b/src/views/mes/reworkSingle/index.vue index 2265bb135..3fe6a7eb8 100644 --- a/src/views/mes/reworkSingle/index.vue +++ b/src/views/mes/reworkSingle/index.vue @@ -33,7 +33,7 @@ @@ -131,18 +131,38 @@ const buttonBaseClick = (val, item) => { } } +// 根据状态返回该按钮是否显示 +const isShowMainButton = (row,val) => { + if (val.indexOf(row.status) > -1) { + return false + } else { + return true + } +} + // 列表-操作按钮 -const butttondata = [ - defaultButtons.mainListEditBtn({hasPermi:'mes:reworkSingle:update'}), // 编辑 - defaultButtons.mainListDeleteBtn({hasPermi:'mes:reworkSingle:delete'}), // 删除 -] +const butttondata = (row) => { + return [ + defaultButtons.mainListEditBtn({hide: isShowMainButton(row,['1']),hasPermi:'mes:reworkSingle:update'}), // 编辑 + defaultButtons.mainListSuspend1Btn({hide: isShowMainButton(row,['1']),hasPermi:'mes:reworkSingle:delete'}), // 中止1 + defaultButtons.mainListReceiveBtn({hide: isShowMainButton(row,['1']),hasPermi:'mes:reworkSingle:update'}), // 领取 + defaultButtons.mainListSuspend2Btn({hide: isShowMainButton(row,['2']),hasPermi:'mes:reworkSingle:delete'}), // 中止2 + defaultButtons.mainListFinishBtn({hide: isShowMainButton(row,['2']),hasPermi:'mes:reworkSingle:update'}), // 完成 + ] +} // 列表-操作按钮事件 const buttonTableClick = async (val, row) => { if (val == 'edit') { // 编辑 openForm('update', row) - } else if (val == 'delete') { // 删除 - handleDelete(row.id) + } else if (val == 'suspend') { // 中止1 + handleSuspend(row.id) + } else if (val == 'receive') { // 领取 + handleReceive(row.id) + } else if (val == 'suspend') { // 中止2 + handleSuspend(row.id) + } else if (val == 'finish') { // 完成 + handleFinish(row.id) } } @@ -209,6 +229,46 @@ const handleDelete = async (id: number) => { } catch {} } +/** 中止按钮操作 */ +const handleSuspend = async (id: number) => { + try { + // 中止的二次确认 + await message.delConfirm('是否中止所选中任务?'); + // 发起删除 + await ReworkSingleApi.suspendReworkSingle(id) + message.success(t('中止成功')) + // 刷新列表 + await getList() + } catch {} +} + + +/** 领取按钮操作 */ +const handleReceive = async (id: number) => { + try { + // 中止的二次确认 + await message.delConfirm('是否领取所选中任务?'); + // 发起删除 + await ReworkSingleApi.receiveReworkSingle(id) + message.success(t('领取成功')) + // 刷新列表 + await getList() + } catch {} +} + +/** 完成按钮操作 */ +const handleFinish = async (id: number) => { + try { + // 中止的二次确认 + await message.delConfirm('是否完成所选中任务?'); + // 发起删除 + await ReworkSingleApi.finishReworkSingle(id) + message.success(t('任务已完成')) + // 刷新列表 + await getList() + } catch {} +} + /** 导出按钮操作 */ const exportLoading = ref(false) // 导出的加载中 const handleExport = async () => { From a958d35adfcf244c7faa6295fd4355046e9f2ec7 Mon Sep 17 00:00:00 2001 From: zhaoyiran Date: Tue, 2 Apr 2024 15:40:42 +0800 Subject: [PATCH 09/16] =?UTF-8?q?=E6=A0=B7=E6=9C=AC=E5=AD=97=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/qms/sampleCode/index.ts | 14 +++++++------- src/views/qms/sampleCode/index.vue | 10 +++++----- src/views/qms/sampleCode/sampleCode.data.ts | 7 ++++++- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/src/api/qms/sampleCode/index.ts b/src/api/qms/sampleCode/index.ts index 021edea4e..3f8e22f45 100644 --- a/src/api/qms/sampleCode/index.ts +++ b/src/api/qms/sampleCode/index.ts @@ -5,13 +5,13 @@ export interface SampleCodeVO { code: string batchLowLimiting: number batchUpperLimiting: number - s1: number - s2: number - s3: number - s4: number - g1: number - g2: number - g3: number + s1: string + s2: string + s3: string + s4: string + g1: string + g2: string + g3: string available: string } diff --git a/src/views/qms/sampleCode/index.vue b/src/views/qms/sampleCode/index.vue index bc328bf0e..0c31d4587 100644 --- a/src/views/qms/sampleCode/index.vue +++ b/src/views/qms/sampleCode/index.vue @@ -99,9 +99,9 @@ const { getList, setSearchParams } = tableMethods // 列表头部按钮 const HeadButttondata = [ - defaultButtons.defaultAddBtn({hasPermi:'wms:sampleCode:create'}), // 新增 - defaultButtons.defaultImportBtn({hasPermi:'wms:sampleCode:import'}), // 导入 - defaultButtons.defaultExportBtn({hasPermi:'wms:sampleCode:export'}), // 导出 + defaultButtons.defaultAddBtn({hasPermi:'qms:sampleCode:create'}), // 新增 + defaultButtons.defaultImportBtn({hasPermi:'qms:sampleCode:import'}), // 导入 + defaultButtons.defaultExportBtn({hasPermi:'qms:sampleCode:export'}), // 导出 defaultButtons.defaultFreshBtn(null), // 刷新 defaultButtons.defaultFilterBtn(null), // 筛选 defaultButtons.defaultSetBtn(null), // 设置 @@ -133,8 +133,8 @@ const buttonBaseClick = (val, item) => { // 列表-操作按钮 const butttondata = [ - defaultButtons.mainListEditBtn({hasPermi:'wms:sampleCode:update'}), // 编辑 - defaultButtons.mainListDeleteBtn({hasPermi:'wms:sampleCode:delete'}), // 删除 + defaultButtons.mainListEditBtn({hasPermi:'qms:sampleCode:update'}), // 编辑 + defaultButtons.mainListDeleteBtn({hasPermi:'qms:sampleCode:delete'}), // 删除 ] // 列表-操作按钮事件 diff --git a/src/views/qms/sampleCode/sampleCode.data.ts b/src/views/qms/sampleCode/sampleCode.data.ts index cc6e9ed6d..a17eff756 100644 --- a/src/views/qms/sampleCode/sampleCode.data.ts +++ b/src/views/qms/sampleCode/sampleCode.data.ts @@ -24,7 +24,7 @@ export const SampleCode = useCrudSchemas(reactive([ }, { label: '批量下限', - field: 'batchLow limiting', + field: 'batchLowLimiting', sort: 'custom', isSearch: true, form: { @@ -81,6 +81,11 @@ export const SampleCode = useCrudSchemas(reactive([ label: '是否可用', field: 'available', sort: 'custom', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + form: { + component: 'SelectV2' + }, }, { label: '创建时间', From 4111574dc0f6838d63e4e7b398cbeb874d95b407 Mon Sep 17 00:00:00 2001 From: bjang03 Date: Tue, 2 Apr 2024 16:02:19 +0800 Subject: [PATCH 10/16] =?UTF-8?q?1=E3=80=81=E5=B7=A5=E4=BD=8D=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E4=BF=AE=E6=94=B9=E5=BC=B9=E7=AA=97=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E8=BD=A6=E9=97=B4=E4=BA=A7=E7=BA=BF=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/mes/workstation/workstation.data.ts | 72 ++++++++++++++++++- 1 file changed, 69 insertions(+), 3 deletions(-) diff --git a/src/views/mes/workstation/workstation.data.ts b/src/views/mes/workstation/workstation.data.ts index c1dd718ab..60e3aa682 100644 --- a/src/views/mes/workstation/workstation.data.ts +++ b/src/views/mes/workstation/workstation.data.ts @@ -1,10 +1,19 @@ import type {CrudSchema} from '@/hooks/web/useCrudSchemas' import {dateFormatter} from '@/utils/formatTime' import * as WorkstationApi from "@/api/mes/workstation"; +import {Workshop} from "@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data"; +import * as WorkshopApi from "@/api/wms/workshop"; +import { + Productionline +} from "@/views/wms/basicDataManage/factoryModeling/productionline/productionline.data"; +import * as ProductionlineApi from "@/api/wms/productionline"; // 表单校验 export const WorkstationRules = reactive({ - code: [required] + code: [required], + name: [required], + workshopCode:[required], + productionLineCode: [required] }) export const TabsList = [{ label: "班组", @@ -43,14 +52,52 @@ export const Workstation = useCrudSchemas(reactive([ field: 'workshopCode', sort: 'custom', isSearch: true, - isForm: false + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择车间代码', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '车间信息', // 查询弹窗标题 + searchAllSchemas: Workshop.allSchemas, // 查询弹窗所需类 + searchPage: WorkshopApi.getWorkshopPage, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + }] + } + } }, { label: '生产线代码', field: 'productionLineCode', sort: 'custom', isSearch: true, - isForm: false + table: { + width: 150 + }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择生产线代码', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '生产线信息', // 查询弹窗标题 + searchAllSchemas: Productionline.allSchemas, // 查询弹窗所需类 + searchPage: ProductionlineApi.getProductionlinePage, // 查询弹窗所需分页方法 + searchCondition: [{ + key:'workshopCode', + value:'workshopCode', + message: '请填写车间代码!', + isMainValue: true + },{ + key: 'available', + value: 'TRUE', + isMainValue: false + }] + } + } }, { label: '班组代码', @@ -95,6 +142,25 @@ export const Workstation = useCrudSchemas(reactive([ } }, }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, { label: '操作', field: 'action', From a13974c0b13514115155987336b8c2046a86103a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=AE=9C=E9=98=B3?= <1301318913@qq.com> Date: Tue, 2 Apr 2024 16:18:42 +0800 Subject: [PATCH 11/16] =?UTF-8?q?=E5=88=A0=E9=99=A4=E8=80=81=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E8=8A=82=E5=81=87=E6=97=A5=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mes/holidaySetting/holidaySetting.data.ts | 178 ------------- src/views/mes/holidaySetting/index.vue | 245 ------------------ 2 files changed, 423 deletions(-) delete mode 100644 src/views/mes/holidaySetting/holidaySetting.data.ts delete mode 100644 src/views/mes/holidaySetting/index.vue diff --git a/src/views/mes/holidaySetting/holidaySetting.data.ts b/src/views/mes/holidaySetting/holidaySetting.data.ts deleted file mode 100644 index 4f7e833a6..000000000 --- a/src/views/mes/holidaySetting/holidaySetting.data.ts +++ /dev/null @@ -1,178 +0,0 @@ -import type { CrudSchema } from '@/hooks/web/useCrudSchemas' -import { dateFormatter } from '@/utils/formatTime' - -// 表单校验 -export const HolidaySettingRules = reactive({ - concurrencyStamp: [required], -}) - -export const HolidaySetting = useCrudSchemas(reactive([ - { - label: 'id', - field: 'id', - sort: 'custom', - isForm: false, - }, - { - label: '备用字段一', - field: 'textOne', - sort: 'custom', - isSearch: true, - }, - { - label: '备用字段二', - field: 'textTwo', - sort: 'custom', - isSearch: true, - }, - { - label: '备用字段三', - field: 'textThree', - sort: 'custom', - isSearch: true, - }, - { - label: '备用字段四', - field: 'textFour', - sort: 'custom', - isSearch: true, - }, - { - label: '备用字段五', - field: 'textFive', - sort: 'custom', - isSearch: true, - }, - { - label: '删除时间', - field: 'deleteTime', - 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')] - } - }, - form: { - component: 'DatePicker', - componentProps: { - type: 'datetime', - valueFormat: 'x' - } - }, - }, - { - label: '状态', - field: 'status', - sort: 'custom', - isSearch: true, - form: { - component: 'Radio' - }, - }, - { - label: '并发乐观锁', - field: 'concurrencyStamp', - sort: 'custom', - isSearch: true, - form: { - component: 'InputNumber', - value: 0 - }, - }, - { - 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: 'deleter', - sort: 'custom', - isSearch: true, - }, - { - label: '位置ID', - field: 'siteId', - sort: 'custom', - isSearch: true, - form: { - component: 'InputNumber', - value: 0 - }, - }, - { - label: '更改ID', - field: 'changeEmplId', - sort: 'custom', - isSearch: true, - form: { - component: 'InputNumber', - value: 0 - }, - }, - { - label: '节假日日期', - field: 'holidayDate', - 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')] - } - }, - form: { - component: 'DatePicker', - componentProps: { - type: 'datetime', - valueFormat: 'x' - } - }, - }, - { - label: '节假日类型', - field: 'holidayFlag', - sort: 'custom', - isSearch: true, - }, - { - label: '节假日名称', - field: 'holidayName', - sort: 'custom', - isSearch: true, - }, - { - label: '操作', - field: 'action', - isForm: false, - table: { - width: 150, - fixed: 'right' - } - } -])) diff --git a/src/views/mes/holidaySetting/index.vue b/src/views/mes/holidaySetting/index.vue deleted file mode 100644 index bb63733b0..000000000 --- a/src/views/mes/holidaySetting/index.vue +++ /dev/null @@ -1,245 +0,0 @@ - - - -./holidaySetting.data \ No newline at end of file From d42961484401544a11382bf43888751c57e3db8a Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Tue, 2 Apr 2024 16:23:43 +0800 Subject: [PATCH 12/16] =?UTF-8?q?=E6=A3=80=E9=AA=8C=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/qms/inspectionTemplate/index.ts | 26 +- .../inspectionTemplate/addForm.vue | 712 ++++++++++++++---- .../inspectionTemplate/index.vue | 95 +-- ...ion.data.ts => inspectionTemplate.data.ts} | 207 +---- 4 files changed, 610 insertions(+), 430 deletions(-) rename src/views/qms/basicDataManage/inspectionTemplate/{agvLocationrelation.data.ts => inspectionTemplate.data.ts} (57%) diff --git a/src/api/qms/inspectionTemplate/index.ts b/src/api/qms/inspectionTemplate/index.ts index 78bc8235f..1c07a30d3 100644 --- a/src/api/qms/inspectionTemplate/index.ts +++ b/src/api/qms/inspectionTemplate/index.ts @@ -3,6 +3,28 @@ import request from '@/config/axios' // 查询采样过程列表 -export const getInspectionProcessPage = async (params) => { - return await request.get({ url: `/qms/inspection-process/page`}) +export const getListByTempleteCode = async (code) => { + return await request.get({ url: `/qms/inspection-process/getListByTempleteCode?code=`+code}) +} +// 新增 +export const inspectionTemplateCreat = async (data) => { + return await request.post({ url: `/qms/programme-template/create`,data}) +} +// 编辑 +export const inspectionTemplateUpdate = async (data) => { + return await request.put({ url: `/qms/programme-template/update`,data}) +} +// 删除 +export const inspectionTemplateDelete = async (id) => { + return await request.delete({ url: `/qms/programme-template/delete?id=`+id}) +} +// 列表 +export const inspectionTemplatePage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return request.post({ url: '/wms/accountcalendar/senior', data }) + } else { + return await request.get({ url: `/qms/programme-template/page`, params }) + } } \ No newline at end of file diff --git a/src/views/qms/basicDataManage/inspectionTemplate/addForm.vue b/src/views/qms/basicDataManage/inspectionTemplate/addForm.vue index 930a4972b..d20c0ba3d 100644 --- a/src/views/qms/basicDataManage/inspectionTemplate/addForm.vue +++ b/src/views/qms/basicDataManage/inspectionTemplate/addForm.vue @@ -8,25 +8,25 @@ >
- - - - - - - + + - - - - - - - - - - - + + + + + + + + + + + + + + + + --> - + - - + + - + - - + - + - + -
检验特性
- + - + - + - - - +
+ - + +
- - - +
+ - + +
- - - +
+ - + +
- - + + - - + + - + - + - - - + + + - - + + + + + + + - - + + - - + + + + - - + + + - + - + - - - +
+ - + +
@@ -240,12 +411,20 @@
- + + + + +
+ + diff --git a/src/layout/components/Menu/src/Menu.vue b/src/layout/components/Menu/src/Menu.vue index 9033616fe..c6880f299 100644 --- a/src/layout/components/Menu/src/Menu.vue +++ b/src/layout/components/Menu/src/Menu.vue @@ -45,6 +45,26 @@ export default defineComponent({ unref(layout) === 'cutMenu' ? permissionStore.getMenuTabRouters : permissionStore.getRouters ) + const categoryRoutes = computed(() => { + const allRoutes = unref(layout) === 'cutMenu' ? permissionStore.getMenuTabRouters : permissionStore.getRouters + const categoryPath = appStore.getCategoryRoutePath + let findRoutes = allRoutes.find(item=>!item.meta.hidden&&item.path === categoryPath) + if(findRoutes){ + findRoutes = JSON.parse(JSON.stringify(findRoutes)) + findRoutes?.children?.forEach(item => { + item.path = findRoutes?.path+'/'+item.path + }); + } + let homeRoute = allRoutes.find(item=>!item.meta.hidden&&item.path === '/') + if(categoryPath!=homeRoute?.path&&homeRoute){ + homeRoute = JSON.parse(JSON.stringify(homeRoute)) + homeRoute?.children?.forEach(item => { + item.path = homeRoute?.path+item.path + }); + } + return categoryPath!=homeRoute?.path?[...homeRoute?.children||[],...findRoutes?.children||[]]:[...findRoutes?.children||[]]||homeRoute||[] + }) + const collapse = computed(() => appStore.getCollapse) const uniqueOpened = computed(() => appStore.getUniqueOpened) @@ -95,7 +115,7 @@ export default defineComponent({ {{ default: () => { const { renderMenuItem } = useRenderMenuItem(unref(menuMode)) - return renderMenuItem(unref(routers)) + return appStore.getShowCategoryMenu?renderMenuItem(unref(categoryRoutes)):renderMenuItem(unref(routers)) } }} diff --git a/src/layout/components/useRenderLayout.tsx b/src/layout/components/useRenderLayout.tsx index 2c5ae80d5..4d9ea8335 100644 --- a/src/layout/components/useRenderLayout.tsx +++ b/src/layout/components/useRenderLayout.tsx @@ -6,6 +6,7 @@ import { TagsView } from '@/layout/components/TagsView' import { Logo } from '@/layout/components/Logo' import AppView from './AppView.vue' import ToolHeader from './ToolHeader.vue' +import CategoryHeader from './CategoryHeader.vue' import { ElScrollbar } from 'element-plus' import { useDesign } from '@/hooks/web/useDesign' import RouterSearch from '@/components/RouterSearch/index.vue' @@ -111,6 +112,12 @@ export const useRenderLayout = () => { ]} style="transition: all var(--transition-time-02);" > + {appStore.getShowCategoryMenu?():undefined} Date: Tue, 2 Apr 2024 16:55:05 +0800 Subject: [PATCH 14/16] =?UTF-8?q?=E6=96=B0=E7=89=88=E6=9C=AC=E8=8A=82?= =?UTF-8?q?=E5=81=87=E6=97=A5=E5=89=8D=E7=AB=AF=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mes/holidayCalendar/index.ts | 59 ++++++ src/api/mes/holidaySetting/index.ts | 61 ------ .../holidayCalendar/holidayCalendar.data.ts | 179 ++++++++++++++++++ src/views/mes/holidayCalendar/index.vue | 43 +++++ 4 files changed, 281 insertions(+), 61 deletions(-) create mode 100644 src/api/mes/holidayCalendar/index.ts delete mode 100644 src/api/mes/holidaySetting/index.ts create mode 100644 src/views/mes/holidayCalendar/holidayCalendar.data.ts create mode 100644 src/views/mes/holidayCalendar/index.vue diff --git a/src/api/mes/holidayCalendar/index.ts b/src/api/mes/holidayCalendar/index.ts new file mode 100644 index 000000000..8bd1e0808 --- /dev/null +++ b/src/api/mes/holidayCalendar/index.ts @@ -0,0 +1,59 @@ +import request from '@/config/axios' + +export interface HolidayCalendarVO { + id: number + holidayDate: Date + endTime: Date + textOne: string + textTwo: string + textThree: string + textFour: string + textFive: string + deleteTime: Date + status: string + concurrencyStamp: number + remark: string + deleter: string + siteId: number +} + +// 查询节假日设置日历列表 +export const getHolidayCalendarPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/mes/holidayCalendar/senior', data }) + } else { + return await request.get({ url: `/mes/holidayCalendar/page`, params }) + } +} + +// 查询节假日设置日历详情 +export const getHolidayCalendar = async (id: number) => { + return await request.get({ url: `/mes/holidayCalendar/get?id=` + id }) +} + +// 新增节假日设置日历 +export const createHolidayCalendar = async (data: HolidayCalendarVO) => { + return await request.post({ url: `/mes/holidayCalendar/create`, data }) +} + +// 修改节假日设置日历 +export const updateHolidayCalendar = async (data: HolidayCalendarVO) => { + return await request.put({ url: `/mes/holidayCalendar/update`, data }) +} + +// 删除节假日设置日历 +export const deleteHolidayCalendar = async (id: number) => { + return await request.delete({ url: `/mes/holidayCalendar/delete?id=` + id }) +} + +// 导出节假日设置日历 Excel +export const exportHolidayCalendar = async (params) => { + return await request.download({ url: `/mes/holidayCalendar/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/mes/holidayCalendar/get-import-template' }) +} \ No newline at end of file diff --git a/src/api/mes/holidaySetting/index.ts b/src/api/mes/holidaySetting/index.ts deleted file mode 100644 index 979a7e633..000000000 --- a/src/api/mes/holidaySetting/index.ts +++ /dev/null @@ -1,61 +0,0 @@ -import request from '@/config/axios' - -export interface HolidaySettingVO { - id: number - textOne: string - textTwo: string - textThree: string - textFour: string - textFive: string - deleteTime: Date - status: string - concurrencyStamp: number - remark: string - deleter: string - siteId: number - changeEmplId: number - holidayDate: Date - holidayFlag: string - holidayName: string -} - -// 查询节假日设置列表 -export const getHolidaySettingPage = async (params) => { - if (params.isSearch) { - delete params.isSearch - const data = {...params} - return await request.post({ url: '/mes/holidaySetting/senior', data }) - } else { - return await request.get({ url: `/mes/holidaySetting/page`, params }) - } -} - -// 查询节假日设置详情 -export const getHolidaySetting = async (id: number) => { - return await request.get({ url: `/mes/holidaySetting/get?id=` + id }) -} - -// 新增节假日设置 -export const createHolidaySetting = async (data: HolidaySettingVO) => { - return await request.post({ url: `/mes/holidaySetting/create`, data }) -} - -// 修改节假日设置 -export const updateHolidaySetting = async (data: HolidaySettingVO) => { - return await request.put({ url: `/mes/holidaySetting/update`, data }) -} - -// 删除节假日设置 -export const deleteHolidaySetting = async (id: number) => { - return await request.delete({ url: `/mes/holidaySetting/delete?id=` + id }) -} - -// 导出节假日设置 Excel -export const exportHolidaySetting = async (params) => { - return await request.download({ url: `/mes/holidaySetting/export-excel`, params }) -} - -// 下载用户导入模板 -export const importTemplate = () => { - return request.download({ url: '/mes/holidaySetting/get-import-template' }) -} \ No newline at end of file diff --git a/src/views/mes/holidayCalendar/holidayCalendar.data.ts b/src/views/mes/holidayCalendar/holidayCalendar.data.ts new file mode 100644 index 000000000..6094de858 --- /dev/null +++ b/src/views/mes/holidayCalendar/holidayCalendar.data.ts @@ -0,0 +1,179 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' + +// 表单校验 +export const HolidayCalendarRules = reactive({ + endTime: [required], + concurrencyStamp: [required], +}) + +export const HolidayCalendar = useCrudSchemas(reactive([ + { + label: 'ID', + field: 'id', + sort: 'custom', + isForm: false, + }, + { + label: '日期', + field: 'holidayDate', + 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')] + } + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + }, + }, + { + label: '结束时间', + field: 'endTime', + 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')] + } + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + }, + }, + { + label: '备用字段一', + field: 'textOne', + sort: 'custom', + isSearch: true, + }, + { + label: '备用字段二', + field: 'textTwo', + sort: 'custom', + isSearch: true, + }, + { + label: '备用字段三', + field: 'textThree', + sort: 'custom', + isSearch: true, + }, + { + label: '备用字段四', + field: 'textFour', + sort: 'custom', + isSearch: true, + }, + { + label: '备用字段五', + field: 'textFive', + sort: 'custom', + isSearch: true, + }, + { + label: '删除时间', + field: 'deleteTime', + 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')] + } + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + }, + }, + { + label: '状态', + field: 'status', + sort: 'custom', + isSearch: true, + form: { + component: 'Radio' + }, + }, + { + label: '并发乐观锁', + field: 'concurrencyStamp', + sort: 'custom', + isSearch: true, + form: { + component: 'InputNumber', + value: 0 + }, + }, + { + 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: 'deleter', + sort: 'custom', + isSearch: true, + }, + { + label: '位置ID', + field: 'siteId', + sort: 'custom', + isSearch: true, + form: { + component: 'InputNumber', + value: 0 + }, + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +])) diff --git a/src/views/mes/holidayCalendar/index.vue b/src/views/mes/holidayCalendar/index.vue new file mode 100644 index 000000000..05ec182c2 --- /dev/null +++ b/src/views/mes/holidayCalendar/index.vue @@ -0,0 +1,43 @@ + + + + + \ No newline at end of file From 1627c3dbb694eda3e91b2ae68fa043d1360145e1 Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Tue, 2 Apr 2024 17:01:35 +0800 Subject: [PATCH 15/16] =?UTF-8?q?=E6=A3=80=E9=AA=8C=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/qms/inspectionPlan/index.ts | 30 + .../inspectionPlan/addForm.vue | 864 ++++++++++++++++++ .../basicDataManage/inspectionPlan/index.vue | 197 ++++ .../inspectionPlan/inspectionPlan.data.ts | 287 ++++++ .../inspectionTemplate/addForm.vue | 32 + .../inspectionTemplate.data.ts | 1 - 6 files changed, 1410 insertions(+), 1 deletion(-) create mode 100644 src/api/qms/inspectionPlan/index.ts create mode 100644 src/views/qms/basicDataManage/inspectionPlan/addForm.vue create mode 100644 src/views/qms/basicDataManage/inspectionPlan/index.vue create mode 100644 src/views/qms/basicDataManage/inspectionPlan/inspectionPlan.data.ts diff --git a/src/api/qms/inspectionPlan/index.ts b/src/api/qms/inspectionPlan/index.ts new file mode 100644 index 000000000..1c07a30d3 --- /dev/null +++ b/src/api/qms/inspectionPlan/index.ts @@ -0,0 +1,30 @@ +import request from '@/config/axios' + + + +// 查询采样过程列表 +export const getListByTempleteCode = async (code) => { + return await request.get({ url: `/qms/inspection-process/getListByTempleteCode?code=`+code}) +} +// 新增 +export const inspectionTemplateCreat = async (data) => { + return await request.post({ url: `/qms/programme-template/create`,data}) +} +// 编辑 +export const inspectionTemplateUpdate = async (data) => { + return await request.put({ url: `/qms/programme-template/update`,data}) +} +// 删除 +export const inspectionTemplateDelete = async (id) => { + return await request.delete({ url: `/qms/programme-template/delete?id=`+id}) +} +// 列表 +export const inspectionTemplatePage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return request.post({ url: '/wms/accountcalendar/senior', data }) + } else { + return await request.get({ url: `/qms/programme-template/page`, params }) + } +} \ No newline at end of file diff --git a/src/views/qms/basicDataManage/inspectionPlan/addForm.vue b/src/views/qms/basicDataManage/inspectionPlan/addForm.vue new file mode 100644 index 000000000..d20c0ba3d --- /dev/null +++ b/src/views/qms/basicDataManage/inspectionPlan/addForm.vue @@ -0,0 +1,864 @@ + + + + + diff --git a/src/views/qms/basicDataManage/inspectionPlan/index.vue b/src/views/qms/basicDataManage/inspectionPlan/index.vue new file mode 100644 index 000000000..743b7b659 --- /dev/null +++ b/src/views/qms/basicDataManage/inspectionPlan/index.vue @@ -0,0 +1,197 @@ + + + +./inspectionPlan.data \ No newline at end of file diff --git a/src/views/qms/basicDataManage/inspectionPlan/inspectionPlan.data.ts b/src/views/qms/basicDataManage/inspectionPlan/inspectionPlan.data.ts new file mode 100644 index 000000000..62e6c9f7c --- /dev/null +++ b/src/views/qms/basicDataManage/inspectionPlan/inspectionPlan.data.ts @@ -0,0 +1,287 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' + +// 表单校验 + +export const InspectionTemplateRules = reactive({ + description: [ + { required: true , message: '请填写描述', trigger: 'blur' } + ], + version: [ + { required: true , message: '请填写版本', trigger: 'blur' } + ], + inspectionCode: [ + { required: true, message: '请选择检验方案模板编码', trigger: 'blur' } + ], + sequenceCode: [ + { required: true, message: '请填写顺序号', trigger: 'blur' } + ], + inspectionCharCode: [ + { required: true, message: '请选择检验特性编码', trigger: 'blur' } + ], + describe: [ + { required: true, message: '请填写描述', trigger: 'blur' } + ], + inspectionMethodCode: [ + { required: true, message: '请选择检验方法编码', trigger: 'blur' } + ], + dynamicUpdateCode: [ + { required: true, message: '请选择采样过程编码', trigger: 'blur' } + ], + inspectionMethod: [ + { required: true, message: '请选择动态修改规则编码', trigger: 'blur' } + ], + isCanUpdate: [ + { required: true, message: '请选择是否允许修改特征值', trigger: 'blur' } + ], + isDestructionInspection: [ + { required: true, message: '请选择是否破坏性检验', trigger: 'blur' } + ], + resultEntryMethod: [ + { required: true, message: '请选择结果录入方式', trigger: 'blur' } + ], + featureType: [ + { required: true, message: '请选择特征类型', trigger: 'blur' } + ], + quantifyIsCapping: [ + { required: true, message: '请选择是否设定上限', trigger: 'blur' } + ], + quantifyIsLowlimit: [ + { required: true, message: '请选择是否设定下限', trigger: 'blur' } + ], + quantifyTarget: [ + { required: true, message: '请输入目标值', trigger: 'blur' } + ], + quantifyCapping: [ + { required: true, message: '请输入上限值', trigger: 'blur' } + ], + quantifyLowlimit: [ + { required: true, message: '请输入下限值', trigger: 'blur' } + ], + quantifyquantifyUomLowlimit: [ + { required: true, message: '请选择计量单位', trigger: 'blur' } + ], + quantifyDecimal: [ + { required: true, message: '请输入小数位', trigger: 'blur' } + ], + quantifyQuantifyCode: [ + { required: true, message: '请输入选择集编码', trigger: 'blur' } + ], +}) +export const InspectionTemplateMain = useCrudSchemas(reactive([ + { + label: '编码', + field: 'code', + sort: 'custom', + form:{ + componentProps:{ + disabled:true, + placeholder:'系统自动获取' + } + } + }, + { + label: '描述', + field: 'description', + sort: 'custom', + },{ + label: '版本', + field: 'version', + sort: 'custom', + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +])) +export const InspectionTemplateProcess = useCrudSchemas(reactive([ + { + label: '编码', + field: 'code', + sort: 'custom', + form:{ + componentProps:{ + disabled:true, + placeholder:'系统自动获取' + } + } + }, + { + label: '描述', + field: 'description', + sort: 'custom', + isForm:false + },{ + label: '检验方案模板编码', + field: 'inspectionCode', + sort: 'custom', + },{ + label: '顺序号', + field: 'sequenceCode', + },{ + label: '检验特性编码', + field: 'inspectionCharCode', + sort: 'custom', + } +])) +export const InspectionTemplateFeatures= useCrudSchemas(reactive([ + { + label: '编码', + field: 'code', + sort: 'custom', + form:{ + componentProps:{ + disabled:true, + placeholder:'系统自动获取' + } + } + }, + { + label: '描述', + field: 'describe', + sort: 'custom', + },{ + label: '检验方法编码', + field: 'inspectionMethodCode', + sort: 'custom', + },{ + label: '采样过程编码', + field: 'dynamicUpdateCode', + sort: 'custom', + },{ + label: '动态修改规则编码', + field: 'inspectionMethod', + sort: 'custom', + },{ + label: '是否允许修改特征值', + field: 'isCanUpdate', + sort: 'custom', + + form:{ + component:'Select', + api: () => [{ + value:0, + label:'是' + },{ + value:1, + label:'否' + }], + componentProps:{ + optionsAlias: { + labelField: 'label', + valueField: 'value' + } + } + } + },{ + label: '是否破坏性检验', + field: 'isDestructionInspection', + sort: 'custom', + form:{ + component:'Select', + api: () => [{ + value:0, + label:'是' + },{ + value:1, + label:'否' + }], + componentProps:{ + optionsAlias: { + labelField: 'label', + valueField: 'value' + } + } + } + },{ + label: '结果录入方式', + field: 'resultEntryMethod', + sort: 'custom', + dictType: DICT_TYPE.INSPECTION_CHARACTERISTICS_RESULT_ENTRY, + dictClass: 'string', + table: { + width: 150 + }, + },{ + label: '特征类型', + field: 'featureType', + sort: 'custom', + dictType: DICT_TYPE.INSPECTION_CHARACTERISTICS_FEATURE_TYPE, + dictClass: 'string', + table: { + width: 150 + }, + },{ + label: '是否设定上限', + field: 'quantifyIsCapping', + sort: 'custom', + form:{ + component:'Select', + api: () => [{ + value:0, + label:'是' + },{ + value:1, + label:'否' + }], + componentProps:{ + optionsAlias: { + labelField: 'label', + valueField: 'value' + } + } + } + },{ + label: '是否设定下限', + field: 'quantifyIsLowlimit', + sort: 'custom', + form:{ + component:'Select', + api: () => [{ + value:0, + label:'是' + },{ + value:1, + label:'否' + }], + componentProps:{ + optionsAlias: { + labelField: 'label', + valueField: 'value' + } + } + } + },{ + label: '目标值', + field: 'quantifyTarget', + sort: 'custom', + },{ + label: '上限值', + field: 'quantifyCapping', + sort: 'custom', + },{ + label: '下限值', + field: 'quantifyLowlimit', + sort: 'custom', + },{ + label: '计量单位', + field: 'quantifyUom', + sort: 'custom', + },{ + label: '小数位', + field: 'quantifyDecimal', + sort: 'custom', + },{ + label: '选择集编码', + field: 'quantifyQuantifyCode', + sort: 'custom', + form:{ + component:'Select' + } + } +])) \ No newline at end of file diff --git a/src/views/qms/basicDataManage/inspectionTemplate/addForm.vue b/src/views/qms/basicDataManage/inspectionTemplate/addForm.vue index d20c0ba3d..555761be5 100644 --- a/src/views/qms/basicDataManage/inspectionTemplate/addForm.vue +++ b/src/views/qms/basicDataManage/inspectionTemplate/addForm.vue @@ -576,10 +576,28 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any formType.value = type if (row) { data.value = row + let list = await InspectionProcessPageApi.getListByTempleteCode(row.code) list.forEach((item, index) => { editableTabsValue.value = index + 1 item.name = index + 1 + // 编辑判断上限下限目标值是否必填 + if(item.quantifyIsCapping){ + rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true + }else{ + rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false + } + if(item.quantifyIsLowlimit){ + rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true + }else{ + rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false + } + if(item.quantifyIsTarget){ + rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true + }else{ + rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false + } + }) data.value.process = list } else { @@ -645,6 +663,7 @@ const buttonBaseClick1 = (val) => { featureType: '', quantifyIsCapping: '', quantifyIsLowlimit: '', + quantifyIsTarget: '', quantifyTarget: '', quantifyCapping: '', quantifyLowlimit: '', @@ -691,6 +710,7 @@ const validateForm = (formRef) => { return false }) } + const submitForm = async () => { try { const validateForm1 = await validateForm(formProcessRef.value) @@ -706,6 +726,13 @@ const submitForm = async () => { message.error(`模板中有检验工序和检验特性未填写完全`) return; } + const arr = data.value.process.filter(item=>(!item.inspectionCharacteristicsBaseVO.quantifyIsCapping&&!item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit&&!item.inspectionCharacteristicsBaseVO.quantifyIsTarget&&item.inspectionCharacteristicsBaseVO.featureType == 0)) + console.log(arr) + if(arr&&arr.length>0){ + const str = arr.map(item=>item.description).join(',') + message.error(`${str}是否设定上线,是否设定下限,是否是定目标值至少一项为是`) + return; + } if (formType.value == 'create') { // 主子表——提交请求 emit('submitForm', formType.value, data) @@ -730,6 +757,11 @@ if (props.footButttondata) { // 选择特征类型 const changeFeatureType = (e) => { console.log(e) + // if (e) { + // rules.value['inspectionCharacteristicsBaseVO.quantifyQuantifyCode'][0].required = true + // } else { + // rules.value['inspectionCharacteristicsBaseVO.quantifyQuantifyCode'][0].required = false + // } } const searchTableRef = ref() const opensearchTable = ( diff --git a/src/views/qms/basicDataManage/inspectionTemplate/inspectionTemplate.data.ts b/src/views/qms/basicDataManage/inspectionTemplate/inspectionTemplate.data.ts index e361ed36b..62e6c9f7c 100644 --- a/src/views/qms/basicDataManage/inspectionTemplate/inspectionTemplate.data.ts +++ b/src/views/qms/basicDataManage/inspectionTemplate/inspectionTemplate.data.ts @@ -1,6 +1,5 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' -import * as InspectionProcessPageApi from '@/api/qms/inspectionTemplate' // 表单校验 From a9fe96e1098fe3f85f34e77da0aa7e3c20b5b1db Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Tue, 2 Apr 2024 17:01:51 +0800 Subject: [PATCH 16/16] =?UTF-8?q?=E6=A3=80=E9=AA=8C=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/qms/basicDataManage/inspectionPlan/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/qms/basicDataManage/inspectionPlan/index.vue b/src/views/qms/basicDataManage/inspectionPlan/index.vue index 743b7b659..9699dd2a2 100644 --- a/src/views/qms/basicDataManage/inspectionPlan/index.vue +++ b/src/views/qms/basicDataManage/inspectionPlan/index.vue @@ -66,7 +66,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons' import TableHead from '@/components/TableHead/src/TableHead.vue' import Detail from '@/components/Detail/src/Detail.vue' import AddForm from './addForm.vue' -import * as InspectionProcessPageApi from '@/api/qms/inspectionTemplate' +import * as InspectionProcessPageApi from '@/api/qms/inspectionPlan' defineOptions({ name: 'AgvLocationrelation' })