Browse Source

fix:[模板管理]DL003

ouqian
15881625488@163.com 1 month ago
parent
commit
c8eb402a4b
2 changed files with 169 additions and 98 deletions
  1. +15
    -0
      src/utils/calUnitTools.js
  2. +154
    -98
      src/views/business/comps/template/comps/dl/DL003.vue

+ 15
- 0
src/utils/calUnitTools.js View File

@ -182,3 +182,18 @@ export function uniqeResourceOne(newList) {
} }
return resultList return resultList
} }
//仪器去重
export function uniqeYqOne(newList) {
let resultList = []
for (var i = 0; i < newList.length; i++) {
let _index = _.findIndex(resultList, function (item) {
return (
item.bh == newList[i].bh
)
})
if (_index <0) {
resultList.push(newList[i])
}
}
return resultList
}

+ 154
- 98
src/views/business/comps/template/comps/dl/DL003.vue View File

@ -8,78 +8,42 @@
</div> </div>
<div class="detail-content"> <div class="detail-content">
<div class="content"> <div class="content">
<BaseInfoFormPackage
fieldItemLabel="template.common.baseInfo"
label="template.common.baseInfo"
:ref="refConf.base"
:formConfig="baseInfoFormConfig"
:formData="formData"
/>
<BaseInfoFormPackage fieldItemLabel="template.common.baseInfo" label="template.common.baseInfo"
:ref="refConf.base" :formConfig="baseInfoFormConfig" :formData="formData" />
<!-- <LineLabel label="template.dl.dl003.sysj" /> --> <!-- <LineLabel label="template.dl.dl003.sysj" /> -->
<TableList label="template.common.reagentInfo" :columns="sysjColumns" :dataSource="resource" /> <TableList label="template.common.reagentInfo" :columns="sysjColumns" :dataSource="resource" />
<LineLabel label="template.dl.dl007.yqsyxx" /> <LineLabel label="template.dl.dl007.yqsyxx" />
<CustomTable
:columns="yqsyColumns"
:ref="refConf.yqsy"
@onRegentSubmit="(e) => onRegentSubmit(e)"
:showOperation="fillType === 'actFill'"
:showAddRow="fillType === 'actFill'"
:formData="formData"
:prefixKey="`yqsyTable`"
>
<CustomTable :columns="yqsyColumns" :ref="refConf.yqsy" @onRegentSubmit="(e) => onRegentSubmit(e)"
:showOperation="fillType === 'actFill'" :showAddRow="fillType === 'actFill'" :formData="formData"
:prefixKey="`yqsyTable`">
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> <template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaionDelete
:row="row"
:rowIndex="rowIndex"
:columns="columns"
@deleteRow="() => deleteTableRow(rowIndex, 'yqsyTableRef')"
></TableOpertaionDelete>
<TableOpertaionDelete :row="row" :rowIndex="rowIndex" :columns="columns"
@deleteRow="() => deleteTableRow(rowIndex, 'yqsyTableRef')"></TableOpertaionDelete>
</template> </template>
</CustomTable> </CustomTable>
<LineLabel label="template.common.operationSteps" /> <LineLabel label="template.common.operationSteps" />
<div class="template-form-item"> <div class="template-form-item">
<BaseInfoFormPackage
fieldItemLabel="template.common.operationSteps"
:ref="refConf.czInfo"
:formConfig="czInfoFormConfig"
:formData="formData"
@clickButton="handleClickButton"
@onRegentSubmit="onRegentSubmit"
/>
<CustomTable
fieldItemLabel="template.common.operationSteps"
:columns="jzjzColumns"
@blur="operateBlur"
:ref="'jzjzTableRef'"
@onRegentSubmit="(e) => onRegentSubmit(e)"
:showOperation="fillType === 'actFill'"
<BaseInfoFormPackage fieldItemLabel="template.common.operationSteps" :ref="refConf.czInfo"
:formConfig="czInfoFormConfig" :formData="formData" @clickButton="handleClickButton"
@onRegentSubmit="onRegentSubmit" />
<CustomTable fieldItemLabel="template.common.operationSteps" :columns="jzjzColumns" @blur="operateBlur"
:ref="'jzjzTableRef'" @onRegentSubmit="(e) => onRegentSubmit(e)" :showOperation="fillType === 'actFill'"
:showAddRow="fillType === 'actFill'" :showAddRow="fillType === 'actFill'"
:formData="{stepTableFormData:formData.stepTableFormData_1,headerSelectFields:{}}"
:showHeaderSelect="fillType === 'actFill'"
:prefixKey="`jzjzTable`"
>
:formData="{ stepTableFormData: formData.stepTableFormData_1, headerSelectFields: {} }"
:showHeaderSelect="fillType === 'actFill'" :prefixKey="`jzjzTable`">
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> <template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaionDelete
:row="row"
:rowIndex="rowIndex"
:columns="columns"
@deleteRow="() => deleteTableRow(rowIndex, 'jzjzTableRef')"
></TableOpertaionDelete>
<TableOpertaionDelete :row="row" :rowIndex="rowIndex" :columns="columns"
@deleteRow="() => deleteTableRow(rowIndex, 'jzjzTableRef')"></TableOpertaionDelete>
</template> </template>
</CustomTable> </CustomTable>
</div> </div>
<BaseInfoFormPackage
fieldItemLabel="template.dl.dl007.bz"
label="template.dl.dl007.bz"
:ref="refConf.remark"
:formConfig="remarkConig"
:formData="formData"
/>
<BaseInfoFormPackage fieldItemLabel="template.dl.dl007.bz" label="template.dl.dl007.bz" :ref="refConf.remark"
:formConfig="remarkConig" :formData="formData" />
</div> </div>
</div> </div>
</div> </div>
@ -94,6 +58,7 @@ import LineLabel from '@/components/Template/LineLabel'
import TableList from '@/components/Template/Table' 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 { uniqeYqOne, uniqeResourceOne } from "@/utils/calUnitTools";
import moment from 'moment' import moment from 'moment'
const refConf = { const refConf = {
@ -135,7 +100,7 @@ export default {
fillType: 'actFill', fillType: 'actFill',
span: 1, span: 1,
placeholder: 'template.common.remarkPlaceholder', placeholder: 'template.common.remarkPlaceholder',
maxlength: 1000,
maxlength: 1000,
rows: 5 rows: 5
} }
} }
@ -143,7 +108,7 @@ export default {
] ]
}, },
mounted() { mounted() {
// if (this.fillType === "actFill") { // if (this.fillType === "actFill") {
// this.handleUpdateCode(formData); // this.handleUpdateCode(formData);
// } // }
@ -207,7 +172,7 @@ export default {
} }
] ]
}, },
// 使 // 使
yqsyColumns() { yqsyColumns() {
return [ return [
@ -306,7 +271,7 @@ export default {
subKey: 'pykssj', subKey: 'pykssj',
buttonName: 'template.dl.dl003.ksButton', buttonName: 'template.dl.dl003.ksButton',
}, },
} }
} }
] ]
@ -319,7 +284,7 @@ export default {
prop: "targetSolutionCode", prop: "targetSolutionCode",
bodyType: 'input', bodyType: 'input',
bodySubType: "span", bodySubType: "span",
bodySubKey: "subTargetSolutionCode",
bodySubKey: "subTargetSolutionCode",
myCodeFields: ["targetSolutionCode", "subTargetSolutionCode"],// myCodeFields: ["targetSolutionCode", "subTargetSolutionCode"],//
bodyFillType: 'actFill' bodyFillType: 'actFill'
}, },
@ -339,25 +304,25 @@ export default {
label: 'template.dl.dl003.jzjrtj', label: 'template.dl.dl003.jzjrtj',
prop: 'jzjrtj', prop: 'jzjrtj',
headerSelectKey: "targetDiluentVolumeUnit", headerSelectKey: "targetDiluentVolumeUnit",
headerOptions: this.getDictOptions('business_tjdw'),
headerOptions: this.getDictOptions('business_tjdw'),
bodyType: 'inputNumber', bodyType: 'inputNumber',
bodyMaxlength: 10,
bodyMaxlength: 10,
bodyFillType: 'actFill', bodyFillType: 'actFill',
fillType: 'actFill', fillType: 'actFill',
} }
// { // {
// label: "template.sp.sp003.ysmbrynd",
// prop: "targetSolutionConcentration",
// width: 210,
// showWidth: 120,
// headerSelectKey: "targetSolutionConcentrationUnit",
// fillType: "preFill",
// headerOptions: this.getDictOptions('business_nddw'),
// bodyType: "inputNumber",
// bodyFillType: "preFill",
// bodyMaxlength: 10,
// headerSelectTo:"actSolutionConcentrationUnit",
// },
// label: "template.sp.sp003.ysmbrynd",
// prop: "targetSolutionConcentration",
// width: 210,
// showWidth: 120,
// headerSelectKey: "targetSolutionConcentrationUnit",
// fillType: "preFill",
// headerOptions: this.getDictOptions('business_nddw'),
// bodyType: "inputNumber",
// bodyFillType: "preFill",
// bodyMaxlength: 10,
// headerSelectTo:"actSolutionConcentrationUnit",
// },
] ]
}, },
}, },
@ -379,7 +344,7 @@ export default {
moment().format('YYYY/MM/DD HH:mm'), moment().format('YYYY/MM/DD HH:mm'),
{ isUpdateRecord: true, signData } { isUpdateRecord: true, signData }
) )
}, },
// //
getFilledFormData() { getFilledFormData() {
@ -394,11 +359,88 @@ export default {
return await this.validFormFields(refNames) return await this.validFormFields(refNames)
}, },
getResource() { getResource() {
// const stepResource = this.$refs.yqsyTableRef.getStepResource()
// 使
// this.resourceTmp = stepResource.sjResource || []
// this.yqResourceTmp = stepResource.yqResource || []
// return this.resourceTmp
let content = this.getFilledFormData();
//resource
let tmpResource = []
let tmpYq = []
if (this.fillType === "actFill") {
let header1 = content.headerSelectFields_1
let table1 = content.stepTableFormData_1
//
if (table1 && table1.length > 0) {
for (let i = 0; i < table1.length; i++) {
let item = table1[i]
//
tmpResource.push({
mc: '',
bh: item.targetSolutionCode + item.subTargetSolutionCode,
ph: '',
ndz: '',
nd: '',
nddw: '',
ly: 'ELN配制',
sxrq: null,
kc: item.jzjrtj + header1.targetDiluentVolumeUnit,
kcdw: header1.targetDiluentVolumeUnit,
syl: null,
type: null, //null
elnType: this.product, // his.product
syldw: header1.targetDiluentVolumeUnit,
yxzq: null,
yxzqdw: null,
})
//使 1357 911
tmpResource.push({
mc: item.jzlymc,
bh: item.jzlybh,
ph: '',
ndz: '',
nd: '',
nddw: '',
ly: '',
sxrq: null,
kc: null,
kcdw: null,
syl: item.jzlytj,
type: 9, //使
elnType: null, //null
syldw: header1.targetDiluentVolumeUnit,
yxzq: null,
yxzqdw: null,
})
}
}
//
let table = content.stepTableFormData
if (table && table.length > 0) {
for (let i = 0; i < table.length; i++) {
let item = table[i]
tmpYq.push({
mc: item.yqmc,
xh: item.yqxh,
bh: item.yqbh,
jzrq: item.jzrq,
})
}
}
tmpYq.push({
mc: content.pykssjmc,
xh: content.pykssjxh,
bh: content.fssygbh,
jzrq: content.pykssjjzrq,
})
tmpYq.push({
mc: content.pyxmc,
xh: content.pyxxh,
bh: content.pyx,
jzrq: content.pyxjzrq,
})
this.yqResourceTmp = tmpYq
}
//使,
this.yqResourceTmp = uniqeYqOne(tmpYq)
this.resourceTmp = uniqeResourceOne(tmpResource)
return this.resourceTmp;
}, },
onRegentSubmit(e) { onRegentSubmit(e) {
const { selectInfo, key, rowIndex } = e const { selectInfo, key, rowIndex } = e
@ -415,13 +457,26 @@ export default {
if (key === 'qxbd') { if (key === 'qxbd') {
this.$refs.czInfoRef.updateFormData('pykssj', row.startDate) this.$refs.czInfoRef.updateFormData('pykssj', row.startDate)
} }
if (key == 'fssygbh') {
this.$refs.czInfoRef.updateFormData('pykssjmc', row.mc)
this.$refs.czInfoRef.updateFormData('pykssjxh', row.xh)
this.$refs.czInfoRef.updateFormData('pykssjjzrq', row.jzrq)
}
if (key == 'pyx') {
this.$refs.czInfoRef.updateFormData('pyxmc', row.mc)
this.$refs.czInfoRef.updateFormData('pyxxh', row.xh)
this.$refs.czInfoRef.updateFormData('pyxjzrq', row.jzrq)
}
if (key == 'jzlybh') {
this.$refs['jzjzTableRef'].updateDataSourceByRowIndex(rowIndex, { jzlymc: row.mc, jzlytj: row.tj, jzlytjdw: row.tjdw })
}
}, },
// //
async onSave() { async onSave() {
const formData = this.getStepResource() const formData = this.getStepResource()
console.log(formData, 'formData') console.log(formData, 'formData')
}, },
//table
//table
async operateBlur(params) { async operateBlur(params) {
let isGeneratingSubCode = false; let isGeneratingSubCode = false;
const { dataSource = [], rowIndex } = params; // rowIndex const { dataSource = [], rowIndex } = params; // rowIndex
@ -448,9 +503,9 @@ export default {
isGeneratingSubCode = true; isGeneratingSubCode = true;
// 5. // 5.
const subCode = await this.getLatestSnArr([{
pre: currentItem.targetSolutionCode,
type: 1
const subCode = await this.getLatestSnArr([{
pre: currentItem.targetSolutionCode,
type: 1
}]); }]);
// 6. // 6.
@ -469,20 +524,20 @@ export default {
} }
} }
//table header //table header
// onHeaderSelectChange(data){
// const {key, headerSelectFields,dataSource=[]} = data;
// const keys = [
// 'targetDiluentVolumeUnit',
// ]
// if(keys.includes(key)){
// const {targetStartSolution,subTargetStartSolution} = this.$refs.stepFormPackageRef?.getFilledFormData();
// const params = {
// subTargetStartSolution,
// headerSelectFields
// }
// this.batchUpdateTargetStartSolutionVolume(dataSource,targetStartSolution,params)
// }
// },
// onHeaderSelectChange(data){
// const {key, headerSelectFields,dataSource=[]} = data;
// const keys = [
// 'targetDiluentVolumeUnit',
// ]
// if(keys.includes(key)){
// const {targetStartSolution,subTargetStartSolution} = this.$refs.stepFormPackageRef?.getFilledFormData();
// const params = {
// subTargetStartSolution,
// headerSelectFields
// }
// this.batchUpdateTargetStartSolutionVolume(dataSource,targetStartSolution,params)
// }
// },
} }
} }
</script> </script>
@ -494,6 +549,7 @@ export default {
.print-btn { .print-btn {
margin-bottom: 20px; margin-bottom: 20px;
} }
.config-header-end { .config-header-end {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;

Loading…
Cancel
Save