<!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_org_data",
|
children_dataname: "md_org_register",
|
title: "新增商业",
|
|
dataRequest: [
|
{
|
name: "product_group",
|
dataname: "md_product_authorize",
|
// url: "root/data/newEntity",
|
// paramsobj: {dataname: "md_org_data", type_code:"Distributor"},
|
isnotoption: false, //true:不是选项
|
code:"id",//是下拉选项时设置
|
label:"name",//是下拉选项时设置
|
filter: "",
|
orderby: "order_no"
|
}
|
],
|
|
formAttr: {
|
istitle: false,
|
title: "表单名称",
|
columnnumber: 4,
|
labelwidth: "165px",
|
labelposition: "left",//"left",// right//top
|
size: "mini",
|
border: "10px solid #c6c6c600"
|
},
|
formAttrs: {
|
istitle: false,
|
title: "表单名称",
|
columnnumber: 1,
|
labelwidth: "165px",
|
labelposition: "left",//"left",// right//top
|
size: "mini",
|
border: "10px solid #c6c6c600"
|
},
|
|
formFields: [],
|
formFieldss: [],
|
tableData: [],
|
change_org_hospital: {},
|
add_org_hospital: [],
|
del_org_hospital: [],
|
tableFields: [
|
{isshow: "T", field: "province", name: "省份",width:"120"},
|
{isshow: "T", field: "city", name: "城市",width:"120"},
|
{isshow: "T", field: "county", name: "区县",width:"120"},
|
{isshow: "T", field: "code", name: "医院编码"},
|
{isshow: "T", field: "name", name: "医院名称", width: "350",align:"left"},
|
{isshow: "T", field: "grade", name: "等级"},
|
{isshow: "T", field: "field222", name: "是否目标",width:"90"},
|
],
|
|
activeName: '',
|
newformData: {
|
//id: uuid_short(),
|
code: createBaseCode("CH"),
|
create_time: createDatetime(),
|
update_time: createDatetime(),
|
state_code: "Input",
|
state_name: "未开户",
|
creator_name: window.top.vue.userinfo.name,
|
type_code: "Dealer",
|
type_name: "经销商",
|
field15: [],
|
field11: [],
|
authorization_province: "",
|
|
},
|
formData: {
|
},
|
formDatas: {
|
authorize_scope: [],
|
},
|
authorize_scope_id: "",//授权范围id
|
|
formData1: {},
|
fileobj: {},
|
ocrobj: {},
|
formData2: {},
|
|
product_group: [],
|
product_group_map: {},
|
old_org_product: [],
|
old_org_province: [],
|
//按键权限设置
|
isedit: false,//提交前编辑,保存/提交
|
isrefuseedit: false,//拒绝后编辑,保存/再次提交
|
isapproval: false,//审批,同意/拒绝/转办/退回
|
|
iscommit: false,//提交标记
|
|
//弹窗参数
|
popupParames: {},
|
//字段设置
|
tablefieldClick: {},
|
formfieldClick: {},
|
dialogImageUrl: '',
|
dialogVisible: false,
|
fileId:"",
|
fileUrl:"",
|
imgurl: "",
|
imgLoading: false,
|
tableHeight: 500,
|
pagesize: 10,
|
pagenum: 1,
|
total: 0,
|
dheight: null,
|
editTableButton: {
|
edit: {
|
isshow: true,
|
txt:"编辑"
|
},
|
del: {
|
isshow: true,
|
txt:"删除"
|
},
|
save: {
|
isshow: false,
|
txt:"保存"
|
},
|
},
|
|
loading_save: false,
|
approveremark: "",
|
loading_pass: false,
|
reasonvisible: false,
|
passOrRefuse: true,
|
|
mark: null,
|
|
isRoleQA: false,
|
|
connectActor : false,
|
},
|
created() {
|
var me = this;
|
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.formData.file_id) {
|
this.imgurl = config.url_root + "root/file/getFile?category=org&token=" + Root.getToken() + "&id=" + this.formData.file_id;
|
}
|
}
|
|
console.log(window.top.vue.userinfo);
|
|
if(window.top.vue.userinfo.currentactor.code == 'Capacity-QA') {
|
this.isRoleQA = true;
|
}
|
|
if (this.popupParames.sceneCode) {
|
if (this.popupParames.sceneCode == "add") {//新增
|
//动态获取默认数据
|
var newEntity_ = {
|
name: "newEntity",
|
url: "root/data/newEntity",
|
paramsobj: {dataname: "md_org_data", type_code:"Distributor"},
|
isnotoption: true, //true:不是选项
|
}
|
this.dataRequest.push(newEntity_);
|
|
// if (this.newformData) {
|
// let formData_ = clone(this.formData);
|
|
// for (var k in this.newformData) {
|
// formData_[k] = this.newformData[k];
|
// }
|
// this.formData = formData_;
|
// }
|
this.isedit = true;
|
}
|
else if (this.popupParames.sceneCode == "browse") {//只读
|
this.formAttr.disabled = true;
|
this.formAttrs.disabled = true;
|
|
}
|
else if (this.popupParames.sceneCode == "edit") {//编辑
|
this.isedit = true;
|
}
|
else if (this.popupParames.sceneCode == "adminedit") {//管理员编辑
|
this.formAttr.disabled = true;
|
this.formAttrs.disabled = true;
|
this.isedit = true;
|
}
|
else if (this.popupParames.sceneCode == "approval") {//审批
|
this.formAttr.disabled = true;
|
this.formAttrs.disabled = true;
|
this.isapproval = true;
|
}
|
// else if (this.popupParames.sceneCode == "refuseedit") {//拒绝后的编辑
|
// this.isrefuseedit = true;
|
// }
|
}
|
},
|
|
mounted() {
|
var me = this;
|
this.activeName = 'basicInfo';
|
if(me.isRoleQA) {
|
this.activeName = 'devices';
|
}
|
|
me.dheight = document.documentElement.clientHeight - 155;
|
//预加载数据
|
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["md_org_data"]);
|
formData.product_category_name = [];
|
formData.state_code = "Input";
|
formData.state_name = "草稿";
|
formData.category_code = "Customer";
|
formData.category_name = "客户";
|
me.formData = formData;
|
}
|
|
if (me.dataRequestObj.product_group) {
|
console.log(me.dataRequestObj);
|
me.product_group = me.dataRequestObj.product_group;
|
me.product_group_map = me.dataRequestObj.map.product_group;
|
}
|
|
// data.agm_template.map(c=>{
|
// me.options_templateobj[c[me.props_template.value]] = c;
|
// })
|
|
// let agm_template_ = ArrayToTree(clone(data.agm_template), "name", "parent_id");
|
// me.options_category = agm_template_;
|
|
me.initData();
|
// 以服务的方式调用的 Loading 需要异步关闭
|
me.$nextTick(() => {
|
hideLoading();
|
});
|
});
|
}
|
else {
|
this.initData();
|
// 以服务的方式调用的 Loading 需要异步关闭
|
me.$nextTick(() => {
|
hideLoading();
|
});
|
}
|
},
|
|
methods:{
|
//关闭弹窗
|
closeDialog(code) {
|
var me = this;
|
// if(code && code == 'delete') {
|
// console.log(code);
|
// if(me.tableData.length > 0) {
|
// me.tableData.map(h =>{
|
// me.rowChange(h, "del", "md_org_data.md_org_hospital");
|
// })
|
// if (me.popupParames.totab){
|
// Root.tab.removeItem(Root.tab.selected);
|
// Root.tab.open(me.popupParames.parentOption, false);
|
// }
|
// else {
|
// Root.hidePopup();
|
// }
|
// }
|
// }
|
|
// else {
|
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();
|
}
|
},
|
handleRemove(file, fileList) {
|
console.log(file, fileList);
|
},
|
handlePictureCardPreview(file) {
|
this.dialogImageUrl = file.url;
|
this.dialogVisible = true;
|
},
|
|
initData() {
|
let me = this;
|
var id_ = null;
|
if (this.formData.id) {
|
id_ = this.formData.id;
|
}
|
this.getRowDataById(id_, function(result) {//查询后的回调,用于获取字段的
|
// if (result.meta) {
|
// me.data_tablename_map = result.meta
|
// }
|
if (result.meta && result.meta[me.dataname] && result.meta[me.dataname].fields) {
|
var metas = clone(result.meta[me.dataname].fields);
|
if (result.meta.md_org_product && result.meta.md_org_product.fields) {
|
result.meta.md_org_product.fields[0].options = me.product_group;
|
console.log("options: ", result.meta.md_org_product.fields[0]);
|
}
|
|
metas.push(result.meta.md_org_product.fields[0]);
|
console.log(metas);
|
|
if (result.meta.md_org_register && result.meta.md_org_register.fields) {
|
result.meta.md_org_register.fields.map(f=>{
|
if(f.code == "certificate_date_from"){
|
f.colspan = 4;
|
f.required = true;
|
metas.map(t=>{
|
if(t.code == "license_business_no"){
|
me.mark = metas.indexOf(t);
|
console.log(metas.indexOf(t));
|
metas.splice(me.mark+1, 0, f);
|
}
|
})
|
}
|
|
if(f.code == "certificate_date_to"){
|
f.colspan = 4;
|
f.required = true;
|
metas.splice(me.mark+2, 0, f);
|
}
|
|
if(f.code == "certificate_legal_representative"){
|
f.colspan = 4;
|
f.required = true;
|
metas.splice(me.mark+3, 0, f);
|
}
|
|
if(f.code == "certificate_scope"){
|
f.inputtype = 'textarea';
|
f.colspan = 4;
|
f.required = true;
|
metas.splice(me.mark+4, 0, f);
|
}
|
})
|
}
|
|
//Brooke
|
if(result.meta.md_org_data && result.meta.md_org_data.fields) {
|
if(me.rowData && me.rowData.md_org_account && me.rowData.md_org_account.actor) {
|
var mark_ = null;
|
if(me.rowData.md_org_data.actor == "Distributor") {
|
mark_ = false;
|
}
|
else {
|
mark_ = true;
|
}
|
result.meta.md_org_data.fields.map(f => {
|
if(f.field == "email") {
|
f.required = mark_;
|
}
|
})
|
}
|
}
|
|
var formFields_ = [];
|
|
metas.map(f=>{
|
f.isshow = "T";
|
if (me.formData.actor == "Distributor" && f.field == 'email') {
|
f.required = false;
|
}
|
|
formFields_.push(clone(f));
|
})
|
|
if (!me.formFields || (me.formFields && me.formFields.length == 0)) {
|
me.formFields = clone(formFields_);
|
console.log(result)//business_device_license
|
if (result.meta["md_org_hospital"].fields) {
|
var tablemetas = clone(result.meta["md_org_hospital"].fields);
|
var tableFields_ = [];
|
tablemetas.map(f=>{
|
f.isshow = "T";
|
tableFields_.push(clone(f));
|
})
|
me.tableFields = clone(tableFields_);
|
}
|
|
if (result.meta["business_device_license"].fields) {
|
|
var formmetas = clone(result.meta["business_device_license"].fields);
|
|
/* if(result.meta.md_org_register && result.meta.md_org_register.fields) {
|
result.meta.md_org_register.fields.map(f=> {
|
if(f.code == 'instrument_license_business_address') {
|
f.required = true;
|
f.labelchinese = "经营场所";
|
|
formmetas.map(h => {
|
if(h.code == 'instrument_business_type') {
|
var mark = formmetas.indexOf(h);
|
formmetas.splice(mark+1, 0, f);
|
}
|
})
|
}
|
})
|
} */
|
|
var formFieldss_ = [];
|
formmetas.map(f=>{
|
f.isshow = "T";
|
formFieldss_.push(clone(f));
|
})
|
me.formFieldss = clone(formFieldss_);
|
}
|
|
//字段数组转字段obj,目的为了筛选时获取字段属性
|
me.fieldsToFieldsObj();
|
|
//设置字段事件
|
me.tableFieldClick();
|
}
|
}
|
|
console.log(me.rowData);
|
|
if (me.rowData[me.dataname]) {
|
me.formData = clone(me.rowData[me.dataname]);
|
}
|
if (me.rowData.business_device_license) {
|
me.formDatas = clone(me.rowData.business_device_license);
|
}
|
|
if (me.rowData.md_org_biz_regist_scope) {
|
var authorize_scope_ = [];
|
for(var i in me.rowData.md_org_biz_regist_scope) {
|
if(i == "is_2002" && me.rowData.md_org_biz_regist_scope[i]) {
|
authorize_scope_.push(i)
|
}else if(i == "is_2017" && me.rowData.md_org_biz_regist_scope[i]) {
|
authorize_scope_.push(i)
|
}else if(i == "is_13" && me.rowData.md_org_biz_regist_scope[i]) {
|
authorize_scope_.push(i)
|
}
|
}
|
me.authorize_scope_id = me.rowData.md_org_biz_regist_scope.id;
|
me.formDatas.authorize_scope = authorize_scope_;
|
}
|
else {
|
me.formDatas.authorize_scope = [];
|
}
|
if (me.rowData.md_org_product) {
|
me.old_org_product = clone(me.rowData.md_org_product);
|
var md_org_product_ = [];
|
me.rowData.md_org_product.map(p=>{
|
md_org_product_.push(p.product_category_id);
|
})
|
me.$set(me.formData, "product_category_name", md_org_product_);
|
}
|
else {
|
me.$set(me.formData, "product_category_name", []);
|
}
|
// 多选授权省份
|
// if (me.rowData.md_org_province) {
|
// me.old_org_province = clone(me.rowData.md_org_province);
|
// var md_org_province_ = [];
|
// me.rowData.md_org_province.map(p=>{
|
// md_org_province_.push(p.province_name);
|
// })
|
// me.$set(me.formData, "authorization_province", md_org_province_);
|
// }
|
// else {
|
// me.$set(me.formData, "authorization_province", []);
|
// }
|
// 单选授权省份
|
if (me.rowData.md_org_province) {
|
me.old_org_province = clone(me.rowData.md_org_province);
|
var md_org_province_ = "";
|
me.rowData.md_org_province.map(p=>{
|
md_org_province_ = p.province_name;
|
})
|
me.$set(me.formData, "authorization_province", md_org_province_);
|
}
|
else {
|
me.$set(me.formData, "authorization_province", "");
|
}
|
|
if(me.rowData.md_org_register) {
|
let data_ = me.rowData.md_org_register
|
me.$set(me.formData, "certificate_date_from", data_.certificate_date_from);
|
me.$set(me.formData, "certificate_date_to", data_.certificate_date_to);
|
me.$set(me.formData, "certificate_legal_representative", data_.certificate_legal_representative);
|
me.$set(me.formData, "certificate_scope", data_.certificate_scope);
|
//me.$set(me.formDatas, "instrument_license_business_address", data_.instrument_license_business_address);
|
}
|
})
|
},
|
|
tableFieldClick() {
|
var me = this;
|
//表单字段事件设置
|
this.formfieldClick = {
|
name: {
|
input: {
|
onkeydown: function(e, b) {
|
// let key = e.key
|
// if (key === "4" || key === "." || key === "-") {
|
// e.returnValue = false
|
// return false
|
// }
|
}
|
}
|
},
|
superior_name: {
|
popup: {
|
onclick: function(obj) {//弹窗点击事件
|
//打开
|
me.tablepopup_customerlist(obj)
|
}
|
},
|
},
|
|
relation_name : {
|
popup: {
|
onclick: function(obj) {//弹窗点击事件
|
//打开
|
me.tablepopup_customerlist(obj)
|
}
|
},
|
|
// val: {
|
// onchange: function(obj) {
|
// debugger;
|
// var formData_ = clone(me.formData);
|
|
// formData_.product_category_name = null;
|
// formData_.product_category_id = null;
|
|
// me.formData = clone(formData_);
|
// }
|
// }
|
},
|
|
file_name_authorization_content: {
|
buttonarray: {
|
onclick: function(obj) {
|
var filenamefield = obj.obj.field;
|
var fileidfield = "file_authorization_content";
|
if(obj.buttonobj && obj.buttonobj.code == "showfile"){
|
me.showFileImgByFileId(filenamefield, fileidfield);
|
}else if (obj.buttonobj && obj.buttonobj.code == "upload"){
|
me.onPopupByUploadFile(filenamefield, fileidfield, me.dataname);
|
}else if (obj.buttonobj && obj.buttonobj.code == "delfile"){
|
me.deleteByFileId(filenamefield, fileidfield);
|
}
|
}
|
}
|
},
|
|
file_name_drug_license_original: {
|
buttonarray: {
|
onclick: function(obj) {
|
var filenamefield = obj.obj.field;
|
var fileidfield = "file_drug_license_original";
|
if(obj.buttonobj && obj.buttonobj.code == "showfile"){
|
me.showFileImgByFileId(filenamefield, fileidfield);
|
}else if (obj.buttonobj && obj.buttonobj.code == "upload"){
|
me.onPopupByUploadFile_zz("ZGL02", true, "zz","file_name_drug_license_original");
|
}else if (obj.buttonobj && obj.buttonobj.code == "delfile"){
|
me.deleteByFileId(filenamefield, fileidfield);
|
}
|
}
|
}
|
},
|
|
file_name_quality_agreement: {
|
buttonarray: {
|
onclick: function(obj) {
|
var filenamefield = obj.obj.field;
|
var fileidfield = "file_quality_agreement";
|
if(obj.buttonobj && obj.buttonobj.code == "showfile"){
|
me.showFileImgByFileId(filenamefield, fileidfield);
|
}else if (obj.buttonobj && obj.buttonobj.code == "upload"){
|
me.onPopupByUploadFile(filenamefield, fileidfield, "md_org_register");
|
}else if (obj.buttonobj && obj.buttonobj.code == "delfile"){
|
me.deleteByFileId(filenamefield, fileidfield);
|
}
|
}
|
}
|
},
|
|
file_name_quality_status: {
|
buttonarray: {
|
onclick: function(obj) {
|
var filenamefield = obj.obj.field;
|
var fileidfield = "file_quality_status";
|
if(obj.buttonobj && obj.buttonobj.code == "showfile"){
|
me.showFileImgByFileId(filenamefield, fileidfield);
|
}else if (obj.buttonobj && obj.buttonobj.code == "upload"){
|
me.onPopupByUploadFile(filenamefield, fileidfield, "md_org_register");
|
}else if (obj.buttonobj && obj.buttonobj.code == "delfile"){
|
me.deleteByFileId(filenamefield, fileidfield);
|
}
|
}
|
}
|
},
|
|
authorization_province: {
|
visible: {
|
onchange: function(obj) {//下拉展开事件
|
var formFields_ = clone(me.formFields);
|
let param_ = {
|
isClientMode: false,
|
dataname: "md_province",
|
}
|
Server.call("root/data/getEntitySet", param_, function(result) {
|
if (result && result.data) {
|
var options_ = result.data.entityset;
|
for(var i=0; i<options_.length;i++) {
|
options_[i].code = options_[i].name;
|
options_[i].value = options_[i].name;
|
}
|
formFields_.map(e=>{
|
if(e.field == "authorization_province") {
|
e.options = options_;
|
}
|
})
|
}
|
me.formFields = formFields_;
|
});
|
},
|
},
|
},
|
|
province: {//字段事件设置
|
visible: {
|
onchange: function(obj) {//下拉展开事件
|
var formFields_ = clone(me.formFields);
|
let param_ = {
|
isClientMode: false,
|
dataname: "md_province",
|
}
|
Server.call("root/data/getEntitySet", param_, function(result) {
|
if (result && result.data) {
|
var options_ = result.data.entityset;
|
for(var i=0; i<options_.length;i++) {
|
options_[i].code = options_[i].name;
|
options_[i].value = options_[i].name;
|
}
|
formFields_.map(e=>{
|
if(e.field == "province") {
|
e.options = options_;
|
}
|
})
|
}
|
me.formFields = formFields_;
|
});
|
},
|
},
|
select: {
|
onchange: function(obj) {//下拉展开事件
|
var formData_ = clone(me.formData);
|
var formFields_ = clone(me.formFields);
|
formData_.city = "";
|
formData_.county = "";
|
me.formData = formData_;
|
},
|
},
|
},
|
|
city: {//字段事件设置
|
visible: {
|
onchange: function(fieldObj, row, callback) {//下拉展开事件
|
let param_p = {
|
isClientMode: false,
|
dataname: "md_province",
|
filter: [
|
{field: "name", value: row.province}
|
]
|
}
|
Server.call("root/data/getEntitySet", param_p, function(resultp) {
|
if (resultp && resultp.data) {
|
let param_ = {
|
dataname: "md_city",
|
filter:[
|
{"field": "province_id", "value":resultp.data.entityset[0].id}
|
]
|
}
|
Server.call("root/data/getEntitySet", param_, function(result) {
|
if (result && result.data) {
|
var options_ = result.data.entityset;
|
for(var i=0; i<options_.length;i++) {
|
options_[i].code = options_[i].name;
|
options_[i].value = options_[i].name;
|
}
|
//重新设置选择项
|
if (callback) {
|
var obj_ = {
|
options: options_
|
};
|
callback(obj_);
|
}
|
}
|
});
|
}
|
});
|
|
// var formFields_ = clone(me.filterFields);
|
// let param_ = {
|
// dataname: "md_city",
|
// filter: "parent_id='" + me.formData.customer_id + "'",
|
// }
|
|
// Server.call("root/data/getEntitySet", param_, function(result) {
|
// if (result && result.data) {
|
// var options_ = result.data.entityset;
|
// for(var i=0; i<options_.length;i++) {
|
// options_[i].code = options_[i].address;
|
// options_[i].value = options_[i].address;
|
// }
|
// // formFields_.map(e=>{
|
// // if(e.field == "province") {
|
// // e.options = options_;
|
// // }
|
// // })
|
// //重新设置选择项
|
// if (callback) {
|
// var obj_ = {
|
// options: options_
|
// };
|
// callback(obj_);
|
// }
|
// }
|
// // me.filterFields = formFields_;
|
// });
|
},
|
},
|
select: {
|
onchange: function(obj) {//下拉展开事件
|
var formData_ = clone(me.formData);
|
var formFields_ = clone(me.formFields);
|
formData_.county = "";
|
me.formData = formData_;
|
},
|
},
|
},
|
|
county: {
|
visible: {
|
onchange: function(fieldObj, row, callback) {//下拉展开事件
|
let param_p = {
|
dataname: "md_city",
|
filter: [
|
{field: "name", value: row.city}
|
]
|
}
|
Server.call("root/data/getEntitySet", param_p, function(resultp) {
|
if (resultp && resultp.data) {
|
let param_ = {
|
dataname: "md_county",
|
filter:[
|
{"field": "city_id", "value":resultp.data.entityset[0].id}
|
]
|
}
|
Server.call("root/data/getEntitySet", param_, function(result) {
|
if (result && result.data) {
|
var options_ = result.data.entityset;
|
for(var i=0; i<options_.length;i++) {
|
options_[i].code = options_[i].name;
|
options_[i].value = options_[i].name;
|
}
|
//重新设置选择项
|
if (callback) {
|
var obj_ = {
|
options: options_
|
};
|
callback(obj_);
|
}
|
}
|
});
|
}
|
});
|
},
|
},
|
},
|
|
category_name:{
|
select:{
|
onchange: function(obj) {//下拉展开事件
|
var formData_ = clone(me.formData);
|
formData_.category_name = obj.selectoption.value || "";
|
me.formData = formData_;
|
},
|
}
|
},
|
|
actor: {//经销商
|
select: {
|
onchange: function(obj) {//下拉展开事件
|
//关联经销商
|
if(obj.selectoption.code == "Connected") {
|
me.connectActor = true;
|
}
|
else {
|
me.connectActor = false;
|
|
var formFields_ = clone(me.formFields);
|
var formData_ = clone(me.formData)
|
formFields_.map(f => {
|
if(f.field == "product_category_name") {
|
f.options = me.product_group;
|
}
|
})
|
formData_.relation_code = "";
|
formData_.relation_id = "";
|
formData_.relation_name = "";
|
me.formData = clone(formData_);
|
me.formFields = clone(formFields_);
|
}
|
|
//配送商
|
var mark = null;
|
if(obj.selectoption.code == "Distributor") {
|
mark = false;
|
}
|
else {
|
mark = true;
|
}
|
|
var formFields_ = clone(me.formFields);
|
formFields_.map(f => {
|
if(f.field == 'email') {
|
f.required = mark;
|
}
|
})
|
me.formFields = clone(formFields_);
|
},
|
}
|
},
|
};
|
|
this.tablefieldClick = {
|
authorization_type: {//授权类型
|
select: {
|
onchange: function(obj) {//下拉更改事件
|
var aa = obj;
|
// Root.message({
|
// type: 'success',
|
// message: '下拉更改事件'
|
// });
|
// if (change_org_hospital[]) {
|
|
// }
|
|
}
|
},
|
// defaultval: {
|
// val: "选择",//空值时的显示值
|
// onclick: function(obj) {//默认值点击事件,此事件需要设置val才有效
|
// Root.message({
|
// type: 'success',
|
// message: '默认值点击事件'
|
// });
|
// }
|
// },
|
},
|
category_name: {//授权产品
|
val: {
|
notclick_val: "",//不可点击的值,1、是数组["11","22"];2、以“;”分隔的字符串"111;222"
|
notclick_bindfield: [],//当该字段值等于指定字段值时不可点击["filterfield": "111"]
|
onclick: function(obj) {//数据值点击事件
|
me.editHospital(obj.row, "browse")
|
},
|
},
|
defaultval: {
|
val: "查看",//空值时的显示值
|
onclick: function(obj) {//默认值点击事件,此事件需要设置val才有效
|
me.editHospital(obj.row, "browse")
|
}
|
},
|
|
},
|
};
|
},
|
|
tablepopup_customerlist(obj) {
|
var me = this;
|
var filter_ = "actor='First'";
|
var actor_ = this.formData.actor;
|
var text_ = "选择经销商";
|
if (obj.obj.field == "superior_name") {
|
text_ = "选择上级经销商"
|
}
|
// else if (obj.obj.field == "relation_name") {
|
// text_ = "选择经销商"
|
// }
|
|
if (actor_ == "Distributor") {//配送商
|
filter_ = "actor='First' and state_code = 'Open'";//一级经销商
|
}
|
else if (actor_ == "Second") {//二级经销商
|
filter_ = "actor='Platform' and state_code = 'Open'";//平台商
|
}
|
else if (actor_ == "Connected") {//关联经销商
|
filter_ = "actor = 'First' and state_code = 'Open'"
|
}
|
|
Root.showPopup({
|
icon: "icon-product",
|
text: text_,
|
url: "module/agreement/page/popup_customer.html",
|
width: 900,
|
height: 550,
|
data: {},
|
sceneCode: "add",
|
filter: filter_,
|
callback: function(callbackobj, callback) {
|
var formData_ = clone(me.formData);
|
|
if(actor_ == "Connected"){
|
if(formData_.relation_id != callbackobj.row.id) {
|
if(me.tableData.length > 0) {
|
me.tableData.map(h =>{
|
me.rowChange(h, "del", "md_org_hospital", 'scilent');
|
})
|
}
|
}
|
formData_.relation_name = callbackobj.row.name;
|
formData_.relation_id = callbackobj.row.id;
|
formData_.relation_code = callbackobj.row.code;
|
formData_.product_category_name = [];
|
formData_.product_category_id = [];
|
|
let param = {
|
dataname: "md_org_product",
|
filter: "parent_id = '" + formData_.relation_id + "'",
|
}
|
Server.call("root/data/getEntitySet", param, function(result) {
|
if(result.data && result.data.entityset) {
|
// var saveGrantProduct = [];
|
// for(var p in result.data.entityset) {
|
// saveGrantProduct.push(result.data.entityset[p].product_category_id)
|
// }
|
var saveGrantProduct = result.data.entityset.map(p => p.product_category_id);
|
console.log("options_limit: ", saveGrantProduct);
|
|
var options = [];
|
saveGrantProduct.map( p => {
|
var option = {
|
code: p,
|
value: me.product_group_map[p]
|
}
|
options.push(option);
|
})
|
var formFields_ = clone(me.formFields);
|
formFields_.map(f => {
|
if(f.field == "product_category_name") {
|
f.options = options;
|
console.log(f);
|
}
|
})
|
me.formFields = clone(formFields_);
|
}
|
me.formData = formData_;
|
})
|
}
|
else {
|
formData_.superior_name = callbackobj.row.name;
|
formData_.superior_code = callbackobj.row.code;
|
me.formData = formData_;
|
}
|
|
if (callback) {
|
callback();
|
}
|
}
|
});
|
},
|
|
onPopupByUploadFile_zz(zz_code, isupform, type,zname) {
|
var me = this;
|
var analysistype_ = "";
|
var delta_ = {filetypelist: []};
|
var data_ = {};
|
if(zz_code == "ZGL01") {
|
analysistype_ = "BizLicense";
|
delta_ = {filetypelist: [".png", ".jpg"], analysistype: analysistype_}
|
}
|
else if(zz_code == "ZGL02"){
|
analysistype_ = "EnterpriseLicense";
|
delta_ = {filetypelist: [".png", ".jpg"], analysistype: analysistype_};
|
|
data_ = {
|
dataName: "md_org_register",
|
fileidfieldName: "file_drug_license_original",
|
id: me.formData.id,
|
fileNamefieldName: "file_name_drug_license_original"
|
}
|
}
|
else if(zz_code == "ZGL03") {
|
analysistype_ = "BizYPLicence";
|
delta_ = {filetypelist: [".png", ".jpg"], analysistype: analysistype_}
|
}
|
else if(zz_code == "ZGL06") {
|
analysistype_ = "BizGSP";
|
delta_ = {filetypelist: [".png", ".jpg"], analysistype: analysistype_}
|
}
|
var config = {
|
totab: false,
|
width: "900px",
|
icon: "icon-product",
|
text: "附件上传",
|
id: "popupByUploadFile",
|
url: "module/tool/page/popup_uploadFile.html",
|
data: data_,
|
delta: delta_,
|
callback: function(obj, callback) {
|
me.uploadFileAfter(zz_code, obj, isupform, type,zname);
|
// me.fileList = obj.row[0];
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
this.doPopupByPublic(config);
|
},
|
|
uploadFileAfter(zz_code, obj, isupform, type,zname) {
|
var me = this;
|
if (type == "zz") {
|
this.uploadFormByZZ(zz_code, obj, isupform,zname);
|
}
|
else if (type == "kp") {
|
this.uploadFormByKP(zz_code, obj,zname);
|
}
|
else if (type == "fhztfj") {
|
this.uploadFormByfhztfj(obj);
|
}
|
|
else if (type == "syxxfj") {
|
this.uploadFormBysyxxfj(obj,zname);
|
}
|
|
},
|
|
uploadFormByZZ(zz_code, obj, isupform,zname) {
|
var me = this;
|
var file_ = obj.row[0];
|
var filetxt = obj.filetxt;
|
var formData_ = clone(me.formDatas);
|
var formFieldss_ = clone(me.formFieldss);
|
|
var field_id = "";
|
if(zname == "file_name_drug_license_original"){
|
field_id= "file_drug_license_original"
|
formData_[zname] =file_.name;
|
formData_[field_id] = file_.id;
|
if (filetxt.EnterpriseLicenseInfos) {
|
filetxt.EnterpriseLicenseInfos.map(e=>{
|
console.log(e.Name,e.Value)
|
if (e.Value && typeof(e.Value) == "string") {
|
//去除两端的空格
|
e.Value = e.Value.replace(/(^\s*)|(\s*$)/g, "");
|
//去除两端的Tab
|
e.Value = e.Value.replace(/(^\t*)|(\t*$)/g, "");
|
//去除首端的特殊字符
|
e.Value = delInvalidCharacter(e.Value, [":",":"]);
|
//去除中间所有"
|
e.Value = e.Value.replace(/\"/g,"");
|
}
|
console.log(e.Name,e.Value)
|
if(e.Name == "企业负责人"){
|
formData_.instrument_license_ceo = e.Value;
|
}else if(e.Name == "许可证编号"){
|
formData_.instrument_license_no = e.Value;
|
}else if(e.Name == "住所"){
|
formData_.instrument_license_address = e.Value;
|
}else if(e.Name == "有效期限"){
|
var txt = e.Value;
|
formFieldss_.map(f=>{
|
if (f.field == "instrument_date_to") {
|
f.placeholder = e.Value
|
}
|
})
|
var txtList = txt.split("至");
|
if(txtList[0] == "年月日"){
|
txt = "2099-12-31";
|
}
|
else {
|
if (txtList.length > 1) {
|
if(txtList[1].indexOf("长期") != -1 || txtList[1].indexOf("永久") != -1 || txtList[1].indexOf("不约定期限") != -1){
|
txt = "2099-12-31";
|
}
|
else {
|
txt = txtList[1];
|
|
txt = txt.replace("年", "-");
|
txt = txt.replace("月", "-");
|
txt = txt.replace("日", "");
|
var datas_ = txt.split("-");
|
var txt_ = "";
|
datas_.map(d=>{
|
d = d * 1;
|
if (txt_ == "") {
|
txt_ = d;
|
}
|
else {
|
txt_ += "-" + d;
|
}
|
})
|
txt = txt_.toString();
|
if(txt && txt.search && txt.search(/^[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}$/) == -1) {
|
txt = ""
|
}
|
}
|
}
|
else if (txtList.length == 1) {
|
txt = txtList[0];
|
if(txt.indexOf("长期") != -1 || txt.indexOf("永久") != -1 || txt.indexOf("不约定期限") != -1){
|
txt = "2099-12-31";
|
}
|
txt = txt.replace("年", "-");
|
txt = txt.replace("月", "-");
|
txt = txt.replace("日", "");
|
var datas_ = txt.split("-");
|
var txt_ = "";
|
datas_.map(d=>{
|
d = d * 1;
|
if (txt_ == "") {
|
txt_ = d;
|
}
|
else {
|
txt_ += "-" + d;
|
}
|
})
|
txt = txt_.toString();
|
if(txt && txt.search && txt.search(/^[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}$/) == -1) {
|
txt = ""
|
}
|
}
|
}
|
e.Value = txt;
|
formData_.instrument_date_to = e.Value;
|
}else if(e.Name == "经营范围"){
|
formData_.instrument_business_scope = e.Value;
|
}else if(e.Name == "经营方式"){
|
formData_.instrument_business_type = e.Value;
|
}else if(e.Name == "经营场所"){
|
formData_.instrument_license_business_address = e.Value;
|
}else if(e.Name == "库房地址"){
|
formData_.instrument_warehouse_address = e.Value;
|
} else if(e.Name == "发证日期"){
|
var txt = e.Value;
|
formFieldss_.map(f=>{
|
if (f.field == "instrument_date_from") {
|
f.placeholder = e.Value
|
}
|
})
|
var txtList = txt.split("至");
|
if(txtList[0] == "年月日"){
|
txt = "2099-12-31";
|
}
|
else {
|
if (txtList.length > 1) {
|
if(txtList[1].indexOf("长期") != -1 || txtList[1].indexOf("永久") != -1 || txtList[1].indexOf("不约定期限") != -1){
|
txt = "2099-12-31";
|
}
|
else {
|
txt = txtList[1];
|
|
txt = txt.replace("年", "-");
|
txt = txt.replace("月", "-");
|
txt = txt.replace("日", "");
|
|
var datas_ = txt.split("-");
|
var txt_ = "";
|
datas_.map(d=>{
|
d = d * 1;
|
if (txt_ == "") {
|
txt_ = d;
|
}
|
else {
|
txt_ += "-" + d;
|
}
|
})
|
txt = txt_.toString();
|
if(txt && txt.search && txt.search(/^[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}$/) == -1) {
|
txt = ""
|
}
|
}
|
}
|
else if (txtList.length == 1) {
|
txt = txtList[0];
|
if(txt.indexOf("长期") != -1 || txt.indexOf("永久") != -1 || txt.indexOf("不约定期限") != -1){
|
txt = "2099-12-31";
|
}
|
txt = txt.replace("年", "-");
|
txt = txt.replace("月", "-");
|
txt = txt.replace("日", "");
|
var datas_ = txt.split("-");
|
var txt_ = "";
|
datas_.map(d=>{
|
d = d * 1;
|
if (txt_ == "") {
|
txt_ = d;
|
}
|
else {
|
txt_ += "-" + d;
|
}
|
})
|
txt = txt_.toString();
|
if(txt && txt.search && txt.search(/^[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}$/) == -1) {
|
txt = ""
|
}
|
}
|
}
|
e.Value = txt;
|
formData_.instrument_date_from = e.Value;
|
}
|
})
|
}
|
}
|
// placeholder
|
me.formFieldss = formFieldss_;
|
me.formDatas = formData_;
|
},
|
|
onPopupByUploadFile(filenamefield, fileidfield,dataname) {
|
var me = this;
|
var analysistype_ = "";
|
var formData_ = clone(me.formData);
|
var formDatas_ = clone(me.formDatas);
|
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
|
},
|
delta: delta_,
|
callback: function(obj, callback) {
|
me.$message({
|
showClose: true,
|
message: '上传成功!',
|
type: 'success'
|
});
|
if(filenamefield == "file_name_authorization_content"){
|
formData_[filenamefield] =decodeURI(obj.row[0].name);
|
formData_[fileidfield] = obj.row[0].id;
|
}else if(filenamefield == "file_name_drug_license_original"){
|
formDatas_[filenamefield] =decodeURI(obj.row[0].name);
|
formDatas_[fileidfield] = obj.row[0].id;
|
}else if(filenamefield == "file_name_quality_agreement"){
|
formDatas_[filenamefield] =decodeURI(obj.row[0].name);
|
formDatas_[fileidfield] = obj.row[0].id;
|
}else if(filenamefield == "file_name_quality_status"){
|
formDatas_[filenamefield] =decodeURI(obj.row[0].name);
|
formDatas_[fileidfield] = obj.row[0].id;
|
}
|
me.formData = formData_;
|
me.formDatas = formDatas_;
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
this.doPopupByPublic(config);
|
},
|
|
deleteByFileId(filenamefield, fileidfield){
|
var me = this;
|
var formData_ = clone(me.formData);
|
var formDatas_ = clone(me.formDatas);
|
if(filenamefield == "file_name_authorization_content"){
|
formData_[filenamefield] = "";
|
formData_[fileidfield] = "";
|
}else if(filenamefield == "file_name_drug_license_original"){
|
formDatas_[filenamefield] = "";
|
formDatas_[fileidfield] = "";
|
}else if(filenamefield == "file_name_quality_agreement"){
|
formDatas_[filenamefield] = "";
|
formDatas_[fileidfield] = "";
|
}else if(filenamefield == "file_name_quality_status"){
|
formDatas_[filenamefield] = "";
|
formDatas_[fileidfield] = "";
|
}
|
|
me.formData = formData_;
|
me.formDatas = formDatas_;
|
},
|
|
showFileImgByFileId(filenamefield, fileidfield) {
|
let me = this;
|
var formData_ = clone(me.formData);
|
var formDatas_ = clone(me.formDatas);
|
var file_id = "";
|
var file_name = "";
|
if(filenamefield == "file_name_authorization_content"){
|
file_id = formData_[fileidfield];
|
file_name = formData_[filenamefield]
|
}else if(filenamefield == "file_name_drug_license_original"){
|
file_id = formDatas_[fileidfield];
|
file_name = formDatas_[filenamefield]
|
}else if(filenamefield == "file_name_quality_agreement"){
|
file_id = formDatas_[fileidfield];
|
file_name = formDatas_[filenamefield]
|
}else if(filenamefield == "file_name_quality_status"){
|
file_id = formDatas_[fileidfield];
|
file_name = formDatas_[filenamefield]
|
}
|
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);
|
}
|
}
|
},
|
|
doPopupByPublic(config) {
|
if (config.totab) {
|
if (config.url) {
|
if (config.text.length > 4) {
|
config.text = config.text.substr(0, 4) + "...";
|
}
|
}
|
var parames = {
|
totab: true,
|
url: config.url,
|
sceneCode: config.sceneCode,
|
data: config.data,
|
delta: config.delta,
|
disabled: config.disabled,
|
disabledone: config.disabledone,
|
operationtype: config.operationtype,
|
parentOption: window.top.tab.selected.option
|
};
|
|
Root.popupParames = parames;
|
|
window.top.tab.open(config);
|
}
|
else {
|
this.doPopup(config);
|
}
|
},
|
|
// tablepopup_productlist(obj){
|
// var me = this;
|
// Root.showPopup({
|
// icon: "icon-product",
|
// text: "选择产品分类",
|
// url: "module/md/page/customer/page/popup/product_classify.html",
|
// width: 700,
|
// height: 450,
|
// data: {},
|
// sceneCode: "add",
|
// callback: function(callbackobj, callback) {
|
// // console.log(callbackobj)
|
// me.tableData[0].category_name = callbackobj.row.category_name;
|
// if (callback) {
|
// callback();
|
// }
|
// }
|
// });
|
// },
|
|
editData(scope) {
|
let me = this;
|
let row = scope.row;
|
let index_ = scope.$index;
|
|
this.editHospital(row, "edit");
|
},
|
|
addHospital() {
|
var me = this;
|
|
var id_ = new Date().getTime();//1670392074539
|
var id2_ = id_ + uuid(4);//时间戳+4位随机数
|
var row_ = {
|
id: id2_,
|
parent_id: this.formData.id,
|
authorization_type: "",
|
category_name: [],
|
}
|
me.editHospital(row_, "add");
|
},
|
|
// openConnectHospital(code) {
|
// let me = this;
|
|
// var config = {
|
// totab: false, //true: 以Tab导航的方式打开
|
// width: "950px",
|
// height: "500px",
|
// icon: "icon-product",
|
// text: "关联授权医院选择",
|
// id: "connect_org_hospital_list" + "add",//totab: true时需设置,用于判断是否已打开此页面
|
// url: "module/md/page/customer/page/popup/connect_org_hospital_list.html",
|
// // data: "",
|
// // delta: "",
|
// filter: "org_code ='" + code + "'",
|
// sceneCode: "add",//"edit", //"add"//"browse",
|
// callback: function(obj, callback) {
|
// // obj.row.category_name = null;
|
|
// // if (sceneCode == "add") {
|
// me.tableData.unshift(obj.row);
|
// // }
|
|
// // else {
|
// // var tableData_ = clone(me.tableData)
|
|
// // tableData_.map(f=>{
|
// // if(f.id == row.id){
|
// // f = obj.row;
|
// // }
|
// // })
|
|
// // me.tableData = tableData_;
|
|
// // me.getOrgHospital();
|
// // console.log(row);
|
// // row = obj.row;
|
// // }
|
// me.getOrgHospital();
|
// // me.change_org_hospital[obj.row.id] = obj.row;
|
// if (callback) {
|
// callback();
|
// }
|
// }
|
// };
|
// me.doPopupByPublic(config);
|
// },
|
|
editHospital(row, sceneCode){
|
let me = this;
|
var delta_ = {};
|
var mark = true;
|
var idList = [];
|
|
if(!me.formData.actor) {
|
Root.message({
|
type: 'warning',
|
message: '请先选择经销商类型'
|
});
|
return
|
}
|
|
if(me.connectActor == true) {
|
if(!me.formData.relation_code) {
|
mark = false;
|
}
|
}
|
|
if(!mark) {
|
Root.message({
|
type: 'warning',
|
message: '请先选择开户经销商'
|
});
|
return
|
}
|
|
if (this.formData.product_category_name && this.formData.product_category_name.length) {
|
var product_group_ = []
|
var product_group_map_ = {};
|
this.formData.product_category_name.map(val=>{
|
var option_ = {
|
code: val,
|
value: this.product_group_map[val]
|
}
|
product_group_.push(option_);
|
product_group_map_[val] = this.product_group_map[val];
|
})
|
|
delta_.product_group = product_group_;
|
delta_.product_group_map = product_group_map_;
|
|
}
|
else {
|
Root.message({
|
type: 'warning',
|
message: '请先选择经销商的授权产品'
|
});
|
return
|
}
|
|
delta_.isConnect = me.connectActor;
|
delta_.connectCode = me.formData.relation_code;
|
|
if(me.tableData.length > 0) {
|
me.tableData.map(i =>{
|
idList.push(i.id);
|
})
|
delta_.idList = idList;
|
|
//filter hospital
|
var filter = "id not in (";
|
me.tableData.map(hi =>{
|
filter += "'" + hi.hospital_id + "',";
|
})
|
filter = filter.slice(0, -1) + ")";
|
delta_.filter = filter;
|
}
|
|
//Brooke - 判断是否管理员修改,传参给popup
|
if(me.popupParames.sceneCode == "adminedit") {
|
delta_.isAdmin = true;
|
delta_.state_code = me.formData.state_code;
|
}
|
|
var config = {
|
totab: false, //true: 以Tab导航的方式打开
|
width: "950px",
|
height: "500px",
|
icon: "icon-product",
|
text: "医院选择",
|
id: "org_hospital_edit",//totab: true时需设置,用于判断是否已打开此页面
|
url: "module/md/page/customer/page/popup/org_hospital_edit.html",
|
data: row,
|
delta: delta_,
|
// filter: "state_code!='UnderApproval'",
|
sceneCode: sceneCode,//"edit", //"add"//"browse",
|
callback: function(obj, callback) {
|
// obj.row.category_name = null;
|
console.log('XX',obj.row);
|
|
if (sceneCode == "add") {
|
me.tableData.unshift(obj.row);
|
console.log('Xdd',me.tableData);
|
}
|
|
else {
|
var tableData_ = clone(me.tableData)
|
|
tableData_.map(f=>{
|
if(f.id == row.id){
|
f = obj.row;
|
}
|
})
|
me.tableData = tableData_;
|
// console.log(row);
|
// row = obj.row;
|
}
|
|
me.getOrgHospital();
|
// me.change_org_hospital[obj.row.id] = obj.row;
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
},
|
|
delData(scope) {
|
let me = this;
|
let row = scope.row;
|
let index_ = scope.$index;
|
|
//Brooke
|
let prompt = '';
|
if(me.popupParames.sceneCode == "adminedit" && (me.formData.state_code == "Open" || me.formData.state_code == "open")) {
|
prompt = '并更新授权书';
|
}
|
|
Root.confirm('确定删除医院【' + row.name + '】' + prompt + '吗?', '删除提示', {
|
confirmButtonText: '删除',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
me.rowChange(row, "del", "md_org_hospital");
|
}).catch(() => {
|
Root.message({
|
type: 'info',
|
message: '已取消删除'
|
});
|
});
|
},
|
|
rowChange(row, type, tablename, notion_type) {
|
var me = this;
|
if (type == "add") {
|
this.tableData.unshift(row);
|
}
|
else if (type == "del") {
|
if (row.id) {
|
let param = {
|
dataname: tablename,
|
id: row.id,
|
}
|
|
Server.call("root/data/deleteEntity", param, function(result) {
|
console.log(result);
|
if (result && result.data) {
|
me.tableData.remove(row);
|
|
if(me.popupParames.sceneCode == "adminedit" && (me.formData.state_code == "Open" || me.formData.state_code == "open")) {
|
//Brooke-等待接口完善
|
let param_admin = {
|
dataname: tablename,
|
id: row.id,
|
parent_id: row.parent_id,
|
hospital_id: row.hospital_id,
|
operate_type: "delete",
|
};
|
|
Server.call("root/orgBizLogic/authorizationBook", param_admin, function(result) {
|
if(result.success) {
|
Root.message({
|
type: 'success',
|
message: '客户授权信息及授权书更新成功'
|
});
|
}
|
}, function(error) {
|
me.loading_save = false;
|
Root.message({
|
type: 'error',
|
message: '授权书更新失败'
|
});
|
});
|
}
|
else {
|
if(!notion_type || notion_type != 'scilent') {
|
Root.message({
|
type: 'success',
|
message: '删除授权医院成功!'
|
});
|
}
|
|
|
}
|
}
|
});
|
}
|
else {
|
this.tableData.remove(row);
|
this.add_org_hospital.remove(row);
|
}
|
}
|
else {
|
|
}
|
},
|
|
uploadFileFun_file(one, fileList, type) {
|
let me = this;
|
let formData = new FormData()
|
formData.append("category" , "org");
|
formData.append("oneFile" , one.raw);
|
|
formData.append("id", me.formData.id);
|
formData.append("dataName", "md_org_register");
|
formData.append("field_fileName", "file_name_certificate_original");
|
formData.append("field_fileId", "file_certificate_original");
|
|
me.imgLoading = true;
|
uploadFileOCR("bizLicense", me, formData, function(result_){
|
var form_data_ = {};
|
|
if (result_.data && result_.data.data && result_.data.data.upload && result_.data.data.ocr && result_.data.data.ocr.operator) {
|
var file_ = result_.data.data.upload;
|
var ocr_ = result_.data.data.ocr;
|
|
if (typeof(ocr_.content)=="string") {
|
ocr_.content = JSON.parse(ocr_.content);
|
}
|
|
for (var k in ocr_.content) {
|
// var v_ = decodeURI(ocr_[k]);
|
var v_ = ocr_.content[k];
|
if ( "string" == typeof v_) {
|
//去除两端的空格
|
v_ = v_.replace(/(^\s*)|(\s*$)/g, "");
|
//去除中间的回车换行
|
v_ = v_.replace(/[\r\n]/g,"");
|
//去除中间所有"
|
v_ = v_.replace(/\"/g,"");
|
}
|
form_data_[k] = v_;
|
}
|
|
me.fileobj = file_;
|
me.ocrobj = form_data_;
|
console.log("识别信息",form_data_);
|
me.imgurl = config.url_root + "root/file/getFile?category=org&token=" + Root.getToken() + "&id=" + file_.indexid;
|
}
|
else {
|
me.$message({
|
type:"warning",
|
message:"识别失败"
|
})
|
}
|
|
if (me.ocrobj.Period) {
|
var txt = me.ocrobj.Period;
|
me.ocrobj.Period = ocrDateFormatter(txt);
|
// var txtList = txt.split("至");
|
// if(txtList[0] == "年月日"){
|
// txt = "2099-12-31";
|
// }
|
// else {
|
// if (txtList.length > 1) {
|
// if(txtList[1].indexOf("长期") != -1 || txtList[1].indexOf("永久") != -1){
|
// txt = "2099-12-31";
|
// }
|
// else {
|
// txt = txtList[1];
|
|
// txt = txt.replace("年", "-");
|
// txt = txt.replace("月", "-");
|
// txt = txt.replace("日", "");
|
// var datas_ = txt.split("-");
|
// var txt_ = "";
|
// datas_.map(d=>{
|
// d = d * 1;
|
// if (txt_ == "") {
|
// txt_ = d;
|
// }
|
// else {
|
// txt_ += "-" + d;
|
// }
|
// })
|
// txt = txt_.toString();
|
// if(txt && txt.search && txt.search(/^[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}$/) == -1) {
|
// txt = ""
|
// }
|
// //licenceObj_[k] = txt;
|
// }
|
// }
|
// else if (txtList.length == 1) {
|
// txt = txtList[0];
|
// if(txt.indexOf("长期") != -1 || txt.indexOf("永久") != -1){
|
// txt = "2099-12-31";
|
// }
|
// txt = txt.replace("年", "-");
|
// txt = txt.replace("月", "-");
|
// txt = txt.replace("日", "");
|
// var datas_ = txt.split("-");
|
// var txt_ = "";
|
// datas_.map(d=>{
|
// d = d * 1;
|
// if (txt_ == "") {
|
// txt_ = d;
|
// }
|
// else {
|
// txt_ += "-" + d;
|
// }
|
// })
|
// txt = txt_.toString();
|
// if(txt && txt.search && txt.search(/^[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}$/) == -1) {
|
// txt = ""
|
// }
|
// }
|
// }
|
// me.ocrobj.Period = txt;
|
}
|
|
if (me.ocrobj.SetDate) {
|
var txt = me.ocrobj.SetDate;
|
me.ocrobj.SetDate = ocrDateFormatter(txt);
|
// var txtList = txt.split("至");
|
// if(txtList[0] == "年月日"){
|
// txt = "2099-12-31";
|
// }
|
// else {
|
// if (txtList.length > 1) {
|
// if(txtList[1].indexOf("长期") != -1 || txtList[1].indexOf("永久") != -1){
|
// txt = "2099-12-31";
|
// }
|
// else {
|
// txt = txtList[1];
|
|
// txt = txt.replace("年", "-");
|
// txt = txt.replace("月", "-");
|
// txt = txt.replace("日", "");
|
// var datas_ = txt.split("-");
|
// var txt_ = "";
|
// datas_.map(d=>{
|
// d = d * 1;
|
// if (txt_ == "") {
|
// txt_ = d;
|
// }
|
// else {
|
// txt_ += "-" + d;
|
// }
|
// })
|
// txt = txt_.toString();
|
// if(txt && txt.search && txt.search(/^[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}$/) == -1) {
|
// txt = ""
|
// }
|
// //licenceObj_[k] = txt;
|
// }
|
// }
|
// else if (txtList.length == 1) {
|
// txt = txtList[0];
|
// if(txt.indexOf("长期") != -1 || txt.indexOf("永久") != -1){
|
// txt = "2099-12-31";
|
// }
|
// txt = txt.replace("年", "-");
|
// txt = txt.replace("月", "-");
|
// txt = txt.replace("日", "");
|
// var datas_ = txt.split("-");
|
// var txt_ = "";
|
// datas_.map(d=>{
|
// d = d * 1;
|
// if (txt_ == "") {
|
// txt_ = d;
|
// }
|
// else {
|
// txt_ += "-" + d;
|
// }
|
// })
|
// txt = txt_.toString();
|
// if(txt && txt.search && txt.search(/^[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}$/) == -1) {
|
// txt = ""
|
// }
|
// }
|
// }
|
// me.ocrobj.SetDate = txt;
|
}
|
|
var from_ = clone(me.formData);
|
console.log(form_data_);
|
from_.register_address = form_data_.Address || null;
|
from_.license_business_no = me.ocrobj.RegNum || null; // 营业执照-证照编号
|
from_.name = form_data_.Name;
|
from_.certificate_date_from = form_data_.SetDate;
|
from_.certificate_date_to = form_data_.Period;
|
from_.certificate_legal_representative = form_data_.Person;
|
from_.certificate_scope = form_data_.Business;
|
|
me.formData = from_;
|
|
me.imgLoading = false;
|
|
}, function() {
|
me.$message({
|
type:"warning",
|
message:"识别失败"
|
})
|
me.imgLoading = false;
|
});
|
|
// uploadFile(me, formData, result_ => {
|
// var id = result_.data.data.id;
|
// me.fileId = result_.data.data.id;
|
// let formData_ = new FormData()
|
// formData_.append("id", id);
|
// formData_.append("type" , "BizLicense");
|
// // me.getFilePreview(id, me.upload_file);
|
// uploadFileAnalysis("BizLicense", me, formData_, result_ => {
|
// var retObj_ = result_.data.data.parseresult;
|
// var form_data_ = {};
|
// if (retObj_.recognizewarncode) {
|
// for (var k in retObj_) {
|
// var v_ = decodeURI(retObj_[k]);
|
// if ( "string" == typeof v_) {
|
// //去除两端的空格
|
// v_ = v_.replace(/(^\s*)|(\s*$)/g, "");
|
// //去除中间的回车换行
|
// v_ = v_.replace(/[\r\n]/g,"");
|
// //去除中间所有"
|
// v_ = v_.replace(/\"/g,"");
|
// }
|
// form_data_[k] = v_;
|
// }
|
// }
|
// else {
|
// me.$message({
|
// type:"warning",
|
// message:"识别失败"
|
// })
|
// }
|
|
// var from_ = clone(this.formData);
|
// from_.address = form_data_.address;
|
// from_.name = form_data_.name;
|
|
// this.formData = from_;
|
|
// });
|
// })
|
},
|
|
delyyzz() {//删除营业执照
|
var me = this;
|
me.imgurl = "";
|
if (me.fileobj.indexid) {
|
me.fileobj.indexid = ""
|
}
|
/*
|
if (me.rowData[me.children_dataname] && me.rowData[me.children_dataname].id) {
|
register_id = me.rowData[me.children_dataname].id;
|
}
|
|
if (me.fileobj.indexid) {
|
param.data.md_org_register = {
|
id: register_id,
|
certificate_org_name: me.formData.name || null, // 企业名称
|
certificate_license_no: me.ocrobj.RegNum || null, // 营业执照-证照编号
|
certificate_date_from: me.ocrobj.SetDate || null, // 营业执照-注册日期
|
certificate_date_to: me.ocrobj.Period || null, // 营业执照-经营期限至
|
certificate_legal_representative: me.ocrobj.Person || null, //法定代表人
|
certificate_address: me.formData.register_address || null, // 营业执照-地址
|
file_certificate_original: me.fileobj.indexid || null, // 文件-营业执照-正本
|
file_name_certificate_original: me.fileobj.filename || null, // 文件名称-营业执照-正本
|
|
certificate_scope: me.ocrobj.Business || null, // 营业执照-经营范围
|
//certificate_phone: me.ocrobj.certificate_scope || null, // 营业执照-电话
|
//certificate_fax: me.ocrobj.certificate_scope || null, // 营业执照-传真
|
}
|
}
|
*/
|
},
|
|
showThumbnail(file, type, num) {
|
var me = this;
|
|
if(num == "2"){
|
return me.fileUrl;
|
}
|
if(type == "pic") {
|
return file.url;
|
}
|
|
// let fileName = file.name;
|
|
// let suffix = fileName.split(".").pop().toLowerCase();
|
// if ("cad" == suffix) {
|
// return "../../img/thumbnail/cad.svg";
|
// } else if ("pdf" == suffix) {
|
// return "../../img/thumbnail/pdf.svg";
|
// } else if (isAssetTypeAnImage(suffix)) {
|
// return file.url;
|
// } else {
|
// return "../../img/thumbnail/file.svg";
|
// }
|
|
// console.info(file);
|
},
|
|
|
//提交
|
submitRowTable() {
|
this.iscommit = true;
|
//必填项校验
|
var bo = this.$refs.form1.checkForm();
|
var bo2 = this.$refs.form2.checkForm();
|
|
if(bo && bo2){
|
this.saveRowTable();
|
}
|
else {
|
Root.message({
|
type: 'error',
|
message: '请填写必填项'
|
});
|
this.iscommit = false;
|
}
|
|
},
|
|
handleChange(){
|
var me = this;
|
if (me.activeName == "htable") {
|
if (me.data_tablename_map["md_org_hospital"].lasyload) {//需要二次加载
|
me.getOrgHospital();
|
}
|
}
|
},
|
|
getData(page) {
|
this.pagesize = page.pagesize;
|
this.pagenum = page.pagenum;
|
|
this.getOrgHospital();
|
},
|
|
getOrgHospital() {
|
var me = this;
|
console.log(me.formData.id);
|
//页面信息
|
var params = {
|
dataname: "md_org_data.md_org_hospital",
|
filter: "parent_id='" + me.formData.id + "'",
|
orderby: "create_time desc, code",
|
page: {
|
pageno: this.pagenum,
|
pagesize: this.pagesize
|
},
|
}
|
|
Server.call("root/data/getEntitySet", params, function(result) {
|
console.log(result);
|
|
if (result && result.data && result.data.entityset) {
|
var data_ = result.data.entityset;
|
me.tableData = data_;
|
me.total = result.data.page.recordcount;
|
}
|
else {
|
me.total = 0;
|
}
|
})
|
},
|
|
//保存
|
saveRowTable() {
|
var me = this;
|
this.loading_save = true;
|
var operator_ = "saveEntity";//新增保存
|
|
if ((this.formData.state_code == "WaitOpen" || this.formData.state_code == "Open" || this.formData.state_code == "Close") && !me.iscommit) {//变更保存
|
operator_ = "ChangeSave"
|
}
|
else if(me.iscommit) {
|
operator_ = "InputCommit";//提交
|
}
|
|
// this.formData.credit_amt = "10";
|
// this.formData.credit_available = "10";
|
// this.formData.order_date = "2022-09-23";
|
// this.formData.hope_delivery = "2022-09-23";
|
// this.formData.amt_available = "213123";
|
|
var entity_ = clone(this.formData);
|
var entity = {};
|
var md_org_biz_regist_scope_ = {};
|
var product_category_ = [];
|
var authorization_province_ = [];
|
var formdata_ = clone(this.formDatas);
|
var biz_regist_scope_ = formdata_["authorize_scope"];
|
var biz_regist_scope_obj = {
|
parent_id: me.formData.id,
|
is_2002: "F",
|
is_2017: "F",
|
is_13: "F"
|
}
|
|
biz_regist_scope_.map(scope=>{
|
biz_regist_scope_obj[scope] = "T"
|
})
|
|
md_org_biz_regist_scope_ = clone(biz_regist_scope_obj);
|
if (me.authorize_scope_id) {
|
md_org_biz_regist_scope_.id = me.authorize_scope_id
|
}
|
|
for (var r in entity_) {
|
if (r == "product_category_name") {
|
product_category_ = entity_[r];
|
}
|
else if (r == "authorization_province") {
|
authorization_province_.push(entity_[r]);
|
}
|
else if (entity_[r] || entity_[r] == "" || entity_[r] == 0) {
|
entity[r] = entity_[r];
|
}
|
}
|
|
let param = {
|
dataname: this.dataname,
|
// operator: operator_,
|
data: {},
|
}
|
param.data[this.dataname] = entity;
|
|
|
//子表授权省份
|
var province_ = [];
|
authorization_province_.map(provincename=>{
|
// var pcobj_name = me.province_group_map[provincename];
|
var row_pobj = {
|
province_code: provincename,
|
province_name: provincename
|
}
|
province_.push(row_pobj);
|
})
|
me.old_org_province.map(old_p=>{
|
var del_row_pcobj = {
|
id: old_p.id,
|
_operator: "delete"
|
}
|
province_.push(del_row_pcobj);
|
})
|
param.data["md_org_province"] = province_;
|
|
//子表授权产品
|
var product_group_ = [];
|
product_category_.map(pcid=>{
|
var pcobj_name = me.product_group_map[pcid];
|
var row_pcobj = {
|
product_category_id: pcid,
|
product_category_name: pcobj_name
|
}
|
product_group_.push(row_pcobj);
|
|
})
|
me.old_org_product.map(old_p=>{
|
var del_row_pcobj = {
|
id: old_p.id,
|
_operator: "delete"
|
}
|
product_group_.push(del_row_pcobj);
|
})
|
param.data["md_org_product"] = product_group_;
|
param.data["md_org_biz_regist_scope"] = Object.keys(md_org_biz_regist_scope_).length ? md_org_biz_regist_scope_ : null;
|
//子表授权医院
|
// md_org_hospital
|
// if (me.add_org_hospital && me.add_org_hospital.length) {
|
// var add_org_hospital_ = [];
|
// me.add_org_hospital.map(add_h=>{
|
// var add_row_hospital = {
|
// hospital_id: add_h.hospital_id,
|
// authorization_type: add_h.authorization_type,
|
// }
|
// add_org_hospital_.push(add_row_hospital);
|
// })
|
|
// param.data["md_org_hospital"] = add_org_hospital_;
|
// }
|
|
//营业执照的信息
|
var register_id = "";
|
if (me.rowData[me.children_dataname] && me.rowData[me.children_dataname].id) {
|
register_id = me.rowData[me.children_dataname].id;
|
}
|
|
if (me.fileobj.indexid) {
|
/*
|
param.data.md_org_register = {
|
id: register_id,
|
certificate_org_name: me.formData.name || null, // 企业名称
|
certificate_license_no: me.ocrobj.RegNum || null, // 营业执照-证照编号
|
certificate_date_from: me.ocrobj.SetDate || null, // 营业执照-注册日期
|
certificate_date_to: me.ocrobj.Period || null, // 营业执照-经营期限至
|
certificate_legal_representative: me.ocrobj.Person || null, //法定代表人
|
certificate_address: me.formData.register_address || null, // 营业执照-地址
|
file_certificate_original: me.fileobj.indexid || null, // 文件-营业执照-正本
|
file_name_certificate_original: me.fileobj.filename || null, // 文件名称-营业执照-正本
|
|
certificate_scope: me.ocrobj.Business || null, // 营业执照-经营范围
|
//certificate_phone: me.ocrobj.certificate_scope || null, // 营业执照-电话
|
//certificate_fax: me.ocrobj.certificate_scope || null, // 营业执照-传真
|
}
|
|
*/
|
param.data.md_org_register = {
|
id: register_id,
|
certificate_org_name: me.formData.name || null, // 企业名称
|
certificate_license_no: me.formData.license_business_no || null, // 营业执照-证照编号
|
certificate_date_from: me.formData.certificate_date_from || null, // 营业执照-注册日期
|
certificate_date_to: me.formData.certificate_date_to || null, // 营业执照-经营期限至
|
certificate_legal_representative: me.formData.certificate_legal_representative || null, //法定代表人
|
certificate_address: me.formData.register_address || null, // 营业执照-地址
|
file_certificate_original: me.fileobj.indexid || null, // 文件-营业执照-正本
|
file_name_certificate_original: me.fileobj.filename || null, // 文件名称-营业执照-正本
|
|
certificate_scope: me.formData.certificate_scope || null, // 营业执照-经营范围
|
//certificate_phone: me.ocrobj.certificate_scope || null, // 营业执照-电话
|
//certificate_fax: me.ocrobj.certificate_scope || null, // 营业执照-传真
|
}
|
}
|
else if (register_id) {
|
param.data.md_org_register = {
|
id: register_id,
|
certificate_org_name: me.formData.name || null, // 企业名称
|
certificate_license_no: me.formData.license_business_no || null, // 营业执照-证照编号
|
certificate_date_from: me.formData.certificate_date_from || null, // 营业执照-注册日期
|
certificate_date_to: me.formData.certificate_date_to || null, // 营业执照-经营期限至
|
certificate_legal_representative: me.formData.certificate_legal_representative || null, //法定代表人
|
certificate_address: me.formData.register_address || null, // 营业执照-地址
|
certificate_scope: me.formData.certificate_scope || null, // 营业执照-经营范围
|
}
|
}
|
|
if (!param.data.md_org_register) {
|
param.data.md_org_register = {
|
id: register_id
|
}
|
}
|
for (var key_ in formdata_) {
|
if (formdata_[key_] != null && !param.data.md_org_register[key_] && key_ != "authorize_scope") {
|
param.data.md_org_register[key_] = formdata_[key_]
|
}
|
}
|
|
// param.data["business_device_license"] = me.formDatas;
|
// param.data["business_device_license"].authorize_scope = null;
|
param.data["md_org_data"].authorization_province = null;
|
|
Server.call("root/data/" + operator_, param, function(result) {
|
me.loading_save = false;
|
if (result.success) {
|
if(me.iscommit) {
|
me.iscommit = false;
|
Root.message({
|
type: 'success',
|
message: '提交成功'
|
});
|
me.saveAfter();
|
|
|
// var param_commit = {
|
// id: me.formData.id,
|
// dataname: me.dataname
|
// }
|
// Server.call("root/data/InputCommit", param_commit, function(result) {
|
// me.iscommit = false;
|
// Root.message({
|
// type: 'success',
|
// message: '提交成功'
|
// });
|
// me.saveAfter();
|
// }, function(errorresult) {
|
// 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 {
|
Root.message({
|
type: 'success',
|
message: '保存成功'
|
});
|
|
//刷新数据
|
me.activeName = 'basicInfo';
|
if(me.isRoleQA) {
|
me.activeName = 'devices';
|
}
|
me.pagenum = 1;
|
me.initData();
|
|
//这里需要重新赋值
|
//刷新页面
|
// me.saveAfter();
|
}
|
}
|
}, function(errorresult) {
|
console.log("错误信息", errorresult);
|
me.loading_save = false;
|
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: '保存失败'
|
});
|
}
|
});
|
},
|
|
onpassApproval(){
|
this.approveremark = "";
|
this.reasonvisible = true;
|
this.passOrRefuse = true;
|
},
|
|
onrefuseApproval(){
|
this.approveremark = "";
|
this.reasonvisible = true;
|
this.passOrRefuse = false;
|
},
|
|
saveReason(){
|
this.loading_pass = true;
|
if(this.passOrRefuse){
|
this.doPassApproval(true);
|
}else{
|
if(this.approveremark != ""){
|
this.doPassApproval(false);
|
}
|
else{
|
Root.message({
|
type: 'warning',
|
message: '请填写原因'
|
});
|
this.loading_pass = false;
|
}
|
}
|
},
|
|
doPassApproval(bo) {
|
var me = this;
|
var state_ = "";
|
if (bo) {
|
if (this.formData.state_code == "MDOpening") {//新增通过
|
state_ = "OpenApprove"
|
}
|
else if (this.formData.state_code == "MDChanging") {//变更通过
|
state_ = "ChangeApprove"
|
}
|
else {
|
state_ = "OpenApprove"
|
}
|
}
|
if (!bo) {
|
if (this.formData.state_code == "MDOpening") {//新增拒绝
|
state_ = "Reject"
|
}
|
else if (this.formData.state_code == "MDChanging") {//变更拒绝
|
state_ = "ChangeReject"
|
}
|
else {
|
state_ = "Reject"
|
}
|
}
|
|
let param = {
|
dataname: "md_org_data",
|
id: me.formData.id,
|
remark: this.approveremark
|
}
|
Server.call("root/data/" + state_, param, function(result) {
|
me.loading_pass = false;
|
console.log(result);
|
if (bo) {
|
|
Root.message({
|
type: 'success',
|
message: '审批成功'
|
});
|
me.saveAfter();
|
|
// var param_ncc = {
|
// dataName: "md_org_data",
|
// id: me.formData.id
|
// }
|
// console.log("addOrg->NCC");
|
// Server.call("interface/call/add_customer", param_ncc, function(resultncc) {
|
// console.log("addOrg->NCC成功", resultncc);
|
// if (resultncc.data && resultncc.data.error) {
|
// Root.message({
|
// type: 'warning',
|
// message: resultncc.data.error
|
// });
|
// // me.saveAfter();
|
// }
|
// else {
|
// Root.message({
|
// type: 'success',
|
// message: '审批成功'
|
// });
|
// me.saveAfter();
|
// }
|
|
// }, function(errorncc) {
|
// console.log("addOrg->NCC失败", errorncc);
|
// Root.message({
|
// type: 'warning',
|
// message: '推送NCC失败'
|
// });
|
// 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;
|
}
|
.el-upload--picture-card {
|
width: 100% !important;
|
}
|
.ocr_img .el-upload-list--picture-card .el-upload-list__item {
|
width: 100%;
|
height: 100%;
|
}
|
</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>
|
<el-tabs v-model="activeName" type="border-card" @tab-click="handleChange"><!-- type="border-card" -->
|
<el-tab-pane label="基本信息" name="basicInfo" v-if = '!isRoleQA'>
|
<div :style="{overflow: 'auto',height:dheight + 'px'}">
|
<div v-loading.fullscreen.lock="imgLoading" element-loading-text="OCR识别中" style="width: 30%; float: left; overflow: hidden;">
|
<el-image
|
v-if="imgurl && !imgLoading"
|
:style="{width: '100%', 'max-height': dheight - 50 + 'px'}"
|
:src="imgurl"
|
:preview-src-list="[imgurl]">
|
</el-image>
|
|
<div v-else-if="!imgLoading && (isedit || isrefuseedit)" class="ocr_img">
|
<el-upload action="#" style="margin-top: 15px;margin-bottom: 15px;"
|
accept="image/jpeg,image/gif,image/png"
|
ref="reportUpload1"
|
list-type="picture-card"
|
:file-list="formData1.mdm_img"
|
:on-change="(file, fileList) => {uploadFileFun_file(file, fileList, '1')}"
|
:auto-upload="false">
|
<!-- <i slot="default" class="el-icon-plus"></i> -->
|
<span style="font-size: 14px; color: #909399;">营业执照上传</span>
|
<div slot="file" slot-scope="{file}">
|
<img class="el-upload-list__item-thumbnail" :src="showThumbnail(file, 'pic', '1')" alt="">
|
</div>
|
</el-upload>
|
</div>
|
<el-button v-if="imgurl && (isedit || isrefuseedit)" size="small" type="danger" @click="delyyzz">删除营业执照</el-button>
|
</div>
|
<div class="el-dialog__body1" :style="{overflow: 'auto',height:dheight + 'px'}">
|
<h-form
|
ref="form1"
|
:form-attr="formAttr"
|
:table-fields="formFields"
|
:form-data="formData"
|
:table-field-click="formfieldClick"
|
>
|
</h-form>
|
</div>
|
</div>
|
</el-tab-pane>
|
<el-tab-pane label="器械经营许可证" name="devices">
|
<div :style="{overflow: 'auto',height:dheight + 'px'}">
|
<div class="el-dialog__body1" :style="{overflow: 'auto',height:dheight + 'px'}">
|
<h-form
|
ref="form2"
|
:form-attr="formAttrs"
|
:table-fields="formFieldss"
|
:form-data="formDatas"
|
:table-field-click="formfieldClick"
|
>
|
</h-form>
|
</div>
|
</div>
|
</el-tab-pane>
|
<el-tab-pane label="授权医院" name="htable" v-if="!isRoleQA && formData.actor !='Platform'">
|
<div :style="{height:dheight + 'px'}">
|
<div v-if="isedit || isrefuseedit" style="height: 30px; line-height: 30px; width: 100%;text-align: right;">
|
<el-button size="small" type="primary" @click="addHospital":icon="buttonsconfig.add.icon">{{buttonsconfig.add.name}}</el-button>
|
</div>
|
<div v-else style="height: 30px; line-height: 30px; width: 100%;"></div>
|
<h-table
|
ref="table1"
|
:table-fields="tableFields"
|
:table-data="tableData"
|
:table-height="dheight - 94"
|
:pagesize="pagesize"
|
:pagenum="pagenum"
|
:total="total"
|
:is-edit-table-data="isedit || isrefuseedit"
|
:edit-table-button="editTableButton"
|
:table-field-click="tablefieldClick"
|
|
v-on:get-data="getData"
|
v-on:del-data="delData"
|
v-on:edit-data="editData"
|
>
|
</h-table>
|
<!--
|
:is-within-edit-table-data="isedit || isrefuseedit"
|
-->
|
</div>
|
</el-tab-pane>
|
</el-tabs>
|
|
<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 size="small" type="default" @click="reasonvisible = false">取 消</el-button>
|
<el-button size="small" type="primary" :loading="loading_pass" @click="saveReason">确 定</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 != 'adminedit'" type="primary" :loading="loading_save" @click="saveRowTable" :icon="buttonsconfig.save.icon":icon="buttonsconfig.save.icon">{{buttonsconfig.save.name}}</el-button>
|
<el-button size="small" v-if="isedit && popupParames.sceneCode != 'adminedit'" type="success" :loading="iscommit" @click="submitRowTable" :icon="buttonsconfig.submit.icon":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>
|