(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-c2e5b922"],{"329e":function(t,e,a){"use strict";a.d(e,"j",(function(){return o})),a.d(e,"g",(function(){return n})),a.d(e,"a",(function(){return s})),a.d(e,"b",(function(){return i})),a.d(e,"d",(function(){return l})),a.d(e,"e",(function(){return c})),a.d(e,"f",(function(){return u})),a.d(e,"h",(function(){return d})),a.d(e,"i",(function(){return p})),a.d(e,"c",(function(){return h})),a.d(e,"k",(function(){return f})),a.d(e,"l",(function(){return y}));var r=a("66a5");const o=t=>Object(r["a"])({url:"/shopapi/order/page",method:"post",data:t}),n=t=>Object(r["a"])({url:"/shopapi/order/detail",method:"post",data:t}),s=t=>Object(r["a"])({url:"/shopapi/order/price/calculate",method:"post",data:t}),i=t=>Object(r["a"])({url:"/shopapi/order/price/calculateForOrder",method:"post",data:t}),l=t=>Object(r["a"])({url:"/shopapi/order/create",method:"post",data:t}),c=t=>Object(r["a"])({url:"/shopapi/order/create_for_design",method:"post",data:t}),u=t=>Object(r["a"])({url:"/shopapi/order/create_from_cart",method:"post",data:t}),d=t=>Object(r["a"])({url:"/shopapi/order/importOrder",method:"post",data:t}),p=t=>Object(r["a"])({url:"/shopapi/order/onHold",method:"post",data:t}),h=t=>Object(r["a"])({url:"/shopapi/order/cancel",method:"post",data:t}),f=t=>Object(r["a"])({url:"/shopapi/order/shipping/update",method:"post",data:t}),y=t=>Object(r["a"])({url:"/shopapi/order/item/greeting_card/print_areas/update",method:"post",data:t})},"38ea":function(t,e,a){"use strict";a("5149")},5149:function(t,e,a){},"6b29":function(t,e,a){"use strict";a.d(e,"a",(function(){return o})),a.d(e,"c",(function(){return n})),a.d(e,"b",(function(){return s})),a.d(e,"d",(function(){return i}));var r=a("66a5");const o=t=>Object(r["a"])({url:"/shopapi/pay/paypal/create",method:"post",data:t}),n=t=>Object(r["a"])({url:"/shopapi/pay/paypal/execute",method:"post",data:t}),s=t=>Object(r["a"])({url:"/shopapi/pay/paypal/subscription/create/param",method:"post",data:t}),i=t=>Object(r["a"])({url:"/shopapi/pay/paypal/subscription/status",method:"post",data:t})},"7b32":function(t,e,a){"use strict"; /*! * paypal-js v5.1.4 (2022-11-29T23:08:21.847Z) * Copyright 2020-present, PayPal, Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ function r(t,e){var a=document.querySelector('script[src="'.concat(t,'"]'));if(null===a)return null;var r=l(t,e),o=a.cloneNode();if(delete o.dataset.uidAuto,Object.keys(o.dataset).length!==Object.keys(r.dataset).length)return null;var n=!0;return Object.keys(o.dataset).forEach((function(t){o.dataset[t]!==r.dataset[t]&&(n=!1)})),n?a:null}function o(t){var e=t.url,a=t.attributes,r=t.onSuccess,o=t.onError,n=l(e,a);n.onerror=o,n.onload=r,document.head.insertBefore(n,document.head.firstElementChild)}function n(t){var e="https://www.paypal.com/sdk/js";t.sdkBaseURL&&(e=t.sdkBaseURL,delete t.sdkBaseURL),c(t);var a=Object.keys(t).filter((function(e){return"undefined"!==typeof t[e]&&null!==t[e]&&""!==t[e]})).reduce((function(e,a){var r=t[a].toString();return"data-"===a.substring(0,5)?e.dataAttributes[a]=r:e.queryParams[a]=r,e}),{queryParams:{},dataAttributes:{}}),r=a.queryParams,o=a.dataAttributes;return{url:"".concat(e,"?").concat(s(r)),dataAttributes:o}}function s(t){var e="";return Object.keys(t).forEach((function(a){0!==e.length&&(e+="&"),e+=a+"="+t[a]})),e}function i(t){var e=t.split("/* Original Error:")[1];return e?e.replace(/\n/g,"").replace("*/","").trim():t}function l(t,e){void 0===e&&(e={});var a=document.createElement("script");return a.src=t,Object.keys(e).forEach((function(t){a.setAttribute(t,e[t]),"data-csp-nonce"===t&&a.setAttribute("nonce",e["data-csp-nonce"])})),a}function c(t){var e=t["merchant-id"],a=t["data-merchant-id"],r="",o="";return Array.isArray(e)?e.length>1?(r="*",o=e.toString()):r=e.toString():"string"===typeof e&&e.length>0?r=e:"string"===typeof a&&a.length>0&&(r="*",o=a),t["merchant-id"]=r,t["data-merchant-id"]=o,t}function u(t,e){if(void 0===e&&(e=p()),f(t,e),"undefined"===typeof window)return e.resolve(null);var a=n(t),o=a.url,s=a.dataAttributes,i=s["data-namespace"]||"paypal",l=h(i);return r(o,s)&&l?e.resolve(l):d({url:o,attributes:s},e).then((function(){var t=h(i);if(t)return t;throw new Error("The window.".concat(i," global variable is not available."))}))}function d(t,e){void 0===e&&(e=p()),f(t,e);var a=t.url,r=t.attributes;if("string"!==typeof a||0===a.length)throw new Error("Invalid url.");if("undefined"!==typeof r&&"object"!==typeof r)throw new Error("Expected attributes to be an object.");return new e((function(t,e){if("undefined"===typeof window)return t();o({url:a,attributes:r,onSuccess:function(){return t()},onError:function(){var t=new Error('The script "'.concat(a,'" failed to load.'));return window.fetch?fetch(a).then((function(a){return 200===a.status&&e(t),a.text()})).then((function(t){var a=i(t);e(new Error(a))})).catch((function(t){e(t)})):e(t)}})}))}function p(){if("undefined"===typeof Promise)throw new Error("Promise is undefined. To resolve the issue, use a Promise polyfill.");return Promise}function h(t){return window[t]}function f(t,e){if("object"!==typeof t||null===t)throw new Error("Expected an options object.");if("undefined"!==typeof e&&"function"!==typeof e)throw new Error("Expected PromisePonyfill to be a function.")}a.d(e,"a",(function(){return u}))},"82bd":function(t,e,a){"use strict";var r=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticStyle:{"text-align":"center"},attrs:{id:"paypal-button-container2"}})},o=[],n=a("7b32"),s=a("6b29"),i={name:"PaypalButton",props:{value:{type:Boolean,default:!1},orderIds:{type:Array,default:()=>[]},payTarget:{type:Number,default:1}},data(){return{paypal:null}},inject:["reload"],watch:{},created(){},mounted(){this.paypalReady()},methods:{close(){const t=document.querySelector("#paypal-button-container2");t.removeChild(t.lastElementChild)},async paypalReady(){var t=this;try{this.paypal=await Object(n["a"])({"client-id":"Ad_2nWfHg-jljIyJdtNKa_8Vt9CzTPSn99w5REF3BFBV13lrA1QUF7HV5uSN3dwfV1Gag-YUMKfQyl2B"})}catch(e){console.error("failed to load the PayPal JS SDK script",e)}this.paypal&&await this.paypal.Buttons({env:"production",commit:!0,style:{size:"large",color:"blue",shape:"rect",label:"buynow"},locale:"en_US",createOrder:function(){return t.ceatePayPals()},onApprove:(e,a)=>{const r={paymentId:e.paymentID,payerId:e.payerID};return t.executePaypals(r)},onError:t=>{console.log(t,"paypal err")}}).render("#paypal-button-container2")},async ceatePayPals(){var t="https://www.artshiney.com";const e={orderIds:this.orderIds,payTarget:this.payTarget,cancelUrl:`${t}/Orders/${this.orderIds[0]}`,returnUrl:`${t}/Orders/${this.orderIds[0]}`},a=await Object(s["a"])(e);return a.data.token},async executePaypals(t){const e=await Object(s["c"])(t);1===e.data.status?(this.$message.success("Pay success"),setTimeout(()=>{this.callNewPage("/Orders/"+this.orderIds[0])},500)):this.$message.success(e.data.failReason)}}},l=i,c=a("2877"),u=Object(c["a"])(l,r,o,!1,null,"5d1437cf",null);e["a"]=u.exports},de73:function(t,e,a){"use strict";var r=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("el-dialog",{attrs:{visible:t.dialogVisible,"close-on-click-modal":!1,top:"30vh"},on:{"update:visible":function(e){t.dialogVisible=e},close:t.close}},[a("PaypalButton",{ref:"PaypalButton",attrs:{"order-ids":t.orderIds,"pay-target":t.payTarget}})],1)},o=[],n=a("82bd"),s={name:"PaypalDialog",components:{PaypalButton:n["a"]},props:{value:{type:Boolean,default:!1},orderIds:{type:Array,default:()=>[]},payTarget:{type:Number,default:1}},data(){return{dialogVisible:!1}},watch:{value:{handler(t){this.dialogVisible=t},immediate:!0},dialogVisible:{handler(t){this.$emit("input",t)},immediate:!0}},mounted(){},methods:{close(){this.dialogVisible=!1,this.$emit("close")}}},i=s,l=a("2877"),c=Object(l["a"])(i,r,o,!1,null,"69e4bf62",null);e["a"]=c.exports},fc4a:function(t,e,a){"use strict";a.r(e);var r=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"order-page default-main"},[a("div",{staticClass:"order-card order-query",attrs:{shadow:"always"}},[a("el-row",{attrs:{gutter:50}},[a("el-col",{staticClass:"order-query-item",attrs:{span:6}},[a("el-input",{attrs:{placeholder:"Shine Order Number"},model:{value:t.query.orderNo,callback:function(e){t.$set(t.query,"orderNo",e)},expression:"query.orderNo"}})],1),a("el-col",{staticClass:"order-query-item",attrs:{span:6}},[a("el-input",{attrs:{placeholder:"Tracking Number"},model:{value:t.query.trackingNumber,callback:function(e){t.$set(t.query,"trackingNumber",e)},expression:"query.trackingNumber"}})],1),a("el-col",{staticClass:"order-query-item",attrs:{span:6}},[a("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"All Order Status",clearable:""},model:{value:t.query.status,callback:function(e){t.$set(t.query,"status",e)},expression:"query.status"}},t._l(t.orderStatusList,(function(t){return a("el-option",{key:t.status,attrs:{label:t.label,value:t.status}})})),1)],1),a("el-col",{staticClass:"order-query-item",attrs:{span:6}},[a("el-date-picker",{staticStyle:{width:"100%"},attrs:{"value-format":"yyyy-MM-dd",type:"daterange","range-separator":"To","start-placeholder":"Start Date","end-placeholder":"End Date"},model:{value:t.currentSelectDate,callback:function(e){t.currentSelectDate=e},expression:"currentSelectDate"}})],1),a("el-col",{staticClass:"order-query-item button-box",attrs:{span:6}},[a("el-button",{staticClass:"button-box-item",attrs:{type:"primary",loading:t.searchLoading},on:{click:t.search}},[t._v("Search")]),a("el-button",{staticClass:"button-box-item",attrs:{loading:t.resetLoading},on:{click:t.reset}},[t._v("Reset")])],1)],1)],1),a("div",{staticClass:"order-card order-list"},[a("div",{staticClass:"order-list-top"},[a("el-row",{attrs:{gutter:50}},[a("el-col",{staticClass:"button-box",attrs:{span:6}},[a("el-button",{staticClass:"button-box-item",attrs:{type:"primary"},on:{click:t.paypal}},[t._v("Paypal")]),a("el-button",{staticClass:"button-box-item",staticStyle:{visibility:"hidden"}},[t._v("Import Order")])],1)],1)],1),a("el-table",{ref:"multipleTable",staticStyle:{width:"100%"},attrs:{data:t.orderList,"tooltip-effect":"dark",stripe:""},on:{"selection-change":t.handleSelectionChange,"row-click":function(e){return t.toDetail(e.orderNo)}}},[a("el-table-column",{attrs:{type:"selection",width:"55"}}),a("el-table-column",{attrs:{prop:"orderNo",label:"Shine Orders No",align:"center"}}),1===t.currentShop.shopType?a("el-table-column",{attrs:{prop:"storeOrderNo",label:"Shopify No",align:"center"}}):t._e(),a("el-table-column",{attrs:{prop:"status",label:"Status",width:"150"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{style:[{"font-weight":"bold"},{color:t.statusColor(e.row.status,t.orderStatusList)}]},[t._v(t._s(t._f("statusFilters")(e.row.status,t.orderStatusList)))])]}}])}),a("el-table-column",{attrs:{prop:"addDate",label:"Order Date",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t._f("datetimeFormatter")(e.row.addDate)))]}}])}),a("el-table-column",{attrs:{prop:"totalPrice",label:"Total Cost",width:"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticStyle:{"font-weight":"bold"}},[t._v("$"+t._s(e.row.totalPrice))])]}}])}),a("el-table-column",{attrs:{label:"",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-link",{staticStyle:{"font-weight":"bold"},attrs:{type:"primary"},on:{click:function(a){return t.toDetail(e.row.orderNo)}}},[t._v("Detail")])]}}])})],1),a("el-pagination",{staticClass:"pagination",attrs:{background:"",layout:"prev, pager, next, sizes","page-sizes":[10,20,30,40],total:t.query.total},on:{"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange}})],1),a("PaypalDialog",{attrs:{"order-ids":t.orderIds},model:{value:t.showPaypal,callback:function(e){t.showPaypal=e},expression:"showPaypal"}})],1)},o=[],n=a("329e"),s=a("de73"),i=a("2f62"),l={name:"OrderList",components:{PaypalDialog:s["a"]},filters:{statusFilters(t,e){return e.find(e=>e.status===t).label}},data(){return{orderList:[],currentSelectDate:[],query:{keyword:"",status:"",startDate:"",endDate:"",total:0,current:1,size:10},orderStatusList:[{status:1,label:"Pending",color:"#7469F0"},{status:2,label:"Confirmed",color:"#36CB78"},{status:3,label:"In production",color:"#36CA78"},{status:4,label:"Partial Shipment",color:"#0BD1E9"},{status:5,label:"All Shipments",color:"#0BD1E9"},{status:6,label:"On hold",color:"#EE7777"},{status:7,label:"Cancelled",color:"#EE7777"}],searchLoading:!1,resetLoading:!1,showPaypal:!1,orderIds:[]}},computed:{statusColor(){return(t,e)=>e.find(e=>e.status===t).color},...Object(i["b"])("user",{currentShop:"getCurrentShop"})},created(){this.getOrderList()},methods:{async getOrderList(){const t=Object.assign([],this.currentSelectDate),e=Object.assign({},this.query);e.startDate=t[0],e.endDate=t[1];const a=await Object(n["j"])(e);this.orderList=a.data.records,this.query.total=a.data.total},async reset(){this.resetLoading=!0,this.query=this.$options.data().query,this.currentSelectDate=[];try{await this.getOrderList()}finally{this.resetLoading=!1}},async search(){this.searchLoading=!0,this.query.current=1;try{await this.getOrderList()}finally{this.searchLoading=!1}},paypal(){this.orderIds.length?this.showPaypal=!0:this.$message.info("Please select order")},async inportOrder(t){const{uid:e}=t,a=await Object(n["h"])({fileId:e});console.log(a)},toDetail(t){this.callNewPage("/Orders/"+t)},handleSelectionChange(t){this.orderIds=t.filter(t=>1===t.status).map(t=>t.id)},handleSizeChange(t){this.query.size=t,this.getOrderList()},handleCurrentChange(t){this.query.current=t,this.getOrderList()}}},c=l,u=(a("38ea"),a("2877")),d=Object(u["a"])(c,r,o,!1,null,"d6fdab18",null);e["default"]=d.exports}}]);