Browse Source

检验任务和检验记录添加包装

master_hella_20240701
zhang_li 8 months ago
parent
commit
f8bfda3315
  1. 6
      src/api/qms/inspectionJob/inspectionJobPackage/index.ts
  2. 3
      src/components/listTable/index.ts
  3. 40
      src/components/listTable/src/ListTable.vue
  4. 1
      src/locales/en-US.ts
  5. 1
      src/locales/zh-CN.ts
  6. 12
      src/utils/disposition/defaultButtons.ts
  7. 393
      src/views/qms/inspection/inspectionJob/addForm.vue
  8. 61
      src/views/qms/inspection/inspectionJob/index.vue
  9. 65
      src/views/qms/inspection/inspectionJob/inspectionJobMain.data.ts
  10. 10
      src/views/qms/inspection/inspectionRecord/index.vue

6
src/api/qms/inspectionJob/inspectionJobPackage/index.ts

@ -0,0 +1,6 @@
import request from '@/config/axios'
//查询检验申请列表
export const getInspectionJobPackageList = async (id: number) => {
return await request.get({ url: `/qms/inspection-job-package/list?masterId=` + id })
}

3
src/components/listTable/index.ts

@ -0,0 +1,3 @@
import ListTable from './src/ListTable.vue'
export { ListTable }

40
src/components/listTable/src/ListTable.vue

@ -0,0 +1,40 @@
<template>
<div>
<Dialog v-model="isPackageShow" :title="dialogTitle" :width="width?width:'900px'" v-loading="packageLoading">
<Table
ref="searchTableRef"
:columns="columns"
:data="allList"
:reserveSelection="true"
row-key="id"
/>
</Dialog>
</div>
</template>
<script lang="ts" setup>
const isPackageShow = ref(false)
const packageLoading = ref(false)
const dialogTitle = ref()
const message = useMessage() //
const columns = ref()
const allList = ref()
//
const props = defineProps({
width: {
type: String,
required: false
},
})
const openPackage = async (row?: any, titleName?: any,tableColumns?: any,list?: any) => {
isPackageShow.value = true
if (titleName) {
dialogTitle.value = titleName
}
columns.value = tableColumns.filter(item => (item.field !== 'action'))
allList.value = list
}
defineExpose({ openPackage }) // open
</script>

1
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',

1
src/locales/zh-CN.ts

