Przeglądaj źródła

Merge branch 'master' of http://119.23.210.103:3000/wy/zdqy_firm_former

zhonghuizhen 4 miesięcy temu
rodzic
commit
9e04eeb7d7

+ 1 - 0
src/business/platform/data/templaterender/form/index.vue

@@ -147,6 +147,7 @@ export default {
           }
           // 从后台获取表单定义数据
           this.formDef = this.$utils.parseData(data.form) || {}
+          console.log('formKey====>', this.formDef.key)
           this.boCode = this.formDef.code
           // 版本号
           this.version = data.version

+ 0 - 1
src/business/platform/data/templaterender/templates/list.vue

@@ -862,7 +862,6 @@ export default {
         .then((response) => {
           this.loading = false
           JTemplate._afterHttp(response.data)
-          // console.log('2222222222222222222', response.data)
           ActionUtils.handleListData(this, response.data)
           // 回调查询不再选中原有数据
           if (type !== 'callback') {

+ 4 - 0
src/business/platform/form/formrender/dynamic-form/dynamic-form-field.vue

@@ -862,6 +862,10 @@ export default {
       type: Boolean,
       default: false
     },
+    componentKey: {
+      type: String,
+      default: ''
+    },
     // 所有字段数据,(包含主主子表)
     formData: [Object, Array],
     field: {

+ 1 - 0
src/business/platform/form/formrender/dynamic-form/dynamic-form-item.vue

@@ -64,6 +64,7 @@
         <ibps-dynamic-form-field
           v-else
           ref="formField"
+          :component-key="field.name"
           :value.sync="dataModel"
           :field="field"
           :form-data="models"

+ 1 - 0
src/business/platform/form/formrender/dynamic-form/dynamic-form-table-item.vue

@@ -22,6 +22,7 @@
       v-else
       :value.sync="dataModel"
       :field="field"
+      :component-key="field.name"
       :form-data="formData"
       :row="row"
       :code="code"

+ 20 - 0
src/business/platform/form/formrender/dynamic-form/dynamic-form-table.vue

@@ -1143,6 +1143,26 @@ export default {
         this.exportData()
       }
     },
+    /**
+     * 获取表单字段的具体控件组件实例
+     */
+    getRefs(fieldName) {
+      let targetCom = null
+      // 递归遍历函数
+      const traverse = (component) => {
+        // 匹配目标组件(通过 $options.name 判断)
+        if (component.$props?.componentKey === fieldName) {
+          targetCom = component
+          return // 只找第一个,直接终止遍历
+        }
+        // 遍历当前组件的直接子组件
+        component.$children.forEach((child) => {
+          traverse(child)
+        })
+      }
+      traverse(this)
+      return targetCom
+    },
     /**
      * 导出数据
      */

+ 18 - 1
src/business/platform/form/formrender/dynamic-form/dynamic-form.vue

@@ -740,10 +740,27 @@ export default {
     // 将对象参数传入, 进行渲染
     getStatisOrRecord(type) {
       this.record = type
-    }
+    },
     /**
      * 获取表单字段的具体控件组件实例
      */
+    getRefs(fieldName) {
+      let targetCom = null
+      // 递归遍历函数
+      const traverse = (component) => {
+        // 匹配目标组件(通过 $options.name 判断)
+        if (component.$props?.componentKey === fieldName) {
+          targetCom = component
+          return // 只找第一个,直接终止遍历
+        }
+        // 遍历当前组件的直接子组件
+        component.$children.forEach((child) => {
+          traverse(child)
+        })
+      }
+      traverse(this)
+      return targetCom
+    }
     // getRefsField (fieldName) {
     //     const refs = this.getRefs(fieldName)
     //     if (this.$utils.isEmpty(refs) || this.$utils.isEmpty(refs[0]) || this.$utils.isEmpty(refs[0].$refs) || this.$utils.isEmpty(refs[0].$refs['formField'])) {

+ 1 - 0
src/views/platform/data/dataTemplate/template-list.vue

@@ -145,6 +145,7 @@ export default {
         .then((response) => {
           // 从后台获取数据
           const data = this.$utils.parseData(response.data)
+          console.log('templateKey===>', data.key)
           if (
             data &&
             data.attrs &&

+ 1 - 1
src/views/system/jbdScan/goods/guanshenzhuangtai.vue

@@ -570,7 +570,7 @@ export default {
         // }
         jieduanvalue = jishu + ''
         that.activeIndex = that.jieduan(jieduanvalue)
-        that.jieduanValue = that.activeIndex
+        that.jieduanValue = that.activeIndex || 0
         that.gettable(data.ji_hua_zong_wai_j)
       })
     },

+ 2 - 1
src/views/system/jbdScan/goods/neishenzhuangtai.vue

@@ -1133,7 +1133,8 @@ export default {
         jieduanvalue = data.jie_dian_ren_wu_
       }
       this.activeIndex = this.jieduan(jieduanvalue)
-      this.jieduanValue = this.activeIndex
+      console.log(this.activeIndex, 'this.activeIndex this.activeIndex ')
+      this.jieduanValue = this.activeIndex || 0
       this.gettable(data.ji_hua_zong_wai_j)
     },
     async gettable(id) {