7d408e6.js 26 KB

12
  1. (window.webpackJsonp=window.webpackJsonp||[]).push([[10,39,40],{525:function(e,t,r){"use strict";var n=r(4),o=r(28),c=r(14),d=/"/g,l=n("".replace);e.exports=function(e,t,r,n){var f=c(o(e)),m="<"+t;return""!==r&&(m+=" "+r+'="'+l(c(n),d,"&quot;")+'"'),m+">"+f+"</"+t+">"}},526:function(e,t,r){"use strict";var n=r(3);e.exports=function(e){return n((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}))}},528:function(e,t,r){"use strict";function n(e,t){return void 0===t&&(t=15),+parseFloat(Number(e).toPrecision(t))}function o(e){var t=e.toString().split(/[eE]/),r=(t[0].split(".")[1]||"").length-+(t[1]||0);return r>0?r:0}function c(e){if(-1===e.toString().indexOf("e"))return Number(e.toString().replace(".",""));var t=o(e);return t>0?n(Number(e)*Math.pow(10,t)):Number(e)}function d(e){y&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&console.warn(e+" is beyond boundary when transfer to integer, the results may not be accurate")}function l(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=t[0];return t.slice(1).reduce((function(t,r){return e(t,r)}),n)}}r.d(t,"c",(function(){return m})),r.d(t,"b",(function(){return h})),r.d(t,"d",(function(){return f})),r.d(t,"a",(function(){return v}));var f=l((function(e,t){var r=c(e),n=c(t),l=o(e)+o(t),f=r*n;return d(f),f/Math.pow(10,l)})),m=l((function(e,t){var r=Math.pow(10,Math.max(o(e),o(t)));return(f(e,r)+f(t,r))/r})),h=l((function(e,t){var r=Math.pow(10,Math.max(o(e),o(t)));return(f(e,r)-f(t,r))/r})),v=l((function(e,t){var r=c(e),l=c(t);return d(r),d(l),f(r/l,n(Math.pow(10,o(t)-o(e))))}));var y=!0},546:function(e,t,r){"use strict";r(2)({target:"Number",stat:!0},{isNaN:function(e){return e!=e}})},549:function(e,t,r){e.exports={}},557:function(e,t,r){"use strict";r.r(t);r(46);var n={name:"StepMixin",components:{},props:{loading:{type:Boolean,default:!1},priceData:{type:Object,default:function(){return{priceList:[],attributeList:{},additionList:{}}}},detail:{type:Object,default:function(){return{info:{images:[]}}}},preData:{type:Object,default:function(){return{}}}},data:function(){return{}},computed:{},watch:{form:{deep:!0,handler:function(){this.loaded&&this.$_emitFormData()}}},mounted:function(){},methods:{$_emitFormData:function(){this.$emit("update-form",JSON.parse(JSON.stringify(this.form)))}}},o=r(22),component=Object(o.a)(n,(function(){return(0,this._self._c)("div",{})}),[],!1,null,"bbcc9c86",null);t.default=component.exports},562:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"h",(function(){return c})),r.d(t,"g",(function(){return l})),r.d(t,"f",(function(){return f})),r.d(t,"e",(function(){return m})),r.d(t,"b",(function(){return h})),r.d(t,"d",(function(){return v})),r.d(t,"c",(function(){return y}));r(40),r(53),r(563),r(521),r(546),r(321),r(11),r(17),r(77);var n=r(528);function o(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return 0===e?t?"$0.00":"0.00":t?"$".concat(e):"".concat(e)}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return Math.round(function(e){return parseFloat((e*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:100)).toPrecision(12))}(e,t))/t}function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=Number(e);return Number.isNaN(r)?e:Object(n.a)(Math.trunc(Object(n.d)(Object(n.d)(r,t),100)),100)}var l=function(e,t,r,n){var o=Object.entries(r).filter((function(t){return e>=t[1]})),c="website_qty1";return o.length&&(c=o.pop()[0]),d(n[t][c],e)},f=function(e,form,t){return d(Object.entries(form).reduce((function(e,r){var s=0;if(/\d+/.test(r[0])&&r[1].enable){var o=r[1].colorForm.filter((function(i){return i.id===r[1].printService})),c=1;o.length&&(c=o[0].colorNumber);var d=r[1].decorationList.filter((function(i){return i.id===r[1].printService})),l=0;d.length&&(l=Object(n.c)(Number(d[0].website_setup),Object(n.d)(Number(d[0].supplier_setup),c-1))),s=Object(n.c)(s,l)}else if(r[1].length){var f=t[r[0]].filter((function(e){return r[1].includes(e.id)}));if(f.length){var m=f.reduce((function(e,t){var r=Number(t.website_setup);return[5,6].includes(t.website_setup_id)&&(r=0),Object(n.c)(e,Number.isNaN(r)?0:r)}),0);s=Object(n.c)(s,m)}}return e=Object(n.c)(e,s)}),0))},m=function(e,form,t){var r=Object.entries(t).filter((function(t){return e>=t[1]})),o="website_qty".concat(r.length),c="supplier_qty".concat(r.length),l=Object.entries(form).reduce((function(e,t){if("POA"===e)return e;var r=0;if(/\d+/.test(t[0])&&t[1].enable){var l=t[1].colorForm.filter((function(i){return i.id===t[1].printService})),f=1;l.length&&(f=l[0].colorNumber);var m=t[1].decorationList.filter((function(i){return i.id===t[1].printService})),h=d(m[0][o]);if(999===h||111===h||"number"!=typeof h)return"POA";var v=d(m[0][c]);if(999===v||111===v||"number"!=typeof v)return"POA";var y=0;m.length&&(y=Object(n.c)(h,Object(n.d)(v,f-1))),r=Object(n.c)(r,y)}return e=Object(n.c)(e,r)}),0);return d(l,e)},h=function(e,form,t,r){var o=Object.entries(t).filter((function(t){return e>=t[1]})),c="website_qty".concat(o.length),l=Object.entries(form).reduce((function(e,t){if("POA"===e)return e;var o=0;return/\d+/.test(t[0])||"packaging"===t[0]||(o=r[t[0]].filter((function(e){return t[1].includes(e.id)})).reduce((function(e,t){if("POA"===e)return e;var r=d(t[c]);return 999===r||111===r||"number"!=typeof r?(r=0,"POA"):e=Object(n.c)(e,r)}),0)),Object(n.c)(e,o)}),0);return d(l,e)},v=function(e,form,t,r){var o=Object.entries(t).filter((function(t){return e>=t[1]})),c="website_qty".concat(o.length),l=Object.entries(form).reduce((function(e,t){if("POA"===e)return e;var o=0;return/\d+/.test(t[0])||"packaging"!==t[0]||(o=r[t[0]].filter((function(e){return t[1].includes(e.id)})).reduce((function(e,t){if("POA"===e)return e;var r=d(t[c]);return 999===r||111===r||"number"!=typeof r?(r=0,"POA"):e=Object(n.c)(e,r)}),0)),Object(n.c)(e,o)}),0);return d(l,e)},y=function(e,t,r,o){var c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,l=Math.ceil(Object(n.d)(+o.unit_w_local,e)),f=Object(n.c)(1,Object(n.a)(Object(n.c)(+t.express_freight,+t.fuel),100)),m=Object(n.c)(1,Object(n.a)(Object(n.c)(+t.bag_freight,+t.fuel),100)),h=0;if(1===r.type)if(l>20){var v=Object(n.b)(l,20),y=Object(n.d)(v,+r.basic),_=Object(n.c)(+r.pickup,y);h=Object(n.d)(_,f)}else h=Object(n.d)(+r.pickup,f);else if(2===r.type){var O=Object(n.d)(l,+r.basic),j=Object(n.c)(+r.pickup,O);h=Object(n.d)(j,m)}else h=0;return d(h,c)}},563:function(e,t,r){"use strict";r(2)({target:"Math",stat:!0},{trunc:r(322)})},569:function(e,t,r){"use strict";r.r(t);r(39),r(53),r(521),r(77);var n={props:{dialogVisible:{type:Boolean,default:!1},componentVisible:{type:Number,default:2},data:{type:Object,default:function(){return{country:"Australia",name:"",phone:"",address:"",post_code:"",city:"",state:"",is_default:null}}}},data:function(){return{value:[],options:[],rules:{country:[{required:!0,message:"Please enter your country",trigger:"blur"}],name:[{required:!0,message:"Please enter your name",trigger:"blur"}],phone:[{required:!0,message:"Please enter your phone number",trigger:"blur"}],address:[{required:!0,message:"Please enter your address",trigger:"blur"}],post_code:[{required:!0,message:"Please enter post_code",trigger:"blur"}],city:[{required:!0,message:"Please enter city",trigger:"blur"}],state:[{required:!0,message:"Please enter state",trigger:"blur"}]},cityList:[{id:1,name:"Sydney"},{id:2,name:"Adelaide Mail Centre"},{id:3,name:"Melbourne"},{id:4,name:"Eastern Suburbs Mc"},{id:5,name:"Hobart"},{id:6,name:"Perth"},{id:7,name:"Launceston"},{id:8,name:"Brisbane"},{id:9,name:"Northern Suburbs Mc"},{id:10,name:"Strawberry Hills"},{id:11,name:"Springfield"},{id:12,name:"Waterloo"},{id:13,name:"Richmond"},{id:14,name:"Haymarket"},{id:15,name:"Red Hill"},{id:16,name:"Brisbane GPO Boxes"},{id:17,name:"Mayfield"},{id:18,name:"Australia Square"},{id:19,name:"Woodstock"},{id:20,name:"Sydney South"},{id:21,name:"The Gap"},{id:22,name:"Kingston"},{id:23,name:"Kensington"},{id:24,name:"Darlington"}],stateList:[{id:1,name:"Australian Capital Territory"},{id:2,name:"New South Wales"},{id:3,name:"Northern Territory"},{id:4,name:"Queensland"},{id:5,name:"South Australia"},{id:6,name:"Tasmania"},{id:7,name:"Victoria"},{id:8,name:"Western Australia"}]}},computed:{dialogFormVisible:{get:function(){return this.dialogVisible},set:function(e){this.$emit("update:dialogVisible",e)}}},methods:{submit:function(e){var t=this;this.$refs[e].validate((function(e){if(!e)return console.log("error submit!!"),!1;if(2==t.componentVisible){if(t.addAddress(),t.$route.fullPath.includes("product-builder"))return;t.$router.push({path:"/home/myDetail",query:{type:"third"}})}else 3==t.componentVisible&&(t.editAddress(),t.$router.push({path:"/home/myDetail",query:{type:"third"}}))}))},addAddress:function(){var e=this;this.$axios.post("/address/add",this.data).then((function(t){1===t.code&&(e.$notify({title:"success",message:"Submitted successfully",type:"success",duration:3e3}),e.dialogFormVisible=!1,e.update())})).catch((function(t){e.$message.error(t.response.data.msg)}))},editAddress:function(){var e=this;this.$axios.post("/address/edit",this.data).then((function(t){1===t.code&&(e.$notify({title:"success",message:"Submitted successfully",type:"success",duration:3e3}),e.dialogFormVisible=!1,e.update())})).catch((function(t){e.$message.error(t.response.data.msg)}))},update:function(){this.$emit("update",!0)}}},o=(r(583),r(22)),component=Object(o.a)(n,(function(){var e=this,t=e._self._c;return t("div",[t("el-dialog",{attrs:{"lock-scroll":!1,title:"Add address",visible:e.dialogFormVisible,width:"700px"},on:{"update:visible":function(t){e.dialogFormVisible=t}}},[t("el-form",{ref:"ruleForm",attrs:{model:e.data,rules:e.rules}},[t("el-form-item",{attrs:{prop:"country"}},[t("label",[e._v("Country/Region")]),e._v(" "),t("el-input",{model:{value:e.data.country,callback:function(t){e.$set(e.data,"country",t)},expression:"data.country"}})],1),e._v(" "),t("el-form-item",{attrs:{prop:"name"}},[t("label",[e._v("Full name")]),e._v(" "),t("el-input",{model:{value:e.data.name,callback:function(t){e.$set(e.data,"name",t)},expression:"data.name"}})],1),e._v(" "),t("el-form-item",{attrs:{prop:"phone"}},[t("label",[e._v("Phone number")]),e._v(" "),t("el-input",{model:{value:e.data.phone,callback:function(t){e.$set(e.data,"phone",t)},expression:"data.phone"}})],1),e._v(" "),t("el-form-item",{attrs:{prop:"address"}},[t("label",[e._v("Address")]),e._v(" "),t("el-input",{attrs:{placeholder:"Street address,P.O.box,company name,c/o"},model:{value:e.data.address,callback:function(t){e.$set(e.data,"address",t)},expression:"data.address"}})],1),e._v(" "),t("el-form-item",{attrs:{prop:"post_code"}},[t("label",[e._v("Postcode")]),e._v(" "),t("el-input",{model:{value:e.data.post_code,callback:function(t){e.$set(e.data,"post_code",t)},expression:"data.post_code"}})],1),e._v(" "),t("el-form-item",{attrs:{prop:"city"}},[t("label",[e._v("City/Suburb")]),e._v(" "),t("el-input",{attrs:{placeholder:"Choose city by suburb"},model:{value:e.data.city,callback:function(t){e.$set(e.data,"city",t)},expression:"data.city"}})],1),e._v(" "),t("el-form-item",{attrs:{prop:"state"}},[t("label",[e._v("State/Territory")]),e._v(" "),t("el-input",{attrs:{placeholder:"Choose state by territory"},model:{value:e.data.state,callback:function(t){e.$set(e.data,"state",t)},expression:"data.state"}})],1),e._v(" "),t("el-form-item",{attrs:{prop:"is_default"}},[t("el-checkbox",{model:{value:e.data.is_default,callback:function(t){e.$set(e.data,"is_default",t)},expression:"data.is_default"}},[e._v("\n Make this my default address\n ")])],1),e._v(" "),t("el-form-item",[t("label",[e._v("Delivery instruction(optional)")]),e._v(" "),t("div",{staticStyle:{color:"#86d4e9","line-height":"14px"}},[t("i",{staticClass:"el-icon-arrow-down",staticStyle:{color:"#a2a2a2"}}),e._v("\n And preferences,notes,access codes and more\n ")])])],1),e._v(" "),t("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){return e.submit("ruleForm")}}},[e._v("Add address")])],1)],1)],1)}),[],!1,null,"443741dd",null);t.default=component.exports},583:function(e,t,r){"use strict";r(549)},597:function(e,t,r){e.exports={}},637:function(e,t,r){"use strict";r(597)},690:function(e,t,r){e.exports={}},720:function(e,t,r){"use strict";r.r(t);r(39),r(41),r(40),r(62),r(63),r(46),r(11),r(32);var n=r(24);r(64);function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){Object(n.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var d={name:"DialogSelectAddr",components:{},filters:{},props:{addressDetail:{type:Object,default:function(){return{}}},visible:{type:Boolean,default:!1},addressList:{type:Array,default:function(){return[]}}},data:function(){return{show:!1,selectedId:-1,computedList:[]}},computed:{},watch:{visible:function(){this.show=this.visible,this.visible&&this.generateAddressList()},addressList:function(){this.generateAddressList()}},mounted:function(){},methods:{generateAddressList:function(){this.computedList=this.addressList.map((function(e){return c(c({},e),{},{selected:!1})}))},submit:function(){-1!==this.selectedId?(this.$emit("select-addr",this.selectedId),this.close()):this.$message.error("Please check address before click this button")},close:function(){this.selectedId=-1,this.computedList=[],this.$emit("close",!1)},newAddr:function(){this.$emit("add-new-addr"),this.close()},handleCurrentChange:function(e,t,r){this.selectedId=e.id||-1,this.$refs.table.setCurrentRow(e),this.computedList=this.addressList.map((function(t){return c(c({},t),{},{selected:t.id===e.id})}))}}},l=(r(637),r(22)),component=Object(l.a)(d,(function(){var e=this,t=e._self._c;return t("div",{attrs:{id:"dialogSelectAddr"}},[t("el-dialog",{attrs:{"lock-scroll":!1,title:"Choose a delivery address",visible:e.show,"close-on-click-modal":!1,"close-on-press-escape":!1,"show-close":!0,width:"50%"},on:{"update:visible":function(t){e.show=t},close:e.close}},[t("el-table",{ref:"table",staticStyle:{width:"100%"},attrs:{height:"300",data:e.computedList,"row-class-name":"row-cursor"},on:{"row-click":e.handleCurrentChange}},[t("el-table-column",{attrs:{label:"checked",width:"80px"},scopedSlots:e._u([{key:"default",fn:function(e){return[t("el-checkbox",{attrs:{value:e.row.selected}})]}}])}),e._v(" "),t("el-table-column",{attrs:{label:"address"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.name)+" "+e._s(t.row.address)+", "+e._s(t.row.city)+", "+e._s(t.row.post_code)+", "+e._s(t.row.country)+", Phone number: "+e._s(t.row.phone)+"\n ")]}}])})],1),e._v(" "),t("br"),e._v(" "),t("div",[t("el-button",{attrs:{size:"mini",type:"text",plain:""},on:{click:e.newAddr}},[e._v("Add Shipping Address")])],1),e._v(" "),t("br"),e._v(" "),t("el-button",{attrs:{size:"small",type:"primary"},on:{click:e.submit}},[e._v("Deliver to this address")])],1)],1)}),[],!1,null,"69716650",null);t.default=component.exports},812:function(e,t,r){"use strict";var n=r(2),o=r(525);n({target:"String",proto:!0,forced:r(526)("fixed")},{fixed:function(){return o(this,"tt","","")}})},813:function(e,t,r){"use strict";r(690)},834:function(e,t,r){"use strict";r.r(t);r(98),r(39),r(812),r(41),r(62),r(63);var n=r(12),o=r(24),c=(r(61),r(40),r(320),r(64),r(65),r(521),r(46),r(11),r(32),r(79),r(528)),d=r(636),l=r.n(d),f=r(43),m=r(557),h=r(720),v=r(569),y=r(562);function _(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function O(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_(Object(r),!0).forEach((function(t){Object(o.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var j={name:"Step3",components:{addAddressDialog:v.default,selectAddressDialog:h.default},mixins:[m.default],props:{cycle:{type:Number,default:function(){return 0}},model:{type:Number,default:function(){return 0}},buyForm:{type:Array,default:function(){return[]}},form2:{type:Object,default:function(){return{}}},weightInfo:{type:Object,default:function(){return{}}}},data:function(){return{rules:{job:[{required:!0,message:"Please select or create a job name",trigger:"change"}]},form:{defaultAddr:{},freight_type:1,job:"",note:""},freightLoading:!1,freightInfo:{},sellFreight:0,addressList:[],addressDetail:{},visibleOfSelectAddressDialog:!1,visibleOfEditAddressDialog:!1,patternOfEditAddressDialog:1,jobOptions:[],priceTableColumns:[{prop:"qty",label:"Qty",fixed:"left"}],dynamicPriceTableColumns:[],dynamicPriceTableData:[],priceTableData:[{qty:"Unit"},{qty:"Set up"},{qty:"Print Option"},{qty:"Addon"},{qty:"Packing"},{qty:"Fright"},{qty:"SubTotal"}]}},computed:O(O({},Object(f.d)("config",{configInfo:function(e){return e.configInfo}})),{},{computedPriceData:function(){var e=this;return this.priceData.priceList.filter((function(t){return t.cycle_id===e.cycle}))},computedBasePriceData:function(){var e=this.computedPriceData.length?this.computedPriceData[0]:{};return e[1]?e[1].slice():[]},computedBasePriceIndex:function(){var e=this;return this.computedBasePriceData.findIndex((function(t){return t.id===e.model}))},computedPrintPriceData:function(){var e=this.computedPriceData.length?this.computedPriceData[0]:{};return e[2]?e[2].slice():[]},defaultAddr:function(){return this.form.defaultAddr},computedPriceTableColumns:function(){return this.priceTableColumns.concat(this.dynamicPriceTableColumns)},computedPriceTableData:function(){var e=this;return this.priceTableData.map((function(t,r){return Object.assign({},t,e.dynamicPriceTableData[r]||{})}))}}),watch:{addressList:function(){var e=this.addressList.filter((function(e){return 1===e.is_default}));e.length?this.form.defaultAddr=e[0]:this.addressList.length?this.form.defaultAddr=this.addressList[0]:this.form.defaultAddr={},this.form.defaultAddr.post_code&&this.getFreight()},"form.freight_type":function(){this.getFreight()},"form.defaultAddr":function(){this.getFreight()},buyForm:{deep:!0,immediate:!0,handler:function(){if(!this.loaded)return[];this.dynamicPriceTableColumns=this.buyForm.map((function(e){return{prop:"".concat(e.value),buyNum:e.value}})),this.getDynamicPriceTableData()}},form2:{deep:!0,immediate:!0,handler:function(){this.getDynamicPriceTableData()}}},mounted:function(){var e=this;localStorage.getItem("sellFreight")&&(this.sellFreight=localStorage.getItem("sellFreight")),this.getAddressData().then((function(){e.loaded=!0})),this.getJobList()},methods:{checkForm:function(){var e=this;return new Promise((function(t,r){e.$refs.form.validate((function(n){n?t(JSON.parse(JSON.stringify(e.form))):r(new Error("validate step3 form error"))}))}))},addToProject:function(){this.$emit("check",1)},sendEnquiry:function(){this.$emit("check",2)},getJobList:function(){var e=this;this.$axios.post("/goods_cart/cartLabelLists",{keyword:[]}).then((function(t){e.jobOptions=t.result}))},getAddressData:function(){var e=this;return Object(n.a)(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$axios.get("address/list",{params:{keyword:"",page:1,limit:100}}).then((function(t){1===t.code&&(e.addressList=t.result.data,e.addressTotal=t.result.total)}));case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})))()},addAddress:function(){this.addressDetail={},this.patternOfEditAddressDialog=2,this.visibleOfEditAddressDialog=!0},closeAddressDialog:function(){this.visibleOfEditAddressDialog=!1},selectAddress:function(data){var e=this.addressList.filter((function(e){return e.id===data}));e.length&&(this.form.defaultAddr=e[0]),this.closeSelectAddressDialog()},closeSelectAddressDialog:function(){this.visibleOfSelectAddressDialog=!1},getDynamicPriceTableData:function(){var e=this,t=[{},{},{},{},{},{},{}],r=Object(c.c)(this.sellFreight/100,1);this.dynamicPriceTableColumns.forEach((function(n){var o=Object(y.g)(n.buyNum,e.computedBasePriceIndex,e.priceData.attributeList,e.computedBasePriceData);t[0]["".concat(n.prop)]=Object(y.a)(o),t[0]["".concat(n.prop,"_value")]=o;var d=Object(y.f)(n.buyNum,e.form2,e.priceData.additionList);t[1]["".concat(n.prop)]=Object(y.a)(d),t[1]["".concat(n.prop,"_value")]=d;var l=Object(y.e)(n.buyNum,e.form2,e.priceData.attributeList);t[2]["".concat(n.prop)]=Object(y.a)(l),t[2]["".concat(n.prop,"_value")]=l;var f=Object(y.b)(n.buyNum,e.form2,e.priceData.attributeList,e.priceData.additionList);t[3]["".concat(n.prop)]=Object(y.a)(f),t[3]["".concat(n.prop,"_value")]=f;var m=Object(y.d)(n.buyNum,e.form2,e.priceData.attributeList,e.priceData.additionList);t[4]["".concat(n.prop)]=Object(y.a)(m),t[4]["".concat(n.prop,"_value")]=m;var h=Object(y.c)(n.buyNum,e.configInfo,e.freightInfo,e.weightInfo,r);t[5]["".concat(n.prop)]=Object(y.a)(h),t[5]["".concat(n.prop,"_value")]=h;var v=[t[0]["".concat(n.prop,"_value")],t[1]["".concat(n.prop,"_value")],t[2]["".concat(n.prop,"_value")],t[3]["".concat(n.prop,"_value")],t[4]["".concat(n.prop,"_value")],t[5]["".concat(n.prop,"_value")]].reduce((function(e,t){var r=Number(t);return"POA"===e||"POA"===t?"POA":"number"==typeof r?Object(c.c)(e,r):e}),0);t[6]["".concat(n.prop)]="number"==typeof v?Object(y.a)(v):v,t[6]["".concat(n.prop,"_value")]=v})),this.dynamicPriceTableData=t},getFreight:l.a.debounce((function(){var e=this;this.form.defaultAddr.post_code&&(this.freightLoading=!0,this.$axios.post("/quote/freight",{postcode:this.form.defaultAddr.post_code,type:this.form.freight_type}).then((function(t){e.freightInfo=t.result,e.getDynamicPriceTableData()})).finally((function(){setTimeout((function(){e.freightLoading=!1}),300)})))}),200)}},A=(r(813),r(22)),component=Object(A.a)(j,(function(){var e=this,t=e._self._c;return t("el-card",{staticClass:"step-card"},[t("div",{staticClass:"flex between",attrs:{slot:"header"},slot:"header"},[t("div",{staticClass:"step-card-title"},[e._v("Step3 Confirm")])]),e._v(" "),t("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}]},[t("div",[e.addressList.length?t("div",[t("div",{staticClass:"card-sub-title"},[e._v("Ship to")]),e._v(" "),t("div",{staticClass:"form-item-label"},[e._v("Shipping address")]),e._v(" "),t("div",{staticClass:"flex between"},[t("div",[t("div",[t("div",{staticClass:"flex"},[t("div",{staticClass:"address-text name"},[e._v(e._s(e.defaultAddr.name))]),e._v(" "),t("div",{staticClass:"address-text"},[e._v(" "+e._s(e.defaultAddr.phone))])]),e._v(" "),t("div",{staticClass:"address-text"},[e._v(e._s(e.defaultAddr.address))]),e._v(" "),t("div",{staticClass:"flex"},[t("div",{staticClass:"address-text"},[e._v(e._s(e.defaultAddr.city))]),e._v(" "),t("div",{staticClass:"address-text"},[e._v("\n  "+e._s(e.defaultAddr.post_code)+"\n ")])])])]),e._v(" "),t("el-button",{attrs:{type:"text"},on:{click:function(t){e.visibleOfSelectAddressDialog=!0}}},[e._v("edit address")])],1)]):t("el-button",{attrs:{size:"mini",plain:""},on:{click:e.addAddress}},[e._v("+ Add delivery address")])],1),e._v(" "),t("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"0","label-position":"left"}},[t("el-form-item",{attrs:{"label-width":"120px",label:"Freight type"}},[t("el-radio-group",{directives:[{name:"loading",rawName:"v-loading",value:e.freightLoading,expression:"freightLoading"}],model:{value:e.form.freight_type,callback:function(t){e.$set(e.form,"freight_type",t)},expression:"form.freight_type"}},[t("el-radio",{attrs:{label:2}},[e._v("AAE")]),e._v(" "),t("el-radio",{attrs:{label:1}},[e._v("Road express")])],1)],1),e._v(" "),t("div",{staticClass:"price-title flex"},[t("div",[e._v("Pricing Optiopns")])]),e._v(" "),t("div",{staticClass:"divide-solid"}),e._v(" "),t("div",{staticClass:"price-table"},[t("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.freightLoading,expression:"freightLoading"}],attrs:{data:e.computedPriceTableData}},e._l(e.computedPriceTableColumns,(function(e,r){return t("el-table-column",{key:"".concat(e.prop,"-").concat(r),attrs:{fixed:e.fixed||!1,width:e.width||"100px",label:e.label||e.prop,prop:e.prop}})})),1)],1),e._v(" "),t("el-form-item",{attrs:{"label-width":"0",prop:"job"}},[t("div",{staticClass:"form-item-label"},[t("span",{staticStyle:{color:"red"}},[e._v("*")]),e._v(" Reference or Job name\n ")]),e._v(" "),t("el-select",{staticStyle:{width:"100%"},attrs:{filterable:"","allow-create":"","default-first-option":"",placeholder:"Ref, Choose or create new one"},model:{value:e.form.job,callback:function(t){e.$set(e.form,"job",t)},expression:"form.job"}},e._l(e.jobOptions,(function(e){return t("el-option",{key:e.label_type,attrs:{label:e.label_type,value:e.label_type}})})),1)],1),e._v(" "),t("div",{staticClass:"form-item-label"},[e._v("Note")]),e._v(" "),t("el-form-item",{attrs:{prop:"note","label-width":"0"}},[t("el-input",{attrs:{placeholder:"Any note"},model:{value:e.form.note,callback:function(t){e.$set(e.form,"note",t)},expression:"form.note"}})],1)],1),e._v(" "),t("div",{staticClass:"flex center"},[t("el-button",{attrs:{type:"primary"},on:{click:e.addToProject}},[t("div",{staticClass:"flex center"},[t("span",{staticClass:"btn-icon el-icon-shopping-cart-2"}),e._v("  Add to\n project\n ")])]),e._v(" "),t("el-button",{attrs:{type:"info"},on:{click:e.sendEnquiry}},[t("div",{staticClass:"flex"},[t("span",{staticClass:"btn-icon el-icon-shopping-bag-1"}),e._v("  Send\n enquiry\n ")])])],1),e._v(" "),t("add-address-dialog",{attrs:{dialogVisible:e.visibleOfEditAddressDialog,data:e.addressDetail,componentVisible:e.patternOfEditAddressDialog},on:{"update:dialogVisible":function(t){e.visibleOfEditAddressDialog=t},"update:dialog-visible":function(t){e.visibleOfEditAddressDialog=t},close:e.closeAddressDialog,update:e.getAddressData}}),e._v(" "),t("select-address-dialog",{attrs:{addressDetail:e.form.defaultAddr,addressList:e.addressList,visible:e.visibleOfSelectAddressDialog},on:{"update:visible":function(t){e.visibleOfSelectAddressDialog=t},"add-new-addr":e.addAddress,"select-addr":e.selectAddress,close:e.closeSelectAddressDialog}})],1)])}),[],!1,null,"6afcebbd",null);t.default=component.exports;installComponents(component,{AddAddressDialog:r(569).default})}}]);
  2. //# sourceMappingURL=7d408e6.js.map