驻村辅警
This commit is contained in:
		| @@ -60,7 +60,7 @@ | ||||
|         :current.sync="search.current" | ||||
|         :size.sync="search.size" | ||||
|         @getList="getList"> | ||||
|         <el-table-column slot="isPublic" label="标签"> | ||||
|         <el-table-column slot="isPublic" label="是否公开"> | ||||
|           <template slot-scope="{ row }"> | ||||
|             <el-switch | ||||
|               v-model="row.isPublic" | ||||
| @@ -115,8 +115,8 @@ | ||||
|           {prop: 'name', label: '名称', align: 'left'}, | ||||
|           {prop: 'type', label: '类型', align: 'center'}, | ||||
|           {prop: 'phone', label: '联系方式', align: 'center'}, | ||||
|           {prop: 'createTime', label: '创建时间'}, | ||||
|           {slot: 'isPublic', label: '是否公开'}, | ||||
|           {prop: 'createTime', align: 'center', label: '创建时间'}, | ||||
|           {slot: 'isPublic', label: '是否公开', align: 'center'}, | ||||
|           {slot: 'options', label: '操作'} | ||||
|         ], | ||||
|         areaName: '', | ||||
|   | ||||
| @@ -8,23 +8,28 @@ | ||||
|       <ai-card title="基本信息"> | ||||
|         <template #content> | ||||
|           <el-form ref="form" class="ai-form" :model="form" label-width="110px" label-position="right"> | ||||
|             <el-form-item label="地区" style="width: 100%;" prop="codeName"> | ||||
|             <el-form-item label="服务区域" style="width: 100%;" prop="codeName"> | ||||
|               <span style="color: #666;">{{ form.areaName }}</span> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="名称" prop="codeName" :rules="[{ required: true, message: '请输入名称', trigger: 'blur' }]"> | ||||
|               <el-input size="small" placeholder="请输入名称" v-model="form.codeName"></el-input> | ||||
|             <el-form-item style="width: 100%" label="名称" prop="name" :rules="[{ required: true, message: '请输入名称', trigger: 'blur' }]"> | ||||
|               <el-input size="small" placeholder="请输入名称" v-model="form.name"></el-input> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="联系方式" prop="codeName" :rules="[{ required: true, message: '请输入电话', trigger: 'blur' }]"> | ||||
|               <el-input size="small" placeholder="请输入联系方式" maxlength="20" v-model="form.codeName"></el-input> | ||||
|             <el-form-item style="width: 100%" label="电话" prop="phone" :rules="[{ required: true, message: '请输入电话', trigger: 'blur' }]"> | ||||
|               <el-input size="small" placeholder="请输入电话" maxlength="20" v-model="form.phone"></el-input> | ||||
|             </el-form-item> | ||||
|             <el-form-item style="width: 100%;" label="是否公开" prop="type" :rules="[{ required: true, message: '请选择是否公开', trigger: 'change' }]"> | ||||
|               <el-radio-group v-model="form.type"> | ||||
|                 <el-radio label="0">否</el-radio> | ||||
|             <el-form-item style="width: 100%;" label="是否公开" prop="isPublic" :rules="[{ required: true, message: '请选择是否公开', trigger: 'change' }]"> | ||||
|               <el-radio-group v-model="form.isPublic"> | ||||
|                 <el-radio label="1">是</el-radio> | ||||
|                 <el-radio label="0">否</el-radio> | ||||
|               </el-radio-group> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="图片" prop="codeName" :rules="[{ required: true, message: '请输入电话', trigger: 'blur' }]"> | ||||
|               <ai-uploader :limit="1" v-model="form.img" :instance="instance" ></ai-uploader> | ||||
|             <el-form-item label="图片" style="width: 100%;" prop="picture"> | ||||
|               <ai-uploader | ||||
|                 :instance="instance" | ||||
|                 isShowTip | ||||
|                 v-model="form.picture" | ||||
|                 :limit="1"> | ||||
|               </ai-uploader> | ||||
|             </el-form-item> | ||||
|           </el-form> | ||||
|         </template> | ||||
| @@ -52,12 +57,11 @@ | ||||
|         info: {}, | ||||
|         form: { | ||||
|           areaId: '', | ||||
|           codeName: '', | ||||
|           name: '', | ||||
|           areaName: '', | ||||
|           code: '', | ||||
|           img: [], | ||||
|           codeUrl: [], | ||||
|           type: '', | ||||
|           phone: '', | ||||
|           picture: [], | ||||
|           isPublic: '1' | ||||
|         }, | ||||
|         id: '', | ||||
|         areaList: [] | ||||
| @@ -65,9 +69,6 @@ | ||||
|     }, | ||||
|  | ||||
|     created () { | ||||
|       this.dict.load('homeConfigMenuType').then(() => { | ||||
|  | ||||
|       }) | ||||
|       this.getAreaList() | ||||
|  | ||||
|       if (this.params && this.params.areaId && !this.params.id) { | ||||
| @@ -83,12 +84,10 @@ | ||||
|  | ||||
|     methods: { | ||||
|       getInfo (id) { | ||||
|         this.instance.post(`/app/appeveryvillagecode/queryDetailById?id=${id}`).then(res => { | ||||
|         this.instance.post(`/app/appvillageauxiliarypolice/queryDetailById?id=${id}`).then(res => { | ||||
|           if (res.code === 0) { | ||||
|             this.form = res.data | ||||
|             this.form.codeUrl = [{ | ||||
|               url: res.data.codeUrl | ||||
|             }] | ||||
|             this.form.picture = res.data.picture ? [{url: res.data.picture}] : [] | ||||
|           } | ||||
|         }) | ||||
|       }, | ||||
| @@ -113,9 +112,10 @@ | ||||
|       confirm () { | ||||
|         this.$refs.form.validate((valid) => { | ||||
|           if (valid) { | ||||
|             this.instance.post(`/app/appeveryvillagecode/addOrUpdate`, { | ||||
|             this.instance.post(`/app/appvillageauxiliarypolice/addOrUpdate`, { | ||||
|               ...this.form, | ||||
|               codeUrl: this.form.codeUrl[0].url | ||||
|               id: this.params.id || '', | ||||
|               picture: this.form.picture ? this.form.picture[0].url : '' | ||||
|             }).then(res => { | ||||
|               if (res.code == 0) { | ||||
|                 this.$message.success('提交成功') | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| <template> | ||||
|   <ai-list class="villagecode"> | ||||
|     <template slot="title"> | ||||
|       <ai-title title="便民通讯录" isShowBottomBorder></ai-title> | ||||
|       <ai-title title="驻村辅警" isShowBottomBorder></ai-title> | ||||
|     </template> | ||||
|     <template #left> | ||||
|       <div class="villagecode-left"> | ||||
| @@ -36,7 +36,20 @@ | ||||
|     <template slot="content"> | ||||
|       <ai-search-bar class="search-bar"> | ||||
|         <template #left> | ||||
|           <el-button size="small" type="primary" :disabled="isShowAdd" icon="iconfont iconAdd" @click="toAdd('')">添加</el-button> | ||||
|           <el-button size="small" type="primary" icon="iconfont iconAdd" @click="toAdd('')">添加</el-button> | ||||
|         </template> | ||||
|         <template slot="right"> | ||||
|           <el-input | ||||
|             v-model="search.name" | ||||
|             class="search-input" | ||||
|             size="small" | ||||
|             @keyup.enter.native="search.current = 1, getList()" | ||||
|             placeholder="请输入名称/电话" | ||||
|             clearable | ||||
|             @change="getList" | ||||
|             @clear="search.current = 1, search.name = '', getList()" | ||||
|             suffix-icon="iconfont iconSearch"> | ||||
|           </el-input> | ||||
|         </template> | ||||
|       </ai-search-bar> | ||||
|       <ai-table | ||||
| @@ -47,27 +60,19 @@ | ||||
|         :current.sync="search.current" | ||||
|         :size.sync="search.size" | ||||
|         @getList="getList"> | ||||
|         <el-table-column slot="tags" label="标签"> | ||||
|         <el-table-column slot="isPublic" label="是否公开"> | ||||
|           <template slot-scope="{ row }"> | ||||
|             <div class="table-tags"> | ||||
|               <el-tag type="info" v-for="(item, index) in row.tags" size="small" :key="index">{{ item }}</el-tag> | ||||
|             </div> | ||||
|             <el-switch | ||||
|               v-model="row.isPublic" | ||||
|               active-value="1" | ||||
|               @change="e => onChange(row.id, e)" | ||||
|               inactive-value="0"> | ||||
|             </el-switch> | ||||
|           </template> | ||||
|         </el-table-column> | ||||
|         <el-table-column slot="options" width="180px" fixed="right" label="操作" align="center"> | ||||
|           <template slot-scope="{ row }"> | ||||
|             <div class="table-options"> | ||||
|               <el-popover | ||||
|                   placement="bottom" | ||||
|                   width="160" | ||||
|                   :visible-arrow="false" | ||||
|                   popper-class="wechat-message__container" | ||||
|                   trigger="hover"> | ||||
|                 <el-button type="text" slot="reference">二维码</el-button> | ||||
|                 <div style="font-size: 0;"> | ||||
|                   <img class="message-info__img" :src="row.codeUrl"> | ||||
|                 </div> | ||||
|               </el-popover> | ||||
|               <el-button type="text" @click="toAdd(row.id)">编辑</el-button> | ||||
|               <el-button type="text" @click="remove(row.id)">删除</el-button> | ||||
|             </div> | ||||
| @@ -93,8 +98,7 @@ | ||||
|         search: { | ||||
|           current: 1, | ||||
|           size: 10, | ||||
|           status: 0, | ||||
|           title: '', | ||||
|           name: '', | ||||
|           areaId: '' | ||||
|         }, | ||||
|         defaultExpanded: [], | ||||
| @@ -108,10 +112,11 @@ | ||||
|         areaList: [], | ||||
|         total: 10, | ||||
|         colConfigs: [ | ||||
|           {prop: 'codeName', label: '名称', align: 'left'}, | ||||
|           {prop: 'type', label: '二维码类型', align: 'left', formart: v => v === '0' ? '群二维码' : '个人二维码'}, | ||||
|           {prop: 'createUserName', label: '创建人'}, | ||||
|           {prop: 'createTime', label: '创建时间'}, | ||||
|           {prop: 'name', label: '姓名', align: 'left'}, | ||||
|           {prop: 'phone', label: '联系方式', align: 'center'}, | ||||
|           {prop: 'areaName', label: '服务区域', align: 'center'}, | ||||
|           {prop: 'createTime', label: '创建时间', align: 'center'}, | ||||
|           {slot: 'isPublic', label: '是否公开', align: 'center'}, | ||||
|           {slot: 'options', label: '操作'} | ||||
|         ], | ||||
|         areaName: '', | ||||
| @@ -121,13 +126,7 @@ | ||||
|     }, | ||||
|  | ||||
|     computed: { | ||||
|       ...mapState(['user']), | ||||
|  | ||||
|       isShowAdd () { | ||||
|         const str = this.search.areaId.substr(this.search.areaId.length - 3) | ||||
|  | ||||
|         return false | ||||
|       } | ||||
|       ...mapState(['user']) | ||||
|     }, | ||||
|  | ||||
|     watch: { | ||||
| @@ -149,7 +148,7 @@ | ||||
|  | ||||
|     methods: { | ||||
|       getList() { | ||||
|         this.instance.post(`/app/appeveryvillagecode/list`, null, { | ||||
|         this.instance.post(`/app/appvillageauxiliarypolice/list`, null, { | ||||
|           params: { | ||||
|             ...this.search | ||||
|           } | ||||
| @@ -161,6 +160,15 @@ | ||||
|         }) | ||||
|       }, | ||||
|  | ||||
|       onChange (id) { | ||||
|         this.instance.post(`/app/appvillageauxiliarypolice/enable?id=${id}`).then(res => { | ||||
|           if (res.code == 0) { | ||||
|             this.$message.success('修改成功') | ||||
|             this.getList() | ||||
|           } | ||||
|         }) | ||||
|       }, | ||||
|  | ||||
|       filterNode(value, data) { | ||||
|         if (!value) return true | ||||
|         return data.name.indexOf(value) !== -1 | ||||
| @@ -220,7 +228,7 @@ | ||||
|  | ||||
|       remove(id) { | ||||
|         this.$confirm('确定删除该数据?').then(() => { | ||||
|           this.instance.post(`/app/appeveryvillagecode/delete?ids=${id}`).then(res => { | ||||
|           this.instance.post(`/app/appvillageauxiliarypolice/delete?ids=${id}`).then(res => { | ||||
|             if (res.code == 0) { | ||||
|               this.$message.success('删除成功!') | ||||
|               this.getList() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user