diff --git a/src/components/Template/CustomTable.vue b/src/components/Template/CustomTable.vue index 6306137..8d7ae3d 100644 --- a/src/components/Template/CustomTable.vue +++ b/src/components/Template/CustomTable.vue @@ -14,30 +14,34 @@
-
-
-
+
+
+
@@ -231,7 +235,7 @@ import HandleFormItem from "./HandleFormItem.vue"; import { isEqual } from "@/utils/index.js"; import { isShowOther } from "@/utils/formPackageCommon.js"; import { EventBus } from "@/utils/eventBus"; -import { getuuid,justUpdateFilledFormData } from "@/utils/index.js"; +import { getuuid, justUpdateFilledFormData } from "@/utils/index.js"; import { isRegent } from "@/utils/index.js"; import { isValueEmpty } from '@/utils/index.js'; @@ -355,24 +359,25 @@ export default { options: headerCol.options, maxlength: headerCol.maxlength, checkType: headerCol.checkType, - regentFillType: headerCol.regentFillType, - type:headerCol.type, + regentFillType: headerCol.regentFillType, + type: headerCol.type, }; }, onHeaderColumnChange(colIndex, headerIndex, headerCol, value) { const fieldKey = `${colIndex}_${headerIndex}`; this.headerFields[fieldKey] = value; - this.$emit('headerColumnChange', { + this.$emit('headerColumnChange', { colIndex, headerIndex, - key: fieldKey, - value, - headerFields: this.headerFields + key: fieldKey, + value, + headerFields: this.headerFields }); }, hasHeaderError(colIndex, headerIndex, key) { + console.log(colIndex, headerIndex, key,this.formErrors,"headerError") return this.formErrors.some(error => error.rowIndex === -1 && error.colIndex === colIndex && @@ -484,7 +489,9 @@ export default { }, onHeaderRegentSubmit(data, inputValue, colIndex, headerIndex) { this.headerFields[`${colIndex}_${headerIndex}`] = inputValue; - this.$emit("onHeaderRegentSubmit", { selectInfo: data, key: col.prop, col, rowIndex, colIndex, rowData: row }) + console.log("onHeaderRegentSubmit", data, inputValue, colIndex, headerIndex,this.headerFields) + + this.$emit("onHeaderRegentSubmit", { selectInfo: data, headerIndex, colIndex, headerFields: this.headerFields }) }, onRegentSubmit(data, inputValue, col, rowIndex, colIndex, row) { // if (this.templateFillType !== 'actFill') { @@ -558,6 +565,7 @@ export default { // 校验表头的 HandleFormItem this.columns.forEach((col, colIndex) => { + console.log(col.headerColumns, col, "ttt") if (col.headerSelectKey && col.headerOptions && col.fillType === this.templateFillType) { const headerValue = this.headerSelectFields[col.headerSelectKey]; if (isValueEmpty(headerValue)) { @@ -571,6 +579,26 @@ export default { errors.push(errorItem); this.formErrors.push(errorItem); } + } else if (col.headerColumns && col.headerColumns.length > 0) { + col.headerColumns.forEach((headerCol, headerColIndex) => { + const headerValue = this.headerFields[`${colIndex}_${headerColIndex}`]; + if (headerCol.fillType === this.templateFillType) { + if (isValueEmpty(headerValue) && headerCol.type !== "span") { + const errorItem = { + rowIndex: -1, // 表头特殊标记 + colIndex, + field: headerCol.key, + label: this.$t(headerCol.label), + headerIndex: headerColIndex, + error: `请选择${this.$t(headerCol.label)}` + }; + errors.push(errorItem); + this.formErrors.push(errorItem); + } + } + + }); + } }); @@ -1293,6 +1321,7 @@ export default { .c-cell { width: 50px; } + .span-content { width: -webkit-fill-available; text-align: center; diff --git a/src/components/Template/HandleFormItem.vue b/src/components/Template/HandleFormItem.vue index f42f2ed..03b3a59 100644 --- a/src/components/Template/HandleFormItem.vue +++ b/src/components/Template/HandleFormItem.vue @@ -1802,7 +1802,7 @@ export default { font-weight: normal; color: #606266; flex: 1; - + background-color: #fff; &.disabled { cursor: not-allowed; color: #c0c4cc; diff --git a/src/views/business/comps/template/comps/dl/DL006.vue b/src/views/business/comps/template/comps/dl/DL006.vue index cb406fe..ace8e5b 100644 --- a/src/views/business/comps/template/comps/dl/DL006.vue +++ b/src/views/business/comps/template/comps/dl/DL006.vue @@ -91,7 +91,6 @@ import moment from 'moment' const refConf = { base: 'baseInfoRef', czInfo: 'czInfoRef', - gyzj: 'gyzjTableRef', remark: 'remarkRef', jzjz: 'jlzpzxxTableRef', bz: 'stepRef', @@ -139,7 +138,7 @@ export default { { type:"sj", fillType: 'preFill', - key:"bh" + key:"bh", }, { type: 'input',