61a5642.js 38 KB

12
  1. (window.webpackJsonp=window.webpackJsonp||[]).push([[88,30],{512:function(e,t,r){"use strict";var n=r(2),o=r(4),l=r(73),c=r(510),d=r(313),f=r(5),m=RangeError,h=String,v=Math.floor,_=o(d),y=o("".slice),w=o(1..toFixed),O=function(e,t,r){return 0===t?r:t%2==1?O(e,t-1,r*e):O(e*e,t/2,r)},x=function(data,e,t){for(var r=-1,n=t;++r<6;)n+=e*data[r],data[r]=n%1e7,n=v(n/1e7)},A=function(data,e){for(var t=6,r=0;--t>=0;)r+=data[t],data[t]=v(r/e),r=r%e*1e7},C=function(data){for(var e=6,s="";--e>=0;)if(""!==s||0===e||0!==data[e]){var t=h(data[e]);s=""===s?t:s+_("0",7-t.length)+t}return s};n({target:"Number",proto:!0,forced:f((function(){return"0.000"!==w(8e-5,3)||"1"!==w(.9,0)||"1.25"!==w(1.255,2)||"1000000000000000128"!==w(0xde0b6b3a7640080,0)}))||!f((function(){w({})}))},{toFixed:function(e){var t,r,n,o,d=c(this),f=l(e),data=[0,0,0,0,0,0],v="",w="0";if(f<0||f>20)throw m("Incorrect fraction digits");if(d!=d)return"NaN";if(d<=-1e21||d>=1e21)return h(d);if(d<0&&(v="-",d=-d),d>1e-21)if(r=(t=function(e){for(var t=0,r=e;r>=4096;)t+=12,r/=4096;for(;r>=2;)t+=1,r/=2;return t}(d*O(2,69,1))-69)<0?d*O(2,-t,1):d/O(2,t,1),r*=4503599627370496,(t=52-t)>0){for(x(data,0,r),n=f;n>=7;)x(data,1e7,0),n-=7;for(x(data,O(10,n,1),0),n=t-1;n>=23;)A(data,1<<23),n-=23;A(data,1<<n),x(data,1,1),A(data,2),w=C(data)}else x(data,0,r),x(data,1<<-t,0),w=C(data)+_("0",f);return w=f>0?v+((o=w.length)<=f?"0."+_("0",f-o)+w:y(w,0,o-f)+"."+y(w,o-f)):v+w}})},515:function(e,t,r){e.exports={}},516: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 l(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 c(e){_&&(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 d(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=d((function(e,t){var r=l(e),n=l(t),d=o(e)+o(t),f=r*n;return c(f),f/Math.pow(10,d)})),m=d((function(e,t){var r=Math.pow(10,Math.max(o(e),o(t)));return(f(e,r)+f(t,r))/r})),h=d((function(e,t){var r=Math.pow(10,Math.max(o(e),o(t)));return(f(e,r)-f(t,r))/r})),v=d((function(e,t){var r=l(e),d=l(t);return c(r),c(d),f(r/d,n(Math.pow(10,o(t)-o(e))))}));var _=!0},517:function(e,t,r){"use strict";r(515)},521:function(e,t,r){"use strict";r.r(t);r(509);var n={name:"Pagination",props:{total:{required:!0,type:Number},page:{type:Number,default:0},limit:{type:Number,default:10},layout:{type:String,default:"prev, pager, next"},background:{type:Boolean,default:!0},autoScroll:{type:Boolean,default:!0},hidden:{type:Boolean,default:!1}},computed:{currentPage:{get:function(){return this.page},set:function(e){this.$emit("update:page",e)}},pageSize:{get:function(){return this.limit},set:function(e){this.$emit("update:limit",e)}}},methods:{handleSizeChange:function(e){this.$emit("pagination",{page:this.currentPage,limit:e}),this.autoScroll&&scrollTo(0,800)},handleCurrentChange:function(e){this.$emit("pagination",{page:e,limit:this.pageSize}),this.autoScroll&&scrollTo(0,800)}}},o=(r(517),r(20)),component=Object(o.a)(n,(function(){var e=this,t=e._self._c;return t("div",{staticClass:"pagination-container",class:{hidden:e.hidden}},[e._t("slot"),e._v(" "),t("el-pagination",e._b({attrs:{background:e.background,"current-page":e.currentPage,"page-size":e.pageSize,layout:e.layout,total:e.total},on:{"update:currentPage":function(t){e.currentPage=t},"update:current-page":function(t){e.currentPage=t},"update:pageSize":function(t){e.pageSize=t},"update:page-size":function(t){e.pageSize=t},"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}},"el-pagination",e.$attrs,!1))],2)}),[],!1,null,"044ef958",null);t.default=component.exports},535:function(e,t,r){r(2)({target:"Number",stat:!0},{isNaN:function(e){return e!=e}})},539:function(e,t,r){e.exports={}},552:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"h",(function(){return l})),r.d(t,"g",(function(){return d})),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 _}));r(509),r(535),r(553),r(38),r(10),r(315),r(14),r(52),r(70);var n=r(516);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 l(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 c(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 d=function(e,t,r,n){var o=Object.entries(r).filter((function(t){return e>=t[1]})),l="website_qty1";return o.length&&(l=o.pop()[0]),c(n[t][l],e)},f=function(e,form,t){return c(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})),l=1;o.length&&(l=o[0].colorNumber);var c=r[1].decorationList.filter((function(i){return i.id===r[1].printService})),d=0;c.length&&(d=Object(n.c)(Number(c[0].website_setup),Object(n.d)(Number(c[0].supplier_setup),l-1))),s=Object(n.c)(s,d)}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),l="supplier_qty".concat(r.length),d=Object.entries(form).reduce((function(e,t){if("POA"===e)return e;var r=0;if(/\d+/.test(t[0])&&t[1].enable){var d=t[1].colorForm.filter((function(i){return i.id===t[1].printService})),f=1;d.length&&(f=d[0].colorNumber);var m=t[1].decorationList.filter((function(i){return i.id===t[1].printService})),h=c(m[0][o]);if(999===h||111===h||"number"!=typeof h)return"POA";var v=c(m[0][l]);if(999===v||111===v||"number"!=typeof v)return"POA";var _=0;m.length&&(_=Object(n.c)(h,Object(n.d)(v,f-1))),r=Object(n.c)(r,_)}return e=Object(n.c)(e,r)}),0);return c(d,e)},h=function(e,form,t,r){var o=Object.entries(t).filter((function(t){return e>=t[1]})),l="website_qty".concat(o.length),d=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=c(t[l]);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 c(d,e)},v=function(e,form,t,r){var o=Object.entries(t).filter((function(t){return e>=t[1]})),l="website_qty".concat(o.length),d=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=c(t[l]);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 c(d,e)},_=function(e,t,r,o){var l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,d=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(d>20){var v=Object(n.b)(d,20),_=Object(n.d)(v,+r.basic),y=Object(n.c)(+r.pickup,_);h=Object(n.d)(y,f)}else h=Object(n.d)(+r.pickup,f);else if(2===r.type){var w=Object(n.d)(d,+r.basic),O=Object(n.c)(+r.pickup,w);h=Object(n.d)(O,m)}else h=0;return c(h,l)}},553:function(e,t,r){r(2)({target:"Math",stat:!0},{trunc:r(316)})},558:function(e,t,r){"use strict";r.r(t);r(37),r(509),r(52),r(70);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(571),r(20)),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},571:function(e,t,r){"use strict";r(539)},572:function(e,t,r){e.exports={}},615:function(e,t,r){"use strict";r(572)},642:function(e,t,r){"use strict";r.r(t);r(509),r(61),r(72),r(10),r(31),r(207);var n=r(662),o={name:"ImageUpload",components:{draggable:r.n(n).a},props:{list:{type:Array,default:function(){return[]}},max:{type:Number,default:16},disablePreview:{type:Boolean,default:!1},width:{type:String,default:"150px"},height:{type:String,default:"150px"}},data:function(){return{imageList:[],loading:!1,uploadPercent:0,imageDialogVisible:!1,imageUrl:""}},computed:{fulled:function(){return 0}},watch:{list:function(){this.imageList=JSON.parse(JSON.stringify(this.list))}},mounted:function(){this.updateList()},methods:{handleUpload:function(e,t){var r=this;if(this.fileList=[],"ready"===e.status){this.loading=!0;var n=setInterval((function(){r.uploadPercent>=99?clearInterval(n):r.uploadPercent+=1}),100)}var o=new FormData;t.forEach((function(e){o.append("file",e.raw)})),o.append("type",1),this.$axios.post("/user_base/imagesUpload",o).then((function(t){if(200===t.result.code)return r.imageList.push({url:t.result.data,uid:e.uid}),void r.updateList();r.$message({message:t.result.message,type:"warning"})})).catch((function(e){console.log(e,"component upload image error"),r.$message.error(e.response.data.msg)})).finally((function(){r.loading=!1,r.uploadPercent=0}))},handleRemove:function(e){this.imageList.splice(e,1),this.updateList()},handlePictureCardPreview:function(e){this.imageUrl=e.url,this.imageDialogVisible=!0},updateList:function(){this.$emit("update:list",JSON.parse(JSON.stringify(this.imageList)))},end:function(){this.updateList()}}},l=(r(615),r(20)),component=Object(l.a)(o,(function(){var e=this,t=e._self._c;return t("div",{staticClass:"com-image-upload"},[t("draggable",{staticClass:"flex start wrap",attrs:{draggable:".image-item"},on:{end:e.end},model:{value:e.imageList,callback:function(t){e.imageList=t},expression:"imageList"}},[e._l(e.imageList,(function(r,n){return t("div",{key:r.uid||n,staticClass:"image-item flex",style:{width:e.width,height:e.height}},[t("img",{attrs:{src:r.url,alt:""}}),e._v(" "),t("div",{staticClass:"action-area flex center"},[e.disablePreview?e._e():t("span",{staticClass:"action-icon",on:{click:function(t){return e.handlePictureCardPreview(r)}}},[t("i",{staticClass:"el-icon-zoom-in"})]),e._v(" "),t("span",{staticClass:"action-icon",on:{click:function(t){return e.handleRemove(n)}}},[t("i",{staticClass:"el-icon-delete"})])])])})),e._v(" "),t("el-progress",{directives:[{name:"show",rawName:"v-show",value:e.loading,expression:"loading"}],staticStyle:{margin:"8px"},attrs:{type:"circle",percentage:e.uploadPercent,width:Number(e.width.slice(0,e.width.length-2))}}),e._v(" "),t("div",{staticClass:"upload-wrap",class:{hide:e.loading||e.imageList.length>=e.max},style:{width:e.width,height:e.height}},[t("el-upload",{ref:"pictureUpload",staticClass:"custom-upload-item",attrs:{multiple:!0,limit:e.max,action:"",drag:"",accept:".jpg,.png,.jpeg","list-type":"picture-card","file-list":e.imageList,"show-file-list":!1,"auto-upload":!1,"on-remove":e.handleRemove,"on-preview":e.handlePictureCardPreview,"on-change":function(t,r){e.handleUpload(t,r)}}},[t("i",{staticClass:"el-icon-plus avatar-uploader-icon"})])],1)],2),e._v(" "),t("el-dialog",{attrs:{visible:e.imageDialogVisible},on:{"update:visible":function(t){e.imageDialogVisible=t}}},[t("img",{attrs:{width:"100%",src:e.imageUrl,alt:""}})])],1)}),[],!1,null,"049aaa02",null);t.default=component.exports},663:function(e,t,r){e.exports={}},664:function(e,t,r){e.exports={}},774:function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAE0AAABNCAYAAADjCemwAAAAAXNSR0IArs4c6QAAAhVJREFUeF7t3EtKA0EYxPH6FHXjCQQhg2cQ8XEM3SuufSCoZzABEV2L7vUYPhCvoExA8ARufLZMRFBM1FQITMI/20z19PxSmUmg6VC5XqHK3KqUViRVJNWlOFD9bF9SKstUoywTacwjm65KA5s/5/RWU365VZa5lgdtbHJcw8O5QoM/cJJe9fSU6f76rgxw5UHLZualOGmNkhaUX5yC9lWgMrOoiKOWKCktqX5xDBpoHXaAphmAoIFmCBgRmgaaIWBEaBpohoARoWmgGQJGhKaBZggYEZoGmiFgRGgaaIaAEaFpoBkCRoSmgWYIGBGaBpohYERoGmiGgBGhaaAZAkaEpoFmCBiRnmxasT5sZGhKSaPGJXceiZiTtPzLQIdK6azzExkjhB70+Hz1uT6uWJ8WyqZ3lAY2mi6oM87Rl5FiYWFoV/n5drHGdU2R9vryQrtxUSnWQ5XZG4UmujF+X46ZdFugvfC1bOPjTXqlaW14NQ79aBr3tLbcGvc0np7/M/v29PyM8DutNV6T32n/k+72UT35j6DbKH+ND9pfQk3eBw00Q8CI0DTQDAEjQtNAMwSMCE0DzRAwIjQNNEPAiNA00AwBI0LTQDMEjAhNA80QMCI0DTRDwIjQNNAMASNC00AzBIwITQPNEDAiNA00Q8CI0DTQDAEjwu6jBhr73BpoRSSbrUpqsqOyasrP2VG5BWtP7N39DnF70LrahZYoAAAAAElFTkSuQmCC"},776:function(e,t,r){"use strict";r(663)},777:function(e,t,r){"use strict";r(664)},841:function(e,t,r){"use strict";r.r(t);r(37),r(52),r(70),r(42),r(39),r(38),r(10),r(58),r(31),r(59);var n=r(23),o=(r(14),r(43),r(512),r(509),r(149),r(72),r(208),r(60),r(41)),l=r(558),c=r(209),d=r(642),f=r(552);function m(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(object);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,r)}return t}var h={components:{addAddressDialog:l.default,"dialog-XX-success":c.default,imageUpload:d.default},data:function(){return{xxContentVisible:!1,xxContent:"success",componentVisible:1,tabName:"",tableLoading:!0,profileform:{},rules:{email:[{required:!0,message:"Please enter the email",trigger:"blur"}],company:[{required:!0,message:"Please enter the company",trigger:"blur"}],contacts:[{required:!0,message:"Please enter first name",trigger:"blur"}],last_name:[{required:!0,message:"Please enter last name",trigger:"blur"}],phone:[{required:!0,message:"Please enter the phone",trigger:"blur"}],password:[{required:!0,message:"Please enter the password",trigger:"blur"}],confirm_password:[{required:!0,message:"Please enter the confirm_password",trigger:"blur"}]},accountPasswordForm:{password:"",confirm_password:""},orderKeyword:"",selword:"",accounts_id:"",orderTotal:0,orderListQuery:{page:1,limit:20},tableData:[],dialogVisible:!1,addressTotal:0,addressListQuery:{page:1,limit:8},addressList:[],addressDetail:{},enquiryKeyword:"",enquiryList:[],enquiryListQuery:{page:1,limit:20},enquiryTotal:0,orderSelList:[],Tracking_URL:"",urlDialogShow:!1}},computed:{activeMenu:function(){var e;return null!==(e=this.$route.query.type)&&void 0!==e?e:"profile"},selShow:function(){return"all-orders"===this.activeMenu||"open-orders"===this.activeMenu}},watch:{$route:{handler:function(e){this.$utils.checkLogin()&&this.updateType()}},orderKeyword:function(){this.orderListQuery.page=1},enquiryKeyword:function(){this.enquiryListQuery.page=1}},mounted:function(){this.$utils.checkLogin()?(this.getMemberDetail(),this.updateType()):this.$router.replace("/")},methods:function(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?m(Object(source),!0).forEach((function(t){Object(n.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):m(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}({transformNumber:function(e){return Object(f.h)(Number(e)).toFixed(2)},handleClick:function(e,t){e&&this.$router.push({path:"/home/myDetail",query:{type:e}})},updateType:function(){"profile"===this.activeMenu?this.tabName="My Profile":"enquiry"===this.activeMenu?(this.tabName="My Enquiry",this.getEnquiryList()):"address"===this.activeMenu?(this.tabName="My Address",this.getAddressList()):(this.selword="","all-orders"===this.activeMenu&&(this.orderSelList=["Order Confirmed","In Production","In Transit","Order Completed"]),"open-orders"===this.activeMenu&&(this.orderSelList=["Order Confirmed","In Production","In Transit"]),this.tabName="My Orders",this.getOrdersList())},closeAddressDialog:function(){this.dialogVisible=!1},getMemberDetail:function(){var e=this;this.$axios.get("/au/member/detail").then((function(t){1===t.code&&(e.profileform=t.result,e.profileform.logo=e.profileform.logo?e.formatLogo(e.profileform.logo):[])})).catch((function(){}))},formatLogo:function(e){return[{url:e}]},onSave:function(form){var e=this;this.accountPasswordForm.confirm_password===this.accountPasswordForm.password?this.$refs[form].validate((function(t){if(!t)return console.log("error submit!!"),!1;var r,n,o={email:e.profileform.email,company:e.profileform.company,contacts:e.profileform.contacts,last_name:e.profileform.last_name,phone:e.profileform.phone,logo:null!==(r=null===(n=e.profileform.logo[0])||void 0===n?void 0:n.url)&&void 0!==r?r:""},l=!1;""!==e.accountPasswordForm.password.trim()&&(o.password=e.accountPasswordForm.password,o.confirm_password=e.accountPasswordForm.confirm_password,l=!0),e.$axios.post("/au/member/edit",o).then((function(t){1===t.code&&(e.$notify({customClass:"custom-notify-class",title:"success",message:"The profile information is modified successfully",type:"success"}),l&&setTimeout((function(){e.$store.dispatch("logout").then((function(){e.$router.push("/")}))}),500))})).catch((function(){}))})):this.$message.error("The second password is inconsistent!")},getOrdersList:function(){var e,t=this,r=this.accounts_id?this.accounts_id:null===(e=this.$store.state.userInfo)||void 0===e?void 0:e.memberCrmcomList.map((function(i){return i.id})).join(),n="all-orders"===this.activeMenu?"":"open-orders"===this.activeMenu?"Open Orders":"Closed Orders";this.tableLoading=!0,this.$axios.post("/crmdata/order_lists",{keyword:this.orderKeyword,page:this.orderListQuery.page,limit:this.orderListQuery.limit,accounts_id:r,Order_Stage:this.selword,type:n}).then((function(e){1===e.code&&(t.tableData=e.result.data,t.orderTotal=e.result.total,t.tableLoading=!1),t.$nextTick((function(){window.scroll(0,0)}))})).catch((function(){}))},goOrderDetail:function(e){var t=this.$router.resolve({path:"/home/myDetail/orderDetail",query:{id:e.sales_orders_id,crm:e.Account_Name_id}});window.open(t.href,"_blank")},getEnquiryList:function(){var e,t=this;this.tableLoading=!0,this.$axios.post("/crmdata/enquiries_lists",{keyword:this.enquiryKeyword,page:this.enquiryListQuery.page,limit:this.enquiryListQuery.limit,accounts_id:(null===(e=this.$store.state.userInfo)||void 0===e?void 0:e.crm_accounts_id)||""}).then((function(e){1===e.code&&(t.enquiryList=e.result.data,t.enquiryTotal=e.result.total,t.tableLoading=!1),t.$nextTick((function(){window.scroll(0,0)}))}))},goEnquiryDetail:function(e){var t=this.$router.resolve({path:"/home/myDetail/enquiryDetail",query:{id:e.enquiries_id}});window.open(t.href,"_blank")},getAddressList:function(){var e=this;this.$axios.get("address/list",{params:{page:this.addressListQuery.page,limit:this.addressListQuery.limit}}).then((function(t){1===t.code&&(e.addressList=t.result.data,e.addressTotal=t.result.total),e.$nextTick((function(){window.scroll(0,0)}))})).catch((function(){}))},addAddress:function(e){this.addressDetail={},this.componentVisible=e,this.dialogVisible=!0},editAddress:function(e,t){var r=this;this.$axios.get("address/detail/"+t).then((function(t){r.addressDetail=t.result,r.addressDetail.is_default=1===t.result.is_default,r.componentVisible=e,r.dialogVisible=!0})).catch((function(){}))},delAddress:function(e){var t=this;this.$axios.get("address/delete/"+e).then((function(e){t.$notify({title:"success",message:"Deleted successfully",type:"success",duration:3e3}),t.getAddressList()}))},setDefault:function(e){var t=this;this.$axios.get("address/set_default/"+e).then((function(e){t.$notify({title:"success",message:"Default address is set successfully",type:"success",duration:3e3}),t.getAddressList()}))},update:function(){this.getAddressList()},resetPassword:function(){var e=this;this.accountPasswordForm.confirm_password!==this.accountPasswordForm.password?this.$message.error("The second password is inconsistent!"):this.$axios({url:"au/member/reset",method:"POST",data:this.accountPasswordForm}).then((function(t){1===t.code&&(e.xxContentVisible=!0,e.xxContent="Password Reset Successful")})).catch((function(){}))},openTracking_URL:function(e){this.Tracking_URL=e,this.urlDialogShow=!0},handleNotification:function(){this.$router.push("/"),this.$store.dispatch("logout"),this.openDialog()}},Object(o.c)(["openDialog"]))},v=h,_=(r(776),r(777),r(20)),component=Object(_.a)(v,(function(){var e,t,n,o=this,l=o._self._c;return l("div",{staticClass:"com-main com-margin-auto com-fixationwidth-1400"},[l("el-breadcrumb",{attrs:{"separator-class":"el-icon-arrow-right"}},[l("el-breadcrumb-item",{attrs:{to:{path:"/"}}},[o._v("Home")]),o._v(" "),l("el-breadcrumb-item",[o._v(o._s(o.tabName))])],1),o._v(" "),l("div",{staticClass:"content"},[l("el-menu",{ref:"menu",staticClass:"el-menu-vertical",attrs:{"background-color":"#e8eaee","text-color":"#4a596c","active-text-color":"#fff","default-active":o.activeMenu},on:{select:o.handleClick}},[l("el-menu-item",{attrs:{index:"profile"}},[l("i",{staticClass:"iconfont"},[o._v("")]),o._v(" "),l("span",{attrs:{slot:"title"},slot:"title"},[o._v("My Profile")])]),o._v(" "),l("el-submenu",{attrs:{index:"order"}},[l("template",{slot:"title"},[l("i",{staticClass:"iconfont"},[o._v("")]),o._v(" "),l("span",{attrs:{slot:"title"},slot:"title"},[o._v("My Orders")])]),o._v(" "),l("el-menu-item",{attrs:{index:"all-orders"}},[o._v("All Orders")]),o._v(" "),l("el-menu-item",{attrs:{index:"open-orders"}},[o._v("Open Orders")]),o._v(" "),l("el-menu-item",{attrs:{index:"closed-orders"}},[o._v("Closed Orders")])],2)],1),o._v(" "),l("div",{staticClass:"content-right"},[l("div",{directives:[{name:"show",rawName:"v-show",value:"profile"===o.activeMenu,expression:"activeMenu === 'profile'"}]},[l("div",{staticClass:"content-form"},[l("p",{staticClass:"content-title"},[o._v(o._s(o.tabName))]),o._v(" "),l("el-form",{ref:"form",attrs:{model:o.profileform,rules:o.rules,"label-width":"220px"}},[l("el-row",[l("el-col",{attrs:{span:15}},[l("el-form-item",{attrs:{label:"Email Address",prop:"email"}},[l("el-input",{attrs:{disabled:!0},model:{value:o.profileform.email,callback:function(e){o.$set(o.profileform,"email",e)},expression:"profileform.email"}})],1)],1),o._v(" "),l("el-col",{attrs:{span:9}},[l("el-form-item",{staticClass:"upload-item",attrs:{label:"Your Logo"}},[l("image-upload",{attrs:{list:o.profileform.logo,disablePreview:!0,max:1},on:{"update:list":function(e){return o.$set(o.profileform,"logo",e)}}})],1)],1)],1),o._v(" "),l("el-form-item",{attrs:{label:"Company Name",prop:"company"}},[l("el-input",{model:{value:o.profileform.company,callback:function(e){o.$set(o.profileform,"company",e)},expression:"profileform.company"}})],1),o._v(" "),l("el-form-item",{attrs:{label:"First Name",prop:"contacts"}},[l("el-input",{model:{value:o.profileform.contacts,callback:function(e){o.$set(o.profileform,"contacts",e)},expression:"profileform.contacts"}})],1),o._v(" "),l("el-form-item",{attrs:{label:"Last Name",prop:"last_name"}},[l("el-input",{model:{value:o.profileform.last_name,callback:function(e){o.$set(o.profileform,"last_name",e)},expression:"profileform.last_name"}})],1),o._v(" "),l("el-form-item",{attrs:{label:"Contact Phone Number",prop:"phone"}},[l("el-input",{model:{value:o.profileform.phone,callback:function(e){o.$set(o.profileform,"phone",e)},expression:"profileform.phone"}})],1)],1)],1),o._v(" "),l("div",{staticClass:"content-form",staticStyle:{"margin-top":"20px"}},[l("p",{staticClass:"content-title"},[o._v("Account And Password")]),o._v(" "),l("el-form",{ref:"ruleForm",staticClass:"accountPasswordForm",attrs:{model:o.accountPasswordForm,"label-width":"220px"}},[l("el-form-item",{attrs:{label:"Enter the new password",prop:"password"}},[l("el-input",{model:{value:o.accountPasswordForm.password,callback:function(e){o.$set(o.accountPasswordForm,"password",e)},expression:"accountPasswordForm.password"}})],1),o._v(" "),l("el-form-item",{attrs:{label:"Retype the password",prop:"confirm_password"}},[l("el-input",{model:{value:o.accountPasswordForm.confirm_password,callback:function(e){o.$set(o.accountPasswordForm,"confirm_password",e)},expression:"accountPasswordForm.confirm_password"}})],1),o._v(" "),l("el-form-item",[l("el-button",{staticClass:"saveBtn",on:{click:function(e){return o.onSave("form")}}},[o._v("\n Save\n ")])],1)],1)],1)]),o._v(" "),l("div",{directives:[{name:"show",rawName:"v-show",value:"enquiry"===o.activeMenu,expression:"activeMenu === 'enquiry'"}],staticClass:"content-form"},[l("p",{staticClass:"content-title"},[o._v(o._s(o.tabName))]),o._v(" "),l("div",{staticClass:"searchInput"},[l("el-input",{attrs:{placeholder:"Search your job name",clearable:""},on:{clear:o.getEnquiryList},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&o._k(e.keyCode,"enter",13,e.key,"Enter")?null:o.getEnquiryList.apply(null,arguments)}},model:{value:o.enquiryKeyword,callback:function(e){o.enquiryKeyword=e},expression:"enquiryKeyword"}},[l("i",{staticClass:"el-input__icon el-icon-search",attrs:{slot:"suffix"},on:{click:o.getEnquiryList},slot:"suffix"})])],1),o._v(" "),l("el-table",{directives:[{name:"loading",rawName:"v-loading",value:o.tableLoading,expression:"tableLoading"}],staticStyle:{width:"100%"},attrs:{data:o.enquiryList,stripe:"","header-cell-style":{background:"#00213b",color:"#ffffff"}},on:{"row-click":o.goEnquiryDetail}},[l("el-table-column",{attrs:{prop:"Auto_Number",label:"Enquiry No"}}),o._v(" "),l("el-table-column",{attrs:{prop:"Enquiry_Title",label:"Job Name",width:"300"}}),o._v(" "),l("el-table-column",{attrs:{prop:"Customize_Pipeline_Stage",label:"Status"}}),o._v(" "),l("el-table-column",{attrs:{prop:"Enquiry_Created",label:"Date"},scopedSlots:o._u([{key:"default",fn:function(e){return[l("div",[o._v("\n "+o._s(o.$utils.formatTime(e.row.Sales_Order_Created,"DD/MM/YYYY",!0))+"\n ")])]}}])}),o._v(" "),l("el-table-column",{attrs:{label:"Action",width:"90",align:"center"}},[[l("el-button",{staticStyle:{"background-color":"rgb(0, 33, 59)",color:"#fff"},attrs:{size:"small",plain:""}},[o._v("View")])]],2)],1),o._v(" "),l("pagination",{directives:[{name:"show",rawName:"v-show",value:o.enquiryTotal>0,expression:"enquiryTotal > 0"}],attrs:{total:o.enquiryTotal,page:o.enquiryListQuery.page,limit:o.enquiryListQuery.limit},on:{"update:page":function(e){return o.$set(o.enquiryListQuery,"page",e)},"update:limit":function(e){return o.$set(o.enquiryListQuery,"limit",e)},pagination:o.getEnquiryList}})],1),o._v(" "),l("div",{directives:[{name:"show",rawName:"v-show",value:"address"===o.activeMenu,expression:"activeMenu === 'address'"}],staticClass:"content-form"},[l("p",{staticClass:"content-title"},[o._v(o._s(o.tabName))]),o._v(" "),l("div",{staticClass:"address-content"},[l("div",{staticClass:"my-addresses add-address",on:{click:function(e){return o.addAddress(2)}}},[l("img",{attrs:{src:r(774),alt:""}}),o._v(" "),l("p",[o._v("Add address")])]),o._v(" "),o._l(o.addressList,(function(e){return l("div",{key:e.id,staticClass:"my-addresses address"},[l("div",{staticClass:"username"},[l("p",[o._v(o._s(e.name))]),o._v(" "),l("span",{directives:[{name:"show",rawName:"v-show",value:e.is_default,expression:"item.is_default"}]},[o._v("Default")])]),o._v(" "),l("div",{staticClass:"my-address-content"},[l("p",[o._v(o._s(e.state))]),o._v(" "),l("p",[o._v(o._s(e.city))]),o._v(" "),l("p",[o._v(o._s(e.address))]),o._v(" "),l("p",[o._v(o._s(e.post_code))]),o._v(" "),l("p",[o._v(o._s(e.country))]),o._v(" "),l("p",[o._v("Phone number: "+o._s(e.phone))])]),o._v(" "),l("div",{staticClass:"edit-btns"},[l("el-button",{attrs:{size:"mini"},on:{click:function(t){return o.editAddress(3,e.id)}}},[o._v("\n Edit\n ")]),o._v(" "),l("el-button",{attrs:{size:"mini"},on:{click:function(t){return o.delAddress(e.id)}}},[o._v("\n Remove\n ")]),o._v(" "),l("el-button",{directives:[{name:"show",rawName:"v-show",value:!e.is_default,expression:"!item.is_default"}],attrs:{size:"mini"},on:{click:function(t){return o.setDefault(e.id)}}},[o._v("\n Set as Default\n ")])],1)])}))],2),o._v(" "),l("pagination",{directives:[{name:"show",rawName:"v-show",value:o.addressTotal>0,expression:"addressTotal > 0"}],attrs:{total:o.addressTotal,page:o.addressListQuery.page,limit:o.addressListQuery.limit},on:{"update:page":function(e){return o.$set(o.addressListQuery,"page",e)},"update:limit":function(e){return o.$set(o.addressListQuery,"limit",e)},pagination:o.getAddressList}})],1),o._v(" "),l("div",{directives:[{name:"show",rawName:"v-show",value:o.activeMenu.includes("orders"),expression:"activeMenu.includes('orders')"}],staticClass:"content-form"},[l("p",{staticClass:"content-title"},[o._v(o._s(o.tabName))]),o._v(" "),l("div",{staticClass:"searchInput"},[l("el-input",{attrs:{placeholder:"Search your job name",clearable:""},on:{clear:o.getOrdersList},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&o._k(e.keyCode,"enter",13,e.key,"Enter")?null:o.getOrdersList.apply(null,arguments)}},model:{value:o.orderKeyword,callback:function(e){o.orderKeyword=e},expression:"orderKeyword"}},[l("i",{staticClass:"el-input__icon el-icon-search",attrs:{slot:"suffix"},on:{click:o.getOrdersList},slot:"suffix"})]),o._v(" "),o.selShow?l("el-select",{attrs:{filterable:"",clearable:"","default-first-option":"",placeholder:"Select the status"},model:{value:o.selword,callback:function(e){o.selword=e},expression:"selword"}},o._l(o.orderSelList,(function(option){return l("el-option",{key:option,attrs:{label:option,value:option}})})),1):o._e(),o._v(" "),(null===(e=o.$store.state.userInfo)||void 0===e||null===(t=e.memberCrmcomList)||void 0===t?void 0:t.length)>1?l("el-select",{attrs:{filterable:"",clearable:"","default-first-option":"",placeholder:"Select the CRM"},model:{value:o.accounts_id,callback:function(e){o.accounts_id=e},expression:"accounts_id"}},o._l(null===(n=o.$store.state.userInfo)||void 0===n?void 0:n.memberCrmcomList,(function(option){return l("el-option",{key:option.id,attrs:{label:option.name,value:option.id}})})),1):o._e(),o._v(" "),l("el-button",{staticStyle:{"background-color":"rgb(0, 33, 59)","border-color":"rgb(0, 33, 59)"},attrs:{type:"primary"},on:{click:o.getOrdersList}},[o._v("Submit")])],1),o._v(" "),l("el-table",{directives:[{name:"loading",rawName:"v-loading",value:o.tableLoading,expression:"tableLoading"}],staticStyle:{width:"100%"},attrs:{data:o.tableData,stripe:"","header-cell-style":{background:"#00213b",color:"#ffffff"}}},[l("el-table-column",{attrs:{prop:"Sales_Order_Title_Job_Name",label:"Job Name"}}),o._v(" "),l("el-table-column",{attrs:{width:"100",prop:"Reference",label:"Order No"}}),o._v(" "),l("el-table-column",{attrs:{width:"120",prop:"Sales_Order_Created",label:"Order Date"},scopedSlots:o._u([{key:"default",fn:function(e){return[l("div",[o._v("\n "+o._s(o.$utils.formatTime(e.row.Sales_Order_Created,"DD/MM/YYYY"))+"\n ")])]}}])}),o._v(" "),l("el-table-column",{attrs:{width:"140",prop:"Order_Stage_new",label:"Order Status"}}),o._v(" "),l("el-table-column",{attrs:{width:"160",prop:"Tracking_No_arr",label:"Tracking No#"},scopedSlots:o._u([{key:"default",fn:function(e){return[l("ul",{staticClass:"location"},o._l(e.row.Tracking_No_arr,(function(e){return l("li",{key:e.Tracking_No,on:{click:function(t){return o.openTracking_URL(e.Tracking_URL)}}},[l("i",{staticClass:"el-icon-location"}),o._v(o._s(e.Tracking_No))])})),0)]}}])}),o._v(" "),l("el-table-column",{attrs:{width:"110",prop:"Grand_Total",label:"Amount"},scopedSlots:o._u([{key:"default",fn:function(e){return[o._v("\n $"+o._s(o.transformNumber(e.row.Grand_Total))+"\n ")]}}])}),o._v(" "),l("el-table-column",{attrs:{label:"Action",width:"80",align:"center"},scopedSlots:o._u([{key:"default",fn:function(e){return[l("el-button",{staticStyle:{"background-color":"rgb(0, 33, 59)",color:"#fff"},attrs:{size:"small",plain:""},on:{click:function(t){return o.goOrderDetail(e.row)}}},[o._v("View")])]}}])})],1),o._v(" "),l("pagination",{directives:[{name:"show",rawName:"v-show",value:o.orderTotal>0,expression:"orderTotal > 0"}],attrs:{total:o.orderTotal,page:o.orderListQuery.page,limit:o.orderListQuery.limit},on:{"update:page":function(e){return o.$set(o.orderListQuery,"page",e)},"update:limit":function(e){return o.$set(o.orderListQuery,"limit",e)},pagination:o.getOrdersList}})],1)])],1),o._v(" "),l("add-address-dialog",{attrs:{dialogVisible:o.dialogVisible,data:o.addressDetail,componentVisible:o.componentVisible},on:{"update:dialogVisible":function(e){o.dialogVisible=e},"update:dialog-visible":function(e){o.dialogVisible=e},close:o.closeAddressDialog,update:o.update}}),o._v(" "),l("dialog-XX-success",{attrs:{visible:o.xxContentVisible,content:o.xxContent},on:{"update:visible":function(e){o.xxContentVisible=e},"notify-parent":o.handleNotification}}),o._v(" "),l("el-dialog",{attrs:{"lock-scroll":!1,visible:o.urlDialogShow,center:"",width:"850px",top:"20vh"},on:{"update:visible":function(e){o.urlDialogShow=e}}},[l("iframe",{staticStyle:{width:"100%",height:"500px"},attrs:{src:o.Tracking_URL,frameborder:"0"}})])],1)}),[],!1,null,"b5122ea0",null);t.default=component.exports;installComponents(component,{ImageUpload:r(642).default,Pagination:r(521).default,AddAddressDialog:r(558).default})}}]);
  2. //# sourceMappingURL=61a5642.js.map