(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-76235eb7"],{"083a":function(e,t,r){"use strict";var o=r("0d51"),n=TypeError;e.exports=function(e,t){if(!delete e[t])throw new n("Cannot delete property "+o(t)+" of "+o(e))}},"0868":function(e,t,r){},"0c47":function(e,t,r){"use strict";var o=r("da84"),n=r("d44e");n(o.JSON,"JSON",!0)},"131a":function(e,t,r){"use strict";var o=r("23e7"),n=r("d2bb");o({target:"Object",stat:!0},{setPrototypeOf:n})},"14d9":function(e,t,r){"use strict";var o=r("23e7"),n=r("7b0b"),a=r("07fa"),i=r("3a34"),s=r("3511"),c=r("d039"),u=c((function(){return 4294967297!==[].push.call({length:4294967296},1)})),l=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}},d=u||!l();o({target:"Array",proto:!0,arity:1,forced:d},{push:function(e){var t=n(this),r=a(t),o=arguments.length;s(r+o);for(var c=0;cn)throw o("Maximum allowed index exceeded");return e}},"3a34":function(e,t,r){"use strict";var o=r("83ab"),n=r("e8b5"),a=TypeError,i=Object.getOwnPropertyDescriptor,s=o&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=s?function(e,t){if(n(e)&&!i(e,"length").writable)throw new a("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},"7a82":function(e,t,r){"use strict";var o=r("23e7"),n=r("83ab"),a=r("9bf2").f;o({target:"Object",stat:!0,forced:Object.defineProperty!==a,sham:!n},{defineProperty:a})},"7e12":function(e,t,r){"use strict";var o=r("da84"),n=r("d039"),a=r("e330"),i=r("577e"),s=r("58a8").trim,c=r("5899"),u=a("".charAt),l=o.parseFloat,d=o.Symbol,h=d&&d.iterator,f=1/l(c+"-0")!==-1/0||h&&!n((function(){l(Object(h))}));e.exports=f?function(e){var t=s(i(e)),r=l(t);return 0===r&&"-"===u(t,0)?-0:r}:l},"944a":function(e,t,r){"use strict";var o=r("d066"),n=r("e065"),a=r("d44e");n("toStringTag"),a(o("Symbol"),"Symbol")},9901:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var o=r("53ca");r("d9e2"),r("d401"),r("4160"),r("b64b"),r("d3b7"),r("e25e"),r("4d63"),r("c607"),r("ac1f"),r("2c3e"),r("00b4"),r("25f0"),r("4d90"),r("5319"),r("159b");function n(e){if(!e&&"object"!==Object(o["a"])(e))throw new Error("error arguments","shallowClone");var t=e.constructor===Array?[]:{};return Object.keys(e).forEach((function(r){e[r]&&"object"===Object(o["a"])(e[r])?t[r]=n(e[r]):t[r]=e[r]})),t}},a15b:function(e,t,r){"use strict";var o=r("23e7"),n=r("e330"),a=r("44ad"),i=r("fc6a"),s=r("a640"),c=n([].join),u=a!==Object,l=u||!s("join",",");o({target:"Array",proto:!0,forced:l},{join:function(e){return c(i(this),void 0===e?",":e)}})},a3ea:function(e,t,r){"use strict";r.d(t,"f",(function(){return n})),r.d(t,"e",(function(){return a})),r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return s})),r.d(t,"d",(function(){return c})),r.d(t,"c",(function(){return u}));var o=r("0088");function n(e){return Object(o["a"])({url:"bid/outline",method:"get",params:e})}function a(){return Object(o["a"])({url:"bid/detail",method:"get"})}function i(e){return Object(o["a"])({url:"bid/detail_calc",method:"post",data:e})}function s(e){return Object(o["a"])({url:"bid/detail_calc_toilet",method:"post",data:e})}function c(e){return Object(o["a"])({url:"bids",method:"get",params:e})}function u(e){return Object(o["a"])({url:"bid/export",method:"get",params:{pkg_id:e}})}},a434:function(e,t,r){"use strict";var o=r("23e7"),n=r("7b0b"),a=r("23cb"),i=r("5926"),s=r("07fa"),c=r("3a34"),u=r("3511"),l=r("65f0"),d=r("8418"),h=r("083a"),f=r("1dde"),m=f("splice"),p=Math.max,v=Math.min;o({target:"Array",proto:!0,forced:!m},{splice:function(e,t){var r,o,f,m,y,b,g=n(this),_=s(g),w=a(e,_),x=arguments.length;for(0===x?r=o=0:1===x?(r=0,o=_-w):(r=x-2,o=v(p(i(t),0),_-w)),u(_+r-o),f=l(g,o),m=0;m_-o+r;m--)h(g,m-1)}else if(r>o)for(m=_-o;m>w;m--)y=m+o-1,b=m+r-1,y in g?g[b]=g[y]:h(g,b);for(m=0;m=0;--n){var i=this.tryEntries[n],s=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var c=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&a.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),N(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var o=r.completion;if("throw"===o.type){var n=o.arg;N(r)}return n}}throw Error("illegal catch attempt")},delegateYield:function(t,r,o){return this.delegate={iterator:I(t),resultName:r,nextLoc:o},"next"===this.method&&(this.arg=e),b}},t}},d81d:function(e,t,r){"use strict";var o=r("23e7"),n=r("b727").map,a=r("1dde"),i=a("map");o({target:"Array",proto:!0,forced:!i},{map:function(e){return n(this,e,arguments.length>1?arguments[1]:void 0)}})},ddfa:function(e,t,r){"use strict";r.r(t);var o=function(){var e=this,t=e._self._c;return t("div",[t("van-nav-bar",{staticClass:"shadow mb-4",attrs:{title:"报价精算","left-text":"返回","left-arrow":""},on:{"click-left":e.handleBack}}),t("div",{staticClass:"mt-2"},[1==e.step?t("div",{staticClass:"w-23/24 mx-auto"},[t("van-form",{ref:"userForm",staticClass:"bg-white shadow",attrs:{"validate-first":"","validate-trigger":"onSubmit"}},[t("p",{staticClass:"bg-yellow-600 bg-opacity-80 text-white px-4 py-2"},[e._v(" 添加客户信息 ")]),t("van-field",{attrs:{name:"customer_name",label:"客户名称",placeholder:"客户名称",rules:[{required:!0,message:"请填写客户名称"}]},model:{value:e.orderForm.customer_name,callback:function(t){e.$set(e.orderForm,"customer_name",t)},expression:"orderForm.customer_name"}}),t("van-field",{attrs:{type:"number",name:"customer_phone",label:"客户电话",placeholder:"客户电话",rules:[{required:!0,message:"请填写客户电话"},{pattern:/^((13[0-9])|(14[5,7])|(15[0-3,5-9])|(17[0,3,5-8])|(18[0-9])|162|166|198|199|191|(147))\d{8}$/,message:"手机号码格式错误!"}]},model:{value:e.orderForm.customer_phone,callback:function(t){e.$set(e.orderForm,"customer_phone",t)},expression:"orderForm.customer_phone"}}),t("van-field",{attrs:{name:"address",label:"房屋地址",placeholder:"房屋地址",rules:[{required:!0,message:"请填写房屋地址"}]},model:{value:e.orderForm.house_address,callback:function(t){e.$set(e.orderForm,"house_address",t)},expression:"orderForm.house_address"}}),t("van-field",{staticClass:"text-gray-600",attrs:{type:"number",name:"area",label:"外框面积",placeholder:"外框面积",rules:[{required:!0,message:"请填写外框面积"}]},model:{value:e.orderForm.area,callback:function(t){e.$set(e.orderForm,"area",t)},expression:"orderForm.area"}}),t("van-field",{attrs:{name:"room_text",label:"房屋户型",placeholder:"房屋户型",readonly:"",rules:[{required:!0,message:"请选择户型"}]},on:{click:function(t){e.showHouseStylePicker=!0}},model:{value:e.orderForm.roomText,callback:function(t){e.$set(e.orderForm,"roomText",t)},expression:"orderForm.roomText"}}),t("van-popup",{attrs:{position:"bottom"},model:{value:e.showHouseStylePicker,callback:function(t){e.showHouseStylePicker=t},expression:"showHouseStylePicker"}},[t("van-picker",{attrs:{"show-toolbar":"",columns:e.houseStyle,"value-key":"name"},on:{confirm:e.onConfirm}})],1)],1),t("van-button",{staticClass:"mt-4",attrs:{block:"",type:"info","loading-text":"加载中...","native-type":"submit"},on:{click:e.handleSubmitUser}},[e._v("下一步")])],1):e._e(),2==e.step?t("van-form",{ref:"orderForm",staticClass:"w-23/24 mx-auto",attrs:{"validate-first":"","validate-trigger":"onSubmit"}},[e._l(e.orderForm.param,(function(r,o){return t("div",{key:o,staticClass:"shadow bg-white mb-4"},[t("div",{class:e.roomTypeColor[r.room_type]+" text-white py-2 px-4"},[e._v(" "+e._s(r.room_name)+" ")]),t("div",[t("van-field",{attrs:{placeholder:"请填写面积,单位平方米",name:"area",type:"number",label:"面积",rules:[{validator:e.validatorNum,message:"请填写面积"}]},scopedSlots:e._u([{key:"button",fn:function(){return[e._v("㎡")]},proxy:!0}],null,!0),model:{value:r.area,callback:function(t){e.$set(r,"area",t)},expression:"item.area"}}),1!=r.room_type?t("van-field",{attrs:{placeholder:"请填写周长,单位米",name:"round",type:"number",label:"周长",rules:[{validator:e.validatorNum,message:"请填写周长"}]},scopedSlots:e._u([{key:"button",fn:function(){return[e._v("m")]},proxy:!0}],null,!0),model:{value:r.round,callback:function(t){e.$set(r,"round",t)},expression:"item.round"}}):e._e()],1)])})),t("div",{staticClass:"fixed bottom-0 left-0 w-full xl:w-800px xl:left-400pxh text-white bg-blue-500 text-center py-3",on:{click:e.handleCalc}},[e._v(" 下一步 ")])],2):e._e(),3==e.step?t("div",[t("div",[t("div",{staticClass:"bg-white w-23/24 mx-auto shadow mb-4"},[t("p",{staticClass:"bg-yellow-500 bg-opacity-80 text-white px-4 py-2"},[e._v(" 报价结果 ")]),t("div",{staticClass:"p-4"},[t("div",{staticClass:"pb-1"},[e._v(" 测量面积:"),t("span",{staticClass:"text-red-600"},[e._v(e._s(e.area)+" 平米")])]),t("div",[e._v(" 报价合计:"),t("span",{staticClass:"text-red-600"},[e._v(e._s(e.money)+" 元")])])])]),t("div",{staticClass:"bg-white w-23/24 mx-auto shadow mb-4"},[t("p",{staticClass:"bg-green-500 bg-opacity-80 text-white px-4 py-2"},[e._v(" 套餐设置 ")]),t("div",{staticClass:"p-4"},[t("van-cell",{attrs:{center:"",title:"有无电梯"},scopedSlots:e._u([{key:"right-icon",fn:function(){return[t("van-switch",{attrs:{"active-value":1,"inactive-value":0,size:"24"},on:{change:e.handleSetting},model:{value:e.orderForm.is_elevator,callback:function(t){e.$set(e.orderForm,"is_elevator",t)},expression:"orderForm.is_elevator"}})]},proxy:!0}],null,!1,2607149545)}),t("van-cell",{attrs:{center:"",title:"所在楼层"},scopedSlots:e._u([{key:"right-icon",fn:function(){return[t("van-field",{staticClass:"border w-2/5 px-4 py-1",attrs:{type:"number",placeholder:"请输入楼层",size:"mini"},on:{change:e.handleSetting},model:{value:e.orderForm.floor_num,callback:function(t){e.$set(e.orderForm,"floor_num",t)},expression:"orderForm.floor_num"}})]},proxy:!0}],null,!1,1977807137)}),t("van-cell",{attrs:{center:"",title:"定制品面积"},scopedSlots:e._u([{key:"right-icon",fn:function(){return[t("van-field",{staticClass:"border w-2/5 px-4 py-1",attrs:{type:"number",placeholder:"请输入定制品面积",size:"mini"},on:{change:e.handleSetting},model:{value:e.orderForm.inclusive_area,callback:function(t){e.$set(e.orderForm,"inclusive_area",t)},expression:"orderForm.inclusive_area"}})]},proxy:!0}],null,!1,1102621650)}),t("van-notice-bar",{attrs:{"left-icon":"info-o"}},[e._v("复式楼、别墅户内按无电梯计算")])],1)]),t("div",{staticClass:"bg-white w-23/24 mx-auto shadow"},[t("p",{staticClass:"bg-green-500 bg-opacity-80 text-white px-4 py-2"},[e._v(" 报价项目 ")]),t("van-collapse",{attrs:{accordion:""},model:{value:e.activeNames,callback:function(t){e.activeNames=t},expression:"activeNames"}},e._l(e.bidList,(function(r,o){return t("van-collapse-item",{key:o,attrs:{title:r.room_name,name:r.room_name,size:"large"}},e._l(r.bid_item,(function(r,o){return t("div",{key:o},[r.length>0?t("div",{staticClass:"mb-4"},[t("div",{staticClass:"font-bold bg-red-400 text-white px-2 py-1"},[e._v(" "+e._s(e.categoryMap[o])+" ")]),t("div",{staticClass:"border px-2 py-1 border-red-400"},e._l(r,(function(r,o){return t("div",{key:o},[e._v(" "+e._s(r.type_names)+" "+e._s(r.bid_name)+" ")])})),0)]):e._e()])})),0)})),1)],1)]),t("div",{staticClass:"fixed bottom-0 left-0 w-full xl:w-800px xl:left-400pxh text-white"},[t("span",{staticClass:"inline-block w-2/3 bg-gray-400 py-3 text-center"},[e._v(" 总价:"+e._s(e.money)+" 元 ")]),t("span",{staticClass:"inline-block w-1/3 bg-yellow-500 py-3 text-center",attrs:{loading:e.submitLoading},on:{click:e.handleSubmitOrder}},[e._v("保存")])])]):e._e()],1)],1)},n=[],a=r("c7eb"),i=r("1da1"),s=(r("4160"),r("a15b"),r("d81d"),r("14d9"),r("a434"),r("d3b7"),r("acd8"),r("e25e"),r("159b"),r("a3ea")),c=r("15e4"),u=r("200e"),l=r("9901"),d=r("ead7"),h={data:function(){return{activeNames:[],step:1,area:0,houseStyle:{},orderForm:{id:0,is_inclusive:0,param:[],is_elevator:1,floor_num:1,inclusive_area:0,customize:{}},orderID:0,submitLoading:!1,bidList:{0:{},1:{},2:{},3:{},4:{},5:{}},roomTypeColor:{1:"bg-blue-400",2:"bg-yellow-400",3:"bg-green-400",4:"bg-red-400",5:"bg-purple-400"},money:0,categoryMap:{},showHouseStylePicker:!1,orderCacheKey:"bid_order_key1"}},created:function(){var e=this;this.loadDetailInfo(),this.$route.query&&this.$route.query.pkg_id?(this.orderForm.pkg_id=parseInt(this.$route.query.pkg_id),this.orderCacheKey=this.orderCacheKey+"_"+this.orderForm.pkg_id):this.$notify("套餐 id 有误"),this.$route.query&&this.$route.query.order_id?this.loadOrderInfo(this.$route.query.order_id).then((function(t){e.orderForm.id=0,e.orderForm.customize={},e.is_inclusive=0,u["a"].set(e.orderCacheKey,e.orderForm),e.loadParams(),e.$router.push({path:"/bid/detail",query:{pkg_id:e.orderForm.pkg_id}})})):(this.$route.params&&this.$route.params.order_id&&(this.orderID=parseInt(this.$route.params.order_id),this.orderCacheKey="bid_order_edit1"),this.orderID>0&&"3"!==this.$route.query.step?this.loadOrderInfo(this.orderID):this.loadOrderCache(),this.loadParams(),"3"===this.$route.query.step&&(this.step=3,this.calc()))},methods:{handleSetting:function(){console.log(this.orderForm),this.calc()},loadOrderInfo:function(e){var t=this;return Object(i["a"])(Object(a["a"])().mark((function r(){return Object(a["a"])().wrap((function(r){while(1)switch(r.prev=r.next){case 0:return t.$store.commit("loading/showLoading"),r.next=3,Object(c["d"])(e).then((function(e){var r=e.data.orderInfo;t.orderForm={id:r.id,pkg_id:r.pkg_id,customer_name:r.customer_name,customer_phone:r.customer_phone,house_address:r.house_address,roomText:r.room_text,house_style:r.house_style_decode,customize:r.customize_decode,is_elevator:r.is_elevator,floor_num:r.floor_num,inclusive_area:r.inclusive_area,area:r.house_area,param:t.formatParam(r.param_decode)},u["a"].set(t.orderCacheKey,t.orderForm),t.$store.commit("loading/hideLoading")}));case 3:case"end":return r.stop()}}),r)})))()},formatParam:function(e){var t=[];return e.forEach((function(e,r){e["room_type"]>0&&(delete e["items"],t.push(e))})),t},loadParams:function(){var e=this;Object(d["a"])({params:"material_bid_category"}).then((function(t){var r=e,o={};t.data.material_bid_category.forEach((function(e){Object.prototype.hasOwnProperty.call(r.orderForm.customize,e.id)?o[e.id]=r.orderForm.customize[e.id]:2===e.level&&(o[e.id]=[]),r.categoryMap[e.id]=e.name})),console.log(o),e.orderForm.customize=o,console.log(e.orderForm)}))},delCustomize:function(e,t){this.orderForm["customize"][e].splice(t,1),u["a"].set(this.orderCacheKey,this.orderForm),this.calc(),console.log(t)},changeCustomize:function(e){if(""===e)return!1;this.calc()},addCustomize:function(e){this.$router.push({path:"/bid/customize",query:{pkg_id:this.orderForm.pkg_id,category:e,order_id:this.orderID}})},handleBack:function(){this.step=this.step-1,console.log(this.step),this.step<1&&this.$router.push("/")},loadOrderCache:function(){u["a"].get(this.orderCacheKey)&&(this.orderForm=u["a"].get(this.orderCacheKey))},validatorNum:function(e){return""!==e&&e>0},parseOrderForm:function(){var e=Object(l["a"])(this.orderForm);for(var t in e.floor_num=isNaN(parseInt(e.floor_num))?1:parseInt(e.floor_num),e.inclusive_area=isNaN(parseInt(e.inclusive_area))?0:parseInt(e.inclusive_area),e.area=isNaN(parseFloat(e.area))?0:parseFloat(e.area),e.param.map((function(e){return e.area=isNaN(parseFloat(e.area))?0:parseFloat(e.area),e.round=isNaN(parseFloat(e.round))?0:parseFloat(e.round),e.hole=isNaN(parseFloat(e.hole))?0:parseFloat(e.hole),e.window=isNaN(parseFloat(e.window))?0:parseFloat(e.window),e})),e.customize)console.log(e.customize[t]),e.customize[t].map((function(e){return e.num=isNaN(parseFloat(e.num))?0:parseFloat(e.num),e}));return e},handleCalc:function(){var e=this;this.$refs.orderForm.validate(["area","hole","round"]).then((function(){e.calc()})).catch((function(t){e.$notify(t[0].message)}))},calc:function(){var e=this,t=this.parseOrderForm();this.$store.commit("loading/showLoading"),Object(s["a"])(t).then((function(t){e.money=t.data.money.toLocaleString(),e.area=t.data.area,e.bidList=t.data.bidList,u["a"].set(e.orderCacheKey,e.orderForm),e.step=3,e.$store.commit("loading/hideLoading")}))},loadDetailInfo:function(){var e=this;this.$store.commit("loading/showLoading"),Object(s["e"])().then((function(t){e.roomTypes=t.data.roomTypes,e.houseStyle=t.data.houseStyle,e.$store.commit("loading/hideLoading")}))},handleSubmitUser:function(){var e=this;this.$refs.userForm.validate(["customer_name","customer_phone","address","room_text"]).then((function(){u["a"].set(e.orderCacheKey,e.orderForm),e.step=2,console.log(e.orderForm)})).catch((function(t){e.$notify(t[0].message)}))},handleSubmitOrder:function(){var e=this,t=this.parseOrderForm();this.submitLoading=!0,t.id>0?Object(c["f"])(t.id,t).then((function(t){var r=e;u["a"].del(e.orderCacheKey),r.$toast.success({message:"保存成功",duration:1e3,onClose:function(){r.submitLoading=!1,r.$router.push("/bid/orders")}})})):Object(c["a"])(t).then((function(t){var r=e;u["a"].del(e.orderCacheKey),r.$toast.success({message:"保存成功",duration:1e3,onClose:function(){r.submitLoading=!1,r.$router.push("/bid/orders")}})}))},onConfirm:function(e){for(var t=[],r=[],o=[],n=0;n1&&(e[n]["num"]=e[n]["num"]-1);for(var a=1;a<=e[n]["num"];a++)o.push({room_name:e[n]["type_name"]+a,room_type:parseInt(e[n]["room_type"]),area:"",round:1==parseInt(e[n]["room_type"])?1:"",hole:""})}var i=this.orderForm;i.roomText=t.join(" "),i.house_style=r,i.param=o,this.orderForm=Object(l["a"])(i),this.showHouseStylePicker=!1}}},f=h,m=(r("c140"),r("2877")),p=Object(m["a"])(f,o,n,!1,null,null,null);t["default"]=p.exports},ead7:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var o=r("0088");function n(e){return Object(o["a"])({url:"params",method:"get",params:e})}}}]);