TaskCheckList.vue 32 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="状态"><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: 'userState',
  385. customRender:function (text,record,index) {
  386. if (text === '1') {
  387. return '在用';
  388. } else if (text === '2') {
  389. return '拆机';
  390. }
  391. return text;
  392. }
  393. },
  394. {
  395. title:'员工姓名',
  396. align:"center",
  397. dataIndex: 'staffName'
  398. },
  399. {
  400. title:'员工编号',
  401. align:"center",
  402. sorter: true,
  403. dataIndex: 'staffNo'
  404. },
  405. {
  406. title:'稽核进度',
  407. align:"center",
  408. sorter: true,
  409. dataIndex: 'checkState',
  410. scopedSlots: { customRender: 'checkState' }
  411. },
  412. {
  413. title: '员工二级部门',
  414. align: "center",
  415. dataIndex: 'staffDeptLevel2Name'
  416. },
  417. {
  418. title: '员工二级部门编号',
  419. align: "center",
  420. dataIndex: 'staffDeptLevel2No'
  421. },
  422. {
  423. title: '员工三级部门',
  424. align: "center",
  425. dataIndex: 'staffDeptLevel3Name'
  426. },
  427. {
  428. title: '员工三级部门编号',
  429. align: "center",
  430. dataIndex: 'staffDeptLevel3No'
  431. },
  432. {
  433. title: '操作',
  434. dataIndex: 'action',
  435. align:"center",
  436. scopedSlots: { customRender: 'action' }
  437. }
  438. ],
  439. isorter:{
  440. column: 'checkState',
  441. order: 'asc',
  442. },
  443. url: {
  444. queryTask: "/smsCheck/task/queryById",
  445. list: "/smsCheck/customerInfo/list",
  446. count: "/smsCheck/customerInfo/count",
  447. delete: "/smsCheck/customerInfo/delete",
  448. edit: "/smsCheck/customerInfo/edit",
  449. notice: "/smsCheck/customerInfo/notice",
  450. editCheck: "/smsCheck/customerInfo/edit/check/state",
  451. dataDelete: "/smsCheck/customerData/clear",
  452. deleteBatch:"/smsCheck/customerInfo/deleteByIds",
  453. exportXlsUrl: "smsCheck/customerInfo/exportXls",
  454. list2: '/sys/user/userRoleList',
  455. },
  456. autoSearch: false,
  457. }
  458. },
  459. created() {
  460. this.task.id = this.$route.query.id;
  461. this.queryTaskById(this.task.id);
  462. this.queryParam.taskId = this.task.id;
  463. this.loadData();
  464. this.loadTabNumber(this.task.id);
  465. },
  466. computed: {
  467. leftColMd() {
  468. return this.selectedRowKeys1.length === 0 ? 24 : 15
  469. },
  470. rightColMd() {
  471. return this.selectedRowKeys1.length === 0 ? 0 : 9
  472. }
  473. },
  474. filters: {
  475. statusTypeFilter(type) {
  476. const statusTypeMap = {
  477. '0': 'error',
  478. '1': 'purple',
  479. '2': 'warning',
  480. '3': 'warning',
  481. '4': 'processing',
  482. '5': 'success'
  483. }
  484. return statusTypeMap[type]
  485. },
  486. statusFilter(status) {
  487. const statusMap = {
  488. '0': '未处理',
  489. '1': '未完善',
  490. '2': '待稽核',
  491. '3': '待稽核',
  492. '4': '待整改',
  493. '5': '通过'
  494. }
  495. return statusMap[status]
  496. }
  497. },
  498. methods: {
  499. transferOut(record) {
  500. let url = '/smsCheck/customerData/transferOut';
  501. let dataOut=[]
  502. dataOut.push(record.id)
  503. let params = {
  504. ids:dataOut,
  505. }
  506. postAction(url, params).then(res => {
  507. if (res.success) {
  508. this.$message.success('转派成功!')
  509. this.visible = false;
  510. this.rightcolval=0;
  511. this.selectedRowKeys1=[];
  512. this.searchReset()
  513. return
  514. }else {
  515. this.$message.error(res.message)
  516. }
  517. })
  518. },
  519. onSelectChange2(selectedRowKeys, selectionRows) {
  520. this.selectedRowKeys2 = selectedRowKeys
  521. this.selectionRows2 = selectionRows
  522. let url = '/smsCheck/customerData/queryDeptById';
  523. let params = {
  524. workNo: selectionRows[0].workNo
  525. }
  526. this.statusList=[]
  527. this.orgCode=''
  528. getAction(url, params).then(res => {
  529. if (res.success) {
  530. this.statusList=res.result
  531. //this.visible = true;
  532. return
  533. }
  534. })
  535. },
  536. showModal() {
  537. this.visible = true;
  538. },
  539. handleOk(e) {
  540. this.loading = true;
  541. setTimeout(() => {
  542. this.visible = false;
  543. this.loading = false;
  544. }, 3000);
  545. },
  546. handleTableChange2(pagination, filters, sorter) {
  547. //分页、排序、筛选变化时触发
  548. //TODO 筛选
  549. if (Object.keys(sorter).length > 0) {
  550. this.isorter2.column = sorter.field
  551. this.isorter2.order = 'ascend' == sorter.order ? 'asc' : 'desc'
  552. }
  553. this.ipagination2 = pagination
  554. this.loadData2()
  555. },
  556. hideUserList(){
  557. //this.rightcolval = 0
  558. this.selectedRowKeys1 = []
  559. },
  560. getQueryParams2() {
  561. //获取查询条件
  562. let sqp = {}
  563. if (this.superQueryParams2) {
  564. sqp['superQueryParams'] = encodeURI(this.superQueryParams2)
  565. sqp['superQueryMatchType'] = this.superQueryMatchType2
  566. }
  567. var param = Object.assign(sqp, this.queryParam2, this.isorter2, this.filters2)
  568. param.field = this.getQueryField2()
  569. param.pageNo = this.ipagination2.current
  570. param.pageSize = this.ipagination2.pageSize
  571. return filterObj(param)
  572. },
  573. getQueryField2() {
  574. //TODO 字段权限控制
  575. var str = 'id,'
  576. this.columns2.forEach(function(value) {
  577. str += ',' + value.dataIndex
  578. })
  579. return str
  580. },
  581. transfer(){
  582. if (this.selectedRowKeys2.length===0){
  583. this.$message.warn('未选择转派人!')
  584. return
  585. }
  586. if (this.selectedRowKeys.length===0){
  587. this.$message.warn('未选择需转派的数据!')
  588. return
  589. }
  590. // if ( this.orgCode===''){
  591. // this.$message.warn('部门不可为空!')
  592. // return
  593. // }
  594. let url = '/smsCheck/customerData/transfer';
  595. let params = {
  596. userId : this.selectedRowKeys2[0],
  597. ids:this.selectedRowKeys,
  598. orgCode: this.orgCode
  599. }
  600. postAction(url, params).then(res => {
  601. if (res.success) {
  602. this.$message.success('转派成功!')
  603. this.visible = false;
  604. this.rightcolval=0;
  605. this.selectedRowKeys1=[];
  606. this.searchReset()
  607. return
  608. }
  609. })
  610. },
  611. searchQuery2() {
  612. this.loadData2(1)
  613. },
  614. searchReset2() {
  615. this.queryParam2 = {}
  616. this.loadData2(1)
  617. },
  618. loadData2(arg) {
  619. if (!this.url.list2) {
  620. this.$message.error('请设置url.list2属性!')
  621. return
  622. }
  623. //加载数据 若传入参数1则加载第一页的内容
  624. if (arg === 1) {
  625. this.ipagination2.current = 1
  626. }
  627. let params = this.getQueryParams2()//查询条件
  628. //params.roleId = this.currentRoleId
  629. getAction(this.url.list2, params).then((res) => {
  630. if (res.success) {
  631. this.dataSource2 = res.result.records
  632. this.ipagination2.total = res.result.total
  633. }
  634. })
  635. },
  636. handleOpen(record) {
  637. if (this.selectedRowKeys.length===0){
  638. this.$message.warn('未选择需转派的数据!')
  639. return
  640. }
  641. this.rightcolval = 1
  642. this.selectedRowKeys1 = '1'
  643. this.model1 = Object.assign({}, record)
  644. this.onClearSelected2()
  645. this.loadData2()
  646. },
  647. onClearSelected2() {
  648. this.selectedRowKeys2 = []
  649. this.selectionRows2 = []
  650. },
  651. getFileUrls(data) {
  652. let url = '/smsCheck/customerInfo/queryUrlById';
  653. let params = {
  654. id: data.id
  655. }
  656. let that = this;
  657. getAction(url, params).then(res => {
  658. if (res.success) {
  659. that.fileInfoList = res.result
  660. this.filesToRar(this.fileInfoList, '客户:'+data.customerNo+'资料下载');
  661. }else {
  662. this.$message.warn('无上传资料,若有疑问请联系管理员')
  663. return
  664. }
  665. })
  666. },
  667. /**文件打包* arrImages:文件list:[{fileUrl:文件url,renameFileName:文件名}]* filename 压缩包名* */
  668. filesToRar(arrImages, filename) {
  669. let _this = this;
  670. let zip = new JSZip();
  671. let cache = {};
  672. let promises = [];
  673. _this.title = '正在加载压缩文件';
  674. // const loading = this.$loading({lock: true,text: '正在加载压缩文件',spinner: 'el-icon-loading',background: 'rgba(0, 0, 0, 0.7)'});
  675. for (let item of arrImages) {
  676. for (let url of item.fileStaticUrl) {
  677. console.log("item",item)
  678. // 下载文件, 并存成ArrayBuffer对象
  679. const promise = this.getImgArrayBuffer(url.fileStaticUrl).then(data => {
  680. var testZip = zip.folder(item.fileId);
  681. // 获取文件名
  682. const file_name = url.fileName
  683. // 逐个添加文件
  684. testZip.file(file_name, data, { binary: true })
  685. //testZip.file(file_name,item.fileId)
  686. cache[file_name] = data})
  687. promises.push(promise);
  688. }
  689. }
  690. Promise.all(promises)
  691. // 生成二进制流
  692. .then(() => {zip.generateAsync({ type: "blob" })
  693. .then(content => {_this.title = '正在压缩';
  694. // 利用file-saver保存文件 自定义文件名
  695. FileSaver.saveAs(content, filename);
  696. _this.title = '压缩完成';}
  697. );
  698. }).catch(res=>{
  699. _this.$message.error('文件压缩失败');
  700. });
  701. },
  702. getImgArrayBuffer(url) {
  703. return new Promise((resolve, reject) => {
  704. //通过请求获取文件blob格式
  705. let xmlhttp = new XMLHttpRequest();
  706. xmlhttp.open("GET", url, true);
  707. xmlhttp.responseType = "blob";
  708. xmlhttp.onload = function () {
  709. if (this.status == 200) {
  710. resolve(this.response);
  711. } else {
  712. reject(this.status);
  713. }};
  714. xmlhttp.send();
  715. });
  716. },
  717. // 返回上一级
  718. goBack() {
  719. this.$router.go(-1);
  720. this.closeCurrent();
  721. },
  722. // // 显示完善页面
  723. // showImprove(record) {
  724. // this.$router.push({ path: '/sms/check/data/edit' ,query:{id:record.id}});
  725. // },
  726. // 上传客户资料
  727. showImprove(record) {
  728. this.$router.push({path: '/sms/check/TaskUploadData', query: {id: record.id}});
  729. },
  730. // 整改
  731. showImproveGZ(record) {
  732. this.$router.push({path: '/sms/check/TaskUploadDataZG', query: {id: record.id}});
  733. },
  734. // 历史
  735. selectData(record) {
  736. this.$router.push({path: '/sms/check/TaskUploadDataSelect', query: {id: record.id}});
  737. },
  738. // 显示上传页面
  739. showUpload(record) {
  740. this.$router.push({ path: '/sms/check/data/upload' ,query:{id:record.id}});
  741. },
  742. // 显示上传页面
  743. handSubmit(record) {
  744. let that = this;
  745. let model = {
  746. id: record.id,
  747. }
  748. postAction(this.url.editCheck, model)
  749. .then((res) => {
  750. if (res.success) {
  751. that.$message.success(res.message)
  752. that.loadData(that.ipagination.current);
  753. } else {
  754. that.$message.warning(res.message)
  755. }
  756. }).finally(() => {
  757. })
  758. },
  759. dataDelete(id) {
  760. var that = this;
  761. deleteAction(that.url.dataDelete, {infoId: id}).then((res) => {
  762. if (res.success) {
  763. that.$message.success('附件资料清空完成!');
  764. } else {
  765. that.$message.warning('附件资料清空失败!');
  766. }
  767. });
  768. },
  769. // 显示列表页面
  770. showCheckCheck(record) {
  771. this.$router.push({ path: '/sms/check/task/check/check', query: { id: record.id}});
  772. },
  773. // 显示稽核详情页面
  774. showCheckDetail(record) {
  775. this.$router.push({ path: '/sms/check/task/check/detail', query:{id:record.id}});
  776. },
  777. // 显示稽核历史页面
  778. showCheckLog(record) {
  779. this.$router.push({ path: '/sms/check/task/check/log',query:{id:record.id}});
  780. },
  781. // 构建任务信息
  782. buildTaskInfo(record) {
  783. let taskInfo = Object.assign({}, this.task);
  784. taskInfo.count = this.count;
  785. taskInfo.undoCount = this.undoCount;
  786. taskInfo.uncheckCount = this.uncheckCount;
  787. taskInfo.checkedCount = this.checkedCount;
  788. taskInfo.passedCount = this.passedCount;
  789. return {
  790. task: this.task,
  791. info: record
  792. }
  793. },
  794. handleCancel () {
  795. this.visible = false;
  796. },
  797. detail (record) {
  798. this.model = Object.assign({}, record);
  799. this.visible = true;
  800. },
  801. searchQuery() {
  802. this.loadData(1);
  803. this.selectedRowKeys = [];
  804. this.selectionRows = [];
  805. this.loadTabNumber(this.task.id);
  806. },
  807. searchReset() {
  808. this.queryParam = {};
  809. this.queryParam.taskId = this.task.id;
  810. this.queryParam.checkState_MultiString = this.currentCheckState;
  811. this.tabChange('all');
  812. this.loadTabNumber(this.queryParam.taskId);
  813. },
  814. tabChange (key) {
  815. // 稽核状态(0:未处理;1:未完善;2:待稽核;3:待整改;4:已整改;5:稽核通过;)
  816. if (key === 'all') {
  817. this.currentCheckState = null;
  818. this.queryParam.checkState_MultiString = this.currentCheckState;
  819. this.currentTab = 'all';
  820. } else if (key === 'undo') {
  821. this.currentCheckState = '1';
  822. this.queryParam.checkState_MultiString = this.currentCheckState;
  823. this.currentTab = 'undo';
  824. } else if (key === 'uncheck') {
  825. this.currentCheckState = '2,3';
  826. this.queryParam.checkState_MultiString = this.currentCheckState;
  827. this.currentTab = 'uncheck';
  828. } else if (key === 'checked') {
  829. this.currentCheckState = '4';
  830. this.queryParam.checkState_MultiString = this.currentCheckState;
  831. this.currentTab = 'checked';
  832. } else if (key === 'passed') {
  833. this.currentCheckState = '5';
  834. this.queryParam.checkState_MultiString = this.currentCheckState;
  835. this.currentTab = 'passed';
  836. } else if (key === 'noUp') {
  837. this.currentCheckState = '0';
  838. this.queryParam.checkState_MultiString = this.currentCheckState;
  839. this.currentTab = 'noUp';
  840. }
  841. this.loadData(1);
  842. },
  843. loadTabNumber (taskId) {
  844. let url = this.url.count;
  845. let params = {
  846. id: taskId
  847. }
  848. let that = this;
  849. getAction(url, params).then(res => {
  850. let { result } = res;
  851. if (result) {
  852. that.count = result.count;
  853. that.undoCount = result.undoCount;
  854. that.uncheckCount = result.uncheckCount;
  855. that.checkedCount = result.checkedCount;
  856. that.passedCount = result.passedCount;
  857. that.noUpCount = result.noUpCount;
  858. that.tabAll= '全部(' + result.count + ')';
  859. that.noUp= '未处理(' + result.noUpCount + ')';
  860. that.tabUndo= '未完善(' + result.undoCount + ')';
  861. that.tabUncheck= '待稽核(' + result.uncheckCount + ')';
  862. that.tabChecked= '待整改(' + result.checkedCount + ')';
  863. that.tabPassed= '稽核通过(' + result.passedCount + ')';
  864. }
  865. }).finally(() => {
  866. })
  867. },
  868. noticeDeal (record) {
  869. let url = this.url.notice;
  870. let params = {
  871. customerName: record.customerName,
  872. smsNumber: record.smsNumber,
  873. staffNo: record.staffNo,
  874. userNo: record.userNo,
  875. }
  876. let that = this;
  877. postAction(url, params).then(res => {
  878. let { result } = res;
  879. if (res.success) {
  880. that.$message.info('已通知客户经理,进行材料补充!');
  881. }
  882. }).finally(() => {
  883. })
  884. },
  885. queryTaskById (id) {
  886. let url = this.url.queryTask;
  887. let params = {
  888. id: id
  889. }
  890. let that = this;
  891. getAction(url, params).then(res => {
  892. if (res.success) {
  893. that.task = res.result;
  894. that.getTaskState(that.task.taskState);
  895. }
  896. }).finally(() => {
  897. })
  898. },
  899. getTaskState(taskState) {
  900. if (taskState === 0) {
  901. this.task.taskStateColor = '#fadb14';
  902. this.task.taskStateText = '未开始';
  903. } else if (taskState === 1) {
  904. this.task.taskStateColor = '#1890ff';
  905. this.task.taskStateText = '稽核中';
  906. } else if (taskState === 2) {
  907. this.task.taskStateColor = '#52c41a';
  908. this.task.taskStateText = '稽核完成';
  909. }
  910. }
  911. }
  912. }
  913. </script>
  914. <style scoped>
  915. </style>