TaskCheckList.vue 31 KB

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