Browse Source

fix[表单模版]优化

ouqian
lslaiwy 1 month ago
parent
commit
7ea8aaa6b8
5 changed files with 97 additions and 48 deletions
  1. +1
    -1
      src/lang/en/template/dl.js
  2. +1
    -1
      src/lang/zh/template/dl.js
  3. +20
    -14
      src/views/business/comps/template/comps/dl/DL016.vue
  4. +72
    -14
      src/views/business/comps/template/comps/dl/DL022.vue
  5. +3
    -18
      src/views/business/comps/template/comps/dl/DL024.vue

+ 1
- 1
src/lang/en/template/dl.js View File

@ -346,7 +346,7 @@ export default {
dl022: {
czsj: '操作时间',
dlbz: '备注',
gcqk: '观察情况',
jbqk: '畸变情况',
xbmc: '细胞名称',
xwj: '显微镜',

+ 1
- 1
src/lang/zh/template/dl.js View File

@ -339,7 +339,7 @@ export default {
dl022: {
czsj: '操作时间',
dlbz: '备注',
gcqk: '观察情况',
jbqk: '畸变情况',
xbmc: '细胞名称',
xwj: '显微镜',

+ 20
- 14
src/views/business/comps/template/comps/dl/DL016.vue View File

@ -45,13 +45,12 @@ import templateMixin from "../../mixins/templateMixin";
import CustomTable from '@/components/Template/CustomTable.vue';
import { EventBus } from "@/utils/eventBus";
import { uniqeResource } from "@/utils/calUnitTools";
import { debounce } from 'lodash-es'
import TableOpertaionDelete from "@/components/Template/operation/TableOpertaionDelete.vue"
export default {
name: "DL016",
dicts: [
'business_dl_qsxjbltj','business_tjdw'
'business_dl_qsxjbltj','business_tjdw','business_nddw'
],
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable,TableOpertaionDelete },
mixins: [templateMixin],
@ -179,13 +178,25 @@ export default {
bodyDisabled: true,
},
{
label: "template.dl.dl016.qsxjjrl",
prop: "qsxjjrl",
width: 180,
bodyType: "input",
bodyFillType: "actFill",
bodyMaxlength: 10,
// bodyDisabled: true,
// label: "template.dl.dl016.qsxjjrl",
// prop: "qsxjjrl",
// width: 180,
// bodyFillType: "actFill",
// bodyMaxlength: 10,
// headerSelectKey: 'qsxjjrldw',
// fillType: "actFill",
// headerOptions: this.getDictOptions('business_nddw'),
// bodyType: 'inputNumber',
label: "template.dl.dl016.qsxjjrl",
prop: 'qsxjjrl',
width: 280,
headerSelectKey: 'qsxjjrldw',
fillType: "preFill",
headerOptions: this.getDictOptions('business_tjdw'),
bodyType: 'inputNumber',
bodyFillType: 'actFill',
copyFrom: 'ysqyl',
compareTo: 'ysqyl',
}
]
},
@ -195,9 +206,6 @@ export default {
formData: {},
};
},
mounted() {
console.log('mounted=============',this.formData);
},
methods: {
onRegentSubmit(e) {
const { selectInfo, key, rowIndex } = e
@ -261,7 +269,6 @@ export default {
//
async getFormData() {
let content = await this.validFormFields(["baseInfoRef", "swypyjInfoRef", "qcxjjyqkTableRef", "stepRef","remarkRef"]);
console.log('获取填写完成的表单数据==============',content);
return content;
},
getResource() {
@ -274,7 +281,6 @@ export default {
//
async onSave() {
let content = await this.$refs.stepRef.getFormData();
console.log(content);
},
//
// deleteRow(rowIndex) {

+ 72
- 14
src/views/business/comps/template/comps/dl/DL022.vue View File

@ -1,4 +1,4 @@
<!-- 生物分析生物样品采集管制备 -->
<!-- 畸变情况 -->
<template>
<div>
<div class="detail-container">
@ -10,7 +10,7 @@
ref="baseInfoRef" :formConfig="baseInfoFormConfig" :formData="formData" />
<TableList label="template.common.instrumentInfo" :columns="yqColumns" :dataSource="yqResource" />
<LineLabel label="template.dl.dl022.gcqk" />
<LineLabel label="template.dl.dl022.jbqk" />
<!-- 观察情况 -->
<div class="template-form-item">
<BaseInfoFormPackage ref="swypyjInfoRef" fieldItemLabel="template.common.operationSteps"
@ -19,9 +19,9 @@
<div style="color:#999;font-size:14px;">
畸变类型以代号填写断片(b)裂隙(g)互换及射体(t)环状染色体(r)多倍体(p)双着丝点染色体(d)内复制(e)染色体碎化(z)缺失(l)粘着(s)微小体(m)
</div>
<CustomTable :ref="`tableRef`" :columns="tableColumns" :formData="formData"
operationWidth="120px" :prefixKey="`table`" fieldItemLabel="template.dl.dl022.gcqk"
@onAddRow = "onAddRow"
<CustomTable :ref="`tableRef`" :columns="tableColumns" :formData="tableFormData"
operationWidth="120px" :prefixKey="`table`" fieldItemLabel="template.dl.dl022.jbqk"
@onAddRow = "onAddRow" @blur="handleClickButton"
:showAddRow="fillType === 'actFill'" :showOperation="fillType === 'actFill'">
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaionDelete :row="row" :rowIndex="rowIndex" :columns="columns"
@ -50,8 +50,6 @@ import Step from "@/components/Template/Step";
import templateMixin from "../../mixins/templateMixin";
import CustomTable from '@/components/Template/CustomTable.vue';
import { EventBus } from "@/utils/eventBus";
import { uniqeResource } from "@/utils/calUnitTools";
import { debounce } from 'lodash-es'
import TableOpertaionDelete from "@/components/Template/operation/TableOpertaionDelete.vue"
import { getuuid } from "@/utils/index.js";
export default {
@ -68,6 +66,13 @@ export default {
},
},
computed: {
//
tableFormData() {
return {
stepTableFormData: this.formData.stepTableFormData || [],
headerSelectFields: {}
}
},
//
remarkConig() {
return [
@ -169,28 +174,32 @@ export default {
bodyType: 'inputNumber',
bodyFillType: 'actFill',
width: 200,
disabled: true
disabled: true,
bodyDisabled: true,
}, {
label: 'template.dl.dl022.lxjbs',
prop: 'lxjbs',
bodyType: 'inputNumber',
bodyFillType: 'actFill',
width: 200,
disabled: true
disabled: true,
bodyDisabled: true,
}, {
label: 'template.dl.dl022.dbtjbs',
prop: 'dbtjbs',
bodyType: 'inputNumber',
bodyFillType: 'actFill',
width: 200,
disabled: true
disabled: true,
bodyDisabled: true,
}, {
label: 'template.dl.dl022.nfzjbs',
prop: 'nfzjbs',
bodyType: 'inputNumber',
bodyFillType: 'actFill',
width: 200,
disabled: true
disabled: true,
bodyDisabled: true,
}, {
label: 'template.dl.dl022.jblx',
prop: 'jblx',
@ -209,6 +218,14 @@ export default {
currentRowIndex: -1,
};
},
watch: {
formData: {
immediate: true,
handler(v) {
console.log('formData==============',v);
}
},
},
mounted() {
EventBus.$on('onEditSignCallback', this.handleEditSignCallback);
},
@ -216,6 +233,44 @@ export default {
EventBus.$off('onEditSignCallback', this.handleEditSignCallback);
},
methods: {
//
handleClickButton(e, rowIndex) {
console.log('formData==============',e,rowIndex,this.formData);
if(this.formData.stepTableFormData&&this.formData.stepTableFormData.length>0){
const list = this.formData.stepTableFormData;
list.map((item, index) => {
let jblxList = item.jblx;
if(jblxList&&jblxList.length>0){
item.jgjxjbs = this.calculateJgjxjbs(jblxList);
}
})
// 使 $set formData CustomTable
this.$set(this.formData, this.formData)
}
},
//
calculateJgjxjbs(jblxList,countCodes) {
if (!jblxList || jblxList.length === 0) return 0
//
// const countCodes = ['b', 't', 'r', 'd', 'z', 'l', 's', 'm']
let count = 0
for (const it of jblxList) {
if (it.value) {
const val = String(it.value).toLowerCase()
// 1
for (const code of countCodes) {
if (val.includes(code)) {
count++
}
}
}
}
return count
},
handleEditSignCallback(data){
if (data.uuid === this.uuid) {
this.handleEdit();
@ -235,10 +290,14 @@ export default {
this.$message.error('畸变类型还未填写完,请填写完成后再操作')
return
}
item.jgjxjbs = this.calculateJgjxjbs(jblx,['b', 't', 'r', 'd', 'z', 'l', 's', 'm'])
item.lxjbs = this.calculateJgjxjbs(jblx,['g'])
item.dbtjbs = this.calculateJgjxjbs(jblx,['p'])
item.nfzjbs = this.calculateJgjxjbs(jblx,['e'])
EventBus.$emit('showEditSignDialog', { uuid: this.uuid });
this.currentItem = item;
this.currentRowIndex = rowIndex;
this.$refs.tableRef.updateDataSourceByRowIndex(rowIndex, item)
},
//
onAddRow() {
@ -298,7 +357,6 @@ export default {
//
async onSave() {
// stepRef
console.log({});
},
//
deleteRow(rowIndex) {
@ -325,7 +383,7 @@ export default {
EventBus.$emit('onModifyRecord', params);
},
}
};
}
</script>
<style rel="stylesheet/scss" lang="scss">
.edit-button{

+ 3
- 18
src/views/business/comps/template/comps/dl/DL024.vue View File

@ -1,4 +1,4 @@
<!-- 生物分析生物样品采集管制备 -->
<!-- 细胞培养信息 -->
<template>
<div>
<div class="detail-container">
@ -51,14 +51,11 @@ import TableList from "@/components/Template/Table";
import Step from "@/components/Template/Step";
import templateMixin from "../../mixins/templateMixin";
import CustomTable from '@/components/Template/CustomTable.vue';
import { EventBus } from "@/utils/eventBus";
import { uniqeResource } from "@/utils/calUnitTools";
import { debounce } from 'lodash-es'
import TableOpertaionDelete from "@/components/Template/operation/TableOpertaionDelete.vue"
import moment from 'moment'
export default {
name: "dl024",
name: "DL024",
dicts: [
'business_dl_xbmc','business_sydd'
],
@ -211,7 +208,6 @@ export default {
onRegentSubmit(e) {
const { selectInfo, key, rowIndex } = e
const { row } = selectInfo
console.log('选择仪器编号预留===',row)
try {
//
const bdnr = JSON.parse(row.bdnr)
@ -224,13 +220,11 @@ export default {
this.$message.warning('前序表单中没有细胞编号数据')
return
}
console.log('选择仪器编号预留=2==',stepTableFormData)
//
const itemData = stepTableFormData.map(item => ({
xbbh: item.jzlybh || '', //
xbbh: item.targetSolutionCode+'-'+item.subTargetSolutionCode, //
}))
// 使 $set formData CustomTable
console.log('选择仪器编号预留=3==',itemData)
this.$set(this.formData, 'stepTableFormData', itemData)
this.$message.success(`已从前序表单加载 ${itemData.length} 条细胞编号数据`)
@ -239,14 +233,6 @@ export default {
console.error('解析前序表单数据失败:', error)
this.$message.error('解析前序表单数据失败')
}
// if (key === 'qxbd' && this.$refs.tableRef) {
// const params = {
// yqmc: row.xbbh,
// yqxh: row.xh,
// xccsjzjdrq: row.jzrq
// }
// this.$refs.tableRef.updateDataSourceByRowIndex(rowIndex, params)
// }
},
onFormSelect(fields){
this.onHandleBlur(fields)
@ -268,7 +254,6 @@ export default {
//
async onSave() {
// stepRef
console.log({});
},
//
deleteRow(rowIndex) {

Loading…
Cancel
Save