From df99da0fd674750aed7e3b17de86ee25ac9f8c30 Mon Sep 17 00:00:00 2001
From: songguoqiang <765017469@qq.com>
Date: Tue, 9 Apr 2024 17:39:43 +0800
Subject: [PATCH 1/2] =?UTF-8?q?=E6=A3=80=E9=AA=8C=E6=96=B9=E6=A1=88?=
=?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A3=80=E9=AA=8C=E7=B1=BB=E5=9E=8B=E5=AD=97?=
=?UTF-8?q?=E6=AE=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../qms/basicDataManage/inspectionScheme/addForm.vue | 12 ++++++------
.../qms/basicDataManage/inspectionScheme/index.vue | 8 ++++----
.../inspectionScheme/inspectionScheme.data.ts | 2 +-
3 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/views/qms/basicDataManage/inspectionScheme/addForm.vue b/src/views/qms/basicDataManage/inspectionScheme/addForm.vue
index 076329a63..7f94f4f3f 100644
--- a/src/views/qms/basicDataManage/inspectionScheme/addForm.vue
+++ b/src/views/qms/basicDataManage/inspectionScheme/addForm.vue
@@ -52,7 +52,7 @@
-
+
-
+
{
data.value[formField] = val[0].code
if (formField == 'itemCode') {
data.value.itemName = val[0].name
- } else if (formField == 'testTypeCode') {
+ } else if (formField == 'inspectionType') {
data.value.testTypeName = val[0].description
} else if (formField == 'programmeTemplateCode') {
data.value.programmeTemplateName = val[0].description
diff --git a/src/views/qms/basicDataManage/inspectionScheme/index.vue b/src/views/qms/basicDataManage/inspectionScheme/index.vue
index 787d11d4f..13e7a84a7 100644
--- a/src/views/qms/basicDataManage/inspectionScheme/index.vue
+++ b/src/views/qms/basicDataManage/inspectionScheme/index.vue
@@ -159,7 +159,7 @@ const submitForm = async (formType,data) => {
description: data.description,
itemCode: data.itemCode,
version: data.version,
- testTypeCode: data.testTypeCode,
+ inspectionType: data.inspectionType,
programmeTemplateCode: data.programmeTemplateCode,
splitRule: data.splitRule,
aql: data.aql,
@@ -170,10 +170,10 @@ const submitForm = async (formType,data) => {
content:JSON.stringify(data.process)
}
if (formType === 'create') {
- await InspectionSchemeApi.inspectionSchemeCreat(data1)
+ await InspectionSchemeApi.InspectionSchemeCreat(data1)
message.success(t('common.createSuccess'))
} else {
- await InspectionSchemeApi.inspectionSchemeUpdate(data1)
+ await InspectionSchemeApi.InspectionSchemeUpdate(data1)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
@@ -192,7 +192,7 @@ const handleDelete = async (id: number) => {
// 删除的二次确认
await message.delConfirm()
// 发起删除
- await InspectionSchemeApi.inspectionSchemeDelete(id)
+ await InspectionSchemeApi.InspectionSchemeDelete(id)
message.success(t('common.delSuccess'))
// 刷新列表
await getList()
diff --git a/src/views/qms/basicDataManage/inspectionScheme/inspectionScheme.data.ts b/src/views/qms/basicDataManage/inspectionScheme/inspectionScheme.data.ts
index fff1c0e44..baed2b3a3 100644
--- a/src/views/qms/basicDataManage/inspectionScheme/inspectionScheme.data.ts
+++ b/src/views/qms/basicDataManage/inspectionScheme/inspectionScheme.data.ts
@@ -115,7 +115,7 @@ export const InspectionSchemeMain = useCrudSchemas(reactive([
}
},{
label: '检验类型编码',
- field: 'testTypeCode',
+ field: 'inspectionType',
dictType: DICT_TYPE.INSPECTION_TYPE,
dictClass: 'string',
sort: 'custom',
From 1f5e393d8bc804a44df137e75175bd5b93d0b8dd Mon Sep 17 00:00:00 2001
From: zhang_li <2235006734@qqq.com>
Date: Tue, 9 Apr 2024 17:49:08 +0800
Subject: [PATCH 2/2] =?UTF-8?q?=E6=A3=80=E9=AA=8C=E8=AE=B0=E5=BD=95?=
=?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=8C=89=E9=92=AE=E6=B7=BB=E5=8A=A0=E5=8C=85?=
=?UTF-8?q?=E8=A3=85=E5=88=97=E8=A1=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../qms/inspection/inspectionJob/addForm.vue | 11 +-
.../qms/inspection/inspectionJob/index.vue | 18 +-
.../inspection/inspectionRecord/addForm.vue | 309 ++++++++++++++++++
.../qms/inspection/inspectionRecord/index.vue | 62 +++-
.../inspectionRecordMain.data.ts | 139 +++++++-
5 files changed, 487 insertions(+), 52 deletions(-)
create mode 100644 src/views/qms/inspection/inspectionRecord/addForm.vue
diff --git a/src/views/qms/inspection/inspectionJob/addForm.vue b/src/views/qms/inspection/inspectionJob/addForm.vue
index d1217fd2b..fdef80d4c 100644
--- a/src/views/qms/inspection/inspectionJob/addForm.vue
+++ b/src/views/qms/inspection/inspectionJob/addForm.vue
@@ -26,7 +26,7 @@
:maxHeight = "490"
:tableFields="tableAllSchemas.tableFormColumns"
:tableFormRules="tableFormRules"
- :tableData="data.packageVOList"
+ :tableData="data.packageList"
:isShowButton="false"
:isShowReduceButton="false"
/>
@@ -312,7 +312,6 @@
-
@@ -359,7 +358,6 @@
-
+
+
diff --git a/src/views/qms/inspection/inspectionRecord/index.vue b/src/views/qms/inspection/inspectionRecord/index.vue
index 7d7cacf9c..3bf88f430 100644
--- a/src/views/qms/inspection/inspectionRecord/index.vue
+++ b/src/views/qms/inspection/inspectionRecord/index.vue
@@ -27,21 +27,30 @@
-
+ :apiCreate="InspectionRecordMainApi.createInspectionRecordMain"
-
-
+ @handleAddTable="handleAddTable"
+ @handleDeleteTable="handleDeleteTable"
+ @searchTableSuccess="searchTableSuccess"
+ @submitForm="submitForm" /> -->
+
import download from '@/utils/download'
- import { InspectionRecordMain, InspectionRecordMainRules, InspectionRecordDetail, InspectionRecordDetailRules } from './inspectionRecordMain.data'
- import { InspectionJobPackage} from '../inspectionJob/inspectionJobMain.data'
+ import { InspectionRecordMain, InspectionRecordMainRules, InspectionRecordDetail, InspectionRecordDetailRules,InspectionRecordPackage, InspectionRecordPackageRules} from './inspectionRecordMain.data'
+ // import { InspectionJobPackage,InspectionJobPackageRules} from '../inspectionJob/inspectionJobMain.data'
import * as InspectionRecordMainApi from '@/api/qms/inspectionRecord/inspectionRecordMain'
import * as InspectionRecordDetailApi from '@/api/qms/inspectionRecord/inspectionRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import listTable from '@/components/listTable/src/listTable.vue'
import TableHead from '@/components/TableHead/src/TableHead.vue'
+ import AddForm from './addForm.vue'
import Detail from './detail.vue'
// 采购订单
@@ -173,6 +183,7 @@
defaultButtons.mainListEditBtn(null), // 编辑
// defaultButtons.mainListDeleteBtn(null), // 删除
defaultButtons.mainListOrderPubBtn(null), // 发布
+ defaultButtons.mainListPackageBtn(null), // 包装
]
}
@@ -197,7 +208,7 @@
openForm('update', row)
}else if (val == 'mainPackage') { // 包装
const list = await InspectionRecordMainApi.getInspectionRecordPackageList(row.id)
- listTableRef.value.openPackage(row,'包装信息',InspectionJobPackage.allSchemas.tableColumns,list)
+ listTableRef.value.openPackage(row,'包装信息',InspectionRecordPackage.allSchemas.tableColumns,list)
}else if (val == 'delete') { // 删除
handleDelete(row.id)
}else if (val == 'mainOrderPub') { //发布
@@ -278,8 +289,23 @@
const handleDeleteTable = (item, index) => {
tableData.value.splice(index, 1)
}
-
- // 主子数据 提交
+ const count = ref(0)
+ const onChange = (field, cur)=>{
+ console.log(field, cur)
+ // if(field=='useDecision'){
+ // if(cur == 1){
+ // InspectionRecordPackage.allSchemas.tableFormColumns.forEach(item=>{
+ // if(item.field == 'qualifiedAmount'){
+ // console.log(item.disabled)
+ // item.disabled = true
+ // console.log(item.disabled)
+ // }
+ // })
+ // }
+ // }
+ console.log(InspectionRecordPackage.allSchemas.tableFormColumns)
+}
+// // 主子数据 提交
const submitForm = async (formType, data) => {
data.subList = tableData.value // 拼接子表数据参数
try {
diff --git a/src/views/qms/inspection/inspectionRecord/inspectionRecordMain.data.ts b/src/views/qms/inspection/inspectionRecord/inspectionRecordMain.data.ts
index 0264c6085..c927a4210 100644
--- a/src/views/qms/inspection/inspectionRecord/inspectionRecordMain.data.ts
+++ b/src/views/qms/inspection/inspectionRecord/inspectionRecordMain.data.ts
@@ -2,6 +2,7 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter2 } from '@/utils/formatTime'
import { validateHanset, validateEmail } from '@/utils/validator'
import { dateFormatter } from '@/utils/formatTime'
+import {validateTwoNum } from '@/utils/validator'
const { t } = useI18n() // 国际化
/**
@@ -398,25 +399,7 @@ export const InspectionRecordMain = useCrudSchemas(reactive([
//表单校验
export const InspectionRecordMainRules = reactive({
- number: [required],
- applicationCode: [required],
- taskCode: [required],
- supplierCode: [required],
- materialCode: [required],
- batch: [required],
- inspectionSchemeCode: [required],
- inspectionBatch: [required],
- inspectionBatchAmount: [required],
- sampleTatalAmount: [required],
- inspectionType: [required],
- inspectionBatchSource: [required],
- orderCode: [required],
- orderRow: [required],
- inspectionStage: [required],
- inspectionStringency: [required],
useDecision: [required],
- inspectionLevel: [required],
- available: [required],
})
@@ -569,3 +552,123 @@ export const InspectionRecordDetailRules = reactive({
isDestroyInspection: [required],
available: [required],
})
+
+/**
+ * @returns {Array} 检验记录包装
+ */
+export const InspectionRecordPackage = useCrudSchemas(reactive([
+ {
+ label: '编码',
+ field: 'number',
+ sort: 'custom',
+ isSearch: true,
+ tableForm:{
+ disabled:true
+ }
+ },
+ {
+ label: '包装号',
+ field: 'packageCode',
+ sort: 'custom',
+ isSearch: true,
+ tableForm:{
+ disabled:true
+ }
+ },
+ {
+ label: '包装规格',
+ field: 'packageSpecificationCode',
+ sort: 'custom',
+ isSearch: true,
+ tableForm:{
+ disabled:true
+ }
+ },
+ {
+ label: '数量',
+ field: 'amount',
+ sort: 'custom',
+ isSearch: true,
+ form: {
+ component: 'InputNumber',
+ value: 0
+ },
+ tableForm:{
+ disabled:true
+ }
+ },
+ {
+ label: '计量单位',
+ field: 'measuringUnit',
+ sort: 'custom',
+ isSearch: true,
+ tableForm:{
+ disabled:true
+ }
+ },
+ {
+ label: '采样数量',
+ field: 'sampleAmount',
+ sort: 'custom',
+ isSearch: true,
+ tableForm:{
+ disabled:true
+ }
+ },
+ {
+ label: '合格数量',
+ field: 'qualifiedAmount',
+ sort: 'custom',
+ isSearch: true,
+ tableForm:{
+ disabled:true
+ }
+ },
+ {
+ label: '不合格数量',
+ field: 'noQualifiedAmount',
+ sort: 'custom',
+ isSearch: true,
+ tableForm:{
+ disabled:true
+ }
+ },
+ {
+ label: '破坏数量',
+ field: 'destroyAmount',
+ sort: 'custom',
+ isSearch: true,
+ tableForm:{
+ disabled:true
+ }
+ },
+ {
+ label: '冻结数量',
+ field: 'frozenAmount',
+ sort: 'custom',
+ isSearch: true,
+ tableForm:{
+ disabled:true
+ }
+ }
+]))
+
+//表单校验
+export const InspectionRecordPackageRules = reactive({
+ qualifiedAmount: [
+ required,
+ { validator:validateTwoNum, message: '小数点后最多2位', trigger: 'blur'}
+ ],
+ frozenAmount: [
+ required,
+ { validator:validateTwoNum, message: '小数点后最多2位', trigger: 'blur'}
+ ],
+ destroyAmount: [
+ required,
+ { validator:validateTwoNum, message: '小数点后最多2位', trigger: 'blur'}
+ ],
+ noQualifiedAmount: [
+ required,
+ { validator:validateTwoNum, message: '小数点后最多2位', trigger: 'blur'}
+ ],
+})
\ No newline at end of file