123 |
- (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;c<o;c++)e[r]=arguments[c],r++;return a(e,r),r}})},"1da1":function(t,e,r){"use strict";r.d(e,"a",(function(){return n}));r("d3b7");function o(t,e,r,o,n,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(o,n)}function n(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function s(t){o(a,n,i,s,c,"next",t)}function c(t){o(a,n,i,s,c,"throw",t)}s(void 0)}))}}},"200e":function(t,e,r){"use strict";var o="Material-Storage";e["a"]={get:function(t){var e=window.localStorage.getItem(o+"_"+t);return e?window.JSON.parse(e):""},set:function(t,e){window.localStorage.setItem(o+"_"+t,window.JSON.stringify(e))},del:function(t,e){window.localStorage.removeItem(o+"_"+t)}}},"23dc":function(t,e,r){"use strict";var o=r("d44e");o(Math,"Math",!0)},"26e9":function(t,e,r){"use strict";var o=r("23e7"),n=r("e330"),i=r("e8b5"),a=n([].reverse),s=[1,2];o({target:"Array",proto:!0,forced:String(s)===String(s.reverse())},{reverse:function(){return i(this)&&(this.length=this.length),a(this)}})},3410:function(t,e,r){"use strict";var o=r("23e7"),n=r("d039"),i=r("7b0b"),a=r("e163"),s=r("e177"),c=n((function(){a(1)}));o({target:"Object",stat:!0,forced:c,sham:!s},{getPrototypeOf:function(t){return a(i(t))}})},3511:function(t,e,r){"use strict";var o=TypeError,n=9007199254740991;t.exports=function(t){if(t>n)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<e.length;)if(i.call(e,n))return r.value=e[n],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(Object(o["a"])(e)+" is not iterable")}return _.prototype=w,a(O,"constructor",{value:w,configurable:!0}),a(w,"constructor",{value:_,configurable:!0}),_.displayName=l(w,d,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===_||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l(t,d,"GeneratorFunction")),t.prototype=Object.create(O),t},e.awrap=function(t){return{__await:t}},j(L.prototype),l(L.prototype,u,(function(){return this})),e.AsyncIterator=L,e.async=function(t,r,o,n,i){void 0===i&&(i=Promise);var a=new L(h(t,r,o,n),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(O),l(O,d,"Generator"),l(O,c,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var o in e)r.push(o);return r.reverse(),function t(){for(;r.length;){var o=r.pop();if(o in e)return t.value=o,t.done=!1,t}return t.done=!0,t}},e.values=D,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach($),!e)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(o,n){return s.type="throw",s.arg=e,r.next=o,n&&(r.method="next",r.arg=t),!!n}for(var n=this.tryEntries.length-1;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<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var n=o;break}}n&&("break"===t||"continue"===t)&&n.tryLoc<=e&&e<=n.finallyLoc&&(n=null);var a=n?n.completion:{};return a.type=t,a.arg=e,n?(this.method="next",this.next=n.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=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;e<t.house_style.length;e++){var r=t.house_style[e]["num"];1===t.house_style[e]["unique"]&&(r=1);for(var o=0;o<t.house_style[e]["num"];o++){var n=this.roomTypes[t.house_style[e]["type"]],i=Object(c["a"])(this.pickList[t.house_style[e]["type"]]);r>1&&(n+=o+1),this.orderData.push({picks:i,name:n,on:0})}}if(0===t.item.length){for(var a=0;a<this.orderData.length;a++){for(var s={},d=0;d<this.orderData[a]["picks"].length;d++){var l=this.orderData[a]["picks"][d];s[l["id"]]={id:0,num:0,remarks:"",level:1,color:""}}t["item"][a]=s}this.orderForm=t,u["a"].set(this.orderCacheKey,this.orderForm)}console.log(this.tabIndex),this.changeTab(this.tabIndex)},onConfirm:function(t){for(var e=[],r=[],o=0;o<t.length;o++)e.push(t[o]["name"]),r.push({type:parseInt(t[o]["room_type"]),num:t[o]["id"],unique:parseInt(t[o]["unique"])});this.orderForm.room_text!==e.join(" ")&&(this.orderForm.item=[]),this.orderForm.room_text=e.join(" "),this.orderForm.house_style=r,this.showHouseStylePicker=!1}}},h=l,m=r("2877"),f=Object(m["a"])(h,o,n,!1,null,null,null);e["default"]=f.exports}}]);
|