TaskCheckList.vue 16 KB

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