TaskCheckList.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426
  1. <template>
  2. <div>
  3. <a-page-header
  4. style="background-color: #FFFFFF;"
  5. title="客户列表"
  6. sub-title=""
  7. @back="showList"
  8. >
  9. <a-descriptions :title="task.taskName" :column="3" :bordered="false">
  10. <a-descriptions-item label="状态"><a-tag :color="task.taskStateColor">{{task.taskStateText}}</a-tag></a-descriptions-item>
  11. <a-descriptions-item label="开始时间">{{task.taskStartTime}}</a-descriptions-item>
  12. <a-descriptions-item label="结束时间">{{task.taskEndTime}}</a-descriptions-item>
  13. <a-descriptions-item label="描述">{{task.description}}</a-descriptions-item>
  14. </a-descriptions>
  15. <a-divider style="margin: 6px;"/>
  16. </a-page-header>
  17. <a-card :bordered="false" style="margin-top: -20px;">
  18. <a-tabs :active-key="currentTab" default-active-key="all" @change="tabChange">
  19. <a-tab-pane key="all" :tab="tabAll"></a-tab-pane>
  20. <a-tab-pane key="undo" :tab="tabUndo"></a-tab-pane>
  21. <a-tab-pane key="uncheck" :tab="tabUncheck"></a-tab-pane>
  22. <a-tab-pane key="checked" :tab="tabChecked"></a-tab-pane>
  23. <a-tab-pane key="passed" :tab="tabPassed"></a-tab-pane>
  24. </a-tabs>
  25. <!-- 查询区域 -->
  26. <div class="table-page-search-wrapper">
  27. <a-form layout="inline" @keyup.enter.native="searchQuery">
  28. <a-row :gutter="24">
  29. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  30. <a-form-item label="客户编号">
  31. <j-input placeholder="请输入客户编号" v-model="queryParam.customerNo"></j-input>
  32. </a-form-item>
  33. </a-col>
  34. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  35. <a-form-item label="客户名称">
  36. <j-input placeholder="请输入客户名称" v-model="queryParam.customerName"></j-input>
  37. </a-form-item>
  38. </a-col>
  39. <template v-if="toggleSearchStatus">
  40. </template>
  41. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  42. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  43. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  44. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  45. <a @click="handleToggleSearch" style="margin-left: 8px">
  46. {{ toggleSearchStatus ? '收起' : '展开' }}
  47. <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
  48. </a>
  49. </span>
  50. </a-col>
  51. </a-row>
  52. </a-form>
  53. </div>
  54. <!-- 查询区域-END -->
  55. <!-- table区域-begin -->
  56. <div>
  57. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  58. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  59. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  60. </div>
  61. <a-table
  62. ref="table"
  63. size="middle"
  64. :scroll="{x:true}"
  65. bordered
  66. rowKey="id"
  67. :columns="columns"
  68. :dataSource="dataSource"
  69. :pagination="ipagination"
  70. :loading="loading"
  71. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  72. class="j-table-force-nowrap"
  73. @change="handleTableChange">
  74. <template slot="action" slot-scope="text, record">
  75. <template v-if="record.checkState === 3 || record.checkState === 4">
  76. <a @click="showCheckCheck(record)">稽核</a>
  77. <a-divider type="vertical" />
  78. </template>
  79. <template v-if="record.checkState >= 4">
  80. <a @click="showCheckLog(record)">历史</a>
  81. <a-divider type="vertical" />
  82. </template>
  83. <template v-if="record.checkState != 3 && record.checkState != 5">
  84. <a @click="noticeDeal(record)">催办</a>
  85. <a-divider type="vertical" />
  86. </template>
  87. <a-dropdown>
  88. <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  89. <a-menu slot="overlay">
  90. <a-menu-item>
  91. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  92. <a>删除</a>
  93. </a-popconfirm>
  94. </a-menu-item>
  95. </a-menu>
  96. </a-dropdown>
  97. </template>
  98. <template v-slot:customerName="text, record">
  99. <a @click="showCheckDetail(record)">{{text}}</a>
  100. </template>
  101. <template v-slot:checkState="status">
  102. <a-badge :status="status | statusTypeFilter" :text="status | statusFilter"/>
  103. </template>
  104. </a-table>
  105. </div>
  106. <!-- table区域 end -->
  107. </a-card>
  108. </div>
  109. </template>
  110. <script>
  111. import { postAction, getAction, httpAction } from '@api/manage'
  112. import '@/assets/less/TableExpand.less'
  113. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  114. export default {
  115. name: 'TaskCheckList',
  116. mixins:[JeecgListMixin],
  117. inject:['closeCurrent'],
  118. data () {
  119. return {
  120. description: '稽核详情页面',
  121. currentTab: 'all',
  122. currentCheckState: null,
  123. task:{
  124. id: '',
  125. taskName: '',
  126. taskStartTime: '',
  127. taskEndTime: '',
  128. description: '',
  129. taskState: 0,
  130. taskStateText: '',
  131. taskStateColor: '',
  132. },
  133. tabAll: '全部(0)',
  134. tabUndo: '未完善(0)',
  135. tabUncheck: '待稽核(0)',
  136. tabChecked: '待整改(0)',
  137. tabPassed: '稽核通过(0)',
  138. count: 0,
  139. undoCount: 0,
  140. uncheckCount: 0,
  141. checkedCount: 0,
  142. passedCount: 0,
  143. columns: [
  144. {
  145. title: '#',
  146. dataIndex: '',
  147. key:'rowIndex',
  148. width:60,
  149. align:"center",
  150. customRender:function (t,r,index) {
  151. return parseInt(index)+1;
  152. }
  153. },
  154. {
  155. title:'客户编号',
  156. align:"center",
  157. dataIndex: 'customerNo'
  158. },
  159. {
  160. title:'客户名称',
  161. align:"center",
  162. dataIndex: 'customerName',
  163. scopedSlots: { customRender: 'customerName' }
  164. },
  165. {
  166. title:'服务号码(全)',
  167. align:"center",
  168. dataIndex: 'smsNumber'
  169. },
  170. {
  171. title:'用户编号',
  172. align:"center",
  173. dataIndex: 'userNo'
  174. },
  175. {
  176. title:'入网时间',
  177. align:"center",
  178. dataIndex: 'networkAccessTime'
  179. },
  180. {
  181. title:'用户状态',
  182. align:"center",
  183. dataIndex: 'userState'
  184. },
  185. {
  186. title:'员工姓名',
  187. align:"center",
  188. dataIndex: 'staffName'
  189. },
  190. {
  191. title:'员工工号',
  192. align:"center",
  193. dataIndex: 'staffNo'
  194. },
  195. {
  196. title:'稽核进度',
  197. align:"center",
  198. sorter: true,
  199. dataIndex: 'checkState',
  200. scopedSlots: { customRender: 'checkState' }
  201. },
  202. {
  203. title: '操作',
  204. dataIndex: 'action',
  205. align:"center",
  206. fixed:"right",
  207. width: 160,
  208. scopedSlots: { customRender: 'action' }
  209. }
  210. ],
  211. isorter:{
  212. column: 'checkState',
  213. order: 'asc',
  214. },
  215. url: {
  216. queryTask: "/smsCheck/task/queryById",
  217. list: "/smsCheck/customerInfo/list",
  218. count: "/smsCheck/customerInfo/count",
  219. delete: "/smsCheck/customerInfo/delete",
  220. edit: "/smsCheck/customerInfo/edit",
  221. notice: "/smsCheck/customerInfo/notice",
  222. },
  223. autoSearch: false,
  224. }
  225. },
  226. created() {
  227. this.task.id = this.$route.query.id;
  228. this.queryTaskById(this.task.id);
  229. this.queryParam.taskId = this.task.id;
  230. this.loadData();
  231. this.loadTabNumber(this.task.id);
  232. },
  233. filters: {
  234. statusTypeFilter(type) {
  235. const statusTypeMap = {
  236. '0': 'error',
  237. '1': 'error',
  238. '2': 'warning',
  239. '3': 'warning',
  240. '4': 'processing',
  241. '5': 'success'
  242. }
  243. return statusTypeMap[type]
  244. },
  245. statusFilter(status) {
  246. const statusMap = {
  247. '0': '未完善',
  248. '1': '未完善',
  249. '2': '待稽核',
  250. '3': '待稽核',
  251. '4': '待整改',
  252. '5': '通过'
  253. }
  254. return statusMap[status]
  255. }
  256. },
  257. methods: {
  258. // 显示列表页面
  259. showList() {
  260. this.$router.go(-1);
  261. this.closeCurrent();
  262. },
  263. // 显示列表页面
  264. showCheckCheck(record) {
  265. this.$router.push({ path: '/sms/check/task/check/check', query: { id: record.id}});
  266. },
  267. // 显示稽核详情页面
  268. showCheckDetail(record) {
  269. this.$router.push({ path: '/sms/check/task/check/detail', query:{id:record.id}});
  270. },
  271. // 显示稽核历史页面
  272. showCheckLog(record) {
  273. this.$router.push({ path: '/sms/check/task/check/log',query:{id:record.id}});
  274. },
  275. // 构建任务信息
  276. buildTaskInfo(record) {
  277. let taskInfo = Object.assign({}, this.task);
  278. taskInfo.count = this.count;
  279. taskInfo.undoCount = this.undoCount;
  280. taskInfo.uncheckCount = this.uncheckCount;
  281. taskInfo.checkedCount = this.checkedCount;
  282. taskInfo.passedCount = this.passedCount;
  283. return {
  284. task: this.task,
  285. info: record
  286. }
  287. },
  288. handleCancel () {
  289. this.visible = false;
  290. },
  291. detail (record) {
  292. this.model = Object.assign({}, record);
  293. this.visible = true;
  294. },
  295. searchQuery() {
  296. this.loadData(1);
  297. this.selectedRowKeys = [];
  298. this.selectionRows = [];
  299. this.loadTabNumber(this.task.id);
  300. },
  301. searchReset() {
  302. this.queryParam = {};
  303. this.queryParam.taskId = this.task.id;
  304. this.queryParam.checkState_MultiString = this.currentCheckState;
  305. this.tabChange('all');
  306. this.loadTabNumber(this.queryParam.taskId);
  307. },
  308. tabChange (key) {
  309. // 稽核状态(0:未处理;1:未完善;2:待稽核;3:待整改;4:已整改;5:稽核通过;)
  310. if (key === 'all') {
  311. this.currentCheckState = null;
  312. this.queryParam.checkState_MultiString = this.currentCheckState;
  313. this.currentTab = 'all';
  314. } else if (key === 'undo') {
  315. this.currentCheckState = '0,1';
  316. this.queryParam.checkState_MultiString = this.currentCheckState;
  317. this.currentTab = 'undo';
  318. } else if (key === 'uncheck') {
  319. this.currentCheckState = '2,3';
  320. this.queryParam.checkState_MultiString = this.currentCheckState;
  321. this.currentTab = 'uncheck';
  322. } else if (key === 'checked') {
  323. this.currentCheckState = '4';
  324. this.queryParam.checkState_MultiString = this.currentCheckState;
  325. this.currentTab = 'checked';
  326. } else if (key === 'passed') {
  327. this.currentCheckState = '5';
  328. this.queryParam.checkState_MultiString = this.currentCheckState;
  329. this.currentTab = 'passed';
  330. }
  331. this.loadData(1);
  332. },
  333. loadTabNumber (taskId) {
  334. let url = this.url.count;
  335. let params = {
  336. id: taskId
  337. }
  338. let that = this;
  339. getAction(url, params).then(res => {
  340. let { result } = res;
  341. if (result) {
  342. that.count = result.count;
  343. that.undoCount = result.undoCount;
  344. that.uncheckCount = result.uncheckCount;
  345. that.checkedCount = result.checkedCount;
  346. that.passedCount = result.passedCount;
  347. that.tabAll= '全部(' + result.count + ')';
  348. that.tabUndo= '未完善(' + result.undoCount + ')';
  349. that.tabUncheck= '待稽核(' + result.uncheckCount + ')';
  350. that.tabChecked= '待整改(' + result.checkedCount + ')';
  351. that.tabPassed= '稽核通过(' + result.passedCount + ')';
  352. }
  353. }).finally(() => {
  354. })
  355. },
  356. noticeDeal (record) {
  357. let url = this.url.notice;
  358. let params = {
  359. customerName: record.customerName,
  360. smsNumber: record.smsNumber,
  361. staffNo: record.staffNo,
  362. userNo: record.userNo,
  363. }
  364. let that = this;
  365. postAction(url, params).then(res => {
  366. let { result } = res;
  367. if (res.success) {
  368. that.$message.info('已通知客户经理,进行材料补充!');
  369. }
  370. }).finally(() => {
  371. })
  372. },
  373. queryTaskById (id) {
  374. let url = this.url.queryTask;
  375. let params = {
  376. id: id
  377. }
  378. let that = this;
  379. getAction(url, params).then(res => {
  380. if (res.success) {
  381. that.task = res.result;
  382. that.getTaskState(that.task.taskState);
  383. }
  384. }).finally(() => {
  385. })
  386. },
  387. getTaskState(taskState) {
  388. if (taskState === 0) {
  389. this.task.taskStateColor = '#fadb14';
  390. this.task.taskStateText = '未开始';
  391. } else if (taskState === 1) {
  392. this.task.taskStateColor = '#1890ff';
  393. this.task.taskStateText = '稽核中';
  394. } else if (taskState === 2) {
  395. this.task.taskStateColor = '#52c41a';
  396. this.task.taskStateText = '稽核完成';
  397. }
  398. }
  399. }
  400. }
  401. </script>
  402. <style scoped>
  403. </style>