<!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_org_hospital",
|
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"
|
// ],
|
// notisshowfieldobj: {},
|
},
|
|
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) {
|
console.log(result);
|
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 row = clone(me.selectedrow);
|
|
let obj = {
|
row: row,
|
}
|
|
me.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 = {
|
// category_name: {//授权产品
|
// defaultval: {
|
// val: "查看",//空值时的显示值
|
// onclick: function(obj) {//默认值点击事件,此事件需要设置val才有效
|
// me.editHospital(obj.row, "browse")
|
// }
|
// },
|
// },
|
};
|
},
|
|
editHospital(row, sceneCode){
|
let me = this;
|
var delta_ = {};
|
|
// if (this.formData.product_category_name && this.formData.product_category_name.length) {
|
// var product_group_ = []
|
// this.formData.product_category_name.map(val=>{
|
// var option_ = {
|
// code: val,
|
// value: this.product_group_map[val]
|
// }
|
// product_group_.push(option_);
|
// })
|
|
// delta_.product_group = product_group_;
|
// delta_.product_group_map = me.product_group_map;
|
|
// }
|
|
var config = {
|
totab: false, //true: 以Tab导航的方式打开
|
width: "950px",
|
height: "500px",
|
icon: "icon-product",
|
text: "医院选择",
|
id: "org_hospital_edit",//totab: true时需设置,用于判断是否已打开此页面
|
url: "module/md/page/customer/page/popup/org_hospital_edit.html",
|
data: row,
|
// delta: delta_,
|
// filter: "state_code!='UnderApproval'",
|
sceneCode: sceneCode,//"edit", //"add"//"browse",
|
callback: function(obj, callback) {
|
// obj.row.category_name = null;
|
console.log('XX',obj.row);
|
|
if (sceneCode == "add") {
|
me.tableData.unshift(obj.row);
|
console.log('Xdd',me.tableData);
|
}
|
|
else {
|
var tableData_ = clone(me.tableData)
|
|
tableData_.map(f=>{
|
if(f.id == row.id){
|
f = obj.row;
|
}
|
})
|
me.tableData = tableData_;
|
// console.log(row);
|
// row = obj.row;
|
}
|
|
// me.getOrgHospital();
|
// me.change_org_hospital[obj.row.id] = obj.row;
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
},
|
|
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>
|