<!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() {
|
pageVue = new TabTableVue({
|
el: "#vbody",
|
data: {
|
title: "授权管理",
|
//Tab项设置
|
tabs_d: [
|
{code: "Input", name: "授权申请", dataname: "md_org_account_hospital_apply", filterTxt: "(state_code='Input' or state_code='OpeningApproval')", orderby: "date_to"},
|
{code: "Open", name: "生效", dataname: "md_org_account_hospital", filterTxt: "apply_id is not null and md_org_account_hospital.state_code='Open'", orderby: "date_to"},
|
// {code: "Overdue", name: "逾期", dataname: "md_org_account_hospital", filterTxt: "", orderby: "update_time desc"},
|
{code: "Close", name: "终止", dataname: "md_org_account_hospital", filterTxt: "apply_id is not null and md_org_account_hospital.state_code='Closed'", orderby: "date_to"},
|
{code: "All", name: "全部", dataname: "md_org_account_hospital", filterTxt: "(md_org_account_hospital.state_code='Open' or md_org_account_hospital.state_code='Closed')", orderby: "date_to"},
|
],
|
d_tabs: {
|
Input: true,
|
Open: true,
|
Overdue: true,
|
Close: true,
|
All: true,
|
},
|
tabsobj: {},
|
tabs: [],
|
cbuttons_r: {},
|
ctabs_r: {},
|
isCustomer: false, //
|
|
},
|
created() {
|
var me = this;
|
this.isCustomer = window.top.vue.isCustomer
|
},
|
|
mounted() {
|
var me = this;
|
if (window.top.tab.selected.option.page_id) {
|
this.title = window.top.tab.selected.option.menutitle
|
getPageByPageId(window.top.tab.selected.option.page_id, function(result){
|
me.cbuttons_r = result.buttons_r;
|
me.ctabs_r = result.tabs_r;
|
// me.ctabs_r = me.d_tabs
|
var tabsarr = [];
|
me.tabs_d.map(e=>{
|
if(me.ctabs_r[e.code]){
|
tabsarr.push(e)
|
}
|
})
|
me.tabs = tabsarr;
|
|
if(me.tabs.length>0){
|
me.activeTabName = me.tabs[0].code;
|
}
|
|
//初始化Tabs
|
me.initTabsPage(function() {
|
//获取数据
|
me.initData();
|
});
|
|
me.$nextTick(() => { // 以服务的方式调用的 Loading 需要异步关闭
|
hideLoading();
|
});
|
})
|
}
|
},
|
|
methods:{
|
onhandleClick() {
|
this.initData();
|
},
|
|
initData() {
|
var me = this;
|
me.tableButtonClick();
|
this.doQueryByTab(function(result, callback) {//查询后的回调,用于获取字段的
|
if (result.meta && result.meta[me.selectTabObj.dataname] && result.meta[me.selectTabObj.dataname].fields) {
|
var metas = clone(result.meta[me.selectTabObj.dataname].fields);
|
var filterFields_ = [];
|
var tableFields_ = [];
|
|
metas.map(f=>{
|
f.isshow = "T";
|
if (me.selectTabObj.dataname == "md_org_account_hospital") {
|
if (f.field == "hospital_id") {
|
f.isshow = "F";
|
}
|
}
|
if (me.isCustomer && (f.field == "md_org__code" || f.field == "md_org__name" || f.field == "category_name"
|
|| f.field == "creator_name" || f.field == "create_time" || f.field == "update_time"
|
)) {
|
f.isshow = "F"
|
f.isfilter = false
|
}
|
|
if (me.isCustomer && me.selectTabObj.code != "Close" && (f.field == "suspend_date" || f.field == "suspend_remark")) {
|
f.isshow = "F"
|
f.isfilter = false
|
}
|
|
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.selectTabObj.code != "Input") {
|
// var file_operation = {
|
// isshow: "T", field: "file_operation", name: "原授权书", isnotfilter: true,
|
// width: "100", align: "center", isfixed: "right",
|
// }
|
|
// // 是非经销售
|
// if (!me.isCustomer) {
|
// tableFields_.push(file_operation);
|
// }
|
// var file_stamp = {
|
// isshow: "T", field: "file_stamp_state_name", name: "签章状态",
|
// width: "100", align: "center", isfixed: "right",
|
// }
|
|
// tableFields_.push(file_stamp);
|
|
var file_operation = {
|
isshow: "T", field: "file_operation", name: "操作", inputtype: "buttons",
|
width: "350", align: "center", isfixed: "right",
|
buttons: [
|
{code: "B001", name: "发起", type: "success"},
|
{code: "B002", name: "签章", type: "warning"},
|
{code: "B003", name: "浏览/下载", type: "primary"},
|
{code: "B004", name: "撤回", type: "danger"},
|
{code: "B005", name: "作废", type: "danger"},
|
]
|
}
|
tableFields_.push(file_operation);
|
|
}
|
|
|
if (!me.selectTabObj.filterFields || (me.selectTabObj.filterFields && me.selectTabObj.filterFields.length == 0)) {
|
me.selectTabObj.filterFields = clone(filterFields_);
|
me.selectTabObj.tableFields = clone(tableFields_);
|
|
//字段数组转字段obj,目的为了筛选时获取字段属性
|
me.fieldsToFieldsObj();
|
|
//设置字段事件
|
me.tableFieldClick();
|
}
|
}
|
|
if (callback) {
|
callback();
|
}
|
});
|
},
|
|
onQueryAfter() {
|
var me = this;
|
var today = new Date(); // 获取当前日期
|
var day90_ = new Date(today.getTime() + 90 * (24 * 60 * 60 * 1000)); // 获取90天后的日期
|
me.selectTabObj.tableData.map(r=>{
|
if (r.file_authorization) {//有附件
|
r.file_operation = "预览"
|
}
|
|
if (r.date_to && new Date(r.date_to) < day90_) {
|
r.h_classname = "h_valid_to"
|
}
|
if (r.suspend_date && new Date(r.suspend_date) < day90_) {
|
r.h_classname = "h_valid_to"
|
}
|
})
|
},
|
|
// 设置表格工具栏按键事件
|
tableButtonClick() {
|
var me = this;
|
var tablebuttonClick = {};
|
tablebuttonClick.Input = [
|
{
|
// name: "新增", // type: "primary", // icon: "el-icon-edit",
|
isbuttonshow: me.cbuttons_r.add ? me.cbuttons_r.add : false,
|
code: "add", isselected: false, classname: "",
|
onclick: function(obj) {
|
// obj.selectedList
|
me.openAccountHospital('add', obj.selectedList[0], true);
|
}
|
},
|
{
|
// name: "提交", // type: "primary", // icon: "el-icon-edit",
|
isbuttonshow: me.cbuttons_r.submit ? me.cbuttons_r.submit : false, type: "success",
|
code: "submit", isselected: true, classname: "",
|
disabled: function(selectRowList) {
|
var bo_ = true;
|
if (selectRowList[0] && selectRowList[0].state_code == "Input") {
|
bo_ = false;
|
}
|
return bo_
|
},
|
onclick: function(obj) {
|
// me.commitData(obj.selectedList[0]);
|
me.openAccountHospital('edit', obj.selectedList[0], true);
|
}
|
},
|
{
|
// name: "详情", // type: "primary", // icon: "el-icon-edit",
|
isbuttonshow: me.cbuttons_r.formdetail ? me.cbuttons_r.formdetail : false,
|
code: "formdetail", isselected: true, classname: "",
|
onclick: function(obj) {
|
// obj.selectedList
|
me.openAccountHospital('browse', obj.selectedList[0], false);
|
}
|
},
|
{
|
// name: "编辑", // type: "primary", // icon: "el-icon-edit",
|
isbuttonshow: me.cbuttons_r.edit ? me.cbuttons_r.edit : false,
|
code: "edit", isselected: true, classname: "",
|
disabled: function(selectRowList) {
|
var bo_ = true;
|
if (selectRowList[0] && selectRowList[0].state_code == "Input" && !selectRowList[0].agreement_id) {
|
bo_ = false;
|
}
|
return bo_
|
},
|
onclick: function(obj) {
|
// obj.selectedList
|
me.openAccountHospital('edit', obj.selectedList[0], true);
|
}
|
},
|
{
|
// name: "删除", // type: "primary", // icon: "el-icon-edit",
|
isbuttonshow: me.cbuttons_r.delete ? me.cbuttons_r.delete : false, type: "danger",
|
code: "delete", isselected: true, classname: "",
|
disabled: function(selectRowList) {
|
var bo_ = true;
|
if (selectRowList[0] && selectRowList[0].state_code == "Input" && !selectRowList[0].agreement_id) {
|
bo_ = false;
|
}
|
return bo_
|
},
|
onclick: function(obj) {
|
// var row = obj.selectedList[0];
|
var row = me.selectTabObj.selectedrow
|
var txt = clone(row.apply_no)
|
me.deleteDataById(row.id, me.selectTabObj.dataname, "【" + txt + "】", function(){})
|
// me.delData(obj)
|
// obj.selectedList
|
// me.closeData('browse', obj.selectedList[0]);
|
// me.closeData();
|
}
|
},
|
],
|
tablebuttonClick.Open = [
|
// {
|
// name: "终止", // type: "primary", // icon: "el-icon-edit",
|
// isbuttonshow: true, type: "danger",
|
// code: "close", isselected: true, classname: "",
|
// disabled: function(selectRowList) {
|
// var bo_ = true;
|
// if (selectRowList[0] && selectRowList[0].state_code == "Open" && !selectRowList[0].agreement_id) {
|
// bo_ = false;
|
// }
|
// return bo_
|
// },
|
// onclick: function(obj) {
|
// // obj.selectedList
|
// // me.closeData('browse', obj.selectedList[0]);
|
// // me.closeData();
|
// }
|
// },
|
{
|
name: "授权书回挂", type: "primary", icon: "el-icon-copy-document",
|
// isbuttonshow: me.cbuttons_r.fileStamp ? me.cbuttons_r.fileStamp : false,
|
isbuttonshow: true,
|
code: "fileStamp", isselected: true, classname: "",
|
disabled: function(selectRowList, selectedList) {
|
var bo_ = true;
|
// 如果是非商业账号需要在甲方待签章状态下可回挂
|
if (selectRowList[0] && !me.isCustomer && selectRowList[0].file_stamp_state_code == "NoSignature") {
|
bo_ = false;
|
}
|
// 如果是商业需要在乙方待签章状态下可回挂,且只能看到回挂文件,原文件看不到
|
else if (selectRowList[0] && me.isCustomer && selectRowList[0].file_stamp_state_code == "PartyASignature") {
|
bo_ = false;
|
}
|
return bo_
|
},
|
onclick: function(obj) {
|
// obj.selectedList
|
me.onPopupByUploadPDFFile(me.selectTabObj.selectedrow, 'file_name_stamp_authorization', 'file_stamp_authorization', me.selectTabObj.dataname, function() {
|
// 更新签章状态
|
var file_stamp_state_code_ = "PartyASignature";
|
var file_stamp_state_name_ = "甲方已签章乙方待签章";
|
if (me.selectTabObj.selectedrow.file_stamp_state_code == "PartyASignature") {
|
file_stamp_state_code_ = "PartyABSignature";
|
file_stamp_state_name_ = "双方已签章";
|
}
|
var selectedList_ = [
|
{
|
id: me.selectTabObj.selectedrow.id,
|
file_stamp_state_code: file_stamp_state_code_,
|
file_stamp_state_name: file_stamp_state_name_,
|
}
|
];
|
var fieldobjlist = [
|
{field: "file_stamp_state_code"},
|
{field: "file_stamp_state_name"}
|
]
|
|
me.onSaveDataByFieldLsit(selectedList_, me.selectTabObj.dataname, fieldobjlist, function(){
|
me.onQuery();
|
});
|
})
|
}
|
},
|
{
|
name: "植入凭证", type: "primary", icon: "el-icon-edit",
|
isbuttonshow: me.cbuttons_r.edit_pz ? me.cbuttons_r.edit_pz : false,
|
code: "edit_pz", isselected: true, classname: "",
|
disabled: function(selectRowList) {
|
var bo_ = true;
|
if (selectRowList[0]) {
|
bo_ = false;
|
}
|
return bo_
|
},
|
onclick: function(obj) {
|
me.openImplantEvidence(obj.selectedList[0], function(suspendData){
|
var selectedList_ = clone(obj.selectedList);
|
selectedList_.map(row=>{
|
row.implant_evidence_code = suspendData.implant_evidence_code
|
})
|
me.onSaveImplantEvidence(selectedList_);
|
});
|
}
|
},
|
|
{
|
// name: "作废", // type: "primary", // icon: "el-icon-edit",
|
isbuttonshow: me.cbuttons_r.repeal, type: "danger",
|
code: "suspend", isselected: true, classname: "",
|
islistselected: false, // 是否可以多选
|
disabled: function(selectRowList, selectedList) {
|
var bo_ = true;
|
if (selectRowList[0]) {
|
bo_ = false;
|
}
|
return bo_
|
},
|
onclick: function(obj) {
|
// me.onSuspend(function(suspendData){
|
// var selectedList_ = clone(obj.selectedList);
|
// selectedList_.map(row=>{
|
// row.suspend_date = suspendData.suspend_date
|
// row.suspend_remark = suspendData.suspend_remark
|
// })
|
// me.onSaveSuspend(selectedList_);
|
// })
|
|
// me.cancelConfirm();
|
me.repealAccountHospital('repeal', obj.selectedList[0], true);
|
}
|
},
|
]
|
|
if (tablebuttonClick[this.activeTabName]) {
|
this.selectTabObj.tablebuttonClick = tablebuttonClick[this.activeTabName];
|
}
|
else {
|
this.selectTabObj.tablebuttonClick = []
|
}
|
},
|
|
tableFieldClick() {
|
var me = this;
|
var tablefieldClick = {};
|
var tablefieldClick_Input = {};
|
tablefieldClick_Input = {
|
apply_no: {
|
val: {//有值时的点击事件
|
notclick_val: "",//不可点击的值,1、是数组["11","22"];2、以“;”分隔的字符串"111;222"
|
notclick_bindfield: [],//当该字段值等于指定字段值时不可点击["filterfield": "111"]
|
onclick: function(obj) {//数据值点击事件
|
//打开
|
me.openAccountHospital('browse', obj.row, false);
|
},
|
},
|
},
|
state_name: {//状态
|
val: {//有值时的点击事件
|
notclick_val: ["草稿","录入"],
|
notclick_bindfield: [],
|
onclick: function(obj) {
|
var config = {
|
totab: false,
|
width: "1100px",
|
height: "520px",
|
icon: "icon-product",
|
text: "流程步骤",
|
id: "popup_workflow_step_user" + obj.row.id,
|
url: "module/tool/page/popup_workflow_step_user.html?v=2023020703",
|
data: obj.row,
|
delta: {},
|
sceneCode: "browse",
|
callback: function(obj, callback) {
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
},
|
},
|
},
|
}
|
//表格字段事件设置
|
tablefieldClick = {
|
implant_evidence_code: {
|
defaultval: {
|
val: "发票",//空值时的显示值
|
},
|
},
|
|
state_name: {//状态
|
val: {//有值时的点击事件
|
notclick_val: ["草稿","录入"],
|
notclick_bindfield: [],
|
onclick: function(obj) {
|
var config = {
|
totab: false,
|
width: "1100px",
|
height: "520px",
|
icon: "icon-product",
|
text: "流程步骤",
|
id: "popup_workflow_step_user" + obj.row.apply_id,
|
url: "module/tool/page/popup_workflow_step_user.html?v=2023020703",
|
data: {id: obj.row.apply_id},
|
delta: {},
|
sceneCode: "browse",
|
callback: function(obj, callback) {
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
},
|
},
|
},
|
file_operation: { //字段事件设置
|
buttons: {
|
onclick: function(obj, code) {//数据值点击事件
|
var signer = null;
|
if (code == "B001") { // 发起
|
me.onFileSignature(obj.row);
|
}
|
else if (code == "B002") { // 签章
|
me.onSignature("md_org_account_hospital", obj.row.id, signer);
|
}
|
else if (code == "B003") { // 浏览/下载
|
//打开
|
if (obj.row.document_id && obj.row.contract_id) { // 已签章的预览
|
me.onPreviewSignature(obj);
|
}
|
else { // 未签章的预览
|
me.previewAuthorization(obj.row.file_authorization, obj.row.file_name_authorization, me.selectTabObj.dataname)
|
}
|
}
|
else if (code == "B004") { // 撤回
|
me.onRecallSignature("md_org_account_hospital", obj.row.id, signer);
|
}
|
else if (code == "B005") { // 作废
|
me.onCancelSignature("md_org_account_hospital", obj.row.id, signer);
|
}
|
},
|
},
|
},
|
|
file_stamp_state_name: { // 字段事件设置
|
val: {//有值时的点击事件
|
notclick_val: "",//不可点击的值,1、是数组["11","22"];2、以“;”分隔的字符串"111;222"
|
notclick_bindfield: [],//当该字段值等于指定字段值时不可点击["filterfield": "111"]
|
onclick: function(obj) {//数据值点击事件
|
// 回挂
|
if (!obj.row.file_stamp_authorization && !me.isCustomer) {
|
me.onPopupByUploadPDFFile(obj.row, 'file_name_stamp_authorization', 'file_stamp_authorization', me.selectTabObj.dataname, function() {
|
// 更新签章状态
|
var file_stamp_state_code_ = "PartyASignature";
|
var file_stamp_state_name_ = "乙方待签章";
|
if (obj.row.file_stamp_state_code == "PartyASignature") {
|
file_stamp_state_code_ = "PartyABSignature";
|
file_stamp_state_name_ = "双方已签章";
|
}
|
var selectedList_ = [
|
{
|
id: obj.row.id,
|
file_stamp_state_code: file_stamp_state_code_,
|
file_stamp_state_name: file_stamp_state_name_,
|
}
|
];
|
var fieldobjlist = [
|
{field: "file_stamp_state_code"},
|
{field: "file_stamp_state_name"}
|
]
|
|
me.onSaveDataByFieldLsit(selectedList_, me.selectTabObj.dataname, fieldobjlist, function(){
|
me.onQuery();
|
});
|
})
|
}
|
else { // 预览
|
me.previewAuthorization(obj.row.file_stamp_authorization, obj.row.file_name_stamp_authorization, me.selectTabObj.dataname)
|
}
|
},
|
},
|
},
|
|
hospital_name: {
|
input: {
|
valuekey: "name",
|
onQuerySearch: function(obj, callback) { // 输入框搜索事件
|
let param_ = {
|
dataname: "md_hospital",
|
filter: " name like '%" + obj.inputstring + "%'",
|
orderby: "name"
|
}
|
Server.call("root/data/getEntitySet", param_, function(result) {
|
var inputoptions_ = []
|
if (result && result.data && result.data.entityset) {
|
inputoptions_ = result.data.entityset;
|
callback(inputoptions_)
|
}
|
else {
|
callback(inputoptions_)
|
}
|
|
});
|
}
|
}
|
}
|
};
|
|
if (this.selectTabObj.code != 'Input') {
|
this.selectTabObj.tablefieldClick = tablefieldClick;
|
}
|
else {
|
this.selectTabObj.tablefieldClick = tablefieldClick_Input;
|
}
|
},
|
|
// 发起签章
|
onFileSignature(row) {
|
let me = this;
|
var is_signature = this.selectTabObj.selectedrow.is_signature ? true : false;
|
var document_id = this.selectTabObj.selectedrow.document_id;
|
var contract_id = this.selectTabObj.selectedrow.contract_id;
|
var signer = null; // 甲乙方的标识
|
if (is_signature) { // 已签章
|
// 取消签章事件
|
// me.onRecallSignature("md_org_account_hospital", row.id, signer);
|
}
|
else { // 待发布
|
this.onWeaverCreatebyFile("md_org_account_hospital", row.id);
|
// 判断是否已经注册过签章文件document_id, contract_id
|
//if (!document_id) {
|
// this.onWeaverCreatebyFile("md_org_account_hospital", row.id);
|
//}
|
//else {
|
// 签章事件
|
// me.onSignature("md_org_account_hospital", me.selectTabObj.selectedrow.id, signer);
|
//}
|
}
|
},
|
|
// 文件注入
|
onWeaverCreatebyFile(dataname, id) {
|
let me = this;
|
var param = {
|
id: id,
|
dataName: dataname
|
}
|
Server.call("root/weaver/weaverCreatebyFile", param, function(result) {
|
console.log(result);
|
me.onWeaverCreatebyCategory(dataname, id);
|
}, function(result) {
|
if (result.weaver) {
|
Root.message({
|
type: 'error',
|
message: result.weaver
|
});
|
}
|
else {
|
Root.message({
|
type: 'error',
|
message: '文件注入错误'
|
});
|
}
|
});
|
|
},
|
|
// 创建签章文件
|
onWeaverCreatebyCategory(dataname, id) {
|
let me = this;
|
var param = {
|
id: id,
|
dataName: dataname
|
}
|
Server.call("root/weaver/weaverCreatebyCategory", param, function(result) {
|
console.log(result);
|
// 更新签章状态为待签章
|
|
//更新后调用签章
|
// 打开签章页面
|
me.onSignature("md_org_account_hospital", id, signer);
|
}, function(result) {
|
if (result.weaver) {
|
Root.message({
|
type: 'error',
|
message: result.weaver
|
});
|
}
|
else {
|
Root.message({
|
type: 'error',
|
message: '创建签章错误'
|
});
|
}
|
});
|
},
|
|
// 打开签章页面
|
onSignature(dataname, id, signer) {
|
let me = this;
|
var param = {
|
id: id,
|
dataName: dataname,
|
signer: signer
|
}
|
Server.call("root/weaver/weaverSignUrl", param, function(result) {
|
console.log(result);
|
if (result && result.weaver) {
|
var signUrl_ = result.weaver.replace(/[\t\r\n]/g,"")
|
signUrl_ = util.decode(signUrl_);
|
signUrl_ = JSON.parse(signUrl_);
|
console.log(signUrl_);
|
var url_ = signUrl_.signUrl;
|
window.open(url_);
|
}
|
}, function(result) {
|
if (result.weaver) {
|
Root.message({
|
type: 'error',
|
message: result.weaver
|
});
|
}
|
else {
|
Root.message({
|
type: 'error',
|
message: '打开签章错误'
|
});
|
}
|
});
|
},
|
// 撤销签章
|
onRecallSignature(dataname, id, signer) {
|
let me = this;
|
var param = {
|
id: id,
|
dataName: dataname,
|
signer: signer
|
}
|
Server.call("root/weaver/weaverRecall", param, function(result) {
|
Root.message({
|
type: 'success',
|
message: '已撤回签章'
|
});
|
//更新签章状态为待发布签章
|
me.onQuery();
|
}, function(result) {
|
if (result.weaver) {
|
Root.message({
|
type: 'error',
|
message: result.weaver
|
});
|
}
|
else {
|
Root.message({
|
type: 'error',
|
message: '撤回签章错误'
|
});
|
}
|
});
|
},
|
// 作废签章
|
onCancelSignature(dataname, id, signer) {
|
let me = this;
|
this.$prompt('', '作废原因', {
|
confirmButtonText: '作废',
|
cancelButtonText: '取消',
|
showInput: true,
|
inputPattern: /.*[^\s]/,
|
inputErrorMessage: "请先填写作废原因"
|
}).then(({ value }) => {
|
var param = {
|
id: id,
|
dataName: dataname,
|
reason: value,
|
signer: signer
|
}
|
Server.call("root/weaver/weaverCancel", param, function(result) {
|
console.log(result);
|
me.$message({
|
type: 'success',
|
message: '已作废'
|
});
|
//更新签章状态为已作废签章
|
me.onQuery();
|
}, function(result) {
|
if (result.weaver) {
|
Root.message({
|
type: 'error',
|
message: result.weaver
|
});
|
}
|
else {
|
Root.message({
|
type: 'error',
|
message: '作废签章错误'
|
});
|
}
|
});
|
|
}).catch(() => {
|
me.$message({
|
type: 'info',
|
message: '已取消'
|
});
|
});
|
|
},
|
|
|
// 签章预览
|
onPreviewSignature(obj) {
|
let me = this;
|
var param = {
|
id: obj.row.id,
|
dataName: "md_org_account_hospital",
|
}
|
Server.call("root/weaver/weaverViewUrl", param, function(result) {
|
console.log(result);
|
if (result && result.weaver) {
|
var signUrl_ = result.weaver.replace(/[\t\r\n]/g,"")
|
signUrl_ = util.decode(signUrl_);
|
signUrl_ = JSON.parse(signUrl_);
|
console.log(signUrl_);
|
var url_ = signUrl_.viewUrl;
|
|
// var url_ = result.data.weaver.viewUrl;
|
window.open(url_);
|
}
|
|
|
});
|
},
|
|
onSaveImplantEvidence(list) {
|
var me = this;
|
if (list.length) {
|
var row = list[0];
|
var param = {
|
dataname: me.selectTabObj.dataname,
|
data: {},
|
}
|
param.data[me.selectTabObj.dataname] = {
|
id: row.id,
|
implant_evidence_code: row.implant_evidence_code,
|
};
|
Server.call("root/data/saveEntity", param, function(result) {
|
console.log(result);
|
if (result.success) {
|
list.remove(row);
|
me.onSaveImplantEvidence(list);
|
}
|
});
|
}
|
else {
|
me.onQuery();
|
}
|
},
|
|
onSaveSuspend(list) {
|
var me = this;
|
if (list.length) {
|
var row = list[0];
|
var param = {
|
dataname: me.selectTabObj.dataname,
|
data: {},
|
}
|
param.data[me.selectTabObj.dataname] = {
|
id: row.id,
|
suspend_date: row.suspend_date,
|
suspend_remark: row.suspend_remark,
|
state_code: "Close",
|
state_name: "已作废",
|
};
|
Server.call("root/data/saveEntity", param, function(result) {
|
console.log(result);
|
if (result.success) {
|
list.remove(row);
|
me.onSaveSuspend(list);
|
}
|
});
|
}
|
else {
|
me.onQuery();
|
}
|
|
},
|
|
openImplantEvidence(row, callback) {
|
var me = this;
|
var config = {
|
totab: false, //true: 以Tab导航的方式打开
|
width: "400px",
|
height: "400px",
|
icon: "icon-product",
|
text: "植入凭证设置",
|
url: "module/md/page/popup/page/popup_implant_evidence.html",
|
data: {implant_evidence_code: row.implant_evidence_code ? row.implant_evidence_code : "invoice"},
|
delta: {},
|
sceneCode: "add", //"add"//"browse",
|
callback: function(popupobj, popupcallback) {
|
callback(popupobj.row);
|
if (popupcallback) {
|
popupcallback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
},
|
|
onSuspend(callback) {
|
var me = this;
|
var config = {
|
totab: false, //true: 以Tab导航的方式打开
|
width: "400px",
|
height: "400px",
|
icon: "icon-product",
|
text: "终止设置",
|
url: "module/tool/page/popup_suspend.html",
|
data: {},
|
delta: {},
|
sceneCode: "add", //"add"//"browse",
|
callback: function(popupobj, popupcallback) {
|
callback(popupobj.row);
|
if (popupcallback) {
|
popupcallback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
},
|
deleteDataById(id, dataname, confirm_txt, callback){
|
var me = this;
|
var formData_ = clone(me.formData);
|
Root.confirm('确定删除授权书' +confirm_txt + '吗?', '删除提示', {
|
confirmButtonText: '删除',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
let param = {
|
id: id,
|
dataname: dataname,
|
}
|
Server.call("root/data/deleteEntity", param, function(result) {
|
Root.message({
|
type: 'success',
|
message: '删除成功!'
|
});
|
me.onQuery();
|
});
|
}).catch(() => {
|
Root.message({
|
type: 'info',
|
message: '已取消删除'
|
});
|
});
|
},
|
commitData(obj) {
|
var me = this;
|
Root.confirm('确定提交授权' + obj.apply_no + '吗?', '提交提示', {
|
confirmButtonText: '提交',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
var param = {
|
dataname: me.selectTabObj.dataname,
|
id: obj.id,
|
// to_state: "OpeningApproval"
|
}
|
Server.call("root/data/commit", param, function(result) {
|
console.log(result);
|
if (result.success) {
|
Root.message({
|
type: 'success',
|
message: '提交成功'
|
});
|
me.onQuery();
|
}
|
});
|
}).catch(() => {
|
Root.message({
|
type: 'info',
|
message: '已取消'
|
});
|
});
|
},
|
createAuthorization(obj) {
|
var me = this;
|
var row = obj.row;
|
var config = {
|
totab: true, //true: 以Tab导航的方式打开
|
icon: "icon-product",
|
text: "授权书-" + row.code,
|
id: "apJMMould" + row.id,//totab: true时需设置,用于判断是否已打开此页面
|
url: "rootjm/report/showReport?token=" + Root.getToken() + "&type=view&id=" + row.report_id + "&data_id=" + row.id
|
};
|
me.doPopupByPublic(config);
|
},
|
|
previewAuthorization(file_id, file_name, dataname) {
|
let me = this;
|
// var file_id = obj.row.file_authorization;
|
// var file_name = obj.row.file_name_authorization;
|
if(file_id) {
|
var fileid = file_id;
|
let fileName = clone(file_name);
|
let index1 = fileName.lastIndexOf(".");
|
let index2 = fileName.length;
|
let suffix = fileName.substring(index1, index2).toLowerCase(); //后缀名
|
if (suffix == ".png" || suffix == ".jpg" || suffix == ".pdf") {
|
var row = {
|
fileid: fileid,
|
filename: fileName,
|
dataname: dataname
|
}
|
var config = {
|
totab: false,
|
width: "1200px",
|
height: 800,
|
icon: "icon-product",
|
text: "附件预览",
|
id: "pdf_" + fileid,
|
url: "module/tool/page/popup_file_pdf.html",
|
data: row,
|
delta: {},
|
callback: function(obj, callback) {
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
this.doPopupByPublic(config);
|
}
|
else {//只可下载,不可预览
|
// handleDownloadUrl(fileid,false);
|
handleDownload(fileid, dataname);
|
}
|
}
|
},
|
// onAddData() {
|
// var me = this;
|
|
// var config = {
|
// totab: true, //true: 以Tab导航的方式打开
|
// icon: "icon-product",
|
// text: "授权书申请",
|
// id: "authorization_add",//totab: true时需设置,用于判断是否已打开此页面
|
// url: "module/md/page/customer/page/authorization_add.html",
|
// data: {},
|
// delta: {},
|
// sceneCode: "add",//"refuseedit",//"approval", //"add"//"browse",
|
// callback: function(obj, callback) {
|
// me.onQuery();
|
// if (callback) {
|
// callback();
|
// }
|
// }
|
// };
|
// me.doPopupByPublic(config);
|
// },
|
|
// onEditData(config, scope) {
|
// var me = this;
|
// var row = scope.row;
|
|
// //1. empty row
|
// if (!row || !row.id) {
|
// Root.message({
|
// type: 'warning',
|
// message: '请选择要编辑的数据'
|
// });
|
// return false;
|
// }
|
|
// //2. not input
|
// if (row.state_code != 'Input') {
|
// Root.message({
|
// type: 'warning',
|
// message: "当前数据不是输入状态"
|
// })
|
// return false;
|
// }
|
|
// //3. popup
|
// config.combine({
|
// totab: true,
|
// icon: "icon-product",
|
// text: "授权书申请",
|
// id: "sorder_edit" + row.id,
|
// url: "module/agreement/page/record_edit.html",
|
// sceneCode: "edit",
|
// data: row,
|
// delta: me.dataname,
|
// callback: function(obj, callback) {
|
// me.onQuery();
|
// if (callback) {
|
// callback();
|
// }
|
// },
|
// });
|
// return true;
|
// },
|
|
closeData() {
|
var me = this;
|
Root.confirm('确定作废授权书【' + this.selectTabObj.selectedrow.code + '】吗?', '作废提示', {
|
confirmButtonText: '作 废',
|
cancelButtonText: '取 消',
|
type: 'warning'
|
}).then(() => {
|
let param = {
|
id: me.selectTabObj.selectedrow.id,
|
dataname: me.selectTabObj.dataname,
|
}
|
Server.call("root/data/Close", param, function(result) {
|
console.log(result);
|
let param_ = {
|
id: me.selectTabObj.selectedrow.id,
|
}
|
|
Server.call("root/data/recordCancel", param_, function(result) {
|
|
})
|
|
Root.message({
|
type: 'success',
|
message: '已作废'
|
});
|
me.onQuery();
|
});
|
}).catch(() => {
|
Root.message({
|
type: 'info',
|
message: '已取消作废'
|
});
|
});
|
},
|
|
dataSubmit() {
|
let row = this.selectTabObj.selectedrow;
|
let me = this;
|
|
Root.confirm('确定提交【' + row.code + '】授权书吗?', '提示', {
|
confirmButtonText: "提交",
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
let param = {
|
dataname: me.selectTabObj.dataname,
|
operator: "commit",
|
id: me.selectTabObj.selectedrow.id,
|
}
|
Server.call("root/data/commit", param, function(result) {
|
console.log(result);
|
if (result.success) {
|
Root.message({
|
type: 'success',
|
message: '提交成功'
|
});
|
me.onQuery();
|
}
|
else {
|
Root.message({
|
type: 'success',
|
message: '提交失败'
|
});
|
me.onQuery();
|
}
|
});
|
}).catch(() => {
|
Root.message({
|
type: 'info',
|
message: '已取消'
|
});
|
});
|
},
|
|
doPassApproval(bo) {
|
var me = this;
|
var operator_ = "Approve"
|
if (!bo) {
|
operator_ = "Reject"
|
}
|
|
let param = {
|
dataname: this.selectTabObj.dataname,
|
id: me.selectTabObj.selectedrow.id,
|
}
|
|
Server.call("root/data/" + operator_, param, function(result) {
|
console.log(result);
|
if (bo) {
|
Root.message({
|
type: 'success',
|
message: '已生效'
|
});
|
me.onQuery();
|
}
|
else {
|
Root.message({
|
type: 'success',
|
message: '已失效'
|
});
|
me.onQuery();
|
}
|
});
|
},
|
|
onDownload() {
|
let me = this;
|
var ioname = "";
|
var sign = "";
|
var filename = '授权导出' + String(new Date().getTime());
|
var filter_ = "1 = 1";
|
filter_ = this.getFilterData(filter_);
|
if (me.selectTabObj.code == "Input") {
|
ioname = "export_authorization_apply"
|
sign = "md_org_account_hospital_apply"
|
filename = '授权申请导出' + String(new Date().getTime());
|
}
|
else { // if (me.selectTabObj.code == "Open")
|
ioname = "export_authorization"
|
sign = "md_org_account_hospital"
|
}
|
let param = {
|
sign: sign,
|
filename: filename,
|
filter: filter_,
|
ioname:ioname,
|
orderby: "",
|
token: Root.getToken()
|
}
|
window.top.vue.textdownloadForm(param);
|
},
|
|
addData() {
|
let me = this;
|
var delta_ = {};
|
var mark = true;
|
var idList = [];
|
var config = {
|
totab: true, //true: 以Tab导航的方式打开
|
width: "950px",
|
height: "500px",
|
icon: "icon-product",
|
text: "医院授权",
|
id: "customer_basic_acct_yysq",//totab: true时需设置,用于判断是否已打开此页面
|
url: "module/md/page/customer/page/customer_basic_acct_yysq.html",
|
data: {},
|
delta: delta_,
|
// filter: "state_code!='UnderApproval'",
|
sceneCode: "add",//"edit", //"add"//"browse",
|
callback: function(obj, callback) {
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
},
|
|
repealAccountHospital(sceneCode, selectrow) {
|
let me = this;
|
var row = {}
|
if (sceneCode == "repeal") {
|
row = clone(selectrow);
|
if(!row.id){
|
Root.message({
|
type: 'warning',
|
message: '请选择一条数据'
|
});
|
return;
|
}
|
}
|
|
// var config = {
|
// totab: false, //true: 以Tab导航的方式打开
|
// width: "1100px",
|
// height: "520px",
|
// icon: "icon-product",
|
// text: "授权医院" + (row.md_hospital__name ? ("-" + row.md_hospital__name) : ""),
|
// id: "customer_basic_acct_yysq" + row.id + sceneCode,//totab: true时需设置,用于判断是否已打开此页面
|
// url: "module/md/page/customer/page/customer_basic_acct_yysq.html",
|
// data: row,
|
// delta: {},
|
// sceneCode: sceneCode,//"refuseedit",//"approval", //"add"//"browse",
|
// callback: function(obj, callback) {
|
// me.onQuery();
|
// if (callback) {
|
// callback();
|
// }
|
// }
|
// };
|
|
var config = {
|
totab: true, //true: 以Tab导航的方式打开
|
width: "1100px",
|
height: "520px",
|
icon: "icon-product",
|
text: "授权终止申请",
|
id: "popup_account_hospital_repealapply" + row.id + sceneCode,//totab: true时需设置,用于判断是否已打开此页面
|
url: "module/md/page/popup/page/popup_account_hospital_repealapply.html",
|
data: row,
|
delta: {},
|
sceneCode: sceneCode,//"refuseedit",//"approval", //"add"//"browse",
|
callback: function(obj, callback) {
|
me.onQuery();
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
},
|
|
openAccountHospital(sceneCode, selectrow, totab) {
|
let me = this;
|
var row = {}
|
if (sceneCode == "edit" || sceneCode == "browse") {
|
row = clone(selectrow);
|
if(!row.id){
|
Root.message({
|
type: 'warning',
|
message: '请选择一条数据'
|
});
|
return;
|
}
|
}
|
|
var config = {
|
totab: totab, //true: 以Tab导航的方式打开
|
width: "1100px",
|
height: "520px",
|
icon: "icon-product",
|
text: "授权申请",
|
id: "popup_account_hospital_apply" + row.id + sceneCode,//totab: true时需设置,用于判断是否已打开此页面
|
url: "module/md/page/popup/page/popup_account_hospital_apply.html",
|
data: row,
|
delta: {},
|
sceneCode: sceneCode,//"refuseedit",//"approval", //"add"//"browse",
|
callback: function(obj, callback) {
|
me.onQuery();
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
},
|
DownloadTemplate() {
|
var pathurl = "";
|
if (this.selectTabObj.code == "Input") {
|
pathurl = "template/1.导入模板/授权医院导入.xlsx";
|
}
|
handleDownload(pathurl);
|
},
|
|
onPopupByUploadFile() {
|
var me = this;
|
var ioname_ = "import_md_org_account_hospital_apply"
|
var delta_ = {
|
filetypelist: [],
|
isToDB: true,
|
}
|
var config = {
|
totab: false,
|
width: "500px",
|
icon: "icon-product",
|
text: "数据文件上传",
|
id: "popup_uploadFileToDB",
|
url: "module/tool/page/popup_uploadFileToDB.html",
|
data: {
|
// userid: me.userid,
|
ioname:ioname_,
|
// position_id: me.position_id,
|
},
|
delta: delta_,
|
callback: function(obj, callback) {
|
me.$message({
|
showClose: true,
|
message: '上传成功!',
|
type: 'success'
|
});
|
me.onQuery();
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
this.doPopupByPublic(config);
|
},
|
|
onPopupByUploadPDFFile(row, filenamefield, fileidfield, dataname, callback) {
|
var me = this;
|
if (row.state_code != 'Open') {
|
Root.message({
|
type: 'warning',
|
message: '仅生效数据可以进行授权书回挂'
|
});
|
return;
|
}
|
var txt_ = "";
|
var isexists = false;
|
if (fileidfield == "file_stamp_authorization" && row.file_stamp_authorization) { // 协议回挂
|
isexists = true;
|
txt_ = "重新进行授权书回挂将替换原回挂授权书";
|
}
|
|
if (isexists) {
|
Root.confirm(txt_, '上传提示', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
me.doPopupByUploadFile(row, filenamefield, fileidfield, dataname, callback);
|
}).catch(() => {
|
Root.message({
|
type: 'info',
|
message: '已取消上传'
|
});
|
});
|
} else {
|
me.doPopupByUploadFile(row, filenamefield, fileidfield, dataname, callback);
|
}
|
},
|
|
doPopupByUploadFile(row, filenamefield, fileidfield, dataname, callback) {
|
var me = this;
|
var analysistype_ = "";
|
var delta_ = {filetypelist: []}//[".png", ".jpg", ".pdf"]
|
var config = {
|
totab: false,
|
width: "500px",
|
icon: "icon-product",
|
text: "附件上传",
|
id: "popupByUploadFile",
|
url: "module/tool/page/popup_uploadFile.html",
|
data: {
|
dataName: dataname,
|
fileidfieldName: fileidfield,
|
id: row.id,
|
fileNamefieldName: filenamefield
|
},
|
delta: delta_,
|
callback: function(fileobj, popupcallback) {
|
me.$message({
|
showClose: true,
|
message: '上传成功!',
|
type: 'success'
|
});
|
// row[filenamefield] =decodeURI(fileobj.row[0].name);
|
// row[fileidfield] = fileobj.row[0].id;
|
if (callback) {
|
callback()
|
}
|
if (popupcallback) {
|
popupcallback();
|
}
|
}
|
};
|
this.doPopupByPublic(config);
|
},
|
|
|
}
|
});
|
};
|
|
loadJsCss(function () {
|
initVue();
|
});
|
</script>
|
<style>
|
/* 在vue.js中 v-cloak 这个指令是防止页面加载时出现 vuejs 的变量名而设计的 */
|
[v-cloak] {
|
display: none !important;
|
}
|
.h_valid_to td.el-table__cell{
|
background-color: #e5b506 !important;
|
}
|
.el-tabs__nav-scroll {
|
overflow: hidden;
|
position: relative;
|
padding-left: 20px;
|
}
|
</style>
|
|
</head>
|
|
<body style="margin: 0px;">
|
<div v-cloak id="vbody">
|
<div id="page_root">
|
<div class="topbar">
|
<span :class="page_title == 'right' ? 'h_page_title_right' : 'h_page_title_left'"><span class="h_page_title_txt">{{title}}</span></span>
|
|
<div :class="page_title == 'right' ? 'h_page_button_left' : 'h_page_button_right'">
|
<el-button-group style="margin-left: 3px;">
|
<el-button v-show="cbuttons_r.import && selectTabObj.code == 'Input'" @click="DownloadTemplate">模板下载</el-button>
|
<el-button v-show="cbuttons_r.import && selectTabObj.code == 'Input'" @click="onPopupByUploadFile":icon="buttonsconfig.import.icon">{{buttonsconfig.import.name}}</el-button>
|
<el-button v-show="cbuttons_r.onDownload" type="primary" @click="onDownload" :icon="buttonsconfig.export.icon">{{buttonsconfig.export.name}}</el-button>
|
</el-button-group>
|
</div>
|
</div>
|
<div>
|
<el-tabs v-model="activeTabName" @tab-click="handleClick">
|
<el-tab-pane v-for="(tab, k) in tabs" :label="tab.name" :name="tab.code" :key="k"></el-tab-pane>
|
</el-tabs>
|
</div>
|
|
<!-- <div class="topbar-line">
|
<div class="query-icon">
|
<i class="iconfont icon-query"></i>
|
</div>
|
<div class="query-bar">
|
<h-form-filter v-if="selectTabObj.filterFields" ref="form1"
|
:form-attr="filterAttr"
|
:table-fields="selectTabObj.filterFields"
|
:form-data="selectTabObj.filterObj"
|
:table-field-click="selectTabObj.filterfieldClick"
|
|
v-on:on-query="onQuery"
|
v-on:on-init-query="onInitFilter"
|
v-on:on-edit-query="onEditFilter"
|
>
|
</h-form-filter>
|
</div>
|
</div> -->
|
|
<div class="h_dialog__body">
|
<h-table
|
v-if="isRefresh && selectTabObj.tableFields"
|
ref="table1"
|
:table-fields="selectTabObj.tableFields"
|
:table-data="selectTabObj.tableData"
|
:is-edit-table-data="selectTabObj.isEditTableData"
|
:pagesize="selectTabObj.pagesize"
|
:pagenum="selectTabObj.pagenum"
|
:total="selectTabObj.total"
|
:table-height="selectTabObj.tableHeight"
|
:table-field-click="selectTabObj.tablefieldClick"
|
:is-show-index="selectTabObj.isShowIndex"
|
:is-highlight-row="true"
|
:table-buttons-click="selectTabObj.tablebuttonClick"
|
:filtersobj="selectTabObj.filterObj"
|
|
v-on:get-data="getData"
|
v-on:edit-data="editData"
|
v-on:row-click="rowClick"
|
>
|
</h-table>
|
</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>
|