123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863 |
- <template>
- <div class="bgColor">
- <div slot="content" class="scroll-wrapper">
- <div class="demo">
- <div class="header">事件列表</div>
- <cube-select
- class="stateSearch"
- v-model="searchType"
- :options="searchsType"
- @change="stateChange()"
- ></cube-select>
- <div class="scroll-list-wrap">
- <cube-scroll
- ref="scroll"
- :data="items"
- :options="options"
- @pulling-down="onPullingDown"
- @pulling-up="onPullingUp"
- >
- <div class="conentBox" v-if="!loadShow && items.length">
- <div
- class="conent"
- v-for="item in items"
- :key="item.id"
- @click="toIncidentDetails(item)"
- >
- <div class="head">
- <p>
- <i class="iconfont icon-zuixinbaoxiu newPapir"></i>
- 事件编号:{{ item.incidentsign }}
- <span
- :class="{
- btn: true,
- daipingjia: item.state.name == '待评价',
- daijiedan:
- item.state.name == '待接单' &&
- item.handlerUser &&
- !item.candidateGroups,
- daiqiangdan:
- item.state.name == '待接单' &&
- !item.handlerUser &&
- item.candidateGroups,
- chulizhong: item.state.name == '处理中',
- yijiejue: item.state.name == '已解决',
- yiguanbi: item.state.name == '已关闭',
- chongxinzhipai: item.state.name == '重新指派'
- }"
- >{{
- item.state.name == "待接单"
- ? item.handlerUser && !item.candidateGroups
- ? "待接单"
- : "待抢单"
- : item.state.name
- }}</span
- >
- </p>
- </div>
- <div class="center">
- <p class="desc">
- <span class="fl">事件描述:</span>
- <span
- class="grayFont overflowEllipsis2"
- v-html="item.description"
- ></span>
- </p>
- <p>
- 报修<span>{{ valConfig == 1 ? "人" : "科室" }}</span> :
- <span class="grayFont">{{ item.contacts }}</span>
- <span @click.stop v-if="item.contactsInformation"
- ><a :href="'tel:' + item.contactsInformation"
- >(<i class="iconfont icon-shouji"></i
- >{{ item.contactsInformation }})</a
- ></span
- >
- </p>
- </div>
- <div class="bottom">
- <span v-if="!item.place"></span>
- <span
- v-if="item.place"
- style="width:70%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"
- >{{ item.branch?item.branch.hosName:'' }} {{ item.place.area.area }} {{ item.place.place }}
- {{ item.houseNumber }}</span
- >
- <span>{{ item.acceptDate | timeFormat("MM-dd HH:mm") }}</span>
- </div>
- <div class="btns">
- <cube-form-group
- class="sub-btn"
- v-show="
- (item.state.id === 1544 || item.state.id === 1543) &&
- isAssign &&
- item.assignee
- "
- >
- <cube-button @click.stop="assign(item)">指派</cube-button>
- </cube-form-group>
- <cube-form-group
- class="sub-btn"
- v-show="item.state.id === 1544"
- >
- <cube-button @click.stop="addHandlerLog(item)"
- >新增沟通记录</cube-button
- >
- </cube-form-group>
- </div>
- </div>
- </div>
- <template slot="pulldown" slot-scope="props">
- <div
- v-if="props.pullDownRefreshObj"
- class="cube-pulldown-wrapper"
- :style="props.pullDownStyle"
- >
- <div
- v-show="props.beforePullDown"
- class="before-trigger"
- :style="{ paddingTop: props.bubbleY + 'px' }"
- >
- <span
- :class="{
- rotate: props.bubbleY > pullDownRefreshThreshold - 80
- }"
- >↓</span
- >
- </div>
- <div class="after-trigger" v-show="!props.beforePullDown">
- <div v-show="props.isPullingDown" class="loading">
- <cube-loading></cube-loading>
- </div>
- <div v-show="!props.isPullingDown" class="text">
- <span class="refresh-text">更新成功</span>
- </div>
- </div>
- </div>
- </template>
- <div class="wushuju" v-if="!loadShow && items.length === 0">
- <img src="./../../static/images/wushuju.svg" alt />
- <p>暂无事件</p>
- </div>
- </cube-scroll>
- </div>
- </div>
- </div>
- <load-ing v-show="loadShow"></load-ing>
- <!-- 指派弹窗 -->
- <showModel
- :title="models.title"
- :icon="models.icon"
- :disjunctor="models.disjunctor"
- @ok="ok"
- @cancel="cancel"
- :operate="models.operate"
- selectName="user"
- ></showModel>
- <!-- 新增沟通记录弹窗 -->
- <showModel
- :title="models1.title"
- :icon="models1.icon"
- :disjunctor="models1.disjunctor"
- @ok="ok1"
- @cancel="cancel1"
- :operate="models1.operate"
- textName="textarea"
- ></showModel>
- </div>
- </template>
- <script>
- import Vue from "vue";
- import showModel from "../components/showModel/showModel.vue";
- import CubePage from "../components/cube-page.vue";
- import SwitchOption from "../components/switch-option";
- import InputOption from "../components/input-option";
- import SelectOption from "../components/select-option";
- import { formatDate } from "./../components/js/date.js";
- import LoadIng from "./../views/loading.vue";
- export default {
- data() {
- return {
- modelsData: null, //点击弹窗的那一项数据
- modelsData1: null, //点击弹窗的那一项数据
- // 弹窗model
- models: {
- disjunctor: false
- },
- models1: {
- disjunctor: false
- },
- isAssign: false, //是否有权限指派
- loginUser: JSON.parse(localStorage.getItem("loginUser")),
- valConfig: JSON.parse(localStorage.getItem("valConfig")) - 0, //报修主体
- items: [],
- pullDownRefresh: true,
- pullDownRefreshThreshold: 60,
- pullDownRefreshStop: 40,
- pullDownRefreshTxt: "更新成功",
- pullUpLoad: true,
- pullUpLoadThreshold: 0,
- pullUpLoadMoreTxt: "加载更多",
- pullUpLoadNoMoreTxt: "没有更多数据",
- customPullDown: true,
- candidateGroups: "",
- searchsType: [
- {
- text: "全部",
- value: "userAll"
- },
- {
- text: "待处理",
- value: "todo"
- },
- {
- text: "处理过",
- value: "done"
- }
- // {
- // text: "我创建",
- // value: "create"
- // }
- ],
- searchType: "userAll",
- type: "all",
- sum: 10,
- idx: 0,
- stateClass: "",
- loadShow: true
- };
- },
- components: {
- CubePage,
- SwitchOption,
- InputOption,
- SelectOption,
- LoadIng,
- showModel
- },
- computed: {
- options() {
- return {
- pullDownRefresh: this.pullDownRefreshObj,
- pullUpLoad: this.pullUpLoadObj,
- scrollbar: true
- };
- },
- pullDownRefreshObj: function() {
- return this.pullDownRefresh
- ? {
- threshold: parseInt(this.pullDownRefreshThreshold),
- txt: this.pullDownRefreshTxt
- }
- : false;
- },
- pullUpLoadObj: function() {
- return this.pullUpLoad
- ? {
- threshold: parseInt(this.pullUpLoadThreshold),
- txt: {
- more: this.pullUpLoadMoreTxt,
- noMore: this.pullUpLoadNoMoreTxt
- }
- }
- : false;
- }
- },
- methods: {
- //确定
- ok(selectUserId) {
- console.log(selectUserId);
- if (!selectUserId) {
- this.$createDialog({
- type: "alert",
- title: "请选择指派对象",
- icon: "cubeic-warn"
- }).show();
- return;
- }
- const toast = this.$createToast({
- txt: "Loading...",
- mask: true
- });
- toast.show();
- this.$http
- .post("service/bpm/bpm/delegateTask/" + this.modelsData.taskId, {
- assginee: selectUserId
- })
- .then(res => {
- toast.hide();
- this.models.disjunctor = false;
- if (res.status == 200) {
- this.$createDialog({
- type: "alert",
- title: "操作成功",
- icon: "cubeic-right",
- onConfirm: (e, promptValue) => {
- this.loadShow = true;
- this.items = [];
- this.idx = 0;
- this.getData();
- }
- }).show();
- } else {
- this.$createDialog({
- type: "alert",
- title: "系统错误,请稍后再试!",
- icon: "cubeic-wrong",
- onConfirm: (e, promptValue) => {
- this.loadShow = true;
- this.items = [];
- this.idx = 0;
- this.getData();
- }
- }).show();
- }
- });
- },
- //取消
- cancel() {
- this.models.disjunctor = false;
- },
- // 指派
- assign(item) {
- this.modelsData = item;
- this.models = {
- disjunctor: true,
- title: "指派对象",
- icon: "warn",
- operate: {
- ok: "确定",
- cancel: "取消"
- }
- };
- },
- //确定
- ok1(text) {
- console.log(text);
- if (!text.trim()) {
- this.$createDialog({
- type: "alert",
- title: "请填写沟通结果",
- icon: "cubeic-warn"
- }).show();
- return;
- }
- const toast = this.$createToast({
- txt: "Loading...",
- mask: true
- });
- toast.show();
- this.$http
- .post("service/bpm/data/addData/operationLog", {
- operationLog: {
- opType: "handlerLog",
- opValue: text,
- extra1: this.modelsData1.id
- }
- })
- .then(res => {
- toast.hide();
- this.models1.disjunctor = false;
- if (res.status == 200) {
- this.$createDialog({
- type: "alert",
- title: "操作成功",
- icon: "cubeic-right",
- onConfirm: (e, promptValue) => {
- this.loadShow = true;
- this.items = [];
- this.idx = 0;
- this.getData();
- }
- }).show();
- } else {
- this.$createDialog({
- type: "alert",
- title: "系统错误,请稍后再试!",
- icon: "cubeic-wrong",
- onConfirm: (e, promptValue) => {
- this.loadShow = true;
- this.items = [];
- this.idx = 0;
- this.getData();
- }
- }).show();
- }
- });
- },
- //取消
- cancel1() {
- this.models1.disjunctor = false;
- },
- // 新增沟通记录
- addHandlerLog(item) {
- this.modelsData1 = item;
- this.models1 = {
- disjunctor: true,
- title: "新增沟通记录",
- icon: "warn",
- operate: {
- ok: "确定",
- cancel: "取消"
- }
- };
- },
- getParamsState() {
- if (this.$route.params.type) {
- this.type = this.$route.params.type;
- if (this.type === "todo") {
- this.searchType = "todo";
- } else if (this.type === "done") {
- this.searchType = "done";
- } else {
- this.searchType = "userAll";
- }
- }
- },
- stateChange() {
- var that = this;
- this.loadShow = true;
- that.items = [];
- that.idx = 0;
- that.sum = 10;
- that.getData();
- },
- toIncidentDetails(data) {
- console.log(1111111);
- console.log(data);
- var name = "";
- if (data.state.value == "pending") {
- if (data.handlerUser && !data.candidateGroups) {
- // 指派给人 接单
- name = "Order";
- } else if (data.candidateGroups && !data.handlerUser) {
- // 指派给组 抢单
- name = "GrabSheet";
- }
- } else if (data.state.value == "reassign") {
- name = "AgainAssign";
- } else if (data.state.value == "handler") {
- name = "Processing";
- } else if (data.state.value == "resolved") {
- name = "Solved";
- } else if (data.state.value == "close") {
- name = "Closed";
- }
- this.$router.push({
- name: name,
- params: {
- data: data
- }
- });
- },
- getData() {
- var that = this;
- let postData = {
- assignee: that.loginUser.id,
- candidateGroups: that.candidateGroups,
- searchType: that.searchType,
- idx: that.idx,
- sum: that.sum,
- incident: { temporary: true }
- };
- if (this.type === "today") {
- postData.incident.acceptDate =
- formatDate(new Date(), "yyyy-MM-dd") + " 00:00:00";
- postData.incident.acceptDateEnd =
- formatDate(new Date(), "yyyy-MM-dd") + " 23:59:59";
- }
- that.$http
- .post("service/bpm/bpm/fetchTask/bpm_incident", postData)
- .then(function(res) {
- if (res.data.data.length > 0) {
- for (var i = 0; i < res.data.data.length; i++) {
- res.data.data[i].createTime = formatDate(
- new Date(res.data.data[i].createTime),
- "yyyy-MM-dd hh:mm"
- );
- }
- if (that.idx) {
- that.items = that.items.concat(res.data.data);
- } else {
- that.items = res.data.data;
- }
- } else {
- that.pullUpLoad = false;
- }
- that.loadShow = false;
- });
- },
- onPullingDown() {
- var that = this;
- that.idx = 0;
- that.sum = 10;
- setTimeout(() => {
- that.getData();
- }, 1000);
- },
- onPullingUp() {
- var that = this;
- that.idx = that.idx + 1;
- that.getData();
- },
- updatePullDownRefresh(val) {
- this.pullDownRefresh = val;
- },
- updatePullDownRefreshThreshold(val) {
- this.pullDownRefreshThreshold = val;
- },
- updatePullDownRefreshTxt(val) {
- this.pullDownRefreshTxt = val;
- },
- updatePullUpLoad(val) {
- this.pullUpLoad = val;
- },
- updatePullUpLoadThreshold(val) {
- this.pullUpLoadThreshold = val;
- },
- updatePullUpLoadMoreTxt(val) {
- this.pullUpLoadMoreTxt = val;
- },
- updatePullUpLoadNoMoreTxt(val) {
- this.pullUpLoadNoMoreTxt = val;
- },
- updateCustomPullDown(val) {
- this.customPullDown = val;
- },
- rebuildScroll() {
- Vue.nextTick(() => {
- this.$refs.scroll.destroy();
- this.$refs.scroll.initScroll();
- });
- }
- },
- created() {
- var that = this;
- let menu = JSON.parse(localStorage.getItem("menu"));
- if (menu) {
- this.isAssign = menu.some(v => v.link == "shijianliebiao_assign");
- }
- that.loginUser.group.forEach(element => {
- that.candidateGroups += element.id + ",";
- });
- that.candidateGroups = that.candidateGroups.substring(
- 0,
- that.candidateGroups.length - 1
- );
- this.getParamsState();
- this.loadShow = true;
- this.getData();
- localStorage.removeItem("modelData");
- // localStorage.removeItem("category");
- // localStorage.removeItem("categoryVal");
- localStorage.removeItem("referenceInfo");
- localStorage.removeItem("order");
- localStorage.removeItem("model");
- // localStorage.removeItem("selectedCategoryTxt");
- }
- };
- </script>
- <style lang="stylus" rel="stylesheet/stylus" scoped>
- .btns{
- display: flex;
- justify-content: space-between
- .sub-btn {
- margin:0 2px;
- flex:1;
- background: #ececec;
- .cube-btn {
- background-color: #005395 !important;
- border-radius: 8px
- }
- }
- }
- .scroll-list-wrap {
- height: calc(100vh - 2.72rem);
- border-radius: 5px;
- transform: rotate(0deg); // fix 子元素超出边框圆角部分不隐藏的问题
- overflow: hidden;
- padding-top: 1.76rem;
- }
- .foods-wrapper {
- .food-item {
- display: flex;
- /* padding: 18px */
- /* border-bottom: 1px solid rgba(7, 17, 27, 0.1) */
- /* border-top: 1px solid rgba(7, 17, 27, 0.1)!important */
- &:last-child {
- border-none();
- margin-bottom: 0;
- }
- .icon {
- flex: 0 0 57px;
- margin-right: 10px;
- }
- .food-content {
- flex: 1;
- .name {
- margin: 2px 0 8px 0;
- height: 14px;
- line-height: 14px;
- font-size: 14px;
- color: rgb(7, 17, 27);
- }
- .description, .extra {
- line-height: 10px;
- font-size: 10px;
- color: rgb(147, 153, 159);
- }
- .description {
- line-height: 12px;
- margin-bottom: 8px;
- }
- .extra {
- .count {
- margin-right: 12px;
- }
- }
- .price {
- font-weight: 700;
- line-height: 24px;
- .now {
- margin-right: 8px;
- font-size: 14px;
- color: rgb(240, 20, 20);
- }
- .old {
- text-decoration: line-through;
- font-size: 10px;
- color: rgb(147, 153, 159);
- }
- }
- .cartcontrol-wrapper {
- position: absolute;
- right: 0;
- bottom: 12px;
- .scroll-wrapper {
- .cube-pulldown-wrapper {
- .before-trigger {
- font-size: 30px;
- line-height: 30px;
- align-self: flex-end;
- span {
- display: inline-block;
- transition: all 0.3s;
- color: #666;
- &.rotate {
- transform: rotate(180deg);
- }
- }
- }
- .after-trigger {
- .refresh-text {
- color: grey;
- }
- }
- }
- }
- }
- }
- }
- }
- </style>
- <style lang="less" scoped>
- .cont {
- margin-top: 1.86rem;
- }
- .scroll-list-wrap {
- padding-top: 1.76rem;
- }
- .header {
- width: 100%;
- height: 0.88rem;
- line-height: 0.88rem;
- text-align: center;
- color: #fff;
- font-size: 0.37rem;
- background: linear-gradient(#2e2f32, #414246);
- position: fixed;
- top: 0;
- z-index: 6;
- }
- .stateSearch {
- width: 100%;
- position: fixed;
- top: 0.88rem;
- z-index: 6;
- }
- .bgColor {
- background-color: white;
- }
- .food-item {
- border-top: 0.16rem rgb(238, 238, 238) solid;
- }
- .food-content {
- border-top: 0.01rem rgb(223, 222, 222) solid;
- border-bottom: 0.01rem rgb(223, 222, 222) solid;
- }
- .cube-select {
- height: 0.88rem;
- line-height: 0.88rem;
- padding: 0 0.24rem;
- font-size: 0.36rem;
- color: #333333;
- border-bottom: 0.08rem solid #e5e5e5;
- }
- .title {
- display: flex;
- justify-content: space-between;
- height: 0.7rem;
- line-height: 0.7rem;
- border-top: 0.01rem rgb(223, 222, 222) solid;
- padding: 0 0.24rem;
- border-bottom: 0.01rem rgb(223, 222, 222) solid;
- }
- .title i {
- font-size: 0.32rem;
- color: #005395;
- }
- .title div:nth-child(1) {
- font-size: 0.32rem;
- }
- .title div:nth-child(1) span {
- display: inline-block;
- margin-left: 0.08rem;
- }
- .title div:nth-child(2) {
- padding: 0.05rem 0.3rem;
- /* border: 0.01rem rgb(0,0,255) solid; */
- border-radius: 16px;
- /* color: rgb(0,0,255); */
- height: 0.25rem;
- line-height: 0.25rem;
- margin-top: 0.15rem;
- font-size: 0.24rem;
- }
- .weishouli {
- color: #991f00;
- border: 0.01rem #991f00 solid;
- background-color: #f4e8e5;
- }
- .bushouli {
- color: #666666;
- background-color: #eeeeee;
- border: 0.01rem #666666 solid;
- }
- .chulizhong {
- color: #003057;
- background-color: #e5eaee;
- border: 0.01rem #003057 solid;
- }
- .daipingjia {
- color: #825b00;
- background-color: #f2eee5;
- border: 0.01rem #825b00 solid;
- }
- .yijiejue {
- color: #40a19c;
- background-color: #ebf5f5;
- border: 0.01rem #40a19c solid;
- }
- .yichehui {
- color: #48a843;
- background-color: #ecf6ec;
- border: 0.01rem #48a843 solid;
- }
- // .conent {
- // font-size: 0.28rem;
- // line-height: 0.39rem;
- // overflow: hidden;
- // display: -webkit-box;
- // -webkit-line-clamp: 2;
- // -webkit-box-orient: vertical;
- // word-break: break-all;
- // padding: 0 0.64rem;
- // margin: 0.24rem 0;
- // }
- .timeBox {
- display: flex;
- justify-content: space-between;
- font-size: 0.24rem;
- color: #999999;
- border-top: 0.01rem rgb(223, 222, 222) solid;
- height: 0.7rem;
- line-height: 0.7rem;
- padding: 0 0.24rem 0 0.64rem;
- }
- .wushuju {
- margin-top: 2.4rem;
- text-align: center;
- color: #999;
- }
- .wushuju img {
- width: 5.12rem;
- height: 2.84rem;
- }
- .conentBox {
- width: 100%;
- height: 100%;
- .conent {
- font-size: 0.32rem;
- font-weight: 400;
- line-height: 0.45rem;
- border-bottom: 0.16rem solid #e5e5e5;
- .head {
- border-bottom: 0.01rem solid #e6e6e6;
- p {
- padding: 0.24rem 0.48rem;
- i {
- color: #00559d;
- }
- .btn {
- float: right;
- }
- }
- }
- .center {
- color: #333333;
- border-bottom: 0.01rem solid #e6e6e6;
- padding: 0.24rem 0.48rem;
- p {
- &.desc {
- overflow: hidden;
- max-height: 0.88rem;
- }
- .grayFont {
- overflow-x: scroll;
- color: #666;
- }
- }
- }
- .bottom {
- display: flex;
- justify-content: space-between;
- align-items: center;
- overflow: hidden;
- height: 0.86rem;
- border-bottom: 0.01rem solid #e6e6e6;
- font-size: 0.24rem;
- color: #999;
- padding: 0 0.24rem 0 0.48rem;
- }
- }
- }
- </style>
|