Browse Source

feat:[模板管理][update]

lkf
luojie 2 months ago
parent
commit
4ef9b09888
5 changed files with 41 additions and 29 deletions
  1. +5
    -9
      src/components/Template/mixins/formPackageMixins.js
  2. +27
    -12
      src/components/Template/operation/TableOpertaion.vue
  3. +2
    -2
      src/views/business/comps/template/comps/sp/SWYPBQGZYZBB.vue
  4. +5
    -4
      src/views/business/comps/template/comps/sp/SWYPNBGZYZBB.vue
  5. +2
    -2
      vue.config.js

+ 5
- 9
src/components/Template/mixins/formPackageMixins.js View File

@ -55,15 +55,10 @@ export default {
},
//更新表单数据
updateFormData(key, value,oldKeys = []) {
if(oldKeys.length){
// 深拷贝当前表单数据,避免直接修改原数据
const cloneFormFields = JSON.parse(JSON.stringify(this.formFields));
oldKeys.forEach(oldKey => {
//需要把记录一下被更新的旧值,用于取消的时候回填,主要用于clickable类型
this.oldFormFields[oldKey] = cloneFormFields[oldKey];
})
}
// 深拷贝当前表单数据,避免直接修改原数据
const cloneFormFields = JSON.parse(JSON.stringify(this.formFields));
this.oldFormFields[key] = cloneFormFields[key];
this.formFields[key] = value;
// 清除该表单项的错误状态
if (this.errors[key]) {
@ -344,6 +339,7 @@ export default {
},
resetRecord(key){
this.formFields = {...this.formFields, ...this.oldFormFields};
this.oldFormFields = {};
this.$emit("resetRecord");
},
}

+ 27
- 12
src/components/Template/operation/TableOpertaion.vue View File

@ -70,24 +70,39 @@ export default {
},
methods: {
//config
getColumnConfig(){
const { columns } = this;
const { columnsData } = columns;
let o = {};
columnsData.forEach((item) => {
if(item.bodyFillType === "actFill"){
o[item.prop] = "";
}else if(item.bodySubFillType === "actFill"){
o[item.bodySubKey] = "";
}
});
return o;
},
//
onStartConfig() {
this.$emit("startConfig", { rowData: this.innerRow, rowIndex: this.rowIndex, headerSelectFields: this.columns.headerSelectFields })
},
//
onConfigComplete() {
// const isComplete = Object.values(this.innerRow).every((val)=>{
// // 0
// if (val === 0) return true;
// if (val === "0") return true;
// // null undefined
// return val != null && val != undefined && val != "";
// });
// if(!isComplete){
// this.$message.error("")
// return
// }
console.log(this.columns,"columns")
const actConfig = this.getColumnConfig();
const cloneRow = JSON.parse(JSON.stringify(this.innerRow));
const isComplete = Object.values({...actConfig,...cloneRow}).every((val)=>{
// 0
if (val === 0) return true;
if (val === "0") return true;
// null undefined
return val != null && val != undefined && val != "";
});
if(!isComplete){
this.$message.error("表单内容未填完,请填写完成后才能配制完成")
return
}
this.$emit("configComplete", { rowData: this.innerRow, rowIndex: this.rowIndex, headerSelectFields: this.columns.headerSelectFields })
},
//

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

@ -515,10 +515,10 @@ export default {
//
onSelectReagentSubmit(code, row) {
if (this.currentSubKey === "subStartSolution") {//
this.$refs.stepFormPackageRef.updateFormData("targetAcSolution", row.nd, ["targetAcSolution"]);
this.$refs.stepFormPackageRef.updateFormData("targetAcSolution", row.nd);
this.updateStepTableData(row);
}
this.$refs.stepFormPackageRef.updateFormData(this.currentSubKey, code, [this.currentSubKey]);
this.$refs.stepFormPackageRef.updateFormData(this.currentSubKey, code);
this.$refs.selectReagentDialogRef.onCancel()
},
//table

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

@ -408,7 +408,7 @@ export default {
const { actVol, actNd } = this.updateSjmbrynd(item, targetAcSolution);
this.$refs[`paralleStepTableRef_${configIndex}`][0]?.updateDataSourceByRowIndex(rowIndex, {
actSolutionVolume: actVol,
targetAcSolution: actNd,
actSolutionConcentration: actNd,
});
}
}
@ -447,11 +447,11 @@ export default {
const ref = this.currentType === "ladder" ? "ladderStepFormPackageRef_" : "paralleStepFormPackageRef_"
const packageRef = this.$refs[`${ref}${this.currentRowIndex}`][0];
if (currentSubKey === "subStartSolution") {
packageRef.updateFormData("targetAcSolution", row.nd, ["targetAcSolution"]);
packageRef.updateFormData("targetAcSolution", row.nd);
packageRef.onValueChangeCompareTo("targetAcSolution", row.nd, "targetStartSolution");
this.updateTableNd(row);
}
packageRef.updateFormData(currentSubKey, code, [currentSubKey]);
packageRef.updateFormData(currentSubKey, code);
this.currentSubKey = "";
} else if (currentTableKey === "actStartSolutionCode") {//
const tableRef = this.$refs[`paralleStepTableRef_${currentRowIndex}`][0];
@ -461,7 +461,7 @@ export default {
actStartSolutionCode: code,
targetAcSolution: row.nd,
actSolutionVolume: actVol,
targetAcSolution: actNd,
actSolutionConcentration: actNd,
})
}
@ -484,6 +484,7 @@ export default {
//
newData.forEach((item, index) => {
const { actVol, actNd } = this.updateSjmbrynd(item, row.nd);
console.log(actNd,"actNd")
item.actSolutionVolume = actVol;
item.actSolutionConcentration = actNd;
})

+ 2
- 2
vue.config.js View File

@ -34,8 +34,8 @@ module.exports = {
proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
target: `http://localhost:8080`,
// target: `http://39.99.251.173:8080`,
// target: `http://localhost:8080`,
target: `http://39.99.251.173:8080`,
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''

Loading…
Cancel
Save