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

购物车服务申请

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