companyTransferDetail.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item label="企微公司" prop="corpId">
  5. <el-select clearable v-model="queryParams.corpId" placeholder="请选择企微公司" size="small" @change="updateCorpId()">
  6. <el-option
  7. v-for="dict in myQwCompanyList"
  8. :key="dict.dictValue"
  9. :label="dict.dictLabel"
  10. :value="dict.dictValue"
  11. />
  12. </el-select>
  13. </el-form-item>
  14. <el-form-item label="公司名称" prop="companyName">
  15. <el-input
  16. v-model="queryParams.companyName"
  17. placeholder="请输入接替销售公司名称"
  18. clearable
  19. size="small"
  20. @keyup.enter.native="handleQuery"
  21. />
  22. </el-form-item>
  23. <el-form-item label="销售名称" prop="companyUserName">
  24. <el-input
  25. v-model="queryParams.companyUserName"
  26. placeholder="请输入接替销售名称"
  27. clearable
  28. size="small"
  29. @keyup.enter.native="handleQuery"
  30. />
  31. </el-form-item>
  32. <el-form-item label="审核状态" prop="status">
  33. <el-select v-model="queryParams.status" placeholder="请选择" clearable >
  34. <el-option :value="0" label="全部"/>
  35. <el-option
  36. v-for="item in auditStatusOptions"
  37. :key="item.dictValue"
  38. :label="item.dictLabel"
  39. :value="item.dictValue"
  40. />
  41. </el-select>
  42. </el-form-item>
  43. <el-form-item>
  44. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  45. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  46. </el-form-item>
  47. </el-form>
  48. <el-table v-loading="loading" :data="list" border>
  49. <el-table-column label="ID" align="center" prop="id" width="55"/>
  50. <el-table-column label="主体名称" align="center" prop="corpName" />
  51. <el-table-column label="接替公司名称" align="center" prop="companyName" />
  52. <el-table-column label="接替销售名称" align="center" prop="companyUserName" />
  53. <el-table-column label="接替企微用户名称" align="center" prop="qwUserName" />
  54. <el-table-column label="审核状态" align="center" prop="status">
  55. <template slot-scope="scope">
  56. <dict-tag :options="auditStatusOptions" :value="scope.row.status"/>
  57. </template>
  58. </el-table-column>
  59. <el-table-column label="提交时间" align="center" prop="createTime" />
  60. <el-table-column label="审核时间" align="center" prop="auditTime" />
  61. <el-table-column label="被拒原因" align="center" prop="reason" />
  62. <el-table-column label="提交人" align="center" prop="createBy" />
  63. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  64. <template slot-scope="scope">
  65. <el-button
  66. size="mini"
  67. type="text"
  68. @click="handleView(scope.row)"
  69. v-hasPermi="['qw:externalContactTransferCompanyAudit:detail']"
  70. >详情</el-button>
  71. </template>
  72. </el-table-column>
  73. </el-table>
  74. <pagination
  75. v-show="total>0"
  76. :total="total"
  77. :page.sync="queryParams.pageNum"
  78. :limit.sync="queryParams.pageSize"
  79. @pagination="getList"
  80. />
  81. <el-drawer title="详情" size="75%" :visible.sync="dialogViewVisible" append-to-body>
  82. <el-row :gutter="10" class="mb8">
  83. <el-col :span="1.5">
  84. <el-button
  85. style="margin-left: 10px"
  86. type="primary"
  87. plain
  88. size="mini"
  89. v-if="currentAudit.status === 2"
  90. :loading="syncLoading"
  91. @click="sync"
  92. v-hasPermi="['qw:externalContactTransferCompanyAudit:sync']"
  93. >同步</el-button>
  94. </el-col>
  95. </el-row>
  96. <el-table v-loading="detailLoading" :data="userList" border>
  97. <el-table-column label="ID" align="center" prop="id" />
  98. <el-table-column label="客户名称" align="center" prop="externalUserName" />
  99. <el-table-column label="原公司名称" align="center" prop="companyName" />
  100. <el-table-column label="原销售名称" align="center" prop="companyUserName" />
  101. <el-table-column label="原企微用户名称" align="center" prop="qwUserName" />
  102. <el-table-column label="备注" align="center" prop="remark" />
  103. <el-table-column label="接替状态" align="center" prop="status">
  104. <template slot-scope="scope">
  105. <dict-tag :options="replaceStatusOptions" :value="scope.row.status"/>
  106. </template>
  107. </el-table-column>
  108. </el-table>
  109. <pagination
  110. v-show="userTotal>0"
  111. :total="userTotal"
  112. :page.sync="userQueryParams.pageNum"
  113. :limit.sync="userQueryParams.pageSize"
  114. @pagination="getUserList"
  115. />
  116. </el-drawer>
  117. </div>
  118. </template>
  119. <script>
  120. import { detail, listExternalContactTransferAudit, sync } from '@/api/qw/externalContactTransferAudit'
  121. import { getMyQwCompanyList } from '@/api/qw/user'
  122. export default {
  123. name: "companyTransferDetail",
  124. data() {
  125. return {
  126. loading: false,
  127. showSearch: true,
  128. queryParams: {
  129. pageNum: 1,
  130. pageSize: 10,
  131. companyName: null,
  132. corpName: null,
  133. companyUserName: null,
  134. status: 0,
  135. corpId: null,
  136. },
  137. total: 0,
  138. list: [],
  139. auditStatusOptions: [],
  140. replaceStatusOptions: [],
  141. dialogAuditVisible: false,
  142. dialogViewVisible: false,
  143. detailLoading: false,
  144. userQueryParams: {
  145. pageNum: 1,
  146. pageSize: 10,
  147. },
  148. userList: [],
  149. userTotal: 0,
  150. currentAudit: {},
  151. syncLoading: false,
  152. myQwCompanyList:[],
  153. }
  154. },
  155. created() {
  156. getMyQwCompanyList().then(response => {
  157. this.myQwCompanyList = response.data;
  158. });
  159. this.getDicts("sys_qw_transfer_audit_status").then((response) => {
  160. this.auditStatusOptions = response.data;
  161. });
  162. this.getDicts("sys_qw_transfer_status").then((response) => {
  163. this.replaceStatusOptions = response.data;
  164. });
  165. this.handleQuery()
  166. },
  167. methods: {
  168. updateCorpId() {
  169. this.handleQuery()
  170. },
  171. handleQuery() {
  172. this.queryParams.pageNum = 1;
  173. this.getList();
  174. },
  175. resetQuery() {
  176. this.queryParams = {
  177. pageNum: 1,
  178. pageSize: 10,
  179. companyName: null,
  180. corpName: null,
  181. companyUserName: null,
  182. status: 0,
  183. corpId: null,
  184. };
  185. this.resetForm("queryForm");
  186. this.handleQuery();
  187. },
  188. getList() {
  189. this.loading = true
  190. const params = {
  191. ...this.queryParams,
  192. status: this.queryParams.status === 0 ? null : this.queryParams.status
  193. }
  194. listExternalContactTransferAudit(params).then(response => {
  195. this.list = response.rows.map(item => {
  196. return {
  197. ...item,
  198. createTime: item.createTime ? item.createTime.replace("T", " ") : null,
  199. auditTime: item.auditTime ? item.auditTime.replace("T", " ") : null,
  200. }
  201. })
  202. this.total = response.total
  203. this.loading = false
  204. })
  205. },
  206. handleView(row) {
  207. this.currentAudit = row
  208. this.userQueryParams.pageNum = 1
  209. this.getUserList()
  210. this.dialogViewVisible = true
  211. },
  212. getUserList() {
  213. this.detailLoading = true
  214. detail(this.currentAudit.id, this.userQueryParams).then(response => {
  215. this.userList = response.rows
  216. this.userTotal = response.total
  217. this.detailLoading = false
  218. })
  219. },
  220. sync() {
  221. const id = this.currentAudit.id
  222. this.syncLoading = true
  223. sync(id).then(() => {
  224. this.getUserList()
  225. this.syncLoading = false
  226. })
  227. },
  228. }
  229. };
  230. </script>
  231. <style scoped>
  232. </style>