<!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 = [
|
{id: "js10", type: "js", url: "root/js/jquery-3.5.1.min.js"},
|
];
|
window.top.initJsCss(document, jscss_urls, callback);
|
};
|
|
function initVue() {
|
new FormVue({
|
el: "#vbody",
|
data: {
|
dataname: "so_complaint",
|
title: "投诉单信息",
|
|
formAttr: {
|
istitle: false,
|
title: "表单名称",
|
columnnumber: 2,
|
labelwidth: "150px",
|
labelposition: "left",//"left",// right//top
|
size: "mini",
|
border: "5px solid #c6c6c600"
|
},
|
formFields: [
|
// {isshow: "F", field: "state_code", name: "状态",},
|
// {isshow: "F", field: "state_name", name: "状态",},
|
// {isshow: "F", field: "code", name: "投诉单号", type: "span",},
|
// {isshow: "F", field: "report_name", name: "报告人",},
|
// {isshow: "T", field: "customer_name", name: "经销商名称", type: "popup",},
|
// {isshow: "T", field: "customer_code", name: "经销商编码", type: "span",},
|
// {isshow: "T", field: "contact_email", name: "联系人邮箱",},
|
// {isshow: "T", field: "shipto_address_fullname", name: "联系人地址", type: "select", colspan: 2,},
|
// {isshow: "T", field: "shipto_contact", name: "联系人姓名",},
|
// {isshow: "T", field: "shipto_phone", name: "联系人电话",},
|
// {isshow: "T", field: "material_name", name: "产品型号", width: "200", isminwidth:true, type: "popup", align:"left"},
|
// {isshow: "T", field: "batch_no", name: "产品批号", width: "150", type: "span"},
|
// {isshow: "T", field: "s_no", name: "产品序列号", width: "150", type: "span"},
|
// {isshow: "T", field: "problematic_qty", name: "缺陷产品数量", type: "input", istablesum: true, width: "150"},
|
// {isshow: "T", field: "return_qty", name: "返回产品数量", type: "input", istablesum: true, width: "150"},
|
|
// {isshow: "T", field: "report_time", name: "报告日期", type: "date",},
|
// {isshow: "T", field: "happen_time", name: "发生日期", type: "date", width: "150",},
|
// {isshow: "T", field: "hospital_name", name: "医院名称", width: "200", align: "left", type: "popup"},
|
// {isshow: "T", field: "hospital_code", name: "医院编码", width: "150", type: "span"},
|
// {isshow: "T", field: "description", name: "问题描述", width: "200", type: "textarea", colspan: 2,},
|
// {isshow: "T", field: "patient_involve", name: "是否有病人参与?", width: "150", type: "select", colspan: 2, options: [{value: "是",code: "Y"}, {value: "否",code: "N"}]},
|
// // {isshow: "T", field: "patient_hurt", name: "病人是否受到伤害", width: "150", type: "select", options: [{value: "是",code: "Y"}, {value: "否",code: "N"}]},
|
// {isshow: "T", field: "patient_hurt", name: "如果有病人参与,病人是否受到伤害?", width: "150", type: "input", colspan: 2,},
|
// {isshow: "T", field: "check_time", name: "故障检查", width: "150", colspan: 2, type: "select", options: [{value: "准备阶段",code: "Before"}, {value: "手术阶段",code: "Ing"}, {value: "手术后",code: "After"}, {value: "未知",code: "Unknown"}]},
|
// {isshow: "T", field: "operation_name", name: "如果在手术过程中或手术后,手术名称是什么?", colspan: 2, width: "100", type: "input",},
|
// {isshow: "T", field: "new_instrument", name: "是否使用了一个新器械完成此手术?", colspan: 2, type: "select", options: [{value: "是的,更换了新的器械",code: "New"}, {value: "没有,继续使用器械",code: "Old"}, {value: "没有,手术停止",code: "Stop"}]},
|
// // {isshow: "T", field: "treatment_need", name: "是否需要额外治疗", width: "150", type: "select", options: [{value: "是",code: "Y"}, {value: "否",code: "N"}]},
|
// {isshow: "T", field: "treatment_need", name: "是否需要额外的手术、医疗干预或药物治疗?", colspan: 2, width: "150", type: "input",},
|
// {isshow: "T", field: "formal_reply", name: "是否需要正式回复?", width: "150", colspan: 2, type: "select", options: [{value: "是",code: "Y"}, {value: "否",code: "N"}]},
|
// {isshow: "T", field: "product_replace", name: "是否需要更换产品?", colspan: 1, width: "150", type: "select", options: [{value: "是",code: "Y"}, {value: "否",code: "N"}]},
|
// {isshow: "T", field: "qty_replace", name: "申请更换数量", type:"input", width: "100", type: "input",},
|
],
|
newformData: {
|
state_code: "Input",
|
state_name: "草稿",
|
},
|
formData: {},
|
|
isRefresh: true,
|
|
dataRequest: [
|
{
|
name: "md_product_authorize",//
|
isnotoption: true, //true:不是选项
|
code:"code",//是下拉选项时设置
|
label:"name",//是下拉选项时设置
|
},
|
],
|
dataRequestObj: {},
|
|
//按键权限设置
|
isedit: false,//提交前编辑,保存/提交
|
isrefuseedit: false,//拒绝后编辑,保存/再次提交
|
isapproval: false,//审批,同意/拒绝/转办/退回
|
|
iscommit: false,//提交标记
|
|
//审批相关变量
|
loading_save: false,
|
loading_pass: false,
|
reasonvisible:false,//审批通过或拒绝填写原因
|
textarea2: '',//填写理由
|
passOrRefuse:false,
|
|
//弹窗参数
|
popupParames: {},
|
//字段设置
|
tablefieldClick: {},
|
formfieldClick: {},
|
loading_page: false,
|
iscustomer: false,
|
t_height:null,
|
activeName: null,
|
|
skuFilter: "1 = 1",
|
bizFilter: "1 = 1",
|
commit: false,
|
},
|
created() {
|
this.popupParames = clone(Root.popupParames);
|
if (window.top.vue.userinfo && window.top.vue.userinfo.org && window.top.vue.userinfo.org.is_account) {
|
this.iscustomer = true;
|
}
|
|
this.title = this.popupParames.title || this.popupParames.text;
|
if (this.popupParames.data) {
|
this.formData = clone(this.popupParames.data);
|
}
|
|
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_);
|
|
this.isedit = true;
|
}
|
else if (this.popupParames.sceneCode == "browse") {//只读
|
this.formAttr.disabled = true;
|
}
|
else if (this.popupParames.sceneCode == "edit") {//编辑
|
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;
|
this.activeName = "BasicInfo";
|
me.t_height = document.documentElement.clientHeight*1 - 91;
|
//预加载数据
|
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]);
|
// formData.product_category_name = [];
|
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_product_authorize) {
|
var product_ = "";
|
if (me.dataRequestObj.md_product_authorize) {
|
me.dataRequestObj.md_product_authorize.map(p=>{
|
if (product_ == "") {
|
product_ = p.id;
|
}
|
else {
|
product_ += "','" + p.id;
|
}
|
})
|
if (product_) {
|
product_ = " and authorize_category_id in ('" + product_ + "')";
|
}
|
}
|
else {
|
product_ = " and 1<>1"
|
}
|
me.skuFilter += product_;
|
}
|
|
me.initData();
|
});
|
}
|
else {
|
me.initData();
|
}
|
|
// 以服务的方式调用的 Loading 需要异步关闭
|
this.$nextTick(() => {
|
hideLoading();
|
|
//重新设置弹窗宽高
|
this.$nextTick(function(){
|
//let w_ = this.$refs.popup_body.offsetWidth + "px";
|
let w_ = "900px";
|
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
|
}
|
if (me.commit) {
|
me.$set(obj, 'commit', true);
|
}
|
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 == "doc_code" || f.field == "doc_date") {
|
f.isshow = "F";
|
}
|
formFields_.push(clone(f));
|
})
|
|
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];
|
}
|
if (me.rowData["so_complaint_image"]) {
|
var files_ = [];
|
me.rowData["so_complaint_image"].map(fileobj=>{
|
var file_ = {
|
image_id: fileobj.id,
|
id: fileobj.file_index_id,
|
file_name: fileobj.name,
|
}
|
files_.push(file_);
|
})
|
me.$set(me.formData, "attachment", files_);
|
}
|
})
|
},
|
|
tableFieldClick() {
|
var me = this;
|
//表单字段事件设置
|
this.formfieldClick = {
|
customer_name: {
|
popup: {
|
onclick: function(obj) {
|
me.popup_customerList(obj);
|
}
|
},
|
|
val: {
|
onchange: function(obj) {
|
me.cleanRelatedData("customer_name");
|
}
|
}
|
},
|
hospital_name: {
|
popup: {
|
onclick: function(obj) {//弹窗点击事件
|
//打开
|
me.tablepopup_hospitalList(obj);
|
}
|
},
|
},
|
material_name: {
|
popup: {
|
onclick: function(obj) {//弹窗点击事件
|
me.tablepopup_productList(obj);
|
}
|
},
|
},
|
attachment: {
|
buttonarray: {
|
onclick: function(obj) {
|
var filenamefield = obj.obj.field;
|
var fileidfield = "attachment";
|
if(obj.buttonobj && obj.buttonobj.code == "showfilebyfile"){
|
me.showFileImgByFileId(obj.buttonobj.fileobj);
|
}else if (obj.buttonobj && obj.buttonobj.code == "uploadlist"){
|
me.onPopupByUploadFile(filenamefield, fileidfield, me.dataname);
|
}else if (obj.buttonobj && obj.buttonobj.code == "delfilebyfile"){
|
me.deleteByFileId(filenamefield, obj.buttonobj.fileobj);
|
}
|
}
|
}
|
},
|
occur_date: {
|
val: {
|
onchange: function(obj) {
|
let date_accurate = new Date($.ajax({async: false}).getResponseHeader("Date"));
|
date_accurate.setHours( 8, 0, 0);
|
if (obj.data.occur_date) {
|
var date_select = new Date(obj.data.occur_date);
|
if (date_select > date_accurate) {
|
Root.message({
|
type: 'warning',
|
message: '发生日期不能晚于当前日期'
|
});
|
obj.data.occur_date = null;
|
}
|
|
if (obj.data.occur_date && obj.data.report_date) {
|
if (new Date(obj.data.occur_date) > new Date(obj.data.report_date)) {
|
Root.message({
|
type: 'warning',
|
message: '发生日期不能晚于报告日期'
|
});
|
obj.data.occur_date = null;
|
}
|
}
|
}
|
}
|
}
|
},
|
report_date: {
|
val: {
|
onchange: function(obj) {
|
let date_accurate = new Date($.ajax({async: false}).getResponseHeader("Date"));
|
date_accurate.setHours( 8, 0, 0);
|
if (obj.data.report_date) {
|
var date_select = new Date(obj.data.report_date);
|
if (date_select > date_accurate) {
|
Root.message({
|
type: 'warning',
|
message: '报告日期不能晚于当前日期'
|
});
|
obj.data.report_date = null;
|
}
|
if (obj.data.report_date && obj.data.occur_date) {
|
if (new Date(obj.data.report_date) < new Date(obj.data.occur_date)) {
|
Root.message({
|
type: 'warning',
|
message: '报告日期不能早于发生日期'
|
});
|
obj.data.report_date = null;
|
}
|
}
|
}
|
}
|
}
|
},
|
};
|
},
|
|
onPopupByUploadFile(filenamefield, fileidfield,dataname) {
|
var me = this;
|
var analysistype_ = "";
|
var formData_ = clone(me.formData);
|
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: me.formData.id,
|
fileNamefieldName: filenamefield,
|
max_size: "100MB",
|
},
|
delta: delta_,
|
callback: function(obj, callback) {
|
me.$message({
|
showClose: true,
|
message: '上传成功!',
|
type: 'success'
|
});
|
|
var file_ = {
|
id: obj.row[0].id,
|
file_name: decodeURI(obj.row[0].name)
|
}
|
if (!formData_[filenamefield]) {
|
formData_[filenamefield] = []
|
}
|
formData_[filenamefield].push(file_);
|
|
me.formData = formData_;
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
this.doPopupByPublic(config);
|
},
|
|
deleteByFileId(filenamefield, fileobj){
|
var me = this;
|
var formData_ = clone(me.formData);
|
Root.confirm('确定删除附件【' + fileobj.file_name + '】吗?', '删除提示', {
|
confirmButtonText: '删除',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
if (fileobj.id) {
|
let param = {
|
dataname: "file_index",
|
id: fileobj.id
|
}
|
|
Server.call("root/data/deleteEntity", param, function(result) {
|
console.log(result);
|
if (result && result.data) {
|
me.formData[filenamefield].remove(fileobj);
|
// me.formData = formData_;
|
Root.message({
|
type: 'success',
|
message: '删除成功!'
|
});
|
}
|
});
|
}
|
}).catch(() => {
|
Root.message({
|
type: 'info',
|
message: '已取消删除'
|
});
|
});
|
|
},
|
|
showFileImgByFileId(fileobj) {
|
let me = this;
|
var file_id = fileobj.id;
|
var file_name = fileobj.file_name;
|
|
this.zzimg = {};
|
this.zzimgList = [];
|
this.file_txt = false;
|
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
|
}
|
|
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);
|
}
|
}
|
},
|
|
popup_customerList(obj) {
|
var me = this;
|
|
Root.showPopup({
|
url: "module/order/page/popup-customerList.html",
|
width: 800,
|
height: 550,
|
filter: "state_code = 'Open'",
|
sceneCode: "add",
|
|
callback: function(obj, callback) {
|
var formData_ = clone(me.formData);
|
formData_.customer_code = obj.row.code;
|
formData_.customer_name = obj.row.name;
|
formData_.customer_id = obj.row.id;
|
me.formData = clone(formData_);
|
|
me.findOrgBizRegistScope(obj.row.id);
|
if (callback) {
|
callback();
|
}
|
}
|
});
|
},
|
|
findOrgBizRegistScope(org_id) {
|
var me = this;
|
var param = {
|
dataname: "md_org_data.md_org_biz_regist_scope",
|
filter: "parent_id ='" + org_id + "'",
|
}
|
Server.call("root/data/getEntitySet", param, function(result) {
|
console.log(result);
|
var scope_ = "";
|
if (result.data.entityset) {
|
result.data.entityset.map(p=>{
|
var do_scope_ = [];
|
if (p.is_2002) {
|
do_scope_.push("Ⅲ-6877");
|
}
|
if (p.is_2017) {
|
do_scope_.push("Ⅲ-03");
|
}
|
if (p.is_13) {
|
do_scope_.push("Ⅲ-13");
|
}
|
|
do_scope_.map(s=>{
|
if (scope_ == "") {
|
scope_ = s
|
}
|
else {
|
scope_ += "','" + s;
|
}
|
})
|
})
|
if (scope_) {
|
scope_ = " and type_code in ('" + scope_ + "')";
|
}
|
}
|
else {
|
scope_ = " and 1<>1"
|
}
|
me.bizFilter += scope_;
|
}, function(errorncc) {
|
|
})
|
},
|
|
tablepopup_hospitalList(obj) {
|
var me = this;
|
// var filter_ = "";
|
// if(!me.formData.customer_id) {
|
// Root.message({
|
// type: 'warning',
|
// message: '请先选择经销商!'
|
// });
|
|
// return;
|
// }
|
// else {
|
// filter_ += "parent_id = '" + me.formData.customer_id + "'";
|
// }
|
|
Root.showPopup({
|
url: "module/order/page/popup-hospitalList.html",
|
width: 800,
|
height: 550,
|
sceneCode: "add",
|
filter: "state_code = 'Open'",
|
callback: function(obj, callback) {
|
var formData_ = clone(me.formData);
|
formData_.hospital_code = obj.row.code;
|
formData_.hospital_name = obj.row.name;
|
formData_.hospital_id = obj.row.id;
|
me.formData = clone(formData_);
|
|
if (callback) {
|
callback();
|
}
|
}
|
});
|
},
|
|
tablepopup_productList(obj) {
|
var me = this;
|
var categoryfilter_ = "1 = 1";
|
var filter_ = "1 = 1";
|
if(!me.formData.customer_id) {
|
Root.message({
|
type: 'warning',
|
message: '请先选择经销商!'
|
});
|
return;
|
}
|
// else {
|
// if (me.skuFilter) {
|
// categoryfilter_ = me.skuFilter;
|
// }
|
if (me.bizFilter) {
|
filter_ = me.bizFilter;
|
}
|
// }
|
if (me.skuFilter) {
|
categoryfilter_ = me.skuFilter;
|
}
|
|
Root.showPopup({
|
url: "module/order/page/popup/product_list.html",
|
width: 800,
|
height: 550,
|
sceneCode: "add",
|
categoryfilter: categoryfilter_,
|
filter: filter_,
|
|
callback: function(obj, callback) {
|
var formData_ = clone(me.formData);
|
formData_.material_name = obj.row.material_name;
|
formData_.material_code = obj.row.material_code;
|
formData_.product_name = obj.row.name;
|
formData_.product_code = obj.row.code;
|
formData_.batch_no = obj.row.batch_no;
|
formData_.batch_sn = obj.row.batch_sn;
|
formData_.spec = obj.row.spec;
|
formData_.batch_no_flag = obj.row.batch_no_flag;
|
formData_.batch_sn_flag = obj.row.batch_sn_flag;
|
formData_.category_name = obj.row.authorize_category_name;
|
formData_.category_code = obj.row.authorize_category_code;
|
|
me.formData = clone(formData_);
|
|
if (callback) {
|
callback();
|
}
|
}
|
});
|
},
|
|
//提交
|
submitRowTable() {
|
var me = this;
|
|
var bo = me.$refs.form1.checkForm();
|
if(!bo) {
|
me.iscommit = false;
|
Root.message({
|
type: 'warning',
|
message: '请填写必填项或检查数据格式'
|
});
|
return;
|
}
|
|
var no_flag = false;
|
var sn_flag = false;
|
var formData_ = clone(me.formData);
|
if(formData_.batch_no_flag == "Y"){
|
if (formData_.batch_no == null || formData_.batch_no === "") {
|
no_flag = true;
|
}
|
}
|
if(formData_.batch_sn_flag == "Y"){
|
if (formData_.batch_sn == null || formData_.batch_sn === "") {
|
sn_flag = true;
|
}
|
}
|
if (no_flag) {
|
Root.message({
|
type: 'error',
|
message: '明细中存在批号为空的数据'
|
});
|
return
|
}
|
if (sn_flag) {
|
Root.message({
|
type: 'error',
|
message: '明细中存在序列号为空的数据'
|
});
|
return
|
}
|
|
me.iscommit = true;
|
me.commit = true;
|
me.saveRowTable();
|
},
|
|
//保存
|
saveRowTable() {
|
var me = this;
|
me.loading_save = true;
|
var operator_ = "saveEntity";//保存
|
if(me.iscommit) {
|
operator_ = "commit";//提交
|
}
|
|
var entity_ = clone(this.formData);
|
var entity = {};
|
for (var r in entity_) {
|
if ((entity_[r] || entity_[r] === false) && r != "attachment" && r != "batch_no_flag" && r != "batch_sn_flag") {
|
entity[r] = entity_[r];
|
}
|
}
|
|
let param = {
|
dataname: this.dataname,
|
data: {},
|
}
|
param.data[this.dataname] = entity;
|
|
if (this.formData["attachment"] && this.formData["attachment"].length) {
|
var attachment_ = clone(this.formData["attachment"]);
|
var files_ = [];
|
attachment_.map(f=>{
|
var f_ = {
|
parent_id: this.formData.id,
|
name: f.file_name,
|
file_index_id: f.id,
|
}
|
|
files_.push(f_)
|
})
|
param.data["so_complaint_image"] = files_;
|
}
|
|
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) {
|
if(me.iscommit) {
|
console.log("错误信息", errorresult);
|
me.iscommit = 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: '提交失败'
|
});
|
}
|
}
|
else {
|
console.log("错误信息", errorresult);
|
me.loading_save = 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: '保存失败'
|
});
|
}
|
}
|
me.iscommit = false;
|
me.loading_save = false;
|
});
|
},
|
|
//审批通过相关数据赋值
|
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;
|
}
|
}
|
},
|
|
//审批通过/拒绝
|
doPassApproval(bo) {
|
var me = this;
|
var state_ = "approve";
|
if (!bo) {
|
state_ = "reject";
|
}
|
|
let param = {
|
dataname: me.dataname,
|
id: me.formData.id,
|
remark: this.textarea2
|
}
|
Server.call("root/data/" + state_, param, function(result) {
|
me.loading_pass = false;
|
console.log(result);
|
if (bo) {
|
Root.message({
|
type: 'success',
|
message: '审批成功'
|
});
|
me.saveAfter();
|
}
|
else {
|
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 class="el-dialog__header">
|
<div class="dialog-title">
|
<i class="iconfont icon-customermanagement"></i>
|
<span> {{title}}</span>
|
</div>
|
</div>
|
|
<div :style="{height: t_height +'px', 'overflow-y': 'auto'}">
|
<div class="el-dialog__body">
|
<div class="form0">
|
<h-form
|
ref="form1"
|
:form-attr="formAttr"
|
:table-fields="formFields"
|
:form-data="formData"
|
:table-field-click="formfieldClick"
|
>
|
</h-form>
|
</div>
|
|
<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>
|
|
<div class="el-dialog__footer">
|
<el-button size="small" type="default" @click="closeDialog">取 消</el-button>
|
<el-button size="small" v-if="isedit || isrefuseedit" type="primary" @click="saveRowTable" :loading="loading_save || iscommit" :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>
|