Browse Source

feat:[模板管理][update]

master
luojie 9 hours ago
parent
commit
d2aea084a5
6 changed files with 111 additions and 85 deletions
  1. +3
    -3
      src/components/Template/CustomTable.vue
  2. +21
    -16
      src/components/Template/HandleFormItem.vue
  3. +3
    -2
      src/components/Template/mixins/operationMixins.js
  4. +80
    -60
      src/views/business/comps/template/comps/gsp/GSP015.vue
  5. +3
    -3
      src/views/business/comps/template/formConfig/gsp/gsp015.js
  6. +1
    -1
      src/views/business/comps/template/formConfig/sp/SP007.js

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

@ -84,7 +84,7 @@
<el-checkbox v-model="row._checked" @change="handleCheckChange(row, $event)"></el-checkbox> <el-checkbox v-model="row._checked" @change="handleCheckChange(row, $event)"></el-checkbox>
</div> </div>
</div> </div>
<div v-for="(col, colIndex) in columns" :key="colIndex"
<div v-for="(col, colIndex) in columns" :key="colIndex+row.id"
class="custom-table-cell body-cell no-break" :style="getCellWidth(col)"> class="custom-table-cell body-cell no-break" :style="getCellWidth(col)">
<div class="inner-table-cell"> <div class="inner-table-cell">
<div class="flex1" :class="{ 'item-center': !isBorder && col.label }"> <div class="flex1" :class="{ 'item-center': !isBorder && col.label }">
@ -109,7 +109,7 @@
</template> </template>
<div v-else-if="col.bodyType === 'checkboxTree'"> <div v-else-if="col.bodyType === 'checkboxTree'">
<HandleFormItem :field-item-label="fieldItemLabel" <HandleFormItem :field-item-label="fieldItemLabel"
:field-key="prefixKey + '_' + col.prop + rowIndex" type="checkboxTree"
:field-key="prefixKey + '_' + col.prop + '_' + row.id" type="checkboxTree"
:item="getBodyItem(col, rowIndex)" :value="row[col.prop]" :item="getBodyItem(col, rowIndex)" :value="row[col.prop]"
@change="(e) => onBodyValueChange(rowIndex, colIndex, e, row, col.bodyType)" @change="(e) => onBodyValueChange(rowIndex, colIndex, e, row, col.bodyType)"
:error="hasError(rowIndex, colIndex, col.prop)" :error="hasError(rowIndex, colIndex, col.prop)"
@ -195,7 +195,7 @@
</div> </div>
<div class="flex flex1"> <div class="flex flex1">
<HandleFormItem :field-item-label="fieldItemLabel" <HandleFormItem :field-item-label="fieldItemLabel"
:field-key="prefixKey + '_' + col.otherCode"
:fieldKey="prefixKey + '_' + col.otherCode + '_' + row.id"
@blur="onBlur(rowIndex, col.prop, $event)" :item="getOtherItem(col)" @blur="onBlur(rowIndex, col.prop, $event)" :item="getOtherItem(col)"
v-model="row[col.otherCode]" v-model="row[col.otherCode]"
:error="hasError(rowIndex, colIndex, col.otherCode)" :error="hasError(rowIndex, colIndex, col.otherCode)"

+ 21
- 16
src/components/Template/HandleFormItem.vue View File

