<!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 FormVue({
|
el: "#vbody",
|
data: {
|
dataname: "md_hospital",
|
title: "医院管理",
|
|
dataRequest : [],
|
dataRequestObj:{},
|
|
//医院管理信息
|
formAttr: {
|
istitle: false,
|
title: "表单名称",
|
columnnumber: 2,
|
labelwidth: "140px",
|
labelposition: "left",//"left",// right//top
|
size: "mini",
|
border: "5px solid #c6c6c600"
|
},
|
formFields: [],
|
newformData: {
|
state_code: "Open",
|
state_name: "生效",
|
creator: window.top.vue.userinfo.id,
|
is_ka: true,
|
is_target: true,
|
year: "2023",
|
},
|
formData: {},
|
formfieldClick: {},
|
|
//按键权限设置
|
isedit: false,//提交前编辑,保存/提交
|
isrefuseedit: false,//拒绝后编辑,保存/再次提交
|
isapproval: false,//审批,同意/拒绝/转办/退回
|
iscommit: false,//提交标记
|
loading_save: false,
|
|
//弹窗参数
|
popupParames: {},
|
|
//审批相关变量
|
loading_pass: false,
|
reasonvisible:false,//审批通过或拒绝填写原因
|
textarea2: "",//填写理由
|
passOrRefuse:false,
|
|
//高度
|
p_height: null,
|
|
//岗位、区域等相关数据
|
save_range : null,
|
save_superior_position_code : null,
|
|
//填写变更原因的弹窗
|
need_remark: false,//变更申请弹窗显示
|
formFields_remark:[//填写变更原因
|
{isshow: "T", required: true, field: "remark", name: "变更原因", inputtype: "textarea"},
|
],
|
formAttr_remark: {//变更申请弹窗属性
|
columnnumber: 1,
|
labelwidth: "100px",
|
labelposition: "left",//"left",// right//top
|
size: "mini",
|
border: "10px solid #c6c6c600",
|
},
|
|
//变更相关
|
dataname_change: "md_hospital_apply",
|
// dataname_bussiness: "md_hospital_apply_business",//非销售新增提交dataname
|
dataname_bussiness: "md_hospital_apply_business_change",//非销售变更提交dataname
|
old_form: {},//变更前数据
|
result_meta: {},
|
loading_pass: false,
|
formFields_change: [//变更头字段
|
{isshow: "T", field: "remark", name: "变更原因", inputtype: "span"},
|
],
|
formData_change: {},//变更头信息
|
formfieldchangeClick: {},
|
showMark: "noMark",
|
|
//判断是否销售
|
isSales: false,//销售人员(销售代表、大区经理、小区经理)
|
isRegionR: false,//大区经理,
|
|
//VS
|
isOldContrast: false,
|
oldformData: {},
|
},
|
created() {
|
if (window.top.vue.userinfo) {
|
|
if (window.top.vue.userinfo.currentactor && window.top.vue.userinfo.currentactor.code) {
|
if (window.top.vue.userinfo.currentactor.code == "Capacity-Sale" || window.top.vue.userinfo.currentactor.code == "Capacity-Region-R" || window.top.vue.userinfo.currentactor.code == "Capacity-Region-M") {
|
//销售
|
this.isSales = true;
|
|
//大区经理
|
if(window.top.vue.userinfo.currentactor.code == "Capacity-Region-R") {
|
this.isRegionR = true;
|
}
|
|
//如果是销售,保存区和岗位
|
if(window.top.vue.userinfo && window.top.vue.userinfo.employee && window.top.vue.userinfo.employee.range) {
|
this.save_range = window.top.vue.userinfo.employee.range;
|
this.save_superior_position_code = window.top.vue.userinfo.employee.positions[0].code;
|
}
|
}
|
}
|
}
|
|
//弹窗
|
this.popupParames = clone(Root.popupParames);
|
this.title = this.popupParames.title || this.popupParames.text;
|
if (this.popupParames.data && this.popupParames.sceneCode) {
|
if (this.popupParames.sceneCode == 'change' || this.popupParames.sceneCode == 'browse') {
|
this.formData = clone(this.popupParames.data);
|
}
|
else {
|
this.formData_change = clone(this.popupParames.data);
|
}
|
}
|
|
//弹窗sceneCode
|
if (this.popupParames.sceneCode) {
|
console.log(this.popupParames.sceneCode);
|
if (this.popupParames.sceneCode == "add") {//新增
|
this.isedit = true;
|
}
|
else if (this.popupParames.sceneCode == "change") {//变更
|
this.isedit = true;
|
this.old_form = clone(this.popupParames.data);
|
this.need_remark = true;
|
}
|
else if (this.popupParames.sceneCode == "infoChange_browse") {//变更只读
|
this.formAttr.disabled = true;
|
}
|
else if (this.popupParames.sceneCode == "reEdit") {//退回编辑
|
this.isedit = true;
|
}
|
else if (this.popupParames.sceneCode == "approval") {//审批
|
this.formAttr.disabled = true;
|
this.isapproval = true;
|
//VS
|
this.isOldContrast = true;
|
//获取当前生效数据
|
if (this.formData_change.host_id) {
|
var getOldEntity_ = {
|
name: "org_hospital_old",
|
url: "root/data/getEntity",
|
paramsobj: {
|
dataname: this.dataname,
|
id: this.formData_change.host_id,
|
},
|
isnotoption: true, //true:不是选项
|
}
|
this.dataRequest.push(getOldEntity_);
|
}
|
}
|
|
else if (this.popupParames.sceneCode == "browse") {//只读
|
this.formAttr.disabled = true;
|
}
|
|
//新增、变更申请创建
|
if (this.popupParames.sceneCode == "add" || this.popupParames.sceneCode == "change") {
|
var newEntity_apply = {
|
name: "newChangeEntity",
|
url: "root/data/newEntity",
|
paramsobj: {
|
dataname: this.dataname_change,
|
},
|
isnotoption: true, //true:不是选项
|
}
|
this.dataRequest.push(newEntity_apply);
|
//新增
|
if(this.popupParames.sceneCode == "add") {
|
var newEntity_hospital = {
|
name: "newAddEntity",
|
url: "root/data/newEntity",
|
paramsobj: {
|
dataname: this.dataname,
|
},
|
isnotoption: true, //true:不是选项
|
}
|
this.dataRequest.push(newEntity_hospital);
|
}
|
}
|
|
//变更只读、审批、退回编辑时getEntity
|
if (this.popupParames.sceneCode == "infoChange_browse" || this.popupParames.sceneCode == "approval" || this.popupParames.sceneCode == "reEdit") {
|
var getEntity_ = {
|
name: "getChangeEntity",
|
url: "root/data/getEntity",
|
paramsobj: {dataname: this.dataname_change, id: this.formData_change.id, host_id: this.formData_change.host_id},
|
isnotoption: true, //true:不是选项
|
}
|
this.dataRequest.push(getEntity_);
|
}
|
|
//变更,变更查看/审批时,显示变更原因
|
if (this.popupParames.sceneCode == "change" || this.formData_change.remark) {
|
this.showMark = "showMark";
|
}
|
}
|
},
|
|
mounted() {
|
var me = this;
|
|
me.p_height = document.documentElement.clientHeight*1 - 91;
|
//预加载数据
|
if (this.dataRequest && this.dataRequest.length) {
|
var result = {};
|
this.loadRequestData(this.dataRequest, result, function(data) {
|
me.dataRequestObj = data;
|
var result_meta_ = null;
|
//预加载数据后给哪些字段设置options或formatterjson
|
|
//变更、新增
|
if (me.dataRequestObj.newChangeEntity) {
|
var formData_change_ = clone(me.dataRequestObj.newChangeEntity.data[me.dataname_change]);
|
//变更时
|
if(me.old_form && me.old_form.id && me.old_form.code && me.old_form.name) {
|
formData_change_.host_id = me.old_form.id;
|
formData_change_.hospital_code = me.old_form.code;
|
formData_change_.hospital_name = me.old_form.name;
|
if(me.isSales) {
|
formData_change_.type_code = "changeSale";
|
formData_change_.type_name = "医院管理销售变更";
|
} else {
|
formData_change_.type_code = "changeBusiness";
|
formData_change_.type_name = "医院管理商务变更";
|
}
|
}
|
|
//新增
|
if (me.dataRequestObj.newAddEntity) {
|
var formData_hospital = clone(me.dataRequestObj.newAddEntity.data[me.dataname]);
|
if (me.newformData) {
|
for (var k in me.newformData) {
|
if (!formData_hospital[k]) {
|
formData_hospital[k] = me.newformData[k];
|
}
|
}
|
me.formData = formData_hospital;
|
}
|
formData_change_.host_id = me.formData.id;
|
if(me.isSales) {
|
formData_change_.type_code = "addSale";
|
formData_change_.type_name = "医院管理销售新增";
|
} else {
|
formData_change_.type_code = "addBusiness";
|
formData_change_.type_name = "医院管理商务新增";
|
}
|
}
|
|
formData_change_.create_id = window.top.vue.userinfo.id;
|
formData_change_.create_name = window.top.vue.userinfo.employee ? window.top.vue.userinfo.employee.name : window.top.vue.userinfo.name;
|
|
me.formData_change = formData_change_;
|
}
|
|
//变更查看(退回编辑)、审批
|
else if (me.dataRequestObj.getChangeEntity) {
|
if(me.dataRequestObj.getChangeEntity.host[me.dataname]) {
|
var formData_ = clone(me.dataRequestObj.getChangeEntity.host[me.dataname]);
|
me.formData = formData_;
|
|
if(me.isedit) {
|
if(me.formData.is_ka === null) {
|
me.formData.is_ka = true;
|
}
|
|
if(me.formData.is_target === null) {
|
me.formData.is_target = true;
|
}
|
}
|
}
|
result_meta_ = me.result_meta = me.dataRequestObj.getChangeEntity.host_meta;
|
}
|
|
//VS
|
if (me.dataRequestObj.org_hospital_old) {
|
if (me.dataRequestObj.org_hospital_old.data) {
|
if (me.dataRequestObj.org_hospital_old.data[me.dataname]) {
|
me.oldformData = clone(me.dataRequestObj.org_hospital_old.data[me.dataname]);
|
}
|
}
|
}
|
|
if(me.result_meta) {
|
me.initData(me.result_meta);
|
} else {
|
me.initData();
|
}
|
});
|
}
|
|
else {
|
this.initData();
|
}
|
|
// 以服务的方式调用的 Loading 需要异步关闭
|
this.$nextTick(() => {
|
hideLoading();
|
|
//重新设置弹窗宽高
|
this.$nextTick(function(){
|
//let w_ = this.$refs.popup_body.offsetWidth + "px";
|
let w_ = "1200px";
|
let h_ = this.$refs.popup_body.offsetHeight + "px";
|
Root.setPopupWH(w_, h_);
|
})
|
});
|
},
|
|
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();
|
}
|
},
|
|
//关闭前调回调
|
saveAfter() {
|
var me = this;
|
if(this.popupParames.callback) {
|
let obj = {
|
//row: this.formData
|
}
|
this.popupParames.callback(obj, function() {
|
me.closeDialog();
|
});
|
}
|
else {
|
me.closeDialog();
|
}
|
},
|
|
initData(result_meta_) {
|
let me = this;
|
var id_ = null;
|
//已经有变更文件的会自动返回meta
|
if (this.popupParames.sceneCode == "approval" || this.popupParames.sceneCode == "infoChange_browse" || this.popupParames.sceneCode == "reEdit") {
|
if (result_meta_ && result_meta_[me.dataname] && result_meta_[me.dataname].fields) {
|
var metas = clone(result_meta_[me.dataname].fields);
|
var formFields_ = [];
|
|
metas.map(f=>{
|
f.isshow = "T";
|
if(me.isedit == true) {
|
if(f.field == "year" || f.field == "month" || f.field == "name" || f.field == "code" || f.field == "offices" || f.field == "open_date" || f.field == "position_name" || f.field == "position_code" || f.field == "employee_name" || f.field == "employee_code" || f.field == "is_ka" || f.field == "is_target" || f.field == "distributor" || f.field == "therapy_person" || f.field == "memo" || f.field == "status_code"){
|
formFields_.push(clone(f));
|
}
|
}
|
else {
|
if(f.field != "resp_prod")
|
formFields_.push(clone(f));
|
}
|
})
|
if (!me.formFields || (me.formFields && me.formFields.length == 0)) {
|
me.formFields = clone(formFields_);
|
//字段数组转字段obj,目的为了筛选时获取字段属性
|
me.fieldsToFieldsObj();
|
}
|
}
|
return
|
}
|
|
//首次变更时需要获取当前生效版本的数据
|
else if (this.formData.id) {
|
id_ = this.formData.id;
|
}
|
console.log(id_);
|
this.getRowDataById(id_, function(result) {//查询后的回调,用于获取字段的
|
if (result.meta && result.meta[me.dataname] && result.meta[me.dataname].fields) {
|
var metas = clone(result.meta[me.dataname].fields);
|
var formFields_ = [];
|
|
metas.map(f=>{
|
f.isshow = "T";
|
|
//医院管理变更时,不可更换医院
|
if (f.field == "name") {
|
if(me.popupParames.sceneCode == "change") {
|
f.readonly = true;
|
}
|
}
|
|
if(me.isedit == true) {
|
if(f.field == "year" || f.field == "month" || f.field == "name" || f.field == "code" || f.field == "offices" || f.field == "open_date" || f.field == "position_name" || f.field == "position_code" || f.field == "employee_name" || f.field == "employee_code" || f.field == "is_ka" || f.field == "is_target" || f.field == "distributor" || f.field == "therapy_person" || f.field == "memo" || f.field == "status_code"){
|
formFields_.push(clone(f));
|
}
|
}
|
|
else {
|
if(f.field != "resp_prod")
|
formFields_.push(clone(f));
|
}
|
})
|
|
// formFields_.map(e=>{
|
// if(e.field == "resp_prod") {
|
// e.options = me.dataRequestObj.category;
|
// // console.log("true");
|
// }
|
// })
|
|
if (!me.formFields || (me.formFields && me.formFields.length == 0)) {
|
me.formFields = clone(formFields_);
|
}
|
|
//字段数组转字段obj,目的为了筛选时获取字段属性
|
me.fieldsToFieldsObj();
|
|
//设置字段事件
|
me.tableFieldClick();
|
}
|
|
if (me.rowData[me.dataname]) {
|
me.formData = me.rowData[me.dataname];
|
}
|
else {
|
var formData_ = getDataByFields(me.formData, me.formFields);
|
me.formData = clone(formData_);
|
}
|
|
if(me.isedit) {
|
if(me.formData.is_ka === null) {
|
me.formData.is_ka = true;
|
}
|
|
if(me.formData.is_target === null) {
|
me.formData.is_target = true;
|
}
|
}
|
})
|
},
|
|
//填写变更原因的弹窗
|
setChangeForm() {
|
var me = this;
|
var bo_form_change = this.$refs.form_temp.checkForm();
|
if (!bo_form_change) {
|
Root.message({
|
type: 'error',
|
message: '请填写必填项'
|
});
|
return
|
}
|
me.need_remark = false;
|
},
|
|
tableFieldClick() {
|
var me = this;
|
|
//表单字段事件设置
|
this.formfieldClick = {
|
name: {
|
popup: {
|
onclick: function(obj) {//弹窗点击事件
|
//打开
|
me.tablePopup_terminalList()
|
}
|
},
|
},
|
distributor: {
|
popup: {
|
onclick: function(obj) {//弹窗点击事件
|
//打开
|
me.tablePopup_customerlist()
|
}
|
},
|
},
|
therapy_person: {
|
popup: {
|
onclick: function(obj) {//弹窗点击事件
|
//打开
|
me.tablePopup_employeelist()
|
}
|
},
|
},
|
employee_name: {
|
popup: {
|
onclick: function(obj) {//弹窗点击事件
|
//打开
|
me.tablePopup_positionlist()
|
}
|
},
|
},
|
|
status_code: {
|
select: {
|
onchange: function(obj) {
|
console.log(obj);
|
var formData_ = clone(me.formData);
|
|
formData_.status_name = formData_.status_code;
|
|
me.formData = formData_;
|
}
|
}
|
}
|
};
|
},
|
|
//负责销售
|
tablePopup_positionlist(obj){
|
var me = this;
|
var filter_temp = "1 = 1";
|
if(me.save_superior_position_code) {
|
filter_temp = "(superior_position_code = '" + me.save_superior_position_code + "' or code = '" + me.save_superior_position_code + "')";
|
}
|
|
Root.showPopup({
|
url: "module/md/page/terminal/page/popup_position_list.html",
|
width: 1200,
|
height: 600,
|
data: {},
|
filter: filter_temp,
|
dataname: "",
|
sceneCode: "add",
|
callback: function(obj, callback) {
|
let formData_ = clone(me.formData);
|
// formData_.employee_name = obj.row.remark;
|
formData_.position_name = obj.row.name;
|
formData_.position_code = obj.row.code;
|
formData_.employee_name = obj.row.employee_name;
|
formData_.employee_code = obj.row.employee_code;
|
|
//大区、小区
|
// formData_.region_big = obj.row.region_name;
|
// formData_.region_small = obj.row.area_name;
|
|
console.log(obj.row.remark)
|
|
me.formData = formData_;
|
if (callback) {
|
callback();
|
}
|
}
|
});
|
},
|
|
// 疗法专员,md_employee
|
tablePopup_employeelist(obj){
|
var me = this;
|
var filter_temp = "position_name = '疗法推广专员'";
|
if(me.save_range) {
|
filter_temp += "and md_employee.range = '" + me.save_range + "'";
|
}
|
|
Root.showPopup({
|
url: "module/md/page/terminal/page/popup_employee_list.html",
|
width: 1200,
|
height: 600,
|
data: {},
|
// dataname: "",
|
filter: filter_temp,
|
sceneCode: "add",
|
callback: function(obj, callback) {
|
let formData_ = clone(me.formData);
|
formData_.therapy_person_code = obj.row.code;
|
formData_.therapy_person = obj.row.name;
|
formData_.therapy_position_code = obj.row.position_code;
|
formData_.therapy_position_name = obj.row.position_name;
|
|
me.formData = formData_;
|
if (callback) {
|
callback();
|
}
|
}
|
});
|
},
|
|
//医院库
|
tablePopup_terminalList(obj) {
|
var me = this;
|
Root.showPopup({
|
url: "module/md/page/terminal/page/popup-new_hospital-terminal.html",
|
width: 1200,
|
height: 600,
|
data: {},
|
filter:"state_code = 'Open'",
|
sceneCode: "add",
|
callback: function(obj, callback) {
|
let formData_ = clone(me.formData);
|
|
formData_.name = obj.row.name;
|
formData_.code = obj.row.code;
|
|
formData_.credit_code = obj.row.credit_code;
|
formData_.shortname = obj.row.shortname;
|
formData_.zip_code = obj.row.zip_code;
|
formData_.grade = obj.row.grade;
|
formData_.level = obj.row.level;
|
formData_.category = obj.row.category;
|
formData_.hospital_group = obj.row.hospital_group;
|
formData_.province = obj.row.province;
|
formData_.city = obj.row.city;
|
formData_.county = obj.row.county;
|
formData_.address = obj.row.address;
|
formData_.longitude = obj.row.longitude;
|
formData_.latitude = obj.row.latitude;
|
formData_.is_disable = obj.row.is_disable;
|
formData_.status_code = obj.row.status_code;
|
formData_.status_name = obj.row.status_name;
|
|
|
let formData_temp = clone(me.formData_change);
|
//新增医院管理时
|
formData_temp.hospital_code = obj.row.code;
|
formData_temp.hospital_name = obj.row.name;
|
|
// formData_.id = obj.row.code;//为id赋值为code
|
|
me.formData_change = formData_temp;
|
me.formData = formData_;
|
|
if (callback) {
|
callback();
|
}
|
}
|
});
|
},
|
|
//配送商
|
tablePopup_customerlist(obj) {
|
var me = this;
|
Root.showPopup({
|
url: "module/md/page/terminal/page/popup_customer_list.html",
|
width: 1200,
|
height: 600,
|
data: {},
|
filter: "actor='Distributor' and state_code = 'Complete'",
|
// this.oldObj
|
dataname: "customer",
|
sceneCode: "add",
|
callback: function(obj, callback) {
|
let formData_ = clone(me.formData);
|
formData_.distributor = obj.row.name;
|
|
me.formData = formData_;
|
if (callback) {
|
callback();
|
}
|
}
|
});
|
},
|
|
//提交
|
submitRowTable() {
|
this.iscommit = true;
|
this.saveRowTable();
|
},
|
|
//保存
|
saveRowTable() {
|
var me = this;
|
me.loading_save = true;
|
|
var operator_ = "saveEntity";//保存
|
if(me.iscommit) {
|
operator_ = "commit";//提交
|
}
|
|
//必填项校验
|
var bo1 = this.$refs.form1.checkForm();
|
if(!bo1){
|
Root.message({
|
type: 'error',
|
message: '请填写必填项'
|
});
|
this.iscommit = false;
|
return;
|
}
|
|
//formData
|
var entity_ = clone(this.formData);
|
var entity = {};
|
for (var r in entity_) {
|
if (r != "create_time" && r != "update_time") {//后端不让传时间的字段,空值也不可以
|
if (entity_[r] || entity_[r] === false) {
|
entity[r] = entity_[r];
|
if(r == "employee_code") {
|
me.formData_change[r] = entity_[r];
|
} else if(r == "employee_name") {
|
me.formData_change[r] = entity_[r];
|
} else if(r == "offices") {
|
me.formData_change[r] = entity_[r];
|
}
|
}
|
}
|
}
|
|
//formData_change
|
var entity_change = clone(me.formData_change);
|
var entityChange = {};
|
for (var r in entity_change) {
|
if(r != 'create_time' && r != 'update_time' && r != 'doc_date') {//后端不让传时间的字段,空值也不可以
|
if (entity_change[r]) {
|
entityChange[r] = entity_change[r];
|
}
|
}
|
}
|
|
var param = {
|
dataname: "",
|
data: {},
|
host: {},
|
}
|
param.host[me.dataname] = entity;
|
|
if(me.isSales) {//销售
|
param.dataname = me.dataname_change;
|
param.data[me.dataname_change] = entityChange;
|
} else {//非销售(商务)
|
param.dataname = me.dataname_bussiness;
|
param.data[me.dataname_bussiness] = entityChange;
|
// if (me.popupParames.sceneCode == 'change') {
|
// param.dataname = me.dataname_bussiness_change;
|
// param.data[me.dataname_bussiness_change] = entityChange;
|
// } else {
|
// param.dataname = me.dataname_bussiness;
|
// param.data[me.dataname_bussiness] = entityChange;
|
// }
|
}
|
|
Server.call("root/data/" + operator_, param, function(result) {
|
console.log(result);
|
if (result.success) {
|
if(me.iscommit){
|
me.iscommit = false;
|
Root.message({
|
type: 'success',
|
message: '提交成功'
|
});
|
me.saveAfter();
|
}
|
else {
|
me.loading_save = false;
|
Root.message({
|
type: 'success',
|
message: '保存成功'
|
});
|
me.saveAfter();
|
}
|
}
|
}, function(errorresult) {
|
console.log("错误信息", errorresult);
|
if (errorresult.messages && errorresult.messages.count && errorresult.messages.count.error) {
|
if (errorresult.messages.list) {
|
var config = {
|
totab: false,
|
// width: "1200px",
|
// height: 800,
|
icon: "icon-product",
|
text: "错误信息",
|
url: "module/tool/page/popup_error_messages.html",
|
data: {},
|
delta: errorresult.messages.list,
|
callback: function(obj, callback) {
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
}
|
}
|
else {
|
if(me.iscommit) {
|
me.iscommit = false;
|
Root.message({
|
type: 'error',
|
message: '提交失败'
|
});
|
}
|
else {
|
me.loading_save = false;
|
Root.message({
|
type: 'error',
|
message: '保存失败'
|
});
|
}
|
}
|
});
|
},
|
|
//审批通过相关数据赋值
|
onPassApproval(){
|
this.textarea2 = "";
|
this.reasonvisible = true;
|
this.passOrRefuse = true;
|
},
|
|
//审批拒绝相关数据赋值
|
onRefuseApproval(){
|
this.textarea2 = "";
|
this.reasonvisible = true;
|
this.passOrRefuse = false;
|
},
|
|
//保存通过/拒绝原因
|
saveReason(){
|
this.loading_pass = true;
|
if(this.passOrRefuse){
|
this.doPassApproval(true);
|
}else{
|
if(this.textarea2 != ""){
|
this.doPassApproval(false);
|
}
|
else{
|
Root.message({
|
type: 'warning',
|
message: '请填写原因'
|
});
|
this.loading_pass = false;
|
}
|
}
|
},
|
|
//审批通过/拒绝,waiting
|
doPassApproval(bo) {
|
var me = this;
|
var state_ = "approve"
|
if (!bo) {
|
state_ = "reject"
|
}
|
|
let param = {
|
dataname: me.dataname_change,
|
id: me.formData_change.id,
|
remark: me.textarea2,
|
}
|
if (me.formData_change.type_code && (me.formData_change.type_code == 'changeBusiness' || me.formData_change.type_code == 'addBusiness')) {
|
param.dataname = me.dataname_bussiness;
|
}
|
|
Server.call("root/data/" + state_, param, function(result) {
|
me.loading_pass = false;
|
console.log(result);
|
if (bo) {
|
if(result.success) {
|
Root.message({
|
type: 'success',
|
message: '审批成功'
|
});
|
}
|
me.saveAfter();
|
}
|
else {
|
if(result.success) {
|
Root.message({
|
type: 'success',
|
message: '已拒绝'
|
});
|
}
|
me.saveAfter();
|
}
|
}, function(errorresult) {
|
console.log("错误信息", errorresult);
|
me.loading_pass = false;
|
if (errorresult.messages && errorresult.messages.count && errorresult.messages.count.error) {
|
if (errorresult.messages.list) {
|
var config = {
|
totab: false,
|
// width: "1200px",
|
// height: 800,
|
icon: "icon-product",
|
text: "错误信息",
|
url: "module/tool/page/popup_error_messages.html",
|
data: {},
|
delta: errorresult.messages.list,
|
callback: function(obj, callback) {
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
}
|
}
|
else {
|
Root.message({
|
type: 'error',
|
message: '审批失败'
|
});
|
}
|
});
|
},
|
}
|
});
|
};
|
|
loadJsCss(function () {
|
initVue();
|
});
|
</script>
|
|
<style>
|
/* 在vue.js中 v-cloak 这个指令是防止页面加载时出现 vuejs 的变量名而设计的 */
|
[v-cloak] {
|
display: none !important;
|
}
|
|
.showMark {
|
margin-bottom: 20px;
|
}
|
</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 style="height: 550px; overflow-y: auto;"> -->
|
<div :style="{height: p_height + 'px', 'overflow-y': 'auto'}">
|
<!-- <div style="margin-top: 20px; padding-left: 25px;">
|
<el-checkbox v-model="isTarget" :disabled= "true">是目标医院</el-checkbox>
|
</div> -->
|
|
<div class="el-dialog__body">
|
<div :class="showMark">
|
<h-form
|
v-if="(showMark === 'showMark')"
|
ref="form_change"
|
:form-attr="formAttr"
|
:table-fields="formFields_change"
|
:form-data="formData_change"
|
:table-field-click="formfieldchangeClick"
|
>
|
</h-form>
|
</div>
|
|
<h-form
|
ref="form1"
|
:form-attr="formAttr"
|
:table-fields="formFields"
|
:form-data="formData"
|
:table-field-click="formfieldClick"
|
|
:is-old-contrast="isOldContrast"
|
:form-data-old="oldformData"
|
>
|
</h-form>
|
|
<el-dialog title="填写原因" :visible.sync="reasonvisible" height="50%">
|
<el-input
|
type="textarea"
|
:autosize="{ minRows: 2, maxRows: 10}"
|
placeholder="请输入原因"
|
v-model="textarea2">
|
</el-input>
|
|
<div slot="footer" class="dialog-footer" >
|
<el-button type="default" @click="reasonvisible = false">取 消</el-button>
|
<el-button type="primary" :loading="loading_pass" @click="saveReason">确 定</el-button>
|
</div>
|
</el-dialog>
|
</div>
|
</div>
|
|
<el-dialog title="填写变更原因" :visible.sync="need_remark"
|
:close-on-press-escape="false"
|
:close-on-click-modal="false"
|
:show-close="false"
|
height="50%">
|
<h-form
|
ref="form_temp"
|
:form-attr="formAttr_remark"
|
:table-fields="formFields_remark"
|
:form-data="formData_change"
|
>
|
</h-form>
|
|
<div slot="footer" class="dialog-footer" >
|
<el-button size="small" type="default" @click="closeDialog">取 消</el-button>
|
<el-button size="small" type="primary" @click="setChangeForm">确 定</el-button>
|
</div>
|
</el-dialog>
|
|
<div class="el-dialog__footer">
|
<el-button size="small" type="default" @click="closeDialog">取 消</el-button>
|
<!-- <el-button size="small" v-if="(isedit || isrefuseedit) && (popupParames.sceneCode != 'change')" type="primary" :loading="loading_save" @click="saveRowTable":icon="buttonsconfig.save.icon">{{buttonsconfig.save.name}}</el-button> -->
|
<el-button size="small" v-if="isedit" type="success" :loading="iscommit" @click="submitRowTable":icon="buttonsconfig.submit.icon">{{buttonsconfig.submit.name}}</el-button>
|
<el-button size="small" v-if="isrefuseedit" type="success" @click="">再次提交</el-button>
|
<el-button size="small" v-if="isapproval" type="danger" @click="onRefuseApproval">拒 绝</el-button>
|
<el-button size="small" v-if="isapproval" type="success" @click="onPassApproval">通 过</el-button>
|
<!-- <el-button size="small" v-if="isapproval" type="primary" @click="">转 办</el-button>
|
<el-button size="small" v-if="isapproval" type="success" @click="">退 回</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>
|