Browse Source

检验任务

master_hella_20240701
zhang_li 7 months ago
parent
commit
fcae4f14c5
  1. 2
      src/utils/dict.ts
  2. 127
      src/views/qms/inspection/inspectionJob/addForm.vue
  3. 6
      src/views/qms/inspection/inspectionJob/index.vue
  4. 75
      src/views/qms/inspection/inspectionJob/inspectionJobMain.data.ts

2
src/utils/dict.ts

@ -300,6 +300,8 @@ export enum DICT_TYPE {
DEFECT_LEVEL = "defect_level", // 缺陷级别
DICTIONARY_CLASS = "dictionary_class", // 字典分类
USAGE_DECISION = "usage_decision", // 使用决策
INSPECTION_BATCH_SOURCE = "inspection_batch_source", // 检验批来源
INSPECTION_TYPE = "inspection_type", // 检验类型
// ========== 业务 - mes -gaojs ==========
QUALIFY_STATUS = 'qualify_status',//质检状态

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

@ -28,7 +28,7 @@
:stretch="false"
>
<el-tab-pane
v-for="item in data.subList"
v-for="(item,index) in data.subList"
:key="item.name"
:label="item.processCode"
:name="item.name"
@ -116,7 +116,7 @@
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<!-- <el-col :span="12">
<el-form-item
label="动态修改规则编码"
prop="inspectionJobCharacteristicsUpdateReqVO.dynamicUpdateCode"
@ -129,7 +129,7 @@
/>
</div>
</el-form-item>
</el-col>
</el-col> -->
<el-col :span="12">
<el-form-item
label="是否允许修改特征值"
@ -179,12 +179,35 @@
</el-select>
</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,key) in item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList" :key="key">
<el-col :span="12">
<el-form-item label="开始时间" prop="inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime">
<el-date-picker
v-model="item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime"
type="datetime"
placeholder="请选择开始时间"
style="width: 100%"
value-format="x"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="结束时间" prop="inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime">
<el-date-picker
v-model="item.inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime"
type="datetime"
placeholder="请选择结束时间"
style="width: 100%"
value-format="x"
/>
</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-row>
<!-- 汇总录入的时候显示 -->
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1">
<el-form-item label="合格数量" prop="inspectionJobCharacteristicsUpdateReqVO.featureType">
<el-form-item label="合格数量">
<el-input v-model="cur.qualifiedQuantity" placeholder="请输入合格数量"/>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1">
@ -410,58 +433,17 @@ const rules = ref({
{ required: true, message: '请输入小数位', trigger: 'blur' }
],
'inspectionJobCharacteristicsUpdateReqVO.quantifyQuantifyCode': [
{ required: true, message: '请输入选择集编码', trigger: 'blur' }
]
{ required: true, message: '请输入选择集编码', trigger: 'change' }
],
'inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime': [
{ required: true, message: '请输入选择开始时间', trigger: 'change'}
],
'inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime': [
{ required: true, message: '请输入选择结束时间', trigger: 'blur' }
],
})
// const rules = ref({
// itemCode: [{ required: true, message: '', trigger: 'blur' }],
// version: [{ required: true, message: '', trigger: 'blur' }],
// testTypeCode: [{ required: true, message: '', trigger: ['blur', 'change'] }],
// programmeTemplateCode: [
// { required: true, message: '', trigger: ['blur', 'change'] }
// ],
// splitRule: [{ required: true, message: '', trigger: ['blur', 'change'] }],
// aql: [{ required: true, message: 'aql', trigger: ['blur', 'change'] }],
// inspectionLevel: [{ required: true, message: '', trigger: ['blur', 'change'] }],
// effectiveDate: [{ required: true, message: '', trigger: ['blur', 'change'] }],
// expirationDate: [{ required: true, message: '', trigger: ['blur', 'change'] }],
// 'inspectionJobCharacteristicsUpdateReqVO.description': [
// { required: true, message: '', trigger: ['blur', 'change'] }
// ],
// 'inspectionJobCharacteristicsUpdateReqVO.inspectionMethodCode': [
// { required: true, message: '', trigger: 'blur' }
// ],
// 'inspectionJobCharacteristicsUpdateReqVO.dynamicUpdateCode': [
// { required: true, message: '', trigger: ['blur', 'change'] }
// ],
// 'inspectionJobCharacteristicsUpdateReqVO.inspectionMethod': [
// { required: true, message: '', trigger: ['blur', 'change'] }
// ],
// 'inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod': [
// { required: true, message: '', trigger: ['blur', 'change'] }
// ],
// 'inspectionJobCharacteristicsUpdateReqVO.featureType': [
// { required: true, message: '', trigger: ['blur', 'change'] }
// ],
// 'inspectionJobCharacteristicsUpdateReqVO.quantifyTarget': [
// { required: true, message: '', trigger: 'blur' }
// ],
// 'inspectionJobCharacteristicsUpdateReqVO.quantifyCapping': [
// { required: true, message: '', trigger: 'blur' }
// ],
// 'inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit': [
// { required: true, message: '', trigger: 'blur' }
// ],
// 'inspectionJobCharacteristicsUpdateReqVO.quantifyUom': [
// { required: true, message: '', trigger: 'blur' }
// ],
// 'inspectionJobCharacteristicsUpdateReqVO.quantifyDecimal': [
// { required: true, message: '', trigger: 'blur' }
// ],
// 'inspectionJobCharacteristicsUpdateReqVO.quantifyQuantifyCode': [
// { required: true, message: '', trigger: 'blur' }
// ]
// })
/** 打开弹窗 */
let tabIndex = 1
@ -647,9 +629,36 @@ const validateForm = (formRef) => {
const submitForm = async () => {
try {
const validateForm1 = await validateForm(formProcessRef.value)
// console.log(validateForm1)
// await formMainRef.value.validate()
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)
// console.log(bol2)
// if (!bol2) {
// message.error(``)
// return
// }
//
let arrBol = data.value.subList.map((item, index) => {
if(item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1){
return item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some((cur,key) =>{
return !cur.qualifiedQuantity || !cur.unqualifiedQuantity
})
}
})
console.log(arrBol)
let isEmpty1 = arrBol.some(item=>item== true)
if (isEmpty1) {
proxy.$modal.msgError("请填写完整信息");
return;
}
return
// if (!data.value.process || data.value.process.length == 0) {
// message.error(``)
// return

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

@ -39,7 +39,7 @@
:formAllSchemasFeatures="InspectionTemplateFeatures.allSchemas"
:formAllSchemasProcess="InspectionTemplateProcess.allSchemas"
:formAllSchemasMain="InspectionTemplateMain.allSchemas"
:rules="InspectionTemplateRules"
:rules="InspectionJobMainRules"
:formAllSchemas="InspectionJobMain.allSchemas"
@submitForm="submitForm"
/>
@ -50,7 +50,7 @@
:apiUpdate="InspectionJobDetailApi.updateInspectionJobDetail"
:apiPage="InspectionJobDetailApi.getInspectionJobDetailPage"
:apiDelete="InspectionJobDetailApi.deleteInspectionJobDetail" @searchTableSuccessDetail="searchTableSuccessDetail"
:isShowAddBtn="false" :detailButtonIsShow="true" />
:isShowAddBtn="false" :detailButtonIsShow="true"/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/purchase-main/import" :importTemplateData="importTemplateData"
@ -230,7 +230,7 @@
//
exportLoading.value = true
const data = await InspectionJobMainApi.exportInspectionJobMain(tableObject.params)
download.excel(data, '备件申领记录主.xlsx')
download.excel(data, '检验任务.xlsx')
} catch {
} finally {
exportLoading.value = false

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

@ -3,6 +3,16 @@ import { dateFormatter2 } from '@/utils/formatTime'
import { validateHanset, validateEmail } from '@/utils/validator'
import { dateFormatter } from '@/utils/formatTime'
const { t } = useI18n() // 国际化
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
const resultEntryMethodList = getStrDictOptions(DICT_TYPE.INSPECTION_CHARACTERISTICS_RESULT_ENTRY)
const featureTypeList = getStrDictOptions( DICT_TYPE.INSPECTION_CHARACTERISTICS_FEATURE_TYPE )
const isCanUpdateList = [{
label:'是',
value:true
},{
label:'否',
value:false
}]
/**
* @returns {Array}
@ -166,6 +176,8 @@ export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'inspectionType',
sort: 'custom',
isSearch: false,
dictType: DICT_TYPE.INSPECTION_TYPE,
dictClass: 'string',
form: {
component: 'Select',
componentProps:{
@ -178,6 +190,8 @@ export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'inspectionBatchSource',
sort: 'custom',
isSearch: false,
dictType: DICT_TYPE.INSPECTION_BATCH_SOURCE,
dictClass: 'string',
form:{
componentProps:{
disabled:true
@ -202,6 +216,8 @@ export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'inspectionStringency',
sort: 'custom',
isSearch: false,
dictType: DICT_TYPE.INSPECTION_SEVERITY,
dictClass: 'string',
form:{
componentProps:{
disabled:true
@ -281,6 +297,8 @@ export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'inspectionLevel',
sort: 'custom',
isSearch: false,
dictType: DICT_TYPE.INSPECTION_LEVEL,
dictClass: 'string',
form:{
componentProps:{
disabled:true
@ -292,6 +310,8 @@ export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'aqlValue',
sort: 'custom',
isSearch: false,
dictType: DICT_TYPE.BASIC_AQL,
dictClass: 'string',
form:{
componentProps:{
disabled:true
@ -312,13 +332,22 @@ export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '是否可用',
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
sort: 'custom',
isSearch: false,
form:{
componentProps:{
table: {
width: 150
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disabled:true
}
}
},
},
{
label: '操作',
@ -334,24 +363,7 @@ export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
//表单校验
export const InspectionJobMainRules = reactive({
number: [required],
inspectionCode: [required],
supplierCode: [required],
materialCode: [required],
materialBatch: [required],
orderCode: [required],
certificateRow: [required],
inspectionSchemeCode: [required],
inspectionSchemeJson: [required],
inspectionBatch: [required],
inspectionBatchAmount: [required],
sampleTatalAmount: [required],
inspectionType: [required],
inspectionBatchSource: [required],
inspectionStage: [required],
inspectionStringency: [required],
inspectionLevel: [required],
available: [required],
usageDecision: [required],
})
/**
@ -407,24 +419,35 @@ export const InspectionJobDetail = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
},{
label: '采样过程编码',
field: 'inspectionMethod',
field: 'inspectionJobCharacteristicsRespVO.inspectionMethod',
sort: 'custom',
},{
label: '动态修改规则编码',
field: 'dynamicUpdateCode',
field: 'inspectionJobCharacteristicsRespVO.dynamicUpdateCode',
sort: 'custom',
},{
label: '是否允许修改特征值',
field: 'inspectionJobCharacteristicsRespVO.isCanUpdate',
sort: 'custom',
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return isCanUpdateList.find((account) => account.value == cellValue)?.label
},
},{
label: '结果录入方式',
field: 'resultEntryMethod',
field: 'inspectionJobCharacteristicsRespVO.resultEntryMethod',
sort: 'custom',
// dictType: DICT_TYPE.INSPECTION_CHARACTERISTICS_RESULT_ENTRY,
// dictClass: 'string',
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return resultEntryMethodList.find((account) => account.value == cellValue)?.label
},
},{
label: '特征类型',
field: 'featureType',
field: 'inspectionJobCharacteristicsRespVO.featureType',
sort: 'custom',
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return featureTypeList.find((account) => account.value == cellValue)?.label
},
}
]))

Loading…
Cancel
Save