Browse Source

feat:[模板管理][update]

luojie
luojie 1 month ago
parent
commit
128ec22c68
7 changed files with 118 additions and 40 deletions
  1. +2
    -2
      src/components/Template/CustomTable.vue
  2. +13
    -10
      src/components/Template/HandleFormItem.vue
  3. +76
    -0
      src/components/Template/mixins/operationMixins.js
  4. +13
    -12
      src/components/Template/operation/TableOpertaion.vue
  5. +12
    -16
      src/components/Template/operation/TableOpertaionDelete.vue
  6. +1
    -0
      src/views/business/comps/template/comps/dl/DL007.vue
  7. +1
    -0
      src/views/business/comps/template/comps/dl/DL023.vue

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

@ -496,7 +496,7 @@ export default {
},
//
getOperationColumns() {
return { columnsData: this.columns, headerSelectFields: this.headerSelectFields }
return { columnsData: this.columns, headerSelectFields: this.headerSelectFields,fieldItemLabel: this.fieldItemLabel }
},
//
getOtherItem(sItem) {
@ -1010,7 +1010,7 @@ export default {
this.localDataSource[rowIndex] = { ...this.localDataSource[rowIndex], ...data };
this.localDataSource = [...this.localDataSource];
this.checkCompareToOnDataLoad();
justUpdateFilledFormData();
// justUpdateFilledFormData();
},
pushDataSource(data=[]) {
this.localDataSource.push(...data);

+ 13
- 10
src/components/Template/HandleFormItem.vue View File

@ -213,7 +213,7 @@
</div>
</div>
</div>
<el-dialog :close-on-click-modal="false" append-to-body :title="templateFillType == 'actFill' ? '回复意见' : '复核意见'"
<el-dialog :close-on-click-modal="false" append-to-body :title="(templateFillType == 'actFill' || templateFillType == 'blxjsh') ? '回复意见' : '复核意见'"
:visible.sync="visible" width="30%">
<el-input v-model="replyContent" type="textarea" show-word-limit resize="none" rows="8" placeholder="输入内容"
maxlength="500" />
@ -744,6 +744,7 @@ export default {
const filterType = ["attachment", "checkboxTag", "fqyq", "checkboxTree","radio"]
const typeObj = {
actFill: "orange-border",//
blxjsh: "orange-border",//
green: "green-border",
preFill: "blue-border",//
}
@ -765,10 +766,10 @@ export default {
const baseInfo = this.getCommonRecordInfo();
const record = {
...baseInfo,
title: this.templateFillType == 'actFill' ? "回复意见" : "复核意见",
title: (this.templateFillType == 'actFill' || this.templateFillType == 'blxjsh') ? "回复意见" : "复核意见",
time: moment().format("YYYY-MM-DD HH:mm:ss"),
}
if (this.templateFillType == 'actFill') {
if (this.templateFillType == 'actFill' || this.templateFillType == 'blxjsh') {
record.reply = this.replyContent;
const deepList = deepClone(this.getFhyjjl());//
const item = deepList.find(o => o.key == record.key);
@ -798,7 +799,7 @@ export default {
}
const params = {
//reply:content:
type: this.templateFillType == 'actFill' ? "reply" : "content",
type: (this.templateFillType == 'actFill' || this.templateFillType == 'blxjsh') ? "reply" : "content",
newRecord: [record],
resourceList: this.getFhyjjl(),
}
@ -1066,7 +1067,7 @@ export default {
// question
onClickQuestion() {
const { templateFillType } = this;
if (templateFillType == 'actFill' || templateFillType == 'qc') {
if (templateFillType == 'actFill' || templateFillType == 'qc' || templateFillType == 'blxjsh') {
if (templateFillType == 'qc') {
const field = this.getFieldCheckObj()[this.fieldKey];
if (field && field.checked) {
@ -1083,7 +1084,7 @@ export default {
const o = records[0];
if (!o.reply && templateFillType == 'qc') {//qc
content = o.content;
} else if (templateFillType == 'actFill') {//qc
} else if (templateFillType == 'actFill' || templateFillType == 'blxjsh') {//qc
content = o.reply;
}
}
@ -1197,7 +1198,7 @@ export default {
if (isSame) {
return;
}
if (!isOldValueEmpty && !(isSame) && this.templateFillType === "actFill") {
if (!isOldValueEmpty && !(isSame) && (this.templateFillType === "actFill" || this.templateFillType === "blxjsh")) {
// EventBus
EventBus.$emit('showEditSignDialog', { uuid: this.uuid });
} else {//
@ -1336,7 +1337,7 @@ export default {
return;
}
if (this.templateFillType === "actFill") {//
if (this.templateFillType === "actFill" || this.templateFillType === "blxjsh") {//
this.updateZdxgjl(record);
this.updateSubmittedCodes(finallyKey);
}
@ -1398,7 +1399,7 @@ export default {
isShowHandle() {
const { fillType } = this.item;
//
return this.templateFillType !== "preFill" && fillType === "actFill" && this.type !== "button"
return this.templateFillType !== "preFill" && (fillType === "actFill" || fillType === "blxjsh") && this.type !== "button"
},
//
getDisabled() {
@ -1411,7 +1412,9 @@ export default {
return this.templateFillType !== "actFill"
} else if (fillType === "preFill") {//fillTypepreFill
return this.templateFillType !== "preFill"
} else {
} else if (fillType === "blxjsh") {//fillTypeblxjsh
return this.templateFillType !== "blxjsh"
}else {
return true
}
}

+ 76
- 0
src/components/Template/mixins/operationMixins.js View File

@ -0,0 +1,76 @@
import { EventBus } from "@/utils/eventBus";
import { getuuid } from "@/utils/index";
import moment from "moment";
export default {
inject: ["templateFillType"],
data() {
return {
uuid: getuuid(),
deleteIndex: 0,
}
},
mounted() {
EventBus.$on('onEditSignCallback', this.handleEditSignCallback);
},
unmounted() {
EventBus.$off('onEditSignCallback', this.handleEditSignCallback);
},
methods: {
handleEditSignCallback(data) {
if (data.uuid === this.uuid) {
console.log(this.columns, this.templateFillType, data, "this.columns")
const { qmrMc, qmrMcEn, remark } = data.data;
const { fieldItemLabel, columnsData } = this.columns;
const { row } = this;
const desArr = columnsData.map((item) => {
const label = this.$t(item.label), otherValue = "", subValue = "", mainValue = row[item.prop];
if (item.bodySubKey && (item.bodySubType !== "button")) {
subValue = row[item.bodySubKey];
}
if (item.otherCode) {
otherValue = row[item.otherCode];
}
const desStr = `${label}:${mainValue}${subValue ? `[${subValue}]` : ''}${otherValue ? `[${otherValue}]` : ''}`;
return desStr;
});
const record = [
{
"userNameCn": qmrMc,
"userNameEn": qmrMcEn,
"fieldCn": this.$t(fieldItemLabel, 'zh_CN'),
"fieldEn": this.$t(fieldItemLabel, 'en_US'),
"oldValue": desArr.join(";"),
"value": "",
"title": "修改",
"time": moment().format("YYYY-MM-DD HH:mm:ss"),
"reason": remark
}
]
this.sureDelete(record);
}
},
sureDelete(record) {
this.$emit("deleteRow", this.deleteIndex);
setTimeout(() => {
const params = {
type: "fieldChanged",
newRecord: record || null,
resourceList: null,
}
EventBus.$emit('onModifyRecord', params,)
}, 30);
},
// 删除行
deleteRow(index) {
this.deleteIndex = index;
if (this.templateFillType === "actFill") {
EventBus.$emit('showEditSignDialog', { uuid: this.uuid });
} else {
this.sureDelete();
}
}
},
}

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

@ -20,9 +20,10 @@
import { EventBus } from "@/utils/eventBus";
import { addTj } from "@/utils/calUnitTools";
import {getuuid} from "@/utils/index"
import operationMixins from "../mixins/operationMixins";
export default {
name: "TableOpertaion",
mixins: [operationMixins],
props: {
row: {
type: Object,
@ -182,17 +183,17 @@ export default {
}
},
//
deleteRow(index) {
this.$emit("deleteRow", index);
setTimeout(() => {
const params = {
type: "fieldChanged",
newRecord: null,
resourceList: null,
}
EventBus.$emit('onModifyRecord', params,)
}, 30);
}
// deleteRow(index) {
// this.$emit("deleteRow", index);
// setTimeout(() => {
// const params = {
// type: "fieldChanged",
// newRecord: null,
// resourceList: null,
// }
// EventBus.$emit('onModifyRecord', params,)
// }, 30);
// }
}
}
</script>

+ 12
- 16
src/components/Template/operation/TableOpertaionDelete.vue View File

@ -2,7 +2,7 @@
<div>
<el-popconfirm confirm-button-text='确认' cancel-button-text='取消' icon="el-icon-info" icon-color="red"
title="确认删除当前数据?" @confirm="deleteRow(rowIndex)">
<el-button slot="reference" type="text" size="small" class="delete-button">
<el-button slot="reference" type="text" size="small" class="delete-button">
删除
</el-button>
</el-popconfirm>
@ -10,10 +10,12 @@
</template>
<script>
import { EventBus } from "@/utils/eventBus";
import operationMixins from "../mixins/operationMixins";
export default {
name: "TableOpertaionDelete",
mixins: [operationMixins],
props: {
row: {
type: Object,
@ -22,27 +24,21 @@ export default {
rowIndex: {
type: Number,
default: 0,
},
columns: {
type: Object,
default: () => { },
}
},
methods: {
//
deleteRow(index) {
this.$emit("deleteRow", index);
setTimeout(() => {
const params = {
type: "fieldChanged",
newRecord: null,
resourceList: null,
}
EventBus.$emit('onModifyRecord', params,)
}, 30);
}
}
}
</script>
<style lang="scss" scoped>
.delete-button{
color: red;
.delete-button {
color: red;
}
</style>

+ 1
- 0
src/views/business/comps/template/comps/dl/DL007.vue View File

@ -22,6 +22,7 @@
:ref="refConf.yqsy"
@onRegentSubmit="(e) => onRegentSubmit(e)"
:showOperation="fillType === 'actFill'"
fieldItemLabel = "template.dl.dl007.yqsyxx"
:showAddRow="fillType === 'actFill'"
:formData="formData"
:prefixKey="`yqsyTable`"

+ 1
- 0
src/views/business/comps/template/comps/dl/DL023.vue View File

@ -12,6 +12,7 @@
<LineLabel label="template.dl.dl023.yqsyxx" />
<CustomTable :ref="`tableRef`" :columns="yqsyxxColumns" @onRegentSubmit="(e) => onRegentSubmit(e)"
:formData="formData" operationWidth="80px" :showAddRow="fillType === 'actFill'"
fieldItemLabel = "template.dl.dl023.yqsyxx"
:showOperation="fillType === 'actFill'">
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaionDelete :row="row" :rowIndex="rowIndex" :columns="columns"

Loading…
Cancel
Save