Commit a0f12053 authored by 张俊's avatar 张俊

服务审批

parent 28984823
......@@ -32,7 +32,8 @@ export default {
},
methods:{
download(val){
this.$emit('download',val)
// this.$emit('download',val)
console.log(val);
}
}
};
......
......@@ -397,6 +397,7 @@ export default {
};
},
mounted() {
console.log(this.datas);
this.getDataFromApiSync();
},
watch: {
......
......@@ -9,9 +9,9 @@
</div>
<div class="type_box_select">
<info-list :list_arr="now_service==0?list_arr:now_service==1?servicead_arr:apply_arr">
<table-um :headers="header_arr" url="min_service_params_arr" slot="zd_table"></table-um>
<table-um :headers="header_arr" url="apply_params_arr" slot="apply_table"></table-um>
<process-card :data="approval_arr1" slot="approval"></process-card>
<table-um v-if="res_data.length" :headers="header_arr" :datas="res_data" slot="zd_table"></table-um>
<table-um v-if="zd_table_arr.length" :headers="header_arr" :datas="zd_table_arr" slot="apply_table"></table-um>
<process-card :data="use_approval_arr" slot="approval"></process-card>
</info-list>
</div>
</div>
......@@ -36,6 +36,7 @@ export default {
},
data() {
return {
use_approval_arr:[],
approval_arr:[
{
title:'一级审批',
......@@ -182,26 +183,26 @@ export default {
],
service_arr:['服务基本信息','接口详细信息','申请审批信息'],
service_header_arr:{
name:'apaas-mapvideos',
name:'',
first:[
{
name:'服务类型',
text:'综合服务',
text:'',
},
{
name:'审批状态',
text:'审批通过',
text:'',
color:'#515fe7',
},
{
name:'服务到期时间',
text:'2020-06-08 17:34:12',
text:'',
},
],
second:[
{
name:'服务接口地址',
text:'http://localhost:8084/cszh/rest/yxtz/zdrylx?code=430100000000',
text:'',
},
],
fixed:false,
......@@ -210,53 +211,53 @@ export default {
list_arr:[
{
title:'服务描述:',
info:'地图视频融合服务'
info:''
},
{
title:'服务领域:',
info:'城市建设'
info:''
},
{
title:'发布人:',
info:'小北'
info:''
},
{
title:'联系方式:',
info:'18342803360'
info:''
},
{
title:'所属组织:',
info:'北京比格大数据有限公司'
info:''
},
{
title:'开放程度:',
info:'共享'
info:''
},
{
title:'接口编码:',
info:'chart'
info:''
},
{
title:'注册发布时间:',
info:'2019-02-17 21:09:23'
info:''
},
],
servicead_arr:[
{
title:'请求方式:',
info:'post'
info:''
},
{
title:'请求参数:',
info:'无请求参数'
info:''
},
{
title:'请求示例:',
info:'无请求示例'
info:''
},
{
title:'编码格式:',
info:'UTF-8'
info:''
},
{
title:'响应参数:',
......@@ -312,6 +313,9 @@ export default {
solt_name:'approval'
},
],
request_arr:['','GET','POST','PUT','DELETE'],
res_data:[],
zd_table_arr:[],
};
},
watch: {
......@@ -321,13 +325,89 @@ export default {
},
created() {
this.get_service_info()
},
mounted() {
},
methods: {
get_service_info(){
this.$http
.get(`/apaas/service/v3/service/apply/service?apply_id=${this.$route.params.id}`)
.then((response) => {
console.log(response.data.data);
let data = response.data.data;
this.$set(this.service_header_arr, "name", data.name);
this.$set(this.service_header_arr['first'][0], 'text', data.data_service_type1_name);
this.$set(this.service_header_arr['first'][1], 'text', data.service_apply_info.approval_status);
this.$set(this.service_header_arr['first'][2], 'text', data.down_time);
this.$set(this.service_header_arr['second'][0], "text", data.req_url);
this.$set(this.service_header_arr, "url", data.cover);
this.$set(this.list_arr[0], "info", data.descript);
this.$set(this.list_arr[1], "info", data.data_service_type2_name);
this.$set(this.list_arr[2], "info", data.service_apply_info.apply_user_info.user_name);
this.$set(this.list_arr[3], "info", data.service_apply_info.apply_user_info.phone);
this.$set(this.list_arr[4], "info", data.service_apply_info.apply_user_info.department_name);
this.$set(this.list_arr[5], "info", data.openness_name);
this.$set(this.list_arr[6], "info", data.encode_method);
this.$set(this.list_arr[7], "info", data.create_time.replace('T'," ").split('+')[0]);
this.$set(this.servicead_arr[0], "info", this.request_arr[data.req_type]);
this.$set(this.servicead_arr[1], "info", data.req_query?data.req_query:'');
this.$set(this.servicead_arr[2], "info", data.req_fields);
this.$set(this.servicead_arr[3], "info", data.encode_method);
// this.$set(this.apply_arr[0], "info", data.apply_user_info.phone);
this.$set(this.apply_arr[1], "info", data.descript);
this.$set(this.apply_arr[2], "info", data.service_apply_info.business_name);
this.$set(this.apply_arr[3], "info", data.service_apply_info.business_url);
this.$set(this.apply_arr[4], "info", data.service_apply_info.apply_file.split('/')[data.service_apply_info.apply_file.split('/').length - 1]);
this.$set(this.apply_arr[4], "url", data.service_apply_info.apply_file);
this.$set(this.apply_arr[6], "info", data.service_apply_info.duration+data.service_apply_info.duration_unit);
this.$set(this.apply_arr[7], "info", data.service_apply_info.apply_time);
this.zd_table_arr = [
{
wfwmc:data.name,
jkzt:data.health_state,
jklj:data.req_url,
wfwms:data.descript
}
]
console.log(this.zd_table_arr);
data.service_apply_info.approval_process.reverse().forEach(e => {
this.use_approval_arr.push(
{
title:e.id==1?'一级审批':'二级审批',
result:e.status==-1?'审批未通过':e.status==0?'审批中':'审批通过',
}
)
if(e.status!==0){
this.use_approval_arr[this.use_approval_arr.length - 1]['arr']=[
{
title:'审批时间:',
info:e.approval_time
},
{
title:'审批单位:',
info:e.user_info.department_name
},
{
title:'审批人:',
info:e.user_info.user_name
},
{
title:'审批意见:',
info:e.comments
},
]
}
});
this.res_data = JSON.parse(data.res_fields)
})
.catch(function(response) {
});
},
},
};
</script>
......
......@@ -18,7 +18,7 @@
</div>
<div class="type_box_select">
<info-list @download="download" :list_arr="now_service==0?list_arr:servicead_arr[now_user]">
<table-um :headers="header_arr" url="params_arr" slot="zd_table"></table-um>
<table-um :headers="header_arr" :datas="zd_table_arr" slot="zd_table"></table-um>
<process-card type="approval" :data="approval_arr[now_user]" slot="sp_card"></process-card>
<div class="info_contain1" slot="sp_result">
<el-form ref="form" :rules="rules" :model="form" label-width="0px">
......@@ -70,6 +70,8 @@ export default {
result:'',
option:''
},
id:'',
zd_table_arr:[],
now_user: 1, //0:普通用户,1:组织管理员,2:超级管理员
rules:{
result:[
......@@ -90,7 +92,7 @@ export default {
},
{
label: "不通过",
value: 0
value: -1
}
],
approval_arr:[
......@@ -123,31 +125,31 @@ export default {
],
header_arr: [
{
prop: "zdmc",
prop: "name",
label: "字段名称",
minWidth: "20%",
align: "left"
},
{
prop: "zdbm",
prop: "field_type",
label: "字段编码",
width: "100px",
align: "center"
},
{
prop: "zdlx",
prop: "show_type",
label: "字段类型",
width: "100px",
align: "center"
},
{
prop: "zdsm",
prop: "descript",
label: "字段说明",
minWidth: "30%",
align: "left"
},
{
prop: "zdsl",
prop: "example",
label: "字段示例数值",
width: "120px",
align: "left"
......@@ -155,26 +157,26 @@ export default {
],
service_header_arr: {
name: "apaas-mapvideos",
name: "",
first: [
{
name: "服务类型",
text: "综合服务"
text: ""
},
{
name: "服务领域",
text: "经济建设"
text: ""
},
{
name: "审批状态",
text: "待审批",
text: "",
color: "#ef9433"
}
],
second: [
{
name: "申请时间",
text: "2019-02-17 21:56:23"
text: ""
}
],
fixed: false
......@@ -264,22 +266,77 @@ export default {
onSubmit(formName){
this.$refs[formName].validate((valid) => {
if (valid) {
alert('submit!');
this.set_approval()
} else {
console.log('error submit!!');
return false;
}
});
},
set_approval(){
this.$http.post('/apaas/service/v3/service/approval/applied/approval',{
apply_id:this.id,
state:this.form.result,
message:this.form.option
}).then((res)=>{
console.log(res);
if(res.data.success){
this.$message.success('审批成功')
this.$router.back(-1)
}else{
this.$message.error('审批失败')
}
}).catch((res)=>{
this.$message.error(res)
})
},
download(val){
console.log(val);
},
get_service_info(){
this.$http
.get(`/apaas/service/v3/service/apply/service?apply_id=${this.$route.params.id}`)
.get(`/apaas/service/v3/service/approval/applied?apply_id=${this.$route.params.id}`)
.then((response) => {
console.log(response);
console.log(response.data.data);
let data = response.data.data;
this.$set(this.service_header_arr, "name", data.name);
this.$set(this.service_header_arr['first'][0], 'text', data.data_service_type1_name);
this.$set(this.service_header_arr['first'][1], 'text', data.data_service_type2_name);
this.$set(this.service_header_arr['first'][2], 'text', data.service_apply_info.approval_status==0?'待审批':data.service_apply_info.approval_status==1?'审批通过':'审批未通过');
this.$set(this.service_header_arr['second'][0], "text", data.service_apply_info.apply_time.replace('T'," ").split('+')[0]);
this.$set(this.service_header_arr, "url", data.cover);
this.$set(this.list_arr[0], "info", data.service_apply_info.apply_user_info.department_name);
this.$set(this.list_arr[1], "info", data.service_apply_info.apply_user_info.user_name);
this.$set(this.list_arr[2], "info", data.service_apply_info.apply_user_info.phone);
this.$set(this.list_arr[3], "info", data.descript);
this.$set(this.list_arr[4], "info", data.service_apply_info.business_name);
this.$set(this.list_arr[5], "info", data.service_apply_info.business_url);
this.$set(this.list_arr[6], "info", data.service_apply_info.apply_file.split('/')[data.service_apply_info.apply_file.split('/').length - 1]);
this.$set(this.list_arr[6], "url", data.service_apply_info.apply_file);
this.$set(this.list_arr[8], "info", data.service_apply_info.duration+data.service_apply_info.duration_unit);
this.$set(this.list_arr[9], "info", data.request_spcs_info);
this.id = data.service_apply_info.id
if(this.now_user==2){
this.approval_arr[2].arr=[
{
title:'审批时间:',
info:data.service_apply_info.approval_process[0].approval_time
},
{
title:'审批单位:',
info:data.service_apply_info.approval_process[0].user_info.department_name
},
{
title:'审批人:',
info:data.service_apply_info.approval_process[0].user_info.user_name
},
{
title:'审批意见:',
info:data.service_apply_info.approval_process[0].comments
},
]
}
this.zd_table_arr = data.service_apply_info.res_fields?JSON.parse(data.service_apply_info.res_fields):[]
})
.catch(function(response) {
......
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