Browse Source

检验模板复制功能,检验任务执行时,第一个包装作为取样包装,如果第一个第一个包装数量不足,再用第二个包装。检验任务执行时,检验工序显示中文名称

master_hella_20240701
zhang_li 6 months ago
parent
commit
7e56ec73b8
  1. 12
      src/utils/disposition/defaultButtons.ts
  2. 116
      src/views/qms/basicDataManage/inspectionTemplate/addForm.vue
  3. 3
      src/views/qms/basicDataManage/inspectionTemplate/index.vue
  4. 41
      src/views/qms/inspection/inspectionJob/addForm.vue
  5. 17
      src/views/qms/inspection/inspectionJob/detail.vue
  6. 96
      src/views/qms/inspection/inspectionRecord/detail.vue

12
src/utils/disposition/defaultButtons.ts

@ -896,6 +896,18 @@ export function mainApplyDecisionBtn(option:any) {
hasPermi: '' hasPermi: ''
}) })
} }
// 主列表-复制
export function mainCopyBtn(option:any) {
return __defaultBtnOption(option,{
label: '复制',
name: 'copy',
hide: false,
type: 'primary',
color: '',
link: true, // 文本展现按钮
hasPermi: ''
})
}
// 默认按钮规则 // 默认按钮规则
function __defaultBtnOption(option:any,specific:any){ function __defaultBtnOption(option:any,specific:any){
return { return {

116
src/views/qms/basicDataManage/inspectionTemplate/addForm.vue

@ -562,30 +562,99 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
} }
formType.value = type formType.value = type
if (row) { if (row) {
data.value = JSON.parse(JSON.stringify(row)) console.log(row)
data.value.version = String(data.value.version) //
let list = await InspectionProcessPageApi.getListByTempleteCode(row.code) if(formType.value == 'create'){
list.forEach((item, index) => { data.value ={
editableTabsValue.value = index + 1 code: '',
item.name = index + 1 description:row.description,
// version:String(row.version),
if (item.inspectionCharacteristicsBaseVO.quantifyIsCapping) { dynamicUpdateCode:row.dynamicUpdateCode,
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true dynamicUpdateName:row.dynamicUpdateName,
} else { process: []
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false
} }
if (item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit) { let list = await InspectionProcessPageApi.getListByTempleteCode(row.code)
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true let arr = []
} else { list.forEach((item, index) => {
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false editableTabsValue.value = index + 1
} item.name = index + 1
if (item.inspectionCharacteristicsBaseVO.quantifyIsTarget) { console.log(item.inspectionCharacteristicsBaseVO)
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true
} else { let obj = {
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false description:item.description,
} inspectionCharCode:item.inspectionCharCode,
}) inspectionCode:item.inspectionCode,
data.value.process = list sequenceCode:item.sequenceCode,
name : index + 1,
inspectionCharacteristicsBaseVO:{
description:item.inspectionCharacteristicsBaseVO.description,
featureType:item.inspectionCharacteristicsBaseVO.featureType,
inspectionMethodCode:item.inspectionCharacteristicsBaseVO.inspectionMethodCode,
inspectionMethodName:item.inspectionCharacteristicsBaseVO.inspectionMethodName,
isCanUpdate:item.inspectionCharacteristicsBaseVO.isCanUpdate,
isDestructionInspection:item.inspectionCharacteristicsBaseVO.isDestructionInspection,
quantifyCapping:item.inspectionCharacteristicsBaseVO.quantifyCapping,
quantifyDecimal:item.inspectionCharacteristicsBaseVO.quantifyDecimal,
quantifyIsCapping:item.inspectionCharacteristicsBaseVO.quantifyIsCapping,
quantifyIsLowlimit:item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit,
quantifyIsTarget:item.inspectionCharacteristicsBaseVO.quantifyIsTarget,
quantifyLowlimit:item.inspectionCharacteristicsBaseVO.quantifyLowlimit,
quantifyQuantifyCode:item.inspectionCharacteristicsBaseVO.quantifyQuantifyCode,
quantifyQuantifyName:item.inspectionCharacteristicsBaseVO.quantifyQuantifyName,
quantifyTarget:item.inspectionCharacteristicsBaseVO.quantifyTarget,
quantifyUom:item.inspectionCharacteristicsBaseVO.quantifyUom,
resultEntryMethod:item.inspectionCharacteristicsBaseVO.resultEntryMethod,
samplingProcessCode:item.inspectionCharacteristicsBaseVO.samplingProcessCode,
samplingProcessName:item.inspectionCharacteristicsBaseVO.samplingProcessName,
}
}
//
if (item.inspectionCharacteristicsBaseVO.quantifyIsCapping) {
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true
} else {
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false
}
if (item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit) {
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true
} else {
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false
}
if (item.inspectionCharacteristicsBaseVO.quantifyIsTarget) {
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true
} else {
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false
}
arr.push(obj)
})
data.value.process = arr
}else{
data.value = JSON.parse(JSON.stringify(row))
data.value.version = String(data.value.version)
let list = await InspectionProcessPageApi.getListByTempleteCode(row.code)
list.forEach((item, index) => {
editableTabsValue.value = index + 1
item.name = index + 1
//
if (item.inspectionCharacteristicsBaseVO.quantifyIsCapping) {
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true
} else {
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false
}
if (item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit) {
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true
} else {
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false
}
if (item.inspectionCharacteristicsBaseVO.quantifyIsTarget) {
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true
} else {
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false
}
})
data.value.process = list
}
} else { } else {
data.value = { data.value = {
code: '', code: '',
@ -643,7 +712,6 @@ const buttonBaseClick1 = (val) => {
sequenceCode: '', sequenceCode: '',
inspectionCharCode: '', inspectionCharCode: '',
inspectionCharacteristicsBaseVO: { inspectionCharacteristicsBaseVO: {
describe: '',
inspectionMethodCode: '', inspectionMethodCode: '',
samplingProcessCode: '', samplingProcessCode: '',
isCanUpdate: '', isCanUpdate: '',

3
src/views/qms/basicDataManage/inspectionTemplate/index.vue

@ -138,6 +138,7 @@ const butttondata = (row) => {
defaultButtons.mainListEditBtn({hasPermi: 'qms:programme-template:update'}), defaultButtons.mainListEditBtn({hasPermi: 'qms:programme-template:update'}),
defaultButtons.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'qms:programme-template:enable'}), defaultButtons.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'qms:programme-template:enable'}),
defaultButtons.mainListDisableBtn({hide:isShowMainButton(row,['TRUE']),hasPermi:'qms:programme-template:disable'}), defaultButtons.mainListDisableBtn({hide:isShowMainButton(row,['TRUE']),hasPermi:'qms:programme-template:disable'}),
defaultButtons.mainCopyBtn({hasPermi:'qms:programme-template:copy'}),
] ]
} }
@ -151,6 +152,8 @@ const buttonTableClick = async (val, row) => {
handleEnable(row.id) handleEnable(row.id)
}else if (val == 'disable') { }else if (val == 'disable') {
handleDisable(row.id) handleDisable(row.id)
}else if (val == 'copy') {
openForm('create', row)
} }
} }

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

