<!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: "md_terminal",
|
title: "医院库选择",
|
dataRequest: [
|
{
|
name: "md_province",
|
dataname: "md_province",
|
// url: "root/data/newEntity",
|
// paramsobj: {dataname: "md_org_data", type_code:"Distributor"},
|
isnotoption: false, //true:不是选项
|
code:"name",//是下拉选项时设置
|
label:"name",//是下拉选项时设置
|
filter: ""
|
|
}
|
],
|
|
filterfieldClick: {},
|
tablefieldClick: {},
|
formfieldClick: {},
|
filterAttr: {
|
columnnumber: 4,
|
labelwidth: "120px",
|
labelposition: "right",
|
size: "medium",
|
border: "0px solid #c6c6c600"
|
},
|
default_filterFields: [
|
{isshow: "T", field: "field11", name: "医院编码", filterfield:"", filteroperator: "like", type: ""},
|
],
|
default_tableFields: [
|
{field: "field1", name: "医院编码", isshow: "T", width: "120"},
|
{field: "field2", name: "医院名称", isshow: "T", align: "left", width: "240"},
|
{field: "field3", name: "等级", isshow: "T"},
|
{field: "field4", name: "级别", isshow: "T"},
|
{field: "field5", name: "医院性质", isshow: "T"},
|
{field: "field6", name: "省份", isshow: "T", width: "120"},
|
{field: "field7", name: "城市", isshow: "T", width: "120"},
|
{field: "field8", name: "区县", isshow: "T", width: "120"},
|
{field: "field9", name: "地址", isshow: "T", align: "left", width: "300"},
|
],
|
notisshowfields: [
|
"address", "longitude","latitude","is_target","is_disable","creator", "create_time", "update_time","hospital_group", "shortname","credit_code","zip_code"
|
],
|
notisshowfieldobj: {},
|
filterTxt: "state_code='Open'"
|
},
|
created() {
|
this.notisshowfields.map(f=>{
|
this.notisshowfieldobj[f] = true;
|
});
|
this.popupParames = clone(Root.popupParames);
|
// if (this.popupParames.filter) {
|
// this.filterTxt = this.popupParames.filter
|
// }
|
this.fieldsToFieldsObj();
|
},
|
mounted() {
|
var me = this;
|
//预加载数据
|
if (this.dataRequest && this.dataRequest.length) {
|
var result = {};
|
this.loadRequestData(this.dataRequest, result, function(data) {
|
me.dataRequestObj = data;
|
//预加载数据后给哪些字段设置options或formatterjson
|
|
me.initData();
|
});
|
}
|
else {
|
this.initData();
|
}
|
this.$nextTick(() => { // 以服务的方式调用的 Loading 需要异步关闭
|
hideLoading();
|
});
|
},
|
methods:{
|
initData() {
|
var me = this;
|
this.onQuery(function(result, callback) {//查询后的回调,用于获取字段的
|
if (result.meta && result.meta[me.dataname] && result.meta[me.dataname].fields) {
|
var metas = clone(result.meta[me.dataname].fields);
|
var filterFields_ = [];
|
var tableFields_ = [];
|
|
metas.map(f=>{
|
f.isshow = "T";
|
|
if (me.notisshowfieldobj[f.field]) {
|
f.isshow = "F";
|
}
|
|
if (f.field == "province") {
|
f.options = me.dataRequestObj.md_province
|
}
|
|
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();
|
}
|
});
|
},
|
saveAfter() {
|
var me = this;
|
if(this.popupParames.callback) {
|
let obj = {
|
row: clone(this.selectedrow)
|
}
|
this.popupParames.callback(obj, function() {
|
me.closeDialog();
|
});
|
}
|
else {
|
me.closeDialog();
|
}
|
},
|
onRowDblClick() {
|
// if (this.isedit) {
|
this.saveAfter();
|
// }
|
},
|
closeDialog() {
|
var me = this;
|
if (me.popupParames.totab){
|
Root.tab.removeItem(Root.tab.selected);
|
Root.tab.open(me.popupParames.parentOption, false);
|
}
|
else {
|
Root.hidePopup();
|
}
|
},
|
tableFieldClick() {
|
var me = this;
|
//表格字段事件设置
|
this.tablefieldClick = {
|
};
|
|
},
|
rowClick(obj){
|
var me = this;
|
me.selectedrow = obj.row;
|
},
|
}
|
});
|
};
|
loadJsCss(function () {
|
initVue();
|
});
|
</script>
|
</head>
|
|
<body style="margin: 0px;">
|
<div v-cloak id="vbody">
|
<div id="page_root">
|
<div style="padding: 0px 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:show-popup="showFilterPopup"
|
v-on:on-query="onQuery"
|
v-on:on-init-query="onInitFilter"
|
v-on:on-edit-query="onEditFilter"
|
v-on:order-fields="orderFilterFields"
|
>
|
</h-form-filter>
|
</div>
|
</div>
|
|
<div class="h_dialog__body">
|
<h-table
|
v-if="isRefresh"
|
ref="table1"
|
:table-fields="tableFields"
|
:table-data="tableData"
|
:is-edit-table-data="isEditTableData"
|
:table-field-click="tablefieldClick"
|
:pagesize="pagesize"
|
:pagenum="pagenum"
|
:total="total"
|
:table-height="tableHeight"
|
:is-highlight-row="true"
|
|
v-on:get-data="getData"
|
v-on:edit-data="editData"
|
v-on:del-data="delData"
|
v-on:cell-click="cellClick"
|
v-on:row-click="rowClick"
|
v-on:order-fields="orderTableFields"
|
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" type="primary" @click="saveAfter">确 定</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>
|
|
<style>
|
[v-cloak] {
|
display: none !important;
|
}
|
</style>
|
</body>
|
</html>
|