<!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 src="../../../js/vue/vue.js"></script>
|
<script src="../../../js/vue/element-ui/lib/index.js"></script>
|
<script src="../../../js/myelement.js?v=20220425"></script>
|
<script src="../../../js/vue/page.js?v=20220425"></script>
|
<script src="../setting.js"></script>
|
|
<link href="../../../js/vue/element-ui/lib/theme-chalk/index.css" rel="stylesheet">
|
<link href="../../../css/myelement.css?v=20220425" rel="stylesheet">
|
<link href="../../../css/iconfont.css" rel="stylesheet">
|
<link href="../../../css/page.css?v=20220425" rel="stylesheet">
|
<link href="//at.alicdn.com/t/font_2374495_13ltsxm2eor.css" rel="stylesheet">
|
</head>
|
|
<body>
|
<div id="vbody">
|
<div id="page_root">
|
<div class="topbar">
|
<span>{{title}}</span>
|
|
<div style="float: right; margin-right: 24px;">
|
<el-button-group style="margin-left: 3px;">
|
<!-- <el-button v-if="buttons.openanaccount" @click="acct_mapping('add')">新增商业</el-button>
|
<el-button v-if="selectedrow.status" @click="acct_mapping('browse')">查看商业</el-button>
|
<el-button v-if="selectedrow.status == 'open' && selectedrow.status_detail == 'open'" @click="verification">商业变更</el-button>
|
<el-button v-if="selectedrow.id && (!selectedrow.status || selectedrow.status == 'input' || selectedrow.status == 'refuse' ) && !selectedrow.old_id" @click="acct_mapping('edit', 'acctstate', 'input')">商业修改</el-button>
|
<el-button v-if="(!selectedrow.status || selectedrow.status == 'input') && selectedrow.old_id" @click="acct_mapping('versionedit')">变更编辑</el-button>
|
<el-button v-if="selectedrow.status == 'refuse' && selectedrow.old_id" @click="acct_mapping('versionedit_refuse')">变更调整</el-button>
|
-->
|
|
<el-button @click="export_excel">导出</el-button>
|
|
<el-button v-if="buttons.openanaccount" @click="acct_mapping('add')">新增商业</el-button>
|
<el-button v-if="buttons.openanaccount" :disabled="!(selectedrow.id && iscustomerdel)" @click="del_customer">删除商业</el-button>
|
<el-button :disabled="!selectedrow.id" @click="acct_mapping('browse')">查看商业</el-button>
|
<el-button v-if="buttons.openanaccount" :disabled="!(selectedrow.id && iscustomeredit)" @click="acct_mapping('newedit')">商业修改</el-button>
|
<!--
|
<el-button v-if="buttons.openanaccount" :disabled="!(selectedrow.id && (!selectedrow.status || selectedrow.status == 'input' || selectedrow.status == 'refuse' || selectedrow.z_status_detail) && selectedrow.status_detail != 'open' && !selectedrow.old_id)" @click="acct_mapping('edit', 'acctstate', 'input')">商业修改</el-button>
|
<el-button v-if="buttons.openanaccount" :disabled="!(selectedrow.status == 'open' && selectedrow.status_detail == 'open')" @click="verification">基础信息变更</el-button>
|
<el-button v-if="buttons.openanaccount" :disabled="!((!selectedrow.status || selectedrow.status == 'input' || selectedrow.status == 'refuse') && selectedrow.old_id)" @click="acct_mapping('v_edit')">变更编辑</el-button>
|
-->
|
<!-- <el-button v-if="buttons.freeze" disabled @click="">商业冻结</el-button> -->
|
<!-- <el-button :disabled="!(!selectedrow.freeze && selectedrow.id && selectedrow.md_code && selectedrow.status == 'open')" @click="add_ba">新增发货主体</el-button> -->
|
<!-- <el-button :disabled="!((!selectedrow.status || selectedrow.status == 'input') && selectedrow.old_id)" @click="acct_mapping('versionedit')">变更编辑</el-button>
|
<el-button :disabled="!(selectedrow.status == 'refuse' && selectedrow.old_id)" @click="acct_mapping('versionedit_refuse')">变更调整</el-button> -->
|
|
<!-- <el-button v-if="buttons.openanaccount" :disabled="buttons.openanaccount.disabled" @click="h_procedure_act('acctstate', 'input', 'working', 'md_description', '开户', '等待审批中', 'customeracct')">开户提交</el-button> -->
|
<!-- <el-button v-if="buttons.openanaccountapproval" :disabled="buttons.openanaccountapproval.disabled" @click="approvalData('register_state')">开户审批</el-button> -->
|
</el-button-group>
|
</div>
|
</div>
|
|
<div class="topbar-line">
|
<div style="float: left; width: 100%;">
|
<el-tabs v-if="isDistributor" v-model="activeNamezz" @tab-click="handleClick">
|
<el-tab-pane label="全部商业" name="1"></el-tab-pane>
|
</el-tabs>
|
|
<el-tabs v-else v-model="activeNamezz" @tab-click="handleClick">
|
<el-tab-pane label="全部商业" name="1"></el-tab-pane>
|
<el-tab-pane label="备案中商业" name="2"></el-tab-pane>
|
<el-tab-pane label="变更中商业" name="3"></el-tab-pane>
|
</el-tabs>
|
</div>
|
|
<div class="query-icon">
|
<i class="iconfont icon-query"></i>
|
</div>
|
<div class="query-bar">
|
<h-form-filter
|
v-if="showfilter"
|
ref="form1"
|
:form-attr="filterAttr"
|
:table-fields="filterFields"
|
:form-data="filterObj"
|
:buttonloading="tableloading"
|
:isbuttonquery="true"
|
|
v-on:on-formchange="onQuery"
|
v-on:show-popup="showFilterPopup"
|
v-on:on-query="onQuery"
|
v-on:on-init-query="onInitFilter"
|
v-on:on-edit-query="onEditFilter"
|
>
|
</h-form-filter>
|
</div>
|
</div>
|
|
<div class="versionNo">
|
<h-table
|
v-if="isRefresh"
|
ref="table1"
|
:tableloading="tableloading"
|
:table-fields="tableFields"
|
:table-data="tableData"
|
:is-edit-table-data="isEditTableData"
|
:pagesize="pagesize"
|
:pagenum="pagenum"
|
:total="total"
|
:table-height="tableHeight"
|
:is-highlight-row="true"
|
:is-show-index="true"
|
|
v-on:get-data="getData"
|
v-on:edit-data="editData"
|
v-on:del-data="delData"
|
v-on:cell-click="cellClick"
|
v-on:row-click="rowClick"
|
>
|
</h-table>
|
</div>
|
|
<el-dialog title="未审批完的备案和资质" :visible.sync="dialog_notapproval">
|
<h-table
|
:table-fields="notApprovalFields"
|
:table-data="notApprovalData"
|
>
|
</h-table>
|
</el-dialog>
|
|
</div>
|
|
<div id="page_loading" style="position: absolute; top:0px; width: 100vw; height: 100vh;">
|
<div class="spinner">
|
<div class="cube1"></div>
|
<div class="cube2"></div>
|
</div>
|
</div>
|
</div>
|
|
<script type="text/javascript">
|
var setting = getSetting("customer_list");
|
var initlized = false;
|
|
new ListVue({
|
el: "#vbody",
|
data: {
|
pageAttr: {
|
heightType: "page"
|
},
|
//dataname: "vCustomer",,//"accountCustomer",//"customerNow",
|
//orderby: "create_time desc",
|
|
dataname: "customer_list",//"accountCustomer",
|
orderby: "create_time desc",
|
filterObjBydefault: {
|
//status: "open"
|
},
|
paramObjBydefault: {
|
empId: localStorage.getItem("emp_id")
|
},
|
tabaleFieldsName: "customer_acct",
|
filterFieldsName: "customer_acct",
|
dataRequest: [
|
"province",
|
{
|
isClientMode: false,
|
code: "code",
|
label: "name",
|
name: "hierarchy",
|
filter: "long_code like '01!0101!010102!010102628!01010218!20210420-0001%'"
|
},
|
{
|
isClientMode: false,
|
code: "code",
|
label: "name",
|
name: "division_level1",
|
filter: " level='1' and active='1'"
|
},
|
{
|
isClientMode: false,
|
code: "code",
|
label: "name",
|
name: "deliveryOrganizationOpen",
|
},
|
{
|
isClientMode: false,
|
code: "send_code",
|
label: "code",
|
dataname: "division_level1",
|
name: "mdm_province_mapping",
|
filter: " level='1' and active='1'"
|
},
|
],
|
dataRequestObj: {},
|
showfilter: true,
|
|
filterAttr: {
|
columnnumber: 3,
|
labelwidth: "130px",
|
labelposition: "right",
|
size: "medium",
|
border: "0px solid #c6c6c600",
|
},
|
|
title: "商业清单",
|
page: setting.page,
|
buttons: setting.buttons,
|
|
provinces: [],
|
|
dialog_notapproval: false,
|
notApprovalFields: [
|
{isshow: "T", field: "delivery_part_name", name: "主体名称"},
|
{isshow: "T", field: "delivery_status", name: "备案状态", width: "100", formatter: "formatter_OrderState"},
|
{isshow: "T", field: "cer_status", name: "资质状态", width: "100", formatter: "formatter_OrderState"},
|
],
|
notApprovalData: [],
|
|
z_status_detail: "",
|
iscustomerdel: false,
|
iscustomeredit: false,
|
|
activeNamezz: "1",
|
total_tab0: 0,
|
total_tab1: 0,
|
total_tab2: 0,
|
total_tab3: 0,
|
isDistributor: false,
|
isadmin: false,
|
},
|
created() {
|
var me = this;
|
|
this.pageCode = "A8-1";//resource_page中的code字段对应的值
|
this.getResoures();
|
this.isDistributor = localStorage.getItem("isdistributor") ? true : false;
|
},
|
mounted() {
|
var me = this;
|
if (this.dataRequest.length) {
|
var result = {};
|
this.loadRequestData(this.dataRequest, result, function(data) {
|
me.dataRequestObj = data;
|
if(me.tableFields.length > 0) {
|
var tableFields_ = clone(me.tableFields);
|
tableFields_.map(e=>{
|
if (e.field == "province") {
|
e.formatterjson = me.dataRequestObj.map.division_level1;
|
}
|
if (e.field == "record_province") {
|
e.formatterjson = me.dataRequestObj.map.division_level1;
|
}
|
|
if (me.isDistributor) {
|
if (e.field == "md_description" || e.field == "md_code" || e.field == "uscc") {
|
e.isshow = "F";
|
}
|
}
|
});
|
|
me.tableFields = tableFields_;
|
}
|
|
if(me.filterFields.length > 0) {
|
var filterFields_ = clone(me.filterFields);
|
filterFields_.map(e=>{
|
if(e.field == "dep_code") {
|
e.options = me.dataRequestObj.hierarchy;
|
}
|
if(e.field == "record_province") {
|
e.options = me.dataRequestObj.division_level1;
|
}
|
if(e.field == "delivery_part_code") {
|
e.options = me.dataRequestObj.deliveryOrganizationOpen;
|
}
|
|
me.filterFieldsObj[e.field] = e;
|
});
|
|
me.filterFields = filterFields_;
|
}
|
|
me.initData();
|
});
|
}
|
else {
|
this.initData();
|
}
|
this.$nextTick(() => { // 以服务的方式调用的 Loading 需要异步关闭
|
hideLoading();
|
});
|
},
|
methods:{
|
initData() {
|
//1. run only
|
if (initlized) { return; }
|
initlized = true;
|
|
//2. query data
|
let roleList = window.top.userinfo.user.roleList;
|
this.isadmin = false;
|
roleList.map(e=>{
|
if(e.code == 'admin') {
|
this.isadmin = true;
|
}
|
})
|
if(this.isadmin) {
|
this.filterTxt = " 1=1 and c.used = 1 ";
|
|
var total_tab = "total_tab" + this.activeNamezz;
|
this.totaltab = total_tab;
|
this.onQuery(total_tab);
|
}
|
|
else if (this.isDistributor) {
|
this.activeNamezz = "3";
|
var total_tab = "total_tab" + this.activeNamezz;
|
this.totaltab = total_tab;
|
//this.dataname = "customerDeliveryInfo";
|
this.paramObjBydefault = {
|
empId: localStorage.getItem("emp_id"),
|
empCode: localStorage.getItem("emp_code")
|
}
|
//this.filterTxt = " customer_delivery_mapping.used = 1 AND customer_delivery_mapping.active = 1 and f1.status='open'";
|
this.filterTxt = " c.uscc='"+ localStorage.getItem("distributor_uscc") +"' and c.used = 1 AND c.active = 1 ";
|
this.onQuery(total_tab);
|
}
|
else {
|
this.filterTxt = "c.used = 1 AND ((c.old_id is null and dc.un_input_cnt > 0) or (c.old_id is not null and c.flow_id is not null) or (c.old_id is null and c.flow_id is null))";
|
|
var total_tab = "total_tab" + this.activeNamezz;
|
this.totaltab = total_tab;
|
this.onQuery(total_tab);
|
}
|
//this.onQuery();
|
},
|
|
onServerInitData(data) {
|
var me = this.data;
|
me.tableFields = data.tableFields;
|
me.filterFields = data.filterFields;
|
|
if(me.filterFields.length > 0) {
|
me.filterFields.map(e=>{
|
me.filterFieldsObj[e.field] = e;
|
});
|
}
|
if(me.tableFields.length > 0) {
|
me.tableFields.map(e=>{
|
me.tableFieldsObj[e.field] = e;
|
});
|
|
}
|
},
|
|
handleClick(tab) {
|
var me = this;
|
var total_tab = "total_tab" + tab.name;
|
this.totaltab = total_tab;
|
/*
|
customerInfo 商业清单 数据对象 :
|
全部已开户商业 c.used = 1 AND c.active = 1
|
我创建/变更的商业 c.create_operate_id = 当前人的empId
|
当前变更商业: c.used = 1 AND c.active = 0 and c.status in ('refuse', 'working')
|
当前所有商业信息 (c.used = 1 AND c.active = 0 )or(c.used = 1 AND c.active = 0 and c.status in ('refuse', 'working'))
|
|
*/
|
if (tab.name == "2") {
|
this.filterTxt = "used = 1 AND active = 0 and status in ('refuse', 'working') and old_id is null";
|
}
|
else if (tab.name == "3") {
|
this.filterTxt = "used = 1 AND active = 0 and f.status in ('refuse', 'working') and old_id is not null";
|
}
|
else if (tab.name == "1") {
|
if (this.isDistributor) {
|
this.filterTxt = " c.uscc='"+ localStorage.getItem("distributor_uscc") +"' and c.used = 1 AND c.active = 1 ";
|
}
|
else if(this.isadmin) {
|
this.filterTxt = " 1=1";
|
}
|
else {
|
this.filterTxt = "c.used = 1 AND ((c.old_id is null and dc.un_input_cnt > 0) or (c.old_id is not null and c.flow_id is not null) or (c.old_id is null and c.flow_id is null))";
|
}
|
}
|
|
this.onQuery(total_tab);
|
},
|
|
onshowFilterPopup(filter) {
|
var me = this;
|
var fieldObj_ = filter.obj;
|
var filterValue = clone(me.filterObj);
|
var field_ = fieldObj_.field;
|
|
if (field_ == "operator_name") {
|
Root.showPopup({
|
url: "../md/customer/popup/employee_list.html",
|
delta: {
|
isvemployeeall: true
|
},
|
width: 800,
|
height: 550,
|
callback: function(result, callback) {
|
filterValue[field_] = result.row.md_description;
|
if (fieldObj_.valfield) {
|
filterValue[fieldObj_.valfield] = result.row.md_code;
|
}
|
me.filterObj = filterValue;
|
me.onQuery();
|
if (callback) {
|
callback();
|
}
|
}
|
});
|
|
}
|
},
|
|
onTableDataAfter(a, b) {
|
let me = this;
|
if (this.tableData.length) {
|
this.tableData.map(e=>{
|
//设置备案状态
|
var status_detail_ = "";
|
if (e.total_cnt > 0) {
|
var input_cnt = e.total_cnt - e.un_input_cnt;
|
if (e.un_input_cnt == 0) {
|
//全部录入,可编辑头,可编辑明细,可批量提交
|
status_detail_ = "input";
|
}
|
else if (e.open_cnt == e.total_cnt || (e.open_cnt + e.close_cnt) == e.total_cnt) {
|
//全部通过,可编辑头,可编辑未提交明细,仅单条提交
|
status_detail_ = "open";
|
}
|
else if (e.refuse_cnt > 0) {
|
//未全部通过,不可编辑头, 可编辑明细,仅单条提交
|
status_detail_ = "refuse";
|
}
|
else if ((e.open_cnt + e.refuse_cnt + e.close_cnt + input_cnt) == e.total_cnt) {//refuse_cnt, close_cnt
|
//部分通过, 除通过外其余的明细都被打回或撤销,可编辑头,可编辑未提交明细,仅单条提交
|
status_detail_ = "exist_open_all";
|
}
|
else if (e.open_cnt > 0) {
|
//未全部通过,不可编辑头, 可编辑明细,仅单条提交
|
status_detail_ = "exist_open";
|
}
|
else if (e.un_input_cnt > 0) {
|
//未全部通过,不可编辑头,不可编辑明细
|
status_detail_ = "working";
|
}
|
|
}
|
else {
|
//没有明细,可编辑头,可编辑明细,可批量提交
|
status_detail_ = "input";
|
}
|
|
if (status_detail_ == "input"
|
|| status_detail_ == "open"
|
|| status_detail_ == "exist_open_all"
|
|| status_detail_ == "refuse"
|
|| status_detail_ == "exist_open"
|
) {
|
e.z_status_detail = "refuse";
|
}
|
else {
|
e.z_status_detail = "";
|
}
|
|
|
e.status_detail = status_detail_;
|
if (!e.status) {
|
if (!e.old_id && e.refuse_cnt > 0) {
|
e.status = "refuse";
|
}
|
else if (!e.old_id && e.open_cnt > 0) {
|
e.status = "open";
|
}
|
else if (!e.old_id && e.un_input_cnt == 0) {
|
e.status = "input";
|
}
|
|
else if (!e.old_id && e.close_cnt == e.total_cnt) {
|
e.status = "close";
|
}
|
else if (!e.old_id) {
|
e.status = "working";
|
}
|
//else e.status = "input";
|
}
|
|
});
|
|
this.$nextTick(function(){
|
this.isRefresh = true;
|
this.$nextTick(function(){
|
if (me.pageAttr && me.pageAttr.heightType == "table") {
|
me.tableHeight = settableHeight(me.$refs.table1.$el, me.pagesize);
|
}
|
else if (me.pageAttr && me.pageAttr.heightType == "page") {
|
var el_list = [];
|
if (me.$refs.form1 && me.$refs.form1.$el) {
|
el_list.push(me.$refs.form1.$el);
|
}
|
|
me.tableHeight = setpageHeight(me.$refs.table1.$el, el_list);
|
}
|
})
|
})
|
|
}
|
|
else if(this.filterObj.uscc) {
|
var bo_ = true;
|
for(var k in this.filterObj) {
|
if (k != "uscc") {
|
bo_ = false;
|
}
|
}
|
if (bo_) {
|
let uscc_val = this.filterObj.uscc;
|
let param_table = {
|
isClientMode: false,
|
dataname: "getUnOpenCustomer",
|
returnType: "entityset",
|
filter: "c.uscc= '" + uscc_val + "'"
|
}
|
Server.call("root/data/procedure", param_table, function(result) {
|
console.log(result);
|
if (result.data.entityset && result.data.entityset.length > 0) {
|
var row_ = result.data.entityset[0];
|
var name_ = "";
|
if (row_.create_operate_name) {
|
name_ = row_.create_operate_name;
|
}
|
|
Root.message({
|
type: 'warning',
|
message: name_ + '已创建该商业'
|
});
|
}
|
//else {
|
// let param_mdm = {
|
// isClientMode: false,
|
// }
|
//
|
// Server.call("mdm/check/uscc/" + uscc_val, param_mdm, function(result) {
|
// console.log(result);
|
// if (result.success) {
|
// var row = result.data;
|
// Root.confirm('是否开户-' + row.md_description + '-吗?', '开户提示', {
|
// confirmButtonText: '开户',
|
// cancelButtonText: '取消',
|
// type: 'warning'
|
// }).then(() => {
|
// if(row.record_province) {
|
// row.record_province = me.dataRequestObj.map.mdm_province_mapping[row.record_province]
|
// }
|
// me.acct_mapping('add_mdm', null, null, row);
|
// }).catch(() => {
|
// Root.message({
|
// type: 'info',
|
// message: '已取消开户'
|
// });
|
// });
|
// }
|
// }, function(error) {
|
// console.log(error);
|
//
|
// });
|
//}
|
})
|
}
|
}
|
|
},
|
|
onAddData(config) {
|
var me = this;
|
|
config.combine({
|
url: "../md/customer/customer_edit.html",
|
sceneCode: "add",
|
data: {},
|
delta: {},
|
callback: function(obj) {
|
me.saveRowTable_popup(obj);
|
}
|
});
|
|
return true;
|
},
|
|
onEditData(config, scope) {
|
var me = this;
|
var row = scope.row;
|
|
//1. empty row
|
if (!row || !row.id) {
|
Root.message({
|
type: 'warning',
|
message: '请选择要编辑的数据'
|
});
|
return false;
|
}
|
|
//2. not input
|
if (row.state != "input") {
|
Root.message({
|
type: 'warning',
|
message: "当前数据不是输入状态"
|
})
|
return false;
|
}
|
|
//3. popup
|
config.combine({
|
url: "../md/customer/customer_edit.html",
|
sceneCode: "edit",
|
data: row,
|
delta: {},
|
callback: function(obj) {
|
me.saveRowTable_popup(obj);
|
}
|
});
|
|
return true;
|
},
|
|
onApproveData(config, code) {
|
var me = this;
|
var row = this.selectedrow;
|
|
//1. empty row
|
if (!row || !row.id) {
|
Root.message({
|
type: 'warning',
|
message: '请选择要审批的数据'
|
});
|
return false;
|
}
|
|
//2 check state
|
var field_, url_;
|
if (code == "data_state") {
|
field_ = "state";
|
url_ = "../md/customer/customer_edit.html";
|
}
|
else if (code == "register_state") {
|
field_ = "statecode";
|
url_ = "../md/customer/account_open.html";
|
}
|
|
var state = row[field_];
|
|
/* if ("working" != state) {
|
Root.message({
|
type: 'warning',
|
message: "当前数据不是【审批中】状态"
|
})
|
return false;
|
} */
|
|
//3. popup
|
config.combine({
|
url: url_,
|
sceneCode: "approval",
|
data: row,
|
delta: {},
|
callback: function(obj) {
|
me.saveRowTable_popup(obj);
|
}
|
})
|
return true;
|
},
|
|
onRowClick(obj) {
|
//判断是否可删除
|
if (this.selectedrow.id && (!this.selectedrow.status || this.selectedrow.status == 'input' || this.selectedrow.status == 'close') && !this.selectedrow.old_id) {
|
if(this.selectedrow.create_operate_id || this.selectedrow.create_operate_code) {
|
if (this.selectedrow.create_operate_id == localStorage.getItem("emp_id") || this.selectedrow.create_operate_code == localStorage.getItem("emp_code") || this.selectedrow.operator_code == localStorage.getItem("emp_code")) {
|
this.iscustomerdel = true;//商业删除
|
}
|
else {
|
this.iscustomerdel = false;
|
}
|
}
|
else {
|
this.iscustomerdel = true;//商业删除
|
}
|
}
|
|
if (this.selectedrow.id && (!this.selectedrow.status || this.selectedrow.status == 'input' || this.selectedrow.status == 'refuse' || this.selectedrow.z_status_detail) && this.selectedrow.status_detail != 'open' && !this.selectedrow.old_id) {
|
if(this.selectedrow.create_operate_id || this.selectedrow.create_operate_code) {
|
if (this.selectedrow.create_operate_id == localStorage.getItem("emp_id") || this.selectedrow.create_operate_code == localStorage.getItem("emp_code") || this.selectedrow.operator_code == localStorage.getItem("emp_code")) {
|
this.iscustomeredit = true;//商业编辑
|
}
|
else {
|
this.iscustomeredit = false;
|
}
|
}
|
else {
|
this.iscustomeredit = true;//商业编辑
|
}
|
}
|
else if (this.selectedrow.id && (!this.selectedrow.status || this.selectedrow.status == 'input' || this.selectedrow.status == 'refuse') && this.selectedrow.old_id) {
|
if(this.selectedrow.create_operate_id || this.selectedrow.create_operate_code) {
|
if (this.selectedrow.create_operate_id == localStorage.getItem("emp_id") || this.selectedrow.create_operate_code == localStorage.getItem("emp_code") || this.selectedrow.operator_code == localStorage.getItem("emp_code")) {
|
this.iscustomeredit = true;//商业变更编辑
|
}
|
else {
|
this.iscustomeredit = false;
|
}
|
}
|
else {
|
this.iscustomeredit = true;//商业编辑
|
}
|
}
|
else if (this.selectedrow.id && this.selectedrow.status == 'open' && this.selectedrow.status_detail == 'open') {
|
this.iscustomeredit = true;//商业信息变更
|
}
|
else {
|
this.iscustomeredit = false;
|
}
|
},
|
|
onCellClick(config, obj) {
|
var me = this;
|
var clickContext = clone(this.selectCellField.clickContext);
|
|
/* if(this.selectCellField.field == "status" && obj.row.flow_id){
|
clickContext.hide_close = true;
|
clickContext.url = "../approval/ApprovalList.html";//Approval_flowid
|
clickContext.delta = {
|
flow_id: obj.row.flow_id,
|
title: obj.row.md_description
|
}
|
|
clickContext.width = "75vw";
|
clickContext.height = "65vh";
|
}
|
else if(this.selectCellField.field == "status" && !obj.row.flow_id){
|
//clickContext.hide_close = true;
|
clickContext.url = "../md/customer/customer_acct_delivery.html";//Approval_flowid
|
clickContext.text = obj.row.md_description;;
|
clickContext.width = "75vw";
|
clickContext.height = "600px";
|
if (obj.row.flow_id) {
|
clickContext.delta = {
|
flow_id: obj.row.flow_id,
|
}
|
}
|
|
} */
|
|
if(this.selectCellField.field == "status" && obj.row.status && obj.row.status != 'input'){
|
clickContext.hide_close = true;
|
clickContext.url = "../md/customer/customer_acct_delivery.html";//Approval_flowid
|
clickContext.text = obj.row.md_description;
|
clickContext.width = "75vw";
|
clickContext.height = "550px";
|
if (obj.row.flow_id) {
|
clickContext.delta = {
|
flow_id: obj.row.flow_id,
|
}
|
}
|
|
}
|
|
else if(this.selectCellField.field == "md_code"){
|
let row = obj.row;
|
|
var sceneCode_ = "";
|
if (row.status_detail) {
|
sceneCode_ = row.status_detail;
|
}
|
|
if (row.create_operate_id != window.top.userinfo.employee.id) {
|
sceneCode_ = "browse"
|
}
|
|
var text_ = row.md_description;
|
var id_ = "acct" + row.id;
|
|
clickContext.totab = true;
|
clickContext.url = "../md/customer/customer_acct.html?v=1";
|
clickContext.text = text_;
|
clickContext.id = id_;
|
clickContext.sceneCode = sceneCode_;
|
clickContext.data = row;
|
clickContext.callback = function(obj, callback) {
|
me.onQuery();
|
if (callback) {
|
callback();
|
}
|
}
|
}
|
|
|
|
if (clickContext && clickContext.type == "popup" && clickContext.url) {
|
config.combine({
|
hide_close: clickContext.hide_close,
|
totab: clickContext.totab,
|
url: clickContext.url,
|
text: clickContext.text,
|
id: clickContext.id,
|
sceneCode: clickContext.sceneCode,
|
data: obj.row,
|
delta: clickContext.delta ? clickContext.delta : {},
|
width: clickContext.width,
|
height: clickContext.height,
|
callback: clickContext.callback
|
})
|
}
|
else {
|
return false;
|
}
|
|
return true;
|
},
|
|
|
/* cellClick(scope) {
|
let me = this;
|
let row = scope.row;
|
let field = scope.column.property;
|
|
var sceneCode_ = "";
|
if (row.status_detail) {
|
sceneCode_ = row.status_detail;
|
}
|
|
if (row.create_operate_id != window.top.userinfo.employee.id) {
|
sceneCode_ = "browse"
|
}
|
|
var text_ = row.md_description;
|
var id_ = "acct" + row.id;
|
if (field == "md_code"){
|
var config = {
|
totab: true,
|
width: "1500px",
|
icon: "icon-product",
|
text: text_,
|
id: id_,
|
url: "../md/customer/customer_acct.html?v=1",
|
sceneCode: sceneCode_,//"browse",
|
data: row,
|
delta: "",
|
callback: function(obj, callback) {
|
//me.uploadFileAfter(obj);
|
me.onQuery();
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
this.doPopupByPublic(config);
|
}
|
}, */
|
|
verification() {
|
let me = this;
|
var bo_ = false;
|
if (!this.selectedrow.uscc) {
|
Root.message({
|
type: 'warning',
|
message: "没有统一信用代码"
|
})
|
return;
|
}
|
|
let param_table = {
|
isClientMode: false,
|
dataname: "getCustomerStatus",
|
returnType: "entityset",
|
filter: "uscc= '" + this.selectedrow.uscc + "'"
|
}
|
Server.call("root/data/procedure", param_table, function(result) {
|
console.log(result);
|
if (result.data.entityset && result.data.entityset.length) {
|
Root.message({
|
type: 'warning',
|
message: '该商业已存在流程'
|
});
|
}
|
else {
|
let param_table = {
|
isClientMode: false,
|
dataname: "getStatusByCustomerUscc",
|
returnType: "entityset",
|
|
filter: "customer_delivery_mapping.customer_uscc = '" + me.selectedrow.uscc + "'"
|
}
|
Server.call("root/data/procedure", param_table, function(result) {
|
console.log(result);
|
me.notApprovalData = [];
|
if (result.data.entityset && result.data.entityset.length) {
|
me.dialog_notapproval = true;
|
me.notApprovalData = result.data.entityset;
|
}
|
else {
|
bo_ = true;
|
}
|
|
if (bo_) {
|
me.acct_mapping("version");
|
}
|
|
});
|
|
}
|
});
|
},
|
|
export_excel() {
|
this.filterTxt;
|
var filter_ = this.getFilterData();
|
var url = baseUrl + "file/downloadDataWithExcel?filter="+ filter_ +"&dataname=customerInfo&type=customerDownload&userId=" + localStorage.getItem("id")+"&name=商业清单.xlsx";
|
dealExportByPath(url, "商业清单.xlsx");
|
},
|
|
del_customer() {
|
var me = this;
|
var name_ = this.selectedrow.md_description;
|
Root.confirm('确定删除' + name_ + '吗?', '删除提示', {
|
confirmButtonText: '删除',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
let param = {
|
id: me.selectedrow.id,
|
isClientMode: false,
|
dataname: "agCustomer",
|
}
|
Server.call("root/data/deleteEntity", param, function(result) {
|
console.log(result);
|
Root.message({
|
type: 'success',
|
message: '删除成功!'
|
});
|
me.doQuery(me.totaltab);
|
});
|
}).catch(() => {
|
Root.message({
|
type: 'info',
|
message: '已取消删除'
|
});
|
});
|
},
|
|
acct_mapping(type, field_, original_val, row_data) {
|
let me = this;
|
let row = {};
|
var text_ = "新增开户";
|
var id_ = "newacct";
|
var sceneCode_ = "add";
|
|
/*
|
<!-- <el-button :disabled="!((!selectedrow.status || selectedrow.status == 'input') && selectedrow.old_id)" @click="acct_mapping('versionedit')">变更编辑</el-button>
|
<el-button :disabled="!(selectedrow.status == 'refuse' && selectedrow.old_id)" @click="acct_mapping('versionedit_refuse')">变更调整</el-button> -->
|
*/
|
|
if (type == "newedit") {
|
//:disabled="!(selectedrow.id && (!selectedrow.status || selectedrow.status == 'input' || selectedrow.status == 'refuse' || z_status_detail) && selectedrow.status_detail != 'open' && !selectedrow.old_id)"
|
//'edit', 'acctstate', 'input'
|
if (this.selectedrow.id && (!this.selectedrow.status || this.selectedrow.status == 'input' || this.selectedrow.status == 'refuse' || this.selectedrow.z_status_detail) && this.selectedrow.status_detail != 'open' && !this.selectedrow.old_id) {
|
type = "edit";//商业编辑
|
}
|
|
//:disabled="!((!selectedrow.status || selectedrow.status == 'input' || selectedrow.status == 'refuse') && selectedrow.old_id)"
|
//type = "v_edit";//商业变更编辑
|
if (this.selectedrow.id && (!this.selectedrow.status || this.selectedrow.status == 'input' || this.selectedrow.status == 'refuse') && this.selectedrow.old_id) {
|
type = "v_edit";//商业变更编辑
|
}
|
|
//:disabled="!(selectedrow.status == 'open' && selectedrow.status_detail == 'open')"
|
//商业信息变更
|
if (this.selectedrow.id && this.selectedrow.status == 'open' && this.selectedrow.status_detail == 'open') {
|
//商业信息变更
|
this.verification();
|
return
|
}
|
|
|
}
|
|
|
if(type == "v_edit") {
|
if ((!this.selectedrow.status || this.selectedrow.status == 'input') && this.selectedrow.old_id) {
|
type = "versionedit";
|
}
|
else if(this.selectedrow.status == 'refuse' && this.selectedrow.old_id) {
|
type = "versionedit_refuse";
|
}
|
|
}
|
|
|
if (type == "add") {
|
row = {
|
country: "000000"
|
};
|
}
|
else if (type == "add_mdm") {
|
row = row_data;
|
sceneCode_ = "add_mdm";
|
}
|
else if(type == "edit") {
|
row = this.selectedrow;
|
if (this.selectedrow[field_] && this.selectedrow[field_] != original_val) {
|
Root.message({
|
type: 'warning',
|
message: "已开户"
|
})
|
return;
|
}
|
|
sceneCode_ = row.status_detail
|
|
text_ = row.md_description;
|
id_ = "acct" + row.id;
|
}
|
else if(type == "version") {
|
row = clone(this.selectedrow);
|
if (this.selectedrow[field_] && this.selectedrow[field_] != original_val) {
|
Root.message({
|
type: 'warning',
|
message: "已开户"
|
})
|
return;
|
}
|
|
sceneCode_ = "version";
|
|
text_ = row.md_description;
|
id_ = "acct" + row.id;
|
}
|
else if(type == "versionedit") {
|
row = clone(this.selectedrow);
|
sceneCode_ = type;
|
text_ = row.md_description;
|
id_ = "acct" + row.id;
|
}
|
|
else {
|
row = clone(this.selectedrow);
|
sceneCode_ = type;
|
text_ = row.md_description;
|
id_ = "acct" + row.id;
|
|
}
|
|
|
var config = {
|
totab: true,
|
width: "1500px",
|
icon: "icon-product",
|
text: text_,
|
id: id_,
|
url: "../md/customer/customer_acct.html?v=1",
|
sceneCode: sceneCode_,
|
data: row,
|
delta: "",
|
callback: function(obj, callback) {
|
//me.uploadFileAfter(obj);
|
me.onQuery();
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
this.doPopupByPublic(config);
|
},
|
|
add_ba() {
|
var me = this;
|
var row = this.selectedrow;
|
|
row.new_customer_id = row.id;
|
let param_table = {
|
isClientMode: false,
|
dataname: "getCustomerStatus",
|
returnType: "entityset",
|
|
filter: "uscc= '" + this.selectedrow.uscc + "'"
|
}
|
Server.call("root/data/procedure", param_table, function(result) {
|
console.log(result);
|
if (result.data.entityset && result.data.entityset.length) {
|
Root.message({
|
type: 'warning',
|
message: '该商业未审批完成'
|
});
|
}
|
else {
|
var text_ = row.md_description + "新增备案";
|
var id_ = "add_acct_" + row.id;
|
var url_ = "../md/customer/contact_acctba.html";
|
|
var config = {
|
totab: true,
|
width: "1500px",
|
icon: "icon-product",
|
text: text_,
|
id: id_,
|
url: url_,
|
sceneCode: "add",
|
data: row,
|
delta: "",
|
callback: function(obj, callback) {
|
me.onQuery();
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
|
me.doPopupByPublic(config);
|
}
|
});
|
},
|
|
consignee_mapping(){
|
var row = this.selectedrow;
|
var row_ ;
|
let me = this;
|
if (!row.id) {
|
Root.message({
|
type: 'warning',
|
message: '请先选择一条数据'
|
})
|
return;
|
}
|
|
Root.popupParames = {
|
width: "900px",
|
//height: "580px",
|
url: "../md/customer/consignee_mapping.html",
|
callback: function(obj, callback) {
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
|
Root.popupParames.data = row;
|
Root.showPopup(Root.popupParames);
|
|
},
|
invoice_mapping(){
|
var row = this.selectedrow;
|
|
if (!row.id) {
|
Root.message({
|
type: 'warning',
|
message: '请先选择一条数据'
|
})
|
return;
|
}
|
|
},
|
licence_mapping(){
|
var row = this.selectedrow;
|
|
if (!row.id) {
|
Root.message({
|
type: 'warning',
|
message: '请先选择一条数据'
|
})
|
return;
|
}
|
Root.popupParames = {
|
width: "900px",
|
//height: "580px",
|
url: "../md/customer/licence_mapping.html",
|
callback: function(obj, callback) {
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
|
Root.popupParames.data = row;
|
Root.showPopup(Root.popupParames);
|
|
|
},
|
//绑定审批流程的
|
h_procedure_act(field_, original_val, new_val, confirm_field, confirm_type, success_val) {
|
var row = this.selectedrow;
|
|
if (!row.field1) {
|
Root.message({
|
type: 'warning',
|
message: '请先选择一条数据'
|
})
|
return;
|
}
|
|
if (row && row[field_] != original_val) {
|
Root.message({
|
type: 'warning',
|
message: row[field_]
|
})
|
return;
|
}
|
|
Root.confirm('确定' + confirm_type + '-' + row[confirm_field] + '-吗?', confirm_type + '提示', {
|
confirmButtonText: confirm_type,
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
if (field_ == "field10") {//提交审批
|
|
}
|
else if (field_ == "field15") {//提交开户提交审批
|
|
}
|
|
this.selectedrow[field_] = new_val;
|
//window.top.setAlertNum();
|
Root.message({
|
type: 'success',
|
message: success_val
|
});
|
}).catch(() => {
|
Root.message({
|
type: 'info',
|
message: '已取消'
|
});
|
});
|
},
|
}
|
});
|
|
</script>
|
<style>
|
|
</style>
|
</body>
|
</html>
|