1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-909900e0"],{"678d":function(t,e,a){var i=a("9c15"),s=a("8655"),o=a("1c0c"),n=a("24bc"),r=a("5008"),c=a("2c48"),l=s.Array,d=o("JSON","stringify"),m=r(/./.exec),u=r("".charAt),p=r("".charCodeAt),h=r("".replace),v=r(1..toString),b=/[\uD800-\uDFFF]/g,f=/^[\uD800-\uDBFF]$/,g=/^[\uDC00-\uDFFF]$/,_=function(t,e,a){var i=u(a,e-1),s=u(a,e+1);return m(f,t)&&!m(g,s)||m(g,t)&&!m(f,i)?"\\u"+v(p(t,0),16):t},w=c((function(){return'"\\udf06\\ud834"'!==d("\udf06\ud834")||'"\\udead"'!==d("\udead")}));d&&i({target:"JSON",stat:!0,forced:w},{stringify:function(t,e,a){for(var i=0,s=arguments.length,o=l(s);i<s;i++)o[i]=arguments[i];var r=n(d,null,o);return"string"==typeof r?h(r,b,_):r}})},"8a52":function(t,e,a){"use strict";a.r(e);var i,s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.table.id?a("div",[a("van-nav-bar",{staticClass:"shadow",attrs:{title:t.table.name,"left-text":"返回","left-arrow":""},on:{"click-left":function(e){return t.$router.back(-1)}}}),t.table.work_type_id?a("div",{staticClass:"shadow bg-white mb-5"},[t.table.worker_id?a("div",[a("van-cell",{attrs:{center:""},scopedSlots:t._u([{key:"title",fn:function(){return[a("div",{staticClass:"block"},[a("span",{staticStyle:{"margin-left":"6px"}},[t._v(t._s(t.table.worker_name))])])]},proxy:!0},{key:"label",fn:function(){return[a("div",{staticClass:"block"},[a("span",{staticStyle:{"margin-left":"6px"}},[t._v(t._s(t.table.work_type_name))])])]},proxy:!0},{key:"icon",fn:function(){return[a("div",{staticClass:"block"},[a("van-image",{attrs:{src:"https://image.nczyzs.com/zhiyuan-logo.png",width:"45px",height:"45px"}})],1)]},proxy:!0}],null,!1,2191901593)},[[a("span",[t._v(t._s(t.table.worker_phone)+" "),t.table.worker_phone?a("a",{attrs:{href:"tel:"+t.table.worker_phone}},[a("van-icon",{attrs:{name:"phone",size:"22",color:"#009688"}})],1):t._e()])]],2),a("div",{staticClass:"pb-2 px-4 text-right"},[a("van-button",{directives:[{name:"auth",rawName:"v-auth",value:["employee:worker:edit"],expression:"['employee:worker:edit']"}],attrs:{type:"info",size:"mini",to:"/worker/"+t.table.worker_id+"/edit"}},[t._v("工人信息")])],1)],1):a("van-cell",{directives:[{name:"auth",rawName:"v-auth",value:["work:dispatch:worker"],expression:"['work:dispatch:worker']"}],attrs:{to:"/table/"+t.table.id+"/worker?type="+t.table.work_type_id},scopedSlots:t._u([{key:"icon",fn:function(){return[a("van-icon",{staticClass:"text-gray-400",attrs:{name:"plus",size:"50px"}})]},proxy:!0}],null,!1,1374246615)},[a("div",{staticClass:"\n text-gray-400 text-center\n h-full\n flex\n justify-center\n items-center\n "},[a("span",[t._v("派单"+t._s(t.table.work_type_name))])])])],1):t._e(),a("div",{staticClass:"shadow bg-white px-5 pt-6 pb-10 leading-8"},[a("div",{staticClass:"flex flex-row"},[a("div",{staticClass:"flex-1"},[a("div",[t._v("进度: "+t._s(t.tableState[t.table.state]))])]),a("div",{staticClass:"flex-1"},[a("div",[t._v(" 合计金额: "+t._s(Math.round(t.items.reduce((function(t,e){return t+e.num*e.price}),0)))+" ")])])]),a("div",{staticClass:"flex flex-row mt-5"},[a("div",{staticClass:"flex-1"},[a("div",[t._v("工价: "+t._s(t.table.budget))])]),a("div",{staticClass:"flex-1"},[a("div",[0==t.table.state&&0!=t.table.worker_id&&0!=t.items.reduce((function(t,e){return t+e.num*e.price}),0)&&t.$store.getters.user_id==t.worksite.manager_id?a("van-button",{staticClass:"float-right ml-2",attrs:{round:"",type:"info",size:"small"},on:{click:function(e){return t.process(0)}}},[t._v("提交")]):t._e(),1==t.table.state&&t.$store.getters.user_id==t.worksite.project_leader_id?a("van-button",{staticClass:"float-right ml-2",attrs:{round:"",type:"info",size:"small"},on:{click:function(e){return t.process(1)}}},[t._v("工程队长审核")]):t._e(),0==t.table.state&&t.$store.getters.user_id==t.worksite.manager_id?a("van-button",{staticClass:"float-right ml-2",attrs:{round:"",type:"info",size:"small"},on:{click:t.addItem}},[t._v("添加项目")]):t._e()],1)])])]),a("van-tabs",{staticClass:"shadow bg-white mt-5",attrs:{swipeable:"",sticky:""},model:{value:t.activeTab,callback:function(e){t.activeTab=e},expression:"activeTab"}},[0!=t.jsonArray(t.table.image).length?a("van-tab",{attrs:{title:"详情"}},t._l(t.jsonArray(t.table.image),(function(t,e){return a("img",{key:e,attrs:{src:t}})})),0):t._e(),a("van-tab",{attrs:{title:"派单"}},[a("van-cell-group",t._l(t.orders,(function(e,i){return a("van-cell",{key:i},[[t._v(" "+t._s(t.orderState[e.state])+" ")],a("template",{slot:"title"},[t._v(" "+t._s(e.worker_name)+" ")]),a("template",{slot:"label"},[t._v(" "+t._s(e.worker_phone)+" ")])],2)})),1)],1),a("van-tab",{attrs:{title:"项目"}},[a("van-cell-group",t._l(t.items,(function(e,i){return a("van-cell",{key:i,on:{click:function(a){return t.editItem(e)}}},[[a("span",{staticClass:"block"},[t._v(t._s(e.price)+" 元/"+t._s(e.unit))]),a("span",{staticClass:"block"},[t._v("x"+t._s(e.num))])],a("template",{slot:"title"},[t._v(" "+t._s(e.name)+" ")]),a("template",{slot:"label"},[t._v(" "+t._s(e.remark)+" ")])],2)})),1)],1),0!=t.processs.length?a("van-tab",{attrs:{title:"流程"}},[a("van-cell-group",t._l(t.processs,(function(e,i){return a("van-cell",{key:i},[a("div",{staticClass:"flex justify-between items-center"},[a("div",[a("van-image",{attrs:{round:"",width:"3rem",height:"3rem",src:e.created_headimgurl?e.created_headimgurl:"https://image.nczyzs.com/zhiyuan-logo.png"}}),a("div",{staticClass:"inline-block align-top px-2"},[a("div",{staticClass:"text-base"},[t._v(t._s(e.created_name))]),a("div",{staticClass:"text-sm text-gray-400"},[t._v(" "+t._s(t.dateFormat("YYYY-mm-dd HH:MM",new Date(1e3*e.created_at)))+" ")])])],1),a("div",{staticClass:"text-right"},[a("div",{staticClass:"text-gray-600"},[t._v(" "+t._s(t.processType[e.type])+" ")]),e.type?a("div",{staticClass:"text-sm text-gray-400"},[t._v(" "+t._s(t.processState[e.state])+" ")]):t._e()])]),a("div",{staticClass:"flex justify-between items-end"},[a("div",{staticClass:"text-base text-gray-600 flex-1",staticStyle:{"white-space":"pre-wrap"}},[t._v(" "+t._s(e.explain)+" ")])]),e.signature?a("van-image",{attrs:{width:"100",height:"100",src:e.signature},on:{click:function(a){return t.openImage([e.signature])}}}):t._e(),e.pictures?a("UploadList",{attrs:{value:t.jsonArray(e.pictures),edit:!1}}):t._e()],1)})),1)],1):t._e()],1),a("van-popup",{attrs:{closeable:"",round:"",position:"bottom"},model:{value:t.itemShow,callback:function(e){t.itemShow=e},expression:"itemShow"}},[a("div",{staticClass:"mt-2 text-center leading-10 text-lg"},[t._v(" "+t._s(t.itemForm.id?"编辑项目":"添加项目")+" ")]),a("van-field",{attrs:{maxlength:"50",label:"项目名称"},model:{value:t.itemForm.name,callback:function(e){t.$set(t.itemForm,"name",e)},expression:"itemForm.name"}}),a("van-row",[a("van-col",{attrs:{span:"18"}},[a("van-field",{attrs:{type:"number",label:"单价"},model:{value:t.itemForm.price,callback:function(e){t.$set(t.itemForm,"price",e)},expression:"itemForm.price"}})],1),a("van-col",{attrs:{span:"6"}},[a("van-field",{attrs:{placeholder:"单位"},model:{value:t.itemForm.unit,callback:function(e){t.$set(t.itemForm,"unit",e)},expression:"itemForm.unit"}})],1)],1),a("van-field",{attrs:{type:"number",label:"数量"},model:{value:t.itemForm.num,callback:function(e){t.$set(t.itemForm,"num",e)},expression:"itemForm.num"}}),a("van-field",{attrs:{rows:"3",autosize:"",type:"textarea",placeholder:"请输入备注"},model:{value:t.itemForm.remark,callback:function(e){t.$set(t.itemForm,"remark",e)},expression:"itemForm.remark"}}),a("van-button",{attrs:{size:"large",type:"primary"},on:{click:t.saveItem}},[t._v("提交")])],1),a("van-popup",{attrs:{closeable:"",round:"",position:"bottom"},model:{value:t.processShow,callback:function(e){t.processShow=e},expression:"processShow"}},[a("div",{staticClass:"mt-2 text-center leading-10 text-lg"},[t._v(" "+t._s(0==t.processForm.type?"提交":"审核")+" ")]),t.processForm.type?a("van-cell",{attrs:{title:"审核"}},[a("div",{staticClass:"flex justify-end"},[a("van-radio-group",{attrs:{direction:"horizontal"},model:{value:t.processForm.state,callback:function(e){t.$set(t.processForm,"state",e)},expression:"processForm.state"}},[a("van-radio",{attrs:{name:0}},[t._v("同意")]),a("van-radio",{attrs:{name:1}},[t._v("驳回")])],1)],1)]):t._e(),a("div",{staticClass:"px-10 py-5"},[a("div",{ref:"canvasBox",staticClass:"w-full h-72 border-2 border-black"},[a("canvas",{attrs:{id:"sign"}})])]),a("van-field",{attrs:{autosize:"",type:"textarea",placeholder:"请输入说明"},model:{value:t.processForm.explain,callback:function(e){t.$set(t.processForm,"explain",e)},expression:"processForm.explain"}}),a("UploadList",{attrs:{value:t.jsonArray(t.processForm.pictures)},on:{input:function(e){t.$set(t.processForm,"pictures",JSON.stringify(e))}}}),a("van-button",{attrs:{size:"large",type:"info"},on:{click:t.saveProcess}},[t._v("提交")])],1)],1):t._e()},o=[],n=a("d696"),r=(a("dcd6"),a("8c89")),c=(a("ee22"),a("3c10")),l=(a("1580"),a("92d0")),d=(a("72bf"),a("c7af")),m=(a("fcda"),a("8e2e")),u=(a("8234"),a("4783")),p=(a("d762"),a("678d"),a("da1a")),h=a("46e0"),v=a("ae79"),b=a("22b4"),f=a("f148"),g={components:(i={UploadList:b["a"]},Object(n["a"])(i,u["a"].name,u["a"]),Object(n["a"])(i,m["a"].name,m["a"]),Object(n["a"])(i,d["a"].name,d["a"]),Object(n["a"])(i,l["a"].name,l["a"]),Object(n["a"])(i,c["a"].name,c["a"]),Object(n["a"])(i,r["a"].Component.name,r["a"].Component),i),data:function(){var t;return{table:{},worksite:{},tableState:(t={},Object(n["a"])(t,-1,"已驳回"),Object(n["a"])(t,0,"待提交"),Object(n["a"])(t,1,"工程队长审核"),Object(n["a"])(t,2,"预审审核"),Object(n["a"])(t,3,"店长审核"),Object(n["a"])(t,4,"财务审核"),Object(n["a"])(t,5,"已完成"),t),activeTab:0,items:[],itemShow:!1,itemForm:{},processs:[],processShow:!1,processForm:{},processState:{0:"通过",1:"驳回"},processType:{0:"提交",1:"工程队长审核",2:"预审审核",3:"店长审核",4:"财务审核"},orderState:{0:"待处理",1:"已接单",2:"已拒绝",3:"已取消"},signaturePad:null,orders:[]}},created:function(){this.$route.params&&this.$route.params.id&&(this.id=parseInt(this.$route.params.id)),this.loadDispatchSiteTable(),this.loadDispatchSiteItem(),this.loadDispatchOrder()},mounted:function(){},methods:{checkAuth:h["a"],dateFormat:v["a"],formatSecond:v["b"],jsonArray:v["c"],loadDispatchOrder:function(){var t=this;this.$store.commit("loading/showLoading"),Object(p["m"])({table_id:this.id}).then((function(e){t.orders=e.data.list,t.$store.commit("loading/hideLoading")})).catch((function(){t.$store.commit("loading/hideLoading")}))},loadDispatchSiteTable:function(){var t=this;this.$store.commit("loading/showLoading"),Object(p["q"])(this.id).then((function(e){t.table=e.data,t.loadWorksite(),t.loadDispatchSiteProcess()})).catch((function(){t.$store.commit("loading/hideLoading")}))},loadDispatchSiteItem:function(){var t=this;this.$store.commit("loading/showLoading"),Object(p["n"])({table_id:this.id}).then((function(e){t.items=e.data.list,t.$store.commit("loading/hideLoading")})).catch((function(){t.$store.commit("loading/hideLoading")}))},loadDispatchSiteProcess:function(){var t=this;this.$store.commit("loading/showLoading"),Object(p["o"])({table_id:this.id,collect_id:this.table.collect_id}).then((function(e){t.processs=e.data.list,t.$store.commit("loading/hideLoading")})).catch((function(){t.$store.commit("loading/hideLoading")}))},loadWorksite:function(){var t=this;this.$store.commit("loading/showLoading"),Object(p["r"])(this.table.site_id).then((function(e){t.worksite=e.data,t.$store.commit("loading/hideLoading")})).catch((function(){t.$store.commit("loading/hideLoading")}))},addItem:function(){this.itemForm={table_id:this.id},this.itemShow=!0},editItem:function(t){0==this.table.state&&this.$store.getters.user_id==this.worksite.manager_id&&(this.itemForm=JSON.parse(JSON.stringify(t)),this.itemShow=!0)},process:function(t){var e=this;this.processForm={table_id:this.id,type:t,state:t?void 0:0},this.processShow=!0,null==this.signaturePad?this.$nextTick((function(){var t=document.getElementById("sign");e.signaturePad=new f["a"](t,{penColor:"#000000"}),t.height=e.$refs.canvasBox.clientHeight,t.width=e.$refs.canvasBox.clientWidth})):this.signaturePad.clear()},saveItem:function(){var t=this;this.$store.commit("loading/showLoading"),(this.itemForm.id?Object(p["i"])(this.itemForm.id,this.itemForm):Object(p["b"])(this.itemForm)).then((function(e){t.loadDispatchSiteItem(),t.itemShow=!1})).catch((function(){t.$store.commit("loading/hideLoading")}))},saveProcess:function(){var t=this;this.$store.commit("loading/showLoading"),Object(p["c"])(Object.assign({signature:this.signaturePad.isEmpty()?"":this.signaturePad.toDataURL()},this.processForm)).then((function(e){t.loadDispatchSiteTable(),t.processShow=!1})).catch((function(){t.$store.commit("loading/hideLoading")}))},openImage:function(t){Object(r["a"])({images:t,showIndex:!1,closeable:!0,overlayClass:"bg-white"})}}},_=g,w=a("cba8"),k=Object(w["a"])(_,s,o,!1,null,null,null);e["default"]=k.exports}}]);
|