@ -297,6 +297,7 @@ export default {
edit: '编辑',
update: '编辑',
preview: '预览',
execute: '执行',
more: '更多',
sync: '同步',
save: '保存',

12
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,{

393
src/views/qms/inspection/inspectionJob/addForm.vue

@ -27,7 +27,7 @@
:stretch="false"
>
<el-tab-pane
v-for="(item,index) in data.subList"
v-for="item in data.subList"
:key="item.name"
:label="item.processCode"
:name="item.name"
@ -37,7 +37,11 @@
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="编码" prop="processCode">
<el-input v-model="item.processCode" placeholder="根据系统生成" :disabled="true" />
<el-input
v-model="item.processCode"
placeholder="根据系统生成"
:disabled="true"
/>
</el-form-item>
</el-col>
<el-col :span="12">
@ -51,12 +55,12 @@
</el-col>
<el-col :span="12">
<el-form-item label="描述" prop="processDescribe">
<el-input v-model="item.processDescribe" :disabled="true" />
<el-input v-model="item.processDescribe" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="顺序号" prop="sequenceCode">
<el-input v-model="item.sequenceCode" :disabled="true" />
<el-input v-model="item.sequenceCode" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="12">
@ -83,39 +87,45 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="描述" prop="inspectionJobCharacteristicsUpdateReqVO.description">
<el-input v-model="item.inspectionJobCharacteristicsUpdateReqVO.description" :disabled="true" />
<el-form-item
label="描述"
prop="inspectionJobCharacteristicsUpdateReqVO.description"
>
<el-input
v-model="item.inspectionJobCharacteristicsUpdateReqVO.description"
:disabled="true"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="检验方法"
prop="inspectionJobCharacteristicsUpdateReqVO.inspectionMethodCode"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionJobCharacteristicsUpdateReqVO.inspectionMethodName"
disabled
placeholder="请选择检验方法"
/>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="采样过程编码"
prop="inspectionJobCharacteristicsUpdateReqVO.inspectionMethod"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionJobCharacteristicsUpdateReqVO.inspectionName"
disabled
placeholder="请选择采样过程编码"
/>
</div>
</el-form-item>
</el-col>
<!-- <el-col :span="12">
<el-form-item
label="检验方法"
prop="inspectionJobCharacteristicsUpdateReqVO.inspectionMethodCode"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionJobCharacteristicsUpdateReqVO.inspectionMethodName"
disabled
placeholder="请选择检验方法"
/>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="采样过程编码"
prop="inspectionJobCharacteristicsUpdateReqVO.inspectionMethod"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionJobCharacteristicsUpdateReqVO.inspectionName"
disabled
placeholder="请选择采样过程编码"
/>
</div>
</el-form-item>
</el-col>
<!-- <el-col :span="12">
<el-form-item
label="动态修改规则编码"
prop="inspectionJobCharacteristicsUpdateReqVO.dynamicUpdateCode"
@ -148,7 +158,7 @@
<el-select
v-model="item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod"
placeholder="请选择结果录入方式"
@change="resultEntryMethodChange($event,item)"
@change="resultEntryMethodChange($event, item)"
disabled
>
<el-option
@ -163,23 +173,32 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="特征类型" prop="inspectionJobCharacteristicsUpdateReqVO.featureType">
<el-form-item
label="特征类型"
prop="inspectionJobCharacteristicsUpdateReqVO.featureType"
>
<el-select
v-model="item.inspectionJobCharacteristicsUpdateReqVO.featureType"
placeholder="请选择特征类型"
@change="changeFeatureType"
disabled
>
<el-option v-for="dict in getStrDictOptions( DICT_TYPE.INSPECTION_CHARACTERISTICS_FEATURE_TYPE )"
<el-option
v-for="dict in getStrDictOptions(
DICT_TYPE.INSPECTION_CHARACTERISTICS_FEATURE_TYPE
)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
</el-col>
<el-col :span="12">
<el-form-item label="开始时间" prop="inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime">
<el-form-item
label="开始时间"
prop="inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime"
>
<el-date-picker
v-model="item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime"
type="datetime"
@ -190,7 +209,10 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="结束时间" prop="inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime">
<el-form-item
label="结束时间"
prop="inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime"
>
<el-date-picker
v-model="item.inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime"
type="datetime"
@ -200,17 +222,37 @@
/>
</el-form-item>
</el-col>
<el-col :span="24" style="border: 1px solid #dedede ;border-radius: 4px ;padding-top: 16px;margin-bottom: 10px" v-for="(cur,i) in data.subList[index].inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList" :key="i">
<el-col
:span="24"
style="
border: 1px solid #dedede;
border-radius: 4px;
padding-top: 16px;
margin-bottom: 10px;
"
v-for="(cur, i) in item.inspectionJobCharacteristicsUpdateReqVO
.recordInspectionQuantifyList"
:key="i"
>
<el-row>
<!-- 汇总录入的时候显示 -->
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1">
<el-col
:span="12"
v-if="item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1"
>
<el-form-item label="合格数量">
<el-input v-model="cur.qualifiedQuantity" placeholder="请输入合格数量"/>
<el-input v-model="cur.qualifiedQuantity" placeholder="请输入合格数量" />
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1">
<el-col
:span="12"
v-if="item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1"
>
<el-form-item label="不合格数量">
<el-input v-model="cur.unqualifiedQuantity" placeholder="请输入不合格数量"/>
<el-input
v-model="cur.unqualifiedQuantity"
placeholder="请输入不合格数量"
/>
</el-form-item>
</el-col>
<!-- 手动评估的时候显示 -->
@ -219,43 +261,54 @@
<el-select
v-model="cur.estimateCode"
placeholder="请选择评估代码"
@change="changeFeatureType">
<el-option v-for="dict in getStrDictOptions( DICT_TYPE.EVALUATION_CODE  )"
@change="changeFeatureType"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.EVALUATION_CODE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"/>
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0">
<el-col
:span="12"
v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0"
>
<el-form-item label="检验值" prop="inspectionValue">
<el-input v-model="cur.inspectionValue" placeholder="请输入检验值"/>
<el-input v-model="cur.inspectionValue" placeholder="请输入检验值" />
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == 1">
<el-col
:span="12"
v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == 1"
>
<el-form-item label="选定集" prop="qualitativeCode">
<el-select
v-model="cur.qualitativeCode"
placeholder="请选择选定集"
@change="changeQualitativeCode($event,item,cur)">
<el-option v-for="dict in item.selectedProjectRespVOList"
@change="changeQualitativeCode($event, item, cur)"
>
<el-option
v-for="dict in item.selectedProjectRespVOList"
:key="dict.dictionaryValue"
:label="dict.dictionaryLabel"
:value="dict.dictionaryValue"/>
:value="dict.dictionaryValue"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.samplingProcessRespVO.evaluationMode == 1">
<el-form-item label="缺陷级别">
<el-select
v-model="cur.defectLevel"
placeholder="请选择缺陷级别"
disabled>
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.DEFECT_LEVEL)"
<el-select v-model="cur.defectLevel" placeholder="请选择缺陷级别" disabled>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.DEFECT_LEVEL)"
:key="dict.value"
:label="dict.label"
:value="dict.value"/>
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
@ -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=[]
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<data.value.sampleTotalAmount;i++){
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({
inspectionValue:'',//
qualitativeCode:'',//
estimateCode:'',//
defectLevel:'',//
qualifiedQuantity:'',//
unqualifiedQuantity:'',//
})
}
if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 0) {
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true
for (let i = 0; i < data.value.sampleTotalAmount; i++) {
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({
inspectionValue: '', //
qualitativeCode: '', //
estimateCode: '', //
defectLevel: '', //
qualifiedQuantity: '', //
unqualifiedQuantity: '' //
})
}
} else {
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = false
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList=[{
inspectionValue:'',//
qualitativeCode:'',//
estimateCode:'',//
defectLevel:'',//
qualifiedQuantity:'',//
unqualifiedQuantity:'',//
}]
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = [
{
inspectionValue: '', //
qualitativeCode: '', //
estimateCode: '', //
defectLevel: '', //
qualifiedQuantity: '', //
unqualifiedQuantity: '' //
}
]
}
//
if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping) {
@ -511,7 +560,11 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
}
})
data.value.subList = list
formMainRef.value.setValues(row)
dialogVisible.value = true
nextTick(() => {
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,51 +686,66 @@ 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 = 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
}
)
)
}
if(item.samplingProcessRespVO.evaluationMode == 1){
arr1.push(item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some((cur,key) =>{
return !cur.estimateCode ||!cur.defectLevel
}))
if (item.samplingProcessRespVO.evaluationMode == 1) {
arr1.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) {
arr1.push(
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some(
(cur, key) => {
return !cur.inspectionValue
}
)
)
}
if(item.inspectionJobCharacteristicsUpdateReqVO.featureType == 1){
arr1.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
}
)
)
}
return arr1
})
// console.log(arrBol)
// let isEmpty1 = arrBol.filter(item=>item == true)
// arrBol.forEach(item=>{
// console.log('1q1q')
// console.log(typeof item)
// })
})
// 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)
@ -789,22 +857,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 +889,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 +905,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<data.value.sampleTotalAmount;i++){
for (let i = 0; i < data.value.sampleTotalAmount; i++) {
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({
inspectionValue:'',//
qualitativeCode:'',//
estimateCode:'',//
defectLevel:'',//
qualifiedQuantity:'',//
unqualifiedQuantity:'',//
inspectionValue: '', //
qualitativeCode: '', //
estimateCode: '', //
defectLevel: '', //
qualifiedQuantity: '', //
unqualifiedQuantity: '' //
})
}
} else {
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = false
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList=[{
inspectionValue:'',//
qualitativeCode:'',//
estimateCode:'',//
defectLevel:'',//
qualifiedQuantity:'',//
unqualifiedQuantity:'',//
}]
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = [
{
inspectionValue: '', //
qualitativeCode: '', //
estimateCode: '', //
defectLevel: '', //
qualifiedQuantity: '', //
unqualifiedQuantity: '' //
}
]
}
console.log(222,item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList)
console.log(222, item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList)
}
//
const changeQualitativeCode= (e,item,cur)=>{
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
}

