diff --git a/src/api/mes/dismantlingMain/index.ts b/src/api/mes/dismantlingMain/index.ts new file mode 100644 index 000000000..67bb42263 --- /dev/null +++ b/src/api/mes/dismantlingMain/index.ts @@ -0,0 +1,55 @@ +import request from '@/config/axios' + +export interface DismantlingMainVO { + deleteTime: Date + id: number + status: string + concurrencyStamp: number + remark: string + deleter: string + siteId: number + dismantlingBillno: string + productionCode: string + workbillType: string +} + +// 查询报废拆解登记主列表 +export const getDismantlingMainPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/mes/dismantling-main/senior', data }) + } else { + return await request.get({ url: `/mes/dismantling-main/page`, params }) + } +} + +// 查询报废拆解登记主详情 +export const getDismantlingMain = async (id: number) => { + return await request.get({ url: `/mes/dismantling-main/get?id=` + id }) +} + +// 新增报废拆解登记主 +export const createDismantlingMain = async (data: DismantlingMainVO) => { + return await request.post({ url: `/mes/dismantling-main/create`, data }) +} + +// 修改报废拆解登记主 +export const updateDismantlingMain = async (data: DismantlingMainVO) => { + return await request.put({ url: `/mes/dismantling-main/update`, data }) +} + +// 删除报废拆解登记主 +export const deleteDismantlingMain = async (id: number) => { + return await request.delete({ url: `/mes/dismantling-main/delete?id=` + id }) +} + +// 导出报废拆解登记主 Excel +export const exportDismantlingMain = async (params) => { + return await request.download({ url: `/mes/dismantling-main/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/mes/dismantling-main/get-import-template' }) +} \ No newline at end of file diff --git a/src/api/qms/inspectionJob/inspectionJobMain/index.ts b/src/api/qms/inspectionJob/inspectionJobMain/index.ts index 289854b37..0d6f85d56 100644 --- a/src/api/qms/inspectionJob/inspectionJobMain/index.ts +++ b/src/api/qms/inspectionJob/inspectionJobMain/index.ts @@ -44,3 +44,7 @@ export const exportInspectionJobMain = async (params) => { export const importTemplate = () => { return request.download({ url: '/qms/inspection-job-main/get-import-template' }) } +//查询检验申请列表 +export const getInspectionJobPackageList = async (id: number) => { + return await request.get({ url: `/qms/inspection-job-package/list?masterId=` + id }) +} \ No newline at end of file diff --git a/src/api/qms/inspectionRecord/inspectionRecordMain/index.ts b/src/api/qms/inspectionRecord/inspectionRecordMain/index.ts index 02663e294..db265c38d 100644 --- a/src/api/qms/inspectionRecord/inspectionRecordMain/index.ts +++ b/src/api/qms/inspectionRecord/inspectionRecordMain/index.ts @@ -63,3 +63,11 @@ export const exportInspectionRecordMain = async (params) => { export const importTemplate = () => { return request.download({ url: '/qms/inspection-record-main/get-import-template' }) } +// 发布 +export const publishInspectionRecordMain = async (data ) => { + return await request.put({ url: `/qms/inspection-record-main/publish`, data }) +} +//查询检验申请列表 +export const getInspectionRecordPackageList = async (id: number) => { + return await request.get({ url: `/qms/inspection-record-package/list?masterId=` + id }) +} \ No newline at end of file diff --git a/src/api/qms/inspectionRequest/index.ts b/src/api/qms/inspectionRequest/index.ts index 0b064dc02..c018b87ac 100644 --- a/src/api/qms/inspectionRequest/index.ts +++ b/src/api/qms/inspectionRequest/index.ts @@ -28,38 +28,72 @@ export const getInspectionMainPage = async (params) => { if (params.isSearch) { delete params.isSearch const data = {...params} - return await request.post({ url: '/inspection/inspection-main/senior', data }) + return await request.post({ url: '/qms/inspection-request-main/senior', data }) } else { - return await request.get({ url: `/inspection/inspection-main/page`, params }) + return await request.get({ url: `/qms/inspection-request-main/page`, params }) } } // 查询检验申请详情 export const getInspectionMain = async (id: number) => { - return await request.get({ url: `/inspection/inspection-main/get?id=` + id }) + return await request.get({ url: `/qms/inspection-request-main/get?id=` + id }) } // 新增检验申请 export const createInspectionMain = async (data: InspectionMainVO) => { - return await request.post({ url: `/inspection/inspection-main/create`, data }) + return await request.post({ url: `/qms/inspection-request-main/create`, data }) } // 修改检验申请 export const updateInspectionMain = async (data: InspectionMainVO) => { - return await request.put({ url: `/inspection/inspection-main/update`, data }) + return await request.put({ url: `/qms/inspection-request-main/update`, data }) } // 删除检验申请 export const deleteInspectionMain = async (id: number) => { - return await request.delete({ url: `/inspection/inspection-main/delete?id=` + id }) + return await request.delete({ url: `/qms/inspection-request-main/delete?id=` + id }) } // 导出检验申请 Excel export const exportInspectionMain = async (params) => { - return await request.download({ url: `/inspection/inspection-main/export-excel`, params }) + return await request.download({ url: `/qms/inspection-request-main/export-excel`, params }) } // 下载用户导入模板 export const importTemplate = () => { - return request.download({ url: '/inspection/inspection-main/get-import-template' }) + return request.download({ url: '/qms/inspection-request-main/get-import-template' }) } +// 关闭检验申请主 Excel +export const closeInspectRequestMain = async (id) => { + return await request.put({ url: `/qms/inspection-request-main/close?id=` + id }) +} + +// 重新添加检验申请主 Excel +export const reAddInspectRequestMain = async (id) => { + return await request.put({ url: `/qms/inspection-request-main/reAdd?id=` + id }) +} + +// 提交检验申请主 Excel +export const submitInspectRequestMain = async (id) => { + return await request.put({ url: `/qms/inspection-request-main/submit?id=` + id }) +} + +// 审批通过检验申请主 Excel +export const agreeInspectRequestMain = async (id) => { + return await request.put({ url: `/qms/inspection-request-main/agree?id=` + id }) +} + +// 审批驳回检验申请主 Excel +export const refusedInspectRequestMain = async (id) => { + return await request.put({ url: `/qms/inspection-request-main/refused?id=` + id }) +} + +// 处理检验申请主 Excel +export const handleInspectRequestMain = async (id) => { + return await request.put({ url: `/qms/inspection-request-main/handle?id=` + id }) +} + +//查询检验申请列表 +export const getInspectionRequestPackageList = async (id: number) => { + return await request.get({ url: `/qms/inspection-request-package/list?masterId=` + id }) +} \ No newline at end of file diff --git a/src/api/system/dict/dict.type.ts b/src/api/system/dict/dict.type.ts index ed2969f11..d88c889ed 100644 --- a/src/api/system/dict/dict.type.ts +++ b/src/api/system/dict/dict.type.ts @@ -42,3 +42,13 @@ export const deleteDictType = (id: number) => { export const exportDictType = (params) => { return request.get({ url: '/system/dict-type/export', params }) } + + +// 查询字典列表 +export const getDictTypeAndData = (classes: string | null) => { + let url = '/system/dict-type/list-all-data-all'; + if (classes !== null) { + url += `?classes=${classes}`; + } + return request.get({ url }); +} \ No newline at end of file diff --git a/src/components/Detail/src/DetailQmsCode.vue b/src/components/Detail/src/DetailQmsCode.vue index 3f393da07..3a54e68e0 100644 --- a/src/components/Detail/src/DetailQmsCode.vue +++ b/src/components/Detail/src/DetailQmsCode.vue @@ -699,6 +699,7 @@ const openForm = async (type: string, row?: number) => { } // form 提交 const submitForm = async (formType, data) => { + debugger try { // 子表新增编辑校验 如果业务需要子表提交校验 需在主页详情组件添加 detailValidate 参数及方法 const rs = (await props.detailValidate) ? await props.detailValidate(data) : true @@ -797,7 +798,7 @@ const openImage=(item)=>{ * @param cur 改变后值 */ const detailBasicFormOnChange = (field, cur) => { - emit('detailBasicFormOnChange', field, cur) + emit('detailBasicFormOnChange', field, cur,formRef.value.formRef) } /** diff --git a/src/components/TableForm/src/TableForm.vue b/src/components/TableForm/src/TableForm.vue index 38dd76825..5d25c1d81 100644 --- a/src/components/TableForm/src/TableForm.vue +++ b/src/components/TableForm/src/TableForm.vue @@ -126,6 +126,39 @@ :key="op.value" /> + + + + + + + + +
+ + + + + + + + diff --git a/src/locales/en-US.ts b/src/locales/en-US.ts index 22c41afaa..4590ca435 100644 --- a/src/locales/en-US.ts +++ b/src/locales/en-US.ts @@ -296,6 +296,7 @@ export default { delete: 'Delete', edit: 'Edit', update: 'Update', + execute: 'Execute', preview: 'Preview', more: 'More', sync: 'Sync', @@ -312,7 +313,8 @@ export default { dataUpdate: 'Dict Data Eidt', fileUpload: 'File Upload', createLabel: 'create label', - viewDetail:'Detailed list' + viewDetail:'Detailed list', + updataRecode:'Updata recode' }, dialog: { dialog: 'Dialog', diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index 7ab623b0b..37dc11cb8 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -297,6 +297,7 @@ export default { edit: '编辑', update: '编辑', preview: '预览', + execute: '执行', more: '更多', sync: '同步', save: '保存', @@ -311,7 +312,8 @@ export default { dataCreate: '字典数据新增', dataUpdate: '字典数据编辑', createLabel: '创建标签', - viewDetail:'明细列表' + viewDetail:'明细列表', + updataRecode:'更新记录' }, dialog: { dialog: '弹窗', diff --git a/src/utils/dict.ts b/src/utils/dict.ts index b94418c4c..a29a1fd4b 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -311,6 +311,7 @@ export enum DICT_TYPE { REWORK_TYPE='rework_type',//工作类型:返工登记、返修登记 REWORK_STATUS='rework_status',//返工返修状态:待返修,返修中,返修完成 REWORK_REPLACE_FLAG = 'rework_replace_flag',//是否有替换件 + DISMANTLING_BILL_TYPE = 'dismantling_bill_type',//工单类型 SUPPLIERINVOICE_REQUEST_STATUS = 'supplierinvoice_request_status', //发票申请状态 SUPPLIERINVOICE_STATUS = 'supplierinvoice_status', //待开票审核状态 } diff --git a/src/utils/disposition/defaultButtons.ts b/src/utils/disposition/defaultButtons.ts index 9095ca7e5..998e0a9ac 100644 --- a/src/utils/disposition/defaultButtons.ts +++ b/src/utils/disposition/defaultButtons.ts @@ -691,6 +691,18 @@ export function mainListJobExeBtn(option:any) { hasPermi: '' }) } +// 主列表-包装按钮 +export function mainListPackageBtn(option:any) { + return __defaultBtnOption(option,{ + label: '包装', + name: 'mainPackage', + hide: false, + type: 'primary', + color: '', + link: true, // 文本展现按钮 + hasPermi: '' + }) +} // 主列表-打印 export function mainListPointBtn(option:any) { return __defaultBtnOption(option,{ @@ -799,7 +811,18 @@ export function mainThawRequesttBtn(option:any) { hasPermi: '' }) } - +// 主列表-更新检验记录 +export function mainUpdataRecodeBtn(option:any) { + return __defaultBtnOption(option,{ + label: '更新检验记录', + name: 'updataRecode', + hide: false, + type: 'primary', + color: '', + link: true, // 文本展现按钮 + hasPermi: '' + }) +} // 默认按钮规则 function __defaultBtnOption(option:any,specific:any){ return { diff --git a/src/views/mes/dismantlingMain/dismantlingMain.data.ts b/src/views/mes/dismantlingMain/dismantlingMain.data.ts new file mode 100644 index 000000000..9e09bf0bb --- /dev/null +++ b/src/views/mes/dismantlingMain/dismantlingMain.data.ts @@ -0,0 +1,177 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' +import {Itembasic} from "@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data"; +import * as ItembasicApi from "@/api/wms/itembasic"; + +// 表单校验 +export const DismantlingMainRules = reactive({ + productionCode: [required], + workbillType: [required], +}) + +export const DismantlingMain = useCrudSchemas(reactive([ + { + label: '删除时间', + field: 'deleteTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: false, + isTable: false, + isForm: false, + isDetail:false, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + }, + }, + { + label: '主键', + field: 'id', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false, + isDetail:false, + }, + { + label: '并发乐观锁', + field: 'concurrencyStamp', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false, + isDetail:false, + form: { + component: 'InputNumber', + value: 0 + }, + }, + { + label: '创建时间', + field: 'createTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: false, + isTable: false, + isForm: false, + isDetail:false, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + isForm: false, + }, + { + label: '删除用户名', + field: 'deleter', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false, + isDetail:false, + }, + { + label: '位置ID', + field: 'siteId', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false, + isDetail:false, + form: { + component: 'InputNumber', + value: 0 + }, + }, + { + label: '单据编号', + field: 'dismantlingBillno', + sort: 'custom', + isSearch: true, + isForm: false, + isDetail: true + }, + { + label: '产品编码', + field: 'productionCode', + sort: 'custom', + isSearch: true, + form: { + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchTitle: '产品编码', // 查询弹窗标题 + searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类 + searchField: 'code', // 查询弹窗赋值字段 + searchPage: ItembasicApi.getItembasicPage, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + }, + { + key: 'type', + action: 'in', // 查询拼接条件 + isSearch: true, // 使用自定义拼接条件 + value: 'BCP,CCP',//,SEMI] + isMainValue: false + }] + } + } + }, + { + label: '工单类型', + field: 'workbillType', + sort: 'custom', + dictType: DICT_TYPE.DISMANTLING_BILL_TYPE, + dictClass: 'string', + isSearch: true, + }, + { + label: '工单状态', + field: 'status', + sort: 'custom', + dictType: DICT_TYPE.QUALIFY_STATUS, + dictClass: 'string', + isForm: true, + isSearch: true, + isTable: true, + form: { + component: 'Switch', + value: '2', + componentProps: { + inactiveValue: '2', + activeValue: '1' + } + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + isSearch: true, + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +])) diff --git a/src/views/mes/dismantlingMain/index.vue b/src/views/mes/dismantlingMain/index.vue new file mode 100644 index 000000000..bf517c993 --- /dev/null +++ b/src/views/mes/dismantlingMain/index.vue @@ -0,0 +1,244 @@ + + + diff --git a/src/views/qms/basicDataManage/inspectionPlan/addForm.vue b/src/views/qms/basicDataManage/inspectionPlan/addForm.vue index 960130cb6..3c09b3f7a 100644 --- a/src/views/qms/basicDataManage/inspectionPlan/addForm.vue +++ b/src/views/qms/basicDataManage/inspectionPlan/addForm.vue @@ -922,8 +922,6 @@ const validateForm = (formRef) => { const submitForm = async () => { try { const validateForm1 = await validateForm(formProcessRef.value) - console.log(validateForm1) - console.log(data.value) await formMainRef.value.validate() if (!data.value.process || data.value.process.length == 0) { message.error(`请添加工序`) diff --git a/src/views/qms/basicDataManage/selectedProject/selectedProject.data.ts b/src/views/qms/basicDataManage/selectedProject/selectedProject.data.ts index 32e9e0f5f..7caeac325 100644 --- a/src/views/qms/basicDataManage/selectedProject/selectedProject.data.ts +++ b/src/views/qms/basicDataManage/selectedProject/selectedProject.data.ts @@ -1,21 +1,23 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' import * as DictTypeApi from '@/api/system/dict/dict.type' -const dictTypeList = await DictTypeApi.getSimpleDictTypeList() -const dictTypeListData = dictTypeList.map(item => { - return { - label: item.name, - value: item.type - } + +const optionsList = await DictTypeApi.getDictTypeAndData('inspection') +optionsList.forEach(element => { + element.options = element.dictDataRespVOList.map(item => { + return { + value: element.type + "-%%%-" + item.value, + label: element.name + "-" + item.label + } + }) }) // 表单校验 export const SelectedProjectRules = reactive({ code: [required], - dictionaryCode: [required], - dictionaryValue: [required], - available: [required], - concurrencyStamp: [required] + dictionaryTypeAndCode: [required], + estimateCode: [required], + defectLevel: [required], }) export const SelectedProject = useCrudSchemas(reactive([ @@ -28,51 +30,64 @@ export const SelectedProject = useCrudSchemas(reactive([ isSearch: true }, { - label: '字典', - field: 'dictionaryCode', + label: '字典及字典项', + field: 'dictionaryTypeAndCode', sort: 'custom', - isSearch: true, + formatter: (_: Recordable, __: TableColumn, cellValue: boolean) => { + return optionsList.find(item => item.options.some(option => option.value === cellValue))?.options.find(option => option.value === cellValue)?.label + }, + isSearch: false, + isDetail: false, + isTable: true, + isForm: true, tableForm: { - type: 'Select', - initOptions: dictTypeListData, + type: 'SelectGroup', + initOptions: optionsList }, form: { component: 'Select', - api: dictTypeListData, componentProps: { - options: dictTypeListData, - optionsAlias: { - labelField: 'label', - valueField: 'value' - } + options: optionsList } - } + }, + + }, + { + label: '字典', + field: 'dictionaryCode', + sort: 'custom', + isSearch: false, + isTableForm: false, + isDetail: false, + isTable: false, + isForm: false, }, { - label: '字典项值', + label: '字典项', field: 'dictionaryValue', sort: 'custom', - isSearch: true, - tableForm: { - type: 'Select', - }, - form: { - component: 'Select', - componentProps: { - options: dictTypeListData, - optionsAlias: { - labelField: 'label', - valueField: 'value' - } - } - } + isSearch: false, + isTableForm: false, + isDetail: false, + isTable: false, + isForm: false, + }, + { + label: '字典名称', + field: 'dictionaryLabel', + sort: 'custom', + isSearch: false, + isTableForm: false, + isDetail: false, + isTable: false, + isForm: false, }, { label: '评估代码', field: 'estimateCode', sort: 'custom', isSearch: true, - dictType: DICT_TYPE.DICTIONARY_CLASS, + dictType: DICT_TYPE.EVALUATION_CODE, dictClass: 'string', tableForm: { type: 'Select', diff --git a/src/views/qms/basicDataManage/selectedSet/index.vue b/src/views/qms/basicDataManage/selectedSet/index.vue index f4513d891..7e6bc2a31 100644 --- a/src/views/qms/basicDataManage/selectedSet/index.vue +++ b/src/views/qms/basicDataManage/selectedSet/index.vue @@ -50,7 +50,7 @@ :apiUpdate="SelectedSetApi.updateSelectedSet" :apiCreate="SelectedSetApi.createSelectedSet" @searchTableSuccess="searchTableSuccess" - :isBusiness="false" + :isBusiness="true" @onChange="onChange" @handleAddTable="handleAddTable" @handleDeleteTable="handleDeleteTable" @@ -92,6 +92,7 @@ import { SelectedProject,SelectedProjectRules } from '../selectedProject/selecte import * as SelectedProjectApi from '@/api/qms/selectedProject' import * as DictDataApi from '@/api/system/dict/dict.data' import component from 'virtual:svg-icons-register' +import * as DictTypeApi from '@/api/system/dict/dict.type' // import TableHead from '@/components/TableHead/src/TableHead.vue' // import ImportForm from '@/components/ImportForm/src/ImportForm.vue' // import Detail from '@/components/Detail/src/Detail.vue' @@ -105,9 +106,11 @@ const route = useRoute() // 路由信息 const tableData = ref([]) const routeName = ref() const selectDictType = ref() +const optionsList = ref() routeName.value = route.name const tableColumns = ref(SelectedSet.allSchemas.tableColumns) + // 查询页面返回 const searchTableSuccess = (formField, searchField, val, formRef) => { nextTick(() => { @@ -287,7 +290,21 @@ const handleDeleteTable = (item, index) => { // 主子数据 提交 const submitForm = async (formType, data) => { + data.selectedProjectDOList = tableData.value// 拼接子表数据参数 + data.selectedProjectDOList = data.selectedProjectDOList.map(item => { + // 按照 '-%%%-'' 拆分 dictionaryCode + const [dictionaryCode, dictionaryValue] = item.dictionaryTypeAndCode.split('-%%%-'); + const dictionary = optionsList.value.find(temp => temp.options.some(option => option.value === item.dictionaryTypeAndCode)) + const dictionaryLabel = dictionary?.options.find(option => option.value === item.dictionaryTypeAndCode)?.label + // 返回一个新对象,包含拆分后的 dictionaryCode 和 dictionaryValue,以及原始项中的其他属性 + return { + ...item, + dictionaryCode, + dictionaryValue, + dictionaryLabel + }; + }); console.log(data.subList) try { if (formType === 'create') { @@ -321,20 +338,21 @@ const detailOpenForm = (type, row, masterParmas) => { -const detailBasiFormOnChange = (field,val) => { +const detailBasiFormOnChange = (field,val,detailFormRef) => { console.log(field) - console.log(val) - if(field == 'dictionaryCode'){ - DictDataApi.queryByDictType(val).then(res => { - SelectedProject.allSchemas.formSchema.find(item => { - return item.field == 'dictionaryValue' - }).componentProps.options = res.map(item=>{ - return { - value: item.value, - label: item.label - } + console.log(33,detailFormRef) + if(field == 'dictionaryTypeAndCode'){ + // 按照 '-%%%-'' 拆分 dictionaryCode + const [dictionaryCode, dictionaryValue] = val.split('-%%%-'); + const dictionary = optionsList.value.find(temp => temp.options.some(option => option.value === val)) + const dictionaryLabel = dictionary?.options.find(option => option.value === val)?.label + const setV = {} + setV['dictionaryLabel'] = dictionaryLabel + setV['dictionaryCode'] = dictionaryCode + setV['dictionaryValue'] = dictionaryValue + nextTick(() => { + detailFormRef.setValues(setV) }) - }) } } @@ -342,9 +360,24 @@ const formSelectChange = (a,b,c,d) => { console.log(111) } +const getDicDetails = ()=>{ + DictTypeApi.getDictTypeAndData('inspection').then(res=>{ + res.forEach(element => { + element.options = element.dictDataRespVOList.map(item => { + return { + value: element.type + "-%%%-" + item.value, + label: element.name + "-" + item.label + } + }) + }) + optionsList.value = res + }) +} + /** 初始化 **/ onMounted(async () => { getList() + getDicDetails() importTemplateData.templateUrl = await SelectedSetApi.importTemplate() }) diff --git a/src/views/qms/basicDataManage/selectedSet/selectedSet.data.ts b/src/views/qms/basicDataManage/selectedSet/selectedSet.data.ts index e4e1d6f0d..a6db09237 100644 --- a/src/views/qms/basicDataManage/selectedSet/selectedSet.data.ts +++ b/src/views/qms/basicDataManage/selectedSet/selectedSet.data.ts @@ -25,17 +25,6 @@ export const SelectedSet = useCrudSchemas(reactive([ sort: 'custom', isSearch: true }, - { - label: '分类', - field: 'classification', - sort: 'custom', - isSearch: true, - dictType: DICT_TYPE.EVALUATION_CODE, - dictClass: 'string', - tableForm: { - type: 'Select', - } - }, { label: '操作', field: 'action', @@ -43,6 +32,8 @@ export const SelectedSet = useCrudSchemas(reactive([ table: { width: 150, fixed: 'right' - } + }, + isTableForm: false, + isDetail: false } ])) diff --git a/src/views/qms/inspection/inspectionJob/addForm.vue b/src/views/qms/inspection/inspectionJob/addForm.vue index 3a469b564..d562c7be1 100644 --- a/src/views/qms/inspection/inspectionJob/addForm.vue +++ b/src/views/qms/inspection/inspectionJob/addForm.vue @@ -27,7 +27,7 @@ :stretch="false" > - + @@ -51,12 +55,12 @@ - + - + @@ -83,39 +87,45 @@ - - + + - -
- -
-
-
- - -
- -
-
-
- - + - + - + - + @@ -219,43 +261,54 @@ - + + :value="dict.value" + /> - + - + - + - + + :value="dict.dictionaryValue" + /> - + - - + + :value="dict.value" + /> @@ -313,7 +366,6 @@ import { DynamicRule } from '@/views/qms/basicDataManage/dynamicRule/dynamicRule import * as SelectedSetApi from '@/api/qms/selectedSet' //选择集 import { SelectedSet } from '@/views/qms/basicDataManage/selectedSet/selectedSet.data' //选择集 - const { proxy } = getCurrentInstance() const message = useMessage() // 消息弹窗 @@ -354,12 +406,12 @@ const props = defineProps({ required: true, default: null }, - // 校验rules - rules: { + // 校验rules + rules: { type: Object, required: true, default: null - }, + } }) const { t } = useI18n() // 国际化 @@ -400,7 +452,7 @@ if (props.basicFormWidth) { } const rules = ref({ ...props.rules, - 'inspectionJobCharacteristicsUpdateReqVO.description': [ + 'inspectionJobCharacteristicsUpdateReqVO.description': [ { required: true, message: '请填写描述', trigger: ['blur', 'change'] } ], 'inspectionJobCharacteristicsUpdateReqVO.inspectionMethodCode': [ @@ -437,22 +489,17 @@ const rules = ref({ { required: true, message: '请输入选择集编码', trigger: 'change' } ], 'inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime': [ - { required: true, message: '请输入选择开始时间', trigger: 'change'} + { required: true, message: '请输入选择开始时间', trigger: 'change' } ], 'inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime': [ { required: true, message: '请输入选择结束时间', trigger: 'blur' } -], -qualifiedQuantity: [ - { required: true, message: '请输入选择结束时间', trigger: 'blur' } -], - - + ], + qualifiedQuantity: [{ required: true, message: '请输入选择结束时间', trigger: 'blur' }] }) /** 打开弹窗 */ let tabIndex = 1 const open = async (type: string, row?: any, masterParmas?: any, titleName?: any) => { - dialogVisible.value = true if (titleName) { dialogTitle.value = t('action.' + titleName) } else { @@ -468,30 +515,32 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any editableTabsValue.value = index + 1 item.name = index + 1 item.inspectionJobCharacteristicsUpdateReqVO = item.inspectionJobCharacteristicsRespVO - item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList=[] - // rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true - if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod==0) { // rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true - for(let i=0;i { + formMainRef.value.setValues(row) + }) } else { data.value = { code: '', @@ -528,7 +581,7 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any subList: [] } } - + dialogVisible.value = true tabIndex = data.value.subList.length + 1 } defineExpose({ open, dialogVisible, formLoading }) // 提供 open 方法,用于打开弹窗 @@ -633,54 +686,74 @@ const validateForm = (formRef) => { const submitForm = async () => { try { - console.log(data.value.subList) // const validateForm1 = await validateForm(formMainRef.value) const elForm = unref(formMainRef)?.getElFormRef() - // 校验表单 - if (!elForm) return - const valid = await elForm.validate() - if (!valid) return - // const bol1 = await validateForm(formProcessRef.value) - const bol2 = await validateForm(formFeaturesRef.value) - if (!bol2) { + // 校验表单 + if (!elForm) return + const valid = await elForm.validate() + if (!valid) return + // const bol1 = await validateForm(formProcessRef.value) + const bol2 = await validateForm(formFeaturesRef.value) + if (!bol2) { message.error(`模板中有检验工序和检验特性未填写完全`) return } - // 判断附加费用数组是否有未填的选项 - let arrBol = data.value.subList.map((item, index) => { - let arr1 = [] - if(item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1){ - arr1.push(item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some((cur,key) =>{ - return !cur.qualifiedQuantity || !cur.unqualifiedQuantity - })) + // 判断附加费用数组是否有未填的选项 + let arrBol = [] + let isOutweigh = []//结束时间是否大于开始时间 + data.value.subList.forEach((item, index) => { + if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1) { + arrBol.push( + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( + (cur, key) => { + return !cur.qualifiedQuantity || !cur.unqualifiedQuantity + } + ) + ) } - if(item.samplingProcessRespVO.evaluationMode == 1){ - arr1.push(item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some((cur,key) =>{ - return !cur.estimateCode ||!cur.defectLevel - })) + if (item.samplingProcessRespVO.evaluationMode == 1) { + arrBol.push( + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( + (cur, key) => { + return !cur.estimateCode || !cur.defectLevel + } + ) + ) } - if(item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0){ - arr1.push( item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some((cur,key) =>{ - return !cur.inspectionValue - })) + if (item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0) { + arrBol.push( + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( + (cur, key) => { + return !cur.inspectionValue + } + ) + ) + } + if (item.inspectionJobCharacteristicsUpdateReqVO.featureType == 1) { + arrBol.push( + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( + (cur, key) => { + return !cur.qualitativeCode + } + ) + ) } - if(item.inspectionJobCharacteristicsUpdateReqVO.featureType == 1){ - arr1.push(item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some((cur,key) =>{ - return !cur.qualitativeCode - })) + // 开始时间大于结束时间放入数组中 + if (item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime >item.inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime) { + isOutweigh.push(item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime) } - return arr1 - }) -// console.log(arrBol) -// let isEmpty1 = arrBol.filter(item=>item == true) -// arrBol.forEach(item=>{ -// console.log('1q1q') -// console.log(typeof item) -// }) - // setTimeout(()=>{ - // console.log(arrBol.includes(true)) - // },2000) + }) + let isEmpty1 = arrBol.some(item=>item == true) + if(isEmpty1){ + message.error('检验工序和检验特性有字段未填写完全') + return; + } + if(isOutweigh.length>0){ + message.error('检验特性中有开始时间大于结束时间') + return; + } + return; if (formType.value == 'create') { // 主子表——提交请求 emit('submitForm', formType.value, data.value) @@ -789,22 +862,22 @@ const opensearchTable = ( // 弹层确定返回所选数据 // val : 弹层列表row 数据 const searchTableSuccess = async (formField, searchField, val, type, row) => { - if(type == 'features'){ + if (type == 'features') { row.inspectionJobCharacteristicsUpdateReqVO[formField] = val[0].code - if(formField == 'inspectionMethodCode'){ + if (formField == 'inspectionMethodCode') { row.inspectionJobCharacteristicsUpdateReqVO.inspectionMethodName = val[0].description - }else if(formField == 'dynamicUpdateCode'){ + } else if (formField == 'dynamicUpdateCode') { row.inspectionJobCharacteristicsUpdateReqVO.dynamicUpdateName = val[0].description - }else if(formField == 'inspectionMethod'){ + } else if (formField == 'inspectionMethod') { row.inspectionJobCharacteristicsUpdateReqVO.inspectionName = val[0].description } - } else if(type == 'main'){ + } else if (type == 'main') { data.value[formField] = val[0].code - if(formField == 'itemCode'){ + if (formField == 'itemCode') { data.value.itemName = val[0].name - }else if(formField == 'testTypeCode'){ + } else if (formField == 'testTypeCode') { data.value.testTypeName = val[0].description - }else if(formField == 'programmeTemplateCode'){ + } else if (formField == 'programmeTemplateCode') { data.value.programmeTemplateName = val[0].description } if (formField == 'programmeTemplateCode') { @@ -821,7 +894,8 @@ const searchTableSuccess = async (formField, searchField, val, type, row) => { if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit) { rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required = true } else { - rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required = false + rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required = + false } if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget) { rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyTarget'][0].required = true @@ -836,36 +910,38 @@ const searchTableSuccess = async (formField, searchField, val, type, row) => { // emit('searchTableSuccess', formField, searchField, val, formRef.value, type, row) } // 请选择结果录入方式 -const resultEntryMethodChange = (e,item) => { - item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList =[] - if (e==0) { +const resultEntryMethodChange = (e, item) => { + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = [] + if (e == 0) { // rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true - for(let i=0;i{ - let obj = item.selectedProjectRespVOList.find(cur=>cur.dictionaryValue==e) +const changeQualitativeCode = (e, item, cur) => { + let obj = item.selectedProjectRespVOList.find((cur) => cur.dictionaryValue == e) console.log(obj) cur.defectLevel = obj.defectLevel } diff --git a/src/views/qms/inspection/inspectionJob/index.vue b/src/views/qms/inspection/inspectionJob/index.vue index b5e4ed1cb..05efe2feb 100644 --- a/src/views/qms/inspection/inspectionJob/index.vue +++ b/src/views/qms/inspection/inspectionJob/index.vue @@ -27,12 +27,6 @@ - + - - - - - + + diff --git a/src/views/qms/inspection/inspectionRecord/inspectionRecordMain.data.ts b/src/views/qms/inspection/inspectionRecord/inspectionRecordMain.data.ts index 11ea76270..436752732 100644 --- a/src/views/qms/inspection/inspectionRecord/inspectionRecordMain.data.ts +++ b/src/views/qms/inspection/inspectionRecord/inspectionRecordMain.data.ts @@ -13,72 +13,84 @@ export const InspectionRecordMain = useCrudSchemas(reactive([ field: 'number', sort: 'custom', isSearch: true, + isForm:false }, { label: '申请编码', field: 'applicationCode', sort: 'custom', isSearch: true, + isForm:false }, { label: '任务编码', field: 'taskCode', sort: 'custom', isSearch: false, + isForm:false }, { label: '供应商编码', field: 'supplierCode', sort: 'custom', isSearch: false, + isForm:false }, { label: '物料编码', field: 'materialCode', sort: 'custom', isSearch: false, + isForm:false }, { label: '批次', field: 'batch', sort: 'custom', isSearch: false, + isForm:false }, { label: '检验方案编码', field: 'inspectionSchemeCode', sort: 'custom', isSearch: false, + isForm:false }, { label: '检验方案Json', field: 'inspectionSchemeJson', sort: 'custom', isSearch: false, + isForm:false }, { label: '检验批次', field: 'inspectionBatch', sort: 'custom', isSearch: false, + isForm:false }, { label: '检验批数量', field: 'inspectionBatchAmount', sort: 'custom', isSearch: false, + isForm:false }, { label: '采样总数量', field: 'sampleTatalAmount', sort: 'custom', isSearch: false, + isForm:false }, { label: '检验类型', field: 'inspectionType', sort: 'custom', isSearch: false, + isForm:false, form: { component: 'Select' }, @@ -88,18 +100,21 @@ export const InspectionRecordMain = useCrudSchemas(reactive([ field: 'inspectionBatchSource', sort: 'custom', isSearch: false, + isForm:false }, { label: '订单号', field: 'orderCode', sort: 'custom', isSearch: false, + isForm:false }, { label: '订单行', field: 'orderRow', sort: 'custom', isSearch: false, + isForm:false, form: { component: 'InputNumber', value: 0 @@ -110,12 +125,14 @@ export const InspectionRecordMain = useCrudSchemas(reactive([ field: 'certificateCode', sort: 'custom', isSearch: false, + isForm:false }, { label: '凭证行', field: 'certificateRow', sort: 'custom', isSearch: false, + isForm:false, form: { component: 'InputNumber', value: 0 @@ -126,6 +143,7 @@ export const InspectionRecordMain = useCrudSchemas(reactive([ field: 'inspectionStage', sort: 'custom', isSearch: false, + isForm:false, form: { component: 'InputNumber', value: 0 @@ -136,12 +154,14 @@ export const InspectionRecordMain = useCrudSchemas(reactive([ field: 'inspectionStringency', sort: 'custom', isSearch: false, + isForm:false, }, { label: '使用决策', field: 'useDecision', sort: 'custom', isSearch: false, + isForm:false }, { label: '计划开始时间', @@ -149,6 +169,7 @@ export const InspectionRecordMain = useCrudSchemas(reactive([ sort: 'custom', formatter: dateFormatter, isSearch: false, + isForm:false, search: { component: 'DatePicker', componentProps: { @@ -171,6 +192,7 @@ export const InspectionRecordMain = useCrudSchemas(reactive([ sort: 'custom', formatter: dateFormatter, isSearch: false, + isForm:false, search: { component: 'DatePicker', componentProps: { @@ -193,6 +215,7 @@ export const InspectionRecordMain = useCrudSchemas(reactive([ sort: 'custom', formatter: dateFormatter, isSearch: false, + isForm:false, search: { component: 'DatePicker', componentProps: { @@ -215,6 +238,7 @@ export const InspectionRecordMain = useCrudSchemas(reactive([ sort: 'custom', formatter: dateFormatter, isSearch: false, + isForm:false, search: { component: 'DatePicker', componentProps: { @@ -236,18 +260,29 @@ export const InspectionRecordMain = useCrudSchemas(reactive([ field: 'inspectionLevel', sort: 'custom', isSearch: false, + isForm:false, }, { label: 'AQL值', field: 'aqlValue', sort: 'custom', isSearch: false, + isForm:false, }, { label: '是否可用', field: 'available', sort: 'custom', isSearch: false, + isForm:false, + }, + { + label: '使用决策', + field: 'useDecision', + sort: 'custom', + isSearch: false, + dictType: DICT_TYPE.USAGE_DECISION, + }, { label: '创建时间', diff --git a/src/views/qms/inspection/inspectionRequest/index.vue b/src/views/qms/inspection/inspectionRequest/index.vue index 002343e54..d69795d30 100644 --- a/src/views/qms/inspection/inspectionRequest/index.vue +++ b/src/views/qms/inspection/inspectionRequest/index.vue @@ -21,7 +21,7 @@
@@ -37,6 +37,8 @@ + +