1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-1d45c4c6"],{"0cc8":function(t,e,n){"use strict";n("68ef"),n("ae9e")},"129f":function(t,e,n){"use strict";t.exports=Object.is||function(t,e){return t===e?0!==t||1/t===1/e:t!==t&&e!==e}},4283:function(t,e,n){},5852:function(t,e,n){"use strict";n("68ef"),n("9d70"),n("3743"),n("1a04"),n("1146"),n("f032")},"7db0":function(t,e,n){"use strict";var i=n("23e7"),o=n("b727").find,a=n("44d2"),r="find",s=!0;r in[]&&Array(1)[r]((function(){s=!1})),i({target:"Array",proto:!0,forced:s},{find:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),a(r)},"841c":function(t,e,n){"use strict";var i=n("c65b"),o=n("d784"),a=n("825a"),r=n("7234"),s=n("1d80"),l=n("129f"),c=n("577e"),d=n("dc4a"),u=n("14c3");o("search",(function(t,e,n){return[function(e){var n=s(this),o=r(e)?void 0:d(e,t);return o?i(o,e,n):new RegExp(e)[t](c(n))},function(t){var i=a(this),o=c(t),r=n(e,i,o);if(r.done)return r.value;var s=i.lastIndex;l(s,0)||(i.lastIndex=0);var d=u(i,o);return l(i.lastIndex,s)||(i.lastIndex=s),null===d?-1:d.index}]}))},a15b:function(t,e,n){"use strict";var i=n("23e7"),o=n("e330"),a=n("44ad"),r=n("fc6a"),s=n("a640"),l=o([].join),c=a!==Object,d=c||!s("join",",");i({target:"Array",proto:!0,forced:d},{join:function(t){return l(r(this),void 0===t?",":t)}})},a434:function(t,e,n){"use strict";var i=n("23e7"),o=n("7b0b"),a=n("23cb"),r=n("5926"),s=n("07fa"),l=n("3a34"),c=n("3511"),d=n("65f0"),u=n("8418"),h=n("083a"),f=n("1dde"),p=f("splice"),v=Math.max,g=Math.min;i({target:"Array",proto:!0,forced:!p},{splice:function(t,e){var n,i,f,p,b,y,m=o(this),k=s(m),w=a(t,k),x=arguments.length;for(0===x?n=i=0:1===x?(n=0,i=k-w):(n=x-2,i=g(v(r(e),0),k-w)),c(k+n-i),f=d(m,i),p=0;p<i;p++)b=w+p,b in m&&u(f,p,m[b]);if(f.length=i,n<i){for(p=w;p<k-i;p++)b=p+i,y=p+n,b in m?m[y]=m[b]:h(m,y);for(p=k;p>k-i+n;p--)h(m,p-1)}else if(n>i)for(p=k-i;p>w;p--)b=p+i-1,y=p+n-1,b in m?m[y]=m[b]:h(m,y);for(p=0;p<n;p++)m[p+w]=arguments[p+2];return l(m,k-i+n),f}})},c9f5:function(t,e,n){"use strict";n("4de4"),n("c740"),n("c975"),n("a15b"),n("d81d"),n("4e82"),n("d3b7");var i=function(){var t=this,e=t._self._c;return e("div",[t.span?e("span",{on:{click:t.showSelect}},[t._v(t._s(0==t.valList.length?t.placeholder:t.valList.map((function(t){return t.name})).join(" ")))]):e("van-field",{attrs:{readonly:"",clickable:t.edit,border:t.border,label:t.label,value:t.valList.map((function(t){return t.name})).join(" "),placeholder:t.placeholder,disabled:t.disabled,"input-align":"right"},on:{click:t.showSelect}}),e("van-popup",{attrs:{round:"",position:"bottom"},model:{value:t.showPicker,callback:function(e){t.showPicker=e},expression:"showPicker"}},[e("div",{staticClass:"van-picker__toolbar"},[e("button",{staticClass:"van-picker__cancel",attrs:{type:"button"},on:{click:function(e){t.showPicker=!1}}},[t._v(" 取消 ")]),e("button",{staticClass:"van-picker__confirm",attrs:{type:"button"},on:{click:t.change}},[t._v(" 确认 ")])]),e("div",{staticStyle:{position:"relative"}},[e("van-overlay",{staticStyle:{position:"absolute"},attrs:{show:t.loading,"z-index":"1000"}},[e("div",{staticStyle:{display:"flex","align-items":"center","justify-content":"center",height:"100%"}},[e("van-loading")],1)]),t.stepShow?e("van-steps",{attrs:{direction:"vertical",active:t.list.length-1}},[t._l(t.list,(function(n,i){return e("van-step",{key:i},[e("div",{on:{click:function(e){return t.reselect(n,i)}}},[e("span",[t._v(t._s(n.name))])])])})),e("van-step",{directives:[{name:"show",rawName:"v-show",value:0==t.list.length||t.geoList.findIndex((function(e){return e==t.list[t.list.length-1].code.length}))!=t.level,expression:"\n list.length == 0 ||\n geoList.findIndex(\n (n) => n == list[list.length - 1].code.length\n ) != level\n "}]},[e("div",[e("span",[t._v("请选择")])])])],2):t._e(),e("div",{staticStyle:{position:"relative","margin-top":"0.5rem"}},[e("div",{directives:[{name:"show",rawName:"v-show",value:0==t.list.length||t.geoList.findIndex((function(e){return e==t.list[t.list.length-1].code.length}))!=t.level,expression:"\n list.length == 0 ||\n geoList.findIndex(\n (n) => n == list[list.length - 1].code.length\n ) != level\n "}],staticClass:"index-box"},[e("van-index-bar",t._l(t.option.map((function(e){return t.pinyinFirst(e.name)[0]})).filter((function(t,e,n){return n.indexOf(t,0)===e})).sort(),(function(n,i){return e("div",{key:i},[e("van-index-anchor",{attrs:{index:n}}),t._l(t.option.filter((function(e){return t.pinyinFirst(e.name)[0]===n})),(function(n,i){return e("van-cell",{key:i,attrs:{title:n.name},on:{click:function(e){return t.select(n)}}})}))],2)})),0)],1)])],1)])],1)},o=[],a=(n("d401"),n("99af"),n("7db0"),n("14d9"),n("fb6a"),n("a434"),n("a9e3"),n("25f0"),n("6456"));function r(t){return Object(a["a"])({url:"/geo/lower"+(t?"/"+t:""),method:"get"})}function s(t){return Object(a["a"])({url:"/geo/code"+(t?"/"+t:""),method:"get"})}var l=n("58a6"),c={name:"AddressCode",components:{},props:{value:{type:String,default:""},label:{type:String,default:""},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},border:{type:Boolean,default:!1},edit:{type:Boolean,default:!0},level:{type:Number,default:4},span:{type:Boolean,default:!1}},watch:{value:{deep:!0,immediate:!0,handler:function(){var t=this;this.loading=!0,this.value?s(this.value).then((function(e){console.log(e),0!=e.data.list.length?t.lazyLoad(e.data.list[e.data.list.length-1].code,(function(e){console.log(e),t.valList=[];for(var n,i=t.value,o=t.$root.options,a=function(){var e=i.toString().slice(0,t.geoList[r]);if(n=o.findIndex((function(t){return t.code==e})),-1===n)return 1;t.valList.push(o[n]),o=o[n]["children"]},r=0;r<=t.geoList.findIndex((function(t){return t==i.toString().length}));r++)if(a())break;t.valOption=o,t.loading=!1})):t.loading=!1})).catch((function(){})):this.lazyLoad("",(function(e){t.valOption=e}))}}},data:function(){return{list:[],option:[],geoList:[2,4,6,9,12],showPicker:!1,pickerShow:!0,loading:!1,stepShow:!0,valList:[],valOption:[]}},created:function(){this.pinyinFirst=l["a"]},methods:{showSelect:function(){this.edit&&(this.list=[].concat(this.valList),this.option=this.valOption,this.showPicker=!0)},reselect:function(t,e){var n=this;this.list.splice(e,this.list.length-e),0==this.list.length?this.option=this.$root.options:this.option=this.list[this.list.length-1].children,this.stepShow=!1,this.$nextTick((function(){n.stepShow=!0}))},select:function(t){var e=this;0!=this.list.length&&this.geoList.findIndex((function(t){return t==e.list[e.list.length-1].code.toString().length}))==this.level||(this.list.push(t),this.geoList.findIndex((function(t){return t==e.list[e.list.length-1].code.toString().length}))!=this.level&&(t.children?this.option=t.children:this.lazyLoad(t.code,(function(t){e.option=t}))))},setChildren:function(t,e){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},o=this.$root.options;if(0!=o.length){for(var a,r,s=function(){var r=t.toString().slice(0,n.geoList[l]);return a=o.find((function(t){return t.code==r})),a?(o=a.children,o||l==n.geoList.findIndex((function(e){return e==t.toString().length}))?void 0:(n.lazyLoad(r,(function(){n.setChildren(t,e,i)})),{v:void 0})):{v:void 0}},l=0;l<=this.geoList.findIndex((function(e){return e==t.toString().length}));l++)if(r=s(),r)return r.v;this.$set(a,"children",e),i()}else this.lazyLoad("",(function(){n.setChildren(t,e,i)}))},lazyLoad:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};this.loading=!0,r(e).then((function(i){console.log(i);var o=i.data.list;e?t.setChildren(e,o,(function(){t.loading=!1,n(o)})):(t.$root.options=o,t.loading=!1,n(o))})).catch((function(){}))},change:function(){this.valList=[].concat(this.list),this.valOption=this.option,this.$emit("input",0==this.valList.length?"":this.valList[this.valList.length-1].code),this.$emit("change",0==this.valList.length?"":this.valList[this.valList.length-1].code),this.showPicker=!1}}},d=c,u=(n("dfd8"),n("2877")),h=Object(u["a"])(d,i,o,!1,null,"ef00c0ee",null);e["a"]=h.exports},d319:function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return a}));var i=n("6456");function o(t){return Object(i["a"])({url:"qiniu/token",method:"get",params:t})}function a(t){return Object(i["a"])({url:"send_verify_code",method:"get",params:t})}},d961:function(t,e,n){"use strict";var i=n("2638"),o=n.n(i),a=n("c31d"),r=n("d282"),s=n("ba31"),l=n("1325"),c=n("565f"),d=Object(r["a"])("search"),u=d[0],h=d[1],f=d[2];function p(t,e,n,i){function r(){if(n.label||e.label)return t("div",{class:h("label")},[n.label?n.label():e.label])}function d(){if(e.showAction)return t("div",{class:h("action"),attrs:{role:"button",tabindex:"0"},on:{click:o}},[n.action?n.action():e.actionText||f("cancel")]);function o(){n.action||(Object(s["a"])(i,"input",""),Object(s["a"])(i,"cancel"))}}var u={attrs:i.data.attrs,on:Object(a["a"])({},i.listeners,{keypress:function(t){13===t.keyCode&&(Object(l["c"])(t),Object(s["a"])(i,"search",e.value)),Object(s["a"])(i,"keypress",t)}})},p=Object(s["b"])(i);return p.attrs=void 0,t("div",o()([{class:h({"show-action":e.showAction}),style:{background:e.background}},p]),[null==n.left?void 0:n.left(),t("div",{class:h("content",e.shape)},[r(),t(c["a"],o()([{attrs:{type:"search",border:!1,value:e.value,leftIcon:e.leftIcon,rightIcon:e.rightIcon,clearable:e.clearable,clearTrigger:e.clearTrigger},scopedSlots:{"left-icon":n["left-icon"],"right-icon":n["right-icon"]}},u]))]),d()])}p.props={value:String,label:String,rightIcon:String,actionText:String,background:String,showAction:Boolean,clearTrigger:String,shape:{type:String,default:"square"},clearable:{type:Boolean,default:!0},leftIcon:{type:String,default:"search"}},e["a"]=u(p)},ded9:function(t,e,n){"use strict";n("7db0"),n("c740"),n("d81d"),n("d3b7");var i=function(){var t=this,e=t._self._c;return e("span",[t.dropDown?e("span",{staticClass:"px-2",on:{click:t.showSelect}},[t._v(" "+t._s(t.columns.find((function(e){return e[t.valueKey]==t.value}))?t.columns.find((function(e){return e[t.valueKey]==t.value}))[t.labelKey]:"")+" "),e("van-icon",{attrs:{name:"arrow-down"}})],1):e("van-field",{attrs:{readonly:"",clickable:t.edit,border:t.border,label:t.label,value:t.columns.find((function(e){return e[t.valueKey]==t.value}))?t.columns.find((function(e){return e[t.valueKey]==t.value}))[t.labelKey]:"",placeholder:t.placeholder,disabled:t.disabled,rules:t.rules},on:{click:t.showSelect}}),e("van-popup",{attrs:{round:"",position:"bottom"},model:{value:t.showPicker,callback:function(e){t.showPicker=e},expression:"showPicker"}},[e("van-picker",{attrs:{"show-toolbar":"",title:t.label,columns:t.columns.map((function(e){return{text:e[t.labelKey],value:e[t.valueKey]}})),"default-index":t.columns.find((function(e){return e[t.valueKey]==t.value}))?t.columns.findIndex((function(e){return e[t.valueKey]==t.value})):0},on:{cancel:function(e){t.showPicker=!1},confirm:t.onConfirm}})],1)],1)},o=[],a={name:"Select",components:{},props:{value:{default:""},label:{type:String,default:""},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},border:{type:Boolean,default:!1},data:{type:String,default:""},edit:{type:Boolean,default:!0},rules:{type:Array,default:function(){return[]}},columns:{type:Array,default:function(){return[]}},labelKey:{default:"name"},valueKey:{default:"id"},dropDown:{type:Boolean,default:!1}},data:function(){return{showPicker:!1}},methods:{showSelect:function(){this.edit&&(this.showPicker=!0)},onConfirm:function(t){t=t.value;this.$emit("input",t),this.$emit("change",t),this.showPicker=!1}}},r=a,s=n("2877"),l=Object(s["a"])(r,i,o,!1,null,"2fd1ab60",null);e["a"]=l.exports},dfd8:function(t,e,n){"use strict";n("4283")},f032:function(t,e,n){},f613:function(t,e,n){"use strict";n.r(e);n("99af"),n("14d9"),n("ac1f"),n("841c");var i=function(){var t=this,e=t._self._c;return e("div",[e("van-sticky",[t.tableid?e("van-nav-bar",{staticClass:"shadow",attrs:{title:t.tableid?"选择工人":"工人管理","left-text":"返回","left-arrow":""},on:{"click-left":function(e){return t.$router.back(-1)}},scopedSlots:t._u([{key:"right",fn:function(){return[e("van-icon",{directives:[{name:"auth",rawName:"v-auth",value:["employee:worker:add"],expression:"['employee:worker:add']"}],attrs:{name:"plus",size:"18"},on:{click:function(e){return t.$router.push("/worker/add")}}})]},proxy:!0}],null,!1,2433742734)}):t._e(),e("van-search",{attrs:{placeholder:"请输入关键词","show-action":""},on:{search:t.changeQuery},model:{value:t.search,callback:function(e){t.search=e},expression:"search"}},[e("template",{slot:"left"},[e("Select",{attrs:{edit:!t.tableid,"drop-down":"",columns:[{id:"",name:"全部"}].concat(t.types)},on:{change:t.changeQuery},model:{value:t.type_ids,callback:function(e){t.type_ids=e},expression:"type_ids"}})],1),e("template",{slot:"action"},[e("AddressCode",{attrs:{span:"",placeholder:"区域",level:3},on:{change:t.changeQuery},model:{value:t.areacode,callback:function(e){t.areacode=e},expression:"areacode"}})],1)],2)],1),e("van-list",{attrs:{finished:t.finished,error:t.error,"error-text":"请求失败,点击重新加载","finished-text":""},on:{"update:error":function(e){t.error=e},load:t.loadWorkers},model:{value:t.loading,callback:function(e){t.loading=e},expression:"loading"}},[e("van-cell-group",t._l(t.workers,(function(n,i){return e("van-cell",{key:i,attrs:{clickable:!1,center:""},scopedSlots:t._u([{key:"title",fn:function(){return[e("div",{staticClass:"block",on:{click:function(e){return t.select(n)}}},[e("span",{staticStyle:{"margin-left":"6px"}},[t._v(t._s(n.name))])])]},proxy:!0},{key:"label",fn:function(){return[e("div",{staticClass:"block",on:{click:function(e){return t.select(n)}}},[e("span",{staticStyle:{"margin-left":"6px"}},[t._v(t._s(n.type_names))])])]},proxy:!0},{key:"icon",fn:function(){return[e("div",{staticClass:"block",on:{click:function(e){return t.select(n)}}},[e("van-image",{attrs:{src:"https://image.nczyzs.com/zhiyuan-logo.png",width:"45px",height:"45px"}})],1)]},proxy:!0},t.tableid?{key:"extra",fn:function(){return[e("van-button",{staticStyle:{"margin-left":"5px"},attrs:{type:"primary",size:"mini"},on:{click:function(e){return t.dispatch(n)}}},[t._v("派单")])]},proxy:!0}:null],null,!0)},[[e("div",[t._v(" "+t._s(n.phone)+" "),n.phone?e("a",{attrs:{href:"tel:"+n.phone}},[e("van-icon",{attrs:{name:"phone",size:"22",color:"#009688"}})],1):t._e()]),e("div",[e("AddressCode",{attrs:{value:n.areacode,span:"",level:3,edit:!1}})],1)]],2)})),1)],1)],1)},o=[],a=n("ade3"),r=(n("0cc8"),n("3104")),s=(n("5852"),n("d961")),l=(n("d401"),n("d3b7"),n("25f0"),n("5319"),n("8b57")),c=(n("d319"),n("c9f5")),d=n("b656"),u=n("ded9"),h={components:Object(a["a"])(Object(a["a"])(Object(a["a"])({Select:u["a"]},s["a"].name,s["a"]),r["a"].name,r["a"]),"AddressCode",c["a"]),data:function(){return{tableid:0,search:"",type_ids:"",areacode:"",types:[],workers:[],loading:!1,finished:!1,error:!1,page:1,size:10}},created:function(){this.$route.query&&this.$route.query.type&&(this.type_ids=this.$route.query.type),this.$route.query&&this.$route.query.areacode&&(this.areacode=this.$route.query.areacode),this.$route.query&&this.$route.query.search&&(this.search=this.$route.query.search),this.$route.params&&this.$route.params.id&&(this.tableid=this.$route.params.id),this.loadWorkTypes()},methods:{loadWorkTypes:function(){var t=this;this.$store.commit("loading/showLoading"),Object(l["x"])().then((function(e){t.types=e.data.list,t.$store.commit("loading/hideLoading")})).catch((function(){t.$store.commit("loading/hideLoading")}))},changeQuery:function(){this.$router.replace({path:this.$route.path,query:{type:this.type_ids,areacode:this.areacode,search:this.search}}),this.beforeChange()},beforeChange:function(){this.finished=!1,this.loading=!1,this.error=!1,this.page=1,this.workers=[],this.loadWorkers()},loadWorkers:function(){var t=this;this.loading=!0,Object(l["z"])({search:this.search,type_ids:this.type_ids,areacode:this.areacode.toString(),page:this.page++,size:this.size}).then((function(e){t.workers=t.workers.concat(e.data.list),t.workers.length>=e.data.count&&(t.finished=!0),t.loading=!1})).catch((function(){t.loading=!1,t.error=!0}))},select:function(t){Object(d["a"])(["employee:worker:edit"])&&this.$router.push("/worker/".concat(t.id,"/edit"))},dispatch:function(t){var e=this;this.$store.commit("loading/showLoading"),Object(l["b"])({table_id:this.tableid,worker_id:t.id}).then((function(t){e.$router.go(-1),e.$store.commit("loading/hideLoading")})).catch((function(){e.$store.commit("loading/hideLoading")}))}}},f=h,p=n("2877"),v=Object(p["a"])(f,i,o,!1,null,"2f1c0f10",null);e["default"]=v.exports}}]);
|