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