Browse Source

feat:[模板管理][update]

zhangteng
luojie 3 days ago
parent
commit
4b60b7e0bf
8 changed files with 53 additions and 39 deletions
  1. +1
    -1
      src/components/Template/BaseInfoFormPackage.vue
  2. +14
    -0
      src/components/Template/HandleFormItem.vue
  3. +2
    -2
      src/components/Template/mixins/stepMixins.js
  4. +1
    -1
      src/utils/formPackageCommon.js
  5. +18
    -19
      src/views/business/comps/template/comps/sp/SP0021.vue
  6. +3
    -2
      src/views/business/comps/template/dialog/SubPackageDialog.vue
  7. +13
    -13
      src/views/business/comps/template/formConfig/sp/SP0019.js
  8. +1
    -1
      src/views/business/comps/template/formConfig/sp/SP0020.js

+ 1
- 1
src/components/Template/BaseInfoFormPackage.vue View File

@ -345,7 +345,7 @@
<div class="p-r-20 item-center" :class="sItem.span == 1 ? 'full-row' : ''">
<div class="form-title mr-20 checkboxList-title">{{ $t(sItem.label) }}</div>
<div class="flex flex1">
<HandleFormItem v-if="sItem.type === 'checkboxTree'" :field-item-label="fieldItemLabel"
<HandleFormItem v-if="sItem.type === 'checkboxTree' || sItem.type === 'radioTree'" :field-item-label="fieldItemLabel"
:field-key="prefixKey + '_' + key" :type="sItem.type" :item="sItem"
:value="formFields[key]" @change="(e) => onAttachmentChange(key, e)"
:error="errors[key]" @update:error="errors[key] = false"

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