61
src/views/qms/inspection/inspectionJob/index.vue

@ -27,12 +27,6 @@
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<!-- <BasicForm ref="formRef" @success="getList" :rules="InspectionJobMainRules"
:formAllSchemas="InspectionJobMain.allSchemas" :tableAllSchemas="InspectionJobDetail.allSchemas"
:tableFormRules="InspectionJobDetailRules" :tableData="tableData"
:apiUpdate="InspectionJobMainApi.updateInspectionJobMain" :apiCreate="InspectionJobMainApi.createInspectionJobMain"
:isBusiness="true" @handleAddTable="handleAddTable" @handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess" @submitForm="submitForm" /> -->
<AddForm
ref="basicFormRef"
basicFormWidth="80"
@ -43,6 +37,7 @@
:formAllSchemas="InspectionJobMain.allSchemas"
@submitForm="submitForm"
/>
<!-- 详情 -->
<Detail
ref="detailRef" :isBasic="false" :allSchemas="InspectionJobMain.allSchemas"
:detailAllSchemas="InspectionJobDetail.allSchemas" :detailAllSchemasRules="InspectionJobDetailRules"
@ -52,33 +47,23 @@
:apiDelete="InspectionJobDetailApi.deleteInspectionJobDetail" @searchTableSuccessDetail="searchTableSuccessDetail"
:isShowAddBtn="false" :detailButtonIsShow="true"
/>
<!-- 详情 -->
<!-- <Detail ref="detailRef" :isBasic="false" :allSchemas="InspectionJobMain.allSchemas"
:detailAllSchemas="InspectionJobDetail.allSchemas" :detailAllSchemasRules="InspectionJobDetailRules"
:apiCreate="InspectionJobDetailApi.createInspectionJobDetail"
:apiUpdate="InspectionJobDetailApi.updateInspectionJobDetail"
:apiPage="InspectionJobDetailApi.getInspectionJobDetailPage"
:apiDelete="InspectionJobDetailApi.deleteInspectionJobDetail" @searchTableSuccessDetail="searchTableSuccessDetail"
:isShowAddBtn="false" :detailButtonIsShow="true"/> -->
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/purchase-main/import" :importTemplateData="importTemplateData"
@success="importSuccess" :isShowOut="true" :updateIsDisable="true" :coverIsDisable="true" :mode="2" />
<!-- 包装信息 -->
<listTable ref="listTableRef" titleName="包装信息"/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { InspectionJobMain, InspectionJobMainRules, InspectionJobDetail, InspectionJobDetailRules } from './inspectionJobMain.data'
import { InspectionJobMain, InspectionJobMainRules, InspectionJobDetail, InspectionJobDetailRules,InspectionJobPackage} from './inspectionJobMain.data'
import { InspectionTemplateMain,InspectionTemplateProcess,InspectionTemplateFeatures,InspectionTemplateRules } from '../../basicDataManage/inspectionTemplate/inspectionTemplate.data'
import * as InspectionJobMainApi from '@/api/qms/inspectionJob/inspectionJobMain'
import * as InspectionJobDetailApi from '@/api/qms/inspectionJob/inspectionJobDetail'
import * as InspectionJobPackageApi from '@/api/qms/inspectionJob/inspectionJobPackage'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import listTable from '@/components/listTable/src/listTable.vue'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import AddForm from './addForm.vue'
import Detail from './detail.vue'
import * as InspectionPlanApi from '@/api/qms/inspectionPlan'
//
defineOptions({ name: 'InspectionJobMain' })
@ -140,19 +125,9 @@
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn(null), //
// defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
@ -187,13 +162,17 @@
defaultButtons.mainListJobCloBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:purchasereceipt-job-main:close'}), //
// defaultButtons.mainListJobAbaBtn({hide:isShowMainButton(row,['2'])}), //
defaultButtons.mainListJobExeBtn({hide:isShowMainButton(row,['2'])}), //
defaultButtons.mainListPackageBtn({hide:isShowMainButton(row,['2'])}), //
]
}
const listTableRef = ref()
// -
const buttonTableClick = async (val, row) => {
if (val == 'mainJobExe') { //
execute('execute', row)
}else if (val == 'mainPackage') { //
const list = await InspectionJobPackageApi.getInspectionJobPackageList(row.id)
listTableRef.value.openPackage(row,'包装信息',InspectionJobPackage.allSchemas.tableColumns,list)
}
else if (val == 'mainJobClo') { //
handleDelete(row.id)
@ -256,14 +235,6 @@
})
const tableData = ref([])
//
const handleAddTable = () => {
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
}
//
const handleDeleteTable = (item, index) => {
tableData.value.splice(index, 1)
}
//
const submitForm = async (formType, data) => {
@ -291,16 +262,6 @@
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '采购订单主导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {

65
src/views/qms/inspection/inspectionJob/inspectionJobMain.data.ts

@ -318,17 +318,17 @@ export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
}
}
},
{
label: '使用决策',
field: 'usageDecision',
sort: 'custom',
isSearch: false,
dictType: DICT_TYPE.USAGE_DECISION,
form:{
componentProps:{
}
}
},
// {
// label: '使用决策',
// field: 'usageDecision',
// sort: 'custom',
// isSearch: false,
// dictType: DICT_TYPE.USAGE_DECISION,
// form:{
// componentProps:{
// }
// }
// },
{
label: '是否可用',
field: 'available',
@ -363,11 +363,11 @@ export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
//表单校验
export const InspectionJobMainRules = reactive({
usageDecision: [required],
// usageDecision: [required],
})
/**
* @returns {Array}
* @returns {Array}
*/
export const InspectionJobDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
@ -458,3 +458,42 @@ export const InspectionJobDetailRules = reactive({
sequenceCode: [required],
available: [required],
})
/**
* @returns {Array}
*/
export const InspectionJobPackage = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '编码',
field: 'number',
sort: 'custom',
isSearch: true,
},
{
label: '包装号',
field: 'packageCode',
sort: 'custom',
isSearch: true,
},
{
label: '包装规格',
field: 'packageSpecificationCode',
sort: 'custom',
isSearch: true,
},
{
label: '数量',
field: 'amount',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '计量单位',
field: 'measuringUnit',
sort: 'custom',
isSearch: true,
},
]))

10
src/views/qms/inspection/inspectionRecord/index.vue

@ -51,15 +51,19 @@
:apiDelete="InspectionRecordDetailApi.deleteInspectionRecordDetail" @searchTableSuccessDetail="searchTableSuccessDetail"
:isShowAddBtn="false" :detailButtonIsShow="true"
/>
<!-- 导入 -->
<!-- 包装信息 -->
<listTable ref="listTableRef" titleName="包装信息"/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { InspectionRecordMain, InspectionRecordMainRules, InspectionRecordDetail, InspectionRecordDetailRules } from './inspectionRecordMain.data'
import { InspectionJobPackage} from './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 * as InspectionJobPackageApi from '@/api/qms/inspectionJob/inspectionJobPackage'
import listTable from '@/components/listTable/src/listTable.vue'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import Detail from './detail.vue'
@ -172,10 +176,14 @@
]
}
const listTableRef = ref()
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
}else if (val == 'mainPackage') { //
const list = await InspectionJobPackageApi.getInspectionJobPackageList(row.id)
listTableRef.value.openPackage(row,'包装信息',InspectionJobPackage.allSchemas.tableColumns,list)
}
else if (val == 'delete') { //
handleDelete(row.id)

Loading…
Cancel
Save