소스 검색

feat():区域列表

geek 4 년 전
부모
커밋
7b093be154

BIN
public/favicon.ico


+ 4 - 1
src/views/advice/components/ArticleDetail.vue

@@ -11,12 +11,15 @@
         <el-form-item prop="user_id" style="" label="用户id">
           <el-input v-model="postForm.user_id" placeholder="" style="width: 100px;" />
         </el-form-item>
+        <el-form-item prop="mark" style="" label="备注">
+          <el-input v-model="postForm.mark" placeholder="" style="width: 300px;" />
+        </el-form-item>
         <el-row>
           <el-button v-if="!isEdit" v-loading="loading" type="success" @click="submitForm">
             提交
           </el-button>
           <el-button v-if="isEdit" v-loading="loading" type="success" @click="updateArticle">
-            修改
+            返回
           </el-button>
         </el-row>
       </div>

+ 36 - 17
src/views/advice/list.vue

@@ -34,18 +34,33 @@
             </el-button>
           </router-link>
           <el-button type="danger" size="mini" icon="el-icon-s-check" style="margin-left: 10px;" :disabled="scope.row.status == '1' ? false : true" @click="handleDelete(scope)">
-            {{ scope.row.status == '1' ? "处理 " : "已处理" }}
+            {{ scope.row.status == '1' ? "处理 " : "已处理" }}
           </el-button>
         </template>
       </el-table-column>
     </el-table>
 
     <pagination v-show="total>0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.pageSize" @pagination="getList" />
+    <el-dialog title="处理备注" :visible.sync="dialogFormVisible">
+      <el-form ref="dataForm" :model="temp" label-position="left" label-width="70px" style="width: 400px; margin-left:50px;">
+        <el-form-item label="备注" prop="mark">
+          <el-input v-model="temp.mark" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="dialogFormVisible = false">
+          取消
+        </el-button>
+        <el-button type="primary" @click="updateData()">
+          确定
+        </el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
 <script>
-import { fetchList, deleteAdvice, fetchAdvice } from '@/api/advice'
+import { fetchList, updateAdvice, fetchAdvice } from '@/api/advice'
 import Pagination from '@/components/Pagination' // Secondary package based on el-pagination
 import waves from '@/directive/waves'
 
@@ -70,7 +85,12 @@ export default {
       listQuery: {
         page: 1,
         pageSize: 10
-      }
+      },
+      temp: {
+        id: undefined,
+        mark: ''
+      },
+      dialogFormVisible: false
     }
   },
   created() {
@@ -94,21 +114,20 @@ export default {
       })
     },
     handleDelete({ $index, row }) {
-      console.log(row.id)
-      this.$confirm('您确定要处理吗', '警告', {
-        confirmButtonText: '是的',
-        cancelButtonText: '取消',
-        type: 'warning'
+      this.temp = Object.assign({}, row) // copy obj
+      this.dialogFormVisible = true
+    },
+    async updateData() {
+      const tempData = Object.assign({}, this.temp)
+      const index = this.list.findIndex(v => v.id === this.temp.id)
+      await updateAdvice(tempData)
+      const rs = await fetchAdvice(tempData.id)
+      this.list.splice(index, 1, rs.data.info)
+      this.dialogFormVisible = false
+      this.$message({
+        type: 'success',
+        message: '处理成功'
       })
-        .then(async() => {
-          await deleteAdvice(row.id)
-          const rs = await fetchAdvice(row.id)
-          this.list.splice($index, 1, rs.data.info)
-          this.$message({
-            type: 'success',
-            message: '处理成功'
-          })
-        })
     }
   }
 }

+ 3 - 0
src/views/join/components/ArticleDetail.vue

@@ -91,6 +91,9 @@
         <el-form-item prop="user_id" label="用户id">
           <el-input v-model="postForm.user_id" placeholder="" style="width: 300px;" />
         </el-form-item>
+        <el-form-item prop="mark" label="备注">
+          <el-input v-model="postForm.mark" placeholder="" style="width: 300px;" />
+        </el-form-item>
         <el-row>
           <el-button v-if="!isEdit" v-loading="loading" type="success" @click="submitForm">
             查看

+ 1 - 1
src/views/join/list.vue

@@ -18,7 +18,7 @@
           <span>{{ scope.row.create_time }}</span>
         </template>
       </el-table-column>
-      <el-table-column class-name="status-col" label="手机号" width="100px">
+      <el-table-column class-name="status-col" label="手机号" width="180px">
         <template slot-scope="scope">
           <span>{{ scope.row.mobile }}</span>
         </template>

+ 5 - 4
src/views/user/list.vue

@@ -53,7 +53,7 @@
 </template>
 
 <script>
-import { fetchList, deleteUser } from '@/api/user'
+import { fetchList, deleteUser, fetchUser } from '@/api/user'
 import Pagination from '@/components/Pagination' // Secondary package based on el-pagination
 import waves from '@/directive/waves'
 
@@ -112,17 +112,18 @@ export default {
     },
     handleDelete({ $index, row }) {
       console.log(row.id)
-      this.$confirm('您确定要隐藏吗', '警告', {
+      this.$confirm('您确定要删除吗', '警告', {
         confirmButtonText: '是的',
         cancelButtonText: '取消',
         type: 'warning'
       })
         .then(async() => {
           await deleteUser(row.id)
-          this.list.splice($index, 1)
+          const user = await fetchUser(row.id)
+          this.list.splice($index, 1, user.data)
           this.$message({
             type: 'success',
-            message: '隐藏成功'
+            message: '删除成功'
           })
         })
     }