@ -70,6 +70,16 @@
</div>
</div>
</div>
<div v-else-if="type === 'radioTree'" class="flex1 radio-tree-container"
:class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '') + (error ? ' form-error-border' : '') + (item.noBorder ? ' no-border' : '') + (item.layout === 'horizontal' ? ' flex' : '')">
<el-radio-group v-model="inputValue" :disabled="getDisabled()" @change="onRadioTreeChange">
<div v-for="option in item.options" :key="option.value" class="radio-tree-item">
<el-radio :label="option.value">
{{ option.label }}
</el-radio>
</div>
</el-radio-group>
</div>
<el-date-picker v-else-if="type === 'dateTime' || type === 'datePicker'"
:type="type === 'dateTime' ? 'datetime' : 'date'" class="flex1"
:class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')" v-model="inputValue"
@ -852,6 +862,10 @@ export default {
onItemCheckboxChange() {
this.onCommonHandleSaveRecord(this.inputValue);
},
onRadioTreeChange(val) {
this.inputValue = val;
this.onCommonHandleSaveRecord(this.inputValue);
},
//
onSelectBlur(visible) {
if (!visible) {

+ 2
- 2
src/components/Template/mixins/stepMixins.js View File

@ -182,10 +182,9 @@ export default {
if (buttonName === '分装') {
const stepFormData = this.getFilledFormData()
const fzInfo = stepFormData.fzInfo || this.formData.fzInfo;
let fields = [], options = []
let fields = [], options = [],result = {};
let maxVolume, maxVolumeUnit;
if (this.getMybh || this.getMybhByIndex) {//某些表单的步骤需要分装表单上的数据
let result = {};
if (this.getMybh) {
result = this.getMybh()
} else if (this.getMybhByIndex) {
@ -220,6 +219,7 @@ export default {
mybhOptions: options,
maxVolumeUnit,
uuid: this.uuid,
myInfo:result,
})
} else if (buttonName === '获取值') {
const { dataSource, dwField = "", fillField,fillDwField = "", yqCode } = e;

+ 1
- 1
src/utils/formPackageCommon.js View File

@ -21,7 +21,7 @@ export const isShowOtherByRadioAndOther = (v = '', col) => {
//checkboxTree判断是否显示其他输入框
export const isShowOtherByCheckboxTree = (v = "") => {
const otherArr = ['其他', '其它', '样品信息', '样品', '部分接受', '给药 ',
const otherArr = ['其他', '其它', '样品信息', '样品', '部分接受','分析批拒绝', '给药 ',
'样本采集',
'日常观察 ',
'皮肤评分',

+ 18
- 19
src/views/business/comps/template/comps/sp/SP0021.vue View File

@ -26,10 +26,11 @@
</el-popconfirm>
</div>
<BaseInfoFormPackage fieldItemLabel="样本说明" :ref="`ybsmFormPackageRef${index}`"
:prefixKey = "'ybsm_'+index"
:formConfig="ybsmFormConfig" @blur="onHandleBlur" :formData="item" />
<el-button v-if="fillType === 'actFill'" type="primary"
@click="onImportAnimal(item, index)">导入动物</el-button>
<CustomTable :ref="`ybsmTableRef${index}`" :columns="ybsmColumns"
<CustomTable :ref="`ybsmTableRef${index}`" :columns="ybsmColumns" :prefixKey = "'ybsm_table_'+index"
:showOperation="fillType === 'actFill'" :showAddRow="fillType === 'actFill'"
:formData="item" @clickButton="(e, rowIndex,colIndex,ee,data)=>handleClickButton(e, rowIndex,colIndex,ee,data,index)">
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
@ -38,7 +39,7 @@
</TableOpertaionDelete>
</template>
</CustomTable>
<Step :ref="`stepRef${index}`" :formData="item.stepData || []"></Step>
<Step :ref="`stepRef${index}`" :prefixKey = "'ybsm_step_'+index" :formData="item.stepData || []"></Step>
</div>
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark"
:ref="refConfig.remarkRef" :formConfig="remarkConig" :formData="formData" />
@ -208,19 +209,17 @@ export default {
//
async getFormData() {
//
let content = await this.validFormFields(compRefs);
if (!content) return null;
const refs = [];
//
for (let index = 0; index < this.formData.ybsmDataList.length; index++) {
refs.push(`ybsmFormPackageRef${index}`)
refs.push(`ybsmTableRef${index}`)
refs.push(`stepRef${index}`)
//
const ybsmFormValid = await this.$refs[`ybsmFormPackageRef${index}`][0]?.getFormData() || true;
if (!ybsmFormValid) return null;
//
const stepValid = await this.$refs[`stepRef${index}`][0]?.getFormData() || true;
if (!stepValid) return null;
}
let content = await this.validFormFields([...compRefs, ...refs]);
if (!content) return null;
//
return this.getFilledFormData();
@ -232,23 +231,23 @@ export default {
//使
let allSjResource = [];
let allYqResource = [];
const {ybsmDataList = []} = content
//
for (let index = 0; index < this.formData.ybsmDataList.length; index++) {
const stepResource = this.$refs[`stepRef${index}`][0]?.getStepResource() || { sjResource: [], yqResource: [] };
for (let index = 0; index < ybsmDataList.length; index++) {
const stepResource = ybsmDataList[index].stepData || { sjResource: [], yqResource: [] };
allSjResource = [...allSjResource, ...(stepResource.sjResource || [])];
allYqResource = [...allYqResource, ...(stepResource.yqResource || [])];
}
for(var i=0;i<this.formData.ybsmDataList.length;i++){
for(var i=0;i<ybsmDataList.length;i++){
allYqResource.push({
mc: this.formData.ybsmDataList[i].selectInfo_xztp.mc,
xh: this.formData.ybsmDataList[i].selectInfo_xztp.xh,
bh: this.formData.ybsmDataList[i].selectInfo_xztp.bh,
jzrq: this.formData.ybsmDataList[i].selectInfo_xztp.jzrq,
mc: ybsmDataList[i].selectInfo_xztp.mc,
xh: ybsmDataList[i].selectInfo_xztp.xh,
bh: ybsmDataList[i].selectInfo_xztp.bh,
jzrq: ybsmDataList[i].selectInfo_xztp.jzrq,
})
}
this.resourceTmp = uniqeResource(tmpResource, allSjResource)
this.yqResourceTmp = uniqeYqOne(allYqResource)
debugger
return this.resourceTmp;
},
//

+ 3
- 2
src/views/business/comps/template/dialog/SubPackageDialog.vue View File

@ -110,6 +110,7 @@ export default {
uuid: getuuid(),//id
mybhOptions: [],//
id: "",//id
myInfo: {},//
}
},
computed: {
@ -174,7 +175,7 @@ export default {
}
this.id = data.id;
this.myInfo = cloneData.myInfo;
this.formData = cloneData;
//
this.resetErrors();
@ -224,7 +225,7 @@ export default {
}
},
handleSubmit() {
EventBus.$emit('dialogSubPackageSubmit', { ...this.formData, fzList: this.fzList, uuid: this.uuid });
EventBus.$emit('dialogSubPackageSubmit', { ...this.formData, fzList: this.fzList, uuid: this.uuid, myInfo: this.myInfo });
setTimeout(() => {
this.close();
}, 500);

+ 13
- 13
src/views/business/comps/template/formConfig/sp/SP0019.js View File

@ -43,19 +43,19 @@ export const getBaseInfoFormConfig = (formType) => {
type: 'input',
disabled: true
},
methodCode: {
label: 'template.common.methodCode',
type: 'input',
fillType: formType === 'sp0020' ? 'actFill' : 'preFill',
maxlength: 50
},
versionNum: {
label: 'template.common.versionNumber',
type: 'inputNumber',
fillType: formType === 'sp0020' ? 'actFill' : 'preFill',
prepend: 'V',
maxlength: 50
},
// methodCode: {
// label: 'template.common.methodCode',
// type: 'input',
// fillType: formType === 'sp0020' ? 'actFill' : 'preFill',
// maxlength: 50
// },
// versionNum: {
// label: 'template.common.versionNumber',
// type: 'inputNumber',
// fillType: formType === 'sp0020' ? 'actFill' : 'preFill',
// prepend: 'V',
// maxlength: 50
// },
clpbh: {
label: '处理批编号',
type: 'input',

+ 1
- 1
src/views/business/comps/template/formConfig/sp/SP0020.js View File

@ -94,7 +94,7 @@ export const getYqjgFormConfig = () => {
type: 'checkboxList',
config: {
jg: {
type: 'checkboxTree',
type: 'radioTree',
label: '结果',
options: [
{ label: '分析批接受', value: '分析批接受' },

Loading…
Cancel
Save