@ -313,7 +313,7 @@ export default {
} else if (this.type === 'fqyq' && !this.value) { } else if (this.type === 'fqyq' && !this.value) {
initialValue = { mainRadio: '', subRadio: '', inputValue: "" }; initialValue = { mainRadio: '', subRadio: '', inputValue: "" };
} else if ((this.type === 'checkboxTree') && !this.value) { } else if ((this.type === 'checkboxTree') && !this.value) {
const defaultCheckedValue = getDefaultValueByOptions(this.item.options || []);
const defaultCheckedValue = getDefaultValueByOptions(this.item.options) || [];
initialValue = { checkedValues: defaultCheckedValue, otherValues: {} }; initialValue = { checkedValues: defaultCheckedValue, otherValues: {} };
} else if ((this.type === 'radioTree') && !this.value) { } else if ((this.type === 'radioTree') && !this.value) {
initialValue = { checkedValues: "", otherValues: {} }; initialValue = { checkedValues: "", otherValues: {} };
@ -381,7 +381,12 @@ export default {
inputValue: newVal.inputValue || '', inputValue: newVal.inputValue || '',
subRadio: newVal.subRadio || '' subRadio: newVal.subRadio || ''
}; };
} else {
} else if(this.type === 'checkboxTree'){
if(!newVal){
this.inputValue = { checkedValues: [], otherValues: {} };
}
}else {
console.log(newVal,"newVal")
this.inputValue = typeof newVal === 'object' ? JSON.parse(JSON.stringify(newVal)) : newVal; this.inputValue = typeof newVal === 'object' ? JSON.parse(JSON.stringify(newVal)) : newVal;
} }
} }
@ -534,7 +539,6 @@ export default {
// //
// //
this.pendingRemoveFile = { file, fileList: this.fileList }; this.pendingRemoveFile = { file, fileList: this.fileList };
console.log("fillll")
// //
EventBus.$emit('showEditSignDialog', { uuid: this.uuid }); EventBus.$emit('showEditSignDialog', { uuid: this.uuid });
@ -964,17 +968,18 @@ export default {
// checkboxTree // checkboxTree
getCheckboxTreeChecked(value) { getCheckboxTreeChecked(value) {
const { checkedValues } = this.inputValue
const { checkedValues = [] } = this.inputValue
const o = checkedValues.find(item => item.label === value) || {}; const o = checkedValues.find(item => item.label === value) || {};
return !!o.checked; return !!o.checked;
}, },
// checkedItem // checkedItem
getOrCreateCheckedItem(value) { getOrCreateCheckedItem(value) {
let checkedItem = this.inputValue.checkedValues.find(item => item.label === value);
const {checkedValues = []} = this.inputValue;
let checkedItem = checkedValues.find(item => item.label === value);
if (!checkedItem) { if (!checkedItem) {
checkedItem = { label: value, checked: false }; checkedItem = { label: value, checked: false };
this.inputValue.checkedValues.push(checkedItem);
checkedValues.push(checkedItem);
} }
return checkedItem; return checkedItem;
}, },
@ -999,7 +1004,6 @@ export default {
} }
}); });
} }
this.onCommonHandleSaveRecord(); this.onCommonHandleSaveRecord();
}, },
@ -1126,11 +1130,11 @@ export default {
return o[this.currentHandleType]; return o[this.currentHandleType];
}, },
getCheckboxTreeInfo() { getCheckboxTreeInfo() {
const { checkedValues, otherValues } = this.inputValue;
const { checkedValues = [], otherValues = {} } = this.inputValue;
const { checkedValues: oldCheckedValues, otherValues: oldOtherValues } = this.oldValue; const { checkedValues: oldCheckedValues, otherValues: oldOtherValues } = this.oldValue;
const { currentHandleType, currentCheckboxTreeValue } = this; const { currentHandleType, currentCheckboxTreeValue } = this;
const newItem = checkedValues.find(item => item.label === currentCheckboxTreeValue); const newItem = checkedValues.find(item => item.label === currentCheckboxTreeValue);
const oldItem = oldCheckedValues.find(item => item.label === currentCheckboxTreeValue);
const oldItem = (oldCheckedValues || []).find(item => item.label === currentCheckboxTreeValue);
const o = { const o = {
"checkboxTreeCheckbox": { oldValue: oldItem, newValue: newItem, des: "" }, "checkboxTreeCheckbox": { oldValue: oldItem, newValue: newItem, des: "" },
"checkboxTreeOther": { oldValue: oldOtherValues[currentCheckboxTreeValue], newValue: otherValues[currentCheckboxTreeValue], des: `${currentCheckboxTreeValue}`, key: this.fieldKey + "_" + currentCheckboxTreeValue }, "checkboxTreeOther": { oldValue: oldOtherValues[currentCheckboxTreeValue], newValue: otherValues[currentCheckboxTreeValue], des: `${currentCheckboxTreeValue}`, key: this.fieldKey + "_" + currentCheckboxTreeValue },
@ -1203,19 +1207,20 @@ export default {
const current = this.getFqyqInfo(); const current = this.getFqyqInfo();
isSame = isEqual(current.oldValue, current.newValue); isSame = isEqual(current.oldValue, current.newValue);
if (this.currentHandleType === "inputValue") { if (this.currentHandleType === "inputValue") {
isOldValueEmpty = this.isUnSubmitted(current.key);
isOldValueEmpty = this.isUnSubmitted(this.fieldKey+current.key);
} else { } else {
isOldValueEmpty = isValueEmpty(current.oldValue); isOldValueEmpty = isValueEmpty(current.oldValue);
} }
} else if (this.type === "checkboxTree") { } else if (this.type === "checkboxTree") {
const current = this.getCheckboxTreeInfo() || {}; const current = this.getCheckboxTreeInfo() || {};
const { oldValue = {}, newValue = {} } = current; const { oldValue = {}, newValue = {} } = current;
console.log(oldValue,newValue,"oldValue,newValue")
if (currentHandleType === "checkboxTreeCheckbox") { if (currentHandleType === "checkboxTreeCheckbox") {
isSame = isEqual(oldValue.checked, newValue.checked); isSame = isEqual(oldValue.checked, newValue.checked);
isOldValueEmpty = oldValue.checked === undefined; isOldValueEmpty = oldValue.checked === undefined;
} else { } else {
isSame = isEqual(current.oldValue, current.newValue); isSame = isEqual(current.oldValue, current.newValue);
isOldValueEmpty = this.isUnSubmitted(current.key);
isOldValueEmpty = this.isUnSubmitted(this.fieldKey+current.key);
} }
} else if(this.type === "radioTree"){ } else if(this.type === "radioTree"){
@ -1223,11 +1228,10 @@ export default {
const { oldValue = {}, newValue = {} } = current; const { oldValue = {}, newValue = {} } = current;
if (this.currentHandleType === "checkboxTreeCheckbox") { if (this.currentHandleType === "checkboxTreeCheckbox") {
isSame = isEqual(oldValue, newValue); isSame = isEqual(oldValue, newValue);
console.log(oldValue,newValue,oldValue !== newValue,"newValue")
isOldValueEmpty = oldValue === newValue; isOldValueEmpty = oldValue === newValue;
} else { } else {
isSame = isEqual(current.oldValue, current.newValue); isSame = isEqual(current.oldValue, current.newValue);
isOldValueEmpty = this.isUnSubmitted(current.key);
isOldValueEmpty = this.isUnSubmitted(this.fieldKey+current.key);
} }
} else if (this.type === "checkbox") { } else if (this.type === "checkbox") {
@ -1311,7 +1315,7 @@ export default {
recordOldVlaue = `${current.des + current.oldValue}`; recordOldVlaue = `${current.des + current.oldValue}`;
recordValue = `${current.des + current.newValue}`; recordValue = `${current.des + current.newValue}`;
if (this.currentHandleType === "inputValue") { if (this.currentHandleType === "inputValue") {
finallyKey = current.key;
finallyKey = this.fieldKey+current.key;
} }
isModify = !!this.oldFqyqValue.mainRadio isModify = !!this.oldFqyqValue.mainRadio
} else if (this.type === "checkboxTree") { } else if (this.type === "checkboxTree") {
@ -1325,7 +1329,7 @@ export default {
} else { } else {
recordOldVlaue = `${current.des + (current.oldValue || '')}`; recordOldVlaue = `${current.des + (current.oldValue || '')}`;
recordValue = `${current.des + (current.newValue || '')}`; recordValue = `${current.des + (current.newValue || '')}`;
finallyKey = current.key;
finallyKey = this.fieldKey+current.key;
isModify = !!current.oldValue; isModify = !!current.oldValue;
} }
} else if (this.type === "radioTree") { } else if (this.type === "radioTree") {
@ -1338,7 +1342,7 @@ export default {
} else { } else {
recordOldVlaue = `${current.des + (current.oldValue || '')}`; recordOldVlaue = `${current.des + (current.oldValue || '')}`;
recordValue = `${current.des + (current.newValue || '')}`; recordValue = `${current.des + (current.newValue || '')}`;
finallyKey = current.key;
finallyKey = this.fieldKey+current.key;
isModify = !!current.oldValue; isModify = !!current.oldValue;
} }
} else if (this.type === "checkbox") { } else if (this.type === "checkbox") {
@ -1548,6 +1552,7 @@ export default {
// //
getModifyRecords() { getModifyRecords() {
const { fieldKey, getZdxgjl } = this; const { fieldKey, getZdxgjl } = this;
const records = getZdxgjl().filter(item => item.key === fieldKey); const records = getZdxgjl().filter(item => item.key === fieldKey);
return records; return records;
}, },

+ 3
- 2
src/components/Template/mixins/operationMixins.js View File

@ -24,7 +24,7 @@ export default {
const { fieldItemLabel, columnsData } = this.columns; const { fieldItemLabel, columnsData } = this.columns;
const { row } = this; const { row } = this;
const desArr = columnsData.map((item) => { const desArr = columnsData.map((item) => {
const label = this.$t(item.label), otherValue = "", subValue = "", mainValue = row[item.prop];
let label = this.$t(item.label), otherValue = "", subValue = "", mainValue = row[item.prop];
if (item.bodySubKey && (item.bodySubType !== "button")) { if (item.bodySubKey && (item.bodySubType !== "button")) {
subValue = row[item.bodySubKey]; subValue = row[item.bodySubKey];
} }
@ -44,7 +44,8 @@ export default {
"value": "", "value": "",
"title": "修改", "title": "修改",
"time": moment().format("YYYY-MM-DD HH:mm:ss"), "time": moment().format("YYYY-MM-DD HH:mm:ss"),
"reason": remark
"reason": remark,
type:"deleteRow"
} }
] ]
this.sureDelete(record); this.sureDelete(record);

+ 80
- 60
src/views/business/comps/template/comps/gsp/GSP015.vue View File

@ -56,9 +56,9 @@
<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">
@beforeReagentSubmit="(e) => beforeReagentSubmit(e, index, 'ybsm')"
@onRegentSubmit="(e) => onRegentSubmit(e, index, 'ybsm')" 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"
@configComplete="(e) => onConfigComplete(e, 'qy')" @configComplete="(e) => onConfigComplete(e, 'qy')"
@ -122,9 +122,11 @@
</div> </div>
<BaseInfoFormPackage fieldItemLabel="二次稀释信息" :ref="`ecFormPackageRef${index}`" <BaseInfoFormPackage fieldItemLabel="二次稀释信息" :ref="`ecFormPackageRef${index}`"
:formConfig="ecFormConfig" :formData="item" /> :formConfig="ecFormConfig" :formData="item" />
<CustomTable :ref="`ecTableRef${index}`" :columns="yjColumns" prefix="ec"
<CustomTable :ref="`ecTableRef${index}`" :columns="ecxsColumns" prefix="ec"
fieldItemLabel="二次稀释信息" @blur="(e) => onHandleTableBlur(e, index, 'ecTableRef')" fieldItemLabel="二次稀释信息" @blur="(e) => onHandleTableBlur(e, index, 'ecTableRef')"
:showOperation="fillType === 'preFill' || fillType === 'actFill'" :showOperation="fillType === 'preFill' || fillType === 'actFill'"
@beforeReagentSubmit="(e) => beforeReagentSubmit(e, index, 'ecxs')"
@onRegentSubmit="(e) => onRegentSubmit(e, index, 'ecxs')"
@onAddRow="() => addEcTableRow(index, 'ecTableRef')" :formData="item"> @onAddRow="() => addEcTableRow(index, 'ecTableRef')" :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"
@ -212,6 +214,10 @@ export default {
ecFormConfig() { ecFormConfig() {
return getEcFormConfig(this) return getEcFormConfig(this)
}, },
//
ecxsColumns() {
return getJyTableColumns(this, 'ec')
},
}, },
data() { data() {
return { return {
@ -233,95 +239,109 @@ export default {
methods: { methods: {
beforeReagentSubmit(data, index) { beforeReagentSubmit(data, index) {
const { selectData, callback, key, headerSelectFields } = data; const { selectData, callback, key, headerSelectFields } = data;
const {selectInfo = {}} = selectData;
const {nddw} = selectInfo;
const {sjzjnddw} = headerSelectFields;
if (
const { selectInfo = {} } = selectData;
const { nddw } = selectInfo;
const { sjzjnddw, qynddw } = headerSelectFields;
if (
key === 'zjbh' && key === 'zjbh' &&
!isCommonUnit(nddw, [sjzjnddw]) !isCommonUnit(nddw, [sjzjnddw])
) { ) {
//table //table
callback.prevent('浓度单位与预制不符,请重新选择或申请废止并重新预制。') callback.prevent('浓度单位与预制不符,请重新选择或申请废止并重新预制。')
} }
if (
key === 'qybh' &&
!isCommonUnit(nddw, [qynddw])
) {
//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));
onRegentSubmit(e, index, type) {
const { selectInfo, headerSelectFields } = e;
const { nd, nddw } = selectInfo.selectInfo;
const { sjzjnddw } = headerSelectFields;
if (type === 'ybsm') {
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 })
}
if(type === "ecxs"){
const { qynddw } = headerSelectFields;
const qynd = convertConcentration.convert(nd + nddw, qynddw);//
this.$refs[`ecTableRef${index}`][0].updateDataSourceByRowIndex(e.rowIndex, { qynd: parseFloat(qynd.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;
async handleUpdateCode() {
const { ecDataList = [], ybsmDataList = [] } = this.formData;
const codes = []; const codes = [];
let flag = false; let flag = false;
ybsmDataList.map((item,index) => {
const {stepTableFormData = [],jyStepTableFormData = []} = item;
stepTableFormData.map((step,sIndex) => {
if(step.qybhCode){
ybsmDataList.map((item, index) => {
const { stepTableFormData = [], jyStepTableFormData = [] } = item;
stepTableFormData.map((step, sIndex) => {
if (step.qybhCode) {
flag = true; 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}`,});
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){
jyStepTableFormData.map((step, sIndex) => {
if (step.jybhCode) {
flag = true; flag = true;
} }
codes.push({ pre: step.jybh, type: 1 ,id:`jyStepTableFormData_${step.jybh}_${index}_${sIndex}`,});
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){
ecDataList.map((item, index) => {
const { stepTableFormData } = item;
stepTableFormData.map((step, sIndex) => {
if (step.jybhCode) {
flag = true; flag = true;
} }
codes.push({ pre: step.jybh, type: 1 ,id:`ecStepTableFormData_${step.jybh}_${index}_${sIndex}`,});
codes.push({ pre: step.jybh, type: 1, id: `ecStepTableFormData_${step.jybh}_${index}_${sIndex}`, });
}); });
}); });
if(flag){
if (flag) {
return; return;
} }
const result = await this.getLatestSnArr(codes) const result = await this.getLatestSnArr(codes)
codes.map((item,index)=>{
codes.map((item, index) => {
item.sn = result[index] item.sn = result[index]
}) })
ybsmDataList.map((item,index)=>{
const {stepTableFormData = [],jyStepTableFormData = []} = item;
stepTableFormData.map((step,sIndex) => {
ybsmDataList.map((item, index) => {
const { stepTableFormData = [], jyStepTableFormData = [] } = item;
stepTableFormData.map((step, sIndex) => {
const id = `stepTableFormData_${step.qybh}_${index}_${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})
const o = codes.find((item) => item.id === id) || {};
this.$refs[`ybsmTableRef${index}`][0].updateDataSourceByRowIndex(sIndex, { qybhCode: o.sn })
}); });
jyStepTableFormData.map((step,sIndex) => {
jyStepTableFormData.map((step, sIndex) => {
const id = `jyStepTableFormData_${step.jybh}_${index}_${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})
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) => {
ecDataList.map((item, index) => {
const { stepTableFormData } = item;
stepTableFormData.map((step, sIndex) => {
const id = `ecStepTableFormData_${step.jybh}_${index}_${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})
const o = codes.find((item) => item.id === id) || {};
this.$refs[`ecTableRef${index}`][0].updateDataSourceByRowIndex(sIndex, { jybhCode: o.sn })
}); });
}) })
this.justUpdateFilledFormData(); this.justUpdateFilledFormData();
}, },
//blog //blog
async handleBeforeDownload({ html2pdf, options, pdfContent }) { async handleBeforeDownload({ html2pdf, options, pdfContent }) {
@ -344,7 +364,7 @@ export default {
}, },
// //
async uploadPdfToServer(blob) { async uploadPdfToServer(blob) {
let that=this
let that = this
const formData = new FormData(); const formData = new FormData();
formData.append('file', blob, 'hxhq-export-form.pdf'); formData.append('file', blob, 'hxhq-export-form.pdf');
try { try {
@ -368,7 +388,7 @@ export default {
studyFormFill_exportTbByFileUrl( studyFormFill_exportTbByFileUrl(
{ {
url: data.data.url, url: data.data.url,
studyFormFillId:that.formData.id,
studyFormFillId: that.formData.id,
version: that.appTitle, version: that.appTitle,
lang: that.$store.getters.language.split("_")[0] lang: that.$store.getters.language.split("_")[0]
} }
@ -529,7 +549,7 @@ export default {
deleteConfig(item, type = "ybsmDataList") { deleteConfig(item, type = "ybsmDataList") {
if (this.formData[type].length > 1) { if (this.formData[type].length > 1) {
const configIndex = this.formData[type].findIndex(config => config.id === item.id); const configIndex = this.formData[type].findIndex(config => config.id === item.id);
console.log(configIndex,item,"configIndex")
console.log(configIndex, item, "configIndex")
if (configIndex > -1) { if (configIndex > -1) {
const newList = [...this.formData[type]] const newList = [...this.formData[type]]
newList.splice(configIndex, 1); newList.splice(configIndex, 1);

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

@ -212,7 +212,7 @@ export const getQyTableColumns = ($this) => {
} }
//进样table //进样table
export const getJyTableColumns = ($this) => {
export const getJyTableColumns = ($this,type) => {
return [ return [
{ {
label: '进样编号', label: '进样编号',
@ -227,8 +227,8 @@ export const getJyTableColumns = ($this) => {
label: '取样编号', label: '取样编号',
prop: 'qybh', prop: 'qybh',
width: 200, width: 200,
bodyType: 'input',
bodyDisabled: true,
bodyType: type==="ec"?'mix':'input',
bodyDisabled: type!="ec",
bodyFillType: 'actFill', bodyFillType: 'actFill',
}, },
{ {

+ 1
- 1
src/views/business/comps/template/formConfig/sp/SP007.js View File

@ -110,7 +110,7 @@ export const getYbFormConfig = () => {
{ {
type: 'cellItem', type: 'cellItem',
config: { config: {
remark: {
ybsm: {
label: '', label: '',
type: 'textarea', type: 'textarea',
fillType: 'actFill', fillType: 'actFill',

Loading…
Cancel
Save