Browse Source

Merge branch 'master' into ouqian

# Conflicts:
#	src/views/business/comps/template/TemplateTable.vue
lkf
ouqian 1 month ago
parent
commit
ad7fd4c0b5
10 changed files with 707 additions and 63 deletions
  1. +13
    -0
      src/components/Template/BaseInfoFormPackage.vue
  2. +88
    -49
      src/components/Template/CustomTable.vue
  3. +124
    -3
      src/components/Template/HandleFormItem.vue
  4. +10
    -1
      src/lang/en/template/dl.js
  5. +10
    -1
      src/lang/zh/template/dl.js
  6. +24
    -2
      src/views/business/comps/template/TemplateTable.vue
  7. +208
    -0
      src/views/business/comps/template/comps/dl/DL016.vue
  8. +205
    -0
      src/views/business/comps/template/comps/dl/DL020.vue
  9. +23
    -5
      src/views/business/comps/template/comps/yp/YP003.vue
  10. +2
    -2
      vue.config.js

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

@ -114,6 +114,13 @@
@update:error="errors[key] = false" @resetRecord="resetRecord(key)" :item="sItem" @update:error="errors[key] = false" @resetRecord="resetRecord(key)" :item="sItem"
:value="formFields[key]" /> :value="formFields[key]" />
</div> </div>
<div v-else-if="sItem.type === 'checkboxTag'" class="flex1">
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key"
type="checkboxTag" :item="sItem" :value="formFields[key]"
@copy="onCopy(sItem, key)" @change="(e) => onAttachmentChange(key, e)"
:error="errors[key]" @update:error="errors[key] = false"
:orange-bg="orangeBgFields[key]" />
</div>
<div v-else-if="sItem.type === 'checkboxList'" class="flex1"> <div v-else-if="sItem.type === 'checkboxList'" class="flex1">
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key" <HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key"
type="checkboxList" :item="sItem" :value="formFields[key]" type="checkboxList" :item="sItem" :value="formFields[key]"
@ -268,6 +275,12 @@
@update:error="errors[key] = false" @resetRecord="resetRecord(key)" :item="sItem" @update:error="errors[key] = false" @resetRecord="resetRecord(key)" :item="sItem"
:value="formFields[key]" /> :value="formFields[key]" />
</div> </div>
<div v-else-if="sItem.type === 'checkboxTag'" class="flex flex1">
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key"
type="checkboxTag" :item="sItem" :value="formFields[key]" @copy="onCopy(sItem, key)"
@change="(e) => onAttachmentChange(key, e)" :error="errors[key]"
@update:error="errors[key] = false" :orange-bg="orangeBgFields[key]" />
</div>
<div v-else-if="sItem.type === 'checkboxList'" class="flex flex1"> <div v-else-if="sItem.type === 'checkboxList'" class="flex flex1">
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key" <HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key"
type="checkboxList" :item="sItem" :value="formFields[key]" @copy="onCopy(sItem, key)" type="checkboxList" :item="sItem" :value="formFields[key]" @copy="onCopy(sItem, key)"

