Merge branch 'build' of http://git.sinoecare.com/sinoecare/digital_village_v2/dvcp_v2_webapp into build
This commit is contained in:
		| @@ -50,6 +50,7 @@ | ||||
|       <template slot="content"> | ||||
|         <ai-card title="基本信息"> | ||||
|           <template #content> | ||||
|             <div class="tips" v-if="!id"><i class="el-icon-warning"></i>换届选举仅采取不记名(匿名)投票</div> | ||||
|             <div class="add-form"> | ||||
|               <el-form ref="form" :model="form" :rules="formRules" size="small"  label-width="150px"> | ||||
|  | ||||
| @@ -234,6 +235,15 @@ export default { | ||||
|     confirm() { | ||||
|       this.$refs.form.validate((valid) => { | ||||
|           if (valid) { | ||||
|             if(this.form.electionMethod == 0) { | ||||
|               if(this.form.chooseNumber != this.form.candidateUsers.length) { | ||||
|                 return this.$message.error('候选人数与应选人数应相等') | ||||
|               } | ||||
|             } else if(this.form.electionMethod == 1) { | ||||
|               if(this.form.chooseNumber >= this.form.candidateUsers.length) { | ||||
|                 return this.$message.error('候选人数应多于应选人数') | ||||
|               } | ||||
|             } | ||||
|             this.instance.post(`/app/appgeneralelectioninfo/addOrUpdate`,{ | ||||
|               ...this.form | ||||
|             }).then(res => { | ||||
| @@ -258,5 +268,17 @@ export default { | ||||
|   ::v-deep .el-date-editor .el-input { | ||||
|     width: 100%; | ||||
|   } | ||||
|  | ||||
|   .tips { | ||||
|     width: 100%; | ||||
|     border: 1px solid #f82; | ||||
|     background-color: #fff3e9; | ||||
|     color: #f82; | ||||
|     padding: 8px 16px; | ||||
|     box-sizing: border-box; | ||||
|     border-radius: 4px; | ||||
|     margin-bottom: 32px; | ||||
|     font-size: 13px; | ||||
|   } | ||||
| } | ||||
| </style> | ||||
| @@ -17,10 +17,9 @@ | ||||
|         <ai-table :tableData="tableData" :total="page.total" :current.sync="page.current" :size.sync="page.size" @getList="getList" :col-configs="colConfigs" :dict="dict"> | ||||
|           <el-table-column slot="options" label="操作" fixed="right" align="center"> | ||||
|             <template slot-scope="{ row }"> | ||||
|               <!-- <el-button v-show="row.status==0" type="text" @click.native="toAdd(row.id, true)">编辑</el-button> --> | ||||
|               <el-button type="text" @click.native="toAdd(row.id)">详情</el-button> | ||||
|               <el-button type="text" :disabled="row.status==2" @click.native="startEnd(row.id, false)">结束</el-button> | ||||
|               <el-button type="text" @click.native="toStatistics(row.id)">统计</el-button> | ||||
|               <el-button type="text" v-show="row.status!=2" :disabled="row.status==2" @click.native="startEnd(row.id, row.status)">{{row.status == 0? '开启':'结束'}}</el-button> | ||||
|               <el-button type="text" v-show="row.status != 0" @click.native="toStatistics(row.id)">统计</el-button> | ||||
|               <el-button type="text" @click.native="handleDelete(row.id)">删除</el-button> | ||||
|             </template> | ||||
|           </el-table-column> | ||||
| @@ -82,7 +81,7 @@ export default { | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|     toAdd(id,flag) { | ||||
|     toAdd(id) { | ||||
|       this.$emit('change', { | ||||
|         type: 'electionAdd', | ||||
|         params: { | ||||
| @@ -107,12 +106,24 @@ export default { | ||||
|       } | ||||
|       this.getList() | ||||
|     }, | ||||
|     // 结束 | ||||
|     // 开启、结束 | ||||
|     startEnd(id, status) { | ||||
|       this.$confirm('投票正在进行中,确定要提前结束吗?').then(() => { | ||||
|         this.instance.post(`/app/appgeneralelectioninfo/start-end?id=${id}&start=${status}`).then(res=>{ | ||||
|       let title = '' | ||||
|       let bool = null | ||||
|       let tips = '' | ||||
|       if(status == 0) { | ||||
|         title = '未到投票开始时间,确定要提前开始吗?' | ||||
|         bool = true | ||||
|         tips = '开启成功' | ||||
|       } else if(status == 1) { | ||||
|         title = '投票正在进行中,确定要提前结束吗?' | ||||
|         bool = false | ||||
|         tips = '结束成功' | ||||
|       } | ||||
|       this.$confirm(title).then(() => { | ||||
|         this.instance.post(`/app/appgeneralelectioninfo/start-end?id=${id}&start=${bool}`).then(res=>{ | ||||
|           if(res.code == 0) { | ||||
|             this.$message.success('结束成功') | ||||
|             this.$message.success(tips) | ||||
|             this.getList() | ||||
|           } | ||||
|         }) | ||||
|   | ||||
| @@ -15,9 +15,15 @@ import organizationSetting from "./components/organizationSetting.vue"; | ||||
| export default { | ||||
|   name: "AppOrganizationChange", | ||||
|   label: "组织换届", | ||||
|   provide() { | ||||
|     return { | ||||
|       ...this.$props | ||||
|     } | ||||
|   }, | ||||
|   props: { | ||||
|     instance: Function, | ||||
|     dict: Object, | ||||
|     permissions: Function | ||||
|   }, | ||||
|   components: { | ||||
|     List, | ||||
| @@ -27,16 +33,16 @@ export default { | ||||
|   computed: { | ||||
|     ...mapState(['user']), | ||||
|     currentPage() { | ||||
|       if (this.$route.hash == "#add") { | ||||
|       const {hash} = this.$route | ||||
|       if (["#add","#makeup"].includes(hash)) { | ||||
|         return addChange | ||||
|       } else if (this.$route.hash == "#setting") { | ||||
|       } else if (hash == "#setting") { | ||||
|         return organizationSetting | ||||
|       } else return List | ||||
|     } | ||||
|   }, | ||||
|   data() { | ||||
|     return { | ||||
|       component: "List", | ||||
|       params: {}, | ||||
|       include: [], | ||||
|       selected: {}, | ||||
| @@ -47,10 +53,6 @@ export default { | ||||
|       this.params = data.params; | ||||
|     }, | ||||
|   }, | ||||
|   created() { | ||||
|     let {organizationId: id, organizationName: name} = this.user.info | ||||
|     this.selected = {id, name} | ||||
|   } | ||||
| } | ||||
| </script> | ||||
|  | ||||
|   | ||||
| @@ -1,11 +1,7 @@ | ||||
| <template> | ||||
|   <ai-list class="List"> | ||||
|     <template slot="title"> | ||||
|       <ai-title title="组织换届" isShowBottomBorder> | ||||
|         <template slot="rightBtn"> | ||||
|           <el-button size="small" type="primary" icon="iconfont iconAdd" @click="toSetting('')">换届设置</el-button> | ||||
|         </template> | ||||
|       </ai-title> | ||||
|       <ai-title title="组织换届" isShowBottomBorder/> | ||||
|     </template> | ||||
|     <template #left> | ||||
|       <ai-tree-menu title="组织目录" searchPlaceholder="请输入组织名称" @search="onSearch"> | ||||
| @@ -19,15 +15,16 @@ | ||||
|       </ai-tree-menu> | ||||
|     </template> | ||||
|     <template slot="content" class="content"> | ||||
|       <ai-title title="届次信息"> | ||||
|         <template #rightBtn> | ||||
|           <el-button size="small" type="primary" @click="toSetting(selected.id)" v-if="permissions('app_apporganizationchangeconfig')">换届设置</el-button> | ||||
|         </template> | ||||
|       </ai-title> | ||||
|       <el-tabs v-model="currIndex"> | ||||
|         <el-tab-pane v-for="(tab,i) in tabs" :key="i" :label="tab.label"> | ||||
|           <component :ref="tab.name" v-if="currIndex == String(i)" :is="tab.comp" lazy :instance="instance" :selected="selected" | ||||
|                      :dict="dict" :permissions="permissions" v-on="$listeners"/> | ||||
|           <component :ref="tab.name" v-if="currIndex==i" :is="tab.comp" lazy :selected="selected" v-on="$listeners"/> | ||||
|         </el-tab-pane> | ||||
|       </el-tabs> | ||||
|       <div class="add_btn"> | ||||
|         <el-button size="small" type="primary" icon="iconfont iconAdd" @click="toAdd('')">新增换届</el-button> | ||||
|       </div> | ||||
|     </template> | ||||
|   </ai-list> | ||||
| </template> | ||||
| @@ -39,12 +36,7 @@ import history from './history.vue' | ||||
|  | ||||
| export default { | ||||
|   name: 'List', | ||||
|   props: { | ||||
|     instance: Function, | ||||
|     permissions: Function, | ||||
|     dict: Object, | ||||
|     selected: Object | ||||
|   }, | ||||
|   inject: ['permissions', 'instance', 'dict'], | ||||
|   data() { | ||||
|     return { | ||||
|       tabs: [ | ||||
| @@ -52,6 +44,7 @@ export default { | ||||
|         {label: '历史届次', name: 'history', comp: history, permission: ''} | ||||
|       ], | ||||
|       currIndex: '0', | ||||
|       selected: null | ||||
|     } | ||||
|   }, | ||||
|   components: { | ||||
| @@ -60,25 +53,15 @@ export default { | ||||
|   }, | ||||
|   computed: { | ||||
|     ...mapState(['user']), | ||||
|  | ||||
|     orgTree() { | ||||
|       return this.$refs.tree?.$refs?.partyTree | ||||
|     }, | ||||
|   }, | ||||
|  | ||||
|   methods: { | ||||
|     showNeighbourSetting(id) { | ||||
|       this.$router.push({query: {id}, hash: "#ns"}) | ||||
|     }, | ||||
|     onTreeChange(e) { | ||||
|       this.$emit("update:selected", e) | ||||
|       this.selected = e | ||||
|       this.$refs[this.tabs[Number(this.currIndex)].name][0].getList(e.id) | ||||
|     }, | ||||
|  | ||||
|     onSearch(v) { | ||||
|       this.orgTree.filter(v) | ||||
|       this.$refs.tree?.$refs?.partyTree?.filter(v) | ||||
|     }, | ||||
|  | ||||
|     filterNode(value, data) { | ||||
|       if (!value) return true | ||||
|       return data.name.indexOf(value) !== -1 | ||||
| @@ -86,9 +69,13 @@ export default { | ||||
|     toAdd(id) { | ||||
|       this.$router.push({hash: "#add", query: {id}}) | ||||
|     }, | ||||
|     toSetting(id) { | ||||
|       this.$router.push({hash: "#setting", query: {id}}) | ||||
|     toSetting(oid) { | ||||
|       this.$router.push({hash: "#setting", query: {oid, new: 1}}) | ||||
|     } | ||||
|   }, | ||||
|   created() { | ||||
|     const {organizationId: id, organizationName: name} = this.user.info | ||||
|     this.selected = {id, name} | ||||
|   } | ||||
| } | ||||
| </script> | ||||
| @@ -135,6 +122,7 @@ export default { | ||||
|  | ||||
|     .ai-list__content--right-wrapper { | ||||
|       width: 100%; | ||||
|       padding-top: 0; | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| <template> | ||||
|   <section class="addChange"> | ||||
|     <ai-detail> | ||||
|       <ai-title slot="title" title="新增换届" isShowBottomBorder isShowBack @onBackClick="cancel(false)"/> | ||||
|       <ai-title slot="title" :title="pageTitle" isShowBottomBorder isShowBack @onBackClick="cancel(false)"/> | ||||
|       <template #content> | ||||
|         <ai-card title="基本信息"> | ||||
|           <template #content> | ||||
| @@ -83,10 +83,13 @@ export default { | ||||
|     permissions: Function, | ||||
|     dict: Object, | ||||
|   }, | ||||
|   computed: { | ||||
|     isMakeUp: v => v.$route.hash == "#makeup", | ||||
|     pageTitle: v => v.isMakeUp ? "补录换届" : "新增换届" | ||||
|   }, | ||||
|   data() { | ||||
|     return { | ||||
|       form: { | ||||
|         addOrMakeup: true, | ||||
|         changeTime: '', | ||||
|         sessionTime: '', | ||||
|         serveList: [],   // 任职人员列表 | ||||
| @@ -99,8 +102,18 @@ export default { | ||||
|     } | ||||
|   }, | ||||
|   methods: { | ||||
|     cancel() { | ||||
|       this.$router.push({}) | ||||
|     // getDetail() { | ||||
|     //   const {id: organizationId} = this.$route.query | ||||
|     //   organizationId && this.instance.post(`/app/apporganizationgeneralelection/queryDetailByOrganizationId`, null, { | ||||
|     //     params: {organizationId} | ||||
|     //   }).then(res => { | ||||
|     //     if (res?.data) { | ||||
|     //       this.form = res.data | ||||
|     //     } | ||||
|     //   }) | ||||
|     // }, | ||||
|     cancel(refresh) { | ||||
|       refresh ? this.$router.push({}) : this.$router.back() | ||||
|     }, | ||||
|     handleDelete(i, type) { | ||||
|       this.$confirm("确定要删除该数据?").then(() => { | ||||
| @@ -114,8 +127,9 @@ export default { | ||||
|     confirm() { | ||||
|       this.$refs.form.validate((valid) => { | ||||
|         if (valid) { | ||||
|           const addOrMakeup = !this.isMakeUp | ||||
|           this.instance.post(`/app/apporganizationgeneralelection/add`, { | ||||
|             ...this.form | ||||
|             ...this.form, addOrMakeup | ||||
|           }).then(res => { | ||||
|             if (res.code == 0) { | ||||
|               this.$message.success('提交成功') | ||||
|   | ||||
| @@ -0,0 +1,190 @@ | ||||
| <template> | ||||
|   <section class="detailPanel"> | ||||
|     <div class="itemTitle"> | ||||
|       <b>本届任职{{editable?"(必填)":""}}</b> | ||||
|       <span type="text" class="iconfont iconAdd" @click="showDialog({type:0})">添加任职人员</span> | ||||
|     </div> | ||||
|     <el-table :data="serveList" border header-cell-class-name="table-header" cell-class-name="table-cell"> | ||||
|       <el-table-column label="职位" width="180px" prop="position"/> | ||||
|       <el-table-column label="姓名" prop="name"/> | ||||
|       <el-table-column label="操作" width="120px" align="center"> | ||||
|         <div slot-scope="{row,$index}" class="table-operation"> | ||||
|           <span class="iconfont iconEdit" @click="showDialog(row,$index)" title="编辑"/> | ||||
|           <span class="iconfont iconDelete" title="删除" @click="deleteItem($index,0)"/> | ||||
|         </div> | ||||
|       </el-table-column> | ||||
|     </el-table> | ||||
|     <div class="itemTitle"> | ||||
|       <b>本届候选人</b> | ||||
|       <span type="text" class="iconfont iconAdd" @click="showDialog({type:1})">添加候选人</span> | ||||
|     </div> | ||||
|     <el-table :data="candidateList" border header-cell-class-name="table-header" cell-class-name="table-cell"> | ||||
|       <el-table-column label="职位" width="180px" prop="position"/> | ||||
|       <el-table-column label="候选人" prop="name"/> | ||||
|       <el-table-column label="操作" width="120px" align="center"> | ||||
|         <div slot-scope="{row,$index}" class="table-operation"> | ||||
|           <span class="iconfont iconEdit" @click="showDialog(row,$index)" title="编辑"/> | ||||
|           <span class="iconfont iconDelete" title="删除" @click="deleteItem($index,1)"/> | ||||
|         </div> | ||||
|       </el-table-column> | ||||
|     </el-table> | ||||
|     <el-dialog :visible.sync="dialog.visible" width="520px" :title="dialog.title" class="editStyle" | ||||
|                @close="dialog={visible: false},$refs.editListItemForm.clearValidate()"> | ||||
|       <el-form ref="editListItemForm" size="small" :model="dialog" :rules="rules" label-width="100px" | ||||
|                :validate-on-rule-change="false"> | ||||
|         <el-form-item label="职位:" prop="position"> | ||||
|           <el-input v-model="dialog.position" placeholder="请输入..."/> | ||||
|         </el-form-item> | ||||
|         <el-form-item :label="currentList.name+':'" prop="name"> | ||||
|           <el-input v-if="dialog.type==0" v-model="dialog.name" placeholder="请输入..."/> | ||||
|           <div v-else> | ||||
|             <el-input type="textarea" :rows="3" v-model="dialog.name" placeholder="请输入..."/> | ||||
|             <span style="color:#999;font-size: 12px">输入候选人姓名,用空格隔开</span> | ||||
|           </div> | ||||
|         </el-form-item> | ||||
|  | ||||
|       </el-form> | ||||
|       <div slot="footer" class="footerBtns"> | ||||
|         <el-button size="small" @click="dialog.visible=false">取消</el-button> | ||||
|         <el-button size="small" type="primary" @click="submitAdd">确认</el-button> | ||||
|       </div> | ||||
|     </el-dialog> | ||||
|   </section> | ||||
|  | ||||
| </template> | ||||
|  | ||||
| <script> | ||||
|   export default { | ||||
|     name: "detailPanel", | ||||
|     model: { | ||||
|       prop: "value", | ||||
|       event: "change" | ||||
|     }, | ||||
|     props: { | ||||
|       value: Object, | ||||
|       instance: Function, | ||||
|       dict: Object, | ||||
|       permissions: Function, | ||||
|       editable: {type: Boolean, default: false} | ||||
|     }, | ||||
|     data() { | ||||
|       return { | ||||
|         dialog: { | ||||
|           visible: false, | ||||
|           title: "", | ||||
|           name: "", | ||||
|           changeTime: "" | ||||
|         }, | ||||
|         serveList: [], | ||||
|         candidateList: [] | ||||
|       } | ||||
|     }, | ||||
|     computed: { | ||||
|       lists() { | ||||
|         return {candidateList: this.candidateList, serveList: this.serveList} | ||||
|       }, | ||||
|       currentList() { | ||||
|         let initData = { | ||||
|           0: {name: "姓名", dialogTitle: "本届任职人", list: "serveList"}, | ||||
|           1: {name: "候选人", dialogTitle: "本届候选人", list: "candidateList"} | ||||
|         } | ||||
|         return initData[this.dialog.type || 0] | ||||
|       }, | ||||
|       rules() { | ||||
|         return { | ||||
|           name: [{required: true, message: "请输入" + this.currentList.name, trigger: "change"}], | ||||
|           position: [{required: true, message: "请输入职位", trigger: "change"}], | ||||
|         } | ||||
|       }, | ||||
|     }, | ||||
|     watch: { | ||||
|       lists: { | ||||
|         deep: true, | ||||
|         handler() { | ||||
|           this.$emit('change', this.lists) | ||||
|         } | ||||
|       }, | ||||
|       value: { | ||||
|         deep: true, | ||||
|         handler(v) { | ||||
|           if (v) { | ||||
|             v.candidateList && (this.candidateList = v.candidateList) | ||||
|             v.serveList && (this.serveList = v.serveList) | ||||
|           } | ||||
|         } | ||||
|       } | ||||
|     }, | ||||
|     methods: { | ||||
|       showDialog(v, rowIndex) { | ||||
|         this.dialog = {...this.dialog, ...v, rowIndex} | ||||
|         this.dialog.title = (this.dialog.rowIndex==0? "编辑" : "添加") + this.currentList.dialogTitle | ||||
|         this.dialog.visible = true | ||||
|       }, | ||||
|       submitAdd() { | ||||
|         this.$refs.editListItemForm.validate(v => { | ||||
|           if (v) { | ||||
|             if (this.dialog.rowIndex > -1) { | ||||
|               this.$data[this.currentList.list].splice(this.dialog.rowIndex, 1, this.dialog) | ||||
|             } else this.$data[this.currentList.list].push(this.dialog) | ||||
|             this.dialog.visible = false | ||||
|             this.dialog.rowIndex==undefined ? this.$emit("refresh",1) : this.$emit("refresh",2); | ||||
|           } | ||||
|         }) | ||||
|       }, | ||||
|       deleteItem(index,type) { | ||||
|         this.$confirm(`是否要删除该${type==0?'本届任职人':'本届候选人'}`, {type: "error"}).then(() => { | ||||
|           type==0?this.$data["serveList"].splice(index, 1):this.$data["candidateList"].splice(index, 1) | ||||
|           this.$emit("refresh",0) | ||||
|         }).catch(() => { | ||||
|         }) | ||||
|       } | ||||
|     }, | ||||
|     mounted() { | ||||
|       this.$nextTick(() => { | ||||
|         if (this.value) { | ||||
|           let v = JSON.parse(JSON.stringify(this.value)) | ||||
|           v.candidateList && (this.candidateList = v.candidateList) | ||||
|           v.serveList && (this.serveList = v.serveList) | ||||
|         } | ||||
|       }) | ||||
|     } | ||||
|   } | ||||
| </script> | ||||
|  | ||||
| <style lang="scss" scoped> | ||||
|   .detailPanel { | ||||
|     .itemTitle + .el-table { | ||||
|       margin-top: 16px; | ||||
|     } | ||||
|  | ||||
|     .el-table + .itemTitle { | ||||
|       margin-top: 24px; | ||||
|     } | ||||
|  | ||||
|     ::v-deep .table-header { | ||||
|       box-sizing: border-box; | ||||
|       border-right: 1px solid #d0d4dc !important; | ||||
|  | ||||
|       .cell { | ||||
|         padding-left: 32px; | ||||
|       } | ||||
|  | ||||
|       &.is-center > .cell { | ||||
|         padding-left: 10px !important; | ||||
|       } | ||||
|     } | ||||
|  | ||||
|     ::v-deep .table-cell { | ||||
|       height: 44px; | ||||
|       color: #333; | ||||
|  | ||||
|       .cell { | ||||
|         padding-left: 32px; | ||||
|       } | ||||
|  | ||||
|       &.is-center > .cell { | ||||
|         padding-left: 10px !important; | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| </style> | ||||
| @@ -3,26 +3,18 @@ | ||||
|  | ||||
|     <ai-search-bar> | ||||
|       <template #left> | ||||
|         <el-button type="primary" icon="iconfont iconEdit" @click="fillupAdd('')">补录</el-button> | ||||
|         <el-button type="primary" icon="iconfont iconEdit" @click="$router.push({hash:'#makeup',query:{}})">补录</el-button> | ||||
|       </template> | ||||
|       <template #right> | ||||
|         <el-input size="small" placeholder="请输入届次" v-model="search.name" clearable | ||||
|                   v-throttle="() => {page.current = 1, getList()}"/> | ||||
|         <el-button icon="iconfont iconResetting" @click="reset('')">重置</el-button> | ||||
|       </template> | ||||
|     </ai-search-bar> | ||||
|     <ai-table | ||||
|         class="detail-table__table" | ||||
|         :tableData="tableData" | ||||
|         :col-configs="colConfigs" | ||||
|         :total="page.total" | ||||
|         :current.sync="current" | ||||
|         :size.sync="size" | ||||
|         @getList="getJobList"> | ||||
|     <ai-table :tableData="tableData" :col-configs="colConfigs" :isShowPagination="false" @getList="getList"> | ||||
|       <el-table-column slot="options" label="操作" align="center"> | ||||
|         <template slot-scope="{ row }"> | ||||
|           <el-button type="text" @click="jobEdit(row.id)">编辑</el-button> | ||||
|           <el-button type="text" @click="jobDelete(row.id)">删除</el-button> | ||||
|           <el-button type="text" @click="handleEdit(row.id)">编辑</el-button> | ||||
|           <el-button type="text" @click="handleDelete(row.id)">删除</el-button> | ||||
|         </template> | ||||
|       </el-table-column> | ||||
|     </ai-table> | ||||
| @@ -32,41 +24,60 @@ | ||||
| <script> | ||||
| export default { | ||||
|   name: "history", | ||||
|   props: { | ||||
|     instance: Function, | ||||
|     permissions: Function, | ||||
|     dict: Object, | ||||
|   inject: { | ||||
|     permissions: {}, | ||||
|     instance: {}, | ||||
|     dict: {} | ||||
|   }, | ||||
|   data() { | ||||
|     return { | ||||
|       search: { | ||||
|         name: '', | ||||
|       }, | ||||
|       page: { | ||||
|         current: 1, | ||||
|         size: 10, | ||||
|         total: 0 | ||||
|       } | ||||
|       tableData: [] | ||||
|     } | ||||
|   }, | ||||
|   computed: { | ||||
|     colConfigs() { | ||||
|       return [ | ||||
|         {prop: '', label: '届次', align: 'left'}, | ||||
|         {prop: '', label: '换届日期', align: 'center'}, | ||||
|         {prop: '', label: '操作时间', align: 'center'}, | ||||
|         {prop: '', label: '操作人', align: 'center'}, | ||||
|         {prop: 'sessionTime', label: '届次', align: 'left'}, | ||||
|         {prop: 'changeTime', label: '换届日期', align: 'center'}, | ||||
|         {prop: 'createTime', label: '操作时间', align: 'center'}, | ||||
|         {prop: 'createUserName', label: '操作人', align: 'center'}, | ||||
|         {slot: 'options'}, | ||||
|       ] | ||||
|     } | ||||
|     }, | ||||
|     oid: v => v.$attrs.selected.id | ||||
|   }, | ||||
|   methods: { | ||||
|     fillupAdd() {}, | ||||
|     reset() {}, | ||||
|     getList() {} | ||||
|     handleEdit(id) { | ||||
|       this.$router.push({hash: "#makeup", query: {id}}) | ||||
|     }, | ||||
|     handleDelete(id) { | ||||
|       this.$confirm("是否要删除该条届次记录?").then(() => { | ||||
|         this.instance.post("/app/apporganizationgeneralelection/delete", null, { | ||||
|           params: {id} | ||||
|         }).then(res => { | ||||
|           if (res?.code == 0) { | ||||
|             this.$message.success("删除成功!") | ||||
|             this.getList() | ||||
|           } | ||||
|         }) | ||||
|       }).catch(() => 0) | ||||
|     }, | ||||
|     getList() { | ||||
|       const {oid: organizationId} = this | ||||
|       this.instance.post("/app/apporganizationgeneralelection/list", null, { | ||||
|         params: {...this.search, organizationId} | ||||
|       }).then(res => { | ||||
|         if (res?.data) { | ||||
|           this.tableData = res.data | ||||
|         } | ||||
|       }) | ||||
|     } | ||||
|   }, | ||||
|   created() { | ||||
|  | ||||
|     this.getList() | ||||
|   }, | ||||
| } | ||||
| </script> | ||||
|   | ||||
| @@ -1,56 +1,64 @@ | ||||
| <template> | ||||
|   <section class="moment"> | ||||
|     <ai-title title="总体概况" class="mar-b8"> | ||||
|       <template slot="rightBtn"> | ||||
|         <el-button size="small" type="text" icon="iconfont iconEdit" @click="toEdit('')">修改</el-button> | ||||
|       </template> | ||||
|     </ai-title> | ||||
|     <ai-wrapper> | ||||
|       <ai-info-item label="本届换届时间" :value="111"/> | ||||
|       <ai-info-item label="换届类型" :value="111"/> | ||||
|       <ai-info-item label="下届换届时间" :value="111"/> | ||||
|       <ai-info-item label="当前届次" :value="111"/> | ||||
|     </ai-wrapper> | ||||
|     <ai-title title="本届任职" class="mar-b8"> | ||||
|       <template slot="rightBtn"> | ||||
|         <el-button size="small" type="text" icon="iconfont iconAdd" @click="dialogJob=true">添加任职人员</el-button> | ||||
|       </template> | ||||
|     </ai-title> | ||||
|     <ai-table | ||||
|         class="detail-table__table" | ||||
|         :tableData="tableData" | ||||
|         :col-configs="colConfigs" | ||||
|         :total="totalJob" | ||||
|         :current.sync="current" | ||||
|         :size.sync="size" | ||||
|         @getList="getJobList"> | ||||
|       <el-table-column slot="options" label="操作" align="center"> | ||||
|         <template slot-scope="{ row }"> | ||||
|           <el-button type="text" @click="jobEdit(row.id)">编辑</el-button> | ||||
|           <el-button type="text" @click="jobDelete(row.id)">删除</el-button> | ||||
|     <template v-if="detail.id"> | ||||
|       <ai-title title="总体概况" class="mar-b8"> | ||||
|         <template slot="rightBtn"> | ||||
|           <el-button size="small" type="text" icon="iconfont iconEdit" @click="toEdit(oid)">修改</el-button> | ||||
|         </template> | ||||
|       </el-table-column> | ||||
|     </ai-table> | ||||
|     <ai-title title="本届候选人" class="mar-b8"> | ||||
|       <template slot="rightBtn"> | ||||
|         <el-button size="small" type="text" icon="iconfont iconAdd" @click="dialogCandidate = true">添加候选人</el-button> | ||||
|       </template> | ||||
|     </ai-title> | ||||
|     <ai-table | ||||
|         class="detail-table__table" | ||||
|         :tableData="tableData" | ||||
|         :col-configs="colConfigs" | ||||
|         :total="totalJob" | ||||
|         :current.sync="current" | ||||
|         :size.sync="size" | ||||
|         @getList="getJobList"> | ||||
|       <el-table-column slot="options" label="操作" align="center"> | ||||
|         <template slot-scope="{ row }"> | ||||
|           <el-button type="text" @click="jobEdit(row.id)">编辑</el-button> | ||||
|           <el-button type="text" @click="jobDelete(row.id)">删除</el-button> | ||||
|       </ai-title> | ||||
|       <ai-wrapper> | ||||
|         <ai-info-item label="本届换届时间" :value="detail.changeTime"/> | ||||
|         <ai-info-item label="换届类型" :value="dict.getLabel('organizationChangeType',detail.type)"/> | ||||
|         <ai-info-item label="下届换届时间" :value="detail.nextChangeTime"/> | ||||
|         <ai-info-item label="当前届次" :value="detail.sessionTime"/> | ||||
|       </ai-wrapper> | ||||
|       <ai-title title="本届任职" class="mar-b8"> | ||||
|         <template slot="rightBtn"> | ||||
|           <el-button size="small" type="text" icon="iconfont iconAdd" @click="dialogJob=true">添加任职人员</el-button> | ||||
|         </template> | ||||
|       </el-table-column> | ||||
|     </ai-table> | ||||
|       </ai-title> | ||||
|       <ai-table | ||||
|           class="detail-table__table" | ||||
|           :tableData="tableData" | ||||
|           :col-configs="colConfigs" | ||||
|           :total="totalJob" | ||||
|           :current.sync="current" | ||||
|           :size.sync="size" | ||||
|           @getList="getJobList"> | ||||
|         <el-table-column slot="options" label="操作" align="center"> | ||||
|           <template slot-scope="{ row }"> | ||||
|             <el-button type="text" @click="jobEdit(row.id)">编辑</el-button> | ||||
|             <el-button type="text" @click="jobDelete(row.id)">删除</el-button> | ||||
|           </template> | ||||
|         </el-table-column> | ||||
|       </ai-table> | ||||
|       <ai-title title="本届候选人" class="mar-b8"> | ||||
|         <template slot="rightBtn"> | ||||
|           <el-button size="small" type="text" icon="iconfont iconAdd" @click="dialogCandidate = true">添加候选人</el-button> | ||||
|         </template> | ||||
|       </ai-title> | ||||
|       <ai-table | ||||
|           class="detail-table__table" | ||||
|           :tableData="tableData" | ||||
|           :col-configs="colConfigs" | ||||
|           :total="totalJob" | ||||
|           :current.sync="current" | ||||
|           :size.sync="size" | ||||
|           @getList="getJobList"> | ||||
|         <el-table-column slot="options" label="操作" align="center"> | ||||
|           <template slot-scope="{ row }"> | ||||
|             <el-button type="text" @click="jobEdit(row.id)">编辑</el-button> | ||||
|             <el-button type="text" @click="jobDelete(row.id)">删除</el-button> | ||||
|           </template> | ||||
|         </el-table-column> | ||||
|       </ai-table> | ||||
|     </template> | ||||
|     <ai-empty> | ||||
|       <div>暂无换届信息</div> | ||||
|       <el-row type="flex" justify="center" class="mar-t8"> | ||||
|         <ai-highlight content="请点击【@v】完善基础内容后,再进行后续操作" value="换届设置"/> | ||||
|       </el-row> | ||||
|     </ai-empty> | ||||
|     <ai-dialog :visible.sync="dialogJob" title="添加本届任职人" width="720px" @closed="jobForm={}" @onConfirm="handleJobForm"> | ||||
|       <el-form ref="jobForm" size="small" :model="jobForm" :rules="jobRules" label-width="80px"> | ||||
|         <el-form-item label="职位" prop="job"> | ||||
| @@ -77,15 +85,10 @@ | ||||
| <script> | ||||
| export default { | ||||
|   name: "moment", | ||||
|   props: { | ||||
|     instance: Function, | ||||
|     permissions: Function, | ||||
|     dict: Object, | ||||
|     selected: Object, | ||||
|   }, | ||||
|   inject: ['permissions', 'instance', 'dict'], | ||||
|   data() { | ||||
|     return { | ||||
|       isEdit: false, | ||||
|       detail: {}, | ||||
|       tableData: [], | ||||
|       totalJob: 0, | ||||
|       current: 1, | ||||
| @@ -121,10 +124,11 @@ export default { | ||||
|         job: [{required: true, message: "请输入职位"}], | ||||
|         name: [{required: true, message: "请输入姓名"}], | ||||
|       } | ||||
|     } | ||||
|     }, | ||||
|     oid: v => v.$attrs.selected.id | ||||
|   }, | ||||
|   mounted() { | ||||
|     this.getList(this.selected.id) | ||||
|   created() { | ||||
|     this.getList() | ||||
|   }, | ||||
|   methods: { | ||||
|     jobEdit() { | ||||
| @@ -136,10 +140,13 @@ export default { | ||||
|     toEdit(id) { | ||||
|       this.$router.push({hash: "#add", query: {id}}) | ||||
|     }, | ||||
|     getList(id) { | ||||
|       this.instance.post(`/app/apporganizationgeneralelection/queryDetailByOrganizationId?organizationId=${id}`).then(res => { | ||||
|     getList() { | ||||
|       const {oid: organizationId} = this | ||||
|       organizationId && this.instance.post(`/app/apporganizationgeneralelection/queryDetailByOrganizationId`, null, { | ||||
|         params: {organizationId} | ||||
|       }).then(res => { | ||||
|         if (res?.data) { | ||||
|           console.log(res, '111'); | ||||
|           this.detail = res.data | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|   | ||||
| @@ -1,90 +1,45 @@ | ||||
| <template> | ||||
|   <section class="organizationSetting"> | ||||
|     <!-- <ai-detail class="add" v-if="id && !isEdit"> | ||||
|       <template slot="title"> | ||||
|         <ai-title title="换届选举详情" isShowBack isShowBottomBorder @onBackClick="cancel(false)"></ai-title> | ||||
|       </template> | ||||
|       <template slot="content"> | ||||
|         <ai-card title="基本信息"> | ||||
|           <template #right> | ||||
|             <span style="color:#2266FF;cursor: pointer;font-size: 12px;" class="iconfont iconEdit" v-if="isEdit==false" @click="isEdit = true">修改</span> | ||||
|           </template> | ||||
|           <template #content v-if="isEdit == false"> | ||||
|             <ai-wrapper> | ||||
|               <ai-info-item label="标题" :value="info.title"></ai-info-item> | ||||
|               <ai-info-item label="投票说明" :value="info.votingInstructions"></ai-info-item> | ||||
|               <ai-info-item label="单位名称" :value="info.organizationName"></ai-info-item> | ||||
|               <ai-info-item label="选举方式"> | ||||
|                 {{ info.electionMethod==0? '等额':'差额'}} | ||||
|                 <el-tooltip class="item" effect="dark" content="差额选举:候选人数多于应选人数的选举方式; | ||||
|                   等额选举:候选人数与应选人数相等的选举方式。" placement="top"> | ||||
|                   <i class="el-icon-info" style="margin-right: 8px"></i> | ||||
|                 </el-tooltip> | ||||
|               </ai-info-item> | ||||
|               <ai-info-item label="应选人数" :value="info.candidatesNumber"></ai-info-item> | ||||
|               <ai-info-item label="投票日期" :value="info.votingDate"></ai-info-item> | ||||
|               <ai-info-item label="候选人" isLine> | ||||
|                 <span v-for="(item,index) in candidateUsersList" :key="index"> | ||||
|                   {{ item }} | ||||
|                   <span v-if="index < candidateUsersList.length - 1">、</span> | ||||
|                 </span> | ||||
|               </ai-info-item> | ||||
|               <ai-info-item label="投票人" isLine :value="info.voteUsers"> | ||||
|                 <span v-for="(item,index) in voteUsersList" :key="index"> | ||||
|                   {{ item }} | ||||
|                   <span v-if="index < voteUsersList.length - 1">、</span> | ||||
|                 </span> | ||||
|               </ai-info-item> | ||||
|             </ai-wrapper> | ||||
|           </template> | ||||
|         </ai-card> | ||||
|       </template> | ||||
|     </ai-detail> --> | ||||
|     <ai-detail> | ||||
|       <ai-title slot="title" title="换届设置" isShowBottomBorder isShowBack @onBackClick="cancel(true)"/> | ||||
|       <template slot="content"> | ||||
|         <ai-card title="基本信息"> | ||||
|           <template #content> | ||||
|             <div class="tips"> | ||||
|               <i class="el-icon-warning"></i> | ||||
|               系统将在下次换届时间开始前,对“换届提醒人”进行提醒。提醒方式包括平台消息推送、短信提醒。 | ||||
|             </div> | ||||
|             <div class="add-form"> | ||||
|               <el-form ref="form" :model="form" :rules="formRules" size="small" label-width="150px"> | ||||
|                 <el-form-item label="单位名称"> | ||||
|                   <div>{{ user.info.organizationName }}</div> | ||||
|                 </el-form-item> | ||||
|  | ||||
|                 <el-form-item label="成立时间"> | ||||
|                   <div>{{ createTime }}</div> | ||||
|                 </el-form-item> | ||||
|  | ||||
|                 <el-form-item label="换届类型" prop="type"> | ||||
|                   <el-radio v-model="form.type" label="0">三年换届</el-radio> | ||||
|                   <el-radio v-model="form.type" label="1">五年换届</el-radio> | ||||
|                 </el-form-item> | ||||
|  | ||||
|                 <el-form-item label="单位名称" prop="organizationName"> | ||||
|                   <el-input size="small" disabled placeholder="请选择所属党组织" v-model="form.organizationName"> | ||||
|                     <template slot="append"> | ||||
|                       <ai-party :instance="instance" size="small" :value="form.organizationId" @origin="handlePartyOrgSelect"/> | ||||
|                     </template> | ||||
|                   </el-input> | ||||
|                 </el-form-item> | ||||
|  | ||||
|                 <el-form-item label="换届提醒人" prop="userList"> | ||||
|                   <ai-person-select :instance="instance" :customClicker="true" :chooseUserList="chooseUserList" | ||||
|                                     :url="`/app/appparty/list?partyOrgId=${form.organizationId}`" headerTitle="党员列表" | ||||
|                                     :isMultiple="true" dialogTitle="选择抄送人" @selectPerson="selectUser" class="aipersonselect"> | ||||
|                     <template name="option" v-slot:option="{ item }"> | ||||
|                       <span class="iconfont iconProlife">{{ item.name }}</span> | ||||
|                     </template> | ||||
|                   </ai-person-select> | ||||
|                 </el-form-item> | ||||
|               </el-form> | ||||
|             </div> | ||||
|           </template> | ||||
|         </ai-card> | ||||
|         <el-form ref="SettingForm" :model="form" :rules="formRules" size="small" label-width="150px"> | ||||
|           <ai-card title="基本信息"> | ||||
|             <template #content> | ||||
|               <div class="tips"> | ||||
|                 <i class="el-icon-warning"></i> | ||||
|                 系统将在下次换届时间开始前,对“换届提醒人”进行提醒。提醒方式包括平台消息推送、短信提醒。 | ||||
|               </div> | ||||
|               <el-form-item label="单位名称">{{ org.name }}</el-form-item> | ||||
|               <el-form-item label="成立时间">{{ $dateFormat(org.createTime) }}</el-form-item> | ||||
|               <el-form-item label="换届类型" prop="type"> | ||||
|                 <el-radio v-model="form.type" label="0">三年换届</el-radio> | ||||
|                 <el-radio v-model="form.type" label="1">五年换届</el-radio> | ||||
|               </el-form-item> | ||||
|               <el-form-item label="换届提醒人" prop="userList"> | ||||
|                 <ai-person-select :instance="instance" :customClicker="true" :chooseUserList="chooseUserList" | ||||
|                                   :url="`/app/appparty/list?partyOrgId=${org.id}`" headerTitle="党员列表" | ||||
|                                   :isMultiple="true" dialogTitle="选择抄送人" @selectPerson="selectUser" class="aipersonselect"> | ||||
|                   <template name="option" v-slot:option="{ item }"> | ||||
|                     <span class="iconfont iconProlife">{{ item.name }}</span> | ||||
|                   </template> | ||||
|                 </ai-person-select> | ||||
|               </el-form-item> | ||||
|             </template> | ||||
|           </ai-card> | ||||
|           <ai-card v-if="isInit" title="届次设置"> | ||||
|             <el-form-item label="本届换届时间:" prop="changeTime"> | ||||
|               <el-date-picker v-model="form.changeTime"/> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="下届换届时间:" prop="nextChangeTime"> | ||||
|               <el-date-picker disabled v-model="form.nextChangeTime"/> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="届次:" prop="sessionTime"> | ||||
|               <el-input v-model="form.sessionTime" placeholder="请输入..."/> | ||||
|             </el-form-item> | ||||
|             <detail-panel :instance="instance" v-model="lists" editable/> | ||||
|           </ai-card> | ||||
|         </el-form> | ||||
|       </template> | ||||
|       <template slot="footer" class="footer"> | ||||
|         <el-button class="delete-btn footer-btn" @click="cancel(false)">取消</el-button> | ||||
| @@ -97,14 +52,12 @@ | ||||
|  | ||||
| <script> | ||||
| import {mapState} from 'vuex' | ||||
| import DetailPanel from "./detailPanel"; | ||||
|  | ||||
| export default { | ||||
|   name: "organizationSetting", | ||||
|   props: { | ||||
|     instance: Function, | ||||
|     dict: Object, | ||||
|   }, | ||||
|  | ||||
|   components: {DetailPanel}, | ||||
|   inject: ['permissions', 'instance', 'dict'], | ||||
|   data() { | ||||
|     let validUser = (rule, value, callback) => { | ||||
|       if (!value.length) { | ||||
| @@ -115,47 +68,46 @@ export default { | ||||
|     }; | ||||
|     return { | ||||
|       form: { | ||||
|         addOrMakeup: true, | ||||
|         organizationId: '', | ||||
|         organizationName: '', | ||||
|         type: '0', | ||||
|         type: "", | ||||
|         userList: [], | ||||
|         sessionTime: "", | ||||
|         changeTime: "", | ||||
|         nextChangeTime: "" | ||||
|       }, | ||||
|       lists: { | ||||
|         candidateList: [],     //本届候选人 | ||||
|         serveList: []          //本届任职 | ||||
|       }, | ||||
|       formRules: { | ||||
|         type: [{required: true, message: "请选择选举方式", trigger: "blur"}], | ||||
|         organizationName: [{required: true, message: "请选择党组织", trigger: "blur"}], | ||||
|         userList: [{required: true, validator: validUser, trigger: "blur"}], | ||||
|       }, | ||||
|       chooseUserList: [], | ||||
|       createTime: '', | ||||
|       org: null | ||||
|     } | ||||
|   }, | ||||
|   computed: { | ||||
|     ...mapState(['user']) | ||||
|     ...mapState(['user']), | ||||
|     isInit: v => !!v.form.id, | ||||
|     isNew: v => v.$route.query.new | ||||
|   }, | ||||
|   created() { | ||||
|     this.getDetail() | ||||
|     this.getOrganization() | ||||
|     this.org = new this.MODEL.PartyOrg(this.$route.query.oid) | ||||
|     !this.isNew && this.getDetail() | ||||
|   }, | ||||
|   methods: { | ||||
|     cancel() { | ||||
|       this.$router.back() | ||||
|     }, | ||||
|     // 查询组织关系 | ||||
|     getOrganization() { | ||||
|       this.instance.post(`/app/partyOrganization/queryPartyOrganizationServiceList`).then(res => { | ||||
|         if (res?.data) { | ||||
|           let data = res.data.filter(item => item.id == this.user.info.organizationId) | ||||
|           this.createTime = data[0].createTime | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|     getDetail() { | ||||
|       this.instance.post(`/app/apporganizationchangeconfig/queryDetailByOrganizationId?organizationId=${this.user.info.organizationId}`).then((res) => { | ||||
|       const {oid: organizationId} = this.$route.query | ||||
|       this.instance.post(`/app/apporganizationchangeconfig/queryDetailByOrganizationId`, null, { | ||||
|         params: {organizationId} | ||||
|       }).then((res) => { | ||||
|         if (res?.data) { | ||||
|           // this.chooseCandidateList = res.data.candidateUsers | ||||
|           // this.chooseVoteList = res.data.voteUsers | ||||
|           console.log(res); | ||||
|           this.form = res.data | ||||
|           let {candidateList, serveList} = this.form | ||||
|           this.lists = {candidateList, serveList} | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
| @@ -165,26 +117,20 @@ export default { | ||||
|     selectVote(e) { | ||||
|       this.form.voteUsers = e | ||||
|     }, | ||||
|     handlePartyOrgSelect(v) { | ||||
|       if (v) { | ||||
|         this.form.organizationId = v[0]?.id | ||||
|         this.form.organizationName = v[0]?.name | ||||
|  | ||||
|       } | ||||
|     }, | ||||
|     confirm() { | ||||
|       // 换届设置 | ||||
|       this.$refs.form.validate((valid) => { | ||||
|         if (valid) { | ||||
|           this.instance.post(`/app/apporganizationchangeconfig/update`, { | ||||
|             ...this.form | ||||
|       this.$refs.SettingForm.validate(v => { | ||||
|         if (v) { | ||||
|           const {id: organizationId, name: organizationName} = this.org | ||||
|           const action = `/app/apporganizationchangeconfig/${this.isInit ? 'update' : 'add'}` | ||||
|           this.instance.post(action, { | ||||
|             addOrMakeup: true, | ||||
|             ...this.form, organizationId, organizationName | ||||
|           }).then(res => { | ||||
|             if (res.code == 0) { | ||||
|               this.$message.success('提交成功') | ||||
|               this.cancel(true) | ||||
|             } | ||||
|           }).catch((err) => { | ||||
|             console.log(err); | ||||
|           }) | ||||
|         } | ||||
|       }) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user