TaskCheckList.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964
  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. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  43. <a-form-item label="员工编号">
  44. <j-input placeholder="请输入员工编号" v-model="queryParam.staffNo"></j-input>
  45. </a-form-item>
  46. </a-col>
  47. <template v-if="toggleSearchStatus">
  48. </template>
  49. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  50. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  51. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  52. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  53. <a @click="handleToggleSearch" style="margin-left: 8px">
  54. {{ toggleSearchStatus ? '收起' : '展开' }}
  55. <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
  56. </a>
  57. </span>
  58. </a-col>
  59. </a-row>
  60. </a-form>
  61. </div>
  62. <!-- 查询区域-END -->
  63. <!-- 操作按钮区域 -->
  64. <div class="table-operator">
  65. <a-button type="primary" icon="download" @click="handleExportXls('客户列表')">导出</a-button>
  66. <a-button type="primary" @click="handleOpen">转派<a-icon type="right" /></a-button>
  67. <!-- 高级查询区域 -->
  68. <a-dropdown v-if="selectedRowKeys.length > 0">
  69. <a-menu slot="overlay">
  70. <a-menu-item key="1" @click="batchDel" v-has="'task:check:list:delete'"><a-icon type="delete"/>删除</a-menu-item>
  71. </a-menu>
  72. <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
  73. </a-dropdown>
  74. </div>
  75. <!-- table区域-begin -->
  76. <div>
  77. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  78. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  79. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  80. </div>
  81. <a-table
  82. ref="table"
  83. size="middle"
  84. :scroll="{x:true}"
  85. bordered
  86. rowKey="id"
  87. :columns="columns"
  88. :dataSource="dataSource"
  89. :pagination="ipagination"
  90. :loading="loading"
  91. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  92. class="j-table-force-nowrap"
  93. @change="handleTableChange">
  94. <template slot="action" slot-scope="text, record">
  95. <!-- <span v-has="'task:check:list:improve'" v-if="record.checkState == 1 || record.checkState == 0-->
  96. <!-- || record.checkState == 3 || record.checkState == 4" >-->
  97. <!-- <a @click="showImprove(record)">完善</a>-->
  98. <!-- <a-divider type="vertical"/>-->
  99. <!-- </span>-->
  100. <!-- <span v-has="'task:check:list:upload'" v-if="record.checkState == 1 || record.checkState == 0-->
  101. <!-- || record.checkState == 3 || record.checkState == 4">-->
  102. <!-- <a @click="showUpload(record)">上传</a>-->
  103. <!-- <a-divider type="vertical"/>-->
  104. <!-- </span>-->
  105. <span v-has="'task:check:list:improve'" v-if="record.checkState == 1 || record.checkState == 0 " >
  106. <a @click="showImprove(record)">完善上传</a>
  107. <a-divider type="vertical"/>
  108. </span>
  109. <!-- <span v-has="'task:check:list:submit'" v-if=" record.checkState == 4">-->
  110. <!-- <a @click="handSubmit(record)">提交</a>-->
  111. <!-- <a-divider type="vertical"/>-->
  112. <!-- </span>-->
  113. <span v-has="'task:check:list:check'" v-if="record.checkState === 2 || record.checkState === 3">
  114. <a @click="showCheckCheck(record)">稽核</a>
  115. <a-divider type="vertical" />
  116. </span>
  117. <span v-has="'task:check:list:history'" v-if="record.checkState === 4">
  118. <a @click="showImproveGZ(record)">整改</a>
  119. <a-divider type="vertical" />
  120. </span>
  121. <span v-has="'task:check:list:selectData'" v-if="record.checkState === 5">
  122. <a @click="selectData(record)">查看数据</a>
  123. <a-divider type="vertical" />
  124. </span>
  125. <span v-has="'truck:check:list:out'" >
  126. <a @click="transferOut(record)">回退转派</a>
  127. <a-divider type="vertical" />
  128. </span>
  129. <span v-has="'task:check:list:selectDataDown'">
  130. <a @click="getFileUrls(record)">下载资料</a>
  131. <a-divider type="vertical" />
  132. </span>
  133. <span v-has="'task:check:list:notice'" v-if="record.checkState != 2 && record.checkState != 3 && record.checkState != 5">
  134. <a @click="noticeDeal(record)">催办</a>
  135. <a-divider type="vertical" />
  136. </span>
  137. <a-dropdown>
  138. <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  139. <a-menu slot="overlay">
  140. <a-menu-item v-has="'task:check:list:delete'">
  141. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  142. <a>删除</a>
  143. </a-popconfirm>
  144. </a-menu-item>
  145. <a-menu-item v-has="'task:check:list:clear'">
  146. <a-popconfirm title="确定清空吗?" @confirm="() => dataDelete(record.id)">
  147. <a>清空</a>
  148. </a-popconfirm>
  149. </a-menu-item>
  150. </a-menu>
  151. </a-dropdown>
  152. </template>
  153. <template v-slot:customerName="text, record">
  154. <a @click="showCheckDetail(record)">{{text}}</a>
  155. </template>
  156. <template v-slot:checkState="status">
  157. <a-badge :status="status | statusTypeFilter" :text="status | statusFilter"/>
  158. </template>
  159. <template v-slot:rowIndex="text,records,index">
  160. {{ (ipagination.current - 1) * ipagination.pageSize + Number(index)+1 }}
  161. </template>
  162. </a-table>
  163. </div>
  164. <!-- table区域 end -->
  165. </a-card>
  166. </div>
  167. </a-col>
  168. <a-col :md="rightColMd" :sm="24" v-if="this.rightcolval == 1">
  169. <a-card :bordered="false">
  170. <div style="text-align: right;">
  171. <a-icon type="close-circle" @click="hideUserList" />
  172. </div>
  173. <div style='margin-top: 126px' ></div>
  174. <!-- 查询区域 -->
  175. <div class="table-page-search-wrapper">
  176. <a-form layout="inline">
  177. <a-row :gutter="24">
  178. <a-col :md="15" :sm="24">
  179. <a-form-item label="用户账号">
  180. <a-input placeholder="" v-model="queryParam2.username"></a-input>
  181. </a-form-item>
  182. </a-col>
  183. <a-col :md="15" :sm="24">
  184. <a-form-item label="用户名称">
  185. <a-input placeholder="" v-model="queryParam2.realname"></a-input>
  186. </a-form-item>
  187. </a-col>
  188. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  189. <a-col :md="9" :sm="24">
  190. <a-button type="primary" @click="searchQuery2" icon="search" style="margin-left: 21px">查询</a-button>
  191. <a-button type="primary" @click="searchReset2" icon="reload" style="margin-left: 8px">重置</a-button>
  192. <a-button type="danger" @click="transfer" style="margin-left: 8px">转派</a-button>
  193. <!-- <a-button type="danger" @click="transfer" style="margin-left: 8px">转派</a-button>-->
  194. </a-col>
  195. </span>
  196. </a-row>
  197. </a-form>
  198. </div>
  199. <!-- 操作按钮区域 -->
  200. <div class="table-operator" :md="24" :sm="24">
  201. </div>
  202. <!-- table区域-begin -->
  203. <div>
  204. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  205. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{
  206. selectedRowKeys2.length }}</a>项
  207. <a style="margin-left: 24px" @click="onClearSelected2">清空</a>
  208. </div>
  209. <a-table
  210. style="height:500px"
  211. ref="table2"
  212. bordered
  213. size="middle"
  214. rowKey="id"
  215. :columns="columns2"
  216. :dataSource="dataSource2"
  217. :pagination="ipagination2"
  218. :rowSelection="{selectedRowKeys: selectedRowKeys2, onChange: onSelectChange2 ,type:'radio'}"
  219. @change="handleTableChange2">
  220. <span slot="action" slot-scope="text, record">
  221. <a-divider type="vertical"/>
  222. <a-dropdown>
  223. </a-dropdown>
  224. </span>
  225. </a-table>
  226. <a-modal v-model="visible" title="请选择所属部门" on-ok="handleOk">
  227. <template slot="footer">
  228. <a-button key="back" @click="handleCancel">
  229. 返回
  230. </a-button>
  231. <!-- <a-button key="submit" type="primary" :loading="loading" @click="handleOk">-->
  232. <!-- 确认-->
  233. <!-- </a-button>-->
  234. <a-button type="danger" @click="transfer" style="margin-left: 8px">转派</a-button>
  235. </template>
  236. <div> 请选择部门
  237. <a-select style="width: 220px" v-model="orgCode">
  238. <a-select-option v-for="item in statusList" :key="statusList.orgCode" :value="item.orgCode">
  239. {{ item.departName }}
  240. </a-select-option>
  241. </a-select>
  242. </div>
  243. </a-modal>
  244. </div>
  245. <!-- 表单区域 -->
  246. </a-card>
  247. </a-col>
  248. </a-row>
  249. </template>
  250. <script>
  251. import { postAction, getAction, httpAction, deleteAction } from '@api/manage'
  252. import '@/assets/less/TableExpand.less'
  253. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  254. import JSZip from 'jszip'
  255. import FileSaver from 'file-saver'
  256. import RoleModal from '@views/system/modules/RoleModal.vue'
  257. import SelectUserModal from '@views/system/modules/SelectUserModal.vue'
  258. import UserModal from '@views/system/modules/UserModal.vue'
  259. import { filterObj } from '@/utils/util'
  260. const statusMap1 = {
  261. 1: {
  262. color: 'green',
  263. text: '正常'
  264. },
  265. 2: {
  266. color: 'red',
  267. text: '冻结'
  268. }
  269. }
  270. export default {
  271. name: 'TaskCheckList',
  272. components: { UserModal, SelectUserModal, RoleModal },
  273. mixins:[JeecgListMixin],
  274. inject:['closeCurrent'],
  275. data () {
  276. let _self = this;
  277. return {
  278. statusList:[],
  279. loading: false,
  280. visible: false,
  281. dataSource1: [],
  282. dataSource2: [],
  283. currentRoleId: '',
  284. ipagination2: {
  285. current: 1,
  286. pageSize: 10,
  287. pageSizeOptions: ['10', '20', '30'],
  288. showTotal: (total, range) => {
  289. return range[0] + '-' + range[1] + ' 共' + total + '条'
  290. },
  291. showQuickJumper: true,
  292. showSizeChanger: true,
  293. total: 0
  294. },
  295. queryParam2: {},
  296. rightcolval:0,
  297. selectedRowKeys1: [],
  298. selectedRowKeys2: [],
  299. queryParam:{
  300. },
  301. fileInfoList:[
  302. ],
  303. dataListSelections:'',
  304. description: '稽核详情页面',
  305. currentTab: 'all',
  306. currentCheckState: null,
  307. task:{
  308. id: '',
  309. taskName: '',
  310. taskStartTime: '',
  311. taskEndTime: '',
  312. description: '',
  313. taskState: 0,
  314. taskStateText: '',
  315. taskStateColor: '',
  316. },
  317. tabAll: '全部(0)',
  318. noUp: '未处理(0)',
  319. tabUndo: '未完善(0)',
  320. tabUncheck: '待稽核(0)',
  321. tabChecked: '待整改(0)',
  322. tabPassed: '稽核通过(0)',
  323. count: 0,
  324. noUpCount:0,
  325. undoCount: 0,
  326. uncheckCount: 0,
  327. checkedCount: 0,
  328. passedCount: 0,
  329. orgCode:"",
  330. columns2: [{
  331. title: '用户账号',
  332. align: 'center',
  333. dataIndex: 'username',
  334. width: 120
  335. },
  336. {
  337. title: '用户名称',
  338. align: 'center',
  339. width: 100,
  340. dataIndex: 'realname'
  341. }],
  342. columns: [
  343. {
  344. title: '#',
  345. dataIndex: '',
  346. key:'rowIndex',
  347. width:60,
  348. align:"center",
  349. scopedSlots: { customRender: 'rowIndex' }
  350. },
  351. // {
  352. // title:'客户名称',
  353. // align:"left",
  354. // sorter: true,
  355. // dataIndex: 'customerName',
  356. // scopedSlots: { customRender: 'customerName' }
  357. // },
  358. {
  359. title:'客户编号',
  360. align:"center",
  361. sorter: true,
  362. dataIndex: 'customerNo'
  363. },
  364. // {
  365. // title:'服务号码(全)',
  366. // align:"center",
  367. // dataIndex: 'smsNumber'
  368. // },
  369. {
  370. title:'用户编号',
  371. align:"center",
  372. dataIndex: 'userNo'
  373. },
  374. {
  375. title:'入网时间',
  376. align:"center",
  377. sorter: true,
  378. dataIndex: 'networkAccessTime'
  379. },
  380. {
  381. title:'用户状态',
  382. align:"center",
  383. dataIndex: 'userState',
  384. customRender:function (text,record,index) {
  385. if (text === '1') {
  386. return '在用';
  387. } else if (text === '2') {
  388. return '拆机';
  389. }
  390. return text;
  391. }
  392. },
  393. {
  394. title:'员工姓名',
  395. align:"center",
  396. dataIndex: 'staffName'
  397. },
  398. {
  399. title:'员工编号',
  400. align:"center",
  401. sorter: true,
  402. dataIndex: 'staffNo'
  403. },
  404. {
  405. title:'稽核进度',
  406. align:"center",
  407. sorter: true,
  408. dataIndex: 'checkState',
  409. scopedSlots: { customRender: 'checkState' }
  410. },
  411. {
  412. title: '员工二级部门',
  413. align: "center",
  414. dataIndex: 'staffDeptLevel2Name'
  415. },
  416. {
  417. title: '员工二级部门编号',
  418. align: "center",
  419. dataIndex: 'staffDeptLevel2No'
  420. },
  421. {
  422. title: '员工三级部门',
  423. align: "center",
  424. dataIndex: 'staffDeptLevel3Name'
  425. },
  426. {
  427. title: '员工三级部门编号',
  428. align: "center",
  429. dataIndex: 'staffDeptLevel3No'
  430. },
  431. {
  432. title: '操作',
  433. dataIndex: 'action',
  434. align:"center",
  435. scopedSlots: { customRender: 'action' }
  436. }
  437. ],
  438. isorter:{
  439. column: 'checkState',
  440. order: 'asc',
  441. },
  442. url: {
  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. deleteBatch:"/smsCheck/customerInfo/deleteByIds",
  452. exportXlsUrl: "smsCheck/customerInfo/exportXls",
  453. list2: '/sys/user/userRoleList',
  454. },
  455. autoSearch: false,
  456. }
  457. },
  458. created() {
  459. this.task.id = this.$route.query.id;
  460. this.queryTaskById(this.task.id);
  461. this.queryParam.taskId = this.task.id;
  462. this.loadData();
  463. this.loadTabNumber(this.task.id);
  464. },
  465. computed: {
  466. leftColMd() {
  467. return this.selectedRowKeys1.length === 0 ? 24 : 15
  468. },
  469. rightColMd() {
  470. return this.selectedRowKeys1.length === 0 ? 0 : 9
  471. }
  472. },
  473. filters: {
  474. statusTypeFilter(type) {
  475. const statusTypeMap = {
  476. '0': 'error',
  477. '1': 'purple',
  478. '2': 'warning',
  479. '3': 'warning',
  480. '4': 'processing',
  481. '5': 'success'
  482. }
  483. return statusTypeMap[type]
  484. },
  485. statusFilter(status) {
  486. const statusMap = {
  487. '0': '未处理',
  488. '1': '未完善',
  489. '2': '待稽核',
  490. '3': '待稽核',
  491. '4': '待整改',
  492. '5': '通过'
  493. }
  494. return statusMap[status]
  495. }
  496. },
  497. methods: {
  498. transferOut(record) {
  499. let url = '/smsCheck/customerData/transferOut';
  500. let dataOut=[]
  501. dataOut.push(record.id)
  502. let params = {
  503. ids:dataOut,
  504. }
  505. postAction(url, params).then(res => {
  506. if (res.success) {
  507. this.$message.success('转派成功!')
  508. this.visible = false;
  509. this.rightcolval=0;
  510. this.selectedRowKeys1=[];
  511. this.searchReset()
  512. return
  513. }else {
  514. this.$message.error(res.message)
  515. }
  516. })
  517. },
  518. onSelectChange2(selectedRowKeys, selectionRows) {
  519. this.selectedRowKeys2 = selectedRowKeys
  520. this.selectionRows2 = selectionRows
  521. let url = '/smsCheck/customerData/queryDeptById';
  522. let params = {
  523. workNo: selectionRows[0].workNo
  524. }
  525. this.statusList=[]
  526. this.orgCode=''
  527. getAction(url, params).then(res => {
  528. if (res.success) {
  529. this.statusList=res.result
  530. //this.visible = true;
  531. return
  532. }
  533. })
  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. this.closeCurrent();
  717. },
  718. // // 显示完善页面
  719. // showImprove(record) {
  720. // this.$router.push({ path: '/sms/check/data/edit' ,query:{id:record.id}});
  721. // },
  722. // 上传客户资料
  723. showImprove(record) {
  724. this.$router.push({path: '/sms/check/TaskUploadData', query: {id: record.id}});
  725. },
  726. // 整改
  727. showImproveGZ(record) {
  728. this.$router.push({path: '/sms/check/TaskUploadDataZG', query: {id: record.id}});
  729. },
  730. // 历史
  731. selectData(record) {
  732. this.$router.push({path: '/sms/check/TaskUploadDataSelect', query: {id: record.id}});
  733. },
  734. // 显示上传页面
  735. showUpload(record) {
  736. this.$router.push({ path: '/sms/check/data/upload' ,query:{id:record.id}});
  737. },
  738. // 显示上传页面
  739. handSubmit(record) {
  740. let that = this;
  741. let model = {
  742. id: record.id,
  743. }
  744. postAction(this.url.editCheck, model)
  745. .then((res) => {
  746. if (res.success) {
  747. that.$message.success(res.message)
  748. that.loadData(that.ipagination.current);
  749. } else {
  750. that.$message.warning(res.message)
  751. }
  752. }).finally(() => {
  753. })
  754. },
  755. dataDelete(id) {
  756. var that = this;
  757. deleteAction(that.url.dataDelete, {infoId: id}).then((res) => {
  758. if (res.success) {
  759. that.$message.success('附件资料清空完成!');
  760. } else {
  761. that.$message.warning('附件资料清空失败!');
  762. }
  763. });
  764. },
  765. // 显示列表页面
  766. showCheckCheck(record) {
  767. this.$router.push({ path: '/sms/check/task/check/check', query: { id: record.id}});
  768. },
  769. // 显示稽核详情页面
  770. showCheckDetail(record) {
  771. this.$router.push({ path: '/sms/check/task/check/detail', query:{id:record.id}});
  772. },
  773. // 显示稽核历史页面
  774. showCheckLog(record) {
  775. this.$router.push({ path: '/sms/check/task/check/log',query:{id:record.id}});
  776. },
  777. // 构建任务信息
  778. buildTaskInfo(record) {
  779. let taskInfo = Object.assign({}, this.task);
  780. taskInfo.count = this.count;
  781. taskInfo.undoCount = this.undoCount;
  782. taskInfo.uncheckCount = this.uncheckCount;
  783. taskInfo.checkedCount = this.checkedCount;
  784. taskInfo.passedCount = this.passedCount;
  785. return {
  786. task: this.task,
  787. info: record
  788. }
  789. },
  790. handleCancel () {
  791. this.visible = false;
  792. },
  793. detail (record) {
  794. this.model = Object.assign({}, record);
  795. this.visible = true;
  796. },
  797. searchQuery() {
  798. this.loadData(1);
  799. this.selectedRowKeys = [];
  800. this.selectionRows = [];
  801. this.loadTabNumber(this.task.id);
  802. },
  803. searchReset() {
  804. this.queryParam = {};
  805. this.queryParam.taskId = this.task.id;
  806. this.queryParam.checkState_MultiString = this.currentCheckState;
  807. this.tabChange('all');
  808. this.loadTabNumber(this.queryParam.taskId);
  809. },
  810. tabChange (key) {
  811. // 稽核状态(0:未处理;1:未完善;2:待稽核;3:待整改;4:已整改;5:稽核通过;)
  812. if (key === 'all') {
  813. this.currentCheckState = null;
  814. this.queryParam.checkState_MultiString = this.currentCheckState;
  815. this.currentTab = 'all';
  816. } else if (key === 'undo') {
  817. this.currentCheckState = '1';
  818. this.queryParam.checkState_MultiString = this.currentCheckState;
  819. this.currentTab = 'undo';
  820. } else if (key === 'uncheck') {
  821. this.currentCheckState = '2,3';
  822. this.queryParam.checkState_MultiString = this.currentCheckState;
  823. this.currentTab = 'uncheck';
  824. } else if (key === 'checked') {
  825. this.currentCheckState = '4';
  826. this.queryParam.checkState_MultiString = this.currentCheckState;
  827. this.currentTab = 'checked';
  828. } else if (key === 'passed') {
  829. this.currentCheckState = '5';
  830. this.queryParam.checkState_MultiString = this.currentCheckState;
  831. this.currentTab = 'passed';
  832. } else if (key === 'noUp') {
  833. this.currentCheckState = '0';
  834. this.queryParam.checkState_MultiString = this.currentCheckState;
  835. this.currentTab = 'noUp';
  836. }
  837. this.loadData(1);
  838. },
  839. loadTabNumber (taskId) {
  840. let url = this.url.count;
  841. let params = {
  842. id: taskId
  843. }
  844. let that = this;
  845. getAction(url, params).then(res => {
  846. let { result } = res;
  847. if (result) {
  848. that.count = result.count;
  849. that.undoCount = result.undoCount;
  850. that.uncheckCount = result.uncheckCount;
  851. that.checkedCount = result.checkedCount;
  852. that.passedCount = result.passedCount;
  853. that.noUpCount = result.noUpCount;
  854. that.tabAll= '全部(' + result.count + ')';
  855. that.noUp= '未处理(' + result.noUpCount + ')';
  856. that.tabUndo= '未完善(' + result.undoCount + ')';
  857. that.tabUncheck= '待稽核(' + result.uncheckCount + ')';
  858. that.tabChecked= '待整改(' + result.checkedCount + ')';
  859. that.tabPassed= '稽核通过(' + result.passedCount + ')';
  860. }
  861. }).finally(() => {
  862. })
  863. },
  864. noticeDeal (record) {
  865. let url = this.url.notice;
  866. let params = {
  867. customerName: record.customerName,
  868. smsNumber: record.smsNumber,
  869. staffNo: record.staffNo,
  870. userNo: record.userNo,
  871. }
  872. let that = this;
  873. postAction(url, params).then(res => {
  874. let { result } = res;
  875. if (res.success) {
  876. that.$message.info('已通知客户经理,进行材料补充!');
  877. }
  878. }).finally(() => {
  879. })
  880. },
  881. queryTaskById (id) {
  882. let url = this.url.queryTask;
  883. let params = {
  884. id: id
  885. }
  886. let that = this;
  887. getAction(url, params).then(res => {
  888. if (res.success) {
  889. that.task = res.result;
  890. that.getTaskState(that.task.taskState);
  891. }
  892. }).finally(() => {
  893. })
  894. },
  895. getTaskState(taskState) {
  896. if (taskState === 0) {
  897. this.task.taskStateColor = '#fadb14';
  898. this.task.taskStateText = '未开始';
  899. } else if (taskState === 1) {
  900. this.task.taskStateColor = '#1890ff';
  901. this.task.taskStateText = '稽核中';
  902. } else if (taskState === 2) {
  903. this.task.taskStateColor = '#52c41a';
  904. this.task.taskStateText = '稽核完成';
  905. }
  906. }
  907. }
  908. }
  909. </script>
  910. <style scoped>
  911. </style>