You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

864 lines
30 KiB

1 year ago
<template>
<Dialog
:title="dialogTitle"
v-model="dialogVisible"
:width="dialogWidth"
:close-on-click-modal="false"
:vLoading="formLoading"
>
<div style="max-height: 60vh; overflow-y: auto; padding: 0px 20px">
1 year ago
<!-- <Form ref="formRefMain" :schema="formAllSchemasMain" :is-col="true" :rules="rules" /> -->
<el-form :model="data" label-width="auto" :rules="rules" ref="formMainRef">
<el-row gutter="20">
1 year ago
<el-col :span="12">
1 year ago
<el-form-item label="编码" prop="code">
<el-input v-model="data.code" placeholder="根据系统生成" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="描述" prop="description">
<el-input v-model="data.description" placeholder="请填写描述" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="版本" prop="version">
<el-input v-model="data.version" placeholder="请填写版本" />
</el-form-item>
</el-col>
</el-row>
</el-form>
1 year ago
<el-tabs
1 year ago
v-model="editableTabsValue"
editable
class="demo-tabs"
@edit="handleTabsEdit"
type="border-card"
tab-position="left"
1 year ago
:stretch="false"
1 year ago
>
1 year ago
<el-tab-pane
v-for="item in data.process"
1 year ago
:key="item.name"
1 year ago
:label="item.description"
1 year ago
:name="item.name"
>
<div class="small-title">检验工序</div>
1 year ago
<!-- <Form
:ref="`formRefProcess`+index"
1 year ago
:schema="formAllSchemasProcess"
:is-col="true"
labelWidth="150px"
1 year ago
:rules="rules"
/> -->
1 year ago
<el-form :model="item" label-width="auto" :rules="rules" ref="formProcessRef">
1 year ago
<el-row :gutter="20">
<el-col :span="12">
1 year ago
<el-form-item label="编码" prop="code">
<el-input v-model="item.code" placeholder="根据系统生成" :disabled="true" />
1 year ago
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="检验方案模板编码">
1 year ago
<el-input
v-model="item.inspectionCode"
placeholder="根据系统生成"
:disabled="true"
/>
1 year ago
</el-form-item>
</el-col>
<el-col :span="12">
1 year ago
<el-form-item label="描述" prop="description">
1 year ago
<el-input v-model="item.description" />
</el-form-item>
</el-col>
<el-col :span="12">
1 year ago
<el-form-item label="顺序号" prop="sequenceCode">
1 year ago
<el-input v-model="item.sequenceCode" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="检验特性编码">
1 year ago
<el-input
v-model="item.inspectionCharCode"
placeholder="根据系统生成"
:disabled="true"
/>
1 year ago
</el-form-item>
</el-col>
</el-row>
</el-form>
1 year ago
<div class="small-title">检验特性</div>
1 year ago
<el-form :model="item" label-width="auto" :rules="rules" ref="formFeaturesRef">
1 year ago
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="编码">
1 year ago
<el-input
v-model="item.inspectionCharacteristicsBaseVO.code"
placeholder="根据系统生成"
:disabled="true"
/>
1 year ago
</el-form-item>
</el-col>
<el-col :span="12">
1 year ago
<el-form-item label="描述" prop="inspectionCharacteristicsBaseVO.description">
1 year ago
<el-input v-model="item.inspectionCharacteristicsBaseVO.description" />
</el-form-item>
</el-col>
<el-col :span="12">
1 year ago
<el-form-item
label="检验方法编码"
prop="inspectionCharacteristicsBaseVO.inspectionMethodCode"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionCharacteristicsBaseVO.inspectionMethodCode"
disabled
placeholder="请选择检验方法编码"
1 year ago
/>
1 year ago
<el-button
type="info"
plain
style="width: 40px"
@click="
opensearchTable(
'inspectionMethodCode',
null,
'检验方法',
SamplingProcess.allSchemas,
1 year ago
InspectionMethodApi.getInspectionMethodPage,
[
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
],
1 year ago
false,
null,
item
)
"
><Icon icon="ep:search"
/></el-button>
</div>
1 year ago
</el-form-item>
</el-col>
<el-col :span="12">
1 year ago
<el-form-item
label="采样过程编码"
prop="inspectionCharacteristicsBaseVO.dynamicUpdateCode"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionCharacteristicsBaseVO.dynamicUpdateCode"
disabled
placeholder="请选择采样过程编码"
1 year ago
/>
1 year ago
<el-button
type="info"
plain
style="width: 40px"
@click="
opensearchTable(
'dynamicUpdateCode',
null,
'采样过程编码',
SamplingProcess.allSchemas,
SamplingProcessApi.getSamplingProcessPage,
1 year ago
[
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
],
1 year ago
false,
null,
item
)
"
><Icon icon="ep:search"
/></el-button>
</div>
1 year ago
</el-form-item>
</el-col>
<el-col :span="12">
1 year ago
<el-form-item
label="动态修改规则编码"
prop="inspectionCharacteristicsBaseVO.inspectionMethod"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionCharacteristicsBaseVO.inspectionMethod"
disabled
placeholder="请选择动态修改规则编码"
1 year ago
/>
1 year ago
<el-button
type="info"
plain
style="width: 40px"
@click="
opensearchTable(
'inspectionMethod',
null,
'动态修改规则编码',
SamplingProcess.allSchemas,
1 year ago
DynamicRuleApi.getDynamicRulePage,
[
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
],
1 year ago
false,
null,
item
)
"
><Icon icon="ep:search"
/></el-button>
</div>
1 year ago
</el-form-item>
</el-col>
<el-col :span="12">
1 year ago
<el-form-item
label="是否允许修改特征值"
prop="inspectionCharacteristicsBaseVO.isCanUpdate"
>
<el-switch v-model="item.inspectionCharacteristicsBaseVO.isCanUpdate"/>
1 year ago
</el-form-item>
</el-col>
<el-col :span="12">
1 year ago
<el-form-item
label="结果录入方式"
prop="inspectionCharacteristicsBaseVO.resultEntryMethod"
>
<el-select
v-model="item.inspectionCharacteristicsBaseVO.resultEntryMethod"
placeholder="请选择结果录入方式"
>
1 year ago
<el-option
1 year ago
v-for="dict in getStrDictOptions(
DICT_TYPE.INSPECTION_CHARACTERISTICS_RESULT_ENTRY
)"
1 year ago
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
1 year ago
<el-form-item label="特征类型" prop="inspectionCharacteristicsBaseVO.featureType">
1 year ago
<!-- <el-input v-model="item.featureType" /> -->
1 year ago
<el-select
v-model="item.inspectionCharacteristicsBaseVO.featureType"
placeholder="请选择特征类型"
@change="changeFeatureType"
>
1 year ago
<el-option
1 year ago
v-for="dict in getStrDictOptions(
DICT_TYPE.INSPECTION_CHARACTERISTICS_FEATURE_TYPE
)"
1 year ago
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
1 year ago
<el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0">
<el-form-item
label="是否设定上限"
prop="inspectionCharacteristicsBaseVO.quantifyIsCapping"
>
1 year ago
<el-switch v-model="item.inspectionCharacteristicsBaseVO.quantifyIsCapping" @change="changeIsCapping"/>
1 year ago
</el-form-item>
</el-col>
<el-col :span="12">
1 year ago
<el-form-item
label="上限值"
prop="inspectionCharacteristicsBaseVO.quantifyCapping"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"
>
<el-input v-model="item.inspectionCharacteristicsBaseVO.quantifyCapping" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
prop="inspectionCharacteristicsBaseVO.quantifyIsLowlimit"
label="是否设定下限"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"
>
1 year ago
<el-switch v-model="item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit" @change="changeLowlimit"/>
1 year ago
</el-form-item>
</el-col>
<el-col :span="12">
1 year ago
<el-form-item
label="下限值"
prop="inspectionCharacteristicsBaseVO.quantifyLowlimit"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"
>
<el-input v-model="item.inspectionCharacteristicsBaseVO.quantifyLowlimit" />
1 year ago
</el-form-item>
</el-col>
<el-col :span="12">
1 year ago
<el-form-item
prop="inspectionCharacteristicsBaseVO.quantifyIsTarget"
label="是否设定目标值"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"
>
1 year ago
<el-switch v-model="item.inspectionCharacteristicsBaseVO.quantifyIsTarget" @change="changeIsTarget"/>
1 year ago
</el-form-item>
</el-col>
<el-col :span="12">
1 year ago
<el-form-item
label="目标值"
prop="inspectionCharacteristicsBaseVO.quantifyTarget"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"
>
<el-input v-model="item.inspectionCharacteristicsBaseVO.quantifyTarget" />
1 year ago
</el-form-item>
</el-col>
1 year ago
1 year ago
<el-col :span="12">
1 year ago
<el-form-item
label="计量单位"
prop="inspectionCharacteristicsBaseVO.quantifyUom"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"
>
1 year ago
<el-input v-model="item.inspectionCharacteristicsBaseVO.quantifyUom" />
</el-form-item>
</el-col>
<el-col :span="12">
1 year ago
<el-form-item
label="小数位"
prop="inspectionCharacteristicsBaseVO.quantifyDecimal"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"
>
1 year ago
<el-input v-model="item.inspectionCharacteristicsBaseVO.quantifyDecimal" />
</el-form-item>
</el-col>
<el-col :span="12">
1 year ago
<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="请选择选择集编码"
1 year ago
/>
1 year ago
<el-button
type="info"
plain
style="width: 40px"
@click="
opensearchTable(
'quantifyQuantifyCode',
null,
'选择集编码',
SamplingProcess.allSchemas,
1 year ago
SelectedSetApi.getSelectedSetPage,
[
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
],
1 year ago
false,
null,
item
)
"
><Icon icon="ep:search"
/></el-button>
</div>
1 year ago
</el-form-item>
</el-col>
</el-row>
</el-form>
1 year ago
</el-tab-pane>
1 year ago
</el-tabs>
1 year ago
</div>
<template #footer>
<ButtonBase :Butttondata="Butttondata" @button-base-click="buttonBaseClick" />
</template>
</Dialog>
1 year ago
<Dialog title="修改名称" v-model="dialogVisibleName" width="500px" :close-on-click-modal="false">
<div style="padding: 0px 20px">
1 year ago
<el-form ref="nameRef" :model="nameForm">
<el-form-item
:rules="[{ required: true, message: '请输入名称', trigger: 'blur' }]"
prop="name"
>
<el-input v-model="nameForm.name" style="width: 240px" placeholder="请输入名称" />
</el-form-item>
</el-form>
1 year ago
</div>
<template #footer>
<ButtonBase :Butttondata="Butttondata" @button-base-click="buttonBaseClick1" />
</template>
</Dialog>
1 year ago
<SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess" />
1 year ago
</template>
<script setup lang="ts">
import * as defaultButtons from '@/utils/disposition/defaultButtons'
1 year ago
import { getCurrentInstance } from 'vue'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
import * as InspectionProcessPageApi from '@/api/qms/inspectionTemplate'
1 year ago
import { SearchTable } from '@/components/SearchTable'
import { SamplingProcess } from '@/views/qms/samplingProcess/samplingProcess.data'
1 year ago
import * as SamplingProcessApi from '@/api/qms/samplingProcess'//采样过程
import * as InspectionMethodApi from '@/api/qms/inspectionMethod'//检验方法
import * as DynamicRuleApi from '@/api/qms/dynamicRule'//动态修改规则
import * as SelectedSetApi from '@/api/qms/selectedSet'//选择集
1 year ago
const message = useMessage() // 消息弹窗
1 year ago
1 year ago
const props = defineProps({
// 显示窗口宽度设置
basicFormWidth: {
type: String,
default: ''
},
// 检验特性表单,列表 相关信息
formAllSchemasFeatures: {
type: Object,
required: true,
default: null
},
// 检验工序表单,列表 相关信息
formAllSchemasProcess: {
type: Object,
required: true,
default: null
},
// 检验模板表单,列表 相关信息
formAllSchemasMain: {
type: Object,
required: true,
default: null
},
// 底部按钮集合
footButttondata: {
type: Array,
required: false,
default: null
}
})
const { t } = useI18n() // 国际化
1 year ago
const dialogVisible = ref(false) // 弹窗的是否展示
1 year ago
const dialogTitle = ref('') // 弹窗的标题
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
const formType = ref('') // 表单的类型:create - 新增;update - 修改
const dialogWidth = ref()
1 year ago
const formMainRef = ref()
const formFeaturesRef = ref()
const formProcessRef = ref()
1 year ago
const data = ref({
code: '',
1 year ago
description: '',
version: '',
process: []
1 year ago
})
1 year ago
const dialogVisibleName = ref(false)
1 year ago
const nameForm = ref({
name: ''
})
const nameRef = ref()
1 year ago
if (props.basicFormWidth) {
dialogWidth.value = props.basicFormWidth + '%'
} else {
dialogWidth.value = props.isBusiness ? '60%' : '40%'
}
1 year ago
const rules = ref({
description: [{ required: true, message: '请填写描述', trigger: 'blur' }],
version: [{ required: true, message: '请填写版本', trigger: 'blur' }],
inspectionCode: [{ required: true, message: '请选择检验方案模板编码', trigger: 'blur' }],
sequenceCode: [{ required: true, message: '请填写顺序号', trigger: 'blur' }],
inspectionCharCode: [{ required: true, message: '请选择检验特性编码', trigger: 'blur' }],
'inspectionCharacteristicsBaseVO.description': [
{ required: true, message: '请填写描述', trigger: ['blur', 'change'] }
],
'inspectionCharacteristicsBaseVO.inspectionMethodCode': [
{ required: true, message: '请选择检验方法编码', trigger: 'blur' }
],
'inspectionCharacteristicsBaseVO.dynamicUpdateCode': [
{ required: true, message: '请选择采样过程编码', trigger: ['blur', 'change'] }
],
'inspectionCharacteristicsBaseVO.inspectionMethod': [
{ required: true, message: '请选择动态修改规则编码', trigger: ['blur', 'change'] }
],
'inspectionCharacteristicsBaseVO.resultEntryMethod': [
{ required: true, message: '请选择结果录入方式', trigger: ['blur', 'change'] }
],
'inspectionCharacteristicsBaseVO.featureType': [
{ required: true, message: '请选择特征类型', trigger: ['blur', 'change'] }
],
'inspectionCharacteristicsBaseVO.quantifyTarget': [
{ required: true, message: '请输入目标值', trigger: 'blur' }
],
'inspectionCharacteristicsBaseVO.quantifyCapping': [
{ required: true, message: '请输入上限值', trigger: 'blur' }
],
'inspectionCharacteristicsBaseVO.quantifyLowlimit': [
{ required: true, message: '请输入下限值', trigger: 'blur' }
],
'inspectionCharacteristicsBaseVO.quantifyUom': [
{ required: true, message: '请选择计量单位', trigger: 'blur' }
],
'inspectionCharacteristicsBaseVO.quantifyDecimal': [
{ required: true, message: '请输入小数位', trigger: 'blur' }
],
'inspectionCharacteristicsBaseVO.quantifyQuantifyCode': [
{ required: true, message: '请输入选择集编码', trigger: 'blur' }
]
})
1 year ago
/** 打开弹窗 */
1 year ago
let tabIndex = 1
1 year ago
const open = async (type: string, row?: any, masterParmas?: any, titleName?: any) => {
dialogVisible.value = true
if (titleName) {
dialogTitle.value = t('action.' + titleName)
} else {
dialogTitle.value = t('action.' + type)
}
1 year ago
formType.value = type
if (row) {
1 year ago
data.value = JSON.parse(JSON.stringify(row))
1 year ago
let list = await InspectionProcessPageApi.getListByTempleteCode(row.code)
list.forEach((item, index) => {
editableTabsValue.value = index + 1
item.name = index + 1
1 year ago
// 编辑判断上限下限目标值是否必填
1 year ago
if (item.quantifyIsCapping) {
1 year ago
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true
1 year ago
} else {
1 year ago
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false
}
1 year ago
if (item.quantifyIsLowlimit) {
1 year ago
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true
1 year ago
} else {
1 year ago
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false
}
1 year ago
if (item.quantifyIsTarget) {
1 year ago
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true
1 year ago
} else {
1 year ago
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false
}
1 year ago
})
data.value.process = list
} else {
data.value = {
code: '',
description: '',
version: '',
process: []
}
}
tabIndex = data.value.process.length + 1
1 year ago
}
defineExpose({ open, dialogVisible, formLoading }) // 提供 open 方法,用于打开弹窗
1 year ago
import type { TabPaneName } from 'element-plus'
1 year ago
1 year ago
const editableTabsValue = ref('1')
// const editableTabs = ref([])
const handleTabsEdit = (targetName: TabPaneName | undefined, action: 'remove' | 'add') => {
if (action === 'add') {
1 year ago
nameForm.value.name = ''
1 year ago
dialogVisibleName.value = true
} else if (action === 'remove') {
const tabs = data.value.process
let activeName = editableTabsValue.value
if (activeName === targetName) {
tabs.forEach((tab, index) => {
if (tab.name === targetName) {
const nextTab = tabs[index + 1] || tabs[index - 1]
if (nextTab) {
activeName = nextTab.name
}
}
})
1 year ago
}
1 year ago
editableTabsValue.value = activeName
data.value.process = tabs.filter((tab) => tab.name !== targetName)
}
}
/** 修改名称时间 */
const buttonBaseClick1 = (val) => {
// 保存
if (val == 'save') {
1 year ago
if (!nameRef.value) return
nameRef.value.validate((valid, fields) => {
if (valid) {
const newTabName = `${++tabIndex}`
data.value.process.push({
description: nameForm.value.name,
name: newTabName,
inspectionCode: '',
sequenceCode: '',
inspectionCharCode: '',
inspectionCharacteristicsBaseVO: {
describe: '',
inspectionMethodCode: '',
dynamicUpdateCode: '',
inspectionMethod: '',
isCanUpdate: '',
isDestructionInspection: '',
resultEntryMethod: '',
featureType: '',
quantifyIsCapping: '',
quantifyIsLowlimit: '',
1 year ago
quantifyIsTarget: '',
1 year ago
quantifyTarget: '',
quantifyCapping: '',
quantifyLowlimit: '',
quantifyUom: '',
quantifyDecimal: '',
quantifyQuantifyCode: ''
}
})
console.log(data.value.process)
editableTabsValue.value = newTabName
dialogVisibleName.value = false
} else {
console.log('error submit!')
return false
1 year ago
}
})
}
// 关闭
else if (val == 'close') {
dialogVisibleName.value = false
}
}
const buttonBaseClick = (val) => {
// 保存
if (val == 'save') {
submitForm()
}
// 关闭
else if (val == 'close') {
dialogVisible.value = false
}
}
1 year ago
// 传递给父类
const emit = defineEmits(['submitForm', 'searchTableSuccess'])
const validateForm = (formRef) => {
// console.log(TableBaseForm_Ref.value)
let _lists = formRef?.map((v) => v.validate())
return Promise.all(_lists)
.then(() => {
return true
})
.catch(() => {
return false
})
}
1 year ago
1 year ago
const submitForm = async () => {
1 year ago
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(`请添加工序`)
1 year ago
return
1 year ago
}
const bol1 = await validateForm(formProcessRef.value)
const bol2 = await validateForm(formFeaturesRef.value)
if (!bol1 || !bol2) {
message.error(`模板中有检验工序和检验特性未填写完全`)
1 year ago
return
1 year ago
}
1 year ago
const arr = data.value.process.filter(
(item) =>
!item.inspectionCharacteristicsBaseVO.quantifyIsCapping &&
!item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit &&
!item.inspectionCharacteristicsBaseVO.quantifyIsTarget &&
item.inspectionCharacteristicsBaseVO.featureType == 0
)
1 year ago
console.log(arr)
1 year ago
if (arr && arr.length > 0) {
const str = arr.map((item) => item.description).join(',')
1 year ago
message.error(`${str}是否设定上线,是否设定下限,是否是定目标值至少一项为是`)
1 year ago
return
1 year ago
}
1 year ago
if (formType.value == 'create') {
// 主子表——提交请求
emit('submitForm', formType.value, data)
} else {
// 编辑
emit('submitForm', formType.value, data)
}
} catch {
console.log(111)
}
1 year ago
}
1 year ago
/** 弹窗按钮 */
let Butttondata: any = []
if (props.footButttondata) {
Butttondata = props.footButttondata
} else {
Butttondata = [
defaultButtons.formSaveBtn(null), // 保存
defaultButtons.formCloseBtn(null) // 关闭
]
}
1 year ago
// 选择特征类型
const changeFeatureType = (e) => {
console.log(e)
1 year ago
// if (e) {
// rules.value['inspectionCharacteristicsBaseVO.quantifyQuantifyCode'][0].required = true
// } else {
// rules.value['inspectionCharacteristicsBaseVO.quantifyQuantifyCode'][0].required = false
// }
1 year ago
}
const searchTableRef = ref()
const opensearchTable = (
formField,
searchField,
searchTitle,
searchAllSchemas,
searchPage,
searchCondition,
multiple,
type,
row
) => {
console.log(988, row)
const _searchCondition = {}
// 判断查询条件中,是否存在指向主表的数据
if (searchCondition && searchCondition.length > 0) {
// 转换筛选条件所需
let filters: any[] = []
for (var i = 0; i < searchCondition.length; i++) {
// searchCondition.forEach((item) => {
// 查询条件为主表某字段,需要赋值主表数据,数据来源是详情的,赋值需要从row中获取
if (searchCondition[i].isMainValue) {
_searchCondition[searchCondition[i].key] = formRef.value.formModel[searchCondition[i].value]
? formRef.value.formModel[searchCondition[i].value]
: props.detailData
? props.detailData[searchCondition[i].value]
: row
? row[searchCondition[i].value]
: ''
// 是否含有空参数情况
let isNull = false
if (
_searchCondition[searchCondition[i].key] == '' ||
_searchCondition[searchCondition[i].key] == undefined
) {
isNull = true
}
if (isNull) {
message.warning(
searchCondition[i].message ? searchCondition[i].message : '前置条件未选择!'
)
return
}
} else {
// 扩展 转换为筛选条件进行查询
if (searchCondition[i].isSearch) {
filters.push({
action: searchCondition[i].action,
column: searchCondition[i].key,
value: searchCondition[i].value
})
} else {
_searchCondition[searchCondition[i].key] = searchCondition[i].value
}
}
}
if (filters.length > 0) {
_searchCondition.isSearch = true
_searchCondition.filters = filters
}
}
const _searchTableTitle = searchTitle
const _searchTableAllSchemas = searchAllSchemas
const _searchTablePage = searchPage
searchTableRef.value.open(
_searchTableTitle,
_searchTableAllSchemas,
_searchTablePage,
formField,
searchField,
multiple,
type,
row,
_searchCondition
)
}
// 弹层确定返回所选数据
// val : 弹层列表row 数据
const searchTableSuccess = (formField, searchField, val, type, row) => {
console.log(row)
data.value.process.forEach((item) => {
if (item.description == row.description) {
item.inspectionCharacteristicsBaseVO[formField] = val[0].code
}
})
// row.inspectionCharacteristicsBaseVO.inspectionMethodCode = val[0].code
// 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
} else {
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false
}
}
// 选择是否设定目标值
const changeIsTarget = (e) => {
if (e) {
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true
} else {
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false
}
}
1 year ago
</script>
1 year ago
<style scoped>
1 year ago
.small-title {
font-weight: bold;
padding: 0px 10px 10px;
color: #1a8bfc;
font-size: 16px;
}
1 year ago
</style>
<style>
1 year ago
.el-tabs--left .el-tabs__header.is-left {
min-height: 700px !important;
1 year ago
min-width: 150px !important;
1 year ago
}
1 year ago
.el-tabs--left.el-tabs--border-card .el-tabs__item.is-left {
min-width: 120px !important;
1 year ago
}
</style>