<!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_account",
|
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"
|
|
}
|
],
|
product_group: [],
|
notvalunit: false,
|
formAttr: {
|
istitle: false,
|
title: "表单名称",
|
columnnumber: 2,
|
labelwidth: "170px",
|
labelposition: "left",//"left",// right//top
|
size: "mini",
|
border: "10px solid #c6c6c600"
|
},
|
formAttr_JCXX: {
|
istitle: false,
|
title: "表单名称",
|
columnnumber: 4,
|
labelwidth: "170px",
|
labelposition: "left",//"left",// right//top
|
size: "mini",
|
border: "10px solid #c6c6c600",
|
disabled: true
|
},
|
|
formAttr_register: {
|
istitle: false,
|
title: "表单名称",
|
columnnumber: 1,
|
labelwidth: "170px",
|
labelposition: "left",//"left",// right//top
|
size: "mini",
|
border: "10px solid #c6c6c600",
|
suffixwidth: "100px"
|
// notvalunit: true,
|
},
|
|
formAttr_SYPG: {
|
istitle: false,
|
title: "表单名称",
|
columnnumber: 1,
|
labelwidth: "170px",
|
labelposition: "left",//"left",// right//top
|
size: "mini",
|
border: "10px solid #c6c6c600",
|
suffixwidth: "100px",
|
disabled: true
|
},
|
|
formData: {},
|
authorize_scope_id: "",//授权范围id
|
tabs: [//md_org_register
|
{code: "JCXX", name: "基础信息", dataname: "md_org_account", tablename: "md_org_hospital"},
|
// {code: "SYPG", name: "商业评估", children: [
|
// {code: "JYZK", name: "经营状况", dataname: "business_status"},
|
// {code: "YWNL", name: "业务能力", dataname: "md_org_opening", groupfield: "classify", groupval: "BC"},
|
// {code: "QAZZ", name: "QA资质", dataname: "md_org_opening", groupfield: "classify", groupval: "QQ"},
|
// {code: "HGYQ", name: "合规要求", dataname: "md_org_opening", groupfield: "classify", groupval: "CR"},
|
// ]},
|
{code: "SYZZ", name: "首营资质", children: [
|
{code: "YYZZ", name: "营业执照", dataname: "business_license"},
|
{code: "QXJYXKZ", name: "器械经营许可证", dataname: "business_device_license"},
|
]},
|
{code: "CWKP", name: "财务开票", dataname: "md_org_billing"},
|
{code: "DDWL", name: "订单物流", dataname: "md_org_shipto"}
|
],
|
tabs_customer: [//经销商可看tab
|
{code: "JCXX", name: "基础信息", dataname: "md_org_account", tablename: "md_org_hospital"},
|
{code: "SYZZ", name: "首营资质", children: [
|
{code: "YYZZ", name: "营业执照", dataname: "business_license"},
|
{code: "QXJYXKZ", name: "器械经营许可证", dataname: "business_device_license"},
|
]},
|
{code: "CWKP", name: "财务开票", dataname: "md_org_billing"},
|
{code: "DDWL", name: "订单物流", dataname: "md_org_shipto"}
|
],
|
tabRefresh: true,
|
result_meta: {},
|
metaBydataname_meta: {},
|
tabsobj: {},
|
tabdatamap: {},
|
//运行Tab项
|
activeTabName: "",
|
activeTabName_detail: "",
|
selectTabObj: {},
|
|
//按键权限设置
|
isedit: false,//提交前编辑,保存/提交
|
isrefuseedit: false,//拒绝后编辑,保存/再次提交
|
isapproval: false,//审批,同意/拒绝/转办/退回
|
isBusiness: false,//商务审核
|
isUnderOpen: false,//开户审核
|
|
iscommit: false,//提交标记
|
ischange: false,//变更按键
|
//弹窗参数
|
popupParames: {},
|
//字段设置
|
tablefieldClick: {},
|
formfieldClick: {},
|
|
height_long: 0,
|
height_short: 0,
|
|
loading_save: false,
|
textarea2: "",
|
loading_pass: false,
|
reasonvisible: false,
|
passOrRefuse: true,
|
iscustomer: true,// 是否经销商
|
},
|
created() {
|
let clientHeight = document.documentElement.clientHeight;
|
console.log(clientHeight);
|
// this.height_long = clientHeight - 125 - 30;
|
// this.height_short = clientHeight - 156 - 30;
|
// this.height_long = clientHeight - (50 + 21 + 32 + 30);
|
// this.height_short = clientHeight - (50 + 21 + 32 + 30 + 32);
|
|
this.height_long = clientHeight - 125;
|
this.height_short = clientHeight - 157;
|
if (window.top.vue.userinfo && window.top.vue.userinfo.org && window.top.vue.userinfo.org.is_account) {
|
//是经销商
|
var orgobj = window.top.vue.userinfo.org;
|
var Root_popupParames = {
|
title: orgobj.name,
|
data: {
|
id: orgobj.id,
|
actor: orgobj.actor //|| "Distributor"
|
},
|
sceneCode: "edit"
|
}
|
this.iscustomer = true;// 是经销商
|
this.popupParames = clone(Root_popupParames);
|
this.tabs = clone(this.tabs_customer);
|
}
|
else {
|
this.iscustomer = false;// 不是经销商
|
this.popupParames = clone(Root.popupParames);
|
this.formAttr.disabled = true;
|
this.formAttr_register.disabled = true;
|
this.formAttr_SYPG.disabled = true;
|
}
|
this.title = this.popupParames.title || this.popupParames.text
|
if (this.popupParames.data) {
|
this.formData = clone(this.popupParames.data);
|
}
|
if (this.popupParames.sceneCode == "browse") {//只读
|
this.formAttr.disabled = true;
|
this.formAttr_register.disabled = true;
|
this.formAttr_SYPG.disabled = true;
|
}
|
/* if (this.popupParames.sceneCode) {
|
if (this.popupParames.sceneCode == "add") {//新增
|
this.isedit = true;
|
}
|
else if (this.popupParames.sceneCode == "browse") {//只读
|
this.formAttr.disabled = true;
|
this.formAttr_register.disabled = true;
|
this.formAttr_SYPG.disabled = true;
|
}
|
else if (this.popupParames.sceneCode == "edit") {//编辑
|
this.isedit = true;
|
}
|
else if (this.popupParames.sceneCode == "approval") {//审批
|
this.formAttr.disabled = true;
|
this.isapproval = true;
|
|
if(this.formData.state_detail_code == "BusinessApproval") {
|
this.isBusiness = true;//商务审核
|
this.formAttr_SYPG.disabled = false;
|
}
|
else if (this.formData.state_detail_code == "UnderOpenApproval") {
|
this.isUnderOpen = true;//开户审核
|
}
|
}
|
else if (this.popupParames.sceneCode == "refuseedit") {//拒绝后的编辑
|
this.isrefuseedit = true;
|
}
|
} */
|
var tabsobj_ = {};
|
var tabdatamap_ = {};
|
this.tabs.map(t=>{
|
if (t.children) {
|
t.children.map(tc=>{
|
tabsobj_[tc.code] = tc;
|
if (tc.dataname && !tc.groupfield) {
|
tabdatamap_[tc.dataname] = {
|
isgroup: false,
|
tabcode: t.code
|
};
|
}
|
else if (tc.dataname && tc.groupfield) {
|
if (!tabdatamap_[tc.dataname]) {
|
tabdatamap_[tc.dataname] = {
|
isgroup: true,
|
children: []
|
}
|
}
|
var datanamegroup = {
|
groupfield: tc.groupfield,
|
groupval: tc.groupval,
|
tabcode: tc.code,
|
}
|
tabdatamap_[tc.dataname].children.push(datanamegroup);
|
}
|
})
|
}
|
tabsobj_[t.code] = t;
|
if (t.dataname && !t.groupfield) {
|
tabdatamap_[t.dataname] = {
|
isgroup: false,
|
tabcode: t.code
|
};
|
}
|
else if (t.dataname && t.groupfield) {
|
if (!tabdatamap_[t.dataname]) {
|
tabdatamap_[t.dataname] = {
|
isgroup: true,
|
children: []
|
}
|
}
|
var datanamegroup = {
|
groupfield: t.groupfield,
|
groupval: t.groupval,
|
tabcode: t.code,
|
}
|
tabdatamap_[t.dataname].children.push(datanamegroup);
|
}
|
})
|
|
this.tabsobj = tabsobj_;
|
this.tabdatamap = tabdatamap_;
|
},
|
|
mounted() {
|
var me = this;
|
this.activeTabName = "JCXX"
|
//预加载数据
|
if (this.dataRequest && this.dataRequest.length) {
|
var result = {};
|
this.loadRequestData(this.dataRequest, result, function(data) {
|
me.dataRequestObj = data;
|
//预加载数据后给哪些字段设置options或formatterjson
|
|
// 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_;
|
|
|
if (me.dataRequestObj.product_group) {
|
me.product_group = me.dataRequestObj.product_group;
|
// me.product_group_map = me.dataRequestObj.map.product_group;
|
}
|
|
me.initData();
|
// 以服务的方式调用的 Loading 需要异步关闭
|
me.$nextTick(() => {
|
hideLoading();
|
});
|
});
|
}
|
else {
|
this.initData();
|
// 以服务的方式调用的 Loading 需要异步关闭
|
me.$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) {//查询后的回调,用于获取字段的
|
console.log(result)
|
if (result.meta) {
|
me.result_meta = clone(result.meta);
|
var metaBydataname = {};
|
for (var dataname_ in result.meta) {
|
var formFields_ = [];
|
var metas = clone(result.meta[dataname_].fields);
|
metas.map(f=>{
|
f.isshow = "T";
|
formFields_.push(clone(f));
|
})
|
|
metaBydataname[dataname_] = clone(formFields_);
|
|
//Brooke
|
if(dataname_ == "md_org_billing") {
|
if(me.rowData && me.rowData.md_org_billing && me.rowData.md_org_billing.tax_category_code) {
|
var mark = null;
|
if(me.rowData.md_org_billing.tax_category_code == "02") {
|
mark = true;
|
}
|
else {
|
mark = false;
|
}
|
metaBydataname[dataname_].map(f => {
|
if(f.field == "invoice_phone") {
|
f.required = mark;
|
}
|
})
|
}
|
}
|
|
if (dataname_ == "md_org_shipto") {
|
metaBydataname[dataname_].map(f => {
|
if(f.field == "address") {
|
f.appendix = "如:***省***市***区***路***号***";
|
f.isvalexplain_br = true;
|
}
|
})
|
}
|
|
/* if (dataname_ == 'md_org_register') {
|
metas.map(f=>{
|
if(f.code == 'instrument_license_business_address') {
|
f.required = true;
|
f.labelchinese = "经营场所";
|
|
metaBydataname.business_device_license.map(j=> {
|
if(j.field == "instrument_business_type") {
|
var mark = metaBydataname.business_device_license.indexOf(j);
|
metaBydataname.business_device_license.splice(mark+1, 0, f);
|
}
|
})
|
}
|
})
|
} */
|
}
|
|
me.metaBydataname_meta = clone(metaBydataname);
|
|
console.log(me.rowData)
|
var tabsobj_ = clone(me.tabsobj);
|
for (var tabcode_ in tabsobj_) {
|
var tabobj_ = tabsobj_[tabcode_];
|
if (tabobj_.dataname && metaBydataname[tabobj_.dataname]) {
|
if (tabobj_.dataname == "md_org_account") {
|
var f_ = metaBydataname["md_org_product"][0];
|
f_.options = me.product_group;
|
|
metaBydataname[tabobj_.dataname].push(f_);
|
|
}
|
else if (tabobj_.dataname == "md_org_shipto") {
|
var formFields_ = [
|
{isshow: "T", field: "md_org_shipto", name: "", typeof: "objlist", labelwidth: "0px",
|
children: [],
|
formattr: {
|
title: "表单信息",
|
istitle: false,
|
columnnumber: 2,
|
labelwidth: "180px",
|
labelposition: "left", //"right",
|
size: "medium",
|
disabled: false,
|
bordertop: "5px solid #c6c6c600",
|
}, colspan: 2, required: true},
|
]
|
formFields_[0].children = clone(metaBydataname[tabobj_.dataname]);
|
|
metaBydataname[tabobj_.dataname] = clone(formFields_);
|
}
|
|
tabobj_.formFields = clone(metaBydataname[tabobj_.dataname]);
|
if (tabobj_.dataname == "md_org_shipto") {
|
tabobj_.formData = {
|
md_org_shipto: [{}]
|
}
|
}
|
|
else {
|
var newformData_ = {};
|
metaBydataname[tabobj_.dataname].map(field=>{
|
if (field.inputtype == "checkboxobj") {
|
newformData_[field.field] = [];
|
}
|
})
|
|
tabobj_.formData = newformData_
|
}
|
if (me.rowData[tabobj_.dataname] && !result.meta[tabobj_.dataname].lasyload) {
|
if (tabobj_.dataname == "md_org_shipto") {
|
var md_org_shipto_ = [{}]
|
if (me.rowData[tabobj_.dataname].length) {
|
md_org_shipto_ = me.rowData[tabobj_.dataname];
|
}
|
tabobj_.formData = {
|
md_org_shipto: md_org_shipto_
|
}
|
}
|
else if(tabobj_.dataname == "business_device_license"){
|
tabobj_.formData = me.rowData[tabobj_.dataname]
|
var authorize_scope_ = [];
|
for(var i in me.rowData.md_org_biz_regist_scope) {
|
if(i == "is_all" && me.rowData.md_org_biz_regist_scope[i]) {
|
authorize_scope_.push(i)
|
}else 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)
|
}
|
}
|
if (me.rowData.md_org_biz_regist_scope) {
|
me.authorize_scope_id = me.rowData.md_org_biz_regist_scope.id;
|
}
|
tabobj_.formData.authorize_scope = authorize_scope_;
|
// if(me.rowData.md_org_register) {
|
// let data_ = me.rowData.md_org_register
|
// me.$set(tabobj_.formData, "instrument_license_business_address", data_.instrument_license_business_address);
|
// }
|
}
|
else if(tabobj_.dataname != "md_org_opening" && tabobj_.dataname != "md_org_shipto" && tabobj_.dataname != "md_org_product") {
|
metaBydataname[tabobj_.dataname].map(field=>{
|
if (field.inputtype == "checkboxobj" && !me.rowData[tabobj_.dataname][field.field]) {
|
me.rowData[tabobj_.dataname][field.field] = []
|
}
|
})
|
|
tabobj_.formData = me.rowData[tabobj_.dataname]
|
}
|
if (tabobj_.dataname == "md_org_account") {
|
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(tabobj_.formData, "product_category_name", md_org_product_);
|
}
|
else {
|
me.$set(tabobj_.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(tabobj_.formData, "authorization_province", md_org_province_);
|
}
|
else {
|
me.$set(tabobj_.formData, "authorization_province", []);
|
}
|
}
|
|
|
}
|
|
tabobj_.formData = getDataByFields(tabobj_.formData, tabobj_.formFields);
|
|
tabobj_.lasyload = result.meta[tabobj_.dataname].lasyload;
|
}
|
|
if (tabobj_.tablename && metaBydataname[tabobj_.tablename]) {
|
tabobj_.tableFields = clone(metaBydataname[tabobj_.tablename]);
|
tabobj_.tableData = [];
|
tabobj_.pagesize = 10;
|
tabobj_.pagenum = 0;
|
tabobj_.total = 0;
|
if (me.rowData[tabobj_.tablename] && !result.meta[tabobj_.tablename].lasyload) {
|
tabobj_.tableData = me.rowData[tabobj_.tablename]
|
}
|
}
|
|
}
|
|
if (me.iscustomer) {
|
if (me.rowData.md_org_account.state_code == "Opening" && me.rowData.md_org_account.state_detail_code == "DealerInput" ) {
|
me.isedit = true;
|
}
|
else {
|
if (me.rowData.md_org_account.state_code == "Open") {
|
me.ischange = true;//变更按键
|
}
|
|
me.formAttr.disabled = true;
|
me.formAttr_register.disabled = true;
|
me.formAttr_SYPG.disabled = true;
|
me.isedit = false;
|
}
|
}
|
|
me.tabsobj = clone(tabsobj_);
|
|
//字段数组转字段obj,目的为了筛选时获取字段属性
|
me.fieldsToFieldsObj();
|
|
//设置字段事件
|
me.tableFieldClick();
|
}
|
|
me.selectTabObj = me.tabsobj[me.activeTabName];
|
|
|
me.getOrgHospital();
|
})
|
},
|
|
getData(page) {
|
this.tabsobj["JCXX"].pagesize = page.pagesize;
|
this.tabsobj["JCXX"].pagenum = page.pagenum;
|
|
this.getOrgHospital();
|
},
|
|
getOrgHospital() {
|
var me = this;
|
//页面信息
|
var params = {
|
dataname: this.dataname + ".md_org_hospital",
|
filter: "parent_id='"+ this.formData.id +"'",
|
page: {
|
pageno: this.tabsobj["JCXX"].pagenum,
|
pagesize: this.tabsobj["JCXX"].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.tabsobj["JCXX"].tableData = data_;
|
me.tabsobj["JCXX"].total = result.data.page.recordcount;
|
}
|
else {
|
me.tabsobj["JCXX"].total = 0;
|
}
|
})
|
},
|
|
onChangeData() {
|
this.isedit = true
|
this.$set(this.formAttr, "disabled", false);
|
this.$set(this.formAttr_register, "disabled", false);
|
},
|
|
tablepopup_banklist(obj) {
|
var me = this;
|
Root.showPopup({
|
icon: "icon-product",
|
text: "选择客户",
|
url: "module/md/page/customer/page/popup/bank_list.html",
|
width: 900,
|
height: 550,
|
data: {},
|
sceneCode: "add",
|
callback: function(callbackobj, callback) {
|
var formData_ = clone(me.selectTabObj.formData)
|
formData_.bank_name = callbackobj.row.name;
|
formData_.bank_code = callbackobj.row.code;
|
me.selectTabObj.formData = formData_
|
|
if (callback) {
|
callback();
|
}
|
}
|
});
|
},
|
|
tableFieldClick() {
|
var me = this;
|
//表格字段事件设置
|
this.tablefieldClick = {
|
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")
|
}
|
},
|
},
|
};
|
|
//表单字段事件设置
|
this.formfieldClick = {
|
bank_name: {
|
popup: {
|
onclick: function(obj) {//弹窗点击事件
|
//打开
|
me.tablepopup_banklist(obj)
|
}
|
},
|
},
|
|
tax_category_code: {
|
val: {
|
onchange: function(obj) {
|
var mark = null;
|
if(obj.data.tax_category_code == "02") {
|
mark = true;
|
}
|
|
else {
|
mark = false;
|
}
|
|
var formFieldsCWKP = clone(me.selectTabObj.formFields);
|
|
formFieldsCWKP.map(f => {
|
if(f.field == 'invoice_phone') {
|
f.required = mark;
|
}
|
})
|
|
me.selectTabObj.formFields = clone(formFieldsCWKP);
|
}
|
}
|
},
|
|
file_name_report_finance_original: {
|
buttonarray: {
|
onclick: function(obj) {
|
var filenamefield = obj.obj.field;
|
var fileidfield = "file_report_finance_original";
|
if(obj.buttonobj && obj.buttonobj.code == "showfile"){
|
me.showFileImgByFileId_n(filenamefield, fileidfield);
|
}else if (obj.buttonobj && obj.buttonobj.code == "upload"){
|
me.onPopupByUploadFile_n(filenamefield, fileidfield, "md_org_register");
|
}else if (obj.buttonobj && obj.buttonobj.code == "delfile"){
|
me.deleteByFileId_n(filenamefield, fileidfield);
|
}
|
}
|
}
|
},
|
file_name_certificate_original: {
|
buttonarray: {
|
onclick: function(obj) {
|
var filenamefield = obj.obj.field;
|
var fileidfield = "file_certificate_original";
|
if(obj.buttonobj && obj.buttonobj.code == "showfile"){
|
me.showFileImgByFileId_n(filenamefield, fileidfield);
|
}else if (obj.buttonobj && obj.buttonobj.code == "upload"){
|
me.onPopupByUploadFile_zz("ZGL01", true, "zz","file_name_certificate_original");
|
}else if (obj.buttonobj && obj.buttonobj.code == "delfile"){
|
me.deleteByFileId_n(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_n(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_n(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_n(filenamefield, fileidfield);
|
}else if (obj.buttonobj && obj.buttonobj.code == "upload"){
|
me.onPopupByUploadFile_n(filenamefield, fileidfield, "md_org_register");
|
}else if (obj.buttonobj && obj.buttonobj.code == "delfile"){
|
me.deleteByFileId_n(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_n(filenamefield, fileidfield);
|
}else if (obj.buttonobj && obj.buttonobj.code == "upload"){
|
me.onPopupByUploadFile_n(filenamefield, fileidfield, "md_org_register");
|
}else if (obj.buttonobj && obj.buttonobj.code == "delfile"){
|
me.deleteByFileId_n(filenamefield, fileidfield);
|
}
|
}
|
}
|
},
|
file_name_invoice_info: {//开票信息附件
|
buttonarray: {
|
onclick: function(obj) {
|
var filenamefield = obj.obj.field;
|
var fileidfield = "file_invoice_info";
|
if(obj.buttonobj && obj.buttonobj.code == "showfile"){
|
me.showFileImgByFileId_n(filenamefield, fileidfield);
|
}else if (obj.buttonobj && obj.buttonobj.code == "upload"){
|
me.onPopupByUploadFile_zz("ZGL03", true, "kp","file_name_invoice_info");
|
// me.onPopupByUploadFile_n(filenamefield, fileidfield, "md_org_billing");
|
}else if (obj.buttonobj && obj.buttonobj.code == "delfile"){
|
me.deleteByFileId_n(filenamefield, fileidfield);
|
}
|
}
|
}
|
},
|
file_name_bank_account_permit: {
|
buttonarray: {
|
onclick: function(obj) {
|
var filenamefield = obj.obj.field;
|
var fileidfield = "file_bank_account_permit";
|
if(obj.buttonobj && obj.buttonobj.code == "showfile"){
|
me.showFileImgByFileId_n(filenamefield, fileidfield);
|
}else if (obj.buttonobj && obj.buttonobj.code == "upload"){
|
me.onPopupByUploadFile_n(filenamefield, fileidfield, "md_org_billing");
|
}else if (obj.buttonobj && obj.buttonobj.code == "delfile"){
|
me.deleteByFileId_n(filenamefield, fileidfield);
|
}
|
}
|
}
|
},
|
tax_name_attachment: {
|
buttonarray: {
|
onclick: function(obj) {
|
var filenamefield = obj.obj.field;
|
var fileidfield = "tax_attachment";
|
if(obj.buttonobj && obj.buttonobj.code == "showfile"){
|
me.showFileImgByFileId_n(filenamefield, fileidfield);
|
}else if (obj.buttonobj && obj.buttonobj.code == "upload"){
|
me.onPopupByUploadFile_n(filenamefield, fileidfield, "md_org_billing");
|
}else if (obj.buttonobj && obj.buttonobj.code == "delfile"){
|
me.deleteByFileId_n(filenamefield, fileidfield);
|
}
|
}
|
}
|
},
|
file_name_proxy_statement: {
|
buttonarray: {
|
onclick: function(obj) {
|
var filenamefield = obj.obj.field;
|
var fileidfield = "file_proxy_statement";
|
if(obj.buttonobj && obj.buttonobj.code == "showfile"){
|
me.showFileImgByFileId_n(filenamefield, fileidfield, obj.formdata);
|
}else if (obj.buttonobj && obj.buttonobj.code == "upload"){
|
me.onPopupByUploadFile_n(filenamefield, fileidfield, "md_org_shipto", obj.formdata);
|
}else if (obj.buttonobj && obj.buttonobj.code == "delfile"){
|
me.deleteByFileId_n(filenamefield, fileidfield, obj.formdata);
|
}
|
}
|
}
|
},
|
};
|
},
|
|
editHospital(row, sceneCode){
|
let me = this;
|
var delta_ = {};
|
// if (this.formData.product_category_name && this.formData.product_category_name.length) {
|
// var product_group_ = []
|
// this.formData.product_category_name.map(val=>{
|
// var option_ = {
|
// code: val,
|
// value: this.product_group_map[val]
|
// }
|
// product_group_.push(option_);
|
// })
|
|
// delta_.product_group = me.dataRequestObj.product_group;
|
// delta_.product_group_map = this.product_group_map;
|
|
// }
|
// else {
|
// Root.message({
|
// type: 'warning',
|
// message: '请先选择经销商的授权产品'
|
// });
|
// return
|
// }
|
delta_.product_group = me.dataRequestObj.product_group;
|
delta_.product_group_map = me.dataRequestObj.map.product_group;
|
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) {
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
},
|
|
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_}
|
data_ = {
|
dataName: "md_org_register",
|
fileidfieldName: "file_certificate_original",
|
id: me.formData.id,
|
fileNamefieldName: "file_name_certificate_original"
|
}
|
}
|
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_ = "bankSlip";
|
delta_ = {filetypelist: [".png", ".jpg"], analysistype: analysistype_}
|
data_ = {
|
dataName: "md_org_billing",
|
fileidfieldName: "file_invoice_info",
|
id: me.formData.id,
|
fileNamefieldName: "file_name_invoice_info"
|
}
|
}
|
// 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.selectTabObj.formData);
|
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;
|
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;
|
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;
|
}
|
})
|
}
|
|
}else if(zname == "file_name_certificate_original"){
|
field_id= "file_certificate_original"
|
formData_[zname] =file_.name;
|
formData_[field_id] = file_.id;
|
var txt = "";
|
for (var k in filetxt) {
|
if (k == "Period") {
|
var txt = filetxt.Period;
|
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 = ""
|
}
|
//licenceObj_[k] = 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 = ""
|
}
|
}
|
}
|
filetxt.Period = txt;
|
}
|
else if (k == "SetDate") {
|
var txt = filetxt.SetDate;
|
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 = ""
|
}
|
//licenceObj_[k] = 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 = ""
|
}
|
}
|
}
|
filetxt.SetDate = txt;
|
}
|
|
}
|
formData_.certificate_org_name = filetxt.Name;
|
formData_.certificate_license_no = filetxt.RegNum;
|
formData_.certificate_date_from = filetxt.SetDate;
|
formData_.certificate_date_to = filetxt.Period;
|
formData_.certificate_address = filetxt.Address;
|
formData_.certificate_legal_representative = filetxt.Person;
|
formData_.certificate_scope = filetxt.Business;
|
}
|
me.selectTabObj.formData = formData_;
|
},
|
|
uploadFormByKP(zz_code, obj, zname) {
|
var me = this;
|
var file_ = obj.row[0];
|
var filetxt = obj.filetxt;
|
var formData_ = clone(me.selectTabObj.formData);
|
var field_id = "";
|
console.log('开票信息', filetxt)
|
|
field_id= "file_invoice_info";
|
formData_[zname] =file_.name;
|
formData_[field_id] = file_.id;
|
filetxt.BankSlipInfos.map(e=>{
|
console.log(e.Name,e.Value)
|
if(e.Name == "开户户名"){
|
formData_.bank_account_name = e.Value;
|
// formData_.invoice_header = e.Value;
|
}else if(e.Name == "开户银行"){
|
formData_.bank_branch = e.Value;
|
}else if(e.Name == "银行账号"){
|
formData_.bank_account_no = e.Value;
|
}else if(e.Name == "开票税号"){
|
formData_.invoice_taxno = e.Value;
|
}else if(e.Name == "金税开票地址"){
|
formData_.invoice_address = e.Value;
|
}else if(e.Name == "开票电话"){
|
formData_.invoice_phone = e.Value;
|
}
|
|
else if(e.Name == "发票寄送地址"){
|
formData_.invoice_sendto_address = e.Value;
|
}else if(e.Name == "收票联系人"){
|
formData_.receiver_name = e.Value;
|
}else if(e.Name == "收票人电话"){
|
formData_.receiver_phone = e.Value;
|
}
|
|
})
|
|
me.selectTabObj.formData = formData_;
|
},
|
|
showFileImgByFileId_n(filenamefield, fileidfield, objformdata){
|
let me = this;
|
var formData_ = clone(me.selectTabObj.formData);
|
var file_id = "";
|
var file_name = "";
|
if(filenamefield == "file_name_report_finance_original"){
|
file_id = formData_[fileidfield];
|
file_name = formData_[filenamefield]
|
}else if(filenamefield == "file_name_certificate_original"){
|
file_id = formData_[fileidfield];
|
file_name = formData_[filenamefield]
|
}else if(filenamefield == "file_name_drug_license_original"){
|
file_id = formData_[fileidfield];
|
file_name = formData_[filenamefield]
|
}else if(filenamefield == "file_name_quality_agreement"){
|
file_id = formData_[fileidfield];
|
file_name = formData_[filenamefield]
|
}else if(filenamefield == "file_name_quality_status"){
|
file_id = formData_[fileidfield];
|
file_name = formData_[filenamefield]
|
}else if(filenamefield == "file_name_invoice_info"){
|
file_id = formData_[fileidfield];
|
file_name = formData_[filenamefield]
|
}else if(filenamefield == "file_name_bank_account_permit"){
|
file_id = formData_[fileidfield];
|
file_name = formData_[filenamefield]
|
}
|
|
else if(filenamefield == "tax_name_attachment"){
|
file_id = formData_[fileidfield];
|
file_name = formData_[filenamefield]
|
}
|
else if(filenamefield == "file_name_proxy_statement"){
|
file_id = objformdata[fileidfield];
|
file_name = objformdata[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);
|
}
|
}
|
},
|
|
onPopupByUploadFile_n(filenamefield, fileidfield,dataname, objformdata) {
|
var me = this;
|
var analysistype_ = "";
|
var formData_ = clone(me.selectTabObj.formData);
|
var delta_ = {filetypelist: [".png", ".jpg"]}
|
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'
|
});
|
console.log('111',obj)
|
if(filenamefield == "file_name_report_finance_original"){
|
formData_[filenamefield] =decodeURI(obj.row[0].name);
|
formData_[fileidfield] = obj.row[0].id;
|
}else if(filenamefield == "file_name_certificate_original"){
|
formData_[filenamefield] =decodeURI(obj.row[0].name);
|
formData_[fileidfield] = obj.row[0].id;
|
}else if(filenamefield == "file_name_drug_license_original"){
|
formData_[filenamefield] =decodeURI(obj.row[0].name);
|
formData_[fileidfield] = obj.row[0].id;
|
}else if(filenamefield == "file_name_quality_agreement"){
|
formData_[filenamefield] =decodeURI(obj.row[0].name);
|
formData_[fileidfield] = obj.row[0].id;
|
}else if(filenamefield == "file_name_quality_status"){
|
formData_[filenamefield] =decodeURI(obj.row[0].name);
|
formData_[fileidfield] = obj.row[0].id;
|
}else if(filenamefield == "file_name_invoice_info"){
|
formData_[filenamefield] =decodeURI(obj.row[0].name);
|
formData_[fileidfield] = obj.row[0].id;
|
}else if(filenamefield == "file_name_bank_account_permit"){
|
formData_[filenamefield] =decodeURI(obj.row[0].name);
|
formData_[fileidfield] = obj.row[0].id;
|
}
|
else if(filenamefield == "tax_name_attachment"){
|
formData_[filenamefield] =decodeURI(obj.row[0].name);
|
formData_[fileidfield] = obj.row[0].id;
|
}
|
else if(filenamefield == "file_name_proxy_statement"){
|
objformdata[filenamefield] =decodeURI(obj.row[0].name);
|
objformdata[fileidfield] = obj.row[0].id;
|
|
// formData_.md_org_shipto[0][filenamefield] =decodeURI(obj.row[0].name);
|
// formData_.md_org_shipto[0][fileidfield] = obj.row[0].id;
|
}
|
if (!objformdata) {
|
me.selectTabObj.formData = formData_;
|
}
|
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
this.doPopupByPublic(config);
|
},
|
|
deleteByFileId_n(filenamefield, fileidfield, objformdata){
|
var me = this;
|
var formData_ = clone(me.selectTabObj.formData);
|
if(filenamefield == "file_name_report_finance_original"){
|
formData_[filenamefield] = "";
|
formData_[fileidfield] = "";
|
}else if(filenamefield == "file_name_certificate_original"){
|
formData_[filenamefield] = "";
|
formData_[fileidfield] = "";
|
}else if(filenamefield == "file_name_drug_license_original"){
|
formData_[filenamefield] = "";
|
formData_[fileidfield] = "";
|
}else if(filenamefield == "file_name_quality_agreement"){
|
formData_[filenamefield] = "";
|
formData_[fileidfield] = "";
|
}else if(filenamefield == "file_name_quality_status"){
|
formData_[filenamefield] = "";
|
formData_[fileidfield] = "";
|
}else if(filenamefield == "file_name_invoice_info"){
|
formData_[filenamefield] = "";
|
formData_[fileidfield] = "";
|
}else if(filenamefield == "file_name_bank_account_permit"){
|
formData_[filenamefield] = "";
|
formData_[fileidfield] = "";
|
}
|
else if(filenamefield == "tax_name_attachment"){
|
formData_[filenamefield] = "";
|
formData_[fileidfield] = "";
|
}
|
else if(filenamefield == "file_name_proxy_statement"){
|
objformdata[filenamefield] = "";
|
objformdata[fileidfield] = "";
|
}
|
if (!objformdata) {
|
me.selectTabObj.formData = formData_;
|
}
|
|
},
|
|
handleClick() {
|
var me = this;
|
if (this.tabsobj[this.activeTabName].children) {
|
this.activeTabName_detail = this.tabsobj[this.activeTabName].children[0].code;
|
this.selectTabObj = this.tabsobj[this.activeTabName_detail];
|
}
|
else {
|
this.selectTabObj = this.tabsobj[this.activeTabName];
|
}
|
|
|
this.getDataByTabObj();
|
},
|
|
handleClick_detail() {
|
this.selectTabObj = this.tabsobj[this.activeTabName_detail];
|
this.getDataByTabObj();
|
},
|
|
getDataByTabObj() {
|
var me = this;
|
this.tabRefresh = false;
|
if (this.selectTabObj.lasyload) {
|
if (this.selectTabObj.groupval) {
|
var params = {
|
dataname: this.dataname + "." + this.selectTabObj.dataname,
|
id: this.formData.id,
|
filter: [
|
{"field": "parent_id", "value": this.formData.id},
|
{"field": "category_code", "value": this.formData.actor},//actor
|
{"field": "classify", "value": this.selectTabObj.groupval}
|
]
|
}
|
|
Server.call("root/data/getEntitySet", params, function(result) {
|
console.log(me.selectTabObj.name, result);
|
|
if (result && result.data && result.data.entityset) {
|
var data_ = result.data.entityset;
|
|
var group_ = listTOListGroup(data_, "group_name")
|
console.log(me.selectTabObj.name + "group", group_);
|
|
me.selectTabObj.formData = group_;
|
var sum_ = 0;
|
var item_notnum_ = 0;
|
group_.map(f=>{
|
f.children.map(fc=>{
|
if (fc.content_type == "radio") {
|
sum_++;
|
if (fc.criteria_value == "F") {
|
item_notnum_++;
|
}
|
}
|
|
})
|
})
|
me.$set(me.selectTabObj, "sum", sum_);
|
me.$set(me.selectTabObj, "item_notnum", item_notnum_);
|
|
me.selectTabObj.lasyload = false
|
}
|
|
me.$nextTick(() => {
|
me.tabRefresh = true;
|
me.$forceUpdate();
|
});
|
})
|
}
|
else if (this.selectTabObj.dataname) {
|
|
}
|
}
|
else {
|
me.$nextTick(() => {
|
me.tabRefresh = true;
|
me.$forceUpdate();
|
});
|
|
}
|
},
|
|
buttonArrayClick(unitobj, obj) {
|
var me = this;
|
var filenamefield = "criteria_value";
|
var fileidfield = "remark";
|
if(obj.code == "showfile"){
|
me.showFileImgByFileId(unitobj, filenamefield, fileidfield);
|
}else if (obj.code == "upload"){
|
me.onPopupByUploadFile(unitobj, filenamefield, fileidfield, me.dataname);
|
}else if (obj.code == "delfile"){
|
me.deleteByFileId(unitobj, filenamefield, fileidfield);
|
}
|
},
|
|
radioChange(label, code) {
|
var formData_ = clone(this.selectTabObj.formData);
|
var sum_ = 0;
|
var item_notnum_ = 0;
|
formData_.map(f=>{
|
f.children.map(fc=>{
|
if (fc.content_type == "radio") {
|
sum_++;
|
if (fc.criteria_value == "F") {
|
item_notnum_++;
|
}
|
}
|
|
})
|
})
|
this.$set(this.selectTabObj, "sum", sum_);
|
this.$set(this.selectTabObj, "item_notnum", item_notnum_);
|
},
|
|
buttonClick(obj) {
|
var field = obj.obj.field;
|
var index;
|
var me = this;
|
var formData6_ = clone(me.selectTabObj.formData);
|
|
if (obj.obj.field == "md_org_shipto") {//
|
if (obj.type == "del") {
|
//获取数据,如果有id,需要调删除事件
|
var row = formData6_[obj.obj.field][obj.index];
|
var address_ = "";
|
if (row.address) {
|
address_ = "【" + row.address + "】";
|
}
|
Root.confirm('确定删除地址' + address_ + '吗?', '删除提示', {
|
confirmButtonText: '删除',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
if (row.id) {
|
let param = {
|
dataname: "md_org_shipto",
|
id: row.id,
|
}
|
|
Server.call("root/data/deleteEntity", param, function(result) {
|
console.log(result);
|
if (result && result.data) {
|
formData6_[obj.obj.field].splice(obj.index,1);
|
}
|
});
|
}
|
else {
|
formData6_[obj.obj.field].splice(obj.index,1);
|
}
|
}).catch(() => {
|
Root.message({
|
type: 'info',
|
message: '已取消删除'
|
});
|
});
|
|
|
}
|
else {
|
formData6_[obj.obj.field].push({receiver_id_date_to: null,proxy_statement_date_to: null});
|
}
|
me.selectTabObj.formData = formData6_;
|
}
|
|
},
|
|
|
onPopupByUploadFile(unitobj, filenamefield, fileidfield,dataname) {
|
var me = this;
|
var analysistype_ = "";
|
var formData_ = clone(unitobj);
|
var delta_ = {
|
filetypelist: [],
|
}
|
var config = {
|
totab: false,
|
width: "500px",
|
icon: "icon-product",
|
text: "附件上传",
|
id: "popupByUploadFile",
|
url: "module/tool/page/popup_uploadFile.html",
|
data: {
|
dataName: "md_org_opening",//"md_org_register",md_org_opening
|
fileidfieldName: fileidfield,
|
id: unitobj.id,
|
fileNamefieldName: filenamefield
|
},
|
delta: delta_,
|
callback: function(obj, callback) {
|
me.$message({
|
showClose: true,
|
message: '上传成功!',
|
type: 'success'
|
});
|
me.$set(unitobj,filenamefield,decodeURI(obj.row[0].name));
|
me.$set(unitobj,fileidfield,obj.row[0].id);
|
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
this.doPopupByPublic(config);
|
},
|
deleteByFileId(unitobj, filenamefield, fileidfield){
|
var me = this;
|
var formData_ = clone(unitobj);
|
me.$set(unitobj,filenamefield,"");
|
me.$set(unitobj,fileidfield,"");
|
},
|
|
showFileImgByFileId(unitobj, filenamefield, fileidfield) {
|
let me = this;
|
var formData_ = clone(unitobj);
|
var file_id = "";
|
var file_name = "";
|
file_id = formData_[fileidfield];
|
file_name = formData_[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);
|
}
|
}
|
},
|
|
|
//提交
|
submitRowTable() {
|
var me = this;
|
var bo_ = true;
|
|
if (this.iscustomer) {//经销商填写
|
var bo_YYZZ = me.$refs.YYZZ.checkForm();
|
var bo_QXJYXKZ = me.$refs.QXJYXKZ.checkForm();
|
var bo_CWKP = me.$refs.CWKP.checkForm();
|
var bo_DDWL = me.$refs.DDWL.checkForm();
|
if (!bo_YYZZ || !bo_QXJYXKZ || !bo_CWKP || !bo_DDWL) {
|
bo_ = false;
|
|
if (!bo_YYZZ) {
|
this.activeTabName ='SYZZ';
|
this.activeTabName_detail='YYZZ';
|
this.selectTabObj = this.tabsobj[this.activeTabName_detail];
|
me.$nextTick(() => {
|
me.$refs.YYZZ.checkForm();
|
});
|
}
|
else if (!bo_QXJYXKZ) {
|
this.activeTabName ='SYZZ';
|
this.activeTabName_detail='QXJYXKZ';
|
this.selectTabObj = this.tabsobj[this.activeTabName_detail];
|
me.$nextTick(() => {
|
me.$refs.QXJYXKZ.checkForm();
|
});
|
|
}
|
else if (!bo_CWKP) {
|
this.activeTabName ='CWKP';
|
this.selectTabObj = this.tabsobj[this.activeTabName];
|
me.$nextTick(() => {
|
me.$refs.CWKP.checkForm();
|
});
|
}
|
else if (!bo_DDWL) {
|
this.activeTabName ='DDWL';
|
this.selectTabObj = this.tabsobj[this.activeTabName];
|
me.$nextTick(() => {
|
me.$refs.DDWL.checkForm();
|
});
|
}
|
Root.message({
|
type: 'error',
|
message: '请填写必填项'
|
});
|
return
|
}
|
}
|
|
if(bo_){
|
this.iscommit = true;
|
this.saveRowTable();
|
}
|
},
|
|
//保存
|
saveRowTable(callback) {
|
var me = this;
|
var operator_ = "saveEntity";//保存
|
|
if (this.formData.state_code == "Open") {//变更保存
|
operator_ = "ChangeDealerSave";
|
}
|
|
if(me.iscommit) {
|
if (this.formData.state_code == "Changing") {//this.formData.state_code == "Open"//后端缺少直接从Open提交变更的配置
|
operator_ = "ChangeDealerCommit";//变更提交
|
}
|
else {
|
operator_ = "OpenCommit";//提交
|
}
|
|
}
|
|
//var entity_ = clone(this.formData);
|
var md_org_register_ = {};
|
// {code: "JYZK", name: "经营状况", dataname: "business_status"},
|
// {code: "YYZZ", name: "营业执照", dataname: "business_license"},
|
// {code: "QXJYXKZ", name: "器械经营许可证", dataname: "business_device_license"},
|
|
var md_org_opening_ = [];
|
// {code: "YWNL", name: "业务能力", dataname: "md_org_opening", groupfield: "classify", groupval: "BC"},
|
// {code: "QAZZ", name: "QA资质", dataname: "md_org_opening", groupfield: "classify", groupval: "QQ"},
|
// {code: "HGYQ",
|
|
var md_org_billing_ = [];
|
// {code: "CWKP", name: "财务开票", dataname: "md_org_billing"},
|
// {code: "DDWL", name: "订单物流", dataname: "md_org_shipto"},
|
var md_org_shipto_ = [];
|
var md_org_biz_regist_scope_ = {};
|
|
|
for (var tabcode in this.tabsobj) {
|
var formdata_ = this.tabsobj[tabcode].formData;
|
if (!this.tabsobj[tabcode].lasyload) {//不需要二次加载或已经二次加载
|
//经营状况 (商务审核时或管理员编辑时保存)
|
if (tabcode == "JYZK" && (this.popupParames.sceneCode == "adminedit" || this.isBusiness)) {
|
for (var field_ in formdata_) {
|
md_org_register_[field_] = formdata_[field_];
|
}
|
}
|
|
//YYZZ营业执照,QXJYXKZ器械经营许可证(经销商填写时或管理员编辑时保存)
|
if ((tabcode == "YYZZ" || tabcode == "QXJYXKZ") && (this.popupParames.sceneCode == "adminedit" || this.iscustomer)) {
|
for (var field_ in formdata_) {
|
if (tabcode == "QXJYXKZ" && field_ == "authorize_scope") {
|
var biz_regist_scope_ = formdata_["authorize_scope"];
|
if (biz_regist_scope_.length) {
|
var biz_regist_scope_obj = {
|
parent_id: me.formData.id
|
}
|
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
|
}
|
}
|
}
|
else {
|
md_org_register_[field_] = formdata_[field_];
|
}
|
}
|
}
|
|
//YWNL业务能力,QAZZQA资质,HGYQ合规要求 (商务审核时或管理员编辑时保存)
|
if ((tabcode == "YWNL" || tabcode == "QAZZ" || tabcode == "HGYQ") && (this.popupParames.sceneCode == "adminedit" || this.isBusiness)) {
|
formdata_.map(group=>{
|
group.children.map(unitobj=>{
|
var row_ = {
|
id: unitobj.id,
|
parent_id: me.formData.id,
|
criteria_id: unitobj.ask_id,
|
criteria_value: unitobj.criteria_value,
|
remark: unitobj.remark,
|
}
|
md_org_opening_.push(row_);
|
})
|
})
|
}
|
if (tabcode == "CWKP" && (this.popupParames.sceneCode == "adminedit" || this.iscustomer)) {
|
var row_ = clone(formdata_);
|
row_.parent_id = me.formData.id;
|
md_org_billing_ = clone(row_);
|
}
|
if (tabcode == "DDWL" && (this.popupParames.sceneCode == "adminedit" || this.iscustomer)) {
|
md_org_shipto_ = clone(formdata_.md_org_shipto);
|
}
|
}
|
}
|
|
let param = {
|
dataname: this.dataname,
|
id: me.formData.id,
|
data: {},
|
}
|
|
//财务开票
|
if (Object.keys(md_org_billing_).length != 0) {
|
param.data["md_org_billing"] = md_org_billing_;
|
}
|
else {
|
param.data["md_org_billing"] = null;
|
}
|
|
if (md_org_shipto_.length) {
|
var md_org_shipto = [];
|
md_org_shipto_.map(obj_=>{
|
if (Object.keys(obj_).length != 0 && obj_.address) {
|
obj_.parent_id = me.formData.id;
|
md_org_shipto.push(obj_);
|
}
|
})
|
//订单物流
|
param.data["md_org_shipto"] = md_org_shipto.length ? md_org_shipto : null;
|
}
|
|
if (Object.keys(md_org_register_).length) {
|
md_org_register_.parent_id = me.formData.id;
|
}
|
//md_org_register (经营状况,营业执照,器械经营许可证)
|
param.data["md_org_register"] = Object.keys(md_org_register_).length ? md_org_register_ : null;
|
//md_org_opening (业务能力,QA资质,合规要求)
|
param.data["md_org_opening"] = md_org_opening_.length ? md_org_opening_ : null;
|
//md_org_biz_regist_scope (授权范围,器械经营许可证中的子字段)
|
param.data["md_org_biz_regist_scope"] = Object.keys(md_org_biz_regist_scope_).length ? md_org_biz_regist_scope_ : null;
|
param.data["md_org_account"] = {
|
id: me.formData.id,
|
name: md_org_register_.certificate_org_name,
|
license_business_no: md_org_register_.certificate_license_no,
|
// certificate_date_from: md_org_register_.certificate_date_from,
|
certificate_date_to: md_org_register_.certificate_date_to,
|
certificate_legal_representative: md_org_register_.certificate_legal_representative,
|
register_address: md_org_register_.certificate_address,
|
// certificate_scope: md_org_register_.certificate_scope
|
}
|
|
console.log("保存数据", param);
|
// return
|
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: '提交成功'
|
});
|
|
if (me.iscustomer) {
|
var formAttr_ = clone(me.formAttr);
|
var formAttr_register_ = clone(me.formAttr_register);
|
var formAttr_SYPG_ = clone(me.formAttr_SYPG);
|
|
formAttr_.disabled = true;
|
formAttr_register_.disabled = true;
|
formAttr_SYPG_.disabled = true;
|
|
me.formAttr = formAttr_;
|
me.formAttr_register = formAttr_register_;
|
me.formAttr_SYPG = formAttr_SYPG_;
|
|
me.isedit = false;
|
|
me.$alert('公司信息已提交,等待审核中', '提交成功', {
|
confirmButtonText: '确定',
|
callback: action => {}
|
});
|
}
|
else {
|
me.saveAfter();
|
}
|
// var param_commit = {
|
// id: me.formData.id,
|
// dataname: "md_org_account"
|
// }
|
// Server.call("root/data/InputCommit", param_commit, function(result) {
|
// me.iscommit = false;
|
// Root.message({
|
// type: 'success',
|
// message: '提交成功'
|
// });
|
// if (me.iscustomer) {
|
// var formAttr_ = clone(me.formAttr);
|
// var formAttr_register_ = clone(me.formAttr_register);
|
// var formAttr_SYPG_ = clone(me.formAttr_SYPG);
|
|
// formAttr_.disabled = true;
|
// formAttr_register_.disabled = true;
|
// formAttr_SYPG_.disabled = true;
|
|
// me.formAttr = formAttr_;
|
// me.formAttr_register = formAttr_register_;
|
// me.formAttr_SYPG = formAttr_SYPG_;
|
|
// me.isedit = false;
|
// }
|
// else {
|
// me.saveAfter();
|
// }
|
|
// })
|
}
|
else if (callback) {
|
callback();
|
}
|
else {
|
Root.message({
|
type: 'success',
|
message: '保存成功'
|
});
|
//这里需要重新赋值
|
//me.RefreshData(result.data);
|
//刷新页面
|
me.activeTabName = "JCXX";
|
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: '保存失败'
|
});
|
}
|
});
|
},
|
|
RefreshData(me_rowData) {
|
var me = this;
|
var log_tabsobj = clone(me.tabsobj);
|
console.log("前tabsobj", log_tabsobj);
|
var result_meta_ = clone(me.result_meta);
|
var tabsobj_ = clone(me.tabsobj);
|
var metaBydataname = clone(me.metaBydataname_meta);
|
for (var tabcode_ in tabsobj_) {
|
var tabobj_ = tabsobj_[tabcode_];
|
if (tabobj_.dataname && metaBydataname[tabobj_.dataname]) {
|
if (tabobj_.dataname == "md_org_account") {
|
var f_ = metaBydataname["md_org_product"][0];
|
f_.options = me.product_group;
|
|
metaBydataname[tabobj_.dataname].push(f_);
|
|
}
|
else if (tabobj_.dataname == "md_org_shipto") {
|
var formFields_ = [
|
{isshow: "T", field: "md_org_shipto", name: "", typeof: "objlist", labelwidth: "0px",
|
children: [],
|
formattr: {
|
title: "表单信息",
|
istitle: false,
|
columnnumber: 2,
|
labelwidth: "180px",
|
labelposition: "left", //"right",
|
size: "medium",
|
disabled: false,
|
bordertop: "5px solid #c6c6c600",
|
}, colspan: 2, required: true},
|
]
|
formFields_[0].children = clone(metaBydataname[tabobj_.dataname]);
|
|
metaBydataname[tabobj_.dataname] = clone(formFields_);
|
}
|
|
tabobj_.formFields = clone(metaBydataname[tabobj_.dataname]);
|
if (tabobj_.dataname == "md_org_shipto") {
|
tabobj_.formData = {
|
md_org_shipto: [{}]
|
}
|
}
|
|
else {
|
var newformData_ = {};
|
metaBydataname[tabobj_.dataname].map(field=>{
|
if (field.inputtype == "checkboxobj") {
|
newformData_[field.field] = [];
|
}
|
})
|
|
tabobj_.formData = newformData_
|
}
|
if (me_rowData[tabobj_.dataname] && !result_meta_[tabobj_.dataname].lasyload) {
|
if (tabobj_.dataname == "md_org_shipto") {
|
var md_org_shipto_ = [{}]
|
if (me_rowData[tabobj_.dataname].length) {
|
md_org_shipto_ = me_rowData[tabobj_.dataname];
|
}
|
tabobj_.formData = {
|
md_org_shipto: md_org_shipto_
|
}
|
}
|
else if(tabobj_.dataname == "business_device_license"){
|
tabobj_.formData = me_rowData[tabobj_.dataname]
|
var authorize_scope_ = [];
|
for(var i in me_rowData.md_org_biz_regist_scope) {
|
if(i == "is_all" && me_rowData.md_org_biz_regist_scope[i]) {
|
authorize_scope_.push(i)
|
}else 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)
|
}
|
}
|
if (me_rowData.md_org_biz_regist_scope) {
|
me.authorize_scope_id = me_rowData.md_org_biz_regist_scope.id;
|
}
|
tabobj_.formData.authorize_scope = authorize_scope_;
|
// if(me_rowData.md_org_register) {
|
// let data_ = me_rowData.md_org_register
|
// me.$set(tabobj_.formData, "instrument_license_business_address", data_.instrument_license_business_address);
|
// }
|
}
|
else if(tabobj_.dataname != "md_org_opening" && tabobj_.dataname != "md_org_shipto" && tabobj_.dataname != "md_org_product") {
|
metaBydataname[tabobj_.dataname].map(field=>{
|
if (field.inputtype == "checkboxobj" && !me_rowData[tabobj_.dataname][field.field]) {
|
me_rowData[tabobj_.dataname][field.field] = []
|
}
|
})
|
|
tabobj_.formData = me_rowData[tabobj_.dataname]
|
}
|
if (tabobj_.dataname == "md_org_account") {
|
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(tabobj_.formData, "product_category_name", md_org_product_);
|
}
|
else {
|
me.$set(tabobj_.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(tabobj_.formData, "authorization_province", md_org_province_);
|
}
|
else {
|
me.$set(tabobj_.formData, "authorization_province", []);
|
}
|
}
|
}
|
tabobj_.lasyload = result_meta_[tabobj_.dataname].lasyload;
|
}
|
|
if (tabobj_.tablename && metaBydataname[tabobj_.tablename]) {
|
tabobj_.tableFields = clone(metaBydataname[tabobj_.tablename]);
|
tabobj_.tableData = [];
|
tabobj_.pagesize = 10;
|
tabobj_.pagenum = 0;
|
tabobj_.total = 0;
|
if (me_rowData[tabobj_.tablename] && !result_meta_[tabobj_.tablename].lasyload) {
|
tabobj_.tableData = me_rowData[tabobj_.tablename]
|
}
|
}
|
}
|
|
me.tabsobj = clone(tabsobj_);
|
console.log("后tabsobj", tabsobj_);
|
},
|
|
onpassApproval(type){
|
this.approvalType = "";
|
if (type == "account") {//开户审批
|
this.approvalType = "account";
|
}
|
this.textarea2 = "";
|
this.reasonvisible = true;
|
this.passOrRefuse = true;
|
},
|
onrefuseApproval(type){
|
this.approvalType = "";
|
if (type == "account") {//开户审批
|
this.approvalType = "account";
|
}
|
|
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 (this.approvalType == "account") {//开户审批
|
state_ = "flowApprove"
|
if (!bo) {
|
state_ = "flowReject"
|
}
|
}
|
else {//商务审批
|
if (!bo) {
|
state_ = "reject"
|
}
|
}
|
|
if (state_ == "approve") {//商务审核,需先保存数据
|
this.saveRowTable(function() {
|
me.doRunPassApproval(state_, bo);
|
});
|
|
}
|
else {
|
this.doRunPassApproval(state_, bo)
|
}
|
},
|
|
doRunPassApproval(state_, bo) {
|
var me = this;
|
let param = {
|
dataname: "md_org_account",
|
id: me.formData.id,
|
}
|
Server.call("root/data/" + state_, param, function(result) {
|
me.loading_pass = false;
|
console.log(result);
|
// if (bo && state_ == "flowApprove") {
|
// 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
|
if (bo) {
|
Root.message({
|
type: 'success',
|
message: '审批成功'
|
});
|
me.saveAfter();
|
}
|
else {
|
Root.message({
|
type: 'success',
|
message: '已拒绝'
|
});
|
me.saveAfter();
|
}
|
});
|
}
|
|
|
}
|
});
|
};
|
|
loadJsCss(function () {
|
initVue();
|
});
|
</script>
|
<style>
|
/* 在vue.js中 v-cloak 这个指令是防止页面加载时出现 vuejs 的变量名而设计的 */
|
[v-cloak] {
|
display: none !important;
|
}
|
.box-card {
|
border: 1px solid #DCDFE6 !important;
|
-webkit-box-shadow: 0 2px 4px 0 rgb(0 0 0 / 12%), 0 0 6px 0 rgb(0 0 0 / 4%) !important;
|
box-shadow: 0 2px 4px 0 rgb(0 0 0 / 12%), 0 0 6px 0 rgb(0 0 0 / 4%) !important;
|
}
|
.box-card > .el-card__body {
|
padding: 0px;
|
}
|
|
.box-card .el-tabs--border-card>.el-tabs__content {
|
padding: 0px 15px !important;
|
}
|
|
.box-card .el-tabs--border-card {
|
border: 0px;
|
box-shadow: none;
|
}
|
|
.me_h_itemgroup_row {
|
margin-bottom: 10px;
|
}
|
|
.me_h_itemgroup_row .me_h_unitlabel:before {
|
content: '*';
|
color: #F56C6C;
|
margin-right: 4px;
|
}
|
|
.me_h_itemgroup_row .me_h_nounitlabel:before {
|
content: '*';
|
color: #F56C6C00;
|
margin-right: 4px;
|
}
|
|
.h_valexplain {
|
color: #ccc;
|
}
|
</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 style="margin-right: 18px;float: right;">
|
<el-button v-if="ischange" @click="onChangeData">变 更</el-button>
|
</div> -->
|
</div>
|
|
</div>
|
|
<div >
|
<el-card class="box-card">
|
<el-tabs v-model="activeTabName" type="border-card" @tab-click="handleClick"> <!-- type="border-card" -->
|
<el-tab-pane v-for="(tab, k) in tabs" :label="tab.name" :name="tab.code" :key="tab.code">
|
<div :style="{height: tab.children ? '32px' : '0px'}">
|
<el-tabs v-if="tab.children" v-model="activeTabName_detail" @tab-click="handleClick_detail">
|
<el-tab-pane v-for="(tab_d, k) in tab.children" :label="tab_d.name" :name="tab_d.code" :key="tab_d.code">
|
</el-tab-pane>
|
</el-tabs>
|
</div>
|
</el-tab-pane>
|
</el-tabs>
|
|
<div v-if="tabRefresh" :style="{height: ((activeTabName == 'SYPG' || activeTabName == 'SYZZ') ? height_short : height_long) + 'px', 'overflow-y': 'auto'}">
|
<!-- 基础信息-->
|
<div v-if="activeTabName=='JCXX'">
|
<h-form
|
ref="JCXX"
|
:form-attr="formAttr_JCXX"
|
:table-fields="selectTabObj.formFields"
|
:form-data="selectTabObj.formData"
|
:table-field-click="formfieldClick"
|
>
|
</h-form>
|
|
<h-table v-if="selectTabObj && selectTabObj.tableFields"
|
ref="table1"
|
:table-fields="selectTabObj.tableFields"
|
:table-data="selectTabObj.tableData"
|
:pagesize="selectTabObj.pagesize"
|
:pagenum="selectTabObj.pagenum"
|
:total="selectTabObj.total"
|
:table-field-click="tablefieldClick"
|
|
v-on:get-data="getData"
|
>
|
</h-table>
|
</div>
|
|
<!-- 经营状况-->
|
<!-- 业务能力-->
|
<!-- QA资质-->
|
<!-- 合规要求-->
|
|
<!-- 营业执照-->
|
<div v-show="activeTabName=='SYZZ' && activeTabName_detail=='YYZZ'">
|
<div style="width: 100%; float: right;">
|
<div>
|
<h-form
|
ref="YYZZ"
|
:form-attr="formAttr_register"
|
:table-fields="tabsobj.YYZZ.formFields"
|
:form-data="tabsobj.YYZZ.formData"
|
:table-field-click="formfieldClick"
|
>
|
</h-form>
|
</div>
|
</div>
|
</div>
|
<!-- 器械经营许可证-->
|
<div v-show="activeTabName=='SYZZ' && activeTabName_detail=='QXJYXKZ'">
|
<div style="width: 100%; float: right;">
|
<div>
|
<h-form
|
ref="QXJYXKZ"
|
:form-attr="formAttr_register"
|
:table-fields="tabsobj.QXJYXKZ.formFields"
|
:form-data="tabsobj.QXJYXKZ.formData"
|
:table-field-click="formfieldClick"
|
>
|
</h-form>
|
</div>
|
</div>
|
</div>
|
<!-- 财务开票-->
|
<div v-show="activeTabName=='CWKP'">
|
<div style="width: 100%; float: right; ">
|
<div style="padding: 5px 10px;">
|
<h-form
|
ref="CWKP"
|
:form-attr="formAttr"
|
:table-fields="tabsobj.CWKP.formFields"
|
:form-data="tabsobj.CWKP.formData"
|
:table-field-click="formfieldClick"
|
>
|
</div>
|
</div>
|
</div>
|
<!-- 订单物流-->
|
<div v-show="activeTabName=='DDWL'">
|
<div style="overflow: auto;">
|
<h-form
|
ref="DDWL"
|
:form-attr="formAttr"
|
:table-fields="tabsobj.DDWL.formFields"
|
:form-data="tabsobj.DDWL.formData"
|
:table-field-click="formfieldClick"
|
|
v-on:button-click="(obj)=>buttonClick(obj)"
|
>
|
</div>
|
</div>
|
</div>
|
</el-card>
|
</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 size="small" type="primary" :loading="loading_pass" @click="saveReason">确 定</el-button>
|
<el-button size="small" type="default" @click="reasonvisible = false">取 消</el-button>
|
</div>
|
</el-dialog>
|
|
<div v-if="tabRefresh" class="el-dialog__footer">
|
<el-button v-if="!iscustomer" 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" 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 && isBusiness" type="success" @click="onpassApproval">商务审批通过</el-button>
|
<el-button size="small" v-if="isapproval && isBusiness" type="danger" @click="onrefuseApproval">商务审批拒绝</el-button>
|
|
<el-button size="small" v-if="isapproval && isUnderOpen" type="success" @click="onpassApproval('account')">通 过</el-button>
|
<el-button size="small" v-if="isapproval && isUnderOpen" type="danger" @click="onrefuseApproval('account')">拒 绝</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>
|