diff --git a/src/components/Template/CustomTable.vue b/src/components/Template/CustomTable.vue index b50fe45..4e285fb 100644 --- a/src/components/Template/CustomTable.vue +++ b/src/components/Template/CustomTable.vue @@ -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); diff --git a/src/components/Template/HandleFormItem.vue b/src/components/Template/HandleFormItem.vue index b22cc2f..e0d5b01 100644 --- a/src/components/Template/HandleFormItem.vue +++ b/src/components/Template/HandleFormItem.vue @@ -213,7 +213,7 @@ - @@ -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") {//当模板状态是预填写时,只有当fillType是preFill才能填写 return this.templateFillType !== "preFill" - } else { + } else if (fillType === "blxjsh") {//当模板状态是预填写时,只有当fillType是blxjsh才能填写 + return this.templateFillType !== "blxjsh" + }else { return true } } diff --git a/src/components/Template/mixins/operationMixins.js b/src/components/Template/mixins/operationMixins.js new file mode 100644 index 0000000..be9f683 --- /dev/null +++ b/src/components/Template/mixins/operationMixins.js @@ -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(); + } + + } + }, +} diff --git a/src/components/Template/operation/TableOpertaion.vue b/src/components/Template/operation/TableOpertaion.vue index 67f8aac..d819fde 100644 --- a/src/components/Template/operation/TableOpertaion.vue +++ b/src/components/Template/operation/TableOpertaion.vue @@ -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); + // } } } diff --git a/src/components/Template/operation/TableOpertaionDelete.vue b/src/components/Template/operation/TableOpertaionDelete.vue index 54b3401..5897812 100644 --- a/src/components/Template/operation/TableOpertaionDelete.vue +++ b/src/components/Template/operation/TableOpertaionDelete.vue @@ -2,7 +2,7 @@
- + 删除 @@ -10,10 +10,12 @@ \ No newline at end of file diff --git a/src/views/business/comps/template/comps/dl/DL007.vue b/src/views/business/comps/template/comps/dl/DL007.vue index 02f9318..caba3f2 100644 --- a/src/views/business/comps/template/comps/dl/DL007.vue +++ b/src/views/business/comps/template/comps/dl/DL007.vue @@ -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`" diff --git a/src/views/business/comps/template/comps/dl/DL023.vue b/src/views/business/comps/template/comps/dl/DL023.vue index fad17ca..ab14c55 100644 --- a/src/views/business/comps/template/comps/dl/DL023.vue +++ b/src/views/business/comps/template/comps/dl/DL023.vue @@ -12,6 +12,7 @@