列表
This commit is contained in:
		| @@ -7,26 +7,28 @@ | ||||
|       <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="edit">修改</span> | ||||
|             <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="选举方式" :value="info.electionMethod"></ai-info-item> | ||||
|               <ai-info-item label="选举方式"> | ||||
|                 {{ info.electionMethod==0? '等额':'差额'}} | ||||
|               </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 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 v-if="index < voteUsersList.length - 1">、</span> | ||||
|                 </span> | ||||
|               </ai-info-item> | ||||
|             </ai-wrapper> | ||||
| @@ -34,7 +36,7 @@ | ||||
|         </ai-card> | ||||
|       </template> | ||||
|     </ai-detail> | ||||
|     <ai-detail v-else> | ||||
|     <ai-detail v-if="!id || isEdit"> | ||||
|       <ai-title slot="title" :title="id? '编辑换届选举':'添加换届选举'" isShowBottomBorder isShowBack @onBackClick="cancel(true)"/> | ||||
|       <template slot="content"> | ||||
|         <ai-card title="基本信息"> | ||||
| @@ -64,14 +66,14 @@ | ||||
|                     <i class="el-icon-info" style="margin-right: 8px"></i> | ||||
|                   </el-tooltip> | ||||
|                    | ||||
|                   <el-radio v-model="form.electionMethod" label="1">等额</el-radio> | ||||
|                   <el-radio v-model="form.electionMethod" label="2">差额</el-radio> | ||||
|                   <el-radio v-model="form.electionMethod" label="0">等额</el-radio> | ||||
|                   <el-radio v-model="form.electionMethod" label="1">差额</el-radio> | ||||
|                 </el-form-item> | ||||
|                  | ||||
|                 <el-row type="flex"> | ||||
|                   <el-col :span="20"> | ||||
|                     <el-form-item label="应选人数" prop="candidatesNumber"> | ||||
|                       <el-input type="number" v-model="form.candidatesNumber" placeholder="请输入"></el-input> | ||||
|                     <el-form-item label="应选人数" prop="chooseNumber"> | ||||
|                       <el-input type="number" v-model="form.chooseNumber" placeholder="请输入"></el-input> | ||||
|                     </el-form-item> | ||||
|                   </el-col> | ||||
|                   <el-col :span="20"> | ||||
| @@ -89,7 +91,7 @@ | ||||
|                     <template name="option" v-slot:option="{ item }"> | ||||
|                       <span class="iconfont iconProlife">{{ item.name }}</span> | ||||
|                       <span>{{ item.phone }}</span> | ||||
|                       <!-- <span>{{ item}}</span> --> | ||||
|                       <span>{{ item}}</span> | ||||
|                     </template> | ||||
|                   </ai-person-select> | ||||
|                 </el-form-item> | ||||
| @@ -148,7 +150,7 @@ export default { | ||||
|         votingInstructions: '', | ||||
|         organizationName: '', | ||||
|         electionMethod: '', | ||||
|         candidatesNumber: '', | ||||
|         chooseNumber: '', | ||||
|         votingDate: '', | ||||
|         candidateUsers: [], | ||||
|         voteUsers: [], | ||||
| @@ -159,7 +161,7 @@ export default { | ||||
|         title: [{required: true, message: "请输入标题", trigger: "blur"}], | ||||
|         organizationName: [{required: true, message: "请选择党组织", trigger: "blur"}], | ||||
|         electionMethod: [{required: true, message: "请选择选举方式", trigger: "blur"}], | ||||
|         candidatesNumber: [{required: true, message: "请输入应选人数", trigger: "blur"}], | ||||
|         chooseNumber: [{required: true, message: "请输入应选人数", trigger: "blur"}], | ||||
|         votingDate: [{required: true, message: "请选择投票日期", trigger: "blur"}], | ||||
|         candidateUsers: [{required: true,validator: validCandidate, trigger: "blur"}], | ||||
|         voteUsers: [{required: true,validator: validVote, trigger: "blur"}], | ||||
| @@ -192,15 +194,15 @@ export default { | ||||
|         params: {id:this.id} | ||||
|       }).then((res) => { | ||||
|         if(res?.data) { | ||||
|           // console.log(res.data); | ||||
|           this.form = res.data, | ||||
|           console.log(res.data,'getDetail'); | ||||
|           this.form = res.data | ||||
|           this.form.organizationName = res.data.partyOrganizations[0].name | ||||
|           this.info = res.data | ||||
|           this.candidateUsersList = res.data.candidateUsers.map(v=> v.name) | ||||
|           this.voteUsersList = res.data.voteUsers.map(v=> v.name) | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|     edit() {}, | ||||
|     selectCandidate(v) { | ||||
|       this.form.candidateUsers = v | ||||
|     }, | ||||
| @@ -223,12 +225,8 @@ export default { | ||||
|               ...this.form | ||||
|             }).then(res => { | ||||
|               if(res.code == 0) { | ||||
|                 if(this.id) { | ||||
|                   this.$message.success('编辑成功') | ||||
|                 } else { | ||||
|                   this.$message.success('新增成功') | ||||
|                 } | ||||
|                 this.cancel(false) | ||||
|                 this.$message.success(this.id ? '编辑成功' : '新增成功') | ||||
|                 this.cancel(true) | ||||
|               } | ||||
|             }).catch((err) => { | ||||
|               console.log(err); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user