<!DOCTYPE html>
|
<html>
|
<head>
|
<meta charset="utf-8">
|
<title>管理主体弹出窗体</title>
|
<script src="../../../../js/vue/vue.js"></script>
|
<script src="../../../../js/vue/element-ui/lib/index.js"></script>
|
<script src="../../../../js/vue/page.js"></script>
|
<script src="../../../../js/myelement.js"></script>
|
|
<link href="../../../../js/vue/element-ui/lib/theme-chalk/index.css" rel="stylesheet">
|
<link href="../../../../css/myelement.css" rel="stylesheet">
|
<link href="../../../../css/iconfont.css" rel="stylesheet">
|
<link href="../../../../css/page.css" rel="stylesheet">
|
<link href="//at.alicdn.com/t/font_2374495_mkoo966o0uo.css" rel="stylesheet">
|
</head>
|
<body>
|
<div id="vbody">
|
<div class="topbar-line">
|
<div class="query-icon">
|
<i class="iconfont icon-query"></i>
|
</div>
|
|
<div class="query-bar">
|
<el-form label-position='left' label-width="50px" :inline="true" :model="formInline_gh" class="demo-form-inline">
|
<el-form-item label="名称:" style="line-height: 40px;">
|
<el-input size="mini" v-model="formInline_gh.name" placeholder="请输入" style="width: 140px;"></el-input>
|
</el-form-item>
|
<el-form-item>
|
<el-button @click="onQuery_gh">查 询</el-button>
|
<el-button @click="onInitQuery_gh">重 置</el-button>
|
</el-form-item>
|
</el-form>
|
</div>
|
</div>
|
|
<h-table
|
v-if="isRefresh"
|
ref="table2"
|
:table-fields="tableFields1"
|
:table-data="tableData_cus2"
|
:pagesize="pagesize_gh"
|
:pagenum="pagenum_gh"
|
:total="total_gh"
|
:table-height="tableHeight_cus"
|
:is-highlight-row="true"
|
:is-pagination = "false"
|
|
v-on:row-click="rowClickCus"
|
v-on:get-data="getData_gh"
|
>
|
</h-table>
|
|
<div slot="footer" class="popup-footer" >
|
<el-button type="default" @click="close">关 闭</el-button>
|
<el-button type="primary" @click="saveFormValByField">确 定</el-button>
|
</div>
|
</div>
|
|
</body>
|
|
<script type="text/javascript">
|
|
new Vue({
|
el: "#vbody",
|
data: {
|
isRefresh: true,
|
tableFields1: [
|
{field: "code", name: "客户代码", isshow: "T", align: "center", required: true},
|
{field: "name", name: "客户名称", isshow: "T", align: "center", required: true},
|
],
|
selectFormField:{},
|
tableData_cus: [],
|
tableData_cus2: [],
|
tableData_cus_new: [],
|
pagesize_gh: 10,
|
pagenum_gh: 1,
|
total_gh: 0,
|
tableHeight_cus: 350,
|
selectcusrow: {},
|
|
formInline_gh: {},
|
popupParames: {}
|
},
|
created() {
|
this.popupParames = clone(Root.popupParames);
|
},
|
mounted() {
|
this.onQuery_gh();
|
},
|
methods:{
|
close: function() {
|
Root.hidePopup();
|
},
|
|
//查询条件的弹窗
|
showPopup_gh() {
|
this.isDialogVisible = true;
|
this.onQuery_gh();
|
},
|
onQuery_gh() {
|
this.pagenum_gh = 1;
|
this.doQuery_cus();
|
},
|
doQuery_cus() {
|
let me = this;
|
let filter_ = "1=1";
|
for(var k in this.formInline_gh) {
|
let k_val = this.formInline_gh[k];
|
if (filter_) {
|
filter_ += " and md_customer." + k + " like '%" + k_val +"%'";
|
}
|
else {
|
filter_ = "md_customer." + k + " like '%" + k_val +"%'";
|
}
|
}
|
|
let param_ = {
|
isClientMode: false,
|
dataname: "vCustomer",
|
filter: filter_,
|
orderby: "name",
|
|
//attachmeta: true
|
}
|
Server.call("root/data/getEntitySet/customer", param_, function(result) {
|
console.log(result);
|
me.total_gh = 0;
|
me.tableData_cus = [];
|
//if (result && result.data) {
|
var data_ = result.data.entityset;
|
me.tableData_cus = data_;
|
//}
|
|
me.getData_cus();
|
});
|
},
|
getData_cus() {
|
this.total_gh = this.tableData_cus.length;
|
console.log(this.tableData_cus.length);
|
this.tableData_cus2 = this.tableData_cus//.slice((this.pagenum-1)*this.pagesize, this.pagenum * this.pagesize);
|
|
},
|
getData_gh(page) {
|
this.pagesize_gh = page.pagesize;
|
this.pagenum_gh = page.pagenum;
|
this.doQuery_cus();
|
},
|
|
onInitQuery_gh() {
|
this.formInline_gh = {};
|
//this.tableData_cus = this.tableData_cus_new;
|
this.onQuery_gh();
|
},
|
|
rowClickCus(event) {
|
this.selectcusrow = event.row;
|
},
|
|
|
//编辑页面弹窗
|
showPopup(event) {
|
this.selectFormField = event.obj;
|
this.isDialogVisible = true;
|
},
|
/* saveFormValByField(val) {
|
Root.hidePopup();
|
this.$refs.form1.setFormValByField(this.selectcusrow, val)
|
} */
|
|
saveFormValByField() {
|
if(this.popupParames.callback) {
|
let obj = {
|
row: this.selectcusrow
|
}
|
this.popupParames.callback(obj, function() {
|
Root.hidePopup();
|
});
|
}
|
else {
|
alert("该按键事件缺失!")
|
}
|
},
|
|
}
|
});
|
|
</script>
|
</html>
|