TaskCheckList.vue 32 KB

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