Browse Source

feat:[模板管理][update]

lkf
luojie 3 months ago
parent
commit
bd1bcd5ea2
14 changed files with 387 additions and 338 deletions
  1. +14
    -14
      src/components/Template/BaseInfoFormPcakge.vue
  2. +9
    -0
      src/components/Template/CustomTable.vue
  3. +15
    -22
      src/components/Template/HandleFormItem.vue
  4. +4
    -2
      src/components/Template/Step.vue
  5. +2
    -0
      src/lang/en/template/commonTemplate.js
  6. +3
    -1
      src/lang/index.js
  7. +2
    -0
      src/lang/zh/template/commonTemplate.js
  8. +2
    -2
      src/views/business/comps/template/comps/sp/SWYPBQGZYZBB.vue
  9. +2
    -2
      src/views/business/comps/template/comps/sp/SWYPFXCBYPZB.vue
  10. +11
    -292
      src/views/business/comps/template/comps/sp/SWYPNBGZYZBB.vue
  11. +315
    -0
      src/views/business/comps/template/formConfig/paralleAndLadderConfig.js
  12. +6
    -0
      src/views/business/comps/template/mixins/paralleAndladderMixin.js
  13. +0
    -1
      src/views/business/comps/template/mixins/templateMixin.js
  14. +2
    -2
      vue.config.js

+ 14
- 14
src/components/Template/BaseInfoFormPcakge.vue View File

