userStatistics.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972
  1. <template>
  2. <div>
  3. <a-card :bordered="false">
  4. <div>
  5. <!-- <a-tabs v-has="'user:userStatistics:tab'" :active-key="currentTab" default-active-key="all"-->
  6. <!-- @change="tabChange">-->
  7. <!-- <a-tab-pane key="all" :tab="tabAll"></a-tab-pane>-->
  8. <!-- <a-tab-pane key="undo" :tab="tabUndo"></a-tab-pane>-->
  9. <!-- <a-tab-pane key="uncheck" :tab="tabUncheck"></a-tab-pane>-->
  10. <!-- <a-tab-pane key="checked" :tab="tabChecked"></a-tab-pane>-->
  11. <!-- </a-tabs>-->
  12. <!-- <a-tabs v-has="'admin:userStatistics:tab'" :active-key="currentTab" default-active-key="all"-->
  13. <!-- @change="tabChange">-->
  14. <!-- <a-tab-pane key="all" :tab="tabAll"></a-tab-pane>-->
  15. <!-- <a-tab-pane key="undo" :tab="tabUndo"></a-tab-pane>-->
  16. <!-- <a-tab-pane key="uncheck" :tab="tabUncheck"></a-tab-pane>-->
  17. <!-- <a-tab-pane key="checked" :tab="tabChecked"></a-tab-pane>-->
  18. <!-- <a-tab-pane key="del" :tab="tabDelCheck"></a-tab-pane>-->
  19. <!-- </a-tabs>-->
  20. </div>
  21. <!-- 查询区域 -->
  22. <div class="table-page-search-wrapper">
  23. <a-form layout="inline" @keyup.enter.native="searchQuery">
  24. <a-row :gutter="24">
  25. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  26. <a-form-item label="客户名称">
  27. <j-input placeholder="请输入客户名称" v-model="queryParam.cardName"></j-input>
  28. </a-form-item>
  29. </a-col>
  30. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  31. <a-form-item label="证件编号">
  32. <j-input placeholder="请输入证件编号" v-model="queryParam.cardNo"></j-input>
  33. </a-form-item>
  34. </a-col>
  35. <a-col :span="6">
  36. <a-form-model-item label=" 判研结果 " :labelCol="{ span:5}" :wrapperCol="{ span: 8 }">
  37. <a-select placeholder="请选择判研结果" v-model="queryParam.numberResults" mode="tags">
  38. <a-select-option v-for="item in optionsWithDisabled" :value="item.value">
  39. {{ item.text }}
  40. </a-select-option>
  41. </a-select>
  42. </a-form-model-item>
  43. </a-col>
  44. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  45. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  46. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  47. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  48. <a @click="handleToggleSearch" style="margin-left: 8px">
  49. {{ toggleSearchStatus ? '收起' : '展开' }}
  50. <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
  51. </a>
  52. </span>
  53. </a-col>
  54. </a-row>
  55. <template v-if="toggleSearchStatus">
  56. <a-row :gutter="24">
  57. <a-col :span="6">
  58. <a-form-model-item label=" 上报状态 " :labelCol="{ span:5}" :wrapperCol="{ span: 8 }">
  59. <a-select placeholder="请选择上报状态" v-model="queryParam.status" >
  60. <a-select-option v-for="item in statusList" :value="item.value">
  61. {{ item.text }}
  62. </a-select-option>
  63. </a-select>
  64. </a-form-model-item>
  65. </a-col>
  66. <a-col :span="6">
  67. <a-form-item label=" 办理电话 " :labelCol="{ span:5}" :wrapperCol="{ span: 8 }">
  68. <j-input placeholder="请输入办理电话" v-model="queryParam.newPhone"></j-input>
  69. </a-form-item>
  70. </a-col>
  71. <a-col :span="6">
  72. <a-form-item label=" 创建人 " :labelCol="{ span:5}" :wrapperCol="{ span: 8 }">
  73. <j-input placeholder="请输入创建人" v-model="queryParam.createBy"></j-input>
  74. </a-form-item>
  75. </a-col>
  76. </a-row>
  77. <a-row>
  78. <a-col :span="11" >
  79. <a-form-item label="创建时间" prop="industry" :labelCol="{ span:9}" :wrapperCol="{ span: 10 }">
  80. <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" class="query-group-cust"
  81. id ="cardStartTime" v-model="queryParam.createDateStart" ></j-date>
  82. <span class="query-group-split-cust"></span>
  83. <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择结束时间" class="query-group-cust"
  84. id="cardEndTime" v-model="queryParam.createDateEnd" ></j-date>
  85. </a-form-item>
  86. </a-col>
  87. <a-col :span="7" style='margin-left: 30px'>
  88. <a-form-item label="创建人归属部门" >
  89. <j-input placeholder="请输入营业厅" v-model="queryParam.businessAddress" style="width: 220px;"></j-input>
  90. </a-form-item>
  91. </a-col>
  92. </a-row>
  93. <a-row>
  94. <a-col :span="11" >
  95. <a-form-item label="上报时间" prop="industry" :labelCol="{ span:9}" :wrapperCol="{ span: 10 }">
  96. <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" class="query-group-cust"
  97. id ="upTimeStart" v-model="queryParam.upTimeStart" ></j-date>
  98. <span class="query-group-split-cust"></span>
  99. <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择结束时间" class="query-group-cust"
  100. id="upTimeEnd" v-model="queryParam.upTimeEnd" ></j-date>
  101. </a-form-item>
  102. </a-col>
  103. </a-row>
  104. </template>
  105. </a-form>
  106. </div>
  107. <!-- 操作按钮区域 -->
  108. <div class="table-operator">
  109. <!-- <a-button type="primary" icon="download" @click="handleExportXls('入网统计')">导出</a-button>-->
  110. <a-button type="primary" icon="download" v-has="'userStatistic:excel'" @click="excelOutExcel()">导出</a-button>
  111. <a-button type="primary" icon="download" v-has="'userStatistic:excelUp'" @click="excelOutUp()">导出并上报</a-button>
  112. <!-- 高级查询区域 -->
  113. <a-dropdown v-if="selectedRowKeys.length > 0">
  114. <a-menu slot="overlay">
  115. <a-menu-item key="1" @click="showImproveAndUploadList" v-has="'access:check:lists:up'">
  116. <a-icon type="up"/>
  117. 上报
  118. </a-menu-item>
  119. </a-menu>
  120. <a-button style="margin-left: 8px"> 批量操作
  121. <a-icon type="down"/>
  122. </a-button>
  123. </a-dropdown>
  124. </div>
  125. <!-- table区域-begin -->
  126. <div>
  127. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  128. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a
  129. style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  130. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  131. </div>
  132. <a-table
  133. ref="table"
  134. size="middle"
  135. :scroll="{x:true}"
  136. bordered
  137. rowKey="id"
  138. :columns="columns"
  139. :dataSource="dataSource"
  140. :pagination="ipagination"
  141. :loading="loading"
  142. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  143. class="j-table-force-nowrap"
  144. @change="handleTableChange">
  145. <template slot="action" slot-scope="text, record">
  146. <div>
  147. <span v-has="'userStatistics:list:update'" v-show=" currentTab != 'del'">
  148. <a @click="showImproveAndUpload(record)">修改</a>
  149. <a-divider type="vertical"/>
  150. </span>
  151. <span v-has="'userStatistics:up'" v-show=" currentTab != 'del'">
  152. <a @click="showImproveAndUploadAdmin(record,'2')">上报</a>
  153. <a-divider type="vertical"/>
  154. </span>
  155. <span v-has="'userStatistics:list:upCom'" v-show=" currentTab != 'del'">
  156. <a @click="showImproveAndUploadAdminCom(record,'1')">上报分公司</a>
  157. <a-divider type="vertical"/>
  158. </span>
  159. <span v-has="'userStatistics:list:notice'" v-show=" currentTab != 'del'">
  160. <a @click="noticeDeal(record)">通知</a>
  161. <a-divider type="vertical"/>
  162. </span>
  163. <span v-has="'userStatistics:list:restore:id'" v-show=" currentTab == 'del'">
  164. <a @click="restoreById(record)">恢复</a>
  165. <a-divider type="vertical"/>
  166. </span>
  167. <span v-has="'userStatistics:list:remove:id'" v-show=" currentTab == 'del'">
  168. <a @click="removeById(record)">彻底删除</a>
  169. <a-divider type="vertical"/>
  170. </span>
  171. <!-- <a-dropdown v-show =" currentTab != 'del'">-->
  172. <!-- <a class="ant-dropdown-link">更多-->
  173. <!-- <a-icon type="down"/>-->
  174. <!-- </a>-->
  175. <!-- <a-menu slot="overlay">-->
  176. <!-- <a-menu-item v-has="'del:userStatistics:list:row:delete'">-->
  177. <!-- <a @click="delFlagById(record)">删除</a>-->
  178. <!-- </a-menu-item>-->
  179. <!-- </a-menu>-->
  180. <!-- </a-dropdown>-->
  181. </div>
  182. </template>
  183. <template v-slot:status="text, record">
  184. <a-badge :color="text | statusEscalationColor" :text="text | escalationFilter"/>
  185. </template>
  186. <template v-slot:createBy="text, record">
  187. <a @click="showByCreateBy(record)">{{text}}</a>
  188. </template>
  189. <template v-slot:sysBusinessHall="text, record">
  190. <div>{{getSysCompany(text)}}</div>
  191. </template>
  192. <template v-slot:cardNo="text, record">
  193. <a @click="showByCardNo(record)">{{text}}</a>
  194. </template>
  195. <template v-slot:cardName="text, record">
  196. <a @click="showByCardName(record)">{{text}}</a>
  197. </template>
  198. <template v-slot:phone="text, record">
  199. <a @click="showByPhone(record)">{{text}}</a>
  200. </template>
  201. <template v-slot:numberResults="text, record">
  202. <a-badge :status="text | statusTypeFilter" :text="text | statusFilter"/>
  203. </template>
  204. <template v-slot:newPhone="text, record">
  205. <div>{{newPhone(text)}}</div>
  206. </template>
  207. <template v-slot:newBusinessAddress="text, record">
  208. <div>{{getSysCompany(text)}}</div>
  209. </template>
  210. <template v-slot:rowIndex="text,records,index">
  211. {{ (ipagination.current - 1) * ipagination.pageSize + Number(index) + 1 }}
  212. </template>
  213. <template v-slot:current="text, record">
  214. <!-- <div>{{currentCom(record)}}</div>-->
  215. <!-- if (record.status==='0'){-->
  216. <!-- return record.businessAddress-->
  217. <!-- }-->
  218. <!-- if (record.status==='1'){-->
  219. <!-- return '已报分公司'-->
  220. <!-- }-->
  221. <!-- if (record.status==='2'){-->
  222. <!-- return '已完成'-->
  223. <!-- }-->
  224. <!-- <div v-if="record.status==='0'" style="color: red">{{ record.businessAddress }}</div>-->
  225. <!-- <div v-if="record.status==='1'" style="color: yellow">{{ 已报分公司 }}</div>-->
  226. <!-- <div v-if="record.status==='2'" style="color: greenyellow">{{ 已完成 }}</div>-->
  227. <a-badge :color=" record.status | statusCurrentColor" :text="record | currentFilter "/>
  228. </template>
  229. </a-table>
  230. </div>
  231. </a-card>
  232. </div>
  233. </template>
  234. <script>
  235. import { getAction, postAction, deleteAction, downFile } from '@api/manage'
  236. import {JeecgListMixin} from '@/mixins/JeecgListMixin'
  237. import '@/assets/less/TableExpand.less'
  238. export default {
  239. name: "userStatistics",
  240. mixins: [JeecgListMixin],
  241. inject: ['closeCurrent'],
  242. data() {
  243. return {
  244. excelName:'入网统计',
  245. optionsWithDisabled:
  246. [{
  247. text: '非高危',
  248. value: '1',
  249. }, {
  250. text: '上报关停',
  251. value: '2',
  252. }, {
  253. text: '上报蓝/紫',
  254. value: '3',
  255. } ],
  256. statusList:
  257. [{
  258. text: '上报成功',
  259. value: '2',
  260. },{
  261. text: '已报分公司',
  262. value: '1',
  263. }, {
  264. text: '新建未报',
  265. value: '0',
  266. }],
  267. company:'',
  268. sysCompany: [],
  269. ipagination:{
  270. current: 1,
  271. pageSize: 10,
  272. pageSizeOptions: ['10', '20', '30','300'],
  273. showTotal: (total, range) => {
  274. return range[0] + "-" + range[1] + " 共" + total + "条"
  275. },
  276. showQuickJumper: true,
  277. showSizeChanger: true,
  278. total: 0
  279. },
  280. numberResults: [],
  281. /**统计标签*/
  282. currentTab: 'all',
  283. tabAll: '全部(0)',
  284. tabUndo: '非高危(0)',
  285. tabUncheck: '上报蓝紫名单(0)',
  286. tabChecked: '上报关停(0)',
  287. tabDelCheck: "已删除(0)",
  288. allCount: 0,
  289. tabUndoCount: 0,
  290. tabUncheckCount: 0,
  291. tabCheckedCount: 0,
  292. delCount: 0,
  293. /* table选中keys*/
  294. selectedRowKeys: [],
  295. /* table选中records*/
  296. selectionRows: [],
  297. /* 查询条件-请不要在queryParam中声明非字符串值的属性 */
  298. queryParam: {},
  299. url: {
  300. getType:"/businessReminderCard/type",
  301. getCompany: "/sysCompany/list",
  302. typeCount: "/businessReminderCard/type/count",
  303. list: "/businessReminderCard/list",
  304. delete: "/businessReminderCard/delete/flagById",
  305. removeById: "/businessReminderCard/deleteById",
  306. restoreById: "/businessReminderCard/restoreById",
  307. notice: "/smsCheck/customerInfo/notice",
  308. exportXlsUrl: "/businessReminderCard/exportXls",
  309. exportXlsUrlUp: "/businessReminderCard/exportXlsUp",
  310. },
  311. /**表单
  312. * 入网用户统计:身份证号/姓名/办理电话/创建人/创建人所属营业厅/更新人/更新人营业厅/研判结果/
  313. * */
  314. columns: [
  315. // {
  316. // title: '#',
  317. // dataIndex: '',
  318. // key: 'rowIndex',
  319. // width: 60,
  320. // align: "center",
  321. // scopedSlots: {customRender: 'rowIndex'}
  322. // },
  323. {
  324. title: '证件编号',
  325. align: "center",
  326. sorter: true,
  327. dataIndex: 'cardNo',
  328. scopedSlots: {customRender: 'cardNo'}
  329. }, {
  330. title: '客户名称',
  331. align: "center",
  332. sorter: true,
  333. dataIndex: 'cardName'
  334. // scopedSlots: {customRender: 'cardName'}
  335. }, {
  336. title: '创建人',
  337. align: "center",
  338. sorter: true,
  339. dataIndex: 'createBy'
  340. // scopedSlots: {customRender: 'createBy'}
  341. }, {
  342. title: '创建时间',
  343. align: "center",
  344. sorter: true,
  345. width: 100,
  346. dataIndex: 'createTime'
  347. }, {
  348. title: '创建人归属部门',
  349. width: 100,
  350. align: "center",
  351. sorter: true,
  352. dataIndex: 'businessAddress'
  353. //scopedSlots: {customRender: 'sysBusinessHall'}
  354. },{
  355. title: '上报时间',
  356. align: "center",
  357. sorter: true,
  358. dataIndex: 'upTime'
  359. //scopedSlots: {customRender: 'sysBusinessHall'}
  360. },
  361. {
  362. title: '办理电话',
  363. align: "center",
  364. sorter: true,
  365. width: 200,
  366. dataIndex: 'newPhone',
  367. scopedSlots: {customRender: 'newPhone'}
  368. },
  369. {
  370. title: '研判结果',
  371. align: "center",
  372. sorter: true,
  373. dataIndex: 'numberResults',
  374. scopedSlots: {customRender: 'numberResults'},
  375. /*customRender: function (text, record, index) {
  376. if (text == '1') {
  377. return '非高危';
  378. } else if (text == '2') {
  379. return '上报蓝紫名单';
  380. } else if (text == '3') {
  381. return '上报关停';
  382. }
  383. return '';
  384. }*/
  385. },{
  386. title: '当前处理部门',
  387. align: "center",
  388. sorter: true,
  389. dataIndex: 'businessAddress',
  390. fixed: 'right',
  391. scopedSlots: {customRender: 'current'}
  392. //scopedSlots: {customRender: 'sysBusinessHall'}
  393. },{
  394. title: '上报状态',
  395. align: "center",
  396. sorter: true,
  397. dataIndex: 'status',
  398. fixed: 'right',
  399. scopedSlots: {customRender: 'status'}
  400. },
  401. {
  402. title: '操作',
  403. dataIndex: 'action',
  404. align: "center",
  405. fixed: 'right',
  406. scopedSlots: {customRender: 'action'}
  407. }
  408. ],
  409. }
  410. },
  411. filters: {
  412. statusTypeFilter(type) {
  413. const statusTypeMap = {
  414. '1': 'success',
  415. '2': 'processing',
  416. '3': 'warning',
  417. '4': 'warning',
  418. '3,4': 'warning',
  419. '4,3': 'warning',
  420. }
  421. return statusTypeMap[type]
  422. },
  423. statusFilter(status) {
  424. const statusMap = {
  425. '1': '非高危',
  426. '2': '上报关停',
  427. '3': '上报蓝名单',
  428. '4': '上报紫名单',
  429. '3,4':'上报蓝/紫名单',
  430. '4,3':'上报蓝/紫名单',
  431. }
  432. return statusMap[status]
  433. },
  434. statusEscalation(type) {
  435. const statusTypeMap = {
  436. '1': 'success',
  437. '0': 'warning',
  438. }
  439. return statusTypeMap[type]
  440. },
  441. statusEscalationColor(type) {
  442. const statusTypeMap = {
  443. '2': 'green',
  444. '1': 'yellow',
  445. '0': 'gray',
  446. }
  447. console.log(statusTypeMap[type])
  448. return statusTypeMap[type]
  449. },
  450. currentFilter(status) {
  451. const statusMap = {
  452. '0': status.businessAddress,
  453. '1':'已报分公司',
  454. '2': '已完成'
  455. }
  456. return statusMap[status.status]
  457. },
  458. statusCurrentColor(type) {
  459. const statusTypeMap = {
  460. '2': 'green',
  461. '1': 'yellow',
  462. '0': 'gray',
  463. }
  464. console.log(statusTypeMap[type])
  465. return statusTypeMap[type]
  466. },
  467. escalationFilter(status) {
  468. const statusMap = {
  469. '0': '新建未报',
  470. '1':'已报分公司',
  471. '2': '上报成功'
  472. }
  473. return statusMap[status]
  474. },
  475. },
  476. created() {
  477. /**获取研判结果统计数*/
  478. this.typeCount();
  479. this.getSysCompanyData();
  480. },
  481. methods: {
  482. excelOutExcel(){
  483. this.handleExportXls(this.excelName)
  484. //this.handleExportXlsData(this.excelName,'0',"out")
  485. },
  486. excelOutUp(){
  487. if (this.selectionRows.length===0){
  488. return this.$message.warning('请重新选择数据...', 3);
  489. }
  490. for (let i = 0; i < this.selectionRows.length; i++) {
  491. if(this.selectionRows[i].status==='2'){
  492. return this.$message.warning('选中数据中存在上报成功的数据...', 3);
  493. }
  494. }
  495. for (let i = 0; i < this.selectionRows.length; i++) {
  496. if(this.selectionRows[i].status==='0'){
  497. return this.$message.warning('选中数据中存在新建未报的数据...', 3);
  498. }
  499. }
  500. for (let s = 0; s < this.selectionRows.length; s++) {
  501. if(this.selectionRows[s].numberResults.indexOf('1')!==-1){
  502. return this.$message.warning('选中数据存在非高危数据(请重新选择)...', 3);
  503. }
  504. }
  505. this.excelOut();
  506. this.loadData();
  507. this.selectionRows=[];
  508. },
  509. excelOut(){
  510. // if (this.queryParam.numberResults!==undefined&&this.queryParam.numberResults!==null && this.queryParam.numberResults.length===1){
  511. // if (this.queryParam.numberResults[0]==="3"){
  512. // this.handleExportXlsData('上报紫名单','4')
  513. // this.handleExportXlsData('上报蓝名单','3')
  514. // }
  515. // }else {
  516. // this.handleExportXls(this.excelName)
  517. // }
  518. if (this.getQueryParams().numberResults!==undefined && this.getQueryParams().numberResults.indexOf('3')!==-1){
  519. this.handleExportXlsData('上报紫名单','4',"up")
  520. this.handleExportXlsData('上报蓝名单','3',"up")
  521. }
  522. if (this.getQueryParams().numberResults!==undefined && this.getQueryParams().numberResults.indexOf('1')!==-1){
  523. this.handleExportXlsData('非高危','1',"up")
  524. }
  525. if (this.getQueryParams().numberResults!==undefined && this.getQueryParams().numberResults.indexOf('2')!==-1){
  526. this.handleExportXlsData('上报关停','2',"up")
  527. }
  528. if (this.getQueryParams().numberResults===undefined || this.getQueryParams().numberResults.length===0){
  529. let url = this.url.getType;
  530. const params = {
  531. params: this.selectionRows
  532. };
  533. postAction(url, this.selectionRows).then(res => {
  534. if (res.success) {
  535. if (res.result.indexOf('2')!==-1){
  536. this.handleExportXlsData('上报关停','2',"up")
  537. }
  538. if (res.result.indexOf('1')!==-1){
  539. this.handleExportXlsData('非高危','1',"up")
  540. }
  541. if (res.result.indexOf('3')!==-1 || res.result.indexOf('4,3')!==-1 || res.result.indexOf('3,4')!==-1 || res.result.indexOf('4')!==-1) {
  542. this.handleExportXlsData('上报紫名单','4',"up")
  543. this.handleExportXlsData('上报蓝名单','3',"up")
  544. }
  545. }
  546. })
  547. }
  548. this.showImproveAndUploadList();
  549. },
  550. handleExportXlsData(fileName,num,info){
  551. if(!fileName || typeof fileName != "string"){
  552. fileName = "导出文件"
  553. }
  554. let param = this.getQueryParams();
  555. if (info==="up"){
  556. param.numberResults=[];
  557. param.numberResults[0]=num;
  558. }
  559. if(this.selectedRowKeys && this.selectedRowKeys.length>0){
  560. param['selections'] = this.selectedRowKeys.join(",")
  561. }
  562. console.log("导出参数",param)
  563. downFile(this.url.exportXlsUrlUp,param).then((data)=>{
  564. if (!data) {
  565. this.$message.warning("文件下载失败")
  566. return
  567. }
  568. if (typeof window.navigator.msSaveBlob !== 'undefined') {
  569. window.navigator.msSaveBlob(new Blob([data],{type: 'application/vnd.ms-excel'}), fileName+'.xls')
  570. }else{
  571. let url = window.URL.createObjectURL(new Blob([data],{type: 'application/vnd.ms-excel'}))
  572. let link = document.createElement('a')
  573. link.style.display = 'none'
  574. link.href = url
  575. link.setAttribute('download', fileName+'.xls')
  576. document.body.appendChild(link)
  577. link.click()
  578. document.body.removeChild(link); //下载完成移除元素
  579. window.URL.revokeObjectURL(url); //释放掉blob对象
  580. }
  581. })
  582. },
  583. // getSysCompanyData(){
  584. // let data = {
  585. //
  586. // };
  587. // getAction(this.url.getCompany, data).then((res) => {
  588. // if (res.success) {
  589. // let result = res.result;
  590. // console.log(result + "result");
  591. // if (result != null) {
  592. // this.sysCompany = result;
  593. // }
  594. // }
  595. // })
  596. // },
  597. // getSysCompany(id) {
  598. //
  599. // for (var item of this.sysCompany) {
  600. //
  601. // for (var it of item.sysBusinessHallList) {
  602. // if (it.id === id) {
  603. // return it.name
  604. // }
  605. // }
  606. //
  607. // }
  608. // },
  609. newPhone(newPhones){
  610. var phone='';
  611. newPhones = newPhones.split(',');
  612. for (var item of newPhones) {
  613. phone+=item+' '
  614. }
  615. return phone
  616. },
  617. currentCom(record){
  618. //新建未报
  619. if (record.status==='0'){
  620. return record.businessAddress
  621. }
  622. if (record.status==='1'){
  623. return '已报分公司'
  624. }
  625. if (record.status==='2'){
  626. return '已完成'
  627. }
  628. },
  629. showByCreateBy(record){
  630. this.selectRefresh();
  631. this.selectedRowKeys = [];
  632. this.selectionRows = [];
  633. },
  634. showByBusinessAddresse(record){
  635. let queryParam = {
  636. "businessAddress":record.businessAddress,
  637. "cardNo":this.queryParam.cardNo,
  638. "cardName":this.queryParam.cardName,
  639. "newPhone":this.queryParam.newPhone,
  640. "createDateStart":this.queryParam.createDateStart,
  641. "createDateEnd":this.queryParam.createDateEnd
  642. }
  643. this.loadData(null,queryParam);
  644. this.selectedRowKeys = [];
  645. this.selectionRows = [];
  646. },
  647. showByPhone(record){
  648. this.selectRefresh();
  649. this.selectedRowKeys = [];
  650. this.selectionRows = [];
  651. },
  652. showByCardNo(record){
  653. // let queryParam = {
  654. // "cardNo":record.cardNo,
  655. // "cardName":this.queryParam.cardName
  656. // }
  657. // this.loadData(null,queryParam);
  658. // this.selectedRowKeys = [];
  659. // this.selectionRows = [];
  660. // this.$router.go({
  661. // path:'/networkAccess/registration',
  662. // query: {
  663. // close:true
  664. // }
  665. // })
  666. //this.$router.push({path: '/networkAccess/registrationSelect', query: {id: record.id,cardNo: record.cardNo,isDisabled:true}});
  667. this.$router.push({path: '/networkAccess/registrationSelect', query: {id: record.id}});
  668. },
  669. showByCardName(record){
  670. this.selectRefresh();
  671. this.selectedRowKeys = [];
  672. this.selectionRows = [];
  673. },
  674. /**标签监听*/
  675. tabChange(key) {
  676. this.url.list = "/businessReminderCard/list"
  677. if (key == "all") {
  678. this.numberResults = null;
  679. this.queryParam.numberResults_MultiString = this.numberResults;
  680. this.currentTab = 'all';
  681. } else if (key == "undo") {
  682. this.numberResults = "1";
  683. this.queryParam.numberResults_MultiString = this.numberResults;
  684. this.currentTab = 'undo';
  685. } else if (key == "uncheck") {
  686. this.numberResults = "2";
  687. this.queryParam.numberResults_MultiString = this.numberResults;
  688. this.currentTab = 'uncheck';
  689. } else if (key == "checked") {
  690. this.numberResults = "3";
  691. this.queryParam.numberResults_MultiString = this.numberResults;
  692. this.currentTab = 'checked';
  693. } else if (key == "del") {
  694. this.numberResults = null
  695. this.url.list = '/businessReminderCard/delete/list'
  696. this.queryParam.numberResults_MultiString = this.numberResults;
  697. this.currentTab = 'del';
  698. }
  699. this.loadData(1);
  700. },
  701. searchQuery() {
  702. this.loadData(1);
  703. this.selectedRowKeys = [];
  704. this.selectionRows = [];
  705. //this.loadTabNumber(this.task.id);
  706. },
  707. /**统计数量*/
  708. typeCount() {
  709. let that = this;
  710. let url = that.url.typeCount;
  711. getAction(url, {}).then(res => {
  712. if (res.success) {
  713. let result = res.result;
  714. that.tabAll = '全部(' + result.count + ')';
  715. console.log(that.tabAll)
  716. that.tabUndo = '非高危(' + result.unCount + ')';
  717. that.tabUncheck = '上报蓝紫名单(' + result.uncheckCount + ')';
  718. that.tabChecked = '上报关停(' + result.closeCount + ')';
  719. that.tabDelCheck = '已删除(' + result.delCount + ')';
  720. } else {
  721. }
  722. }).finally(() => {
  723. })
  724. },
  725. getDate(){
  726. var today = new Date();
  727. var dd = String(today.getDate()).padStart(2, '0');
  728. var mm = String(today.getMonth() + 1).padStart(2, '0');
  729. var yyyy = today.getFullYear();
  730. today = yyyy+'-'+ mm+'-' +dd;
  731. return today;
  732. },
  733. /**修改*/
  734. showImproveAndUpload(record) {
  735. if (!record.createTime.match(RegExp(this.getDate()))){
  736. return this.$message.warning('非当天创建 禁止修改', 3);
  737. }
  738. //校验
  739. let data = {
  740. ids: [record.id],
  741. }
  742. postAction("/businessReminderCard/check",{ids: data.ids} ).then((res) => {
  743. if (!res.success) {
  744. return this.$message.warning(res.message, 3);
  745. }
  746. this.$router.push({path: '/networkAccess/registrationUpdate', query: {id: record.id}});
  747. })
  748. },
  749. showImproveAndUploadAdminCom(record,status) {
  750. //上报分公司
  751. if (record.status==='1'){
  752. return this.$message.warning('上报状态为已上报分公司 请勿重复操作', 3);
  753. }
  754. if (record.status==='2'){
  755. return this.$message.warning('上报状态为已上报 请勿重复操作', 3);
  756. }
  757. let data = {
  758. ids: [record.id],
  759. }
  760. postAction("/businessReminderCard/escalationCom",{ids: data.ids} ).then((res) => {
  761. if (res.success) {
  762. this.$message.success(res.message, 3);
  763. this.loadData(1);
  764. } else {
  765. this.$message.error(res.message);
  766. }
  767. })
  768. },
  769. showImproveAndUploadAdmin(record,status) {
  770. //上报
  771. if (record.status==='0'){
  772. return this.$message.warning('上报状态为新建未报 请先进行上报分公司', 3);
  773. }
  774. if (record.status==='2'){
  775. return this.$message.warning('上报状态为已上报 请勿重复操作', 3);
  776. }
  777. let data = {
  778. ids: [record.id],
  779. }
  780. postAction("/businessReminderCard/escalation",{ids: data.ids} ).then((res) => {
  781. if (res.success) {
  782. this.$message.success(res.message, 3);
  783. this.loadData(1);
  784. } else {
  785. this.$message.error(res.message);
  786. }
  787. })
  788. },
  789. selectRefresh(){
  790. let queryParam = {
  791. "cardNo":this.queryParam.cardNo,
  792. "cardName":record.cardName,
  793. "newPhone":this.queryParam.newPhone,
  794. "createDateStart":this.queryParam.createDateStart,
  795. "createDateEnd":this.queryParam.createDateEnd,
  796. "sysBusinessHall":this.queryParam.sysBusinessHall,
  797. "status":this.queryParam.status
  798. }
  799. this.loadData(null,queryParam);
  800. },
  801. showImproveAndUploadList() {
  802. for (let i = 0; i < this.selectionRows.length; i++) {
  803. if(this.selectionRows[i].status==='2'){
  804. return this.$message.warning('选中数据中存在上报成功的数据...', 3);
  805. }
  806. }
  807. for (let i = 0; i < this.selectionRows.length; i++) {
  808. if(this.selectionRows[i].status==='0'){
  809. return this.$message.warning('选中数据中存在新建未报的数据...', 3);
  810. }
  811. }
  812. for (let s = 0; s < this.selectionRows.length; s++) {
  813. if(this.selectionRows[s].numberResults.indexOf('1')!==-1){
  814. return this.$message.warning('选中数据存在非高危数据(请重新选择)...', 3);
  815. }
  816. }
  817. let data = {
  818. ids: this.selectedRowKeys,
  819. }
  820. postAction("/businessReminderCard/escalation",data ).then((res) => {
  821. if (res.success) {
  822. this.$message.success(res.message, 3);
  823. this.loadData(1);
  824. } else {
  825. this.$message.error(res.message);
  826. }
  827. })
  828. },
  829. /**详情*/
  830. showCheckDetail(record) {
  831. let id = record.id;
  832. this.$router.push({path: '/networkAccess/registrationDetails', query: {id: record.id}});
  833. },
  834. /**删除*/
  835. delFlagById(record){
  836. let id = record.id;
  837. let that = this;
  838. let url = that.url.delete;
  839. deleteAction(url, {id: id}).then(res => {
  840. if (res.success) {
  841. this.typeCount();
  842. this.$message.success("删除成功", 7);
  843. this.loadData(1);
  844. } else {
  845. this.$message.error("删除失败", 7);
  846. }
  847. });
  848. },
  849. /**彻底删除*/
  850. removeById(record) {
  851. let id = record.id;
  852. let that = this;
  853. let url = that.url.removeById;
  854. getAction(url, {id: id}).then(res => {
  855. if (res.success) {
  856. this.typeCount();
  857. this.$message.success("删除成功", 7);
  858. this.loadData(1);
  859. } else {
  860. this.$message.error("删除失败", 7);
  861. }
  862. });
  863. },
  864. /**恢复*/
  865. restoreById(record) {
  866. let id = record.id;
  867. let that = this;
  868. let url = that.url.restoreById;
  869. getAction(url, {id: id}).then(res => {
  870. if (res.success) {
  871. this.typeCount();
  872. this.$message.success("恢复成功", 7);
  873. this.loadData(1);
  874. } else {
  875. this.$message.error("恢复失败", 7);
  876. }
  877. });
  878. },
  879. /**通知*/
  880. noticeDeal(record) {
  881. let that = this;
  882. that.$message.info('已通知业务员,对入网信息进行修改!');
  883. }
  884. },
  885. }
  886. </script>
  887. <style scoped>
  888. </style>