@ -8,7 +8,7 @@
<TableForm ref="tableFormRef" style="width:100%;" :maxHeight = "490" :tableFields="tableAllSchemas.tableFormColumns" :tableFormRules="tableFormRules" :tableData="data.packageList" :isShowButton="false" :isShowReduceButton="false" /> <TableForm ref="tableFormRef" style="width:100%;" :maxHeight = "490" :tableFields="tableAllSchemas.tableFormColumns" :tableFormRules="tableFormRules" :tableData="data.packageList" :isShowButton="false" :isShowReduceButton="false" />
</div> </div>
<el-tabs v-model="editableTabsValue" class="demo-tabs" @edit="handleTabsEdit" type="border-card" tab-position="left" :stretch="false"> <el-tabs v-model="editableTabsValue" class="demo-tabs" @edit="handleTabsEdit" type="border-card" tab-position="left" :stretch="false">
<el-tab-pane v-for="item in data.subList" :key="item.name" :label="item.processCode" :name="item.name"> <el-tab-pane v-for="item in data.subList" :key="item.name" :label="item.processDescribe" :name="item.name">
<div class="small-title">检验工序</div> <div class="small-title">检验工序</div>
<el-form :model="item" label-width="auto" :rules="rules" ref="formProcessRef"> <el-form :model="item" label-width="auto" :rules="rules" ref="formProcessRef">
<el-row :gutter="20"> <el-row :gutter="20">
@ -64,10 +64,17 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="样品份数" prop="inspectionJobCharacteristicsUpdateReqVO.sampleQty"> <el-form-item label="样品份数" prop="inspectionJobCharacteristicsUpdateReqVO.sampleQty">
<div style="display: flex; width: 100%"> <div style="display: flex; width: 100%">
<el-input v-model=" item.inspectionJobCharacteristicsUpdateReqVO.sampleQty" disabled placeholder="请输入样品份数" /> <el-input v-model="item.inspectionJobCharacteristicsUpdateReqVO.sampleQty" disabled placeholder="请输入样品份数" />
</div> </div>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="每份样品量" prop="inspectionJobCharacteristicsUpdateReqVO.samplePieceSize">
<div style="display: flex; width: 100%">
<el-input v-model="item.inspectionJobCharacteristicsUpdateReqVO.samplePieceSize" disabled placeholder="请输入样品份数" />
</div>
</el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="是否允许修改特征值" prop="inspectionJobCharacteristicsUpdateReqVO.isCanUpdate"> <el-form-item label="是否允许修改特征值" prop="inspectionJobCharacteristicsUpdateReqVO.isCanUpdate">
@ -316,7 +323,7 @@ const rules = ref({
], ],
qualifiedQuantity: [{ required: true, message: '请输入选择结束时间', trigger: 'blur' }] qualifiedQuantity: [{ required: true, message: '请输入选择结束时间', trigger: 'blur' }]
}) })
const allSamplePieceSize = ref(0)
/** 打开弹窗 */ /** 打开弹窗 */
let tabIndex = 1 let tabIndex = 1
const open = async (type: string, row?: any, masterParmas?: any, titleName?: any) => { const open = async (type: string, row?: any, masterParmas?: any, titleName?: any) => {
@ -326,6 +333,7 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
dialogTitle.value = t('action.' + type) dialogTitle.value = t('action.' + type)
} }
formType.value = type formType.value = type
allSamplePieceSize.value =0//0
if (row) { if (row) {
data.value = JSON.parse(JSON.stringify(row)) data.value = JSON.parse(JSON.stringify(row))
// console.log(data.value)// // console.log(data.value)//
@ -337,6 +345,9 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
editableTabsValue.value = index + 1 editableTabsValue.value = index + 1
item.name = index + 1 item.name = index + 1
item.inspectionJobCharacteristicsUpdateReqVO = item.inspectionJobCharacteristicsRespVO item.inspectionJobCharacteristicsUpdateReqVO = item.inspectionJobCharacteristicsRespVO
//
allSamplePieceSize.value += parseFloat((parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.sampleQty) * parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.samplePieceSize)).toFixed(2))
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true // rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true
if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 0) { if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 0) {
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true // rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true
@ -384,8 +395,25 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
rules.value['inspectionJobCharacteristicsUpdateReqVO.estimateCode'][0].required = false rules.value['inspectionJobCharacteristicsUpdateReqVO.estimateCode'][0].required = false
} }
}) })
console.log(22,allSamplePieceSize.value )
data.value.subList = list data.value.subList = list
/**
设置采样数量默认第一个包装采样数量<总数量显示数量字段第二个包装和剩下的总数量对比以此类推
第一个包装采样数量>总数量 则显示总数量
*/
for(let i = 0; i<data.value.packageList.length;i++){
if(allSamplePieceSize.value>data.value.packageList[i].amount){
data.value.packageList[i].sampleAmount = data.value.packageList[i].amount
allSamplePieceSize.value = parseFloat((allSamplePieceSize.value - data.value.packageList[i].amount).toFixed(2))
}else{
data.value.packageList[i].sampleAmount = allSamplePieceSize.value
allSamplePieceSize.value=0
// return;
}
}
// data.value.packageList.forEach(item=>{
// })
dialogVisible.value = true dialogVisible.value = true
nextTick(() => { nextTick(() => {
formMainRef.value.setValues(row) formMainRef.value.setValues(row)
@ -522,7 +550,12 @@ const submitForm = async () => {
console.log(11,data.value.packageList) console.log(11,data.value.packageList)
if(data.value.packageList?.length>0){ if(data.value.packageList?.length>0){
const validateForm1 = await tableFormRef.value.validateForm() const validateForm1 = await tableFormRef.value.validateForm()
if (!validateForm1) return if (!validateForm1) return
let isPass = data.value.packageList.some(cur=>parseFloat(cur.sampleAmount)>parseFloat(cur.amount))
if(isPass){
message.error(`采样数量不能大于数量`)
return
}
// let number = 0 // let number = 0
// data.value.packageList.forEach(cur=>{ // data.value.packageList.forEach(cur=>{
// number += parseFloat(cur.sampleAmount) // number += parseFloat(cur.sampleAmount)

17
src/views/qms/inspection/inspectionJob/detail.vue

@ -11,7 +11,7 @@
</ContentWrap> </ContentWrap>
<ContentWrap> <ContentWrap>
<el-tabs v-model="editableTabsValue" class="demo-tabs" type="border-card" tab-position="left" :stretch="false"> <el-tabs v-model="editableTabsValue" class="demo-tabs" type="border-card" tab-position="left" :stretch="false">
<el-tab-pane v-for="item in data.subList" :key="item.name" :label="item.processCode" :name="item.name"> <el-tab-pane v-for="item in data.subList" :key="item.name" :label="item.processDescribe" :name="item.name">
<div class="small-title">检验工序</div> <div class="small-title">检验工序</div>
<el-form :model="item" label-width="auto" ref="formProcessRef"> <el-form :model="item" label-width="auto" ref="formProcessRef">
<el-row :gutter="20"> <el-row :gutter="20">
@ -59,6 +59,21 @@
</div> </div>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item label="样品份数" prop="inspectionJobCharacteristicsRespVO.sampleQty">
<div style="display: flex; width: 100%">
<el-input v-model="item.inspectionJobCharacteristicsRespVO.sampleQty" disabled placeholder="请输入样品份数" />
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="每份样品量" prop="inspectionJobCharacteristicsRespVO.samplePieceSize">
<div style="display: flex; width: 100%">
<el-input v-model="item.inspectionJobCharacteristicsRespVO.samplePieceSize" disabled placeholder="请输入样品份数" />
</div>
</el-form-item>
</el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="是否允许修改特征值" prop="inspectionJobCharacteristicsRespVO.isCanUpdate"> <el-form-item label="是否允许修改特征值" prop="inspectionJobCharacteristicsRespVO.isCanUpdate">
<el-switch v-model="item.inspectionJobCharacteristicsRespVO.isCanUpdate" disabled /> <el-switch v-model="item.inspectionJobCharacteristicsRespVO.isCanUpdate" disabled />

96
src/views/qms/inspection/inspectionRecord/detail.vue

@ -76,47 +76,61 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item
label="检验方法" label="检验方法"
prop="inspectionRecordCharacteristicsRespVO.inspectionMethodCode" prop="inspectionRecordCharacteristicsRespVO.inspectionMethodCode"
> >
<div style="display: flex; width: 100%"> <div style="display: flex; width: 100%">
<el-input <el-input
v-model="item.inspectionRecordCharacteristicsRespVO.inspectionMethodName" v-model="item.inspectionRecordCharacteristicsRespVO.inspectionMethodName"
disabled disabled
placeholder="请输入检验方法" placeholder="请输入检验方法"
/> />
</div> </div>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item
label="采样过程" label="采样过程"
prop="inspectionRecordCharacteristicsRespVO.inspectionMethod" prop="inspectionRecordCharacteristicsRespVO.inspectionMethod"
> >
<div style="display: flex; width: 100%"> <div style="display: flex; width: 100%">
<el-input <el-input
v-model="item.inspectionRecordCharacteristicsRespVO.samplingProcessName" v-model="item.inspectionRecordCharacteristicsRespVO.samplingProcessName"
disabled disabled
placeholder="请输入采样过程" placeholder="请输入采样过程"
/> />
</div> </div>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item label="采样过程编码" prop="inspectionRecordCharacteristicsRespVO.samplingProcessCode">
label="动态修改规则编码" <div style="display: flex; width: 100%">
prop="inspectionRecordCharacteristicsRespVO.dynamicUpdateCode" <el-input v-model="item.inspectionRecordCharacteristicsRespVO.samplingProcessName" disabled placeholder="请选择采样过程编码" />
> </div>
<div style="display: flex; width: 100%"> </el-form-item>
<el-input </el-col>
v-model="item.inspectionRecordCharacteristicsRespVO.dynamicUpdateName" <el-col :span="12">
disabled <el-form-item label="样品份数" prop="inspectionRecordCharacteristicsRespVO.sampleQty">
placeholder="请输入动态修改规则编码" <div style="display: flex; width: 100%">
/> <el-input v-model="item.inspectionRecordCharacteristicsRespVO.sampleQty" disabled placeholder="请输入样品份数" />
</div> </div>
</el-form-item> </el-form-item>
</el-col> --> </el-col>
<!-- <el-col :span="12">
<el-form-item
label="动态修改规则编码"
prop="inspectionRecordCharacteristicsRespVO.dynamicUpdateCode"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionRecordCharacteristicsRespVO.dynamicUpdateName"
disabled
placeholder="请输入动态修改规则编码"
/>
</div>
</el-form-item>
</el-col> -->
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item
label="是否允许修改特征值" label="是否允许修改特征值"

Loading…
Cancel
Save