@@ -95,19 +96,19 @@
:class="getSpanClass(sItem)" :key="key">
-
其他
-
@@ -115,22 +116,22 @@
-
-
{{ formFields[sItem.subKey] }}
-
其他
-
@@ -142,17 +143,17 @@
-->
-
-
{{ formFields[sItem.subKey] }}
-
-
@@ -175,6 +176,7 @@
import HandleFormItem from "./HandleFormItem.vue";
import LineLabel from "./LineLabel.vue";
export default {
+ inject: ['templateFillType'],
components: {
HandleFormItem,
LineLabel
@@ -191,6 +193,11 @@ export default {
formData: {
type: Object,
value: () => ({})
+ },
+ //主要标识当前表单属于哪个模块,用于传给后端
+ fieldItemLabel: {
+ type: String,
+ default: "",
}
},
data() {
@@ -202,6 +209,7 @@ export default {
};
},
watch: {
+
formData: {
immediate: true,
deep: true, // 深度监听,以便检测嵌套对象变化
@@ -211,6 +219,15 @@ export default {
}
}
},
+ fieldItemLabel: {
+ immediate: true,
+ deep: true, // 深度监听,以便检测嵌套对象变化
+ handler(v) {
+ if (v) {
+ console.log(v,"fieldItemLabel")
+ }
+ }
+ },
formConfig: {
immediate: true,
deep: true, // 深度监听,以便检测嵌套对象变化
@@ -263,7 +280,7 @@ export default {
},
handleClickable(sItem, event) {
console.log("clickable", sItem)
- if (this.$store.state.template.templateStatus !== 'actFill') {
+ if (this.templateFillType !== 'actFill') {
return
}
this.$emit("clickable", sItem)
@@ -374,11 +391,10 @@ export default {
if (item.hasOwnProperty("disabled")) {
return item.disabled
} else {
- const { templateStatus } = this.$store.state.template;
if (fillType === "actFill") {//当模板状态是实际填写时,只有当fillType是actFill时才能填写
- return templateStatus !== "actFill"
+ return this.templateFillType !== "actFill"
} else if (fillType === "preFill") {//当模板状态是预填写时,只有当fillType是preFill才能填写
- return templateStatus !== "preFill"
+ return this.templateFillType !== "preFill"
} else {
return true
}
@@ -387,7 +403,6 @@ export default {
// 表单数据校验
validateFormData() {
const { formFields, allFieldsConfig } = this;
- const { templateStatus } = this.$store.state.template;
const errors = [];
// 清空之前的错误状态
@@ -418,7 +433,7 @@ export default {
if (o.type === "span") {
continue
}
- if (o.fillType == templateStatus && !o.disabled) {
+ if (o.fillType === this.templateFillType && !o.disabled) {
let prefix = "";
if (o.type === "input" || o.type === "inputNumber" || o.type === "textarea") {
prefix = "填写";
diff --git a/src/components/Template/CustomTable.vue b/src/components/Template/CustomTable.vue
index d13e3a1..3e1861d 100644
--- a/src/components/Template/CustomTable.vue
+++ b/src/components/Template/CustomTable.vue
@@ -8,8 +8,8 @@