| <template> | 
|   <div ref="container" 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"> | 
|       <template slot="common-column-slot" slot-scope="{row, col}"> | 
|         <template v-if="col.prop=='payStatus'"> | 
|           <template> | 
|             <el-tag v-if="row[col.prop]=='新建'" color="#ffff33" style="color:black;border:0"> | 
|               {{ $refs[dataListRef].translateText(col.prop, row[col.prop], col.dropdown_Id) }} | 
|             </el-tag> | 
|             <el-tag v-if="row[col.prop]=='审核成功'" color="#33cc33" style="color:black;border:0;color:#fff;"> | 
|               {{ $refs[dataListRef].translateText(col.prop, row[col.prop], col.dropdown_Id) }} | 
|             </el-tag> | 
|           </template> | 
|         </template> | 
|         <template v-else-if="col.prop=='auditing'"> | 
|           <template> | 
|             <el-tag v-if="row[col.prop]==0" color="#ffff33" style="color:black;border:0"> | 
|               {{ $refs[dataListRef].translateText(col.prop, row[col.prop], col.dropdown_Id) }} | 
|             </el-tag> | 
|             <el-tag v-else-if="row[col.prop]==2" color="#33cc33" style="color:black;border:0;color:#fff;"> | 
|               {{ $refs[dataListRef].translateText(col.prop, row[col.prop], col.dropdown_Id) }} | 
|             </el-tag> | 
|             <span v-else> | 
|               {{ row[col.prop] }} | 
|             </span> | 
|           </template> | 
|         </template> | 
|       </template> | 
|     </yrt-data-list> | 
|     <!--数据编辑器Editor--> | 
|     <yrt-editor :ref="editorRef" :data-list-ref="dataListRef" v-bind="editorOptions" :data-options="dataOptions" :action.sync="editorOptions.action" :top.sync="editorOptions.top" :visible.sync="editorOptions.config.visible" :detail-button-click="detailButtonClick" :auth-nodes="authNodes" :btn-read-only="btnReadOnly" @on-add-load-after="onEditLoadAfter" @on-edit-load-after="onEditLoadAfter"> | 
|     </yrt-editor> | 
|   | 
|   </div> | 
| </template> | 
| <script> | 
| import baseLayout from "@/components/common/base-layout.vue"; | 
| export default { | 
|   name: "finance-fee-payablebill", | 
|   components: {}, | 
|   mixins: [baseLayout], | 
|   data() { | 
|     return {}; | 
|   }, | 
|   methods: { | 
|     buttonClick(authNode) { | 
|       switch (authNode) { | 
|         case "storageSettle": | 
|           this.storageSettle(this.dataListSelections); | 
|           return true; | 
|         case "billGenerat": | 
|           // 生成对账单 | 
|           this.billGenerat(); | 
|           return true; | 
|       } | 
|     }, | 
|     // 明细按钮点击事件 | 
|     detailButtonClick(authNode) { | 
|       switch (authNode) { | 
|         case "exportList": | 
|           // 导出明细 | 
|           this.exportList(); | 
|           break; | 
|       } | 
|     }, | 
|     // 明细导出 | 
|     exportList() { | 
|       var formData = this.editor.formData; | 
|       var url = "/api/finance/payablebill/exportlossList"; | 
|       const params = { | 
|         ids: formData.payableBill_Id | 
|       }; | 
|       var callback = res => { | 
|         this.common.showMsg(res); | 
|         if (res.result) { | 
|           const url = this.common.domain + "/api/common/download?url=" + res.data.url; | 
|           window.open(url); | 
|         } | 
|       }; | 
|       this.common.ajax(url, params, callback, true); | 
|     }, | 
|     // 生成对账单 | 
|     billGenerat() { | 
|       // 获取选择框选中的长度 | 
|       const ids = this.dataList.dataListSelections.map(item => item.payableBill_Id); | 
|       if (!ids.length) { | 
|         this.$message.error("至少选择一行!"); | 
|         return; | 
|       } | 
|   | 
|       const url = "/api/finance/payablebill/billGenerat"; | 
|       const params = { | 
|         openNodeApi: true, | 
|         ids: ids | 
|       }; | 
|       const ref = this.dataList; | 
|       var callback = res => { | 
|         this.common.showMsg(res); | 
|       }; | 
|       this.common.ajax(url, params, callback, ref); | 
|     }, | 
|     onEditLoadAfter(formData) { | 
|       if (formData.auditing === 2) { | 
|         this.btnReadOnly.auditing = true; | 
|         this.editorOptions.config.disabled = true; | 
|       } | 
|       this.btnReadOnly.auditing = false; | 
|     }, | 
|     // 生成仓储费 | 
|     storageSettle() { | 
|       this.$confirm("是否要进行仓费结算", "仓费结算", { | 
|         distinguishCancelAndClose: true, | 
|         confirmButtonText: "确认" | 
|       }).then(() => { | 
|         const url = "/api/finance/payablebill/storageSettle"; | 
|         const params = {}; | 
|         const callback = res => { | 
|           this.common.showMsg(res); | 
|           if (res.result) { | 
|             this.dataList.reload(); | 
|           } | 
|         }; | 
|         this.common.ajax(url, params, callback); | 
|       }); | 
|     } | 
|   } | 
| }; | 
| </script> |