Browse Source

检验任务

master_hella_20240701
zhang_li 8 months ago
parent
commit
d327af15d6
  1. 31
      src/api/qms/inspectionJob/inspectionJobMain/index.ts
  2. 1
      src/utils/dict.ts
  3. 569
      src/views/qms/inspection/inspectionJob/addForm.vue
  4. 9
      src/views/qms/inspection/inspectionJob/index.vue
  5. 184
      src/views/qms/inspection/inspectionJob/inspectionJobMain.data.ts

31
src/api/qms/inspectionJob/inspectionJobMain/index.ts

@ -1,27 +1,5 @@
import request from '@/config/axios'
export interface InspectionJobMainVO {
number: string
applicationDate: localdate
applicationTime: Date
requestStartTime: Date
requestEndTime: Date
finishTime: Date
supplierCode: string
materialCode: string
batch: string
requestInspectionNum: number
referenceOrderCode: string
referenceOrderRow: number
referenceCertificateCode: string
referenceCertificateRow: number
inspectionSchemeCode: string
inspectionStageCode: string
applicationPackageCode: string
inspectionLevel: string
aqlValue: number
available: string
}
// 查询检验申请列表
export const getInspectionJobMainPage = async (params) => {
@ -40,15 +18,18 @@ export const getInspectionJobMain = async (id: number) => {
}
// 新增检验申请
export const createInspectionJobMain = async (data: InspectionJobMainVO) => {
export const createInspectionJobMain = async (data) => {
return await request.post({ url: `/qms/inspection-job-main/create`, data })
}
// 修改检验申请
export const updateInspectionJobMain = async (data: InspectionJobMainVO) => {
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 })

1
src/utils/dict.ts

@ -299,6 +299,7 @@ export enum DICT_TYPE {
EVALUATION_CODE = "evaluation_code", // 评估代码
DEFECT_LEVEL = "defect_level", // 缺陷级别
DICTIONARY_CLASS = "dictionary_class", // 字典分类
USAGE_DECISION = "usage_decision", // 使用决策
// ========== 业务 - mes -gaojs ==========
QUALIFY_STATUS = 'qualify_status',//质检状态

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

@ -16,7 +16,6 @@
:rules="rules"
:schema="formSchema"
:is-col="true"
:disabled="true"
@opensearchTable="opensearchTable"
/>
<el-tabs
@ -29,7 +28,7 @@
:stretch="false"
>
<el-tab-pane
v-for="item in data.process"
v-for="item in data.subList"
:key="item.name"
:label="item.processCode"
:name="item.name"
@ -78,141 +77,66 @@
<el-col :span="12">
<el-form-item label="编码">
<el-input
v-model="item.inspectionCharacteristicsBaseVO.number"
v-model="item.inspectionJobCharacteristicsUpdateReqVO.number"
placeholder="根据系统生成"
:disabled="true"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="描述" prop="inspectionCharacteristicsBaseVO.description">
<el-input v-model="item.inspectionCharacteristicsBaseVO.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="inspectionCharacteristicsBaseVO.inspectionMethodCode"
prop="inspectionJobCharacteristicsUpdateReqVO.inspectionMethodCode"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionCharacteristicsBaseVO.inspectionMethodName"
v-model="item.inspectionJobCharacteristicsUpdateReqVO.inspectionMethodName"
disabled
placeholder="请选择检验方法"
/>
<el-button
type="info"
plain
style="width: 40px"
@click="
opensearchTable(
'inspectionMethodCode',
null,
'检验方法',
InspectionMethod.allSchemas,
InspectionMethodApi.getInspectionMethodPage,
[
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
],
false,
'features',
item
)
"
><Icon icon="ep:search"
/></el-button>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="采样过程编码"
prop="inspectionCharacteristicsBaseVO.inspectionMethod"
prop="inspectionJobCharacteristicsUpdateReqVO.inspectionMethod"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionCharacteristicsBaseVO.inspectionName"
v-model="item.inspectionJobCharacteristicsUpdateReqVO.inspectionName"
disabled
placeholder="请选择采样过程编码"
/>
<el-button
type="info"
plain
style="width: 40px"
@click="
opensearchTable(
'inspectionMethod',
null,
'采样过程编码',
SamplingProcess.allSchemas,
SamplingProcessApi.getSamplingProcessPage,
[
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
],
false,
'features',
item
)
"
><Icon icon="ep:search"
/></el-button>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="动态修改规则编码"
prop="inspectionCharacteristicsBaseVO.dynamicUpdateCode"
prop="inspectionJobCharacteristicsUpdateReqVO.dynamicUpdateCode"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionCharacteristicsBaseVO.dynamicUpdateName"
v-model="item.inspectionJobCharacteristicsUpdateReqVO.dynamicUpdateName"
disabled
placeholder="请选择动态修改规则编码"
/>
<el-button
type="info"
plain
style="width: 40px"
@click="
opensearchTable(
'dynamicUpdateCode',
null,
'动态修改规则编码',
DynamicRule.allSchemas,
DynamicRuleApi.getDynamicRulePage,
[
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
],
false,
'features',
item
)
"
><Icon icon="ep:search"
/></el-button>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="是否允许修改特征值"
prop="inspectionCharacteristicsBaseVO.isCanUpdate"
prop="inspectionJobCharacteristicsUpdateReqVO.isCanUpdate"
>
<el-switch
v-model="item.inspectionCharacteristicsBaseVO.isCanUpdate"
v-model="item.inspectionJobCharacteristicsUpdateReqVO.isCanUpdate"
disabled
/>
</el-form-item>
@ -220,11 +144,13 @@
<el-col :span="12">
<el-form-item
label="结果录入方式"
prop="inspectionCharacteristicsBaseVO.resultEntryMethod"
prop="inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod"
>
<el-select
v-model="item.inspectionCharacteristicsBaseVO.resultEntryMethod"
v-model="item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod"
placeholder="请选择结果录入方式"
@change="resultEntryMethodChange($event,item)"
disabled
>
<el-option
v-for="dict in getStrDictOptions(
@ -238,18 +164,14 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="特征类型" prop="inspectionCharacteristicsBaseVO.featureType">
<!-- <el-input v-model="item.featureType" /> -->
<el-form-item label="特征类型" prop="inspectionJobCharacteristicsUpdateReqVO.featureType">
<el-select
v-model="item.inspectionCharacteristicsBaseVO.featureType"
v-model="item.inspectionJobCharacteristicsUpdateReqVO.featureType"
placeholder="请选择特征类型"
@change="changeFeatureType"
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
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"
@ -257,146 +179,66 @@
</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-row>
<!-- 汇总录入的时候显示 -->
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1">
<el-form-item label="合格数量" prop="inspectionJobCharacteristicsUpdateReqVO.featureType">
<el-input v-model="cur.qualifiedQuantity" placeholder="请输入合格数量"/>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1">
<el-form-item label="不合格数量">
<el-input v-model="cur.unqualifiedQuantity" placeholder="请输入不合格数量"/>
</el-form-item>
</el-col>
<!-- 手动评估的时候显示 -->
<el-col :span="12" v-if="item.samplingProcessRespVO.evaluationMode == 1">
<el-form-item label="评估代码">
<el-select
v-model="cur.estimateCode"
placeholder="请选择评估代码"
@change="changeFeatureType">
<el-option v-for="dict in getStrDictOptions( DICT_TYPE.EVALUATION_CODE  )"
:key="dict.value"
:label="dict.label"
:value="dict.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0">
<el-form-item label="检验值" prop="inspectionValue">
<el-input v-model="cur.inspectionValue" placeholder="请输入检验值"/>
</el-form-item>
</el-col>
<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"
:key="dict.dictionaryValue"
:label="dict.dictionaryLabel"
:value="dict.dictionaryValue"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0">
<el-form-item
label="是否设定上限"
prop="inspectionCharacteristicsBaseVO.quantifyIsCapping"
>
<el-switch
v-model="item.inspectionCharacteristicsBaseVO.quantifyIsCapping"
@change="changeIsCapping"
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="上限值"
prop="inspectionCharacteristicsBaseVO.quantifyCapping"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"
>
<el-input
v-model="item.inspectionCharacteristicsBaseVO.quantifyCapping"
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
prop="inspectionCharacteristicsBaseVO.quantifyIsLowlimit"
label="是否设定下限"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"
>
<el-switch
v-model="item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit"
@change="changeLowlimit"
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="下限值"
prop="inspectionCharacteristicsBaseVO.quantifyLowlimit"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"
>
<el-input
v-model="item.inspectionCharacteristicsBaseVO.quantifyLowlimit"
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
prop="inspectionCharacteristicsBaseVO.quantifyIsTarget"
label="是否设定目标值"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"
>
<el-switch
v-model="item.inspectionCharacteristicsBaseVO.quantifyIsTarget"
@change="changeIsTarget"
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="目标值"
prop="inspectionCharacteristicsBaseVO.quantifyTarget"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"
>
<el-input
v-model="item.inspectionCharacteristicsBaseVO.quantifyTarget"
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="计量单位"
prop="inspectionCharacteristicsBaseVO.quantifyUom"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"
>
<el-input
v-model="item.inspectionCharacteristicsBaseVO.quantifyUom"
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="小数位"
prop="inspectionCharacteristicsBaseVO.quantifyDecimal"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"
>
<el-input
v-model="item.inspectionCharacteristicsBaseVO.quantifyDecimal"
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="选择集编码"
prop="inspectionCharacteristicsBaseVO.quantifyQuantifyCode"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 1"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionCharacteristicsBaseVO.quantifyQuantifyCode"
disabled
placeholder="请选择选择集编码"
/>
<el-button
type="info"
plain
style="width: 40px"
@click="
opensearchTable(
'quantifyQuantifyCode',
null,
'选择集编码',
SelectedSet.allSchemas,
SelectedSetApi.getSelectedSetPage,
[
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
],
false,
null,
item
)
"
v-if="item.inspectionCharacteristicsBaseVO.isCanUpdate"
><Icon icon="ep:search"
/></el-button>
</div>
</el-form-item>
<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)"
:key="dict.value"
:label="dict.label"
:value="dict.value"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-col>
</el-row>
</el-form>
@ -519,7 +361,7 @@ const data = ref({
effectiveDate: '',
expirationDate: '',
available: 'TRUE',
process: []
subList: []
})
const dialogVisibleName = ref(false)
@ -534,40 +376,40 @@ if (props.basicFormWidth) {
}
const rules = ref({
...props.rules,
'inspectionCharacteristicsBaseVO.description': [
'inspectionJobCharacteristicsUpdateReqVO.description': [
{ required: true, message: '请填写描述', trigger: ['blur', 'change'] }
],
'inspectionCharacteristicsBaseVO.inspectionMethodCode': [
'inspectionJobCharacteristicsUpdateReqVO.inspectionMethodCode': [
{ required: true, message: '请选择检验方法编码', trigger: 'blur' }
],
'inspectionCharacteristicsBaseVO.dynamicUpdateCode': [
'inspectionJobCharacteristicsUpdateReqVO.dynamicUpdateCode': [
{ required: true, message: '请选择采样过程编码', trigger: ['blur', 'change'] }
],
'inspectionCharacteristicsBaseVO.inspectionMethod': [
'inspectionJobCharacteristicsUpdateReqVO.inspectionMethod': [
{ required: true, message: '请选择动态修改规则编码', trigger: ['blur', 'change'] }
],
'inspectionCharacteristicsBaseVO.resultEntryMethod': [
'inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod': [
{ required: true, message: '请选择结果录入方式', trigger: ['blur', 'change'] }
],
'inspectionCharacteristicsBaseVO.featureType': [
'inspectionJobCharacteristicsUpdateReqVO.featureType': [
{ required: true, message: '请选择特征类型', trigger: ['blur', 'change'] }
],
'inspectionCharacteristicsBaseVO.quantifyTarget': [
'inspectionJobCharacteristicsUpdateReqVO.quantifyTarget': [
{ required: true, message: '请输入目标值', trigger: 'blur' }
],
'inspectionCharacteristicsBaseVO.quantifyCapping': [
'inspectionJobCharacteristicsUpdateReqVO.quantifyCapping': [
{ required: true, message: '请输入上限值', trigger: 'blur' }
],
'inspectionCharacteristicsBaseVO.quantifyLowlimit': [
'inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit': [
{ required: true, message: '请输入下限值', trigger: 'blur' }
],
'inspectionCharacteristicsBaseVO.quantifyUom': [
'inspectionJobCharacteristicsUpdateReqVO.quantifyUom': [
{ required: true, message: '请选择计量单位', trigger: 'blur' }
],
'inspectionCharacteristicsBaseVO.quantifyDecimal': [
'inspectionJobCharacteristicsUpdateReqVO.quantifyDecimal': [
{ required: true, message: '请输入小数位', trigger: 'blur' }
],
'inspectionCharacteristicsBaseVO.quantifyQuantifyCode': [
'inspectionJobCharacteristicsUpdateReqVO.quantifyQuantifyCode': [
{ required: true, message: '请输入选择集编码', trigger: 'blur' }
]
})
@ -583,40 +425,40 @@ const rules = ref({
// inspectionLevel: [{ required: true, message: '', trigger: ['blur', 'change'] }],
// effectiveDate: [{ required: true, message: '', trigger: ['blur', 'change'] }],
// expirationDate: [{ required: true, message: '', trigger: ['blur', 'change'] }],
// 'inspectionCharacteristicsBaseVO.description': [
// 'inspectionJobCharacteristicsUpdateReqVO.description': [
// { required: true, message: '', trigger: ['blur', 'change'] }
// ],
// 'inspectionCharacteristicsBaseVO.inspectionMethodCode': [
// 'inspectionJobCharacteristicsUpdateReqVO.inspectionMethodCode': [
// { required: true, message: '', trigger: 'blur' }
// ],
// 'inspectionCharacteristicsBaseVO.dynamicUpdateCode': [
// 'inspectionJobCharacteristicsUpdateReqVO.dynamicUpdateCode': [
// { required: true, message: '', trigger: ['blur', 'change'] }
// ],
// 'inspectionCharacteristicsBaseVO.inspectionMethod': [
// 'inspectionJobCharacteristicsUpdateReqVO.inspectionMethod': [
// { required: true, message: '', trigger: ['blur', 'change'] }
// ],
// 'inspectionCharacteristicsBaseVO.resultEntryMethod': [
// 'inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod': [
// { required: true, message: '', trigger: ['blur', 'change'] }
// ],
// 'inspectionCharacteristicsBaseVO.featureType': [
// 'inspectionJobCharacteristicsUpdateReqVO.featureType': [
// { required: true, message: '', trigger: ['blur', 'change'] }
// ],
// 'inspectionCharacteristicsBaseVO.quantifyTarget': [
// 'inspectionJobCharacteristicsUpdateReqVO.quantifyTarget': [
// { required: true, message: '', trigger: 'blur' }
// ],
// 'inspectionCharacteristicsBaseVO.quantifyCapping': [
// 'inspectionJobCharacteristicsUpdateReqVO.quantifyCapping': [
// { required: true, message: '', trigger: 'blur' }
// ],
// 'inspectionCharacteristicsBaseVO.quantifyLowlimit': [
// 'inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit': [
// { required: true, message: '', trigger: 'blur' }
// ],
// 'inspectionCharacteristicsBaseVO.quantifyUom': [
// 'inspectionJobCharacteristicsUpdateReqVO.quantifyUom': [
// { required: true, message: '', trigger: 'blur' }
// ],
// 'inspectionCharacteristicsBaseVO.quantifyDecimal': [
// 'inspectionJobCharacteristicsUpdateReqVO.quantifyDecimal': [
// { required: true, message: '', trigger: 'blur' }
// ],
// 'inspectionCharacteristicsBaseVO.quantifyQuantifyCode': [
// 'inspectionJobCharacteristicsUpdateReqVO.quantifyQuantifyCode': [
// { required: true, message: '', trigger: 'blur' }
// ]
// })
@ -633,37 +475,56 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
formType.value = type
if (row) {
data.value = JSON.parse(JSON.stringify(row))
console.log(data.value)
let list = []
list = await InspectionJobDetailPageApi.getInspectionJobDetailList(row.id)
// if (row.inspectionSchemeJson) {
// list = JSON.parse(JSON.parse(row.inspectionSchemeJson))
// } else {
// list = await InspectionJobDetailPageApi.getListByTempleteCode(row.programmeTemplateCode)
// }
console.log(list)
console.log(typeof list)
list.forEach((item, index) => {
editableTabsValue.value = index + 1
item.name = index + 1
item.inspectionCharacteristicsBaseVO = item.inspectionJobCharacteristicsRespVO
item.inspectionJobCharacteristicsUpdateReqVO = item.inspectionJobCharacteristicsRespVO
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:'',//
})
}
} else {
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = false
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList=[{
inspectionValue:'',//
qualitativeCode:'',//
estimateCode:'',//
defectLevel:'',//
qualifiedQuantity:'',//
unqualifiedQuantity:'',//
}]
}
//
if (item.inspectionCharacteristicsBaseVO.quantifyIsCapping) {
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true
if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping) {
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true
} else {
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = false
}
if (item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit) {
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true
if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit) {
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required = true
} else {
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required = false
}
if (item.inspectionCharacteristicsBaseVO.quantifyIsTarget) {
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true
if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget) {
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyTarget'][0].required = true
} else {
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyTarget'][0].required = false
}
})
data.value.process = list
data.value.subList = list
formMainRef.value.setValues(row)
} else {
data.value = {
@ -678,11 +539,11 @@ console.log(typeof list)
effectiveDate: '',
expirationDate: '',
available: 'TRUE',
process: []
subList: []
}
}
tabIndex = data.value.process.length + 1
tabIndex = data.value.subList.length + 1
}
defineExpose({ open, dialogVisible, formLoading }) // open
import type { TabPaneName } from 'element-plus'
@ -695,7 +556,7 @@ const handleTabsEdit = (targetName: TabPaneName | undefined, action: 'remove' |
nameForm.value.name = ''
dialogVisibleName.value = true
} else if (action === 'remove') {
const tabs = data.value.process
const tabs = data.value.subList
let activeName = editableTabsValue.value
if (activeName === targetName) {
tabs.forEach((tab, index) => {
@ -708,7 +569,7 @@ const handleTabsEdit = (targetName: TabPaneName | undefined, action: 'remove' |
})
}
editableTabsValue.value = activeName
data.value.process = tabs.filter((tab) => tab.name !== targetName)
data.value.subList = tabs.filter((tab) => tab.name !== targetName)
}
}
/** 修改名称时间 */
@ -719,13 +580,13 @@ const buttonBaseClick1 = (val) => {
nameRef.value.validate((valid, fields) => {
if (valid) {
const newTabName = `${++tabIndex}`
data.value.process.push({
data.value.subList.push({
description: nameForm.value.name,
name: newTabName,
inspectionCode: '',
sequenceCode: '',
inspectionCharCode: '',
inspectionJobCharacteristicsRespVO: {
inspectionJobCharacteristicsUpdateReqVO: {
describe: '',
inspectionMethodCode: '',
dynamicUpdateCode: '',
@ -745,7 +606,7 @@ const buttonBaseClick1 = (val) => {
quantifyQuantifyCode: ''
}
})
console.log(data.value.process)
console.log(data.value.subList)
editableTabsValue.value = newTabName
dialogVisibleName.value = false
@ -787,36 +648,36 @@ const validateForm = (formRef) => {
const submitForm = async () => {
try {
const validateForm1 = await validateForm(formProcessRef.value)
console.log(validateForm1)
await formMainRef.value.validate()
if (!data.value.process || data.value.process.length == 0) {
message.error(`请添加工序`)
return
}
const bol1 = await validateForm(formProcessRef.value)
const bol2 = await validateForm(formFeaturesRef.value)
if (!bol1 || !bol2) {
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
}
// console.log(validateForm1)
// await formMainRef.value.validate()
// if (!data.value.process || data.value.process.length == 0) {
// message.error(``)
// return
// }
// const bol1 = await validateForm(formProcessRef.value)
// const bol2 = await validateForm(formFeaturesRef.value)
// if (!bol1 || !bol2) {
// message.error(``)
// return
// }
// const arr = data.value.process.filter(
// (item) =>
// !item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping &&
// !item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit &&
// !item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget &&
// item.inspectionJobCharacteristicsUpdateReqVO.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.value)
} else {
//
// /
emit('submitForm', formType.value, data.value)
}
} catch {
@ -837,9 +698,9 @@ if (props.footButttondata) {
const changeFeatureType = (e) => {
console.log(e)
// if (e) {
// rules.value['inspectionCharacteristicsBaseVO.quantifyQuantifyCode'][0].required = true
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyQuantifyCode'][0].required = true
// } else {
// rules.value['inspectionCharacteristicsBaseVO.quantifyQuantifyCode'][0].required = false
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyQuantifyCode'][0].required = false
// }
}
const searchTableRef = ref()
@ -921,13 +782,13 @@ const opensearchTable = (
// val row
const searchTableSuccess = async (formField, searchField, val, type, row) => {
if(type == 'features'){
row.inspectionCharacteristicsBaseVO[formField] = val[0].code
row.inspectionJobCharacteristicsUpdateReqVO[formField] = val[0].code
if(formField == 'inspectionMethodCode'){
row.inspectionCharacteristicsBaseVO.inspectionMethodName = val[0].description
row.inspectionJobCharacteristicsUpdateReqVO.inspectionMethodName = val[0].description
}else if(formField == 'dynamicUpdateCode'){
row.inspectionCharacteristicsBaseVO.dynamicUpdateName = val[0].description
row.inspectionJobCharacteristicsUpdateReqVO.dynamicUpdateName = val[0].description
}else if(formField == 'inspectionMethod'){
row.inspectionCharacteristicsBaseVO.inspectionName = val[0].description
row.inspectionJobCharacteristicsUpdateReqVO.inspectionName = val[0].description
}
} else if(type == 'main'){
data.value[formField] = val[0].code
@ -944,51 +805,61 @@ const searchTableSuccess = async (formField, searchField, val, type, row) => {
editableTabsValue.value = index + 1
item.name = index + 1
//
if (item.inspectionCharacteristicsBaseVO.quantifyIsCapping) {
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true
if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping) {
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true
} else {
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = false
}
if (item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit) {
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true
if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit) {
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required = true
} else {
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required = false
}
if (item.inspectionCharacteristicsBaseVO.quantifyIsTarget) {
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true
if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget) {
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyTarget'][0].required = true
} else {
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyTarget'][0].required = false
}
})
data.value.process = list
data.value.subList = list
}
}
// emit('searchTableSuccess', formField, searchField, val, formRef.value, type, row)
}
//
const changeIsCapping = (e) => {
if (e) {
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true
} else {
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false
}
}
//
const changeLowlimit = (e) => {
if (e) {
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true
//
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++){
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({
inspectionValue:'',//
qualitativeCode:'',//
estimateCode:'',//
defectLevel:'',//
qualifiedQuantity:'',//
unqualifiedQuantity:'',//
})
}
} else {
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = false
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList=[{
inspectionValue:'',//
qualitativeCode:'',//
estimateCode:'',//
defectLevel:'',//
qualifiedQuantity:'',//
unqualifiedQuantity:'',//
}]
}
console.log(222,item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList)
}
//
const changeIsTarget = (e) => {
if (e) {
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true
} else {
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false
}
//
const changeQualitativeCode= (e,item,cur)=>{
let obj = item.selectedProjectRespVOList.find(cur=>cur.dictionaryValue==e)
console.log(obj)
cur.defectLevel = obj.defectLevel
}
</script>
<style scoped>

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

@ -183,7 +183,7 @@
// -
const buttonTableClick = async (val, row) => {
if (val == 'mainJobExe') { //
execute('update', row)
execute('execute', row)
}
else if (val == 'mainJobClo') { //
handleDelete(row.id)
@ -257,13 +257,14 @@
//
const submitForm = async (formType, data) => {
data.subList = tableData.value //
console.log(data)
// return
try {
if (formType === 'create') {
await InspectionJobMainApi.createInspectionJobMain(data)
message.success(t('common.createSuccess'))
} else {
await InspectionJobMainApi.updateInspectionJobMain(data)
} else if(formType === 'execute') {
await InspectionJobMainApi.executeInspectionJobMain(data)
message.success(t('common.updateSuccess'))
}
formRef.value.dialogVisible = false

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

@ -13,36 +13,66 @@ export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'number',
sort: 'custom',
isSearch: true,
form: {
componentProps:{
disabled:true
}
},
},
{
label: '申请单号',
field: 'requestNumber',
sort: 'custom',
isSearch: true,
form: {
componentProps:{
disabled:true
}
},
},
{
label: '供应商编码',
field: 'supplierCode',
sort: 'custom',
isSearch: true,
form: {
componentProps:{
disabled:true
}
},
},
{
label: '物料编码',
field: 'materialCode',
sort: 'custom',
isSearch: true,
form: {
componentProps:{
disabled:true
}
},
},
{
label: '物料批次',
field: 'materialBatch',
sort: 'custom',
isSearch: false,
form: {
componentProps:{
disabled:true
}
},
},
{
label: '订单号',
field: 'orderCode',
sort: 'custom',
isSearch: false,
form: {
componentProps:{
disabled:true
}
},
},
{
label: '订单行',
@ -51,7 +81,10 @@ export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: false,
form: {
component: 'InputNumber',
value: 0
value: 0,
componentProps:{
disabled:true
}
},
},
{
@ -59,6 +92,11 @@ export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'certificateCode',
sort: 'custom',
isSearch: false,
form: {
componentProps:{
disabled:true
}
},
},
{
label: '凭证行',
@ -67,7 +105,10 @@ export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: false,
form: {
component: 'InputNumber',
value: 0
value: 0,
componentProps:{
disabled:true
}
},
},
{
@ -75,6 +116,11 @@ export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'inspectionSchemeCode',
sort: 'custom',
isSearch: false,
form: {
componentProps:{
disabled:true
}
},
},
// {
// label: '检验方案Json',
@ -87,18 +133,33 @@ export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'inspectionBatch',
sort: 'custom',
isSearch: false,
form: {
componentProps:{
disabled:true
}
},
},
{
label: '检验批数量',
field: 'inspectionBatchAmount',
sort: 'custom',
isSearch: false,
form: {
componentProps:{
disabled:true
}
},
},
{
label: '采样总数量',
field: 'sampleTatalAmount',
sort: 'custom',
isSearch: false,
form: {
componentProps:{
disabled:true
}
},
},
{
label: '检验类型',
@ -106,7 +167,10 @@ export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
isSearch: false,
form: {
component: 'Select'
component: 'Select',
componentProps:{
disabled:true
}
},
},
{
@ -114,6 +178,11 @@ export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'inspectionBatchSource',
sort: 'custom',
isSearch: false,
form:{
componentProps:{
disabled:true
}
}
},
{
label: '检验阶段',
@ -122,7 +191,10 @@ export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: false,
form: {
component: 'InputNumber',
value: 0
value: 0,
componentProps:{
disabled:true
}
},
},
{
@ -130,18 +202,33 @@ export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'inspectionStringency',
sort: 'custom',
isSearch: false,
form:{
componentProps:{
disabled:true
}
}
},
{
label: '检验任务包装列表',
field: 'inspectionTaskPackageCode',
sort: 'custom',
isSearch: false,
form:{
componentProps:{
disabled:true
}
}
},
{
label: '检验任务工序列表',
field: 'inspectionTaskProcessCode',
sort: 'custom',
isSearch: false,
form:{
componentProps:{
disabled:true
}
}
},
{
label: '计划开始时间',
@ -161,7 +248,8 @@ export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
valueFormat: 'x',
disabled:true
}
},
},
@ -183,7 +271,8 @@ export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
valueFormat: 'x',
disabled:true
}
},
},
@ -192,18 +281,44 @@ export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'inspectionLevel',
sort: 'custom',
isSearch: false,
form:{
componentProps:{
disabled:true
}
}
},
{
label: 'AQL值',
field: 'aqlValue',
sort: 'custom',
isSearch: false,
form:{
componentProps:{
disabled:true
}
}
},
{
label: '使用决策',
field: 'usageDecision',
sort: 'custom',
isSearch: false,
dictType: DICT_TYPE.USAGE_DECISION,
form:{
componentProps:{
}
}
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
isSearch: false,
form:{
componentProps:{
disabled:true
}
}
},
{
label: '操作',
@ -244,25 +359,19 @@ export const InspectionJobMainRules = reactive({
*/
export const InspectionJobDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
label: '编码',
field: 'number',
sort: 'custom',
isSearch: true,
},
{
label: '任务编码',
field: 'taskCode',
label: '检验方案模板编码',
field: 'inspectionCode',
sort: 'custom',
isSearch: true,
},
{
label: '工序编码',
field: 'processCode',
sort: 'custom',
isSearch: true,
},
{
label: '工序描述',
label: '描述',
field: 'processDescribe',
sort: 'custom',
isSearch: true,
@ -279,26 +388,43 @@ export const InspectionJobDetail = useCrudSchemas(reactive<CrudSchema[]>([
},
{
label: '检验特性编号',
field: 'inspectionFeatureCode',
field: 'inspectionCharCode',
sort: 'custom',
isSearch: true,
},
{
label: '是否可用',
field: 'available',
label: '检验特性编码',
field: 'inspectionJobCharacteristicsRespVO.number',
sort: 'custom',
isSearch: true,
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false,
table: {
width: 150,
fixed: 'right'
},
isTableForm: false,
label: '检验特性描述',
field: 'inspectionJobCharacteristicsRespVO.description',
sort: 'custom',
},{
label: '检验方法',
field: 'inspectionJobCharacteristicsRespVO.inspectionMethodName',
sort: 'custom',
},{
label: '采样过程编码',
field: 'inspectionMethod',
sort: 'custom',
},{
label: '动态修改规则编码',
field: 'dynamicUpdateCode',
sort: 'custom',
},{
label: '是否允许修改特征值',
field: 'inspectionJobCharacteristicsRespVO.isCanUpdate',
sort: 'custom',
},{
label: '结果录入方式',
field: 'resultEntryMethod',
sort: 'custom',
},{
label: '特征类型',
field: 'featureType',
sort: 'custom',
}
]))

Loading…
Cancel
Save