| | |
| | | }, |
| | | eventList: { |
| | | type: Array |
| | | } |
| | | }, |
| | | status: { |
| | | type: String, |
| | | default: "", |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | | filteredObject: {}, |
| | | filteredArray: [], |
| | | isSeriesType: {}, |
| | | attrList: [], |
| | | add: '', |
| | | codeattrsecValue: '', |
| | |
| | | // 表单属性 |
| | | attributes: [], |
| | | slotColumnList: [], |
| | | isShow:null, |
| | | }; |
| | | }, |
| | | mounted() { |
| | |
| | | immediate: true, |
| | | handler(newV) { |
| | | this.$emit("getFormData", newV); |
| | | // console.log("filteredObject",this.filteredObject) |
| | | if (this.filteredObject.label === "系列号") { |
| | | if (newV.isSeries === "false") { |
| | | this.filteredObject.disabled = true; |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | |
| | | attrList: { |
| | | deep: true, |
| | | immediate: true, |
| | | handler(newVal, oldVal) { |
| | | if (newVal) { |
| | | this.$emit("attrList", newVal) |
| | | } |
| | | } |
| | | }, |
| | | isSeriesType: { |
| | | deep: true, |
| | | immediate: true, |
| | | handler(newVal, oldVal) { |
| | | if (newVal) { |
| | | this.$emit("isSeriesType", newVal) |
| | | } |
| | | } |
| | | }, |
| | |
| | | methods: { |
| | | // 渲染表单模板 |
| | | templateRender(formItemList, TreeValue) { |
| | | // debugger |
| | | if (this.eventList) { |
| | | this.eventFlag = this.eventList.some(item => { |
| | | if (item.classifyInvokeEditFlag === 'true') { |
| | |
| | | let dictKeys = []; |
| | | let slotColumnList = []; |
| | | formItemList.forEach((formItem) => { |
| | | // console.log('formItem',formItem) |
| | | console.log('formItem',formItem); |
| | | formItem = this.resetFormConfig(formItem); |
| | | //属性码段规则 |
| | | if (formItem.secType === "codeattrsec") { |
| | | this.attrList.push(formItem); |
| | | } |
| | | //系列号规则 |
| | | if (formItem.label === "系列号") { |
| | | this.isSeriesType = formItem; |
| | | // console.log("系列号",formItem) |
| | | } |
| | | //更改方式规则 |
| | | if (formItem.field === "codeStandardEditType") { |
| | | if (this.status === "amend") { |
| | | formItem.readOnly = true; |
| | | } |
| | | } |
| | | if (formItem.type === "line") { |
| | | group.push({ |
| | |
| | | |
| | | let columnItem = { |
| | | change: (val) => { |
| | | // console.log(val) |
| | | if (val.column.field === "drawingno") { |
| | | this.codeattrsecValue = val.value; |
| | | return; |
| | | } |
| | | // console.log(this.codeattrsecValue) |
| | | ; |
| | | if (val.column.field === "isSeries") { |
| | | if (val.value === "false") { |
| | | this.isShow = true; |
| | | }else { |
| | | this.isShow = false; |
| | | } |
| | | } |
| | | |
| | | }, |
| | | dataKey: formItem.dataKey || formItem.field, |
| | | label: formItem.text, |
| | |
| | | field: formItem.field, |
| | | type: this.columnType[formItem.type], |
| | | dicData: this.getDataList(formItem.type, formItem.data), |
| | | disabled: this.type === "detail" ? true : formItem.readOnly || (formItem.codeValueApplyStatus && formItem.codeValueApplyStatus == 2 ? true : false), |
| | | disabled: this.type === "detail" ? true : formItem.readOnly || (formItem.codeValueApplyStatus && formItem.codeValueApplyStatus == 2 ? true : false) || |
| | | (this.isShow && formItem.label === "系列号" ? true : false), |
| | | prepend: this.preOrSufFixShow("text", formItem.prefix), |
| | | append: this.preOrSufFixShow("text", formItem.suffix), |
| | | prefixIcon: this.preOrSufFixShow("icon", formItem.prefix), |
| | |
| | | keyAttr: formItem.keyAttr, |
| | | value: (formItem.dicData && formItem.dicData.length > 0 && formItem.secType == "codefixedsec" ? formItem.dicData[0].id : null) || |
| | | (formItem.secType == "codedatesec" ? formItem.codeDateValue : null) || (TreeValue && formItem.secType == "codelevelsec" ? TreeValue : null) || |
| | | (formItem.secType == "codeattrsec" ? this.add : null), |
| | | (formItem.secType == "codeattrsec" ? this.add : null) || (this.status === "apply" && formItem.field === "codeStandardEditType" ? "1" : null) || |
| | | (formItem.field === "isSeries" ? "true" : null), |
| | | placeholder: formItem.inputTip, |
| | | comboxKey: formItem.comboxKey, |
| | | tip: formItem.tooltips, |
| | |
| | | value: "key", |
| | | }, |
| | | }; |
| | | // console.log('formItem',formItem) |
| | | // console.log('columnItem',columnItem) |
| | | this.filteredObject = columnItem |
| | | // console.log("columnItem", columnItem) |
| | | slotColumnList.push(columnItem); |
| | | if (group.length === 0) { |
| | | column.push(columnItem); |
| | |
| | | group[group.length - 1]["column"].push(columnItem); |
| | | } |
| | | }); |
| | | |
| | | // this.filteredArray = column.filter(obj => obj.label === "系列号"); |
| | | this.slotColumnList = slotColumnList; |
| | | // console.log(slotColumnList) |
| | | this.$set(this.option, "column", column); |
| | | this.$set(this.option, "group", group); |
| | | this.updateIndex++; |
| | |
| | | let that = this; |
| | | items.forEach((item) => { |
| | | let formItem = this.resetFormConfig(item); |
| | | |
| | | if (formItem.field == "lcstatus") { |
| | | formItem.field = formItem.field + "_text"; |
| | | formItem.readOnly = true; |
| | |
| | | } |
| | | let columnItem = { |
| | | change: (val) => { |
| | | console.log('1', val) |
| | | // console.log('1', val) |
| | | }, |
| | | label: formItem.text, |
| | | labelslot: true, |