userStatistics.vue 34 KB

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