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="'truck: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="'truck:task:check:list:audit'" v-if="record.checkState === 2 || record.checkState === 3">
  100. <a @click="showCheckCheck(record)">稽核</a>
  101. <a-divider type="vertical"/>
  102. </span>
  103. <span v-has="'truck:check:list:selectData'" v-if="record.checkState === 5">
  104. <a @click="selectData(record)">查看数据</a>
  105. <a-divider type="vertical" />
  106. </span>
  107. <span v-has="'truck:check:list:history'" v-if="record.checkState === 4">
  108. <a @click="showImproveGZ(record)">整改</a>
  109. <a-divider type="vertical" />
  110. </span>
  111. <span v-has="'truck:task:check:list:notice'"
  112. v-if="record.checkState != 2 && record.checkState != 3 && record.checkState != 5">
  113. <a @click="noticeDeal(record)">催办</a>
  114. <a-divider type="vertical"/>
  115. </span>
  116. <a-dropdown>
  117. <a class="ant-dropdown-link">更多
  118. <a-icon type="down"/>
  119. </a>
  120. <a-menu slot="overlay">
  121. <a-menu-item v-has="'task:check:list:delete'">
  122. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  123. <a>删除</a>
  124. </a-popconfirm>
  125. </a-menu-item>
  126. <a-menu-item v-has="'task:check:list:clear'">
  127. <a-popconfirm title="确定清空吗?" @confirm="() => dataDelete(record.id)">
  128. <a>清空</a>
  129. </a-popconfirm>
  130. </a-menu-item>
  131. </a-menu>
  132. </a-dropdown>
  133. </template>
  134. <template v-slot:customerName="text, record">
  135. <a @click="showCheckDetail(record)">{{ text }}</a>
  136. </template>
  137. <template v-slot:checkState="status">
  138. <a-badge :status="status | statusTypeFilter" :text="status | statusFilter"/>
  139. </template>
  140. <template v-slot:rowIndex="text,records,index">
  141. {{ (ipagination.current - 1) * ipagination.pageSize + Number(index) + 1 }}
  142. </template>
  143. </a-table>
  144. </div>
  145. <!-- table区域 end -->
  146. </a-card>
  147. </div>
  148. </template>
  149. <script>
  150. import {postAction, getAction, httpAction, deleteAction} from '@api/manage'
  151. import '@/assets/less/TableExpand.less'
  152. import {JeecgListMixin} from '@/mixins/JeecgListMixin'
  153. export default {
  154. name: 'TaskCheckList',
  155. mixins: [JeecgListMixin],
  156. inject: ['closeCurrent'],
  157. data() {
  158. let _self = this;
  159. return {
  160. description: '稽核详情页面',
  161. currentTab: 'all',
  162. currentCheckState: null,
  163. task: {
  164. id: '',
  165. taskName: '',
  166. taskStartTime: '',
  167. taskEndTime: '',
  168. description: '',
  169. taskState: 0,
  170. taskStateText: '',
  171. taskStateColor: '',
  172. },
  173. tabAll: '全部(0)',
  174. noUp: '未处理(0)',
  175. tabUndo: '未完善(0)',
  176. tabUncheck: '待稽核(0)',
  177. tabChecked: '待整改(0)',
  178. tabPassed: '稽核通过(0)',
  179. count: 0,
  180. noUpCount:0,
  181. undoCount: 0,
  182. uncheckCount: 0,
  183. checkedCount: 0,
  184. passedCount: 0,
  185. columns: [
  186. {
  187. title: '#',
  188. dataIndex: '',
  189. key:'rowIndex',
  190. width:60,
  191. align:"center",
  192. scopedSlots: { customRender: 'rowIndex' }
  193. },
  194. // {
  195. // title:'客户名称',
  196. // align:"left",
  197. // sorter: true,
  198. // dataIndex: 'customerName',
  199. // scopedSlots: { customRender: 'customerName' }
  200. // },
  201. {
  202. title:'客户编号',
  203. align:"center",
  204. sorter: true,
  205. dataIndex: 'customerNo'
  206. },
  207. // {
  208. // title:'服务号码(全)',
  209. // align:"center",
  210. // dataIndex: 'smsNumber'
  211. // },
  212. {
  213. title:'用户编号',
  214. align:"center",
  215. dataIndex: 'userNo'
  216. },
  217. {
  218. title:'入网时间',
  219. align:"center",
  220. sorter: true,
  221. dataIndex: 'networkAccessTime'
  222. },
  223. {
  224. title:'用户状态',
  225. align:"center",
  226. dataIndex: 'userState',
  227. customRender:function (text,record,index) {
  228. if (text === '1') {
  229. return '在用';
  230. } else if (text === '2') {
  231. return '拆机';
  232. }
  233. return text;
  234. }
  235. },
  236. {
  237. title:'员工姓名',
  238. align:"center",
  239. dataIndex: 'staffName'
  240. },
  241. {
  242. title:'员工编号',
  243. align:"center",
  244. sorter: true,
  245. dataIndex: 'staffNo'
  246. },
  247. {
  248. title:'稽核进度',
  249. align:"center",
  250. sorter: true,
  251. dataIndex: 'checkState',
  252. scopedSlots: { customRender: 'checkState' }
  253. },
  254. {
  255. title: '员工二级部门',
  256. align: "center",
  257. dataIndex: 'staffDeptLevel2Name'
  258. },
  259. {
  260. title: '员工二级部门编号',
  261. align: "center",
  262. dataIndex: 'staffDeptLevel2No'
  263. },
  264. {
  265. title: '员工三级部门',
  266. align: "center",
  267. dataIndex: 'staffDeptLevel3Name'
  268. },
  269. {
  270. title: '员工三级部门编号',
  271. align: "center",
  272. dataIndex: 'staffDeptLevel3No'
  273. },
  274. {
  275. title: '首次激活时间(固网起租时间)',
  276. align: "center",
  277. dataIndex: 'firstActivationDate'
  278. }, {
  279. title: '账户编码',
  280. align: "center",
  281. dataIndex: 'accountCode'
  282. }, {
  283. title: '楼宇名称',
  284. align: "center",
  285. dataIndex: 'floorName'
  286. }, {
  287. title: '楼宇编号',
  288. align: "center",
  289. dataIndex: 'floorCode'
  290. },
  291. {
  292. title: '操作',
  293. dataIndex: 'action',
  294. align:"center",
  295. scopedSlots: { customRender: 'action' }
  296. }
  297. ],
  298. isorter: {
  299. column: 'checkState',
  300. order: 'asc',
  301. },
  302. url: {
  303. deleteBatch : "smsCheck/customerInfo/deleteBatch",
  304. queryTask: "/smsCheck/task/queryById",
  305. list: "/smsCheck/customerInfo/list",
  306. count: "/smsCheck/customerInfo/count",
  307. delete: "/smsCheck/customerInfo/delete",
  308. edit: "/smsCheck/customerInfo/edit",
  309. notice: "/smsCheck/customerInfo/notice",
  310. editCheck: "/smsCheck/customerInfo/edit/check/state",
  311. dataDelete: "/smsCheck/customerData/clear",
  312. exportXlsUrl: "smsCheck/customerInfo/exportXlsTruck",
  313. },
  314. autoSearch: false,
  315. }
  316. },
  317. created() {
  318. this.task.id = this.$route.query.id;
  319. this.queryTaskById(this.task.id);
  320. this.queryParam.taskId = this.task.id;
  321. this.loadData();
  322. this.loadTabNumber(this.task.id);
  323. },
  324. filters: {
  325. statusTypeFilter(type) {
  326. const statusTypeMap = {
  327. '0': 'error',
  328. '1': 'error',
  329. '2': 'warning',
  330. '3': 'warning',
  331. '4': 'processing',
  332. '5': 'success'
  333. }
  334. return statusTypeMap[type]
  335. },
  336. statusFilter(status) {
  337. const statusMap = {
  338. '0': '未处理',
  339. '1': '未完善',
  340. '2': '待稽核',
  341. '3': '待稽核',
  342. '4': '待整改',
  343. '5': '通过'
  344. }
  345. return statusMap[status]
  346. }
  347. },
  348. methods: {
  349. // 整改
  350. showImproveGZ(record) {
  351. this.$router.push({path: '/truckCheck/modules/TaskCheckAudit', query: {id: record.id}});
  352. },
  353. // 历史
  354. selectData(record) {
  355. this.$router.push({path: '/truckCheck/modules/TaskCheckAudit', query: {id: record.id}});
  356. },
  357. // 返回上一级
  358. goBack() {
  359. this.$router.go(-1);
  360. //关闭当前页面
  361. this.closeCurrent();
  362. },
  363. // 上传客户资料
  364. showImproveAndUpload(record){
  365. this.$router.push({path: '/truck/check/data/upload', query: {id: record.id}});
  366. },
  367. // 显示完善页面
  368. showImprove(record) {
  369. this.$router.push({path: '/sms/check/data/edit', query: {id: record.id}});
  370. },
  371. // 显示上传页面
  372. showUpload(record) {
  373. this.$router.push({path: '/sms/check/data/upload', query: {id: record.id}});
  374. },
  375. // 显示上传页面
  376. handSubmit(record) {
  377. let that = this;
  378. let model = {
  379. id: record.id,
  380. }
  381. postAction(this.url.editCheck, model)
  382. .then((res) => {
  383. if (res.success) {
  384. that.$message.success(res.message)
  385. that.loadData(that.ipagination.current);
  386. } else {
  387. that.$message.warning(res.message)
  388. }
  389. }).finally(() => {
  390. })
  391. },
  392. dataDelete(id) {
  393. var that = this;
  394. deleteAction(that.url.dataDelete, {infoId: id}).then((res) => {
  395. if (res.success) {
  396. that.$message.success('附件资料清空完成!');
  397. } else {
  398. that.$message.warning('附件资料清空失败!');
  399. }
  400. });
  401. },
  402. // 稽核点击事件
  403. showCheckCheck(record) {
  404. this.$router.push({path: '/truckCheck/modules/TaskCheckAudit', query: {id: record.id}});
  405. },
  406. // 显示稽核详情页面
  407. showCheckDetail(record) {
  408. this.$router.push({path: '/truckCheck/modules/TaskCheckDetails', query: {id: record.id}});
  409. },
  410. // 显示稽核历史页面
  411. showCheckLog(record) {
  412. this.$router.push({path: '/sms/check/task/check/log', query: {id: record.id}});
  413. },
  414. // 构建任务信息
  415. buildTaskInfo(record) {
  416. let taskInfo = Object.assign({}, this.task);
  417. taskInfo.count = this.count;
  418. taskInfo.undoCount = this.undoCount;
  419. taskInfo.uncheckCount = this.uncheckCount;
  420. taskInfo.checkedCount = this.checkedCount;
  421. taskInfo.passedCount = this.passedCount;
  422. return {
  423. task: this.task,
  424. info: record
  425. }
  426. },
  427. handleCancel() {
  428. this.visible = false;
  429. },
  430. detail(record) {
  431. this.model = Object.assign({}, record);
  432. this.visible = true;
  433. },
  434. searchQuery() {
  435. this.loadData(1);
  436. this.selectedRowKeys = [];
  437. this.selectionRows = [];
  438. this.loadTabNumber(this.task.id);
  439. },
  440. searchReset() {
  441. this.queryParam = {};
  442. this.queryParam.taskId = this.task.id;
  443. this.queryParam.checkState_MultiString = this.currentCheckState;
  444. this.tabChange('all');
  445. this.loadTabNumber(this.queryParam.taskId);
  446. },
  447. tabChange(key) {
  448. // 稽核状态(0:未处理;1:未完善;2:待稽核;3:待整改;4:已整改;5:稽核通过;)
  449. if (key === 'all') {
  450. this.currentCheckState = null;
  451. this.queryParam.checkState_MultiString = this.currentCheckState;
  452. this.currentTab = 'all';
  453. } else if (key === 'undo') {
  454. this.currentCheckState = '1';
  455. this.queryParam.checkState_MultiString = this.currentCheckState;
  456. this.currentTab = 'undo';
  457. } else if (key === 'uncheck') {
  458. this.currentCheckState = '2,3';
  459. this.queryParam.checkState_MultiString = this.currentCheckState;
  460. this.currentTab = 'uncheck';
  461. } else if (key === 'checked') {
  462. this.currentCheckState = '4';
  463. this.queryParam.checkState_MultiString = this.currentCheckState;
  464. this.currentTab = 'checked';
  465. } else if (key === 'passed') {
  466. this.currentCheckState = '5';
  467. this.queryParam.checkState_MultiString = this.currentCheckState;
  468. this.currentTab = 'passed';
  469. } else if (key === 'noUp') {
  470. this.currentCheckState = '0';
  471. this.queryParam.checkState_MultiString = this.currentCheckState;
  472. this.currentTab = 'noUp';
  473. }
  474. this.loadData(1);
  475. },
  476. loadTabNumber(taskId) {
  477. let url = this.url.count;
  478. let params = {
  479. id: taskId
  480. }
  481. let that = this;
  482. getAction(url, params).then(res => {
  483. let {result} = res;
  484. if (result) {
  485. that.count = result.count;
  486. that.undoCount = result.undoCount;
  487. that.uncheckCount = result.uncheckCount;
  488. that.checkedCount = result.checkedCount;
  489. that.passedCount = result.passedCount;
  490. that.noUpCount = result.noUpCount;
  491. that.tabAll = '全部(' + result.count + ')';
  492. that.noUp= '未处理(' + result.noUpCount + ')';
  493. that.tabUndo = '未完善(' + result.undoCount + ')';
  494. that.tabUncheck = '待稽核(' + result.uncheckCount + ')';
  495. that.tabChecked = '待整改(' + result.checkedCount + ')';
  496. that.tabPassed = '稽核通过(' + result.passedCount + ')';
  497. }
  498. }).finally(() => {
  499. })
  500. },
  501. noticeDeal(record) {
  502. let url = this.url.notice;
  503. let params = {
  504. customerName: record.customerName,
  505. smsNumber: record.smsNumber,
  506. staffNo: record.staffNo,
  507. userNo: record.userNo,
  508. }
  509. let that = this;
  510. postAction(url, params).then(res => {
  511. let {result} = res;
  512. if (res.success) {
  513. that.$message.info('已通知客户经理,进行材料补充!');
  514. }
  515. }).finally(() => {
  516. })
  517. },
  518. queryTaskById(id) {
  519. let url = this.url.queryTask;
  520. let params = {
  521. id: id
  522. }
  523. let that = this;
  524. getAction(url, params).then(res => {
  525. if (res.success) {
  526. that.task = res.result;
  527. that.getTaskState(that.task.taskState);
  528. }
  529. }).finally(() => {
  530. })
  531. },
  532. getTaskState(taskState) {
  533. if (taskState === 0) {
  534. this.task.taskStateColor = '#fadb14';
  535. this.task.taskStateText = '未开始';
  536. } else if (taskState === 1) {
  537. this.task.taskStateColor = '#1890ff';
  538. this.task.taskStateText = '稽核中';
  539. } else if (taskState === 2) {
  540. this.task.taskStateColor = '#52c41a';
  541. this.task.taskStateText = '稽核完成';
  542. }
  543. }
  544. }
  545. }
  546. </script>
  547. <style scoped>
  548. </style>