| 1 |
- (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-44f11bef"],{"14c6":function(t,e,o){"use strict";o.d(e,"p",(function(){return s})),o.d(e,"z",(function(){return a})),o.d(e,"A",(function(){return n})),o.d(e,"w",(function(){return i})),o.d(e,"E",(function(){return d})),o.d(e,"x",(function(){return c})),o.d(e,"F",(function(){return u})),o.d(e,"D",(function(){return l})),o.d(e,"y",(function(){return g})),o.d(e,"B",(function(){return f})),o.d(e,"C",(function(){return p})),o.d(e,"c",(function(){return h})),o.d(e,"g",(function(){return m})),o.d(e,"h",(function(){return _})),o.d(e,"d",(function(){return y})),o.d(e,"e",(function(){return b})),o.d(e,"f",(function(){return v})),o.d(e,"H",(function(){return x})),o.d(e,"K",(function(){return w})),o.d(e,"I",(function(){return k})),o.d(e,"J",(function(){return D})),o.d(e,"G",(function(){return S})),o.d(e,"O",(function(){return L})),o.d(e,"L",(function(){return C})),o.d(e,"M",(function(){return z})),o.d(e,"N",(function(){return O})),o.d(e,"i",(function(){return j})),o.d(e,"n",(function(){return G})),o.d(e,"j",(function(){return $})),o.d(e,"o",(function(){return I})),o.d(e,"k",(function(){return A})),o.d(e,"m",(function(){return K})),o.d(e,"l",(function(){return P})),o.d(e,"P",(function(){return E})),o.d(e,"S",(function(){return T})),o.d(e,"Q",(function(){return R})),o.d(e,"R",(function(){return q})),o.d(e,"t",(function(){return B})),o.d(e,"s",(function(){return F})),o.d(e,"u",(function(){return J})),o.d(e,"v",(function(){return N})),o.d(e,"r",(function(){return M})),o.d(e,"q",(function(){return H})),o.d(e,"T",(function(){return Q})),o.d(e,"U",(function(){return U})),o.d(e,"V",(function(){return V})),o.d(e,"W",(function(){return W})),o.d(e,"a",(function(){return X})),o.d(e,"b",(function(){return Y})),o.d(e,"Y",(function(){return Z})),o.d(e,"X",(function(){return tt}));var r=o("f175");const s=t=>r.a.post("/goods.goods/add",t),a=t=>r.a.post("/goods.goods/edit",t),n=t=>r.a.get("/goods.goods/lists",{params:t}),i=t=>r.a.get("/goods.goods/commonLists",{params:t}),d=t=>r.a.post("/goods.goods/status",t),c=t=>r.a.post("/goods.goods/del",t),u=t=>r.a.post("/goods.goods/changeCategory",t),l=t=>r.a.post("/goods.goods/sort",t),g=t=>r.a.get("/goods.goods/detail",{params:{id:t}}),f=t=>r.a.get("/goods.goods/otherList",{params:t}),p=t=>r.a.post("goods.goods/rename ",t),h=t=>r.a.post("/goods.goods_brand/add",t),m=t=>r.a.get("/goods.goods_brand/lists",{params:t}),_=t=>r.a.post("/goods.goods_brand/status",t),y=t=>r.a.post("/goods.goods_brand/del",t),b=t=>r.a.get("/goods.goods_brand/detail",{params:{id:t}}),v=t=>r.a.post("/goods.goods_brand/edit",t),x=t=>r.a.post("/goods.goods_supplier_category/add",t),w=t=>r.a.get("goods.goods_supplier_category/lists",{params:t}),k=t=>r.a.post("goods.goods_supplier_category/del",{id:t}),D=t=>r.a.post("goods.goods_supplier_category/edit",t),S=t=>r.a.post("/goods.goods_supplier/add",t),L=t=>r.a.get("/goods.goods_supplier/lists",{params:t}),C=t=>r.a.post("goods.goods_supplier/del",{id:t}),z=t=>r.a.get("/goods.goods_supplier/detail",{params:{id:t}}),O=t=>r.a.post("/goods.goods_supplier/edit",t),j=t=>r.a.post("/goods.goods_category/add",t),G=t=>r.a.get("/goods.goods_category/lists",{params:t}),$=t=>r.a.get("/goods.goods_category/commonLists",{params:t}),I=t=>r.a.post("/goods.goods_category/status",t),A=t=>r.a.post("goods.goods_category/del",{id:t}),K=t=>r.a.post("/goods.goods_category/edit",t),P=t=>r.a.get("/goods.goods_category/detail",{params:{id:t}}),E=t=>r.a.post("/goods.goods_unit/add",t),T=t=>r.a.get("/goods.goods_unit/lists",{params:t}),R=t=>r.a.post("goods.goods_unit/del",{id:t}),q=t=>r.a.post("/goods.goods_unit/edit",t),B=t=>r.a.get("goods.goods_comment/lists",{params:t}),F=t=>r.a.post("goods.goods_comment/del",t),J=t=>r.a.post("goods.goods_comment/reply",t),N=t=>r.a.post("/goods.goods_comment/status",t),M=t=>r.a.get("goods.goods_comment_assistant/lists",{params:t}),H=t=>r.a.post("goods.goods_comment_assistant/add",t),Q=t=>r.a.get("goods.goodsServiceGuarantee/lists",t),U=t=>r.a.post("goods.goodsServiceGuarantee/add",t),V=t=>r.a.post("goods.goodsServiceGuarantee/delete",t),W=t=>r.a.post("goods.goodsServiceGuarantee/edit",t),X=()=>r.a.get("goods.GoodsDeliveryTemplate/lists"),Y=t=>r.a.post("goods.GoodsDeliveryTemplate/add",t),Z=t=>r.a.post("goods.GoodsDeliveryTemplate/edit",t),tt=t=>r.a.post("goods.GoodsDeliveryTemplate/delete",t)},"1e5a":function(t,e,o){"use strict";var r=o("23e7"),s=o("9961");r({target:"Set",proto:!0,real:!0,forced:!o("dad2")("symmetricDifference")},{symmetricDifference:s})},"1e70":function(t,e,o){"use strict";var r=o("23e7"),s=o("a5f7");r({target:"Set",proto:!0,real:!0,forced:!o("dad2")("difference",(function(t){return 0===t.size}))},{difference:s})},"2bcf":function(t,e,o){"use strict";o.r(e);o("14d9"),o("d9e2"),o("e9f5"),o("7d54"),o("1e70"),o("79a4"),o("c1a1"),o("8b00"),o("a4e7"),o("1e5a"),o("72c3");var r=o("9ab4"),s=o("14c6"),a=o("d09e"),n=o("1b40"),i=o("6ddb"),d=o("0a6d");let c=class extends n.e{constructor(){super(...arguments),this.form={key_99api:""}}closeDialog(){this.$refs.dialog.close()}openDialog(t){this.form.key_99api=t,this.$refs.dialog.open()}handleConfirm(){Object(a.i)({key_99api:this.form.key_99api}).then(()=>{this.closeDialog(),this.$emit("getGatherKey")}).finally(()=>{this.form.key_99api=""})}};Object(r.a)([Object(n.f)("value")],c.prototype,"closeDialog",null),c=Object(r.a)([Object(n.a)({components:{LsDialog:d.a}})],c);var u=c,l=o("2877"),g=Object(l.a)(u,(function(){var t=this,e=t._self._c;t._self._setupProxy;return e("div",[e("ls-dialog",{ref:"dialog",attrs:{title:"接口配置",width:"600px",top:"30vh",async:!0},on:{confirm:t.handleConfirm,cancel:t.closeDialog}},[e("div",{staticClass:"p-l-20 p-r-20"},[e("el-form",{ref:"form",attrs:{model:t.form,"label-width":"120px",size:"small"}},[e("el-form-item",{attrs:{label:"99Api apiKey"}},[e("el-input",{staticStyle:{width:"380px"},attrs:{placeholder:"复制商品第三方平台接口秘钥"},model:{value:t.form.key_99api,callback:function(e){t.$set(t.form,"key_99api",e)},expression:"form.key_99api"}}),e("div",{staticClass:"xs muted"},[t._v(" 采集的API接口请前往 "),e("el-link",{attrs:{href:"https://user.99api.com/login?log=5&referee=25463",target:"_blank",type:"primary",underline:!1}},[t._v(" 99API ")]),t._v(" 官网注册 ")],1)],1)],1)],1)])],1)}),[],!1,null,"ae575414",null).exports,f=o("b31b"),p=o("3c50");let h=class extends n.e{constructor(){super(...arguments),this.formData={goods_type:1,goods_category:"",gather_url:"",delivery_content:""},this.key_99api="",this.formRules={goods_category:[{required:!0,message:"请添加采集商品分类",trigger:["blur","change"]}],gather_url:[{required:!0,message:"请添加采集商品链接",trigger:["blur"]}],delivery_content:[{required:!0,message:"请输入发货内容",trigger:["blur"]}]},this.categoryList=[],this.pager=new i.a,this.checking=!0}async getCategoryList(){const t=await Object(s.n)({page_type:1});this.categoryList=t.lists}toApiConfig(){this.$refs.apiConfig.openDialog(this.key_99api)}getLogLists(t){t&&(this.pager.page=t),this.pager.request({callback:a.h,params:{}}).then(t=>{})}async getGatherKey(){try{const t=await Object(a.e)("");this.key_99api=t.key_99api}catch(t){throw new Error("error")}}handleDelete(t){Object(a.b)({log_id:t}).then(()=>{this.getLogLists(),this.$message.success("操作成功")})}handleGather(){this.$refs.form.validate(async(t,e)=>{let o=this.formData.gather_url.split(/[(\r\n\s)\r\n\s]+/);if(o.forEach((t,e)=>{t||o.splice(e,1)}),o=Array.from(new Set(o)),!this.key_99api)return this.$message.error("99Apikey还未配置请前往配置");if(!t)return!1;this.$refs.isLoadingRef.openDialog();try{await Object(a.f)({...this.formData,gather_url:o}),this.$message.success("采集完成");const t={goods_category:"",gather_url:""};Object.assign(this.formData,t)}catch(t){}this.$refs.isLoadingRef.closeDialog(),this.getLogLists()})}created(){this.getCategoryList(),this.getLogLists(),this.getGatherKey()}};h=Object(r.a)([Object(n.a)({components:{ApiConfig:g,IsLoading:f.a,LsDialog:d.a,LsPagination:p.a}})],h);var m=h,_=Object(l.a)(m,(function(){var t=this,e=t._self._c;t._self._setupProxy;return e("div",[e("div",{staticClass:"ls-card"},[e("el-alert",{staticClass:"xxl",attrs:{type:"info",closable:!1,"show-icon":"",title:"温馨提示:目前商品采集只支持淘宝、天猫、京东、1688的商品"}}),e("el-form",{ref:"form",staticClass:"m-t-16",attrs:{model:t.formData,rules:t.formRules,"label-width":"120px",size:"small"}},[e("el-form-item",{attrs:{label:"采集商品链接",prop:"gather_url"}},[e("el-input",{staticStyle:{width:"550px"},attrs:{type:"textarea",rows:8,placeholder:"请输入淘宝、天猫、京东、1688的采集商品链接"},model:{value:t.formData.gather_url,callback:function(e){t.$set(t.formData,"gather_url",e)},expression:"formData.gather_url"}}),e("div",{staticClass:"muted"},[t._v(" 批量采集请按回车键换行,如果您已配置99Api key可直接开始采集,如果未配置请 "),e("el-button",{attrs:{type:"text"},on:{click:t.toApiConfig}},[t._v("前往配置")])],1)],1),e("el-form-item",{attrs:{label:"采集商品类型"}},[e("el-radio-group",{model:{value:t.formData.goods_type,callback:function(e){t.$set(t.formData,"goods_type",e)},expression:"formData.goods_type"}},[e("el-radio",{attrs:{label:1}},[t._v("实物商品")]),e("el-radio",{attrs:{label:2}},[t._v("虚拟商品")])],1)],1),2===t.formData.goods_type?e("el-form-item",{attrs:{label:"发货内容",prop:"delivery_content"}},[e("el-input",{staticStyle:{width:"260px"},attrs:{type:"textarea",rows:3,placeholder:"请输入发货内容"},model:{value:t.formData.delivery_content,callback:function(e){t.$set(t.formData,"delivery_content",e)},expression:"formData.delivery_content"}})],1):t._e(),e("el-form-item",{attrs:{label:"采集商品分类",prop:"goods_category"}},[e("el-cascader",{staticStyle:{width:"280px"},attrs:{options:t.categoryList,props:{checkStrictly:!0,label:"name",value:"id",children:"sons",emitPath:!1},clearable:"",filterable:""},model:{value:t.formData.goods_category,callback:function(e){t.$set(t.formData,"goods_category",e)},expression:"formData.goods_category"}}),e("router-link",{staticClass:"m-l-10",attrs:{target:"_blank",to:"/goods/category_edit"}},[e("el-button",{attrs:{type:"text",size:"small"}},[t._v("新增分类")])],1),e("span",{staticClass:"primary m-8"},[t._v("|")]),e("el-button",{attrs:{type:"text",size:"small"},on:{click:t.getCategoryList}},[t._v("刷新")])],1),e("el-form-item",[e("el-button",{attrs:{size:"small",type:"primary"},on:{click:function(e){return e.stopPropagation(),t.handleGather.apply(null,arguments)}}},[t._v("采集")])],1)],1)],1),e("div",{staticClass:"ls-card m-t-16"},[e("div",{staticClass:"ls-content__table"},[e("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.pager.loading,expression:"pager.loading"}],staticStyle:{width:"100%"},attrs:{data:t.pager.lists,size:"mini"}},[e("el-table-column",{attrs:{prop:"goods_type_desc",label:"采集商品类型","min-width":"170"}}),e("el-table-column",{attrs:{prop:"goods_category_desc",label:"采集商品分类","min-width":"200"}}),e("el-table-column",{attrs:{prop:"gather_num",label:"采集数","min-width":"150"}}),e("el-table-column",{attrs:{prop:"gather_fail_num",label:"失败数","min-width":"150"},scopedSlots:t._u([{key:"default",fn:function(o){return[e("div",{style:{color:"#ff3333"}},[t._v(t._s(o.row.gather_fail_num))])]}}])}),e("el-table-column",{attrs:{prop:"gather_success_num",label:"成功数","min-width":"150"}}),e("el-table-column",{attrs:{prop:"create_time",label:"采集时间","min-width":"170"}}),e("el-table-column",{attrs:{fixed:"right",label:"操作","min-width":"140"},scopedSlots:t._u([{key:"default",fn:function(o){return[e("el-button",{attrs:{type:"text",size:"small"},on:{click:function(e){return t.$router.push({path:"/goods_collection/details",query:{id:o.row.id}})}}},[t._v("查看")]),e("ls-dialog",{staticClass:"m-l-10 inline",attrs:{content:"确定删除该条采集商品?请谨慎操作。"},on:{confirm:function(e){return t.handleDelete(o.row.id)}}},[e("el-button",{attrs:{slot:"trigger",type:"text",size:"small"},slot:"trigger"},[t._v("删除")])],1)]}}])})],1),e("div",{staticClass:"flex row-right m-t-20"},[e("ls-pagination",{on:{change:function(e){return t.getLogLists()}},model:{value:t.pager,callback:function(e){t.pager=e},expression:"pager"}})],1)],1)]),e("ApiConfig",{ref:"apiConfig",on:{getGatherKey:t.getGatherKey}}),e("IsLoading",{ref:"isLoadingRef",attrs:{title:"采集"}})],1)}),[],!1,null,"39d91c05",null);e.default=_.exports},"384f":function(t,e,o){"use strict";var r=o("e330"),s=o("5388"),a=o("cb27"),n=a.Set,i=a.proto,d=r(i.forEach),c=r(i.keys),u=c(new n).next;t.exports=function(t,e,o){return o?s({iterator:c(t),next:u},e):d(t,e)}},"395e":function(t,e,o){"use strict";var r=o("dc19"),s=o("cb27").has,a=o("8e16"),n=o("7f65"),i=o("5388"),d=o("2a62");t.exports=function(t){var e=r(this),o=n(t);if(a(e)<o.size)return!1;var c=o.getIterator();return!1!==i(c,(function(t){if(!s(e,t))return d(c,"normal",!1)}))}},5388:function(t,e,o){"use strict";var r=o("c65b");t.exports=function(t,e,o){for(var s,a,n=o?t:t.iterator,i=t.next;!(s=r(i,n)).done;)if(void 0!==(a=e(s.value)))return a}},"68df":function(t,e,o){"use strict";var r=o("dc19"),s=o("8e16"),a=o("384f"),n=o("7f65");t.exports=function(t){var e=r(this),o=n(t);return!(s(e)>o.size)&&!1!==a(e,(function(t){if(!o.includes(t))return!1}),!0)}},"72c3":function(t,e,o){"use strict";var r=o("23e7"),s=o("e9bc");r({target:"Set",proto:!0,real:!0,forced:!o("dad2")("union")},{union:s})},"79a4":function(t,e,o){"use strict";var r=o("23e7"),s=o("d039"),a=o("953b");r({target:"Set",proto:!0,real:!0,forced:!o("dad2")("intersection",(function(t){return 2===t.size&&t.has(1)&&t.has(2)}))||s((function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))}))},{intersection:a})},"7f65":function(t,e,o){"use strict";var r=o("59ed"),s=o("825a"),a=o("c65b"),n=o("5926"),i=o("46c4"),d=RangeError,c=TypeError,u=Math.max,l=function(t,e){this.set=t,this.size=u(e,0),this.has=r(t.has),this.keys=r(t.keys)};l.prototype={getIterator:function(){return i(s(a(this.keys,this.set)))},includes:function(t){return a(this.has,this.set,t)}},t.exports=function(t){s(t);var e=+t.size;if(e!=e)throw new c("Invalid size");var o=n(e);if(o<0)throw new d("Invalid size");return new l(t,o)}},"83b9e":function(t,e,o){"use strict";var r=o("cb27"),s=o("384f"),a=r.Set,n=r.add;t.exports=function(t){var e=new a;return s(t,(function(t){n(e,t)})),e}},"8b00":function(t,e,o){"use strict";var r=o("23e7"),s=o("68df");r({target:"Set",proto:!0,real:!0,forced:!o("dad2")("isSubsetOf",(function(t){return t}))},{isSubsetOf:s})},"8e16":function(t,e,o){"use strict";var r=o("7282"),s=o("cb27");t.exports=r(s.proto,"size","get")||function(t){return t.size}},"953b":function(t,e,o){"use strict";var r=o("dc19"),s=o("cb27"),a=o("8e16"),n=o("7f65"),i=o("384f"),d=o("5388"),c=s.Set,u=s.add,l=s.has;t.exports=function(t){var e=r(this),o=n(t),s=new c;return a(e)>o.size?d(o.getIterator(),(function(t){l(e,t)&&u(s,t)})):i(e,(function(t){o.includes(t)&&u(s,t)})),s}},9961:function(t,e,o){"use strict";var r=o("dc19"),s=o("cb27"),a=o("83b9e"),n=o("7f65"),i=o("5388"),d=s.add,c=s.has,u=s.remove;t.exports=function(t){var e=r(this),o=n(t).getIterator(),s=a(e);return i(o,(function(t){c(e,t)?u(s,t):d(s,t)})),s}},a4e7:function(t,e,o){"use strict";var r=o("23e7"),s=o("395e");r({target:"Set",proto:!0,real:!0,forced:!o("dad2")("isSupersetOf",(function(t){return!t}))},{isSupersetOf:s})},a5f7:function(t,e,o){"use strict";var r=o("dc19"),s=o("cb27"),a=o("83b9e"),n=o("8e16"),i=o("7f65"),d=o("384f"),c=o("5388"),u=s.has,l=s.remove;t.exports=function(t){var e=r(this),o=i(t),s=a(e);return n(e)<=o.size?d(e,(function(t){o.includes(t)&&l(s,t)})):c(o.getIterator(),(function(t){u(e,t)&&l(s,t)})),s}},b31b:function(t,e,o){"use strict";var r=o("9ab4"),s=o("1b40"),a=o("0a6d");let n=class extends s.e{constructor(){super(...arguments),this.checking=!0}closeDialog(){this.checking=!1,this.$refs.lsDialog.close()}openDialog(){this.checking=!0,this.$refs.lsDialog.open()}};Object(r.a)([Object(s.c)()],n.prototype,"title",void 0),n=Object(r.a)([Object(s.a)({components:{LsDialog:a.a}})],n);var i=n,d=o("2877"),c=Object(d.a)(i,(function(){var t=this._self._c;this._self._setupProxy;return t("div",[t("ls-dialog",{ref:"lsDialog",attrs:{width:"510px",top:"30vh",confirmButtonText:!1,cancelButtonText:!1,title:this.title}},[t("div",{directives:[{name:"loading",rawName:"v-loading",value:this.checking,expression:"checking"}],staticStyle:{height:"200px"},attrs:{"element-loading-text":"正在处理中,请稍等..."}})])],1)}),[],!1,null,null,null);e.a=c.exports},b4bc:function(t,e,o){"use strict";var r=o("dc19"),s=o("cb27").has,a=o("8e16"),n=o("7f65"),i=o("384f"),d=o("5388"),c=o("2a62");t.exports=function(t){var e=r(this),o=n(t);if(a(e)<=o.size)return!1!==i(e,(function(t){if(o.includes(t))return!1}),!0);var u=o.getIterator();return!1!==d(u,(function(t){if(s(e,t))return c(u,"normal",!1)}))}},c1a1:function(t,e,o){"use strict";var r=o("23e7"),s=o("b4bc");r({target:"Set",proto:!0,real:!0,forced:!o("dad2")("isDisjointFrom",(function(t){return!t}))},{isDisjointFrom:s})},cb27:function(t,e,o){"use strict";var r=o("e330"),s=Set.prototype;t.exports={Set:Set,add:r(s.add),has:r(s.has),remove:r(s.delete),proto:s}},d09e:function(t,e,o){"use strict";o.d(e,"h",(function(){return s})),o.d(e,"e",(function(){return a})),o.d(e,"i",(function(){return n})),o.d(e,"f",(function(){return i})),o.d(e,"b",(function(){return d})),o.d(e,"g",(function(){return c})),o.d(e,"a",(function(){return u})),o.d(e,"c",(function(){return l})),o.d(e,"d",(function(){return g}));var r=o("f175");const s=t=>r.a.get("/goods.goods_gather/logLists",{params:t}),a=t=>r.a.get("/settings.goods.goods_settings/getGatherKey",{params:t}),n=t=>r.a.post("/settings.goods.goods_settings/setGatherKey",t),i=t=>r.a.post("/goods.goods_gather/gather",t),d=t=>r.a.post("/goods.goods_gather/del",t),c=t=>r.a.get("/goods.goods_gather/lists",{params:t}),u=t=>r.a.post("/goods.goods_gather/createGoods",t),l=t=>r.a.get("/goods.goods_gather/gatherGoodsDetail",{params:{id:t}}),g=t=>r.a.post("/goods.goods_gather/gatherGoodsEdit",t)},dad2:function(t,e,o){"use strict";var r=o("d066"),s=function(t){return{size:t,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},a=function(t){return{size:t,has:function(){return!0},keys:function(){throw new Error("e")}}};t.exports=function(t,e){var o=r("Set");try{(new o)[t](s(0));try{return(new o)[t](s(-1)),!1}catch(r){if(!e)return!0;try{return(new o)[t](a(-1/0)),!1}catch(r){var n=new o;return n.add(1),n.add(2),e(n[t](a(1/0)))}}}catch(t){return!1}}},dc19:function(t,e,o){"use strict";var r=o("cb27").has;t.exports=function(t){return r(t),t}},e9bc:function(t,e,o){"use strict";var r=o("dc19"),s=o("cb27").add,a=o("83b9e"),n=o("7f65"),i=o("5388");t.exports=function(t){var e=r(this),o=n(t).getIterator(),d=a(e);return i(o,(function(t){s(d,t)})),d}}}]);
|