<!DOCTYPE html>
|
<html>
|
<head>
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
<title>小程序第三方对接入口</title>
|
<link href="./css/main.css" rel="stylesheet">
|
<link href="../../css/frame.css" rel="stylesheet">
|
<link href="../../css/iconfont.css" rel="stylesheet">
|
<link href="../../css/control.css" rel="stylesheet">
|
<link href="../../css/page.css" rel="stylesheet">
|
<link href="../../js/vue/element-ui/lib/theme-chalk/index.css" rel="stylesheet">
|
<link href="//at.alicdn.com/t/font_2374495_0we9t7l9865.css" rel="stylesheet">
|
<script src="../../data/data.js"></script>
|
<script src="../../js/vue/axios/dist/axios.min.js"></script>
|
<script src="../../js/jquery-3.5.1.min.js"></script>
|
|
<script src="../../js/vue/vue.js"></script>
|
<script src="../../js/vue/element-ui/lib/index.js"></script>
|
<script src="../../js/vue/elementDefault.js"></script>
|
<script src="../../js/vue/page.js"></script>
|
<script src="../../js/myelement.js"></script>
|
<script src="../../js/foundation.js"></script>
|
<script src="../../js/control.js"></script>
|
</head>
|
|
<body>
|
<div id="app">
|
<div class="client">
|
<div id="pnl_header" class="header" style="left: 0px;">
|
<div id="btn_toggle" class="but_toggle">
|
<span class="iconfont icon-menulist" style="color: white; margin-left: 10px;"></span>
|
</div>
|
|
<div class="logoArea" >
|
<div id="logoText" class="logoText">
|
<span class="iconfont icon-logo" style="font-size: 20px"></span>
|
<span id="lbl_title" class="open_logo">E-Commerce平台</span>
|
</div>
|
</div>
|
|
|
<div class="bar_system" style="width: 190px">
|
<div id="SH_user" class="bar_btn" style="left: 0px; width: 110px" >
|
<div style="margin-left: 5px; float: left; margin-top: 10px;height: 30px;">
|
<img src="../../img/portrait.jpg" style="height: 30px; border-radius: 50%"/>
|
</div>
|
<div id="lbl_user" style="float: left; font-size: 14px; width: 60px; height: 100%; margin-left: 5px; overflow: hidden;" >无</div>
|
</div>
|
</div>
|
</div>
|
|
<div v-if="show_countdown" class="z_countdown">
|
<div>
|
<span>该节点已审批,{{erroe_code}}</span>
|
</div>
|
</div>
|
<div v-if="show_erroe" class="z_countdown">
|
<div>
|
<span>页面错误,{{erroe_code}}</span>
|
</div>
|
</div>
|
|
<div id="content" class="content" style="left: 0px">
|
</div>
|
</div>
|
</div>
|
|
<!-- <div style="position: absolute; height: 100%; width: 100%; top: 0; background-color: #ffffff36; padding: 0px; margin: 0px;">
|
|
|
<iframe v-if="pathurl" id="bodyFrame" style="height: 100%; width: 100%;" :src="pathurl" ></iframe>
|
</div> -->
|
|
<script type="text/javascript">
|
var alert_num, pnl_header, pnl_account, pnl_message, pnl_setting;
|
var userinfo, toolbar, treeMenu, tab;
|
var alertnum_ ;
|
var isShowAlertnum = false;
|
|
|
function hidePanel() {
|
togglePanel(pnl_account, false);
|
togglePanel(pnl_message, false);
|
togglePanel(pnl_setting, false);
|
}
|
|
function togglePanel(panel, visible) {
|
event.stopPropagation();
|
if (!panel) { return; }
|
panel.visible = (visible == undefined) ? !panel.visible : visible;
|
|
if (panel.visible) {
|
panel.show();
|
}
|
else {
|
panel.hide();
|
}
|
}
|
|
|
function getPeroid() {
|
Server.call("root/system/getPeroid", function(result) {
|
if (result.success) {
|
setLocalData("year", result.year);
|
setLocalData("month", result.month);
|
}
|
});
|
}
|
|
function changePw() {
|
Root.popupParames = {
|
width: "500px",
|
//height: "580px",
|
url: "./password.html",
|
callback: function(obj, callback) {
|
//me.saveRowTable_popup(obj);
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
Root.showPopup(Root.popupParames);
|
/* Win.popup({
|
url: "./password.html",
|
}); */
|
}
|
|
function setPopupWH(width, height, monkey) {
|
if (!monkey) {
|
monkey = $("#main_popup_page1");
|
}
|
else {
|
monkey = $(monkey);
|
}
|
if (width) {
|
monkey.css("width", width);
|
}
|
if (height) {
|
monkey.css("height", height);
|
}
|
};
|
|
function hidePopup(monkey) {
|
if (!monkey) {
|
monkey = $("#main_popup1");
|
}
|
else {
|
monkey = $(monkey);
|
}
|
//监听animation动画结束方法
|
monkey.animate({"margin-left": "-100%"}, 300, function(){
|
if (monkey[0].id == "main_popup1") {
|
Root.popup.zno = 0;
|
}
|
monkey.remove();
|
});
|
|
Root.popupParames = {};
|
};
|
|
</script>
|
|
<script type="text/javascript">
|
vue = new Vue({
|
el: "#app",
|
data: {
|
show_countdown: false,
|
show_erroe: false,
|
close_s: 9,//10秒后被关闭;
|
erroe_code: "",
|
userId: "",
|
user: {},
|
activeName: '0',
|
reminds: [],
|
|
empcode: "",
|
config:{
|
path:"../../page/order/sorder/sorder_list.html",
|
id: "",
|
canApprove: true,
|
flow_id: "",
|
act_type: ""
|
},
|
pathurl:"",//http://127.0.0.1:8848/h5/page/order/sorder/sorder_edit2.html
|
},
|
|
created() {
|
this.browserRedirect();
|
console.info(this.phone);
|
},
|
|
mounted() {
|
this.getpnl_message();
|
},
|
|
methods:{
|
getpnl_message(){
|
var url = window.location.href;//"http://127.0.0.1:8848/h5/AppLoginMain.html?empCode=001007&flowId=47f6e38eae0444d0a7169278df86c4f0"
|
var params = getGetParams(url);
|
var me = this;
|
if(params && params.empCode && params.flowId) {
|
let empCode = params.empCode;
|
let flowid = params.flowId;
|
console.log(empCode);
|
/* this.$confirm('验证token', '验证', {
|
confirmButtonText: '继续',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
//继续提交
|
me.loadOaKey(token,flowid);
|
}).catch(() => {
|
|
}); */
|
this.empcode = empCode;
|
this.loadOaKey(flowid,empCode);
|
}
|
else {
|
this.onCloseWinPage("erroe", "请求错误");
|
}
|
},
|
|
loadOaKey(flowid, empCode) {
|
var me = this;
|
var url = window.top.RootSetting.url_act + "flows/checkFlowData/"+flowid;
|
|
axios.post(url, {
|
isClientMode: false,
|
type:"user",
|
nodeId: empCode
|
})
|
.then(data => {
|
console.log(data.data.data);
|
var flows = data.data.data;
|
|
var scenetype_ = "approval";
|
if (!flows) {
|
me.onCloseWinPage("", "无节点信息");
|
// me.remindWarning("", "1");
|
return
|
}
|
else {
|
if(!flows.path) {
|
me.onCloseWinPage("erroe", "未找到页面");
|
}
|
// debugger
|
|
if(this.phone) {
|
window.location.replace("dingtalk://dingtalkclient/action/open_micro_app?miniAppId=5000000002689518&agentId=1610109120&pVersion=1&packageType=1&corpId=ding6b6a824032ecd975bc961a6cb783455b&page=page_home/main/fact/main?type="+flows.businessType+"%26business_id="+flows.businessId);
|
// const winObj = window.open("dingtalk://dingtalkclient/action/open_micro_app?miniAppId=5000000001342689&agentId=1335770798&pVersion=1&packageType=1&corpId=ding03e1e4643c9f347dffe93478753d9884&page=page_home/main/fact/main?type="+flows.businessType+"&business_id="+flows.businessId);
|
// const loop = setInterval(function () {
|
// if (winObj && winObj.closed) {
|
// alert('我被关闭了');
|
// clearInterval(loop);
|
// window.close();
|
// }
|
// }, 500);
|
|
return
|
}
|
me.config = {
|
path: flows.path,//"../../page/order/sorder/sorder_list.html",
|
id: flows.businessId,//
|
canApprove: flows.canApprove,
|
flow_id: flows.id,
|
act_type: flows.businessType,
|
scenetype: scenetype_
|
};
|
me.doSuccess();
|
//me.openPage(type, row);
|
}
|
})
|
.catch( (error) => {
|
console.log(error.message);
|
me.onCloseWinPage("error", "解析错误");
|
});
|
},
|
|
doSuccess() {
|
var me = this;
|
var url = "root/api/loginByEmployeeCode";
|
var param = {
|
isClientMode: false,
|
code: this.empcode//"SYS9999"
|
}
|
|
Server.call(url, param, function(result) {
|
let userinfo_ = result.data;
|
var url_user = "root/client/getUser";
|
var param_user = {
|
id: userinfo_.data.id,
|
type: "Ding",
|
isClientMode: false
|
}
|
Server.call(url_user, param_user, function(result) {
|
let userinfo1_ = result.data;
|
|
userinfo = window.top.userinfo = userinfo1_;
|
me.user = userinfo.user;
|
me.showUserInfo(userinfo1_);
|
});
|
|
});
|
},
|
|
showUserInfo(userinfo) {
|
let me = this;
|
if (!userinfo) {
|
return;
|
}
|
var userObj = userinfo.user;
|
var employeeObj = userinfo.employee;
|
var orgObj = userinfo.org;
|
//公司
|
$("#lbl_org").html(orgObj.name);
|
//部门
|
var hierarchyNodes_ = "";
|
if(employeeObj.hierarchyNodes && employeeObj.hierarchyNodes.length) {
|
employeeObj.hierarchyNodes.map(e=>{
|
hierarchyNodes_ += e.name + " ";
|
});
|
}
|
$("#lbl_department").html(hierarchyNodes_);
|
//岗位
|
$("#lbl_position").html(hierarchyNodes_);
|
//角色
|
var lbl_role_ = "";
|
if(userObj.roleList && userObj.roleList.length) {
|
userObj.roleList.map(e=>{
|
lbl_role_ += e.name + " ";
|
});
|
}
|
$("#lbl_role").html(lbl_role_);
|
|
$("#lbl_employeeName").html(employeeObj ? employeeObj.name : userObj.name);
|
$("#lbl_user").html(employeeObj ? employeeObj.name : userObj.name);
|
$("#lbl_user").attr("title", employeeObj ? employeeObj.name : userObj.name);
|
|
/* 公司 */
|
localStorage.setItem("orgcode", orgObj.code);
|
localStorage.setItem("orgname", orgObj.name);
|
|
/* 人员 */
|
localStorage.setItem("emp_id", employeeObj.id);
|
localStorage.setItem("emp_name", employeeObj.name);
|
localStorage.setItem("emp_code", employeeObj.code);
|
|
/* 用户 */
|
localStorage.setItem("id", userObj.id);
|
localStorage.setItem("username", userObj.name);
|
localStorage.setItem("password", userObj.password);
|
if (userObj.actPassword) {
|
localStorage.setItem("actpassword", userObj.actPassword);
|
}
|
if(userObj.roleList.length) {
|
localStorage.setItem("roleList", JSON.stringify(userObj.roleList));
|
var rolecode_ = "";
|
var rolename_ = "";
|
var roleid_ = "";
|
userObj.roleList.map(e=>{
|
if (roleid_ == "") {
|
roleid_ = e.id;
|
// rolecode_ = e.code;
|
// rolename_ = e.name;
|
}
|
else {
|
roleid_ += ";" + e.id;
|
// rolecode_ += ";" + e.code;
|
// rolename_ += ";" + e.name;
|
}
|
});
|
// localStorage.setItem("rolecode", rolecode_);
|
// localStorage.setItem("rolename", rolename_);
|
me.getRole(roleid_);
|
|
}
|
else {
|
me.onCloseWinPage("erroe", "无角色信息");
|
}
|
},
|
|
closeWin() {
|
ClosePage();
|
},
|
|
onCloseWinPage(type, code) {
|
var me = this;
|
if (code) {
|
this.erroe_code = "错误信息:" + code;
|
}
|
if (type == "erroe") {
|
me.show_erroe = true;
|
}
|
else {
|
me.show_countdown = true;
|
}
|
// this.doCloseWinPage();
|
},
|
doCloseWinPage() {
|
var me = this;
|
setTimeout(function(){
|
if (me.close_s == 0) {
|
ClosePage();
|
}
|
else {
|
me.close_s--;
|
me.doCloseWinPage();
|
}
|
},1000);
|
},
|
|
getRole(roleid_) {
|
var me = this;
|
var roleid = roleid_.replace(/;/g,"','");
|
var params = {
|
dataname: "sysRole",
|
isClientMode: false,
|
filter: " id in ('"+ roleid +"')"
|
}
|
|
Server.call("root/data/getEntitySet", params, function(result) {
|
console.log(result);
|
if (result && result.data.entityset) {
|
|
var roleid_ = "";
|
var rolecode_ = "";
|
|
var rolename_ = "";
|
result.data.entityset.map(e=>{
|
if (rolecode_ == "") {
|
roleid_ = e.id;
|
rolecode_ = e.code;
|
rolename_ = e.name;
|
}
|
else {
|
roleid_ += ";" + e.id;
|
rolecode_ += ";" + e.code;
|
rolename_ += ";" + e.name;
|
}
|
});
|
localStorage.setItem("roleid", roleid_);
|
localStorage.setItem("rolecode", rolecode_);
|
localStorage.setItem("rolename", rolename_);
|
}
|
|
me.topageByPath();
|
|
Root.init_vue();
|
});
|
},
|
|
topageByPath() {
|
var me = this;
|
tab = new Tab({
|
element: "content"
|
});
|
|
Root = new RootClass({
|
"tab": tab
|
})
|
|
//this.pathurl = this.config.path;
|
var filter_ = " 1<>1";
|
var sceneCode_ = "approval";
|
var dataname_ = "";
|
var paramObjBydefault = {};
|
if (this.config.act_type == "accountCustomer") {//商业变更审批
|
sceneCode_ = "versionapproval";
|
filter_ = "customer.id='" + this.config.id + "'";
|
dataname_ = "approveCustomer";
|
|
paramObjBydefault = {
|
empCode: localStorage.getItem("emp_code")//"040679"//localStorage.getItem("emp_code")
|
}
|
}
|
else if (this.config.act_type == "accountCustomerDelivery") {//发货主体审批
|
sceneCode_ = "approval";
|
filter_ = "cdm.id='" + this.config.id + "'";
|
dataname_ = "customerDeliveryApprove";
|
}
|
|
else if (this.config.act_type == "deliveryFreeze") {//发货主体冻/结激活审批
|
sceneCode_ = "approval";
|
filter_ = "cdm.id='" + this.config.id + "'";
|
dataname_ = "customerDeliveryApprove";
|
}
|
else if (this.config.act_type == "accountCustomerCertification") {//资质审批
|
sceneCode_ = "approval";
|
filter_ = "customer_delivery_certification_mapping.id='" + this.config.id + "'";
|
dataname_ = "getCertificationApproveList";
|
}
|
else if (this.config.act_type == "poxyCertification") {//资质审批
|
sceneCode_ = "approval";
|
filter_ = "customer_delivery_certification_mapping.id='" + this.config.id + "'";
|
dataname_ = "getCertificationApproveList";
|
}
|
|
else if (this.config.act_type == "sales") {//销售订单
|
sceneCode_ = "approval";
|
filter_ = "id='" + this.config.id + "'";
|
dataname_ = "salesOrder";
|
}
|
else if (this.config.act_type == "proxy_sales") {//商业订单
|
sceneCode_ = "approval";
|
filter_ = "id='" + this.config.id + "'";
|
dataname_ = "salesOrder";
|
}
|
else if (this.config.act_type == "revocation") {//退货单
|
sceneCode_ = "approval";
|
filter_ = "id='" + this.config.id + "'";
|
dataname_ = "revocationOrder";
|
}
|
else if (this.config.act_type == "agreement") {//政策备案
|
sceneCode_ = "approval";
|
filter_ = "agreement_line.id='" + this.config.id + "'";
|
dataname_ = "agreementLine";
|
}
|
else if (this.config.act_type == "puresale_plan") {//纯销计划审批
|
sceneCode_ = "approval";
|
filter_ = "plan_puresale.id='" + this.config.id + "'";
|
dataname_ = "puresalePlan";
|
}
|
else if (this.config.act_type == "product_plan") {//生产计划审批
|
sceneCode_ = "approval";
|
filter_ = "id='" + this.config.id + "'";
|
dataname_ = "producePlan";
|
}
|
else if (this.config.act_type == "product_summary") {//产品变更
|
sceneCode_ = "approval";
|
filter_ = "md_product.id='" + this.config.id + "'";
|
dataname_ = "demandproduct";
|
}
|
|
if(!this.config.canApprove) {
|
sceneCode_ = "browse"
|
}
|
|
let param_ = {
|
isClientMode: false,
|
dataname: dataname_,
|
filter: filter_,
|
}
|
|
if (paramObjBydefault != {}) {
|
for(var k in paramObjBydefault) {
|
let k_val = paramObjBydefault[k];
|
param_[k] = k_val;
|
}
|
}
|
|
Server.call("root/data/getEntitySet", param_, function(result) {
|
console.log(result);
|
if (result && result.data && result.data.entityset && result.data.entityset.length>0) {
|
var data_ = result.data.entityset[0];
|
|
me.doPopupConfig(data_, sceneCode_);
|
}
|
else {
|
// me.onCloseWinPage("", "无审批数据");
|
}
|
})
|
|
|
},
|
|
doPopupConfig(row, sceneCode){
|
var config = {
|
totab: true,
|
icon: "icon-product",
|
text: "审批",
|
id: row.id,
|
url: this.config.path,//"../md/customer/customer_licence.html",
|
sceneCode: sceneCode,
|
data: row,
|
delta: {},
|
closecallback: function() {
|
ClosePage();
|
},
|
callback: function(obj, callback) {
|
ClosePage();
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
|
this.doPopupToPage(config);
|
},
|
|
doPopupToPage(config) {
|
if (config.url) {
|
config.title = config.text;
|
if (config.text.length > 4) {
|
config.text = config.text.substr(0, 4) + "...";
|
}
|
|
config.url = toClientURL(config.url);
|
|
if (config.url.indexOf("?") != -1) {
|
config.url += "&fromDing=true"
|
} else {
|
config.url += "?fromDing=true"
|
}
|
}
|
config.minwidth = "1000px";
|
var callback_ = config.callback;
|
var parames = {
|
totab: true,
|
minwidth: config.minwidth,
|
url: config.url,
|
title: config.title,
|
sceneCode: config.sceneCode,
|
data: config.data,
|
delta: config.delta,
|
disabled: config.disabled,
|
disabledone: config.disabledone,
|
operationtype: config.operationtype,
|
parentOption: {},
|
callback: function(obj, callback) {
|
if (callback_) {
|
callback_(obj);
|
}
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
Root.popupParames = parames;
|
|
tab.open(config);
|
},
|
|
getGetParams(url) {
|
// var url = window.location.href;
|
var empCode = url.split('?')[1]
|
var flowid = url.split('?')[2]
|
if (!empCode) {
|
return {}
|
}
|
|
var search = []
|
search.push(JSON.parse(
|
'{"' +
|
decodeURIComponent(empCode)
|
.replace(/"/g, '\\"')
|
.replace(/&/g, '","')
|
.replace(/=/g, '":"') +
|
'"}'
|
))
|
search.push(JSON.parse(
|
'{"' +
|
decodeURIComponent(flowid)
|
.replace(/"/g, '\\"')
|
.replace(/&/g, '","')
|
.replace(/=/g, '":"') +
|
'"}'
|
))
|
return search;
|
},
|
browserRedirect() {
|
var sUserAgent = navigator.userAgent.toLowerCase();
|
var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
|
var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
|
var bIsMidp = sUserAgent.match(/midp/i) == "midp";
|
var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
|
var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
|
var bIsAndroid = sUserAgent.match(/android/i) == "android";
|
var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
|
var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
|
if (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM){
|
this.phone = true;
|
}else {
|
this.phone = false;
|
}
|
},
|
|
|
}
|
});
|
|
</script>
|
|
<style>
|
.closeTab {
|
display: none !important;
|
}
|
.header {
|
position: absolute;
|
top: 0px;
|
right: 0px;
|
left: 0px;
|
height: 52px;
|
min-height: 40px;
|
z-index: 610;
|
background-color: #3c8dbc;
|
transition: 0.3s;
|
}
|
|
.content {
|
position: absolute;
|
left: 0px;
|
right: 0px;
|
bottom: 0px;
|
top: 51px;
|
z-index: 10;
|
background-color: #fff;
|
transition: 0.3s;
|
}
|
|
.el-collapse-item__header {
|
background-color: #4f5b61;
|
color: #FFF;
|
border-bottom: 1px solid #fff;
|
}
|
.el-collapse-item__wrap {
|
background-color: #5c6a71;
|
color: #FFF;
|
border-bottom: 1px solid #fff;
|
}
|
.el-collapse-item__content {
|
color: #FFF;
|
padding-bottom: 15px;
|
}
|
.el-collapse {
|
border-top: 0px solid #fff;
|
}
|
.el-badge__content.is-fixed {
|
left: -20px;
|
right: auto;
|
}
|
.itembadge {
|
width: 100%;
|
}
|
.z_remind:hover {
|
cursor: pointer;
|
color: #e7e7e7;
|
}
|
|
|
.z_countdown {
|
position: absolute;
|
top: 100px;
|
width: 100%;
|
height: 100px;
|
line-height: 100px;
|
z-index: 100;
|
}
|
|
.z_countdown div{
|
width: 500px;
|
margin: auto;
|
border: 1px solid #ccc;
|
text-align: center;
|
color: #0000FF;
|
}
|
.z_countdown span:hover{
|
cursor: pointer;
|
}
|
</style>
|
</body>
|
</html>
|