<!doctype html> <html> <head> <meta charset="utf-8"><meta http-equiv="Expires" content="0"><meta http-equiv="Pragma" content="no-cache"><meta http-equiv="Cache-control" content="no-cache"><meta http-equiv="Cache" content="no-cache"> <title>坿 ¸é”€çš„è®¢å•æ˜Žç»†</title> <script type="text/javascript"> var pageVue = null; function loadJsCss(callback) { var jscss_urls = []; window.top.initJsCss(document, jscss_urls, callback); }; function initVue() { new ListVue({ el: "#vbody", data: { // dataname: "so_order_available_statement", dataurl:"root/data/getAvailables", paramObjBydefault:{ flowName: "sales", consumer: "so_statement_detail", }, title: "坿 ¸é”€çš„è®¢å•æ˜Žç»†", pageAttr: { heightType: "popuppage" }, default_filterFields: [], default_tableFields: [], filterfieldClick: {}, tablefieldClick: {}, formfieldClick: {}, }, created() { this.popupParames = clone(Root.popupParames); this.title = this.popupParames.title || this.popupParames.text // if (this.popupParames.filter) { // this.filterTxt = this.popupParames.filter; // } if (this.popupParames.txt) { this.filterTxt = this.popupParames.txt; } if (this.popupParames.delta) { var Filter = this.popupParames.delta.filter_; this.filterObjBydefault = { customer_id: Filter } } if (this.popupParames.sceneCode) { if (this.popupParames.sceneCode == "add") {//新增 this.isedit = true; } } }, mounted() { //èŽ·å–æ•°æ® this.initData(); this.$nextTick(() => { // 以æœåŠ¡çš„æ–¹å¼è°ƒç”¨çš„ Loading 需è¦å¼‚æ¥å…³é— hideLoading(); }); }, methods:{ //å…³é—弹窗 closeDialog() { var me = this; if (me.popupParames.totab){ Root.tab.removeItem(Root.tab.selected); Root.tab.open(me.popupParames.parentOption, false); } else { Root.hidePopup(); } }, createDocument(){ var me = this; var row = this.selectedrow; let param = { flowName: "sales", dataName: "so_statement_detail", ticket: { detail:[{id:row.id}] }, } Server.call("root/data/createDocument", param, function(result) { if (result && result.data) { me.documentData = clone(result.data[param.dataName][0]); } // console.log(param); console.log(result); // console.log(result.data[param.dataName]); console.log("this"); console.log(me.documentData); me.saveAfter(); }); }, //å…³é—å‰è°ƒå›žè°ƒ saveAfter() { var me = this; if(this.popupParames.callback) { let obj = { row: clone(me.documentData) } this.popupParames.callback(obj, function() { me.closeDialog(); }); } else { me.closeDialog(); } }, initData() { var me = this; this.onQuery(function(result, callback) {//查询åŽçš„回调,用于获å–å—æ®µçš„ if (result.meta && result.meta.entityset) { var metas = clone(result.meta.entityset); var filterFields_ = []; var tableFields_ = []; metas.map(f=>{ f.isshow = "T"; if (f.isfilter) { filterFields_.push(clone(f)); } else { var filter_f = clone(f); filter_f.isshow = "F"; filterFields_.push(filter_f); } tableFields_.push(clone(f)); }) if (!me.filterFields || (me.filterFields && me.filterFields.length == 0)) { me.filterFields = clone(filterFields_); me.tableFields = clone(tableFields_); //å—æ®µæ•°ç»„è½¬å—æ®µobj,目的为了ç›é€‰æ—¶èŽ·å–å—æ®µå±žæ€§ me.fieldsToFieldsObj(); //è®¾ç½®å—æ®µäº‹ä»¶ me.tableFieldClick(); } } if (callback) { callback(); } }); }, tableFieldClick() { var me = this; //ç›é€‰å—段事件设置 this.filterfieldClick = { }; //è¡¨æ ¼å—æ®µäº‹ä»¶è®¾ç½® this.tablefieldClick = { }; //表å•å—æ®µäº‹ä»¶è®¾ç½® this.formfieldClick = { }; }, onRowDblClick() { if (this.isedit) { this.createDocument(); } }, } }); }; loadJsCss(function () { initVue(); }); </script> <style> /* 在vue.jsä¸ v-cloak 这个指令是防æ¢é¡µé¢åŠ è½½æ—¶å‡ºçŽ° vuejs çš„å˜é‡å而设计的 */ [v-cloak] { display: none !important; } </style> </head> <body style="margin: 0px;"> <div v-cloak id="vbody"> <div id="page_root"> <div ref="popup_body" style="padding: 0 20px;"> <!-- æ ‡é¢˜ --> <div class="el-dialog__header"> <div class="dialog-title"> <i class="iconfont icon-customermanagement"></i> <span>{{title}}</span> </div> </div> <!-- 主体 --> <div class="topbar-line"> <div class="query-bar"> <h-form-filter ref="form1" :form-attr="filterAttr" :table-fields="filterFields" :form-data="filterObj" :table-field-click="filterfieldClick" v-on:on-query="onQuery" v-on:on-init-query="onInitFilter" > </h-form-filter> </div> </div> <div class="h_dialog__body"> <h-table v-if="isRefresh" ref="table1" :table-fields="tableFields" :table-data="tableData" :pagesize="pagesize" :pagenum="pagenum" :total="total" :table-height="tableHeight" :table-field-click="tablefieldClick" :is-highlight-row="isedit" v-on:get-data="getData" v-on:row-click="rowClick" v-on:row-dblclick="rowDblclick" > </h-table> </div> <!-- 底部工具æ --> <div class="el-dialog__footer"> <el-button size="small" type="default" @click="closeDialog">å– æ¶ˆ</el-button> <el-button size="small" :disabled = "!(selectedrow && selectedrow.id)" v-if="isedit" type="primary" @click="createDocument">ç¡® 定</el-button> </div> </div> </div> </div> <div id="page_loading" style="position: absolute; top:0px; width: 100vw; height: 50vh;"> <div class="spinner"> <div class="cube1"></div> <div class="cube2"></div> </div> </div> </body> </html>