(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-078a63a2"],{"14d9":function(t,e,i){"use strict";var r=i("23e7"),n=i("7b0b"),o=i("07fa"),a=i("3a34"),s=i("3511"),c=i("d039"),d=c((function(){return 4294967297!==[].push.call({length:4294967296},1)})),l=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}},h=d||!l();r({target:"Array",proto:!0,arity:1,forced:h},{push:function(t){var e=n(this),i=o(e),r=arguments.length;s(i+r);for(var c=0;cn)throw r("Maximum allowed index exceeded");return t}},"3a34":function(t,e,i){"use strict";var r=i("83ab"),n=i("e8b5"),o=TypeError,a=Object.getOwnPropertyDescriptor,s=r&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();t.exports=s?function(t,e){if(n(t)&&!a(t,"length").writable)throw new o("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e}},"3a59":function(t,e,i){"use strict";i.r(e);var r=function(){var t=this,e=t._self._c;return e("div",[e("van-search",{staticClass:"mb-2 shadow",attrs:{placeholder:"请输入搜索关键词"},on:{search:t.refresh,cancel:t.refresh},model:{value:t.itemName,callback:function(e){t.itemName=e},expression:"itemName"}}),e("van-dropdown-menu",[e("van-dropdown-item",{attrs:{disabled:"",options:t.typeList},on:{change:t.refresh},model:{value:t.typeID,callback:function(e){t.typeID=e},expression:"typeID"}}),e("van-dropdown-item",{attrs:{options:t.brandList},on:{change:t.refresh},model:{value:t.brandID,callback:function(e){t.brandID=e},expression:"brandID"}})],1),e("van-empty",{directives:[{name:"show",rawName:"v-show",value:t.showEmpty,expression:"showEmpty"}],attrs:{description:"暂无产品"}}),e("van-list",{staticClass:"mt-4",attrs:{finished:t.finished,error:t.error,"error-text":"请求失败,点击重新加载","finished-text":""},on:{"update:error":function(e){t.error=e},load:t.loadItemList},model:{value:t.loading,callback:function(e){t.loading=e},expression:"loading"}},t._l(t.itemList,(function(i,r){return e("div",{key:r,staticClass:"bg-white mb-4 w-23/24 mx-auto text-sm shadow px-4 py-4 flex items-center justify-between"},[e("div",[e("div",{staticClass:"mb-2"},[t._v(t._s(i.brand_name)+" "+t._s(i.type_name))]),e("div",[t._v(t._s(i.item_name)+" ")]),i.colors.length>0?e("div",{staticClass:"mt-2"},[e("van-field",{staticClass:"p-0",attrs:{readonly:"",clickable:"",name:"picker",value:i.color_text,placeholder:"点击选择颜色"},on:{click:function(e){return t.handleShowPicker(r,i.colors)}}}),e("van-popup",{attrs:{position:"bottom"},model:{value:t.showColorPicker,callback:function(e){t.showColorPicker=e},expression:"showColorPicker"}},[e("van-picker",{attrs:{"show-toolbar":"",columns:t.pickerData.options},on:{confirm:t.colorConfirm,cancel:function(e){t.showPicker=!1}}})],1)],1):t._e()]),e("van-button",{attrs:{type:"info",size:"small"},on:{click:function(e){return t.handleSelectItem(i)}}},[t._v("选择")])],1)})),0)],1)},n=[],o=(i("4160"),i("14d9"),i("d3b7"),i("159b"),i("0088"));function a(t){return Object(o["a"])({url:"items",method:"get",params:t})}function s(t){return Object(o["a"])({url:"item_types",method:"get",params:t})}var c=i("6687");function d(t){return Object(o["a"])({url:"brands",method:"get",params:t})}var l=i("200e"),h={data:function(){return{showColorPicker:!1,itemList:[],loading:!1,error:!1,page:1,finished:!1,showEmpty:!1,itemName:"",typeID:0,brandID:0,pickInfo:{},typeList:[],brandList:[],query:{},orderCacheKey:"",pickerData:{key:0,options:[]}}},created:function(){this.query=this.$route.query,this.orderCacheKey="pick_order_"+this.query.pkg_id,this.query.order_id>0&&(this.orderCacheKey="pick_order_edit_"+this.query.pkg_id),console.log(this.orderCacheKey),this.loadTypeList()},methods:{handleShowPicker:function(t,e){this.pickerData={key:t,options:e},this.showColorPicker=!0},colorConfirm:function(t){console.log(t),this.itemList[this.pickerData.key]["color_text"]=t,this.showColorPicker=!1},handleSelectItem:function(t){var e=l["a"].get(this.orderCacheKey);return e?t.colors.length>0&&""===t.color_text?(this.$toast("请选择颜色"),!1):(e.item[this.query.tab_index][this.query.pick_id]={id:t.id,num:1,remarks:"",brand_name:t["brand_name"],type_name:t["type_name"],item_name:t["item_name"],unit_name:t["unit_name"],color:t["color_text"],level:t["level"]},l["a"].set(this.orderCacheKey,e),void(this.query.order_id>0?this.$router.push({path:"/pick/orders/"+this.query.order_id+"/edit",query:this.query}):this.$router.push({path:"/pick/orders/add",query:this.query}))):(this.$toast("数据有误"),!1)},loadSubInfo:function(t){var e=this;this.$store.commit("loading/showLoading"),Object(c["a"])(this.query.pick_id).then((function(i){e.pickInfo=i.data,e.typeID=i.data.item_type,e.$store.commit("loading/hideLoading"),t()}))},refresh:function(){return console.log("ok"),this.finished=!1,this.loading=!1,this.error=!1,this.page=1,this.itemList=[],this.loadItemList(),!0},loadItemList:function(){this.loading=!0;var t=this;this.TypeID?this.fetchItemList():this.loadSubInfo((function(){t.fetchItemList(),t.loadBrandList()}))},fetchItemList:function(){var t=this;a({page:this.page++,name:this.itemName,brand_id:this.brandID,type_id:this.typeID}).then((function(e){for(var i in t.loading=!1,e.data.length