chunk-66b697c0.a7d65fdf.js 77 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-66b697c0"],{"09f4":function(e,t,a){"use strict";a.d(t,"a",(function(){return l})),Math.easeInOutQuad=function(e,t,a,r){return e/=r/2,e<1?a/2*e*e+t:(e--,-a/2*(e*(e-2)-1)+t)};var r=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}();function o(e){document.documentElement.scrollTop=e,document.body.parentNode.scrollTop=e,document.body.scrollTop=e}function n(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function l(e,t,a){var l=n(),s=e-l,i=20,c=0;t="undefined"===typeof t?500:t;var u=function e(){c+=i;var n=Math.easeInOutQuad(c,l,s,t);o(n),c<t?r(e):a&&"function"===typeof a&&a()};u()}},"0f46":function(e,t,a){},2543:function(e,t,a){"use strict";a.d(t,"q",(function(){return i})),a.d(t,"r",(function(){return c})),a.d(t,"u",(function(){return u})),a.d(t,"n",(function(){return d})),a.d(t,"o",(function(){return p})),a.d(t,"s",(function(){return m})),a.d(t,"p",(function(){return f})),a.d(t,"f",(function(){return b})),a.d(t,"g",(function(){return g})),a.d(t,"h",(function(){return h})),a.d(t,"m",(function(){return v})),a.d(t,"t",(function(){return S})),a.d(t,"k",(function(){return I})),a.d(t,"i",(function(){return y})),a.d(t,"j",(function(){return w})),a.d(t,"l",(function(){return O})),a.d(t,"d",(function(){return _})),a.d(t,"e",(function(){return k})),a.d(t,"c",(function(){return L})),a.d(t,"b",(function(){return x})),a.d(t,"a",(function(){return F}));var r=a("b775"),o=a("829b"),n=a("4328"),l=a.n(n),s="/api-web";function i(e){return Object(r["a"])({url:s+"/goods/queryPage",method:"get",params:e})}function c(e){return Object(r["a"])({url:s+"/goods/get/".concat(e),method:"get"})}function u(e){return Object(r["a"])({url:s+"/goods/updateGoodsStatus",method:"post",data:l.a.stringify(e)})}function d(e){return Object(r["a"])({url:s+"/goods/add",method:"post",data:e})}function p(e){return Object(r["a"])({url:s+"/goods/addBatch",method:"post",data:e})}function m(e){return Object(r["a"])({url:s+"/goods/update",method:"post",data:e})}function f(e){return Object(r["a"])({url:s+"/goods/del/".concat(e),method:"post"})}function b(e){return Object(r["a"])({url:s+"/category/queryPage",method:"get",params:e})}function g(e){return Object(r["a"])({url:s+"/category/upset",method:"post",data:e})}function h(e){return Object(r["a"])({url:s+"/category/del",method:"post",data:l.a.stringify(e)})}function v(e){return Object(r["a"])({url:s+"/subjectChange/queryPage",method:"get",params:e})}function S(e){return Object(r["a"])({url:s+"/subjectChange/updateCostMargin",method:"post",data:l.a.stringify(e)})}function I(e){return Object(r["a"])({url:s+"/goodsProcurement/queryGoodsProcurements",method:"get",params:e})}function y(e){return Object(r["a"])({url:s+"/goods/addGoodsProcurement",method:"post",params:e})}function w(e){return Object(r["a"])({url:s+"/swTempJc/queryPageForCourseSchedule",method:"get",params:e})}function O(e){return Object(r["a"])({url:s+"/swTempJc/queryPageForExtensionOrder",method:"get",params:e})}function _(e){return Object(o["a"])({url:s+"/goods/queryGoodsSubByPage",method:"GET",params:e,data:{}})}function k(e){return Object(o["a"])({url:s+"/goods/queryGoodsTypeList",method:"GET",params:e,data:{}})}function L(e){return Object(o["a"])({url:s+"/goods/queryGoodsCategoryList",method:"GET",params:e,data:{}})}function x(e){return Object(o["a"])({url:s+"/goods/queryGoodsBrandList",method:"GET",params:e,data:{}})}function F(e){return Object(o["a"])({url:s+"/goods/get/"+e.id,method:"GET",data:{}})}},"3b28":function(e,t,a){},"47c6":function(e,t,a){"use strict";a("3b28")},"54b3":function(e,t,a){"use strict";a.r(t);var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"m-container"},[e._m(0),e._v(" "),a("div",{staticClass:"m-core"},[a("el-button",{directives:[{name:"permission",rawName:"v-permission",value:"/shopOperation",expression:"'/shopOperation'"}],staticStyle:{"margin-bottom":"20px"},attrs:{type:"primary"},on:{click:function(t){return e.onShopOperation("create")}}},[e._v("添加")]),e._v(" "),a("el-button",{directives:[{name:"permission",rawName:"v-permission",value:"goods/add/commonAdd",expression:"'goods/add/commonAdd'"}],staticStyle:{"margin-bottom":"20px"},attrs:{type:"primary"},on:{click:e.onShopComAdd}},[e._v("添加组合商品")]),e._v(" "),a("el-button",{staticStyle:{"margin-bottom":"20px"},attrs:{type:"primary"},on:{click:e.onDownload}},[e._v("下载组合商品模板")]),e._v(" "),a("el-upload",{directives:[{name:"permission",rawName:"v-permission",value:"import/goodsV2",expression:"'import/goodsV2'"}],staticStyle:{display:"inline-block","margin-left":"10px"},attrs:{action:"/api-web/import/goodsV2","show-file-list":!1,"before-upload":e.beforeUpload,accept:".xlsx,.xls",headers:e.headers,"on-error":e.handleError,"on-success":e.handleSuccess}},[a("el-button",{staticStyle:{"margin-bottom":"20px"},attrs:{type:"primary"}},[e._v("\n 组合商品导入\n ")])],1),e._v(" "),a("save-form",{ref:"searchForm",staticClass:"searchForm",attrs:{inline:!0,model:e.searchForm},on:{submit:e.onSearch,reset:e.onReset}},[a("el-form-item",{attrs:{prop:"search"}},[a("el-input",{attrs:{clearable:"",placeholder:"商品编号/货号/商品名称"},model:{value:e.searchForm.search,callback:function(t){e.$set(e.searchForm,"search","string"===typeof t?t.trim():t)},expression:"searchForm.search"}})],1),e._v(" "),a("el-form-item",{attrs:{prop:"educationShowOrganId"}},[a("el-select",{attrs:{clearable:"",placeholder:"移动端可售分部"},model:{value:e.searchForm.educationShowOrganId,callback:function(t){e.$set(e.searchForm,"educationShowOrganId","string"===typeof t?t.trim():t)},expression:"searchForm.educationShowOrganId"}},e._l(e.selects.branchs,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id.toString()}})})),1)],1),e._v(" "),a("el-form-item",{attrs:{prop:"courseFeeShowOrganId"}},[a("el-select",{attrs:{clearable:"",placeholder:"课程收费团可售分部"},model:{value:e.searchForm.courseFeeShowOrganId,callback:function(t){e.$set(e.searchForm,"courseFeeShowOrganId","string"===typeof t?t.trim():t)},expression:"searchForm.courseFeeShowOrganId"}},e._l(e.selects.branchs,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id.toString()}})})),1)],1),e._v(" "),a("el-form-item",{attrs:{prop:"memberFeeShowOrganId"}},[a("el-select",{attrs:{clearable:"",placeholder:"会员收费团可见分部"},model:{value:e.searchForm.memberFeeShowOrganId,callback:function(t){e.$set(e.searchForm,"memberFeeShowOrganId","string"===typeof t?t.trim():t)},expression:"searchForm.memberFeeShowOrganId"}},e._l(e.selects.branchs,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id.toString()}})})),1)],1),e._v(" "),a("el-form-item",{attrs:{prop:"freeFeeShowOrganId"}},[a("el-select",{attrs:{clearable:"",placeholder:"免费团可见分部"},model:{value:e.searchForm.freeFeeShowOrganId,callback:function(t){e.$set(e.searchForm,"freeFeeShowOrganId","string"===typeof t?t.trim():t)},expression:"searchForm.freeFeeShowOrganId"}},e._l(e.selects.branchs,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id.toString()}})})),1)],1),e._v(" "),1==e.tenantId?a("el-form-item",{attrs:{prop:"replacementShowOrganId"}},[a("el-select",{attrs:{clearable:"",placeholder:"乐器置换可见分部"},model:{value:e.searchForm.replacementShowOrganId,callback:function(t){e.$set(e.searchForm,"replacementShowOrganId","string"===typeof t?t.trim():t)},expression:"searchForm.replacementShowOrganId"}},e._l(e.selects.branchs,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id.toString()}})})),1)],1):e._e(),e._v(" "),a("el-form-item",{attrs:{prop:"type"}},[a("el-select",{attrs:{clearable:"",placeholder:"商品类型"},model:{value:e.searchForm.type,callback:function(t){e.$set(e.searchForm,"type","string"===typeof t?t.trim():t)},expression:"searchForm.type"}},e._l(e.goodsType,(function(e,t){return a("el-option",{key:t,attrs:{label:e.label,value:e.value}})})),1)],1),e._v(" "),a("el-form-item",{attrs:{prop:"goodsCategoryId"}},[a("el-select",{attrs:{clearable:"",placeholder:"商品分类"},model:{value:e.searchForm.goodsCategoryId,callback:function(t){e.$set(e.searchForm,"goodsCategoryId","string"===typeof t?t.trim():t)},expression:"searchForm.goodsCategoryId"}},e._l(e.categoryList,(function(e,t){return a("el-option",{key:t,attrs:{label:e.label,value:e.value}})})),1)],1),e._v(" "),a("el-form-item",{attrs:{prop:"brandId"}},[a("el-select",{attrs:{clearable:"",placeholder:"商品品牌"},model:{value:e.searchForm.brandId,callback:function(t){e.$set(e.searchForm,"brandId","string"===typeof t?t.trim():t)},expression:"searchForm.brandId"}},e._l(e.goodsBrand,(function(e,t){return a("el-option",{key:t,attrs:{label:e.label,value:e.value}})})),1)],1),e._v(" "),a("el-form-item",{attrs:{prop:"status"}},[a("el-select",{attrs:{clearable:"",placeholder:"是否是上架"},model:{value:e.searchForm.status,callback:function(t){e.$set(e.searchForm,"status","string"===typeof t?t.trim():t)},expression:"searchForm.status"}},[a("el-option",{attrs:{label:"是",value:"1"}}),e._v(" "),a("el-option",{attrs:{label:"否",value:"0"}})],1)],1),e._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"danger","native-type":"submit"}},[e._v("搜索")]),e._v(" "),a("el-button",{attrs:{type:"primary","native-type":"reset"}},[e._v("重置")])],1)],1),e._v(" "),a("div",{staticClass:"tableWrap"},[a("el-table",{attrs:{data:e.tableList,"header-cell-style":{background:"#EDEEF0",color:"#444"}}},[a("el-table-column",{attrs:{align:"center",prop:"id",label:"商品编号"}}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"sn",label:"货号"}}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"brandName",label:"品牌"}}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"name",label:"商品名称",width:"150px"},scopedSlots:e._u([{key:"default",fn:function(e){return[a("overflow-text",{attrs:{text:e.row.name,width:"100%"}})]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",label:"商品类型"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(e._f("shopType")(t.row.type))+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"goodsCategoryName",label:"商品分类"}}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"specification",label:"具体型号"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",{staticStyle:{"max-height":"64px",display:"block"}},[e._v(e._s(t.row.specification))])]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"stockCount",label:"库存"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",[e._v(e._s(t.row.stockCount))])]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"marketPrice",label:"市场价(元)"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(e._f("moneyFormat")(t.row.marketPrice))+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"discountPrice",label:"零售价(元)"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(e._f("moneyFormat")(t.row.discountPrice))+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"groupPurchasePrice",label:"商品团购价(元)"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(e._f("moneyFormat")(t.row.groupPurchasePrice))+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"organCostPrice",label:"分部成本(元)"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(e._f("moneyFormat")(t.row.organCostPrice))+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center","cell-style":"padding: 0",label:"商品缩略图"},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.image?a("img",{staticClass:"shopImage",attrs:{src:t.row.image,alt:"",srcset:""}}):e._e()]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",label:"商品描述"},scopedSlots:e._u([{key:"default",fn:function(e){return[a("Tooltip",{attrs:{content:e.row.brief}})]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",label:"商品详情"},scopedSlots:e._u([{key:"default",fn:function(e){return[a("Tooltip",{attrs:{content:e.row.desc}})]}}])}),e._v(" "),a("el-table-column",{key:"caozuo",attrs:{align:"center",width:"180px",label:"操作",fixed:"right"},scopedSlots:e._u([{key:"default",fn:function(t){return[0==t.row.status&&e.permission("goods/updateGoodsStatus")?a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.onUpdate(t.row,0)}}},[e._v("上架")]):e._e(),e._v(" "),1==t.row.status&&e.permission("goods/updateGoodsStatus/downGoods")?a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.onUpdate(t.row,1)}}},[e._v("下架")]):e._e(),e._v(" "),0==t.row.status&&e.permission("/shopOperation/updateShop")?a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.onShopOperation("update",t.row)}}},[e._v("修改")]):e._e(),e._v(" "),1==t.row.status&&e.permission("/shopOperation/shopLook")?a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.onShopOperation("look",t.row)}}},[e._v("查看")]):e._e(),e._v(" "),e.permission("goods/copyGoods")&&t.row.groupGoods?a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.onShopOperation("copy",t.row)}}},[e._v("复制")]):e._e()]}}])})],1),e._v(" "),a("pagination",{attrs:{sync:"",total:e.pageInfo.total,page:e.pageInfo.page,limit:e.pageInfo.limit,"page-sizes":e.pageInfo.page_size},on:{"update:total":function(t){return e.$set(e.pageInfo,"total",t)},"update:page":function(t){return e.$set(e.pageInfo,"page",t)},"update:limit":function(t){return e.$set(e.pageInfo,"limit",t)},pagination:e.getList}})],1)],1),e._v(" "),e.routeShopStatus?a("el-dialog",{attrs:{title:e.addString[e.addType]+"组合商品",visible:e.routeShopStatus,width:"1000px"},on:{"update:visible":function(t){e.routeShopStatus=t}}},[a("combinationProducts",{attrs:{activeRow:e.activeRow,addType:e.addType,addDisabled:e.addDisabled,categoryList:e.categoryList,goodsBrand:e.goodsBrand,goodsType:e.goodsType,selectGoodsList:e.selectGoodsList,tenantId:e.tenantId},on:{close:function(t){e.routeShopStatus=!1},confirm:e.getList}})],1):e._e(),e._v(" "),e.singleShopStatus?a("el-dialog",{attrs:{title:e.addString[e.addType]+"商品",visible:e.singleShopStatus,width:"1200px"},on:{"update:visible":function(t){e.singleShopStatus=t},close:function(t){return e.onFormClose("ruleForm")}}},[a("singleProducts",{attrs:{activeRow:e.activeRow,addType:e.addType,addDisabled:e.addDisabled,categoryList:e.categoryList,goodsBrand:e.goodsBrand,goodsType:e.goodsType,tenantId:e.tenantId},on:{close:function(t){e.singleShopStatus=!1},confirm:e.getList}})],1):e._e()],1)},o=[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("h2",[a("div",{staticClass:"squrt"}),e._v("\n 商品列表\n ")])}],n=(a("28a5"),a("7f7f"),a("ac6a"),a("c7eb")),l=(a("96cf"),a("1da1")),s=a("ade3"),i=a("333d"),c=a("c7f0"),u=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("el-form",{ref:"ruleForm",attrs:{model:e.form,rules:e.rules,inline:!0}},[a("el-alert",{staticClass:"alert",attrs:{title:"子商品信息",closable:!1,type:"info"}}),e._v(" "),a("el-table",{staticStyle:{width:"100%!important"},attrs:{data:e.form.goodsList,"header-cell-style":{background:"#EDEEF0",color:"#444"}}},[a("el-table-column",{attrs:{align:"center",prop:"name",label:"商品名称"},scopedSlots:e._u([{key:"default",fn:function(e){return[a("tooltip",{attrs:{content:e.row.name}})]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"productSn",label:"商品货号"}}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"price",label:"销售价格"}}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"skuCode",label:"sku编号"}}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"sn",label:"成本"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-form-item",{staticClass:"tableItem",attrs:{"show-message":!1,prop:"goodsList."+t.$index+".goodsPrice",rules:[{required:!0,message:"请输入成本",trigger:"blur"}]}},[a("el-input-number",{staticClass:"number-input",staticStyle:{width:"100%!important"},attrs:{controls:!1,precision:2,min:0,placeholder:"请输入成本",disabled:e.addDisabled},model:{value:e.form.goodsList[t.$index].goodsPrice,callback:function(a){e.$set(e.form.goodsList[t.$index],"goodsPrice",a)},expression:"form.goodsList[scope.$index].goodsPrice"}})],1)]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"sn",label:"商城状态"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-tag",{attrs:{type:1==t.row.publishStatus?"":"danger"}},[e._v("\n "+e._s(t.row.publishStatus?"上架":"下架")+"\n ")])]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"sn",label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{type:"text",disabled:e.addDisabled},on:{click:function(a){return a.preventDefault(),e.removeGoodsList(t.row)}}},[e._v("删除")])]}}])})],1),e._v(" "),a("el-button",{staticStyle:{width:"100%",margin:"20px 0"},attrs:{icon:"el-icon-circle-plus-outline",plain:"",type:"info",disabled:e.addDisabled},on:{click:e.addGoodsList}},[e._v("添加子商品")]),e._v(" "),a("el-alert",{staticClass:"alert",attrs:{title:"基础信息",closable:!1,type:"info"}}),e._v(" "),a("el-form-item",{attrs:{label:"商品名称",prop:"name","label-width":e.formLabelWidth}},[a("el-input",{staticStyle:{width:"220px !important"},attrs:{placeholder:"请输入商品名称",type:"text",disabled:e.addDisabled},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name","string"===typeof t?t.trim():t)},expression:"form.name"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"货号",prop:"sn","label-width":e.formLabelWidth}},[a("el-input",{staticStyle:{width:"220px !important"},attrs:{placeholder:"请输入货号",type:"text",disabled:e.addDisabled},model:{value:e.form.sn,callback:function(t){e.$set(e.form,"sn","string"===typeof t?t.trim():t)},expression:"form.sn"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"品牌",prop:"brand","label-width":e.formLabelWidth}},[a("el-select",{staticStyle:{width:"220px !important"},attrs:{disabled:e.addDisabled,placeholder:"请选择品牌"},model:{value:e.form.brand,callback:function(t){e.$set(e.form,"brand","string"===typeof t?t.trim():t)},expression:"form.brand"}},e._l(e.goodsCategoryList,(function(e,t){return a("el-option",{key:t,attrs:{label:e.label,value:e.value}})})),1)],1),e._v(" "),a("el-form-item",{attrs:{label:"商品类型",prop:"type","label-width":e.formLabelWidth}},[a("el-select",{staticStyle:{width:"220px !important"},attrs:{disabled:e.addDisabled,placeholder:"请选择商品类型"},model:{value:e.form.type,callback:function(t){e.$set(e.form,"type","string"===typeof t?t.trim():t)},expression:"form.type"}},e._l(e.goodsType,(function(e,t){return a("el-option",{key:t,attrs:{label:e.label,value:e.value}})})),1)],1),e._v(" "),a("el-form-item",{attrs:{label:"商品分类",prop:"goodsCategoryId","label-width":e.formLabelWidth}},[a("el-select",{staticStyle:{width:"220px !important"},attrs:{clearable:"",placeholder:"请选择商品分类",disabled:e.addDisabled},model:{value:e.form.goodsCategoryId,callback:function(t){e.$set(e.form,"goodsCategoryId","string"===typeof t?t.trim():t)},expression:"form.goodsCategoryId"}},e._l(e.categoryList,(function(e,t){return a("el-option",{key:t,attrs:{label:e.label,value:e.value}})})),1)],1),e._v(" "),a("el-form-item",{attrs:{label:"商品型号",prop:"specification","label-width":e.formLabelWidth}},[a("el-input",{staticStyle:{width:"220px !important"},attrs:{disabled:e.addDisabled,placeholder:"请输入商品型号"},model:{value:e.form.specification,callback:function(t){e.$set(e.form,"specification","string"===typeof t?t.trim():t)},expression:"form.specification"}})],1),e._v(" "),a("el-alert",{staticClass:"alert",attrs:{title:"价格信息",closable:!1,type:"info"}}),e._v(" "),a("el-form-item",{staticClass:"hiddenStart",attrs:{label:"市场价",prop:"marketPrice","label-width":e.formLabelWidth}},[a("template",{slot:"label"},[a("p",{staticStyle:{position:"relative"}},[a("span",{staticStyle:{color:"#f56c6c","margin-right":"4px"}},[e._v("*")]),e._v("\n 市场价\n "),a("el-tooltip",{attrs:{placement:"top","popper-class":"mTooltip"}},[a("div",{attrs:{slot:"content"},slot:"content"},[e._v("\n 商品标价,仅在商品购买时做展示,不以该价格向学员销售商品\n ")]),e._v(" "),a("i",{staticClass:"el-icon-question",staticStyle:{"font-size":"18px",color:"#f56c6c",position:"relative",top:"2px"}})])],1)]),e._v(" "),a("el-input",{staticStyle:{width:"220px !important"},attrs:{type:"number",placeholder:"请输入市场价",disabled:e.addDisabled},nativeOn:{mousewheel:function(e){e.preventDefault()}},model:{value:e.form.marketPrice,callback:function(t){e.$set(e.form,"marketPrice","string"===typeof t?t.trim():t)},expression:"form.marketPrice"}})],2),e._v(" "),a("el-form-item",{staticClass:"hiddenStart",attrs:{label:"零售价",prop:"discountPrice","label-width":e.formLabelWidth}},[a("template",{slot:"label"},[a("p",{staticStyle:{position:"relative"}},[a("span",{staticStyle:{color:"#f56c6c","margin-right":"4px"}},[e._v("*")]),e._v("\n 零售价\n "),a("el-tooltip",{attrs:{placement:"top","popper-class":"mTooltip"}},[a("div",{attrs:{slot:"content"},slot:"content"},[e._v("\n 管理端APP、乐器维修时学员购买该商品的价格\n ")]),e._v(" "),a("i",{staticClass:"el-icon-question",staticStyle:{"font-size":"18px",color:"#f56c6c",position:"relative",top:"2px"}})])],1)]),e._v(" "),a("el-input",{staticStyle:{width:"220px !important"},attrs:{type:"number",placeholder:"请输入零售价",disabled:e.addDisabled},nativeOn:{mousewheel:function(e){e.preventDefault()}},model:{value:e.form.discountPrice,callback:function(t){e.$set(e.form,"discountPrice","string"===typeof t?t.trim():t)},expression:"form.discountPrice"}})],2),e._v(" "),a("el-form-item",{staticClass:"hiddenStart",attrs:{label:"商品团购价",prop:"groupPurchasePrice","label-width":e.formLabelWidth}},[a("template",{slot:"label"},[a("p",{staticStyle:{position:"relative"}},[a("span",{staticStyle:{color:"#f56c6c","margin-right":"4px"}},[e._v("*")]),e._v("\n 团购价\n "),a("el-tooltip",{attrs:{placement:"top","popper-class":"mTooltip"}},[a("div",{attrs:{slot:"content"},slot:"content"},[e._v("乐团报名缴费时学员购买该商品的价格")]),e._v(" "),a("i",{staticClass:"el-icon-question",staticStyle:{"font-size":"18px",color:"#f56c6c",position:"relative",top:"2px"}})])],1)]),e._v(" "),a("el-input",{staticStyle:{width:"220px !important"},attrs:{type:"number",placeholder:"请输入商品团购价",disabled:e.addDisabled},nativeOn:{mousewheel:function(e){e.preventDefault()}},model:{value:e.form.groupPurchasePrice,callback:function(t){e.$set(e.form,"groupPurchasePrice","string"===typeof t?t.trim():t)},expression:"form.groupPurchasePrice"}})],2),e._v(" "),a("el-alert",{staticClass:"alert",attrs:{title:"销售渠道",closable:!1,type:"info"}}),e._v(" "),a("el-form-item",{attrs:{label:"移动端可售分部",prop:"educationShowOrganId","label-width":e.formLabelWidth}},[a("select-all",{staticStyle:{width:"400px !important"},attrs:{filterable:"",placeholder:"移动端可售分部",multiple:"",clearable:"",disabled:e.addDisabled},model:{value:e.form.educationShowOrganId,callback:function(t){e.$set(e.form,"educationShowOrganId","string"===typeof t?t.trim():t)},expression:"form.educationShowOrganId"}},e._l(e.selects.branchs,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id.toString()}})})),1)],1),e._v(" "),a("el-form-item",{attrs:{label:"课程收费乐团可售分部",prop:"courseFeeShowOrganId","label-width":e.formLabelWidth}},[a("select-all",{staticStyle:{width:"400px !important"},attrs:{filterable:"",placeholder:"课程收费乐团可售分部",multiple:"",clearable:"",disabled:e.addDisabled},model:{value:e.form.courseFeeShowOrganId,callback:function(t){e.$set(e.form,"courseFeeShowOrganId","string"===typeof t?t.trim():t)},expression:"form.courseFeeShowOrganId"}},e._l(e.selects.branchs,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id.toString()}})})),1)],1),e._v(" "),a("el-form-item",{attrs:{label:"会员收费乐团可售分部",prop:"memberFeeShowOrganId","label-width":e.formLabelWidth}},[a("select-all",{staticStyle:{width:"400px !important"},attrs:{filterable:"",placeholder:"请选择会员收费团可见分部",multiple:"",clearable:"",disabled:e.addDisabled},model:{value:e.form.memberFeeShowOrganId,callback:function(t){e.$set(e.form,"memberFeeShowOrganId","string"===typeof t?t.trim():t)},expression:"form.memberFeeShowOrganId"}},e._l(e.selects.branchs,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id.toString()}})})),1)],1),e._v(" "),a("el-form-item",{attrs:{label:"免费乐团可售分部",prop:"freeFeeShowOrganId","label-width":e.formLabelWidth}},[a("select-all",{staticStyle:{width:"400px !important"},attrs:{filterable:"",placeholder:"请选择会员收费团可见分部",multiple:"",clearable:"",disabled:e.addDisabled},model:{value:e.form.freeFeeShowOrganId,callback:function(t){e.$set(e.form,"freeFeeShowOrganId","string"===typeof t?t.trim():t)},expression:"form.freeFeeShowOrganId"}},e._l(e.selects.branchs,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id.toString()}})})),1)],1),e._v(" "),1==e.tenantId?a("el-form-item",{attrs:{label:"乐器置换可售分部",prop:"replacementShowOrganId","label-width":e.formLabelWidth}},[a("select-all",{staticStyle:{width:"400px !important"},attrs:{filterable:"",placeholder:"请选择乐器置换可售分部",multiple:"",clearable:"",disabled:e.addDisabled},model:{value:e.form.replacementShowOrganId,callback:function(t){e.$set(e.form,"replacementShowOrganId","string"===typeof t?t.trim():t)},expression:"form.replacementShowOrganId"}},e._l(e.selects.branchs,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id.toString()}})})),1)],1):e._e(),e._v(" "),a("el-alert",{staticClass:"alert",attrs:{title:"商品信息",closable:!1,type:"info"}}),e._v(" "),a("el-form-item",{attrs:{label:"商品图片",prop:"image","label-width":e.formLabelWidth}},[a("image-cropper",{attrs:{options:e.cropperOptions,disabled:e.addDisabled,imgSize:2,imageUrl:e.form.image,bucket_name:"mall"},on:{"crop-upload-success":e.cropSuccess}}),e._v(" "),a("p",{staticStyle:{color:"red"}},[e._v("请上传大小2M以内,格式为jpg、png、gif图片")])],1),e._v(" "),a("br"),e._v(" "),a("el-form-item",{attrs:{label:"商品描述",prop:"brief","label-width":e.formLabelWidth}},[a("el-input",{staticStyle:{width:"400px"},attrs:{type:"textarea",disabled:e.addDisabled},model:{value:e.form.brief,callback:function(t){e.$set(e.form,"brief","string"===typeof t?t.trim():t)},expression:"form.brief"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"商品详情",prop:"desc","label-width":e.formLabelWidth}},[a("el-input",{staticStyle:{width:"400px"},attrs:{type:"textarea",disabled:e.addDisabled},model:{value:e.form.desc,callback:function(t){e.$set(e.form,"desc","string"===typeof t?t.trim():t)},expression:"form.desc"}})],1)],1),e._v(" "),e.addDisabled?e._e():a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){return e.$listeners.close()}}},[e._v("取 消")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.onShopSubmit("ruleForm")}}},[e._v("确 定")])],1),e._v(" "),e.recordStatus?a("el-dialog",{attrs:{title:"添加子商品",visible:e.recordStatus,"close-on-click-modal":!1,width:"1200px","append-to-body":""},on:{"update:visible":function(t){e.recordStatus=t}}},[a("subShopGoods",{attrs:{disabledIds:e.disabledIds,goodsBrand:e.goodsBrand},on:{close:function(t){e.recordStatus=!1},comfirm:e.onConfirm}})],1):e._e()],1)},d=[],p=(a("20d6"),a("6762"),a("2fdb"),a("2909")),m=a("b85c"),f=(a("c5f6"),a("2543")),b=a("e3eb"),g=a.n(b),h=a("896b"),v=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("save-form",{ref:"searchForm",staticClass:"searchForm",attrs:{inline:!0,model:e.searchForm,"save-key":"subShopGoods"},on:{submit:e.onSearch,reset:e.onReset}},[a("el-form-item",{attrs:{prop:"keyword"}},[a("el-input",{attrs:{clearable:"",placeholder:"商品名称"},model:{value:e.searchForm.keyword,callback:function(t){e.$set(e.searchForm,"keyword","string"===typeof t?t.trim():t)},expression:"searchForm.keyword"}})],1),e._v(" "),a("el-form-item",{attrs:{prop:"productSn"}},[a("el-input",{attrs:{clearable:"",placeholder:"商品货号"},model:{value:e.searchForm.productSn,callback:function(t){e.$set(e.searchForm,"productSn","string"===typeof t?t.trim():t)},expression:"searchForm.productSn"}})],1),e._v(" "),a("el-form-item",{attrs:{prop:"productCategoryId"}},[a("el-cascader",{attrs:{options:e.categoryList,placeholder:"商品分类",props:{expandTrigger:"hover"}},model:{value:e.searchForm.productCategoryId,callback:function(t){e.$set(e.searchForm,"productCategoryId","string"===typeof t?t.trim():t)},expression:"searchForm.productCategoryId"}})],1),e._v(" "),a("el-form-item",{attrs:{prop:"brandId"}},[a("el-select",{attrs:{clearable:"",placeholder:"商品品牌"},model:{value:e.searchForm.brandId,callback:function(t){e.$set(e.searchForm,"brandId","string"===typeof t?t.trim():t)},expression:"searchForm.brandId"}},e._l(e.goodsBrand,(function(e,t){return a("el-option",{key:t,attrs:{label:e.label,value:e.value}})})),1)],1),e._v(" "),a("el-form-item",{attrs:{prop:"publishStatus"}},[a("el-select",{attrs:{clearable:"",placeholder:"上架状态"},model:{value:e.searchForm.publishStatus,callback:function(t){e.$set(e.searchForm,"publishStatus","string"===typeof t?t.trim():t)},expression:"searchForm.publishStatus"}},[a("el-option",{attrs:{label:"上架",value:1}}),e._v(" "),a("el-option",{attrs:{label:"下架",value:0}})],1)],1),e._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"danger","native-type":"submit"}},[e._v("搜索")]),e._v(" "),a("el-button",{attrs:{type:"primary","native-type":"reset"}},[e._v("重置")])],1)],1),e._v(" "),a("div",{staticClass:"tableWrap"},[a("el-table",{ref:"multipleSelection",attrs:{data:e.tableList,"header-cell-style":{background:"#EDEEF0",color:"#444"}},on:{"selection-change":e.handleSelectionChange,select:e.onTableSelect}},[a("el-table-column",{attrs:{type:"selection",width:"55",selectable:e.onSelectable}}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"name",label:"商品名称",width:"200px"},scopedSlots:e._u([{key:"default",fn:function(e){return[a("tooltip",{attrs:{content:e.row.name}})]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"productSn",label:"商品货号"}}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"brandName",label:"品牌"}}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"skuCode",label:"sku编号"}}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"price",label:"销售价格"}}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"stock",label:"剩余库存"}}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"publishStatus",label:"状态"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-tag",{attrs:{type:1==t.row.publishStatus?"":"danger"}},[e._v("\n "+e._s(t.row.publishStatus?"上架":"下架")+"\n ")])]}}])})],1),e._v(" "),a("pagination",{attrs:{sync:"","save-key":"subShopGoods",total:e.pageInfo.total,page:e.pageInfo.page,limit:e.pageInfo.limit,"page-sizes":e.pageInfo.page_size},on:{"update:total":function(t){return e.$set(e.pageInfo,"total",t)},"update:page":function(t){return e.$set(e.pageInfo,"page",t)},"update:limit":function(t){return e.$set(e.pageInfo,"limit",t)},pagination:e.getList}})],1),e._v(" "),a("div",{staticClass:"dialog-footer"},[a("el-button",{on:{click:function(t){return e.onClose()}}},[e._v("取 消")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.onSubmit()}}},[e._v("确 定")])],1)],1)},S=[],I={props:["disabledIds","goodsBrand"],components:{pagination:i["a"]},data:function(){return{categoryList:[],pageInfo:{limit:10,page:1,total:0,page_size:[10,20,40,50]},searchForm:{keyword:null,productSn:null,publishStatus:null,productCategoryId:null,brandId:null},tableList:[],isNewPage:!1,selectList:[]}},mounted:function(){this.__init(),this.getList()},methods:{__init:function(){var e=Object(l["a"])(Object(n["a"])().mark((function e(){var t,a,r,o,l;return Object(n["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t={delFlag:0,rows:9999},e.prev=1,e.next=4,Object(f["c"])(t);case 4:a=e.sent,r=a.data,o=r||[],l=[],o.forEach((function(e){var t=[];e.children&&e.children.length>0&&e.children.forEach((function(e){t.push({label:e.name,value:e.id})})),l.push({label:e.name,value:e.id,children:t})})),this.categoryList=l,e.next=14;break;case 12:e.prev=12,e.t0=e["catch"](1);case 14:case"end":return e.stop()}}),e,this,[[1,12]])})));function t(){return e.apply(this,arguments)}return t}(),getList:function(){var e=this,t=Object.assign({},this.searchForm);t.rows=this.pageInfo.limit,t.page=this.pageInfo.page,t.productCategoryId=t.productCategoryId?t.productCategoryId[t.productCategoryId.length-1]:null,Object(f["d"])(t).then((function(t){if(200==t.code&&t.data){e.tableList=t.data.rows,e.pageInfo.total=t.data.total;var a=e.selectList.map((function(e){return e.skuStockId}));e.isNewPage=!0,e.$nextTick((function(){e.tableList.forEach((function(t){-1!=a.indexOf(t.skuStockId)&&e.$refs.multipleSelection.toggleRowSelection(t,!0)})),e.isNewPage=!1}))}}))},onSearch:function(){this.pageInfo.page=1,this.getList()},onReset:function(){this.$refs.searchForm.resetFields(),this.getList()},onClose:function(){this.$listeners.close()},onSubmit:function(){this.$listeners.comfirm(this.selectList),this.onClose()},onSelectable:function(e){return!this.disabledIds.includes(e.skuStockId)},handleSelectionChange:function(e){var t=this;if(e.length>0)this.selectList=this.selectList.concat(e),this.selectList=this.$helpers.lodash.uniqBy(this.selectList,"skuStockId");else{if(this.isNewPage)return;var a=this.selectList.map((function(e){return e.skuStockId}));this.$nextTick((function(){var e=[];t.tableList.forEach((function(r){e.push(r.skuStockId),-1!=a.indexOf(r.skuStockId)&&t.$refs.tableList.toggleRowSelection(r,!1)})),t.selectList=t.$helpers.lodash.remove(t.selectList,(function(t){return-1==e.indexOf(t.skuStockId)})),t.selectList.length<=0&&t.clearCom()}))}},onTableSelect:function(e,t){var a=this.selectList.map((function(e){return e.skuStockId}));-1!=a.indexOf(t.skuStockId)&&(this.selectList.splice(a.indexOf(t.skuStockId),1),this.selectList.length<=0&&this.clearCom())},clearCom:function(){}}},y=I,w=(a("969a"),a("2877")),O=Object(w["a"])(y,v,S,!1,null,"082969ba",null),_=O.exports,k=function(e,t,a){""==t&&"string"==typeof t||null==t?a(new Error("请输入金额")):t<0?a(new Error("输入金额必须大于或等于0")):t>=1e5?a(new Error("输入金额必须小于100000")):a()},L={props:["activeRow","addType","addDisabled","categoryList","selectGoodsList","tenantId","goodsBrand","goodsType"],components:{ImageCropper:h["a"],subShopGoods:_},data:function(){return{formLabelWidth:"160px",goodsCategoryList:[],form:{sn:null,brand:null,supplyChannel:null,name:null,type:null,organIdList:[],goodsCategoryId:null,specification:null,marketPrice:null,discountPrice:null,groupPurchasePrice:null,clientShow:null,educationalShow:null,musicGroupShow:null,courseViewType:[],stockWarning:null,image:null,complementGoodsIdList:null,groupGoods:1,goodsList:[],brief:null,desc:null,replacementShow:null,studentShowOrganId:null,educationShowOrganId:null,courseFeeShowOrganId:null,memberFeeShowOrganId:null,freeFeeShowOrganId:null,replacementShowOrganId:null},goodsTree:[],rules:{sn:[{required:!0,message:"请输入商品货号",trigger:"blur"}],brand:[{required:!0,message:"请输入品牌",trigger:"blur"}],supplyChannel:[{required:!0,message:"请输入备查货号",trigger:"blur"}],name:[{required:!0,message:"请输入商品名称",trigger:"blur"},{min:2,max:30,message:"长度在 2 到 30 个字符",trigger:"blur"}],type:[{required:!0,message:"请选择商品类型",trigger:"change"}],goodsCategoryId:[{required:!0,message:"请选择商品分类",trigger:"change"}],organIdList:[{required:!0,message:"请选择所属分部",trigger:"change"}],specification:[{required:!0,message:"请输入商品型号",trigger:"blur"},{min:2,max:30,message:"长度在 2 到 30 个字符",trigger:"blur"}],marketPrice:[{required:!0,validator:k,trigger:"blur"}],discountPrice:[{required:!0,validator:k,trigger:"blur"}],groupPurchasePrice:[{required:!0,validator:k,trigger:"blur"}],clientShow:[{required:!0,message:"请选择学员是否展示",trigger:"change"}],educationalShow:[{required:!0,message:"请选择教务端是否展示",trigger:"change"}],musicGroupShow:[{required:!0,message:"请选择乐团是否展示",trigger:"change"}],courseViewType:[{required:!0,message:"请选乐团收费模式",trigger:"change"}],replacementShow:[{required:!0,message:"请选择是否参与置换",trigger:"change"}],stockWarning:[{required:!0,message:"请选择是否库存预警",trigger:"change"}],image:[{required:!0,message:"请选择图片",trigger:"blur"}]},goodsDetail:{},cropperOptions:{autoCrop:!0,autoCropWidth:300,autoCropHeight:300,fixedBox:!0,previewsCircle:!1,title:"商品图片"},recordStatus:!1,disabledIds:[]}},mounted:function(){var e=Object(l["a"])(Object(n["a"])().mark((function e(){var t,a,r,o,l,s,i;return Object(n["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if("create"===this.addType){e.next=29;break}return e.prev=1,e.next=4,Object(f["a"])({id:this.activeRow.id});case 4:for(l in t=e.sent,a=t.data,this.goodsDetail=a||{},r=this.goodsDetail,o=this.form,o)o[l]="brand"===l?Number(r[l]):r[l];s=r.goodsSubList,i=[],s.forEach((function(e){i.push({name:e.mallGoodsName,goodsId:e.mallGoodsId,skuStockId:e.sku,skuCode:e.skuCode,brandId:e.brandId,brandName:e.brandName,price:e.price,publishStatus:e.goodsStatus,productSn:e.productSn,goodsPrice:e.goodsPrice})})),o.goodsList=i,o.id=r.id,r.courseViewType&&(o.courseViewType=r.courseViewType.split(",")),r.studentShowOrganId&&(o.studentShowOrganId=r.studentShowOrganId.split(",")),r.educationShowOrganId&&(o.educationShowOrganId=r.educationShowOrganId.split(",")),r.courseFeeShowOrganId&&(o.courseFeeShowOrganId=r.courseFeeShowOrganId.split(",")),r.memberFeeShowOrganId&&(o.memberFeeShowOrganId=r.memberFeeShowOrganId.split(",")),r.freeFeeShowOrganId&&(o.freeFeeShowOrganId=r.freeFeeShowOrganId.split(",")),r.replacementShowOrganId&&(o.replacementShowOrganId=r.replacementShowOrganId.split(",")),r.organIdList&&(o.organIdList=r.organIdList.split(",")),this.getBrandCatatory(),e.next=29;break;case 26:e.prev=26,e.t0=e["catch"](1),console.log(e.t0,"1212");case 29:case"end":return e.stop()}}),e,this,[[1,26]])})));function t(){return e.apply(this,arguments)}return t}(),methods:{formatParentId:function(e,t){var a,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=Object(m["a"])(t);try{for(o.s();!(a=o.n()).done;){var n=a.value;if(n.children){var l=this.formatParentId(e,n.children,[].concat(Object(p["a"])(r),[n.value]));if(l.includes(e))return l}if(n.value===e)return[].concat(Object(p["a"])(r),[e])}}catch(s){o.e(s)}finally{o.f()}return r},getBrandCatatory:function(){var e=this.form.goodsList,t=[];e.forEach((function(e){var a=t.findIndex((function(t){return t.value==e.brandId}));-1===a&&t.push({label:e.brandName,value:e.brandId})})),this.goodsCategoryList=t},onShopSubmit:function(e){var t=this;this.form.goodsList.length<=0?this.$message.error("请至少添加一个子商品"):this.$refs[e].validate((function(e){if(!e)return t.$nextTick((function(){var e=document.getElementsByClassName("is-error");e[0].scrollIntoView({block:"center",behavior:"smooth"})})),!1;var a=Object.assign({},t.form),r=[];a.goodsList.forEach((function(e){e.skuStockId&&r.push({mallGoodsId:e.goodsId,sku:e.skuStockId,goodsStatus:e.publishStatus,goodsPrice:e.goodsPrice})})),a.goodsSubList=r,a.studentShowOrganId&&(a.studentShowOrganId=a.studentShowOrganId.join(",")),a.educationShowOrganId&&(a.educationShowOrganId=a.educationShowOrganId.join(",")),a.courseFeeShowOrganId&&(a.courseFeeShowOrganId=a.courseFeeShowOrganId.join(",")),a.memberFeeShowOrganId&&(a.memberFeeShowOrganId=a.memberFeeShowOrganId.join(",")),a.freeFeeShowOrganId&&(a.freeFeeShowOrganId=a.freeFeeShowOrganId.join(",")),a.replacementShowOrganId&&(a.replacementShowOrganId=a.replacementShowOrganId.join(",")),a.studentShowOrganId||a.educationShowOrganId||a.courseFeeShowOrganId||a.freeFeeShowOrganId||a.replacementShowOrganId?(a.goodsList=null,a.groupGoods=1,console.log(a,"1221"),"create"==t.addType||"copy"==t.addType?(t.form.id&&delete t.form.id,a.status="NO",Object(f["n"])(g()(a)).then((function(e){t.messageTips("保存",e)}))):"update"==t.addType&&Object(f["s"])(g()(a)).then((function(e){t.messageTips("保存",e)}))):t.$message.error("请至少选择一个可见分部")}))},messageTips:function(e,t){200==t.code?(this.$message.success(e+"成功"),this.$listeners.close(),this.$listeners.confirm()):this.$message.error(t.msg)},removeGoodsList:function(e){var t=this;this.$confirm("是否删除该商品?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){var a=t.form.goodsList.indexOf(e);-1!==a&&t.form.goodsList.splice(a,1),t.getBrandCatatory(),t.form.brand=null})).catch((function(){}))},addGoodsList:function(){var e=[];this.form.goodsList.forEach((function(t){e.push(t.skuStockId)})),this.disabledIds=e,this.recordStatus=!0},onFormClose:function(e){this.$refs[e].resetFields()},cropSuccess:function(e){this.form.image=e.data.url},onConfirm:function(e){var t,a=this;console.log(e);var r=[];(e||[]).forEach((function(e){var t=a.form.goodsList.findIndex((function(t){return t.skuStockId==e.skuStockId}));-1==t&&r.push({name:e.name,goodsId:e.goodsId,brandId:e.brandId,brandName:e.brandName,skuStockId:e.skuStockId,skuCode:e.skuCode,price:e.price,publishStatus:e.publishStatus,productSn:e.productSn,goodsPrice:null})})),(t=this.form.goodsList).push.apply(t,r),this.getBrandCatatory()}}},x=L,F=(a("47c6"),Object(w["a"])(x,u,d,!1,null,"71c3855f",null)),C=F.exports,T=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("el-button",{staticStyle:{"margin-bottom":"20px"},attrs:{type:"primary"},on:{click:e.addGoodsList}},[e._v("添加")]),e._v(" "),a("el-form",{ref:"ruleForm",attrs:{model:e.form,rules:e.rules,inline:!0}},[a("el-alert",{staticClass:"alert",attrs:{title:"销售渠道",closable:!1,type:"info"}}),e._v(" "),a("el-form-item",{attrs:{label:"移动端可售分部",prop:"educationShowOrganId","label-width":e.formLabelWidth}},[a("select-all",{staticStyle:{width:"400px !important"},attrs:{filterable:"",placeholder:"移动端可售分部",multiple:"",clearable:"",disabled:e.addDisabled},model:{value:e.form.educationShowOrganId,callback:function(t){e.$set(e.form,"educationShowOrganId","string"===typeof t?t.trim():t)},expression:"form.educationShowOrganId"}},e._l(e.selects.branchs,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id.toString()}})})),1)],1),e._v(" "),a("el-form-item",{attrs:{label:"课程收费乐团可售分部",prop:"courseFeeShowOrganId","label-width":e.formLabelWidth}},[a("select-all",{staticStyle:{width:"400px !important"},attrs:{filterable:"",placeholder:"课程收费乐团可售分部",multiple:"",clearable:"",disabled:e.addDisabled},model:{value:e.form.courseFeeShowOrganId,callback:function(t){e.$set(e.form,"courseFeeShowOrganId","string"===typeof t?t.trim():t)},expression:"form.courseFeeShowOrganId"}},e._l(e.selects.branchs,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id.toString()}})})),1)],1),e._v(" "),a("el-form-item",{attrs:{label:"会员收费乐团可售分部",prop:"memberFeeShowOrganId","label-width":e.formLabelWidth}},[a("select-all",{staticStyle:{width:"400px !important"},attrs:{filterable:"",placeholder:"请选择会员收费团可见分部",multiple:"",clearable:"",disabled:e.addDisabled},model:{value:e.form.memberFeeShowOrganId,callback:function(t){e.$set(e.form,"memberFeeShowOrganId","string"===typeof t?t.trim():t)},expression:"form.memberFeeShowOrganId"}},e._l(e.selects.branchs,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id.toString()}})})),1)],1),e._v(" "),a("el-form-item",{attrs:{label:"免费乐团可售分部",prop:"freeFeeShowOrganId","label-width":e.formLabelWidth}},[a("select-all",{staticStyle:{width:"400px !important"},attrs:{filterable:"",placeholder:"请选择会员收费团可见分部",multiple:"",clearable:"",disabled:e.addDisabled},model:{value:e.form.freeFeeShowOrganId,callback:function(t){e.$set(e.form,"freeFeeShowOrganId","string"===typeof t?t.trim():t)},expression:"form.freeFeeShowOrganId"}},e._l(e.selects.branchs,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id.toString()}})})),1)],1),e._v(" "),1==e.tenantId?a("el-form-item",{attrs:{label:"乐器置换可售分部",prop:"replacementShowOrganId","label-width":e.formLabelWidth}},[a("select-all",{staticStyle:{width:"400px !important"},attrs:{filterable:"",placeholder:"请选择乐器置换可售分部",multiple:"",clearable:"",disabled:e.addDisabled},model:{value:e.form.replacementShowOrganId,callback:function(t){e.$set(e.form,"replacementShowOrganId","string"===typeof t?t.trim():t)},expression:"form.replacementShowOrganId"}},e._l(e.selects.branchs,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id.toString()}})})),1)],1):e._e(),e._v(" "),a("el-table",{staticStyle:{width:"100%!important"},attrs:{data:e.form.goodsList,"header-cell-style":{background:"#EDEEF0",color:"#444"}}},[a("el-table-column",{attrs:{align:"center",prop:"name",label:"商品名称"},scopedSlots:e._u([{key:"default",fn:function(e){return[a("tooltip",{attrs:{content:e.row.name}})]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"sn",label:"商品货号"}}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"brandName",label:"品牌"}}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"skuCode",label:"sku编号"}}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"marketPrice",label:"市场价",width:"160"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-form-item",{staticClass:"tableItem",attrs:{"show-message":!1,prop:"goodsList."+t.$index+".marketPrice",rules:[{required:!0,validator:e.validPrice,trigger:"blur"}]}},[a("el-input-number",{staticClass:"number-input",staticStyle:{width:"100%!important"},attrs:{controls:!1,precision:2,min:0,placeholder:"请选择市场价",disabled:e.addDisabled},model:{value:e.form.goodsList[t.$index].marketPrice,callback:function(a){e.$set(e.form.goodsList[t.$index],"marketPrice",a)},expression:"form.goodsList[scope.$index].marketPrice"}})],1)]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"discountPrice",label:"零售价",width:"160"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-form-item",{staticClass:"tableItem",attrs:{"show-message":!1,prop:"goodsList."+t.$index+".discountPrice",rules:[{required:!0,validator:e.validPrice,trigger:"blur"}]}},[a("el-input-number",{staticClass:"number-input",staticStyle:{width:"100%!important"},attrs:{controls:!1,precision:2,min:0,placeholder:"请选择零售价",disabled:e.addDisabled},model:{value:e.form.goodsList[t.$index].discountPrice,callback:function(a){e.$set(e.form.goodsList[t.$index],"discountPrice",a)},expression:"form.goodsList[scope.$index].discountPrice"}})],1)]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"groupPurchasePrice",label:"团购价",width:"160"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-form-item",{staticClass:"tableItem",attrs:{"show-message":!1,prop:"goodsList."+t.$index+".groupPurchasePrice",rules:[{required:!0,validator:e.validPrice,trigger:"blur"}]}},[a("el-input-number",{staticClass:"number-input",staticStyle:{width:"100%!important"},attrs:{controls:!1,precision:2,min:0,placeholder:"请选择团购价",disabled:e.addDisabled},model:{value:e.form.goodsList[t.$index].groupPurchasePrice,callback:function(a){e.$set(e.form.goodsList[t.$index],"groupPurchasePrice",a)},expression:"form.goodsList[scope.$index].groupPurchasePrice"}})],1)]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"goodsPrice",label:"成本",width:"160"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-form-item",{staticClass:"tableItem",attrs:{"show-message":!1,prop:"goodsList."+t.$index+".goodsPrice",rules:[{required:!0,validator:e.validPrice,trigger:"blur"}]}},[a("el-input-number",{staticClass:"number-input",staticStyle:{width:"100%!important"},attrs:{controls:!1,precision:2,min:0,placeholder:"请选择成本",disabled:e.addDisabled},model:{value:e.form.goodsList[t.$index].goodsPrice,callback:function(a){e.$set(e.form.goodsList[t.$index],"goodsPrice",a)},expression:"form.goodsList[scope.$index].goodsPrice"}})],1)]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"type",label:"商品类型",width:"160"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-form-item",{staticClass:"tableItem",attrs:{"show-message":!1,prop:"goodsList."+t.$index+".type",rules:[{required:!0,message:"请选择商品类型",trigger:"change"}]}},[a("el-select",{staticStyle:{width:"100%!important"},attrs:{clearable:"",placeholder:"商品类型"},model:{value:e.form.goodsList[t.$index].type,callback:function(a){e.$set(e.form.goodsList[t.$index],"type","string"===typeof a?a.trim():a)},expression:"form.goodsList[scope.$index].type"}},e._l(e.goodsType,(function(e,t){return a("el-option",{key:t,attrs:{label:e.label,value:e.value}})})),1)],1)]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"goodsCategoryId",label:"商品分类",width:"160"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-form-item",{staticClass:"tableItem",attrs:{"show-message":!1,prop:"goodsList."+t.$index+".goodsCategoryId",rules:[{required:!0,message:"请选择商品分类",trigger:"change"}]}},[a("el-select",{staticStyle:{width:"100%!important"},attrs:{clearable:"",placeholder:"商品分类"},model:{value:e.form.goodsList[t.$index].goodsCategoryId,callback:function(a){e.$set(e.form.goodsList[t.$index],"goodsCategoryId","string"===typeof a?a.trim():a)},expression:"form.goodsList[scope.$index].goodsCategoryId"}},e._l(e.categoryList,(function(e,t){return a("el-option",{key:t,attrs:{label:e.label,value:e.value}})})),1)],1)]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"publishStatus",label:"状态"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-tag",{attrs:{type:1==t.row.publishStatus?"":"danger"}},[e._v("\n "+e._s(t.row.publishStatus?"上架":"下架")+"\n ")])]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"sn",label:"操作",fixed:"right"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{type:"text",disabled:e.addDisabled},on:{click:function(a){return a.preventDefault(),e.removeGoodsList(t.row)}}},[e._v("删除")])]}}])})],1)],1),e._v(" "),e.addDisabled?e._e():a("span",{staticClass:"dialog-footer",staticStyle:{"padding-top":"12px"},attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){return e.$listeners.close()}}},[e._v("取 消")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.onShopSubmit("ruleForm")}}},[e._v("确 定")])],1),e._v(" "),e.recordStatus?a("el-dialog",{attrs:{title:"添加子商品",visible:e.recordStatus,"close-on-click-modal":!1,width:"1200px","append-to-body":""},on:{"update:visible":function(t){e.recordStatus=t}}},[a("subShopGoods",{attrs:{disabledIds:e.disabledIds,goodsBrand:e.goodsBrand},on:{close:function(t){e.recordStatus=!1},comfirm:e.onConfirm}})],1):e._e()],1)},E=[],P=function(e,t,a){""==t&&"string"==typeof t||null==t?a(new Error("请输入金额")):t<0?a(new Error("输入金额必须大于或等于0")):t>=1e5?a(new Error("输入金额必须小于100000")):a()},$={props:["activeRow","addType","addDisabled","categoryList","selectGoodsList","tenantId","goodsBrand","goodsType"],components:{subShopGoods:_},data:function(){return{formLabelWidth:"160px",form:{goodsList:[],studentShowOrganId:null,educationShowOrganId:null,courseFeeShowOrganId:null,memberFeeShowOrganId:null,freeFeeShowOrganId:null,replacementShowOrganId:null},goodsTree:[],rules:{},goodsDetail:{},recordStatus:!1,disabledIds:[]}},mounted:function(){var e=Object(l["a"])(Object(n["a"])().mark((function e(){var t,a,r,o,l,s;return Object(n["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if("create"===this.addType){e.next=25;break}return e.prev=1,e.next=4,Object(f["a"])({id:this.activeRow.id});case 4:for(l in t=e.sent,a=t.data,this.goodsDetail=a||{},r=this.goodsDetail,o=this.form,o)o[l]="brand"===l?Number(r[l]):r[l];s=r.goodsSubList&&r.goodsSubList.length>0?r.goodsSubList[0]:{},o.goodsList=[{name:r.name,sn:r.sn,brandId:r.brand,brandName:r.brandName,type:r.type,goodsCategoryId:r.goodsCategoryId,specification:r.specification,marketPrice:r.marketPrice,discountPrice:r.discountPrice,groupPurchasePrice:r.groupPurchasePrice,groupGoods:r.groupGoods?1:0,pic:r.image,skuStockId:s.sku,skuCode:s.skuCode,goodsPrice:s.goodsPrice,goodsId:s.mallGoodsId,publishStatus:s.goodsStatus}],console.log(o),o.id=r.id,r.studentShowOrganId&&(o.studentShowOrganId=r.studentShowOrganId.split(",")),r.educationShowOrganId&&(o.educationShowOrganId=r.educationShowOrganId.split(",")),r.courseFeeShowOrganId&&(o.courseFeeShowOrganId=r.courseFeeShowOrganId.split(",")),r.memberFeeShowOrganId&&(o.memberFeeShowOrganId=r.memberFeeShowOrganId.split(",")),r.freeFeeShowOrganId&&(o.freeFeeShowOrganId=r.freeFeeShowOrganId.split(",")),r.replacementShowOrganId&&(o.replacementShowOrganId=r.replacementShowOrganId.split(",")),r.organIdList&&(o.organIdList=r.organIdList.split(",")),e.next=25;break;case 23:e.prev=23,e.t0=e["catch"](1);case 25:case"end":return e.stop()}}),e,this,[[1,23]])})));function t(){return e.apply(this,arguments)}return t}(),methods:{validPrice:P,__init:function(){var e=Object(l["a"])(Object(n["a"])().mark((function e(){var t,a,r,o,l;return Object(n["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t={delFlag:0,rows:9999},e.prev=1,e.next=4,api_queryGoodsCategoryList(t);case 4:a=e.sent,r=a.data,o=r||[],l=[],o.forEach((function(e){var t=[];e.children&&e.children.length>0&&e.children.forEach((function(e){t.push({label:e.name,value:e.id})})),l.push({label:e.name,value:e.id,children:t})})),this.categoryList=l,e.next=14;break;case 12:e.prev=12,e.t0=e["catch"](1);case 14:case"end":return e.stop()}}),e,this,[[1,12]])})));function t(){return e.apply(this,arguments)}return t}(),formatParentId:function(e,t){var a,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=Object(m["a"])(t);try{for(o.s();!(a=o.n()).done;){var n=a.value;if(n.children){var l=this.formatParentId(e,n.children,[].concat(Object(p["a"])(r),[n.value]));if(l.includes(e))return l}if(n.value===e)return[].concat(Object(p["a"])(r),[e])}}catch(s){o.e(s)}finally{o.f()}return r},onShopSubmit:function(e){var t=this,a=Object.assign({},this.form);a.studentShowOrganId&&(a.studentShowOrganId=a.studentShowOrganId.join(",")),a.educationShowOrganId&&(a.educationShowOrganId=a.educationShowOrganId.join(",")),a.courseFeeShowOrganId&&(a.courseFeeShowOrganId=a.courseFeeShowOrganId.join(",")),a.memberFeeShowOrganId&&(a.memberFeeShowOrganId=a.memberFeeShowOrganId.join(",")),a.freeFeeShowOrganId&&(a.freeFeeShowOrganId=a.freeFeeShowOrganId.join(",")),a.replacementShowOrganId&&(a.replacementShowOrganId=a.replacementShowOrganId.join(",")),a.studentShowOrganId||a.educationShowOrganId||a.courseFeeShowOrganId||a.freeFeeShowOrganId||a.memberFeeShowOrganId||a.replacementShowOrganId?this.form.goodsList.length<=0?this.$message.error("请至少添加一个商品"):this.$refs[e].validate((function(e){if(!e)return t.$nextTick((function(){var e=document.getElementsByClassName("is-error");e[0].scrollIntoView({block:"center",behavior:"smooth"})})),!1;var r=[];if(a.goodsList.forEach((function(e){e.skuStockId&&r.push({name:e.name,sn:e.sn,brand:e.brandId,type:e.type,goodsCategoryId:e.goodsCategoryId,specification:e.specification,marketPrice:e.marketPrice,discountPrice:e.discountPrice,groupPurchasePrice:e.groupPurchasePrice,groupGoods:0,studentShowOrganId:a.studentShowOrganId,educationShowOrganId:a.educationShowOrganId,memberFeeShowOrganId:a.memberFeeShowOrganId,courseFeeShowOrganId:a.courseFeeShowOrganId,freeFeeShowOrganId:a.freeFeeShowOrganId,replacementShowOrganId:a.replacementShowOrganId,image:e.pic,goodsSubList:[{mallGoodsId:e.goodsId,sku:e.skuStockId,goodsStatus:e.publishStatus,goodsPrice:e.goodsPrice}]})})),console.log(r,"temps"),"create"==t.addType||"copy"==t.addType)t.form.id&&delete t.form.id,r.forEach((function(e){e.status="NO"})),Object(f["o"])(g()(r)).then((function(e){t.messageTips("保存",e)}));else if("update"==t.addType){var o=r[0];o.id=t.form.id,Object(f["s"])(g()(o)).then((function(e){t.messageTips("保存",e)}))}})):this.$message.error("请至少选择一个可见分部")},messageTips:function(e,t){200==t.code?(this.$message.success(e+"成功"),this.$listeners.close(),this.$listeners.confirm()):this.$message.error(t.msg)},removeGoodsList:function(e){var t=this;this.$confirm("是否删除该商品?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){var a=t.form.goodsList.indexOf(e);-1!==a&&t.form.goodsList.splice(a,1)})).catch((function(){}))},addGoodsList:function(){var e=[];this.form.goodsList.forEach((function(t){e.push(t.skuStockId)})),this.disabledIds=e,this.recordStatus=!0},onFormClose:function(e){this.$refs[e].resetFields()},onConfirm:function(e){var t,a=this;console.log(e);var r=[];(e||[]).forEach((function(e){var t=a.form.goodsList.findIndex((function(t){return t.skuStockId==e.skuStockId}));if(-1==t){var o=e.spData?JSON.parse(e.spData):[{key:"默认"}],n="";o.forEach((function(e){n+=e.key+(e.value?":"+e.value:"")})),r.push({name:e.name,goodsId:e.goodsId,brandId:e.brandId,brandName:e.brandName,skuStockId:e.skuStockId,skuCode:e.skuCode,pic:e.pic,specification:n,detailHtml:e.detailHtml,price:e.price,publishStatus:e.publishStatus,sn:e.productSn,marketPrice:null,discountPrice:null,groupPurchasePrice:null,goodsPrice:null})}})),(t=this.form.goodsList).push.apply(t,r)}}},j=$,N=(a("aa96"),Object(w["a"])(j,T,E,!1,null,"4135000c",null)),G=N.exports,R=a("829b"),A="/api-web";function D(e){return Object(R["a"])({url:A+"/goods/copyGoods",method:"post",requestType:"form",data:e})}var B=a("92e3"),M=a("4328"),q=a.n(M),U=a("a5b0"),W=a("adb21"),H=a("5f87"),V=a("3908"),z=a("ec8a"),Y={components:{pagination:i["a"],Tooltip:U["a"],Upload:c["a"],combinationProducts:C,singleProducts:G},name:"shopList",data:function(){var e;return{goodsType:B["C"]||[],categoryList:[],goodsBrand:[],goodsLoading:!1,organId:null,orderDate:null,searchForm:(e={search:null,groupGoods:null,organId:null,type:null,status:null,goodsCategoryId:null,startTime:null,endTime:null},Object(s["a"])(e,"status",null),Object(s["a"])(e,"clientShow",null),Object(s["a"])(e,"educationalShow",null),Object(s["a"])(e,"musicGroupShow",null),Object(s["a"])(e,"courseViewType",null),Object(s["a"])(e,"replacementShow",null),Object(s["a"])(e,"courseFeeShowOrganId",null),Object(s["a"])(e,"educationShowOrganId",null),Object(s["a"])(e,"memberFeeShowOrganId",null),Object(s["a"])(e,"freeFeeShowOrganId",null),Object(s["a"])(e,"replacementShowOrganId",null),Object(s["a"])(e,"studentShowOrganId",null),Object(s["a"])(e,"brandId",null),e),headers:{Authorization:Object(H["b"])(),tenantId:Object(H["a"])()},searchLsit:[],tableList:[],pageInfo:{limit:10,page:1,total:0,page_size:[10,20,40,50]},singleShopStatus:!1,routeShopStatus:!1,addType:"create",addString:{create:"添加",update:"修改",look:"查看",copy:"复制"},addDisabled:!1,activeRow:{},selectGoodsList:[],tenantId:""}},mounted:function(){var e=Object(l["a"])(Object(n["a"])().mark((function e(){return Object(n["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this.tenantId=this.$helpers.tenantId,e.next=3,this.$store.dispatch("setBranchs");case 3:this.init();case 4:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}(),methods:{permission:function(e){return Object(z["a"])(e)},init:function(){this.getList(),this.getCategory(),this.getGoodsBrand()},getCategory:function(){var e=Object(l["a"])(Object(n["a"])().mark((function e(){var t,a=this;return Object(n["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:t={delFlag:0,rows:9999};try{Object(f["f"])(t).then((function(e){var t=e.data;if(200==e.code){var r=[];t.rows.forEach((function(e){r.push({label:e.name,value:e.id})})),a.categoryList=r}}))}catch(r){}case 2:case"end":return e.stop()}}),e)})));function t(){return e.apply(this,arguments)}return t}(),getGoodsType:function(){var e=Object(l["a"])(Object(n["a"])().mark((function e(){var t,a,r,o;return Object(n["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Object(f["e"])({rows:999});case 3:t=e.sent,a=t.data,console.log(a,"getGoodsType"),r=a||[],o=[],r.forEach((function(e){o.push({label:e.name,value:e.id})})),this.goodsType=o,e.next=14;break;case 12:e.prev=12,e.t0=e["catch"](0);case 14:case"end":return e.stop()}}),e,this,[[0,12]])})));function t(){return e.apply(this,arguments)}return t}(),getGoodsBrand:function(){var e=Object(l["a"])(Object(n["a"])().mark((function e(){var t,a,r,o;return Object(n["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Object(f["b"])({rows:999});case 3:t=e.sent,a=t.data,console.log(a,"getGoodsBrand"),r=a||[],o=[],r.forEach((function(e){o.push({label:e.name,value:e.id})})),this.goodsBrand=o,e.next=14;break;case 12:e.prev=12,e.t0=e["catch"](0);case 14:case"end":return e.stop()}}),e,this,[[0,12]])})));function t(){return e.apply(this,arguments)}return t}(),onUpdate:function(){var e=Object(l["a"])(Object(n["a"])().mark((function e(t,a){var r,o=this;return Object(n["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:r=1==a?"你是否下架该商品?":"你是否上架该商品?",this.$confirm(r,"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(Object(l["a"])(Object(n["a"])().mark((function e(){return Object(n["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(f["u"])({goodsId:t.id,status:t.status?0:1}).then((function(e){o.messageTips(t.status?"下架":"上架",e)}));case 2:case"end":return e.stop()}}),e)})))).catch((function(){}));case 2:case"end":return e.stop()}}),e,this)})));function t(t,a){return e.apply(this,arguments)}return t}(),onPurchaseList:function(e){this.$router.push({path:"/shopManager/purchaseLlist",query:{name:e.name,goodsId:e.id}})},onDelete:function(e){var t=this;this.$confirm("您确定删除该商品吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){Object(f["p"])(e.id).then((function(e){t.messageTips("删除",e)}))})).catch((function(){}))},searchOrderDate:function(e){e?(this.searchForm.startTime=e[0],this.searchForm.endTime=e[1]):(this.searchForm.startTime=null,this.searchForm.endTime=null)},messageTips:function(e,t){200==t.code?(this.$message.success(e+"成功"),this.typeStatus=!1,this.getList()):this.$message.error(t.msg)},getList:function(){var e=this,t=Object.assign({},this.searchForm);t.organId=this.organId,t.rows=this.pageInfo.limit,t.page=this.pageInfo.page,Object(f["q"])(t).then((function(t){200==t.code&&t.data&&(e.tableList=t.data.rows,e.pageInfo.total=t.data.total)}))},getAllGoodsList:function(e){var t=this;Object(f["q"])({rows:9999,page:1,groupGoods:0,organId:e,status:1}).then((function(e){200==e.code&&e.data&&(t.selectGoodsList=e.data.rows)}))},onSearch:function(){this.pageInfo.page=1,this.getList()},onReset:function(){this.$refs.searchForm.resetFields(),this.getList()},onShopComAdd:function(){this.addType="create",this.addDisabled=!1,this.routeShopStatus=!0},beforeUpload:function(e){V["a"].startLoading()},handleSuccess:function(e,t,a){if(V["a"].endLoading(),200==e.code)this.$message.success(e.msg||"导入成功");else if(0==e.code){var r=this.fomatStr(e.msg);this.$alert(r,"导入结果",{confirmButtonText:"确定",dangerouslyUseHTMLString:!0,callback:function(e){}})}else this.$message.error("导入失败"),window.location.href=e.msg},handleError:function(e,t,a){V["a"].endLoading()},onShopOperation:function(){var e=Object(l["a"])(Object(n["a"])().mark((function e(t,a){var r=this;return Object(n["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if("copy"!==t){e.next=3;break}return this.$confirm("是否复制该商品?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(Object(l["a"])(Object(n["a"])().mark((function e(){return Object(n["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,D({goodsId:a.id});case 3:r.$message.success("复制成功"),r.getList(),e.next=10;break;case 7:e.prev=7,e.t0=e["catch"](0),console.log(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))),e.abrupt("return");case 3:if(this.addType=t,this.addDisabled="look"==t,"update"!=t&&"look"!=t&&"copy"!=t){e.next=9;break}return this.activeRow=a,a.groupGoods?this.routeShopStatus=!0:this.singleShopStatus=!0,e.abrupt("return");case 9:this.singleShopStatus=!0;case 10:case"end":return e.stop()}}),e,this)})));function t(t,a){return e.apply(this,arguments)}return t}(),onDownload:function(){window.location.href="https://oss.dayaedu.com/template/%E7%BB%84%E5%90%88%E5%95%86%E5%93%81%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx"},exportShopList:function(){Object(W["a"])(this,{url:"/api-web/export/goods",params:q.a.stringify(g()(this.searchForm)),fileName:"组合商品导入.xls",method:"post"},"确定导入组合商品")},onFormClose:function(e){}},filters:{courseViewTypeFormat:function(e){var t=["课程收费","AMR收费","会员收费"];if(!e)return"";var a=e.split(","),r=[];return a.forEach((function(e){r.push(t[e])})),r.join(",")}}},X=Y,J=(a("d7a7"),Object(w["a"])(X,r,o,!1,null,"fe09eb02",null));t["default"]=J.exports},"7a0e":function(e,t,a){},8300:function(e,t,a){},"92e3":function(e,t,a){"use strict";a.d(t,"v",(function(){return i})),a.d(t,"I",(function(){return c})),a.d(t,"t",(function(){return u})),a.d(t,"c",(function(){return d})),a.d(t,"E",(function(){return p})),a.d(t,"bb",(function(){return m})),a.d(t,"Z",(function(){return f})),a.d(t,"d",(function(){return b})),a.d(t,"M",(function(){return g})),a.d(t,"x",(function(){return h})),a.d(t,"db",(function(){return v})),a.d(t,"u",(function(){return S})),a.d(t,"o",(function(){return I})),a.d(t,"cb",(function(){return y})),a.d(t,"Q",(function(){return w})),a.d(t,"fb",(function(){return O})),a.d(t,"gb",(function(){return _})),a.d(t,"P",(function(){return k})),a.d(t,"U",(function(){return L})),a.d(t,"C",(function(){return x})),a.d(t,"l",(function(){return F})),a.d(t,"Y",(function(){return C})),a.d(t,"eb",(function(){return T})),a.d(t,"J",(function(){return E})),a.d(t,"m",(function(){return P})),a.d(t,"w",(function(){return $})),a.d(t,"N",(function(){return j})),a.d(t,"f",(function(){return N})),a.d(t,"e",(function(){return G})),a.d(t,"L",(function(){return R})),a.d(t,"K",(function(){return A})),a.d(t,"T",(function(){return D})),a.d(t,"H",(function(){return B})),a.d(t,"a",(function(){return M})),a.d(t,"y",(function(){return q})),a.d(t,"p",(function(){return U})),a.d(t,"n",(function(){return W})),a.d(t,"q",(function(){return H})),a.d(t,"g",(function(){return V})),a.d(t,"G",(function(){return z})),a.d(t,"r",(function(){return Y})),a.d(t,"D",(function(){return X})),a.d(t,"B",(function(){return J})),a.d(t,"A",(function(){return K})),a.d(t,"h",(function(){return Q})),a.d(t,"k",(function(){return Z})),a.d(t,"i",(function(){return ee})),a.d(t,"j",(function(){return te})),a.d(t,"S",(function(){return ae})),a.d(t,"O",(function(){return re})),a.d(t,"F",(function(){return oe})),a.d(t,"z",(function(){return ne})),a.d(t,"R",(function(){return le})),a.d(t,"V",(function(){return se})),a.d(t,"X",(function(){return ie})),a.d(t,"s",(function(){return ce})),a.d(t,"ab",(function(){return ue})),a.d(t,"W",(function(){return de})),a.d(t,"b",(function(){return me}));var r=a("b85c"),o=a("3835"),n=a("267e"),l=sessionStorage.getItem("tenantConfig");l=l?JSON.parse(l):{};var s=l.tenantId,i=null,c=null;1==s?(c=[{label:"声部课",value:"SINGLE"},{label:"合奏课",value:"MIX"},{label:"基础技能课",value:"HIGH"},{label:"线上基础技能课",value:"HIGH_ONLINE"},{label:"乐团网管课",value:"MUSIC_NETWORK"},{label:"集训声部课",value:"TRAINING_SINGLE"},{label:"集训合奏课",value:"TRAINING_MIX"},{label:"课堂课",value:"CLASSROOM"},{label:"综合课",value:"COMPREHENSIVE"}],i=[{label:"声部课",value:"SINGLE"},{label:"合奏课",value:"MIX"},{label:"基础技能课",value:"HIGH"},{label:"线上基础技能课",value:"HIGH_ONLINE"},{label:"vip课",value:"VIP"},{label:"试听课",value:"DEMO"},{label:"综合课",value:"COMPREHENSIVE"},{label:"网管课",value:"PRACTICE"},{label:"乐团网管课",value:"MUSIC_NETWORK"},{label:"启蒙课",value:"ENLIGHTENMENT"},{label:"集训声部课",value:"TRAINING_SINGLE"},{label:"集训合奏课",value:"TRAINING_MIX"},{label:"课堂课",value:"CLASSROOM"},{label:"对外课",value:"COMM"},{label:"直播课",value:"LIVE"}]):(c=[{label:"声部课",value:"SINGLE"},{label:"合奏课",value:"MIX"},{label:"基础技能课",value:"HIGH"},{label:"集训声部课",value:"TRAINING_SINGLE"},{label:"集训合奏课",value:"TRAINING_MIX"},{label:"课堂课",value:"CLASSROOM"},{label:"综合课",value:"COMPREHENSIVE"}],i=[{label:"声部课",value:"SINGLE"},{label:"合奏课",value:"MIX"},{label:"vip课",value:"VIP"},{label:"试听课",value:"DEMO"},{label:"综合课",value:"COMPREHENSIVE"},{label:"网管课",value:"PRACTICE"},{label:"启蒙课",value:"ENLIGHTENMENT"},{label:"集训声部课",value:"TRAINING_SINGLE"},{label:"集训合奏课",value:"TRAINING_MIX"},{label:"课堂课",value:"CLASSROOM"},{label:"对外课",value:"COMM"},{label:"直播课",value:"LIVE"}]);var u=[{label:"乐团课",value:"MUSIC"},{label:"VIP课",value:"VIP"},{label:"网管课",value:"PRACTICE"},{label:"直播课",value:"LIVE"}],d=[{label:"正常签到",value:1},{label:"异常签到",value:0}],p=[{label:"兼职",value:"PART_TIME"},{label:"全职",value:"FULL_TIME"},{label:"劳务",value:"LABOUR"}],m=[{label:"正常",value:"0"},{label:"冻结",value:"1"},{label:"锁定",value:"9"}],f=[{value:"NORMAL",label:"正常"},{value:"TRUANT",label:"旷课"},{value:"LEAVE",label:"请假"}],b=[].concat(f,[{value:"QUIT_SCHOOL",label:"休学"},{value:"DROP_OUT",label:"退学"},{value:"LATE",label:"迟到"}]),g=[{value:"APPLY",label:"报名"},{value:"RENEW",label:"续费"},{value:"MEMBER",label:"学练宝购买"},{value:"SMALL_CLASS_TO_BUY",label:"VIP购买"},{value:"SPORADIC",label:"零星收费"},{value:"LUCK",label:"福袋活动"},{value:"DEGREE_REGISTRATION",label:"考级报名"},{value:"DOUBLE_ELEVEN2020",label:"2020双十一活动"},{value:"DOUBLE_ELEVEN2021",label:"2021双十一活动"},{value:"DEGREE",label:"儿童节活动"},{value:"PRACTICE_GROUP_BUY",label:"网管课"},{value:"PRACTICE_GROUP_RENEW",label:"网管课续费"},{value:"REPAIR",label:"乐器维修"},{value:"OUTORDER",label:"外部收入"},{value:"GOODS_SELL",label:"商品销售"},{value:"MALL_BUY",label:"商城销售"},{value:"SUBJECT_CHANGE",label:"声部更换"},{value:"MAINTENANCE",label:"乐器保养"},{value:"ADD_STUDENT",label:"乐团报名"},{value:"REPLACEMENT",label:"乐器置换"},{value:"SCHOOL",label:"学校订单"},{value:"PERSONAL",label:"个人订单"},{value:"OTHER",label:"其他"},{value:"ACTIVITY",label:"活动购买"},{value:"LIVE_BUY",label:"直播购物"},{value:"LIVE_GROUP_BUY",label:"直播课购买"},{value:"SCHOOL_GOODS_PURCHASE",label:"商品采购"},{value:"DIRECTOR_TRAINING_CAMP",label:"乐队指导培训"}],h=[{value:"ING",label:"交易中"},{value:"SUCCESS",label:"成功交易"},{value:"FAILED",label:"交易失败"},{value:"CLOSE",label:"交易关闭"}],v=[{value:"0",text:"未开始"},{value:"1",text:"报名中"},{value:"2",text:"进行中"},{value:"4",text:"已结束"},{value:"3",text:"取消"}],S=[{value:"NOT_START",label:"未开始"},{value:"UNDERWAY",label:"进行中"},{value:"OVER",label:"已结束"}],I=[{value:"NORMAL",label:"进行中"},{value:"FINISH",label:"结束"},{value:"CANCEL",label:"关闭"},{value:"LOCK",label:"锁定"}],y=[{value:"RECHARGE",label:"充值"},{value:"CONSUME",label:"建课"},{value:"RETURN",label:"退课"},{value:"MANUAL_ADD",label:"系统充值"},{value:"MANUAL_SUB",label:"系统扣除"}],w=[{value:"FREE",label:"免费"},{value:"CHARGE",label:"收费"},{value:"TRIAL",label:"试听课"},{value:"CARE_PACKAGE",label:"关心包"},{value:"COME_ON_PACKAGE",label:"加油包"}],O=[{value:"课程推荐",label:"课程推荐",children:[{value:"新课推荐",label:"新课推荐"},{value:"续费提醒",label:"续费提醒"}]},{value:"常规回访",label:"常规回访",children:[{value:"课后及练习回访",label:"课后及练习回访"},{value:"练习及乐团表现",label:"练习及乐团表现"}]},{value:"其它",label:"其它",children:[{value:"其它",label:"其它"}]}],_=[{value:"课程推荐",label:"课程推荐",children:[{value:"新课推荐",label:"新课推荐"},{value:"续费提醒",label:"续费提醒"}]},{value:"常规回访",label:"常规回访",children:[{value:"课后及练习回访",label:"课后及练习回访"},{value:"练习及乐团表现",label:"练习及乐团表现"},{label:"考勤申诉",value:"考勤申诉"},{value:"异常请假回访",label:"异常请假回访"}]},{value:"小课回访",label:"小课回访",children:[{value:"续费类回访",label:"续费类回访"},{value:"服务回访",label:"服务回访"},{value:"其他",label:"其他"}]},{value:"学练宝",label:"学练宝",children:[{value:"体验回访",label:"体验回访"}]},{value:"其它",label:"其它",children:[{value:"其它",label:"其它"},{value:"会员续费",label:"会员续费"}]}],k=[{value:"YQPAY",label:"双乾"},{value:"BALANCE",label:"余额"},{value:"ADAPAY",label:"汇付"},{value:"YEEPAY",label:"易宝"}],L=[{value:"INSTRUMENT",label:"乐器销售"},{value:"ACCESSORIES",label:"配件销售"},{value:"SCHOOL_BUY",label:"学校采购"},{value:"OTHER",label:"其它"}],x=[{value:"INSTRUMENT",label:"乐器"},{value:"ACCESSORIES",label:"辅件"},{value:"TEACHING",label:"教材"},{value:"STAFF",label:"教谱"},{value:"OTHER",label:"其它"}],F=[{value:"1",label:"一年级"},{value:"2",label:"二年级"},{value:"3",label:"三年级"},{value:"4",label:"四年级"},{value:"5",label:"五年级"},{value:"6",label:"六年级"},{value:"7",label:"初一"},{value:"8",label:"初二"},{value:"9",label:"初三"},{value:"10",label:"高一"},{value:"11",label:"高二"},{value:"12",label:"高三"}],C=[{value:"INTERNAL",label:"内部"},{value:"EXTERNAL",label:"外部"},{value:"ALL",label:"全部"}],T=[{label:"不限制",value:"1"},{label:"线上不可调为线下",value:"0"},{label:"线下不可调为线上",value:"2"},{label:"线上线下不可互调",value:"3"}],E=pe(n["musicGroupType"]),P=pe(n["classTime"]),$=[{label:"课程收费",value:0},{label:"会员收费",value:2},{label:"免费",value:3}],j=pe(n["payOrderType"]),N=pe(n["auditType"]),G=pe(n["auditPaymentType"]),R=pe(n["orderServerType"]),A=pe(n["orderAuditType"]),D=pe(n["rewardModeType"]),B=pe(n["musicClassType"]),M=pe(n["ProbationPeriodStatus"]),q=pe(n["downListType"]),U=pe(n["conclusion"]),W=pe(n["clientType"]),H=pe(n["couponType"]),V=pe(n["backType"]),z=pe(n["memberEnum"]),Y=pe(n["coupontypeDetail"]),X=pe(n["issue"]),J=pe(n["feedbackType"]),K=pe(n["feedbackTypeDesc"]),Q=pe(n["campState"]),Z=pe(n["catgGoupType"]),ee=pe(n["catRole"]),te=pe(n["catType"]),ae=pe(n["quiteReason"]),re=pe(n["payUserType"]),oe=pe(n["levelStatus"]),ne=pe(n["evaluateStatus"]),le=pe(n["problemType"]),se=pe(n["schoolUserType"]),ie=pe(n["shareLiveType"]),ce=pe(n["courseEmnu"]),ue=pe(n["suggestionType"]),de=pe(n["scoreType"]);function pe(e){var t=[];for(var a in e)t.push({label:e[a],value:a});return t}var me=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["value","label"],a=Object(o["a"])(t,2),n=a[0],l=a[1],s={};if(e&&e.length){var i,c=Object(r["a"])(e);try{for(c.s();!(i=c.n()).done;){var u=i.value;s[u[n]]=u[l]}}catch(d){c.e(d)}finally{c.f()}}return s}},"969a":function(e,t,a){"use strict";a("0f46")},aa96:function(e,t,a){"use strict";a("7a0e")},adb21:function(e,t,a){"use strict";a.d(t,"a",(function(){return c}));var r=a("bc3a"),o=a.n(r),n=(a("4328"),a("5f87")),l=a("3908"),s=a("e3eb"),i=a.n(s),c=function(e,t,a,r){var s=t.url,c={method:t.method?t.method:"get",headers:{Authorization:Object(n["b"])(),tenantId:Object(n["a"])()},url:s,responseType:"blob"};"post"==c.method?c.data=t.params:c.params=t.params,e.$confirm(a||"您确定下载模板","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){l["a"].startLoading(),o()(i()(c)).then((function(a){var o=new Blob([a.data],{type:"application/vnd.ms-excel;charset=utf-8"}),n=new Response(o).text();n.then((function(a){if(-1!=a.indexOf("code")){var n=JSON.parse(a);if(403==n.code)return e.$message.error("登录过期,请重新登录!"),void setTimeout((function(){e.$store.dispatch("user/resetToken").then((function(){location.reload()}))}),1e3);200==n.code?e.$message.success(n.msg):e.$message.error(n.msg),r&&r()}else{var l=URL.createObjectURL(o),s=document.createElement("a"),i=t.fileName||"导出文件.xls";s.href=l,s.setAttribute("download",i),document.body.appendChild(s),s.click(),r&&r()}})),l["a"].endLoading()})).catch((function(t){console.log(t),e.$message.error("下载失败,请联系管理员"),l["a"].endLoading()}))})).catch((function(){}))}},d7a7:function(e,t,a){"use strict";a("8300")}}]);