lk 5 vuotta sitten
vanhempi
commit
55ff171345
2 muutettua tiedostoa jossa 140 lisäystä ja 17 poistoa
  1. 49 17
      pages/main/index/kaifawu_contact.vue
  2. 91 0
      pages/main/index/remark_list.vue

+ 49 - 17
pages/main/index/kaifawu_contact.vue

@@ -4,14 +4,14 @@
       <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
     </el-select>
     <section class="table">
-      <el-table :data="tableData" style="width: 100%">
+      <el-table :data="tableData" style="width: 100%" v-loading="loading">
         <el-table-column prop="providerTitle" label="解决方案">
           <template slot-scope="scope">
             <span class="lblue point">
               <nuxt-link
                 target="_blank"
                 :to="{path:'/main/solution_detail?id='+scope.row.providerId}"
-              >{{scope.row.providerTitle}}</nuxt-link>
+              >{{ scope.row.providerTitle }}</nuxt-link>
             </span>
           </template>
         </el-table-column>
@@ -25,9 +25,14 @@
         <el-table-column prop="mobile" label="手机号"></el-table-column>
         <el-table-column prop="contactCreatedAtFormat" label="创建时间"></el-table-column>
         <el-table-column prop="channel" label="渠道">
-          <template slot-scope="scope">{{scope.row.channel}} {{scope.row.channelVersion}}</template>
+          <template slot-scope="scope">{{ scope.row.channel }} {{ scope.row.channelVersion }}</template>
+        </el-table-column>
+        <el-table-column prop="platformContactNote" label="历史备注"></el-table-column>
+        <el-table-column prop="platformContactNote" label="备注" width="120">
+          <template slot-scope="scope">
+            <el-button type="text" @click="onToList(scope.row)">查看备注({{scope.row.remark_num}})</el-button>
+          </template>
         </el-table-column>
-        <el-table-column prop="platformContactNote" label="联系备注"></el-table-column>
         <el-table-column prop="platformContactAtFormat" label="联系时间"></el-table-column>
         <el-table-column prop="platformContact" label="当前状态">
           <template slot-scope="scope">
@@ -38,11 +43,10 @@
 
         <el-table-column prop="platformContactAdmin.nickname" label="操作人"></el-table-column>
 
-        <el-table-column label="操作" prop="platformContact">
+        <el-table-column label="操作" prop="platformContact" width="200">
           <template slot-scope="scope">
-            <p v-if="scope.row.platformContact == 0">
-              <el-button type="primary" @click="showConfirm(scope.row)">确认联系</el-button>
-            </p>
+            <el-button type="text" v-if="scope.row.platformContact == 0" @click="onContact(scope.row)">确认联系</el-button>
+            <el-button type="text" @click="showConfirm(scope.row)">添加备注</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -60,7 +64,7 @@
     <el-dialog title="确认联系" :visible.sync="dialogFormVisible">
       <el-form :model="form" :rules="rules" ref="roleForm">
         <el-form-item label="备注" label-width="120px">
-          <el-input v-model="form.note" type="textarea"></el-input>
+          <el-input v-model="form.content" type="textarea"></el-input>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -75,6 +79,7 @@
 export default {
   data() {
     return {
+      loading: false,
       // 列表数据
       tableData: [],
       pageSize: 20,
@@ -83,7 +88,8 @@ export default {
       currentPage: 1,
       form: {
         id: null,
-        note: ""
+        content: "",
+        type: 2
       }
     };
   },
@@ -91,7 +97,29 @@ export default {
     this.getTableData();
   },
   methods: {
+    async onContact(row) {
+      let res = await this.$post("/api/admin/kaifawu/markContact", {id: row.id});
+      if (res.status == 1) {
+        this.$message({
+          message: res.info,
+          type: "success"
+        });
+        this.getTableData();
+      } else {
+        this.$message({
+          message: res.info,
+          type: "fail"
+        });
+      }
+    },
     showConfirm(row) {
+      if (row.platformContact == 0) {
+        this.$message({
+          message: '请先联系,在备注',
+          type: "fail"
+        });
+        return false;
+      }
       this.form.id = row.id;
       this.dialogFormVisible = true;
     },
@@ -107,25 +135,28 @@ export default {
       );
     },
     async confirm() {
-      let res = await this.$post("/api/admin/kaifawu/markContact", this.form);
+      let res = await this.$post("/api/admin/kaifawu/remark", this.form);
       if (res.status == 1) {
         this.$message({
           message: res.info,
           type: "success"
         });
         this.getTableData();
-      } else {
-        this.$message({
-          message: res.info,
-          type: "fail"
-        });
+        this.dialogFormVisible = false;
       }
     },
+    onToList(row) {
+      let data = {
+        obj_id: row.id,
+        type: 2
+      }
+      this.$router.push({path: '/main/remark_list', query: data});
+    },
     // 获取列表数据
     async getTableData() {
       this.tableData = [];
       let page = this.currentPage;
-      let body = { page };
+      let body = {page};
       let res = await this.$post("/api/admin/kaifawu/getContactList", body);
       let data = res.data;
       this.tableData = data.lists;
@@ -140,6 +171,7 @@ export default {
 .table {
   height: calc(100% - 60px);
 }
+
 .img {
   width: 100%;
   height: auto;

+ 91 - 0
pages/main/index/remark_list.vue

@@ -0,0 +1,91 @@
+<template>
+  <div>
+    <el-table
+      :data="tableData"
+      style="width: 100%">
+      <el-table-column
+        prop="nickname"
+        label="昵称"
+        width="180">
+        <template slot-scope="scope">
+ <span class="lblue point">
+              <a
+                :href="scope.row.user_url"
+                target="_blank"
+              > {{ scope.row.userinfo ? scope.row.userinfo.nickname : '-' }}({{ scope.row.uid }})</a>
+            </span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        prop="create_time_name"
+        label="日期"
+        width="180">
+      </el-table-column>
+
+      <el-table-column
+        prop="content"
+        label="备注内容">
+      </el-table-column>
+    </el-table>
+    <div>
+      <el-pagination
+        @current-change="getDatas"
+        :current-page.sync="pageInfo.page"
+        :page-size="pageInfo.size"
+        layout="total, prev, pager, next"
+        :total="pageInfo.total"
+      ></el-pagination>
+    </div>
+
+  </div>
+</template>
+
+<script>
+export default {
+  name: "remark_list",
+  data() {
+    return {
+      tableData: [],
+      formData: {
+        obj_id: 0,
+        type: 2
+      },
+      pageInfo: {
+        page: 1,
+        size: 20,
+        total: 0,
+      },
+    }
+  },
+  mounted() {
+    this.queryDataFormat();
+  },
+  methods: {
+    queryDataFormat() {
+      let query = this.$route.query;
+      if (JSON.stringify(query) === "{}") {
+        this.$message.error('参数错误');
+        return;
+      }
+      this.formData.obj_id = query.obj_id || 0;
+      this.getDatas();
+    },
+    async getDatas() {
+      const res = await this.$post("/api/admin/kaifawu/remarkList", {
+        type: 2,
+        obj_id: this.formData.obj_id,
+        page: this.pageInfo.page,
+      });
+      let data = res.data;
+      debugger;
+      this.tableData = data.list;
+      this.pageInfo.total = Number(data.total);
+      this.pageInfo.page = data.totalPage;
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>