TaskCheckList.vue 31 KB

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