Commit 4ab69016 authored by 徐一鸣's avatar 徐一鸣

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

parents 5f806392 6a1f7a52
...@@ -187,9 +187,8 @@ export default { ...@@ -187,9 +187,8 @@ export default {
query: { query: {
service_id: parseFloat(this.data.service_id), service_id: parseFloat(this.data.service_id),
duration: this.duration, duration: this.duration,
spec_id: this.specification.id, duration_unit: this.type,
spec_pv: this.specification.pv, spec_id: this.specification.id
spec_count: this.specification.count,
}, },
}); });
}, },
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
</el-form-item> </el-form-item>
<el-form-item prop="phone"> <el-form-item prop="phone">
<p class="formname">联系电话:</p> <p class="formname">联系电话:</p>
<el-input v-model="formInline.phone" placeholder="审批人"></el-input> <el-input v-model="formInline.phone" placeholder="联系电话"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
...@@ -33,6 +33,17 @@ export default { ...@@ -33,6 +33,17 @@ export default {
props: {}, props: {},
components: {}, components: {},
data() { data() {
var check_phone = (rule, value, callback) => {
var phone_ruler=/^(?:(?:\+|00)86)?1[3-9]\d{9}$/
setTimeout(() => {
if (!phone_ruler.test(value)) {
callback(new Error('请输入正确电话号码'));
} else {
callback();
}
});
};
return { return {
formInline: { formInline: {
depart: "", depart: "",
...@@ -43,7 +54,10 @@ export default { ...@@ -43,7 +54,10 @@ export default {
preson: [ preson: [
{ required: true, message: "请输入部门联系人", trigger: "blur" }, { required: true, message: "请输入部门联系人", trigger: "blur" },
], ],
phone: [{ required: true, message: "请输入联系电话", trigger: "blur" }], phone: [
{ required: true, message: "请输入联系电话", trigger: "blur" },
{ validator: check_phone, trigger: "blur" },
],
}, },
}; };
}, },
......
...@@ -42,48 +42,48 @@ export default { ...@@ -42,48 +42,48 @@ export default {
], ],
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:'水路货物周转量情况水路货物周转量情况',
tips:[ // tips:[
{ // {
tip:'Map Service', // tip:'Map Service',
type:'nor' // type:'nor'
}, // },
{ // {
tip:'共享', // tip:'共享',
type:'share' // type:'share'
}, // },
], // ],
type:'基础数据服务', // type:'基础数据服务',
auth:'贵州省交通运输厅', // auth:'贵州省交通运输厅',
size:'规格:访问次数:20/日,访问量:100/日', // size:'规格:访问次数:20/日,访问量:100/日',
applytype:'申请方式:按月', // applytype:'申请方式:按月',
num:1, // num:1,
isMg:false, // isMg:false,
tableurl:'applydata', // tableurl:'applydata',
}, // },
{ // {
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:'水路货物周转量情况水路货物周转量情况',
tips:[ // tips:[
{ // {
tip:'Map Service', // tip:'Map Service',
type:'nor' // type:'nor'
}, // },
{ // {
tip:'敏感', // tip:'敏感',
type:'mg' // type:'mg'
}, // },
], // ],
type:'基础数据服务', // type:'基础数据服务',
auth:'贵州省交通运输厅', // auth:'贵州省交通运输厅',
size:'规格:访问次数:20/日,访问量:100/日', // size:'规格:访问次数:20/日,访问量:100/日',
applytype:'申请方式:按月', // applytype:'申请方式:按月',
num:1, // num:1,
isMg:true, // isMg:true,
tableurl:'applydata', // tableurl:'applydata',
}, // },
], ],
share_arr:[ share_arr:[
'', '',
...@@ -110,17 +110,80 @@ export default { ...@@ -110,17 +110,80 @@ export default {
}, },
created() { created() {
this.get_car_list() if(this.$route.query.service_id){
this.get_one_service(this.$route.query)
}else if(this.$route.query.app_id){
this.get_one_app()
}else{
console.log(JSON.parse(window.sessionStorage.getItem('shoppingCart')));
var temp_arr=[]
JSON.parse(window.sessionStorage.getItem('shoppingCart')).forEach(e => {
temp_arr.push(e.id)
});
this.get_car_list(temp_arr)
}
}, },
mounted() { mounted() {
}, },
methods: { methods: {
get_one_app(){
},
get_one_service(service_data){
this.$http
.get(`/apaas/serviceapp/v3/shopcart/serviceinfo?service_id=${service_data.service_id}`)
.then(response => {
console.log(response);
let data = response.data.data
if(response.data.success&&data){
//服务
this.post_arr = [data]
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].duration_method = parseInt(service_data.duration_unit)
this.post_arr[0].duration = parseInt(service_data.duration)
this.post_arr[0].id = ''
this.service_arr.push({})
this.service_arr[0]['img'] = data.cover
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,
type:this.share_arr[data.openness].val
}
]
this.service_arr[0]['auth'] = data.organization_name
this.service_arr[0]['size'] = '规格:'
data.request_spcs_info.forEach(el => {
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]['applytype'] = '申请方式:'+(service_data.duration_unit==1?'':'')
this.service_arr[0]['num'] = service_data.duration
this.service_arr[0]['isMg'] = data.openness == 3
this.service_arr[0]['data'] = JSON.parse(data.res_fields)
console.log(this.service_arr[0]['data']);
this.service_arr[0]['isapp'] = false
}else{
this.$message.error(response.data.errMsg)
}
}).catch(()=>{
})
},
sub_service(){ sub_service(){
console.log(this.$refs.apply_service.$refs.apply_service_state); 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); 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}$/
if(!phone_ruler.test(formInline.phone)){
this.$message.error('输入正确号码')
return
}
var temp = { var temp = {
"apply_part":{ "apply_part":{
"o_name":formInline.preson, "o_name":formInline.preson,
...@@ -170,9 +233,17 @@ export default { ...@@ -170,9 +233,17 @@ export default {
.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){
this.$message.success('申请成功')
this.$router.replace('/shop/service_application_successfully')
}else{
this.$message.error('申请失败')
}
}).catch(()=>{
this.$message.error('申请失败')
}) })
}, },
get_car_list(){ get_car_list(car_arr){
this.service_arr = [] this.service_arr = []
this.post_arr = [] this.post_arr = []
this.$http this.$http
...@@ -182,6 +253,9 @@ export default { ...@@ -182,6 +253,9 @@ export default {
let data = response.data.data.valid let data = response.data.data.valid
this.post_arr = data this.post_arr = data
data.forEach(e => { data.forEach(e => {
if(car_arr.indexOf(e.id)==-1){
return
}
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){
......
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