TaskCheckList.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574
  1. <template>
  2. <div>
  3. <a-page-header
  4. style="background-color: #FFFFFF;"
  5. title="客户列表"
  6. sub-title=""
  7. @back="goBack"
  8. >
  9. <a-descriptions :title="task.taskName" :column="3" :bordered="false">
  10. <a-descriptions-item label="状态">
  11. <a-tag :color="task.taskStateColor">{{ task.taskStateText }}</a-tag>
  12. </a-descriptions-item>
  13. <a-descriptions-item label="开始时间">{{ task.taskStartTime }}</a-descriptions-item>
  14. <a-descriptions-item label="结束时间">{{ task.taskEndTime }}</a-descriptions-item>
  15. <!-- <a-descriptions-item label="描述"><span v-html="task.description"></span></a-descriptions-item>-->
  16. </a-descriptions>
  17. <a-divider style="margin: 6px;"/>
  18. </a-page-header>
  19. <a-card :bordered="false" style="margin-top: -20px;">
  20. <a-tabs :active-key="currentTab" default-active-key="all" @change="tabChange">
  21. <a-tab-pane key="all" :tab="tabAll"></a-tab-pane>
  22. <a-tab-pane key="noUp" :tab="noUp"></a-tab-pane>
  23. <a-tab-pane key="undo" :tab="tabUndo"></a-tab-pane>
  24. <a-tab-pane key="uncheck" :tab="tabUncheck"></a-tab-pane>
  25. <a-tab-pane key="checked" :tab="tabChecked"></a-tab-pane>
  26. <a-tab-pane key="passed" :tab="tabPassed"></a-tab-pane>
  27. </a-tabs>
  28. <!-- 查询区域 -->
  29. <div class="table-page-search-wrapper">
  30. <a-form layout="inline" @keyup.enter.native="searchQuery">
  31. <a-row :gutter="24">
  32. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  33. <a-form-item label="客户编号">
  34. <j-input placeholder="请输入客户编号" v-model="queryParam.customerNo"></j-input>
  35. </a-form-item>
  36. </a-col>
  37. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  38. <a-form-item label="客户名称">
  39. <j-input placeholder="请输入客户名称" v-model="queryParam.customerName"></j-input>
  40. </a-form-item>
  41. </a-col>
  42. <template v-if="toggleSearchStatus">
  43. </template>
  44. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  45. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  46. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  47. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  48. <a @click="handleToggleSearch" style="margin-left: 8px">
  49. {{ toggleSearchStatus ? '收起' : '展开' }}
  50. <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
  51. </a>
  52. </span>
  53. </a-col>
  54. </a-row>
  55. </a-form>
  56. </div>
  57. <!-- 查询区域-END -->
  58. <!-- 操作按钮区域 -->
  59. <div class="table-operator">
  60. <a-button type="primary" icon="download" @click="handleExportXls('客户列表')">导出</a-button>
  61. <!-- 高级查询区域 -->
  62. <a-dropdown v-if="selectedRowKeys.length > 0">
  63. <a-menu slot="overlay">
  64. <a-menu-item key="1" @click="batchDel" v-has="'task:check:list:delete'">
  65. <a-icon type="delete"/>
  66. 删除
  67. </a-menu-item>
  68. </a-menu>
  69. <a-button style="margin-left: 8px"> 批量操作
  70. <a-icon type="down"/>
  71. </a-button>
  72. </a-dropdown>
  73. </div>
  74. <!-- table区域-begin -->
  75. <div>
  76. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  77. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a
  78. style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  79. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  80. </div>
  81. <a-table
  82. ref="table"
  83. size="middle"
  84. :scroll="{x:true}"
  85. bordered
  86. rowKey="id"
  87. :columns="columns"
  88. :dataSource="dataSource"
  89. :pagination="ipagination"
  90. :loading="loading"
  91. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  92. class="j-table-force-nowrap"
  93. @change="handleTableChange">
  94. <template slot="action" slot-scope="text, record">
  95. <span v-has="'lot:task:check:list:upload:improve'" v-if="record.checkState == 0 || record.checkState == 1">
  96. <a @click="showImproveAndUpload(record)">上传资料</a>
  97. <a-divider type="vertical"/>
  98. </span>
  99. <span v-has="'lot:task:check:list:upload:rectification'" v-if="record.checkState == 4">
  100. <a @click="showImproveAndUploadZg(record)">整改</a>
  101. <a-divider type="vertical"/>
  102. </span>
  103. <span v-has="'lot:task:check:list:submit'" v-if="record.checkState == 1 || record.checkState == 4">
  104. <a @click="handSubmit(record)">提交</a>
  105. <a-divider type="vertical"/>
  106. </span>
  107. <span v-has="'lot:task:check:list:audit'" v-if="record.checkState === 2 || record.checkState === 3">
  108. <a @click="showCheckCheck(record)">稽核</a>
  109. <a-divider type="vertical"/>
  110. </span>
  111. <span v-has="'lot:task:check:list:audit:resetting'" v-if="record.checkState === 5">
  112. <a @click="showCheckCheck(record)">查看数据</a>
  113. <a-divider type="vertical"/>
  114. </span>
  115. <span v-has="'lot:task:check:list:history'" v-if="record.checkState >= 4">
  116. <a @click="showCheckLog(record)">历史</a>
  117. <a-divider type="vertical"/>
  118. </span>
  119. <span v-has="'lot:task:check:list:notice'"
  120. v-if="record.checkState != 2 && record.checkState != 3 && record.checkState != 5">
  121. <a @click="noticeDeal(record)">催办</a>
  122. <a-divider type="vertical"/>
  123. </span>
  124. <a-dropdown>
  125. <a class="ant-dropdown-link">更多
  126. <a-icon type="down"/>
  127. </a>
  128. <a-menu slot="overlay">
  129. <a-menu-item>
  130. <a-popconfirm>
  131. <a>详情</a>
  132. </a-popconfirm>
  133. </a-menu-item>
  134. <a-menu-item v-has="'task:check:list:delete'">
  135. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  136. <a>删除</a>
  137. </a-popconfirm>
  138. </a-menu-item>
  139. <a-menu-item v-has="'task:check:list:clear'">
  140. <a-popconfirm title="确定清空吗?" @confirm="() => dataDelete(record.id)">
  141. <a>清空</a>
  142. </a-popconfirm>
  143. </a-menu-item>
  144. </a-menu>
  145. </a-dropdown>
  146. </template>
  147. <template v-slot:customerName="text, record">
  148. <a @click="showCheckDetail(record)">{{ text }}</a>
  149. </template>
  150. <template v-slot:checkState="status">
  151. <a-badge :status="status | statusTypeFilter" :text="status | statusFilter"/>
  152. </template>
  153. <template v-slot:rowIndex="text,records,index">
  154. {{ (ipagination.current - 1) * ipagination.pageSize + Number(index) + 1 }}
  155. </template>
  156. </a-table>
  157. </div>
  158. <!-- table区域 end -->
  159. </a-card>
  160. </div>
  161. </template>
  162. <script>
  163. import {postAction, getAction, httpAction, deleteAction} from '@api/manage'
  164. import '@/assets/less/TableExpand.less'
  165. import {JeecgListMixin} from '@/mixins/JeecgListMixin'
  166. export default {
  167. name: 'TaskCheckList',
  168. mixins: [JeecgListMixin],
  169. inject: ['closeCurrent'],
  170. data() {
  171. let _self = this;
  172. return {
  173. description: '稽核详情页面',
  174. currentTab: 'all',
  175. currentCheckState: null,
  176. task: {
  177. id: '',
  178. taskName: '',
  179. taskStartTime: '',
  180. taskEndTime: '',
  181. description: '',
  182. taskState: 0,
  183. taskStateText: '',
  184. taskStateColor: '',
  185. },
  186. tabAll: '全部(0)',
  187. noUp: '未处理(0)',
  188. tabUndo: '未完善(0)',
  189. tabUncheck: '待稽核(0)',
  190. tabChecked: '待整改(0)',
  191. tabPassed: '稽核通过(0)',
  192. count: 0,
  193. noUpCount:0,
  194. undoCount: 0,
  195. uncheckCount: 0,
  196. checkedCount: 0,
  197. passedCount: 0,
  198. columns: [
  199. {
  200. title: '#',
  201. dataIndex: '',
  202. key: 'rowIndex',
  203. width: 60,
  204. align: "center",
  205. scopedSlots: {customRender: 'rowIndex'}
  206. },
  207. // {
  208. // title: '客户名称',
  209. // align: "left",
  210. // sorter: true,
  211. // dataIndex: 'customerName',
  212. // scopedSlots: {customRender: 'customerName'}
  213. // },
  214. {
  215. title: '客户编号',
  216. align: "center",
  217. sorter: true,
  218. dataIndex: 'customerNo'
  219. },
  220. // {
  221. // title: '服务号码(全)',
  222. // align: "center",
  223. // dataIndex: 'smsNumber'
  224. // },
  225. {
  226. title: '用户编号',
  227. align: "center",
  228. dataIndex: 'userNo'
  229. },
  230. {
  231. title: '入网时间',
  232. align: "center",
  233. sorter: true,
  234. dataIndex: 'networkAccessTime'
  235. },
  236. {
  237. title: '用户状态',
  238. align: "center",
  239. dataIndex: 'userState',
  240. customRender: function (text, record, index) {
  241. if (text === '1') {
  242. return '在用';
  243. } else if (text === '2') {
  244. return '拆机';
  245. }
  246. return text;
  247. }
  248. },
  249. {
  250. title: '员工姓名',
  251. align: "center",
  252. dataIndex: 'staffName'
  253. },
  254. {
  255. title: '员工工号',
  256. align: "center",
  257. sorter: true,
  258. dataIndex: 'staffNo'
  259. },
  260. {
  261. title: '员工二级部门',
  262. align: "center",
  263. dataIndex: 'staffDeptLevel2Name'
  264. },
  265. {
  266. title: '员工二级部门编号',
  267. align: "center",
  268. dataIndex: 'staffDeptLevel2No'
  269. },
  270. {
  271. title: '员工三级部门',
  272. align: "center",
  273. dataIndex: 'staffDeptLevel3Name'
  274. },
  275. {
  276. title: '员工三级部门编号',
  277. align: "center",
  278. dataIndex: 'staffDeptLevel3No'
  279. },
  280. {
  281. title: '稽核进度',
  282. align: "center",
  283. sorter: true,
  284. dataIndex: 'checkState',
  285. scopedSlots: {customRender: 'checkState'}
  286. },
  287. {
  288. title: '操作',
  289. dataIndex: 'action',
  290. align: "center",
  291. scopedSlots: {customRender: 'action'}
  292. }
  293. ],
  294. isorter: {
  295. column: 'checkState',
  296. order: 'asc',
  297. },
  298. url: {
  299. "getInfoDataByInfoId": "/smsTurck/customerData/queryDataLogByInfoId",
  300. queryTask: "/smsCheck/task/queryById",
  301. list: "/smsCheck/customerInfo/list",
  302. count: "/smsCheck/customerInfo/count",
  303. delete: "/smsCheck/customerInfo/delete",
  304. edit: "/smsCheck/customerInfo/edit",
  305. notice: "/smsCheck/customerInfo/notice",
  306. editCheck: "/smsCheck/customerInfo/edit/check/state",
  307. dataDelete: "/smsCheck/customerData/clear",
  308. exportXlsUrl: "smsCheck/customerInfo/exportXlsLot",
  309. },
  310. autoSearch: false,
  311. }
  312. },
  313. created() {
  314. this.task.id = this.$route.query.id;
  315. this.queryTaskById(this.task.id);
  316. this.queryParam.taskId = this.task.id;
  317. this.loadData();
  318. this.loadTabNumber(this.task.id);
  319. },
  320. filters: {
  321. statusTypeFilter(type) {
  322. const statusTypeMap = {
  323. '0': 'error',
  324. '1': 'error',
  325. '2': 'warning',
  326. '3': 'warning',
  327. '4': 'processing',
  328. '5': 'success'
  329. }
  330. return statusTypeMap[type]
  331. },
  332. statusFilter(status) {
  333. const statusMap = {
  334. '0': '未处理',
  335. '1': '未完善',
  336. '2': '待稽核',
  337. '3': '待稽核',
  338. '4': '待整改',
  339. '5': '通过'
  340. }
  341. return statusMap[status]
  342. }
  343. },
  344. methods: {
  345. // 返回上一级
  346. goBack() {
  347. this.$router.go(-1);
  348. //关闭当前页面
  349. this.closeCurrent();
  350. },
  351. // 上传客户资料
  352. showImproveAndUpload(record){
  353. this.$router.push({path: '/lot/check/data/upload', query: {id: record.id}});
  354. },
  355. showImproveAndUploadZg(record){
  356. this.$router.push({path: '/lotCheck/modules/TaskCheckAudit', query: {id: record.id}});
  357. },
  358. // 显示完善页面
  359. showImprove(record) {
  360. this.$router.push({path: '/sms/check/data/edit', query: {id: record.id}});
  361. },
  362. // 显示上传页面
  363. showUpload(record) {
  364. this.$router.push({path: '/sms/check/data/upload', query: {id: record.id}});
  365. },
  366. // 显示上传页面
  367. handSubmit(record) {
  368. let that = this;
  369. let model = {
  370. id: record.id,
  371. }
  372. postAction(this.url.editCheck, model)
  373. .then((res) => {
  374. if (res.success) {
  375. that.$message.success(res.message)
  376. that.loadData(that.ipagination.current);
  377. } else {
  378. that.$message.warning(res.message)
  379. }
  380. }).finally(() => {
  381. })
  382. },
  383. dataDelete(id) {
  384. var that = this;
  385. deleteAction(that.url.dataDelete, {infoId: id}).then((res) => {
  386. if (res.success) {
  387. that.$message.success('附件资料清空完成!');
  388. } else {
  389. that.$message.warning('附件资料清空失败!');
  390. }
  391. });
  392. },
  393. // 稽核点击事件
  394. showCheckCheck(record) {
  395. this.$router.push({path: '/lotCheck/modules/TaskCheckAudit', query: {id: record.id}});
  396. },
  397. // 显示稽核详情页面
  398. showCheckDetail(record) {
  399. this.$router.push({path: '/lotCheck/modules/TaskCheckDetails', query: {id: record.id}});
  400. },
  401. // 显示稽核历史页面
  402. showCheckLog(record) {
  403. this.$router.push({path: '/sms/check/task/check/log', query: {id: record.id}});
  404. },
  405. // 构建任务信息
  406. buildTaskInfo(record) {
  407. let taskInfo = Object.assign({}, this.task);
  408. taskInfo.count = this.count;
  409. taskInfo.undoCount = this.undoCount;
  410. taskInfo.uncheckCount = this.uncheckCount;
  411. taskInfo.checkedCount = this.checkedCount;
  412. taskInfo.passedCount = this.passedCount;
  413. return {
  414. task: this.task,
  415. info: record
  416. }
  417. },
  418. handleCancel() {
  419. this.visible = false;
  420. },
  421. detail(record) {
  422. this.model = Object.assign({}, record);
  423. this.visible = true;
  424. },
  425. searchQuery() {
  426. this.loadData(1);
  427. this.selectedRowKeys = [];
  428. this.selectionRows = [];
  429. this.loadTabNumber(this.task.id);
  430. },
  431. searchReset() {
  432. this.queryParam = {};
  433. this.queryParam.taskId = this.task.id;
  434. this.queryParam.checkState_MultiString = this.currentCheckState;
  435. this.tabChange('all');
  436. this.loadTabNumber(this.queryParam.taskId);
  437. },
  438. tabChange(key) {
  439. // 稽核状态(0:未处理;1:未完善;2:待稽核;3:待整改;4:已整改;5:稽核通过;)
  440. if (key === 'all') {
  441. this.currentCheckState = null;
  442. this.queryParam.checkState_MultiString = this.currentCheckState;
  443. this.currentTab = 'all';
  444. } else if (key === 'undo') {
  445. this.currentCheckState = '1';
  446. this.queryParam.checkState_MultiString = this.currentCheckState;
  447. this.currentTab = 'undo';
  448. } else if (key === 'uncheck') {
  449. this.currentCheckState = '2,3';
  450. this.queryParam.checkState_MultiString = this.currentCheckState;
  451. this.currentTab = 'uncheck';
  452. } else if (key === 'checked') {
  453. this.currentCheckState = '4';
  454. this.queryParam.checkState_MultiString = this.currentCheckState;
  455. this.currentTab = 'checked';
  456. } else if (key === 'passed') {
  457. this.currentCheckState = '5';
  458. this.queryParam.checkState_MultiString = this.currentCheckState;
  459. this.currentTab = 'passed';
  460. }else if (key === 'noUp') {
  461. this.currentCheckState = '0';
  462. this.queryParam.checkState_MultiString = this.currentCheckState;
  463. this.currentTab = 'noUp';
  464. }
  465. this.loadData(1);
  466. },
  467. loadTabNumber(taskId) {
  468. let url = this.url.count;
  469. let params = {
  470. id: taskId
  471. }
  472. let that = this;
  473. getAction(url, params).then(res => {
  474. let {result} = res;
  475. if (result) {
  476. that.count = result.count;
  477. that.undoCount = result.undoCount;
  478. that.uncheckCount = result.uncheckCount;
  479. that.checkedCount = result.checkedCount;
  480. that.passedCount = result.passedCount;
  481. that.noUpCount = result.noUpCount;
  482. that.tabAll = '全部(' + result.count + ')';
  483. that.noUp= '未处理(' + result.noUpCount + ')';
  484. that.tabUndo = '未完善(' + result.undoCount + ')';
  485. that.tabUncheck = '待稽核(' + result.uncheckCount + ')';
  486. that.tabChecked = '待整改(' + result.checkedCount + ')';
  487. that.tabPassed = '稽核通过(' + result.passedCount + ')';
  488. }
  489. }).finally(() => {
  490. })
  491. },
  492. noticeDeal(record) {
  493. let url = this.url.notice;
  494. let params = {
  495. customerName: record.customerName,
  496. smsNumber: record.smsNumber,
  497. staffNo: record.staffNo,
  498. userNo: record.userNo,
  499. }
  500. let that = this;
  501. postAction(url, params).then(res => {
  502. let {result} = res;
  503. if (res.success) {
  504. that.$message.info('已通知客户经理,进行材料补充!');
  505. }
  506. }).finally(() => {
  507. })
  508. },
  509. queryTaskById(id) {
  510. let url = this.url.queryTask;
  511. let params = {
  512. id: id
  513. }
  514. let that = this;
  515. getAction(url, params).then(res => {
  516. if (res.success) {
  517. that.task = res.result;
  518. that.getTaskState(that.task.taskState);
  519. }
  520. }).finally(() => {
  521. })
  522. },
  523. getTaskState(taskState) {
  524. if (taskState === 0) {
  525. this.task.taskStateColor = '#fadb14';
  526. this.task.taskStateText = '未开始';
  527. } else if (taskState === 1) {
  528. this.task.taskStateColor = '#1890ff';
  529. this.task.taskStateText = '稽核中';
  530. } else if (taskState === 2) {
  531. this.task.taskStateColor = '#52c41a';
  532. this.task.taskStateText = '稽核完成';
  533. }
  534. }
  535. }
  536. }
  537. </script>
  538. <style scoped>
  539. </style>