IncidentNewList.vue 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202
  1. <template>
  2. <div class="bgColor">
  3. <div slot="content" class="scroll-wrapper">
  4. <div class="demo">
  5. <div class="header">事件列表</div>
  6. <div class="stateSearchWrap">
  7. <!-- <cube-select
  8. class="stateSearch"
  9. v-model="searchType"
  10. :options="searchsType"
  11. @change="typeChange()"
  12. ></cube-select>
  13. <cube-select
  14. class="stateSearch"
  15. v-model="searchState"
  16. :options="searchsState"
  17. @change="typeChange()"
  18. ></cube-select> -->
  19. <div class="stateSearch" @click="typeChange(tab)" v-for="tab in tabTypes" :key="tab.id" :class="{active: tabTypeIdActive == tab.id}">
  20. {{ tab.text }}({{ tab.num }})
  21. <div class="filter" v-if="tab.id == 2" @click.stop="showDrawer()" :class="{active: tabTypeIdActive == tab.id}"><i class="dash dash-shaixuan"></i></div>
  22. </div>
  23. </div>
  24. <div class="scroll-list-wrap">
  25. <cube-scroll
  26. ref="scroll"
  27. :data="items"
  28. :options="options"
  29. @pulling-down="onPullingDown"
  30. @pulling-up="onPullingUp"
  31. >
  32. <div class="conentBox" v-if="!loadShow && items.length">
  33. <div
  34. class="conent"
  35. v-for="item in items"
  36. :key="item.id"
  37. @click="toIncidentDetails(item)"
  38. >
  39. <div class="head">
  40. <p>
  41. <i class="iconfont icon-zuixinbaoxiu newPapir"></i>
  42. 事件编号:{{ item.incidentsign }}
  43. <span
  44. :class="{
  45. btn: true,
  46. daipingjia: item.state.name == '待评价',
  47. daijiedan:
  48. item.state.name == '待接单' &&
  49. item.handlerUser &&
  50. !item.candidateGroups,
  51. daiqiangdan:
  52. item.state.name == '待接单' &&
  53. !item.handlerUser &&
  54. item.candidateGroups,
  55. chulizhong: item.state.name == '处理中',
  56. yijiejue: item.state.name == '已解决',
  57. yiguanbi: item.state.name == '已关闭',
  58. chongxinzhipai: item.state.name == '重新指派'
  59. }"
  60. >{{
  61. item.state.name == "待接单"
  62. ? item.handlerUser && !item.candidateGroups
  63. ? "待接单"
  64. : "待抢单"
  65. : item.state.name
  66. }}</span
  67. >
  68. </p>
  69. </div>
  70. <div class="center">
  71. <p class="desc">
  72. <span class="fl">事件描述:</span>
  73. <span
  74. class="grayFont overflowEllipsis2"
  75. v-html="item.description"
  76. ></span>
  77. </p>
  78. <p v-if="valConfig == 1">
  79. 报修人 :
  80. <span class="grayFont">{{ item.requester?item.requester.name:'' }}</span>
  81. <span @click.stop v-if="item.contactsInformation"
  82. ><a :href="'tel:' + item.contactsInformation"
  83. >(<i class="iconfont icon-shouji"></i
  84. >{{ item.contactsInformation }})</a
  85. ></span
  86. >
  87. </p>
  88. <p v-if="valConfig == 2">
  89. 报修科室 :
  90. <span class="grayFont">{{
  91. item.department ? item.department.dept : ""
  92. }}</span>
  93. </p>
  94. </div>
  95. <div class="bottom">
  96. <span v-if="!item.place"></span>
  97. <span
  98. v-if="item.place"
  99. style="width:70%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"
  100. >{{ item.place.area.area }} {{ item.place.place }}
  101. {{ item.houseNumber }}</span
  102. >
  103. <span>
  104. <i v-if="item.callID" @click.stop="showAudio(item.callID)" class="dash dash-dianbohuifang"></i>
  105. {{ item.acceptDate | timeFormat("MM-dd HH:mm") }}
  106. </span>
  107. </div>
  108. <div class="btns">
  109. <cube-form-group
  110. class="sub-btn"
  111. v-show="
  112. (item.state.id === 1544 || item.state.id === 1543) &&
  113. isAssign
  114. "
  115. >
  116. <cube-button @click.stop="assign(item)">指派</cube-button>
  117. </cube-form-group>
  118. <cube-form-group
  119. class="sub-btn"
  120. v-show="item.state.id === 1544"
  121. >
  122. <cube-button @click.stop="addHandlerLog(item)"
  123. >维修进度</cube-button
  124. >
  125. </cube-form-group>
  126. <cube-form-group
  127. class="sub-btn"
  128. v-if="item.state.value != 1546 && !item.handlerUser && jurisdiction(item) && qiangdan(item)"
  129. >
  130. <cube-button @click.stop="subVali(item)"
  131. >抢单</cube-button
  132. >
  133. </cube-form-group>
  134. </div>
  135. </div>
  136. </div>
  137. <template v-if="customPullDown" slot="pulldown" slot-scope="props">
  138. <div
  139. v-if="props.pullDownRefresh"
  140. class="cube-pulldown-wrapper"
  141. :style="props.pullDownStyle"
  142. >
  143. <div
  144. v-show="props.beforePullDown"
  145. class="before-trigger"
  146. :style="{ paddingTop: props.bubbleY + 'px' }"
  147. >
  148. <span
  149. :class="{
  150. rotate: props.bubbleY > pullDownRefreshThreshold - 40
  151. }"
  152. >↓</span
  153. >
  154. </div>
  155. <div class="after-trigger" v-show="!props.beforePullDown">
  156. <div v-show="props.isPullingDown" class="loading">
  157. <cube-loading></cube-loading>
  158. </div>
  159. <div v-show="!props.isPullingDown" class="text">
  160. <span class="refresh-text">更新成功</span>
  161. </div>
  162. </div>
  163. </div>
  164. </template>
  165. <!-- <div class="wushuju" v-if="!loadShow && items.length === 0">
  166. <img src="./../../static/images/wushuju.svg" alt />
  167. <p>暂无事件</p>
  168. </div> -->
  169. </cube-scroll>
  170. </div>
  171. </div>
  172. </div>
  173. <load-ing v-show="loadShow"></load-ing>
  174. <!-- 指派弹窗 -->
  175. <showModel
  176. v-if="models.disjunctor"
  177. :title="models.title"
  178. :icon="models.icon"
  179. :disjunctor="models.disjunctor"
  180. @ok="ok"
  181. @cancel="cancel"
  182. :operate="models.operate"
  183. selectName="user"
  184. ></showModel>
  185. <!-- 新增维修记录弹窗 -->
  186. <showModel
  187. :title="models1.title"
  188. :icon="models1.icon"
  189. :disjunctor="models1.disjunctor"
  190. @ok="ok1"
  191. @cancel="cancel1"
  192. :operate="models1.operate"
  193. textName="textarea"
  194. ></showModel>
  195. <div class="mask" v-if="audioMask" @click="hideAudio()">
  196. <audio controls autoplay="autoplay" id="bgMusic">
  197. <source :src="audioSrc" type="audio/mpeg">
  198. </audio>
  199. </div>
  200. <seiminDrawer v-if="isShowDrawer" @close="closeDrawer" @confirm="confirmDrawer" :evt="evt"></seiminDrawer>
  201. </div>
  202. </template>
  203. <script>
  204. import seiminDrawer from "../custom/seiminDrawer.vue";
  205. import showModel from "../components/showModel/showModel.vue";
  206. import CubePage from "../components/cube-page.vue";
  207. import SwitchOption from "../components/switch-option";
  208. import InputOption from "../components/input-option";
  209. import SelectOption from "../components/select-option";
  210. import { formatDate } from "./../components/js/date.js";
  211. import LoadIng from "./../views/loading.vue";
  212. export default {
  213. data() {
  214. return {
  215. evt: null,
  216. isShowDrawer: false,
  217. tabTypeIdActive: 2,
  218. tabTypes: [
  219. {
  220. id: 1,
  221. text: "待接单",
  222. num: 0
  223. },
  224. {
  225. id: 2,
  226. text: "处理中",
  227. num: 0
  228. }
  229. ],
  230. audioSrc:'',//音频路径
  231. audioMask:false,//音频
  232. modelsData: null, //点击弹窗的那一项数据
  233. modelsData1: null, //点击弹窗的那一项数据
  234. // 弹窗model
  235. models: {
  236. disjunctor: false
  237. },
  238. models1: {
  239. disjunctor: false
  240. },
  241. isAssign: false, //是否有权限指派
  242. isAll: false, //是否显示全部事件
  243. loginUser: JSON.parse(localStorage.getItem("loginUser")),
  244. menu: JSON.parse(localStorage.getItem("menu")),
  245. valConfig: JSON.parse(localStorage.getItem("valConfig")) - 0, //报修主体
  246. items: [],
  247. pullDownRefresh: true,
  248. pullDownRefreshThreshold: 60,
  249. pullDownRefreshStop: 40,
  250. pullDownRefreshTxt: "更新成功",
  251. pullUpLoad: true,
  252. pullUpLoadThreshold: 0,
  253. pullUpLoadMoreTxt: "加载更多",
  254. pullUpLoadNoMoreTxt: "没有更多数据",
  255. customPullDown: true,
  256. candidateGroups: "",
  257. searchsType: [
  258. {
  259. text: "待我处理",
  260. value: "todo"
  261. },
  262. {
  263. text: "与我关联",
  264. value: "done"
  265. }
  266. ],
  267. searchsState:[],//状态列表
  268. searchType: "todo",
  269. searchState: 1544,
  270. type: "todo",
  271. isToday: "",
  272. sum: 10,
  273. idx: 0,
  274. stateClass: "",
  275. loadShow: true
  276. };
  277. },
  278. components: {
  279. CubePage,
  280. SwitchOption,
  281. InputOption,
  282. SelectOption,
  283. LoadIng,
  284. showModel,
  285. seiminDrawer,
  286. },
  287. computed: {
  288. options() {
  289. return {
  290. pullDownRefresh: this.pullDownRefreshObj,
  291. pullUpLoad: this.pullUpLoadObj,
  292. scrollbar: true
  293. };
  294. },
  295. pullDownRefreshObj: function() {
  296. return this.pullDownRefresh
  297. ? {
  298. threshold: parseInt(this.pullDownRefreshThreshold),
  299. txt: this.pullDownRefreshTxt
  300. }
  301. : false;
  302. },
  303. pullUpLoadObj: function() {
  304. return this.pullUpLoad
  305. ? {
  306. threshold: parseInt(this.pullUpLoadThreshold),
  307. txt: {
  308. more: this.pullUpLoadMoreTxt,
  309. noMore: this.pullUpLoadNoMoreTxt
  310. }
  311. }
  312. : false;
  313. }
  314. },
  315. methods: {
  316. // 确认侧边筛选框
  317. confirmDrawer(evt){
  318. console.log(evt);
  319. this.evt = evt;
  320. this.loadShow = true;
  321. this.items = [];
  322. this.idx = 0;
  323. this.sum = 10;
  324. this.getData();
  325. },
  326. // 关闭侧边筛选框
  327. closeDrawer(){
  328. this.isShowDrawer = false;
  329. },
  330. // 打开侧边筛选框
  331. showDrawer(){
  332. this.isShowDrawer = true;
  333. },
  334. qiangdan(incident){
  335. return this.menu.some(v => v.link == 'shijianliebiao_qiangdan');
  336. },
  337. jurisdiction(incident){
  338. return this.loginUser.group.some(v => v.id == incident.candidateGroups);
  339. },
  340. // 抢单
  341. subVali(incident) {
  342. //数据提交
  343. var that = this;
  344. this.$createDialog({
  345. type: 'confirm',
  346. icon: 'cubeic-alert',
  347. title: '提示',
  348. content: '是否抢单?',
  349. confirmBtn: {
  350. text: '确定',
  351. active: true,
  352. disabled: false,
  353. href: 'javascript:;'
  354. },
  355. cancelBtn: {
  356. text: '取消',
  357. active: false,
  358. disabled: false,
  359. href: 'javascript:;'
  360. },
  361. onConfirm: () => {
  362. that.$http
  363. .post(
  364. "service/bpm/bpm/claimAndCompletedTask/" + incident.taskId,
  365. { receive_code: "handler", userId: that.loginUser.id }
  366. )
  367. .then(function (res) {
  368. console.log(res.data);
  369. if (res.data.status == 200) {
  370. that
  371. .$createDialog({
  372. type: "alert",
  373. title: "抢单成功",
  374. content: "点击返回首页",
  375. icon: "cubeic-right",
  376. onConfirm: (e, promptValue) => {
  377. that.$router.push({ path: "/main" });
  378. },
  379. })
  380. .show();
  381. }else{
  382. this.$createDialog({
  383. type: "alert",
  384. title: "系统错误,请稍后再试!",
  385. icon: "cubeic-wrong",
  386. }).show();
  387. }
  388. });
  389. },
  390. onCancel: () => {
  391. }
  392. }).show()
  393. },
  394. // 播放音频
  395. showAudio(callID){
  396. const toast = this.$createToast({
  397. txt: "Loading...",
  398. mask: true
  399. });
  400. toast.show();
  401. this.$http
  402. .post("service/bpm/data/fetchDataList/callrecord", {idx: 0, sum: 1, callrecord: {callAccept: callID}})
  403. .then(res => {
  404. toast.hide();
  405. if (res.data.status == 200) {
  406. res.data.list = res.data.list || [];
  407. if(res.data.list.length){
  408. this.audioMask = true;
  409. this.audioSrc = this.$host+res.data.list[0].recordingFileName;
  410. }
  411. }
  412. });
  413. },
  414. // 隐藏音频组件
  415. hideAudio(){
  416. this.audioMask=false;
  417. },
  418. //确定
  419. ok(selectUserId) {
  420. console.log(selectUserId);
  421. if (!selectUserId) {
  422. this.$createDialog({
  423. type: "alert",
  424. title: "请选择指派对象",
  425. icon: "cubeic-warn"
  426. }).show();
  427. return;
  428. }
  429. const toast = this.$createToast({
  430. txt: "Loading...",
  431. mask: true
  432. });
  433. toast.show();
  434. this.$http
  435. .post("service/bpm/bpm/delegateTask/" + this.modelsData.taskId, {
  436. assginee: selectUserId,
  437. incidentId: this.modelsData.assignee ? undefined : this.modelsData.id,
  438. processInstanceId: this.modelsData.processInstanceId,
  439. })
  440. .then(res => {
  441. toast.hide();
  442. this.models.disjunctor = false;
  443. if (res.status == 200) {
  444. this.$createDialog({
  445. type: "alert",
  446. title: "操作成功",
  447. icon: "cubeic-right",
  448. onConfirm: (e, promptValue) => {
  449. this.loadShow = true;
  450. this.items = [];
  451. this.idx = 0;
  452. this.getData();
  453. }
  454. }).show();
  455. } else {
  456. this.$createDialog({
  457. type: "alert",
  458. title: "系统错误,请稍后再试!",
  459. icon: "cubeic-wrong",
  460. onConfirm: (e, promptValue) => {
  461. this.loadShow = true;
  462. this.items = [];
  463. this.idx = 0;
  464. this.getData();
  465. }
  466. }).show();
  467. }
  468. });
  469. },
  470. //取消
  471. cancel() {
  472. this.models.disjunctor = false;
  473. },
  474. // 指派
  475. assign(item) {
  476. this.modelsData = item;
  477. this.models = {
  478. disjunctor: true,
  479. title: "指派对象",
  480. icon: "warn",
  481. operate: {
  482. ok: "确定",
  483. cancel: "取消"
  484. }
  485. };
  486. },
  487. //确定
  488. ok1(obj) {
  489. console.log(obj);
  490. if (!obj.maintenanceMode) {
  491. this.$createDialog({
  492. type: "alert",
  493. title: "请选择维修方式",
  494. icon: "cubeic-warn"
  495. }).show();
  496. return;
  497. }
  498. if (!obj.estimatedNumberOfDays) {
  499. this.$createDialog({
  500. type: "alert",
  501. title: "请选择预估天数",
  502. icon: "cubeic-warn"
  503. }).show();
  504. return;
  505. }
  506. if (!obj.textareaData.trim()) {
  507. this.$createDialog({
  508. type: "alert",
  509. title: "请填写维修记录",
  510. icon: "cubeic-warn"
  511. }).show();
  512. return;
  513. }
  514. const toast = this.$createToast({
  515. txt: "Loading...",
  516. mask: true
  517. });
  518. toast.show();
  519. this.$http
  520. .post("service/bpm/data/addData/operationLog", {
  521. operationLog: {
  522. opType: "handlerLog",
  523. opValue: obj.textareaData,
  524. extra1: this.modelsData1.id,
  525. repairType: obj.maintenanceMode,
  526. expectedDay: obj.estimatedNumberOfDays,
  527. }
  528. })
  529. .then(res => {
  530. toast.hide();
  531. this.models1.disjunctor = false;
  532. if (res.status == 200) {
  533. this.$createDialog({
  534. type: "alert",
  535. title: "操作成功",
  536. icon: "cubeic-right",
  537. onConfirm: (e, promptValue) => {
  538. this.loadShow = true;
  539. this.items = [];
  540. this.idx = 0;
  541. this.getData();
  542. }
  543. }).show();
  544. } else {
  545. this.$createDialog({
  546. type: "alert",
  547. title: "系统错误,请稍后再试!",
  548. icon: "cubeic-wrong",
  549. onConfirm: (e, promptValue) => {
  550. this.loadShow = true;
  551. this.items = [];
  552. this.idx = 0;
  553. this.getData();
  554. }
  555. }).show();
  556. }
  557. });
  558. },
  559. //取消
  560. cancel1() {
  561. this.models1.disjunctor = false;
  562. },
  563. // 新增维修记录
  564. addHandlerLog(item) {
  565. this.modelsData1 = item;
  566. this.models1 = {
  567. disjunctor: true,
  568. title: "新增维修记录",
  569. icon: "warn",
  570. operate: {
  571. ok: "确定",
  572. cancel: "取消"
  573. }
  574. };
  575. },
  576. getParamsState() {
  577. if (this.$route.params.type) {
  578. this.type = this.$route.params.type;
  579. this.isToday = this.$route.params.isToday;
  580. if (this.type === "todo") {
  581. this.searchType = "todo";
  582. } else if (this.type === "done") {
  583. this.searchType = "done";
  584. } else {
  585. this.searchType = "all";
  586. }
  587. }
  588. if(this.$route.params.status){
  589. this.searchState = this.$route.params.status ? Number(this.$route.params.status) : 0;
  590. }
  591. },
  592. typeChange(tab) {
  593. this.tabTypeIdActive = tab.id;
  594. if(tab.id == 1){
  595. this.searchState = 1543;
  596. }else if(tab.id == 2){
  597. this.searchState = 1544;
  598. }
  599. this.loadShow = true;
  600. this.items = [];
  601. this.idx = 0;
  602. this.sum = 10;
  603. this.getData();
  604. },
  605. toIncidentDetails(data) {
  606. console.log(1111111);
  607. console.log(data);
  608. var name = "";
  609. if (data.state.value == "pending") {
  610. if (data.handlerUser && !data.candidateGroups) {
  611. // 指派给人 接单
  612. name = "Order";
  613. } else if (data.candidateGroups && !data.handlerUser) {
  614. // 指派给组 抢单
  615. name = "GrabSheet";
  616. }
  617. } else if (data.state.value == "reassign") {
  618. name = "AgainAssign";
  619. } else if (data.state.value == "handler") {
  620. name = "Processing";
  621. } else if (data.state.value == "resolved") {
  622. name = "Solved";
  623. } else if (data.state.value == "close") {
  624. name = "Closed";
  625. }
  626. if(data.duty && data.duty.addSummary == 1 && name == "Processing"){
  627. // 责任科室【是否需要填写汇总单】开启,并且工单状态是处理中
  628. this.$router.push({
  629. path: `/summaryOrder/${data.id}/${data.processInstanceId}`
  630. });
  631. }else{
  632. this.$router.push({
  633. name: name,
  634. params: {
  635. data: data
  636. }
  637. });
  638. }
  639. },
  640. getNum(statusId) {
  641. let postData = {
  642. assignee: this.loginUser.id,
  643. candidateGroups: this.candidateGroups,
  644. searchType: this.searchType,
  645. idx: 0,
  646. sum: 1,
  647. incident: { temporary: true,statusId }
  648. };
  649. if(this.evt && this.evt.category.id){
  650. postData.incident.levelCategory = this.evt.category;
  651. }
  652. if(this.evt && this.evt.area.id){
  653. postData.incident.place = {
  654. area: this.evt.area
  655. }
  656. }
  657. if (this.isToday == "today") {
  658. postData.incident.acceptDate =
  659. formatDate(new Date(), "yyyy-MM-dd") + " 00:00:00";
  660. postData.incident.acceptDateEnd =
  661. formatDate(new Date(), "yyyy-MM-dd") + " 23:59:59";
  662. }
  663. if(this.searchType === 'all'){
  664. // 全部事件
  665. if(this.loginUser.duty){
  666. // 当前的所属责任科室
  667. postData.incident.duty = this.loginUser.duty;
  668. }else if(this.loginUser.branch){
  669. // 当前的所属院区
  670. postData.incident.branch = this.loginUser.branch.id;
  671. }
  672. this.$http
  673. .post("service/user/data/fetchDataList/incident", postData)
  674. .then((res) => {
  675. if(statusId == 1543){
  676. this.tabTypes[0].num = res.data.totalNum;
  677. }else if(statusId == 1544){
  678. this.tabTypes[1].num = res.data.totalNum;
  679. }
  680. });
  681. }else{
  682. this.$http
  683. .post("service/bpm/bpm/fetchTask/bpm_incident", postData)
  684. .then((res) => {
  685. if(statusId == 1543){
  686. this.tabTypes[0].num = res.data.resultCount;
  687. }else if(statusId == 1544){
  688. this.tabTypes[1].num = res.data.resultCount;
  689. }
  690. });
  691. }
  692. },
  693. getData() {
  694. let postData = {
  695. assignee: this.loginUser.id,
  696. candidateGroups: this.candidateGroups,
  697. searchType: this.searchType,
  698. idx: this.idx,
  699. sum: this.sum,
  700. incident: {
  701. temporary: true,
  702. statusId:this.searchState?this.searchState:undefined,
  703. }
  704. };
  705. if(this.evt && this.evt.category.id){
  706. postData.incident.levelCategory = this.evt.category;
  707. }
  708. if(this.evt && this.evt.area.id){
  709. postData.incident.place = {
  710. area: this.evt.area
  711. }
  712. }
  713. if (this.isToday == "today") {
  714. postData.incident.acceptDate =
  715. formatDate(new Date(), "yyyy-MM-dd") + " 00:00:00";
  716. postData.incident.acceptDateEnd =
  717. formatDate(new Date(), "yyyy-MM-dd") + " 23:59:59";
  718. }
  719. if(this.searchType === 'all'){
  720. // 全部事件
  721. if(this.loginUser.duty){
  722. // 当前的所属责任科室
  723. postData.incident.duty = this.loginUser.duty;
  724. }else if(this.loginUser.branch){
  725. // 当前的所属院区
  726. postData.incident.branch = this.loginUser.branch.id;
  727. }
  728. this.$http
  729. .post("service/user/data/fetchDataList/incident", postData)
  730. .then((res) => {
  731. if (res.data.list.length > 0) {
  732. for (var i = 0; i < res.data.list.length; i++) {
  733. delete res.data.list[i].handlingPersonnelUser;
  734. delete res.data.list[i].sendBackUser;
  735. delete res.data.list[i].colourInfo;
  736. if(res.data.list[i].acceptUser){
  737. res.data.list[i].acceptUser = {
  738. id: res.data.list[i].acceptUser.id,
  739. name: res.data.list[i].acceptUser.name,
  740. };
  741. }
  742. res.data.list[i].createTime = formatDate(
  743. new Date(res.data.list[i].createTime),
  744. "yyyy-MM-dd hh:mm"
  745. );
  746. }
  747. if (this.idx) {
  748. this.items = this.items.concat(res.data.list);
  749. } else {
  750. this.items = res.data.list;
  751. }
  752. } else {
  753. this.$refs.scroll.forceUpdate();
  754. }
  755. if(this.searchState == 1543){
  756. this.tabTypes[0].num = res.data.totalNum;
  757. this.getNum(1544);
  758. }else if(this.searchState == 1544){
  759. this.tabTypes[1].num = res.data.totalNum;
  760. this.getNum(1543);
  761. }
  762. this.loadShow = false;
  763. });
  764. }else{
  765. this.$http
  766. .post("service/bpm/bpm/fetchTask/bpm_incident", postData)
  767. .then((res) => {
  768. if (res.data.data.length > 0) {
  769. for (var i = 0; i < res.data.data.length; i++) {
  770. delete res.data.data[i].handlingPersonnelUser;
  771. delete res.data.data[i].sendBackUser;
  772. delete res.data.data[i].colourInfo;
  773. if(res.data.data[i].acceptUser){
  774. res.data.data[i].acceptUser = {
  775. id: res.data.data[i].acceptUser.id,
  776. name: res.data.data[i].acceptUser.name,
  777. };
  778. }
  779. res.data.data[i].createTime = formatDate(
  780. new Date(res.data.data[i].createTime),
  781. "yyyy-MM-dd hh:mm"
  782. );
  783. }
  784. if (this.idx) {
  785. this.items = this.items.concat(res.data.data);
  786. } else {
  787. this.items = res.data.data;
  788. }
  789. } else {
  790. this.$refs.scroll.forceUpdate();
  791. }
  792. if(this.searchState == 1543){
  793. this.tabTypes[0].num = res.data.resultCount;
  794. this.getNum(1544);
  795. }else if(this.searchState == 1544){
  796. this.tabTypes[1].num = res.data.resultCount;
  797. this.getNum(1543);
  798. }
  799. this.loadShow = false;
  800. });
  801. }
  802. },
  803. onPullingDown() {
  804. this.idx = 0;
  805. this.sum = 10;
  806. this.getData();
  807. },
  808. onPullingUp() {
  809. this.idx = this.idx + 1;
  810. this.getData();
  811. },
  812. // 获取事件状态
  813. getStateList(){
  814. this.$http
  815. .post("service/common/common/getDictionary", {"type":"list","key":"incident_status"})
  816. .then((res) => {
  817. this.searchsState = [{text:'全部',value:0},...res.data.map(v=>({text:v.name,value:v.id}))]
  818. });
  819. }
  820. },
  821. created() {
  822. var that = this;
  823. let menu = JSON.parse(localStorage.getItem("menu"));
  824. if (menu) {
  825. this.isAssign = menu.some(v => v.link == "shijianliebiao_assign");
  826. this.isAll = menu.some(v => v.link == "shijianliebiao_all");
  827. if(this.isAll){
  828. this.searchsType.unshift({
  829. text: "全部事件",
  830. value: "all"
  831. })
  832. }
  833. }
  834. that.loginUser.group.forEach(element => {
  835. that.candidateGroups += element.id + ",";
  836. });
  837. that.candidateGroups = that.candidateGroups.substring(
  838. 0,
  839. that.candidateGroups.length - 1
  840. );
  841. this.getParamsState();
  842. this.loadShow = true;
  843. this.getData();
  844. this.getStateList();
  845. localStorage.removeItem("modelData");
  846. localStorage.removeItem("referenceInfo");
  847. localStorage.removeItem("order");
  848. localStorage.removeItem("model");
  849. }
  850. };
  851. </script>
  852. <style lang="stylus" rel="stylesheet/stylus" scoped>
  853. .mask{
  854. width: 100%;
  855. height: 100%;
  856. position: fixed;
  857. top: 0;
  858. background: rgba(0,0,0,.5);
  859. z-index: 999;
  860. display: flex;
  861. align-items: center;
  862. justify-content: center;
  863. }
  864. .btns{
  865. display: flex;
  866. justify-content: space-between
  867. .sub-btn {
  868. margin:0 2px;
  869. flex:1;
  870. background: #ececec;
  871. .cube-btn {
  872. background-color: #005395 !important;
  873. border-radius: 8px
  874. }
  875. }
  876. }
  877. .scroll-list-wrap {
  878. height: calc(100vh - 2.72rem);
  879. border-radius: 5px;
  880. transform: rotate(0deg); // fix 子元素超出边框圆角部分不隐藏的问题
  881. overflow: hidden;
  882. padding-top: 1.76rem;
  883. }
  884. .foods-wrapper {
  885. .food-item {
  886. display: flex;
  887. /* padding: 18px */
  888. /* border-bottom: 1px solid rgba(7, 17, 27, 0.1) */
  889. /* border-top: 1px solid rgba(7, 17, 27, 0.1)!important */
  890. &:last-child {
  891. border-none();
  892. margin-bottom: 0;
  893. }
  894. .icon {
  895. flex: 0 0 57px;
  896. margin-right: 10px;
  897. }
  898. .food-content {
  899. flex: 1;
  900. .name {
  901. margin: 2px 0 8px 0;
  902. height: 14px;
  903. line-height: 14px;
  904. font-size: 14px;
  905. color: rgb(7, 17, 27);
  906. }
  907. .description, .extra {
  908. line-height: 10px;
  909. font-size: 10px;
  910. color: rgb(147, 153, 159);
  911. }
  912. .description {
  913. line-height: 12px;
  914. margin-bottom: 8px;
  915. }
  916. .extra {
  917. .count {
  918. margin-right: 12px;
  919. }
  920. }
  921. .price {
  922. font-weight: 700;
  923. line-height: 24px;
  924. .now {
  925. margin-right: 8px;
  926. font-size: 14px;
  927. color: rgb(240, 20, 20);
  928. }
  929. .old {
  930. text-decoration: line-through;
  931. font-size: 10px;
  932. color: rgb(147, 153, 159);
  933. }
  934. }
  935. .cartcontrol-wrapper {
  936. position: absolute;
  937. right: 0;
  938. bottom: 12px;
  939. .scroll-wrapper {
  940. .cube-pulldown-wrapper {
  941. .before-trigger {
  942. font-size: 30px;
  943. line-height: 30px;
  944. align-self: flex-end;
  945. span {
  946. display: inline-block;
  947. transition: all 0.3s;
  948. color: #666;
  949. &.rotate {
  950. transform: rotate(180deg);
  951. }
  952. }
  953. }
  954. .after-trigger {
  955. .refresh-text {
  956. color: grey;
  957. }
  958. }
  959. }
  960. }
  961. }
  962. }
  963. }
  964. }
  965. </style>
  966. <style lang="less" scoped>
  967. .cont {
  968. margin-top: 1.86rem;
  969. }
  970. .scroll-list-wrap {
  971. padding-top: 1.76rem;
  972. }
  973. .header {
  974. width: 100%;
  975. height: 0.88rem;
  976. line-height: 0.88rem;
  977. text-align: center;
  978. color: #fff;
  979. font-size: 0.37rem;
  980. background: linear-gradient(#2e2f32, #414246);
  981. position: fixed;
  982. top: 0;
  983. z-index: 6;
  984. }
  985. .stateSearchWrap{
  986. width: 100%;
  987. position: fixed;
  988. top: 0.88rem;
  989. z-index: 6;
  990. display: flex;
  991. .filter{
  992. color: #005395;
  993. position: absolute;
  994. width: 1rem;
  995. height: 0.88rem;
  996. display: flex;
  997. justify-content: center;
  998. align-items: center;
  999. top: 0;
  1000. right: 0;
  1001. &.active{
  1002. color: #fff;
  1003. }
  1004. }
  1005. .stateSearch {
  1006. flex: 1;
  1007. text-align: center;
  1008. height: 0.88rem;
  1009. line-height: 0.88rem;
  1010. padding: 0 0.24rem;
  1011. font-size: 0.36rem;
  1012. color: #333333;
  1013. border-bottom: 0.08rem solid #e5e5e5;
  1014. border-right: 0.08rem solid #e5e5e5;
  1015. &.active{
  1016. background-color: #005395 ;
  1017. color: #fff;
  1018. }
  1019. &:last-of-type{
  1020. border-right: none;
  1021. }
  1022. }
  1023. }
  1024. .bgColor {
  1025. background-color: white;
  1026. }
  1027. .food-item {
  1028. border-top: 0.16rem rgb(238, 238, 238) solid;
  1029. }
  1030. .food-content {
  1031. border-top: 0.01rem rgb(223, 222, 222) solid;
  1032. border-bottom: 0.01rem rgb(223, 222, 222) solid;
  1033. }
  1034. // .cube-select {
  1035. // height: 0.88rem;
  1036. // line-height: 0.88rem;
  1037. // padding: 0 0.24rem;
  1038. // font-size: 0.36rem;
  1039. // color: #333333;
  1040. // border-bottom: 0.08rem solid #e5e5e5;
  1041. // }
  1042. .title {
  1043. display: flex;
  1044. justify-content: space-between;
  1045. height: 0.7rem;
  1046. line-height: 0.7rem;
  1047. border-top: 0.01rem rgb(223, 222, 222) solid;
  1048. padding: 0 0.24rem;
  1049. border-bottom: 0.01rem rgb(223, 222, 222) solid;
  1050. }
  1051. .title i {
  1052. font-size: 0.32rem;
  1053. color: #005395;
  1054. }
  1055. .title div:nth-child(1) {
  1056. font-size: 0.32rem;
  1057. }
  1058. .title div:nth-child(1) span {
  1059. display: inline-block;
  1060. margin-left: 0.08rem;
  1061. }
  1062. .title div:nth-child(2) {
  1063. padding: 0.05rem 0.3rem;
  1064. /* border: 0.01rem rgb(0,0,255) solid; */
  1065. border-radius: 16px;
  1066. /* color: rgb(0,0,255); */
  1067. height: 0.25rem;
  1068. line-height: 0.25rem;
  1069. margin-top: 0.15rem;
  1070. font-size: 0.24rem;
  1071. }
  1072. .weishouli {
  1073. color: #991f00;
  1074. border: 0.01rem #991f00 solid;
  1075. background-color: #f4e8e5;
  1076. }
  1077. .bushouli {
  1078. color: #666666;
  1079. background-color: #eeeeee;
  1080. border: 0.01rem #666666 solid;
  1081. }
  1082. .chulizhong {
  1083. color: #003057;
  1084. background-color: #e5eaee;
  1085. border: 0.01rem #003057 solid;
  1086. }
  1087. .daipingjia {
  1088. color: #825b00;
  1089. background-color: #f2eee5;
  1090. border: 0.01rem #825b00 solid;
  1091. }
  1092. .yijiejue {
  1093. color: #40a19c;
  1094. background-color: #ebf5f5;
  1095. border: 0.01rem #40a19c solid;
  1096. }
  1097. .yichehui {
  1098. color: #48a843;
  1099. background-color: #ecf6ec;
  1100. border: 0.01rem #48a843 solid;
  1101. }
  1102. // .conent {
  1103. // font-size: 0.28rem;
  1104. // line-height: 0.39rem;
  1105. // overflow: hidden;
  1106. // display: -webkit-box;
  1107. // -webkit-line-clamp: 2;
  1108. // -webkit-box-orient: vertical;
  1109. // word-break: break-all;
  1110. // padding: 0 0.64rem;
  1111. // margin: 0.24rem 0;
  1112. // }
  1113. .timeBox {
  1114. display: flex;
  1115. justify-content: space-between;
  1116. font-size: 0.24rem;
  1117. color: #999999;
  1118. border-top: 0.01rem rgb(223, 222, 222) solid;
  1119. height: 0.7rem;
  1120. line-height: 0.7rem;
  1121. padding: 0 0.24rem 0 0.64rem;
  1122. }
  1123. .wushuju {
  1124. margin-top: 2.4rem;
  1125. text-align: center;
  1126. color: #999;
  1127. }
  1128. .wushuju img {
  1129. width: 5.12rem;
  1130. height: 2.84rem;
  1131. }
  1132. .conentBox {
  1133. width: 100%;
  1134. height: 100%;
  1135. .conent {
  1136. font-size: 0.32rem;
  1137. font-weight: 400;
  1138. line-height: 0.45rem;
  1139. border-bottom: 0.16rem solid #e5e5e5;
  1140. .head {
  1141. border-bottom: 0.01rem solid #e6e6e6;
  1142. p {
  1143. padding: 0.24rem 0.48rem;
  1144. i {
  1145. color: #00559d;
  1146. }
  1147. .btn {
  1148. float: right;
  1149. }
  1150. }
  1151. }
  1152. .center {
  1153. color: #333333;
  1154. border-bottom: 0.01rem solid #e6e6e6;
  1155. padding: 0.24rem 0.48rem;
  1156. p {
  1157. &.desc {
  1158. overflow: hidden;
  1159. max-height: 0.88rem;
  1160. }
  1161. .grayFont {
  1162. overflow-x: scroll;
  1163. color: #666;
  1164. }
  1165. }
  1166. }
  1167. .bottom {
  1168. display: flex;
  1169. justify-content: space-between;
  1170. align-items: center;
  1171. overflow: hidden;
  1172. height: 0.86rem;
  1173. border-bottom: 0.01rem solid #e6e6e6;
  1174. font-size: 0.24rem;
  1175. color: #999;
  1176. padding: 0 0.24rem 0 0.48rem;
  1177. }
  1178. }
  1179. }
  1180. </style>