Browse Source

feat:[模板管理][全局TableOpertion新增columns字段]

lkf
luojie 2 months ago
parent
commit
6099522cbb
17 changed files with 98 additions and 74 deletions
  1. +1
    -1
      src/components/Template/CustomTable.vue
  2. +13
    -0
      src/components/Template/operation/TableOpertaion.vue
  3. +2
    -2
      src/views/business/comps/template/comps/dl/SYWZPZJHB.vue
  4. +2
    -2
      src/views/business/comps/template/comps/gsp/SYWZPZJHB.vue
  5. +52
    -51
      src/views/business/comps/template/comps/sp/SWYPBQGZYZBB.vue
  6. +2
    -1
      src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/CBYDB.vue
  7. +2
    -1
      src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/CBYHGZYWDX.vue
  8. +2
    -1
      src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/JZXY.vue
  9. +2
    -1
      src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/QXWDX.vue
  10. +2
    -1
      src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/RXJZXY.vue
  11. +4
    -4
      src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/Recovery.vue
  12. +2
    -1
      src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/XSKKX.vue
  13. +2
    -1
      src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/XZXHTYX.vue
  14. +2
    -1
      src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/ZDYBS.vue
  15. +2
    -1
      src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/ZQDYJMD.vue
  16. +2
    -1
      src/views/business/comps/template/comps/sp/SWYPFXFFXZKPZB.vue
  17. +4
    -4
      src/views/business/comps/template/comps/sp/SWYPNBGZYZBB.vue

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

@ -127,7 +127,7 @@
<!-- 默认操作栏 -->
<div class="custom-table-cell body-cell" :style="{ width: '245px' }" v-if="showOperation">
<div class="inner-table-cell">
<slot name="operation" :row="row" :rowIndex="rowIndex"></slot>
<slot name="operation" :row="row" :rowIndex="rowIndex" :columns = "columns"></slot>
</div>
</div>
</div>

+ 13
- 0
src/components/Template/operation/TableOpertaion.vue View File

