TaskCheckList.vue 31 KB

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