"src/pages/data-analysis/org-overview.vue" did not exist on "8947da7f5986a39eae2d1b833aacb6c84e39d806"
Commit 6e3031c6 authored by 刘殿昕's avatar 刘殿昕

申请页,申请项无数据不显示

parent 35563cf3
...@@ -2,10 +2,7 @@ ...@@ -2,10 +2,7 @@
<div class="outborder"> <div class="outborder">
<div class="outservice"> <div class="outservice">
<div class="serviceinfo"> <div class="serviceinfo">
<div <div class="pic" :style="{ backgroundImage: 'url(' + data.img + ')' }"></div>
class="pic"
:style="{ backgroundImage: 'url(' + data.img + ')' }"
></div>
<div class="info"> <div class="info">
<p> <p>
{{ data.title }} {{ data.title }}
...@@ -33,8 +30,7 @@ ...@@ -33,8 +30,7 @@
border: 'solid 1px #e4c884', border: 'solid 1px #e4c884',
} }
" "
>{{ item.tip }}</span >{{ item.tip }}</span>
>
</p> </p>
<p>{{ data.type }}</p> <p>{{ data.type }}</p>
<p>{{ data.auth }}</p> <p>{{ data.auth }}</p>
...@@ -44,9 +40,7 @@ ...@@ -44,9 +40,7 @@
<p>{{ data.size }}</p> <p>{{ data.size }}</p>
<P>{{ data.applytype }}</P> <P>{{ data.applytype }}</P>
</div> </div>
<div class="num"> <div class="num">{{ data.num }}</div>
{{ data.num }}
</div>
<div class="oprate"> <div class="oprate">
<upload-file <upload-file
v-if="data.isMg" v-if="data.isMg"
...@@ -59,17 +53,17 @@ ...@@ -59,17 +53,17 @@
</div> </div>
<p class="inputtitle">应用场景:</p> <p class="inputtitle">应用场景:</p>
<div class="system"> <div class="system">
<el-input <el-input v-model="sceneinput" placeholder="请填写申请服务的应用场景"></el-input>
v-model="sceneinput"
placeholder="请填写申请服务的应用场景"
></el-input>
</div> </div>
<p class="inputtitle degr" v-if="!data.isapp" @click="showtable = !showtable"> <p
<i :class="showtable ? 'el-icon-caret-bottom' : 'el-icon-caret-right'"></i class="inputtitle degr"
>选择需要申请的数据项: v-if="!data.isapp && data.data && data.data.length != 0 "
@click="showtable = !showtable"
>
<i :class="showtable ? 'el-icon-caret-bottom' : 'el-icon-caret-right'"></i>选择需要申请的数据项:
</p> </p>
<table-um <table-um
v-if="!data.isapp" v-if="!data.isapp && data.data && data.data.length != 0 "
v-show="showtable" v-show="showtable"
:isSelection="true" :isSelection="true"
ref="apply_service_state_table" ref="apply_service_state_table"
...@@ -85,66 +79,66 @@ ...@@ -85,66 +79,66 @@
import uploadFile from "@/components/upload_file"; import uploadFile from "@/components/upload_file";
import tableUm from "@/components/table/table-um"; import tableUm from "@/components/table/table-um";
export default { export default {
props: ["data","idx"], props: ["data", "idx"],
components: { components: {
uploadFile, uploadFile,
tableUm, tableUm
}, },
data() { data() {
return { return {
sceneinput: "", sceneinput: "",
fileList:'', fileList: "",
imgList:[], imgList: [],
showtable: false, showtable: false,
headers: [ headers: [
{ {
label: "字段编码", label: "字段编码",
prop: "code", prop: "code",
align: "left", align: "left",
minWidth: "20%", minWidth: "20%"
}, },
{ {
label: "字段名称", label: "字段名称",
prop: "name", prop: "name",
align: "left", align: "left",
minWidth: "20%", minWidth: "20%"
}, },
{ {
label: "字段类型", label: "字段类型",
prop: "type", prop: "type",
align: "center", align: "center",
width: "150", width: "150"
}, },
{ {
label: "字段描述", label: "字段描述",
prop: "desc", prop: "desc",
align: "left", align: "left",
minWidth: "50%", minWidth: "50%"
}, }
], ]
}; };
}, },
watch: {}, watch: {},
computed: {}, computed: {},
created() { created() {},
},
mounted() {}, mounted() {},
methods: { methods: {
getNewList(val) { getNewList(val) {
console.log(val); console.log(val);
this.fileList = "" this.fileList = "";
this.fileList = val.map((v,k)=>{ this.fileList = val
return v.url .map((v, k) => {
}).join(';') return v.url;
console.log(this.fileList) })
.join(";");
console.log(this.fileList);
}
} }
},
}; };
</script> </script>
<style scoped> <style scoped>
.outborder{ .outborder {
border-bottom: 2px solid rgba(244, 247, 252, 1); border-bottom: 2px solid rgba(244, 247, 252, 1);
} }
.outservice { .outservice {
...@@ -238,7 +232,7 @@ export default { ...@@ -238,7 +232,7 @@ export default {
text-decoration: underline; text-decoration: underline;
cursor: pointer; cursor: pointer;
} }
.table{ .table {
margin: 0 30px 20px; margin: 0 30px 20px;
} }
</style> </style>
...@@ -17,9 +17,7 @@ import infoList from "@/components/infoList"; ...@@ -17,9 +17,7 @@ import infoList from "@/components/infoList";
import applyForm from "@/components/shop-car-apply/apply_form"; import applyForm from "@/components/shop-car-apply/apply_form";
import serviceList from "@/components/shop-car-apply/service_list"; import serviceList from "@/components/shop-car-apply/service_list";
export default { export default {
props: { props: {},
},
components: { components: {
infoList, infoList,
applyForm, applyForm,
...@@ -27,21 +25,20 @@ export default { ...@@ -27,21 +25,20 @@ export default {
}, },
data() { data() {
return { return {
module_arr:[ module_arr: [
{ {
title:'服务申请', title: "服务申请",
type:'solt', type: "solt",
solt_name:'apply_info' solt_name: "apply_info"
}, },
{ {
title:'申请的服务', title: "申请的服务",
type:'solt', type: "solt",
solt_name:'apply_service' solt_name: "apply_service"
}, }
], ],
post_arr:[], post_arr: [],
service_arr:[ service_arr: [
// { // {
// img:'http://b-ssl.duitang.com/uploads/item/201705/09/20170509165713_NiHaG.jpeg', // img:'http://b-ssl.duitang.com/uploads/item/201705/09/20170509165713_NiHaG.jpeg',
// title:'水路货物周转量情况水路货物周转量情况', // title:'水路货物周转量情况水路货物周转量情况',
...@@ -85,296 +82,307 @@ export default { ...@@ -85,296 +82,307 @@ export default {
// tableurl:'applydata', // tableurl:'applydata',
// }, // },
], ],
share_arr:[ share_arr: [
'', "",
{ {
name:'共享', name: "共享",
val:'share' val: "share"
}, },
{ {
name:'受限', name: "受限",
val:'limit' val: "limit"
}, },
{ {
name:'敏感', name: "敏感",
val:'mg' val: "mg"
} }
], ],
temp_sub_arr:[] temp_sub_arr: []
}; };
}, },
watch: { watch: {},
computed: {},
},
computed: {
},
created() { created() {
if(this.$route.query.service_id){ if (this.$route.query.service_id) {
this.get_one_service(this.$route.query) this.get_one_service(this.$route.query);
}else if(this.$route.query.app_id){ } else if (this.$route.query.app_id) {
this.get_one_app(this.$route.query) this.get_one_app(this.$route.query);
}else{ } else {
console.log(JSON.parse(window.sessionStorage.getItem('shoppingCart'))); console.log(JSON.parse(window.sessionStorage.getItem("shoppingCart")));
var temp_arr=[] var temp_arr = [];
JSON.parse(window.sessionStorage.getItem('shoppingCart')).forEach(e => { JSON.parse(window.sessionStorage.getItem("shoppingCart")).forEach(e => {
temp_arr.push(e.id) temp_arr.push(e.id);
}); });
this.get_car_list(temp_arr) this.get_car_list(temp_arr);
} }
}, },
mounted() { mounted() {},
},
methods: { methods: {
get_one_app(app_data){ get_one_app(app_data) {
this.$http this.$http
.get(`/apaas/serviceapp/v3/shopcart/appinfo?app_id=${app_data.app_id}`) .get(`/apaas/serviceapp/v3/shopcart/appinfo?app_id=${app_data.app_id}`)
.then(response => { .then(response => {
console.log(response); console.log(response);
let data = response.data.data let data = response.data.data;
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(app_data.app_id) this.post_arr[0].app_id = parseInt(app_data.app_id);
this.post_arr[0].spec_id = parseInt(app_data.spec_id) this.post_arr[0].spec_id = parseInt(app_data.spec_id);
this.post_arr[0].duration_method = parseInt(app_data.duration_unit) this.post_arr[0].duration_method = parseInt(app_data.duration_unit);
this.post_arr[0].duration = parseInt(app_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'] = '规格:'+(app_data.spec_id==0?'部署':'开发') this.service_arr[0]["size"] =
this.service_arr[0]['applytype'] = '申请方式:'+(app_data.duration_unit==1?'':'') "规格:" + (app_data.spec_id == 0 ? "部署" : "开发");
this.service_arr[0]['num'] = app_data.duration this.service_arr[0]["applytype"] =
this.service_arr[0]['isMg'] = false "申请方式:" + (app_data.duration_unit == 1 ? "" : "");
this.service_arr[0]['isapp'] = true this.service_arr[0]["num"] = app_data.duration;
this.service_arr[0]["isMg"] = false;
this.service_arr[0]["isapp"] = true;
} }
}) });
}, },
get_one_service(service_data){ get_one_service(service_data) {
this.$http this.$http
.get(`/apaas/serviceapp/v3/shopcart/serviceinfo?service_id=${service_data.service_id}`) .get(
`/apaas/serviceapp/v3/shopcart/serviceinfo?service_id=${service_data.service_id}`
)
.then(response => { .then(response => {
console.log(response); console.log(response);
let data = response.data.data let data = response.data.data;
if(response.data.success&&data){ if (response.data.success && data) {
//服务 //服务
this.post_arr = [data] this.post_arr = [data];
this.post_arr[0].service_id = parseInt(service_data.service_id) this.post_arr[0].service_id = parseInt(service_data.service_id);
this.post_arr[0].spec_id = parseInt(service_data.spec_id) this.post_arr[0].spec_id = parseInt(service_data.spec_id);
this.post_arr[0].duration_method = parseInt(service_data.duration_unit) this.post_arr[0].duration_method = parseInt(
this.post_arr[0].duration = parseInt(service_data.duration) service_data.duration_unit
this.post_arr[0].id = '' );
this.service_arr.push({}) this.post_arr[0].duration = parseInt(service_data.duration);
this.service_arr[0]['img'] = data.cover this.post_arr[0].id = "";
this.service_arr[0]['title'] = data.name this.service_arr.push({});
this.service_arr[0]['type'] = data.data_service_type1_name this.service_arr[0]["img"] = data.cover;
this.service_arr[0]['tips'] = [ this.service_arr[0]["title"] = data.name;
this.service_arr[0]["type"] = data.data_service_type1_name;
this.service_arr[0]["tips"] = [
{ {
tip:this.share_arr[data.openness].name, tip: this.share_arr[data.openness].name,
type:this.share_arr[data.openness].val type: this.share_arr[data.openness].val
} }
] ];
this.service_arr[0]['auth'] = data.organization_name this.service_arr[0]["auth"] = data.organization_name;
this.service_arr[0]['size'] = '规格:' this.service_arr[0]["size"] = "规格:";
data.request_spcs_info.forEach(el => { data.request_spcs_info.forEach(el => {
if(service_data.spec_id==el.id){ if (service_data.spec_id == el.id) {
this.service_arr[0]['size'] = this.service_arr[0]['size'] + '访问次数:'+el.count+',访问量:'+el.pv+',' this.service_arr[0]["size"] =
this.service_arr[0]["size"] +
"访问次数:" +
el.count +
",访问量:" +
el.pv +
",";
} }
}); });
this.service_arr[0]['applytype'] = '申请方式:'+(service_data.duration_unit==1?'':'') this.service_arr[0]["applytype"] =
this.service_arr[0]['num'] = service_data.duration "申请方式:" + (service_data.duration_unit == 1 ? "" : "");
this.service_arr[0]['isMg'] = data.openness == 3 this.service_arr[0]["num"] = service_data.duration;
this.service_arr[0]['data'] = JSON.parse(data.res_fields) this.service_arr[0]["isMg"] = data.openness == 3;
console.log(this.service_arr[0]['data']); this.service_arr[0]["data"] = JSON.parse(data.res_fields);
this.service_arr[0]['isapp'] = false console.log(this.service_arr[0]["data"]);
}else{ this.service_arr[0]["isapp"] = false;
this.$message.error(response.data.errMsg) } else {
this.$message.error(response.data.errMsg);
} }
}).catch(()=>{
}) })
.catch(() => {});
}, },
deal_data(data){ deal_data(data) {
data.forEach(e => { data.forEach(e => {
if(e.selected){ if (e.selected) {
e.selected = 1 e.selected = 1;
}else{ } else {
e.selected = 0 e.selected = 0;
} }
if(e.children&&e.children.length){ if (e.children && e.children.length) {
this.deal_data(e.children) this.deal_data(e.children);
} }
}); });
}, },
sub_service(){ sub_service() {
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}$/;
if(!phone_ruler.test(formInline.phone)){ if (!phone_ruler.test(formInline.phone)) {
this.$message.error('输入正确号码') this.$message.error("输入正确号码");
return return;
} }
var temp = { var temp = {
"apply_part":{ apply_part: {
"o_name":formInline.preson, o_name: formInline.preson,
"o_mobile":formInline.phone o_mobile: formInline.phone
}, },
carts:[] carts: []
} };
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( id: e.id,
{ service_id: e.service_id,
"id": e.id, duration: e.duration,
"service_id": e.service_id, spec_id: e.spec_id,
"duration": e.duration, duration_method: e.duration_method,
"spec_id": e.spec_id, is_subscribe: e.is_subscribe,
"duration_method": e.duration_method, app_id: 0,
"is_subscribe": e.is_subscribe, scene: temp1[idx].sceneinput,
"app_id": 0, apply_file: temp1[idx].fileList,
"scene":temp1[idx].sceneinput, apply_fields: []
"apply_file":temp1[idx].fileList, });
"apply_fields":[], // 判断表格ref是否存在
} this.temp_sub_arr = temp1[idx].$refs.apply_service_state_table
) ? temp1[idx].$refs.apply_service_state_table.metaData
this.temp_sub_arr = temp1[idx].$refs.apply_service_state_table.metaData : [];
this.deal_data(this.temp_sub_arr) this.deal_data(this.temp_sub_arr);
temp.carts[temp.carts.length - 1]['apply_fields'] = this.temp_sub_arr temp.carts[temp.carts.length - 1][
}else{ "apply_fields"
temp.carts.push( ] = this.temp_sub_arr;
{ } else {
"id": e.id, temp.carts.push({
"service_id":0, id: e.id,
"duration": e.duration, service_id: 0,
"spec_id": e.spec_id, duration: e.duration,
"duration_method": e.duration_method, spec_id: e.spec_id,
"is_subscribe": e.is_subscribe, duration_method: e.duration_method,
"app_id": e.app_id, is_subscribe: e.is_subscribe,
"scene":this.$refs.apply_service.$refs.apply_service_state[idx].sceneinput, app_id: e.app_id,
"apply_file":"", scene: this.$refs.apply_service.$refs.apply_service_state[idx]
} .sceneinput,
) apply_file: ""
});
} }
}); });
} else {
}else{ this.$message.error("请完善服务申请");
this.$message.error('请完善服务申请') return;
return
} }
for (let index = 0; index < temp.carts.length; index++) { for (let index = 0; index < temp.carts.length; index++) {
const e = temp.carts[index]; const e = temp.carts[index];
if(e.service_id){ // 若表格数据长度不为0,执行以下
if(e.apply_fields[0].selected == 0){ if (e.service_id && e.apply_fields.length != 0) {
this.$message.error('请选择所需参数') if (e.apply_fields[0].selected == 0) {
return 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 => {
console.log(response); console.log(response);
if(response.data.success){ if (response.data.success) {
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(response.data.errMsg) this.$message.error(response.data.errMsg);
} }
}).catch(()=>{
this.$message.error('申请失败')
}) })
.catch(() => {
this.$message.error("申请失败");
});
}, },
get_car_list(car_arr){ get_car_list(car_arr) {
this.service_arr = [] this.service_arr = [];
this.post_arr = [] this.post_arr = [];
this.$http this.$http
.get(`/apaas/serviceapp/v3/shopcart/list`) .get(`/apaas/serviceapp/v3/shopcart/list`)
.then(response => { .then(response => {
console.log(response); console.log(response);
let data = response.data.data.valid let data = response.data.data.valid;
data.forEach(e => { data.forEach(e => {
if(car_arr.indexOf(e.id)==-1){ if (car_arr.indexOf(e.id) == -1) {
return return;
} }
this.post_arr.push(e) this.post_arr.push(e);
this.service_arr.push({}) this.service_arr.push({});
let l = this.service_arr.length -1 let l = this.service_arr.length - 1;
if(e.app_id){ if (e.app_id) {
//应用 //应用
this.service_arr[l]['img'] = e.application.logo this.service_arr[l]["img"] = e.application.logo;
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"] =
this.service_arr[l]['applytype'] = '申请方式:'+(e.duration_unit==1?'':'') "规格:" + (e.spec_id == 0 ? "部署" : "开发");
this.service_arr[l]['num'] = e.duration this.service_arr[l]["applytype"] =
this.service_arr[l]['isMg'] = false "申请方式:" + (e.duration_unit == 1 ? "" : "");
this.service_arr[l]['isapp'] = true this.service_arr[l]["num"] = e.duration;
}else{ this.service_arr[l]["isMg"] = false;
this.service_arr[l]["isapp"] = true;
} else {
//服务 //服务
this.service_arr[l]['img'] = e.service.cover this.service_arr[l]["img"] = e.service.cover;
this.service_arr[l]['title'] = e.service.name this.service_arr[l]["title"] = e.service.name;
this.service_arr[l]['type'] = e.service.data_service_type1_name this.service_arr[l]["type"] = e.service.data_service_type1_name;
this.service_arr[l]['tips'] = [ this.service_arr[l]["tips"] = [
{ {
tip:this.share_arr[e.service.openness].name, tip: this.share_arr[e.service.openness].name,
type:this.share_arr[e.service.openness].val type: this.share_arr[e.service.openness].val
} }
] ];
this.service_arr[l]['auth'] = e.service.organization_name this.service_arr[l]["auth"] = e.service.organization_name;
this.service_arr[l]['size'] = '规格:' this.service_arr[l]["size"] = "规格:";
e.service.request_spcs_info.forEach(el => { e.service.request_spcs_info.forEach(el => {
if(e.spec_id==el.id){ if (e.spec_id == el.id) {
this.service_arr[l]['size'] = this.service_arr[l]['size'] + '访问次数:'+el.count+',访问量:'+el.pv+',' this.service_arr[l]["size"] =
this.service_arr[l]["size"] +
"访问次数:" +
el.count +
",访问量:" +
el.pv +
",";
} }
}); });
this.service_arr[l]['applytype'] = '申请方式:'+(e.duration_unit==1?'':'') this.service_arr[l]["applytype"] =
this.service_arr[l]['num'] = e.duration "申请方式:" + (e.duration_unit == 1 ? "" : "");
this.service_arr[l]['isMg'] = e.service.openness == 3 this.service_arr[l]["num"] = e.duration;
this.service_arr[l]['data'] = JSON.parse(e.service.res_fields) this.service_arr[l]["isMg"] = e.service.openness == 3;
console.log(this.service_arr[l]['data']); this.service_arr[l]["data"] = JSON.parse(e.service.res_fields);
this.service_arr[l]['isapp'] = false console.log(this.service_arr[l]["data"]);
this.service_arr[l]["isapp"] = false;
} }
}); });
// this.service_arr = // this.service_arr =
}) })
.catch((response)=> { .catch(response => {});
}
}); }
},
},
}; };
</script> </script>
<style scoped> <style scoped>
.apply_container{ .apply_container {
width: 1200px; width: 1200px;
margin: 0 auto; margin: 0 auto;
overflow: hidden; overflow: hidden;
} }
.footout{ .footout {
width: 100%; width: 100%;
height: 84px; height: 84px;
background-color: rgba(255, 255, 255, 1); background-color: rgba(255, 255, 255, 1);
box-shadow: 0px 3px 6px 0px box-shadow: 0px 3px 6px 0px rgba(244, 247, 252, 1);
rgba(244, 247, 252, 1);
border-radius: 12px; border-radius: 12px;
padding: 20px; padding: 20px;
text-align: right; text-align: right;
margin: 20px 0; margin: 20px 0;
} }
.applybtn{ .applybtn {
color: rgba(252, 239, 214, 1); color: rgba(252, 239, 214, 1);
width: 200px; width: 200px;
height: 44px; height: 44px;
......
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