| <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> |