@ -24,6 +24,10 @@ export default {
type: Object,
default: () => { },
},
columns: {
type: Array,
default: [],
},
rowIndex: {
type: Number,
default: 0,
@ -48,6 +52,15 @@ export default {
},
//
onSubPackage() {
console.log(this.row,this.columns,"this.row")
const {columns,row} = this;
const col = columns.find((item)=>item.myCodeFields);
const {myCodeFields} = col;
const fields = [];
myCodeFields.forEach((key)=>{
fields.push(row[key])
})
console.log(fields,"fields")
this.$emit("subPackage", this.row)
},
//

+ 2
- 2
src/views/business/comps/template/comps/dl/SYWZPZJHB.vue View File

@ -14,8 +14,8 @@
:formData="formData" />
<CustomTable @blur="onHandleTableBlur" :showHeaderSelect="fillType === 'actFill'" :showOperation="fillType === 'actFill'" ref="stepTableRef" :columns="stepColumns"
:formData="formData" >
<template slot="operation" slot-scope="{ row, rowIndex}">
<TableOpertaion :fillType="fillType" :row="row" :rowIndex="rowIndex" @deleteRow="deleteRow"></TableOpertaion>
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion :fillType="fillType" :row="row" :rowIndex="rowIndex" :columns="columns" @deleteRow="deleteRow"></TableOpertaion>
</template>
</CustomTable>
<div class="add-row">

+ 2
- 2
src/views/business/comps/template/comps/gsp/SYWZPZJHB.vue View File

@ -14,8 +14,8 @@
:formData="formData" />
<CustomTable @blur="onHandleTableBlur" :showHeaderSelect="fillType === 'actFill'" :showAddRow="fillType === 'actFill'" :showOperation="fillType === 'actFill'" ref="stepTableRef" :columns="stepColumns"
:formData="formData" >
<template slot="operation" slot-scope="{ row, rowIndex}">
<TableOpertaionDelete :row="row" :rowIndex="rowIndex" @deleteRow="deleteRow" ></TableOpertaionDelete>
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaionDelete :row="row" :rowIndex="rowIndex" :columns="columns" @deleteRow="deleteRow" ></TableOpertaionDelete>
</template>
</CustomTable>
</div>

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

@ -2,8 +2,8 @@
<template>
<div>
<div class="detail-container">
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{formData.templateMc || "生物样品标曲工作液制备表"}}<img
src="@/assets/images/detail-title.png" /></div>
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.templateMc ||
"生物样品标曲工作液制备表" }}<img src="@/assets/images/detail-title.png" /></div>
<div class="detail-content">
<div class="content">
<BaseInfoFormPcakge label="试验基本信息" ref="baseInfoRef" :formConfig="baseInfoFormConfig"
@ -14,12 +14,14 @@
:formData="formData" />
<LineLabel label="操作步骤" />
<div class="template-form-item">
<BaseInfoFormPcakge @clickable="handleClickable" ref="stepFormPackageRef" :formConfig="stepFormConfig" @blur="onHandleBlur"
:formData="formData" />
<CustomTable fieldItemLabel = "操作步骤" @blur="onHandleTableBlur" :showAddRow="false" :showOperation="fillType==='actFill'" ref="stepTableRef" :columns="stepColumns"
:formData="formData" >
<template slot="operation" slot-scope="{ row, rowIndex}">
<TableOpertaion :fillType="fillType" :row="row" :rowIndex="rowIndex" @deleteRow="deleteRow"></TableOpertaion>
<BaseInfoFormPcakge @clickable="handleClickable" ref="stepFormPackageRef"
:formConfig="stepFormConfig" @blur="onHandleBlur" :formData="formData" />
<CustomTable fieldItemLabel="操作步骤" @blur="onHandleTableBlur" :showAddRow="false"
:showOperation="fillType === 'actFill'" ref="stepTableRef" :columns="stepColumns"
:formData="formData">
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion :fillType="fillType" :row="row" :rowIndex="rowIndex" :columns="columns"
@deleteRow="deleteRow"></TableOpertaion>
</template>
</CustomTable>
</div>
@ -30,9 +32,7 @@
</div>
<!-- <button @click="onSave">保存</button> -->
</div>
<SelectReagentDialog
@submit="onSelectReagentSubmit"
ref="selectReagentDialogRef" >
<SelectReagentDialog @submit="onSelectReagentSubmit" ref="selectReagentDialogRef">
</SelectReagentDialog>
</div>
</template>
@ -46,11 +46,11 @@ import templateMixin from "../../mixins/templateMixin";
import CustomTable from '@/components/Template/CustomTable.vue';
import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue';
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue";
import {EventBus} from "@/utils/eventBus";
import { EventBus } from "@/utils/eventBus";
export default {
name: "SWYPBQGZYZBB",
components: { BaseInfoFormPcakge, LineLabel, TableList, Step, CustomTable, SelectReagentDialog, TableOpertaion },
components: { BaseInfoFormPcakge, LineLabel, TableList, Step, CustomTable, SelectReagentDialog, TableOpertaion },
mixins: [templateMixin],
props: {
fillType: {
@ -62,7 +62,7 @@ export default {
fillType: {
immediate: true,
handler(v) {
if(v &&this.fillType === "actFill"){
if (v && this.fillType === "actFill") {
this.handleUpdateCode();
}
}
@ -132,7 +132,7 @@ export default {
label: "版本号",
type: "inputNumber",
fillType: "actFill",
prepend:"V",
prepend: "V",
maxlength: 50,
},
@ -268,10 +268,11 @@ export default {
bodySubType: "span",
bodySubKey: "subTargetSolutionCode",
bodyFillType: "preFill",
width: 280
width: 280,
myCodeFields: ["targetSolutionCode", "subTargetSolutionCode"],
},
{
label: "起始溶液编号",
label: "起始溶液编号",
prop: "startSolutionCode",
width: 280,
bodyType: "input",
@ -279,7 +280,7 @@ export default {
bodyMaxlength: 10,
},
{
label: "预设起始溶液体积",
label: "预设起始溶液体积",
prop: "targetStartSolutionVolume",
width: 280,
headerSelectKey: "targetStartSolutionVolumeUnit",
@ -297,7 +298,7 @@ export default {
bodySubPlaceholder: "请输入保留小数位数",
},
{
label: "实际起始溶液体积",
label: "实际起始溶液体积",
prop: "actStartSolutionVolume",
width: 280,
headerSelectKey: "actStartSolutionVolumeUnit",
@ -310,7 +311,7 @@ export default {
copyFrom: "targetStartSolutionVolume",//
},
{
label: "预设稀释液体积",
label: "预设稀释液体积",
prop: "targetDiluentVolume",
width: 280,
headerSelectKey: "targetDiluentVolumeUnit",
@ -328,7 +329,7 @@ export default {
bodySubPlaceholder: "请输入保留小数位数",
},
{
label: "实际稀释液体积",
label: "实际稀释液体积",
prop: "actDiluentVolume",
width: 280,
headerSelectKey: "actDiluentVolumeUnit",
@ -341,7 +342,7 @@ export default {
copyFrom: "targetDiluentVolume",//
},
{
label: "预设目标溶液浓度",
label: "预设目标溶液浓度",
prop: "targetSolutionConcentration",
width: 280,
headerSelectKey: "targetSolutionConcentrationUnit",
@ -352,7 +353,7 @@ export default {
bodyMaxlength: 10,
},
{
label: "实际目标溶液浓度",
label: "实际目标溶液浓度",
prop: "actSolutionConcentration",
width: 280,
headerSelectKey: "actSolutionConcentrationUnit",
@ -369,8 +370,8 @@ export default {
bodyMaxlength: 10,
bodySubPlaceholder: "请输入保留小数位数",
},
{
label: "预设目标溶液体积",
{
label: "预设目标溶液体积",
prop: "targetSolutionVolume",
width: 280,
headerSelectKey: "targetSolutionVolumeUnit",
@ -381,7 +382,7 @@ export default {
bodyMaxlength: 10,
},
{
label: "实际目标溶液体积",
label: "实际目标溶液体积",
prop: "actSolutionVolume",
width: 280,
headerSelectKey: "actSolutionVolumeUnit",
@ -413,46 +414,46 @@ export default {
methods: {
//
async handleUpdateCode() {
const {stepTableFormData = []} = this.formData;
if(stepTableFormData.length === 0){
const { stepTableFormData = [] } = this.formData;
if (stepTableFormData.length === 0) {
return;
}
const hasAnyWithValue = stepTableFormData.some(row =>
row.subTargetSolutionCode && row.subTargetSolutionCode.trim() !== '');
if(hasAnyWithValue){
const hasAnyWithValue = stepTableFormData.some(row =>
row.subTargetSolutionCode && row.subTargetSolutionCode.trim() !== '');
if (hasAnyWithValue) {
return;
}
const snList = await this.getLatestSn(stepTableFormData.length);
stepTableFormData.forEach((item,index) => {
this.$refs.stepTableRef.updateDataSourceByRowIndex(index,{subTargetSolutionCode: stepTableFormData.length==1?snList:snList[index]});
stepTableFormData.forEach((item, index) => {
this.$refs.stepTableRef.updateDataSourceByRowIndex(index, { subTargetSolutionCode: stepTableFormData.length == 1 ? snList : snList[index] });
})
this.$nextTick(() => {
//
const params = {
type: "fieldChanged",
newRecord: null,
resourceList: null,
}
type: "fieldChanged",
newRecord: null,
resourceList: null,
}
EventBus.$emit('onModifyRecord', params,)
})
},
//
getFilledFormData(){
return this.getFilledFormDataByRefs(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "stepRef", "remarkRef","stepTableRef"])
getFilledFormData() {
return this.getFilledFormDataByRefs(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "stepRef", "remarkRef", "stepTableRef"])
},
handleClickable(item) {
if(this.fillType === "preFill"){
if (this.fillType === "preFill") {
return;
}
const {subKey = ""} = item;
if(subKey === "subStartSolution" || subKey === "subSolution"){//
const { subKey = "" } = item;
if (subKey === "subStartSolution" || subKey === "subSolution") {//
this.$refs.selectReagentDialogRef.show()
this.currentSubKey = subKey;
}
},
//
onSelectReagentSubmit(code,row){
if(this.currentSubKey === "subStartSolution"){//
onSelectReagentSubmit(code, row) {
if (this.currentSubKey === "subStartSolution") {//
this.$refs.stepFormPackageRef.updateFormData("targetAcSolution", row.nd);
this.updateStepTableData(row);
}
@ -460,12 +461,12 @@ export default {
this.$refs.selectReagentDialogRef.onCancel()
},
//table
updateStepTableData(row){
const {stepTableFormData = []} = this.formData;
updateStepTableData(row) {
const { stepTableFormData = [] } = this.formData;
//
const newStepTableData = JSON.parse(JSON.stringify(stepTableFormData));
//
for (let i = 0; i < newStepTableData.length; i++) {
if (i === 0) {
@ -477,16 +478,16 @@ export default {
newStepTableData[i].startSolutionCode = newStepTableData[i - 1].targetSolutionCode;
}
}
// stepTableRef
this.$refs.stepTableRef.updateDataSource(newStepTableData);
},
async getFormData() {
return await this.validFormFields(["baseInfoRef", "storageConditionRef","stepFormPackageRef","stepTableRef","stepRef","remarkRef"]);
return await this.validFormFields(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "stepTableRef", "stepRef", "remarkRef"]);
},
async onSave() {
// const formData = await this.getFormData();
const formData = await this.validFormFields(["baseInfoRef", "storageConditionRef","stepFormPackageRef","stepTableRef","stepRef","remarkRef"]);
const formData = await this.validFormFields(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "stepTableRef", "stepRef", "remarkRef"]);
console.log(formData, "formData")
}

+ 2
- 1
src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/CBYDB.vue View File

@ -28,11 +28,12 @@
@clickable="handleClickable"
fieldItemLabel = "template.common.operationSteps"
>
<template slot="operation" slot-scope="{ row, rowIndex}">
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion
:fillType="fillType"
:row="row"
:rowIndex="rowIndex"
:columns="columns"
@deleteRow="(rowIndex) => deleteRow(rowIndex)"
></TableOpertaion>
</template>

+ 2
- 1
src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/CBYHGZYWDX.vue View File

@ -28,11 +28,12 @@
@clickable="handleClickable"
fieldItemLabel = "template.common.operationSteps"
>
<template slot="operation" slot-scope="{ row, rowIndex}">
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion
:fillType="fillType"
:row="row"
:rowIndex="rowIndex"
:columns="columns"
@deleteRow="(rowIndex) => deleteRow(rowIndex)"
></TableOpertaion>
</template>

+ 2
- 1
src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/JZXY.vue View File

@ -26,11 +26,12 @@
@clickable="handleClickable"
fieldItemLabel = "template.common.operationSteps"
>
<template slot="operation" slot-scope="{ row, rowIndex}">
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion
:fillType="fillType"
:row="row"
:rowIndex="rowIndex"
:columns="columns"
@deleteRow="(rowIndex) => deleteRow(rowIndex)"
></TableOpertaion>
</template>

+ 2
- 1
src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/QXWDX.vue View File

@ -28,11 +28,12 @@
@clickable="handleClickable"
fieldItemLabel = "template.common.operationSteps"
>
<template slot="operation" slot-scope="{ row, rowIndex}">
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion
:fillType="fillType"
:row="row"
:rowIndex="rowIndex"
:columns="columns"
@deleteRow="(rowIndex) => deleteRow(rowIndex)"
></TableOpertaion>
</template>

+ 2
- 1
src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/RXJZXY.vue View File

@ -28,11 +28,12 @@
@clickable="handleClickable"
fieldItemLabel = "template.common.operationSteps"
>
<template slot="operation" slot-scope="{ row, rowIndex}">
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion
:fillType="fillType"
:row="row"
:rowIndex="rowIndex"
:columns="columns"
@deleteRow="(rowIndex) => deleteRow(rowIndex)"
></TableOpertaion>
</template>

+ 4
- 4
src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/Recovery.vue View File

@ -23,8 +23,8 @@
<CustomTable @blur="onHandleTableBlur" :ref="`tableRef`" :columns="tableStepColumns"
:formData="formData" :prefixKey="`table`" @clickable="handleClickable"
fieldItemLabel="template.common.operationSteps">
<template slot="operation" slot-scope="{ row, rowIndex}">
<TableOpertaion :fillType="fillType" :row="row" :rowIndex="rowIndex"
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion :fillType="fillType" :row="row" :rowIndex="rowIndex" :columns="columns"
@deleteRow="(rowIndex) => deleteRow(rowIndex)"></TableOpertaion>
</template>
</CustomTable>
@ -38,8 +38,8 @@
<CustomTable @blur="onHandleTableBlur" :ref="`rongyeTableRef`" :columns="rongyeTableStepColumns"
:formData="{stepTableFormData:formData.stepTableFormData_1,headerSelectFields:formData.headerSelectFields_1}" :prefixKey="`rongyeTable`" @clickable="handleRongyeTableClickable"
fieldItemLabel="template.common.operationSteps">
<template slot="operation" slot-scope="{ row, rowIndex}">
<TableOpertaion :fillType="fillType" :row="row" :rowIndex="rowIndex"
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion :fillType="fillType" :row="row" :rowIndex="rowIndex" :columns="columns"
@deleteRow="(rowIndex) => deleteRow(rowIndex)"></TableOpertaion>
</template>
</CustomTable>

+ 2
- 1
src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/XSKKX.vue View File

@ -28,11 +28,12 @@
@clickable="handleClickable"
fieldItemLabel = "template.common.operationSteps"
>
<template slot="operation" slot-scope="{ row, rowIndex}">
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion
:fillType="fillType"
:row="row"
:rowIndex="rowIndex"
:columns="columns"
@deleteRow="(rowIndex) => deleteRow(rowIndex)"
></TableOpertaion>
</template>

+ 2
- 1
src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/XZXHTYX.vue View File

@ -28,11 +28,12 @@
@clickable="handleClickable"
fieldItemLabel = "template.common.operationSteps"
>
<template slot="operation" slot-scope="{ row, rowIndex}">
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion
:fillType="fillType"
:row="row"
:rowIndex="rowIndex"
:columns="columns"
@deleteRow="(rowIndex) => deleteRow(rowIndex)"
></TableOpertaion>
</template>

+ 2
- 1
src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/ZDYBS.vue View File

@ -28,11 +28,12 @@
@clickable="handleClickable"
fieldItemLabel = "template.common.operationSteps"
>
<template slot="operation" slot-scope="{ row, rowIndex}">
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion
:fillType="fillType"
:row="row"
:rowIndex="rowIndex"
:columns="columns"
@deleteRow="(rowIndex) => deleteRow(rowIndex)"
></TableOpertaion>
</template>

+ 2
- 1
src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/ZQDYJMD.vue View File

@ -28,11 +28,12 @@
@clickable="handleClickable"
fieldItemLabel = "template.common.operationSteps"
>
<template slot="operation" slot-scope="{ row, rowIndex}">
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion
:fillType="fillType"
:row="row"
:rowIndex="rowIndex"
:columns="columns"
@deleteRow="(rowIndex) => deleteRow(rowIndex)"
></TableOpertaion>
</template>

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

@ -28,11 +28,12 @@
@clickable="handleClickable"
fieldItemLabel = "template.common.operationSteps"
>
<template slot="operation" slot-scope="{ row, rowIndex}">
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion
:fillType="fillType"
:row="row"
:rowIndex="rowIndex"
:columns="columns"
@deleteRow="(rowIndex) => deleteRow(rowIndex)"
></TableOpertaion>
</template>

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

@ -34,8 +34,8 @@
<CustomTable @blur="(e)=>onHandleTableBlur('ladder', ladderIndex,e)" :ref="`ladderStepTableRef_${ladderIndex}`"
:columns="ladderStepColumns" :formData="ladderConfig" :prefixKey="'ladder_' + ladderIndex"
fieldItemLabel="阶梯配制">
<template slot="operation" slot-scope="{ row, rowIndex}">
<TableOpertaion :fillType="fillType" :row="row" :rowIndex="rowIndex"
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion :fillType="fillType" :row="row" :rowIndex="rowIndex" :columns="columns"
@deleteRow="(rowIndex) => deleteRow(rowIndex, 'ladder', ladderIndex)">
</TableOpertaion>
</template>
@ -65,8 +65,8 @@
:columns="paralleStepColumns" :formData="paralleConfig"
@clickable="(col,rowIndex) => handleTableClickable('paralle', paralleIndex, col,rowIndex)"
:prefixKey="'paralle' + paralleIndex" fieldItemLabel="平行配制">
<template slot="operation" slot-scope="{ row, rowIndex}">
<TableOpertaion :fillType="fillType" :row="row" :rowIndex="rowIndex"
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion :fillType="fillType" :row="row" :rowIndex="rowIndex" :columns="columns"
@deleteRow="(rowIndex) => deleteRow(rowIndex, 'paralle', paralleIndex)">
</TableOpertaion>
</template>

Loading…
Cancel
Save