userStatistics.vue 35 KB

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