TaskCheckList.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643
  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="'task:check:list:selectDataDown'">
  108. <a @click="getFileUrls(record)">下载资料</a>
  109. <a-divider type="vertical" />
  110. </span>
  111. <span v-has="'truck:check:list:history'" v-if="record.checkState === 4">
  112. <a @click="showImproveGZ(record)">整改</a>
  113. <a-divider type="vertical" />
  114. </span>
  115. <span v-has="'truck:task:check:list:notice'"
  116. v-if="record.checkState != 2 && record.checkState != 3 && record.checkState != 5">
  117. <a @click="noticeDeal(record)">催办</a>
  118. <a-divider type="vertical"/>
  119. </span>
  120. <a-dropdown>
  121. <a class="ant-dropdown-link">更多
  122. <a-icon type="down"/>
  123. </a>
  124. <a-menu slot="overlay">
  125. <a-menu-item v-has="'task:check:list:delete'">
  126. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  127. <a>删除</a>
  128. </a-popconfirm>
  129. </a-menu-item>
  130. <a-menu-item v-has="'task:check:list:clear'">
  131. <a-popconfirm title="确定清空吗?" @confirm="() => dataDelete(record.id)">
  132. <a>清空</a>
  133. </a-popconfirm>
  134. </a-menu-item>
  135. </a-menu>
  136. </a-dropdown>
  137. </template>
  138. <template v-slot:customerName="text, record">
  139. <a @click="showCheckDetail(record)">{{ text }}</a>
  140. </template>
  141. <template v-slot:checkState="status">
  142. <a-badge :status="status | statusTypeFilter" :text="status | statusFilter"/>
  143. </template>
  144. <template v-slot:rowIndex="text,records,index">
  145. {{ (ipagination.current - 1) * ipagination.pageSize + Number(index) + 1 }}
  146. </template>
  147. </a-table>
  148. </div>
  149. <!-- table区域 end -->
  150. </a-card>
  151. </div>
  152. </template>
  153. <script>
  154. import {postAction, getAction, httpAction, deleteAction} from '@api/manage'
  155. import '@/assets/less/TableExpand.less'
  156. import {JeecgListMixin} from '@/mixins/JeecgListMixin'
  157. import JSZip from 'jszip'
  158. import FileSaver from 'file-saver'
  159. export default {
  160. name: 'TaskCheckList',
  161. mixins: [JeecgListMixin],
  162. inject: ['closeCurrent'],
  163. data() {
  164. let _self = this;
  165. return {
  166. description: '稽核详情页面',
  167. currentTab: 'all',
  168. currentCheckState: null,
  169. task: {
  170. id: '',
  171. taskName: '',
  172. taskStartTime: '',
  173. taskEndTime: '',
  174. description: '',
  175. taskState: 0,
  176. taskStateText: '',
  177. taskStateColor: '',
  178. },
  179. tabAll: '全部(0)',
  180. noUp: '未处理(0)',
  181. tabUndo: '未完善(0)',
  182. tabUncheck: '待稽核(0)',
  183. tabChecked: '待整改(0)',
  184. tabPassed: '稽核通过(0)',
  185. count: 0,
  186. noUpCount:0,
  187. undoCount: 0,
  188. uncheckCount: 0,
  189. checkedCount: 0,
  190. passedCount: 0,
  191. columns: [
  192. {
  193. title: '#',
  194. dataIndex: '',
  195. key:'rowIndex',
  196. width:60,
  197. align:"center",
  198. scopedSlots: { customRender: 'rowIndex' }
  199. },
  200. // {
  201. // title:'客户名称',
  202. // align:"left",
  203. // sorter: true,
  204. // dataIndex: 'customerName',
  205. // scopedSlots: { customRender: 'customerName' }
  206. // },
  207. {
  208. title:'客户编号',
  209. align:"center",
  210. sorter: true,
  211. dataIndex: 'customerNo'
  212. },
  213. // {
  214. // title:'服务号码(全)',
  215. // align:"center",
  216. // dataIndex: 'smsNumber'
  217. // },
  218. {
  219. title:'用户编号',
  220. align:"center",
  221. dataIndex: 'userNo'
  222. },
  223. {
  224. title:'入网时间',
  225. align:"center",
  226. sorter: true,
  227. dataIndex: 'networkAccessTime'
  228. },
  229. {
  230. title:'用户状态',
  231. align:"center",
  232. dataIndex: 'userState',
  233. customRender:function (text,record,index) {
  234. if (text === '1') {
  235. return '在用';
  236. } else if (text === '2') {
  237. return '拆机';
  238. }
  239. return text;
  240. }
  241. },
  242. {
  243. title:'员工姓名',
  244. align:"center",
  245. dataIndex: 'staffName'
  246. },
  247. {
  248. title:'员工编号',
  249. align:"center",
  250. sorter: true,
  251. dataIndex: 'staffNo'
  252. },
  253. {
  254. title:'稽核进度',
  255. align:"center",
  256. sorter: true,
  257. dataIndex: 'checkState',
  258. scopedSlots: { customRender: 'checkState' }
  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. dataIndex: 'firstActivationDate'
  284. }, {
  285. title: '账户编码',
  286. align: "center",
  287. dataIndex: 'accountCode'
  288. }, {
  289. title: '楼宇名称',
  290. align: "center",
  291. dataIndex: 'floorName'
  292. }, {
  293. title: '楼宇编号',
  294. align: "center",
  295. dataIndex: 'floorCode'
  296. },
  297. {
  298. title: '操作',
  299. dataIndex: 'action',
  300. align:"center",
  301. scopedSlots: { customRender: 'action' }
  302. }
  303. ],
  304. isorter: {
  305. column: 'checkState',
  306. order: 'asc',
  307. },
  308. url: {
  309. deleteBatch : "smsCheck/customerInfo/deleteBatch",
  310. queryTask: "/smsCheck/task/queryById",
  311. list: "/smsCheck/customerInfo/list",
  312. count: "/smsCheck/customerInfo/count",
  313. delete: "/smsCheck/customerInfo/delete",
  314. edit: "/smsCheck/customerInfo/edit",
  315. notice: "/smsCheck/customerInfo/notice",
  316. editCheck: "/smsCheck/customerInfo/edit/check/state",
  317. dataDelete: "/smsCheck/customerData/clear",
  318. exportXlsUrl: "smsCheck/customerInfo/exportXlsTruck",
  319. },
  320. autoSearch: false,
  321. }
  322. },
  323. created() {
  324. this.task.id = this.$route.query.id;
  325. this.queryTaskById(this.task.id);
  326. this.queryParam.taskId = this.task.id;
  327. this.loadData();
  328. this.loadTabNumber(this.task.id);
  329. },
  330. filters: {
  331. statusTypeFilter(type) {
  332. const statusTypeMap = {
  333. '0': 'error',
  334. '1': 'error',
  335. '2': 'warning',
  336. '3': 'warning',
  337. '4': 'processing',
  338. '5': 'success'
  339. }
  340. return statusTypeMap[type]
  341. },
  342. statusFilter(status) {
  343. const statusMap = {
  344. '0': '未处理',
  345. '1': '未完善',
  346. '2': '待稽核',
  347. '3': '待稽核',
  348. '4': '待整改',
  349. '5': '通过'
  350. }
  351. return statusMap[status]
  352. }
  353. },
  354. methods: {
  355. getFileUrls(data) {
  356. let url = '/smsCheck/customerInfo/queryUrlById';
  357. let params = {
  358. id: data.id
  359. }
  360. let that = this;
  361. getAction(url, params).then(res => {
  362. if (res.success) {
  363. that.fileInfoList = res.result
  364. this.filesToRar(this.fileInfoList, '客户:'+data.customerNo+'资料下载');
  365. }
  366. })
  367. },
  368. /**文件打包* arrImages:文件list:[{fileUrl:文件url,renameFileName:文件名}]* filename 压缩包名* */
  369. filesToRar(arrImages, filename) {
  370. let _this = this;
  371. let zip = new JSZip();
  372. let cache = {};
  373. let promises = [];
  374. _this.title = '正在加载压缩文件';
  375. // const loading = this.$loading({lock: true,text: '正在加载压缩文件',spinner: 'el-icon-loading',background: 'rgba(0, 0, 0, 0.7)'});
  376. for (let item of arrImages) {
  377. for (let url of item.fileStaticUrl) {
  378. console.log("item",item)
  379. // 下载文件, 并存成ArrayBuffer对象
  380. const promise = this.getImgArrayBuffer(url.fileStaticUrl).then(data => {
  381. var testZip = zip.folder(item.fileId);
  382. // 获取文件名
  383. const file_name = url.fileName
  384. // 逐个添加文件
  385. testZip.file(file_name, data, { binary: true })
  386. //testZip.file(file_name,item.fileId)
  387. cache[file_name] = data})
  388. promises.push(promise);
  389. }
  390. }
  391. Promise.all(promises)
  392. // 生成二进制流
  393. .then(() => {zip.generateAsync({ type: "blob" })
  394. .then(content => {_this.title = '正在压缩';
  395. // 利用file-saver保存文件 自定义文件名
  396. FileSaver.saveAs(content, filename);
  397. _this.title = '压缩完成';}
  398. );
  399. }).catch(res=>{
  400. _this.$message.error('文件压缩失败');
  401. });
  402. },
  403. getImgArrayBuffer(url) {
  404. return new Promise((resolve, reject) => {
  405. //通过请求获取文件blob格式
  406. let xmlhttp = new XMLHttpRequest();
  407. xmlhttp.open("GET", url, true);
  408. xmlhttp.responseType = "blob";
  409. xmlhttp.onload = function () {
  410. if (this.status == 200) {
  411. resolve(this.response);
  412. } else {
  413. reject(this.status);
  414. }};
  415. xmlhttp.send();
  416. });
  417. },
  418. // 整改
  419. showImproveGZ(record) {
  420. this.$router.push({path: '/truckCheck/modules/TaskCheckAudit', query: {id: record.id}});
  421. },
  422. // 历史
  423. selectData(record) {
  424. this.$router.push({path: '/truckCheck/modules/TaskCheckAudit', query: {id: record.id}});
  425. },
  426. // 返回上一级
  427. goBack() {
  428. this.$router.go(-1);
  429. //关闭当前页面
  430. this.closeCurrent();
  431. },
  432. // 上传客户资料
  433. showImproveAndUpload(record){
  434. this.$router.push({path: '/truck/check/data/upload', query: {id: record.id}});
  435. },
  436. // 显示完善页面
  437. showImprove(record) {
  438. this.$router.push({path: '/sms/check/data/edit', query: {id: record.id}});
  439. },
  440. // 显示上传页面
  441. showUpload(record) {
  442. this.$router.push({path: '/sms/check/data/upload', query: {id: record.id}});
  443. },
  444. // 显示上传页面
  445. handSubmit(record) {
  446. let that = this;
  447. let model = {
  448. id: record.id,
  449. }
  450. postAction(this.url.editCheck, model)
  451. .then((res) => {
  452. if (res.success) {
  453. that.$message.success(res.message)
  454. that.loadData(that.ipagination.current);
  455. } else {
  456. that.$message.warning(res.message)
  457. }
  458. }).finally(() => {
  459. })
  460. },
  461. dataDelete(id) {
  462. var that = this;
  463. deleteAction(that.url.dataDelete, {infoId: id}).then((res) => {
  464. if (res.success) {
  465. that.$message.success('附件资料清空完成!');
  466. } else {
  467. that.$message.warning('附件资料清空失败!');
  468. }
  469. });
  470. },
  471. // 稽核点击事件
  472. showCheckCheck(record) {
  473. this.$router.push({path: '/truckCheck/modules/TaskCheckAudit', query: {id: record.id}});
  474. },
  475. // 显示稽核详情页面
  476. showCheckDetail(record) {
  477. this.$router.push({path: '/truckCheck/modules/TaskCheckDetails', query: {id: record.id}});
  478. },
  479. // 显示稽核历史页面
  480. showCheckLog(record) {
  481. this.$router.push({path: '/sms/check/task/check/log', query: {id: record.id}});
  482. },
  483. // 构建任务信息
  484. buildTaskInfo(record) {
  485. let taskInfo = Object.assign({}, this.task);
  486. taskInfo.count = this.count;
  487. taskInfo.undoCount = this.undoCount;
  488. taskInfo.uncheckCount = this.uncheckCount;
  489. taskInfo.checkedCount = this.checkedCount;
  490. taskInfo.passedCount = this.passedCount;
  491. return {
  492. task: this.task,
  493. info: record
  494. }
  495. },
  496. handleCancel() {
  497. this.visible = false;
  498. },
  499. detail(record) {
  500. this.model = Object.assign({}, record);
  501. this.visible = true;
  502. },
  503. searchQuery() {
  504. this.loadData(1);
  505. this.selectedRowKeys = [];
  506. this.selectionRows = [];
  507. this.loadTabNumber(this.task.id);
  508. },
  509. searchReset() {
  510. this.queryParam = {};
  511. this.queryParam.taskId = this.task.id;
  512. this.queryParam.checkState_MultiString = this.currentCheckState;
  513. this.tabChange('all');
  514. this.loadTabNumber(this.queryParam.taskId);
  515. },
  516. tabChange(key) {
  517. // 稽核状态(0:未处理;1:未完善;2:待稽核;3:待整改;4:已整改;5:稽核通过;)
  518. if (key === 'all') {
  519. this.currentCheckState = null;
  520. this.queryParam.checkState_MultiString = this.currentCheckState;
  521. this.currentTab = 'all';
  522. } else if (key === 'undo') {
  523. this.currentCheckState = '1';
  524. this.queryParam.checkState_MultiString = this.currentCheckState;
  525. this.currentTab = 'undo';
  526. } else if (key === 'uncheck') {
  527. this.currentCheckState = '2,3';
  528. this.queryParam.checkState_MultiString = this.currentCheckState;
  529. this.currentTab = 'uncheck';
  530. } else if (key === 'checked') {
  531. this.currentCheckState = '4';
  532. this.queryParam.checkState_MultiString = this.currentCheckState;
  533. this.currentTab = 'checked';
  534. } else if (key === 'passed') {
  535. this.currentCheckState = '5';
  536. this.queryParam.checkState_MultiString = this.currentCheckState;
  537. this.currentTab = 'passed';
  538. } else if (key === 'noUp') {
  539. this.currentCheckState = '0';
  540. this.queryParam.checkState_MultiString = this.currentCheckState;
  541. this.currentTab = 'noUp';
  542. }
  543. this.loadData(1);
  544. },
  545. loadTabNumber(taskId) {
  546. let url = this.url.count;
  547. let params = {
  548. id: taskId
  549. }
  550. let that = this;
  551. getAction(url, params).then(res => {
  552. let {result} = res;
  553. if (result) {
  554. that.count = result.count;
  555. that.undoCount = result.undoCount;
  556. that.uncheckCount = result.uncheckCount;
  557. that.checkedCount = result.checkedCount;
  558. that.passedCount = result.passedCount;
  559. that.noUpCount = result.noUpCount;
  560. that.tabAll = '全部(' + result.count + ')';
  561. that.noUp= '未处理(' + result.noUpCount + ')';
  562. that.tabUndo = '未完善(' + result.undoCount + ')';
  563. that.tabUncheck = '待稽核(' + result.uncheckCount + ')';
  564. that.tabChecked = '待整改(' + result.checkedCount + ')';
  565. that.tabPassed = '稽核通过(' + result.passedCount + ')';
  566. }
  567. }).finally(() => {
  568. })
  569. },
  570. noticeDeal(record) {
  571. let url = this.url.notice;
  572. let params = {
  573. customerName: record.customerName,
  574. smsNumber: record.smsNumber,
  575. staffNo: record.staffNo,
  576. userNo: record.userNo,
  577. }
  578. let that = this;
  579. postAction(url, params).then(res => {
  580. let {result} = res;
  581. if (res.success) {
  582. that.$message.info('已通知客户经理,进行材料补充!');
  583. }
  584. }).finally(() => {
  585. })
  586. },
  587. queryTaskById(id) {
  588. let url = this.url.queryTask;
  589. let params = {
  590. id: id
  591. }
  592. let that = this;
  593. getAction(url, params).then(res => {
  594. if (res.success) {
  595. that.task = res.result;
  596. that.getTaskState(that.task.taskState);
  597. }
  598. }).finally(() => {
  599. })
  600. },
  601. getTaskState(taskState) {
  602. if (taskState === 0) {
  603. this.task.taskStateColor = '#fadb14';
  604. this.task.taskStateText = '未开始';
  605. } else if (taskState === 1) {
  606. this.task.taskStateColor = '#1890ff';
  607. this.task.taskStateText = '稽核中';
  608. } else if (taskState === 2) {
  609. this.task.taskStateColor = '#52c41a';
  610. this.task.taskStateText = '稽核完成';
  611. }
  612. }
  613. }
  614. }
  615. </script>
  616. <style scoped>
  617. </style>