index.vue 8.5 KB

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