Commit 75a031ef by chenxianqi

update code

parent 5e3f6d21
......@@ -201,9 +201,21 @@ func (c *WorkOrderController) GetWorkOrders() {
res, err := c.WorkOrderRepository.GetWorkOrders(request)
if err != nil {
c.JSON(configs.ResponseFail, "查询失败!", &res)
c.JSON(configs.ResponseFail, "查询失败!", err.Error())
}
c.JSON(configs.ResponseSucess, "查询成功", &res)
}
// GetWorkOrderCounts get workorders counts
func (c *WorkOrderController) GetWorkOrderCounts() {
counts, err := c.WorkOrderRepository.GetCounts()
if err != nil {
c.JSON(configs.ResponseFail, "查询失败!", err.Error())
}
c.JSON(configs.ResponseSucess, "查询成功", &counts)
}
package models
// WorkOrderCountDto model
type WorkOrderCountDto struct {
Status0 int64 `json:"status0"`
Status2 int64 `json:"status2"`
Status3 int64 `json:"status3"`
DeleteCount int64 `json:"delete_count"`
}
......@@ -6,6 +6,7 @@ type WorkOrderPaginationDto struct {
PageOn int `json:"page_on"`
Total int64 `json:"total"`
Tid int64 `json:"tid"`
Status int `json:"status"`
Del int `json:"del"`
Status string `json:"status"`
List interface{} `json:"list"`
}
.container[data-v-1f126a3f]{height:100vh;overflow:hidden;overflow-y:auto}.content[data-v-1f126a3f]{padding-top:50px;padding-bottom:90px}.content .no-data[data-v-1f126a3f]{color:#666;font-size:14px}.content .workorder-close[data-v-1f126a3f]{text-align:center;color:#666;font-size:14px;padding:10px}.content.hide-header[data-v-1f126a3f]{padding-top:0}.content .head[data-v-1f126a3f]{margin:0 10px;padding:10px 0;border-bottom:1px solid hsla(0,0%,62%,.13)}.content .head .con[data-v-1f126a3f]{font-size:15px;color:#333;display:-ms-flexbox;display:flex;margin-bottom:8px}.content .head .con span[data-v-1f126a3f]{-ms-flex-flow:1;flex-flow:1}.content .head .con span[data-v-1f126a3f]:first-child{-ms-flex-flow:0;flex-flow:0;-ms-flex-negative:0;flex-shrink:0;width:45px}.content .head .con i[data-v-1f126a3f]{font-style:normal}.content .comments[data-v-1f126a3f]{padding:10px}.content .comments .item[data-v-1f126a3f]{display:-ms-flexbox;display:flex}.content .comments .item .avatar[data-v-1f126a3f]{padding-top:10px;border-bottom:1px solid hsla(0,0%,62%,.13)}.content .comments .item .avatar img[data-v-1f126a3f]{width:30px;height:30px;border-radius:100px;display:block}.content .comments .item .right[data-v-1f126a3f]{padding:10px 5px;-ms-flex-positive:1;flex-grow:1;border-bottom:1px solid hsla(0,0%,62%,.13)}.content .comments .item .right .nickname[data-v-1f126a3f]{font-size:15px;color:#333}.content .comments .item .right .detail[data-v-1f126a3f]{font-size:15px;color:#333;margin-top:5px}.content .comments .item .right .date[data-v-1f126a3f]{color:#999;font-size:14px;margin-top:5px}.content .comments .item:last-child .avatar[data-v-1f126a3f],.content .comments .item:last-child .right[data-v-1f126a3f]{border-bottom:0}.content .file-view[data-v-1f126a3f]{position:fixed;bottom:80px;left:0;right:0;padding:5px 10px;margin:0 auto;font-size:13px;color:#8bc34a}.content .file-view span[data-v-1f126a3f]{display:-ms-flexbox;display:flex;-ms-flex-line-pack:center;align-content:center;-ms-flex-align:center;align-items:center}.content .file-view span img[data-v-1f126a3f]{width:20px;height:20px}.content .file-view span i[data-v-1f126a3f]{font-style:normal;margin-left:5px}.content .input-form[data-v-1f126a3f]{position:fixed;bottom:0;left:0;right:0;margin:0 auto;width:100%;height:80px;background-color:#fff;border-top:1px solid hsla(0,0%,62%,.13);display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;padding:0 10px;box-sizing:border-box;-ms-flex-line-pack:center;align-content:center;-ms-flex-align:center;align-items:center}.content .input-form textarea[data-v-1f126a3f]{height:45px;-ms-flex-positive:1;flex-grow:1;border-radius:0;border:0;color:#333;font-size:14px;resize:none}.content .input-form .icon-btn[data-v-1f126a3f]{background:url(../img/upload.76668586.png) 50% no-repeat;background-size:30px;width:55px;height:55px;overflow:hidden}.content .input-form .icon-btn input[data-v-1f126a3f]{display:block;width:100%;height:100%;font-size:100px;opacity:0}.content .input-form .sub-btn[data-v-1f126a3f]{display:block;width:55px;height:30px;color:#fff;line-height:30px;text-align:center;border-radius:3px;border:none;font-size:14px;background:linear-gradient(90deg,#26a2ff,#736cde);-ms-flex-negative:0;flex-shrink:0}.content .input-form .sub-btn[data-v-1f126a3f]:active{opacity:.8}
\ No newline at end of file
.container[data-v-ac0a42f8]{height:100vh;overflow:hidden;overflow-y:auto}.content[data-v-ac0a42f8]{padding-top:50px;padding-bottom:90px}.content .no-data[data-v-ac0a42f8]{color:#666;font-size:14px}.content .workorder-close[data-v-ac0a42f8]{text-align:center;color:#666;font-size:14px;padding:10px}.content.hide-header[data-v-ac0a42f8]{padding-top:0}.content .head[data-v-ac0a42f8]{margin:0 10px;padding:10px 0;border-bottom:1px solid hsla(0,0%,62%,.13)}.content .head .con[data-v-ac0a42f8]{font-size:15px;color:#333;display:-ms-flexbox;display:flex;margin-bottom:8px}.content .head .con span[data-v-ac0a42f8]{-ms-flex-flow:1;flex-flow:1}.content .head .con span[data-v-ac0a42f8]:first-child{-ms-flex-flow:0;flex-flow:0;-ms-flex-negative:0;flex-shrink:0;width:45px}.content .head .con i[data-v-ac0a42f8]{font-style:normal}.content .comments[data-v-ac0a42f8]{padding:10px}.content .comments .item[data-v-ac0a42f8]{display:-ms-flexbox;display:flex}.content .comments .item .avatar[data-v-ac0a42f8]{padding-top:10px;border-bottom:1px solid hsla(0,0%,62%,.13)}.content .comments .item .avatar img[data-v-ac0a42f8]{width:30px;height:30px;border-radius:100px;display:block}.content .comments .item .right[data-v-ac0a42f8]{padding:10px 5px;-ms-flex-positive:1;flex-grow:1;border-bottom:1px solid hsla(0,0%,62%,.13)}.content .comments .item .right .nickname[data-v-ac0a42f8]{font-size:15px;color:#333}.content .comments .item .right .detail[data-v-ac0a42f8]{font-size:15px;color:#333;margin-top:5px}.content .comments .item .right .date[data-v-ac0a42f8]{color:#999;font-size:14px;margin-top:5px}.content .comments .item:last-child .avatar[data-v-ac0a42f8],.content .comments .item:last-child .right[data-v-ac0a42f8]{border-bottom:0}.content .file-view[data-v-ac0a42f8]{position:fixed;bottom:80px;left:0;right:0;padding:5px 10px;margin:0 auto;font-size:13px;color:#8bc34a}.content .file-view span[data-v-ac0a42f8]{display:-ms-flexbox;display:flex;-ms-flex-line-pack:center;align-content:center;-ms-flex-align:center;align-items:center}.content .file-view span img[data-v-ac0a42f8]{width:20px;height:20px}.content .file-view span i[data-v-ac0a42f8]{font-style:normal;margin-left:5px}.content .input-form[data-v-ac0a42f8]{position:fixed;bottom:0;left:0;right:0;margin:0 auto;width:100%;height:80px;background-color:#fff;border-top:1px solid hsla(0,0%,62%,.13);display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;padding:0 10px;box-sizing:border-box;-ms-flex-line-pack:center;align-content:center;-ms-flex-align:center;align-items:center}.content .input-form textarea[data-v-ac0a42f8]{height:45px;-ms-flex-positive:1;flex-grow:1;border-radius:0;border:0;color:#333;font-size:14px;resize:none}.content .input-form .icon-btn[data-v-ac0a42f8]{background:url(../img/upload.76668586.png) 50% no-repeat;background-size:30px;width:55px;height:55px;overflow:hidden}.content .input-form .icon-btn input[data-v-ac0a42f8]{display:block;width:100%;height:100%;font-size:100px;opacity:0}.content .input-form .sub-btn[data-v-ac0a42f8]{display:block;width:55px;height:30px;color:#fff;line-height:30px;text-align:center;border-radius:3px;border:none;font-size:14px;background:linear-gradient(90deg,#26a2ff,#736cde);-ms-flex-negative:0;flex-shrink:0}.content .input-form .sub-btn[data-v-ac0a42f8]:active{opacity:.8}
\ No newline at end of file
......@@ -43,4 +43,4 @@
top:0 !important;
min-height: inherit!important;
left:0 !important; right:0 !important; bottom:0 !important; margin: auto !important;
}</style><link href=css/chunk-233fded2.68e29c95.css rel=prefetch><link href=css/chunk-2c568771.92feb802.css rel=prefetch><link href=css/chunk-5e6009ff.86cb9867.css rel=prefetch><link href=css/chunk-612d9b40.3daa63d4.css rel=prefetch><link href=js/chunk-233fded2.64fa5b81.js rel=prefetch><link href=js/chunk-2c568771.a81203d3.js rel=prefetch><link href=js/chunk-5e6009ff.d7088d94.js rel=prefetch><link href=js/chunk-612d9b40.13a3a9bb.js rel=prefetch><link href=css/app.19de1655.css rel=preload as=style><link href=css/chunk-vendors.5cea36ab.css rel=preload as=style><link href=js/app.cd5008bc.js rel=preload as=script><link href=js/chunk-vendors.a823ad66.js rel=preload as=script><link href=css/chunk-vendors.5cea36ab.css rel=stylesheet><link href=css/app.19de1655.css rel=stylesheet></head><body><noscript><strong>We're sorry but m doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=js/chunk-vendors.a823ad66.js></script><script src=js/app.cd5008bc.js></script></body></html>
\ No newline at end of file
}</style><link href=css/chunk-2c568771.92feb802.css rel=prefetch><link href=css/chunk-5e6009ff.86cb9867.css rel=prefetch><link href=css/chunk-612d9b40.3daa63d4.css rel=prefetch><link href=css/chunk-9ec58ea8.5743221d.css rel=prefetch><link href=js/chunk-2c568771.a81203d3.js rel=prefetch><link href=js/chunk-5e6009ff.d7088d94.js rel=prefetch><link href=js/chunk-612d9b40.13a3a9bb.js rel=prefetch><link href=js/chunk-9ec58ea8.59b56ff9.js rel=prefetch><link href=css/app.19de1655.css rel=preload as=style><link href=css/chunk-vendors.5cea36ab.css rel=preload as=style><link href=js/app.a65684bc.js rel=preload as=script><link href=js/chunk-vendors.a823ad66.js rel=preload as=script><link href=css/chunk-vendors.5cea36ab.css rel=stylesheet><link href=css/app.19de1655.css rel=stylesheet></head><body><noscript><strong>We're sorry but m doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=js/chunk-vendors.a823ad66.js></script><script src=js/app.a65684bc.js></script></body></html>
\ No newline at end of file
(function(e){function t(t){for(var a,r,c=t[0],i=t[1],u=t[2],l=0,d=[];l<c.length;l++)r=c[l],Object.prototype.hasOwnProperty.call(o,r)&&o[r]&&d.push(o[r][0]),o[r]=0;for(a in i)Object.prototype.hasOwnProperty.call(i,a)&&(e[a]=i[a]);f&&f(t);while(d.length)d.shift()();return s.push.apply(s,u||[]),n()}function n(){for(var e,t=0;t<s.length;t++){for(var n=s[t],a=!0,r=1;r<n.length;r++){var c=n[r];0!==o[c]&&(a=!1)}a&&(s.splice(t--,1),e=i(i.s=n[0]))}return e}var a={},r={app:0},o={app:0},s=[];function c(e){return i.p+"js/"+({}[e]||e)+"."+{"chunk-233fded2":"64fa5b81","chunk-2c568771":"a81203d3","chunk-5e6009ff":"d7088d94","chunk-612d9b40":"13a3a9bb"}[e]+".js"}function i(t){if(a[t])return a[t].exports;var n=a[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.e=function(e){var t=[],n={"chunk-233fded2":1,"chunk-2c568771":1,"chunk-5e6009ff":1,"chunk-612d9b40":1};r[e]?t.push(r[e]):0!==r[e]&&n[e]&&t.push(r[e]=new Promise((function(t,n){for(var a="css/"+({}[e]||e)+"."+{"chunk-233fded2":"68e29c95","chunk-2c568771":"92feb802","chunk-5e6009ff":"86cb9867","chunk-612d9b40":"3daa63d4"}[e]+".css",o=i.p+a,s=document.getElementsByTagName("link"),c=0;c<s.length;c++){var u=s[c],l=u.getAttribute("data-href")||u.getAttribute("href");if("stylesheet"===u.rel&&(l===a||l===o))return t()}var d=document.getElementsByTagName("style");for(c=0;c<d.length;c++){u=d[c],l=u.getAttribute("data-href");if(l===a||l===o)return t()}var f=document.createElement("link");f.rel="stylesheet",f.type="text/css",f.onload=t,f.onerror=function(t){var a=t&&t.target&&t.target.src||o,s=new Error("Loading CSS chunk "+e+" failed.\n("+a+")");s.code="CSS_CHUNK_LOAD_FAILED",s.request=a,delete r[e],f.parentNode.removeChild(f),n(s)},f.href=o;var p=document.getElementsByTagName("head")[0];p.appendChild(f)})).then((function(){r[e]=0})));var a=o[e];if(0!==a)if(a)t.push(a[2]);else{var s=new Promise((function(t,n){a=o[e]=[t,n]}));t.push(a[2]=s);var u,l=document.createElement("script");l.charset="utf-8",l.timeout=120,i.nc&&l.setAttribute("nonce",i.nc),l.src=c(e);var d=new Error;u=function(t){l.onerror=l.onload=null,clearTimeout(f);var n=o[e];if(0!==n){if(n){var a=t&&("load"===t.type?"missing":t.type),r=t&&t.target&&t.target.src;d.message="Loading chunk "+e+" failed.\n("+a+": "+r+")",d.name="ChunkLoadError",d.type=a,d.request=r,n[1](d)}o[e]=void 0}};var f=setTimeout((function(){u({type:"timeout",target:l})}),12e4);l.onerror=l.onload=u,document.head.appendChild(l)}return Promise.all(t)},i.m=e,i.c=a,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)i.d(n,a,function(t){return e[t]}.bind(null,a));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i.oe=function(e){throw console.error(e),e};var u=window["webpackJsonp"]=window["webpackJsonp"]||[],l=u.push.bind(u);u.push=t,u=u.slice();for(var d=0;d<u.length;d++)t(u[d]);var f=l;s.push([0,"chunk-vendors"]),n()})({0:function(e,t,n){e.exports=n("56d7")},4678:function(e,t,n){var a={"./af":"2bfb","./af.js":"2bfb","./ar":"8e73","./ar-dz":"a356","./ar-dz.js":"a356","./ar-kw":"423e","./ar-kw.js":"423e","./ar-ly":"1cfd","./ar-ly.js":"1cfd","./ar-ma":"0a84","./ar-ma.js":"0a84","./ar-sa":"8230","./ar-sa.js":"8230","./ar-tn":"6d83","./ar-tn.js":"6d83","./ar.js":"8e73","./az":"485c","./az.js":"485c","./be":"1fc1","./be.js":"1fc1","./bg":"84aa","./bg.js":"84aa","./bm":"a7fa","./bm.js":"a7fa","./bn":"9043","./bn.js":"9043","./bo":"d26a","./bo.js":"d26a","./br":"6887","./br.js":"6887","./bs":"2554","./bs.js":"2554","./ca":"d716","./ca.js":"d716","./cs":"3c0d","./cs.js":"3c0d","./cv":"03ec","./cv.js":"03ec","./cy":"9797","./cy.js":"9797","./da":"0f14","./da.js":"0f14","./de":"b469","./de-at":"b3eb","./de-at.js":"b3eb","./de-ch":"bb71","./de-ch.js":"bb71","./de.js":"b469","./dv":"598a","./dv.js":"598a","./el":"8d47","./el.js":"8d47","./en-SG":"cdab","./en-SG.js":"cdab","./en-au":"0e6b","./en-au.js":"0e6b","./en-ca":"3886","./en-ca.js":"3886","./en-gb":"39a6","./en-gb.js":"39a6","./en-ie":"e1d3","./en-ie.js":"e1d3","./en-il":"7333","./en-il.js":"7333","./en-nz":"6f50","./en-nz.js":"6f50","./eo":"65db","./eo.js":"65db","./es":"898b","./es-do":"0a3c","./es-do.js":"0a3c","./es-us":"55c9","./es-us.js":"55c9","./es.js":"898b","./et":"ec18","./et.js":"ec18","./eu":"0ff2","./eu.js":"0ff2","./fa":"8df4","./fa.js":"8df4","./fi":"81e9","./fi.js":"81e9","./fo":"0721","./fo.js":"0721","./fr":"9f26","./fr-ca":"d9f8","./fr-ca.js":"d9f8","./fr-ch":"0e49","./fr-ch.js":"0e49","./fr.js":"9f26","./fy":"7118","./fy.js":"7118","./ga":"5120","./ga.js":"5120","./gd":"f6b4","./gd.js":"f6b4","./gl":"8840","./gl.js":"8840","./gom-latn":"0caa","./gom-latn.js":"0caa","./gu":"e0c5","./gu.js":"e0c5","./he":"c7aa","./he.js":"c7aa","./hi":"dc4d","./hi.js":"dc4d","./hr":"4ba9","./hr.js":"4ba9","./hu":"5b14","./hu.js":"5b14","./hy-am":"d6b6","./hy-am.js":"d6b6","./id":"5038","./id.js":"5038","./is":"0558","./is.js":"0558","./it":"6e98","./it-ch":"6f12","./it-ch.js":"6f12","./it.js":"6e98","./ja":"079e","./ja.js":"079e","./jv":"b540","./jv.js":"b540","./ka":"201b","./ka.js":"201b","./kk":"6d79","./kk.js":"6d79","./km":"e81d","./km.js":"e81d","./kn":"3e92","./kn.js":"3e92","./ko":"22f8","./ko.js":"22f8","./ku":"2421","./ku.js":"2421","./ky":"9609","./ky.js":"9609","./lb":"440c","./lb.js":"440c","./lo":"b29d","./lo.js":"b29d","./lt":"26f9","./lt.js":"26f9","./lv":"b97c","./lv.js":"b97c","./me":"293c","./me.js":"293c","./mi":"688b","./mi.js":"688b","./mk":"6909","./mk.js":"6909","./ml":"02fb","./ml.js":"02fb","./mn":"958b","./mn.js":"958b","./mr":"39bd","./mr.js":"39bd","./ms":"ebe4","./ms-my":"6403","./ms-my.js":"6403","./ms.js":"ebe4","./mt":"1b45","./mt.js":"1b45","./my":"8689","./my.js":"8689","./nb":"6ce3","./nb.js":"6ce3","./ne":"3a39","./ne.js":"3a39","./nl":"facd","./nl-be":"db29","./nl-be.js":"db29","./nl.js":"facd","./nn":"b84c","./nn.js":"b84c","./pa-in":"f3ff","./pa-in.js":"f3ff","./pl":"8d57","./pl.js":"8d57","./pt":"f260","./pt-br":"d2d4","./pt-br.js":"d2d4","./pt.js":"f260","./ro":"972c","./ro.js":"972c","./ru":"957c","./ru.js":"957c","./sd":"6784","./sd.js":"6784","./se":"ffff","./se.js":"ffff","./si":"eda5","./si.js":"eda5","./sk":"7be6","./sk.js":"7be6","./sl":"8155","./sl.js":"8155","./sq":"c8f3","./sq.js":"c8f3","./sr":"cf1e","./sr-cyrl":"13e9","./sr-cyrl.js":"13e9","./sr.js":"cf1e","./ss":"52bd","./ss.js":"52bd","./sv":"5fbd","./sv.js":"5fbd","./sw":"74dc","./sw.js":"74dc","./ta":"3de5","./ta.js":"3de5","./te":"5cbb","./te.js":"5cbb","./tet":"576c","./tet.js":"576c","./tg":"3b1b","./tg.js":"3b1b","./th":"10e8","./th.js":"10e8","./tl-ph":"0f38","./tl-ph.js":"0f38","./tlh":"cf75","./tlh.js":"cf75","./tr":"0e81","./tr.js":"0e81","./tzl":"cf51","./tzl.js":"cf51","./tzm":"c109","./tzm-latn":"b53d","./tzm-latn.js":"b53d","./tzm.js":"c109","./ug-cn":"6117","./ug-cn.js":"6117","./uk":"ada2","./uk.js":"ada2","./ur":"5294","./ur.js":"5294","./uz":"2e8c","./uz-latn":"010e","./uz-latn.js":"010e","./uz.js":"2e8c","./vi":"2921","./vi.js":"2921","./x-pseudo":"fd7e","./x-pseudo.js":"fd7e","./yo":"7f33","./yo.js":"7f33","./zh-cn":"5c3a","./zh-cn.js":"5c3a","./zh-hk":"49ab","./zh-hk.js":"49ab","./zh-tw":"90ea","./zh-tw.js":"90ea"};function r(e){var t=o(e);return n(t)}function o(e){if(!n.o(a,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return a[e]}r.keys=function(){return Object.keys(a)},r.resolve=o,e.exports=r,r.id="4678"},"56d7":function(e,t,n){"use strict";n.r(t);n("cadf"),n("551c"),n("f751"),n("097d");var a=n("2b0e"),r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[e.isShowPageLoading?n("div",{staticClass:"mini-im-loading",class:{"pc-mini-im-loading":!e.isMobile}},[n("mt-spinner",{attrs:{type:"triple-bounce",color:"#26a2ff"}})],1):e._e(),n("router-view")],1)},o=[],s=(n("8e6e"),n("ac6a"),n("456d"),n("28a5"),n("bd86")),c=n("2f62");function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){Object(s["a"])(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var l={name:"app",data:function(){return{}},computed:u({},Object(c["b"])(["isShowPageLoading","userAccount","isArtificial","isMobile","artificialAccount","robotAccount","platform","userLocal","uid","uid"])),created:function(){var e=this;this.getLocal(),setTimeout((function(){e.handelUrl(),e.runApp()}),500),this.onCheckIsOutSession()},methods:{runApp:function(){var e=this,t=this.$mimcInstance.getLocalCacheUser();t&&null!=this.userAccount&&this.userAccount!=t.id&&0!=this.userAccount&&localStorage.clear(),this.$mimcInstance.init({type:0,address:this.userLocal,uid:this.uid||0,platform:this.platform,account_id:this.userAccount||0},(function(t){if(e.upLastActivity(),e.$store.dispatch("onGetCompanyInfo"),e.$store.dispatch("onGetUploadSecret"),e.$store.dispatch("onGetWorkorderTypes"),e.$store.dispatch("onGetWorkorders"),t){e.$store.commit("updateState",{userAccount:t.id,userInfo:t});var n=e.$mimcInstance.robot;localStorage.setItem("robot_"+n.id,JSON.stringify(n)),e.$store.commit("updateState",{robotAccount:n.id,robotInfo:n}),e.$mimcInstance.login();var a=function t(){null!=e.$mimcInstance.user&&e.$mimcInstance.user.isLogin()?e.artificialAccount||(console.log("握手消息"),e.$mimcInstance.sendMessage("handshake",e.robotAccount,"")):setTimeout((function(){return t()}),200)};a()}else setTimeout((function(){return e.runApp()}),1e3)}))},handelUrl:function(){var e,t,n,a,r,o,s,c,i=this.$route.query;i&&i.c&&localStorage.clear();var u=this.queryToJson(localStorage.getItem("urlQuery"));u&&(i=Object.assign({},u,i)),i&&("0"==i.h&&(e=!1),"0"==i.m&&(t=!1,e=!1),i.u&&(n=parseInt(i.u)),i.p&&(c=parseInt(i.p)),i.uid&&(a=parseInt(i.uid)),"0"==i.r?(r=!0,o=parseInt(i.a)):s=parseInt(i.a));var l=localStorage.getItem("isArtificial"),d=localStorage.getItem("artificialAccount");"true"==l&&(r=!0,o=parseInt(d)),this.$store.commit("updateState",{isShowHeader:e,isMobile:t,userAccount:n,uid:a,isArtificial:r,artificialAccount:o,robotAccount:s,platform:c})},queryToJson:function(e){if(!e||""==e)return null;var t=e.substr(1,e.length).split("&");if(!t)return null;for(var n={},a=0;a<t.length;a++){var r=t[a].split("=");n[r[0]]=r[1]}return n},getLocal:function(){this.$store.dispatch("onGetLocal",this.$store.state.AmapAPPKey)},upLastActivity:function(){var e=this;this.onCheckIsOutSession();var t=this.$mimcInstance.getLocalCacheUser();t&&this.$store.dispatch("onUpdateLastActivity"),this.isArtificial&&localStorage.setItem("artificialTime",Date.now()),setTimeout((function(){return e.upLastActivity()}),6e4)},onCheckIsOutSession:function(){var e=localStorage.getItem("artificialTime");e&&(e=parseInt(e),Date.now()>e+6e5&&this.$store.commit("updateState",{isArtificial:!1,artificialAccount:null}))}}},d=l,f=(n("7faf"),n("2877")),p=Object(f["a"])(d,r,o,!1,null,null,null),m=p.exports,h=n("d1d4"),b=n.n(h),g=n("8c4f");a["default"].use(g["a"]);var j=new g["a"]({base:"",routes:[{path:"/",redirect:"/index"},{path:"/index",name:"index",component:function(){return n.e("chunk-5e6009ff").then(n.bind(null,"e0a0"))}},{path:"/workorder",name:"workorder",component:function(){return n.e("chunk-612d9b40").then(n.bind(null,"fb09"))}},{path:"/workorder/create",name:"workorder_create",component:function(){return n.e("chunk-2c568771").then(n.bind(null,"ede1"))}},{path:"/workorder/detail/:id",name:"workorder_detail",component:function(){return n.e("chunk-233fded2").then(n.bind(null,"4033"))}}]}),k=j,v=n("bc3a"),y=n.n(v),w={onGetMessages:function(e,t){var n=20;y.a.post("/public/messages",{timestamp:t.timestamp,page_size:n}).then((function(a){var r=[],o=a.data.data.list||[];(o.length<n||0==o.length)&&e.commit("updateState",{isLoadMorEnd:!0}),r=0==t.oldMsg.length&&o.length>0?a.data.data.list:o.length>0?o.concat(t.oldMsg):t.oldMsg,e.commit("updateState",{messages:r}),t.callback&&t.callback()})).catch((function(e){console.log(e)}))},onGetLocal:function(e,t){y.a.get("https://restapi.amap.com/v3/ip?key="+t).then((function(t){t.data.province&&e.commit("updateState",{userLocal:t.data.province+t.data.city})})).catch((function(e){console.error(e)}))},onCleanRead:function(){y.a.get("/public/clean_read/")},onUpdateLastActivity:function(){y.a.get("/public/activity/")},onToggleWindow:function(e,t){y.a.put("/public/window/",{window:t})},onGetCompanyInfo:function(e){y.a.get("/public/company").then((function(t){e.commit("updateState",{companyInfo:t.data.data})})).catch((function(e){console.error(e)}))},onGetUploadSecret:function(e){y.a.get("/public/secret").then((function(t){e.commit("updateState",{uploadToken:t.data.data})}))},onGetWorkorderTypes:function(e){y.a.get("/public/workorder/types").then((function(t){e.commit("updateState",{workorderTypes:t.data.data})}))},onGetWorkorders:function(e){y.a.get("/public/workorders").then((function(t){e.commit("updateState",{workorders:t.data.data})}))}},_={updateState:function(e,t){var n=e;for(var a in t)void 0!=t[a]&&(n[a]=t[a]);e=n}},M=(n("4917"),{platform:function(e){return e.platform},isArtificial:function(e){return e.isArtificial},isShowHeader:function(e){return e.isShowHeader},isMobile:function(e){return e.isMobile},uid:function(e){return e.uid},userAccount:function(e){return e.userAccount},artificialAccount:function(e){return e.artificialAccount},robotInfo:function(e){return e.robotInfo},robotAccount:function(e){return e.robotAccount},isLoadMorEnd:function(e){return e.isLoadMorEnd},messages:function(e){return e.messages||[]},userLocal:function(e){return e.userLocal},isLoadMorLoading:function(e){return e.isLoadMorLoading},userInfo:function(e){return e.userInfo},companyInfo:function(e){return e.companyInfo},uploadToken:function(e){return e.uploadToken},isIOS:function(){return!!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)},isSafari:function(){return navigator.userAgent.indexOf("Safari")>-1&&navigator.userAgent.indexOf("Chrome")<1},isJudgeBigScreen:function(){var e=!1,t=window.screen.height/window.screen.width,n=window.screen.height==window.screen.availHeight?1.8:1.65;return t>n&&(e=!0),e},isShowPageLoading:function(e){return e.isShowPageLoading},workorders:function(e){return e.workorders},workorderTypes:function(e){return e.workorderTypes}}),I={platform:5,isShowPageLoading:!1,isShowHeader:!0,isMobile:!0,isArtificial:!1,uid:0,userAccount:0,artificialAccount:null,robotInfo:null,robotAccount:null,messages:[],isLoadMorEnd:!1,userLocal:"",AmapAPPKey:"",isLoadMorLoading:!1,userInfo:{},companyInfo:null,uploadToken:null,workorders:[],workorderTypes:[]};a["default"].use(c["a"]);var S=new c["a"].Store({state:I,getters:M,mutations:_,actions:w}),A=(n("394c"),n("76a0")),L=n.n(A),T=(n("aa35"),n("7f7f"),n("cea2")),C=n("c1df"),O={install:function(e,t){e.prototype.$myMethod=function(){console.log(t)},e.prototype.$formatUnixDate=function(e,t){return C(parseInt(e+"000")).format(t)},e.prototype.$formatFromNowDate=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"YYYY-MM-DD HH:mm";return C().format("YYYYMMDD")==C(parseInt(e+"000")).format("YYYYMMDD")?"今天 "+C(parseInt(e+"000")).format("HH:mm"):C(parseInt(e+"000")).format(t)},e.prototype.$formatDate=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"YYYY-MM-DD HH:mm:ss";return C(parseInt(e+"000")).format(t)},e.prototype.$robotNickname=function(e){for(var t,n=this.$store.getters.robots,a=0;a<n.length;a++)n[a].id==e&&(t=n[a].nickname);return t},e.prototype.$uploadFile=function(e){var t=e.mode,n=e.file,a=e.percent,r=e.success,o=e.fail,s=null,c=parseInt(1e4*Math.random()*(new Date).getTime())+n.name.substr(n.name.lastIndexOf("."));if(1==t){var i=new FormData;i.append("file",n),i.append("file_name",c),y.a.post("/public/upload",i).then((function(e){r&&r(e.data.data)})).catch((function(e){o&&o(e)}))}else if(2==t){var u={quality:.92,noCompressIfLarger:!0,maxWidth:1500};T["compressImage"](n,u).then((function(e){var t=T["upload"](e.dist,c,self.uploadToken.secret,{},{mimeType:null});s=t.subscribe({next:function(e){a&&a(e)},error:function(){var e=new FormData;e.append("fileType","image"),e.append("fileName","file"),e.append("key",c),e.append("token",self.uploadToken.secret),e.append("file",n),y.a.post("https://upload.qiniup.com",e).then((function(){r&&r(c)})).catch((function(e){o&&o(e)}))},complete:function(e){r&&r(e.key)}})}))}return s}}},D=O,Y=(n("6b54"),{install:function(e,t){console.log(t),e.MimcInstance=e.prototype.$mimcInstance={user:null,robot:null,platform:5,fetchMIMCTokenResult:null,_receiveP2PMsgCallback:null,_statusChangeCallback:null,_serverAckCallback:null,_disconnectCallback:null,init:function(e,t){this.platform=e.platform,this.fetchMIMCToken(e,t)},getLocalCacheUser:function(){var e=localStorage.getItem("user");return e?JSON.parse(e):null},fetchMIMCToken:function(e,t){var n=this;y.a.post("/public/register",e).then((function(e){n.fetchMIMCTokenResult=e.data.data.token,localStorage.setItem("user",JSON.stringify(e.data.data.user)),localStorage.setItem("Token",e.data.data.user.token),console.log("MIMC初始化成功"),n.getRobot((function(){t&&t(e.data.data.user)}))})).catch((function(e){t&&t(null),console.log(e)}))},getRobot:function(e){var t=this;y.a.get("/public/robot/"+this.platform).then((function(n){t.robot=n.data.data,e&&e()})).catch((function(e){console.log("mimc初始化失败,请刷新重试",e)}))},pushMessage:function(e){var t=this;y.a.post("/public/message/push",{msgType:"NORMAL_MSG",payload:e}).then((function(n){console.log(n.data),200!=n.data["code"]&&setTimeout((function(){return t.pushMessage(e)}),300)})).catch((function(){setTimeout((function(){return t.pushMessage(e)}),300)}))},login:function(e){var t=this;try{if(this.user)return;var n=this.fetchMIMCTokenResult;this.user=new MIMCUser(n.data.appId,n.data.appAccount,"666"),this.user.registerP2PMsgHandler((function(e){var n=JSON.parse(window.Base64.decode(e.getPayload()));t._receiveP2PMsgCallback&&t._receiveP2PMsgCallback(n)})),this.user.registerFetchToken((function(){return n})),this.user.registerStatusChange((function(e,n,a,r){t._statusChangeCallback&&t._statusChangeCallback(e,n,a,r)})),this.user.registerServerAckHandler((function(e,n,a,r){t._serverAckCallback&&t._serverAckCallback(e,n,a,r)})),this.user.registerDisconnHandler((function(){t._disconnectCallback&&t._disconnectCallback()})),this.user.login(),window.mimcInstance=this,e&&e(),console.log("MIMC登录成功")}catch(a){console.log("MIMC登录失败"),setTimeout((function(){t.login()}),1e3)}},logout:function(){this.user&&(this.user.logout(),this.user=null)},addEventListener:function(e,t){switch(e){case"receiveP2PMsg":this._receiveP2PMsgCallback=t;break;case"statusChange":this._statusChangeCallback=t;break;case"serverAck":this._serverAckCallback=t;break;case"disconnect":this._disconnectCallback=t;break}},sendMessage:function(e,t){var n=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(this.user){var r={from_account:parseInt(this.fetchMIMCTokenResult.data.appAccount),to_account:parseInt(t),biz_type:e,version:"0",timestamp:parseInt(((new Date).getTime()+" ").substr(0,10)),key:(new Date).getTime(),read:0,platform:this.platform,transfer_account:0,payload:a+""},o=window.Base64.encode(JSON.stringify(r));return"contacts"!=e&&"pong"!=e&&"welcome"!=e&&"handshake"!=e&&"search_knowledge"!=e&&this.pushMessage(window.Base64.encode(o)),setTimeout((function(){n.user.sendMessage(t.toString(),o)}),150),r}Object(A["Toast"])({message:"服务异常,请刷新重试!"})},createLocalMessage:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r={from_account:parseInt(this.fetchMIMCTokenResult.data.appAccount),to_account:parseInt(t),biz_type:e,version:"0",platform:this.platform,timestamp:parseInt(((new Date).getTime()+" ").substr(0,10)),key:(new Date).getTime(),read:0,transfer_account:parseInt(a),payload:n+""};return r}}}}),P=Y,$={months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY年MM月DD日",LLL:"YYYY年MM月DD日Ah点mm分",LLLL:"YYYY年MM月DD日ddddAh点mm分",l:"YYYY-M-D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"下午"===t||"晚上"===t?e+12:e>=11?e:e+12},meridiem:function(e,t){var n=100*e+t;return n<600?"凌晨":n<900?"早上":n<1130?"上午":n<1230?"中午":n<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|周)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"周";default:return e}},relativeTime:{future:"%s内",past:"%s前",s:"几秒",ss:"%d秒",m:"1分钟",mm:"%d分钟",h:"1小时",hh:"%d小时",d:"1天",dd:"%d天",M:"1个月",MM:"%d个月",y:"1年",yy:"%d年"},week:{dow:1,doy:4}},z=n("c1df");z.locale("zh-cn",$),y.a.defaults.baseURL="/api",y.a.interceptors.request.use((function(e){var t=localStorage.getItem("Token")||"";return e.headers=Object.assign({},{Token:t},e.headers),e}),(function(e){return console.log(e),Promise.reject(e)}));var H={clickToCloseNonZoomable:!1,fullscreenEl:!1};a["default"].use(b.a,H),a["default"].use(D),a["default"].use(P),a["default"].use(L.a),a["default"].config.productionTip=!1,new a["default"]({router:k,store:S,render:function(e){return e(m)}}).$mount("#app")},"7faf":function(e,t,n){"use strict";var a=n("8fba"),r=n.n(a);r.a},"8fba":function(e,t,n){}});
//# sourceMappingURL=app.cd5008bc.js.map
\ No newline at end of file
(function(e){function t(t){for(var a,r,c=t[0],i=t[1],u=t[2],l=0,d=[];l<c.length;l++)r=c[l],Object.prototype.hasOwnProperty.call(o,r)&&o[r]&&d.push(o[r][0]),o[r]=0;for(a in i)Object.prototype.hasOwnProperty.call(i,a)&&(e[a]=i[a]);f&&f(t);while(d.length)d.shift()();return s.push.apply(s,u||[]),n()}function n(){for(var e,t=0;t<s.length;t++){for(var n=s[t],a=!0,r=1;r<n.length;r++){var c=n[r];0!==o[c]&&(a=!1)}a&&(s.splice(t--,1),e=i(i.s=n[0]))}return e}var a={},r={app:0},o={app:0},s=[];function c(e){return i.p+"js/"+({}[e]||e)+"."+{"chunk-2c568771":"a81203d3","chunk-5e6009ff":"d7088d94","chunk-612d9b40":"13a3a9bb","chunk-9ec58ea8":"59b56ff9"}[e]+".js"}function i(t){if(a[t])return a[t].exports;var n=a[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.e=function(e){var t=[],n={"chunk-2c568771":1,"chunk-5e6009ff":1,"chunk-612d9b40":1,"chunk-9ec58ea8":1};r[e]?t.push(r[e]):0!==r[e]&&n[e]&&t.push(r[e]=new Promise((function(t,n){for(var a="css/"+({}[e]||e)+"."+{"chunk-2c568771":"92feb802","chunk-5e6009ff":"86cb9867","chunk-612d9b40":"3daa63d4","chunk-9ec58ea8":"5743221d"}[e]+".css",o=i.p+a,s=document.getElementsByTagName("link"),c=0;c<s.length;c++){var u=s[c],l=u.getAttribute("data-href")||u.getAttribute("href");if("stylesheet"===u.rel&&(l===a||l===o))return t()}var d=document.getElementsByTagName("style");for(c=0;c<d.length;c++){u=d[c],l=u.getAttribute("data-href");if(l===a||l===o)return t()}var f=document.createElement("link");f.rel="stylesheet",f.type="text/css",f.onload=t,f.onerror=function(t){var a=t&&t.target&&t.target.src||o,s=new Error("Loading CSS chunk "+e+" failed.\n("+a+")");s.code="CSS_CHUNK_LOAD_FAILED",s.request=a,delete r[e],f.parentNode.removeChild(f),n(s)},f.href=o;var p=document.getElementsByTagName("head")[0];p.appendChild(f)})).then((function(){r[e]=0})));var a=o[e];if(0!==a)if(a)t.push(a[2]);else{var s=new Promise((function(t,n){a=o[e]=[t,n]}));t.push(a[2]=s);var u,l=document.createElement("script");l.charset="utf-8",l.timeout=120,i.nc&&l.setAttribute("nonce",i.nc),l.src=c(e);var d=new Error;u=function(t){l.onerror=l.onload=null,clearTimeout(f);var n=o[e];if(0!==n){if(n){var a=t&&("load"===t.type?"missing":t.type),r=t&&t.target&&t.target.src;d.message="Loading chunk "+e+" failed.\n("+a+": "+r+")",d.name="ChunkLoadError",d.type=a,d.request=r,n[1](d)}o[e]=void 0}};var f=setTimeout((function(){u({type:"timeout",target:l})}),12e4);l.onerror=l.onload=u,document.head.appendChild(l)}return Promise.all(t)},i.m=e,i.c=a,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)i.d(n,a,function(t){return e[t]}.bind(null,a));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i.oe=function(e){throw console.error(e),e};var u=window["webpackJsonp"]=window["webpackJsonp"]||[],l=u.push.bind(u);u.push=t,u=u.slice();for(var d=0;d<u.length;d++)t(u[d]);var f=l;s.push([0,"chunk-vendors"]),n()})({0:function(e,t,n){e.exports=n("56d7")},4678:function(e,t,n){var a={"./af":"2bfb","./af.js":"2bfb","./ar":"8e73","./ar-dz":"a356","./ar-dz.js":"a356","./ar-kw":"423e","./ar-kw.js":"423e","./ar-ly":"1cfd","./ar-ly.js":"1cfd","./ar-ma":"0a84","./ar-ma.js":"0a84","./ar-sa":"8230","./ar-sa.js":"8230","./ar-tn":"6d83","./ar-tn.js":"6d83","./ar.js":"8e73","./az":"485c","./az.js":"485c","./be":"1fc1","./be.js":"1fc1","./bg":"84aa","./bg.js":"84aa","./bm":"a7fa","./bm.js":"a7fa","./bn":"9043","./bn.js":"9043","./bo":"d26a","./bo.js":"d26a","./br":"6887","./br.js":"6887","./bs":"2554","./bs.js":"2554","./ca":"d716","./ca.js":"d716","./cs":"3c0d","./cs.js":"3c0d","./cv":"03ec","./cv.js":"03ec","./cy":"9797","./cy.js":"9797","./da":"0f14","./da.js":"0f14","./de":"b469","./de-at":"b3eb","./de-at.js":"b3eb","./de-ch":"bb71","./de-ch.js":"bb71","./de.js":"b469","./dv":"598a","./dv.js":"598a","./el":"8d47","./el.js":"8d47","./en-SG":"cdab","./en-SG.js":"cdab","./en-au":"0e6b","./en-au.js":"0e6b","./en-ca":"3886","./en-ca.js":"3886","./en-gb":"39a6","./en-gb.js":"39a6","./en-ie":"e1d3","./en-ie.js":"e1d3","./en-il":"7333","./en-il.js":"7333","./en-nz":"6f50","./en-nz.js":"6f50","./eo":"65db","./eo.js":"65db","./es":"898b","./es-do":"0a3c","./es-do.js":"0a3c","./es-us":"55c9","./es-us.js":"55c9","./es.js":"898b","./et":"ec18","./et.js":"ec18","./eu":"0ff2","./eu.js":"0ff2","./fa":"8df4","./fa.js":"8df4","./fi":"81e9","./fi.js":"81e9","./fo":"0721","./fo.js":"0721","./fr":"9f26","./fr-ca":"d9f8","./fr-ca.js":"d9f8","./fr-ch":"0e49","./fr-ch.js":"0e49","./fr.js":"9f26","./fy":"7118","./fy.js":"7118","./ga":"5120","./ga.js":"5120","./gd":"f6b4","./gd.js":"f6b4","./gl":"8840","./gl.js":"8840","./gom-latn":"0caa","./gom-latn.js":"0caa","./gu":"e0c5","./gu.js":"e0c5","./he":"c7aa","./he.js":"c7aa","./hi":"dc4d","./hi.js":"dc4d","./hr":"4ba9","./hr.js":"4ba9","./hu":"5b14","./hu.js":"5b14","./hy-am":"d6b6","./hy-am.js":"d6b6","./id":"5038","./id.js":"5038","./is":"0558","./is.js":"0558","./it":"6e98","./it-ch":"6f12","./it-ch.js":"6f12","./it.js":"6e98","./ja":"079e","./ja.js":"079e","./jv":"b540","./jv.js":"b540","./ka":"201b","./ka.js":"201b","./kk":"6d79","./kk.js":"6d79","./km":"e81d","./km.js":"e81d","./kn":"3e92","./kn.js":"3e92","./ko":"22f8","./ko.js":"22f8","./ku":"2421","./ku.js":"2421","./ky":"9609","./ky.js":"9609","./lb":"440c","./lb.js":"440c","./lo":"b29d","./lo.js":"b29d","./lt":"26f9","./lt.js":"26f9","./lv":"b97c","./lv.js":"b97c","./me":"293c","./me.js":"293c","./mi":"688b","./mi.js":"688b","./mk":"6909","./mk.js":"6909","./ml":"02fb","./ml.js":"02fb","./mn":"958b","./mn.js":"958b","./mr":"39bd","./mr.js":"39bd","./ms":"ebe4","./ms-my":"6403","./ms-my.js":"6403","./ms.js":"ebe4","./mt":"1b45","./mt.js":"1b45","./my":"8689","./my.js":"8689","./nb":"6ce3","./nb.js":"6ce3","./ne":"3a39","./ne.js":"3a39","./nl":"facd","./nl-be":"db29","./nl-be.js":"db29","./nl.js":"facd","./nn":"b84c","./nn.js":"b84c","./pa-in":"f3ff","./pa-in.js":"f3ff","./pl":"8d57","./pl.js":"8d57","./pt":"f260","./pt-br":"d2d4","./pt-br.js":"d2d4","./pt.js":"f260","./ro":"972c","./ro.js":"972c","./ru":"957c","./ru.js":"957c","./sd":"6784","./sd.js":"6784","./se":"ffff","./se.js":"ffff","./si":"eda5","./si.js":"eda5","./sk":"7be6","./sk.js":"7be6","./sl":"8155","./sl.js":"8155","./sq":"c8f3","./sq.js":"c8f3","./sr":"cf1e","./sr-cyrl":"13e9","./sr-cyrl.js":"13e9","./sr.js":"cf1e","./ss":"52bd","./ss.js":"52bd","./sv":"5fbd","./sv.js":"5fbd","./sw":"74dc","./sw.js":"74dc","./ta":"3de5","./ta.js":"3de5","./te":"5cbb","./te.js":"5cbb","./tet":"576c","./tet.js":"576c","./tg":"3b1b","./tg.js":"3b1b","./th":"10e8","./th.js":"10e8","./tl-ph":"0f38","./tl-ph.js":"0f38","./tlh":"cf75","./tlh.js":"cf75","./tr":"0e81","./tr.js":"0e81","./tzl":"cf51","./tzl.js":"cf51","./tzm":"c109","./tzm-latn":"b53d","./tzm-latn.js":"b53d","./tzm.js":"c109","./ug-cn":"6117","./ug-cn.js":"6117","./uk":"ada2","./uk.js":"ada2","./ur":"5294","./ur.js":"5294","./uz":"2e8c","./uz-latn":"010e","./uz-latn.js":"010e","./uz.js":"2e8c","./vi":"2921","./vi.js":"2921","./x-pseudo":"fd7e","./x-pseudo.js":"fd7e","./yo":"7f33","./yo.js":"7f33","./zh-cn":"5c3a","./zh-cn.js":"5c3a","./zh-hk":"49ab","./zh-hk.js":"49ab","./zh-tw":"90ea","./zh-tw.js":"90ea"};function r(e){var t=o(e);return n(t)}function o(e){if(!n.o(a,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return a[e]}r.keys=function(){return Object.keys(a)},r.resolve=o,e.exports=r,r.id="4678"},"56d7":function(e,t,n){"use strict";n.r(t);n("cadf"),n("551c"),n("f751"),n("097d");var a=n("2b0e"),r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[e.isShowPageLoading?n("div",{staticClass:"mini-im-loading",class:{"pc-mini-im-loading":!e.isMobile}},[n("mt-spinner",{attrs:{type:"triple-bounce",color:"#26a2ff"}})],1):e._e(),n("router-view")],1)},o=[],s=(n("8e6e"),n("ac6a"),n("456d"),n("28a5"),n("bd86")),c=n("2f62");function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){Object(s["a"])(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var l={name:"app",data:function(){return{}},computed:u({},Object(c["b"])(["isShowPageLoading","userAccount","isArtificial","isMobile","artificialAccount","robotAccount","platform","userLocal","uid","uid"])),created:function(){var e=this;this.getLocal(),setTimeout((function(){e.handelUrl(),e.runApp()}),500),this.onCheckIsOutSession()},methods:{runApp:function(){var e=this,t=this.$mimcInstance.getLocalCacheUser();t&&null!=this.userAccount&&this.userAccount!=t.id&&0!=this.userAccount&&localStorage.clear(),this.$mimcInstance.init({type:0,address:this.userLocal,uid:this.uid||0,platform:this.platform,account_id:this.userAccount||0},(function(t){if(e.upLastActivity(),e.$store.dispatch("onGetCompanyInfo"),e.$store.dispatch("onGetUploadSecret"),e.$store.dispatch("onGetWorkorderTypes"),e.$store.dispatch("onGetWorkorders"),t){e.$store.commit("updateState",{userAccount:t.id,userInfo:t});var n=e.$mimcInstance.robot;localStorage.setItem("robot_"+n.id,JSON.stringify(n)),e.$store.commit("updateState",{robotAccount:n.id,robotInfo:n}),e.$mimcInstance.login();var a=function t(){null!=e.$mimcInstance.user&&e.$mimcInstance.user.isLogin()?e.artificialAccount||(console.log("握手消息"),e.$mimcInstance.sendMessage("handshake",e.robotAccount,"")):setTimeout((function(){return t()}),200)};a()}else setTimeout((function(){return e.runApp()}),1e3)}))},handelUrl:function(){var e,t,n,a,r,o,s,c,i=this.$route.query;i&&i.c&&localStorage.clear();var u=this.queryToJson(localStorage.getItem("urlQuery"));u&&(i=Object.assign({},u,i)),i&&("0"==i.h&&(e=!1),"0"==i.m&&(t=!1,e=!1),i.u&&(n=parseInt(i.u)),i.p&&(c=parseInt(i.p)),i.uid&&(a=parseInt(i.uid)),"0"==i.r?(r=!0,o=parseInt(i.a)):s=parseInt(i.a));var l=localStorage.getItem("isArtificial"),d=localStorage.getItem("artificialAccount");"true"==l&&(r=!0,o=parseInt(d)),this.$store.commit("updateState",{isShowHeader:e,isMobile:t,userAccount:n,uid:a,isArtificial:r,artificialAccount:o,robotAccount:s,platform:c})},queryToJson:function(e){if(!e||""==e)return null;var t=e.substr(1,e.length).split("&");if(!t)return null;for(var n={},a=0;a<t.length;a++){var r=t[a].split("=");n[r[0]]=r[1]}return n},getLocal:function(){this.$store.dispatch("onGetLocal",this.$store.state.AmapAPPKey)},upLastActivity:function(){var e=this;this.onCheckIsOutSession();var t=this.$mimcInstance.getLocalCacheUser();t&&this.$store.dispatch("onUpdateLastActivity"),this.isArtificial&&localStorage.setItem("artificialTime",Date.now()),setTimeout((function(){return e.upLastActivity()}),6e4)},onCheckIsOutSession:function(){var e=localStorage.getItem("artificialTime");e&&(e=parseInt(e),Date.now()>e+6e5&&this.$store.commit("updateState",{isArtificial:!1,artificialAccount:null}))}}},d=l,f=(n("7faf"),n("2877")),p=Object(f["a"])(d,r,o,!1,null,null,null),m=p.exports,h=n("d1d4"),b=n.n(h),g=n("8c4f");a["default"].use(g["a"]);var j=new g["a"]({base:"",routes:[{path:"/",redirect:"/index"},{path:"/index",name:"index",component:function(){return n.e("chunk-5e6009ff").then(n.bind(null,"e0a0"))}},{path:"/workorder",name:"workorder",component:function(){return n.e("chunk-612d9b40").then(n.bind(null,"fb09"))}},{path:"/workorder/create",name:"workorder_create",component:function(){return n.e("chunk-2c568771").then(n.bind(null,"ede1"))}},{path:"/workorder/detail/:id",name:"workorder_detail",component:function(){return n.e("chunk-9ec58ea8").then(n.bind(null,"4033"))}}]}),k=j,v=n("bc3a"),y=n.n(v),w={onGetMessages:function(e,t){var n=20;y.a.post("/public/messages",{timestamp:t.timestamp,page_size:n}).then((function(a){var r=[],o=a.data.data.list||[];(o.length<n||0==o.length)&&e.commit("updateState",{isLoadMorEnd:!0}),r=0==t.oldMsg.length&&o.length>0?a.data.data.list:o.length>0?o.concat(t.oldMsg):t.oldMsg,e.commit("updateState",{messages:r}),t.callback&&t.callback()})).catch((function(e){console.log(e)}))},onGetLocal:function(e,t){y.a.get("https://restapi.amap.com/v3/ip?key="+t).then((function(t){t.data.province&&e.commit("updateState",{userLocal:t.data.province+t.data.city})})).catch((function(e){console.error(e)}))},onCleanRead:function(){y.a.get("/public/clean_read/")},onUpdateLastActivity:function(){y.a.get("/public/activity/")},onToggleWindow:function(e,t){y.a.put("/public/window/",{window:t})},onGetCompanyInfo:function(e){y.a.get("/public/company").then((function(t){e.commit("updateState",{companyInfo:t.data.data})})).catch((function(e){console.error(e)}))},onGetUploadSecret:function(e){y.a.get("/public/secret").then((function(t){e.commit("updateState",{uploadToken:t.data.data})}))},onGetWorkorderTypes:function(e){y.a.get("/public/workorder/types").then((function(t){e.commit("updateState",{workorderTypes:t.data.data})}))},onGetWorkorders:function(e){y.a.get("/public/workorders").then((function(t){e.commit("updateState",{workorders:t.data.data})}))}},_={updateState:function(e,t){var n=e;for(var a in t)void 0!=t[a]&&(n[a]=t[a]);e=n}},M=(n("4917"),{platform:function(e){return e.platform},isArtificial:function(e){return e.isArtificial},isShowHeader:function(e){return e.isShowHeader},isMobile:function(e){return e.isMobile},uid:function(e){return e.uid},userAccount:function(e){return e.userAccount},artificialAccount:function(e){return e.artificialAccount},robotInfo:function(e){return e.robotInfo},robotAccount:function(e){return e.robotAccount},isLoadMorEnd:function(e){return e.isLoadMorEnd},messages:function(e){return e.messages||[]},userLocal:function(e){return e.userLocal},isLoadMorLoading:function(e){return e.isLoadMorLoading},userInfo:function(e){return e.userInfo},companyInfo:function(e){return e.companyInfo},uploadToken:function(e){return e.uploadToken},isIOS:function(){return!!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)},isSafari:function(){return navigator.userAgent.indexOf("Safari")>-1&&navigator.userAgent.indexOf("Chrome")<1},isJudgeBigScreen:function(){var e=!1,t=window.screen.height/window.screen.width,n=window.screen.height==window.screen.availHeight?1.8:1.65;return t>n&&(e=!0),e},isShowPageLoading:function(e){return e.isShowPageLoading},workorders:function(e){return e.workorders},workorderTypes:function(e){return e.workorderTypes}}),I={platform:5,isShowPageLoading:!1,isShowHeader:!0,isMobile:!0,isArtificial:!1,uid:0,userAccount:0,artificialAccount:null,robotInfo:null,robotAccount:null,messages:[],isLoadMorEnd:!1,userLocal:"",AmapAPPKey:"",isLoadMorLoading:!1,userInfo:{},companyInfo:null,uploadToken:null,workorders:[],workorderTypes:[]};a["default"].use(c["a"]);var S=new c["a"].Store({state:I,getters:M,mutations:_,actions:w}),A=(n("394c"),n("76a0")),L=n.n(A),T=(n("aa35"),n("7f7f"),n("cea2")),C=n("c1df"),O={install:function(e,t){e.prototype.$myMethod=function(){console.log(t)},e.prototype.$formatUnixDate=function(e,t){return C(parseInt(e+"000")).format(t)},e.prototype.$formatFromNowDate=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"YYYY-MM-DD HH:mm";return C().format("YYYYMMDD")==C(parseInt(e+"000")).format("YYYYMMDD")?"今天 "+C(parseInt(e+"000")).format("HH:mm"):C(parseInt(e+"000")).format(t)},e.prototype.$formatDate=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"YYYY-MM-DD HH:mm:ss";return C(parseInt(e+"000")).format(t)},e.prototype.$robotNickname=function(e){for(var t,n=this.$store.getters.robots,a=0;a<n.length;a++)n[a].id==e&&(t=n[a].nickname);return t},e.prototype.$uploadFile=function(e){var t=e.mode,n=e.file,a=e.percent,r=e.success,o=e.fail,s=null,c=parseInt(1e4*Math.random()*(new Date).getTime())+n.name.substr(n.name.lastIndexOf("."));if(1==t){var i=new FormData;i.append("file",n),i.append("file_name",c),y.a.post("/public/upload",i).then((function(e){r&&r(e.data.data)})).catch((function(e){o&&o(e)}))}else if(2==t){var u={quality:.92,noCompressIfLarger:!0,maxWidth:1500};T["compressImage"](n,u).then((function(e){var t=T["upload"](e.dist,c,self.uploadToken.secret,{},{mimeType:null});s=t.subscribe({next:function(e){a&&a(e)},error:function(){var e=new FormData;e.append("fileType","image"),e.append("fileName","file"),e.append("key",c),e.append("token",self.uploadToken.secret),e.append("file",n),y.a.post("https://upload.qiniup.com",e).then((function(){r&&r(c)})).catch((function(e){o&&o(e)}))},complete:function(e){r&&r(e.key)}})}))}return s}}},D=O,Y=(n("6b54"),{install:function(e,t){console.log(t),e.MimcInstance=e.prototype.$mimcInstance={user:null,robot:null,platform:5,fetchMIMCTokenResult:null,_receiveP2PMsgCallback:null,_statusChangeCallback:null,_serverAckCallback:null,_disconnectCallback:null,init:function(e,t){this.platform=e.platform,this.fetchMIMCToken(e,t)},getLocalCacheUser:function(){var e=localStorage.getItem("user");return e?JSON.parse(e):null},fetchMIMCToken:function(e,t){var n=this;y.a.post("/public/register",e).then((function(e){n.fetchMIMCTokenResult=e.data.data.token,localStorage.setItem("user",JSON.stringify(e.data.data.user)),localStorage.setItem("Token",e.data.data.user.token),console.log("MIMC初始化成功"),n.getRobot((function(){t&&t(e.data.data.user)}))})).catch((function(e){t&&t(null),console.log(e)}))},getRobot:function(e){var t=this;y.a.get("/public/robot/"+this.platform).then((function(n){t.robot=n.data.data,e&&e()})).catch((function(e){console.log("mimc初始化失败,请刷新重试",e)}))},pushMessage:function(e){var t=this;y.a.post("/public/message/push",{msgType:"NORMAL_MSG",payload:e}).then((function(n){console.log(n.data),200!=n.data["code"]&&setTimeout((function(){return t.pushMessage(e)}),300)})).catch((function(){setTimeout((function(){return t.pushMessage(e)}),300)}))},login:function(e){var t=this;try{if(this.user)return;var n=this.fetchMIMCTokenResult;this.user=new MIMCUser(n.data.appId,n.data.appAccount,"666"),this.user.registerP2PMsgHandler((function(e){var n=JSON.parse(window.Base64.decode(e.getPayload()));t._receiveP2PMsgCallback&&t._receiveP2PMsgCallback(n)})),this.user.registerFetchToken((function(){return n})),this.user.registerStatusChange((function(e,n,a,r){t._statusChangeCallback&&t._statusChangeCallback(e,n,a,r)})),this.user.registerServerAckHandler((function(e,n,a,r){t._serverAckCallback&&t._serverAckCallback(e,n,a,r)})),this.user.registerDisconnHandler((function(){t._disconnectCallback&&t._disconnectCallback()})),this.user.login(),window.mimcInstance=this,e&&e(),console.log("MIMC登录成功")}catch(a){console.log("MIMC登录失败"),setTimeout((function(){t.login()}),1e3)}},logout:function(){this.user&&(this.user.logout(),this.user=null)},addEventListener:function(e,t){switch(e){case"receiveP2PMsg":this._receiveP2PMsgCallback=t;break;case"statusChange":this._statusChangeCallback=t;break;case"serverAck":this._serverAckCallback=t;break;case"disconnect":this._disconnectCallback=t;break}},sendMessage:function(e,t){var n=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(this.user){var r={from_account:parseInt(this.fetchMIMCTokenResult.data.appAccount),to_account:parseInt(t),biz_type:e,version:"0",timestamp:parseInt(((new Date).getTime()+" ").substr(0,10)),key:(new Date).getTime(),read:0,platform:this.platform,transfer_account:0,payload:a+""},o=window.Base64.encode(JSON.stringify(r));return"contacts"!=e&&"pong"!=e&&"welcome"!=e&&"handshake"!=e&&"search_knowledge"!=e&&this.pushMessage(window.Base64.encode(o)),setTimeout((function(){n.user.sendMessage(t.toString(),o)}),150),r}Object(A["Toast"])({message:"服务异常,请刷新重试!"})},createLocalMessage:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r={from_account:parseInt(this.fetchMIMCTokenResult.data.appAccount),to_account:parseInt(t),biz_type:e,version:"0",platform:this.platform,timestamp:parseInt(((new Date).getTime()+" ").substr(0,10)),key:(new Date).getTime(),read:0,transfer_account:parseInt(a),payload:n+""};return r}}}}),P=Y,$={months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY年MM月DD日",LLL:"YYYY年MM月DD日Ah点mm分",LLLL:"YYYY年MM月DD日ddddAh点mm分",l:"YYYY-M-D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"下午"===t||"晚上"===t?e+12:e>=11?e:e+12},meridiem:function(e,t){var n=100*e+t;return n<600?"凌晨":n<900?"早上":n<1130?"上午":n<1230?"中午":n<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|周)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"周";default:return e}},relativeTime:{future:"%s内",past:"%s前",s:"几秒",ss:"%d秒",m:"1分钟",mm:"%d分钟",h:"1小时",hh:"%d小时",d:"1天",dd:"%d天",M:"1个月",MM:"%d个月",y:"1年",yy:"%d年"},week:{dow:1,doy:4}},z=n("c1df");z.locale("zh-cn",$),y.a.defaults.baseURL="/api",y.a.interceptors.request.use((function(e){var t=localStorage.getItem("Token")||"";return e.headers=Object.assign({},{Token:t},e.headers),e}),(function(e){return console.log(e),Promise.reject(e)}));var H={clickToCloseNonZoomable:!1,fullscreenEl:!1};a["default"].use(b.a,H),a["default"].use(D),a["default"].use(P),a["default"].use(L.a),a["default"].config.productionTip=!1,new a["default"]({router:k,store:S,render:function(e){return e(m)}}).$mount("#app")},"7faf":function(e,t,n){"use strict";var a=n("8fba"),r=n.n(a);r.a},"8fba":function(e,t,n){}});
//# sourceMappingURL=app.a65684bc.js.map
\ No newline at end of file
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-233fded2"],{"0b3a":function(t,e,o){},"269c":function(t,e,o){t.exports=o.p+"img/fujian1.083cd8b7.png"},"3fb2":function(t,e,o){"use strict";var s=o("0b3a"),r=o.n(s);r.a},4033:function(t,e,o){"use strict";o.r(e);var s=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"container"},[t.isShowHeader?s("mt-header",{attrs:{fixed:"",title:"工单详细"}},[s("div",{attrs:{slot:"left"},slot:"left"},[s("mt-button",{attrs:{icon:"back"},on:{click:function(e){return t.$router.go(-1)}}})],1),3!=t.workorder.status?s("mt-button",{attrs:{slot:"right"},on:{click:function(e){return t.close()}},slot:"right"},[s("span",[t._v("关闭工单")])]):s("mt-button",{attrs:{slot:"right"},on:{click:function(e){return t.del()}},slot:"right"},[s("span",[t._v("删除")])])],1):t._e(),s("div",{staticClass:"content",class:{"hide-header":!t.isShowHeader}},[s("div",{staticClass:"head"},[s("div",{staticClass:"con"},[s("span",[t._v("标题:")]),s("span",[t._v(t._s(t.workorder.title))])]),s("div",{staticClass:"con"},[s("span",[t._v("内容:")]),s("span",{domProps:{innerHTML:t._s(t.workorder.content)}})]),s("div",{staticClass:"con"},[s("span",[t._v("电话:")]),s("span",[t._v(t._s(t.workorder.phone||"未预留电话号码"))])]),s("div",{staticClass:"con"},[s("span",[t._v("邮箱:")]),s("span",[t._v(t._s(t.workorder.email||"未预留邮箱"))])]),s("div",{staticClass:"con"},[s("span",[t._v("时间:")]),s("span",[t._v(t._s(t.$formatDate(t.workorder.create_at)))])]),s("div",{staticClass:"con"},[s("span",[t._v("状态:")]),s("span",[1==t.workorder.status?s("i",{staticStyle:{color:"#8bc34a"}},[t._v("已回复")]):t._e(),3==t.workorder.status?s("i",{staticStyle:{color:"#ccc"}},[t._v("已结束")]):t._e(),0==t.workorder.status?s("i",{staticStyle:{color:"#FF9800"}},[t._v("待处理")]):t._e(),2==t.workorder.status?s("i",{staticStyle:{color:"#FF9800"}},[t._v("待回复")]):t._e()])])]),s("div",{staticClass:"comments"},[t.comments.length<=0?s("div",{staticClass:"no-data"},[t._v("暂无回复内容,请您耐心等待~")]):t._l(t.comments,(function(e,o){return[s("div",{key:o,staticClass:"item"},[s("div",{staticClass:"avatar"},[0==e.aid?s("img",{attrs:{src:t.userInfo.avatar||"http://qiniu.cmp520.com/avatar_degault_3.png",alt:""}}):s("img",{attrs:{src:e.a_avatar||"http://qiniu.cmp520.com/avatar_degault_3.png",alt:""}})]),s("div",{staticClass:"right"},[0==e.aid?s("div",{staticClass:"nickname"},[t._v("我")]):s("div",{staticClass:"nickname"},[t._v(t._s(e.a_nickname))]),s("div",{staticClass:"detail",domProps:{innerHTML:t._s(e.content)}}),s("div",{staticClass:"date"},[t._v(t._s(t.$formatDate(e.create_at)))])])])]})),3==t.workorder.status?s("div",{staticClass:"workorder-close"},[t._v("工单已结束~")]):t._e()],2),""!=t.request.source||t.isShowUploadLoading?s("div",{staticClass:"file-view"},[t.isShowUploadLoading?s("span",[s("img",{attrs:{src:o("cf1c"),alt:""}}),s("i",[t._v("上传中~")])]):s("span",[s("img",{attrs:{src:o("269c"),alt:""}}),s("i",[t._v("你已成功添加附件,重新上传可替换~")])])]):t._e(),3!=t.workorder.status?s("div",{staticClass:"input-form"},[s("textarea",{directives:[{name:"model",rawName:"v-model",value:t.request.content,expression:"request.content"}],attrs:{placeholder:"请输入内容~"},domProps:{value:t.request.content},on:{blur:function(e){return t.inputBlur()},input:function(e){e.target.composing||t.$set(t.request,"content",e.target.value)}}}),s("span",{staticClass:"icon-btn"},[s("input",{attrs:{title:"添加附件",type:"file",onclick:"this.value = null"},on:{change:t.uploadFile}})]),s("span",{staticClass:"sub-btn",on:{click:function(e){return t.reply()}}},[t._v("提交")])]):t._e()])],1)},r=[],n=(o("8e6e"),o("ac6a"),o("456d"),o("bd86")),a=o("2f62"),i=o("76a0"),c=o("bc3a"),l=o.n(c);function u(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),o.push.apply(o,s)}return o}function d(t){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?u(Object(o),!0).forEach((function(e){Object(n["a"])(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):u(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}var A={name:"workorder_detail",components:{},data:function(){return{isShowUploadLoading:!1,isSubmit:!1,workorder:{},comments:[],fileType:"",request:{source:"",content:""}}},computed:d({},Object(a["b"])(["isShowHeader","workorders","userInfo","workorderTypes","uploadToken"])),created:function(){var t=this;document.title="工单详细";var e=this.$route.params.id;this.$store.commit("updateState",{isShowPageLoading:!0}),l.a.all([this.getWorkOrder(e),this.getComments(e)]).then(l.a.spread((function(){t.$store.commit("updateState",{isShowPageLoading:!1})})))},methods:{getWorkOrder:function(t){var e=this;return l.a.get("/public/workorder/"+t).then((function(t){e.workorder=t.data.data,setTimeout((function(){return e.$previewRefresh()}),200)})).catch((function(t){console.log(t)}))},getComments:function(t){var e=this;return l.a.get("/public/workorder/comments/"+t).then((function(t){null!=t.data.data&&(e.comments=t.data.data,setTimeout((function(){return e.$previewRefresh()}),200))})).catch((function(t){console.log(t)}))},reply:function(){var t=this,e=this.request.content+this.request.source;if(""!=e.trim()){if(!this.isSubmit){this.isSubmit=!0;var o=this.workorder.id;l.a.post("/public/workorder/reply",{wid:o,content:e}).then((function(e){t.isSubmit=!1,console.log(e),t.getComments(o),t.request={source:"",content:""},setTimeout((function(){var t=document.querySelector(".container").clientHeight,e=document.querySelector(".content").clientHeight;document.querySelector(".container").scrollTop=e-t+20}),500)})).catch((function(e){t.isSubmit=!1,console.log(e),Object(i["Toast"])({message:"提交失败~"})}))}}else Object(i["Toast"])({message:"请输入内容~"})},inputBlur:function(){setTimeout((function(){document.body.scrollTo=0,window.scrollTo(0,0)}),100)},uploadFile:function(t){var e=t.target,o=e.files[0];this.isShowUploadLoading=!0;var s=this;this.$uploadFile({file:o,mode:this.uploadToken.mode,percent:function(){},success:function(t){var e;s.isShowUploadLoading=!1;var o=s.uploadToken.host+"/"+t,r=t.substr(t.lastIndexOf(".")+1);-1!="jpg,jpeg,png,JPG,JPEG,PNG".indexOf(r)?e="<br><img style='max-width:45%' preview='1' src='"+o+"' />":(e="<br><img style='width:20px;height:20px;top:3px; right:3px;position: relative;' preview='1' src='http://qiniu.cmp520.com/fj.png' />",e+="<a target='_blank' style='color: #2e9dfc;' href='"+o+"'>下载附件</a>"),s.request.source=e,Object(i["Toast"])({message:"上传成功~"})},fail:function(t){s.isShowUploadLoading=!1,t.response&&t.response.data&&Object(i["Toast"])({message:t.response.data.message})}})},close:function(){var t=this,e=this.workorder.id;i["MessageBox"].confirm("您确定关闭该工单吗?").then((function(){l.a.put("/public/workorder/close/"+e).then((function(o){console.log(o),Object(i["Toast"])({message:"工单已关闭~"}),t.getWorkOrder(e)})).catch((function(t){Object(i["Toast"])({message:"工单关闭失败~"}),console.log(t)}))}))},del:function(){var t=this,e=this.workorder.id;i["MessageBox"].confirm("您确定删除该工单吗?").then((function(){l.a.delete("/public/workorder/"+e).then((function(e){console.log(e),Object(i["Toast"])({message:"工单已删除~"}),setTimeout((function(){return t.$router.go(-1)}))})).catch((function(t){Object(i["Toast"])({message:"工单关闭失败~"}),console.log(t)}))}))}}},p=A,g=(o("3fb2"),o("2877")),m=Object(g["a"])(p,s,r,!1,null,"1f126a3f",null);e["default"]=m.exports},cf1c:function(t,e){t.exports="data:image/gif;base64,R0lGODlhEAAQAKIGAMLY8YSx5HOm4Mjc88/g9Ofw+v///wAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQFCgAGACwAAAAAEAAQAAADMGi6RbUwGjKIXCAA016PgRBElAVlG/RdLOO0X9nK61W39qvqiwz5Ls/rRqrggsdkAgAh+QQFCgAGACwCAAAABwAFAAADD2hqELAmiFBIYY4MAutdCQAh+QQFCgAGACwGAAAABwAFAAADD1hU1kaDOKMYCGAGEeYFCQAh+QQFCgAGACwKAAIABQAHAAADEFhUZjSkKdZqBQG0IELDQAIAIfkEBQoABgAsCgAGAAUABwAAAxBoVlRKgyjmlAIBqCDCzUoCACH5BAUKAAYALAYACgAHAAUAAAMPaGpFtYYMAgJgLogA610JACH5BAUKAAYALAIACgAHAAUAAAMPCAHWFiI4o1ghZZJB5i0JACH5BAUKAAYALAAABgAFAAcAAAMQCAFmIaEp1motpDQySMNFAgA7"}}]);
//# sourceMappingURL=chunk-233fded2.64fa5b81.js.map
\ No newline at end of file
{"version":3,"sources":["webpack:///./src/assets/fujian1.png","webpack:///./src/views/workorder_detail.vue?00b7","webpack:///./src/views/workorder_detail.vue?073f","webpack:///src/views/workorder_detail.vue","webpack:///./src/views/workorder_detail.vue?9869","webpack:///./src/views/workorder_detail.vue","webpack:///./src/assets/loading.gif"],"names":["module","exports","render","_vm","this","_h","$createElement","_c","_self","staticClass","attrs","slot","on","$event","$router","go","workorder","status","close","_v","del","_e","class","isShowHeader","_s","title","domProps","content","phone","email","$formatDate","create_at","staticStyle","comments","length","_l","item","index","key","aid","userInfo","avatar","a_avatar","a_nickname","request","source","isShowUploadLoading","directives","name","rawName","value","expression","inputBlur","target","composing","$set","uploadFile","reply","staticRenderFns","components","data","isSubmit","fileType","computed","created","document","$store","commit","methods","getWorkOrder","getComments","trim","message","setTimeout","body","scrollTo","window","fileDom","e","file","files","$uploadFile","mode","uploadToken","percent","success","html","self","fullPath","host","src","substr","lastIndexOf","indexOf","fail","response","wid","id","component"],"mappings":"8HAAAA,EAAOC,QAAU,IAA0B,4B,oCCA3C,yBAA+iB,EAAG,G,yCCAljB,IAAIC,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,YAAY,aAAa,CAAEN,EAAgB,aAAEI,EAAG,YAAY,CAACG,MAAM,CAAC,MAAQ,GAAG,MAAQ,SAAS,CAACH,EAA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,WAEU,YAAV,WAAY,OAAZ,uBAEA,mBACU,OAAV,WAAU,CAAV,CACY,QAAZ,YAEU,QAAV,gBCzQ6X,I,wBCQzXC,EAAY,eACd,EACAhG,EACAwD,GACA,EACA,KACA,WACA,MAIa,aAAAwC,E,4BCnBflG,EAAOC,QAAU","file":"js/chunk-233fded2.64fa5b81.js","sourcesContent":["module.exports = __webpack_public_path__ + \"img/fujian1.083cd8b7.png\";","import mod from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--11-oneOf-1-0!../../node_modules/css-loader/index.js??ref--11-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--11-oneOf-1-2!../../node_modules/stylus-loader/index.js??ref--11-oneOf-1-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./workorder_detail.vue?vue&type=style&index=0&id=1f126a3f&lang=stylus&scoped=true&\"; export default mod; export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--11-oneOf-1-0!../../node_modules/css-loader/index.js??ref--11-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--11-oneOf-1-2!../../node_modules/stylus-loader/index.js??ref--11-oneOf-1-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./workorder_detail.vue?vue&type=style&index=0&id=1f126a3f&lang=stylus&scoped=true&\"","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"container\"},[(_vm.isShowHeader)?_c('mt-header',{attrs:{\"fixed\":\"\",\"title\":\"工单详细\"}},[_c('div',{attrs:{\"slot\":\"left\"},slot:\"left\"},[_c('mt-button',{attrs:{\"icon\":\"back\"},on:{\"click\":function($event){return _vm.$router.go(-1)}}})],1),(_vm.workorder.status != 3)?_c('mt-button',{attrs:{\"slot\":\"right\"},on:{\"click\":function($event){return _vm.close()}},slot:\"right\"},[_c('span',[_vm._v(\"关闭工单\")])]):_c('mt-button',{attrs:{\"slot\":\"right\"},on:{\"click\":function($event){return _vm.del()}},slot:\"right\"},[_c('span',[_vm._v(\"删除\")])])],1):_vm._e(),_c('div',{staticClass:\"content\",class:{'hide-header': !_vm.isShowHeader}},[_c('div',{staticClass:\"head\"},[_c('div',{staticClass:\"con\"},[_c('span',[_vm._v(\"标题:\")]),_c('span',[_vm._v(_vm._s(_vm.workorder.title))])]),_c('div',{staticClass:\"con\"},[_c('span',[_vm._v(\"内容:\")]),_c('span',{domProps:{\"innerHTML\":_vm._s(_vm.workorder.content)}})]),_c('div',{staticClass:\"con\"},[_c('span',[_vm._v(\"电话:\")]),_c('span',[_vm._v(_vm._s(_vm.workorder.phone || '未预留电话号码'))])]),_c('div',{staticClass:\"con\"},[_c('span',[_vm._v(\"邮箱:\")]),_c('span',[_vm._v(_vm._s(_vm.workorder.email || '未预留邮箱'))])]),_c('div',{staticClass:\"con\"},[_c('span',[_vm._v(\"时间:\")]),_c('span',[_vm._v(_vm._s(_vm.$formatDate(_vm.workorder.create_at)))])]),_c('div',{staticClass:\"con\"},[_c('span',[_vm._v(\"状态:\")]),_c('span',[(_vm.workorder.status == 1)?_c('i',{staticStyle:{\"color\":\"#8bc34a\"}},[_vm._v(\"已回复\")]):_vm._e(),(_vm.workorder.status == 3)?_c('i',{staticStyle:{\"color\":\"#ccc\"}},[_vm._v(\"已结束\")]):_vm._e(),(_vm.workorder.status == 0)?_c('i',{staticStyle:{\"color\":\"#FF9800\"}},[_vm._v(\"待处理\")]):_vm._e(),(_vm.workorder.status == 2)?_c('i',{staticStyle:{\"color\":\"#FF9800\"}},[_vm._v(\"待回复\")]):_vm._e()])])]),_c('div',{staticClass:\"comments\"},[(_vm.comments.length <= 0)?_c('div',{staticClass:\"no-data\"},[_vm._v(\"暂无回复内容,请您耐心等待~\")]):_vm._l((_vm.comments),function(item,index){return [_c('div',{key:index,staticClass:\"item\"},[_c('div',{staticClass:\"avatar\"},[(item.aid == 0)?_c('img',{attrs:{\"src\":_vm.userInfo.avatar || 'http://qiniu.cmp520.com/avatar_degault_3.png',\"alt\":\"\"}}):_c('img',{attrs:{\"src\":item.a_avatar || 'http://qiniu.cmp520.com/avatar_degault_3.png',\"alt\":\"\"}})]),_c('div',{staticClass:\"right\"},[(item.aid == 0)?_c('div',{staticClass:\"nickname\"},[_vm._v(\"我\")]):_c('div',{staticClass:\"nickname\"},[_vm._v(_vm._s(item.a_nickname))]),_c('div',{staticClass:\"detail\",domProps:{\"innerHTML\":_vm._s(item.content)}}),_c('div',{staticClass:\"date\"},[_vm._v(_vm._s(_vm.$formatDate(item.create_at)))])])])]}),(_vm.workorder.status == 3)?_c('div',{staticClass:\"workorder-close\"},[_vm._v(\"工单已结束~\")]):_vm._e()],2),(_vm.request.source != '' || _vm.isShowUploadLoading)?_c('div',{staticClass:\"file-view\"},[(_vm.isShowUploadLoading)?_c('span',[_c('img',{attrs:{\"src\":require(\"./../assets/loading.gif\"),\"alt\":\"\"}}),_c('i',[_vm._v(\"上传中~\")])]):_c('span',[_c('img',{attrs:{\"src\":require(\"./../assets/fujian1.png\"),\"alt\":\"\"}}),_c('i',[_vm._v(\"你已成功添加附件,重新上传可替换~\")])])]):_vm._e(),(_vm.workorder.status != 3)?_c('div',{staticClass:\"input-form\"},[_c('textarea',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.request.content),expression:\"request.content\"}],attrs:{\"placeholder\":\"请输入内容~\"},domProps:{\"value\":(_vm.request.content)},on:{\"blur\":function($event){return _vm.inputBlur()},\"input\":function($event){if($event.target.composing){ return; }_vm.$set(_vm.request, \"content\", $event.target.value)}}}),_c('span',{staticClass:\"icon-btn\"},[_c('input',{attrs:{\"title\":\"添加附件\",\"type\":\"file\",\"onclick\":\"this.value = null\"},on:{\"change\":_vm.uploadFile}})]),_c('span',{staticClass:\"sub-btn\",on:{\"click\":function($event){return _vm.reply()}}},[_vm._v(\"提交\")])]):_vm._e()])],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n <div class=\"container\">\n <mt-header v-if=\"isShowHeader\" fixed title=\"工单详细\">\n <div slot=\"left\">\n <mt-button @click=\"$router.go(-1)\" icon=\"back\"></mt-button>\n </div>\n <mt-button @click=\"close()\" v-if=\"workorder.status != 3\" slot=\"right\">\n <span>关闭工单</span>\n </mt-button>\n <mt-button @click=\"del()\" v-else slot=\"right\">\n <span>删除</span>\n </mt-button>\n </mt-header>\n <div class=\"content\" :class=\"{'hide-header': !isShowHeader}\">\n <div class=\"head\">\n <div class=\"con\">\n <span>标题:</span>\n <span>{{workorder.title}}</span>\n </div>\n <div class=\"con\">\n <span>内容:</span>\n <span v-html=\"workorder.content\"></span>\n </div>\n <div class=\"con\">\n <span>电话:</span>\n <span>{{workorder.phone || '未预留电话号码'}}</span>\n </div>\n <div class=\"con\">\n <span>邮箱:</span>\n <span>{{workorder.email || '未预留邮箱'}}</span>\n </div>\n <div class=\"con\">\n <span>时间:</span>\n <span>{{$formatDate(workorder.create_at)}}</span>\n </div>\n <div class=\"con\">\n <span>状态:</span>\n <span>\n <i v-if=\"workorder.status == 1\" style=\"color:#8bc34a;\">已回复</i>\n <i v-if=\"workorder.status == 3\" style=\"color:#ccc\">已结束</i>\n <i v-if=\"workorder.status == 0\" style=\"color:#FF9800\">待处理</i>\n <i v-if=\"workorder.status == 2\" style=\"color:#FF9800\">待回复</i>\n </span>\n </div>\n </div>\n <div class=\"comments\">\n <div class=\"no-data\" v-if=\"comments.length <= 0\">暂无回复内容,请您耐心等待~</div>\n <template v-else v-for=\"(item,index) in comments\">\n <div :key=\"index\" class=\"item\">\n <div class=\"avatar\">\n <img\n v-if=\"item.aid == 0\"\n :src=\"userInfo.avatar || 'http://qiniu.cmp520.com/avatar_degault_3.png'\"\n alt\n />\n <img v-else :src=\"item.a_avatar || 'http://qiniu.cmp520.com/avatar_degault_3.png'\" alt />\n </div>\n <div class=\"right\">\n <div class=\"nickname\" v-if=\"item.aid == 0\">我</div>\n <div class=\"nickname\" v-else>{{item.a_nickname}}</div>\n <div class=\"detail\" v-html=\"item.content\"></div>\n <div class=\"date\">{{$formatDate(item.create_at)}}</div>\n </div>\n </div>\n </template>\n <div class=\"workorder-close\" v-if=\"workorder.status == 3\">工单已结束~</div>\n </div>\n <div class=\"file-view\" v-if=\"request.source != '' || isShowUploadLoading\">\n <span v-if=\"isShowUploadLoading\">\n <img src=\"./../assets/loading.gif\" alt />\n <i>上传中~</i>\n </span>\n <span v-else>\n <img src=\"./../assets/fujian1.png\" alt />\n <i>你已成功添加附件,重新上传可替换~</i>\n </span>\n </div>\n <div class=\"input-form\" v-if=\"workorder.status != 3\">\n <textarea v-model=\"request.content\" @blur=\"inputBlur()\" placeholder=\"请输入内容~\"></textarea>\n <span class=\"icon-btn\">\n <input title=\"添加附件\" type=\"file\" @change=\"uploadFile\" onclick=\"this.value = null\" />\n </span>\n <span class=\"sub-btn\" @click=\"reply()\">提交</span>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { mapGetters } from \"vuex\";\nimport { Toast, MessageBox } from \"mint-ui\";\nimport axios from \"axios\";\nexport default {\n name: \"workorder_detail\",\n components: {},\n data() {\n return {\n isShowUploadLoading: false,\n isSubmit: false,\n workorder: {},\n comments: [],\n fileType: \"\",\n request: {\n source: \"\",\n content: \"\"\n }\n };\n },\n computed: {\n ...mapGetters([\n \"isShowHeader\",\n \"workorders\",\n \"userInfo\",\n \"workorderTypes\",\n \"uploadToken\"\n ])\n },\n created() {\n document.title = \"工单详细\";\n const id = this.$route.params.id;\n this.$store.commit(\"updateState\", { isShowPageLoading: true });\n axios.all([this.getWorkOrder(id), this.getComments(id)]).then(\n axios.spread(() => {\n this.$store.commit(\"updateState\", { isShowPageLoading: false });\n })\n );\n },\n methods: {\n getWorkOrder(id) {\n return axios\n .get(\"/public/workorder/\" + id)\n .then(response => {\n this.workorder = response.data.data;\n setTimeout(()=>this.$previewRefresh(), 200)\n })\n .catch(error => {\n console.log(error);\n });\n },\n getComments(id) {\n return axios\n .get(\"/public/workorder/comments/\" + id)\n .then(response => {\n if (response.data.data == null) return;\n this.comments = response.data.data;\n setTimeout(()=>this.$previewRefresh(), 200)\n })\n .catch(error => {\n console.log(error);\n });\n },\n reply() {\n const content = this.request.content + this.request.source;\n if (content.trim() == \"\") {\n Toast({\n message: \"请输入内容~\"\n });\n return;\n }\n if (this.isSubmit) return;\n this.isSubmit = true;\n const wid = this.workorder.id;\n axios\n .post(\"/public/workorder/reply\", { wid, content })\n .then(response => {\n this.isSubmit = false\n console.log(response);\n this.getComments(wid);\n this.request = {\n source: \"\",\n content: \"\"\n };\n setTimeout(()=>{\n var sBoxHeight = document.querySelector(\".container\").clientHeight\n var sHeight = document.querySelector(\".content\").clientHeight\n document.querySelector(\".container\").scrollTop = sHeight - sBoxHeight + 20\n }, 500)\n })\n .catch(error => {\n this.isSubmit = false\n console.log(error);\n Toast({\n message: \"提交失败~\"\n });\n });\n },\n inputBlur() {\n setTimeout(() => {\n document.body.scrollTo = 0;\n window.scrollTo(0, 0);\n }, 100);\n },\n uploadFile(e) {\n var fileDom = e.target;\n var file = fileDom.files[0];\n this.isShowUploadLoading = true;\n const self = this;\n this.$uploadFile({\n file,\n mode: this.uploadToken.mode,\n // 七牛才会执行\n percent() {},\n success(src) {\n\n self.isShowUploadLoading = false;\n var html\n var fullPath = self.uploadToken.host + \"/\" + src;\n var fileType = src.substr(src.lastIndexOf(\".\") + 1);\n if (\"jpg,jpeg,png,JPG,JPEG,PNG\".indexOf(fileType) != -1) {\n html = \"<br><img style='max-width:45%' preview='1' src='\" + fullPath + \"' />\"\n }else{\n html = \"<br><img style='width:20px;height:20px;top:3px; right:3px;position: relative;' preview='1' src='http://qiniu.cmp520.com/fj.png' />\"\n html += \"<a target='_blank' style='color: #2e9dfc;' href='\"+fullPath+\"'>下载附件</a>\"\n }\n self.request.source = html\n Toast({\n message: \"上传成功~\"\n });\n },\n fail(e) {\n self.isShowUploadLoading = false;\n if (e.response && e.response.data) {\n Toast({\n message: e.response.data.message\n });\n return;\n }\n }\n });\n },\n close() {\n var wid = this.workorder.id;\n MessageBox.confirm(\"您确定关闭该工单吗?\").then(() => {\n axios\n .put(\"/public/workorder/close/\" + wid)\n .then(response => {\n console.log(response);\n Toast({\n message: \"工单已关闭~\"\n });\n this.getWorkOrder(wid);\n })\n .catch(error => {\n Toast({\n message: \"工单关闭失败~\"\n });\n console.log(error);\n });\n });\n },\n del() {\n var wid = this.workorder.id;\n MessageBox.confirm(\"您确定删除该工单吗?\").then(() => {\n axios\n .delete(\"/public/workorder/\" + wid)\n .then(response => {\n console.log(response);\n Toast({\n message: \"工单已删除~\"\n });\n setTimeout(() => this.$router.go(-1));\n })\n .catch(error => {\n Toast({\n message: \"工单关闭失败~\"\n });\n console.log(error);\n });\n });\n }\n }\n};\n</script>\n<style lang=\"stylus\" scoped>\n.container {\n height: 100vh;\n overflow: hidden;\n overflow-y: auto;\n}\n\n.content {\n padding-top: 50px;\n padding-bottom: 90px;\n\n .no-data {\n color: #666;\n font-size: 14px;\n }\n\n .workorder-close {\n text-align: center;\n color: #666;\n font-size: 14px;\n padding: 10px;\n }\n\n &.hide-header {\n padding-top: 0;\n }\n\n .head {\n margin: 0 10px;\n padding: 10px 0;\n border-bottom: 1px solid rgba(158, 158, 158, 0.13);\n\n .con {\n font-size: 15px;\n color: #333;\n display: flex;\n margin-bottom: 8px;\n\n span {\n flex-flow: 1;\n }\n\n span:first-child {\n flex-flow: 0;\n flex-shrink: 0;\n width: 45px;\n }\n\n i {\n font-style: normal;\n }\n }\n }\n\n .comments {\n padding: 10px;\n\n .item {\n display: flex;\n\n .avatar {\n padding-top: 10px;\n\n img {\n width: 30px;\n height: 30px;\n border-radius: 100px;\n display: block;\n }\n\n border-bottom: 1px solid rgba(158, 158, 158, 0.13);\n }\n\n .right {\n padding: 10px 5px;\n flex-grow: 1;\n border-bottom: 1px solid rgba(158, 158, 158, 0.13);\n\n .nickname {\n font-size: 15px;\n color: #333;\n }\n\n .detail {\n font-size: 15px;\n color: #333;\n margin-top: 5px;\n }\n\n .date {\n color: #999;\n font-size: 14px;\n margin-top: 5px;\n }\n }\n\n &:last-child {\n .right, .avatar {\n border-bottom: 0;\n }\n }\n }\n }\n\n .file-view {\n position: fixed;\n bottom: 80px;\n left: 0;\n right: 0;\n padding: 5px 10px;\n margin: 0 auto;\n font-size: 13px;\n color: #8bc34a;\n\n span {\n display: flex;\n align-content: center;\n align-items: center;\n\n img {\n width: 20px;\n height: 20px;\n }\n\n i {\n font-style: normal;\n margin-left: 5px;\n }\n }\n }\n\n .input-form {\n position: fixed;\n bottom: 0;\n left: 0;\n right: 0;\n margin: 0 auto;\n width: 100%;\n height: 80px;\n background-color: #fff;\n border-top: 1px solid rgba(158, 158, 158, 0.13);\n display: flex;\n justify-content: space-between;\n padding: 0 10px;\n box-sizing: border-box;\n align-content: center;\n align-items: center;\n\n textarea {\n height: 45px;\n flex-grow: 1;\n border-radius: 0;\n border: 0;\n color: #333;\n font-size: 14px;\n resize: none;\n }\n\n .icon-btn {\n background: url('./../assets/upload.png') center center no-repeat;\n background-size: 30px;\n width: 55px;\n height: 55px;\n overflow: hidden;\n\n input {\n display: block;\n width: 100%;\n height: 100%;\n font-size: 100px;\n opacity: 0;\n }\n }\n\n .sub-btn {\n display: block;\n width: 55px;\n height: 30px;\n color: #fff;\n line-height: 30px;\n text-align: center;\n border-radius: 3px;\n border: none;\n font-size: 14px;\n background: linear-gradient(to right, #26a2ff, #736cde);\n flex-shrink: 0;\n\n &:active {\n opacity: 0.8;\n }\n }\n }\n}\n</style>\n\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./workorder_detail.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./workorder_detail.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./workorder_detail.vue?vue&type=template&id=1f126a3f&scoped=true&\"\nimport script from \"./workorder_detail.vue?vue&type=script&lang=js&\"\nexport * from \"./workorder_detail.vue?vue&type=script&lang=js&\"\nimport style0 from \"./workorder_detail.vue?vue&type=style&index=0&id=1f126a3f&lang=stylus&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"1f126a3f\",\n null\n \n)\n\nexport default component.exports","module.exports = \"data:image/gif;base64,R0lGODlhEAAQAKIGAMLY8YSx5HOm4Mjc88/g9Ofw+v///wAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQFCgAGACwAAAAAEAAQAAADMGi6RbUwGjKIXCAA016PgRBElAVlG/RdLOO0X9nK61W39qvqiwz5Ls/rRqrggsdkAgAh+QQFCgAGACwCAAAABwAFAAADD2hqELAmiFBIYY4MAutdCQAh+QQFCgAGACwGAAAABwAFAAADD1hU1kaDOKMYCGAGEeYFCQAh+QQFCgAGACwKAAIABQAHAAADEFhUZjSkKdZqBQG0IELDQAIAIfkEBQoABgAsCgAGAAUABwAAAxBoVlRKgyjmlAIBqCDCzUoCACH5BAUKAAYALAYACgAHAAUAAAMPaGpFtYYMAgJgLogA610JACH5BAUKAAYALAIACgAHAAUAAAMPCAHWFiI4o1ghZZJB5i0JACH5BAUKAAYALAAABgAFAAcAAAMQCAFmIaEp1motpDQySMNFAgA7\""],"sourceRoot":""}
\ No newline at end of file
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-9ec58ea8"],{"0c51":function(t,e,o){},"269c":function(t,e,o){t.exports=o.p+"img/fujian1.083cd8b7.png"},4033:function(t,e,o){"use strict";o.r(e);var s=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"container"},[t.isShowHeader?s("mt-header",{attrs:{fixed:"",title:"工单详细"}},[s("div",{attrs:{slot:"left"},slot:"left"},[s("mt-button",{attrs:{icon:"back"},on:{click:function(e){return t.$router.go(-1)}}})],1),3!=t.workorder.status?s("mt-button",{attrs:{slot:"right"},on:{click:function(e){return t.close()}},slot:"right"},[s("span",[t._v("关闭工单")])]):s("mt-button",{attrs:{slot:"right"},on:{click:function(e){return t.del()}},slot:"right"},[s("span",[t._v("删除")])])],1):t._e(),s("div",{staticClass:"content",class:{"hide-header":!t.isShowHeader}},[s("div",{staticClass:"head"},[s("div",{staticClass:"con"},[s("span",[t._v("标题:")]),s("span",[t._v(t._s(t.workorder.title))])]),s("div",{staticClass:"con"},[s("span",[t._v("内容:")]),s("span",{domProps:{innerHTML:t._s(t.workorder.content)}})]),s("div",{staticClass:"con"},[s("span",[t._v("电话:")]),s("span",[t._v(t._s(t.workorder.phone||"未预留电话号码"))])]),s("div",{staticClass:"con"},[s("span",[t._v("邮箱:")]),s("span",[t._v(t._s(t.workorder.email||"未预留邮箱"))])]),s("div",{staticClass:"con"},[s("span",[t._v("时间:")]),s("span",[t._v(t._s(t.$formatDate(t.workorder.create_at)))])]),s("div",{staticClass:"con"},[s("span",[t._v("类型:")]),s("span",[t._v(t._s(t.typeName||"---"))])]),s("div",{staticClass:"con"},[s("span",[t._v("状态:")]),s("span",[1==t.workorder.status?s("i",{staticStyle:{color:"#8bc34a"}},[t._v("已回复")]):t._e(),3==t.workorder.status?s("i",{staticStyle:{color:"#ccc"}},[t._v("已结束")]):t._e(),0==t.workorder.status?s("i",{staticStyle:{color:"#FF9800"}},[t._v("待处理")]):t._e(),2==t.workorder.status?s("i",{staticStyle:{color:"#FF9800"}},[t._v("待回复")]):t._e()])])]),s("div",{staticClass:"comments"},[t.comments.length<=0?s("div",{staticClass:"no-data"},[t._v("暂无回复内容,请您耐心等待~")]):t._l(t.comments,(function(e,o){return[s("div",{key:o,staticClass:"item"},[s("div",{staticClass:"avatar"},[0==e.aid?s("img",{attrs:{src:t.userInfo.avatar||"http://qiniu.cmp520.com/avatar_degault_3.png",alt:""}}):s("img",{attrs:{src:e.a_avatar||"http://qiniu.cmp520.com/avatar_degault_3.png",alt:""}})]),s("div",{staticClass:"right"},[0==e.aid?s("div",{staticClass:"nickname"},[t._v("我")]):s("div",{staticClass:"nickname"},[t._v(t._s(e.a_nickname))]),s("div",{staticClass:"detail",domProps:{innerHTML:t._s(e.content)}}),s("div",{staticClass:"date"},[t._v(t._s(t.$formatDate(e.create_at)))])])])]})),3==t.workorder.status?s("div",{staticClass:"workorder-close"},[t._v("工单已结束~")]):t._e()],2),""!=t.request.source||t.isShowUploadLoading?s("div",{staticClass:"file-view"},[t.isShowUploadLoading?s("span",[s("img",{attrs:{src:o("cf1c"),alt:""}}),s("i",[t._v("上传中~")])]):s("span",[s("img",{attrs:{src:o("269c"),alt:""}}),s("i",[t._v("你已成功添加附件,重新上传可替换~")])])]):t._e(),3!=t.workorder.status?s("div",{staticClass:"input-form"},[s("textarea",{directives:[{name:"model",rawName:"v-model",value:t.request.content,expression:"request.content"}],attrs:{placeholder:"请输入内容~"},domProps:{value:t.request.content},on:{blur:function(e){return t.inputBlur()},input:function(e){e.target.composing||t.$set(t.request,"content",e.target.value)}}}),s("span",{staticClass:"icon-btn"},[s("input",{attrs:{title:"添加附件",type:"file",onclick:"this.value = null"},on:{change:t.uploadFile}})]),s("span",{staticClass:"sub-btn",on:{click:function(e){return t.reply()}}},[t._v("提交")])]):t._e()])],1)},r=[],n=(o("8e6e"),o("ac6a"),o("456d"),o("bd86")),a=o("2f62"),i=o("76a0"),c=o("bc3a"),l=o.n(c);function u(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),o.push.apply(o,s)}return o}function d(t){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?u(Object(o),!0).forEach((function(e){Object(n["a"])(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):u(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}var p={name:"workorder_detail",components:{},data:function(){return{isShowUploadLoading:!1,isSubmit:!1,workorder:{},comments:[],fileType:"",request:{source:"",content:""}}},computed:d({},Object(a["b"])(["isShowHeader","workorders","userInfo","workorderTypes","uploadToken"]),{typeName:function(){var t=this;try{return this.workorderTypes.filter((function(e){return e.id==t.workorder.tid}))[0].title}catch(e){return console.log(e),""}}}),created:function(){var t=this;document.title="工单详细";var e=this.$route.params.id;this.$store.commit("updateState",{isShowPageLoading:!0}),l.a.all([this.getWorkOrder(e),this.getComments(e)]).then(l.a.spread((function(){t.$store.commit("updateState",{isShowPageLoading:!1})})))},methods:{getWorkOrder:function(t){var e=this;return l.a.get("/public/workorder/"+t).then((function(t){e.workorder=t.data.data,setTimeout((function(){return e.$previewRefresh()}),200)})).catch((function(t){console.log(t)}))},getComments:function(t){var e=this;return l.a.get("/public/workorder/comments/"+t).then((function(t){null!=t.data.data&&(e.comments=t.data.data,setTimeout((function(){return e.$previewRefresh()}),200))})).catch((function(t){console.log(t)}))},reply:function(){var t=this,e=this.request.content+this.request.source;if(""!=e.trim()){if(!this.isSubmit){this.isSubmit=!0;var o=this.workorder.id;l.a.post("/public/workorder/reply",{wid:o,content:e}).then((function(e){t.isSubmit=!1,console.log(e),t.getComments(o),t.request={source:"",content:""},setTimeout((function(){var t=document.querySelector(".container").clientHeight,e=document.querySelector(".content").clientHeight;document.querySelector(".container").scrollTop=e-t+20}),500)})).catch((function(e){t.isSubmit=!1,console.log(e),Object(i["Toast"])({message:"提交失败~"})}))}}else Object(i["Toast"])({message:"请输入内容~"})},inputBlur:function(){setTimeout((function(){document.body.scrollTo=0,window.scrollTo(0,0)}),100)},uploadFile:function(t){var e=t.target,o=e.files[0];this.isShowUploadLoading=!0;var s=this;this.$uploadFile({file:o,mode:this.uploadToken.mode,percent:function(){},success:function(t){var e;s.isShowUploadLoading=!1;var o=s.uploadToken.host+"/"+t,r=t.substr(t.lastIndexOf(".")+1);-1!="jpg,jpeg,png,JPG,JPEG,PNG".indexOf(r)?e="<br><img style='max-width:45%' preview='1' src='"+o+"' />":(e="<br><img style='width:20px;height:20px;top:3px; right:3px;position: relative;' preview='1' src='http://qiniu.cmp520.com/fj.png' />",e+="<a target='_blank' style='color: #2e9dfc;' href='"+o+"'>下载附件</a>"),s.request.source=e,Object(i["Toast"])({message:"上传成功~"})},fail:function(t){s.isShowUploadLoading=!1,t.response&&t.response.data&&Object(i["Toast"])({message:t.response.data.message})}})},close:function(){var t=this,e=this.workorder.id;i["MessageBox"].confirm("您确定关闭该工单吗?").then((function(){l.a.put("/public/workorder/close/"+e).then((function(o){console.log(o),Object(i["Toast"])({message:"工单已关闭~"}),t.getWorkOrder(e)})).catch((function(t){Object(i["Toast"])({message:"工单关闭失败~"}),console.log(t)}))}))},del:function(){var t=this,e=this.workorder.id;i["MessageBox"].confirm("您确定删除该工单吗?").then((function(){l.a.delete("/public/workorder/"+e).then((function(e){console.log(e),Object(i["Toast"])({message:"工单已删除~"}),setTimeout((function(){return t.$router.go(-1)}))})).catch((function(t){Object(i["Toast"])({message:"工单关闭失败~"}),console.log(t)}))}))}}},A=p,m=(o("da20"),o("2877")),g=Object(m["a"])(A,s,r,!1,null,"ac0a42f8",null);e["default"]=g.exports},cf1c:function(t,e){t.exports="data:image/gif;base64,R0lGODlhEAAQAKIGAMLY8YSx5HOm4Mjc88/g9Ofw+v///wAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQFCgAGACwAAAAAEAAQAAADMGi6RbUwGjKIXCAA016PgRBElAVlG/RdLOO0X9nK61W39qvqiwz5Ls/rRqrggsdkAgAh+QQFCgAGACwCAAAABwAFAAADD2hqELAmiFBIYY4MAutdCQAh+QQFCgAGACwGAAAABwAFAAADD1hU1kaDOKMYCGAGEeYFCQAh+QQFCgAGACwKAAIABQAHAAADEFhUZjSkKdZqBQG0IELDQAIAIfkEBQoABgAsCgAGAAUABwAAAxBoVlRKgyjmlAIBqCDCzUoCACH5BAUKAAYALAYACgAHAAUAAAMPaGpFtYYMAgJgLogA610JACH5BAUKAAYALAIACgAHAAUAAAMPCAHWFiI4o1ghZZJB5i0JACH5BAUKAAYALAAABgAFAAcAAAMQCAFmIaEp1motpDQySMNFAgA7"},da20:function(t,e,o){"use strict";var s=o("0c51"),r=o.n(s);r.a}}]);
//# sourceMappingURL=chunk-9ec58ea8.59b56ff9.js.map
\ No newline at end of file
{"version":3,"sources":["webpack:///./src/assets/fujian1.png","webpack:///./src/views/workorder_detail.vue?05c4","webpack:///src/views/workorder_detail.vue","webpack:///./src/views/workorder_detail.vue?9869","webpack:///./src/views/workorder_detail.vue","webpack:///./src/assets/loading.gif","webpack:///./src/views/workorder_detail.vue?c7ba"],"names":["module","exports","render","_vm","this","_h","$createElement","_c","_self","staticClass","attrs","slot","on","$event","$router","go","workorder","status","close","_v","del","_e","class","isShowHeader","_s","title","domProps","content","phone","email","$formatDate","create_at","typeName","staticStyle","comments","length","_l","item","index","key","aid","userInfo","avatar","a_avatar","a_nickname","request","source","isShowUploadLoading","directives","name","rawName","value","expression","inputBlur","target","composing","$set","uploadFile","reply","staticRenderFns","components","data","isSubmit","fileType","computed","console","log","e","created","document","$store","commit","methods","getWorkOrder","getComments","trim","message","setTimeout","body","scrollTo","window","fileDom","file","files","$uploadFile","mode","uploadToken","percent","success","html","self","fullPath","host","src","substr","lastIndexOf","indexOf","fail","response","wid","id","component"],"mappings":"8HAAAA,EAAOC,QAAU,IAA0B,4B,yCCA3C,IAAIC,EAAS,WAAa,IAAIC,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,UAAY/B,EAAE+B,SAASrC,MAC3B,OAAZ,WAAY,CAAZ,CACce,QAAST,EAAE+B,SAASrC,KAAKe,cAOnC1D,MAvGJ,WAuGA,WACUiF,EAAM/F,KAAKY,UAAUoF,GACzB,EAAN,qDACQ,EAAR,EACA,kCACA,kBACU,QAAV,OACU,OAAV,WAAU,CAAV,CACY,QAAZ,WAEU,EAAV,mBAEA,mBACU,OAAV,WAAU,CAAV,CACY,QAAZ,YAEU,QAAV,cAIIhF,IA3HJ,WA2HA,WACU+E,EAAM/F,KAAKY,UAAUoF,GACzB,EAAN,qDACQ,EAAR,EACA,+BACA,kBACU,QAAV,OACU,OAAV,WAAU,CAAV,CACY,QAAZ,WAEU,YAAV,WAAY,OAAZ,uBAEA,mBACU,OAAV,WAAU,CAAV,CACY,QAAZ,YAEU,QAAV,gBCrR6X,I,wBCQzXC,EAAY,eACd,EACAnG,EACAyD,GACA,EACA,KACA,WACA,MAIa,aAAA0C,E,4BCnBfrG,EAAOC,QAAU,shB,kCCAjB,yBAA+iB,EAAG","file":"js/chunk-9ec58ea8.59b56ff9.js","sourcesContent":["module.exports = __webpack_public_path__ + \"img/fujian1.083cd8b7.png\";","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"container\"},[(_vm.isShowHeader)?_c('mt-header',{attrs:{\"fixed\":\"\",\"title\":\"工单详细\"}},[_c('div',{attrs:{\"slot\":\"left\"},slot:\"left\"},[_c('mt-button',{attrs:{\"icon\":\"back\"},on:{\"click\":function($event){return _vm.$router.go(-1)}}})],1),(_vm.workorder.status != 3)?_c('mt-button',{attrs:{\"slot\":\"right\"},on:{\"click\":function($event){return _vm.close()}},slot:\"right\"},[_c('span',[_vm._v(\"关闭工单\")])]):_c('mt-button',{attrs:{\"slot\":\"right\"},on:{\"click\":function($event){return _vm.del()}},slot:\"right\"},[_c('span',[_vm._v(\"删除\")])])],1):_vm._e(),_c('div',{staticClass:\"content\",class:{'hide-header': !_vm.isShowHeader}},[_c('div',{staticClass:\"head\"},[_c('div',{staticClass:\"con\"},[_c('span',[_vm._v(\"标题:\")]),_c('span',[_vm._v(_vm._s(_vm.workorder.title))])]),_c('div',{staticClass:\"con\"},[_c('span',[_vm._v(\"内容:\")]),_c('span',{domProps:{\"innerHTML\":_vm._s(_vm.workorder.content)}})]),_c('div',{staticClass:\"con\"},[_c('span',[_vm._v(\"电话:\")]),_c('span',[_vm._v(_vm._s(_vm.workorder.phone || '未预留电话号码'))])]),_c('div',{staticClass:\"con\"},[_c('span',[_vm._v(\"邮箱:\")]),_c('span',[_vm._v(_vm._s(_vm.workorder.email || '未预留邮箱'))])]),_c('div',{staticClass:\"con\"},[_c('span',[_vm._v(\"时间:\")]),_c('span',[_vm._v(_vm._s(_vm.$formatDate(_vm.workorder.create_at)))])]),_c('div',{staticClass:\"con\"},[_c('span',[_vm._v(\"类型:\")]),_c('span',[_vm._v(_vm._s(_vm.typeName || \"---\"))])]),_c('div',{staticClass:\"con\"},[_c('span',[_vm._v(\"状态:\")]),_c('span',[(_vm.workorder.status == 1)?_c('i',{staticStyle:{\"color\":\"#8bc34a\"}},[_vm._v(\"已回复\")]):_vm._e(),(_vm.workorder.status == 3)?_c('i',{staticStyle:{\"color\":\"#ccc\"}},[_vm._v(\"已结束\")]):_vm._e(),(_vm.workorder.status == 0)?_c('i',{staticStyle:{\"color\":\"#FF9800\"}},[_vm._v(\"待处理\")]):_vm._e(),(_vm.workorder.status == 2)?_c('i',{staticStyle:{\"color\":\"#FF9800\"}},[_vm._v(\"待回复\")]):_vm._e()])])]),_c('div',{staticClass:\"comments\"},[(_vm.comments.length <= 0)?_c('div',{staticClass:\"no-data\"},[_vm._v(\"暂无回复内容,请您耐心等待~\")]):_vm._l((_vm.comments),function(item,index){return [_c('div',{key:index,staticClass:\"item\"},[_c('div',{staticClass:\"avatar\"},[(item.aid == 0)?_c('img',{attrs:{\"src\":_vm.userInfo.avatar || 'http://qiniu.cmp520.com/avatar_degault_3.png',\"alt\":\"\"}}):_c('img',{attrs:{\"src\":item.a_avatar || 'http://qiniu.cmp520.com/avatar_degault_3.png',\"alt\":\"\"}})]),_c('div',{staticClass:\"right\"},[(item.aid == 0)?_c('div',{staticClass:\"nickname\"},[_vm._v(\"我\")]):_c('div',{staticClass:\"nickname\"},[_vm._v(_vm._s(item.a_nickname))]),_c('div',{staticClass:\"detail\",domProps:{\"innerHTML\":_vm._s(item.content)}}),_c('div',{staticClass:\"date\"},[_vm._v(_vm._s(_vm.$formatDate(item.create_at)))])])])]}),(_vm.workorder.status == 3)?_c('div',{staticClass:\"workorder-close\"},[_vm._v(\"工单已结束~\")]):_vm._e()],2),(_vm.request.source != '' || _vm.isShowUploadLoading)?_c('div',{staticClass:\"file-view\"},[(_vm.isShowUploadLoading)?_c('span',[_c('img',{attrs:{\"src\":require(\"./../assets/loading.gif\"),\"alt\":\"\"}}),_c('i',[_vm._v(\"上传中~\")])]):_c('span',[_c('img',{attrs:{\"src\":require(\"./../assets/fujian1.png\"),\"alt\":\"\"}}),_c('i',[_vm._v(\"你已成功添加附件,重新上传可替换~\")])])]):_vm._e(),(_vm.workorder.status != 3)?_c('div',{staticClass:\"input-form\"},[_c('textarea',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.request.content),expression:\"request.content\"}],attrs:{\"placeholder\":\"请输入内容~\"},domProps:{\"value\":(_vm.request.content)},on:{\"blur\":function($event){return _vm.inputBlur()},\"input\":function($event){if($event.target.composing){ return; }_vm.$set(_vm.request, \"content\", $event.target.value)}}}),_c('span',{staticClass:\"icon-btn\"},[_c('input',{attrs:{\"title\":\"添加附件\",\"type\":\"file\",\"onclick\":\"this.value = null\"},on:{\"change\":_vm.uploadFile}})]),_c('span',{staticClass:\"sub-btn\",on:{\"click\":function($event){return _vm.reply()}}},[_vm._v(\"提交\")])]):_vm._e()])],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n <div class=\"container\">\n <mt-header v-if=\"isShowHeader\" fixed title=\"工单详细\">\n <div slot=\"left\">\n <mt-button @click=\"$router.go(-1)\" icon=\"back\"></mt-button>\n </div>\n <mt-button @click=\"close()\" v-if=\"workorder.status != 3\" slot=\"right\">\n <span>关闭工单</span>\n </mt-button>\n <mt-button @click=\"del()\" v-else slot=\"right\">\n <span>删除</span>\n </mt-button>\n </mt-header>\n <div class=\"content\" :class=\"{'hide-header': !isShowHeader}\">\n <div class=\"head\">\n <div class=\"con\">\n <span>标题:</span>\n <span>{{workorder.title}}</span>\n </div>\n <div class=\"con\">\n <span>内容:</span>\n <span v-html=\"workorder.content\"></span>\n </div>\n <div class=\"con\">\n <span>电话:</span>\n <span>{{workorder.phone || '未预留电话号码'}}</span>\n </div>\n <div class=\"con\">\n <span>邮箱:</span>\n <span>{{workorder.email || '未预留邮箱'}}</span>\n </div>\n <div class=\"con\">\n <span>时间:</span>\n <span>{{$formatDate(workorder.create_at)}}</span>\n </div>\n <div class=\"con\">\n <span>类型:</span>\n <span>{{typeName || \"---\"}}</span>\n </div>\n <div class=\"con\">\n <span>状态:</span>\n <span>\n <i v-if=\"workorder.status == 1\" style=\"color:#8bc34a;\">已回复</i>\n <i v-if=\"workorder.status == 3\" style=\"color:#ccc\">已结束</i>\n <i v-if=\"workorder.status == 0\" style=\"color:#FF9800\">待处理</i>\n <i v-if=\"workorder.status == 2\" style=\"color:#FF9800\">待回复</i>\n </span>\n </div>\n </div>\n <div class=\"comments\">\n <div class=\"no-data\" v-if=\"comments.length <= 0\">暂无回复内容,请您耐心等待~</div>\n <template v-else v-for=\"(item,index) in comments\">\n <div :key=\"index\" class=\"item\">\n <div class=\"avatar\">\n <img\n v-if=\"item.aid == 0\"\n :src=\"userInfo.avatar || 'http://qiniu.cmp520.com/avatar_degault_3.png'\"\n alt\n />\n <img v-else :src=\"item.a_avatar || 'http://qiniu.cmp520.com/avatar_degault_3.png'\" alt />\n </div>\n <div class=\"right\">\n <div class=\"nickname\" v-if=\"item.aid == 0\">我</div>\n <div class=\"nickname\" v-else>{{item.a_nickname}}</div>\n <div class=\"detail\" v-html=\"item.content\"></div>\n <div class=\"date\">{{$formatDate(item.create_at)}}</div>\n </div>\n </div>\n </template>\n <div class=\"workorder-close\" v-if=\"workorder.status == 3\">工单已结束~</div>\n </div>\n <div class=\"file-view\" v-if=\"request.source != '' || isShowUploadLoading\">\n <span v-if=\"isShowUploadLoading\">\n <img src=\"./../assets/loading.gif\" alt />\n <i>上传中~</i>\n </span>\n <span v-else>\n <img src=\"./../assets/fujian1.png\" alt />\n <i>你已成功添加附件,重新上传可替换~</i>\n </span>\n </div>\n <div class=\"input-form\" v-if=\"workorder.status != 3\">\n <textarea v-model=\"request.content\" @blur=\"inputBlur()\" placeholder=\"请输入内容~\"></textarea>\n <span class=\"icon-btn\">\n <input title=\"添加附件\" type=\"file\" @change=\"uploadFile\" onclick=\"this.value = null\" />\n </span>\n <span class=\"sub-btn\" @click=\"reply()\">提交</span>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { mapGetters } from \"vuex\";\nimport { Toast, MessageBox } from \"mint-ui\";\nimport axios from \"axios\";\nexport default {\n name: \"workorder_detail\",\n components: {},\n data() {\n return {\n isShowUploadLoading: false,\n isSubmit: false,\n workorder: {},\n comments: [],\n fileType: \"\",\n request: {\n source: \"\",\n content: \"\"\n }\n };\n },\n computed: {\n ...mapGetters([\n \"isShowHeader\",\n \"workorders\",\n \"userInfo\",\n \"workorderTypes\",\n \"uploadToken\"\n ]),\n typeName(){\n try{\n return this.workorderTypes.filter((i)=>i.id == this.workorder.tid)[0].title\n }catch(e){\n console.log(e)\n return \"\"\n }\n }\n },\n created() {\n document.title = \"工单详细\";\n const id = this.$route.params.id;\n this.$store.commit(\"updateState\", { isShowPageLoading: true });\n axios.all([this.getWorkOrder(id), this.getComments(id)]).then(\n axios.spread(() => {\n this.$store.commit(\"updateState\", { isShowPageLoading: false });\n })\n );\n },\n methods: {\n getWorkOrder(id) {\n return axios\n .get(\"/public/workorder/\" + id)\n .then(response => {\n this.workorder = response.data.data;\n setTimeout(()=>this.$previewRefresh(), 200)\n })\n .catch(error => {\n console.log(error);\n });\n },\n getComments(id) {\n return axios\n .get(\"/public/workorder/comments/\" + id)\n .then(response => {\n if (response.data.data == null) return;\n this.comments = response.data.data;\n setTimeout(()=>this.$previewRefresh(), 200)\n })\n .catch(error => {\n console.log(error);\n });\n },\n reply() {\n const content = this.request.content + this.request.source;\n if (content.trim() == \"\") {\n Toast({\n message: \"请输入内容~\"\n });\n return;\n }\n if (this.isSubmit) return;\n this.isSubmit = true;\n const wid = this.workorder.id;\n axios\n .post(\"/public/workorder/reply\", { wid, content })\n .then(response => {\n this.isSubmit = false\n console.log(response);\n this.getComments(wid);\n this.request = {\n source: \"\",\n content: \"\"\n };\n setTimeout(()=>{\n var sBoxHeight = document.querySelector(\".container\").clientHeight\n var sHeight = document.querySelector(\".content\").clientHeight\n document.querySelector(\".container\").scrollTop = sHeight - sBoxHeight + 20\n }, 500)\n })\n .catch(error => {\n this.isSubmit = false\n console.log(error);\n Toast({\n message: \"提交失败~\"\n });\n });\n },\n inputBlur() {\n setTimeout(() => {\n document.body.scrollTo = 0;\n window.scrollTo(0, 0);\n }, 100);\n },\n uploadFile(e) {\n var fileDom = e.target;\n var file = fileDom.files[0];\n this.isShowUploadLoading = true;\n const self = this;\n this.$uploadFile({\n file,\n mode: this.uploadToken.mode,\n // 七牛才会执行\n percent() {},\n success(src) {\n\n self.isShowUploadLoading = false;\n var html\n var fullPath = self.uploadToken.host + \"/\" + src;\n var fileType = src.substr(src.lastIndexOf(\".\") + 1);\n if (\"jpg,jpeg,png,JPG,JPEG,PNG\".indexOf(fileType) != -1) {\n html = \"<br><img style='max-width:45%' preview='1' src='\" + fullPath + \"' />\"\n }else{\n html = \"<br><img style='width:20px;height:20px;top:3px; right:3px;position: relative;' preview='1' src='http://qiniu.cmp520.com/fj.png' />\"\n html += \"<a target='_blank' style='color: #2e9dfc;' href='\"+fullPath+\"'>下载附件</a>\"\n }\n self.request.source = html\n Toast({\n message: \"上传成功~\"\n });\n },\n fail(e) {\n self.isShowUploadLoading = false;\n if (e.response && e.response.data) {\n Toast({\n message: e.response.data.message\n });\n return;\n }\n }\n });\n },\n close() {\n var wid = this.workorder.id;\n MessageBox.confirm(\"您确定关闭该工单吗?\").then(() => {\n axios\n .put(\"/public/workorder/close/\" + wid)\n .then(response => {\n console.log(response);\n Toast({\n message: \"工单已关闭~\"\n });\n this.getWorkOrder(wid);\n })\n .catch(error => {\n Toast({\n message: \"工单关闭失败~\"\n });\n console.log(error);\n });\n });\n },\n del() {\n var wid = this.workorder.id;\n MessageBox.confirm(\"您确定删除该工单吗?\").then(() => {\n axios\n .delete(\"/public/workorder/\" + wid)\n .then(response => {\n console.log(response);\n Toast({\n message: \"工单已删除~\"\n });\n setTimeout(() => this.$router.go(-1));\n })\n .catch(error => {\n Toast({\n message: \"工单关闭失败~\"\n });\n console.log(error);\n });\n });\n }\n }\n};\n</script>\n<style lang=\"stylus\" scoped>\n.container {\n height: 100vh;\n overflow: hidden;\n overflow-y: auto;\n}\n\n.content {\n padding-top: 50px;\n padding-bottom: 90px;\n\n .no-data {\n color: #666;\n font-size: 14px;\n }\n\n .workorder-close {\n text-align: center;\n color: #666;\n font-size: 14px;\n padding: 10px;\n }\n\n &.hide-header {\n padding-top: 0;\n }\n\n .head {\n margin: 0 10px;\n padding: 10px 0;\n border-bottom: 1px solid rgba(158, 158, 158, 0.13);\n\n .con {\n font-size: 15px;\n color: #333;\n display: flex;\n margin-bottom: 8px;\n\n span {\n flex-flow: 1;\n }\n\n span:first-child {\n flex-flow: 0;\n flex-shrink: 0;\n width: 45px;\n }\n\n i {\n font-style: normal;\n }\n }\n }\n\n .comments {\n padding: 10px;\n\n .item {\n display: flex;\n\n .avatar {\n padding-top: 10px;\n\n img {\n width: 30px;\n height: 30px;\n border-radius: 100px;\n display: block;\n }\n\n border-bottom: 1px solid rgba(158, 158, 158, 0.13);\n }\n\n .right {\n padding: 10px 5px;\n flex-grow: 1;\n border-bottom: 1px solid rgba(158, 158, 158, 0.13);\n\n .nickname {\n font-size: 15px;\n color: #333;\n }\n\n .detail {\n font-size: 15px;\n color: #333;\n margin-top: 5px;\n }\n\n .date {\n color: #999;\n font-size: 14px;\n margin-top: 5px;\n }\n }\n\n &:last-child {\n .right, .avatar {\n border-bottom: 0;\n }\n }\n }\n }\n\n .file-view {\n position: fixed;\n bottom: 80px;\n left: 0;\n right: 0;\n padding: 5px 10px;\n margin: 0 auto;\n font-size: 13px;\n color: #8bc34a;\n\n span {\n display: flex;\n align-content: center;\n align-items: center;\n\n img {\n width: 20px;\n height: 20px;\n }\n\n i {\n font-style: normal;\n margin-left: 5px;\n }\n }\n }\n\n .input-form {\n position: fixed;\n bottom: 0;\n left: 0;\n right: 0;\n margin: 0 auto;\n width: 100%;\n height: 80px;\n background-color: #fff;\n border-top: 1px solid rgba(158, 158, 158, 0.13);\n display: flex;\n justify-content: space-between;\n padding: 0 10px;\n box-sizing: border-box;\n align-content: center;\n align-items: center;\n\n textarea {\n height: 45px;\n flex-grow: 1;\n border-radius: 0;\n border: 0;\n color: #333;\n font-size: 14px;\n resize: none;\n }\n\n .icon-btn {\n background: url('./../assets/upload.png') center center no-repeat;\n background-size: 30px;\n width: 55px;\n height: 55px;\n overflow: hidden;\n\n input {\n display: block;\n width: 100%;\n height: 100%;\n font-size: 100px;\n opacity: 0;\n }\n }\n\n .sub-btn {\n display: block;\n width: 55px;\n height: 30px;\n color: #fff;\n line-height: 30px;\n text-align: center;\n border-radius: 3px;\n border: none;\n font-size: 14px;\n background: linear-gradient(to right, #26a2ff, #736cde);\n flex-shrink: 0;\n\n &:active {\n opacity: 0.8;\n }\n }\n }\n}\n</style>\n\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./workorder_detail.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./workorder_detail.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./workorder_detail.vue?vue&type=template&id=ac0a42f8&scoped=true&\"\nimport script from \"./workorder_detail.vue?vue&type=script&lang=js&\"\nexport * from \"./workorder_detail.vue?vue&type=script&lang=js&\"\nimport style0 from \"./workorder_detail.vue?vue&type=style&index=0&id=ac0a42f8&lang=stylus&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"ac0a42f8\",\n null\n \n)\n\nexport default component.exports","module.exports = \"data:image/gif;base64,R0lGODlhEAAQAKIGAMLY8YSx5HOm4Mjc88/g9Ofw+v///wAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQFCgAGACwAAAAAEAAQAAADMGi6RbUwGjKIXCAA016PgRBElAVlG/RdLOO0X9nK61W39qvqiwz5Ls/rRqrggsdkAgAh+QQFCgAGACwCAAAABwAFAAADD2hqELAmiFBIYY4MAutdCQAh+QQFCgAGACwGAAAABwAFAAADD1hU1kaDOKMYCGAGEeYFCQAh+QQFCgAGACwKAAIABQAHAAADEFhUZjSkKdZqBQG0IELDQAIAIfkEBQoABgAsCgAGAAUABwAAAxBoVlRKgyjmlAIBqCDCzUoCACH5BAUKAAYALAYACgAHAAUAAAMPaGpFtYYMAgJgLogA610JACH5BAUKAAYALAIACgAHAAUAAAMPCAHWFiI4o1ghZZJB5i0JACH5BAUKAAYALAAABgAFAAcAAAMQCAFmIaEp1motpDQySMNFAgA7\"","import mod from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--11-oneOf-1-0!../../node_modules/css-loader/index.js??ref--11-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--11-oneOf-1-2!../../node_modules/stylus-loader/index.js??ref--11-oneOf-1-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./workorder_detail.vue?vue&type=style&index=0&id=ac0a42f8&lang=stylus&scoped=true&\"; export default mod; export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--11-oneOf-1-0!../../node_modules/css-loader/index.js??ref--11-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--11-oneOf-1-2!../../node_modules/stylus-loader/index.js??ref--11-oneOf-1-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./workorder_detail.vue?vue&type=style&index=0&id=ac0a42f8&lang=stylus&scoped=true&\""],"sourceRoot":""}
\ No newline at end of file
......@@ -161,6 +161,7 @@ func routers(prefix string) *beego.Namespace {
beego.NSRouter("/types", &controllers.WorkOrderController{}, "get:GetWorkTypes"),
beego.NSRouter("/close", &controllers.WorkOrderController{}, "post:CloseWorkOrder"),
beego.NSRouter("/list", &controllers.WorkOrderController{}, "post:GetWorkOrders"),
beego.NSRouter("/counts", &controllers.WorkOrderController{}, "get:GetWorkOrderCounts"),
),
)
......
......@@ -3,6 +3,7 @@ package services
import (
"kefu_server/models"
"strconv"
"strings"
"time"
"github.com/astaxie/beego/logs"
......@@ -18,6 +19,7 @@ type WorkOrderRepositoryInterface interface {
Add(workOrder models.WorkOrder) (int64, error)
Delete(id int64) (int64, error)
Close(id int64, cid int64, remark string) (int64, error)
GetCounts() (models.WorkOrderCountDto, error)
}
// WorkOrderRepository struct
......@@ -62,10 +64,20 @@ func (r *WorkOrderRepository) GetUserWorkOrders(uid int64) ([]models.WorkOrder,
return workOrders, err
}
// GetCounts get WorkOrder counts
func (r *WorkOrderRepository) GetCounts() (models.WorkOrderCountDto, error) {
var workOrderCouns models.WorkOrderCountDto
err := r.o.Raw("SELECT * FROM ((SELECT count(*) AS status0 FROM work_order WHERE `status` = 0) w1,(SELECT count(*) AS status2 FROM work_order WHERE `status` = 2) w2,(SELECT count(*) AS status3 FROM work_order WHERE `status` = 3) w3,(SELECT count(*) AS delete_count FROM work_order WHERE `delete` = 1) w4)").QueryRow(&workOrderCouns)
if err != nil {
logs.Warn(" GetCounts get WorkOrder count", err)
}
return workOrderCouns, err
}
// GetWorkOrder get WorkOrder
func (r *WorkOrderRepository) GetWorkOrder(id int64) (models.WorkOrderDto, error) {
var workOrder models.WorkOrderDto
err := r.o.Raw("SELECT * FROM (SELECT w.*,w.id AS i_d, w.uid AS u_i_d,u.nickname AS u_nickname FROM work_order w LEFT JOIN (SELECT * FROM `user`) u ON w.uid = u.id) w WHERE w.id = ? AND w.`delete` = 0", id).QueryRow(&workOrder)
err := r.o.Raw("SELECT * FROM (SELECT w.*,w.id AS i_d, w.uid AS u_i_d,u.nickname AS u_nickname FROM work_order w LEFT JOIN (SELECT * FROM `user`) u ON w.uid = u.id) w WHERE w.id = ?", id).QueryRow(&workOrder)
if err != nil {
logs.Warn("GetWorkOrder get WorkOrder------------", err)
}
......@@ -75,11 +87,11 @@ func (r *WorkOrderRepository) GetWorkOrder(id int64) (models.WorkOrderDto, error
// GetWorkOrders get WorkOrders
func (r *WorkOrderRepository) GetWorkOrders(request models.WorkOrderPaginationDto) (models.WorkOrderPaginationDto, error) {
statusSQL := ""
if request.Status >= 0 {
statusSQL = " AND `status` = " + strconv.Itoa(request.Status) + " "
if request.Status != "" {
statusSQL = " AND `status` IN(" + strings.Trim(request.Status, ",") + ") "
}
tidSQL := ""
if request.Tid != 0 {
if request.Tid != 0 && request.Tid != -1 && request.Tid != -2 {
tidSQL = " AND `t_i_d` = " + strconv.FormatInt(request.Tid, 10) + " "
}
if request.PageSize == 0 {
......@@ -88,17 +100,22 @@ func (r *WorkOrderRepository) GetWorkOrders(request models.WorkOrderPaginationDt
if request.PageOn == 0 {
request.PageOn = 1
}
del := strconv.Itoa(request.Del)
var workOrders []models.WorkOrderDto
SQLSUB := "SELECT w.*,u.nickname AS u_nickname,a.nickname AS a_nickname,w.id AS i_d,w.uid AS u_i_d FROM work_order w LEFT JOIN (SELECT id, nickname FROM `user`) u ON w.uid = u.id LEFT JOIN (SELECT id, nickname FROM `admin`) a ON w.last_reply = a.id"
SQL := "SELECT *,t_i_d AS tid,c_i_d AS cid FROM (" + SQLSUB + ") w WHERE `delete` = 0 " + statusSQL + tidSQL + " ORDER BY status ASC, create_at DESC"
SQL := "SELECT *,t_i_d AS tid,c_i_d AS cid FROM (" + SQLSUB + ") w WHERE `delete` = " + del + statusSQL + tidSQL + " ORDER BY status ASC, create_at DESC"
_, err := r.o.Raw(SQL+" LIMIT ? OFFSET ?", request.PageSize, (request.PageOn-1)*request.PageSize).QueryRows(&workOrders)
if err != nil {
logs.Warn("GetWorkOrders get WorkOrders------------", err)
request.List = []int{}
}
if len(workOrders) == 0 {
request.List = []int{}
} else {
request.List = workOrders
}
var _maps []orm.Params
total, _ := r.o.Raw(SQL).Values(&_maps)
request.List = workOrders
request.Total = total
return request, err
}
......
......@@ -75,7 +75,7 @@ func (r *WorkOrderTypeRepository) GetWorkOrderTypes() []models.WorkOrderType {
// GetWorkOrderTypesAndCountWorkorder get all
func (r *WorkOrderTypeRepository) GetWorkOrderTypesAndCountWorkorder() []models.WorkOrderTypeDto {
var workOrderTypes []models.WorkOrderTypeDto
_, err := r.o.Raw("SELECT t.*,IFNULL(w.count,0) as `count` FROM work_order_type t LEFT JOIN (SELECT t_i_d,COUNT(*) AS `count` FROM `work_order` WHERE `delete` = 0 GROUP BY `t_i_d`) w ON t.id = w.t_i_d").QueryRows(&workOrderTypes)
_, err := r.o.Raw("SELECT t.*,IFNULL(w.count,0) as `count` FROM work_order_type t LEFT JOIN (SELECT t_i_d,COUNT(*) AS `count` FROM `work_order` WHERE `delete` = 0 AND status != 3 GROUP BY `t_i_d`) w ON t.id = w.t_i_d").QueryRows(&workOrderTypes)
if err != nil {
logs.Warn("GetWorkOrderTypes get all------------", err)
return []models.WorkOrderTypeDto{}
......
......@@ -11,16 +11,6 @@
条待回复工单</span>
</span>
<div>
<el-button-group>
<el-radio size="small" v-model="workStatus" label="-1" border>全部</el-radio>
<el-radio size="small" v-model="workStatus" label="0" border>待处理</el-radio>
<el-radio size="small" v-model="workStatus" label="2" border>待回复</el-radio>
<el-radio size="small" v-model="workStatus" label="1" border>已回复</el-radio>
<el-radio size="small" v-model="workStatus" label="3" border>已关闭</el-radio>
</el-button-group>
</div>
<div>
<el-button size="mini">回收站 ( 52654 )</el-button>
<el-button size="mini">分类设置</el-button>
</div>
</div>
......@@ -74,7 +64,7 @@
</el-row>
</div>
</div>
<WorkOrderView :prop="showWorkOrder" v-model="isShowWorkOrderView" />
<WorkOrderView :workorderTypes="workorderTypes" :prop="showWorkOrder" v-model="isShowWorkOrderView" />
</div>
</template>
<script>
......@@ -90,15 +80,17 @@ export default {
loading: true,
isShowWorkOrderView: false,
showWorkOrder: {},
workStatus: "-1",
tableData: {
list: [],
page_on: 1,
page_size: 10,
total: 0,
status: -1,
status: "",
del: 0,
tid: 0
},
tabIndex: 0,
del: 0,
workorderTypes:[
{
"id": 0,
......@@ -108,6 +100,14 @@ export default {
],
};
},
computed: {
workStatus(){
if(this.tabIndex == this.workorderTypes.length-1 && this.workorderTypes.length > 1){
return '0,1,2,3'
}
return "0,1,2"
}
},
created() {
this.getWorkorderList();
this.getWorkorderTypes()
......@@ -118,7 +118,10 @@ export default {
this.isShowWorkOrderView = true
},
tabsChange(tab){
this.changeType(this.workorderTypes[parseInt(tab.index)].id)
this.tabIndex = parseInt(tab.index)
this.del = 0
if(this.tabIndex == this.workorderTypes.length-1) this.del = 1
this.changeType(this.workorderTypes[this.tabIndex].id)
},
// 行号
indexMethod(index) {
......@@ -133,9 +136,11 @@ export default {
// 获取数据
getWorkorderList(index) {
if (index) this.tableData.page_on = index;
const { page_on, page_size, tid, status } = this.tableData;
this.tableData.status = this.workStatus
this.tableData.del = this.del
const { page_on, page_size, tid, status, del } = this.tableData;
axios
.post("/workorder/list", { page_on, page_size, tid, status })
.post("/workorder/list", { page_on, page_size, tid, status, del })
.then(response => {
this.loading = false;
this.tableData = response.data.data;
......@@ -154,6 +159,16 @@ export default {
for(var i=0; i<response.data.data.length; i++){
this.workorderTypes[0].count += response.data.data[i].count
}
this.workorderTypes.push({
"id": -1,
"count": 0,
"title": "已结单"
})
this.workorderTypes.push({
"id": -2,
"count": 0,
"title": "回收站"
})
})
.catch(error => {
this.$message.error(error.response.data.message);
......@@ -175,10 +190,6 @@ export default {
if(!show){
this.getWorkorderList();
}
},
workStatus(status){
this.tableData.status = parseInt(status)
this.getWorkorderList();
}
}
};
......
......@@ -11,15 +11,16 @@
<el-button
size="mini"
@click="closeWorkorder"
v-if="showData.status == 1 || showData.status == 2"
v-if="(showData.status == 1 || showData.status == 2) && showData.delete == 0"
type="warning"
>关闭工单</el-button>
<el-button
size="mini"
@click="delWorkorder"
v-if="showData.status == 3 && adminInfo.root == 1"
v-if="showData.status == 3 && adminInfo.root == 1 && showData.delete == 0"
type="danger"
>删除工单</el-button>
<div v-if="showData.delete == 1" style="font-size:13px;margin-top:5px;color:#f44336">该工单已删除</div>
</div>
<span class="close" @click="close">
<i class="el-icon-close"></i>
......@@ -43,6 +44,10 @@
<div class="con">{{showData.email || '未预留邮箱'}}</div>
</div>
<div class="form-line">
<span class="lable">类型:</span>
<div class="con">{{typeName || '---'}}</div>
</div>
<div class="form-line">
<span class="lable">状态:</span>
<div class="con">
<span style="color:#e6a23c;" v-if="showData.status == 0">等待客服处理</span>
......@@ -134,7 +139,8 @@ export default {
default: false,
type: Boolean
},
prop: Object
prop: Object,
workorderTypes: Array
},
created() {
this.comments = [];
......@@ -146,6 +152,13 @@ export default {
isShowAside() {
return this.$store.state.isShowAside;
},
typeName(){
try{
return this.workorderTypes.filter((i)=>i.id == this.showData.tid)[0].title
}catch(e){
return ""
}
},
...mapGetters(["adminInfo", "uploadToken"])
},
methods: {
......@@ -185,7 +198,7 @@ export default {
let remark = value
axios
.post("/workorder/close", { wid, remark })
.then(response => {
.then(() => {
this.getWorkOrder()
this.$notify({
title: "温馨提示!",
......@@ -194,7 +207,7 @@ export default {
type: "success"
});
})
.catch(error => {
.catch(() => {
this.$message.error("工单关闭失败~");
});
});
......@@ -208,7 +221,7 @@ export default {
const wid = this.showData.id;
axios
.delete("/public/workorder/" +wid)
.then(response => {
.then(() => {
this.$notify({
title: "温馨提示!",
message: "工单已删除~",
......@@ -217,7 +230,7 @@ export default {
});
this.close()
})
.catch(error => {
.catch(() => {
this.$message.error("工单删除失败~");
});
});
......
......@@ -34,6 +34,10 @@
<span>{{$formatDate(workorder.create_at)}}</span>
</div>
<div class="con">
<span>类型:</span>
<span>{{typeName || "---"}}</span>
</div>
<div class="con">
<span>状态:</span>
<span>
<i v-if="workorder.status == 1" style="color:#8bc34a;">已回复</i>
......@@ -112,7 +116,15 @@ export default {
"userInfo",
"workorderTypes",
"uploadToken"
])
]),
typeName(){
try{
return this.workorderTypes.filter((i)=>i.id == this.workorder.tid)[0].title
}catch(e){
console.log(e)
return ""
}
}
},
created() {
document.title = "工单详细";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment