<!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_position_hospital",
|
title: "辖区医院信息",
|
dataRequest: [
|
{
|
name: "md_org_master", // 公司下拉项
|
dataname: "md_org_master",
|
// url: "root/data/newEntity",
|
// paramsobj: {dataname: "md_org_data", type_code:"Distributor"},
|
isnotoption: false, //true:不是选项
|
code:"id",//是下拉选项时设置
|
label:"short_name",//是下拉选项时设置
|
filter: "",
|
orderby: "name"
|
},
|
{
|
name: "md_bu", // BU下拉项
|
dataname: "md_bu_org",
|
// url: "root/data/newEntity",
|
// paramsobj: {dataname: "md_org_data", type_code:"Distributor"},
|
isnotoption: false, //true:不是选项
|
code:"bu_id",//是下拉选项时设置
|
label:"bu_name",//是下拉选项时设置
|
filter: "state_code='Open'",
|
orderby: ""
|
},
|
|
// {
|
// name: "md_bu_product", // 产品下拉项
|
// dataname: "md_bu_product",
|
// isnotoption: false, //true:不是选项
|
// code:"id",//是下拉选项时设置
|
// label:"product_name",//是下拉选项时设置
|
// filter: "",
|
// orderby: "product_name"
|
// },
|
|
// {
|
// name: "md_prod_sku", // SKU下拉项
|
// dataname: "md_prod_sku",
|
// isnotoption: false, //true:不是选项
|
// code:"spec",//是下拉选项时设置
|
// label:"spec",//是下拉选项时设置
|
// filter: "",
|
// orderby: "spec"
|
// },
|
],
|
|
options_md_org_master: [],
|
md_bu_org_obj: {},
|
options_md_bu: [],
|
productobj_map: {},
|
md_bu_product_obj: {},
|
md_bu_product_bu_obj: {},
|
md_prod_sku_obj: {},
|
|
formAttr: {
|
istitle: false,
|
title: "表单名称",
|
columnnumber: 2,
|
labelwidth: "80px",
|
labelposition: "left",//"left",// right//top
|
size: "mini",
|
border: "10px solid #c6c6c600",
|
borderleft: "0px"
|
},
|
|
formFields: [],
|
|
newformData: {
|
state_code: "Input",
|
state_name: "录入",
|
is_active: true,
|
// source: "手动录入",
|
// type_code: "Customer", // Standard标准价目表、Customer经销商价目表
|
},
|
formData: {},
|
|
//按键权限设置
|
isedit: false,//提交前编辑,保存/提交
|
isrefuseedit: false,//拒绝后编辑,保存/再次提交
|
isapproval: false,//审批,同意/拒绝/转办/退回
|
|
iscommit: false,//提交标记
|
|
//弹窗参数
|
popupParames: {},
|
//字段设置
|
tablefieldClick: {},
|
formfieldClick: {},
|
dheight: null,
|
|
agreementdata: {},
|
options_product: [],
|
|
//审批相关变量
|
reasonvisible:false,//审批通过或拒绝填写原因
|
approveremark: '',//填写理由
|
passOrRefuse:false,
|
loading_pass: false,
|
},
|
created() {
|
this.popupParames = clone(Root.popupParames);
|
this.title = this.popupParames.title || this.popupParames.text
|
if (this.popupParames.data) {
|
this.formData = clone(this.popupParames.data);
|
}
|
if (this.popupParames.delta && this.popupParames.delta.dataname) {
|
this.dataname = clone(this.popupParames.delta.dataname);
|
}
|
|
if (this.popupParames.delta && this.popupParames.delta.agreementdata) {
|
this.agreementdata = clone(this.popupParames.delta.agreementdata);
|
}
|
if (this.popupParames.delta && this.popupParames.delta.options_product) {
|
this.options_product = clone(this.popupParames.delta.options_product);
|
}
|
|
if (this.popupParames.sceneCode) {
|
if (this.popupParames.sceneCode == "add") {//新增
|
var newEntity_ = {
|
name: "newEntity",
|
url: "root/data/newEntity",
|
paramsobj: {dataname: this.dataname},
|
isnotoption: true, //true:不是选项
|
}
|
this.dataRequest.push(newEntity_);
|
for (var k in this.popupParames.data) {
|
this.newformData[k] = this.popupParames.data[k]
|
}
|
this.isedit = true;
|
}
|
else if (this.popupParames.sceneCode == "addbyagreement") {// 固定经销商新增
|
var newEntity_ = {
|
name: "newEntity",
|
url: "root/data/newEntity",
|
paramsobj: {dataname: this.dataname},
|
isnotoption: true, //true:不是选项
|
}
|
this.dataRequest.push(newEntity_);
|
for (var k in this.popupParames.data) {
|
this.newformData[k] = this.popupParames.data[k]
|
}
|
this.isedit = true;
|
}
|
else if (this.popupParames.sceneCode == "browse") {//只读
|
this.formAttr.disabled = true;
|
}
|
else if (this.popupParames.sceneCode == "edit" || this.popupParames.sceneCode == "editbyagreement") {//编辑
|
this.isedit = true;
|
}
|
else if (this.popupParames.sceneCode == "approval") {//审批
|
this.formAttr.disabled = true;
|
this.isapproval = true;
|
}
|
else if (this.popupParames.sceneCode == "refuseedit") {//拒绝后的编辑
|
this.isrefuseedit = true;
|
}
|
}
|
},
|
|
mounted() {
|
var me = this;
|
var title_h = 0;
|
if (me.popupParames.totab){
|
title_h = 42;
|
}
|
me.dheight = document.documentElement.clientHeight - 50 - title_h;
|
//预加载数据
|
if (this.dataRequest && this.dataRequest.length) {
|
var result = {};
|
this.loadRequestData(this.dataRequest, result, function(data) {
|
me.dataRequestObj = data;
|
//预加载数据后给哪些字段设置options或formatterjson
|
if (me.dataRequestObj.newEntity) {
|
var formData = clone(me.dataRequestObj.newEntity.data[me.dataname]);
|
if (me.newformData) {
|
let formData_ = clone(formData);
|
|
for (var k in me.newformData) {
|
if (!formData_[k]) {
|
formData_[k] = me.newformData[k];
|
}
|
}
|
|
me.formData = formData_;
|
}
|
}
|
// 公司下拉
|
if (me.dataRequestObj.md_org_master) {
|
me.options_md_org_master = me.dataRequestObj.md_org_master
|
}
|
|
if (me.dataRequestObj.md_bu) {
|
// exists_account
|
var md_bu_org_obj_ = {};
|
var options_md_bu = [];
|
var md_bu_list = clone(me.dataRequestObj.md_bu);
|
md_bu_list.map(bl=>{
|
if (!md_bu_org_obj_[bl.company_id]) {
|
md_bu_org_obj_[bl.company_id] = [];
|
}
|
md_bu_org_obj_[bl.company_id].push(bl);
|
})
|
me.md_bu_org_obj = clone(md_bu_org_obj_)
|
// me.options_md_bu = me.dataRequestObj.md_bu;
|
}
|
|
// 产品下拉
|
// options_tree_product
|
if (me.dataRequestObj.md_bu_product) {
|
var md_bu_product_array_ = clone(me.dataRequestObj.md_bu_product);
|
var md_bu_product_obj_ = {};
|
var productobj_map_ = {};
|
|
md_bu_product_array_.map(p=>{
|
if (!md_bu_product_obj_[p.bu_id]) {
|
md_bu_product_obj_[p.bu_id] = {
|
children: [],
|
}
|
}
|
var p_ = {
|
code: p.product_id,
|
value: p.product_name
|
}
|
productobj_map_[p.product_id] = p.product_name;
|
md_bu_product_obj_[p.bu_id].children.push(p_);
|
})
|
me.md_bu_product_obj = clone(md_bu_product_obj_)
|
me.productobj_map = clone(productobj_map_);
|
}
|
|
// SKU下拉
|
if (me.dataRequestObj.md_prod_sku) {
|
var md_prod_sku_array_ = clone(me.dataRequestObj.md_prod_sku);
|
var md_prod_sku_obj_ = {}
|
|
md_prod_sku_array_.map(sku=>{
|
if (!md_prod_sku_obj_[sku.product_id]) {
|
md_prod_sku_obj_[sku.product_id] = []
|
}
|
var sku_ = {
|
code: sku.spec,
|
value: sku.spec,
|
id: sku.id,
|
}
|
md_prod_sku_obj_[sku.product_id].push(sku_);
|
})
|
me.md_prod_sku_obj = md_prod_sku_obj_;
|
}
|
|
me.initData();
|
});
|
}
|
else {
|
this.initData();
|
}
|
|
// 以服务的方式调用的 Loading 需要异步关闭
|
this.$nextTick(() => {
|
hideLoading();
|
});
|
},
|
|
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() {
|
let me = this;
|
var id_ = null;
|
if (this.formData.id) {
|
id_ = this.formData.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 == "company_id") {
|
// f.isshow = "F";
|
f.options = me.options_md_org_master
|
}
|
|
if (f.field == "product_id") {
|
f.props = {label: "value", value: "code", multiple: false};
|
if (me.options_product.length) {
|
f.options = clone(me.options_product);
|
}
|
else if (me.formData.bu_id) {
|
f.options = clone(me.md_bu_product_obj[me.formData.bu_id].children);
|
}
|
else {
|
f.options = [];
|
}
|
}
|
|
// if (f.field == "parent_id" && me.popupParames.sceneCode == "addbyagreement") {
|
// f.disabled = true;
|
// }
|
if (f.field == "customer_name" && (me.popupParames.sceneCode == "addbyagreement" || me.popupParames.sceneCode == "editbyagreement")) {
|
f.disabled = true;
|
}
|
if ((f.field == "date_from" || f.field == "date_to") && (me.popupParames.sceneCode == "addbyagreement" || me.popupParames.sceneCode == "editbyagreement")) {
|
f.isshow = false;
|
}
|
|
formFields_.push(clone(f));
|
})
|
if (!me.formFields || (me.formFields && me.formFields.length == 0)) {
|
me.formFields = clone(formFields_);
|
|
//字段数组转字段obj,目的为了筛选时获取字段属性
|
me.fieldsToFieldsObj();
|
|
//设置字段事件
|
me.tableFieldClick();
|
}
|
|
if (me.formData.product_id) {
|
var select_p_ = [me.formData.product_id];
|
me.formData.product_id = clone(select_p_);
|
|
var formFields_ = clone(me.formFields);
|
formFields_.map(f=>{
|
if (f.field == "spec") {
|
if (me.formData.product_id) {
|
f.options = clone(me.md_prod_sku_obj[me.formData.product_id[0]]);
|
}
|
else {
|
f.options = [];
|
}
|
}
|
})
|
me.formFields = clone(formFields_);
|
}
|
|
|
}
|
})
|
},
|
|
tableFieldClick() {
|
var me = this;
|
//表单字段事件设置
|
this.formfieldClick = {
|
company_id:{//字段事件设置
|
select: {
|
onchange: function(obj, refreshCallback) {//下拉展开事件
|
obj.data.company_id = obj.selectoption.code || "";
|
obj.data.company_name = obj.selectoption.value || "";
|
obj.data.bu_id = "";
|
obj.data.bu_name = "";
|
|
obj.data.hospital_id = "";
|
obj.data.department = "";
|
obj.data.md_hospital__name = "";
|
|
obj.data.position_id = "";
|
obj.data.md_position_hierarchy__position_path = "";
|
obj.data.md_position_hierarchy__employee_name = "";
|
refreshCallback();
|
},
|
},
|
},
|
bu_id: {//字段事件设置
|
visible: { //标识二:点击太快会导致加载不出来,待解决
|
onchange: function(obj,row,callback) {//下拉展开事件
|
if (me.formData.company_id) {
|
var formFields_ = clone(me.formFields);
|
formFields_.map(f=>{
|
if (f.field == "bu_id") {
|
if (me.md_bu_org_obj[me.formData.company_id] && me.md_bu_org_obj[me.formData.company_id].length) {
|
f.options = clone(me.md_bu_org_obj[me.formData.company_id])
|
}
|
}
|
})
|
me.formFields = clone(formFields_);
|
}
|
}
|
},
|
select: {
|
onchange: function(obj,refreshCallback) {//下拉展开事件
|
obj.data.bu_id = obj.selectoption.code || "";
|
obj.data.bu_name = obj.selectoption.value || "";
|
|
obj.data.hospital_id = "";
|
obj.data.department = "";
|
obj.data.md_hospital__name = "";
|
|
obj.data.position_id = "";
|
obj.data.md_position_hierarchy__position_path = "";
|
obj.data.md_position_hierarchy__employee_name = "";
|
},
|
},
|
},
|
hospital_id: {
|
popup: {
|
onclick: function(obj) {//弹窗点击事件
|
if (!me.formData.company_id) {
|
Root.message({
|
type: 'warning',
|
message: '请先选择公司'
|
});
|
return
|
}
|
if (!me.formData.bu_id) {
|
Root.message({
|
type: 'warning',
|
message: '请先选择BU'
|
});
|
return
|
}
|
//打开开户库弹窗
|
me.openHospital("add", obj, function(popupobj){
|
let row_ = clone(me.formData);
|
row_.hospital_id = popupobj.row.hospital_id;
|
row_.department = popupobj.row.department ? popupobj.row.department : "--";
|
row_.md_hospital__name = popupobj.row.hospital_name;
|
|
me.formData = clone(row_);
|
});
|
}
|
},
|
},
|
position_id: {
|
popup: {
|
onclick: function(obj) {//弹窗点击事件
|
if (!me.formData.company_id) {
|
Root.message({
|
type: 'warning',
|
message: '请先选择公司'
|
});
|
return
|
}
|
if (!me.formData.bu_id) {
|
Root.message({
|
type: 'warning',
|
message: '请先选择BU'
|
});
|
return
|
}
|
|
//打开开户库弹窗
|
me.openPositionTree("add", function(popupobj){
|
let row_ = clone(me.formData);
|
row_.position_id = popupobj.row.id;
|
row_.md_position_hierarchy__position_path = popupobj.row.md_position_hierarchy__position_path;
|
row_.md_position_hierarchy__employee_name = popupobj.row.md_position_hierarchy__employee_name;
|
me.formData = clone(row_);
|
});
|
}
|
},
|
},
|
};
|
},
|
|
openHospital(sceneCode, obj, callback) {
|
var me = this;
|
var data_ = {};
|
var filter_ = "";
|
if (this.formData.company_id) {
|
filter_ = "company_id='" + this.formData.company_id + "'"
|
}
|
if (this.formData.bu_id) {
|
if (filter_) {
|
filter_ += " and bu_id='" + this.formData.bu_id + "'"
|
}
|
else {
|
filter_ = "bu_id='" + this.formData.bu_id + "'"
|
}
|
}
|
|
var config = {
|
totab: false, //true: 以Tab导航的方式打开
|
width: "800px",
|
height: "520px",
|
icon: "icon-product",
|
text: "医院选择",
|
id: "popup_hospital_target",//totab: true时需设置,用于判断是否已打开此页面
|
url: "module/md/page/popup/page/popup_hospital_target.html",
|
data: data_,
|
delta: {},
|
filter: filter_,
|
sceneCode: sceneCode,//"refuseedit",//"approval", //"add"//"browse",
|
callback: function(popupobj, popupcallback) {
|
callback(popupobj)
|
|
if (popupcallback) {
|
popupcallback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
},
|
openPositionTree(sceneCode, callback) {
|
var me = this;
|
var data_ = {};
|
var text_ = "岗位负责人"
|
var config = {
|
totab: false, //true: 以Tab导航的方式打开
|
width: "500px",
|
height: "80vh",
|
icon: "icon-product",
|
text: text_ + "选择",
|
id: "popup_position",//totab: true时需设置,用于判断是否已打开此页面
|
url: "module/md/page/popup/page/popup_position.html",
|
data: data_,
|
delta: {
|
company_id: me.formData.company_id,
|
bu_id: me.formData.bu_id,
|
//select_position: this.tableData // position_id
|
},
|
// filter: "org_id='"+ me.selectedrow.org_id + "' and bu_id='" + me.selectedrow.bu_id + "'",
|
sceneCode: sceneCode,//"refuseedit",//"approval", //"add"//"browse",
|
callback: function(popupobj, popupcallback) {
|
callback(popupobj)
|
|
if (popupcallback) {
|
popupcallback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
},
|
// openHospital(sceneCode, obj, callback) {
|
// var me = this;
|
// var data_ = {};
|
// var config = {
|
// totab: false, //true: 以Tab导航的方式打开
|
// width: "800px",
|
// height: "520px",
|
// icon: "icon-product",
|
// text: "医院选择",
|
// id: "popup_hospital",//totab: true时需设置,用于判断是否已打开此页面
|
// url: "module/md/page/popup/page/popup_hospital.html",
|
// data: data_,
|
// delta: {},
|
// // filter: "org_id='"+ me.selectedrow.org_id + "' and bu_id='" + me.selectedrow.bu_id + "'",
|
// filter: "",
|
// sceneCode: sceneCode,//"refuseedit",//"approval", //"add"//"browse",
|
// callback: function(popupobj, popupcallback) {
|
// callback(popupobj);
|
// if (popupcallback) {
|
// popupcallback();
|
// }
|
// }
|
// };
|
// me.doPopupByPublic(config);
|
// },
|
|
//提交
|
submitRowTable() {
|
var me = this;
|
var bo_ = this.$refs.form1.checkForm();
|
|
if (!bo_) {
|
bo_ = false;
|
Root.message({
|
type: 'error',
|
message: '请填写必填项'
|
});
|
return
|
}
|
this.iscommit = true;
|
this.saveRowTable();
|
},
|
|
//保存
|
saveRowTable() {
|
var me = this;
|
var operator_ = "uniqueSaveEntity";//保存
|
if(me.iscommit) {
|
operator_ = "commit";//提交
|
}
|
|
var entity_ = clone(this.formData);
|
var entity = {};
|
var product_ = [];
|
for (var r in entity_) {
|
if (r == "product_id" && entity_[r].length) {
|
product_ = clone(entity_[r]);
|
}
|
else if (entity_[r] || entity_[r] == "" || entity_[r] == false || entity_[r] == 0) {
|
entity[r] = entity_[r];
|
}
|
}
|
|
if (product_.length) {
|
entity.product_id = product_[0];
|
entity.product_name = me.productobj_map[product_[0]];
|
}
|
|
let param = {
|
dataname: me.dataname,
|
data: {},
|
check_exists: true
|
}
|
if (me.formData.id) {
|
param.id = me.formData.id
|
}
|
// if(me.iscommit) {
|
// param.to_state = "OpeningApproval";//提交
|
// }
|
// param.data[this.dataname] = entity;
|
param.data[me.dataname] = entity;
|
|
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 {
|
Root.message({
|
type: 'success',
|
message: '保存成功'
|
});
|
me.saveAfter();
|
}
|
}
|
}, function(errorresult) {
|
console.log("错误信息", errorresult);
|
|
if (errorresult.messages && errorresult.messages.count && errorresult.messages.count.error) {
|
me.iscommit = false;
|
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 (errorresult.exists_errors && errorresult.exists_errors.length) {
|
var messages_list = []
|
var index_ = 0;
|
errorresult.exists_errors.map(r=>{
|
index_ ++;
|
var messages_ = {
|
step: index_,
|
level: "Error",
|
message: r.title
|
}
|
messages_list.push(messages_)
|
})
|
me.iscommit = false;
|
var config = {
|
totab: false,
|
// width: "1200px",
|
// height: 800,
|
icon: "icon-product",
|
text: "错误信息",
|
url: "module/tool/page/popup_error_messages.html",
|
data: {},
|
delta: messages_list,
|
callback: function(obj, callback) {
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
}
|
else {
|
if (me.iscommit) {
|
Root.message({
|
type: 'error',
|
message: '提交失败'
|
});
|
me.iscommit = false;
|
}
|
else {
|
Root.message({
|
type: 'error',
|
message: '保存失败'
|
});
|
}
|
|
}
|
});
|
},
|
|
// 通过或拒绝
|
onShowApproval(passOrRefuse) {
|
this.approveremark = "";
|
this.reasonvisible = true;//审批备注填写弹窗
|
this.passOrRefuse = passOrRefuse;// commit下一个状态;approve通过;gohome;//拒绝 goback;//回退
|
},
|
saveReason() {
|
this.loading_pass = true;
|
if(this.passOrRefuse == "commit" || this.passOrRefuse == "approve"){
|
this.doApproval();
|
}
|
else{
|
if(this.approveremark != ""){
|
this.doApproval();
|
}
|
else{
|
Root.message({
|
type: 'warning',
|
message: '请填写原因'
|
});
|
this.loading_pass = false;
|
}
|
}
|
},
|
doApproval(bo) {
|
var me = this;
|
this.getMachine(function(next_step, up_step) { //
|
me.doRunApproval(next_step, up_step);
|
});
|
},
|
|
getMachine(callback) {
|
var me = this;
|
let param = {
|
dataname: me.dataname,
|
}
|
Server.call("root/state/getMachine", param, function(result) {
|
var next_step = {}; // 向下流程
|
var up_step = {}; // 向上流程
|
|
if (result && result.machine && result.machine.detail) {
|
result.machine.detail.map(md=>{
|
next_step[md.from_code] = md.to_code;
|
up_step[md.to_code] = md.from_code;
|
})
|
|
callback(next_step, up_step);
|
}
|
})
|
},
|
|
doRunApproval(next_step, up_step) {
|
var me = this;
|
this.passOrRefuse;//首次开户-通过
|
// commit // 下一个状态
|
// approve // 通过
|
// gohome // 拒绝
|
// goback // 回退
|
|
var to_state_ = "";
|
if (this.passOrRefuse == "commit") {
|
to_state_ = next_step[this.formData.state_code];
|
}
|
else if (this.passOrRefuse == "approve") {
|
|
}
|
else if (this.passOrRefuse == "gohome") {
|
// to_state_ = up_step[this.formData.state_code];
|
}
|
else if (this.passOrRefuse == "goback") {
|
to_state_ = up_step[this.formData.state_code];
|
}
|
|
let param = {
|
dataname: me.dataname,
|
id: me.formData.id,
|
to_state: to_state_,
|
remark: this.approveremark
|
}
|
//
|
// return
|
Server.call("root/data/" + this.passOrRefuse, param, function(result) {
|
me.loading_pass = false;
|
console.log(result);
|
if (me.passOrRefuse == "commit" || me.passOrRefuse == "approve") {
|
Root.message({
|
type: 'success',
|
message: '审批成功'
|
});
|
}
|
else if (me.passOrRefuse == "goback") {
|
Root.message({
|
type: 'success',
|
message: '已退回'
|
});
|
}
|
else if (me.passOrRefuse == "gohome") {
|
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;
|
}
|
</style>
|
|
</head>
|
|
<body style="margin: 0px;">
|
<div v-cloak id="vbody">
|
<div id="page_root">
|
<div ref="popup_body" style="padding: 0 20px;">
|
<div v-if="popupParames.totab" class="el-dialog__header">
|
<div class="dialog-title">
|
<i class="iconfont icon-customermanagement"></i>
|
<span> {{title}}</span>
|
</div>
|
</div>
|
<div :style="{height: dheight + 'px', 'overflow-y': 'auto'}">
|
<div class="el-dialog__body">
|
<h-form
|
ref="form1"
|
:form-attr="formAttr"
|
:table-fields="formFields"
|
:form-data="formData"
|
:table-field-click="formfieldClick"
|
>
|
</h-form>
|
</div>
|
</div>
|
<el-dialog title="填写原因" :visible.sync="reasonvisible" height="50%">
|
<el-input
|
type="textarea"
|
:autosize="{ minRows: 2, maxRows: 10}"
|
placeholder="请输入原因"
|
v-model="approveremark">
|
</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 class="el-dialog__footer">
|
<el-button-group style="margin-right: 80px;" >
|
<el-button size="small" v-if="isapproval" type="warning" plain @click="onShowApproval('gohome')">退回到申请人</el-button>
|
<el-button size="small" v-if="isapproval" type="danger" plain @click="onShowApproval('goback')">退回到上一步</el-button>
|
</el-button-group>
|
<el-button size="small" type="default" @click="closeDialog">取 消</el-button>
|
<el-button size="small" v-if="isedit || isrefuseedit" type="primary" :loading="loading_save" @click="saveRowTable":icon="buttonsconfig.save.icon">{{buttonsconfig.save.name}}</el-button>
|
<!-- <el-button size="small" v-if="isedit && !formData.agreement_id" type="success" :loading="loading_submit" @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="success" @click="onShowApproval('approve')">通 过</el-button>
|
<!-- <el-button size="small" v-if="isapproval" type="primary" @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>
|