|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<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">
|
|
|
|
<el-form :model="data" label-width="auto" :rules="rules" ref="formMainRef">
|
|
|
|
<el-row gutter="20">
|
|
|
|
<el-col :span="12" v-if="data.code">
|
|
|
|
<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="itemCode">
|
|
|
|
<div style="display: flex; width: 100%">
|
|
|
|
<el-input
|
|
|
|
v-model="data.itemCode"
|
|
|
|
placeholder="请选择物料编码"
|
|
|
|
@blur="onItemBlur('item', ItemBasicApi.getItembasicPage)"
|
|
|
|
@focus="onFocus"
|
|
|
|
/>
|
|
|
|
<el-button
|
|
|
|
type="info"
|
|
|
|
plain
|
|
|
|
style="width: 40px"
|
|
|
|
@click="
|
|
|
|
opensearchTable(
|
|
|
|
'itemCode',
|
|
|
|
null,
|
|
|
|
'物料编码',
|
|
|
|
Itembasic.allSchemas,
|
|
|
|
ItemBasicApi.getItembasicPage,
|
|
|
|
null,
|
|
|
|
false,
|
|
|
|
'main',
|
|
|
|
null
|
|
|
|
)
|
|
|
|
"
|
|
|
|
><Icon icon="ep:search" />
|
|
|
|
</el-button>
|
|
|
|
</div>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="品名" prop="itemName">
|
|
|
|
<div style="display: flex; width: 100%">
|
|
|
|
<el-input v-model="data.itemName" placeholder="请选择物料" disabled />
|
|
|
|
</div>
|
|
|
|
</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-col :span="12">
|
|
|
|
<el-form-item label="检验类型" prop="inspectionType">
|
|
|
|
<el-select v-model="data.inspectionType" placeholder="请选择检验类型">
|
|
|
|
<el-option
|
|
|
|
v-for="dict in getStrDictOptions(DICT_TYPE.INSPECTION_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="programmeTemplateCode">
|
|
|
|
<div style="display: flex; width: 100%">
|
|
|
|
<el-input
|
|
|
|
v-model="data.programmeTemplateCode"
|
|
|
|
placeholder="请选择检验模板"
|
|
|
|
@blur="
|
|
|
|
onBlur('programmeTemplate', InspectionTemplateApi.inspectionTemplatePage)
|
|
|
|
"
|
|
|
|
@focus="onFocus"
|
|
|
|
/>
|
|
|
|
<el-button
|
|
|
|
type="info"
|
|
|
|
plain
|
|
|
|
style="width: 40px"
|
|
|
|
@click="
|
|
|
|
opensearchTable(
|
|
|
|
'programmeTemplateCode',
|
|
|
|
null,
|
|
|
|
'检验模板',
|
|
|
|
InspectionTemplateMain.allSchemas,
|
|
|
|
InspectionTemplateApi.inspectionTemplatePage,
|
|
|
|
[
|
|
|
|
{
|
|
|
|
key: 'available',
|
|
|
|
value: 'TRUE',
|
|
|
|
isMainValue: false
|
|
|
|
}
|
|
|
|
],
|
|
|
|
false,
|
|
|
|
'main',
|
|
|
|
null
|
|
|
|
)
|
|
|
|
"
|
|
|
|
><Icon icon="ep:search" />
|
|
|
|
</el-button>
|
|
|
|
</div>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="检验模板描述" prop="programmeTemplateName">
|
|
|
|
<div style="display: flex; width: 100%">
|
|
|
|
<el-input
|
|
|
|
v-model="data.programmeTemplateName"
|
|
|
|
placeholder="请选择检验模板"
|
|
|
|
disabled
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="动态修改规则" prop="dynamicUpdateCode">
|
|
|
|
<div style="display: flex; width: 100%">
|
|
|
|
<el-input
|
|
|
|
v-model="data.dynamicUpdateCode"
|
|
|
|
placeholder="请选择动态修改规则"
|
|
|
|
@blur="onBlur('dynamicUpdate', DynamicRuleApi.getDynamicRulePage)"
|
|
|
|
@focus="onFocus"
|
|
|
|
/>
|
|
|
|
<el-button
|
|
|
|
type="info"
|
|
|
|
plain
|
|
|
|
style="width: 40px"
|
|
|
|
@click="
|
|
|
|
opensearchTable(
|
|
|
|
'dynamicUpdateCode',
|
|
|
|
null,
|
|
|
|
'动态修改规则',
|
|
|
|
DynamicRule.allSchemas,
|
|
|
|
DynamicRuleApi.getDynamicRulePage,
|
|
|
|
[
|
|
|
|
{
|
|
|
|
key: 'available',
|
|
|
|
value: 'TRUE',
|
|
|
|
isMainValue: false
|
|
|
|
}
|
|
|
|
],
|
|
|
|
false,
|
|
|
|
'main',
|
|
|
|
data
|
|
|
|
)
|
|
|
|
"
|
|
|
|
><Icon icon="ep:search"
|
|
|
|
/></el-button>
|
|
|
|
</div>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="动态修改规则描述" prop="dynamicUpdateName">
|
|
|
|
<div style="display: flex; width: 100%">
|
|
|
|
<el-input
|
|
|
|
v-model="data.dynamicUpdateName"
|
|
|
|
placeholder="请选择动态修改规则描述"
|
|
|
|
disabled
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<!-- <el-col :span="12">
|
|
|
|
<el-form-item label="拆分规则" prop="splitRule">
|
|
|
|
<el-select v-model="data.splitRule" placeholder="请选择拆分规则">
|
|
|
|
<el-option
|
|
|
|
v-for="dict in getStrDictOptions(DICT_TYPE.SPLIT_RULES)"
|
|
|
|
:key="dict.value"
|
|
|
|
:label="dict.label"
|
|
|
|
:value="dict.value"
|
|
|
|
/>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col> -->
|
|
|
|
<el-col :span="12" v-if="isShowField != 0">
|
|
|
|
<el-form-item label="aql" prop="aql">
|
|
|
|
<el-select v-model="data.aql" placeholder="请选择aql">
|
|
|
|
<el-option
|
|
|
|
v-for="dict in getStrDictOptions(DICT_TYPE.BASIC_AQL)"
|
|
|
|
:key="dict.value"
|
|
|
|
:label="dict.label"
|
|
|
|
:value="dict.value"
|
|
|
|
/>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12" v-if="isShowField != 0">
|
|
|
|
<el-form-item label="检验水平" prop="inspectionLevel">
|
|
|
|
<el-select v-model="data.inspectionLevel" placeholder="请选择检验水平">
|
|
|
|
<el-option
|
|
|
|
v-for="dict in getStrDictOptions(DICT_TYPE.INSPECTION_LEVEL)"
|
|
|
|
: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="samplePieceSize">
|
|
|
|
<el-input
|
|
|
|
v-model="data.samplePieceSize"
|
|
|
|
placeholder="请填写每份样品量"
|
|
|
|
:disabled="isSamplePieceSizeDisabled"
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="生效时间" prop="effectiveDate">
|
|
|
|
<el-date-picker
|
|
|
|
v-model="data.effectiveDate"
|
|
|
|
type="datetime"
|
|
|
|
placeholder="请选择生效时间"
|
|
|
|
style="width: 100%"
|
|
|
|
value-format="x"
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="失效时间" prop="expirationDate">
|
|
|
|
<el-date-picker
|
|
|
|
v-model="data.expirationDate"
|
|
|
|
type="datetime"
|
|
|
|
placeholder="请选择失效时间"
|
|
|
|
style="width: 100%"
|
|
|
|
value-format="x"
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<!-- <el-col :span="12">
|
|
|
|
<el-form-item label="是否可用" prop="available">
|
|
|
|
<el-switch v-model="data.available" active-value="TRUE" inactive-value="FALSE" />
|
|
|
|
</el-form-item>
|
|
|
|
</el-col> -->
|
|
|
|
</el-row>
|
|
|
|
</el-form>
|
|
|
|
<div class="main-body">
|
|
|
|
<div class="left">
|
|
|
|
<!-- <div class="plus-icon" @click="handleTabsEdit('', 'add')">
|
|
|
|
<el-icon><Plus /></el-icon>
|
|
|
|
</div> -->
|
|
|
|
<draggable
|
|
|
|
:list="data.process"
|
|
|
|
:disabled="!data.enabled"
|
|
|
|
item-key="name"
|
|
|
|
ghost-class="ghost"
|
|
|
|
chosen-class="chosen"
|
|
|
|
animation="300"
|
|
|
|
@change="handleChange"
|
|
|
|
>
|
|
|
|
<template #item="{ element, index }">
|
|
|
|
<div
|
|
|
|
class="tabs-label"
|
|
|
|
:class="element.name == editableTabsValue ? 'active' : ''"
|
|
|
|
@click.stop="chooseTabs(element, index)"
|
|
|
|
>
|
|
|
|
<span>{{ element.description }}</span>
|
|
|
|
<!-- <el-icon
|
|
|
|
color="#67C23A"
|
|
|
|
@click.stop="copy(element)"
|
|
|
|
style="margin-left: 10px; margin-right: 10px"
|
|
|
|
><CopyDocument
|
|
|
|
/></el-icon> -->
|
|
|
|
<el-icon color="#409efc" @click.stop="handleTabsEdit(element.name, 'remove')"
|
|
|
|
><Close
|
|
|
|
/></el-icon>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</draggable>
|
|
|
|
</div>
|
|
|
|
<div class="right">
|
|
|
|
<div v-for="(item, index) in data.process" :key="index">
|
|
|
|
<div v-show="item.name == editableTabsValue">
|
|
|
|
<div class="small-title">检验工序</div>
|
|
|
|
<el-form :model="item" label-width="auto" :rules="rules" ref="formProcessRef">
|
|
|
|
<el-row :gutter="20">
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="编码" prop="code">
|
|
|
|
<el-input v-model="item.code" placeholder="根据系统生成" :disabled="true" />
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="检验方案模板编码">
|
|
|
|
<el-input
|
|
|
|
v-model="item.inspectionCode"
|
|
|
|
placeholder="根据系统生成"
|
|
|
|
:disabled="true"
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="描述" prop="description">
|
|
|
|
<el-input v-model="item.description" />
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="顺序号" prop="sequenceCode">
|
|
|
|
<el-input v-model="item.sequenceCode" disabled/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="检验特性编码">
|
|
|
|
<el-input
|
|
|
|
v-model="item.inspectionCharCode"
|
|
|
|
placeholder="根据系统生成"
|
|
|
|
:disabled="true"
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
</el-form>
|
|
|
|
<div class="small-title">检验特性</div>
|
|
|
|
<el-form :model="item" label-width="auto" :rules="rules" ref="formFeaturesRef">
|
|
|
|
<el-row :gutter="20">
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="编码">
|
|
|
|
<el-input
|
|
|
|
v-model="item.inspectionCharacteristicsBaseVO.code"
|
|
|
|
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" />
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item
|
|
|
|
label="检验方法"
|
|
|
|
prop="inspectionCharacteristicsBaseVO.inspectionMethodCode"
|
|
|
|
>
|
|
|
|
<div style="display: flex; width: 100%">
|
|
|
|
<el-input
|
|
|
|
v-model="item.inspectionCharacteristicsBaseVO.inspectionMethodCode"
|
|
|
|
placeholder="请选择检验方法"
|
|
|
|
@blur="
|
|
|
|
onBlur(
|
|
|
|
'inspectionMethod',
|
|
|
|
InspectionMethodApi.getInspectionMethodPage,
|
|
|
|
item
|
|
|
|
)
|
|
|
|
"
|
|
|
|
@focus="onFocus"
|
|
|
|
/>
|
|
|
|
<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.inspectionMethodName"
|
|
|
|
>
|
|
|
|
<div style="display: flex; width: 100%">
|
|
|
|
<el-input
|
|
|
|
v-model="item.inspectionCharacteristicsBaseVO.inspectionMethodName"
|
|
|
|
disabled
|
|
|
|
placeholder="请选择检验方法"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item
|
|
|
|
label="采样过程"
|
|
|
|
prop="inspectionCharacteristicsBaseVO.samplingProcessCode"
|
|
|
|
>
|
|
|
|
<div style="display: flex; width: 100%">
|
|
|
|
<el-input
|
|
|
|
v-model="item.inspectionCharacteristicsBaseVO.samplingProcessCode"
|
|
|
|
placeholder="请选择采样过程"
|
|
|
|
@blur="
|
|
|
|
onBlur(
|
|
|
|
'samplingProcess',
|
|
|
|
SamplingProcessApi.getSamplingProcessPage,
|
|
|
|
item
|
|
|
|
)
|
|
|
|
"
|
|
|
|
@focus="onFocus"
|
|
|
|
/>
|
|
|
|
<el-button
|
|
|
|
type="info"
|
|
|
|
plain
|
|
|
|
style="width: 40px"
|
|
|
|
@click="
|
|
|
|
opensearchTable(
|
|
|
|
'samplingProcessCode',
|
|
|
|
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.inspectionMethodName"
|
|
|
|
>
|
|
|
|
<div style="display: flex; width: 100%">
|
|
|
|
<el-input
|
|
|
|
v-model="item.inspectionCharacteristicsBaseVO.inspectionMethodName"
|
|
|
|
disabled
|
|
|
|
placeholder="请选择采样过程描述"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item
|
|
|
|
label="是否允许修改特征值"
|
|
|
|
prop="inspectionCharacteristicsBaseVO.isCanUpdate"
|
|
|
|
>
|
|
|
|
<el-switch
|
|
|
|
v-model="item.inspectionCharacteristicsBaseVO.isCanUpdate"
|
|
|
|
disabled
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item
|
|
|
|
label="结果录入方式"
|
|
|
|
prop="inspectionCharacteristicsBaseVO.resultEntryMethod"
|
|
|
|
>
|
|
|
|
<el-select
|
|
|
|
v-model="item.inspectionCharacteristicsBaseVO.resultEntryMethod"
|
|
|
|
placeholder="请选择结果录入方式"
|
|
|
|
>
|
|
|
|
<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="inspectionCharacteristicsBaseVO.featureType"
|
|
|
|
>
|
|
|
|
<!-- <el-input v-model="item.featureType" /> -->
|
|
|
|
<el-select
|
|
|
|
v-model="item.inspectionCharacteristicsBaseVO.featureType"
|
|
|
|
placeholder="请选择特征类型"
|
|
|
|
@change="changeFeatureType($event, item)"
|
|
|
|
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
|
|
|
|
>
|
|
|
|
<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" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0">
|
|
|
|
<el-form-item
|
|
|
|
label="计量单位"
|
|
|
|
prop="inspectionCharacteristicsBaseVO.quantifyUom"
|
|
|
|
>
|
|
|
|
<el-input
|
|
|
|
v-model="item.inspectionCharacteristicsBaseVO.quantifyUom"
|
|
|
|
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0">
|
|
|
|
<el-form-item
|
|
|
|
label="小数位"
|
|
|
|
prop="inspectionCharacteristicsBaseVO.quantifyDecimal"
|
|
|
|
>
|
|
|
|
<el-input
|
|
|
|
v-model="item.inspectionCharacteristicsBaseVO.quantifyDecimal"
|
|
|
|
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
|
|
|
|
/>
|
|
|
|
</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($event, item)"
|
|
|
|
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0">
|
|
|
|
<el-form-item
|
|
|
|
prop="inspectionCharacteristicsBaseVO.quantifyIsLowlimit"
|
|
|
|
label="是否设定下限"
|
|
|
|
>
|
|
|
|
<el-switch
|
|
|
|
v-model="item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit"
|
|
|
|
@change="changeLowlimit($event, item)"
|
|
|
|
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0">
|
|
|
|
<el-form-item
|
|
|
|
prop="inspectionCharacteristicsBaseVO.quantifyIsTarget"
|
|
|
|
label="是否设定目标值"
|
|
|
|
>
|
|
|
|
<el-switch
|
|
|
|
v-model="item.inspectionCharacteristicsBaseVO.quantifyIsTarget"
|
|
|
|
@change="changeIsTarget($event, item)"
|
|
|
|
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col
|
|
|
|
:span="12"
|
|
|
|
v-if="
|
|
|
|
item.inspectionCharacteristicsBaseVO.featureType == 0 &&
|
|
|
|
item.inspectionCharacteristicsBaseVO.quantifyIsCapping
|
|
|
|
"
|
|
|
|
>
|
|
|
|
<el-form-item
|
|
|
|
label="上限值"
|
|
|
|
prop="inspectionCharacteristicsBaseVO.quantifyCapping"
|
|
|
|
>
|
|
|
|
<el-input
|
|
|
|
v-model="item.inspectionCharacteristicsBaseVO.quantifyCapping"
|
|
|
|
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
|
|
|
|
type="number"
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
<el-col
|
|
|
|
:span="12"
|
|
|
|
v-if="
|
|
|
|
item.inspectionCharacteristicsBaseVO.featureType == 0 &&
|
|
|
|
item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit
|
|
|
|
"
|
|
|
|
>
|
|
|
|
<el-form-item
|
|
|
|
label="下限值"
|
|
|
|
prop="inspectionCharacteristicsBaseVO.quantifyLowlimit"
|
|
|
|
>
|
|
|
|
<el-input
|
|
|
|
v-model="item.inspectionCharacteristicsBaseVO.quantifyLowlimit"
|
|
|
|
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
|
|
|
|
type="number"
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
<el-col
|
|
|
|
:span="12"
|
|
|
|
v-if="
|
|
|
|
item.inspectionCharacteristicsBaseVO.featureType == 0 &&
|
|
|
|
item.inspectionCharacteristicsBaseVO.quantifyIsTarget
|
|
|
|
"
|
|
|
|
>
|
|
|
|
<el-form-item
|
|
|
|
label="目标值"
|
|
|
|
prop="inspectionCharacteristicsBaseVO.quantifyTarget"
|
|
|
|
>
|
|
|
|
<el-input
|
|
|
|
v-model="item.inspectionCharacteristicsBaseVO.quantifyTarget"
|
|
|
|
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
|
|
|
|
type="number"
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
<el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 1">
|
|
|
|
<el-form-item
|
|
|
|
label="选定集"
|
|
|
|
prop="inspectionCharacteristicsBaseVO.quantifyQuantifyCode"
|
|
|
|
>
|
|
|
|
<div style="display: flex; width: 100%">
|
|
|
|
<el-input
|
|
|
|
v-model="item.inspectionCharacteristicsBaseVO.quantifyQuantifyCode"
|
|
|
|
placeholder="请选择选定集"
|
|
|
|
@blur="
|
|
|
|
onBlur('quantifyQuantify', SelectedSetApi.getSelectedSetPage, item)
|
|
|
|
"
|
|
|
|
@focus="onFocus"
|
|
|
|
/>
|
|
|
|
<el-button
|
|
|
|
type="info"
|
|
|
|
plain
|
|
|
|
style="width: 40px"
|
|
|
|
@click="
|
|
|
|
opensearchTable(
|
|
|
|
'quantifyQuantifyCode',
|
|
|
|
null,
|
|
|
|
'选定集',
|
|
|
|
SelectedSet.allSchemas,
|
|
|
|
SelectedSetApi.getSelectedSetPage,
|
|
|
|
[
|
|
|
|
{
|
|
|
|
key: 'available',
|
|
|
|
value: 'TRUE',
|
|
|
|
isMainValue: false
|
|
|
|
}
|
|
|
|
],
|
|
|
|
false,
|
|
|
|
'features',
|
|
|
|
item
|
|
|
|
)
|
|
|
|
"
|
|
|
|
v-if="item.inspectionCharacteristicsBaseVO.isCanUpdate"
|
|
|
|
><Icon icon="ep:search"
|
|
|
|
/></el-button>
|
|
|
|
</div>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 1">
|
|
|
|
<el-form-item
|
|
|
|
label="选定集描述"
|
|
|
|
prop="inspectionCharacteristicsBaseVO.quantifyQuantifyName"
|
|
|
|
>
|
|
|
|
<div style="display: flex; width: 100%">
|
|
|
|
<el-input
|
|
|
|
v-model="item.inspectionCharacteristicsBaseVO.quantifyQuantifyName"
|
|
|
|
disabled
|
|
|
|
placeholder="请选择选定集描述"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
</el-form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<template #footer>
|
|
|
|
<ButtonBase :Butttondata="Butttondata" @button-base-click="buttonBaseClick" :key="count" />
|
|
|
|
</template>
|
|
|
|
</Dialog>
|
|
|
|
<Dialog
|
|
|
|
title="修改名称"
|
|
|
|
v-model="dialogVisibleName"
|
|
|
|
width="500px"
|
|
|
|
:close-on-click-modal="false"
|
|
|
|
>
|
|
|
|
<div style="padding: 0px 20px">
|
|
|
|
<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>
|
|
|
|
</div>
|
|
|
|
<template #footer>
|
|
|
|
<ButtonBase :Butttondata="Butttondata" @button-base-click="buttonBaseClick1" />
|
|
|
|
</template>
|
|
|
|
</Dialog>
|
|
|
|
<SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess" />
|
|
|
|
</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 InspectionProcessPageApi from '@/api/qms/inspectionTemplate'
|
|
|
|
import { SearchTable } from '@/components/SearchTable'
|
|
|
|
import { SamplingProcess } from '@/views/qms/samplingProcess/samplingProcess.data'
|
|
|
|
import { InspectionTemplateMain } from '@/views/qms/inspectionTemplate/inspectionTemplate.data'
|
|
|
|
import * as InspectionTemplateApi from '@/api/qms/inspectionTemplate'
|
|
|
|
import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data'
|
|
|
|
import * as ItemBasicApi from '@/api/wms/itembasic'
|
|
|
|
import * as SamplingProcessApi from '@/api/qms/samplingProcess' //采样过程
|
|
|
|
import * as InspectionMethodApi from '@/api/qms/inspectionMethod' //检验方法
|
|
|
|
import { InspectionMethod } from '@/views/qms/inspectionMethod/inspectionMethod.data' //检验方法
|
|
|
|
import * as DynamicRuleApi from '@/api/qms/dynamicRule' //动态修改规则
|
|
|
|
import { DynamicRule } from '@/views/qms/dynamicRule/dynamicRule.data' //动态修改规则
|
|
|
|
import * as SelectedSetApi from '@/api/qms/selectedSet' //选择集
|
|
|
|
import { SelectedSet } from '@/views/qms/selectedSet/selectedSet.data' //选择集
|
|
|
|
import { validateInteger, validateMaxNumber5, validateTwoNum } from '@/utils/validator'
|
|
|
|
import { Plus, Close, CopyDocument } from '@element-plus/icons-vue'
|
|
|
|
import draggable from 'vuedraggable'
|
|
|
|
|
|
|
|
const message = useMessage() // 消息弹窗
|
|
|
|
|
|
|
|
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() // 国际化
|
|
|
|
|
|
|
|
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 data = ref({
|
|
|
|
enabled: true,
|
|
|
|
dragging: false,
|
|
|
|
code: '',
|
|
|
|
itemCode: '',
|
|
|
|
version: '',
|
|
|
|
inspectionType: '',
|
|
|
|
programmeTemplateCode: '',
|
|
|
|
splitRule: '',
|
|
|
|
aql: '',
|
|
|
|
inspectionLevel: '',
|
|
|
|
effectiveDate: '',
|
|
|
|
expirationDate: '',
|
|
|
|
available: 'TRUE',
|
|
|
|
dynamicUpdateCode: '',
|
|
|
|
description: '',
|
|
|
|
samplePieceSize: '',
|
|
|
|
uom: '',
|
|
|
|
process: []
|
|
|
|
})
|
|
|
|
|
|
|
|
const dialogVisibleName = ref(false)
|
|
|
|
const nameForm = ref({
|
|
|
|
name: ''
|
|
|
|
})
|
|
|
|
const nameRef = ref()
|
|
|
|
if (props.basicFormWidth) {
|
|
|
|
dialogWidth.value = props.basicFormWidth + '%'
|
|
|
|
} else {
|
|
|
|
dialogWidth.value = props.isBusiness ? '60%' : '40%'
|
|
|
|
}
|
|
|
|
const rules = ref({
|
|
|
|
itemCode: [{ required: true, message: '请选择物料', trigger: 'blur' }],
|
|
|
|
version: [{ required: true, message: '请填写版本', trigger: 'blur' }],
|
|
|
|
inspectionType: [{ required: true, message: '请选择检验类型', trigger: ['blur', 'change'] }],
|
|
|
|
programmeTemplateCode: [
|
|
|
|
{ required: true, message: '请选择检验模板', trigger: ['blur', 'change'] }
|
|
|
|
],
|
|
|
|
description: [{ required: false, message: '请选择描述', trigger: 'blur' }],
|
|
|
|
// splitRule: [{ required: true, message: '请选择拆分规则', trigger: ['blur', 'change'] }],
|
|
|
|
aql: [{ required: true, message: '请选择aql', trigger: ['blur', 'change'] }],
|
|
|
|
inspectionLevel: [{ required: true, message: '请选择检验水平', trigger: ['blur', 'change'] }],
|
|
|
|
samplePieceSize: [
|
|
|
|
{ required: true, message: '请输入每份样品量', trigger: ['blur', 'change'] },
|
|
|
|
{ validator: validateTwoNum, message: '小数点后最多2位', trigger: 'blur' }
|
|
|
|
],
|
|
|
|
|
|
|
|
effectiveDate: [{ required: true, message: '请选择生效时间', trigger: ['blur', 'change'] }],
|
|
|
|
expirationDate: [{ required: true, message: '请选择失效时间', trigger: ['blur', 'change'] }],
|
|
|
|
sequenceCode: [
|
|
|
|
{ required: true, message: '请填写顺序号', trigger: 'blur' },
|
|
|
|
{ validator: validateInteger, message: '请输入正确的整数', trigger: 'blur' }
|
|
|
|
],
|
|
|
|
'inspectionCharacteristicsBaseVO.description': [
|
|
|
|
{ required: true, message: '请填写描述', trigger: ['blur', 'change'] }
|
|
|
|
],
|
|
|
|
'inspectionCharacteristicsBaseVO.inspectionMethodCode': [
|
|
|
|
{ required: true, message: '请选择检验方法', trigger: 'blur' }
|
|
|
|
],
|
|
|
|
'inspectionCharacteristicsBaseVO.samplingProcessCode': [
|
|
|
|
{ required: true, message: '请选择采样过程', trigger: ['blur', 'change'] }
|
|
|
|
],
|
|
|
|
dynamicUpdateCode: [
|
|
|
|
{ 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', 'change'] }
|
|
|
|
],
|
|
|
|
'inspectionCharacteristicsBaseVO.quantifyLowlimit': [
|
|
|
|
{ required: true, message: '请输入下限值', trigger: 'blur' }
|
|
|
|
],
|
|
|
|
'inspectionCharacteristicsBaseVO.quantifyUom': [
|
|
|
|
{ required: true, message: '请选择计量单位', trigger: 'blur' }
|
|
|
|
],
|
|
|
|
'inspectionCharacteristicsBaseVO.quantifyDecimal': [
|
|
|
|
{ required: true, message: '请输入小数位', trigger: 'blur' },
|
|
|
|
{ validator: validateInteger, message: '请输入正确的整数', trigger: 'blur' },
|
|
|
|
{ validator: validateMaxNumber5, message: '不能大于5', trigger: 'blur' }
|
|
|
|
],
|
|
|
|
'inspectionCharacteristicsBaseVO.quantifyQuantifyCode': [
|
|
|
|
{ required: true, message: '请输入选定集', trigger: 'blur' }
|
|
|
|
]
|
|
|
|
})
|
|
|
|
const isShowField = ref(0) //是否显示aql和检验水平字段 0隐藏 大于0显示
|
|
|
|
/** 打开弹窗 */
|
|
|
|
const sequenceCode = ref(0)
|
|
|
|
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)
|
|
|
|
}
|
|
|
|
formType.value = type
|
|
|
|
isShowField.value = 0 //设置isShowField == 0隐藏aql和检验水平字段
|
|
|
|
if (row) {
|
|
|
|
data.value = JSON.parse(JSON.stringify(row))
|
|
|
|
data.value.enabled = true
|
|
|
|
data.value.dragging = false
|
|
|
|
// 如果点击复制进入
|
|
|
|
if (formType.value == 'create') {
|
|
|
|
data.value.id = ''
|
|
|
|
data.value.code = ''
|
|
|
|
data.value.itemCode = ''
|
|
|
|
data.value.process = []
|
|
|
|
let list = []
|
|
|
|
if (row.content) {
|
|
|
|
list = JSON.parse(row.content)
|
|
|
|
} else {
|
|
|
|
list = await InspectionProcessPageApi.getListByTempleteCode(row.programmeTemplateCode)
|
|
|
|
}
|
|
|
|
editableTabsValue.value = '1'
|
|
|
|
let arr = []
|
|
|
|
list.forEach((item, index) => {
|
|
|
|
let obj = {
|
|
|
|
inspectionCode: item.inspectionCode,
|
|
|
|
description: item.description,
|
|
|
|
inspectionCharCode: item.inspectionCharCode,
|
|
|
|
sequenceCode: item.sequenceCode,
|
|
|
|
name: String(index + 1),
|
|
|
|
inspectionCharacteristicsBaseVO: {
|
|
|
|
description: item.inspectionCharacteristicsBaseVO.description,
|
|
|
|
featureType: item.inspectionCharacteristicsBaseVO.featureType,
|
|
|
|
inspectionMethodCode: item.inspectionCharacteristicsBaseVO.inspectionMethodCode,
|
|
|
|
inspectionMethodName: item.inspectionCharacteristicsBaseVO.inspectionMethodName,
|
|
|
|
samplingProcessCode: item.inspectionCharacteristicsBaseVO.samplingProcessCode,
|
|
|
|
|
|
|
|
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
|
|
|
|
console.log(111, data.value)
|
|
|
|
} else {
|
|
|
|
let list = []
|
|
|
|
if (row.content) {
|
|
|
|
list = JSON.parse(row.content)
|
|
|
|
} else {
|
|
|
|
list = await InspectionProcessPageApi.getListByTempleteCode(row.programmeTemplateCode)
|
|
|
|
}
|
|
|
|
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false
|
|
|
|
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false
|
|
|
|
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false
|
|
|
|
editableTabsValue.value = '1'
|
|
|
|
list.forEach((item, index) => {
|
|
|
|
item.name = String(index + 1)
|
|
|
|
// 编辑判断上限下限目标值是否必填
|
|
|
|
if (
|
|
|
|
item.inspectionCharacteristicsBaseVO.featureType == 0 &&
|
|
|
|
item.inspectionCharacteristicsBaseVO.quantifyIsCapping
|
|
|
|
) {
|
|
|
|
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true
|
|
|
|
}
|
|
|
|
if (item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit) {
|
|
|
|
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true
|
|
|
|
}
|
|
|
|
if (item.inspectionCharacteristicsBaseVO.quantifyIsTarget) {
|
|
|
|
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true
|
|
|
|
}
|
|
|
|
if (item.inspectionCharacteristicsBaseVO.sampleType == 4) {
|
|
|
|
isShowField.value += 1 //设置isShowField > 0显示aql和检验水平字段
|
|
|
|
}
|
|
|
|
})
|
|
|
|
// 显示aql和检验水平字段的时候添加必填规则
|
|
|
|
if (isShowField.value > 0) {
|
|
|
|
rules.value.aql[0].required = true
|
|
|
|
rules.value.aql[0].required = true
|
|
|
|
} else {
|
|
|
|
rules.value.aql[0].required = false
|
|
|
|
rules.value.aql[0].required = false
|
|
|
|
}
|
|
|
|
data.value.process = list
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
data.value = {
|
|
|
|
enabled: true,
|
|
|
|
dragging: false,
|
|
|
|
code: '',
|
|
|
|
itemCode: '',
|
|
|
|
version: '',
|
|
|
|
inspectionType: '',
|
|
|
|
programmeTemplateCode: '',
|
|
|
|
splitRule: '',
|
|
|
|
aql: '',
|
|
|
|
inspectionLevel: '',
|
|
|
|
effectiveDate: '',
|
|
|
|
expirationDate: '',
|
|
|
|
available: 'TRUE',
|
|
|
|
dynamicUpdateCode: '',
|
|
|
|
description: '',
|
|
|
|
samplePieceSize: '',
|
|
|
|
uom: '',
|
|
|
|
process: []
|
|
|
|
}
|
|
|
|
}
|
|
|
|
sequenceCode.value = data.value.process.length + 1
|
|
|
|
}
|
|
|
|
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') => {
|
|
|
|
if (action === 'add') {
|
|
|
|
nameForm.value.name = ''
|
|
|
|
dialogVisibleName.value = true
|
|
|
|
sequenceCode.value = data.value.process.length + 1
|
|
|
|
} 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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
editableTabsValue.value = activeName
|
|
|
|
data.value.process = tabs.filter((tab) => tab.name !== targetName)
|
|
|
|
data.value.process.forEach((item, index) => {
|
|
|
|
item.sequenceCode = index + 1
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/** 修改名称时间 */
|
|
|
|
const buttonBaseClick1 = (val) => {
|
|
|
|
// 保存
|
|
|
|
if (val == 'save') {
|
|
|
|
if (!nameRef.value) return
|
|
|
|
nameRef.value.validate((valid, fields) => {
|
|
|
|
if (valid) {
|
|
|
|
let newTabName = 1
|
|
|
|
if (data.value.process && data.value.process.length > 0) {
|
|
|
|
newTabName = data.value.process[data.value.process.length - 1].name + 1
|
|
|
|
}
|
|
|
|
let obj = {
|
|
|
|
description: nameForm.value.name,
|
|
|
|
name: newTabName,
|
|
|
|
inspectionCode: '',
|
|
|
|
sequenceCode: '',
|
|
|
|
dynamicUpdateCode: '',
|
|
|
|
inspectionCharCode: '',
|
|
|
|
inspectionCharacteristicsBaseVO: {
|
|
|
|
describe: '',
|
|
|
|
inspectionMethodCode: '',
|
|
|
|
dynamicUpdateCode: '',
|
|
|
|
inspectionMethod: '',
|
|
|
|
isCanUpdate: true,
|
|
|
|
isDestructionInspection: '',
|
|
|
|
resultEntryMethod: '',
|
|
|
|
featureType: '',
|
|
|
|
quantifyIsCapping: false,
|
|
|
|
quantifyIsLowlimit: false,
|
|
|
|
quantifyIsTarget: false,
|
|
|
|
quantifyTarget: '',
|
|
|
|
quantifyCapping: '',
|
|
|
|
quantifyLowlimit: '',
|
|
|
|
quantifyUom: '',
|
|
|
|
quantifyDecimal: '',
|
|
|
|
quantifyQuantifyCode: ''
|
|
|
|
}
|
|
|
|
}
|
|
|
|
data.value.process.push(obj)
|
|
|
|
editableTabsValue.value = newTabName
|
|
|
|
dialogVisibleName.value = false
|
|
|
|
} else {
|
|
|
|
console.log('error submit!')
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
// 关闭
|
|
|
|
else if (val == 'close') {
|
|
|
|
dialogVisibleName.value = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const buttonBaseClick = (val) => {
|
|
|
|
// 保存
|
|
|
|
if (val == 'save') {
|
|
|
|
submitForm()
|
|
|
|
}
|
|
|
|
// 关闭
|
|
|
|
else if (val == 'close') {
|
|
|
|
dialogVisible.value = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 传递给父类
|
|
|
|
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
|
|
|
|
})
|
|
|
|
}
|
|
|
|
// 判断对象数组是否有相同属性 相同:true \ 不相同:false
|
|
|
|
const hasDuplicates = (array) => {
|
|
|
|
const seen = new Set()
|
|
|
|
const repeatCode = new Set()
|
|
|
|
let arr = array.map((item) => parseInt(item.sequenceCode))
|
|
|
|
arr.forEach((item) => {
|
|
|
|
if (seen.has(item)) {
|
|
|
|
repeatCode.add(item)
|
|
|
|
} else {
|
|
|
|
seen.add(item)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
const arr1 = Array.from(repeatCode)
|
|
|
|
if (arr1.length > 0) {
|
|
|
|
return true
|
|
|
|
} else {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const submitForm = async () => {
|
|
|
|
try {
|
|
|
|
const aa = await getStrDictOptions(DICT_TYPE.SPLIT_RULES) //拆分规则隐藏默认给第一字典值
|
|
|
|
data.value.splitRule = aa[0].value
|
|
|
|
const validateForm1 = await validateForm(formProcessRef.value)
|
|
|
|
await formMainRef.value.validate()
|
|
|
|
if (!data.value.process || data.value.process.length == 0) {
|
|
|
|
message.error(`请添加工序`)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
// debugger
|
|
|
|
if (hasDuplicates(data.value.process)) {
|
|
|
|
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(data.value.process)
|
|
|
|
const arr1 = data.value.process.filter(
|
|
|
|
(item) =>
|
|
|
|
((item.inspectionCharacteristicsBaseVO.quantifyIsCapping &&
|
|
|
|
String(item.inspectionCharacteristicsBaseVO.quantifyCapping).split('.')[1]?.length >
|
|
|
|
Number(item.inspectionCharacteristicsBaseVO.quantifyDecimal)) ||
|
|
|
|
(item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit &&
|
|
|
|
String(item.inspectionCharacteristicsBaseVO.quantifyLowlimit).split('.')[1]?.length >
|
|
|
|
Number(item.inspectionCharacteristicsBaseVO.quantifyDecimal)) ||
|
|
|
|
(item.inspectionCharacteristicsBaseVO.quantifyIsTarget &&
|
|
|
|
String(item.inspectionCharacteristicsBaseVO.quantifyTarget).split('.')[1]?.length >
|
|
|
|
Number(item.inspectionCharacteristicsBaseVO.quantifyDecimal))) &&
|
|
|
|
item.inspectionCharacteristicsBaseVO.featureType == 0
|
|
|
|
)
|
|
|
|
if (arr1 && arr1.length > 0) {
|
|
|
|
const str = arr1.map((item) => item.description).join(',')
|
|
|
|
message.error(`${str}工序上限值,下限值,目标值小数位数不可以大于小数位`)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
// 检验上限值应大目标值大于下限值
|
|
|
|
const arr2 = data.value.process.filter((item) => {
|
|
|
|
// 上限值存在并且下限值存在时,目标值不存在,上限值应大于下限值
|
|
|
|
return (
|
|
|
|
(item.inspectionCharacteristicsBaseVO.quantifyIsCapping &&
|
|
|
|
item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit &&
|
|
|
|
!item.inspectionCharacteristicsBaseVO.quantifyIsTarget &&
|
|
|
|
parseFloat(item.inspectionCharacteristicsBaseVO.quantifyCapping) <=
|
|
|
|
parseFloat(item.inspectionCharacteristicsBaseVO.quantifyLowlimit)) ||
|
|
|
|
// 上限值存在并且目标值存在时,下限值不存在,上限值应大于目标值
|
|
|
|
(item.inspectionCharacteristicsBaseVO.quantifyIsCapping &&
|
|
|
|
item.inspectionCharacteristicsBaseVO.quantifyIsTarget &&
|
|
|
|
!item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit &&
|
|
|
|
parseFloat(item.inspectionCharacteristicsBaseVO.quantifyCapping) <=
|
|
|
|
parseFloat(item.inspectionCharacteristicsBaseVO.quantifyTarget)) ||
|
|
|
|
// 下限值存在并且目标值存在时,上限值不存在,下限值应小于目标值
|
|
|
|
(item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit &&
|
|
|
|
item.inspectionCharacteristicsBaseVO.quantifyIsTarget &&
|
|
|
|
!item.inspectionCharacteristicsBaseVO.quantifyIsCapping &&
|
|
|
|
parseFloat(item.inspectionCharacteristicsBaseVO.quantifyLowlimit) >=
|
|
|
|
parseFloat(item.inspectionCharacteristicsBaseVO.quantifyTarget)) ||
|
|
|
|
// 上限值,下限值,目标值都存在时,上限值应大于目标值大于下限值
|
|
|
|
(item.inspectionCharacteristicsBaseVO.quantifyIsCapping &&
|
|
|
|
item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit &&
|
|
|
|
item.inspectionCharacteristicsBaseVO.quantifyIsTarget &&
|
|
|
|
(parseFloat(item.inspectionCharacteristicsBaseVO.quantifyCapping) <=
|
|
|
|
parseFloat(item.inspectionCharacteristicsBaseVO.quantifyLowlimit) ||
|
|
|
|
parseFloat(item.inspectionCharacteristicsBaseVO.quantifyCapping) <=
|
|
|
|
parseFloat(item.inspectionCharacteristicsBaseVO.quantifyTarget) ||
|
|
|
|
parseFloat(item.inspectionCharacteristicsBaseVO.quantifyLowlimit) >=
|
|
|
|
parseFloat(item.inspectionCharacteristicsBaseVO.quantifyTarget)))
|
|
|
|
)
|
|
|
|
})
|
|
|
|
if (arr2 && arr2.length > 0) {
|
|
|
|
const str = arr2.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 {
|
|
|
|
console.log(111)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/** 弹窗按钮 */
|
|
|
|
let Butttondata: any = []
|
|
|
|
if (props.footButttondata) {
|
|
|
|
Butttondata = props.footButttondata
|
|
|
|
} else {
|
|
|
|
Butttondata = [
|
|
|
|
defaultButtons.formSaveBtn(null), // 保存
|
|
|
|
defaultButtons.formCloseBtn(null) // 关闭
|
|
|
|
]
|
|
|
|
}
|
|
|
|
// 选择特征类型
|
|
|
|
const changeFeatureType = (e, item) => {
|
|
|
|
item.inspectionCharacteristicsBaseVO.quantifyIsCapping = false
|
|
|
|
item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit = false
|
|
|
|
item.inspectionCharacteristicsBaseVO.quantifyIsTarget = false
|
|
|
|
item.inspectionCharacteristicsBaseVO.quantifyCapping = ''
|
|
|
|
item.inspectionCharacteristicsBaseVO.quantifyLowlimit = ''
|
|
|
|
item.inspectionCharacteristicsBaseVO.quantifyTarget = ''
|
|
|
|
item.inspectionCharacteristicsBaseVO.quantifyQuantifyCode = ''
|
|
|
|
item.inspectionCharacteristicsBaseVO.quantifyQuantifyName = ''
|
|
|
|
console.log(e)
|
|
|
|
if (e) {
|
|
|
|
rules.value['inspectionCharacteristicsBaseVO.quantifyQuantifyCode'][0].required = true
|
|
|
|
} else {
|
|
|
|
rules.value['inspectionCharacteristicsBaseVO.quantifyQuantifyCode'][0].required = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const searchTableRef = ref()
|
|
|
|
const opensearchTable = (
|
|
|
|
formField,
|
|
|
|
searchField,
|
|
|
|
searchTitle,
|
|
|
|
searchAllSchemas,
|
|
|
|
searchPage,
|
|
|
|
searchCondition,
|
|
|
|
multiple,
|
|
|
|
type,
|
|
|
|
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
|
|
|
|
)
|
|
|
|
}
|
|
|
|
const isSamplePieceSizeDisabled = ref(false) //判断每份样品朗是否可输入
|
|
|
|
// 弹层确定返回所选数据
|
|
|
|
// val : 弹层列表row 数据
|
|
|
|
const searchTableSuccess = async (formField, searchField, val, type, row) => {
|
|
|
|
if (type == 'features') {
|
|
|
|
row.inspectionCharacteristicsBaseVO[formField] = val[0].code
|
|
|
|
if (formField == 'inspectionMethodCode') {
|
|
|
|
row.inspectionCharacteristicsBaseVO.inspectionMethodName = val[0].description
|
|
|
|
}
|
|
|
|
// else if(formField == 'dynamicUpdateCode'){
|
|
|
|
// row.inspectionCharacteristicsBaseVO.dynamicUpdateName = val[0].description
|
|
|
|
// }
|
|
|
|
else if (formField == 'samplingProcessCode') {
|
|
|
|
row.inspectionCharacteristicsBaseVO.samplingProcessName = val[0].description
|
|
|
|
} else if (formField == 'quantifyQuantifyCode') {
|
|
|
|
row.inspectionCharacteristicsBaseVO.quantifyQuantifyName = val[0].description
|
|
|
|
}
|
|
|
|
} else if (type == 'main') {
|
|
|
|
data.value[formField] = val[0].code
|
|
|
|
if (formField == 'itemCode') {
|
|
|
|
data.value.itemName = val[0].name
|
|
|
|
data.value.uom = val[0].uom
|
|
|
|
if (data.value.uom == 'EA') {
|
|
|
|
data.value.samplePieceSize = 1
|
|
|
|
isSamplePieceSizeDisabled.value = true
|
|
|
|
} else {
|
|
|
|
data.value.samplePieceSize = 1
|
|
|
|
isSamplePieceSizeDisabled.value = false
|
|
|
|
}
|
|
|
|
// data.value.description = val[0].desc1
|
|
|
|
} else if (formField == 'inspectionType') {
|
|
|
|
data.value.testTypeName = val[0].description
|
|
|
|
} else if (formField == 'programmeTemplateCode') {
|
|
|
|
isShowField.value = 0 //设置isShowField == 0隐藏aql和检验水平字段
|
|
|
|
data.value.programmeTemplateName = val[0].description
|
|
|
|
data.value['dynamicUpdateCode'] = val[0].dynamicUpdateCode
|
|
|
|
data.value.dynamicUpdateName = val[0].dynamicUpdateName
|
|
|
|
let list = await InspectionProcessPageApi.getListByTempleteCode(val[0].code)
|
|
|
|
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false
|
|
|
|
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false
|
|
|
|
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false
|
|
|
|
list.forEach((item, index) => {
|
|
|
|
editableTabsValue.value = index + 1
|
|
|
|
item.name = index + 1
|
|
|
|
// rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true
|
|
|
|
// 编辑判断上限下限目标值是否必填
|
|
|
|
if (
|
|
|
|
item.inspectionCharacteristicsBaseVO.featureType == 0 &&
|
|
|
|
item.inspectionCharacteristicsBaseVO.quantifyIsCapping
|
|
|
|
) {
|
|
|
|
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true
|
|
|
|
}
|
|
|
|
if (item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit) {
|
|
|
|
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true
|
|
|
|
}
|
|
|
|
if (item.inspectionCharacteristicsBaseVO.quantifyIsTarget) {
|
|
|
|
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true
|
|
|
|
}
|
|
|
|
if (item.inspectionCharacteristicsBaseVO.sampleType == 4) {
|
|
|
|
isShowField.value += 1 //设置isShowField > 0显示aql和检验水平字段
|
|
|
|
}
|
|
|
|
})
|
|
|
|
// 显示aql和检验水平字段的时候添加必填规则
|
|
|
|
if (isShowField.value > 0) {
|
|
|
|
rules.value.aql[0].required = true
|
|
|
|
rules.value.aql[0].required = true
|
|
|
|
} else {
|
|
|
|
rules.value.aql[0].required = false
|
|
|
|
rules.value.aql[0].required = false
|
|
|
|
}
|
|
|
|
data.value.process = list
|
|
|
|
} else if (formField == 'dynamicUpdateCode') {
|
|
|
|
data.value[formField] = val[0].code
|
|
|
|
data.value.dynamicUpdateName = val[0].description
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// emit('searchTableSuccess', formField, searchField, val, formRef.value, type, row)
|
|
|
|
}
|
|
|
|
// 选择是否设定上限值
|
|
|
|
const changeIsCapping = (e, item) => {
|
|
|
|
item.inspectionCharacteristicsBaseVO.quantifyCapping = ''
|
|
|
|
if (e) {
|
|
|
|
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true
|
|
|
|
} else {
|
|
|
|
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 选择是否设定下限值
|
|
|
|
const changeLowlimit = (e, item) => {
|
|
|
|
item.inspectionCharacteristicsBaseVO.quantifyLowlimit = ''
|
|
|
|
if (e) {
|
|
|
|
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true
|
|
|
|
} else {
|
|
|
|
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 选择是否设定目标值
|
|
|
|
const changeIsTarget = (e, item) => {
|
|
|
|
item.inspectionCharacteristicsBaseVO.quantifyTarget = ''
|
|
|
|
if (e) {
|
|
|
|
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true
|
|
|
|
} else {
|
|
|
|
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 物料失去焦点校验
|
|
|
|
const onItemBlur = async (field, pageApi, item) => {
|
|
|
|
const dataObj = item ? item.inspectionCharacteristicsBaseVO : data.value
|
|
|
|
if (dataObj[field + 'Code']) {
|
|
|
|
const _searchCondition = {}
|
|
|
|
const filters: any[] = []
|
|
|
|
filters.push(
|
|
|
|
{
|
|
|
|
action: '==',
|
|
|
|
column: 'available',
|
|
|
|
value: 'TRUE'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
column: 'code',
|
|
|
|
action: '==',
|
|
|
|
value: dataObj[field + 'Code']?.trim()
|
|
|
|
}
|
|
|
|
)
|
|
|
|
// 参数整理
|
|
|
|
_searchCondition.isSearch = true
|
|
|
|
_searchCondition.filters = filters
|
|
|
|
const array = await pageApi(_searchCondition)
|
|
|
|
Butttondata = [
|
|
|
|
defaultButtons.formSaveBtn(null), // 保存
|
|
|
|
defaultButtons.formCloseBtn(null) // 关闭
|
|
|
|
]
|
|
|
|
count.value++
|
|
|
|
const obj = array.list[0]
|
|
|
|
if (obj) {
|
|
|
|
dataObj['itemName'] = obj.name
|
|
|
|
// dataObj['description'] = obj.desc1
|
|
|
|
} else {
|
|
|
|
message.alert('暂无数据')
|
|
|
|
dataObj[field + 'Code'] = ''
|
|
|
|
dataObj[field + 'Name'] = ''
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
dataObj[field + 'Name'] = ''
|
|
|
|
Butttondata = [
|
|
|
|
defaultButtons.formSaveBtn(null), // 保存
|
|
|
|
defaultButtons.formCloseBtn(null) // 关闭
|
|
|
|
]
|
|
|
|
count.value++
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//失去焦点
|
|
|
|
const onBlur = async (field, pageApi, item) => {
|
|
|
|
const dataObj = item ? item.inspectionCharacteristicsBaseVO : data.value
|
|
|
|
if (dataObj[field + 'Code']) {
|
|
|
|
const _searchCondition = {}
|
|
|
|
const filters: any[] = []
|
|
|
|
filters.push(
|
|
|
|
{
|
|
|
|
action: '==',
|
|
|
|
column: 'available',
|
|
|
|
value: 'TRUE'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
column: 'code',
|
|
|
|
action: '==',
|
|
|
|
value: dataObj[field + 'Code']?.trim()
|
|
|
|
}
|
|
|
|
)
|
|
|
|
// 参数整理
|
|
|
|
_searchCondition.isSearch = true
|
|
|
|
_searchCondition.filters = filters
|
|
|
|
const array = await pageApi(_searchCondition)
|
|
|
|
Butttondata = [
|
|
|
|
defaultButtons.formSaveBtn(null), // 保存
|
|
|
|
defaultButtons.formCloseBtn(null) // 关闭
|
|
|
|
]
|
|
|
|
count.value++
|
|
|
|
const obj = array.list[0]
|
|
|
|
if (obj) {
|
|
|
|
dataObj[field + 'Name'] = obj.description
|
|
|
|
} else {
|
|
|
|
message.alert('暂无数据')
|
|
|
|
dataObj[field + 'Code'] = ''
|
|
|
|
dataObj[field + 'Name'] = ''
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
dataObj[field + 'Name'] = ''
|
|
|
|
Butttondata = [
|
|
|
|
defaultButtons.formSaveBtn(null), // 保存
|
|
|
|
defaultButtons.formCloseBtn(null) // 关闭
|
|
|
|
]
|
|
|
|
count.value++
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const count = ref(0)
|
|
|
|
// 聚焦的时候不可以保存
|
|
|
|
const onFocus = () => {
|
|
|
|
Butttondata = [
|
|
|
|
defaultButtons.formSaveBtn({ disabled: true }), // 保存
|
|
|
|
defaultButtons.formCloseBtn(null) // 关闭
|
|
|
|
]
|
|
|
|
count.value++
|
|
|
|
}
|
|
|
|
const chooseTabs = (element, index) => {
|
|
|
|
if (element.name == editableTabsValue.value) return
|
|
|
|
editableTabsValue.value = element.name
|
|
|
|
}
|
|
|
|
const handleChange = (e) => {
|
|
|
|
editableTabsValue.value = e.moved.element.name
|
|
|
|
data.value.process.forEach((item, index) => {
|
|
|
|
item.sequenceCode = index + 1
|
|
|
|
})
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
<style scoped>
|
|
|
|
.small-title {
|
|
|
|
font-weight: bold;
|
|
|
|
padding: 0px 10px 10px;
|
|
|
|
color: #1a8bfc;
|
|
|
|
font-size: 16px;
|
|
|
|
}
|
|
|
|
.main-body {
|
|
|
|
display: flex;
|
|
|
|
.left {
|
|
|
|
width: 200px;
|
|
|
|
background: rgb(245, 247, 250);
|
|
|
|
border: 1px solid rgb(220, 223, 230);
|
|
|
|
min-height: 60px;
|
|
|
|
position: relative;
|
|
|
|
padding: 6px 0px;
|
|
|
|
.plus-icon {
|
|
|
|
cursor: pointer;
|
|
|
|
position: absolute;
|
|
|
|
right: 0px;
|
|
|
|
top: 0px;
|
|
|
|
border: 1px solid rgb(220, 223, 230);
|
|
|
|
background: rgb(245, 247, 250);
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-items: center;
|
|
|
|
padding: 1px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.tabs-label {
|
|
|
|
padding: 4px 20px 4px 20px;
|
|
|
|
min-height: 30px;
|
|
|
|
justify-content: flex-end;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
cursor: pointer;
|
|
|
|
word-break: break-all;
|
|
|
|
}
|
|
|
|
.active {
|
|
|
|
background: white;
|
|
|
|
}
|
|
|
|
.right {
|
|
|
|
border: 1px solid rgb(220, 223, 230);
|
|
|
|
flex: 1;
|
|
|
|
width: 0px;
|
|
|
|
padding: 20px;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
<style>
|
|
|
|
.el-tabs--left .el-tabs__header.is-left {
|
|
|
|
padding-bottom: 5000px;
|
|
|
|
margin-bottom: -5000px;
|
|
|
|
min-width: 150px !important;
|
|
|
|
}
|
|
|
|
.el-tabs--left.el-tabs--border-card .el-tabs__item.is-left {
|
|
|
|
min-width: 120px !important;
|
|
|
|
}
|
|
|
|
</style>
|