Browse Source

检验方案失去焦点

hella_online_20240829
zhang_li 4 months ago
parent
commit
162a6173eb
  1. 193
      src/views/qms/inspectionScheme/addForm.vue
  2. 23
      src/views/qms/inspectionTemplate/addForm.vue

193
src/views/qms/inspectionScheme/addForm.vue

@ -18,7 +18,12 @@
<el-col :span="12">
<el-form-item label="物料编码" prop="itemCode">
<div style="display: flex; width: 100%">
<el-input v-model="data.itemCode" disabled placeholder="请选择物料编码" />
<el-input
v-model="data.itemCode"
placeholder="请选择物料编码"
@blur="onBlur('item', ItemBasicApi.getItembasicPage)"
@focus="onFocus"
/>
<el-button
type="info"
plain
@ -41,6 +46,13 @@
</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="请填写描述" />
@ -53,28 +65,6 @@
</el-col>
<el-col :span="12">
<el-form-item label="检验类型" prop="inspectionType">
<!-- <div style="display: flex; width: 100%">
<el-input v-model="data.testTypeName" disabled placeholder="请选择检验类型" />
<el-button
type="info"
plain
style="width: 40px"
@click="
opensearchTable(
'testTypeCode',
null,
'检验类型',
SamplingProcess.allSchemas,
SamplingProcessApi.getSamplingProcessPage,
null,
false,
'main',
null
)
"
><Icon icon="ep:search" />
</el-button>
</div> -->
<el-select v-model="data.inspectionType" placeholder="请选择检验类型">
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.INSPECTION_TYPE)"
@ -89,9 +79,12 @@
<el-form-item label="检验模板" prop="programmeTemplateCode">
<div style="display: flex; width: 100%">
<el-input
v-model="data.programmeTemplateName"
disabled
v-model="data.programmeTemplateCode"
placeholder="请选择检验模板"
@blur="
onBlur('programmeTemplateCode', InspectionTemplateApi.inspectionTemplatePage)
"
@focus="onFocus"
/>
<el-button
type="info"
@ -122,12 +115,24 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="动态修改规则" prop="dynamicUpdateCode">
<el-form-item label="检验模板描述" prop="programmeTemplateName">
<div style="display: flex; width: 100%">
<el-input
v-model="data.dynamicUpdateName"
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"
@ -157,6 +162,17 @@
</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="请选择拆分规则">
@ -344,9 +360,16 @@
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionCharacteristicsBaseVO.inspectionMethodName"
disabled
v-model="item.inspectionCharacteristicsBaseVO.inspectionMethodCode"
placeholder="请选择检验方法"
@blur="
onBlur(
'inspectionMethod',
InspectionMethodApi.getInspectionMethodPage,
item
)
"
@focus="onFocus"
/>
<el-button
type="info"
@ -376,6 +399,20 @@
</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="采样过程"
@ -383,9 +420,12 @@
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionCharacteristicsBaseVO.samplingProcessName"
disabled
v-model="item.inspectionCharacteristicsBaseVO.samplingProcessCode"
placeholder="请选择采样过程"
@blur="
onBlur('samplingProcess', SamplingProcessApi.getSamplingProcessPage, item)
"
@focus="onFocus"
/>
<el-button
type="info"
@ -415,6 +455,20 @@
</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="是否允许修改特征值"
@ -586,8 +640,9 @@
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionCharacteristicsBaseVO.quantifyQuantifyCode"
disabled
placeholder="请选择选定集"
@blur="onBlur('quantifyQuantify', SelectedSetApi.getSelectedSetPage, item)"
@focus="onFocus"
/>
<el-button
type="info"
@ -618,13 +673,27 @@
</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>
</el-tab-pane>
</el-tabs>
</div>
<template #footer>
<ButtonBase :Butttondata="Butttondata" @button-base-click="buttonBaseClick" />
<ButtonBase :Butttondata="Butttondata" @button-base-click="buttonBaseClick" :key="count" />
</template>
</Dialog>
<Dialog
@ -861,7 +930,7 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
quantifyUom: item.inspectionCharacteristicsBaseVO.quantifyUom,
resultEntryMethod: item.inspectionCharacteristicsBaseVO.resultEntryMethod,
samplingProcessCode: item.inspectionCharacteristicsBaseVO.samplingProcessCode,
samplingProcessName:item.inspectionCharacteristicsBaseVO.samplingProcessName,
samplingProcessName: item.inspectionCharacteristicsBaseVO.samplingProcessName
}
}
@ -925,9 +994,6 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
}
data.value.process = list
}
} else {
data.value = {
code: '',
@ -1382,6 +1448,59 @@ const changeIsTarget = (e, item) => {
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false
}
}
//
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++
}
</script>
<style scoped>
.small-title {

23
src/views/qms/inspectionTemplate/addForm.vue

@ -31,8 +31,8 @@
<el-input
v-model="data.dynamicUpdateCode"
placeholder="请选择动态修改规则编码"
@blur="mainblur('dynamicUpdate', DynamicRuleApi.getDynamicRulePage)"
@focus="mainFocus"
@blur="onBlur('dynamicUpdate', DynamicRuleApi.getDynamicRulePage)"
@focus="onFocus"
/>
<el-button
type="info"
@ -173,13 +173,13 @@
v-model="item.inspectionCharacteristicsBaseVO.inspectionMethodCode"
placeholder="请选择检验方法编码"
@blur="
mainblur(
onBlur(
'inspectionMethod',
InspectionMethodApi.getInspectionMethodPage,
item
)
"
@focus="mainFocus"
@focus="onFocus"
/>
<el-button
type="info"
@ -233,9 +233,9 @@
v-model="item.inspectionCharacteristicsBaseVO.samplingProcessCode"
placeholder="请选择采样过程"
@blur="
mainblur('samplingProcess', SamplingProcessApi.getSamplingProcessPage, item)
onBlur('samplingProcess', SamplingProcessApi.getSamplingProcessPage, item)
"
@focus="mainFocus"
@focus="onFocus"
/>
<el-button
type="info"
@ -446,8 +446,8 @@
<el-input
v-model="item.inspectionCharacteristicsBaseVO.quantifyQuantifyCode"
placeholder="请选择选定集"
@blur="mainblur('quantifyQuantify', SelectedSetApi.getSelectedSetPage, item)"
@focus="mainFocus"
@blur="onBlur('quantifyQuantify', SelectedSetApi.getSelectedSetPage, item)"
@focus="onFocus"
/>
<el-button
type="info"
@ -1152,8 +1152,8 @@ const copy = (item) => {
data.value.process.push(newItem)
editableTabsValue.value = newItem.name
}
//
const mainblur = async (field, pageApi, item) => {
//
const onBlur = async (field, pageApi, item) => {
const dataObj = item ? item.inspectionCharacteristicsBaseVO : data.value
if (dataObj[field + 'Code']) {
const _searchCondition = {}
@ -1197,7 +1197,8 @@ const mainblur = async (field, pageApi, item) => {
}
}
const count = ref(0)
const mainFocus = () => {
//
const onFocus = () => {
Butttondata = [
defaultButtons.formSaveBtn({ disabled: true }), //
defaultButtons.formCloseBtn(null) //

Loading…
Cancel
Save