diff --git a/src/api/mes/workstation/index.ts b/src/api/mes/workstation/index.ts
index e397ff645..336c9714a 100644
--- a/src/api/mes/workstation/index.ts
+++ b/src/api/mes/workstation/index.ts
@@ -48,45 +48,8 @@ export const exportWorkstation = async (params) => {
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/mes/workstation/get-import-template' })
-}// 查询班组列表
-export const getTeamPage = async (params) => {
- params.workstationCode = goalParams.workstationCode
- if (params.isSearch) {
- delete params.isSearch
- const data = {...params}
- return await request.post({ url: '/mes/team/senior', data })
- } else {
- return await request.get({ url: `/mes/team/pageListByWorkstationCode`, params })
- }
-}
-// 查询选择班组列表
-export const checkTeamPageList = async (params) => {
- params.workstationCode = goalParams.workstationCode
- if (params.isSearch) {
- delete params.isSearch
- const data = {...params}
- return await request.post({ url: '/mes/team/senior', data })
- } else {
- return await request.get({ url: `/mes/team/pageCheckListByWorkstationCode`, params })
- }
-}
-// 添加班组关联
-export const createTeamRelation = async (teamCodes:string[]) => {
- const data = {
- workstationCode : goalParams.workstationCode,
- teamCodes : teamCodes
- }
- return await request.post({ url: `/mes/team/createRelation`, data })
}
-// 删除班组关联
-export const deleteTeamRelation = async (teamCodes:string[]) => {
- const data = {
- workstationCode : goalParams.workstationCode,
- teamCodes : teamCodes
- }
- return await request.post({ url: `/mes/team/deleteRelation`, data })
-}
export const getEquipmentPage = async (params) => {
params.workstationCode = goalParams.workstationCode
if (params.isSearch) {
diff --git a/src/api/qms/counter/index.ts b/src/api/qms/counter/index.ts
index 3a75b8163..9190e34f5 100644
--- a/src/api/qms/counter/index.ts
+++ b/src/api/qms/counter/index.ts
@@ -3,7 +3,7 @@ import request from '@/config/axios'
export interface CounterVO {
id: number
itemCode: string
- testTypeCode: string
+ inspectionType: string
supplierCode: string
qualifiedTimes: number
lastQualifiedBatch: string
diff --git a/src/api/qms/inspectionJob/inspectionJobMain/index.ts b/src/api/qms/inspectionJob/inspectionJobMain/index.ts
index fe61e36c3..372fef2dc 100644
--- a/src/api/qms/inspectionJob/inspectionJobMain/index.ts
+++ b/src/api/qms/inspectionJob/inspectionJobMain/index.ts
@@ -1,7 +1,7 @@
import request from '@/config/axios'
-// 查询检验申请列表
+// 查询检验任务列表
export const getInspectionJobMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
@@ -12,29 +12,40 @@ export const getInspectionJobMainPage = async (params) => {
}
}
-// 查询检验申请详情
+// 查询检验任务详情
export const getInspectionJobMain = async (id: number) => {
return await request.get({ url: `/qms/inspection-job-main/get?id=` + id })
}
-// 新增检验申请
+// 新增检验任务
export const createInspectionJobMain = async (data) => {
return await request.post({ url: `/qms/inspection-job-main/create`, data })
}
-// 修改检验申请
+// 修改检验任务
export const updateInspectionJobMain = async (data) => {
return await request.put({ url: `/qms/inspection-job-main/update`, data })
}
-// 执行检验申请
+// 执行检验任务
export const executeInspectionJobMain = async (data) => {
return await request.put({ url: `/qms/inspection-job-main/execute`, data })
}
-// 删除检验申请
+// 删除检验任务
export const deleteInspectionJobMain = async (id: number) => {
return await request.delete({ url: `/qms/inspection-job-main/delete?id=` + id })
}
-
+// 承接检验任务
+export const acceptInspectionJobMain = async (id) => {
+ return await request.put({ url: `/qms/inspection-job-main/accept?id=` + id })
+}
+// 放弃检验任务
+export const abandonInspectionJobMain = async (id) => {
+ return await request.put({ url: `/qms/inspection-job-main/abandon?id=` + id })
+}
+// 关闭检验任务
+export const closeInspectionJobMain = async (id) => {
+ return await request.put({ url: `/qms/inspection-job-main/close?id=` + id })
+}
// 导出检验申请 Excel
export const exportInspectionJobMain = async (params) => {
return await request.download({ url: `/qms/inspection-job-main/export-excel`, params })
diff --git a/src/api/qms/inspectionStage/index.ts b/src/api/qms/inspectionStage/index.ts
index ffce240a6..2ad0ed13b 100644
--- a/src/api/qms/inspectionStage/index.ts
+++ b/src/api/qms/inspectionStage/index.ts
@@ -60,4 +60,10 @@ export const exportInspectionStage = async (params) => {
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/qms/inspection-stage/get-import-template' })
+}
+
+
+// 查询检验阶段列表
+export const getInspectionStageNoPage = async (params) => {
+ return await request.get({ url: `/qms/inspection-stage/noPage`, params })
}
\ No newline at end of file
diff --git a/src/api/wms/purchasereceiptRecordDetail/index.ts b/src/api/wms/purchasereceiptRecordDetail/index.ts
index 2afacb3e1..04699eb06 100644
--- a/src/api/wms/purchasereceiptRecordDetail/index.ts
+++ b/src/api/wms/purchasereceiptRecordDetail/index.ts
@@ -76,6 +76,12 @@ export const getPurchasereceiptRecordDetailPageBySupplierCode = async (params) =
export const getPurchasereceiptRecordDetailList = async (params) => {
return await request.get({ url: `/wms/purchasereceipt-record-detail/list`, params })
}
+
+// 查询采购收货记录子列表
+export const getPurchasereceiptRecordDetailListToRepeat = async (params) => {
+ return await request.get({ url: `/wms/purchasereceipt-record-detail/listToRepeat`, params })
+}
+
// 查询采购收货记录子详情
export const getPurchasereceiptRecordDetail = async (id: number) => {
return await request.get({ url: `/wms/purchasereceipt-record-detail/get?id=` + id })
diff --git a/src/components/BasicForm/src/BasicForm.vue b/src/components/BasicForm/src/BasicForm.vue
index afc1d884d..bcd2d6326 100644
--- a/src/components/BasicForm/src/BasicForm.vue
+++ b/src/components/BasicForm/src/BasicForm.vue
@@ -658,7 +658,7 @@ const inpuFocus = (headerItem, row, index) => {
* @param cur 改变后值
*/
const onChange = (field, cur) => {
- emit('onChange', field, cur)
+ emit('onChange', field, cur, formRef)
}
/**
diff --git a/src/components/listTable/index.ts b/src/components/ListTable/index.ts
similarity index 100%
rename from src/components/listTable/index.ts
rename to src/components/ListTable/index.ts
diff --git a/src/components/listTable/src/ListTable.vue b/src/components/ListTable/src/ListTable.vue
similarity index 100%
rename from src/components/listTable/src/ListTable.vue
rename to src/components/ListTable/src/ListTable.vue
diff --git a/src/components/ListTable1/index.ts b/src/components/ListTable1/index.ts
new file mode 100644
index 000000000..e95f79c43
--- /dev/null
+++ b/src/components/ListTable1/index.ts
@@ -0,0 +1,3 @@
+import ListTable from './src/ListTable.vue'
+
+export { ListTable }
diff --git a/src/components/ListTable1/src/ListTable.vue b/src/components/ListTable1/src/ListTable.vue
new file mode 100644
index 000000000..b9985a8d0
--- /dev/null
+++ b/src/components/ListTable1/src/ListTable.vue
@@ -0,0 +1,40 @@
+
+
+
+
+
+
diff --git a/src/components/TableForm/src/TableForm.vue b/src/components/TableForm/src/TableForm.vue
index 2cf1fadea..131269e58 100644
--- a/src/components/TableForm/src/TableForm.vue
+++ b/src/components/TableForm/src/TableForm.vue
@@ -46,7 +46,7 @@
:label="headerItem.label" :prop="headerItem.field"
:align="headerItem?.tableForm?.align || 'center'"
:sortable="headerItem?.tableForm?.sortable || false"
- :width="headerItem?.tableForm?.width || '200'"
+ :width="headerItem?.tableForm?.width || '200px'"
:min-width="headerItem?.tableForm?.minWidth || 'auto'">
{
}
// 子包装数据
const detailAllSchemas = ref(Team.allSchemas)
-const apiPage = ref(WorkstationApi.getTeamPage)
+const apiPage = ref(WorkstationApi.getEquipmentPage)
const tableKey = ref("Team");
-let tmpPopList = teamPopList.allSchemas
+let tmpPopList = equipmentPopList.allSchemas
// tabs 切换事件
const changeTabs = (data) =>{
tableKey.value = data.prop
- if(data.prop == 'Team'){
- apiPage.value = WorkstationApi.getTeamPage
- detailAllSchemas.value = Team.allSchemas
- tabsDeleteApi = WorkstationApi.deleteTeamRelation
- tabsCreateApi = WorkstationApi.createTeamRelation
- tmpPopList = teamPopList.allSchemas
- }else if(data.prop == 'Equipment'){
+ if(data.prop == 'Equipment'){
apiPage.value = WorkstationApi.getEquipmentPage
detailAllSchemas.value = Equipment.allSchemas
tabsDeleteApi = WorkstationApi.deleteEquipmentRelation
diff --git a/src/views/mes/workstation/workstation.data.ts b/src/views/mes/workstation/workstation.data.ts
index 60e3aa682..31278352b 100644
--- a/src/views/mes/workstation/workstation.data.ts
+++ b/src/views/mes/workstation/workstation.data.ts
@@ -16,10 +16,6 @@ export const WorkstationRules = reactive({
productionLineCode: [required]
})
export const TabsList = [{
- label: "班组",
- prop: 'Team',
-},
- {
label: "设备",
prop: 'Equipment',
},
@@ -280,30 +276,7 @@ export const Opersteps = useCrudSchemas(reactive([
isTableForm:true,
}
]))
-export const teamPopList = useCrudSchemas(reactive([
- {
- label: '选择班组',
- field: 'list',
- sort: 'custom',
- isSearch: false,
- form: {
- // labelMessage: '信息提示说明!!!',
- componentProps: {
- isSearchList: true, // 开启查询弹窗
- searchListPlaceholder: '请选择选择班组', // 输入框占位文本
- searchField: 'code', // 查询弹窗赋值字段
- searchTitle: '选择班组', // 查询弹窗标题
- searchAllSchemas: Team.allSchemas, // 查询弹窗所需类
- searchPage: WorkstationApi.checkTeamPageList, // 查询弹窗所需分页方法
- searchCondition: [{
- key: 'available',
- value: 'TRUE',
- isMainValue: false
- }]
- }
- }
- }
-]))
+
export const equipmentPopList = useCrudSchemas(reactive([
{
label: '选择设备',
diff --git a/src/views/qms/aql/aql.data.ts b/src/views/qms/aql/aql.data.ts
index f3dc3fe56..8b04deda5 100644
--- a/src/views/qms/aql/aql.data.ts
+++ b/src/views/qms/aql/aql.data.ts
@@ -1,6 +1,7 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import {getSamplingScheme} from "@/api/qms/aql";
+import {validateNum} from "@/utils/validator";
// 表单校验
export const AqlRules = reactive({
@@ -8,7 +9,58 @@ export const AqlRules = reactive({
inspectionQualification: [required],
sampleCharacterCode: [required],
sampleSize: [required],
- // available: [required],
+ a0separator010: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ r0separator010: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ a0separator015: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ r0separator015: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ a0separator025: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ r0separator025: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ a0separator040: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ r0separator040: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ a0separator065: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ r0separator065: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ a0separator10: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ r0separator10: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ a0separator15: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ r0separator15: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ a0separator25: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ r0separator25: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ a0separator40: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ r0separator40: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ a0separator65: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ r0separator65: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ a1separator0: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ r1separator0: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ a1separator5: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ r1separator5: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ a2separator5: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ r2separator5: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ a4separator0: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ r4separator0: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ a6separator5: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ r6separator5: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ a10: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ r10: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ a15: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ r15: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ a25: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ r25: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ a40: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ r40: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ a65: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ r65: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ a100: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ r100: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ a150: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ r150: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ a250: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ r250: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ a400: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ r400: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ a650: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ r650: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ a1000: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
+ r1000: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
})
const samplingSchemeList = await getSamplingScheme()
export const Aql = useCrudSchemas(reactive([
diff --git a/src/views/qms/aql/index.vue b/src/views/qms/aql/index.vue
index b5d0446a4..76a3e5a65 100644
--- a/src/views/qms/aql/index.vue
+++ b/src/views/qms/aql/index.vue
@@ -48,6 +48,7 @@
:apiCreate="AqlApi.createAql"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
+ @onChange="onChange"
/>
@@ -235,6 +236,47 @@ const searchFormClick = (searchData) => {
getList() // 刷新当前列表
}
+const onChange = async (field, value, formRef) => {
+ // 检查字段是否以 "a" 开头
+ if (field.startsWith("a") || field.startsWith("r")) {
+ // 从 "a" 字段名中获取其余部分
+ const suffix = field.slice(1);
+ // 构建对应的 "r" 字段名
+ const correspondingField = field.startsWith("a") ? "r" + suffix : "a" + suffix ;
+console.log(correspondingField)
+ // 如果有值,则更新对应的 "r" 字段
+ if (value) {
+ // 查找并更新对应 "r" 字段的值和属性
+ Aql.allSchemas.formSchema.forEach(item => {
+ if (item.field === correspondingField) {
+ const setV = {};
+ if(correspondingField.startsWith("r")){
+ setV[correspondingField] = parseInt(value) + 1;
+ }else {
+ setV[correspondingField] = parseInt(value) - 1;
+ }
+ item.componentProps.disabled = true;
+
+ // 使用 Vue 的 nextTick 来等待 DOM 更新
+ nextTick(() => {
+ formRef.value.setValues(setV);
+ });
+ }
+ });
+ }else{
+ Aql.allSchemas.formSchema.forEach(item => {
+ if (item.field === correspondingField || item.field === field) {
+ item.componentProps.disabled = false;
+ const setV = {};
+ setV[correspondingField] = ''
+ nextTick(() => {
+ formRef.value.setValues(setV);
+ });
+ }
+ });
+ }
+ }
+};
/** 初始化 **/
onMounted(async () => {
getList()
diff --git a/src/views/qms/basicDataManage/counter/counter.data.ts b/src/views/qms/basicDataManage/counter/counter.data.ts
index 71a96b204..c5aa501fe 100644
--- a/src/views/qms/basicDataManage/counter/counter.data.ts
+++ b/src/views/qms/basicDataManage/counter/counter.data.ts
@@ -23,7 +23,7 @@ export const Counter = useCrudSchemas(reactive([
},
{
label: '检验类型编码',
- field: 'testTypeCode',
+ field: 'inspectionType',
sort: 'custom',
isSearch: true
},
diff --git a/src/views/qms/basicDataManage/dynamicRule/index.vue b/src/views/qms/basicDataManage/dynamicRule/index.vue
index 40fe1130a..b9aebe87d 100644
--- a/src/views/qms/basicDataManage/dynamicRule/index.vue
+++ b/src/views/qms/basicDataManage/dynamicRule/index.vue
@@ -105,6 +105,8 @@ const routeName = ref()
const tableData = ref([])
routeName.value = route.name
const tableColumns = ref(DynamicRule.allSchemas.tableColumns)
+const detailMasterId = ref()
+const detailList = ref([])
// 查询页面返回
const searchTableSuccess = (formField, searchField, val, formRef) => {
@@ -210,6 +212,10 @@ const formsSuccess = async (formType,data) => {
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
+ detailMasterId.value = row.id
+ InspectionStageApi.getInspectionStageNoPage({masterId:row.id}).then(res=>{
+ detailList.value = res
+ })
detailRef.value.openDetail(row, titleName, titleValue, 'basicDynamicRule')
}
@@ -283,6 +289,11 @@ const handleDeleteTable = (item, index) => {
// 主子数据 提交
const submitForm = async (formType, data) => {
+ if(!validateNotRepetition(tableData.value)){
+ message.alertWarning('动态规则阶段不能重复')
+ basicFormRef.value.formLoading = false
+ return
+ }
data.inspectionStageDOList = tableData.value// 拼接子表数据参数
console.log(data.subList)
try {
@@ -303,15 +314,35 @@ const submitForm = async (formType, data) => {
const detailValidate = (data) => {
let tag = true;
+ if(!validateIfRepeat(data)){
+ tag = false
+ message.alertWarning('动态规则阶段不能重复')
+ }
return tag
}
const detailOpenForm = (type, row, masterParmas) => {
- if(type='create'){
-
- }
+
}
+const validateIfRepeat = (data) => {
+ const mergedArray = [data, ...detailList.value];
+ const stageSet = new Set(mergedArray.map(item => item.stage));
+ return stageSet.size === mergedArray.length;
+}
+
+const validateNotRepetition = (data) => {
+ // 提取所有的 dictionaryTypeAndCode 值
+ const codes = data.map(item => item.stage);
+ // 创建一个 Set 来存储唯一的 dictionaryTypeAndCode 值
+ const uniqueCodes = new Set(codes);
+ // 如果原始数组的长度大于 Set 集合的大小,则说明有重复
+ if (codes.length > uniqueCodes.size) {
+ return false; // 发现重复,返回 false
+ }
+ return true; // 未发现重复,返回 true
+};
+
/** 初始化 **/
onMounted(async () => {
getList()
diff --git a/src/views/qms/basicDataManage/inspectionScheme/addForm.vue b/src/views/qms/basicDataManage/inspectionScheme/addForm.vue
index f6d67ae35..a41ffb448 100644
--- a/src/views/qms/basicDataManage/inspectionScheme/addForm.vue
+++ b/src/views/qms/basicDataManage/inspectionScheme/addForm.vue
@@ -209,11 +209,11 @@
/>
-
+
([
table: {
width: 180
}
- },{
- 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: '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',
diff --git a/src/views/qms/basicDataManage/inspectionStage/inspectionStage.data.ts b/src/views/qms/basicDataManage/inspectionStage/inspectionStage.data.ts
index 2ef795c87..1fbab3826 100644
--- a/src/views/qms/basicDataManage/inspectionStage/inspectionStage.data.ts
+++ b/src/views/qms/basicDataManage/inspectionStage/inspectionStage.data.ts
@@ -11,8 +11,10 @@ const trueFalse = [{
// 表单校验
export const InspectionStageRules = reactive({
- description: [required],
- dynamicModifyCode: [required],
+ description: [
+ required,
+ { max: 1024, message: '不得超过1024个字符', trigger: 'blur' },
+ ],
okTimes: [required],
okTimeStage: [required],
noOkTimes: [required],
diff --git a/src/views/qms/basicDataManage/selectedSet/index.vue b/src/views/qms/basicDataManage/selectedSet/index.vue
index 4d55e0906..b85a54bfe 100644
--- a/src/views/qms/basicDataManage/selectedSet/index.vue
+++ b/src/views/qms/basicDataManage/selectedSet/index.vue
@@ -407,8 +407,8 @@ const detailBasiFormOnChange = (field,val,detailFormRef) => {
setV['dictionaryCode'] = dictionaryCode
setV['dictionaryValue'] = dictionaryValue
nextTick(() => {
- detailFormRef.setValues(setV)
- })
+ detailFormRef.setValues(setV)
+ })
}
}
diff --git a/src/views/qms/inspection/inspectionJob/addForm.vue b/src/views/qms/inspection/inspectionJob/addForm.vue
index fdef80d4c..e931fdefb 100644
--- a/src/views/qms/inspection/inspectionJob/addForm.vue
+++ b/src/views/qms/inspection/inspectionJob/addForm.vue
@@ -312,7 +312,7 @@
-
+
{
const valid = await elForm.validate()
if (!valid) return
// 校验包装列表
- const validateForm1 = await tableFormRef.value.validateForm()
+
+ console.log(11,data.value.packageList)
+ if(data.value.packageList?.length>0){
+ const validateForm1 = await tableFormRef.value.validateForm()
if (!validateForm1) return
- let number = 0
- data.value.packageList.forEach(cur=>{
- number += parseFloat(cur.sampleAmount)
- })
- if(number > data.value.sampleTotalAmount){
- message.error(`采样数量之和不可以大于总数量`)
- return
+ let number = 0
+ data.value.packageList.forEach(cur=>{
+ number += parseFloat(cur.sampleAmount)
+ })
+ if(number != data.value.sampleTotalAmount){
+ message.error(`采样数量之和不等于总数量`)
+ return
+ }
}
+
const bol2 = await validateForm(formFeaturesRef.value)
if (!bol2) {
message.error(`模板中有检验工序和检验特性未填写完全`)
return
}
- // 判断附加费用数组是否有未填的选项
+ // 判断数组是否有未填的选项
let arrBol = []
let isOutweigh = []//结束时间是否大于开始时间
+ let numberList = []//判断合格数量和不合格数量之和是否等于主表数量
data.value.subList.forEach((item, index) => {
if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1) {
arrBol.push(
@@ -750,7 +756,7 @@ const submitForm = async () => {
arrBol.push(
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some(
(cur, key) => {
- return !cur.estimateCode || !cur.defectLevel
+ return !cur.estimateCode
}
)
)
@@ -777,16 +783,32 @@ const submitForm = async () => {
if (item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime >item.inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime) {
isOutweigh.push(item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime)
}
+ // 合格数量和不合格数量之和不等于总数量
+ if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1) {
+ numberList.push(
+ item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some(
+ (cur, key) => {
+ return parseFloat(cur.qualifiedQuantity) + parseFloat(cur.unqualifiedQuantity) != data.value.sampleTotalAmount
+ }
+ )
+ )
+ }
})
let isEmpty1 = arrBol.some(item=>item == true)
+ let isEmptyNumberList = numberList.some(item=>item == true)
if(isEmpty1){
message.error('检验工序和检验特性有字段未填写完全')
return;
}
- if(isOutweigh.length>0){
+ if(isOutweigh?.length>0){
message.error('检验特性中有开始时间大于结束时间')
return;
}
+ console.log(44,numberList)
+ if(isEmptyNumberList){
+ message.error('合格数量和不合格数量之和不等于总数量')
+ return;
+ }
if (formType.value == 'create') {
// 主子表——提交请求
emit('submitForm', formType.value, data.value)
diff --git a/src/views/qms/inspection/inspectionJob/index.vue b/src/views/qms/inspection/inspectionJob/index.vue
index 1bbaa59be..0413a48aa 100644
--- a/src/views/qms/inspection/inspectionJob/index.vue
+++ b/src/views/qms/inspection/inspectionJob/index.vue
@@ -51,7 +51,7 @@
:isShowAddBtn="false" :detailButtonIsShow="true"
/>
-
+