Browse Source

feat:[模板管理][update]

zhangteng^2
luojie 22 hours ago
parent
commit
599e31998a
3 changed files with 115 additions and 15 deletions
  1. +2
    -2
      src/components/Template/CustomTable.vue
  2. +92
    -4
      src/views/business/comps/template/comps/gsp/GSP015.vue
  3. +21
    -9
      src/views/business/comps/template/formConfig/gsp/gsp015.js

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

@ -539,7 +539,7 @@ export default {
if (this.templateFillType !== 'actFill') { if (this.templateFillType !== 'actFill') {
return return
} }
this.$emit("beforeReagentSubmit", { selectData: data, callback, key: col.prop, rowData: row })
this.$emit("beforeReagentSubmit", { selectData: data, callback, key: col.prop, rowData: row,headerSelectFields: this.headerSelectFields })
}, },
onHeaderRegentSubmit(data, inputValue, colIndex, headerIndex) { onHeaderRegentSubmit(data, inputValue, colIndex, headerIndex) {
this.headerFields[`${colIndex}_${headerIndex}`] = inputValue; this.headerFields[`${colIndex}_${headerIndex}`] = inputValue;
@ -563,7 +563,7 @@ export default {
// return // return
// } // }
this.updateDataSourceByRowIndex(rowIndex, { [key]: inputValue, [`selectInfo_${key}`]: data.selectInfo }) this.updateDataSourceByRowIndex(rowIndex, { [key]: inputValue, [`selectInfo_${key}`]: data.selectInfo })
this.$emit("onRegentSubmit", { selectInfo: data, key, col, rowIndex, colIndex, rowData: row })
this.$emit("onRegentSubmit", { selectInfo: data, key, col, rowIndex, colIndex, rowData: row,headerSelectFields: this.headerSelectFields })
}, },
isShowAddRos() { isShowAddRos() {
if (this.showAddRow !== undefined) { if (this.showAddRow !== undefined) {

+ 92
- 4
src/views/business/comps/template/comps/gsp/GSP015.vue View File

@ -56,6 +56,8 @@
<CustomTable :ref="`ybsmTableRef${index}`" :columns="ybsmColumns" prefix="qy" <CustomTable :ref="`ybsmTableRef${index}`" :columns="ybsmColumns" prefix="qy"
:showOperation="fillType === 'actFill' || fillType === 'preFill'" :showOperation="fillType === 'actFill' || fillType === 'preFill'"
:showAddRow="fillType === 'preFill'" @onAddRow="() => addTableRow(index)" :showAddRow="fillType === 'preFill'" @onAddRow="() => addTableRow(index)"
@beforeReagentSubmit="(e) => beforeReagentSubmit(e, index)"
@onRegentSubmit="(e) => onRegentSubmit(e, index)"
fieldItemLabel="取样进样信息" :formData="item"> fieldItemLabel="取样进样信息" :formData="item">
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> <template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion :row="row" :rowIndex="rowIndex" :columns="columns" <TableOpertaion :row="row" :rowIndex="rowIndex" :columns="columns"
@ -229,11 +231,97 @@ export default {
} }
}, },
methods: { methods: {
handleUpdateCode(){
const refs = ["jyTableRef"]
const {ecDataList = [],ybsmDataList= []} = this.fromData;
beforeReagentSubmit(data, index) {
const { selectData, callback, key, headerSelectFields } = data;
const {selectInfo = {}} = selectData;
const {nddw} = selectInfo;
const {sjzjnddw} = headerSelectFields;
if (
key === 'zjbh' &&
!isCommonUnit(nddw, [sjzjnddw])
) {
//table
callback.prevent('浓度单位与预制不符,请重新选择或申请废止并重新预制。')
}
},
onRegentSubmit(e, index) {
const {selectInfo,headerSelectFields} = e;
const {nd,nddw} = selectInfo.selectInfo;
const {sjzjnddw} = headerSelectFields;
const jyTableInfo = this.$refs[`jyTableRef${index}`][0].getFilledFormData();
const jyHeaderSelectFields = jyTableInfo.headerSelectFields;
const {qynddw} = jyHeaderSelectFields;
const sjnd = convertConcentration.convert(nd + nddw, sjzjnddw);//
const transQynd = convertConcentration.convert(nd + nddw, qynddw);//
const parseSjnd = parseFloat(sjnd.toFixed(4));
const parseQynd = parseFloat(transQynd.toFixed(4));
this.$refs[`ybsmTableRef${index}`][0].updateDataSourceByRowIndex(e.rowIndex,{sjzjnd:parseSjnd})
this.$refs[`jyTableRef${index}`][0].updateDataSourceByRowIndex(e.rowIndex,{qynd:parseQynd})
},
async handleUpdateCode(){
const {ecDataList = [],ybsmDataList= []} = this.formData;
const codes = [];
let flag = false;
ybsmDataList.map((item,index) => {
const {stepTableFormData = [],jyStepTableFormData = []} = item;
stepTableFormData.map((step,sIndex) => {
if(step.qybhCode){
flag = true;
}
this.$refs[`jyTableRef${index}`][0].updateDataSourceByRowIndex(sIndex,{qybh:step.qybh})
codes.push({ pre: step.qybh, type: 1 ,id:`stepTableFormData_${step.qybh}_${index}_${sIndex}`,});
});
jyStepTableFormData.map((step,sIndex) => {
if(step.jybhCode){
flag = true;
}
codes.push({ pre: step.jybh, type: 1 ,id:`jyStepTableFormData_${step.jybh}_${index}_${sIndex}`,});
});
});
ecDataList.map((item,index) => {
const {stepTableFormData} = item;
stepTableFormData.map((step,sIndex) => {
if(step.jybhCode){
flag = true;
}
codes.push({ pre: step.jybh, type: 1 ,id:`ecStepTableFormData_${step.jybh}_${index}_${sIndex}`,});
});
});
if(flag){
return;
}
console.log(this.formData,"fff")
const result = await this.getLatestSnArr(codes)
codes.map((item,index)=>{
item.sn = result[index]
})
ybsmDataList.map((item,index)=>{
const {stepTableFormData = [],jyStepTableFormData = []} = item;
stepTableFormData.map((step,sIndex) => {
const id = `stepTableFormData_${step.qybh}_${index}_${sIndex}`;
const o = codes.find((item) => item.id === id) ||{};
this.$refs[`ybsmTableRef${index}`][0].updateDataSourceByRowIndex(sIndex,{qybhCode:o.sn})
});
jyStepTableFormData.map((step,sIndex) => {
const id = `jyStepTableFormData_${step.jybh}_${index}_${sIndex}`;
const o = codes.find((item) => item.id === id) ||{};
this.$refs[`jyTableRef${index}`][0].updateDataSourceByRowIndex(sIndex,{jybhCode:o.sn})
});
})
ecDataList.map((item,index) => {
const {stepTableFormData} = item;
stepTableFormData.map((step,sIndex) => {
const id = `ecStepTableFormData_${step.jybh}_${index}_${sIndex}`;
const o = codes.find((item) => item.id === id) ||{};
this.$refs[`ecTableRef${index}`][0].updateDataSourceByRowIndex(sIndex,{jybhCode:o.sn})
});
})
this.justUpdateFilledFormData();
}, },
//blog //blog
async handleBeforeDownload({ html2pdf, options, pdfContent }) { async handleBeforeDownload({ html2pdf, options, pdfContent }) {

+ 21
- 9
src/views/business/comps/template/formConfig/gsp/gsp015.js View File

@ -88,10 +88,14 @@ export const getYbsmFormConfig = ($this) => {
disabled: true, disabled: true,
subType:"button", subType:"button",
subKey: "startButton", subKey: "startButton",
subFillType: 'actFill',
subDisabled: false,
buttonName:"开始", buttonName:"开始",
thirdType: 'button', thirdType: 'button',
showSub:$this.fillType === 'actFill', showSub:$this.fillType === 'actFill',
showThird:$this.fillType === 'actFill', showThird:$this.fillType === 'actFill',
thirdDisabled: false,
thirdFillType: 'actFill',
thirdKey: 'endButton', thirdKey: 'endButton',
thirdButtonName:"结束", thirdButtonName:"结束",
}, },
@ -118,15 +122,19 @@ export const getQyTableColumns = ($this) => {
width: 200, width: 200,
bodyType: 'input', bodyType: 'input',
bodyFillType: 'preFill', bodyFillType: 'preFill',
subBodyType:"span",
subBodyKey: "qybhCode",
bodySubType:"span",
bodySubKey: "qybhCode",
}, },
{ {
label: '制剂编号', label: '制剂编号',
prop: 'zjbh', prop: 'zjbh',
width: 200, width: 200,
bodyType: 'gsp',
bodyFillType: 'actFill',
bodyType: 'input',
bodyFillType: 'preFill',
bodySubType: 'mix',
bodySubKey: "zjbhCode",
bodySubFillType: 'actFill',
}, },
{ {
label: '预设制剂浓度', label: '预设制剂浓度',
@ -142,6 +150,7 @@ export const getQyTableColumns = ($this) => {
{ {
label: '实际制剂浓度', label: '实际制剂浓度',
prop: 'sjzjnd', prop: 'sjzjnd',
bodyDisabled: true,
width: 200, width: 200,
headerSelectKey: 'sjzjnddw', headerSelectKey: 'sjzjnddw',
fillType: "preFill", fillType: "preFill",
@ -164,10 +173,10 @@ export const getQyTableColumns = ($this) => {
width: 180, width: 180,
bodyType: 'select', bodyType: 'select',
bodyOptions: $this.getDictOptions('business_qywz'), bodyOptions: $this.getDictOptions('business_qywz'),
bodyFillType: 'actFill',
bodyFillType: 'preFill',
}, },
{ {
label: '预设取样位置',
label: '实际取样位置',
prop: 'sjqywz', prop: 'sjqywz',
width: 180, width: 180,
bodyType: 'select', bodyType: 'select',
@ -211,20 +220,22 @@ export const getJyTableColumns = ($this) => {
width: 200, width: 200,
bodyType: 'input', bodyType: 'input',
bodyFillType: 'preFill', bodyFillType: 'preFill',
subBodyType:"span",
subBodyKey: "jybhCode",
bodySubType:"span",
bodySubKey: "jybhCode",
}, },
{ {
label: '取样编号', label: '取样编号',
prop: 'qybh', prop: 'qybh',
width: 200, width: 200,
bodyType: 'gsp',
bodyType: 'input',
bodyDisabled: true,
bodyFillType: 'actFill', bodyFillType: 'actFill',
}, },
{ {
label: '取样浓度', label: '取样浓度',
prop: 'qynd', prop: 'qynd',
width: 200, width: 200,
bodyDisabled: true,
headerSelectKey: 'qynddw', headerSelectKey: 'qynddw',
fillType: "preFill", fillType: "preFill",
headerOptions: $this.getDictOptions('business_nddw'), headerOptions: $this.getDictOptions('business_nddw'),
@ -235,6 +246,7 @@ export const getJyTableColumns = ($this) => {
label: '取样体积', label: '取样体积',
prop: 'qytj', prop: 'qytj',
width: 200, width: 200,
bodyDisabled: true,
headerSelectKey: 'qytjdw', headerSelectKey: 'qytjdw',
fillType: "preFill", fillType: "preFill",
headerOptions: $this.getDictOptions('business_tjdw'), headerOptions: $this.getDictOptions('business_tjdw'),

Loading…
Cancel
Save