Commit 610349f0 authored by 徐一鸣's avatar 徐一鸣

Merge branch 'dev' of cloud.wodcloud.com:apaas/apaas-v3-ui into dev

parents e7794227 de4af155
<template>
<!--
this page will be destoryed after userRoles is available
-->
<div class="menu">
<img src="../assets/imgs/home_img_logo.png" alt class="logo" />
<div style="float:right;cursor: pointer;position:relative;" class="user_hover">
<span
v-if="userInfo.user_name && userInfo.user_name !=''"
class="user"
>{{ userInfo.user_name }}</span>
<span v-else @click="gotopage('login')" class="user">请登录</span>
<img
:class="userInfo.picture_path ? 'user_pic': 'user_default'"
:src="
userInfo.picture_path || require('../assets/imgs/home_ic_user.png')
"
/>
<div v-if="userInfo.user_name && userInfo.user_name !=''" class="user_menu">
<div
v-for="(item, index) in user_arr"
:key="index + 700"
@click="gotopage(item.path)"
>{{ item.name }}</div>
</div>
<div v-if="userInfo.user_name && userInfo.user_name !=''" class="sj"></div>
</div>
<div
style="float:right;cursor: pointer;position:relative;"
class="shop_hover"
@click="gotopage('/shop/shopping_cart')"
>
<div class="car">
<el-badge v-if="menuCartNum != 0" :value="menuCartNum" :max="99" class="number"></el-badge>
<img src="../assets/imgs/home_ic_shop.png" alt class="car_img" />
</div>
<div v-if="userInfo.user_name && userInfo.user_name !=''" class="shop_menu">
<div class="shop_list_title">最近加入的服务:</div>
<div
v-for="(item, index) in shopping_list"
:key="'shopping' + index"
class="shop_list_cell shop_line"
>
<img :src="item.service.cover" class="shop_img" />
<div class="shop_cell_msgs">
<p @click="getDetail(item.id)" class="shop_cell_name over_one">
{{
item.service_id == 0
? item.application.app_name
: item.service.name
}}
</p>
<p class="shop_cell_msg bover_one">
{{
item.service_id == 0
? item.application.ywly
: item.service.sectors_name
}}
</p>
<p class="shop_cell_msg over_one">
{{
item.service_id == 0
? item.application.org
: item.service.organization_name
}}
</p>
</div>
<div>
<img @click.stop="deleteItem(item.id)" src="../assets/imgs/ic_delete.png" alt />
</div>
</div>
<div class="shop_footer">
<el-button @click="settlement" size="small" class="shop_settlement">去购物车申请结算</el-button>
</div>
</div>
<div v-if="userInfo.user_name && userInfo.user_name !=''" class="shop_sj"></div>
</div>
<div style="float:right">
<div
v-for="(item, index) in menu_arr"
:key="index + 200"
class="menu_box user_hover"
@click="navAction(index, item.visit_url)"
:style="{ color: now_menu == index ? '#fff' : '' }"
>
{{ item.menu_name }}
<div class="user_menu" v-if="item.Child && item.Child.length" style="left: 30px;">
<div
v-for="(v, indexs) in item.Child"
:key="indexs + 700"
@click.stop="gotoChildPage(v, index)"
>{{ v.menu_name }}</div>
</div>
<div class="sj" v-if="item.Child && item.Child.length" style="left: 60px;"></div>
<div class="bottom_show" v-if="now_menu == index"></div>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
menu_arr: [
// {
// name: "工作台",
// path: "/workplace",
// children: [
// {
// name: "服务注册",
// path: "/fwzc/fwcs"
// },
// {
// name: "服务管理",
// path: "/fwgl/"
// },
// {
// name: "应用管理",
// path: "/yygl/"
// }
// ]
// },
// {
// name: "技术支持",
// path: "/xxx"
// },
// {
// name: "服务超市",
// path: "/services_shop",
// children: [
// {
// name: "数据服务",
// path: "/shop/data_service_list/5"
// },
// {
// name: "时空服务",
// path: "/shop/space_time_service_list/6"
// },
// {
// name: "视频服务",
// path: "/shop/video_service_list/7"
// },
// {
// name: "感知服务",
// path: "/shop/perception_service_list/10"
// },
// {
// name: "综合应用",
// path: "/shop/comprehensive_app_list/11"
// },
// {
// name: "云资源服务",
// path: "/shop/cloud"
// },
// {
// name: "应用商店",
// path: "/shop/app_store_list/12"
// }
// ]
// }
],
now_menu: 2,
user_arr: [
{ name: "个人档案", path: "/user/user_info" },
{ name: "消息通知", path: "/user/message" },
{ name: "收银中心", path: "" },
{ name: "关于BD-aPaaS", path: "" },
{ name: "退出登录", path: "logout" }
],
shopping_list: [],
menuCartNum: 0
};
},
mounted() {
this.getNowMenu();
this.getList();
},
computed: {
getMenuCartState() {
return this.$store.state.menuCartState;
},
userInfo() {
return this.$store.state.userInfo || {};
}
},
watch: {
getMenuCartState(newVal) {
this.getList();
}
},
methods: {
gotopage(n) {
if (n == "logout") {
window.location.href = "/iam/api/logout";
} else if (n == "login") {
let path = this.$route.path;
window.location.href = "/iam/login/#/login?ReturnUrl=" + path;
} else {
this.$router.push(n);
}
},
settlement() {
this.$router.push({ name: "shoppingCart" });
},
deleteItem(id) {
let query = [id];
this.$api.serviceShop.delShoppingCart(query).then(response => {
this.getList();
});
},
getDetail() {
// if you want goto detail page, you should give me the type at first
// at here, we will goto shopping cart
this.$router.push({ name: "shoppingCart" });
},
navAction(index, path) {
this.$router.push(path);
this.now_menu = index;
window.sessionStorage.setItem("menuIndex", index);
},
gotoChildPage(v, parent) {
if (v.visit_url) {
if (v.visit_url == "/fwgl/" || v.visit_url == "/yygl/") {
this.$router.push(v.visit_url + this.$store.getters.level);
} else if (parent == 2) {
this.$router.push(v.visit_url);
this.$store.commit("serviceShopMenuAct", v.visit_url);
} else {
this.$router.push(v.visit_url);
}
this.now_menu = parent;
window.sessionStorage.setItem("menuIndex", parent);
}
},
getList() {
this.$api.serviceShop.getShoppingCart().then(response => {
if (response.data.success == "1") {
this.menuCartNum = response.data.data.valid
? response.data.data.valid.length
: 0;
this.shopping_list = response.data.data.valid
? response.data.data.valid.slice(0, 3)
: [];
} else {
console.log(response.data.message);
}
});
},
getMenuIndex() {
let index = window.sessionStorage.getItem("menuIndex");
console.log(index);
this.now_menu = index ? index : 2;
},
getNowMenu() {
this.$api.general.getNowMenu({ teamName: "APAAS3" }).then(response => {
if (response.data.success == 1) {
this.menu_arr = response.data.data[0].Child;
this.getMenuIndex();
}
});
}
}
};
</script>
<style scoped>
.menu {
width: 100%;
height: 84px;
background-color: #0f2683;
color: #8390ee;
line-height: 84px;
}
.logo {
float: left;
margin: 30px 0 0 40px;
}
.user {
float: right;
display: inline-block;
width: 140px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin-right: 20px;
font-size: 16px;
}
.user_pic {
float: right;
margin-right: 10px;
margin-top: 26px;
width: 30px;
height: 30px;
}
.user_default {
float: right;
margin-right: 10px;
margin-top: 30px;
}
.car {
float: right;
width: 50px;
text-align: center;
position: relative;
}
.number {
position: absolute;
background-color: #e56600;
border-radius: 11px;
color: #fcefd6;
line-height: 18px;
height: 20px;
text-align: center;
left: 38px;
top: 26px;
z-index: 2;
}
.car_img {
position: relative;
top: 7px;
}
.menu_box {
float: right;
width: 185px;
text-align: center;
cursor: pointer;
position: relative;
}
.menu_box:nth-of-type(1) {
margin-right: 52px;
}
.bottom_show {
width: 24px;
height: 5px;
background-color: #e56600;
border-radius: 3px;
position: absolute;
bottom: 0px;
left: calc(50% - 12px);
}
.user_menu {
width: 135px;
background-color: #ffffff;
box-shadow: 0px 3px 6px 0px #f4f7fc;
border-radius: 8px;
position: absolute;
top: 80px;
left: -20px;
overflow: hidden;
display: none;
z-index: 1;
}
.shop_menu {
width: 280px;
background-color: #ffffff;
box-shadow: 0px 3px 6px 0px #f4f7fc;
border-radius: 8px;
position: absolute;
top: 80px;
left: -20px;
overflow: hidden;
display: none;
z-index: 1;
padding: 10px 20px;
}
.user_hover:hover .user_menu {
display: block;
}
.user_hover:hover .sj {
display: block;
}
.shop_hover {
height: 100%;
margin-right: 50px;
}
.shop_hover:hover .shop_menu {
display: block;
}
.shop_hover:hover .shop_sj {
display: block;
}
.user_menu div {
width: 135px;
height: 44px;
line-height: 44px;
text-align: center;
color: #0d1847;
}
.user_menu div:hover {
background-color: #e56600;
color: #fff;
}
.sj {
width: 16px;
height: 16px;
background-color: #e56600;
position: absolute;
top: 72px;
transform: rotate(45deg);
display: none;
}
.shop_sj {
width: 16px;
height: 16px;
background-color: #fff;
position: absolute;
top: 72px;
left: 20px;
transform: rotate(45deg);
display: none;
}
.shop_list_title {
color: #8890a7;
font-size: 14px;
height: 30px;
line-height: 30px;
}
.shop_list_cell {
height: 80px;
padding: 10px 0;
display: flex;
line-height: 26px;
}
.shop_line {
border-bottom: #f4f7fc 2px solid;
}
.shop_line:nth-last-child(2) {
border-bottom: 0;
}
.shop_img {
width: 60px;
height: 60px;
border-radius: 8px;
}
.shop_footer {
width: 100%;
height: 50px;
text-align: right;
padding: 15px 0;
line-height: 30px;
}
.shop_settlement {
background-color: #e56600;
color: #fcefd6;
}
.shop_cell_msgs {
width: calc(100% - 80px);
margin-left: 10px;
}
.shop_cell_name {
color: #2d3867;
font-size: 14px;
line-height: 24px;
}
.shop_cell_name:hover {
color: #0d0807;
}
.shop_cell_msg {
color: #8890a7;
font-size: 12px;
line-height: 18px;
}
.over_one {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
</style>
<style>
.number .el-badge__content {
background-color: #e56600;
border: 0;
line-height: 18px;
padding: 0 7px;
}
</style>
\ No newline at end of file
...@@ -227,6 +227,7 @@ export default { ...@@ -227,6 +227,7 @@ export default {
.system { .system {
padding: 0 30px; padding: 0 30px;
position: relative; position: relative;
margin-bottom: 10px;
} }
.system .el-select { .system .el-select {
position: absolute; position: absolute;
......
...@@ -137,19 +137,19 @@ export default { ...@@ -137,19 +137,19 @@ export default {
if(response.data.success&&data){ if(response.data.success&&data){
//应用 //应用
this.post_arr = [data] this.post_arr = [data]
this.post_arr[0].app_id = parseInt(pp_data.app_id) this.post_arr[0].app_id = parseInt(app_data.app_id)
this.post_arr[0].spec_id = parseInt(pp_data.spec_id) this.post_arr[0].spec_id = parseInt(app_data.spec_id)
this.post_arr[0].duration_method = parseInt(pp_data.duration_unit) this.post_arr[0].duration_method = parseInt(app_data.duration_unit)
this.post_arr[0].duration = parseInt(pp_data.duration) this.post_arr[0].duration = parseInt(app_data.duration)
this.post_arr[0].id = '' this.post_arr[0].id = ''
this.service_arr.push({}) this.service_arr.push({})
this.service_arr[0]['img'] = data.logo this.service_arr[0]['img'] = data.logo
this.service_arr[0]['title'] = data.app_name this.service_arr[0]['title'] = data.app_name
this.service_arr[0]['type'] = data.type_name this.service_arr[0]['type'] = data.type_name
this.service_arr[0]['auth'] = data.org_name this.service_arr[0]['auth'] = data.org_name
this.service_arr[0]['size'] = pp_data.spec_id==0?'部署':'开发' this.service_arr[0]['size'] = '规格:'+(app_data.spec_id==0?'部署':'开发')
this.service_arr[0]['applytype'] = '申请方式:'+pp_data.duration_unit==1?'':'' this.service_arr[0]['applytype'] = '申请方式:'+(app_data.duration_unit==1?'':'')
this.service_arr[0]['num'] = pp_data.duration this.service_arr[0]['num'] = app_data.duration
this.service_arr[0]['isMg'] = false this.service_arr[0]['isMg'] = false
this.service_arr[0]['isapp'] = true this.service_arr[0]['isapp'] = true
} }
...@@ -212,8 +212,6 @@ export default { ...@@ -212,8 +212,6 @@ export default {
}); });
}, },
sub_service(){ sub_service(){
console.log(this.$refs.apply_service.$refs.apply_service_state);
console.log(this.$refs.apply_service.$refs.apply_service_state[0].$refs.apply_service_state_table.metaData);
let formInline = this.$refs.apply_info.formInline let formInline = this.$refs.apply_info.formInline
if(formInline.preson&&formInline.phone){ if(formInline.preson&&formInline.phone){
var phone_ruler=/^(?:(?:\+|00)86)?1[3-9]\d{9}$/ var phone_ruler=/^(?:(?:\+|00)86)?1[3-9]\d{9}$/
...@@ -230,6 +228,7 @@ export default { ...@@ -230,6 +228,7 @@ export default {
} }
var temp1 = this.$refs.apply_service.$refs.apply_service_state var temp1 = this.$refs.apply_service.$refs.apply_service_state
this.post_arr.forEach((e,idx) => { this.post_arr.forEach((e,idx) => {
debugger
if(e.service_id){ if(e.service_id){
temp.carts.push( temp.carts.push(
{ {
...@@ -270,13 +269,17 @@ export default { ...@@ -270,13 +269,17 @@ export default {
return return
} }
for (let index = 0; index < temp.carts.length; index++) {
const e = temp.carts[index]; for (let index = 0; index < temp.carts.length; index++) {
if(e.apply_fields[0].selected == 0){ const e = temp.carts[index];
this.$message.error('请选择所需参数') if(e.service_id){
return if(e.apply_fields[0].selected == 0){
this.$message.error('请选择所需参数')
return
}
}
} }
}
this.$http this.$http
.post(`/apaas/serviceapp/v3/shopcart/apply`,temp) .post(`/apaas/serviceapp/v3/shopcart/apply`,temp)
.then(response => { .then(response => {
...@@ -285,7 +288,7 @@ export default { ...@@ -285,7 +288,7 @@ export default {
this.$message.success('申请成功') this.$message.success('申请成功')
this.$router.replace('/shop/service_application_successfully') this.$router.replace('/shop/service_application_successfully')
}else{ }else{
this.$message.error('申请失败') this.$message.error(response.data.errMsg)
} }
}).catch(()=>{ }).catch(()=>{
this.$message.error('申请失败') this.$message.error('申请失败')
...@@ -312,8 +315,8 @@ export default { ...@@ -312,8 +315,8 @@ export default {
this.service_arr[l]['title'] = e.application.app_name this.service_arr[l]['title'] = e.application.app_name
this.service_arr[l]['type'] = e.application.type_name this.service_arr[l]['type'] = e.application.type_name
this.service_arr[l]['auth'] = e.application.org_name this.service_arr[l]['auth'] = e.application.org_name
this.service_arr[l]['size'] = e.spec_id==0?'部署':'开发' this.service_arr[l]['size'] = '规格:'+(e.spec_id==0?'部署':'开发')
this.service_arr[l]['applytype'] = '申请方式:'+e.duration_unit==1?'':'' this.service_arr[l]['applytype'] = '申请方式:'+(e.duration_unit==1?'':'')
this.service_arr[l]['num'] = e.duration this.service_arr[l]['num'] = e.duration
this.service_arr[l]['isMg'] = false this.service_arr[l]['isMg'] = false
this.service_arr[l]['isapp'] = true this.service_arr[l]['isapp'] = true
......
...@@ -58,12 +58,13 @@ ...@@ -58,12 +58,13 @@
<el-input v-model="user_data.userTypeName" :disabled="true"></el-input> <el-input v-model="user_data.userTypeName" :disabled="true"></el-input>
<el-button <el-button
v-if="(user_data.userType == 3 || user_data.userType == 4) && couldUp" v-if="(user_data.userType == 3 || user_data.userType == 4) && couldUp"
:class="option_btn" class="option_btn"
@click="upLevel" @click="upLevel"
>升级为开发者</el-button> >升级为开发者</el-button>
<el-button <el-button
v-else-if="(user_data.userType == 3 || user_data.userType == 4) && !couldUp" v-else-if="(user_data.userType == 3 || user_data.userType == 4) && !couldUp"
type="info" type="info"
class="option_btn_gray_dis"
disabled disabled
>升级为开发者</el-button> >升级为开发者</el-button>
</el-form-item> </el-form-item>
...@@ -184,6 +185,7 @@ export default { ...@@ -184,6 +185,7 @@ export default {
}, },
data: () => ({ data: () => ({
activeName: "0", activeName: "0",
userId: "",
is_admin: 0, is_admin: 0,
user_data: { user_data: {
accountNo: "", accountNo: "",
...@@ -227,14 +229,15 @@ export default { ...@@ -227,14 +229,15 @@ export default {
this.$api.user.getNowUser().then(response => { this.$api.user.getNowUser().then(response => {
if (response.data.success == 1) { if (response.data.success == 1) {
this.is_admin = response.data.data.is_admin; this.is_admin = response.data.data.is_admin;
this.getUserInfo(response.data.data.user_id); this.userId = response.data.data.user_id;
this.getUserInfo();
} else { } else {
console.log(response.data.errMsg); console.log(response.data.errMsg);
} }
}); });
}, },
getUserInfo(id) { getUserInfo(id) {
this.$api.user.getUserDetail({ id: id }).then(response => { this.$api.user.getUserDetail({ id: this.userId }).then(response => {
if (response.data.success == 1) { if (response.data.success == 1) {
let data = response.data.data; let data = response.data.data;
this.user_data.accountNo = data.user_id; this.user_data.accountNo = data.user_id;
...@@ -298,6 +301,7 @@ export default { ...@@ -298,6 +301,7 @@ export default {
message: "修改个人信息成功", message: "修改个人信息成功",
type: "success" type: "success"
}); });
this.getUserInfo();
} else { } else {
this.$message({ this.$message({
message: "修改个人信息失败", message: "修改个人信息失败",
...@@ -333,6 +337,7 @@ export default { ...@@ -333,6 +337,7 @@ export default {
type: "success" type: "success"
}); });
this.diaPassWord = false; this.diaPassWord = false;
this.getUserInfo();
} else { } else {
this.$message({ this.$message({
message: "修改密码失败", message: "修改密码失败",
...@@ -342,20 +347,36 @@ export default { ...@@ -342,20 +347,36 @@ export default {
}); });
}, },
resetKey() { resetKey() {
this.$api.authority this.$confirm("此操作将重置您的密钥, 是否继续?", "提示", {
.resetUserKey({ user_id: this.user_data.accountNo }) confirmButtonText: "确定",
.then(response => { cancelButtonText: "取消",
if (response.data.success == 1) { cancelButtonClass: "msg_btn_gray",
this.$message({ confirmButtonClass: "msg_btn",
message: "重置密钥成功", type: "warning"
type: "success" })
.then(() => {
this.$api.authority
.resetUserKey({ user_id: this.user_data.accountNo })
.then(response => {
if (response.data.success == 1) {
this.$message({
message: "重置密钥成功",
type: "success"
});
this.getUserInfo();
} else {
this.$message({
message: "重置密钥失败",
type: "error"
});
}
}); });
} else { })
this.$message({ .catch(() => {
message: "重置密钥失败", this.$message({
type: "error" type: "info",
}); message: "已取消重置"
} });
}); });
}, },
upLevel() { upLevel() {
...@@ -366,6 +387,7 @@ export default { ...@@ -366,6 +387,7 @@ export default {
type: "success" type: "success"
}); });
this.couldUp = false; this.couldUp = false;
this.getUserInfo();
} else { } else {
this.$message({ this.$message({
message: "申请升级开发者失败", message: "申请升级开发者失败",
...@@ -458,9 +480,7 @@ export default { ...@@ -458,9 +480,7 @@ export default {
} }
.option_btn_gray_dis { .option_btn_gray_dis {
width: 124px; width: 124px;
background-color: #e3e5ef;
border-radius: 8px; border-radius: 8px;
color: #0f2683;
} }
.info_item { .info_item {
width: 70%; width: 70%;
...@@ -586,4 +606,23 @@ export default { ...@@ -586,4 +606,23 @@ export default {
line-height: 24px; line-height: 24px;
height: 24px; height: 24px;
} }
.msg_btn {
width: 70px;
background-color: #495feb;
border-radius: 8px;
color: #f8f9fd;
}
.msg_btn:hover {
background-color: #596ffb;
}
.msg_btn_gray {
width: 70px;
background-color: #e3e5ef;
border-radius: 8px;
color: #0f2683;
}
.msg_btn_gray:hover {
background-color: #e8eaf4;
color: #0f2683;
}
</style> </style>
\ No newline at end of file
...@@ -316,6 +316,7 @@ import helper from "@/services/helper.js"; ...@@ -316,6 +316,7 @@ import helper from "@/services/helper.js";
import dashBoard from '../../components/e-charts/dashboard' import dashBoard from '../../components/e-charts/dashboard'
import { formatDateTime_date } from "@/utils/common"; import { formatDateTime_date } from "@/utils/common";
import { mapGetters,mapState } from 'vuex' import { mapGetters,mapState } from 'vuex'
import {getCookie} from '../../services/cookie'
var echarts = require("echarts"); var echarts = require("echarts");
export default { export default {
data() { data() {
...@@ -1162,7 +1163,7 @@ export default { ...@@ -1162,7 +1163,7 @@ export default {
}, },
getUserData() { getUserData() {
this.person = this.userInfo.user_name; this.person = this.userInfo.user_name;
this.login_time = this.userInfo.last_login; this.login_time = decodeURIComponent(getCookie('lastLogin'));
}, },
getoperatingdata() { getoperatingdata() {
this.$http this.$http
......
...@@ -24,8 +24,7 @@ ...@@ -24,8 +24,7 @@
<div class="type_box_select"> <div class="type_box_select">
<mavon-editor v-model="list_arr" :boxShadow="false" :toolbarsFlag="false" :subfield="false" defaultOpen="preview" :editable="false" v-if="now_service == 0"/> <mavon-editor v-model="list_arr" :boxShadow="false" :toolbarsFlag="false" :subfield="false" defaultOpen="preview" :editable="false" v-if="now_service == 0"/>
<info-list <info-list
v-if=" now_service == 1" v-if=" now_service !== 0"
@download="download"
:list_arr="servicead_arr :list_arr="servicead_arr
" "
> >
...@@ -171,12 +170,7 @@ export default { ...@@ -171,12 +170,7 @@ export default {
], ],
}, },
], ],
approval_arr3:[ approval_arr3:[],
{
title: "一级审批",
result: "审批中",
},
],
service_arr: ["基本信息", "申请审批信息"], service_arr: ["基本信息", "申请审批信息"],
service_header_arr: { service_header_arr: {
id:"", id:"",
...@@ -280,7 +274,7 @@ export default { ...@@ -280,7 +274,7 @@ export default {
created() { created() {
this.getServiceInfo(); this.getServiceInfo();
this.getreadme(); this.getreadme();
// this.getServiceBaseInfo(); this.getServiceBaseInfo();
this.getServiceapplyInfo(); this.getServiceapplyInfo();
}, },
mounted() {}, mounted() {},
...@@ -294,36 +288,57 @@ export default { ...@@ -294,36 +288,57 @@ export default {
}) })
.catch(function(response) {}); .catch(function(response) {});
}, },
download(val){
console.log(val);
},
getServiceapplyInfo() { getServiceapplyInfo() {
this.$http this.$http
.get("./static/applyappdetail.json") .get(`/apaas/hubApi/market/approvalInfo/${this.$route.params.id}`)
.then((response) => {
let data = response.data.data;
if(!(data&&data.length)){
this.approval_arr3.push({
title: "一级审批",
result: "待审批"
})
return
}
data.forEach(e => {
this.approval_arr3.push({
title: e.level==1?"一级审批":'二级审批',
result: e.apply_type_name,
arr: [
{
title: "审批时间:",
info: e.created,
},
{
title: "审批单位:",
info: e.department_name,
},
{
title: "审批人:",
info: e.user_name,
},
{
title: "审批意见:",
info: e.comments,
}
]
})
});
})
.catch(function(response) {});
},
getServiceBaseInfo() {
this.$http
.get("/apaas/hubApi/market/applyDetailInfo/"+this.$route.params.id)
.then((response) => { .then((response) => {
let data = response.data.data; let data = response.data.data;
this.$set(this.servicead_arr[1], "info", data.appapplyinfo.scene); this.$set(this.servicead_arr[1], "info", data.scene);
this.$set(this.servicead_arr[2], "info", data.appapplyinfo.filename); this.$set(this.servicead_arr[2], "info", data.apply_file);
this.$set(this.servicead_arr[2], "url", data.appapplyinfo.fileurl); this.$set(this.servicead_arr[2], "url", data.apply_file);
this.$set(this.servicead_arr[3], "info", data.appapplyinfo.size); this.$set(this.servicead_arr[3], "info", data.apply_type_name);
}) })
.catch(function(response) {}); .catch(function(response) {});
}, },
// getServiceBaseInfo() {
// this.$http
// .get("/apaas/hubApi/market/applyDetailInfo/"+this.$route.params.id)
// .then((response) => {
// let data = response.data.data;
// this.$set(this.list_arr[0], "info", data.appbaseinfo.intorduce);
// this.$set(this.list_arr[1], "info", data.appbaseinfo.action);
// this.$set(this.list_arr[2], "info", data.scene);
// this.$set(this.list_arr[4], "info", data.contact_person);
// this.$set(this.list_arr[5], "info", data.contact_number);
// this.appcode = data.appbaseinfo.appcode;
// })
// .catch(function(response) {});
// },
deploy(val){ deploy(val){
console.log(val); console.log(val);
}, },
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
>{{item}}</div> >{{item}}</div>
</div> </div>
<div class="type_box_select"> <div class="type_box_select">
<info-list @download="download" :list_arr="now_service==0?list_arr:servicead_arr[now_user]"> <mavon-editor v-model="list_arr" :boxShadow="false" :toolbarsFlag="false" :subfield="false" defaultOpen="preview" :editable="false" v-if="now_service == 0"/>
<table-um :headers="header_arr" url="params_arr" slot="zd_table"></table-um> <info-list v-if="now_service!==0" :list_arr="servicead_arr[now_user]">
<process-card type="approval" :data="approval_arr[now_user]" slot="sp_card"></process-card> <process-card type="approval" :data="approval_arr" slot="sp_card"></process-card>
<div class="info_contain1" slot="sp_result"> <div class="info_contain1" slot="sp_result">
<el-form ref="form" :rules="rules" :model="form" label-width="0px"> <el-form ref="form" :rules="rules" :model="form" label-width="0px">
<el-form-item prop="result"> <el-form-item prop="result">
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
</el-form-item> </el-form-item>
<el-form-item class="btnsty"> <el-form-item class="btnsty">
<el-button @click="onSubmit('form')" class="right">提交</el-button> <el-button @click="onSubmit('form')" class="right">提交</el-button>
<el-button class="right">取消</el-button> <el-button class="right" @click="back_page">取消</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
...@@ -57,6 +57,7 @@ import infoList from "@/components/infoList"; ...@@ -57,6 +57,7 @@ import infoList from "@/components/infoList";
import tableUm from "@/components/table/table-um"; import tableUm from "@/components/table/table-um";
import processCard from "@/components/process-card"; import processCard from "@/components/process-card";
import {getRole} from "@/utils/common" import {getRole} from "@/utils/common"
import { mapGetters,mapState } from 'vuex'
export default { export default {
props: {}, props: {},
components: { components: {
...@@ -79,7 +80,7 @@ export default { ...@@ -79,7 +80,7 @@ export default {
option:[ option:[
{ required: true, message: '请输入意见', trigger: 'blur' }, { required: true, message: '请输入意见', trigger: 'blur' },
{ {
min: 10, message: '长度大于10个字符', trigger: 'blur' min: 10, message: '长度大于10个字符', trigger: 'blur'
} }
] ]
}, },
...@@ -91,37 +92,33 @@ export default { ...@@ -91,37 +92,33 @@ export default {
}, },
{ {
label: "不通过", label: "不通过",
value: 0 value: -1
} }
], ],
approval_arr:[ approval_arr:[
[], // {
[], // title:'一级审批',
[ // result:'审批通过',
{ // arr:[
title:'一级审批', // {
result:'审批通过', // title:'审批时间:',
arr:[ // info:'2020-02-28 15:23:45'
{ // },
title:'审批时间:', // {
info:'2020-02-28 15:23:45' // title:'审批单位:',
}, // info:'某某某城管局'
{ // },
title:'审批单位:', // {
info:'某某某城管局' // title:'审批人:',
}, // info:'张先生'
{ // },
title:'审批人:', // {
info:'张先生' // title:'审批意见:',
}, // info:'同意'
{ // },
title:'审批意见:', // ]
info:'同意' // },
}, ],
]
},
],
],
header_arr: [ header_arr: [
{ {
prop: "zdmc", prop: "zdmc",
...@@ -157,15 +154,48 @@ export default { ...@@ -157,15 +154,48 @@ export default {
service_header_arr: { service_header_arr: {
name: "", name: "",
pic:"", url:"",
first: [], first: [
second: [], {
"name": "应用类型",
"text": ""
},
{
"name": "业务领域",
"text": ""
},
{
"name": "审批状态",
"text": "",
"color":"#ef9433"
}
],
second: [
{
"name": "在线区域",
"text": ""
},
{
"name": "申请类型",
"text": ""
},
{
"name":"所属组织",
"text":""
}
],
}, },
service_arr: ["应用申请信息", "应用审批"], service_arr: ["应用申请信息", "应用审批"],
now_service: 0, now_service: 0,
servicead_arr: [ servicead_arr: [
[], [],
[ [
{
title: "审批信息:",
prop: "title",
type: "solt",
solt_name: "sp_card"
},
{ {
title: "一级审批:", title: "一级审批:",
prop: "title", prop: "title",
...@@ -188,83 +218,143 @@ export default { ...@@ -188,83 +218,143 @@ export default {
}, },
], ],
], ],
list_arr: [ list_arr: "",
{
title: "申请单位:",
info: ""
},
{
title: "申请人:",
info: ""
},
{
title: "申请人联系电话:",
info: ""
},
{
title: "场景描述:",
info: ""
},
{
title: "申请文件:",
info: "",
url:"",
type: "down"
},
{
title: "申请时间:",
info: ""
}
]
}; };
}, },
watch: {}, watch: {},
computed: {}, computed: {
...mapGetters([
'level',
]),
...mapState(['userInfo']),
},
created() { created() {
this.now_user = this.$store.state.role; console.log(this.level);
getRole().then((data) => { if(this.userInfo){
this.now_user = data; this.now_user = this.level
console.log(data);
this.$store.commit("rolefun", data);
this.getheaderinfo(); this.getheaderinfo();
this.getapplyinfo(); this.getapplyinfo();
}); this.get_approval_info();
}else{
this.getCurrentUser()
}
}, },
mounted() {}, mounted() {},
methods: { methods: {
download(val){ getCurrentUser() {
console.log(val); this.$api.user.getNowUser().then(({ data }) => {
if (data.success == 1) {
console.log("--- user info ---");
console.log(data.data);
console.log("--- user info ---");
this.$store.commit("userInfofun", data.data);
this.now_user = this.level
this.getheaderinfo();
this.getapplyinfo();
this.get_approval_info();
console.log(this.level);
} else {
console.log(data.errMsg);
}
});
},
get_approval_info(){
this.$http
.get(`/apaas/hubApi/market/approvalInfo/${this.$route.params.id}`)
.then((response) => {
let data = response.data.data;
if(!(data&&data.length)){
if(this.now_user==2){
}else{
this.servicead_arr[1].splice(0,1)
}
return
}
if(this.now_user==2){
if(data.length>=2){
this.servicead_arr[2].splice(1,1)
}
}else{
this.servicead_arr[1].splice(1,1)
}
data.forEach(e => {
this.approval_arr.push({
title: e.level==1?"一级审批":'二级审批',
result: e.apply_type_name,
arr: [
{
title: "审批时间:",
info: e.created.split('.')[0].replace('T',' '),
},
{
title: "审批单位:",
info: e.department_name,
},
{
title: "审批人:",
info: e.user_name,
},
{
title: "审批意见:",
info: e.comments,
}
]
})
});
}).catch(function(response) {});
}, },
getapplyinfo(){ getapplyinfo(){
this.$http this.$http
.get("./static/approvalappdetail.json") .get("/apaas/hubApi/market/readme/"+this.$route.params.app_id)
.then((response) => { .then((response) => {
let data = response.data.data; let data = response.data.data;
this.$set(this.list_arr[0], "info", data.appbaseinfo.company); this.list_arr = data
this.$set(this.list_arr[1], "info", data.appbaseinfo.person);
this.$set(this.list_arr[2], "info", data.appbaseinfo.phone);
this.$set(this.list_arr[3], "info", data.appbaseinfo.desc);
this.$set(this.list_arr[4], "info", data.appbaseinfo.filename);
this.$set(this.list_arr[4], "url", data.appbaseinfo.fileurl);
this.$set(this.list_arr[5], "info", data.appbaseinfo.time);
}) })
.catch(function(response) {}); .catch(function(response) {});
}, },
getheaderinfo(){ getheaderinfo(){
this.$http this.$http
.get("./static/approvalappdetail.json") .get("/apaas/hubApi/market/applyInfo/"+this.$route.params.id)
.then((response) => { .then((response) => {
let data = response.data.data; let data = response.data.data;
this.$set(this.service_header_arr, "name", data.appInfo.name); this.$set(this.service_header_arr, "name", data.app_name+' ');
this.$set(this.service_header_arr, "first", data.appInfo.first); this.$set(this.service_header_arr, "url", data.logo);
this.$set(this.service_header_arr, "second", data.appInfo.second); this.$set(this.service_header_arr.first[0], "text", data.type_name);
this.$set(this.service_header_arr.first[1], "text", data.ywly_name);
this.$set(this.service_header_arr.first[2], "text", data.apply_status);
this.$set(this.service_header_arr.first[2], "color", data.apply_status=="审批中"||data.apply_status=="待审批"?'#ef9433':data.apply_status=="审批通过"||data.apply_status=="已审批"?'#515fe7':'#e15260');
this.$set(this.service_header_arr.second[0], "text", data.online_state_name);
this.$set(this.service_header_arr.second[1], "text", data.apply_type_name);
this.$set(this.service_header_arr.second[2], "text", data.department_name);
}) })
.catch(function(response) {}); .catch(function(response) {});
}, },
back_page(){
this.$router.back(-1)
},
post_result(){
var temp = {
"app_id":parseInt(this.$route.params.app_id), // 申请的应用的id
"apply_id":parseInt(this.$route.params.id), // 申请id
"status": this.form.result, // 是否通过,-1 不通过 1 通过
"comments":this.form.option // 审批意见
}
this.$http
.post("/apaas/hubApi/market/approval/"+this.$route.params.id,temp)
.then((response) => {
if(response.data.success){
this.$message.success('审批成功')
this.back_page()
}else{
this.$message.error(errMsg)
}
}).catch(function(response) {});
},
onSubmit(formName){ onSubmit(formName){
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
alert('submit!'); this.post_result()
} else { } else {
console.log('error submit!!'); console.log('error submit!!');
return false; return false;
......
...@@ -6,6 +6,9 @@ const general = { ...@@ -6,6 +6,9 @@ const general = {
logout(params) { logout(params) {
return axios.get(`/iam/api/logout?ReturnUrl=${encodeURIComponent(params.returnUrl)}`); return axios.get(`/iam/api/logout?ReturnUrl=${encodeURIComponent(params.returnUrl)}`);
}, },
getNowMenu(params) {
return axios.get(`/apaas/backmgt/menu/user/menu?teamName=${params.teamName}`);
},
} }
export default general; export default general;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment