TaskCheckList.vue 33 KB

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