diff --git a/src/api/qms/inspectionQ3/inspectionQ3Detail/index.ts b/src/api/qms/inspectionQ3/inspectionQ3Detail/index.ts new file mode 100644 index 000000000..796b25512 --- /dev/null +++ b/src/api/qms/inspectionQ3/inspectionQ3Detail/index.ts @@ -0,0 +1,64 @@ +import request from '@/config/axios' + +export interface InspectionQ3DetailVO { + id: number + masterId: number + number: string + itemCode: string + qty: number + uom: string + price: number + amount: number + costCode: string + defectCode: string + defectLocation: string + defectType: string + problemReason: string + available: string + deletionTime: Date + deleterId: string + extraProperties: string + concurrencyStamp: number + siteId: string +} + +// 查询Q3通知单子列表 +export const getInspectionQ3DetailPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = { ...params } + return await request.post({ url: '/qms/inspection-Q3-detail/senior', data }) + } else { + return await request.get({ url: `/qms/inspection-Q3-detail/page`, params }) + } +} + +// 查询Q3通知单子详情 +export const getInspectionQ3Detail = async (id: number) => { + return await request.get({ url: `/qms/inspection-Q3-detail/get?id=` + id }) +} + +// 新增Q3通知单子 +export const createInspectionQ3Detail = async (data: InspectionQ3DetailVO) => { + return await request.post({ url: `/qms/inspection-Q3-detail/create`, data }) +} + +// 修改Q3通知单子 +export const updateInspectionQ3Detail = async (data: InspectionQ3DetailVO) => { + return await request.put({ url: `/qms/inspection-Q3-detail/update`, data }) +} + +// 删除Q3通知单子 +export const deleteInspectionQ3Detail = async (id: number) => { + return await request.delete({ url: `/qms/inspection-Q3-detail/delete?id=` + id }) +} + +// 导出Q3通知单子 Excel +export const exportInspectionQ3Detail = async (params) => { + return await request.download({ url: `/qms/inspection-Q3-detail/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/qms/inspection-Q3-detail/get-import-template' }) +} \ No newline at end of file diff --git a/src/api/qms/inspectionQ3/inspectionQ3Main/index.ts b/src/api/qms/inspectionQ3/inspectionQ3Main/index.ts new file mode 100644 index 000000000..60c723fd8 --- /dev/null +++ b/src/api/qms/inspectionQ3/inspectionQ3Main/index.ts @@ -0,0 +1,65 @@ +import request from '@/config/axios' + +export interface InspectionQ3MainVO { + id: number + number: string + q1Number: string + responUser: string + priority: string + handleTime: Date + summaryAmount: number + desc: string + status: string + available: string + deletionTime: Date + deleterId: string + extraProperties: string + concurrencyStamp: number + siteId: string +} + +// 查询Q3通知单主列表 +export const getInspectionQ3MainPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = { ...params } + return await request.post({ url: '/qms/inspection-Q3-main/senior', data }) + } else { + return await request.get({ url: `/qms/inspection-Q3-main/page`, params }) + } +} + +// 查询Q3通知单主详情 +export const getInspectionQ3Main = async (id: number) => { + return await request.get({ url: `/qms/inspection-Q3-main/get?id=` + id }) +} + +// 新增Q3通知单主 +export const createInspectionQ3Main = async (data: InspectionQ3MainVO) => { + return await request.post({ url: `/qms/inspection-Q3-main/create`, data }) +} + +// 修改Q3通知单主 +export const updateInspectionQ3Main = async (data: InspectionQ3MainVO) => { + return await request.put({ url: `/qms/inspection-Q3-main/update`, data }) +} + +// 删除Q3通知单主 +export const deleteInspectionQ3Main = async (id: number) => { + return await request.delete({ url: `/qms/inspection-Q3-main/delete?id=` + id }) +} + +// 导出Q3通知单主 Excel +export const exportInspectionQ3Main = async (params) => { + return await request.download({ url: `/qms/inspection-Q3-main/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/qms/inspection-Q3-main/get-import-template' }) +} + +// 完成 +export const finishInspectionQ3Main = async (id: number) => { + return await request.get({ url: `/qms/inspection-Q3-main/finish?id=` + id }) +} diff --git a/src/views/qms/inspectionQThree/index.vue b/src/views/qms/inspectionQThree/index.vue new file mode 100644 index 000000000..d49ba7e99 --- /dev/null +++ b/src/views/qms/inspectionQThree/index.vue @@ -0,0 +1,478 @@ + + + diff --git a/src/views/qms/inspectionQThree/inspectionQ3.data.ts b/src/views/qms/inspectionQThree/inspectionQ3.data.ts new file mode 100644 index 000000000..5c8d36532 --- /dev/null +++ b/src/views/qms/inspectionQThree/inspectionQ3.data.ts @@ -0,0 +1,618 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' + +import * as InspectionQ1Api from '@/api/qms/inspectionQ1' +import { Q1 } from '@/views/qms/inspectionQ1/inspectionQ1.data' + +import * as ItembasicApi from '@/api/wms/itembasic' +import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data' + +import * as QadCostcentreApi from '@/api/wms/qadCostcentre' +import { QadCostcentre } from '@/views/wms/basicDataManage/subject/qadCostcentre/qadCostcentre.data' + +const { t } = useI18n() // 国际化 + +// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值 +const queryParams = { + pageSize: 10, + pageNo: 1, + code: 'IssueRequest' +} + +// 获取当前操作人的部门 +import { useUserStore } from '@/store/modules/user' +import { TableColumn } from '@/types/table' +import { fa } from 'element-plus/es/locale' +const userStore = useUserStore() +const userDept = userStore.userSelfInfo.dept +// id 转str 否则form回显匹配不到 +userDept.id = userDept.id.toString() +const userDeptArray: any = [userDept] + +/** + * @returns {Array} 发料申请主表 + */ +export const InspectionQ3Main = useCrudSchemas( + reactive([ + { + label: '通知单号', + field: 'number', + sort: 'custom', + isSearch: true, + isForm: false, + table: { + width: 150, + fixed: 'left' + } + }, + { + label: 'Q1通知单号', + field: 'q1Number', + sort: 'custom', + isSearch: true, + table: { + width: 150 + }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + enterSearch: true, + multiple: true, + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择Q1通知单', // 输入框占位文本 + searchField: 'number', // 查询弹窗赋值字段 + searchTitle: 'Q1通知单', // 查询弹窗标题 + searchAllSchemas: Q1.allSchemas, // 查询弹窗所需类 + searchPage: InspectionQ1Api.getQ1Page, // 查询弹窗所需分页方法 + searchCondition: [ + { + key: 'available', + value: 'TRUE', + isMainValue: false + }, + { + key: 'status', + value: '0', + isMainValue: false + } + ], + verificationParams: [ + { + key: 'number', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true + } + ] // 失去焦点校验参数 + } + } + }, + { + label: '负责用户', + field: 'responUser', + sort: 'custom', + isSearch: false, + table: { + width: 120 + }, + form: { + componentProps: { + value: userStore.getUser.nickname, + disabled: true + } + } + }, + { + label: '优先级', + field: 'priority', + sort: 'custom', + dictType: DICT_TYPE.QUALITY_NOTIFICATION_PRIORITY, + dictClass: 'string', + isSearch: false, + isTable: false, + tableForm: { + type: 'Select' + } + }, + { + label: '处理时间', + field: 'handleTime', + isSearch: false, + table: { + width: 180 + }, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + form: { + component: 'DatePicker', + componentProps: { + style: { width: '100%' }, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x' + } + } + }, + { + label: '汇总金额', + field: 'summaryAmount', + sort: 'custom', + isSearch: false, + table: { + width: 150 + }, + form: { + component: 'InputNumber', + componentProps: { + min: 0, + precision: 2 + } + } + }, + { + label: '物料代码', + field: 'itemCode', + sort: 'custom', + isSearch: true, + isForm: false + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + isSearch: false, + isForm: false + }, + { + label: '计量单位', + field: 'uom', + sort: 'custom', + isSearch: false, + isForm: false + }, + { + label: '单价', + field: 'price', + sort: 'custom', + isSearch: false, + isForm: false + }, + { + label: '金额', + field: 'amount', + sort: 'custom', + isTable: true, + isForm: false, + isSearch: false, + table: { + width: 150 + }, + form: { + component: 'InputNumber', + componentProps: { + min: 0, + precision: 2 + } + } + }, + { + label: '成本中心代码', + field: 'costCode', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + enterSearch: true, + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择成本中心', // 输入框占位文本 + searchField: 'costcentreCode', // 查询弹窗赋值字段 + searchTitle: '成本中心信息', // 查询弹窗标题 + searchAllSchemas: QadCostcentre.allSchemas, // 查询弹窗所需类 + searchPage: QadCostcentreApi.getQadCostcentrePage, // 查询弹窗所需分页方法 + searchCondition: [ + { + key: 'available', + value: 'TRUE', + isMainValue: false + } + ], + verificationParams: [ + { + key: 'costcentreCode', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true + } + ] // 失去焦点校验参数 + } + } + }, + + { + label: '缺陷编码', + field: 'defectCode', + sort: 'custom', + isSearch: false, + isForm: false + }, + { + label: '缺陷位置', + field: 'defectLocation', + sort: 'custom', + isSearch: false, + isForm: false + }, + { + label: '缺陷类型', + field: 'defectType', + sort: 'custom', + isSearch: false, + isForm: false, + form: { + component: 'Select' + } + }, + { + label: '问题原因', + field: 'problemReason', + sort: 'custom', + isSearch: false, + isForm: false + }, + { + label: '描述', + field: 'desc', + sort: 'custom', + isSearch: false, + table: { + width: '150' + }, + form: { + component: 'Input', + componentProps: { + type: 'textarea' + } + } + }, + { + label: '状态', + field: 'status', + sort: 'custom', + dictType: DICT_TYPE.PUBLISHE_STATUS, + dictClass: 'string', + isSearch: false, + isForm: false, + tableForm: { + type: 'Select', + disabled: true + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: '是否可用', + field: 'available', + sort: 'custom', + isSearch: false, + isForm: false, + isTable: false, + isDetail: false + }, + { + label: '创建时间', + field: 'createTime', + isTable: true, + isForm: false, + table: { + width: 180 + }, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + form: { + component: 'DatePicker', + componentProps: { + style: { width: '100%' }, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x' + } + }, + 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')] + } + } + }, + + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false, + table: { + width: 230, + fixed: 'right' + } + } + ]) +) + +export const InspectionQ3MainRules = reactive({ + workshopCode: [{ required: true, message: '请选择车间代码', trigger: 'change' }], + productionLineCode: [{ required: true, message: '请选择生产线代码', trigger: 'change' }], + // fromWarehouseCode: [ + // { required: true, message: '请选择从仓库代码', trigger: 'change' } + // ], + // dueTime: [ + // { required: true, message: '请选择截止时间', trigger: 'change' } + // ], + remark: [{ max: 50, message: '不得超过50个字符', trigger: 'blur' }] +}) + +/** + * @returns {Array} 发料申请子表 + */ +export const InspectionQ3Detail = useCrudSchemas( + reactive([ + { + label: '通知单号', + field: 'number', + sort: 'custom', + isSearch: false, + isTable: false, + isTableForm: false + }, + { + label: '物料号', + field: 'itemCode', + sort: 'custom', + isTable: false, + isSearch: false, + table: { + width: 150 + }, + tableForm: { + enterSearch: true, + isInpuFocusShow: true, + searchListPlaceholder: '请选择物料代码', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '物料基础信息', // 查询弹窗标题 + searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类 + searchPage: ItembasicApi.getItembasicPage, // 查询弹窗所需分页方法 + searchCondition: [ + { + key: 'available', + value: 'TRUE', + isMainValue: false + } + ], + verificationParams: [ + { + key: 'code', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true + } + ] // 失去焦点校验参数 + }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + enterSearch: true, + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择物料代码', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '物料基础信息', // 查询弹窗标题 + searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类 + searchPage: ItembasicApi.getItembasicPage, // 查询弹窗所需分页方法 + searchCondition: [ + { + key: 'available', + value: 'TRUE', + isMainValue: false + } + ], + verificationParams: [ + { + key: 'code', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true + } + ] // 失去焦点校验参数 + } + } + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + isSearch: false, + isTable: false, + + tableForm: { + component: 'InputNumber', + componentProps: { + min: 0, + precision: 2 + } + } + }, + { + label: '单位', + field: 'uom', + sort: 'custom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: false, + isTable: false, + tableForm: { + type: 'Select', + disabled: true + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: '单价', + field: 'price', + sort: 'custom', + isTable: false, + isSearch: false, + tableForm: { + disabled: true + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: '金额', + field: 'amount', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false, + tableForm: { + disabled: true + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: '成本中心代码', + field: 'costCode', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: true, + tableForm: { + isInpuFocusShow: true, + searchListPlaceholder: '请选择成本中心', // 输入框占位文本 + searchField: 'costcentreCode', // 查询弹窗赋值字段 + searchTitle: '成本中心信息', // 查询弹窗标题 + searchAllSchemas: QadCostcentre.allSchemas, // 查询弹窗所需类 + searchPage: QadCostcentreApi.getQadCostcentrePage, // 查询弹窗所需分页方法 + searchCondition: [ + { + key: 'available', + value: 'TRUE', + isMainValue: false + } + ], + verificationParams: [ + { + key: 'costcentreCode', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true + } + ] // 失去焦点校验参数 + } + }, + { + label: '缺陷编码', + field: 'defectCode', + sort: 'custom', + dictType: DICT_TYPE.QMS_Q3_CODE, + dictClass: 'string', + isSearch: true, + isTable: true, + tableForm: { + type: 'Select' + } + }, + { + label: '缺陷位置', + field: 'defectLocation', + sort: 'custom', + dictClass: 'string', + isSearch: false, + isTable: false, + form: { + component: 'Select', + componentProps: { + options: [], + optionsAlias: { + labelField: 'productionLineName', + valueField: 'productionLineCode' + }, + filterable: true + } + } + }, + { + label: '缺陷类型', + field: 'defectType', + sort: 'custom', + isSearch: false, + isTable: false, + form: { + component: 'Select' + } + }, + { + label: '问题原因', + field: 'problemReason', + sort: 'custom', + isSearch: false, + isTable: false, + form: { + component: 'Select' + } + }, + { + label: '操作', + field: 'action', + hiddenInMain: true, + isDetail: false, + isForm: false, + table: { + width: 200, + fixed: 'right' + }, + isTableForm: false + } + ]) +) + +//表单校验 +export const InspectionQ3DetailRules = reactive({ + itemCode: [{ required: true, message: '请选择物料代码', trigger: 'change' }], + packingNumber: [{ required: true, message: '请输入包装号', trigger: 'blur' }], + batch: [{ required: true, message: '请输入批次', trigger: 'blur' }], + inventoryStatus: [{ required: true, message: '请选择库存状态', trigger: 'change' }], + toLocationCode: [{ required: true, message: '请输入到库位代码', trigger: 'blur' }] +})