From 1a3a6d8e458700cf032ac1bec3f29bd4293b1147 Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Mon, 1 Apr 2024 16:43:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/qms/inspectionTemplate/index.ts | 8 + .../inspectionTemplate/addForm.vue | 304 ++++++++++++++++ .../agvLocationrelation.data.ts | 330 ++++++++++++++++++ .../inspectionTemplate/index.vue | 32 +- 4 files changed, 652 insertions(+), 22 deletions(-) create mode 100644 src/api/qms/inspectionTemplate/index.ts create mode 100644 src/views/qms/basicDataManage/inspectionTemplate/addForm.vue create mode 100644 src/views/qms/basicDataManage/inspectionTemplate/agvLocationrelation.data.ts diff --git a/src/api/qms/inspectionTemplate/index.ts b/src/api/qms/inspectionTemplate/index.ts new file mode 100644 index 000000000..78bc8235f --- /dev/null +++ b/src/api/qms/inspectionTemplate/index.ts @@ -0,0 +1,8 @@ +import request from '@/config/axios' + + + +// 查询采样过程列表 +export const getInspectionProcessPage = async (params) => { + return await request.get({ url: `/qms/inspection-process/page`}) +} \ No newline at end of file diff --git a/src/views/qms/basicDataManage/inspectionTemplate/addForm.vue b/src/views/qms/basicDataManage/inspectionTemplate/addForm.vue new file mode 100644 index 000000000..a4079fae9 --- /dev/null +++ b/src/views/qms/basicDataManage/inspectionTemplate/addForm.vue @@ -0,0 +1,304 @@ + + + + diff --git a/src/views/qms/basicDataManage/inspectionTemplate/agvLocationrelation.data.ts b/src/views/qms/basicDataManage/inspectionTemplate/agvLocationrelation.data.ts new file mode 100644 index 000000000..724d49a5a --- /dev/null +++ b/src/views/qms/basicDataManage/inspectionTemplate/agvLocationrelation.data.ts @@ -0,0 +1,330 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' +import * as AreaApi from '@/api/wms/areabasic' +import { Area } from '@/views/wms/basicDataManage/factoryModeling/areabasic/areabasic.data' +import * as LocationApi from '@/api/wms/location' +import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/location.data' +import * as InspectionProcessPageApi from '@/api/qms/inspectionTemplate' +// const inspectionProcessPage = await InspectionProcessPageApi.getInspectionProcessPage() + +// 表单校验 +export const AgvLocationrelationRules = reactive({ + positionCode: [ + { required: true, message: '请填写AGV点位', trigger: 'change' } + ], + positionArea: [ + { required: true, message: '请填写AGV库区', trigger: 'change' } + ], + wmsArea: [ + { required: true, message: '请填写WMS库区', trigger: 'change' } + ], + wmsPosition: [ + { required: true, message: '请填写WMS库位', trigger: 'change' } + ] +}) + +export const AgvLocationrelation = useCrudSchemas(reactive([ + { + label: '单据号', + field: 'reqCode', + sort: 'custom', + isSearch: true, + isForm: false, + }, + { + label: 'AGV点位', + field: 'positionCode', + sort: 'custom', + isSearch: false, + }, + { + label: 'AGV库区', + field: 'positionArea', + sort: 'custom', + isSearch: false, + }, + { + label: 'WMS库区', + field: 'wmsArea', + sort: 'custom', + isSearch: false, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择库区代码', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '库区信息', // 查询弹窗标题 + searchAllSchemas: Area.allSchemas, // 查询弹窗所需类 + searchPage: AreaApi.getAreaPage, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + }] + } + } + }, + { + label: 'WMS库位', + field: 'wmsPosition', + sort: 'custom', + table: { + width: 150 + }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择库位代码', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '库位信息', // 查询弹窗标题 + searchAllSchemas: Location.allSchemas, // 查询弹窗所需类 + searchPage: LocationApi.getLocationPage, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + }, + { + key: 'areaCode', + value: "wmsArea", + message: '请选择库区代码!', + isMainValue: true + }] + } + } + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + isSearch: false, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: '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')] + } + }, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + isForm: false, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + isSearch: false, + }, + { + label: '操作', + field: 'action', + isForm: false, + isDetail: false, + table: { + width: 150, + fixed: 'right' + } + } +])) + +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', + } +])) +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', + form:{ + component:'Select', + // api: () => inspectionProcessPage, + // componentProps:{ + // optionsAlias: { + // labelField: 'name', + // valueField: 'id' + // } + // } + } + // form: { + // value: userDept.id, + // component: 'Select', + // api: () => userDeptArray, + // componentProps: { + // disabled: true, + // optionsAlias: { + // labelField: 'name', + // valueField: 'id' + // } + // } + // } + } +])) +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', + form:{ + component:'Select' + } + },{ + label: '采样过程编码', + field: 'dynamicUpdateCode', + sort: 'custom', + form:{ + component:'Select' + } + },{ + label: '动态修改规则编码', + field: 'inspectionMethod', + sort: 'custom', + form:{ + component:'Select' + } + },{ + label: '是否允许修改特征值', + field: 'isCanUpdate', + sort: 'custom', + form:{ + component:'Select' + } + },{ + label: '是否破坏性检验', + field: 'isDestructionInspection', + sort: 'custom', + form:{ + component:'Select' + } + },{ + label: '结果录入方式', + field: 'resultEntryMethod', + sort: 'custom', + form:{ + component:'Select' + } + },{ + label: '特征类型', + field: 'featureType', + sort: 'custom', + form:{ + component:'Select' + } + },{ + label: '是否设定上限', + field: 'quantifyIsCapping', + sort: 'custom', + },{ + label: '是否设定下限', + field: 'quantifyIsLowlimit', + sort: 'custom', + },{ + 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/index.vue b/src/views/qms/basicDataManage/inspectionTemplate/index.vue index 0431f7339..463f6d19e 100644 --- a/src/views/qms/basicDataManage/inspectionTemplate/index.vue +++ b/src/views/qms/basicDataManage/inspectionTemplate/index.vue @@ -39,7 +39,7 @@ - --> + - import download from '@/utils/download' -import { AgvLocationrelation,AgvLocationrelationRules } from './agvLocationrelation.data' +import { AgvLocationrelation,AgvLocationrelationRules,InspectionTemplateMain,InspectionTemplateProcess,InspectionTemplateFeatures } from './agvLocationrelation.data' import * as AgvLocationrelationApi from '@/api/wms/agvLocationrelation' import * as defaultButtons from '@/utils/disposition/defaultButtons' import TableHead from '@/components/TableHead/src/TableHead.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue' import Detail from '@/components/Detail/src/Detail.vue' +import AddForm from './addForm.vue' defineOptions({ name: 'AgvLocationrelation' }) @@ -153,25 +160,6 @@ const buttonTableClick = async (val, row) => { /** 添加/修改操作 */ const basicFormRef = ref() const openForm = (type: string, row?: any) => { - if(type == "update"){ - AgvLocationrelation.allSchemas.formSchema.forEach((item) => { - if (item.field == 'positionCode') { - item.componentProps.disabled = true - } - if (item.field == 'positionArea') { - item.componentProps.disabled = true - } - }) - }else { - AgvLocationrelation.allSchemas.formSchema.forEach((item) => { - if (item.field == 'positionCode') { - item.componentProps.disabled = false - } - if (item.field == 'positionArea') { - item.componentProps.disabled = false - } - }) - } basicFormRef.value.open(type, row) }