| | |
| | | :templateOid="templateOid" |
| | | :type="type" |
| | | data-key="masterForm" |
| | | @dataYearCode="dataYearHandler" |
| | | @getFormData="getFormData" |
| | | @isShow="isShowHandler" |
| | | @dataYearValue="dataYearHandler" |
| | | ></FormTemplate> |
| | | <div |
| | | v-if=" |
| | |
| | | }, |
| | | methods: { |
| | | openDialog() { |
| | | //新增和修改共同调用 |
| | | this.getFormTemplate(); |
| | | if (this.type === "add") { |
| | | if (this.type === "add" || (this.type !== "add" && this.status === "amend")) { |
| | | this.getCodeRule(); |
| | | return; |
| | | } |
| | | }, |
| | | close() { |
| | |
| | | }, |
| | | // 接口获取表单数据 |
| | | getFormTemplate() { |
| | | //新增和修改共同调用 |
| | | getFormTemplate({ |
| | | templateOid: this.templateOid, |
| | | codeClassifyOid: this.codeClassifyOid, |
| | |
| | | } else { |
| | | this.showResembleQuery = false; |
| | | } |
| | | //传递表单上方区域数据 (新增和修改) |
| | | this.$nextTick(() => { |
| | | this.$refs.FormTemplate.templateRender( |
| | | res.data.formDefineVO.items |
| | |
| | | that.secVOList = (res.data.data.secVOList || []).filter((item) => |
| | | typeList.includes(item.secType) |
| | | ); |
| | | if (that.secVOList.length > 0 && that.type === "add") { |
| | | if (that.secVOList.length > 0 && that.type === "add" ||(that.type !== "add" && that.status === "amend")) { |
| | | that.showCodeApply = true; |
| | | that.activeName = "codeApply"; |
| | | |
| | |
| | | }, |
| | | //系列号规则 |
| | | isShowHandler(val) { |
| | | let that = this; |
| | | this.isShowStatus = val; |
| | | |
| | | this.secVOList.forEach(item => { |
| | | if (item.name === "系列号") { |
| | | this.$set(item, "readOnly", val) |
| | | } |
| | | }) |
| | | if(this.$refs.CodeApply.changeChildItem ){ |
| | | this.secVOList.forEach(item => { |
| | | if (item.name === "系列号") { |
| | | this.$set(item, "readOnly", val) |
| | | } |
| | | }) |
| | | if (this.$refs.CodeApply) { // 添加一个判断语句,检查对象是否为undefined |
| | | this.$refs.CodeApply.changeChildItem(this.secVOList, this.TreeValue, this.type); |
| | | } |
| | | }, |
| | | //年代号 |
| | | dataYearHandler(val){ |
| | | console.log("val",val) |
| | | dataYearHandler(val) { |
| | | const readOnlyValue = val && Object.values(val).every(value => value !== ''); |
| | | |
| | | this.secVOList.forEach(item => { |
| | | if (item.name === "年代号") { |
| | | const year = readOnlyValue ? val.value.slice(0, 4) : item.codeDateValue; |
| | | this.codeApplyForm[item.oid] = year; |
| | | this.$set(item, "readOnly", readOnlyValue); |
| | | } |
| | | }); |
| | | |
| | | if (this.$refs.CodeApply) { |
| | | this.$refs.CodeApply.changeChildItem(this.secVOList, this.TreeValue, this.type); |
| | | } |
| | | }, |
| | | //属性码段赋值 |
| | | attrListForm(attrListForm) { |
| | |
| | | return item; |
| | | }); |
| | | //this.$refs.CodeApply.templateRender(this.secVOList,this.TreeValue); |
| | | this.$refs.CodeApply.changeChildItem(childItems,this.TreeValue,this.type); |
| | | this.$refs.CodeApply.changeChildItem(childItems, this.TreeValue, this.type); |
| | | }, |
| | | resembleQuerySubmit() { |
| | | this.activeName = "resembleQuery"; |