Browse Source

feat:[模板管理][update]

luojie
luojie 1 week ago
parent
commit
cbb8bf2da2
17 changed files with 91 additions and 324 deletions
  1. +2
    -1
      src/components/Template/CustomTable.vue
  2. +13
    -8
      src/components/Template/DecimalInput.vue
  3. +12
    -14
      src/components/Template/HandleFormItem.vue
  4. +0
    -258
      src/components/Template/Input.vue
  5. +6
    -4
      src/components/Template/StepComponents/ZLSubPackage.vue
  6. +3
    -3
      src/components/Template/StepComponents/ry/bdtj.vue
  7. +2
    -1
      src/components/Template/StepComponents/ry/bdzl.vue
  8. +5
    -0
      src/components/Template/StepComponents/ry/fy.vue
  9. +26
    -26
      src/components/Template/StepComponents/ry/jd.vue
  10. +1
    -0
      src/components/Template/StepComponents/ry/tjphcz.vue
  11. +1
    -0
      src/components/Template/StepComponents/ry/tjphfcz.vue
  12. +3
    -2
      src/components/Template/StepComponents/ry/tpjydd.vue
  13. +8
    -6
      src/components/Template/StepComponents/ry/tpjysd.vue
  14. +2
    -1
      src/components/Template/StepFormPackage.vue
  15. +1
    -0
      src/views/business/comps/template/dialog/SelectInstrumentDialog.vue
  16. +3
    -0
      src/views/business/comps/template/dialog/SelectMixReagentDialog.vue
  17. +3
    -0
      src/views/business/comps/template/dialog/SelectReagentDialog.vue

+ 2
- 1
src/components/Template/CustomTable.vue View File

