Commit 009f519a authored by 张俊's avatar 张俊

购物车服务申请

parent 38ac4c25
......@@ -187,9 +187,8 @@ export default {
query: {
service_id: parseFloat(this.data.service_id),
duration: this.duration,
spec_id: this.specification.id,
spec_pv: this.specification.pv,
spec_count: this.specification.count,
duration_unit: this.type,
spec_id: this.specification.id
},
});
},
......
......@@ -22,7 +22,7 @@
</el-form-item>
<el-form-item prop="phone">
<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>
</div>
......@@ -33,6 +33,17 @@ export default {
props: {},
components: {},
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 {
formInline: {
depart: "",
......@@ -43,7 +54,10 @@ export default {
preson: [
{ 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 {
],
post_arr:[],
service_arr:[
{
img:'http://b-ssl.duitang.com/uploads/item/201705/09/20170509165713_NiHaG.jpeg',
title:'水路货物周转量情况水路货物周转量情况',
tips:[
{
tip:'Map Service',
type:'nor'
},
{
tip:'共享',
type:'share'
},
],
type:'基础数据服务',
auth:'贵州省交通运输厅',
size:'规格:访问次数:20/日,访问量:100/日',
applytype:'申请方式:按月',
num:1,
isMg:false,
tableurl:'applydata',
},
{
img:'http://b-ssl.duitang.com/uploads/item/201705/09/20170509165713_NiHaG.jpeg',
title:'水路货物周转量情况水路货物周转量情况',
tips:[
{
tip:'Map Service',
type:'nor'
},
{
tip:'敏感',
type:'mg'
},
],
type:'基础数据服务',
auth:'贵州省交通运输厅',
size:'规格:访问次数:20/日,访问量:100/日',
applytype:'申请方式:按月',
num:1,
isMg:true,
tableurl:'applydata',
},
// {
// img:'http://b-ssl.duitang.com/uploads/item/201705/09/20170509165713_NiHaG.jpeg',
// title:'水路货物周转量情况水路货物周转量情况',
// tips:[
// {
// tip:'Map Service',
// type:'nor'
// },
// {
// tip:'共享',
// type:'share'
// },
// ],
// type:'基础数据服务',
// auth:'贵州省交通运输厅',
// size:'规格:访问次数:20/日,访问量:100/日',
// applytype:'申请方式:按月',
// num:1,
// isMg:false,
// tableurl:'applydata',
// },
// {
// img:'http://b-ssl.duitang.com/uploads/item/201705/09/20170509165713_NiHaG.jpeg',
// title:'水路货物周转量情况水路货物周转量情况',
// tips:[
// {
// tip:'Map Service',
// type:'nor'
// },
// {
// tip:'敏感',
// type:'mg'
// },
// ],
// type:'基础数据服务',
// auth:'贵州省交通运输厅',
// size:'规格:访问次数:20/日,访问量:100/日',
// applytype:'申请方式:按月',
// num:1,
// isMg:true,
// tableurl:'applydata',
// },
],
share_arr:[
'',
......@@ -110,17 +110,80 @@ export default {
},
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() {
},
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(){
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 phone_ruler=/^(?:(?:\+|00)86)?1[3-9]\d{9}$/
if(!phone_ruler.test(formInline.phone)){
this.$message.error('输入正确号码')
return
}
var temp = {
"apply_part":{
"o_name":formInline.preson,
......@@ -170,9 +233,17 @@ export default {
.post(`/apaas/serviceapp/v3/shopcart/apply`,temp)
.then(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.post_arr = []
this.$http
......@@ -182,6 +253,9 @@ export default {
let data = response.data.data.valid
this.post_arr = data
data.forEach(e => {
if(car_arr.indexOf(e.id)==-1){
return
}
this.service_arr.push({})
let l = this.service_arr.length -1
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