From 3369a0ee21ba7d997e1b5ab2faca817d21a0654f Mon Sep 17 00:00:00 2001
From: zhang_li <2235006734@qqq.com>
Date: Wed, 3 Apr 2024 09:41:06 +0800
Subject: [PATCH] =?UTF-8?q?=E6=A3=80=E9=AA=8C=E6=96=B9=E6=A1=88?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/qms/inspectionPlan/index.ts | 23 +--
src/utils/dict.ts | 4 +-
.../inspectionPlan/addForm.vue | 141 ++++++++++++++++--
.../basicDataManage/inspectionPlan/index.vue | 10 +-
.../inspectionTemplate/addForm.vue | 18 ++-
5 files changed, 159 insertions(+), 37 deletions(-)
diff --git a/src/api/qms/inspectionPlan/index.ts b/src/api/qms/inspectionPlan/index.ts
index 1c07a30d3..e0938f648 100644
--- a/src/api/qms/inspectionPlan/index.ts
+++ b/src/api/qms/inspectionPlan/index.ts
@@ -1,30 +1,23 @@
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 inspectionPlanCreat = async (data) => {
+ return await request.post({ url: `/qms/type-template/create`,data})
}
// 编辑
-export const inspectionTemplateUpdate = async (data) => {
- return await request.put({ url: `/qms/programme-template/update`,data})
+export const inspectionPlanUpdate = async (data) => {
+ return await request.put({ url: `/qms/type-template/update`,data})
}
// 删除
-export const inspectionTemplateDelete = async (id) => {
- return await request.delete({ url: `/qms/programme-template/delete?id=`+id})
+export const inspectionPlanDelete = async (id) => {
+ return await request.delete({ url: `/qms/type-template/delete?id=`+id})
}
// 列表
-export const inspectionTemplatePage = async (params) => {
+export const inspectionPlanPage = 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 })
+ return await request.get({ url: `/qms/type-template/page`, params })
}
}
\ No newline at end of file
diff --git a/src/utils/dict.ts b/src/utils/dict.ts
index b72ef2599..df8c4ee05 100644
--- a/src/utils/dict.ts
+++ b/src/utils/dict.ts
@@ -293,7 +293,9 @@ export enum DICT_TYPE {
INSPECTION_CHARACTERISTICS_FEATURE_TYPE = "inspection_characteristics_feature_type", // 特征类型
INSPECTION_CHARACTERISTICS_RESULT_ENTRY = "inspection_characteristics_result_entry", // 结果录入方式
INSPECTION_SEVERITY = 'inspection_severity',//检验严重性
-
+ SPLIT_RULES = "split_rules", // 拆分规则
+ INSPECTION_LEVEL = "inspection_level", // 检验水平字典
+ BASIC_AQL = "basic_aql", // aql
// ========== 业务 - mes -gaojs ==========
QUALIFY_STATUS = 'qualify_status',//质检状态
diff --git a/src/views/qms/basicDataManage/inspectionPlan/addForm.vue b/src/views/qms/basicDataManage/inspectionPlan/addForm.vue
index d20c0ba3d..1d59048e2 100644
--- a/src/views/qms/basicDataManage/inspectionPlan/addForm.vue
+++ b/src/views/qms/basicDataManage/inspectionPlan/addForm.vue
@@ -7,9 +7,8 @@
:vLoading="formLoading"
>
-
-
+
@@ -25,6 +24,103 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
检验工序
-
@@ -483,6 +572,7 @@ const data = ref({
code: '',
description: '',
version: '',
+ available:true,
process: []
})
const isYesList = [
@@ -576,10 +666,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 {
@@ -587,6 +695,7 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
code: '',
description: '',
version: '',
+ available:true,
process: []
}
}
@@ -645,6 +754,7 @@ const buttonBaseClick1 = (val) => {
featureType: '',
quantifyIsCapping: '',
quantifyIsLowlimit: '',
+ quantifyIsTarget: '',
quantifyTarget: '',
quantifyCapping: '',
quantifyLowlimit: '',
@@ -691,6 +801,7 @@ const validateForm = (formRef) => {
return false
})
}
+
const submitForm = async () => {
try {
const validateForm1 = await validateForm(formProcessRef.value)
@@ -706,6 +817,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 +848,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/inspectionPlan/index.vue b/src/views/qms/basicDataManage/inspectionPlan/index.vue
index 9699dd2a2..be2a9d26b 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/inspectionPlan'
+import * as InspectionPlanApi from '@/api/qms/inspectionPlan'
defineOptions({ name: 'AgvLocationrelation' })
@@ -84,7 +84,7 @@ const updataTableColumns = (val) => {
}
const { tableObject, tableMethods } = useTable({
- getListApi: InspectionProcessPageApi.inspectionTemplatePage // 分页接口
+ getListApi: InspectionPlanApi.inspectionPlanPage // 分页接口
})
// 获得表格的各种操作
@@ -149,10 +149,10 @@ const openForm = (type: string, row?: any) => {
const submitForm = async (formType,data) => {
console.log(data.value)
if (formType === 'create') {
- await InspectionProcessPageApi.inspectionTemplateCreat(data.value)
+ await InspectionPlanApi.inspectionPlanCreat(data.value)
message.success(t('common.createSuccess'))
} else {
- await InspectionProcessPageApi.inspectionTemplateUpdate(data.value)
+ await InspectionPlanApi.inspectionPlanUpdate(data.value)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
@@ -171,7 +171,7 @@ const handleDelete = async (id: number) => {
// 删除的二次确认
await message.delConfirm()
// 发起删除
- await InspectionProcessPageApi.inspectionTemplateDelete(id)
+ await InspectionPlanApi.inspectionPlanDelete(id)
message.success(t('common.delSuccess'))
// 刷新列表
await getList()
diff --git a/src/views/qms/basicDataManage/inspectionTemplate/addForm.vue b/src/views/qms/basicDataManage/inspectionTemplate/addForm.vue
index 555761be5..3297217fb 100644
--- a/src/views/qms/basicDataManage/inspectionTemplate/addForm.vue
+++ b/src/views/qms/basicDataManage/inspectionTemplate/addForm.vue
@@ -8,7 +8,7 @@
>
-
+
@@ -266,7 +266,9 @@
label="是否设定上限"
prop="inspectionCharacteristicsBaseVO.quantifyIsCapping"
>
-
+
@@ -295,7 +297,8 @@
label="是否设定下限"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"
>
-
+
@@ -324,7 +327,8 @@
label="是否设定目标值"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"
>
-
+