1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-34a2d722"],{"14d9":function(t,e,r){"use strict";var a=r("23e7"),i=r("7b0b"),o=r("07fa"),n=r("3a34"),s=r("3511"),c=r("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}},u=d||!l();a({target:"Array",proto:!0,arity:1,forced:u},{push:function(t){var e=i(this),r=o(e),a=arguments.length;s(r+a);for(var c=0;c<a;c++)e[r]=arguments[c],r++;return n(e,r),r}})},"1b4b":function(t,e,r){"use strict";r.r(e);var a=function(){var t=this,e=t._self._c;return e("div",[e("van-nav-bar",{staticClass:"shadow mb-2",attrs:{title:"选择"+t.categoryName,"left-text":"返回","left-arrow":""},on:{"click-left":t.handleBack}}),e("van-dropdown-menu",[e("van-dropdown-item",{attrs:{disabled:"",options:t.categoryList},on:{change:t.refresh},model:{value:t.category,callback:function(e){t.category=e},expression:"category"}}),e("van-dropdown-item",{attrs:{options:t.roomList},on:{change:t.refresh},model:{value:t.roomID,callback:function(e){t.roomID=e},expression:"roomID"}})],1),e("van-search",{attrs:{placeholder:"请输入搜索关键词"},on:{search:t.refresh,clear:t.refresh},model:{value:t.bidName,callback:function(e){t.bidName=e},expression:"bidName"}}),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.loadBidList},model:{value:t.loading,callback:function(e){t.loading=e},expression:"loading"}},t._l(t.bidList,(function(r,a){return e("div",{key:a,staticClass:"bg-white mb-4 w-23/24 mx-auto text-sm shadow px-4 py-4 flex items-center justify-between"},[e("div",{staticClass:"w-5/6"},[e("div",{staticClass:"mb-2 text-gray-400"},[t._v(t._s(r.category_name)+" "+t._s(r.room_type_name))]),e("div",{staticClass:"text-lg pb-1"},[t._v(" "+t._s(r.bid_name)+" ")]),e("div",{staticClass:"text-gray-400 text-sm"},[t._v(t._s(r.price)+"元/"+t._s(r.unit_name))])]),1==r.selected?e("van-button",{attrs:{type:"info",disabled:"",size:"small"}},[t._v("已选择")]):e("van-button",{attrs:{type:"info",size:"small"},on:{click:function(e){return t.handleSelectItem(r)}}},[t._v("选择")])],1)})),0),e("div",{staticClass:"fixed bottom-2 left-0 w-full xl:w-800px xl:left-400pxh text-white text-center"},[e("span",{staticClass:"inline-block w-2/3 bg-blue-500 py-3 text-center rounded-full",on:{click:t.handleBack}},[t._v("确认选择")])])],1)},i=[],o=(r("4160"),r("14d9"),r("d3b7"),r("e25e"),r("159b"),r("a3ea")),n=r("ead7"),s=r("200e"),c={data:function(){return{showColorPicker:!1,bidList:[],loading:!1,error:!1,page:1,finished:!1,showEmpty:!1,bidName:"",typeID:0,brandID:0,pickInfo:{},categoryName:"",category:-1,roomList:[],roomID:-1,pkgID:0,orderID:0,categoryList:[],orderCacheKey:"bid_order_key1",pickerData:{key:0,options:[]}}},created:function(){this.pkgID=this.$route.query.pkg_id,this.orderID=this.$route.query.order_id,this.category=parseInt(this.$route.query.category),this.orderID>0&&(this.orderCacheKey="bid_order_edit1"),this.loadParams()},methods:{isSelected:function(t){var e=s["a"].get(this.orderCacheKey);console.log(t);for(var r=0;r<e.customize[this.category].length;r++)if(e.customize[this.category][r]["id"]===t)return 1;return 0},handleBack:function(){var t=s["a"].get(this.orderCacheKey);t.id>0?this.$router.push({path:"/bid/orders/"+t.id+"/edit",query:{pkg_id:this.pkgID,step:3}}):this.$router.push({path:"/bid/detail",query:{pkg_id:this.pkgID,step:3}})},loadParams:function(){var t=this;Object(n["a"])({params:"material_room_type,material_bid_category"}).then((function(e){var r=[{text:"选择类别",value:-1}];e.data.material_bid_category.forEach((function(t){r.push({text:t.name,value:t.id})})),t.categoryList=r,console.log(t.categoryList);var a=[{text:"房屋类型",value:-1}];e.data.material_room_type.forEach((function(t){a.push({text:t.name,value:t.id})})),t.roomList=a}))},handleSelectItem:function(t){t.selected=1;var e=s["a"].get(this.orderCacheKey);e.customize[this.category].push({id:t["id"],num:1,room_type_name:t["room_type_name"],category_name:t["category_name"],bid_name:t["bid_name"],unit_name:t["unit_name"],price:t["price"]}),s["a"].set(this.orderCacheKey,e)},refresh:function(){return console.log("ok"),this.finished=!1,this.loading=!1,this.error=!1,this.page=1,this.bidList=[],this.loadBidList(),!0},loadBidList:function(){var t=this;this.loading=!0,Object(o["d"])({page:this.page++,pkg_id:this.pkgID,category:this.category,room_type:this.roomID,level:2,bid_name:this.bidName}).then((function(e){for(var r in t.loading=!1,e.data.length<t.$store.getters.setting.page_size&&(t.finished=!0),e.data)e.data[r]["selected"]=t.isSelected(e.data[r]["id"]),t.bidList.push(e.data[r]);console.log(t.bidList),0===t.bidList.length?t.showEmpty=!0:t.showEmpty=!1})).catch((function(e){console.log(e),t.loading=!1,t.error=!0}))}}},d=c,l=(r("f905"),r("2877")),u=Object(l["a"])(d,a,i,!1,null,"02c7afb8",null);e["default"]=u.exports},"200e":function(t,e,r){"use strict";var a="Material-Storage";e["a"]={get:function(t){var e=window.localStorage.getItem(a+"_"+t);return e?window.JSON.parse(e):""},set:function(t,e){window.localStorage.setItem(a+"_"+t,window.JSON.stringify(e))},del:function(t,e){window.localStorage.removeItem(a+"_"+t)}}},3511:function(t,e,r){"use strict";var a=TypeError,i=9007199254740991;t.exports=function(t){if(t>i)throw a("Maximum allowed index exceeded");return t}},"3a34":function(t,e,r){"use strict";var a=r("83ab"),i=r("e8b5"),o=TypeError,n=Object.getOwnPropertyDescriptor,s=a&&!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(i(t)&&!n(t,"length").writable)throw new o("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e}},a3ea:function(t,e,r){"use strict";r.d(e,"f",(function(){return i})),r.d(e,"e",(function(){return o})),r.d(e,"a",(function(){return n})),r.d(e,"b",(function(){return s})),r.d(e,"d",(function(){return c})),r.d(e,"c",(function(){return d}));var a=r("0088");function i(t){return Object(a["a"])({url:"bid/outline",method:"get",params:t})}function o(){return Object(a["a"])({url:"bid/detail",method:"get"})}function n(t){return Object(a["a"])({url:"bid/detail_calc",method:"post",data:t})}function s(t){return Object(a["a"])({url:"bid/detail_calc_toilet",method:"post",data:t})}function c(t){return Object(a["a"])({url:"bids",method:"get",params:t})}function d(t){return Object(a["a"])({url:"bid/export",method:"get",params:{pkg_id:t}})}},cf57:function(t,e,r){},ead7:function(t,e,r){"use strict";r.d(e,"a",(function(){return i}));var a=r("0088");function i(t){return Object(a["a"])({url:"params",method:"get",params:t})}},f905:function(t,e,r){"use strict";r("cf57")}}]);
|