Browse Source

检验任务执行,汇总录入,合格数量和不合格数量必须为整数,检验任务列表页,恢复承接和放弃按钮,、采样过程,样本量可输入时可以是小数

master_hella_20240701
zhang_li 8 months ago
parent
commit
7625dae792
  1. 36
      src/views/qms/inspection/inspectionJob/addForm.vue
  2. 6
      src/views/qms/inspection/inspectionJob/index.vue
  3. 15
      src/views/qms/samplingProcess/index.vue
  4. 4
      src/views/qms/samplingProcess/samplingProcess.data.ts

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

@ -537,8 +537,8 @@ 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)//
await InspectionJobMainApi.acceptInspectionJobMain(row.id)
// console.log(data.value)//
// await InspectionJobMainApi.acceptInspectionJobMain(row.id)
let list = []
list = await InspectionJobDetailPageApi.getInspectionJobDetailList(row.id)
data.value.packageList = await InspectionJobMainApi.getInspectionJobPackageList(row.id)
@ -700,7 +700,7 @@ const buttonBaseClick =async(val) => {
}
//
else if (val == 'close') {
await InspectionJobMainApi.abandonInspectionJobMain(data.value.id)
// await InspectionJobMainApi.abandonInspectionJobMain(data.value.id)
dialogVisible.value = false
}
}
@ -751,6 +751,7 @@ const submitForm = async () => {
let arrBol = []
let isOutweigh = []//
let numberList = []//
let parseFloatList = []//
data.value.subList.forEach((item, index) => {
if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1) {
arrBol.push(
@ -761,15 +762,6 @@ const submitForm = async () => {
)
)
}
// if (item.samplingProcessRespVO.evaluationMode == 1) {
// arrBol.push(
// item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some(
// (cur, key) => {
// return !cur.estimateCode
// }
// )
// )
// }
if (item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0) {
arrBol.push(
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some(
@ -792,12 +784,20 @@ const submitForm = async () => {
if (item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime >item.inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime) {
isOutweigh.push(item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime)
}
//
//
if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1) {
parseFloatList.push(
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some(
(cur, key) => {
return String(cur.qualifiedQuantity).indexOf('.')>-1 || String(cur.unqualifiedQuantity).indexOf('.')>-1
}
)
)
//
numberList.push(
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some(
(cur, key) => {
return parseFloat(cur.qualifiedQuantity) + parseFloat(cur.unqualifiedQuantity) != data.value.sampleTotalAmount
return parseFloat(cur.qualifiedQuantity) + parseFloat(cur.unqualifiedQuantity) != parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.inspectionQty)
}
)
)
@ -805,6 +805,7 @@ const submitForm = async () => {
})
let isEmpty1 = arrBol.some(item=>item == true)
let isEmptyNumberList = numberList.some(item=>item == true)
let isParseFloat = parseFloatList.some(item=>item == true)
if(isEmpty1){
message.error('检验工序和检验特性有字段未填写完全')
return;
@ -813,9 +814,12 @@ const submitForm = async () => {
message.error('检验特性中有开始时间大于结束时间')
return;
}
console.log(44,numberList)
if(isParseFloat){
message.error('合格数量和不合格数量之和不可以是小数')
return;
}
if(isEmptyNumberList){
message.error('合格数量和不合格数量之和不等于总数量')
message.error('合格数量和不合格数量之和不等于检验数')
return;
}
if (formType.value == 'create') {

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

@ -161,10 +161,10 @@
// -
const butttondata = (row) => {
return [
// defaultButtons.mainListJobAccBtn({hide:isShowMainButton(row,['1']),hasPermi:'qms:inspection-job-main:accept'}), //
defaultButtons.mainListJobAccBtn({hide:isShowMainButton(row,['1']),hasPermi:'qms:inspection-job-main:accept'}), //
defaultButtons.mainListJobCloBtn({hide:isShowMainButton(row,['1']),hasPermi:'qms:inspection-job-main:close'}), //
// defaultButtons.mainListJobAbaBtn({hide:isShowMainButton(row,['2']),hasPermi:'qms:inspection-job-main:abandon'}), //
defaultButtons.mainListJobExeBtn({hide:isShowMainButton(row,['1','2']),hasPermi:'qms:inspection-job-main:execute'}), //
defaultButtons.mainListJobAbaBtn({hide:isShowMainButton(row,['2']),hasPermi:'qms:inspection-job-main:abandon'}), //
defaultButtons.mainListJobExeBtn({hide:isShowMainButton(row,['2']),hasPermi:'qms:inspection-job-main:execute'}), //
defaultButtons.mainListPackageBtn(null), //
]
}

15
src/views/qms/samplingProcess/index.vue

@ -66,6 +66,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
import {validatePercent } from '@/utils/validator'
defineOptions({ name: 'SamplingProcess' })
@ -235,20 +236,34 @@ const updateFormFields = (sampleType, formRef) => {
case '1':
sampleSizeLabel = '样品量';
sampleSizeDisabled = true;
if( SamplingProcessRules.sampleSize.length==3){
SamplingProcessRules.sampleSize.pop()
}
break;
case '2':
sampleSizeLabel = '样品量(%)';
sampleSizeRequired = true;
if( SamplingProcessRules.sampleSize.length==2){
SamplingProcessRules.sampleSize.push({
validator:validatePercent, message: '百分比范围 0 ~ 100', trigger: 'blur'
})
}
break;
case '3':
sampleSizeLabel = '样品量';
sampleSizeRequired = true;
if( SamplingProcessRules.sampleSize.length==3){
SamplingProcessRules.sampleSize.pop()
}
break;
case '4':
sampleSizeLabel = '样品量';
sampleSizeDisabled = true;
sampleProgCodeDisabled = false;
sampleProgCodeRequired = true;
if( SamplingProcessRules.sampleSize.length==3){
SamplingProcessRules.sampleSize.pop()
}
break;
default:
break;

4
src/views/qms/samplingProcess/samplingProcess.data.ts

@ -1,14 +1,14 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import {getSamplingScheme} from "@/api/qms/samplingProcess";
import { validateInteger } from '@/utils/validator'
import { validateInteger ,validateTwoNum} from '@/utils/validator'
// 表单校验
export const SamplingProcessRules = reactive({
sampleType: [required],
evaluationMode: [required],
description: [required],
sampleSize:ref([{ required: true, message: '该项为必填项', trigger: 'blur' }]),
sampleSize:ref([{ required: true, message: '该项为必填项', trigger: 'blur' },{validator:validateTwoNum, message: '小数点后最多2位', trigger: 'blur'}]),
sampleProgCode:ref([{ required: true, message: '该项为必填项', trigger: 'blur' }]),
inspectionQty: [required, {validator:validateInteger, message: '请输入正确的整数', trigger: 'blur'}]
})

Loading…
Cancel
Save