account_manager.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. <template>
  2. <div>
  3. <div>
  4. <el-tabs v-model="activeName" @tab-click="handleClick">
  5. <el-tab-pane label="客户经理评级" name="grade">
  6. <el-table :data="gradeData" border style="width: 100%">
  7. <el-table-column
  8. prop=""
  9. label="评价者">
  10. <template slot-scope="scope">
  11. <span class="lblue point">
  12. <a target="_blank" :href="scope.row.host+'/wo/'+scope.row.user_id">{{
  13. scope.row.user_id_name + '(' + scope.row.user_id + ')'
  14. }}</a>
  15. </span>
  16. </template>
  17. </el-table-column>
  18. <el-table-column
  19. prop=""
  20. label="被评价者">
  21. <template slot-scope="scope">
  22. <span class="lblue point">
  23. <a target="_blank" :href="scope.row.host+'/wo/'+scope.row.manager_uid">{{
  24. scope.row.manager_uid_name + '(' + scope.row.manager_uid + ')'
  25. }}</a>
  26. </span>
  27. </template>
  28. </el-table-column>
  29. <el-table-column
  30. prop=""
  31. label="评价等级">
  32. <template slot-scope="scope">
  33. <span class="lblue point">
  34. <el-rate :value="scope.row.grade" disabled></el-rate>
  35. </span>
  36. <span>
  37. {{scope.row.grade_name}}
  38. </span>
  39. </template>
  40. </el-table-column>
  41. <el-table-column prop="create_time" label="评价标签">
  42. <template slot-scope="scope">
  43. <span v-for="item in scope.row.labels" style="margin-left: 5px">
  44. <el-tag size="mini" type="info">{{item}}</el-tag>
  45. </span>
  46. </template>
  47. </el-table-column>
  48. <el-table-column prop="create_time" label="评价时间">
  49. <template slot-scope="scope">
  50. <span>{{ formatDate(scope.row.create_time, 'Y-m-d H:i') }}</span>
  51. </template>
  52. </el-table-column>
  53. </el-table>
  54. </el-tab-pane>
  55. <el-tab-pane label="更改客户经理" name="change">
  56. <el-table :data="changeData" border style="width: 100%">
  57. <el-table-column
  58. prop=""
  59. label="申请者">
  60. <template slot-scope="scope">
  61. <span class="lblue point">
  62. <a target="_blank" :href="scope.row.host+'/wo/'+scope.row.apply_uid">{{
  63. scope.row.apply_uid_name + '(' + scope.row.apply_uid + ')'
  64. }}</a>
  65. </span>
  66. </template>
  67. </el-table-column>
  68. <el-table-column
  69. prop=""
  70. label="原客户经理">
  71. <template slot-scope="scope">
  72. <span class="lblue point">
  73. <a target="_blank" :href="scope.row.host+'/wo/'+scope.row.before_uid">{{
  74. scope.row.before_uid_name + '(' + scope.row.before_uid + ')'
  75. }}</a>
  76. </span>
  77. </template>
  78. </el-table-column>
  79. <el-table-column
  80. prop=""
  81. label="更换后客户经理">
  82. <template slot-scope="scope">
  83. <span class="lblue point">
  84. <a target="_blank" :href="scope.row.host+'/wo/'+scope.row.this_uid">{{
  85. scope.row.this_uid_name + '(' + scope.row.this_uid + ')'
  86. }}</a>
  87. </span>
  88. </template>
  89. </el-table-column>
  90. <el-table-column prop="create_time" label="申请时间">
  91. <template slot-scope="scope">
  92. <span>{{ formatDate(scope.row.create_time, 'Y-m-d H:i') }}</span>
  93. </template>
  94. </el-table-column>
  95. <el-table-column label="状态">
  96. <template slot-scope="scope">
  97. <span v-if="scope.row.status === '0'">待处理</span>
  98. <span v-else-if="scope.row.status === '1'">已处理</span>
  99. <span v-else>--</span>
  100. </template>
  101. </el-table-column>
  102. <el-table-column label="备注">
  103. <template slot-scope="scope">
  104. <span>{{ scope.row.remark }}</span>
  105. </template>
  106. </el-table-column>
  107. <el-table-column label="操作">
  108. <template slot-scope="scope">
  109. <el-button type="text" @click="onRemark(scope.row.id)">添加备注</el-button>
  110. <el-button type="text" v-if="scope.row.status === '0'" @click="onUpdateManager(scope.row)">立即处理</el-button>
  111. <el-button type="text" v-else disabled>已处理</el-button>
  112. </template>
  113. </el-table-column>
  114. </el-table>
  115. </el-tab-pane>
  116. </el-tabs>
  117. </div>
  118. <div class="page">
  119. <el-pagination
  120. class="order-footer"
  121. background
  122. layout="total, prev, pager, next"
  123. :page-size="20"
  124. :total="total"
  125. @current-change="handleCurrentChange"
  126. />
  127. </div>
  128. <el-dialog title="添加备注" :visible.sync="remarkModel">
  129. <div>
  130. <el-input
  131. type="textarea"
  132. :rows="5"
  133. placeholder="请输入内容"
  134. v-model="remarkData.content">
  135. </el-input>
  136. </div>
  137. <div slot="footer" class="dialog-footer">
  138. <el-button @click="remarkModel = false">取 消</el-button>
  139. <el-button type="primary" :loading="loading" @click="onRemarkSave">确 定</el-button>
  140. </div>
  141. </el-dialog>
  142. </div>
  143. </template>
  144. <script>
  145. export default {
  146. name: "user_cards_list",
  147. data() {
  148. return {
  149. page: 1,
  150. total: 0,
  151. loading: false,
  152. remarkData: {id: '0', content: ''},
  153. activeName: 'grade',
  154. remarkModel: false,
  155. gradeData: [],
  156. changeData: [],
  157. }
  158. },
  159. mounted() {
  160. this.getData()
  161. },
  162. methods: {
  163. getData() {
  164. if (this.activeName === 'change') {
  165. this.getChangeList();
  166. } else if (this.activeName === 'grade') {
  167. this.getGradeList();
  168. }
  169. },
  170. handleClick(tab, event) {
  171. this.activeName = tab.name;
  172. this.getData();
  173. },
  174. async getChangeList() {
  175. const page = this.page;
  176. const data = {
  177. page
  178. };
  179. let res = await this.$post("/api/admin/accountManager/getChangeManagerList", data);
  180. if (res && res.status === 1) {
  181. this.changeData = res.data.list || [];
  182. this.total = res.data.total * 1;
  183. }
  184. },
  185. async getGradeList() {
  186. const page = this.page;
  187. const data = {
  188. page
  189. };
  190. let res = await this.$post("/api/admin/accountManager/getGradeList", data);
  191. if (res && res.status === 1) {
  192. this.gradeData = res.data.list || [];
  193. this.total = res.data.total * 1;
  194. }
  195. },
  196. onRemark(id) {
  197. this.remarkData.id = id;
  198. this.remarkModel = true;
  199. },
  200. async onRemarkSave() {
  201. this.loading = true;
  202. if (this.remarkData.content === '' || this.remarkData.id === '0') {
  203. this.$message.error('请输入内容')
  204. this.loading = false
  205. return false
  206. }
  207. let data = {content: this.remarkData.content, id: this.remarkData.id}
  208. let res = await this.$post("/api/admin/accountManager/saveRemark", data);
  209. if (res && res.status === 1) {
  210. this.$message.success('备注成功')
  211. this.remarkModel = false
  212. this.getData()
  213. }
  214. this.loading = false
  215. },
  216. async onUpdateManager(row) {
  217. let data = {id: row.id}
  218. let res = await this.$post("/api/admin/accountManager/updateManager", data);
  219. if (res && res.status === 1) {
  220. this.$message.success('已备注')
  221. this.getData();
  222. }
  223. },
  224. handleCurrentChange(val) {
  225. this.page = val;
  226. this.getData();
  227. },
  228. formatDate(time, format = '') {
  229. if (time === "0") {
  230. return "--";
  231. }
  232. let now = new Date(time * 1000);
  233. let year = now.getFullYear();
  234. let month = now.getMonth() + 1;
  235. let date = now.getDate();
  236. let hour = now.getHours();
  237. let minute = now.getMinutes();
  238. let second = now.getSeconds();
  239. if (hour < 10) {
  240. hour = "0" + hour;
  241. }
  242. if (minute < 10) {
  243. minute = "0" + minute;
  244. }
  245. if (second < 10) {
  246. second = "0" + second;
  247. }
  248. return (format == '' ?
  249. year +
  250. "-" +
  251. month +
  252. "-" +
  253. date +
  254. " " +
  255. hour +
  256. ":" +
  257. minute +
  258. ":" +
  259. second
  260. :
  261. year +
  262. "-" +
  263. month +
  264. "-" +
  265. date +
  266. " " +
  267. hour +
  268. ":" +
  269. minute
  270. );
  271. },
  272. }
  273. }
  274. </script>
  275. <style scoped>
  276. .page {
  277. margin-top: 10px;
  278. }
  279. </style>