|
|
@ -1,13 +1,17 @@ |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<Dialog :title="dialogTitle" v-model="dialogVisible" :width="dialogWidth" :close-on-click-modal="false" :vLoading="formLoading"> |
|
|
|
<Dialog :title="dialogTitle" v-model="dialogVisible" :width="dialogWidth" :close-on-click-modal="false" |
|
|
|
:vLoading="formLoading"> |
|
|
|
<div style="max-height: 80vh; overflow-y: auto; padding: 0px 20px"> |
|
|
|
<Form ref="formMainRef" :rules="rules" :schema="formSchema" :is-col="true" @opensearchTable="opensearchTable" /> |
|
|
|
<div class="small-title">包装列表</div> |
|
|
|
<div style="border:1px solid #dedede;margin-bottom:20px;display: flex;"> |
|
|
|
<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> |
|
|
|
<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.processDescribe" :name="item.name"> |
|
|
|
<div class="small-title">检验工序</div> |
|
|
|
<el-form :model="item" label-width="auto" :rules="rules" ref="formProcessRef"> |
|
|
@ -39,7 +43,8 @@ |
|
|
|
<el-row :gutter="20"> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="编码"> |
|
|
|
<el-input v-model="item.inspectionJobCharacteristicsUpdateReqVO.number" placeholder="根据系统生成" :disabled="true" /> |
|
|
|
<el-input v-model="item.inspectionJobCharacteristicsUpdateReqVO.number" placeholder="根据系统生成" |
|
|
|
:disabled="true" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
@ -50,21 +55,24 @@ |
|
|
|
<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="请选择检验方法" /> |
|
|
|
<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.samplingProcessCode"> |
|
|
|
<div style="display: flex; width: 100%"> |
|
|
|
<el-input v-model="item.inspectionJobCharacteristicsUpdateReqVO.samplingProcessName" disabled placeholder="请选择采样过程编码" /> |
|
|
|
<el-input v-model="item.inspectionJobCharacteristicsUpdateReqVO.samplingProcessName" disabled |
|
|
|
placeholder="请选择采样过程编码" /> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="样品份数" prop="inspectionJobCharacteristicsUpdateReqVO.sampleQty"> |
|
|
|
<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> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
@ -72,7 +80,8 @@ |
|
|
|
<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="请输入样品份数" /> |
|
|
|
<el-input v-model="item.inspectionJobCharacteristicsUpdateReqVO.samplePieceSize" disabled |
|
|
|
placeholder="请输入样品份数" /> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
@ -83,42 +92,52 @@ |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="结果录入方式" prop="inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod"> |
|
|
|
<el-select v-model="item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod" placeholder="请选择结果录入方式" @change="resultEntryMethodChange($event, item)" disabled> |
|
|
|
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.INSPECTION_CHARACTERISTICS_RESULT_ENTRY)" :key="dict.value" :label="dict.label" :value="dict.value" /> |
|
|
|
<el-select v-model="item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod" |
|
|
|
placeholder="请选择结果录入方式" @change="resultEntryMethodChange($event, item)" disabled> |
|
|
|
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.INSPECTION_CHARACTERISTICS_RESULT_ENTRY)" |
|
|
|
:key="dict.value" :label="dict.label" :value="dict.value" /> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<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)" :key="dict.value" :label="dict.label" :value="dict.value" /> |
|
|
|
<el-select v-model="item.inspectionJobCharacteristicsUpdateReqVO.featureType" placeholder="请选择特征类型" |
|
|
|
@change="changeFeatureType" disabled> |
|
|
|
<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 :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-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-date-picker v-model="item.inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime" |
|
|
|
type="datetime" placeholder="请选择结束时间" style="width: 100%" value-format="x" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<!-- 手动评估的时候显示 --> |
|
|
|
<el-col :span="12" v-if="item.samplingProcessRespVO.evaluationMode == 1"> |
|
|
|
<el-form-item label="评估代码" required> |
|
|
|
<el-select v-model="item.inspectionJobCharacteristicsUpdateReqVO.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 v-model="item.inspectionJobCharacteristicsUpdateReqVO.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="24" v-for="(cur, i) in item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList" :key="i" style="border: 1px solid #dedede; border-radius: 4px; padding-top: 16px; margin-bottom: 10px;"> |
|
|
|
<el-col :span="24" |
|
|
|
v-for="(cur, i) in item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList" :key="i" |
|
|
|
style="border: 1px solid #dedede; border-radius: 4px; padding-top: 16px; margin-bottom: 10px;"> |
|
|
|
<el-row> |
|
|
|
<!-- 汇总录入的时候显示 --> |
|
|
|
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1"> |
|
|
|
<el-form-item label="合格数量" required> |
|
|
|
<el-input v-model="cur.qualifiedQuantity" placeholder="请输入合格数量" type="number"/> |
|
|
|
<el-input v-model="cur.qualifiedQuantity" placeholder="请输入合格数量" type="number" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1"> |
|
|
@ -128,13 +147,15 @@ |
|
|
|
</el-col> |
|
|
|
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == '0'"> |
|
|
|
<el-form-item label="检验值" required> |
|
|
|
<el-input v-model="cur.inspectionValue" placeholder="请输入检验值" type="number"/> |
|
|
|
<el-input v-model="cur.inspectionValue" placeholder="请输入检验值" type="number" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == '1'"> |
|
|
|
<el-form-item label="选定集" required> |
|
|
|
<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 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> |
|
|
@ -172,19 +193,19 @@ |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<script setup lang="ts"> |
|
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
|
import { getCurrentInstance } from 'vue' |
|
|
|
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' |
|
|
|
import * as InspectionJobDetailPageApi from '@/api/qms/inspectionJob/inspectionJobDetail' |
|
|
|
import { SearchTable } from '@/components/SearchTable' |
|
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
|
import { getCurrentInstance } from 'vue' |
|
|
|
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' |
|
|
|
import * as InspectionJobDetailPageApi from '@/api/qms/inspectionJob/inspectionJobDetail' |
|
|
|
import { SearchTable } from '@/components/SearchTable' |
|
|
|
import * as InspectionJobMainApi from '@/api/qms/inspectionJob/inspectionJobMain' |
|
|
|
import * as InspectionJobPackageApi from '@/api/qms/inspectionJob/InspectionJobPackage/InspectionJobPackage' |
|
|
|
import * as InspectionJobPackageApi from '@/api/qms/inspectionJob/InspectionJobPackage/InspectionJobPackage' |
|
|
|
|
|
|
|
const { proxy } = getCurrentInstance() |
|
|
|
const { proxy } = getCurrentInstance() |
|
|
|
|
|
|
|
const message = useMessage() // 消息弹窗 |
|
|
|
const message = useMessage() // 消息弹窗 |
|
|
|
|
|
|
|
const props = defineProps({ |
|
|
|
const props = defineProps({ |
|
|
|
// 显示窗口宽度设置 |
|
|
|
basicFormWidth: { |
|
|
|
type: String, |
|
|
@ -237,22 +258,22 @@ const props = defineProps({ |
|
|
|
required: true, |
|
|
|
default: null |
|
|
|
}, |
|
|
|
}) |
|
|
|
const { t } = useI18n() // 国际化 |
|
|
|
}) |
|
|
|
const { t } = useI18n() // 国际化 |
|
|
|
|
|
|
|
const dialogVisible = ref(false) // 弹窗的是否展示 |
|
|
|
const dialogTitle = ref('') // 弹窗的标题 |
|
|
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 |
|
|
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改 |
|
|
|
const dialogWidth = ref() |
|
|
|
const formMainRef = ref() |
|
|
|
const formFeaturesRef = ref() |
|
|
|
const formProcessRef = ref() |
|
|
|
const formSchema = ref(props.formAllSchemas?.formSchema) |
|
|
|
const tableAllSchemas = ref(props.tableAllSchemas) |
|
|
|
const tableFormRules = ref(props.tableFormRules) |
|
|
|
const dialogVisible = ref(false) // 弹窗的是否展示 |
|
|
|
const dialogTitle = ref('') // 弹窗的标题 |
|
|
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 |
|
|
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改 |
|
|
|
const dialogWidth = ref() |
|
|
|
const formMainRef = ref() |
|
|
|
const formFeaturesRef = ref() |
|
|
|
const formProcessRef = ref() |
|
|
|
const formSchema = ref(props.formAllSchemas?.formSchema) |
|
|
|
const tableAllSchemas = ref(props.tableAllSchemas) |
|
|
|
const tableFormRules = ref(props.tableFormRules) |
|
|
|
|
|
|
|
const data = ref({ |
|
|
|
const data = ref({ |
|
|
|
code: '', |
|
|
|
itemCode: '', |
|
|
|
version: '', |
|
|
@ -265,19 +286,19 @@ const data = ref({ |
|
|
|
expirationDate: '', |
|
|
|
available: 'TRUE', |
|
|
|
subList: [] |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
const dialogVisibleName = ref(false) |
|
|
|
const nameForm = ref({ |
|
|
|
const dialogVisibleName = ref(false) |
|
|
|
const nameForm = ref({ |
|
|
|
name: '' |
|
|
|
}) |
|
|
|
const nameRef = ref() |
|
|
|
if (props.basicFormWidth) { |
|
|
|
}) |
|
|
|
const nameRef = ref() |
|
|
|
if (props.basicFormWidth) { |
|
|
|
dialogWidth.value = props.basicFormWidth + '%' |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
dialogWidth.value = props.isBusiness ? '60%' : '40%' |
|
|
|
} |
|
|
|
const rules = ref({ |
|
|
|
} |
|
|
|
const rules = ref({ |
|
|
|
...props.rules, |
|
|
|
'inspectionJobCharacteristicsUpdateReqVO.description': [ |
|
|
|
{ required: true, message: '请填写描述', trigger: ['blur', 'change'] } |
|
|
@ -322,18 +343,18 @@ const rules = ref({ |
|
|
|
{ required: true, message: '请输入样品份数', trigger: 'blur' } |
|
|
|
], |
|
|
|
qualifiedQuantity: [{ required: true, message: '请输入选择结束时间', trigger: 'blur' }] |
|
|
|
}) |
|
|
|
const allSamplePieceSize = ref(0) |
|
|
|
/** 打开弹窗 */ |
|
|
|
let tabIndex = 1 |
|
|
|
const open = async (type: string, row?: any, masterParmas?: any, titleName?: any) => { |
|
|
|
}) |
|
|
|
const allSamplePieceSize = ref(0) |
|
|
|
/** 打开弹窗 */ |
|
|
|
let tabIndex = 1 |
|
|
|
const open = async (type : string, row ?: any, masterParmas ?: any, titleName ?: any) => { |
|
|
|
if (titleName) { |
|
|
|
dialogTitle.value = t('action.' + titleName) |
|
|
|
} else { |
|
|
|
dialogTitle.value = t('action.' + type) |
|
|
|
} |
|
|
|
formType.value = type |
|
|
|
allSamplePieceSize.value =0//打开时候归0 |
|
|
|
allSamplePieceSize.value = 0//打开时候归0 |
|
|
|
if (row) { |
|
|
|
data.value = JSON.parse(JSON.stringify(row)) |
|
|
|
// console.log(data.value)// 发起承接 |
|
|
@ -395,19 +416,20 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any |
|
|
|
rules.value['inspectionJobCharacteristicsUpdateReqVO.estimateCode'][0].required = false |
|
|
|
} |
|
|
|
}) |
|
|
|
console.log(22,allSamplePieceSize.value ) |
|
|
|
console.log(22, allSamplePieceSize.value) |
|
|
|
data.value.subList = list |
|
|
|
/** |
|
|
|
设置采样数量,默认第一个包装采样数量<总数量,显示数量字段,第二个包装和剩下的总数量对比,以此类推, |
|
|
|
第一个包装采样数量>总数量 则显示总数量 |
|
|
|
*/ |
|
|
|
for(let i = 0; i<data.value.packageList.length;i++){ |
|
|
|
if(allSamplePieceSize.value>data.value.packageList[i].amount){ |
|
|
|
|
|
|
|
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{ |
|
|
|
} else { |
|
|
|
data.value.packageList[i].sampleAmount = allSamplePieceSize.value |
|
|
|
allSamplePieceSize.value=0 |
|
|
|
allSamplePieceSize.value = 0 |
|
|
|
// return; |
|
|
|
} |
|
|
|
} |
|
|
@ -436,13 +458,13 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any |
|
|
|
} |
|
|
|
dialogVisible.value = true |
|
|
|
tabIndex = data.value.subList.length + 1 |
|
|
|
} |
|
|
|
defineExpose({ open, dialogVisible, formLoading }) // 提供 open 方法,用于打开弹窗 |
|
|
|
import type { TabPaneName } from 'element-plus' |
|
|
|
} |
|
|
|
defineExpose({ open, dialogVisible, formLoading }) // 提供 open 方法,用于打开弹窗 |
|
|
|
import type { TabPaneName } from 'element-plus' |
|
|
|
|
|
|
|
const editableTabsValue = ref('1') |
|
|
|
// const editableTabs = ref([]) |
|
|
|
const handleTabsEdit = (targetName: TabPaneName | undefined, action: 'remove' | 'add') => { |
|
|
|
const editableTabsValue = ref('1') |
|
|
|
// const editableTabs = ref([]) |
|
|
|
const handleTabsEdit = (targetName : TabPaneName | undefined, action : 'remove' | 'add') => { |
|
|
|
if (action === 'add') { |
|
|
|
nameForm.value.name = '' |
|
|
|
dialogVisibleName.value = true |
|
|
@ -462,9 +484,9 @@ const handleTabsEdit = (targetName: TabPaneName | undefined, action: 'remove' | |
|
|
|
editableTabsValue.value = activeName |
|
|
|
data.value.subList = tabs.filter((tab) => tab.name !== targetName) |
|
|
|
} |
|
|
|
} |
|
|
|
/** 修改名称时间 */ |
|
|
|
const buttonBaseClick1 =async (val) => { |
|
|
|
} |
|
|
|
/** 修改名称时间 */ |
|
|
|
const buttonBaseClick1 = async (val) => { |
|
|
|
// 保存 |
|
|
|
if (val == 'save') { |
|
|
|
if (!nameRef.value) return |
|
|
@ -511,8 +533,8 @@ const buttonBaseClick1 =async (val) => { |
|
|
|
else if (val == 'close') { |
|
|
|
dialogVisibleName.value = false |
|
|
|
} |
|
|
|
} |
|
|
|
const buttonBaseClick =async(val) => { |
|
|
|
} |
|
|
|
const buttonBaseClick = async (val) => { |
|
|
|
// 保存 |
|
|
|
if (val == 'save') { |
|
|
|
submitForm() |
|
|
@ -522,10 +544,14 @@ const buttonBaseClick =async(val) => { |
|
|
|
// await InspectionJobMainApi.abandonInspectionJobMain(data.value.id) |
|
|
|
dialogVisible.value = false |
|
|
|
} |
|
|
|
} |
|
|
|
// 传递给父类 |
|
|
|
const emit = defineEmits(['submitForm', 'searchTableSuccess']) |
|
|
|
const validateForm = (formRef) => { |
|
|
|
// 暂存 |
|
|
|
else if (val == 'staging') { |
|
|
|
staging() |
|
|
|
} |
|
|
|
} |
|
|
|
// 传递给父类 |
|
|
|
const emit = defineEmits(['submitForm', 'searchTableSuccess']) |
|
|
|
const validateForm = (formRef) => { |
|
|
|
// console.log(TableBaseForm_Ref.value) |
|
|
|
let _lists = formRef?.map((v) => v.validate()) |
|
|
|
return Promise.all(_lists) |
|
|
@ -535,9 +561,9 @@ const validateForm = (formRef) => { |
|
|
|
.catch(() => { |
|
|
|
return false |
|
|
|
}) |
|
|
|
} |
|
|
|
const tableFormRef = ref() |
|
|
|
const submitForm = async () => { |
|
|
|
} |
|
|
|
const tableFormRef = ref() |
|
|
|
const submitForm = async () => { |
|
|
|
try { |
|
|
|
console.log(data.value.subList) |
|
|
|
const elForm = unref(formMainRef)?.getElFormRef() |
|
|
@ -547,12 +573,12 @@ const submitForm = async () => { |
|
|
|
if (!valid) return |
|
|
|
// 校验包装列表 |
|
|
|
|
|
|
|
console.log(11,data.value.packageList) |
|
|
|
if(data.value.packageList?.length>0){ |
|
|
|
console.log(11, data.value.packageList) |
|
|
|
if (data.value.packageList?.length > 0) { |
|
|
|
const validateForm1 = await tableFormRef.value.validateForm() |
|
|
|
if (!validateForm1) return |
|
|
|
let isPass = data.value.packageList.some(cur=>parseFloat(cur.sampleAmount)>parseFloat(cur.amount)) |
|
|
|
if(isPass){ |
|
|
|
let isPass = data.value.packageList.some(cur => parseFloat(cur.sampleAmount) > parseFloat(cur.amount)) |
|
|
|
if (isPass) { |
|
|
|
message.error(`采样数量不能大于数量`) |
|
|
|
return |
|
|
|
} |
|
|
@ -606,7 +632,7 @@ const submitForm = async () => { |
|
|
|
) |
|
|
|
} |
|
|
|
// 开始时间大于结束时间放入数组中 |
|
|
|
if (item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime >item.inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime) { |
|
|
|
if (item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime > item.inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime) { |
|
|
|
isOutweigh.push(item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime) |
|
|
|
} |
|
|
|
// 合格数量和不合格数量之和不能是小数 |
|
|
@ -614,7 +640,7 @@ const submitForm = async () => { |
|
|
|
parseFloatList.push( |
|
|
|
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( |
|
|
|
(cur, key) => { |
|
|
|
return String(cur.qualifiedQuantity).indexOf('.')>-1 || String(cur.unqualifiedQuantity).indexOf('.')>-1 |
|
|
|
return String(cur.qualifiedQuantity).indexOf('.') > -1 || String(cur.unqualifiedQuantity).indexOf('.') > -1 |
|
|
|
} |
|
|
|
) |
|
|
|
) |
|
|
@ -622,31 +648,31 @@ const submitForm = async () => { |
|
|
|
numberList.push( |
|
|
|
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( |
|
|
|
(cur, key) => { |
|
|
|
console.log(12,cur.qualifiedQuantity) |
|
|
|
console.log(13,cur.unqualifiedQuantity) |
|
|
|
console.log(14,item.inspectionJobCharacteristicsUpdateReqVO.sampleQty) |
|
|
|
console.log(12, cur.qualifiedQuantity) |
|
|
|
console.log(13, cur.unqualifiedQuantity) |
|
|
|
console.log(14, item.inspectionJobCharacteristicsUpdateReqVO.sampleQty) |
|
|
|
return parseFloat(cur.qualifiedQuantity) + parseFloat(cur.unqualifiedQuantity) != parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.sampleQty) |
|
|
|
} |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
}) |
|
|
|
let isEmpty1 = arrBol.some(item=>item == true) |
|
|
|
let isEmptyNumberList = numberList.some(item=>item == true) |
|
|
|
let isParseFloat = parseFloatList.some(item=>item == true) |
|
|
|
if(isEmpty1){ |
|
|
|
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; |
|
|
|
} |
|
|
|
if(isOutweigh?.length>0){ |
|
|
|
if (isOutweigh?.length > 0) { |
|
|
|
message.error('检验特性中有开始时间大于结束时间') |
|
|
|
return; |
|
|
|
} |
|
|
|
if(isParseFloat){ |
|
|
|
if (isParseFloat) { |
|
|
|
message.error('合格数量和不合格数量之和不可以是小数') |
|
|
|
return; |
|
|
|
} |
|
|
|
if(isEmptyNumberList){ |
|
|
|
if (isEmptyNumberList) { |
|
|
|
message.error('合格数量和不合格数量之和必须等于样品份数') |
|
|
|
return; |
|
|
|
} |
|
|
@ -660,28 +686,149 @@ const submitForm = async () => { |
|
|
|
} catch { |
|
|
|
console.log(111) |
|
|
|
} |
|
|
|
} |
|
|
|
/** 弹窗按钮 */ |
|
|
|
let Butttondata: any = [] |
|
|
|
if (props.footButttondata) { |
|
|
|
} |
|
|
|
|
|
|
|
const staging = async () => { |
|
|
|
try { |
|
|
|
console.log(data.value.subList) |
|
|
|
const elForm = unref(formMainRef)?.getElFormRef() |
|
|
|
// 校验表单 |
|
|
|
if (!elForm) return |
|
|
|
const valid = await elForm.validate() |
|
|
|
if (!valid) return |
|
|
|
// 校验包装列表 |
|
|
|
|
|
|
|
console.log(11, data.value.packageList) |
|
|
|
if (data.value.packageList?.length > 0) { |
|
|
|
const validateForm1 = await tableFormRef.value.validateForm() |
|
|
|
if (!validateForm1) return |
|
|
|
let isPass = data.value.packageList.some(cur => parseFloat(cur.sampleAmount) > parseFloat(cur.amount)) |
|
|
|
if (isPass) { |
|
|
|
message.error(`采样数量不能大于数量`) |
|
|
|
return |
|
|
|
} |
|
|
|
// let number = 0 |
|
|
|
// data.value.packageList.forEach(cur=>{ |
|
|
|
// number += parseFloat(cur.sampleAmount) |
|
|
|
// }) |
|
|
|
// number = number.toFixed('2') |
|
|
|
// if(number != data.value.sampleTotalAmount){ |
|
|
|
// message.error(`采样数量之和必须等于采样总数量`) |
|
|
|
// return |
|
|
|
// } |
|
|
|
} |
|
|
|
|
|
|
|
const bol2 = await validateForm(formFeaturesRef.value) |
|
|
|
if (!bol2) { |
|
|
|
message.error(`模板中有检验工序和检验特性未填写完全`) |
|
|
|
return |
|
|
|
} |
|
|
|
// 判断数组是否有未填的选项 |
|
|
|
let arrBol = [] |
|
|
|
let isOutweigh = []//结束时间是否大于开始时间 |
|
|
|
let numberList = []//判断合格数量和不合格数量之和是否等于主表数量 |
|
|
|
let parseFloatList = []//判断合格数量和不合格数量是否是整数 |
|
|
|
data.value.subList.forEach((item, index) => { |
|
|
|
if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1) { |
|
|
|
arrBol.push( |
|
|
|
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( |
|
|
|
(cur, key) => { |
|
|
|
return !cur.qualifiedQuantity || !cur.unqualifiedQuantity |
|
|
|
} |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
if (item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0) { |
|
|
|
arrBol.push( |
|
|
|
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( |
|
|
|
(cur, key) => { |
|
|
|
return !cur.inspectionValue |
|
|
|
} |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
if (item.inspectionJobCharacteristicsUpdateReqVO.featureType == 1) { |
|
|
|
arrBol.push( |
|
|
|
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( |
|
|
|
(cur, key) => { |
|
|
|
return !cur.qualitativeCode |
|
|
|
} |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
// 开始时间大于结束时间放入数组中 |
|
|
|
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) => { |
|
|
|
console.log(12, cur.qualifiedQuantity) |
|
|
|
console.log(13, cur.unqualifiedQuantity) |
|
|
|
console.log(14, item.inspectionJobCharacteristicsUpdateReqVO.sampleQty) |
|
|
|
return parseFloat(cur.qualifiedQuantity) + parseFloat(cur.unqualifiedQuantity) != parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.sampleQty) |
|
|
|
} |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
}) |
|
|
|
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; |
|
|
|
} |
|
|
|
if (isOutweigh?.length > 0) { |
|
|
|
message.error('检验特性中有开始时间大于结束时间') |
|
|
|
return; |
|
|
|
} |
|
|
|
if (isParseFloat) { |
|
|
|
message.error('合格数量和不合格数量之和不可以是小数') |
|
|
|
return; |
|
|
|
} |
|
|
|
if (isEmptyNumberList) { |
|
|
|
message.error('合格数量和不合格数量之和必须等于样品份数') |
|
|
|
return; |
|
|
|
} |
|
|
|
await InspectionJobMainApi.stagingInspectionJobMain(data.value); |
|
|
|
} catch { |
|
|
|
console.log(111) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** 弹窗按钮 */ |
|
|
|
let Butttondata : any = [] |
|
|
|
if (props.footButttondata) { |
|
|
|
Butttondata = props.footButttondata |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
Butttondata = [ |
|
|
|
defaultButtons.formStagingBtn(null), // 暂存 |
|
|
|
defaultButtons.formSaveBtn(null), // 保存 |
|
|
|
defaultButtons.formCloseBtn(null) // 关闭 |
|
|
|
] |
|
|
|
} |
|
|
|
// 选择特征类型 |
|
|
|
const changeFeatureType = (e) => { |
|
|
|
} |
|
|
|
// 选择特征类型 |
|
|
|
const changeFeatureType = (e) => { |
|
|
|
console.log(e) |
|
|
|
// if (e) { |
|
|
|
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyQuantifyCode'][0].required = true |
|
|
|
// } else { |
|
|
|
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyQuantifyCode'][0].required = false |
|
|
|
// } |
|
|
|
} |
|
|
|
const searchTableRef = ref() |
|
|
|
const opensearchTable = ( |
|
|
|
} |
|
|
|
const searchTableRef = ref() |
|
|
|
const opensearchTable = ( |
|
|
|
formField, |
|
|
|
searchField, |
|
|
|
searchTitle, |
|
|
@ -691,12 +838,12 @@ const opensearchTable = ( |
|
|
|
multiple, |
|
|
|
type, |
|
|
|
row |
|
|
|
) => { |
|
|
|
) => { |
|
|
|
const _searchCondition = {} |
|
|
|
// 判断查询条件中,是否存在指向主表的数据 |
|
|
|
if (searchCondition && searchCondition.length > 0) { |
|
|
|
// 转换筛选条件所需 |
|
|
|
let filters: any[] = [] |
|
|
|
let filters : any[] = [] |
|
|
|
for (var i = 0; i < searchCondition.length; i++) { |
|
|
|
// searchCondition.forEach((item) => { |
|
|
|
// 查询条件为主表某字段,需要赋值主表数据,数据来源是详情的,赋值需要从row中获取 |
|
|
@ -754,10 +901,10 @@ const opensearchTable = ( |
|
|
|
row, |
|
|
|
_searchCondition |
|
|
|
) |
|
|
|
} |
|
|
|
// 弹层确定返回所选数据 |
|
|
|
// val : 弹层列表row 数据 |
|
|
|
const searchTableSuccess = async (formField, searchField, val, type, row) => { |
|
|
|
} |
|
|
|
// 弹层确定返回所选数据 |
|
|
|
// val : 弹层列表row 数据 |
|
|
|
const searchTableSuccess = async (formField, searchField, val, type, row) => { |
|
|
|
if (type == 'features') { |
|
|
|
row.inspectionJobCharacteristicsUpdateReqVO[formField] = val[0].code |
|
|
|
if (formField == 'inspectionMethodCode') { |
|
|
@ -804,9 +951,9 @@ const searchTableSuccess = async (formField, searchField, val, type, row) => { |
|
|
|
} |
|
|
|
|
|
|
|
// emit('searchTableSuccess', formField, searchField, val, formRef.value, type, row) |
|
|
|
} |
|
|
|
// 请选择结果录入方式 |
|
|
|
const resultEntryMethodChange = (e, item) => { |
|
|
|
} |
|
|
|
// 请选择结果录入方式 |
|
|
|
const resultEntryMethodChange = (e, item) => { |
|
|
|
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = [] |
|
|
|
if (e == 0) { |
|
|
|
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true |
|
|
@ -832,29 +979,30 @@ const resultEntryMethodChange = (e, item) => { |
|
|
|
] |
|
|
|
} |
|
|
|
console.log(222, item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList) |
|
|
|
} |
|
|
|
// 选择选定级 |
|
|
|
const changeQualitativeCode = (e, item, cur) => { |
|
|
|
} |
|
|
|
// 选择选定级 |
|
|
|
const changeQualitativeCode = (e, item, cur) => { |
|
|
|
let obj = item.selectedProjectRespVOList.find((cur) => cur.dictionaryValue == e) |
|
|
|
console.log(obj) |
|
|
|
cur.defectLevel = obj.defectLevel |
|
|
|
cur.estimateCode = obj.estimateCode |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
<style scoped> |
|
|
|
.small-title { |
|
|
|
.small-title { |
|
|
|
font-weight: bold; |
|
|
|
padding: 0px 10px 10px; |
|
|
|
color: #1a8bfc; |
|
|
|
font-size: 16px; |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |
|
|
|
<style> |
|
|
|
.el-tabs--left .el-tabs__header.is-left { |
|
|
|
.el-tabs--left .el-tabs__header.is-left { |
|
|
|
min-height: 700px !important; |
|
|
|
min-width: 150px !important; |
|
|
|
} |
|
|
|
.el-tabs--left.el-tabs--border-card .el-tabs__item.is-left { |
|
|
|
} |
|
|
|
|
|
|
|
.el-tabs--left.el-tabs--border-card .el-tabs__item.is-left { |
|
|
|
min-width: 120px !important; |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |
|
|
|