kaifawu_contact.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <template>
  2. <section id="dev_check">
  3. <el-select v-model="value" @change="changeSelect" placeholder="请选择">
  4. <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
  5. </el-select>
  6. <section class="table">
  7. <el-table :data="tableData" style="width: 100%" v-loading="loading">
  8. <el-table-column prop="providerTitle" label="解决方案">
  9. <template slot-scope="scope">
  10. <span class="lblue point">
  11. <nuxt-link
  12. target="_blank"
  13. :to="{path:'/main/solution_detail?id='+scope.row.providerId}"
  14. >{{ scope.row.providerTitle }}</nuxt-link>
  15. </span>
  16. </template>
  17. </el-table-column>
  18. <el-table-column label="用户" width="66">
  19. <template slot-scope="scope">
  20. <span v-if="scope.row.uid == 0">来宾用户</span>
  21. <span class="lblue point" @click="clickDev(scope.row.uid)" v-else>{{ scope.row.uid }}</span>
  22. </template>
  23. </el-table-column>
  24. <el-table-column prop="name" label="姓名"></el-table-column>
  25. <el-table-column prop="mobile" label="手机号"></el-table-column>
  26. <el-table-column prop="contactCreatedAtFormat" label="创建时间"></el-table-column>
  27. <el-table-column prop="channel" label="渠道">
  28. <template slot-scope="scope">{{ scope.row.channel }} {{ scope.row.channelVersion }}</template>
  29. </el-table-column>
  30. <el-table-column prop="platformContactNote" label="历史备注"></el-table-column>
  31. <el-table-column prop="platformContactNote" label="备注" width="120">
  32. <template slot-scope="scope">
  33. <el-button type="text" @click="onToList(scope.row)">查看备注({{scope.row.remark_num}})</el-button>
  34. </template>
  35. </el-table-column>
  36. <el-table-column prop="platformContactAtFormat" label="联系时间"></el-table-column>
  37. <el-table-column prop="platformContact" label="当前状态">
  38. <template slot-scope="scope">
  39. <p v-if="scope.row.platformContact == 0">未联系</p>
  40. <p v-else>已联系</p>
  41. </template>
  42. </el-table-column>
  43. <el-table-column prop="platformContactAdmin.nickname" label="操作人"></el-table-column>
  44. <el-table-column label="操作" prop="platformContact" width="200">
  45. <template slot-scope="scope">
  46. <el-button type="text" v-if="scope.row.platformContact == 0" @click="onContact(scope.row)">确认联系</el-button>
  47. <el-button type="text" @click="showConfirm(scope.row)">添加备注</el-button>
  48. </template>
  49. </el-table-column>
  50. </el-table>
  51. </section>
  52. <el-pagination
  53. background
  54. @current-change="changePagination"
  55. :current-page.sync="currentPage"
  56. :page-size="pageSize"
  57. layout="total, sizes, prev, pager, next, jumper"
  58. :total="totalCount"
  59. ></el-pagination>
  60. <el-dialog title="确认联系" :visible.sync="dialogFormVisible">
  61. <el-form :model="form" :rules="rules" ref="roleForm">
  62. <el-form-item label="备注" label-width="120px">
  63. <el-input v-model="form.content" type="textarea"></el-input>
  64. </el-form-item>
  65. </el-form>
  66. <div slot="footer" class="dialog-footer">
  67. <el-button @click="dialogFormVisible = false">取 消</el-button>
  68. <el-button type="primary" @click="confirm('roleForm')">确 定</el-button>
  69. </div>
  70. </el-dialog>
  71. </section>
  72. </template>
  73. <script>
  74. export default {
  75. data() {
  76. return {
  77. loading: false,
  78. // 列表数据
  79. tableData: [],
  80. pageSize: 20,
  81. totalCount: 40,
  82. dialogFormVisible: false,
  83. currentPage: 1,
  84. form: {
  85. id: null,
  86. content: "",
  87. type: 2
  88. }
  89. };
  90. },
  91. created() {
  92. this.getTableData();
  93. },
  94. methods: {
  95. async onContact(row) {
  96. let res = await this.$post("/api/admin/kaifawu/markContact", {id: row.id});
  97. if (res.status == 1) {
  98. this.$message({
  99. message: res.info,
  100. type: "success"
  101. });
  102. this.getTableData();
  103. } else {
  104. this.$message({
  105. message: res.info,
  106. type: "fail"
  107. });
  108. }
  109. },
  110. showConfirm(row) {
  111. if (row.platformContact == 0) {
  112. this.$message({
  113. message: '请先联系,在备注',
  114. type: "fail"
  115. });
  116. return false;
  117. }
  118. this.form.id = row.id;
  119. this.dialogFormVisible = true;
  120. },
  121. // 页码变动
  122. changePagination(page) {
  123. this.currentPage = page;
  124. this.getTableData();
  125. },
  126. // 点击开发者
  127. clickDev(uid) {
  128. window.open(
  129. this.$store.state.domainConfig.siteUrl + `/rooter/user/${uid}`
  130. );
  131. },
  132. async confirm() {
  133. let res = await this.$post("/api/admin/kaifawu/remark", this.form);
  134. if (res.status == 1) {
  135. this.$message({
  136. message: res.info,
  137. type: "success"
  138. });
  139. this.getTableData();
  140. this.dialogFormVisible = false;
  141. }
  142. },
  143. onToList(row) {
  144. let data = {
  145. obj_id: row.id,
  146. type: 2
  147. }
  148. this.$router.push({path: '/main/remark_list', query: data});
  149. },
  150. // 获取列表数据
  151. async getTableData() {
  152. this.tableData = [];
  153. let page = this.currentPage;
  154. let body = {page};
  155. let res = await this.$post("/api/admin/kaifawu/getContactList", body);
  156. let data = res.data;
  157. this.tableData = data.lists;
  158. this.pageSize = data.pageSize;
  159. this.totalCount = Number(data.total);
  160. }
  161. }
  162. };
  163. </script>
  164. <style scoped>
  165. .table {
  166. height: calc(100% - 60px);
  167. }
  168. .img {
  169. width: 100%;
  170. height: auto;
  171. }
  172. </style>