xjc преди 2 години
родител
ревизия
407d6bfc44
променени са 2 файла, в които са добавени 231 реда и са изтрити 79 реда
  1. 201 79
      src/views/comments/consult.vue
  2. 30 0
      src/views/match/addChampionSay.vue

+ 201 - 79
src/views/comments/consult.vue

@@ -66,20 +66,40 @@ p {
         </el-col>
         <el-col :span="3">
           <el-form-item label="回复状态">
-            <el-select v-model="queryParams.reply_status" placeholder="请选择回复状态" @change="getData()" size="mini" clearable >
-                <el-option
-                    v-for="item in replyStatusList"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value">
-                </el-option>
+            <el-select
+              v-model="queryParams.reply_status"
+              placeholder="请选择回复状态"
+              @change="getData()"
+              size="mini"
+              clearable
+            >
+              <el-option
+                v-for="item in replyStatusList"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
             </el-select>
           </el-form-item>
         </el-col>
         <el-col :span="4">
-          <el-form-item style="margin-left:10px;" label-width="10">
-            <el-button type="primary" @click="getData" size="mini">筛选</el-button>
-            <el-button type="normal" @click="queryParams={},getData()" size="mini">重置</el-button>
+          <el-form-item style="margin-left: 10px" label-width="10">
+            <el-button type="primary" @click="getData" size="mini"
+              >筛选</el-button
+            >
+            <el-button
+              type="normal"
+              @click="(queryParams = {}), getData()"
+              size="mini"
+              >重置</el-button
+            >
+            <el-button
+              type="primary"
+              @click="(dialogVisible = true), (replyForm = {})"
+              size="mini"
+              >新建回复</el-button
+            >
           </el-form-item>
         </el-col>
       </el-row>
@@ -87,46 +107,60 @@ p {
         <el-col :span="6"></el-col>
       </el-row>
     </el-form>
-    <el-table :data="list" height="55vh" style="width: 100%;margin-top:10px;" v-loading="loading">
-      <!-- <el-table-column header-align="center" align="center" prop="prop" label="头像" width="100">
-        <template slot-scope="scope">
-          <el-image
-            style="width: 100px; height: 100px"
-            :src="scope.row.user_avatar"
-            fit="fit"
-            :preview-src-list="[scope.row.user_avatar]"
-          ></el-image>
-        </template>
-      </el-table-column> -->
+    <el-table
+      :data="list"
+      height="55vh"
+      style="width: 100%; margin-top: 10px"
+      v-loading="loading"
+    >
       <el-table-column prop="user_name" label="选手名称" width="150" />
       <el-table-column prop="user_code" label="选手代码" width="100" />
-      <el-table-column header-align="center" align="center" prop="prop" label="咨询内容">
+      <el-table-column
+        header-align="center"
+        align="center"
+        prop="prop"
+        label="咨询内容"
+      >
         <template slot-scope="scope">
           <el-badge v-if="!scope.row.view_status" is-dot class="item">
-            <p>{{scope.row.content}}</p>
+            <p>{{ scope.row.content }}</p>
           </el-badge>
-          <p v-else>{{scope.row.content}}</p>
+          <p v-else>{{ scope.row.content }}</p>
         </template>
       </el-table-column>
-      <el-table-column header-align="center" align="center" prop="prop" label="回复内容">
+      <el-table-column
+        header-align="center"
+        align="center"
+        prop="prop"
+        label="回复内容"
+      >
         <template slot-scope="scope">
-          <p>{{scope.row.reply_content}}</p>
+          <p>{{ scope.row.reply_content }}</p>
         </template>
       </el-table-column>
-      <el-table-column header-align="center" align="center" prop="prop" label="回复状态">
+      <el-table-column
+        header-align="center"
+        align="center"
+        prop="prop"
+        label="回复状态"
+      >
         <template slot-scope="scope">
-          <p v-if="scope.row.reply_status==1">已回复</p>
+          <p v-if="scope.row.reply_status == 1">已回复</p>
           <p v-else>未回复</p>
         </template>
       </el-table-column>
 
       <el-table-column prop="ctime" label="咨询时间" width="250">
-        <template slot-scope="scope">{{scope.row.ctime}}</template>
+        <template slot-scope="scope">{{ scope.row.ctime }}</template>
       </el-table-column>
       <el-table-column prop="date" label="操作" fixed="right" width="220">
         <template slot-scope="scope">
-          <el-button @click="edit(scope.row)" size="mini" type="primary">回复</el-button>
-          <el-button @click="del(scope.row.user_id)" size="mini" type="danger">删除</el-button>
+          <el-button @click="edit(scope.row)" size="mini" type="primary"
+            >回复</el-button
+          >
+          <el-button @click="del(scope.row.user_id)" size="mini" type="danger"
+            >删除</el-button
+          >
         </template>
       </el-table-column>
     </el-table>
@@ -138,25 +172,43 @@ p {
       @pageChange="gopage"
     />
     <!-- 回复 -->
-    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body class="replyDiag">
+    <el-dialog
+      :title="title"
+      :visible.sync="open"
+      width="500px"
+      append-to-body
+      class="replyDiag"
+    >
       <div class="consutlList">
-        <el-row :gutter="1" v-for="(item,index) in form.all_consult_list" :key="index">
-          <el-col :span="3" v-if="item.user_id>0">
-            <img :src="item.user_avatar" alt width="45px" height="45px" style="border-radius:5px;" />
+        <el-row
+          :gutter="1"
+          v-for="(item, index) in form.all_consult_list"
+          :key="index"
+        >
+          <el-col :span="3" v-if="item.user_id > 0">
+            <img
+              :src="item.user_avatar"
+              alt
+              width="45px"
+              height="45px"
+              style="border-radius: 5px"
+            />
           </el-col>
-          <el-col :span="20" v-if="item.user_id>0">
-            <p style="padding-left:5px;font-size:18px;">{{item.content}}</p>
+          <el-col :span="20" v-if="item.user_id > 0">
+            <p style="padding-left: 5px; font-size: 18px">{{ item.content }}</p>
           </el-col>
-          <el-col :span="20" v-if="item.user_id==0">
-            <p style="padding-right:10px;text-align:right;font-size:18px;">{{item.reply_content}}</p>
+          <el-col :span="20" v-if="item.user_id == 0">
+            <p style="padding-right: 10px; text-align: right; font-size: 18px">
+              {{ item.reply_content }}
+            </p>
           </el-col>
-          <el-col :span="3" v-if="item.user_id==0">
+          <el-col :span="3" v-if="item.user_id == 0">
             <img
               src="..\..\assets\wz.jpg"
               alt
               width="45px"
               height="45px"
-              style="border-radius:5px;"
+              style="border-radius: 5px"
             />
           </el-col>
         </el-row>
@@ -179,13 +231,56 @@ p {
         </el-form>
       </div>
     </el-dialog>
+    <!-- 新建回复 -->
+    <el-dialog
+      title="新建回复"
+      :visible.sync="dialogVisible"
+      width="width"
+    >
+      <div>
+        <el-form ref="form" :model="replyForm" label-width="80px">
+          <el-form-item label="选择用户">
+            <el-select
+              filterable
+              remote
+              v-model="replyForm.user_id"
+              placeholder="请选择用户代码"
+              reserve-keyword
+              :remote-method="remoteMethod"
+              :loading="loading"
+            >
+              <el-option
+                v-for="item in playerList"
+                :key="item.user_id"
+                :label="item.label"
+                :value="item.user_id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="回复内容">
+            <el-input
+              v-model="replyForm.reply_content"
+              placeholder=""
+              type="textarea"
+              rows="10"
+            ></el-input>
+          </el-form-item>
+        </el-form>
+      </div>
+      <div slot="footer">
+        <el-button @click="dialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="replyUser"
+          >确 定</el-button
+        >
+      </div>
+    </el-dialog>
   </section>
 </template>
 <script>
 import Page from "../../components/Page";
 export default {
   components: {
-    Page
+    Page,
   },
   data() {
     return {
@@ -193,14 +288,14 @@ export default {
       queryParams: {
         match_id: 0,
         page: 1,
-        stock_date: this.getNowDate()
+        stock_date: this.getNowDate(),
       },
       form: {
         stock_date: this.getNowDate(),
         page: 1,
         page_size: 20,
         consult_list: [],
-        all_consult_list: []
+        all_consult_list: [],
       },
       form1: {},
       list: [{}, {}],
@@ -210,18 +305,18 @@ export default {
       open1: false,
       rules: {
         match_id: [
-          { required: true, message: "请选择比赛", trigger: "change" }
+          { required: true, message: "请选择比赛", trigger: "change" },
         ],
         player_id: [
-          { required: true, message: "请输入用户代码", trigger: "blur" }
+          { required: true, message: "请输入用户代码", trigger: "blur" },
         ],
         stock_date: [
-          { required: true, message: "请选择持仓日期", trigger: "blur" }
+          { required: true, message: "请选择持仓日期", trigger: "blur" },
         ],
         today_fund: [
-          { required: true, message: "请输入今日资产", trigger: "blur" }
+          { required: true, message: "请输入今日资产", trigger: "blur" },
         ],
-        is_markt: [{ required: false, message: "请选择", trigger: "change" }]
+        is_markt: [{ required: false, message: "请选择", trigger: "change" }],
       },
       matchList: [],
       playerList: [],
@@ -229,30 +324,33 @@ export default {
       stockList: [],
       missDayList: [
         { id: 0, name: "否" },
-        { id: 1, name: "是" }
+        { id: 1, name: "是" },
       ],
       orderStatusList: [
         { id: 0, name: "未支付" },
-        { id: 1, name: "已支付" }
+        { id: 1, name: "已支付" },
       ],
       signupTypeList: [
         { id: 1, name: "选手" },
-        { id: 2, name: "游客" }
+        { id: 2, name: "游客" },
+      ],
+      replyStatusList: [
+        { label: "未回复", value: 0 },
+        { label: "已回复", value: 1 },
       ],
-      replyStatusList:[
-          {label:"未回复",value:0},
-          {label:"已回复",value:1}
-      ]
+      dialogVisible: false,
+      replyForm: {},
+      playerList: [],
     };
   },
   methods: {
     updateRank() {
       this.loading = true;
-      this.$api.updateRank(this.queryParams).then(res => {
+      this.$api.updateRank(this.queryParams).then((res) => {
         this.loading = false;
         this.$message({
           message: "更新成功!",
-          type: "success"
+          type: "success",
         });
       });
     },
@@ -266,16 +364,16 @@ export default {
     },
     autoCompleteData() {
       this.loading = true;
-      this.$api.autoCompleteData(this.queryParams).then(res => {
+      this.$api.autoCompleteData(this.queryParams).then((res) => {
         this.getData();
         this.loading = false;
       });
     },
     downloadExcel() {
-      this.$api.downloadRecords(this.queryParams).then(res => {
+      this.$api.downloadRecords(this.queryParams).then((res) => {
         var elink = document.createElement("a");
         let blob = new Blob([res.data], {
-          type: "application/vnd.ms-excel,charset=UTF-8"
+          type: "application/vnd.ms-excel,charset=UTF-8",
         });
         let objUrl = URL.createObjectURL(blob);
         let file_name = decodeURIComponent(
@@ -293,12 +391,12 @@ export default {
     },
     del(id) {
       this.$confirm("确定删除吗?", "提示", {
-        type: "warning"
+        type: "warning",
       }).then(() => {
-        this.$api.delConsult({ id: id }).then(res => {
+        this.$api.delConsult({ id: id }).then((res) => {
           this.$message({
             message: "删除成功",
-            type: "success"
+            type: "success",
           });
           this.getData();
         });
@@ -313,7 +411,7 @@ export default {
     },
     getData() {
       this.loading = true;
-      this.$api.getWanzhuConsultList(this.queryParams).then(res => {
+      this.$api.getWanzhuConsultList(this.queryParams).then((res) => {
         this.list = res.data.data.list;
         this.total = res.data.data.total;
         this.loading = false;
@@ -321,7 +419,7 @@ export default {
     },
     edit(row) {
       this.title = "回复:" + row.user_name;
-      this.$api.getConsultDetail({ user_id: row.user_id }).then(res => {
+      this.$api.getConsultDetail({ user_id: row.user_id }).then((res) => {
         this.form = res.data.data;
         this.open = true;
         row.view_status = 1;
@@ -329,7 +427,7 @@ export default {
     },
     editComment(id) {
       this.title = "顽主点评";
-      this.$api.getRecordInfo({ id: id }).then(res => {
+      this.$api.getRecordInfo({ id: id }).then((res) => {
         this.form1 = res.data.data;
         this.open1 = true;
       });
@@ -338,9 +436,9 @@ export default {
       this.$api
         .updateComment({
           id: this.form1.id,
-          wanzhu_comment: this.form1.wanzhu_comment
+          wanzhu_comment: this.form1.wanzhu_comment,
         })
-        .then(response => {
+        .then((response) => {
           if (response.data.code != 0) {
             this.msgError(response.data.message);
             return;
@@ -357,7 +455,7 @@ export default {
         match_id: this.matchList[0].id,
         today_stock: [{ code: "", name: "", fund: "" }],
         today_stock_img: [],
-        stock_date: this.getNowDate()
+        stock_date: this.getNowDate(),
       };
     },
     addCode() {
@@ -368,7 +466,7 @@ export default {
       this.form.today_stock_img.push(res.data.url);
     },
     triggerClick() {
-      document.onkeyup = e => {
+      document.onkeyup = (e) => {
         // 为了更加严谨所以添加了路由路径的判断
         if (e.keyCode === 13) {
           //回车后执行搜索方法
@@ -378,12 +476,11 @@ export default {
     },
     /** 提交按钮 */
     submitForm() {
-      this.$refs["form"].validate(valid => {
+      this.$refs["form"].validate((valid) => {
         if (valid) {
-          this.form.pid = this.form.consult_list[
-            this.form.consult_list.length - 1
-          ].id;
-          this.$api.replyConsult(this.form).then(response => {
+          this.form.pid =
+            this.form.consult_list[this.form.consult_list.length - 1].id;
+          this.$api.replyConsult(this.form).then((response) => {
             if (response.data.code != 0) {
               this.msgError(response.data.message);
               return;
@@ -394,15 +491,40 @@ export default {
           });
         }
       });
-    }
+    },
+    replyUser(){
+      this.replyForm.action = "send"
+      this.$api.replyConsult(this.replyForm).then((response) => {
+            if (response.data.code != 0) {
+              this.msgError(response.data.message);
+              return;
+            }
+            this.msgSuccess("回复成功!");
+            this.open = false;
+            this.getData();
+            this.dialogVisible = false;
+          });
+    },
+    remoteMethod(query) {
+      if (query !== "") {
+        this.loading = true;
+        this.$api.getPlayerList({ usercode: query }).then((res) => {
+          this.playerList = res.data.data;
+          this.$set(this.playerList, res.data.data);
+          this.loading = false;
+        });
+      } else {
+        this.playerList = [];
+      }
+    },
   },
   created() {
-    this.$api.getMatchList().then(res => {
+    this.$api.getMatchList().then((res) => {
       this.matchList = res.data.data;
       this.queryParams.match_id = this.matchList[0].id;
       this.getData();
     });
     this.triggerClick();
-  }
+  },
 };
 </script>

+ 30 - 0
src/views/match/addChampionSay.vue

@@ -31,6 +31,26 @@
     <h4>新增冠军心得</h4>
     <el-divider></el-divider>
     <el-form label-width="80px">
+      <el-form-item label="分类">
+        <el-select v-model="form.category" placeholder="">
+          <el-option
+            v-for="item in categoryList"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value">
+          </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="置顶">
+        <el-select v-model="form.isbanner" placeholder="">
+          <el-option
+            v-for="item in bannerList"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value">
+          </el-option>
+        </el-select>
+      </el-form-item>
       <el-form-item label="标题">
         <el-input placeholder="标题" v-model="form.name"></el-input>
       </el-form-item>
@@ -106,6 +126,16 @@ export default {
 	      // 上传文件接口,实现上传图片功能必须的配置,这个地址会在后端配置的时候产生,此处先放上结果
 	      serverUrl: '/api/admin/ueditor/upload',
 	    },
+      categoryList:[
+        {label:"冠军心得",value:"冠军心得"},
+        {label:"每日点评",value:"每日点评"},
+        {label:"腰斩心得",value:"腰斩心得"},
+        {label:"牛人专访",value:"牛人专访"}
+      ],
+      bannerList:[
+        {label:"否",value:0},
+        {label:"是",value:1}
+      ]
     };
   },
   methods: {