(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-ffd8ef52"],{"0c47":function(t,e,r){"use strict";var o=r("da84"),n=r("d44e");n(o.JSON,"JSON",!0)},"131a":function(t,e,r){"use strict";var o=r("23e7"),n=r("d2bb");o({target:"Object",stat:!0},{setPrototypeOf:n})},"14d9":function(t,e,r){"use strict";var o=r("23e7"),n=r("7b0b"),i=r("07fa"),a=r("3a34"),s=r("3511"),c=r("d039"),u=c((function(){return 4294967297!==[].push.call({length:4294967296},1)})),d=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}},l=u||!d();o({target:"Array",proto:!0,arity:1,forced:l},{push:function(t){var e=n(this),r=i(e),o=arguments.length;s(r+o);for(var c=0;cn)throw o("Maximum allowed index exceeded");return t}},"3a34":function(t,e,r){"use strict";var o=r("83ab"),n=r("e8b5"),i=TypeError,a=Object.getOwnPropertyDescriptor,s=o&&!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 i("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e}},"629f":function(t,e,r){"use strict";r.d(e,"a",(function(){return n})),r.d(e,"e",(function(){return i})),r.d(e,"c",(function(){return a})),r.d(e,"d",(function(){return s})),r.d(e,"b",(function(){return c}));var o=r("0088");function n(t){return Object(o["a"])({url:"pick/orders",method:"post",data:t})}function i(t,e){return Object(o["a"])({url:"pick/orders/".concat(t),method:"put",data:e})}function a(t){return Object(o["a"])({url:"pick/orders/".concat(t),method:"get"})}function s(t){return Object(o["a"])({url:"pick/orders",method:"get",params:t})}function c(t){return Object(o["a"])({url:"pick/orders/".concat(t,"/export"),method:"get"})}},6687:function(t,e,r){"use strict";r.d(e,"b",(function(){return n})),r.d(e,"a",(function(){return i}));var o=r("0088");function n(t){return Object(o["a"])({url:"picks",method:"get",params:t})}function i(t){return Object(o["a"])({url:"picks/".concat(t),method:"get"})}},"7a82":function(t,e,r){"use strict";var o=r("23e7"),n=r("83ab"),i=r("9bf2").f;o({target:"Object",stat:!0,forced:Object.defineProperty!==i,sham:!n},{defineProperty:i})},"7e12":function(t,e,r){"use strict";var o=r("da84"),n=r("d039"),i=r("e330"),a=r("577e"),s=r("58a8").trim,c=r("5899"),u=i("".charAt),d=o.parseFloat,l=o.Symbol,h=l&&l.iterator,m=1/d(c+"-0")!==-1/0||h&&!n((function(){d(Object(h))}));t.exports=m?function(t){var e=s(a(t)),r=d(e);return 0===r&&"-"===u(e,0)?-0:r}:d},"944a":function(t,e,r){"use strict";var o=r("d066"),n=r("e065"),i=r("d44e");n("toStringTag"),i(o("Symbol"),"Symbol")},9901:function(t,e,r){"use strict";r.d(e,"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(t){if(!t&&"object"!==Object(o["a"])(t))throw new Error("error arguments","shallowClone");var e=t.constructor===Array?[]:{};return Object.keys(t).forEach((function(r){t[r]&&"object"===Object(o["a"])(t[r])?e[r]=n(t[r]):e[r]=t[r]})),e}},a15b:function(t,e,r){"use strict";var o=r("23e7"),n=r("e330"),i=r("44ad"),a=r("fc6a"),s=r("a640"),c=n([].join),u=i!==Object,d=u||!s("join",",");o({target:"Array",proto:!0,forced:d},{join:function(t){return c(a(this),void 0===t?",":t)}})},acd8:function(t,e,r){"use strict";var o=r("23e7"),n=r("7e12");o({global:!0,forced:parseFloat!==n},{parseFloat:n})},b636:function(t,e,r){"use strict";var o=r("e065");o("asyncIterator")},c7eb:function(t,e,r){"use strict";r.d(e,"a",(function(){return n}));r("a4d3"),r("e01a"),r("b636"),r("d28b"),r("944a"),r("d9e2"),r("d401"),r("4160"),r("14d9"),r("26e9"),r("fb6a"),r("0c47"),r("23dc"),r("7a82"),r("3410"),r("131a"),r("d3b7"),r("3ca3"),r("159b"),r("ddb0");var o=r("53ca");function n(){ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ n=function(){return e};var t,e={},r=Object.prototype,i=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},s="function"==typeof Symbol?Symbol:{},c=s.iterator||"@@iterator",u=s.asyncIterator||"@@asyncIterator",d=s.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function h(t,e,r,o){var n=e&&e.prototype instanceof b?e:b,i=Object.create(n.prototype),s=new E(o||[]);return a(i,"_invoke",{value:C(t,r,s)}),i}function m(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var f="suspendedStart",p="suspendedYield",v="executing",y="completed",g={};function b(){}function _(){}function w(){}var k={};l(k,c,(function(){return this}));var x=Object.getPrototypeOf,F=x&&x(x(D([])));F&&F!==r&&i.call(F,c)&&(k=F);var O=w.prototype=b.prototype=Object.create(k);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function L(t,e){function r(n,a,s,c){var u=m(t[n],t,a);if("throw"!==u.type){var d=u.arg,l=d.value;return l&&"object"==Object(o["a"])(l)&&i.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,s,c)}),(function(t){r("throw",t,s,c)})):e.resolve(l).then((function(t){d.value=t,s(d)}),(function(t){return r("throw",t,s,c)}))}c(u.arg)}var n;a(this,"_invoke",{value:function(t,o){function i(){return new e((function(e,n){r(t,o,e,n)}))}return n=n?n.then(i,i):i()}})}function C(e,r,o){var n=f;return function(i,a){if(n===v)throw Error("Generator is already running");if(n===y){if("throw"===i)throw a;return{value:t,done:!0}}for(o.method=i,o.arg=a;;){var s=o.delegate;if(s){var c=I(s,o);if(c){if(c===g)continue;return c}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if(n===f)throw n=y,o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);n=v;var u=m(e,r,o);if("normal"===u.type){if(n=o.done?y:p,u.arg===g)continue;return{value:u.arg,done:o.done}}"throw"===u.type&&(n=y,o.method="throw",o.arg=u.arg)}}}function I(e,r){var o=r.method,n=e.iterator[o];if(n===t)return r.delegate=null,"throw"===o&&e.iterator["return"]&&(r.method="return",r.arg=t,I(e,r),"throw"===r.method)||"return"!==o&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+o+"' method")),g;var i=m(n,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function $(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function D(e){if(e||""===e){var r=e[c];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function r(){for(;++n=0;--n){var a=this.tryEntries[n],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=i.call(a,"catchLoc"),u=i.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),$(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var o=r.completion;if("throw"===o.type){var n=o.arg;$(r)}return n}}throw Error("illegal catch attempt")},delegateYield:function(e,r,o){return this.delegate={iterator:D(e),resultName:r,nextLoc:o},"next"===this.method&&(this.arg=t),g}},e}},d81d:function(t,e,r){"use strict";var o=r("23e7"),n=r("b727").map,i=r("1dde"),a=i("map");o({target:"Array",proto:!0,forced:!a},{map:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}})},e5e4:function(t,e,r){"use strict";r.r(e);var o=function(){var t=this,e=t._self._c;return e("div",[e("van-nav-bar",{staticClass:"shadow mb-4",attrs:{title:t.pkgInfo.pkg_name+"选材","left-text":"返回","left-arrow":""},on:{"click-left":t.handleBack}}),e("div",{staticClass:"mt-2"},[1==t.step?e("div",{staticClass:"w-23/24 mx-auto"},[e("van-form",{ref:"userForm",staticClass:"shadow",attrs:{"validate-first":"","validate-trigger":"onSubmit"}},[e("p",{staticClass:"bg-yellow-600 bg-opacity-80 text-white px-4 py-2"},[t._v("添加客户信息")]),e("van-field",{attrs:{name:"customer_name",label:"客户名称",placeholder:"客户名称",rules:[{required:!0,message:"请填写客户名称"}]},model:{value:t.orderForm.customer_name,callback:function(e){t.$set(t.orderForm,"customer_name",e)},expression:"orderForm.customer_name"}}),e("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:t.orderForm.customer_phone,callback:function(e){t.$set(t.orderForm,"customer_phone",e)},expression:"orderForm.customer_phone"}}),e("van-field",{attrs:{name:"house_address",label:"房屋地址",placeholder:"房屋地址",rules:[{required:!0,message:"请填写房屋地址"}]},model:{value:t.orderForm.house_address,callback:function(e){t.$set(t.orderForm,"house_address",e)},expression:"orderForm.house_address"}}),e("van-field",{attrs:{type:"number",name:"house_area",label:"房屋面积",placeholder:"房屋面积",rules:[{required:!0,message:"请填写房屋面积"}]},model:{value:t.orderForm.house_area,callback:function(e){t.$set(t.orderForm,"house_area",e)},expression:"orderForm.house_area"}}),e("van-field",{attrs:{name:"room_text",label:"房屋户型",placeholder:"房屋户型",readonly:"",rules:[{required:!0,message:"请选择户型"}]},on:{click:function(e){t.showHouseStylePicker=!0}},model:{value:t.orderForm.room_text,callback:function(e){t.$set(t.orderForm,"room_text",e)},expression:"orderForm.room_text"}}),e("van-popup",{attrs:{position:"bottom"},model:{value:t.showHouseStylePicker,callback:function(e){t.showHouseStylePicker=e},expression:"showHouseStylePicker"}},[e("van-picker",{attrs:{"show-toolbar":"",columns:t.houseStyle,"value-key":"name"},on:{confirm:t.onConfirm}})],1)],1),e("van-button",{staticClass:"mt-4",attrs:{block:"",type:"info","loading-text":"加载中...","native-type":"submit"},on:{click:t.handleSubmitUser}},[t._v("下一步")])],1):e("div",{staticClass:"text-sm"},[e("div",{staticClass:"flex"},[e("div",{staticClass:"w-1/6"},t._l(t.orderData,(function(r,o){return e("div",{key:o,class:"py-4 pl-2 "+(r.on?"bg-white border-l-4 border-blue-400 text-blue-400 shadow":""),on:{click:function(e){return t.changeTab(o)}}},[t._v(t._s(r.name))])})),0),e("div",{staticClass:"w-5/6 bg-white p-2"},t._l(t.orderData,(function(r,o){return e("div",{directives:[{name:"show",rawName:"v-show",value:r.on,expression:"item.on"}],key:o},t._l(r.picks,(function(r,n){return e("div",{key:n,staticClass:"shadow mb-2"},[e("p",{staticClass:"bg-blue-400 text-white p-2 flex justify-between items-center"},[e("span",[t._v(t._s(r.pick_name))]),e("van-icon",{attrs:{name:"plus"},on:{click:function(e){return t.addItem(r)}}})],1),t.orderForm["item"][o][r["id"]]["id"]?e("div",{staticClass:"p-2 text-gray-400"},[e("div",{staticClass:"flex justify-between pb-2"},[e("span",{class:2==t.orderForm["item"][o][r["id"]]["level"]?"text-red-600":""},[t._v(t._s(t.orderForm["item"][o][r["id"]]["brand_name"])+" "+t._s(t.orderForm["item"][o][r["id"]]["item_name"]))]),e("van-icon",{attrs:{name:"cross",color:"#ee0a24"},on:{click:function(e){return t.delItem(o,r["id"])}}})],1),""!==t.orderForm["item"][o][r["id"]]["color"]?e("div",{staticClass:"flex items-center pb-2"},[e("span",[t._v("颜色:"+t._s(t.orderForm["item"][o][r["id"]]["color"]))])]):t._e(),2==t.orderForm["item"][o][r["id"]]["level"]?e("div",{staticClass:"flex items-center pb-2"},[e("van-field",{staticClass:"p-0 w-auto",attrs:{name:"stepper"},scopedSlots:t._u([{key:"input",fn:function(){return[e("van-stepper",{attrs:{"default-value":"0",min:"0"},model:{value:t.orderForm["item"][o][r["id"]]["num"],callback:function(e){t.$set(t.orderForm["item"][o][r["id"]],"num",e)},expression:"orderForm['item'][key][pickItem['id']]['num']"}})]},proxy:!0}],null,!0)}),e("span",{staticClass:"pl-2"},[t._v(t._s(t.orderForm["item"][o][r["id"]]["unit_name"]))])],1):t._e(),e("div",[t.orderForm["item"][o][r["id"]]["remarks"]?e("span",[t._v(" 备注:"+t._s(t.orderForm["item"][o][r["id"]]["remarks"])+" "),e("span",{staticClass:"text-sm text-blue-500 pl-2",on:{click:function(e){return t.showRemarks(o,r["id"])}}},[t._v("修改备注")])]):e("span",{staticClass:"text-sm text-blue-500",on:{click:function(e){return t.showRemarks(o,r["id"])}}},[t._v("添加备注")])])]):e("div",{staticClass:"p-2 text-gray-400 text-center"},[t._v(" 请添加 "+t._s(r.pick_name)+" ")])])})),0)})),0)]),e("div",{staticClass:"fixed bottom-0 left-0 w-full xl:w-800px xl:left-400pxh text-white"},[e("span",{staticClass:"inline-block w-2/3 bg-gray-400 py-3 text-center",on:{click:function(e){t.step=1}}},[t._v(" 修改户型 "),e("span",{staticClass:"text-sm"},[t._v(t._s(t.orderForm.room_text))])]),e("span",{staticClass:"inline-block w-1/3 bg-yellow-500 py-3 text-center",on:{click:t.handleSubmitOrder}},[t._v("保存")])])])]),e("van-dialog",{attrs:{title:"添加备注","show-cancel-button":"","class-name":"my-dialog","before-close":t.handleSaveRemarks},model:{value:t.showRemarksDialog,callback:function(e){t.showRemarksDialog=e},expression:"showRemarksDialog"}},[e("van-form",[e("van-field",{attrs:{rows:"3",autosize:"",type:"textarea",placeholder:"请输入备注"},model:{value:t.orderOpt.remarks,callback:function(e){t.$set(t.orderOpt,"remarks",e)},expression:"orderOpt.remarks"}})],1)],1)],1)},n=[],i=r("c7eb"),a=r("1da1"),s=(r("a15b"),r("d81d"),r("14d9"),r("d3b7"),r("acd8"),r("e25e"),r("6687")),c=r("9901"),u=r("200e"),d=r("629f"),l={data:function(){return{showRemarksDialog:!1,orderID:0,pkgInfo:{},showHouseStylePicker:!1,houseStyle:{},pickList:{},roomTypes:{},showItemDialog:!0,orderData:{},orderForm:{pkg_id:0,customer_name:"",customer_phone:"",house_area:"",house_style:[{type:1,num:1},{type:2,num:1},{type:3,num:1},{type:4,num:1},{type:5,num:1}],item:[],room_text:""},step:1,tabIndex:0,orderInfo:{},orderOpt:{tabIndex:0,subID:0,remarks:""},orderCacheKey:"",process:{}}},created:function(){var t=this;this.$route.query.step&&(this.step=this.$route.query.step),this.$route.query.tab_index>=0&&(this.tabIndex=this.$route.query.tab_index),this.$route.query&&this.$route.query.pkg_id?(this.orderForm.pkg_id=this.$route.query.pkg_id,this.orderCacheKey="pick_order_"+this.orderForm.pkg_id):this.$notify("套餐 id 有误"),this.$route.params&&this.$route.params.order_id&&(this.orderID=this.$route.params.order_id,this.orderCacheKey="pick_order_edit_"+this.orderForm.pkg_id),this.loadPickList().then((function(){t.orderID>0&&1===t.step?t.loadOrderInfo():(t.loadOrderCache(),console.log(t.orderForm)),t.createData()}))},methods:{loadOrderCache:function(){u["a"].get(this.orderCacheKey)&&(this.orderForm=u["a"].get(this.orderCacheKey))},loadOrderInfo:function(){var t=this;return Object(a["a"])(Object(i["a"])().mark((function e(){return Object(i["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.$store.commit("loading/showLoading"),e.next=3,Object(d["c"])(t.orderID).then((function(e){t.orderForm=e.data,t.orderForm.house_style=t.orderForm.room,u["a"].set(t.orderCacheKey,t.orderForm),console.log(t.orderForm),t.$store.commit("loading/hideLoading")}));case 3:case"end":return e.stop()}}),e)})))()},handleBack:function(){this.step=this.step-1,this.step<1&&this.$router.push("/")},delItem:function(t,e){this.orderForm["item"][t][e]={id:0,num:0,remarks:""}},showRemarks:function(t,e){this.orderOpt.tabIndex=t,this.orderOpt.subID=e,this.orderOpt.remarks=this.orderForm["item"][t][e]["remarks"],this.showRemarksDialog=!0},handleSaveRemarks:function(t,e){"confirm"===t?(this.orderForm["item"][this.orderOpt.tabIndex][this.orderOpt.subID]["remarks"]=this.orderOpt.remarks,u["a"].set(this.orderCacheKey,this.orderForm),e()):e()},addItem:function(t){this.$router.push({path:"/pick/orders/chooseItem",query:{pick_id:t["id"],pkg_id:this.orderForm.pkg_id,tab_index:this.tabIndex,step:this.step,order_id:this.orderForm.id}})},handleSubmitUser:function(){var t=this;this.$refs.userForm.validate(["customer_name","customer_phone","address","area","room_text"]).then((function(){u["a"].set(t.orderCacheKey,t.orderForm),console.log(t.orderForm),t.createData(),t.step=2})).catch((function(e){console.log(e),console.log("ok"),t.$notify(e[0].message)}))},handleSubmitOrder:function(){var t=this;this.$store.commit("loading/showLoading");var e=this;""===this.orderForm.house_area?this.orderForm.house_area=0:this.orderForm.house_area=parseFloat(this.orderForm.house_area),this.orderForm.pkg_id=parseInt(this.orderForm.pkg_id),this.orderForm.id>0?Object(d["e"])(this.orderForm.id,this.orderForm).then((function(r){u["a"].del(t.orderCacheKey),e.$toast.success({message:"提交成功",duration:1e3,onClose:function(){e.$store.commit("loading/hideLoading"),e.$router.push("/pick/orders")}})})).catch((function(e){t.$store.commit("loading/hideLoading"),console.log(e)})):Object(d["a"])(this.orderForm).then((function(r){u["a"].del(t.orderCacheKey),e.$toast.success({message:"提交成功",duration:1e3,onClose:function(){e.$store.commit("loading/hideLoading"),e.$router.push("/pick/orders")}})})).catch((function(e){t.$store.commit("loading/hideLoading"),console.log(e)}))},changeTab:function(t){t=parseInt(t),this.tabIndex=t,this.orderData.map((function(e,r){e.on=t===r?1:0}))},loadPickList:function(){var t=this;return new Promise((function(e,r){t.$store.commit("loading/showLoading"),Object(s["b"])({pkg_id:t.orderForm.pkg_id}).then((function(r){t.pkgInfo=r.data.pkgInfo,console.log("in picklist"),t.pickList=r.data.pickList,t.roomTypes=r.data.roomTypes,t.houseStyle=r.data.houseStyle,t.$store.commit("loading/hideLoading"),e()})).catch((function(t){r(t)}))}))},createData:function(){this.orderData=[{picks:this.pickList[0],name:this.roomTypes[0],on:1}];var t=Object(c["a"])(this.orderForm);console.log(this.orderForm),console.log(this.pickList);for(var e=0;e1&&(n+=o+1),this.orderData.push({picks:i,name:n,on:0})}}if(0===t.item.length){for(var a=0;a