Commit 7a261583 authored by 张俊's avatar 张俊

购物车服务申请

parent a9be64d5
......@@ -50,7 +50,9 @@
<div class="oprate">
<upload-file
v-if="data.isMg"
:list="imgList"
:drag="false"
@getNewList="getNewList"
type="default"
></upload-file>
</div>
......@@ -70,6 +72,7 @@
v-if="!data.isapp"
v-show="showtable"
:isSelection="true"
ref="apply_service_state_table"
:headers="headers"
:stripe="true"
:datas="data.data"
......@@ -90,6 +93,8 @@ export default {
data() {
return {
sceneinput: "",
fileList:'',
imgList:[],
showtable: false,
headers: [
{
......@@ -126,7 +131,14 @@ export default {
},
mounted() {},
methods: {
getNewList(val) {
console.log(val);
this.fileList = ""
this.fileList = val.map((v,k)=>{
return v.url
}).join(';')
console.log(this.fileList)
}
},
};
</script>
......
......@@ -6,7 +6,7 @@
<span>数量</span>
<span>操作</span>
</p>
<apply-service-state v-for="(item,index) in service_arr" :idx="index" :key="index+5000" :data="item"></apply-service-state>
<apply-service-state ref="apply_service_state" v-for="(item,index) in service_arr" :idx="index" :key="index+5000" :data="item"></apply-service-state>
</div>
</template>
......
......@@ -489,6 +489,7 @@ export default {
if (this.url == "") {
let newArr = [];
if (this.datas) {
console.log(this.datas);
newArr = this.datas;
}
let total = newArr.length;
......
......@@ -2,7 +2,7 @@
<div class="apply_container">
<info-list :list_arr="module_arr">
<apply-form ref="apply_info" slot="apply_info"></apply-form>
<service-list slot="apply_service" :service_arr="service_arr"></service-list>
<service-list ref="apply_service" slot="apply_service" :service_arr="service_arr"></service-list>
</info-list>
<div class="footout">
......@@ -40,6 +40,7 @@ export default {
},
],
post_arr:[],
service_arr:[
{
img:'http://b-ssl.duitang.com/uploads/item/201705/09/20170509165713_NiHaG.jpeg',
......@@ -116,28 +117,70 @@ export default {
},
methods: {
sub_service(){
console.log(this.$refs.apply_info.formInline);
// var temp = {
// "apply_part":{
// "o_name":"部门联系人姓名",
// "o_mobile":"部门联系人电话 / 手机号 或 固话"
// },
// carts:[]
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
if(formInline.preson&&formInline.phone){
var temp = {
"apply_part":{
"o_name":formInline.preson,
"o_mobile":formInline.phone
},
carts:[]
}
this.post_arr.forEach((e,idx) => {
if(e.service_id){
temp.carts.push(
{
"id": e.id,
"service_id": e.service_id,
"duration": e.duration,
"spec_id": e.spec_id,
"duration_method": e.duration_method,
"is_subscribe": e.is_subscribe,
"app_id": 0,
"scene":this.$refs.apply_service.$refs.apply_service_state[idx].sceneinput,
"apply_file":this.$refs.apply_service.$refs.apply_service_state[idx].fileList,
"apply_fields":this.$refs.apply_service.$refs.apply_service_state[idx].$refs.apply_service_state_table.metaData
}
)
}else{
temp.carts.push(
{
"id": e.id,
"service_id":0,
"duration": e.duration,
"spec_id": e.spec_id,
"duration_method": e.duration_method,
"is_subscribe": e.is_subscribe,
"app_id": e.app_id,
"scene":this.$refs.apply_service.$refs.apply_service_state[idx].sceneinput,
"apply_file":"",
}
)
}
});
// }
// this.$http
// .post(`/apaas/serviceapp/v3/shopcart/apply`)
// .then(response => {
// console.log(response);
// })
}else{
this.$message.error('请完善服务申请')
return
}
this.$http
.post(`/apaas/serviceapp/v3/shopcart/apply`,temp)
.then(response => {
console.log(response);
})
},
get_car_list(){
this.service_arr = []
this.post_arr = []
this.$http
.get(`/apaas/serviceapp/v3/shopcart/list`)
.then(response => {
console.log(response);
let data = response.data.data.valid
this.post_arr = data
data.forEach(e => {
this.service_arr.push({})
let l = this.service_arr.length -1
......@@ -147,9 +190,9 @@ export default {
this.service_arr[l]['title'] = e.application.app_name
this.service_arr[l]['type'] = e.application.type_name
this.service_arr[l]['auth'] = e.application.org_name
this.service_arr[l]['size'] = e.app_apply.apply_type==0?'部署':'开发'
this.service_arr[l]['applytype'] = '申请方式:'+e.app_apply.duration_unit==1?'':''
this.service_arr[l]['num'] = e.app_apply.duration
this.service_arr[l]['size'] = e.spec_id==0?'部署':'开发'
this.service_arr[l]['applytype'] = '申请方式:'+e.duration_unit==1?'':''
this.service_arr[l]['num'] = e.duration
this.service_arr[l]['isMg'] = false
this.service_arr[l]['isapp'] = true
}else{
......@@ -166,10 +209,12 @@ export default {
this.service_arr[l]['auth'] = e.service.organization_name
this.service_arr[l]['size'] = '规格:'
e.service.request_spcs_info.forEach(el => {
if(e.spec_id==el.id){
this.service_arr[l]['size'] = this.service_arr[l]['size'] + '访问次数:'+el.count+',访问量:'+el.pv+','
}
});
this.service_arr[l]['applytype'] = '申请方式:'+(e.service_apply.duration_unit==1?'':'')
this.service_arr[l]['num'] = e.service_apply.duration
this.service_arr[l]['applytype'] = '申请方式:'+(e.duration_unit==1?'':'')
this.service_arr[l]['num'] = e.duration
this.service_arr[l]['isMg'] = e.service.openness == 3
this.service_arr[l]['data'] = JSON.parse(e.service.res_fields)
console.log(this.service_arr[l]['data']);
......
......@@ -44,7 +44,7 @@
<upload-file
:multiple="false"
:max="1"
type="picture"
type="cropper"
:readOnly="false"
fit="fill"
:list="imgList"
......@@ -206,7 +206,7 @@ export default {
},
getServiceInfo() {
this.$http
.get("/apaas/hubApi/market/baseInfo?id="+this.$route.params.id)
.get("/apaas/hubApi/market/appEditInfo?id="+this.$route.params.id)
.then((response) => {
if(response.data.success){
let data = response.data.data;
......@@ -264,7 +264,7 @@ export default {
getNewList(val) {
console.log(val);
this.form.fileList = ""
this.form.fileList = val.map((v,k)=>{
this.form.fileList = [val].map((v,k)=>{
return v.url
}).join(';')
console.log(this.form.fileList)
......
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