+ 88
- 49
src/components/Template/CustomTable.vue View File

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<div class="custom-table-wrapper" :class="{'no-border': !isBorder}">
<div class="custom-table-wrapper" :class="{ 'no-border': !isBorder }">
<div class="custom-table-header" v-if="isBorder"> <div class="custom-table-header" v-if="isBorder">
<div class="custom-table-row"> <div class="custom-table-row">
<div v-if="showSort" class="custom-table-cell header-cell sort-cell"> <div v-if="showSort" class="custom-table-cell header-cell sort-cell">
@ -19,8 +19,9 @@
:error="hasError(-1, index, col.headerSelectKey)" :error="hasError(-1, index, col.headerSelectKey)"
@update:error="onErrorUpdate(-1, index, col.headerSelectKey, $event)" /> @update:error="onErrorUpdate(-1, index, col.headerSelectKey, $event)" />
</template> </template>
<div v-else-if="headerSelectFields[col.headerSelectKey]" class="fill-type-icon" :style="{ width: (templateFillType !== 'actFill')? '60px' : 'auto' }">({{
headerSelectFields[col.headerSelectKey] }})</div>
<div v-else-if="headerSelectFields[col.headerSelectKey]" class="fill-type-icon"
:style="{ width: (templateFillType !== 'actFill') ? '60px' : 'auto' }">({{
headerSelectFields[col.headerSelectKey] }})</div>
</div> </div>
@ -42,7 +43,7 @@
<div v-for="(col, colIndex) in columns" :key="colIndex" class="custom-table-cell body-cell" <div v-for="(col, colIndex) in columns" :key="colIndex" class="custom-table-cell body-cell"
:style="getCellWidth(col)"> :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 }">
<div v-if="!isBorder && col.label" class="mr-5"> <div v-if="!isBorder && col.label" class="mr-5">
{{ $t(col.label) }} {{ $t(col.label) }}
</div> </div>
@ -54,7 +55,7 @@
@change="onBodyValueChange(rowIndex, colIndex, $event)" @change="onBodyValueChange(rowIndex, colIndex, $event)"
:error="hasError(rowIndex, colIndex, col.prop)" :error="hasError(rowIndex, colIndex, col.prop)"
@update:error="onErrorUpdate(rowIndex, colIndex, col.prop, $event)" @update:error="onErrorUpdate(rowIndex, colIndex, col.prop, $event)"
@beforeSaveRecord = "(data,callback)=>beforeSaveRecord(data,callback,rowIndex, col,row)"
@beforeSaveRecord="(data, callback) => beforeSaveRecord(data, callback, rowIndex, col, row)"
:orange-bg="hasOrangeBg(rowIndex, colIndex, col.prop)" /> :orange-bg="hasOrangeBg(rowIndex, colIndex, col.prop)" />
</template> </template>
<template v-else-if="col.bodyType === 'inputNumber'"> <template v-else-if="col.bodyType === 'inputNumber'">
@ -65,7 +66,7 @@
@blur="onBlur(rowIndex, col.prop, $event)" @blur="onBlur(rowIndex, col.prop, $event)"
@change="onBodyValueChange(rowIndex, colIndex, $event)" @change="onBodyValueChange(rowIndex, colIndex, $event)"
:error="hasError(rowIndex, colIndex, col.prop)" :error="hasError(rowIndex, colIndex, col.prop)"
@beforeSaveRecord = "(data,callback)=>beforeSaveRecord(data,callback,rowIndex, col,row)"
@beforeSaveRecord="(data, callback) => beforeSaveRecord(data, callback, rowIndex, col, row)"
@update:error="onErrorUpdate(rowIndex, colIndex, col.prop, $event)" @update:error="onErrorUpdate(rowIndex, colIndex, col.prop, $event)"
:orange-bg="hasOrangeBg(rowIndex, colIndex, col.prop)" /> :orange-bg="hasOrangeBg(rowIndex, colIndex, col.prop)" />
</template> </template>
@ -75,7 +76,7 @@
:fieldItemLabel="fieldItemLabel" type="select" class="body-select" :fieldItemLabel="fieldItemLabel" type="select" class="body-select"
@blur="onBlur(rowIndex, col.prop, $event)" @blur="onBlur(rowIndex, col.prop, $event)"
:item="getBodyItem(col, rowIndex)" v-model="row[col.prop]" :item="getBodyItem(col, rowIndex)" v-model="row[col.prop]"
@change="onBodyValueChange(rowIndex, colIndex, $event,row,'select')"
@change="onBodyValueChange(rowIndex, colIndex, $event, row, 'select')"
:error="hasError(rowIndex, colIndex, col.prop)" :error="hasError(rowIndex, colIndex, col.prop)"
@update:error="onErrorUpdate(rowIndex, colIndex, col.prop, $event)" @update:error="onErrorUpdate(rowIndex, colIndex, col.prop, $event)"
:orange-bg="hasOrangeBg(rowIndex, colIndex, col.prop)" /> :orange-bg="hasOrangeBg(rowIndex, colIndex, col.prop)" />
@ -93,14 +94,13 @@
@update:error="onErrorUpdate(rowIndex, colIndex, col.prop, $event)" @update:error="onErrorUpdate(rowIndex, colIndex, col.prop, $event)"
:orange-bg="hasOrangeBg(rowIndex, colIndex, col.prop)" /> :orange-bg="hasOrangeBg(rowIndex, colIndex, col.prop)" />
</div> </div>
<div class="flex flex1" v-else-if="isRegent(col,'bodyType')">
<div class="flex flex1" v-else-if="isRegent(col, 'bodyType')">
<HandleFormItem :fieldKey="prefixKey + '_' + col.prop + '_' + rowIndex" <HandleFormItem :fieldKey="prefixKey + '_' + col.prop + '_' + rowIndex"
:fieldItemLabel="fieldItemLabel" :type="col.bodyType" class="body-clickable" :fieldItemLabel="fieldItemLabel" :type="col.bodyType" class="body-clickable"
sourceFrom = "customTable"
:item="getBodyItem(col, rowIndex)" :value="row[col.prop]"
:error="hasError(rowIndex, colIndex, col.prop)"
@onRegentSubmit="(data,inputValue)=>onRegentSubmit(data,inputValue,col, rowIndex, colIndex, row)"
@beforeReagentSubmit="(data, callback)=>onBeforeReagentSubmit(data, callback,col,row)"
sourceFrom="customTable" :item="getBodyItem(col, rowIndex)"
:value="row[col.prop]" :error="hasError(rowIndex, colIndex, col.prop)"
@onRegentSubmit="(data, inputValue) => onRegentSubmit(data, inputValue, col, rowIndex, colIndex, row)"
@beforeReagentSubmit="(data, callback) => onBeforeReagentSubmit(data, callback, col, row)"
@update:error="onErrorUpdate(rowIndex, colIndex, col.prop, $event)" @update:error="onErrorUpdate(rowIndex, colIndex, col.prop, $event)"
:orange-bg="hasOrangeBg(rowIndex, colIndex, col.prop)" /> :orange-bg="hasOrangeBg(rowIndex, colIndex, col.prop)" />
</div> </div>
@ -109,10 +109,20 @@
{{ row[col.prop] }} {{ row[col.prop] }}
</div> </div>
</template> </template>
<template v-else-if="col.bodyType === 'span'">
<div class="body-span">
{{ row[col.prop] }}
<template v-else-if="col.bodyType === 'checkboxTag'">
<div class="flex flex-wrap">
<HandleFormItem v-for="(tag, tagIndex) in row[col.prop]" :key="tagIndex"
:fieldKey="prefixKey + '_' + col.prop + '_' + rowIndex + '_' + tagIndex"
:fieldItemLabel="fieldItemLabel" type="checkboxTag"
@blur="onBlur(rowIndex, col.prop, $event)"
:value="tag"
:item="getBodyItem(col, rowIndex)"
@change="onCheckboxTagChange(rowIndex, colIndex,tagIndex, $event)"
:error="hasError(rowIndex, colIndex, col.prop)"
@update:error="onErrorUpdate(rowIndex, colIndex, col.prop, $event)"
:orange-bg="hasOrangeBg(rowIndex, colIndex, col.prop)" />
</div> </div>
</template> </template>
</div> </div>
@ -130,14 +140,15 @@
:orange-bg="hasOrangeBg(rowIndex, colIndex, col.otherCode)" /> :orange-bg="hasOrangeBg(rowIndex, colIndex, col.otherCode)" />
</div> </div>
</div> </div>
<div class="m-l-5 flex1" v-if="isShowBodySub(col, row)">
<div class="m-l-5" :class="{ 'flex1': col.bodySubType !== 'button' }"
v-if="isShowBodySub(col, row)">
<template v-if="col.bodySubType === 'inputNumber'"> <template v-if="col.bodySubType === 'inputNumber'">
<HandleFormItem :fieldKey="prefixKey + '_' + col.bodySubKey + '_' + rowIndex" <HandleFormItem :fieldKey="prefixKey + '_' + col.bodySubKey + '_' + rowIndex"
:fieldItemLabel="fieldItemLabel" type="inputNumber" :fieldItemLabel="fieldItemLabel" type="inputNumber"
@blur="onSubBlur(rowIndex, col.bodySubKey, $event)" @blur="onSubBlur(rowIndex, col.bodySubKey, $event)"
@copy="onCopy(rowIndex, col)" :item="getBodySubItem(col)" @copy="onCopy(rowIndex, col)" :item="getBodySubItem(col)"
v-model="row[col.bodySubKey]" v-model="row[col.bodySubKey]"
@change="onBodySubValueChange(rowIndex, colIndex,$event,)"
@change="onBodySubValueChange(rowIndex, colIndex, $event,)"
:error="hasError(rowIndex, colIndex, col.bodySubKey)" :error="hasError(rowIndex, colIndex, col.bodySubKey)"
@update:error="onErrorUpdate(rowIndex, colIndex, col.bodySubKey, $event)" @update:error="onErrorUpdate(rowIndex, colIndex, col.bodySubKey, $event)"
:orange-bg="hasOrangeBg(rowIndex, colIndex, col.bodySubKey)" /> :orange-bg="hasOrangeBg(rowIndex, colIndex, col.bodySubKey)" />
@ -148,7 +159,7 @@
@blur="onSubBlur(rowIndex, col.bodySubKey, $event)" @blur="onSubBlur(rowIndex, col.bodySubKey, $event)"
@copy="onCopy(rowIndex, col)" :item="getBodySubItem(col)" @copy="onCopy(rowIndex, col)" :item="getBodySubItem(col)"
v-model="row[col.bodySubKey]" v-model="row[col.bodySubKey]"
@change="onBodySubValueChange(rowIndex, colIndex,$event,)"
@change="onBodySubValueChange(rowIndex, colIndex, $event,)"
:error="hasError(rowIndex, colIndex, col.bodySubKey)" :error="hasError(rowIndex, colIndex, col.bodySubKey)"
@update:error="onErrorUpdate(rowIndex, colIndex, col.bodySubKey, $event)" @update:error="onErrorUpdate(rowIndex, colIndex, col.bodySubKey, $event)"
:orange-bg="hasOrangeBg(rowIndex, colIndex, col.bodySubKey)" /> :orange-bg="hasOrangeBg(rowIndex, colIndex, col.bodySubKey)" />
@ -158,7 +169,7 @@
:fieldItemLabel="fieldItemLabel" type="select" class="body-select" :fieldItemLabel="fieldItemLabel" type="select" class="body-select"
@blur="onSubBlur(rowIndex, col.bodySubKey, $event)" @blur="onSubBlur(rowIndex, col.bodySubKey, $event)"
:item="getBodySubItem(col, rowIndex)" v-model="row[col.bodySubKey]" :item="getBodySubItem(col, rowIndex)" v-model="row[col.bodySubKey]"
@change="onBodySubValueChange(rowIndex, colIndex, $event,row,'select')"
@change="onBodySubValueChange(rowIndex, colIndex, $event, row, 'select')"
:error="hasError(rowIndex, colIndex, col.bodySubKey)" :error="hasError(rowIndex, colIndex, col.bodySubKey)"
@update:error="onErrorUpdate(rowIndex, colIndex, col.bodySubKey, $event)" @update:error="onErrorUpdate(rowIndex, colIndex, col.bodySubKey, $event)"
:orange-bg="hasOrangeBg(rowIndex, colIndex, col.bodySubKey)" /> :orange-bg="hasOrangeBg(rowIndex, colIndex, col.bodySubKey)" />
@ -169,12 +180,18 @@
{{ row[col.bodySubKey] }} {{ row[col.bodySubKey] }}
</div> </div>
</template> </template>
<template v-else-if="col.bodySubType === 'button'">
<HandleFormItem class="ml-10" type="button" :item="getBodyButtonItem(col, rowIndex)"
:value="row[col.bodySubKey]"
@clickButton="(e, data) => handleClickButton(e, data, col.bodySubKey, rowIndex, colIndex)" />
</template>
</div> </div>
</div> </div>
</div> </div>
<!-- 默认操作栏 --> <!-- 默认操作栏 -->
<div class="custom-table-cell body-cell" :style="{ width: isBorder ? '245px' : 'auto' }" v-if="showOperation">
<div class="custom-table-cell body-cell" :style="{ width: isBorder ? '245px' : 'auto' }"
v-if="showOperation">
<div class="inner-table-cell"> <div class="inner-table-cell">
<slot name="operation" :row="row" :rowIndex="rowIndex" :columns="getOperationColumns()"> <slot name="operation" :row="row" :rowIndex="rowIndex" :columns="getOperationColumns()">
</slot> </slot>
@ -300,14 +317,20 @@ export default {
this.oldLocalDataSource = []; this.oldLocalDataSource = [];
}, },
methods: { methods: {
beforeSaveRecord(data,callback,rowIndex, col,row){
this.$emit("beforeSaveRecord", {inputData:data, callback,rowIndex, key:col.prop, rowData:row,dataSource:this.localDataSource})
onCheckboxTagChange(rowIndex, colIndex,tagIndex, e) {
console.log(e,"eee")
},
handleClickButton(e, data, key, rowIndex, colIndex) {
this.$emit("clickButton", key, rowIndex, colIndex, e, data,)
},
beforeSaveRecord(data, callback, rowIndex, col, row) {
this.$emit("beforeSaveRecord", { inputData: data, callback, rowIndex, key: col.prop, rowData: row, dataSource: this.localDataSource })
}, },
getCellWidth(col){
const {templateFillType} = this;
getCellWidth(col) {
const { templateFillType } = this;
let width = col.width ? col.width + 'px' : 'auto'; let width = col.width ? col.width + 'px' : 'auto';
if(templateFillType !== "actFill" && templateFillType !== "preFill"){
width = (col.showWidth)?col.showWidth + 'px' :(col.width ? col.width + 'px' : 'auto')
if (templateFillType !== "actFill" && templateFillType !== "preFill") {
width = (col.showWidth) ? col.showWidth + 'px' : (col.width ? col.width + 'px' : 'auto')
} }
return { width } return { width }
}, },
@ -348,18 +371,18 @@ export default {
} }
this.$emit("clickable", col, rowIndex, row) this.$emit("clickable", col, rowIndex, row)
}, },
onBeforeReagentSubmit(data, callback, col, row){
onBeforeReagentSubmit(data, callback, col, row) {
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 })
}, },
onRegentSubmit(data, inputValue, col, rowIndex, colIndex, row){
onRegentSubmit(data, inputValue, col, rowIndex, colIndex, row) {
if (this.templateFillType !== 'actFill') { if (this.templateFillType !== 'actFill') {
return return
} }
this.updateDataSourceByRowIndex(rowIndex,{[col.prop]:inputValue})
this.$emit("onRegentSubmit", {selectInfo:data,key:col.prop, col, rowIndex, colIndex, rowData:row})
this.updateDataSourceByRowIndex(rowIndex, { [col.prop]: inputValue })
this.$emit("onRegentSubmit", { selectInfo: data, key: col.prop, col, rowIndex, colIndex, rowData: row })
}, },
isShowAddRos() { isShowAddRos() {
if (this.showAddRow !== undefined) { if (this.showAddRow !== undefined) {
@ -374,7 +397,7 @@ export default {
if (this.isValueEmpty(this.localDataSource[rowIndex][col.copyFrom])) {// if (this.isValueEmpty(this.localDataSource[rowIndex][col.copyFrom])) {//
return return
} }
this.updateDataSourceByRowIndex(rowIndex,{[col.prop]:this.localDataSource[rowIndex][col.copyFrom]},"clickable")
this.updateDataSourceByRowIndex(rowIndex, { [col.prop]: this.localDataSource[rowIndex][col.copyFrom] }, "clickable")
this.onBlur(rowIndex, col.prop, this.localDataSource[rowIndex][col.prop]); this.onBlur(rowIndex, col.prop, this.localDataSource[rowIndex][col.prop]);
} }
}, },
@ -526,7 +549,7 @@ export default {
this.headerSelectFields[col.headerSelectTo] = value; this.headerSelectFields[col.headerSelectTo] = value;
} }
this.headerSelectFields[col.headerSelectKey] = value; this.headerSelectFields[col.headerSelectKey] = value;
this.$emit('headerSelectChange', {key:col.headerSelectKey, headerSelectFields:this.headerSelectFields,dataSource:this.localDataSource});
this.$emit('headerSelectChange', { key: col.headerSelectKey, headerSelectFields: this.headerSelectFields, dataSource: this.localDataSource });
// //
this.formErrors = this.formErrors.filter(error => this.formErrors = this.formErrors.filter(error =>
!(error.rowIndex === -1 && !(error.rowIndex === -1 &&
@ -588,7 +611,7 @@ export default {
}, },
// //
onBodyValueChange(rowIndex, colIndex, value,row,type) {
onBodyValueChange(rowIndex, colIndex, value, row, type) {
const col = this.columns[colIndex]; const col = this.columns[colIndex];
this.localDataSource[rowIndex][col.prop] = value; this.localDataSource[rowIndex][col.prop] = value;
@ -601,12 +624,12 @@ export default {
error.colIndex === colIndex && error.colIndex === colIndex &&
error.field === col.prop) error.field === col.prop)
); );
if(type === "select"){
this.$emit('bodySelectChange', {rowIndex,item:row, colIndex, value,key:col.prop,dataSource:this.localDataSource,headerSelectFields:this.headerSelectFields});
if (type === "select") {
this.$emit('bodySelectChange', { rowIndex, item: row, colIndex, value, key: col.prop, dataSource: this.localDataSource, headerSelectFields: this.headerSelectFields });
} }
}, },
// //
onBodySubValueChange(rowIndex, colIndex, value,row,type) {
onBodySubValueChange(rowIndex, colIndex, value, row, type) {
const col = this.columns[colIndex]; const col = this.columns[colIndex];
this.localDataSource[rowIndex][col.bodySubKey] = value; this.localDataSource[rowIndex][col.bodySubKey] = value;
@ -629,8 +652,8 @@ export default {
error.colIndex === colIndex && error.colIndex === colIndex &&
error.field === col.bodySubKey) error.field === col.bodySubKey)
); );
if(type === "select"){
this.$emit('bodySelectChange', {rowIndex,item:row, colIndex, value,key:col.bodySubKey,dataSource:this.localDataSource,headerSelectFields:this.headerSelectFields});
if (type === "select") {
this.$emit('bodySelectChange', { rowIndex, item: row, colIndex, value, key: col.bodySubKey, dataSource: this.localDataSource, headerSelectFields: this.headerSelectFields });
} }
}, },
getHeaderItem(col) { getHeaderItem(col) {
@ -651,13 +674,20 @@ export default {
copyFrom: col.copyFrom || "", copyFrom: col.copyFrom || "",
compareTo: col.compareTo, // compareTo compareTo: col.compareTo, // compareTo
type: col.bodyType || "input", type: col.bodyType || "input",
filledCodes:col.filledCodes,
filledCodes: col.filledCodes,
}; };
if (col.bodyDisabled) { if (col.bodyDisabled) {
item.disabled = col.bodyDisabled; item.disabled = col.bodyDisabled;
} }
return item return item
}, },
getBodyButtonItem(col,) {
return {
buttonName: col.bodySubButtonName,
fillType: col.bodySubFillType,
type: "button",
}
},
getBodySubItem(col) { getBodySubItem(col) {
const item = { const item = {
fillType: col.bodySubFillType, fillType: col.bodySubFillType,
@ -719,7 +749,7 @@ export default {
targetStartSolutionVolumePrecision: 3,//3 targetStartSolutionVolumePrecision: 3,//3
}); });
}, },
// //
addRow(row = {}) { addRow(row = {}) {
this.localDataSource.push(row); this.localDataSource.push(row);
@ -779,7 +809,7 @@ export default {
} }
} }
this.$emit("blur", { rowIndex, colKey, value,dataSource:this.localDataSource,headerSelectFields:this.headerSelectFields, item: this.localDataSource[rowIndex] });
this.$emit("blur", { rowIndex, colKey, value, dataSource: this.localDataSource, headerSelectFields: this.headerSelectFields, item: this.localDataSource[rowIndex] });
}, },
onSubBlur(rowIndex, colKey, value) { onSubBlur(rowIndex, colKey, value) {
// //
@ -810,13 +840,16 @@ export default {
font-size: 14px; font-size: 14px;
color: #606266; color: #606266;
margin-top: 20px; margin-top: 20px;
&.no-border { &.no-border {
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
border-radius: 5px 5px; border-radius: 5px 5px;
border: none; border: none;
.custom-table-cell { .custom-table-cell {
border-right: none; border-right: none;
} }
.custometable-row { .custometable-row {
display: flex; display: flex;
border-bottom: none; border-bottom: none;
@ -885,7 +918,7 @@ export default {
text-align: left; text-align: left;
vertical-align: middle; vertical-align: middle;
border-right: 1px solid #ebeef5; border-right: 1px solid #ebeef5;
page-break-inside: avoid;
page-break-inside: avoid;
box-sizing: border-box; box-sizing: border-box;
} }
@ -897,15 +930,15 @@ export default {
color: #909399; color: #909399;
background-color: #f5f7fa; background-color: #f5f7fa;
font-size: 12px; font-size: 12px;
word-break: break-word;
white-space: normal;
word-break: break-word;
white-space: normal;
} }
.body-cell { .body-cell {
color: #606266; color: #606266;
page-break-inside: avoid;
page-break-inside: avoid;
background-color: #fff; background-color: #fff;
} }
@ -980,15 +1013,21 @@ export default {
.body-span { .body-span {
text-align: center; text-align: center;
} }
.item-center { .item-center {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.mr-5{
.mr-5 {
margin-right: 5px; margin-right: 5px;
} }
.sort-cell{
.sort-cell {
text-align: center; text-align: center;
width: 100px; width: 100px;
} }
.flex-wrap{
flex-wrap: wrap;
}
</style> </style>

+ 124
- 3
src/components/Template/HandleFormItem.vue View File

@ -1,6 +1,6 @@
<template> <template>
<div class="flex " :class="type !=='radio' ? 'flex1' : ''">
<div class="flex" :class="type !=='radio' ? 'flex1' : ''">
<div class="flex " :class="getFlexClass()">
<div class="flex" :class="getFlexClass()">
<el-input v-if="type === 'input'" :maxlength="item.maxlength || 50" :disabled="getDisabled()" <el-input v-if="type === 'input'" :maxlength="item.maxlength || 50" :disabled="getDisabled()"
:class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')" @blur="onBlur" :class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')" @blur="onBlur"
:placeholder="getPlaceholder()" v-model="inputValue" @input="onInputChange" @change="onInputChange" /> :placeholder="getPlaceholder()" v-model="inputValue" @input="onInputChange" @change="onInputChange" />
@ -89,6 +89,30 @@
<div slot="tip" class="el-upload__tip">支持扩展名.rar .zip .doc .docx .pdf .jpg文件大小不超过2MB</div> <div slot="tip" class="el-upload__tip">支持扩展名.rar .zip .doc .docx .pdf .jpg文件大小不超过2MB</div>
</el-upload> </el-upload>
</template> </template>
<div v-else-if="type === 'checkboxTag'" class="flex1 checkbox-tag-container"
:class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')">
<div class="checkbox-tag-item">
<el-checkbox v-model="checkboxTagChecked" :disabled="getDisabled()" @change="onCheckboxTagChange"></el-checkbox>
<div class="tag-content blue-border" @click="onTagClick">
<el-input v-if="isEditingTag"
v-model="tagValue"
ref="tagInput"
:maxlength="item.maxlength || 20"
@blur="onTagBlur"
@keyup.enter.native="onTagBlur"
placeholder="请输入"
size="mini"
class="tag-input" />
<el-tag v-else
:type="'info'"
class="tag-display"
:closable="false">
{{ tagValue || '点击输入' }}
</el-tag>
</div>
<i class="el-icon-close delete-icon" @click="onDeleteTag" v-if="tagValue"></i>
</div>
</div>
</div> </div>
<div class="handle-row" v-if="isShowHandle()"> <div class="handle-row" v-if="isShowHandle()">
@ -218,7 +242,7 @@ export default {
}, },
data() { data() {
let initialValue = this.value; let initialValue = this.value;
let initialOtherValues = {};
let initialOtherValues = {},checkboxTagChecked = false,tagValue = '';
// checkboxListvalue // checkboxListvalue
if (this.type === 'checkboxList' && this.value && typeof this.value === 'object') { if (this.type === 'checkboxList' && this.value && typeof this.value === 'object') {
@ -226,6 +250,9 @@ export default {
initialOtherValues = this.value.otherValues || {}; initialOtherValues = this.value.otherValues || {};
} else if (this.type === 'checkboxList' && !Array.isArray(this.value)) { } else if (this.type === 'checkboxList' && !Array.isArray(this.value)) {
initialValue = []; initialValue = [];
}else if (this.type === 'checkboxTag' && this.value && typeof this.value === 'object') {
checkboxTagChecked = this.value.checked || false;
tagValue = this.value.tagValue || '';
} }
return { return {
inputValue: initialValue, inputValue: initialValue,
@ -241,6 +268,9 @@ export default {
replyContent: '', // replyContent: '', //
visible: false,// visible: false,//
checkboxValue: this.getChecked(),// checkboxValue: this.getChecked(),//
checkboxTagChecked: checkboxTagChecked, // checkboxTagcheckbox
tagValue: tagValue, // checkboxTagtag
isEditingTag: false, // tag
uuid: getuuid(), // EventBus uuid: getuuid(), // EventBus
regentType: ['sj', 'gsp', 'mix', 'xj', 'xb', 'gyzj', 'mjy', 'yq', 'jcb', 'qxbd'], //// regentType: ['sj', 'gsp', 'mix', 'xj', 'xb', 'gyzj', 'mjy', 'yq', 'jcb', 'qxbd'], ////
selectRegentInfo: {},//// selectRegentInfo: {},////
@ -255,9 +285,13 @@ export default {
}, },
watch: { watch: {
value(newVal) { value(newVal) {
console.log(newVal,"newVal")
if (this.type === 'checkboxList' && newVal && typeof newVal === 'object') { if (this.type === 'checkboxList' && newVal && typeof newVal === 'object') {
this.inputValue = newVal.checkboxValues || []; this.inputValue = newVal.checkboxValues || [];
this.otherValues = newVal.otherValues || {}; this.otherValues = newVal.otherValues || {};
} else if (this.type === 'checkboxTag' && newVal && typeof newVal === 'object') {
this.checkboxTagChecked = newVal.checked || false;
this.tagValue = newVal.tagValue || '';
} else { } else {
this.inputValue = this.type === 'checkboxList' && !Array.isArray(newVal) ? [] : newVal; this.inputValue = this.type === 'checkboxList' && !Array.isArray(newVal) ? [] : newVal;
} }
@ -294,6 +328,10 @@ export default {
EventBus.$off("onMixReagentSubmit", this.onMixReagentSubmit) EventBus.$off("onMixReagentSubmit", this.onMixReagentSubmit)
}, },
methods: { methods: {
getFlexClass(){
const noFlexArr = ["radio","checkboxTag"]
return noFlexArr.includes(this.type) ? '' : 'flex1'
},
getDecimalDigits(){ getDecimalDigits(){
const {precision} = this.item; const {precision} = this.item;
if(!isNaN(precision)){ if(!isNaN(precision)){
@ -774,6 +812,40 @@ export default {
this.otherValues[code] = value; this.otherValues[code] = value;
this.onInputChange(); this.onInputChange();
}, },
// checkboxTagcheckbox
onCheckboxTagChange() {
this.emitCheckboxTagValue();
},
// tag
onTagClick() {
this.isEditingTag = true;
this.$nextTick(() => {
this.$refs.tagInput && this.$refs.tagInput.focus();
});
},
// tag
onTagBlur() {
this.isEditingTag = false;
this.emitCheckboxTagValue();
//
if (this.tagValue) {
this.onCommonHandleSaveRecord(this.tagValue);
}
},
// tag
onDeleteTag() {
this.tagValue = '';
this.emitCheckboxTagValue();
this.onCommonHandleSaveRecord('');
},
// checkboxTag
emitCheckboxTagValue() {
const value = {
checked: this.checkboxTagChecked,
tagValue: this.tagValue
};
this.$emit('change', value);
},
// //
onBlur(e) { onBlur(e) {
this.onCommonHandleSaveRecord(e.target.value); this.onCommonHandleSaveRecord(e.target.value);
@ -927,6 +999,9 @@ export default {
} }
if(this.type === "button"){ if(this.type === "button"){
this.$emit('clickButton', this.item,this.inputValue,data); this.$emit('clickButton', this.item,this.inputValue,data);
if(this.templateFillType === "preFill"){
return;
}
} }
// //
this.oldValue = value; // this.oldValue = value; //
@ -1569,4 +1644,50 @@ export default {
border-color: #f9c588; border-color: #f9c588;
} }
} }
// checkboxTag
.checkbox-tag-container {
border-radius: 4px;
// transition: all 0.3s;
margin-bottom: 5px;
margin-right: 5px;
&.error-border {
border-color: #ff5d5d !important;
box-shadow: 0 0 6px #ffc3c3 !important;
}
.checkbox-tag-item {
display: flex;
align-items: center;
gap: 8px;
.tag-content {
cursor: pointer;
.tag-input {
width: 100px;
}
.tag-display {
cursor: pointer;
user-select: none;
}
}
.delete-icon {
cursor: pointer;
color: #909399;
font-size: 14px;
padding: 2px;
border-radius: 50%;
// transition: all 0.3s;
&:hover {
color: #ff5d5d;
background-color: #f5f5f5;
}
}
}
}
</style> </style>

+ 10
- 1
src/lang/en/template/dl.js View File

@ -1,4 +1,13 @@
//毒理 //毒理
export default { export default {
dl001: {}
dl001: {},
dl020: {
swdljlbxx: '毒理记录表信息',
xbxx:'细胞信息',
sydd:'实验地点',
czsj:'操作时间',
qxbd: '前序表单',
dlbz: '备注',
czbz: '操作步骤',
}
} }

+ 10
- 1
src/lang/zh/template/dl.js View File

@ -1,4 +1,13 @@
//毒理 //毒理
export default { export default {
dl001: {}
dl001: {},
dl020: {
swdljlbxx: '毒理记录表信息',
xbxx:'细胞信息',
sydd:'实验地点',
czsj:'操作时间',
qxbd: '前序表单',
dlbz: '备注',
czbz: '操作步骤',
}
} }

+ 24
- 2
src/views/business/comps/template/TemplateTable.vue View File

@ -86,6 +86,9 @@ import DL012 from './comps/dl/DL012.vue'
import DL013 from './comps/dl/DL013.vue' import DL013 from './comps/dl/DL013.vue'
import DL014 from './comps/dl/DL014.vue' import DL014 from './comps/dl/DL014.vue'
import DL015 from './comps/dl/DL015.vue' import DL015 from './comps/dl/DL015.vue'
import DL016 from "./comps/dl/DL016.vue";
import DL020 from "./comps/dl/DL020.vue";
export default { export default {
name: "TemplateTable", name: "TemplateTable",
@ -121,7 +124,24 @@ export default {
DL012, DL012,
DL013, DL013,
DL014, DL014,
DL015
DL015,
DL016,
DL020
},
data() {
return {
componentMap: null,
}
},
methods: {
getTemplateComponent() {
if (!this.sn) return 'Demo';
let componentName = this.componentMap[this.sn] || 'Demo';
return componentName;
},
handleEditSignCancel(e) {
EventBus.$emit('edit-sign-cancel', e);
},
}, },
props: { props: {
sn: { sn: {
@ -222,6 +242,8 @@ export default {
'DL013': 'DL013', 'DL013': 'DL013',
'DL014': 'DL014', 'DL014': 'DL014',
'DL015': 'DL015', 'DL015': 'DL015',
'DL016': 'DL016',
'DL020': 'DL020',
} }
} }
return this.componentMap || "Demo" return this.componentMap || "Demo"
@ -408,4 +430,4 @@ export default {
padding: 10px 10px; padding: 10px 10px;
width: 100%; width: 100%;
} }
</style>
</style>

+ 208
- 0
src/views/business/comps/template/comps/dl/DL016.vue View File

@ -0,0 +1,208 @@
<!-- 生物分析生物样品采集管制备表 -->
<template>
<div>
<div class="detail-container">
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.bdmc }}<img
src="@/assets/images/detail-title.png" /></div>
<div class="detail-content">
<div class="content">
<BaseInfoFormPackage fieldItemLabel="template.common.baseInfo" label="template.common.baseInfo"
ref="baseInfoRef" :formConfig="baseInfoFormConfig" :formData="formData" />
<TableList label="template.common.reagentInfo" :columns="sysjColumns" :dataSource="resource" />
<TableList label="template.common.instrumentInfo" :columns="yqColumns" :dataSource="yqResource" />
<LineLabel label="template.yp.yp004.zbxx" />
<CustomTable
:ref="`tableRef`"
:columns="tableColumns"
:formData="formData"
:prefixKey = "`table`"
fieldItemLabel = "template.common.operationSteps"
:showOperation="fillType === 'preFill'"
>
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaionDelete :row="row" :rowIndex="rowIndex" :columns="columns" @deleteRow="deleteRow" ></TableOpertaionDelete>
</template>
</CustomTable>
<LineLabel label="template.yp.yp004.zbbz" />
<Step ref="stepRef" :formData="formData.stepData"></Step>
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark"
ref="remarkRef" :formConfig="remarkConig" :formData="formData" />
</div>
</div>
</div>
<!-- <button @click="onSave">保存</button> -->
</div>
</template>
<script>
import BaseInfoFormPackage from "@/components/Template/BaseInfoFormPackage";
import LineLabel from "@/components/Template/LineLabel";
import TableList from "@/components/Template/Table";
import Step from "@/components/Template/Step";
import templateMixin from "../../mixins/templateMixin";
import CustomTable from '@/components/Template/CustomTable.vue';
import { EventBus } from "@/utils/eventBus";
import { uniqeResource } from "@/utils/calUnitTools";
import { debounce } from 'lodash-es'
import TableOpertaionDelete from "@/components/Template/operation/TableOpertaionDelete.vue"
export default {
name: "DL016",
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable,TableOpertaionDelete },
mixins: [templateMixin],
props: {
fillType: {
type: String,
default: 'preFill',
},
},
computed: {
//
remarkConig() {
return [
{
type: "cellItem",
config: {
remark: {
label: "",
type: "textarea",
fillType: "actFill",
span: 1,
placeholder: 'template.common.remarkPlaceholder',
maxlength: 1000,
rows: 5
}
}
}
]
},
//
baseInfoFormConfig() {
return [
{
type: "cardItem",
config: {
studyMc: {
label: 'template.common.testName',
type: "input",
disabled: true,
},
studySn: {
label: 'template.common.testNumber',
type: "input",
disabled: true,
},
}
},
{
type: "conditionItem",
label: 'template.yp.yp004.pztj',
config: {
pre: {
label: 'template.common.preFill',
type: "select",
multiple: true,
fillType: "preFill",
options: this.getDictOptions('business_pztj'),
otherCode: "preOther",
},
act: {
label: 'template.common.actualFill',
type: "select",
fillType: "actFill",
otherCode: "actOther",
multiple: true,
compareTo: "pre",
options: this.getDictOptions('business_pztj')
}
}
},
{
type: "cellItem",
label: 'template.lba.lba002.czsj',
config: {
startDate: {
label: 'template.common.startTime',
type: "input",
},
endDate: {
label: 'template.common.endTime',
type: "input",
},
}
}
]
},
//
tableColumns() {
return [{
label: 'template.yp.yp004.zbdx',
prop: 'zbdx',
bodyType: 'input',
bodyFillType: 'preFill',
width: 280,
bodyMaxlength: 50,
},{
label: 'template.yp.yp004.yjzbs',
prop: 'yjzbs',
bodyType: 'inputNumber',
bodyFillType: 'preFill',
width: 280,
bodyMaxlength: 10,
},{
label: 'template.yp.yp004.sjzbs',
prop: 'sjzbs',
bodyType: 'inputNumber',
bodyFillType: 'actFill',
width: 280,
bodyMaxlength: 10,
copyFrom:'yjzbs',
compareTo:'yjzbs'
}]
},
},
data() {
return {
formData: {},
};
},
mounted() {
},
methods: {
//
getFilledFormData() {
return this.getFilledFormDataByRefs(["baseInfoRef", "tableRef", "stepRef", "remarkRef"])
},
//
async getFormData() {
let content = await this.validFormFields(["baseInfoRef", "tableRef", "stepRef", "remarkRef"]);
return content;
},
getResource() {
//使
const stepResource = this.$refs.stepRef.getStepResource()
this.resourceTmp = stepResource.sjResource || []
this.yqResourceTmp = stepResource.yqResource || []
return this.resourceTmp;
},
//
async onSave() {
let content = await this.$refs.stepRef.getFormData();
console.log(content);
},
//
deleteRow(rowIndex) {
const tableRef = this.$refs['tableRef'];
if (tableRef) {
tableRef.deleteRow(rowIndex);
}
},
}
};
</script>
<style rel="stylesheet/scss" lang="scss">
</style>

+ 205
- 0
src/views/business/comps/template/comps/dl/DL020.vue View File

@ -0,0 +1,205 @@
<!-- 生物样品接收记录表 -->
<template>
<div>
<div class="detail-container">
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.bdmc }}<img src="@/assets/images/detail-title.png" /></div>
<div class="detail-content">
<div class="content">
<BaseInfoFormPackage fieldItemLabel="template.common.baseInfo" label="template.common.baseInfo"
ref="baseInfoRef" :formConfig="baseInfoFormConfig" :formData="formData" />
<TableList label="template.common.reagentInfo" :columns="sysjColumns" :dataSource="resource" />
<TableList label="template.common.instrumentInfo" :columns="yqColumns" :dataSource="yqResource" />
<BaseInfoFormPackage fieldItemLabel="template.dl.dl020.xbxx" label="template.dl.dl020.xbxx"
ref="swypyjInfoRef" :formConfig="swypyjInfoFormConfig" :formData="formData"
/>
<LineLabel label="template.dl.dl020.czbz" />
<Step ref="stepRef" :formData="formData.stepData"></Step>
<BaseInfoFormPackage fieldItemLabel="template.dl.dl020.dlbz" label="template.dl.dl020.dlbz"
ref="remarkRef" :formConfig="remarkConig" :formData="formData" />
</div>
</div>
</div>
<!-- <button @click="onSave">保存</button> -->
</div>
</template>
<script>
import BaseInfoFormPackage from "@/components/Template/BaseInfoFormPackage";
import LineLabel from "@/components/Template/LineLabel";
import TableList from "@/components/Template/Table";
import Step from "@/components/Template/Step";
import templateMixin from "../../mixins/templateMixin";
import moment from "moment";
export default {
name: "DL020",
components: { BaseInfoFormPackage, LineLabel, TableList, Step },
mixins: [templateMixin],
props: {
fillType: {
type: String,
default: 'preFill',
},
},
computed: {
//
remarkConig() {
return [
{
type: "cellItem",
config: {
remark: {
label: "",
type: "textarea",
fillType: "actFill",
span: 1,
placeholder: 'template.common.remarkPlaceholder',
maxlength: 1000,
rows: 5
}
}
}
]
},
//
baseInfoFormConfig() {
return [
{
type: "cardItem",
config: {
studyMc: {
label: 'template.common.testName',
type: "input",
disabled: true,
},
studySn: {
label: 'template.common.testNumber',
type: "input",
disabled: true,
},
}
},
{
type: "cellItem",
label: 'template.dl.dl020.sydd',
config: {
pre: {
label: 'template.dl.dl020.sydd',
type: "input",
fillType: "actFill",
},
}
},
{
type: "cellItem",
label: 'template.dl.dl020.czsj',
config: {
startDate: {
label: 'template.common.startTime',
type: "input",
},
endDate: {
label: 'template.common.endTime',
type: "input",
},
}
}
]
},
//
swypyjInfoFormConfig() {
return [
{
type: "cellItem",
config: {
qxbd: {
span:1,
label: 'template.dl.dl020.qxbd',
type: 'qxbd',
fillType: 'actFill',
filledCodes:['bdmc','bdbh'],
},
}
},
]
},
},
data() {
return {
formData: {},
};
},
mounted() {
},
methods: {
//
// handleClickButton(item,signData){
// this.$refs.ypjsInfoRef.updateFormData("jssj", moment().format("YYYY/MM/DD HH:mm"),{isUpdateRecord:true,signData});
// },
//
getFilledFormData() {
const baseData = this.$refs.baseInfoRef.getFilledFormData();
const swypyjData = this.$refs.swypyjInfoRef.getFilledFormData();
const remarkData = this.$refs.remarkRef.getFilledFormData();
const stepData = this.$refs.stepRef.getFilledFormData();
return {
...baseData,
...swypyjData,
...remarkData,
...stepData,
}
},
//
async getFormData() {
//
const validFlag = await this.validFields();
if (!validFlag) {
return false;
}
let content = this.getFilledFormData();
return content
},
//
async validFields() {
//
let refsToValidate = ["baseInfoRef", "swypyjInfoRef", "stepRef", "remarkRef"];
return await this.validFormFields(refsToValidate);
},
getResource() {
let content = this.getFilledFormData();
//使
const stepResource = this.$refs.stepRef.getStepResource()
this.resourceTmp = stepResource.sjResource || []
this.yqResourceTmp = stepResource.yqResource || []
return this.resourceTmp;
},
//
async onSave() {
const formData = this.getStepResource();
console.log(formData, "formData")
},
}
};
</script>
<style rel="stylesheet/scss" lang="scss">
.mt-20 {
margin-top: 20px;
}
.print-btn {
margin-bottom: 20px;
}
.config-header-end {
display: flex;
justify-content: flex-end;
align-items: center;
margin-bottom: 15px;
font-weight: bold;
font-size: 16px;
color: #303133;
}
</style>

+ 23
- 5
src/views/business/comps/template/comps/yp/YP003.vue View File

@ -19,6 +19,7 @@
:formData="formData" :formData="formData"
:prefixKey = "`table`" :prefixKey = "`table`"
fieldItemLabel = "template.common.operationSteps" fieldItemLabel = "template.common.operationSteps"
@clickButton="handleClickButton"
:showOperation="fillType === 'preFill'" :showOperation="fillType === 'preFill'"
> >
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> <template slot="operation" slot-scope="{ row, rowIndex, columns }">
@ -34,9 +35,6 @@
</div> </div>
</div> </div>
<!-- <button @click="onSave">保存</button> --> <!-- <button @click="onSave">保存</button> -->
<el-button type="primary" @click="showImportExcelDialog">{{ $t('template.common.importTemplate')
}}</el-button>
<ImportExcelDialog ref="ImportExcelDialog" @onLoadData="onLoadExcelData" :downloadArr="['动物编号']" @downloadExcelTemplate="downloadExcelTemplate" /> <ImportExcelDialog ref="ImportExcelDialog" @onLoadData="onLoadExcelData" :downloadArr="['动物编号']" @downloadExcelTemplate="downloadExcelTemplate" />
</div> </div>
</template> </template>
@ -166,8 +164,13 @@ export default {
},{ },{
label: 'template.yp.yp003.dwbh', label: 'template.yp.yp003.dwbh',
prop: 'dwbh', prop: 'dwbh',
bodyType: 'input',
bodyType: 'checkboxTag',
bodyFillType: 'actFill', bodyFillType: 'actFill',
bodySubType:"button",
bodySubFillType:"preFill",
bodySubButtonName:"template.common.importTemplate",
bodySubKey:"exportBtn",
showBodySub:true,
width: 280, width: 280,
},{ },{
label: 'template.yp.yp003.ypsl', label: 'template.yp.yp003.ypsl',
@ -181,11 +184,19 @@ export default {
data() { data() {
return { return {
formData: {}, formData: {},
currentRowIndex: -1,
}; };
}, },
mounted() { mounted() {
}, },
methods: { methods: {
//
handleClickButton(key,rowIndex,colIndex,e,data){
if(key === "exportBtn"){
this.currentRowIndex = rowIndex;
this.$refs.ImportExcelDialog.show()
}
},
// //
getFilledFormData() { getFilledFormData() {
return this.getFilledFormDataByRefs(["baseInfoRef", "tableRef", "stepRef", "remarkRef"]) return this.getFilledFormDataByRefs(["baseInfoRef", "tableRef", "stepRef", "remarkRef"])
@ -220,7 +231,14 @@ export default {
this.$refs.ImportExcelDialog.show() this.$refs.ImportExcelDialog.show()
}, },
onLoadExcelData(excelData) { onLoadExcelData(excelData) {
console.log(excelData)
const data = excelData.splice(1);
const tagData = data.map((item)=>{
return {
checked:false,
tagValue:item[0],
}
})
this.$refs.tableRef.updateDataSourceByRowIndex(this.currentRowIndex,{dwbh:tagData});
this.$refs.ImportExcelDialog.cancel() this.$refs.ImportExcelDialog.cancel()
}, },
downloadExcelTemplate(arr){ downloadExcelTemplate(arr){

+ 2
- 2
vue.config.js View File

@ -34,8 +34,8 @@ module.exports = {
proxy: { proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy // detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: { [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, changeOrigin: true,
pathRewrite: { pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: '' ['^' + process.env.VUE_APP_BASE_API]: ''

Loading…
Cancel
Save