333
schangxiang@126.com
2025-09-19 18966e02fb573c7e2bb0c6426ed792b38b910940
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<template>
  <div class="page-list-container">
    <!--数据Table-->
    <yrt-data-list :ref="dataListRef" :editor-ref="editorRef" :data-options="dataOptions" :fields.sync="dataListOptions.fields" :buttons="dataListOptions.buttons" :button-click="buttonClick" :data-list-selections.sync="dataListSelections" :auth-nodes="authNodes">
 
    </yrt-data-list>
 
    <!--数据编辑器Editor-->
    <yrt-editor :ref="editorRef" :data-list-ref="dataListRef" v-bind="editorOptions" :data-options="dataOptions" :action.sync="editorOptions.action" :visible.sync="editorOptions.config.visible" :detail-button-click="detailButtonClick" :auth-nodes="authNodes" @on-load-dropdown-after="onLoadDropdownAfter" @on-edit-load-after="onEditLoadAfter" @on-add-load-after="onEditLoadAfter"></yrt-editor>
  </div>
</template>
<script>
import baseLayout from "@/components/common/base-layout.vue";
 
export default {
  name: "sys",
  components: {},
  mixins: [baseLayout],
  data() {
    return {
      // 编辑新建时表单默认值
      defaultValue: {
        statusID: 1,
        statusText: "新建"
      }
    };
  },
  methods: {
    onEditLoadAfter(formData) {
      // 设置工厂名称第一条,只有新建时设置默认第一条
      const consignorDropdown = this.editor.getDropdownData(797);
      debugger;
      if (consignorDropdown && consignorDropdown.length && !this.masterData.productionLine_Id) {
        const conInfo = consignorDropdown[0];
        this.editor.changeValue("consignor_Id", conInfo.consignor_Id);
        this.editor.changeValue("consignorCode", conInfo.consignorCode);
        this.editor.changeValue("consignorName", conInfo.consignorName);
      }
    },
    onLoadDropdownAfter() {
      // 设置工厂名称第一条,只有新建时设置默认第一条
      const consignorDropdown = this.editor.getDropdownData(797);
      debugger;
      if (consignorDropdown && consignorDropdown.length && !this.masterData.productionLine_Id) {
        const conInfo = consignorDropdown[0];
        this.editor.changeValue("consignor_Id", conInfo.consignor_Id);
        this.editor.changeValue("consignorCode", conInfo.consignorCode);
        this.editor.changeValue("consignorName", conInfo.consignorName);
      }
    }
  }
};
</script>