@@ -14,6 +14,7 @@ | |||||
:rules="rules" | :rules="rules" | ||||
:required="required" | :required="required" | ||||
:label-width="labelWidth || 'auto'" | :label-width="labelWidth || 'auto'" | ||||
:size="size || ''" | |||||
> | > | ||||
</van-field> | </van-field> | ||||
<van-popup v-model="popupVisible" position="bottom"> | <van-popup v-model="popupVisible" position="bottom"> | ||||
@@ -46,6 +47,7 @@ export default { | |||||
'remoteUrl', // 远程列表加载地址 String | 'remoteUrl', // 远程列表加载地址 String | ||||
'onRemoteResponse', // 远程获取到结果的处理回调 String|Function 如果是函数需返回数组, 如果是字符串支持.分割 | 'onRemoteResponse', // 远程获取到结果的处理回调 String|Function 如果是函数需返回数组, 如果是字符串支持.分割 | ||||
'clearable', // 点击取消时清空绑定值 | 'clearable', // 点击取消时清空绑定值 | ||||
'size', | |||||
], | ], | ||||
watch: { | watch: { | ||||
value: function (newVal, oldVal) { | value: function (newVal, oldVal) { | ||||
@@ -1,13 +1,25 @@ | |||||
<template> | <template> | ||||
<div class="home_wrapper"> | <div class="home_wrapper"> | ||||
<div class="header_main"> | <div class="header_main"> | ||||
{{title}} | |||||
{{titlePreifx}}{{title}} | |||||
<div class="return_btn" @click="back()"></div> | <div class="return_btn" @click="back()"></div> | ||||
</div> | </div> | ||||
<van-form ref="formData" :show-error-message="false" @submit="submit"> | <van-form ref="formData" :show-error-message="false" @submit="submit"> | ||||
<div class="list_main"> | <div class="list_main"> | ||||
<field-select | |||||
v-if="showTypeSelector" | |||||
v-model="form.otherType" | |||||
label="公开类型" | |||||
value-key="dictLabel" | |||||
data-key="dictValue" | |||||
placeholder="请选择公开类型" | |||||
:rules="rules.otherType" | |||||
required | |||||
size="large" | |||||
:columns="otherTypeOptions"/> | |||||
<van-field name="otherName" v-model="form.otherName" label="公开名称" input-align="right" required :rules="rules.otherName" placeholder="请输入公开名称" size="large" :maxlength="150"/> | <van-field name="otherName" v-model="form.otherName" label="公开名称" input-align="right" required :rules="rules.otherName" placeholder="请输入公开名称" size="large" :maxlength="150"/> | ||||
<field-date-picker | <field-date-picker | ||||
@@ -62,9 +74,10 @@ | |||||
import FieldDatePicker from "@/components/form/FieldDatePicker.vue"; | import FieldDatePicker from "@/components/form/FieldDatePicker.vue"; | ||||
import {Toast} from "vant"; | import {Toast} from "vant"; | ||||
import {addOther, getOther, updateOther} from "@/api/sunVillage_info/otherOpen"; | import {addOther, getOther, updateOther} from "@/api/sunVillage_info/otherOpen"; | ||||
import FieldSelect from "@/components/form/FieldSelect.vue"; | |||||
export default { | export default { | ||||
name: "otherOpenEdit", | name: "otherOpenEdit", | ||||
components: {FieldDatePicker, CommonUpload}, | |||||
components: {FieldSelect, FieldDatePicker, CommonUpload}, | |||||
data() { | data() { | ||||
return { | return { | ||||
form: { | form: { | ||||
@@ -88,22 +101,27 @@ | |||||
rules: { | rules: { | ||||
openAt: [{message: '请选择公开时间', required: true}], | openAt: [{message: '请选择公开时间', required: true}], | ||||
otherName: [{message: '请输入公开名称', required: true}], | otherName: [{message: '请输入公开名称', required: true}], | ||||
otherType: [{message: '请选择公开类型', required: true}], | |||||
}, | }, | ||||
id: null, | id: null, | ||||
intent: null, | intent: null, | ||||
content: '', | content: '', | ||||
otherTypeOptions: [], | |||||
type: null, | |||||
title: '综合公开', | title: '综合公开', | ||||
}; | }; | ||||
}, | }, | ||||
created() { | created() { | ||||
this.id = this.$route.query.id; | this.id = this.$route.query.id; | ||||
this.intent = this.$route.query.intent; | this.intent = this.$route.query.intent; | ||||
this.type = this.$route.query.type; | |||||
if(this.isEdit) | if(this.isEdit) | ||||
this.getDetail(); | this.getDetail(); | ||||
else | else | ||||
{ | { | ||||
this.form.otherType = this.$route.query.type; | this.form.otherType = this.$route.query.type; | ||||
this.getDicts('other_gk_type').then((resp) => { | this.getDicts('other_gk_type').then((resp) => { | ||||
this.otherTypeOptions = resp.data; | |||||
const dict = resp.data.find((x) => x.dictValue == this.form.otherType); | const dict = resp.data.find((x) => x.dictValue == this.form.otherType); | ||||
if(dict) | if(dict) | ||||
this.title = dict.dictLabel; | this.title = dict.dictLabel; | ||||
@@ -169,9 +187,12 @@ | |||||
isEdit() { | isEdit() { | ||||
return this.intent === 'edit'; | return this.intent === 'edit'; | ||||
}, | }, | ||||
title() { | |||||
titlePreifx() { | |||||
return this.intent === 'edit' ? '编辑' : '新增'; | return this.intent === 'edit' ? '编辑' : '新增'; | ||||
}, | }, | ||||
showTypeSelector() { | |||||
return this.isAdd && !this.type; | |||||
}, | |||||
}, | }, | ||||
} | } | ||||
</script> | </script> | ||||
@@ -3,7 +3,7 @@ | |||||
<div class="header_main" | <div class="header_main" | ||||
:style="`background-image:url(${require('@/assets/images/sunVillage_info/list_head.png')})`" | :style="`background-image:url(${require('@/assets/images/sunVillage_info/list_head.png')})`" | ||||
> | > | ||||
{{title}} | |||||
<p class="title" @click="openTypeChooser">{{title}}</p> | |||||
<div class="return_btn" @click="back"></div> | <div class="return_btn" @click="back"></div> | ||||
<div class="add_btn" @click="add"></div> | <div class="add_btn" @click="add"></div> | ||||
</div> | </div> | ||||
@@ -54,6 +54,14 @@ | |||||
</paged-list> | </paged-list> | ||||
</div> | </div> | ||||
<van-action-sheet | |||||
v-model="showType" | |||||
:actions="otherTypeOptions" | |||||
cancel-text="取消" | |||||
close-on-click-action | |||||
@select="changeType" | |||||
/> | |||||
</div> | </div> | ||||
</template> | </template> | ||||
@@ -78,21 +86,27 @@ import {getLoginBook} from "@/api/sunVillage_info/fixedAssets"; | |||||
otherType: null, | otherType: null, | ||||
}, | }, | ||||
yearList: [], | yearList: [], | ||||
title: '综合公开', | |||||
reload: false, | reload: false, | ||||
showTab: false, | showTab: false, | ||||
otherTypeOptions: [], | |||||
showType: false, | |||||
}; | }; | ||||
}, | }, | ||||
created() { | created() { | ||||
this.queryParams.otherType = this.$route.query.type; | |||||
if(this.$route.query.type) | |||||
{ | |||||
this.getDicts('other_gk_type').then((resp) => { | |||||
const dict = resp.data.find((x) => x.dictValue == this.$route.query.type); | |||||
if(dict) | |||||
this.title = dict.dictLabel; | |||||
this.queryParams.otherType = this.$route.query.type || ''; | |||||
this.getDicts('other_gk_type').then((resp) => { | |||||
let arr = []; | |||||
arr.push({ | |||||
dictValue: '', | |||||
dictLabel: '综合公开', | |||||
name: '全部', | |||||
}); | }); | ||||
} | |||||
resp.data.forEach((x) => { | |||||
x.name = x.dictLabel; | |||||
arr.push(x); | |||||
}); | |||||
this.otherTypeOptions = arr; | |||||
}); | |||||
getLoginBook().then((resp) => { | getLoginBook().then((resp) => { | ||||
let startYear = new Date().getFullYear(); | let startYear = new Date().getFullYear(); | ||||
let thisYear = startYear; | let thisYear = startYear; | ||||
@@ -115,35 +129,50 @@ import {getLoginBook} from "@/api/sunVillage_info/fixedAssets"; | |||||
}); | }); | ||||
}); | }); | ||||
}, | }, | ||||
viewItem(id){ | |||||
gotoViewItem(id) { | |||||
let parms = { | |||||
id: id, | |||||
intent: 'view', | |||||
}; | |||||
if(this.queryParams.otherType) | |||||
parms.type = this.queryParams.otherType; | |||||
this.$router.push({ | this.$router.push({ | ||||
name: 'otherOpenDetail', | name: 'otherOpenDetail', | ||||
query: { | |||||
id: id, | |||||
intent: 'view', | |||||
type: this.$route.query.type, | |||||
}, | |||||
query: parms, | |||||
}).catch(() => {}); | }).catch(() => {}); | ||||
}, | }, | ||||
add() { | |||||
viewItem(id){ | |||||
this.$router.replace(`/sunVillage_info/otherOpenIndex?type=${this.queryParams.otherType || ''}`, () => this.gotoViewItem(id), () => this.gotoViewItem(id) ); | |||||
}, | |||||
gotoAdd() { | |||||
let parms = { | |||||
intent: 'add', | |||||
}; | |||||
if(this.queryParams.otherType) | |||||
parms.type = this.queryParams.otherType; | |||||
this.$router.push({ | this.$router.push({ | ||||
name: 'otherOpenEdit', | name: 'otherOpenEdit', | ||||
query: { | |||||
intent: 'add', | |||||
type: this.$route.query.type, | |||||
}, | |||||
query: parms, | |||||
}).catch(() => {}); | }).catch(() => {}); | ||||
}, | }, | ||||
edit(id) { | |||||
add() { | |||||
this.$router.replace(`/sunVillage_info/otherOpenIndex?type=${this.queryParams.otherType || ''}`, () => this.gotoAdd(), () => this.gotoAdd() ); | |||||
}, | |||||
gotoEdit(id) { | |||||
let parms = { | |||||
id: id, | |||||
intent: 'edit', | |||||
}; | |||||
if(this.queryParams.otherType) | |||||
parms.type = this.queryParams.otherType; | |||||
this.$router.push({ | this.$router.push({ | ||||
name: 'otherOpenEdit', | name: 'otherOpenEdit', | ||||
query: { | |||||
id: id, | |||||
intent: 'edit', | |||||
type: this.$route.query.type, | |||||
}, | |||||
query: parms, | |||||
}).catch(() => {}); | }).catch(() => {}); | ||||
}, | }, | ||||
edit(id) { | |||||
this.$router.replace(`/sunVillage_info/otherOpenIndex?type=${this.queryParams.otherType || ''}`, () => this.gotoEdit(id), () => this.gotoEdit(id) ); | |||||
}, | |||||
remove(id) { | remove(id) { | ||||
Dialog.confirm({ | Dialog.confirm({ | ||||
title: '警告', | title: '警告', | ||||
@@ -164,7 +193,7 @@ import {getLoginBook} from "@/api/sunVillage_info/fixedAssets"; | |||||
.catch(() => {}); | .catch(() => {}); | ||||
}, | }, | ||||
back() { | back() { | ||||
this.$router.back(); | |||||
this.$router.replace('/sunVillage_info/otherOpenIndex', () => this.$router.back(), () => this.$router.back() ); | |||||
}, | }, | ||||
tabClick(year){ | tabClick(year){ | ||||
this.queryParams.openYear = year; | this.queryParams.openYear = year; | ||||
@@ -173,6 +202,24 @@ import {getLoginBook} from "@/api/sunVillage_info/fixedAssets"; | |||||
tabShow(){ | tabShow(){ | ||||
this.showTab = !this.showTab; | this.showTab = !this.showTab; | ||||
}, | }, | ||||
openTypeChooser() { | |||||
this.showType = true; | |||||
}, | |||||
changeType(action, index) { | |||||
this.queryParams.otherType = action.dictValue; | |||||
this.reload = true; | |||||
}, | |||||
}, | |||||
computed: { | |||||
title() { | |||||
if(this.queryParams.otherType) | |||||
{ | |||||
const dict = this.otherTypeOptions.find((x) => x.dictValue == this.queryParams.otherType); | |||||
if(dict) | |||||
return dict.dictLabel; | |||||
} | |||||
return '综合公开'; | |||||
}, | |||||
}, | }, | ||||
} | } | ||||
</script> | </script> | ||||
@@ -213,6 +260,32 @@ import {getLoginBook} from "@/api/sunVillage_info/fixedAssets"; | |||||
right: 38px; | right: 38px; | ||||
top: 36px; | top: 36px; | ||||
} | } | ||||
.title { | |||||
} | |||||
.title::before { | |||||
display: inline-block; | |||||
width: 24px; | |||||
height: 24px; | |||||
content: ''; | |||||
background-image: url('../../../assets/images/icon/index_header_focus.png'); | |||||
background-repeat: no-repeat; | |||||
background-size: contain; | |||||
margin-right: 0.2rem; | |||||
transform: rotate( | |||||
180deg | |||||
); | |||||
} | |||||
.title::after { | |||||
width: 0.32rem; | |||||
height: 0.32rem; | |||||
display: inline-block; | |||||
content: ''; | |||||
background-image: url('../../../assets/images/icon/index_header_focus.png'); | |||||
background-repeat: no-repeat; | |||||
background-size: contain; | |||||
margin-left: 0.2rem; | |||||
} | |||||
} | } | ||||
.record_main{ | .record_main{ | ||||
padding:30px 22px; | padding:30px 22px; | ||||
@@ -3,7 +3,7 @@ | |||||
<div class="header_main" | <div class="header_main" | ||||
:style="`background-image:url(${require('@/assets/images/sunVillage_info/list_head_red.png')})`" | :style="`background-image:url(${require('@/assets/images/sunVillage_info/list_head_red.png')})`" | ||||
> | > | ||||
{{title}} | |||||
<p class="title" @click="openTypeChooser">{{title}}</p> | |||||
<div class="return_btn" @click="back"></div> | <div class="return_btn" @click="back"></div> | ||||
</div> | </div> | ||||
<div class="record_main"> | <div class="record_main"> | ||||
@@ -47,6 +47,14 @@ | |||||
</paged-list> | </paged-list> | ||||
</div> | </div> | ||||
<van-action-sheet | |||||
v-model="showType" | |||||
:actions="otherTypeOptions" | |||||
cancel-text="取消" | |||||
close-on-click-action | |||||
@select="changeType" | |||||
/> | |||||
</div> | </div> | ||||
</template> | </template> | ||||
@@ -74,9 +82,10 @@ import Cookies from "js-cookie"; | |||||
deptId: null, | deptId: null, | ||||
}, | }, | ||||
yearList: [], | yearList: [], | ||||
title: '综合公开', | |||||
reload: false, | reload: false, | ||||
showTab: false, | showTab: false, | ||||
otherTypeOptions: [], | |||||
showType: false, | |||||
}; | }; | ||||
}, | }, | ||||
created() { | created() { | ||||
@@ -88,15 +97,20 @@ import Cookies from "js-cookie"; | |||||
return; | return; | ||||
} | } | ||||
this.queryParams.otherType = this.$route.query.type; | |||||
if(this.$route.query.type) | |||||
{ | |||||
this.getDicts('other_gk_type').then((resp) => { | |||||
const dict = resp.data.find((x) => x.dictValue == this.$route.query.type); | |||||
if(dict) | |||||
this.title = dict.dictLabel; | |||||
this.queryParams.otherType = this.$route.query.type || ''; | |||||
this.getDicts('other_gk_type').then((resp) => { | |||||
let arr = []; | |||||
arr.push({ | |||||
dictValue: '', | |||||
dictLabel: '综合公开', | |||||
name: '全部', | |||||
}); | }); | ||||
} | |||||
resp.data.forEach((x) => { | |||||
x.name = x.dictLabel; | |||||
arr.push(x); | |||||
}); | |||||
this.otherTypeOptions = arr; | |||||
}); | |||||
bookInfo(this.queryParams.bookId).then((resp) => { | bookInfo(this.queryParams.bookId).then((resp) => { | ||||
let startYear = new Date().getFullYear(); | let startYear = new Date().getFullYear(); | ||||
let thisYear = startYear; | let thisYear = startYear; | ||||
@@ -119,18 +133,23 @@ import Cookies from "js-cookie"; | |||||
}); | }); | ||||
}); | }); | ||||
}, | }, | ||||
viewItem(id){ | |||||
gotoViewItem(id) { | |||||
let parms = { | |||||
id: id, | |||||
intent: 'view', | |||||
}; | |||||
if(this.queryParams.otherType) | |||||
parms.type = this.queryParams.otherType; | |||||
this.$router.push({ | this.$router.push({ | ||||
name: 'otherOpenVisitDetail', | name: 'otherOpenVisitDetail', | ||||
query: { | |||||
id: id, | |||||
intent: 'view', | |||||
type: this.$route.query.type, | |||||
}, | |||||
query: parms, | |||||
}).catch(() => {}); | }).catch(() => {}); | ||||
}, | }, | ||||
viewItem(id){ | |||||
this.$router.replace(`/sunVillage_info/otherOpenVisitIndex?type=${this.queryParams.otherType || ''}`, () => this.gotoViewItem(id), () => this.gotoViewItem(id) ); | |||||
}, | |||||
back() { | back() { | ||||
this.$router.back(); | |||||
this.$router.replace('/sunVillage_info/otherOpenVisitIndex', () => this.$router.back(), () => this.$router.back() ); | |||||
}, | }, | ||||
tabClick(year){ | tabClick(year){ | ||||
this.queryParams.openYear = year; | this.queryParams.openYear = year; | ||||
@@ -139,6 +158,24 @@ import Cookies from "js-cookie"; | |||||
tabShow(){ | tabShow(){ | ||||
this.showTab = !this.showTab; | this.showTab = !this.showTab; | ||||
}, | }, | ||||
openTypeChooser() { | |||||
this.showType = true; | |||||
}, | |||||
changeType(action, index) { | |||||
this.queryParams.otherType = action.dictValue; | |||||
this.reload = true; | |||||
}, | |||||
}, | |||||
computed: { | |||||
title() { | |||||
if(this.queryParams.otherType) | |||||
{ | |||||
const dict = this.otherTypeOptions.find((x) => x.dictValue == this.queryParams.otherType); | |||||
if(dict) | |||||
return dict.dictLabel; | |||||
} | |||||
return '综合公开'; | |||||
}, | |||||
}, | }, | ||||
} | } | ||||
</script> | </script> | ||||
@@ -179,6 +216,32 @@ import Cookies from "js-cookie"; | |||||
right: 38px; | right: 38px; | ||||
top: 36px; | top: 36px; | ||||
} | } | ||||
.title { | |||||
} | |||||
.title::before { | |||||
display: inline-block; | |||||
width: 24px; | |||||
height: 24px; | |||||
content: ''; | |||||
background-image: url('../../../assets/images/icon/index_header_focus.png'); | |||||
background-repeat: no-repeat; | |||||
background-size: contain; | |||||
margin-right: 0.2rem; | |||||
transform: rotate( | |||||
180deg | |||||
); | |||||
} | |||||
.title::after { | |||||
width: 0.32rem; | |||||
height: 0.32rem; | |||||
display: inline-block; | |||||
content: ''; | |||||
background-image: url('../../../assets/images/icon/index_header_focus.png'); | |||||
background-repeat: no-repeat; | |||||
background-size: contain; | |||||
margin-left: 0.2rem; | |||||
} | |||||
} | } | ||||
.record_main{ | .record_main{ | ||||
padding:30px 22px; | padding:30px 22px; | ||||