群众留言完成
This commit is contained in:
		| @@ -24,7 +24,7 @@ export default { | ||||
|     } | ||||
|   }, | ||||
|   created() { | ||||
|     this.dict.load("leaveMessageType","yesOrNo") | ||||
|     this.dict.load("leaveMessageType", "yesOrNo", "msgStatus") | ||||
|   } | ||||
| } | ||||
| </script> | ||||
|   | ||||
| @@ -1,10 +1,10 @@ | ||||
| <template> | ||||
|   <section class="mmDetail"> | ||||
|     <ai-detail> | ||||
|       <ai-title slot="title" title="留言详情" isShowBottomBorder isShowBack @onBackClick="$router.push({query:{}})"> | ||||
|         <template #rightBtn> | ||||
|           <el-button type="primary">回复留言</el-button> | ||||
|           <el-button>关闭留言</el-button> | ||||
|       <ai-title slot="title" title="留言详情" isShowBottomBorder isShowBack @onBackClick="back"> | ||||
|         <template #rightBtn v-if="!isClosed"> | ||||
|           <el-button type="primary" @click="dialog=true">回复留言</el-button> | ||||
|           <el-button @click="handleCloseMass(detail.id)">关闭留言</el-button> | ||||
|         </template> | ||||
|       </ai-title> | ||||
|       <template #content> | ||||
| @@ -38,6 +38,13 @@ | ||||
|         </el-form> | ||||
|       </template> | ||||
|     </ai-detail> | ||||
|     <ai-dialog :visible.sync="dialog" title="回复留言" width="500px" @onConfirm="submit"> | ||||
|       <el-form size="small" :model="form" :rules="rules" label-width="80px" ref="ReplyForm"> | ||||
|         <el-form-item label="回复内容" prop="content"> | ||||
|           <el-input type="textarea" v-model="form.content" rows="4" clearable placeholder="请输入回复内容"/> | ||||
|         </el-form-item> | ||||
|       </el-form> | ||||
|     </ai-dialog> | ||||
|   </section> | ||||
| </template> | ||||
|  | ||||
| @@ -62,11 +69,19 @@ export default { | ||||
|         0: "留言", | ||||
|         1: "回复" | ||||
|       } | ||||
|     }, | ||||
|     isClosed() { | ||||
|       return this.detail.status == 2 | ||||
|     } | ||||
|   }, | ||||
|   data() { | ||||
|     return { | ||||
|       detail: {}, | ||||
|       dialog: false, | ||||
|       form: {}, | ||||
|       rules: { | ||||
|         content: [{required: true, message: "请输入回复内容"}] | ||||
|       } | ||||
|     } | ||||
|   }, | ||||
|   methods: { | ||||
| @@ -80,6 +95,34 @@ export default { | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|     back() { | ||||
|       this.$router.push({}) | ||||
|     }, | ||||
|     handleCloseMass(id) { | ||||
|       this.$confirm("是否要关闭留言?").then(() => { | ||||
|         this.instance.post("/appleavemessage/close", null, { | ||||
|           params: {id} | ||||
|         }).then(res => { | ||||
|           if (res?.code == 0) { | ||||
|             this.$message.success("关闭成功") | ||||
|             this.back() | ||||
|           } | ||||
|         }) | ||||
|       }).catch(() => 0) | ||||
|     }, | ||||
|     submit() { | ||||
|       this.$refs.ReplyForm.validate(v => { | ||||
|         if (v) { | ||||
|           let {id: messageId} = this.detail | ||||
|           this.instance.post("/appleavemessagereply/addOrUpdate", {...this.form, messageId, userType: 1}).then(res => { | ||||
|             if (res?.code == 0) { | ||||
|               this.$message.success("提交成功!") | ||||
|               this.back() | ||||
|             } | ||||
|           }) | ||||
|         } | ||||
|       }) | ||||
|     } | ||||
|   }, | ||||
|   created() { | ||||
|     this.getDetail() | ||||
|   | ||||
| @@ -5,8 +5,10 @@ | ||||
|       <template #content> | ||||
|         <ai-search-bar> | ||||
|           <template #left> | ||||
|             <ai-select v-model="search.type" placeholder="留言状态"/> | ||||
|             <ai-select v-model="search.type" placeholder="留言类型"/> | ||||
|             <ai-select v-model="search.status" placeholder="留言状态" :selectList="dict.getDict('msgStatus')" | ||||
|                        @change="page.current=1,getTableData()"/> | ||||
|             <ai-select v-model="search.type" placeholder="留言类型" :selectList="dict.getDict('leaveMessageType')" | ||||
|                        @change="page.current=1,getTableData()"/> | ||||
|           </template> | ||||
|           <template #right> | ||||
|             <el-input size="small" placeholder="搜索企业名称、法人姓名、登录账号" v-model="search.enterpriseName" clearable | ||||
| @@ -17,8 +19,8 @@ | ||||
|                   @getList="getTableData" :col-configs="colConfigs" :dict="dict"> | ||||
|           <el-table-column slot="options" label="操作" fixed="right" align="center"> | ||||
|             <template slot-scope="{row}"> | ||||
|               <el-button v-if="row.isPublic==0" type="text" @click="handleEnable(row)">公示</el-button> | ||||
|               <el-button v-else-if="row.isPublic==1" type="text" @click="handleEnable(row)">取消公示</el-button> | ||||
|               <el-button v-if="row.isOpen==0" type="text" @click="handleEnable(row)">公示</el-button> | ||||
|               <el-button v-else-if="row.isOpen==1" type="text" @click="handleEnable(row)">取消公示</el-button> | ||||
|               <el-button type="text" @click="showDetail(row.id)">详情</el-button> | ||||
|             </template> | ||||
|           </el-table-column> | ||||
| @@ -53,7 +55,7 @@ export default { | ||||
|         {label: "留言人", prop: "leaveName"}, | ||||
|         {label: "留言提交时间", prop: "createTime"}, | ||||
|         {label: "最后回复时间", prop: "lastReplyTime"}, | ||||
|         {label: "是否公示", prop: "isPublic",dict:"yesOrNo"}, | ||||
|         {label: "是否公示", prop: "isOpen", dict: "yesOrNo", align: 'center'}, | ||||
|         {slot: "options"} | ||||
|       ] | ||||
|     } | ||||
| @@ -73,11 +75,13 @@ export default { | ||||
|       this.$router.push({query: {id}}) | ||||
|     }, | ||||
|     handleEnable(row) { | ||||
|       let status = (Number(row.status) + 1) % 2 | ||||
|       this.$confirm(`是否要${this.dict.getLabel('portalUserStatus', status)}留言?`).then(() => { | ||||
|         this.instance.post("/appportaluser/addOrUpdate", {...row, status}).then(res => { | ||||
|       let openLabel = row.isOpen == 1 ? "取消公示" : "公示", isOpen = (Number(row.isOpen) + 1) % 2 | ||||
|       this.$confirm(`是否要${openLabel}留言?`).then(() => { | ||||
|         this.instance.post("/appleavemessage/setIsOpen", null, { | ||||
|           params: {id: row.id, isOpen} | ||||
|         }).then(res => { | ||||
|           if (res?.code == 0) { | ||||
|             this.$message.success(this.dict.getLabel('portalUserStatus', status) + "成功!") | ||||
|             this.$message.success(openLabel + "成功!") | ||||
|             this.getTableData() | ||||
|           } | ||||
|         }) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user