@ -39,7 +39,7 @@
</div> </div>
<div class="p-l-20"> <div class="p-l-20">
<div v-show="isShowOther(formFields[key])"> <div v-show="isShowOther(formFields[key])">
<div class="form-title">其他</div>
<div class="form-title">{{ $t("template.common.other") }}</div>
<div class="flex flex1"> <div class="flex flex1">
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey+'_'+sItem.otherCode" @blur="onBlur(key, $event)" :item="getOtherItem(sItem)" <HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey+'_'+sItem.otherCode" @blur="onBlur(key, $event)" :item="getOtherItem(sItem)"
v-model="formFields[sItem.otherCode]" @copy="onCopy(sItem, key)" v-model="formFields[sItem.otherCode]" @copy="onCopy(sItem, key)"
@ -82,6 +82,7 @@
</div> </div>
<div v-else-if="sItem.type === 'clickable'" class="flex1"> <div v-else-if="sItem.type === 'clickable'" class="flex1">
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey+'_'+key" type="clickable" @clickable="handleClickable(sItem, $event)" <HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey+'_'+key" type="clickable" @clickable="handleClickable(sItem, $event)"
:error="errors[key]" @update:error="errors[key] = false"
:item="sItem" :value="formFields[key]" /> :item="sItem" :value="formFields[key]" />
</div> </div>
@ -106,7 +107,7 @@
@change="onSelectChange(key, $event)" :error="errors[key]" @change="onSelectChange(key, $event)" :error="errors[key]"
@update:error="errors[key] = false" :orange-bg="orangeBgFields[key]" /> @update:error="errors[key] = false" :orange-bg="orangeBgFields[key]" />
<div v-show="isShowOther(formFields[key])" class="flex flex1"> <div v-show="isShowOther(formFields[key])" class="flex flex1">
<div class="other-title">其他</div>
<div class="other-title">{{ $t("template.common.other") }}</div>
<div class="flex"> <div class="flex">
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey+'_'+sItem.otherCode" @blur="onBlur(key, $event)" :item="getOtherItem(sItem)" <HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey+'_'+sItem.otherCode" @blur="onBlur(key, $event)" :item="getOtherItem(sItem)"
v-model="formFields[sItem.otherCode]" @copy="onCopy(sItem, key)" v-model="formFields[sItem.otherCode]" @copy="onCopy(sItem, key)"
@ -127,9 +128,10 @@
<div class="ml-10 item-span" v-else-if="sItem.subType === 'span'">{{ formFields[sItem.subKey] }}</div> <div class="ml-10 item-span" v-else-if="sItem.subType === 'span'">{{ formFields[sItem.subKey] }}</div>
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey+'_'+sItem.subKey" class="ml-10" v-else-if="sItem.subType === 'clickable'" type="clickable" <HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey+'_'+sItem.subKey" class="ml-10" v-else-if="sItem.subType === 'clickable'" type="clickable"
@clickable="handleClickable(sItem, $event)" :item="getClickableItem(sItem)" @clickable="handleClickable(sItem, $event)" :item="getClickableItem(sItem)"
:error="errors[sItem.subKey]" @update:error="errors[sItem.subKey] = false"
:value="formFields[sItem.subKey]" /> :value="formFields[sItem.subKey]" />
<div v-show="isShowOther(formFields[sItem.subKey])" class="flex flex1"> <div v-show="isShowOther(formFields[sItem.subKey])" class="flex flex1">
<div class="other-title">其他</div>
<div class="other-title">{{ $t("template.common.other") }}</div>
<div class="flex flex1"> <div class="flex flex1">
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey+'_'+sItem.otherCode" @blur="onBlur(key, $event)" :item="getOtherItem(sItem)" <HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey+'_'+sItem.otherCode" @blur="onBlur(key, $event)" :item="getOtherItem(sItem)"
v-model="formFields[sItem.otherCode]" @copy="onCopy(sItem, key)" v-model="formFields[sItem.otherCode]" @copy="onCopy(sItem, key)"
@ -154,16 +156,15 @@
:orange-bg="orangeBgFields[sItem.subKey]" /> :orange-bg="orangeBgFields[sItem.subKey]" />
<div class="ml-10 item-span" v-else-if="sItem.subType === 'span'">{{ formFields[sItem.subKey] }}</div> <div class="ml-10 item-span" v-else-if="sItem.subType === 'span'">{{ formFields[sItem.subKey] }}</div>
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey+'_'+sItem.subKey" class="ml-10" v-else-if="sItem.subType === 'clickable'" <HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey+'_'+sItem.subKey" class="ml-10" v-else-if="sItem.subType === 'clickable'"
@clickable="handleClickable(sItem, $event)" type="clickable"
@clickable="handleClickable(sItem, $event)" :error="errors[sItem.subKey]" type="clickable"
@update:error="errors[sItem.subKey] = false"
:item="getClickableItem(sItem)" :value="formFields[sItem.subKey]" /> :item="getClickableItem(sItem)" :value="formFields[sItem.subKey]" />
<!-- <div class="clickable" :class="getFillType(sItem.subFillType)" v-else-if = "sItem.subType ==='clickable'" @click="handleClickable(sItem,$event)">
<span v-if="formFields[sItem.subKey]">{{ formFields[sItem.subKey] }}</span>
<span v-else class="default-placeholder-text">请选择</span>
</div> -->
</div> </div>
<div v-else-if="sItem.type === 'clickable'" class="flex flex1"> <div v-else-if="sItem.type === 'clickable'" class="flex flex1">
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey+'_'+key" type="clickable" @clickable="handleClickable(sItem, $event)"
:error="errors[key]" :item="sItem" :value="formFields[key]" />
<HandleFormItem :field-item-label="fieldItemLabel"
:field-key="prefixKey+'_'+key" type="clickable" @clickable="handleClickable(sItem, $event)"
:error="errors[key]" @update:error="errors[key] = false"
:item="sItem" :value="formFields[key]" />
</div> </div>
</div> </div>
</div> </div>
@ -301,7 +302,7 @@ export default {
// //
getOtherItem(sItem) { getOtherItem(sItem) {
return { return {
label: "其他",
label: "template.common.other",
fillType: sItem.fillType, fillType: sItem.fillType,
maxlength: sItem.otherMaxlength || 50, maxlength: sItem.otherMaxlength || 50,
parentLabel: sItem.label, parentLabel: sItem.label,
@ -369,7 +370,7 @@ export default {
} else { } else {
result[otherCode] = formData[otherCode] || formFields[otherCode] || ''; result[otherCode] = formData[otherCode] || formFields[otherCode] || '';
} }
config[otherCode] = { label: "其他", parentKey: key, type: "input", fillType: currentConfig.fillType }
config[otherCode] = { label: "template.common.other", parentKey: key, type: "input", fillType: currentConfig.fillType }
} }
if (currentConfig.subKey) { if (currentConfig.subKey) {
const { subKey } = currentConfig; const { subKey } = currentConfig;
@ -434,7 +435,7 @@ export default {
} }
if (this.isValueEmpty(formFields[key])) { if (this.isValueEmpty(formFields[key])) {
// //
if (o.label === "其他" && !this.isShowOther(formFields[o.parentKey])) {
if (o.label === "template.common.other" && !this.isShowOther(formFields[o.parentKey])) {
continue continue
} }
//span //span
@ -460,7 +461,6 @@ export default {
} }
} }
} }
return { return {
valid: errors.length === 0, valid: errors.length === 0,
errors: errors errors: errors

+ 9
- 0
src/components/Template/CustomTable.vue View File

@ -72,6 +72,14 @@
@update:error="onErrorUpdate(rowIndex, colIndex, col.bodySubKey, $event)" @update:error="onErrorUpdate(rowIndex, colIndex, col.bodySubKey, $event)"
:orange-bg="hasOrangeBg(rowIndex, colIndex, col.bodySubKey)" /> :orange-bg="hasOrangeBg(rowIndex, colIndex, col.bodySubKey)" />
</template> </template>
<template v-else-if="col.bodySubType === 'select'">
<HandleFormItem :fieldKey="prefixKey+'_'+col.bodySubKey+'_'+rowIndex" :fieldItemLabel="fieldItemLabel" type="select" class="body-select" @blur="onSubBlur(rowIndex, col.bodySubKey, $event)"
:item="getBodySubItem(col, rowIndex)" v-model="row[col.bodySubKey]"
@change="onBodySubValueChange(rowIndex, colIndex, $event)"
:error="hasError(rowIndex, colIndex, col.bodySubKey)"
@update:error="onErrorUpdate(rowIndex, colIndex, col.bodySubKey, $event)"
:orange-bg="hasOrangeBg(rowIndex, colIndex, col.bodySubKey)" />
</template>
<template v-else> <template v-else>
{{ row[col.bodySubKey] }} {{ row[col.bodySubKey] }}
</template> </template>
@ -214,6 +222,7 @@ export default {
// //
const validateResult = this.validateFormData(); const validateResult = this.validateFormData();
console.log(validateResult,"validateResult")
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (validateResult.valid) { if (validateResult.valid) {
resolve({ resolve({

+ 15
- 22
src/components/Template/HandleFormItem.vue View File

@ -32,7 +32,6 @@
<span v-else class="default-placeholder-text">{{ getPlaceholder() }}</span> <span v-else class="default-placeholder-text">{{ getPlaceholder() }}</span>
</div> </div>
</div> </div>
<!-- qc才能操作 -->
<div class="handle-row" v-if="isShowHandle()"> <div class="handle-row" v-if="isShowHandle()">
<el-checkbox :checked="getChecked()" v-if="getIsShowCheckboxIcon()" :disabled="getCheckboxDisabled()" class="mr-5" <el-checkbox :checked="getChecked()" v-if="getIsShowCheckboxIcon()" :disabled="getCheckboxDisabled()" class="mr-5"
@change="onCheckboxChange"></el-checkbox> @change="onCheckboxChange"></el-checkbox>
@ -351,21 +350,12 @@ export default {
this.$emit('update:error', true); this.$emit('update:error', true);
} }
//
if (this.templateFillType === "actFill") {
//
const isSame = this.isEqual(this.oldValue, this.inputValue);
if (this.oldValue && !isSame) {
this.$refs.editSignRef.show()
}else if (!this.oldValue) {//
this.handleUpdateRecord()
}
} else {
// blurchange
this.$emit("blur", val)
this.$emit('input', val);
this.$emit("change", val)
//
const isSame = this.isEqual(this.oldValue, this.inputValue);
if (this.oldValue && !isSame && this.templateFillType === "actFill") {
this.$refs.editSignRef.show()
}else{//
this.handleUpdateRecord()
} }
}, },
@ -391,7 +381,9 @@ export default {
if (data) { if (data) {
record.reason = data.remark record.reason = data.remark
} }
this.updateZdxgjl(record);
if(this.templateFillType === "actFill"){//
this.updateZdxgjl(record);
}
const params = { const params = {
type: "fieldChanged", type: "fieldChanged",
newRecord: record, newRecord: record,
@ -478,8 +470,9 @@ export default {
}, },
// //
isShowHandle() { isShowHandle() {
const { fillType } = this.item;
// //
return this.templateFillType !== "preFill"
return this.templateFillType !== "preFill" && fillType === "actFill"
}, },
// //
getDisabled() { getDisabled() {
@ -504,13 +497,13 @@ export default {
return "" return ""
} }
if (type === "clickable") { if (type === "clickable") {
return "请选择"
return this.$t("template.common.pleaseSelect")
} }
let prex = "请输入";
let prex = "template.common.pleaseFillIn"
if (type === "select" || type === "dateTime") { if (type === "select" || type === "dateTime") {
prex = "请选择"
prex = "template.common.pleaseSelect"
} }
return placeholder ? this.$t(placeholder) : (prex + this.$t(label))
return placeholder ? this.$t(placeholder) : (this.$t(prex) + this.$t(label))
}, },
onCopy() { onCopy() {

+ 4
- 2
src/components/Template/Step.vue View File

@ -167,12 +167,12 @@ export default {
}, },
'formData': { 'formData': {
handler(newVal) { handler(newVal) {
console.log('newVal', newVal)
console.log('stepValue', newVal)
if(!newVal || newVal.length === 0) return if(!newVal || newVal.length === 0) return
this.steps = newVal.map((step) => ({ this.steps = newVal.map((step) => ({
id: this.stepId++, id: this.stepId++,
type: step.type || '', type: step.type || '',
formData: step.formData || {}
formData: step
})) }))
}, },
deep: true, deep: true,
@ -219,6 +219,8 @@ export default {
}, },
onFormUpdate(stepIndex, formData) { onFormUpdate(stepIndex, formData) {
console.log('stepIndex', stepIndex)
console.log('formData', formData)
this.steps[stepIndex].formData = formData this.steps[stepIndex].formData = formData
}, },

+ 2
- 0
src/lang/en/template/commonTemplate.js View File

@ -61,4 +61,6 @@ export default {
other: 'Other', other: 'Other',
otherInfo: 'Other Information', otherInfo: 'Other Information',
unit: 'unit', unit: 'unit',
pleaseFillIn:"Please fill in",
pleaseSelect:"Please select"
} }

+ 3
- 1
src/lang/index.js View File

@ -6,6 +6,7 @@ import elementZhLocale from 'element-ui/lib/locale/lang/zh-CN' // element-ui lan
import enLocale from './en' import enLocale from './en'
import zhLocale from './zh' import zhLocale from './zh'
Vue.use(VueI18n) Vue.use(VueI18n)
const messages = { const messages = {
@ -23,7 +24,8 @@ const i18n = new VueI18n({
// 设置语言 选项 en | zh // 设置语言 选项 en | zh
locale: Cookies.get('language') || 'zh_CN', locale: Cookies.get('language') || 'zh_CN',
// 设置文本内容 // 设置文本内容
messages
messages,
silentTranslationWarn: true // 禁止翻译警告警告,太多未翻译的时候浏览器会太卡。
}) })
export default i18n export default i18n

+ 2
- 0
src/lang/zh/template/commonTemplate.js View File

@ -61,4 +61,6 @@ export default {
other: '其他', other: '其他',
otherInfo: '其他信息', otherInfo: '其他信息',
unit: '单位', unit: '单位',
pleaseFillIn:"请输入",
pleaseSelect:"请选择"
} }

+ 2
- 2
src/views/business/comps/template/comps/sp/SWYPBQGZYZBB.vue View File

@ -174,11 +174,11 @@ export default {
type: "cellItem", type: "cellItem",
label: "处理时间", label: "处理时间",
config: { config: {
createTime: {
startDate: {
label: "开始时间", label: "开始时间",
type: "input", type: "input",
}, },
endTime: {
endDate: {
label: "结束时间", label: "结束时间",
type: "input", type: "input",
}, },

+ 2
- 2
src/views/business/comps/template/comps/sp/SWYPFXCBYPZB.vue View File

@ -135,11 +135,11 @@ export default {
type: "cellItem", type: "cellItem",
label: "配置时间", label: "配置时间",
config: { config: {
createTime: {
startDate: {
label: "开始时间", label: "开始时间",
type: "input", type: "input",
}, },
endTime: {
endDate: {
label: "结束时间", label: "结束时间",
type: "input", type: "input",
}, },

+ 11
- 292
src/views/business/comps/template/comps/sp/SWYPNBGZYZBB.vue View File

@ -145,7 +145,7 @@ import templateMixin from "../../mixins/templateMixin";
import CustomTable from '@/components/Template/CustomTable.vue'; import CustomTable from '@/components/Template/CustomTable.vue';
import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue'; import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue';
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue" import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue"
import {getLadderColumnsConfig,getParallelColumnsConfig} from "../../formConfig/paralleAndLadderConfig.js";
export default { export default {
name: "SWYPBQGZYZBB", name: "SWYPBQGZYZBB",
components: { BaseInfoFormPcakge, LineLabel, TableList, Step, CustomTable, SelectReagentDialog, TableOpertaion }, components: { BaseInfoFormPcakge, LineLabel, TableList, Step, CustomTable, SelectReagentDialog, TableOpertaion },
@ -272,11 +272,11 @@ export default {
type: "cellItem", type: "cellItem",
label: "处理时间", label: "处理时间",
config: { config: {
createTime: {
startDate: {
label: "开始时间", label: "开始时间",
type: "input", type: "input",
}, },
endTime: {
endDate: {
label: "结束时间", label: "结束时间",
type: "input", type: "input",
}, },
@ -380,292 +380,11 @@ export default {
] ]
}, },
paralleStepColumns() { paralleStepColumns() {
return [
{
label: "目标溶液编号",
prop: "targetSolutionCode",
bodyType: "input",
subType: "span",
subKey: "subTargetSolutionCode",
bodyFillType: "preFill",
width: 280
},
{
label: "起始溶液编号",
prop: "startSolutionCode",
width: 280,
bodyType: "input",
bodyFillType: "actFill",
bodyMaxlength: 10,
},
{
label: "预设起始溶液体积",
prop: "targetStartSolutionVolume",
width: 280,
headerSelectKey: "targetStartSolutionVolumeUnit",
fillType: "preFill",
headerOptions: this.getDictOptions('business_tjdw'),
bodyType: "inputNumber",
bodySubType: "inputNumber",
bodySubKey: "targetStartSolutionVolumePrecision",
bodyFillType: "preFill",
bodySubFillType: "preFill",
showBodySub: this.fillType === "preFill",
bodyDisabled: true,
bodyPrecisionKey: "targetStartSolutionVolumePrecision",
bodyMaxlength: 10,
bodySubPlaceholder: "请输入保留小数位数",
},
{
label: "实际起始溶液体积",
prop: "actStartSolutionVolume",
width: 280,
headerSelectKey: "actStartSolutionVolumeUnit",
fillType: "preFill",
headerOptions: this.getDictOptions('business_tjdw'),
bodyType: "inputNumber",
bodyFillType: "actFill",
bodyMaxlength: 10,
copyFrom: "targetStartSolutionVolume",//
},
{
label: "预设稀释液体积",
prop: "targetDiluentVolume",
width: 280,
headerSelectKey: "targetDiluentVolumeUnit",
fillType: "preFill",
headerOptions: this.getDictOptions('business_tjdw'),
bodyType: "inputNumber",
bodySubType: "inputNumber",
bodySubKey: "targetDiluentVolumePrecision",
bodyFillType: "preFill",
bodySubFillType: "preFill",
showBodySub: this.fillType === "preFill",
bodyDisabled: true,
bodyPrecisionKey: "targetDiluentVolumePrecision",
bodyMaxlength: 10,
bodySubPlaceholder: "请输入保留小数位数",
},
{
label: "实际稀释液体积",
prop: "actDiluentVolume",
width: 280,
headerSelectKey: "actDiluentVolumeUnit",
fillType: "preFill",
headerOptions: this.getDictOptions('business_tjdw'),
bodyType: "inputNumber",
bodyFillType: "actFill",
bodyMaxlength: 10,
copyFrom: "targetDiluentVolume",//
},
{
label: "预设目标溶液浓度",
prop: "targetSolutionConcentration",
width: 280,
headerSelectKey: "targetSolutionConcentrationUnit",
fillType: "preFill",
headerOptions: this.getDictOptions('business_nddw'),
bodyType: "inputNumber",
bodyFillType: "preFill",
bodyMaxlength: 10,
},
{
label: "实际目标溶液浓度",
prop: "actSolutionConcentration",
width: 280,
headerSelectKey: "actSolutionConcentrationUnit",
fillType: "preFill",
headerOptions: this.getDictOptions('business_nddw'),
bodyType: "inputNumber",
bodySubType: "inputNumber",
bodySubKey: "actSolutionConcentrationPrecision",
bodyFillType: "actFill",
bodySubFillType: "preFill",
showBodySub: this.fillType === "preFill",
bodyDisabled: true,
bodyPrecisionKey: "actSolutionConcentrationPrecision",
bodyMaxlength: 10,
copyFrom: "targetSolutionConcentration",//
bodySubPlaceholder: "请输入保留小数位数",
},
{
label: "预设目标溶液体积",
prop: "targetSolutionVolume",
width: 280,
headerSelectKey: "targetSolutionVolumeUnit",
fillType: "preFill",
headerOptions: this.getDictOptions('business_tjdw'),
bodyType: "inputNumber",
bodyFillType: "preFill",
bodyMaxlength: 10,
},
{
label: "实际目标溶液体积",
prop: "actSolutionVolume",
width: 280,
headerSelectKey: "actSolutionVolumeUnit",
fillType: "preFill",
headerOptions: this.getDictOptions('business_tjdw'),
bodyType: "inputNumber",
bodySubType: "inputNumber",
bodySubKey: "actSolutionVolumePrecision",
bodyFillType: "actFill",
bodySubFillType: "preFill",
showBodySub: this.fillType === "preFill",
bodyDisabled: true,
bodyPrecisionKey: "actSolutionVolumePrecision",
bodyMaxlength: 10,
copyFrom: "targetSolutionVolume",//
bodySubPlaceholder: "请输入保留小数位数",
},
]
return getParallelColumnsConfig(this);
}, },
//
//
ladderStepColumns() { ladderStepColumns() {
return [
{
label: "目标溶液编号",
prop: "targetSolutionCode",
bodyType: "input",
subType: "span",
subKey: "subTargetSolutionCode",
bodyFillType: "preFill",
width: 280
},
{
label: "起始溶液编号",
prop: "startSolutionCode",
width: 280,
bodyType: "input",
bodyFillType: "actFill",
bodyMaxlength: 10,
},
{
label: "预设起始溶液体积",
prop: "targetStartSolutionVolume",
width: 280,
headerSelectKey: "targetStartSolutionVolumeUnit",
fillType: "preFill",
headerOptions: this.getDictOptions('business_tjdw'),
bodyType: "inputNumber",
bodySubType: "inputNumber",
bodySubKey: "targetStartSolutionVolumePrecision",
bodyFillType: "preFill",
bodySubFillType: "preFill",
showBodySub: this.fillType === "preFill",
bodyDisabled: true,
bodyPrecisionKey: "targetStartSolutionVolumePrecision",
bodyMaxlength: 10,
bodySubPlaceholder: "请输入保留小数位数",
},
{
label: "实际起始溶液体积",
prop: "actStartSolutionVolume",
width: 280,
headerSelectKey: "actStartSolutionVolumeUnit",
fillType: "preFill",
headerOptions: this.getDictOptions('business_tjdw'),
bodyType: "inputNumber",
bodyFillType: "actFill",
bodyMaxlength: 10,
copyFrom: "targetStartSolutionVolume",//
},
{
label: "预设稀释液体积",
prop: "targetDiluentVolume",
width: 280,
headerSelectKey: "targetDiluentVolumeUnit",
fillType: "preFill",
headerOptions: this.getDictOptions('business_tjdw'),
bodyType: "inputNumber",
bodySubType: "inputNumber",
bodySubKey: "targetDiluentVolumePrecision",
bodyFillType: "preFill",
bodySubFillType: "preFill",
showBodySub: this.fillType === "preFill",
bodyDisabled: true,
bodyPrecisionKey: "targetDiluentVolumePrecision",
bodyMaxlength: 10,
bodySubPlaceholder: "请输入保留小数位数",
},
{
label: "实际稀释液体积",
prop: "actDiluentVolume",
width: 280,
headerSelectKey: "actDiluentVolumeUnit",
fillType: "preFill",
headerOptions: this.getDictOptions('business_tjdw'),
bodyType: "inputNumber",
bodyFillType: "actFill",
bodyMaxlength: 10,
copyFrom: "targetDiluentVolume",//
},
{
label: "预设目标溶液浓度",
prop: "targetSolutionConcentration",
width: 280,
headerSelectKey: "targetSolutionConcentrationUnit",
fillType: "preFill",
headerOptions: this.getDictOptions('business_nddw'),
bodyType: "inputNumber",
bodyFillType: "preFill",
bodyMaxlength: 10,
},
{
label: "实际目标溶液浓度",
prop: "actSolutionConcentration",
width: 280,
headerSelectKey: "actSolutionConcentrationUnit",
fillType: "preFill",
headerOptions: this.getDictOptions('business_nddw'),
bodyType: "inputNumber",
bodySubType: "inputNumber",
bodySubKey: "actSolutionConcentrationPrecision",
bodyFillType: "actFill",
bodySubFillType: "preFill",
showBodySub: this.fillType === "preFill",
bodyDisabled: true,
bodyPrecisionKey: "actSolutionConcentrationPrecision",
bodyMaxlength: 10,
copyFrom: "targetSolutionConcentration",//
bodySubPlaceholder: "请输入保留小数位数",
},
{
label: "预设目标溶液体积",
prop: "targetSolutionVolume",
width: 280,
headerSelectKey: "targetSolutionVolumeUnit",
fillType: "preFill",
headerOptions: this.getDictOptions('business_tjdw'),
bodyType: "inputNumber",
bodyFillType: "preFill",
bodyMaxlength: 10,
},
{
label: "实际目标溶液体积",
prop: "actSolutionVolume",
width: 280,
headerSelectKey: "actSolutionVolumeUnit",
fillType: "preFill",
headerOptions: this.getDictOptions('business_tjdw'),
bodyType: "inputNumber",
bodySubType: "inputNumber",
bodySubKey: "actSolutionVolumePrecision",
bodyFillType: "actFill",
bodySubFillType: "preFill",
showBodySub: this.fillType === "preFill",
bodyDisabled: true,
bodyPrecisionKey: "actSolutionVolumePrecision",
bodyMaxlength: 10,
copyFrom: "targetSolutionVolume",//
bodySubPlaceholder: "请输入保留小数位数",
},
]
return getLadderColumnsConfig(this);
}, },
}, },
data() { data() {
@ -795,7 +514,7 @@ export default {
} }
return await this.validFormFields(refsToValidate); return await this.validFormFields(refsToValidate);
}, },
getRealFormData(){
getFilledFormData(){
const baseData = this.$refs.baseInfoRef.getFilledFormData(); const baseData = this.$refs.baseInfoRef.getFilledFormData();
const conditionData = this.$refs.storageConditionRef.getFilledFormData(); const conditionData = this.$refs.storageConditionRef.getFilledFormData();
@ -810,7 +529,7 @@ export default {
ladderConfigsData.push({ ladderConfigsData.push({
...ladderFormData, ...ladderFormData,
...ladderTableFormData, ...ladderTableFormData,
ladderStepData,
ladderStepData:ladderStepData.stepData,
showLadderConfig: true showLadderConfig: true
}); });
} }
@ -827,7 +546,7 @@ export default {
paralleConfigsData.push({ paralleConfigsData.push({
...paralleFormData, ...paralleFormData,
...paralleTableFormData, ...paralleTableFormData,
paralleStepData,
paralleStepData:paralleStepData.stepData,
showParalleConfig: true showParalleConfig: true
}); });
} }
@ -845,11 +564,11 @@ export default {
}, },
async getFormData() { async getFormData() {
// //
const validFlag = this.validFields();
const validFlag = await this.validFields();
if(!validFlag){ if(!validFlag){
return false; return false;
} }
return this.getRealFormData();
return this.getFilledFormData();
}, },
async onSave() { async onSave() {
const formData = await this.getFormData(); const formData = await this.getFormData();

+ 315
- 0
src/views/business/comps/template/formConfig/paralleAndLadderConfig.js View File

@ -0,0 +1,315 @@
// 阶梯配置表格列配置
export const getLadderColumnsConfig = ($this) => {
return [
{
label: "目标溶液编号",
prop: "targetSolutionCode",
bodyType: "input",
bodySubType: "span",
bodySubKey: "subTargetSolutionCode",
bodyFillType: "preFill",
width: 280
},
{
label: "起始溶液编号",
prop: "startSolutionCode",
width: 280,
bodyType: "input",
bodyFillType: "actFill",
bodyMaxlength: 10,
},
{
label: "预设起始溶液体积",
prop: "targetStartSolutionVolume",
width: 280,
headerSelectKey: "targetStartSolutionVolumeUnit",
fillType: "preFill",
headerOptions: $this.getDictOptions('business_tjdw'),
bodyType: "inputNumber",
bodySubType: "inputNumber",
bodySubKey: "targetStartSolutionVolumePrecision",
bodyFillType: "preFill",
bodySubFillType: "preFill",
showBodySub: $this.fillType === "preFill",
bodyPrecisionKey: "targetStartSolutionVolumePrecision",
bodyMaxlength: 10,
bodySubPlaceholder: "请输入保留小数位数",
},
{
label: "实际起始溶液体积",
prop: "actStartSolutionVolume",
width: 280,
headerSelectKey: "actStartSolutionVolumeUnit",
fillType: "preFill",
headerOptions: $this.getDictOptions('business_tjdw'),
bodyType: "inputNumber",
bodyFillType: "actFill",
bodyMaxlength: 10,
copyFrom: "targetStartSolutionVolume",//复制哪个字段
},
{
label: "预设稀释液体积",
prop: "targetDiluentVolume",
width: 280,
headerSelectKey: "targetDiluentVolumeUnit",
fillType: "preFill",
headerOptions: $this.getDictOptions('business_tjdw'),
bodyType: "inputNumber",
bodySubType: "inputNumber",
bodySubKey: "targetDiluentVolumePrecision",
bodyFillType: "preFill",
bodySubFillType: "preFill",
showBodySub: $this.fillType === "preFill",
bodyPrecisionKey: "targetDiluentVolumePrecision",
bodyMaxlength: 10,
bodySubPlaceholder: "请输入保留小数位数",
},
{
label: "实际稀释液体积",
prop: "actDiluentVolume",
width: 280,
headerSelectKey: "actDiluentVolumeUnit",
fillType: "preFill",
headerOptions: $this.getDictOptions('business_tjdw'),
bodyType: "inputNumber",
bodyFillType: "actFill",
bodyMaxlength: 10,
copyFrom: "targetDiluentVolume",//复制哪个字段
},
{
label: "预设目标溶液浓度",
prop: "targetSolutionConcentration",
width: 280,
headerSelectKey: "targetSolutionConcentrationUnit",
fillType: "preFill",
headerOptions: $this.getDictOptions('business_nddw'),
bodyType: "inputNumber",
bodyFillType: "preFill",
bodyMaxlength: 10,
},
{
label: "实际目标溶液浓度",
prop: "actSolutionConcentration",
width: 280,
headerSelectKey: "actSolutionConcentrationUnit",
fillType: "preFill",
headerOptions: $this.getDictOptions('business_nddw'),
bodyType: "inputNumber",
bodySubType: "inputNumber",
bodySubKey: "actSolutionConcentrationPrecision",
bodyFillType: "actFill",
bodySubFillType: "preFill",
showBodySub: $this.fillType === "preFill",
bodyPrecisionKey: "actSolutionConcentrationPrecision",
bodyMaxlength: 10,
copyFrom: "targetSolutionConcentration",//复制哪个字段
bodySubPlaceholder: "请输入保留小数位数",
},
{
label: "预设目标溶液体积",
prop: "targetSolutionVolume",
width: 280,
headerSelectKey: "targetSolutionVolumeUnit",
fillType: "preFill",
headerOptions: $this.getDictOptions('business_tjdw'),
bodyType: "inputNumber",
bodyFillType: "preFill",
bodyMaxlength: 10,
},
{
label: "实际目标溶液体积",
prop: "actSolutionVolume",
width: 280,
headerSelectKey: "actSolutionVolumeUnit",
fillType: "preFill",
headerOptions: $this.getDictOptions('business_tjdw'),
bodyType: "inputNumber",
bodySubType: "inputNumber",
bodySubKey: "actSolutionVolumePrecision",
bodyFillType: "actFill",
bodySubFillType: "preFill",
showBodySub: $this.fillType === "preFill",
bodyPrecisionKey: "actSolutionVolumePrecision",
bodyMaxlength: 10,
copyFrom: "targetSolutionVolume",//复制哪个字段
bodySubPlaceholder: "请输入保留小数位数",
},
]
}
// 平行配置表格列配置
export const getParallelColumnsConfig = ($this) => {
return [
{
label: "目标溶液编号",
prop: "targetSolutionCode",
bodyType: "select",
bodyOptions:[{
label: "溶液1",
value: "1",
}],
subType: "span",
subKey: "subTargetSolutionCode",
bodyFillType: "preFill",
width: 280
},
{
label: "预设目标溶液浓度",
prop: "targetSolutionConcentration",
width: 280,
headerSelectKey: "targetSolutionConcentrationUnit",
fillType: "preFill",
headerOptions: $this.getDictOptions('business_nddw'),
bodyType: "inputNumber",
bodyFillType: "preFill",
bodyMaxlength: 10,
},
{
label: "实际目标溶液浓度",
prop: "actSolutionConcentration",
width: 280,
headerSelectKey: "actSolutionConcentrationUnit",
fillType: "preFill",
headerOptions: $this.getDictOptions('business_nddw'),
bodyType: "inputNumber",
bodySubType: "inputNumber",
bodySubKey: "actSolutionConcentrationPrecision",
bodyFillType: "actFill",
bodySubFillType: "preFill",
showBodySub: $this.fillType === "preFill",
bodyPrecisionKey: "actSolutionConcentrationPrecision",
bodyMaxlength: 10,
copyFrom: "targetSolutionConcentration",//复制哪个字段
bodySubPlaceholder: "请输入保留小数位数",
},
{
label: "实际目标溶液体积",
prop: "actSolutionVolume",
width: 280,
headerSelectKey: "actSolutionVolumeUnit",
fillType: "preFill",
headerOptions: $this.getDictOptions('business_tjdw'),
bodyType: "inputNumber",
bodySubType: "inputNumber",
bodySubKey: "actSolutionVolumePrecision",
bodyFillType: "actFill",
bodySubFillType: "preFill",
showBodySub: $this.fillType === "preFill",
bodyPrecisionKey: "actSolutionVolumePrecision",
bodyMaxlength: 10,
copyFrom: "targetSolutionVolume",//复制哪个字段
bodySubPlaceholder: "请输入保留小数位数",
},
{
label: "目标溶液有效周期",
prop: "targetSolutionCycle",
width: 280,
fillType: "preFill",
bodyType: "inputNumber",
bodySubType: "select",
bodySubKey: "targetSolutionCyclePrecision",
bodySubOptions: $this.getDictOptions('business_yxqdw'),
bodyFillType: "actFill",
bodySubFillType: "preFill",
bodyMaxlength: 10,
},
{
label: "目标溶液失效日",
prop: "targetSolutionExpirationDate",
width: 280,
bodyType: "span",
},
{
label: "预设原始溶液编号",
prop: "startSolutionCode",
width: 280,
bodyType: "input",
bodyFillType: "preFill",
},
{
label: "实际原始溶液编号",
prop: "actStartSolutionCode",
width: 280,
bodyType: "input",
bodyFillType: "actFill",
},
{
label: "预设原始溶液浓度",
prop: "targetStartSolutionConcentration",
width: 280,
bodyType: "inputNumber",
bodyFillType: "preFill",
bodySubType: "select",
bodySubKey: "targetStartSolutionConcentrationPrecision",
bodySubOptions: $this.getDictOptions('business_nddw'),
bodySubFillType: "preFill",
bodyMaxlength: 10,
},
{
label: "预设原始溶液体积",
prop: "targetStartSolutionVolume",
headerSelectKey: "targetStartSolutionVolumeUnit",
fillType: "preFill",
headerOptions: $this.getDictOptions('business_tjdw'),
width: 280,
bodyType: "inputNumber",
bodyFillType: "preFill",
bodySubType: "inputNumber",
bodySubKey: "targetStartSolutionVolumePrecision",
bodySubFillType: "preFill",
bodyMaxlength: 10,
bodyPrecisionKey: "targetStartSolutionVolumePrecision",
bodyMaxlength: 10,
bodySubPlaceholder: "请输入保留小数位数",
},
{
label: "实际原始溶液体积",
prop: "actStartSolutionVolume",
headerSelectKey: "actStartSolutionVolumeUnit",
fillType: "preFill",
headerOptions: $this.getDictOptions('business_tjdw'),
width: 280,
bodyType: "inputNumber",
bodyFillType: "actFill",
bodyMaxlength: 10,
},
{
label: "预计稀释液体积",
prop: "preDiluentVolume",
headerSelectKey: "preDiluentVolumeUnit",
fillType: "preFill",
headerOptions: $this.getDictOptions('business_tjdw'),
width: 280,
bodyType: "inputNumber",
bodyFillType: "preFill",
bodySubType: "inputNumber",
bodySubKey: "preDiluentVolumePrecision",
bodySubFillType: "preFill",
bodyMaxlength: 10,
bodyPrecisionKey: "preDiluentVolumePrecision",
bodySubPlaceholder: "请输入保留小数位数",
},
{
label: "实际稀释液体积",
prop: "actDiluentVolume",
headerSelectKey: "actDiluentVolumeUnit",
fillType: "preFill",
headerOptions: $this.getDictOptions('business_tjdw'),
width: 280,
bodyType: "inputNumber",
bodyFillType: "actFill",
bodyMaxlength: 10,
},
]
}

+ 6
- 0
src/views/business/comps/template/mixins/paralleAndladderMixin.js View File

@ -0,0 +1,6 @@
import moment from "moment";
export default {
methods: {
},
}

+ 0
- 1
src/views/business/comps/template/mixins/templateMixin.js View File

@ -70,7 +70,6 @@ export default {
this.$message.error("请添加步骤"); this.$message.error("请添加步骤");
return return
} }
console.log(err, "err")
this.$message.error("表单内容未填完,请填写后再提交"); this.$message.error("表单内容未填完,请填写后再提交");
}); });
if (validFormData) { if (validFormData) {

+ 2
- 2
vue.config.js View File

@ -34,8 +34,8 @@ module.exports = {
proxy: { proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy // detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: { [process.env.VUE_APP_BASE_API]: {
target: `http://localhost:8080`,
// target: `http://39.99.251.173:8080`,
// target: `http://localhost:8080`,
target: `http://39.99.251.173:8080`,
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: '' ['^' + process.env.VUE_APP_BASE_API]: ''

Loading…
Cancel
Save