TaskCheckList.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975
  1. <template>
  2. <a-row :gutter="10">
  3. <a-col :md="leftColMd" :sm="24" style="margin-bottom: 20px">
  4. <div>
  5. <a-page-header
  6. style="background-color: #FFFFFF;"
  7. title="客户列表"
  8. sub-title=""
  9. @back="goBack"
  10. >
  11. <a-descriptions :title="'任务名称: '+task.taskName" :column="3" :bordered="false">
  12. <a-descriptions-item label="状态">
  13. <a-tag :color="task.taskStateColor">{{ task.taskStateText }}</a-tag>
  14. </a-descriptions-item>
  15. <a-descriptions-item label="开始时间">{{ task.taskStartTime }}</a-descriptions-item>
  16. <a-descriptions-item label="结束时间">{{ task.taskEndTime }}</a-descriptions-item>
  17. <!-- <a-descriptions-item label="描述"><span v-html="task.description"></span></a-descriptions-item>-->
  18. </a-descriptions>
  19. <a-divider style="margin: 6px;"/>
  20. </a-page-header>
  21. <a-card :bordered="false" style="margin-top: -20px;">
  22. <a-tabs :active-key="currentTab" default-active-key="all" @change="tabChange">
  23. <a-tab-pane key="all" :tab="tabAll"></a-tab-pane>
  24. <a-tab-pane key="noUp" :tab="noUp"></a-tab-pane>
  25. <a-tab-pane key="undo" :tab="tabUndo"></a-tab-pane>
  26. <a-tab-pane key="uncheck" :tab="tabUncheck"></a-tab-pane>
  27. <a-tab-pane key="checked" :tab="tabChecked"></a-tab-pane>
  28. <a-tab-pane key="passed" :tab="tabPassed"></a-tab-pane>
  29. </a-tabs>
  30. <!-- 查询区域 -->
  31. <div class="table-page-search-wrapper">
  32. <a-form layout="inline" @keyup.enter.native="searchQuery">
  33. <a-row :gutter="24">
  34. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  35. <a-form-item label="客户编号">
  36. <j-input placeholder="请输入客户编号" v-model="queryParam.customerNo"></j-input>
  37. </a-form-item>
  38. </a-col>
  39. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  40. <a-form-item label="客户名称">
  41. <j-input placeholder="请输入客户名称" v-model="queryParam.customerName"></j-input>
  42. </a-form-item>
  43. </a-col>
  44. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  45. <a-form-item label="员工编号">
  46. <j-input placeholder="请输入员工编号" v-model="queryParam.staffNo"></j-input>
  47. </a-form-item>
  48. </a-col>
  49. <template v-if="toggleSearchStatus">
  50. </template>
  51. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  52. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  53. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  54. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  55. <a @click="handleToggleSearch" style="margin-left: 8px">
  56. {{ toggleSearchStatus ? '收起' : '展开' }}
  57. <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
  58. </a>
  59. </span>
  60. </a-col>
  61. </a-row>
  62. </a-form>
  63. </div>
  64. <!-- 查询区域-END -->
  65. <!-- 操作按钮区域 -->
  66. <div class="table-operator">
  67. <a-button type="primary" icon="download" @click="handleExportXls('客户列表')">导出</a-button>
  68. <a-button type="primary" @click="handleOpen">转派<a-icon type="right" /></a-button>
  69. <!-- 高级查询区域 -->
  70. <a-dropdown v-if="selectedRowKeys.length > 0">
  71. <a-menu slot="overlay">
  72. <a-menu-item key="1" @click="batchDel" v-has="'task:check:list:delete'">
  73. <a-icon type="delete"/>
  74. 删除
  75. </a-menu-item>
  76. </a-menu>
  77. <a-button style="margin-left: 8px"> 批量操作
  78. <a-icon type="down"/>
  79. </a-button>
  80. </a-dropdown>
  81. </div>
  82. <!-- table区域-begin -->
  83. <div>
  84. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  85. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a
  86. style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  87. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  88. </div>
  89. <a-table
  90. ref="table"
  91. size="middle"
  92. :scroll="{x:true}"
  93. bordered
  94. rowKey="id"
  95. :columns="columns"
  96. :dataSource="dataSource"
  97. :pagination="ipagination"
  98. :loading="loading"
  99. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  100. class="j-table-force-nowrap"
  101. @change="handleTableChange">
  102. <template slot="action" slot-scope="text, record">
  103. <span v-has="'truck:task:check:list:upload:improve'" v-if="record.checkState == 0 || record.checkState == 1 ">
  104. <a @click="showImproveAndUpload(record)">上传资料</a>
  105. <a-divider type="vertical"/>
  106. </span>
  107. <span v-has="'truck: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="'truck:check:list:selectData'" v-if="record.checkState === 5">
  112. <a @click="selectData(record)">查看数据</a>
  113. <a-divider type="vertical" />
  114. </span>
  115. <span v-has="'truck:check:list:truckout'" >
  116. <a @click="transferOut(record)">回退转派</a>
  117. <a-divider type="vertical" />
  118. </span>
  119. <span v-has="'task:check:list:selectDataDown'">
  120. <a @click="getFileUrls(record)">下载资料</a>
  121. <a-divider type="vertical" />
  122. </span>
  123. <span v-has="'truck:check:list:history'" v-if="record.checkState === 4">
  124. <a @click="showImproveGZ(record)">整改</a>
  125. <a-divider type="vertical" />
  126. </span>
  127. <span v-has="'truck:task:check:list:notice'"
  128. v-if="record.checkState != 2 && record.checkState != 3 && record.checkState != 5">
  129. <a @click="noticeDeal(record)">催办</a>
  130. <a-divider type="vertical"/>
  131. </span>
  132. <a-dropdown>
  133. <a class="ant-dropdown-link">更多
  134. <a-icon type="down"/>
  135. </a>
  136. <a-menu slot="overlay">
  137. <a-menu-item v-has="'task:check:list:delete'">
  138. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  139. <a>删除</a>
  140. </a-popconfirm>
  141. </a-menu-item>
  142. <a-menu-item v-has="'task:check:list:clear'">
  143. <a-popconfirm title="确定清空吗?" @confirm="() => dataDelete(record.id)">
  144. <a>清空</a>
  145. </a-popconfirm>
  146. </a-menu-item>
  147. </a-menu>
  148. </a-dropdown>
  149. </template>
  150. <template v-slot:customerName="text, record">
  151. <a @click="showCheckDetail(record)">{{ text }}</a>
  152. </template>
  153. <template v-slot:checkState="status">
  154. <a-badge :status="status | statusTypeFilter" :text="status | statusFilter"/>
  155. </template>
  156. <template v-slot:rowIndex="text,records,index">
  157. {{ (ipagination.current - 1) * ipagination.pageSize + Number(index) + 1 }}
  158. </template>
  159. </a-table>
  160. </div>
  161. <!-- table区域 end -->
  162. </a-card>
  163. </div>
  164. </a-col>
  165. <a-col :md="rightColMd" :sm="24" v-if="this.rightcolval == 1">
  166. <a-card :bordered="false">
  167. <div style="text-align: right;">
  168. <a-icon type="close-circle" @click="hideUserList" />
  169. </div>
  170. <div style='margin-top: 30px;font-size: 25px' >请选择转派给哪位员工:</div>
  171. <div style='margin-top:65px' ></div>
  172. <!-- 查询区域 -->
  173. <div class="table-page-search-wrapper">
  174. <a-form layout="inline">
  175. <a-row :gutter="24">
  176. <a-col :md="15" :sm="24">
  177. <a-form-item label="用户账号">
  178. <a-input placeholder="" v-model="queryParam2.username"></a-input>
  179. </a-form-item>
  180. </a-col>
  181. <a-col :md="15" :sm="24">
  182. <a-form-item label="用户名称">
  183. <a-input placeholder="" v-model="queryParam2.realname"></a-input>
  184. </a-form-item>
  185. </a-col>
  186. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  187. <a-col :md="9" :sm="24">
  188. <a-button type="primary" @click="searchQuery2" icon="search" style="margin-left: 21px">查询</a-button>
  189. <a-button type="primary" @click="searchReset2" icon="reload" style="margin-left: 8px">重置</a-button>
  190. <a-button type="danger" @click="transfer" style="margin-left: 8px">转派</a-button>
  191. <!-- <a-button type="danger" @click="transfer" style="margin-left: 8px">转派</a-button>-->
  192. </a-col>
  193. </span>
  194. </a-row>
  195. </a-form>
  196. </div>
  197. <!-- 操作按钮区域 -->
  198. <div class="table-operator" :md="24" :sm="24">
  199. </div>
  200. <!-- table区域-begin -->
  201. <div>
  202. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  203. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{
  204. selectedRowKeys2.length }}</a>项
  205. <a style="margin-left: 24px" @click="onClearSelected2">清空</a>
  206. </div>
  207. <a-table
  208. style="height:500px"
  209. ref="table2"
  210. bordered
  211. size="middle"
  212. rowKey="id"
  213. :columns="columns2"
  214. :dataSource="dataSource2"
  215. :pagination="ipagination2"
  216. :rowSelection="{selectedRowKeys: selectedRowKeys2, onChange: onSelectChange2 ,type:'radio'}"
  217. @change="handleTableChange2">
  218. <span slot="action" slot-scope="text, record">
  219. <a-divider type="vertical"/>
  220. <a-dropdown>
  221. </a-dropdown>
  222. </span>
  223. </a-table>
  224. <a-modal v-model="visible" title="请选择所属部门" on-ok="handleOk">
  225. <template slot="footer">
  226. <a-button key="back" @click="handleCancel">
  227. 返回
  228. </a-button>
  229. <!-- <a-button key="submit" type="primary" :loading="loading" @click="handleOk">-->
  230. <!-- 确认-->
  231. <!-- </a-button>-->
  232. <a-button type="danger" @click="transfer" style="margin-left: 8px">转派</a-button>
  233. </template>
  234. <div> 请选择部门
  235. <a-select style="width: 220px" v-model="orgCode">
  236. <a-select-option v-for="item in statusList" :key="statusList.orgCode" :value="item.orgCode">
  237. {{ item.departName }}
  238. </a-select-option>
  239. </a-select>
  240. </div>
  241. </a-modal>
  242. </div>
  243. <!-- 表单区域 -->
  244. </a-card>
  245. </a-col>
  246. </a-row>
  247. </template>
  248. <script>
  249. import {postAction, getAction, httpAction, deleteAction} from '@api/manage'
  250. import '@/assets/less/TableExpand.less'
  251. import {JeecgListMixin} from '@/mixins/JeecgListMixin'
  252. import JSZip from 'jszip'
  253. import FileSaver from 'file-saver'
  254. import RoleModal from '@views/system/modules/RoleModal.vue'
  255. import SelectUserModal from '@views/system/modules/SelectUserModal.vue'
  256. import UserModal from '@views/system/modules/UserModal.vue'
  257. import { filterObj } from '@/utils/util'
  258. const statusMap1 = {
  259. 1: {
  260. color: 'green',
  261. text: '正常'
  262. },
  263. 2: {
  264. color: 'red',
  265. text: '冻结'
  266. }
  267. }
  268. export default {
  269. name: 'TaskCheckList',
  270. components: { UserModal, SelectUserModal, RoleModal },
  271. mixins: [JeecgListMixin],
  272. inject: ['closeCurrent'],
  273. data() {
  274. let _self = this;
  275. return {
  276. statusList:[],
  277. loading: false,
  278. visible: false,
  279. dataSource1: [],
  280. dataSource2: [],
  281. currentRoleId: '',
  282. ipagination2: {
  283. current: 1,
  284. pageSize: 10,
  285. pageSizeOptions: ['10', '20', '30'],
  286. showTotal: (total, range) => {
  287. return range[0] + '-' + range[1] + ' 共' + total + '条'
  288. },
  289. showQuickJumper: true,
  290. showSizeChanger: true,
  291. total: 0
  292. },
  293. queryParam2: {},
  294. rightcolval:0,
  295. selectedRowKeys1: [],
  296. selectedRowKeys2: [],
  297. description: '稽核详情页面',
  298. currentTab: 'all',
  299. currentCheckState: null,
  300. task: {
  301. id: '',
  302. taskName: '',
  303. taskStartTime: '',
  304. taskEndTime: '',
  305. description: '',
  306. taskState: 0,
  307. taskStateText: '',
  308. taskStateColor: '',
  309. },
  310. tabAll: '全部(0)',
  311. noUp: '未处理(0)',
  312. tabUndo: '未完善(0)',
  313. tabUncheck: '待稽核(0)',
  314. tabChecked: '待整改(0)',
  315. tabPassed: '稽核通过(0)',
  316. count: 0,
  317. noUpCount:0,
  318. undoCount: 0,
  319. uncheckCount: 0,
  320. checkedCount: 0,
  321. passedCount: 0,
  322. orgCode:"",
  323. columns2: [{
  324. title: '用户账号',
  325. align: 'center',
  326. dataIndex: 'username',
  327. width: 120
  328. },
  329. {
  330. title: '用户名称',
  331. align: 'center',
  332. width: 100,
  333. dataIndex: 'realname'
  334. }],
  335. columns: [
  336. {
  337. title: '#',
  338. dataIndex: '',
  339. key:'rowIndex',
  340. width:60,
  341. align:"center",
  342. scopedSlots: { customRender: 'rowIndex' }
  343. },
  344. // {
  345. // title:'客户名称',
  346. // align:"left",
  347. // sorter: true,
  348. // dataIndex: 'customerName',
  349. // scopedSlots: { customRender: 'customerName' }
  350. // },
  351. {
  352. title:'客户编号',
  353. align:"center",
  354. sorter: true,
  355. dataIndex: 'customerNo'
  356. },
  357. // {
  358. // title:'服务号码(全)',
  359. // align:"center",
  360. // dataIndex: 'smsNumber'
  361. // },
  362. {
  363. title:'用户编号',
  364. align:"center",
  365. dataIndex: 'userNo'
  366. },
  367. {
  368. title:'入网时间',
  369. align:"center",
  370. sorter: true,
  371. dataIndex: 'networkAccessTime'
  372. },
  373. // {
  374. // title:'用户状态',
  375. // align:"center",
  376. // dataIndex: 'userState',
  377. // customRender:function (text,record,index) {
  378. // if (text === '1') {
  379. // return '在用';
  380. // } else if (text === '2') {
  381. // return '拆机';
  382. // }
  383. // return text;
  384. // }
  385. // },
  386. {
  387. title:'员工姓名',
  388. align:"center",
  389. dataIndex: 'staffName'
  390. },
  391. {
  392. title:'员工编号',
  393. align:"center",
  394. sorter: true,
  395. dataIndex: 'staffNo'
  396. },
  397. {
  398. title:'稽核进度',
  399. align:"center",
  400. sorter: true,
  401. dataIndex: 'checkState',
  402. scopedSlots: { customRender: 'checkState' }
  403. },
  404. {
  405. title: '员工二级部门',
  406. align: "center",
  407. dataIndex: 'staffDeptLevel2Name'
  408. },
  409. // {
  410. // title: '员工二级部门编号',
  411. // align: "center",
  412. // dataIndex: 'staffDeptLevel2No'
  413. // },
  414. {
  415. title: '员工三级部门',
  416. align: "center",
  417. dataIndex: 'staffDeptLevel3Name'
  418. },
  419. // {
  420. // title: '员工三级部门编号',
  421. // align: "center",
  422. // dataIndex: 'staffDeptLevel3No'
  423. // },
  424. {
  425. title: '首次激活时间(固网起租时间)',
  426. align: "center",
  427. dataIndex: 'firstActivationDate'
  428. }, {
  429. title: '账户编码',
  430. align: "center",
  431. dataIndex: 'accountCode'
  432. }, {
  433. title: '楼宇名称',
  434. align: "center",
  435. dataIndex: 'floorName'
  436. },
  437. // {
  438. // title: '楼宇编号',
  439. // align: "center",
  440. // dataIndex: 'floorCode'
  441. // },
  442. {
  443. title: '操作',
  444. dataIndex: 'action',
  445. align:"center",
  446. scopedSlots: { customRender: 'action' }
  447. }
  448. ],
  449. isorter: {
  450. column: 'checkState',
  451. order: 'asc',
  452. },
  453. url: {
  454. deleteBatch : "smsCheck/customerInfo/deleteBatch",
  455. queryTask: "/smsCheck/task/queryById",
  456. list: "/smsCheck/customerInfo/list",
  457. count: "/smsCheck/customerInfo/count",
  458. delete: "/smsCheck/customerInfo/delete",
  459. edit: "/smsCheck/customerInfo/edit",
  460. notice: "/smsCheck/customerInfo/notice",
  461. editCheck: "/smsCheck/customerInfo/edit/check/state",
  462. dataDelete: "/smsCheck/customerData/clear",
  463. exportXlsUrl: "smsCheck/customerInfo/exportXlsTruck",
  464. list2: '/sys/user/userRoleList',
  465. },
  466. autoSearch: false,
  467. }
  468. },
  469. computed: {
  470. leftColMd() {
  471. return this.selectedRowKeys1.length === 0 ? 24 : 15
  472. },
  473. rightColMd() {
  474. return this.selectedRowKeys1.length === 0 ? 0 : 9
  475. }
  476. },
  477. created() {
  478. this.task.id = this.$route.query.id;
  479. this.queryTaskById(this.task.id);
  480. this.queryParam.taskId = this.task.id;
  481. this.loadData();
  482. this.loadTabNumber(this.task.id);
  483. },
  484. filters: {
  485. statusTypeFilter(type) {
  486. const statusTypeMap = {
  487. '0': 'error',
  488. '1': 'error',
  489. '2': 'warning',
  490. '3': 'warning',
  491. '4': 'processing',
  492. '5': 'success'
  493. }
  494. return statusTypeMap[type]
  495. },
  496. statusFilter(status) {
  497. const statusMap = {
  498. '0': '未处理',
  499. '1': '未完善',
  500. '2': '待稽核',
  501. '3': '待稽核',
  502. '4': '待整改',
  503. '5': '通过'
  504. }
  505. return statusMap[status]
  506. }
  507. },
  508. methods: {
  509. onSelectChange2(selectedRowKeys, selectionRows) {
  510. this.selectedRowKeys2 = selectedRowKeys
  511. this.selectionRows2 = selectionRows
  512. let url = '/smsCheck/customerData/queryDeptById';
  513. let params = {
  514. workNo: selectionRows[0].workNo
  515. }
  516. this.statusList=[]
  517. this.orgCode=''
  518. getAction(url, params).then(res => {
  519. if (res.success) {
  520. this.statusList=res.result
  521. return
  522. }
  523. })
  524. //this.visible = true;
  525. },
  526. showModal() {
  527. this.visible = true;
  528. },
  529. handleOk(e) {
  530. this.loading = true;
  531. setTimeout(() => {
  532. this.visible = false;
  533. this.loading = false;
  534. }, 3000);
  535. },
  536. handleTableChange2(pagination, filters, sorter) {
  537. //分页、排序、筛选变化时触发
  538. //TODO 筛选
  539. if (Object.keys(sorter).length > 0) {
  540. this.isorter2.column = sorter.field
  541. this.isorter2.order = 'ascend' == sorter.order ? 'asc' : 'desc'
  542. }
  543. this.ipagination2 = pagination
  544. this.loadData2()
  545. },
  546. hideUserList(){
  547. //this.rightcolval = 0
  548. this.selectedRowKeys1 = []
  549. },
  550. getQueryParams2() {
  551. //获取查询条件
  552. let sqp = {}
  553. if (this.superQueryParams2) {
  554. sqp['superQueryParams'] = encodeURI(this.superQueryParams2)
  555. sqp['superQueryMatchType'] = this.superQueryMatchType2
  556. }
  557. var param = Object.assign(sqp, this.queryParam2, this.isorter2, this.filters2)
  558. param.field = this.getQueryField2()
  559. param.pageNo = this.ipagination2.current
  560. param.pageSize = this.ipagination2.pageSize
  561. return filterObj(param)
  562. },
  563. getQueryField2() {
  564. //TODO 字段权限控制
  565. var str = 'id,'
  566. this.columns2.forEach(function(value) {
  567. str += ',' + value.dataIndex
  568. })
  569. return str
  570. },
  571. transfer(){
  572. if (this.selectedRowKeys2.length===0){
  573. this.$message.warn('未选择转派人!')
  574. return
  575. }
  576. if (this.selectedRowKeys.length===0){
  577. this.$message.warn('未选择需转派的数据!')
  578. return
  579. }
  580. // if ( this.orgCode===''){
  581. // this.$message.warn('部门不可为空!')
  582. // return
  583. // }
  584. let url = '/smsCheck/customerData/transfer';
  585. let params = {
  586. userId : this.selectedRowKeys2[0],
  587. ids:this.selectedRowKeys,
  588. orgCode: this.orgCode
  589. }
  590. postAction(url, params).then(res => {
  591. if (res.success) {
  592. this.$message.success('转派成功!')
  593. this.visible = false;
  594. this.rightcolval=0;
  595. this.selectedRowKeys1=[];
  596. this.searchReset()
  597. return
  598. }
  599. })
  600. },
  601. searchQuery2() {
  602. this.loadData2(1)
  603. },
  604. searchReset2() {
  605. this.queryParam2 = {}
  606. this.loadData2(1)
  607. },
  608. loadData2(arg) {
  609. if (!this.url.list2) {
  610. this.$message.error('请设置url.list2属性!')
  611. return
  612. }
  613. //加载数据 若传入参数1则加载第一页的内容
  614. if (arg === 1) {
  615. this.ipagination2.current = 1
  616. }
  617. let params = this.getQueryParams2()//查询条件
  618. //params.roleId = this.currentRoleId
  619. getAction(this.url.list2, params).then((res) => {
  620. if (res.success) {
  621. this.dataSource2 = res.result.records
  622. this.ipagination2.total = res.result.total
  623. }
  624. })
  625. },
  626. handleOpen(record) {
  627. if (this.selectedRowKeys.length===0){
  628. this.$message.warn('未选择需转派的数据!')
  629. return
  630. }
  631. this.rightcolval = 1
  632. this.selectedRowKeys1 = '1'
  633. this.model1 = Object.assign({}, record)
  634. this.onClearSelected2()
  635. this.loadData2()
  636. },
  637. onClearSelected2() {
  638. this.selectedRowKeys2 = []
  639. this.selectionRows2 = []
  640. },
  641. getFileUrls(data) {
  642. let url = '/smsCheck/customerInfo/queryUrlById';
  643. let params = {
  644. id: data.id
  645. }
  646. let that = this;
  647. getAction(url, params).then(res => {
  648. if (res.success) {
  649. that.fileInfoList = res.result
  650. this.$message.success('开始下载请等待...')
  651. this.filesToRar(this.fileInfoList, '客户:'+data.customerNo+'资料下载');
  652. }else {
  653. this.$message.warn('无上传资料,若有疑问请联系管理员')
  654. return
  655. }
  656. })
  657. },
  658. /**文件打包* arrImages:文件list:[{fileUrl:文件url,renameFileName:文件名}]* filename 压缩包名* */
  659. filesToRar(arrImages, filename) {
  660. let _this = this;
  661. let zip = new JSZip();
  662. let cache = {};
  663. let promises = [];
  664. _this.title = '正在加载压缩文件';
  665. // const loading = this.$loading({lock: true,text: '正在加载压缩文件',spinner: 'el-icon-loading',background: 'rgba(0, 0, 0, 0.7)'});
  666. for (let item of arrImages) {
  667. for (let url of item.fileStaticUrl) {
  668. console.log("item",item)
  669. // 下载文件, 并存成ArrayBuffer对象
  670. const promise = this.getImgArrayBuffer(url.fileStaticUrl).then(data => {
  671. var testZip = zip.folder(item.fileId);
  672. // 获取文件名
  673. const file_name = url.fileName
  674. // 逐个添加文件
  675. testZip.file(file_name, data, { binary: true })
  676. //testZip.file(file_name,item.fileId)
  677. cache[file_name] = data})
  678. promises.push(promise);
  679. }
  680. }
  681. Promise.all(promises)
  682. // 生成二进制流
  683. .then(() => {zip.generateAsync({ type: "blob" })
  684. .then(content => {_this.title = '正在压缩';
  685. // 利用file-saver保存文件 自定义文件名
  686. FileSaver.saveAs(content, filename);
  687. _this.title = '压缩完成';}
  688. );
  689. }).catch(res=>{
  690. _this.$message.error('文件压缩失败');
  691. });
  692. },
  693. getImgArrayBuffer(url) {
  694. return new Promise((resolve, reject) => {
  695. //通过请求获取文件blob格式
  696. let xmlhttp = new XMLHttpRequest();
  697. xmlhttp.open("GET", url, true);
  698. xmlhttp.responseType = "blob";
  699. xmlhttp.onload = function () {
  700. if (this.status == 200) {
  701. resolve(this.response);
  702. } else {
  703. reject(this.status);
  704. }};
  705. xmlhttp.send();
  706. });
  707. },
  708. // 整改
  709. showImproveGZ(record) {
  710. this.$router.push({path: '/truckCheck/modules/TaskCheckAudit', query: {id: record.id}});
  711. },
  712. // 历史
  713. selectData(record) {
  714. this.$router.push({path: '/truckCheck/modules/TaskCheckAudit', query: {id: record.id}});
  715. },
  716. transferOut(record) {
  717. let url = '/smsCheck/customerData/transferOut';
  718. let dataOut=[]
  719. dataOut.push(record.id)
  720. let params = {
  721. ids:dataOut,
  722. }
  723. postAction(url, params).then(res => {
  724. if (res.success) {
  725. this.$message.success('转派成功!')
  726. this.visible = false;
  727. this.rightcolval=0;
  728. this.selectedRowKeys1=[];
  729. this.searchReset()
  730. return
  731. }else {
  732. this.$message.error(res.message)
  733. }
  734. })
  735. },
  736. // 返回上一级
  737. goBack() {
  738. this.$router.go(-1);
  739. //关闭当前页面
  740. this.closeCurrent();
  741. },
  742. // 上传客户资料
  743. showImproveAndUpload(record){
  744. this.$router.push({path: '/truck/check/data/upload', query: {id: record.id}});
  745. },
  746. // 显示完善页面
  747. showImprove(record) {
  748. this.$router.push({path: '/sms/check/data/edit', query: {id: record.id}});
  749. },
  750. // 显示上传页面
  751. showUpload(record) {
  752. this.$router.push({path: '/sms/check/data/upload', query: {id: record.id}});
  753. },
  754. // 显示上传页面
  755. handSubmit(record) {
  756. let that = this;
  757. let model = {
  758. id: record.id,
  759. }
  760. postAction(this.url.editCheck, model)
  761. .then((res) => {
  762. if (res.success) {
  763. that.$message.success(res.message)
  764. that.loadData(that.ipagination.current);
  765. } else {
  766. that.$message.warning(res.message)
  767. }
  768. }).finally(() => {
  769. })
  770. },
  771. dataDelete(id) {
  772. var that = this;
  773. deleteAction(that.url.dataDelete, {infoId: id}).then((res) => {
  774. if (res.success) {
  775. that.$message.success('附件资料清空完成!');
  776. } else {
  777. that.$message.warning('附件资料清空失败!');
  778. }
  779. });
  780. },
  781. // 稽核点击事件
  782. showCheckCheck(record) {
  783. this.$router.push({path: '/truckCheck/modules/TaskCheckAudit', query: {id: record.id}});
  784. },
  785. // 显示稽核详情页面
  786. showCheckDetail(record) {
  787. this.$router.push({path: '/truckCheck/modules/TaskCheckDetails', query: {id: record.id}});
  788. },
  789. // 显示稽核历史页面
  790. showCheckLog(record) {
  791. this.$router.push({path: '/sms/check/task/check/log', query: {id: record.id}});
  792. },
  793. // 构建任务信息
  794. buildTaskInfo(record) {
  795. let taskInfo = Object.assign({}, this.task);
  796. taskInfo.count = this.count;
  797. taskInfo.undoCount = this.undoCount;
  798. taskInfo.uncheckCount = this.uncheckCount;
  799. taskInfo.checkedCount = this.checkedCount;
  800. taskInfo.passedCount = this.passedCount;
  801. return {
  802. task: this.task,
  803. info: record
  804. }
  805. },
  806. handleCancel() {
  807. this.visible = false;
  808. },
  809. detail(record) {
  810. this.model = Object.assign({}, record);
  811. this.visible = true;
  812. },
  813. searchQuery() {
  814. this.loadData(1);
  815. this.selectedRowKeys = [];
  816. this.selectionRows = [];
  817. this.loadTabNumber(this.task.id);
  818. },
  819. searchReset() {
  820. this.queryParam = {};
  821. this.queryParam.taskId = this.task.id;
  822. this.queryParam.checkState_MultiString = this.currentCheckState;
  823. this.tabChange('all');
  824. this.loadTabNumber(this.queryParam.taskId);
  825. },
  826. tabChange(key) {
  827. // 稽核状态(0:未处理;1:未完善;2:待稽核;3:待整改;4:已整改;5:稽核通过;)
  828. if (key === 'all') {
  829. this.currentCheckState = null;
  830. this.queryParam.checkState_MultiString = this.currentCheckState;
  831. this.currentTab = 'all';
  832. } else if (key === 'undo') {
  833. this.currentCheckState = '1';
  834. this.queryParam.checkState_MultiString = this.currentCheckState;
  835. this.currentTab = 'undo';
  836. } else if (key === 'uncheck') {
  837. this.currentCheckState = '2,3';
  838. this.queryParam.checkState_MultiString = this.currentCheckState;
  839. this.currentTab = 'uncheck';
  840. } else if (key === 'checked') {
  841. this.currentCheckState = '4';
  842. this.queryParam.checkState_MultiString = this.currentCheckState;
  843. this.currentTab = 'checked';
  844. } else if (key === 'passed') {
  845. this.currentCheckState = '5';
  846. this.queryParam.checkState_MultiString = this.currentCheckState;
  847. this.currentTab = 'passed';
  848. } else if (key === 'noUp') {
  849. this.currentCheckState = '0';
  850. this.queryParam.checkState_MultiString = this.currentCheckState;
  851. this.currentTab = 'noUp';
  852. }
  853. this.loadData(1);
  854. },
  855. loadTabNumber(taskId) {
  856. let url = this.url.count;
  857. let params = {
  858. id: taskId
  859. }
  860. let that = this;
  861. getAction(url, params).then(res => {
  862. let {result} = res;
  863. if (result) {
  864. that.count = result.count;
  865. that.undoCount = result.undoCount;
  866. that.uncheckCount = result.uncheckCount;
  867. that.checkedCount = result.checkedCount;
  868. that.passedCount = result.passedCount;
  869. that.noUpCount = result.noUpCount;
  870. that.tabAll = '全部(' + result.count + ')';
  871. that.noUp= '未处理(' + result.noUpCount + ')';
  872. that.tabUndo = '未完善(' + result.undoCount + ')';
  873. that.tabUncheck = '待稽核(' + result.uncheckCount + ')';
  874. that.tabChecked = '待整改(' + result.checkedCount + ')';
  875. that.tabPassed = '稽核通过(' + result.passedCount + ')';
  876. }
  877. }).finally(() => {
  878. })
  879. },
  880. noticeDeal(record) {
  881. let url = this.url.notice;
  882. let params = {
  883. customerName: record.customerName,
  884. smsNumber: record.smsNumber,
  885. staffNo: record.staffNo,
  886. userNo: record.userNo,
  887. customerNo:record.customerNo,
  888. taskId:record.taskId,
  889. }
  890. let that = this;
  891. postAction(url, params).then(res => {
  892. let {result} = res;
  893. if (res.success) {
  894. that.$message.info('已通知客户经理,进行材料补充!');
  895. }
  896. }).finally(() => {
  897. })
  898. },
  899. queryTaskById(id) {
  900. let url = this.url.queryTask;
  901. let params = {
  902. id: id
  903. }
  904. let that = this;
  905. getAction(url, params).then(res => {
  906. if (res.success) {
  907. that.task = res.result;
  908. that.getTaskState(that.task.taskState);
  909. }
  910. }).finally(() => {
  911. })
  912. },
  913. getTaskState(taskState) {
  914. if (taskState === 0) {
  915. this.task.taskStateColor = '#fadb14';
  916. this.task.taskStateText = '未开始';
  917. } else if (taskState === 1) {
  918. this.task.taskStateColor = '#1890ff';
  919. this.task.taskStateText = '稽核中';
  920. } else if (taskState === 2) {
  921. this.task.taskStateColor = '#52c41a';
  922. this.task.taskStateText = '稽核完成';
  923. }
  924. }
  925. }
  926. }
  927. </script>
  928. <style scoped>
  929. </style>