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: { dl022: {
czsj: '操作时间', czsj: '操作时间',
dlbz: '备注', dlbz: '备注',
gcqk: '观察情况',
jbqk: '畸变情况',
xbmc: '细胞名称', xbmc: '细胞名称',
xwj: '显微镜', xwj: '显微镜',

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

@ -339,7 +339,7 @@ export default {
dl022: { dl022: {
czsj: '操作时间', czsj: '操作时间',
dlbz: '备注', dlbz: '备注',
gcqk: '观察情况',
jbqk: '畸变情况',
xbmc: '细胞名称', xbmc: '细胞名称',
xwj: '显微镜', 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 CustomTable from '@/components/Template/CustomTable.vue';
import { EventBus } from "@/utils/eventBus"; import { EventBus } from "@/utils/eventBus";
import { uniqeResource } from "@/utils/calUnitTools"; import { uniqeResource } from "@/utils/calUnitTools";
import { debounce } from 'lodash-es'
import TableOpertaionDelete from "@/components/Template/operation/TableOpertaionDelete.vue" import TableOpertaionDelete from "@/components/Template/operation/TableOpertaionDelete.vue"
export default { export default {
name: "DL016", name: "DL016",
dicts: [ dicts: [
'business_dl_qsxjbltj','business_tjdw'
'business_dl_qsxjbltj','business_tjdw','business_nddw'
], ],
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable,TableOpertaionDelete }, components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable,TableOpertaionDelete },
mixins: [templateMixin], mixins: [templateMixin],
@ -179,13 +178,25 @@ export default {
bodyDisabled: true, 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: {}, formData: {},
}; };
}, },
mounted() {
console.log('mounted=============',this.formData);
},
methods: { methods: {
onRegentSubmit(e) { onRegentSubmit(e) {
const { selectInfo, key, rowIndex } = e const { selectInfo, key, rowIndex } = e
@ -261,7 +269,6 @@ export default {
// //
async getFormData() { async getFormData() {
let content = await this.validFormFields(["baseInfoRef", "swypyjInfoRef", "qcxjjyqkTableRef", "stepRef","remarkRef"]); let content = await this.validFormFields(["baseInfoRef", "swypyjInfoRef", "qcxjjyqkTableRef", "stepRef","remarkRef"]);
console.log('获取填写完成的表单数据==============',content);
return content; return content;
}, },
getResource() { getResource() {
@ -274,7 +281,6 @@ export default {
// //
async onSave() { async onSave() {
let content = await this.$refs.stepRef.getFormData(); let content = await this.$refs.stepRef.getFormData();
console.log(content);
}, },
// //
// deleteRow(rowIndex) { // deleteRow(rowIndex) {

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

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

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

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

Loading…
Cancel
Save