@ -740,7 +740,8 @@ export default {
}) })
} else { } else {
if (isValueEmpty(mainValue) && col.bodyType !== 'span' && col.bodyType !== 'button') {
if (isValueEmpty(mainValue) &&col.bodyFillType === this.templateFillType && col.bodyType !== 'span' && col.bodyType !== 'button') {
console.log(col.bodyFillType,col.bodySubFillType,"bodySubFillType")
const errorItem = { const errorItem = {
rowIndex, rowIndex,
colIndex, colIndex,

+ 13
- 8
src/components/Template/DecimalInput.vue View File

@ -92,17 +92,22 @@ export default {
return; return;
} }
// NA
if (this.isNA) {
// NANA
this.internalValue = 'NA';
this.$emit('input', 'NA');
return;
}
const upperVal = val.toUpperCase(); const upperVal = val.toUpperCase();
let cleaned = val; let cleaned = val;
let matchedRule = null; let matchedRule = null;
// NA
if (this.isNA) {
// NA
if (upperVal === 'NA') {
this.internalValue = 'NA';
this.$emit('input', 'NA');
return;
} else {
// NA
this.isNA = false;
}
}
// NAFRACTION // NAFRACTION
// NA // NA

+ 12
- 14
src/components/Template/HandleFormItem.vue View File

@ -109,7 +109,7 @@
<el-button :disabled="getDisabled()" :class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')" <el-button :disabled="getDisabled()" :class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')"
size="small" type="primary">点击上传</el-button> size="small" type="primary">点击上传</el-button>
<span v-if="error" class="atta-tips">请上传附件</span> <span v-if="error" class="atta-tips">请上传附件</span>
<div slot="tip" class="el-upload__tip">支持扩展名.rar .zip .doc .docx .pdf .jpg文件大小不超过2MB</div>
<div slot="tip" class="el-upload__tip">支持扩展名.{{allowedTypes.join('. ')}}文件大小不超过2MB</div>
</el-upload> </el-upload>
</template> </template>
<div v-else-if="type === 'checkboxTag'" class="flex1 checkbox-tag-wrapper" <div v-else-if="type === 'checkboxTag'" class="flex1 checkbox-tag-wrapper"
@ -341,8 +341,8 @@ export default {
picker.$emit('pick', new Date()); picker.$emit('pick', new Date());
} }
}] }]
}
},
allowedTypes: ["zip","rar","doc","docx","pdf","jpg"],
} }
}, },
watch: { watch: {
@ -423,13 +423,11 @@ export default {
handleChange(file, fileList) { handleChange(file, fileList) {
// statusready // statusready
if (file.status === 'ready') { if (file.status === 'ready') {
const isAllowedType = ['image/jpeg', 'image/png', 'image/gif', 'application/pdf',
'application/x-rar-compressed', 'application/zip',
'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'].includes(file.raw.type)
const suffix = file.name.split('.').pop().toLowerCase();
const isAllowedType = this.allowedTypes.includes(suffix)
const isLt2M = file.size / 1024 / 1024 < 2 const isLt2M = file.size / 1024 / 1024 < 2
if (!isAllowedType) { if (!isAllowedType) {
this.$message.error(`文件 ${file.name} 格式不支持!只能上传 JPG/PNG/GIF/PDF/RAR/ZIP/DOC/DOCX 格式的文件`)
this.$message.error(`文件 ${file.name} 格式不支持!只能上传 ${this.allowedTypes.join('/')} 格式的文件`)
// fileList // fileList
const index = fileList.indexOf(file); const index = fileList.indexOf(file);
if (index > -1) { if (index > -1) {
@ -1744,16 +1742,16 @@ export default {
.clickable, .clickable,
.el-date-editor, .el-date-editor,
.el-checkbox__inner { .el-checkbox__inner {
border-color: #ff5d5d !important;
border: 1px solid #ff5d5d !important;
box-shadow: 0 0 6px #ffc3c3 !important; box-shadow: 0 0 6px #ffc3c3 !important;
&:focus { &:focus {
border-color: #ff5d5d !important;
border: 1px solid #ff5d5d !important;
box-shadow: 0 0 6px #ffc3c3 !important; box-shadow: 0 0 6px #ffc3c3 !important;
} }
&:hover { &:hover {
border-color: #ff5d5d;
border: 1px solid #ff5d5d !important;
box-shadow: 0 0 6px #ffc3c3 !important; box-shadow: 0 0 6px #ffc3c3 !important;
} }
} }
@ -1761,14 +1759,14 @@ export default {
// el-select el-date-picker // el-select el-date-picker
.el-select .el-input__inner, .el-select .el-input__inner,
.el-date-editor .el-input__inner .el-checkbox__inner { .el-date-editor .el-input__inner .el-checkbox__inner {
border-color: #ff5d5d;
border: 1px solid #ff5d5d !important;
box-shadow: 0 0 6px #ffc3c3 !important; box-shadow: 0 0 6px #ffc3c3 !important;
} }
// DecimalInput // DecimalInput
:deep(.el-input-number) {
.el-input-number {
.el-input__inner { .el-input__inner {
border-color: #ff5d5d;
border: 1px solid #ff5d5d !important;
box-shadow: 0 0 6px #ffc3c3 !important; box-shadow: 0 0 6px #ffc3c3 !important;
} }
} }

+ 0
- 258
src/components/Template/Input.vue View File

@ -1,258 +0,0 @@
<template>
<el-input
v-model="inputValue"
:maxlength="maxLength"
:disabled="disabled"
:readonly="readonly"
:clearable="clearable"
:show-password="showPassword"
:placeholder="placeholder || ('请输入' + label)"
:class="borderClass"
@blur="onBlur"
@focus="onFocus"
@change="onChange"
@clear="onClear"
@keyup.enter="onEnter"
/>
</template>
<script>
export default {
name: 'CustomInput',
props: {
// v-model
value: {
type: [String, Number],
default: ''
},
//
label: {
type: String,
default: ''
},
//
maxLength: {
type: Number,
default: null
},
//
disabled: {
type: Boolean,
default: false
},
//
readonly: {
type: Boolean,
default: false
},
//
clearable: {
type: Boolean,
default: true
},
//
showPassword: {
type: Boolean,
default: false
},
//
placeholder: {
type: String,
default: ''
},
//
fillType: {
type: String,
default: '',
validator: value => {
return ['', 'actFill', 'green', 'preFill'].includes(value)
}
},
//
size: {
type: String,
default: 'default',
validator: value => {
return ['large', 'default', 'small'].includes(value)
}
}
},
data() {
return {
inputValue: this.value
}
},
computed: {
borderClass() {
const typeMap = {
actFill: 'orange-border',
green: 'green-border',
preFill: 'blue-border'
}
return typeMap[this.fillType] || ''
}
},
watch: {
value(newVal) {
this.inputValue = newVal
},
inputValue(newVal) {
this.$emit('input', newVal)
}
},
methods: {
onBlur(event) {
this.$emit('blur', event)
},
onFocus(event) {
this.$emit('focus', event)
},
onChange(value) {
this.$emit('change', value)
},
onClear() {
this.$emit('clear')
},
onEnter(event) {
this.$emit('enter', event)
},
//
clear() {
this.inputValue = ''
this.$emit('input', '')
this.$emit('clear')
},
//
focus() {
this.$el.querySelector('input').focus()
},
//
blur() {
this.$el.querySelector('input').blur()
}
},
filters: {
getFillType(type) {
const typeMap = {
actFill: 'orange-border',
green: 'green-border',
preFill: 'blue-border'
}
return typeMap[type] || ''
}
}
}
</script>
<style lang="scss">
//
:deep(.el-input) {
.el-input__inner {
transition: border-color 0.2s ease, box-shadow 0.2s ease;
&:focus {
box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
}
}
}
//
.orange-border {
:deep(.el-input__inner) {
border-color: #f9c588;
&:focus {
border-color: #f9c588;
box-shadow: 0 0 0 2px rgba(249, 197, 136, 0.2);
}
&:hover {
border-color: #f9c588;
}
}
}
// 绿
.green-border {
:deep(.el-input__inner) {
border-color: #67c23a;
&:focus {
border-color: #67c23a;
box-shadow: 0 0 0 2px rgba(103, 194, 58, 0.2);
}
&:hover {
border-color: #67c23a;
}
}
}
//
.blue-border {
:deep(.el-input__inner) {
border-color: #409eff;
&:focus {
border-color: #409eff;
box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
}
&:hover {
border-color: #409eff;
}
}
}
//
:deep(.el-input.is-disabled) {
.el-input__inner {
background-color: #f5f7fa;
border-color: #e4e7ed;
color: #c0c4cc;
}
}
//
:deep(.el-input.is-readonly) {
.el-input__inner {
background-color: #fafafa;
cursor: not-allowed;
}
}
//
:deep(.el-input__clear) {
color: #909399;
transition: color 0.2s ease;
&:hover {
color: #409eff;
}
}
//
:deep(.el-input__password) {
color: #909399;
transition: color 0.2s ease;
&:hover {
color: #409eff;
}
}
//
:deep(.el-input--large) {
.el-input__inner {
height: 40px;
font-size: 16px;
}
}
:deep(.el-input--small) {
.el-input__inner {
height: 32px;
font-size: 13px;
}
}
</style>

+ 6
- 4
src/components/Template/StepComponents/ZLSubPackage.vue View File

@ -13,8 +13,7 @@
<span class="ml-5">{{ item.unit }}</span> <span class="ml-5">{{ item.unit }}</span>
</div> </div>
<div class="header-item"> <div class="header-item">
<div class="header-title">分装编号</div>
<div class="header-title">单位</div>
<div class="header-title">分装单位</div>
<div class="unit-select"> <div class="unit-select">
<HandleFormItem :fieldKey = "prefixKey+stepIndex + 'dw'" :item="unitItem" type="select" :error="formErrors.dw" <HandleFormItem :fieldKey = "prefixKey+stepIndex + 'dw'" :item="unitItem" type="select" :error="formErrors.dw"
@blur="(e) => onCommonBlur(e, 'dw')" v-model="formData.dw" /> @blur="(e) => onCommonBlur(e, 'dw')" v-model="formData.dw" />
@ -31,6 +30,9 @@
<el-button v-if = "templateFillType == 'preFill'" type="primary" plain @click="onReset">重置</el-button> <el-button v-if = "templateFillType == 'preFill'" type="primary" plain @click="onReset">重置</el-button>
</div> </div>
<div class="header-item">
<div class="header-title">分装编号</div>
</div>
</div> </div>
<div class="content-container"> <div class="content-container">
<div class="zl-header-container"> <div class="zl-header-container">
@ -64,7 +66,7 @@ import { isValueEmpty,justUpdateFilledFormData } from '@/utils/index.js';
export default { export default {
inject: ['templateFillType'], inject: ['templateFillType'],
dicts: [ dicts: [
'business_tjdw',
'business_zldw',
], ],
components: { components: {
HandleFormItem, HandleFormItem,
@ -151,7 +153,7 @@ export default {
return { return {
type: "select", type: "select",
fillType: "preFill", fillType: "preFill",
options: this.dict.type.business_tjdw
options: this.dict.type.business_zldw
} }
}, },
subConfig(){ subConfig(){

+ 3
- 3
src/components/Template/StepComponents/ry/bdtj.vue View File

@ -69,9 +69,9 @@ import stepMixins from '@/components/Template/mixins/stepMixins.js';
options:this.getDictOptions("business_tjdw"), options:this.getDictOptions("business_tjdw"),
fillType:"preFill", fillType:"preFill",
}, },
text5:{
label:",划线。",
type:"text",
hx:{
type:"input",
fillType:"preFill",
}, },
} }

+ 2
- 1
src/components/Template/StepComponents/ry/bdzl.vue View File

@ -14,6 +14,7 @@ import stepMixins from '@/components/Template/mixins/stepMixins.js';
}, },
computed: { computed: {
formConfig() { formConfig() {
console.log(this.stepIndex,"stepIndex")
return [{ return [{
config:{ config:{
text1:{ text1:{
@ -47,7 +48,7 @@ import stepMixins from '@/components/Template/mixins/stepMixins.js';
type:"inputNumber", type:"inputNumber",
fillType:"actFill", fillType:"actFill",
compareTo:"rm", compareTo:"rm",
copyFrom:"rm"
disabled:true,
}, },
button1:{ button1:{
type:"button", type:"button",

+ 5
- 0
src/components/Template/StepComponents/ry/fy.vue View File

@ -27,6 +27,11 @@ export default {
label: "使用", label: "使用",
type: "text", type: "text",
}, },
yqmc: {
type: "input",
fillType: "preFill",
},
yq: { yq: {
type: "yq", type: "yq",
fillType: "actFill", fillType: "actFill",

+ 26
- 26
src/components/Template/StepComponents/ry/jd.vue View File

@ -66,12 +66,12 @@ export default {
fillType: "preFill", fillType: "preFill",
otherCode: "yjwdOther", otherCode: "yjwdOther",
}, },
yjhj: {
type: "select",
options: this.getDictOptions("business_hjxx"),
fillType: "preFill",
otherCode: "yjhjOther",
},
// yjhj: {
// type: "select",
// options: this.getDictOptions("business_hjxx"),
// fillType: "preFill",
// otherCode: "yjhjOther",
// },
text5: { text5: {
label: ",实际条件为", label: ",实际条件为",
type: "text", type: "text",
@ -84,13 +84,13 @@ export default {
otherCode: "sjwdOther", otherCode: "sjwdOther",
compareTo: "yjwd", compareTo: "yjwd",
}, },
sjhj: {
type: "select",
options: this.getDictOptions("business_hjxx"),
fillType: "actFill",
otherCode: "sjhjOther",
compareTo: "yjhj",
},
// sjhj: {
// type: "select",
// options: this.getDictOptions("business_hjxx"),
// fillType: "actFill",
// otherCode: "sjhjOther",
// compareTo: "yjhj",
// },
text6: { text6: {
label: ",放置", label: ",放置",
type: "text", type: "text",
@ -179,12 +179,12 @@ export default {
fillType: "preFill", fillType: "preFill",
otherCode: "yjwdOther", otherCode: "yjwdOther",
}, },
yjhj: {
type: "select",
options: this.getDictOptions("business_hjxx"),
fillType: "preFill",
otherCode: "yjhjOther",
},
// yjhj: {
// type: "select",
// options: this.getDictOptions("business_hjxx"),
// fillType: "preFill",
// otherCode: "yjhjOther",
// },
text5: { text5: {
label: ",实际条件为", label: ",实际条件为",
type: "text", type: "text",
@ -197,13 +197,13 @@ export default {
otherCode: "sjwdOther", otherCode: "sjwdOther",
compareTo: "yjwd", compareTo: "yjwd",
}, },
sjhj: {
type: "select",
options: this.getDictOptions("business_hjxx"),
fillType: "actFill",
otherCode: "sjhjOther",
compareTo: "yjhj",
},
// sjhj: {
// type: "select",
// options: this.getDictOptions("business_hjxx"),
// fillType: "actFill",
// otherCode: "sjhjOther",
// compareTo: "yjhj",
// },
text6: { text6: {
label: ",放置", label: ",放置",
type: "text", type: "text",

+ 1
- 0
src/components/Template/StepComponents/ry/tjphcz.vue View File

@ -96,6 +96,7 @@ export default {
ph: { ph: {
type: "inputNumber", type: "inputNumber",
fillType: "actFill", fillType: "actFill",
compareTo: "rm",
}, },
button1: { button1: {
type: "button", type: "button",

+ 1
- 0
src/components/Template/StepComponents/ry/tjphfcz.vue View File

@ -96,6 +96,7 @@ export default {
ph: { ph: {
type: "inputNumber", type: "inputNumber",
fillType: "actFill", fillType: "actFill",
compareTo: "rm",
}, },
text8: { text8: {

+ 3
- 2
src/components/Template/StepComponents/ry/tpjydd.vue View File

@ -105,8 +105,9 @@ import stepMixins from '@/components/Template/mixins/stepMixins.js';
type:"text", type:"text",
}, },
jgpd:{ jgpd:{
label:"通过/不通过",
type:"span",
type:"input",
fillType:"actFill",
disabled:true,
}, },
text9:{ text9:{
label:"。", label:"。",

+ 8
- 6
src/components/Template/StepComponents/ry/tpjysd.vue View File

@ -1,7 +1,7 @@
<!-- 天平校验(双点) --> <!-- 天平校验(双点) -->
<template> <template>
<StepFormPackage :fieldItemLabel = "fieldItemLabel" ref="stepFormPackageRef" :prefixKey="stepIndex+'_'+'ry_tpjysd'" @resetRecord="resetRecord"
@clickButton="handleClickButton" :form-config="formConfig" :formData="formData" />
<StepFormPackage :fieldItemLabel="fieldItemLabel" ref="stepFormPackageRef" :prefixKey="stepIndex + '_' + 'ry_tpjysd'"
@resetRecord="resetRecord" @clickButton="handleClickButton" :form-config="formConfig" :formData="formData" />
</template> </template>
<script> <script>
@ -112,8 +112,9 @@ export default {
type: "text", type: "text",
}, },
dfmjgpd: { dfmjgpd: {
label: "通过/不通过",
type: "span",
type: "input",
fillType: "actFill",
disabled: true,
} }
} }
}, },
@ -202,8 +203,9 @@ export default {
type: "text", type: "text",
}, },
jgpd: { jgpd: {
label: "通过/不通过",
type: "span",
type: "input",
fillType: "actFill",
disabled: true,
}, },
text9: { text9: {
label: "。", label: "。",

+ 2
- 1
src/components/Template/StepFormPackage.vue View File

@ -31,6 +31,7 @@
<template v-else-if="sItem.type === 'button'"> <template v-else-if="sItem.type === 'button'">
<HandleFormItem <HandleFormItem
type="button" type="button"
:field-key="prefixKey+'_' + key"
:item="getButtonItem(sItem)" :item="getButtonItem(sItem)"
@clickButton="(e)=>handleClickButton(e,item,key)" /> @clickButton="(e)=>handleClickButton(e,item,key)" />
</template> </template>
@ -62,7 +63,7 @@
</template> </template>
<div v-show="isShowOther(formFields[key])" class="flex flex1"> <div v-show="isShowOther(formFields[key])" class="flex flex1">
<div class="other-title">{{sItem.otherLabel ? $t(sItem.otherLabel) : $t("template.common.other") }}</div>
<!-- <div class="other-title">{{sItem.otherLabel ? $t(sItem.otherLabel) : $t("template.common.other") }}</div> -->
<HandleFormItem sourceFrom = "step" class="step-row" :field-item-label="fieldItemLabel" :field-key="prefixKey+'_'+sItem.otherCode" @blur="onBlur(key, $event)" :item="getOtherItem(sItem)" <HandleFormItem sourceFrom = "step" class="step-row" :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)"
:error="errors[sItem.otherCode]" @update:error="errors[sItem.otherCode] = false" :error="errors[sItem.otherCode]" @update:error="errors[sItem.otherCode] = false"

+ 1
- 0
src/views/business/comps/template/dialog/SelectInstrumentDialog.vue View File

@ -98,6 +98,7 @@ export default {
if(data && data.uuid) {//eventBusid if(data && data.uuid) {//eventBusid
this.uuid = data.uuid this.uuid = data.uuid
} }
this.selectedId = "";
this.visible = true this.visible = true
setTimeout(() => { setTimeout(() => {
if(this.$refs.selectSjRef){ if(this.$refs.selectSjRef){

+ 3
- 0
src/views/business/comps/template/dialog/SelectMixReagentDialog.vue View File

@ -134,6 +134,9 @@ export default {
this.selectedCode = 'id' this.selectedCode = 'id'
this.qxbdType = data.qxbdType || ''; this.qxbdType = data.qxbdType || '';
} }
this.selectedId = "";
this.otherReagent = "";
this.otherChecked = false;
this.checkType = checkType; this.checkType = checkType;
this.mixType = mixType; this.mixType = mixType;
this.sourceFrom = sourceFrom; this.sourceFrom = sourceFrom;

+ 3
- 0
src/views/business/comps/template/dialog/SelectReagentDialog.vue View File

@ -134,6 +134,8 @@ export default {
if(data && data.uuid) {//eventBusid if(data && data.uuid) {//eventBusid
this.uuid = data.uuid this.uuid = data.uuid
} }
this.selectedId = ""
this.currentRow = {}
this.visible = true this.visible = true
this.studyFormId = studyFormId this.studyFormId = studyFormId
this.showTableData() this.showTableData()
@ -157,6 +159,7 @@ export default {
}, },
onCancel() { onCancel() {
this.visible = false this.visible = false
this.$emit('cancel'); this.$emit('cancel');
}, },
onSubmit() { onSubmit() {

Loading…
Cancel
Save