chunk-4508e20e.81d933fc.js 31 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4508e20e"],{"11be":function(e,t,l){"use strict";l("3d61")},2543:function(e,t,l){"use strict";l.d(t,"k",(function(){return i})),l.d(t,"l",(function(){return u})),l.d(t,"o",(function(){return s})),l.d(t,"i",(function(){return c})),l.d(t,"m",(function(){return d})),l.d(t,"j",(function(){return p})),l.d(t,"a",(function(){return b})),l.d(t,"b",(function(){return m})),l.d(t,"c",(function(){return g})),l.d(t,"h",(function(){return f})),l.d(t,"n",(function(){return v})),l.d(t,"f",(function(){return h})),l.d(t,"d",(function(){return S})),l.d(t,"e",(function(){return I})),l.d(t,"g",(function(){return y}));var a=l("b775"),r=l("4328"),n=l.n(r),o="/api-web";function i(e){return Object(a["a"])({url:o+"/goods/queryPage",method:"get",params:e})}function u(e){return Object(a["a"])({url:o+"/goods/get/".concat(e),method:"get"})}function s(e){return Object(a["a"])({url:o+"/goods/updateGoodsStatus",method:"post",data:n.a.stringify(e)})}function c(e){return Object(a["a"])({url:o+"/goods/add",method:"post",data:n.a.stringify(e)})}function d(e){return Object(a["a"])({url:o+"/goods/update",method:"post",data:n.a.stringify(e)})}function p(e){return Object(a["a"])({url:o+"/goods/del/".concat(e),method:"post"})}function b(e){return Object(a["a"])({url:o+"/category/queryPage",method:"get",params:e})}function m(e){return Object(a["a"])({url:o+"/category/upset",method:"post",data:e})}function g(e){return Object(a["a"])({url:o+"/category/del",method:"post",data:n.a.stringify(e)})}function f(e){return Object(a["a"])({url:o+"/subjectChange/queryPage",method:"get",params:e})}function v(e){return Object(a["a"])({url:o+"/subjectChange/updateCostMargin",method:"post",data:n.a.stringify(e)})}function h(e){return Object(a["a"])({url:o+"/goodsProcurement/queryGoodsProcurements",method:"get",params:e})}function S(e){return Object(a["a"])({url:o+"/goods/addGoodsProcurement",method:"post",params:e})}function I(e){return Object(a["a"])({url:o+"/swTempJc/queryPageForCourseSchedule",method:"get",params:e})}function y(e){return Object(a["a"])({url:o+"/swTempJc/queryPageForExtensionOrder",method:"get",params:e})}},"3d61":function(e,t,l){},"92e3":function(e,t,l){"use strict";l.d(t,"u",(function(){return u})),l.d(t,"H",(function(){return s})),l.d(t,"s",(function(){return c})),l.d(t,"c",(function(){return d})),l.d(t,"D",(function(){return p})),l.d(t,"Y",(function(){return b})),l.d(t,"X",(function(){return m})),l.d(t,"d",(function(){return g})),l.d(t,"L",(function(){return f})),l.d(t,"w",(function(){return v})),l.d(t,"ab",(function(){return h})),l.d(t,"t",(function(){return S})),l.d(t,"o",(function(){return I})),l.d(t,"Z",(function(){return y})),l.d(t,"P",(function(){return O})),l.d(t,"cb",(function(){return w})),l.d(t,"db",(function(){return E})),l.d(t,"O",(function(){return C})),l.d(t,"T",(function(){return T})),l.d(t,"B",(function(){return _})),l.d(t,"l",(function(){return P})),l.d(t,"W",(function(){return k})),l.d(t,"bb",(function(){return N})),l.d(t,"I",(function(){return A})),l.d(t,"m",(function(){return L})),l.d(t,"v",(function(){return R})),l.d(t,"M",(function(){return x})),l.d(t,"f",(function(){return F})),l.d(t,"e",(function(){return M})),l.d(t,"K",(function(){return D})),l.d(t,"J",(function(){return G})),l.d(t,"S",(function(){return U})),l.d(t,"G",(function(){return $})),l.d(t,"a",(function(){return j})),l.d(t,"x",(function(){return q})),l.d(t,"p",(function(){return V})),l.d(t,"n",(function(){return H})),l.d(t,"q",(function(){return B})),l.d(t,"g",(function(){return W})),l.d(t,"F",(function(){return Y})),l.d(t,"r",(function(){return J})),l.d(t,"C",(function(){return X})),l.d(t,"A",(function(){return z})),l.d(t,"z",(function(){return K})),l.d(t,"h",(function(){return Q})),l.d(t,"k",(function(){return Z})),l.d(t,"i",(function(){return ee})),l.d(t,"j",(function(){return te})),l.d(t,"R",(function(){return le})),l.d(t,"N",(function(){return ae})),l.d(t,"E",(function(){return re})),l.d(t,"y",(function(){return ne})),l.d(t,"Q",(function(){return oe})),l.d(t,"U",(function(){return ie})),l.d(t,"V",(function(){return ue})),l.d(t,"b",(function(){return ce}));var a=l("2d63"),r=l("768b"),n=l("267e"),o=sessionStorage.getItem("tenantConfig");o=o?JSON.parse(o):{};var i=o.tenantId,u=null,s=null;1==i?(s=[{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"}],u=[{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"}]):(s=[{label:"声部课",value:"SINGLE"},{label:"合奏课",value:"MIX"},{label:"基础技能课",value:"HIGH"},{label:"集训声部课",value:"TRAINING_SINGLE"},{label:"集训合奏课",value:"TRAINING_MIX"},{label:"课堂课",value:"CLASSROOM"},{label:"综合课",value:"COMPREHENSIVE"}],u=[{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 c=[{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"}],b=[{label:"正常",value:"0"},{label:"冻结",value:"1"},{label:"锁定",value:"9"}],m=[{value:"NORMAL",label:"正常"},{value:"TRUANT",label:"旷课"},{value:"LEAVE",label:"请假"}],g=[].concat(m,[{value:"QUIT_SCHOOL",label:"休学"},{value:"DROP_OUT",label:"退学"},{value:"LATE",label:"迟到"}]),f=[{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:"直播课购买"}],v=[{value:"ING",label:"交易中"},{value:"SUCCESS",label:"成功交易"},{value:"FAILED",label:"交易失败"},{value:"CLOSE",label:"交易关闭"}],h=[{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:"系统扣除"}],O=[{value:"FREE",label:"免费"},{value:"CHARGE",label:"收费"},{value:"TRIAL",label:"试听课"},{value:"CARE_PACKAGE",label:"关心包"},{value:"COME_ON_PACKAGE",label:"加油包"}],w=[{value:"课程推荐",label:"课程推荐",children:[{value:"新课推荐",label:"新课推荐"},{value:"续费提醒",label:"续费提醒"}]},{value:"常规回访",label:"常规回访",children:[{value:"课后及训练回访",label:"课后及训练回访"},{value:"练习及乐团表现",label:"练习及乐团表现"}]},{value:"其它",label:"其它",children:[{value:"其它",label:"其它"}]}],E=[{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:"会员续费"}]}],C=[{value:"YQPAY",label:"双乾"},{value:"BALANCE",label:"余额"},{value:"ADAPAY",label:"汇付"},{value:"YEEPAY",label:"易宝"}],T=[{value:"INSTRUMENT",label:"乐器销售"},{value:"ACCESSORIES",label:"配件销售"},{value:"SCHOOL_BUY",label:"学校采购"},{value:"OTHER",label:"其它"}],_=[{value:"INSTRUMENT",label:"乐器"},{value:"ACCESSORIES",label:"辅件"},{value:"TEACHING",label:"教材"},{value:"STAFF",label:"教谱"},{value:"OTHER",label:"其它"}],P=[{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:"高三"}],k=[{value:"INTERNAL",label:"内部"},{value:"EXTERNAL",label:"外部"},{value:"ALL",label:"全部"}],N=[{label:"不限制",value:"1"},{label:"线上不可调为线下",value:"0"},{label:"线下不可调为线上",value:"2"},{label:"线上线下不可互调",value:"3"}],A=se(n["musicGroupType"]),L=se(n["classTime"]),R=[{label:"课程收费",value:0},{label:"会员收费",value:2},{label:"免费",value:3}],x=se(n["payOrderType"]),F=se(n["auditType"]),M=se(n["auditPaymentType"]),D=se(n["orderServerType"]),G=se(n["orderAuditType"]),U=se(n["rewardModeType"]),$=se(n["musicClassType"]),j=se(n["ProbationPeriodStatus"]),q=se(n["downListType"]),V=se(n["conclusion"]),H=se(n["clientType"]),B=se(n["couponType"]),W=se(n["backType"]),Y=se(n["memberEnum"]),J=se(n["coupontypeDetail"]),X=se(n["issue"]),z=se(n["feedbackType"]),K=se(n["feedbackTypeDesc"]),Q=se(n["campState"]),Z=se(n["catgGoupType"]),ee=se(n["catRole"]),te=se(n["catType"]),le=se(n["quiteReason"]),ae=se(n["payUserType"]),re=se(n["levelStatus"]),ne=se(n["evaluateStatus"]),oe=se(n["problemType"]),ie=se(n["schoolUserType"]),ue=se(n["shareLiveType"]);function se(e){var t=[];for(var l in e)t.push({label:e[l],value:l});return t}var ce=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["value","label"],l=Object(r["a"])(t,2),n=l[0],o=l[1],i={};if(e&&e.length){var u,s=Object(a["a"])(e);try{for(s.s();!(u=s.n()).done;){var c=u.value;i[c[n]]=c[o]}}catch(d){s.e(d)}finally{s.f()}}return i}},fd78:function(e,t,l){"use strict";l.r(t);var a=function(){var e=this,t=e.$createElement,l=e._self._c||t;return l("div",{staticClass:"m-container"},[l("h2",[l("el-page-header",{attrs:{content:e.pageTitle[e.pageType]+"商品"},on:{back:e.onCancel}})],1),e._v(" "),l("div",{staticClass:"m-core"},[l("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"160px",inline:!0}},[l("el-alert",{staticClass:"alert",attrs:{title:"基础信息",closable:!1,type:"info"}}),e._v(" "),l("el-form-item",{attrs:{label:"货号",prop:"sn"}},[l("el-input",{staticStyle:{width:"220px !important"},attrs:{disabled:e.pageDisabled,placeholder:"请输入货号"},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(" "),l("el-form-item",{attrs:{label:"品牌",prop:"brand"}},[l("el-input",{staticStyle:{width:"220px !important"},attrs:{disabled:e.pageDisabled,placeholder:"请输入品牌"},model:{value:e.form.brand,callback:function(t){e.$set(e.form,"brand","string"===typeof t?t.trim():t)},expression:"form.brand"}})],1),e._v(" "),l("el-form-item",{attrs:{label:"商品名称",prop:"name"}},[l("el-input",{staticStyle:{width:"220px !important"},attrs:{placeholder:"请输入商品名称",disabled:e.pageDisabled},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(" "),l("el-form-item",{attrs:{label:"商品类型",prop:"type"}},[l("el-select",{staticStyle:{width:"220px !important"},attrs:{placeholder:"请选择商品类型",disabled:e.pageDisabled},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 l("el-option",{key:t,attrs:{label:e.label,value:e.value}})})),1)],1),e._v(" "),l("el-form-item",{attrs:{label:"商品分类",prop:"goodsCategoryId"}},[l("el-select",{staticStyle:{width:"220px !important"},attrs:{placeholder:"请选择商品分类",disabled:e.pageDisabled,filterable:""},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){return l("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),e._v(" "),l("el-form-item",{attrs:{label:"商品型号",prop:"specification"}},[l("el-input",{staticStyle:{width:"220px"},attrs:{placeholder:"请输入商品型号",disabled:e.pageDisabled},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(" "),1==e.tenantId?l("el-form-item",{attrs:{label:"库存类型",prop:"stockType"}},[l("el-select",{staticStyle:{width:"220px !important"},attrs:{placeholder:"请选择库存类型",disabled:e.pageDisabled},model:{value:e.form.stockType,callback:function(t){e.$set(e.form,"stockType",t)},expression:"form.stockType"}},e._l(e.stockType,(function(e,t){return l("el-option",{key:t,attrs:{label:e.label,value:e.value}})})),1)],1):e._e(),e._v(" "),1==e.tenantId?l("el-form-item",{attrs:{label:"是否库存预警",prop:"stockWarning"}},[l("el-select",{staticStyle:{width:"220px !important"},attrs:{placeholder:"请选择库存预警",disabled:e.pageDisabled},model:{value:e.form.stockWarning,callback:function(t){e.$set(e.form,"stockWarning",t)},expression:"form.stockWarning"}},[l("el-option",{attrs:{label:"是",value:1}}),e._v(" "),l("el-option",{attrs:{label:"否",value:0}})],1)],1):e._e(),e._v(" "),l("el-alert",{staticClass:"alert",attrs:{title:"价格信息",closable:!1,type:"info"}}),e._v(" "),l("el-form-item",{staticClass:"hiddenStart",attrs:{label:"市场价",prop:"marketPrice"}},[l("template",{slot:"label"},[l("p",{staticStyle:{position:"relative"}},[l("span",{staticStyle:{color:"#f56c6c","margin-right":"4px"}},[e._v("*")]),e._v("\n 市场价\n "),l("el-tooltip",{attrs:{placement:"top","popper-class":"mTooltip"}},[l("div",{attrs:{slot:"content"},slot:"content"},[e._v("\n 商品标价,仅在商品购买时做展示,不以该价格向学员销售商品\n ")]),e._v(" "),l("i",{staticClass:"el-icon-question",staticStyle:{"font-size":"18px",color:"#f56c6c",position:"relative",top:"2px"}})])],1)]),e._v(" "),l("el-input",{staticStyle:{width:"220px"},attrs:{type:"number",placeholder:"请输入市场价",disabled:e.pageDisabled},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(" "),l("el-form-item",{staticClass:"hiddenStart",attrs:{label:"零售价",prop:"discountPrice"}},[l("template",{slot:"label"},[l("p",{staticStyle:{position:"relative"}},[l("span",{staticStyle:{color:"#f56c6c","margin-right":"4px"}},[e._v("*")]),e._v("\n 零售价\n "),l("el-tooltip",{attrs:{placement:"top","popper-class":"mTooltip"}},[l("div",{attrs:{slot:"content"},slot:"content"},[e._v("\n 管理端APP、乐器维修时学员购买该商品的价格\n ")]),e._v(" "),l("i",{staticClass:"el-icon-question",staticStyle:{"font-size":"18px",color:"#f56c6c",position:"relative",top:"2px"}})])],1)]),e._v(" "),l("el-input",{staticStyle:{width:"220px"},attrs:{type:"number",placeholder:"请输入零售价",disabled:e.pageDisabled},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(" "),l("el-form-item",{staticClass:"hiddenStart",attrs:{label:"商品团购价",prop:"groupPurchasePrice"}},[l("template",{slot:"label"},[l("p",{staticStyle:{position:"relative"}},[l("span",{staticStyle:{color:"#f56c6c","margin-right":"4px"}},[e._v("*")]),e._v("\n 团购价\n "),l("el-tooltip",{attrs:{placement:"top","popper-class":"mTooltip"}},[l("div",{attrs:{slot:"content"},slot:"content"},[e._v("乐团报名缴费时学员购买该商品的价格")]),e._v(" "),l("i",{staticClass:"el-icon-question",staticStyle:{"font-size":"18px",color:"#f56c6c",position:"relative",top:"2px"}})])],1)]),e._v(" "),l("el-input",{staticStyle:{width:"220px"},attrs:{type:"number",placeholder:"请输入商品团购价",disabled:e.pageDisabled},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(" "),l("el-form-item",{attrs:{label:"分部成本",prop:"organCostPrice"}},[l("el-input",{staticStyle:{width:"220px"},attrs:{type:"number",placeholder:"请输入分部成本",disabled:e.pageDisabled},nativeOn:{mousewheel:function(e){e.preventDefault()}},model:{value:e.form.organCostPrice,callback:function(t){e.$set(e.form,"organCostPrice","string"===typeof t?t.trim():t)},expression:"form.organCostPrice"}})],1),e._v(" "),l("el-alert",{staticClass:"alert",attrs:{title:"销售渠道",closable:!1,type:"info"}}),e._v(" "),l("el-form-item",{attrs:{label:"移动端可售分部",prop:"educationShowOrganId"}},[l("select-all",{staticStyle:{width:"400px !important"},attrs:{filterable:"",placeholder:"请选择分部",multiple:"",disabled:e.pageDisabled,clearable:""},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 l("el-option",{key:e.id,attrs:{label:e.name,value:e.id.toString()}})})),1)],1),e._v(" "),l("el-form-item",{attrs:{label:"课程收费乐团可售分部",prop:"courseFeeShowOrganId"}},[l("select-all",{staticStyle:{width:"400px !important"},attrs:{filterable:"",placeholder:"请选择分部",multiple:"",disabled:e.pageDisabled,clearable:""},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 l("el-option",{key:e.id,attrs:{label:e.name,value:e.id.toString()}})})),1)],1),e._v(" "),l("el-form-item",{attrs:{label:"会员收费乐团可售分部",prop:"memberFeeShowOrganId"}},[l("select-all",{staticStyle:{width:"400px !important"},attrs:{filterable:"",placeholder:"请选择分部",multiple:"",disabled:e.pageDisabled,clearable:""},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 l("el-option",{key:e.id,attrs:{label:e.name,value:e.id.toString()}})})),1)],1),e._v(" "),l("el-form-item",{attrs:{label:"免费乐团可售分部",prop:"freeFeeShowOrganId"}},[l("select-all",{staticStyle:{width:"400px !important"},attrs:{filterable:"",placeholder:"请选择分部",multiple:"",disabled:e.pageDisabled,clearable:""},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 l("el-option",{key:e.id,attrs:{label:e.name,value:e.id.toString()}})})),1)],1),e._v(" "),1==e.tenantId?l("el-form-item",{attrs:{label:"乐器置换可售分部",prop:"replacementShowOrganId"}},[l("select-all",{staticStyle:{width:"400px !important"},attrs:{filterable:"",placeholder:"请选择所属分部",multiple:"",disabled:e.pageDisabled,clearable:""},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 l("el-option",{key:e.id,attrs:{label:e.name,value:e.id.toString()}})})),1)],1):e._e(),e._v(" "),l("el-alert",{staticClass:"alert",attrs:{title:"商品信息",closable:!1,type:"info"}}),e._v(" "),l("el-form-item",{attrs:{label:"商品图片",prop:"image"}},[l("image-cropper",{attrs:{options:e.cropperOptions,disabled:e.pageDisabled,imgSize:2,imageUrl:e.form.image,bucket_name:"mall"},on:{"crop-upload-success":e.cropSuccess}}),e._v(" "),l("p",{staticClass:"imageSize"},[e._v("\n 请上传大小2M以内,格式为jpg、png、gif图片\n ")])],1),e._v(" "),l("br"),e._v(" "),l("el-form-item",{attrs:{label:"商品描述",prop:"brief"}},[l("el-input",{staticStyle:{width:"400px"},attrs:{type:"textarea",disabled:e.pageDisabled},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(" "),l("br"),e._v(" "),l("el-form-item",{attrs:{label:"商品详情",prop:"desc"}},[l("el-input",{staticStyle:{width:"400px"},attrs:{type:"textarea",disabled:e.pageDisabled},model:{value:e.form.desc,callback:function(t){e.$set(e.form,"desc","string"===typeof t?t.trim():t)},expression:"form.desc"}})],1),e._v(" "),l("br"),e._v(" "),e.pageDisabled?e._e():l("el-form-item",[l("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.onSubmit("form")}}},[e._v("保存")]),e._v(" "),l("el-button",{on:{click:function(t){return e.onReSet("form")}}},[e._v("重置")])],1)],1)],1)])},r=[],n=(l("ac6a"),l("7f7f"),l("28a5"),l("2543")),o=l("5f87"),i=l("92e3"),u=l("896b"),s=function(e,t,l){""==t&&"string"==typeof t||null==t?l(new Error("请输入金额")):t<0?l(new Error("输入金额必须大于或等于0")):t>=1e5?l(new Error("输入金额必须小于100000")):l()},c=function(e,t,l){""==t&&"string"==typeof t||null==t?l(new Error("请输入库存")):t<0?l(new Error("库存数量必须大于或等于0")):l()},d={name:"shopOperation",components:{ImageCropper:u["a"]},data:function(){return{goodsType:i["B"],stockType:i["W"],categoryList:[],pageType:null,pageTitle:{create:"添加",update:"修改",look:"查看",copy:"复制"},pageDisabled:!1,headers:{Authorization:Object(o["b"])()},form:{sn:null,brand:null,supplyChannel:null,name:null,type:null,goodsCategoryId:null,specification:null,stockCount:null,taxStockCount:null,stockType:null,marketPrice:null,discountPrice:null,groupPurchasePrice:null,organCostPrice:null,clientShow:null,educationalShow:null,musicGroupShow:null,courseViewType:[],stockWarning:null,image:null,brief:null,desc:null,replacementShow:null,studentShowOrganId:null,educationShowOrganId:null,courseFeeShowOrganId:null,memberFeeShowOrganId:null,freeFeeShowOrganId:null,replacementShowOrganId:null},rules:{sn:[{required:!0,message:"请输入商品货号",trigger:"blur"}],brand:[{required:!0,message:"请输入品牌",trigger:"blur"},{min:2,max:30,message:"长度在 2 到 30 个字符",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"}],stockCount:[{required:!0,validator:c,trigger:"blur"}],taxStockCount:[{required:!0,validator:c,trigger:"blur"}],stockType:[{required:!0,message:"请选择库存类型",trigger:"change"}],marketPrice:[{required:!0,validator:s,trigger:"blur"}],discountPrice:[{required:!0,validator:s,trigger:"blur"}],groupPurchasePrice:[{required:!0,validator:s,trigger:"blur"}],organCostPrice:[{required:!0,validator:s,trigger:"blur"}],clientShow:[{required:!0,message:"请选择学员是否展示",trigger:"change"}],replacementShow:[{required:!0,message:"是否参与乐器置换",trigger:"change"}],educationalShow:[{required:!0,message:"请选择教务端是否展示",trigger:"change"}],musicGroupShow:[{required:!0,message:"请选择乐团是否展示",trigger:"change"}],courseViewType:[{required:!0,message:"请选乐团收费模式",trigger:"change"}],stockWarning:[{required:!0,message:"请选择是否库存预警",trigger:"change"}],image:[{required:!0,message:"请选择图片",trigger:"blur"}],brief:[{required:!0,message:"请输入商品描述",trigger:"blur"}],desc:[{required:!0,message:"请输入商品详情",trigger:"blur"}]},Fsearch:null,Frules:null,imageWidthM:400,imageHeightM:400,tenantId:"",cropperOptions:{autoCrop:!0,autoCropWidth:300,autoCropHeight:300,fixedBox:!0,previewsCircle:!1,title:"商品图片"}}},mounted:function(){this.tenantId=this.$helpers.tenantId,this.$store.dispatch("setBranchs"),this.init()},methods:{init:function(){var e=this.$route.query;if(e.paramInfo){var t=JSON.parse(e.paramInfo);this.pageType=t.type,this.id=t.id}this.pageDisabled="look"==this.pageType,this.getList(),this.getCatagory()},cropSuccess:function(e){this.form.image=e.data.url},onSubmit:function(e){var t=this;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 l=JSON.parse(JSON.stringify(t.form));l.courseViewType&&(l.courseViewType=l.courseViewType.join(",")),l.studentShowOrganId&&(l.studentShowOrganId=l.studentShowOrganId.join(",")),l.educationShowOrganId&&(l.educationShowOrganId=l.educationShowOrganId.join(",")),l.courseFeeShowOrganId&&(l.courseFeeShowOrganId=l.courseFeeShowOrganId.join(",")),l.memberFeeShowOrganId&&(l.memberFeeShowOrganId=l.memberFeeShowOrganId.join(",")),l.freeFeeShowOrganId&&(l.freeFeeShowOrganId=l.freeFeeShowOrganId.join(",")),l.replacementShowOrganId&&(l.replacementShowOrganId=l.replacementShowOrganId.join(",")),l.studentShowOrganId||l.educationShowOrganId||l.courseFeeShowOrganId||l.memberFeeShowOrganId||l.freeFeeShowOrganId||l.replacementShowOrganId?"create"==t.pageType||"copy"==t.pageType?(l.id&&delete l.id,l.sellCount=0,l.stockCount=0,l.taxStockCount=0,l.status="NO",Object(n["i"])(l).then((function(e){t.messageTips("保存",e)}))):"update"==t.pageType&&Object(n["m"])(l).then((function(e){t.messageTips("保存",e)})):t.$message.error("请至少选择一个可见分部")}))},messageTips:function(e,t){200==t.code?(this.$message.success(e+"成功"),this.$store.dispatch("delVisitedViews",this.$route),this.$router.push({path:"/shopList",query:{pageInfo:this.Frules,searchForm:this.Fsearch}})):this.$message.error(t.msg)},onCancel:function(){this.$store.dispatch("delVisitedViews",this.$route),this.$router.push({path:"/shopList"})},onReSet:function(e){this.$refs[e].resetFields()},getList:function(){var e=this;"create"==this.pageType?(this.form={sn:null,brand:null,supplyChannel:null,name:null,type:null,goodsCategoryId:null,organIdList:[],specification:null,stockCount:null,taxStockCount:null,stockType:null,marketPrice:null,discountPrice:null,groupPurchasePrice:null,organCostPrice:null,clientShow:null,educationalShow:null,musicGroupShow:null,courseViewType:[],stockWarning:null,image:null,brief:null,desc:null},this.$refs["form"]&&this.$refs["form"].resetFields()):Object(n["l"])(this.id).then((function(t){if(200==t.code){var l=t.data,a=null;l.courseViewType&&(a=l.courseViewType.split(","));var r=[];l.studentShowOrganId&&(r=l.studentShowOrganId.split(","));var n=[];l.educationShowOrganId&&(n=l.educationShowOrganId.split(","));var o=[];l.courseFeeShowOrganId&&(o=l.courseFeeShowOrganId.split(","));var i=[];l.memberFeeShowOrganId&&(i=l.memberFeeShowOrganId.split(","));var u=[];l.freeFeeShowOrganId&&(u=l.freeFeeShowOrganId.split(","));var s=[];l.replacementShowOrganId&&(s=l.replacementShowOrganId.split(",")),e.form={id:l.id,sn:l.sn,brand:l.brand,supplyChannel:l.supplyChannel,name:l.name,type:l.type,goodsCategoryId:l.goodsCategoryId,studentShowOrganId:r,educationShowOrganId:n,courseFeeShowOrganId:o,memberFeeShowOrganId:i,freeFeeShowOrganId:u,replacementShowOrganId:s,specification:l.specification,stockCount:l.stockCount,taxStockCount:l.taxStockCount,stockType:l.stockType,marketPrice:l.marketPrice,discountPrice:l.discountPrice,groupPurchasePrice:l.groupPurchasePrice,organCostPrice:l.organCostPrice,clientShow:l.clientShow,educationalShow:l.educationalShow,musicGroupShow:l.musicGroupShow,courseViewType:a,stockWarning:l.stockWarning,image:l.image,brief:l.brief,desc:l.desc,replacementShow:l.replacementShow}}}))},getCatagory:function(){var e=this;Object(n["a"])({delFlag:0,rows:9999}).then((function(t){var l=t.data;if(200==t.code){var a=[];l.rows.forEach((function(e){a.push({label:e.name,value:e.id})})),e.categoryList=a}}))},handleAvatarSuccess:function(e,t){this.form.image=e.data.url},beforeAvatarUpload:function(e){var t=this,l={"image/png":!0,"image/jpeg":!0},a=l[e.type],r=e.size/1024/1024<2,n=this.imageWidthM,o=this.imageHeightM,i=window.URL||window.webkitURL,u=new Promise((function(t,l){var a=new Image;a.onload=function(){n&&o?this.width===n&&this.height===o?t():l("请上传".concat(n,"x").concat(o,"尺寸图片")):n&&!o?this.width===n?t():l("请上传宽为".concat(n,"的图片")):!n&&o?this.height===o?t():l("请上传高为".concat(o,"的图片")):t()},a.src=i.createObjectURL(e)})).then((function(){return e}),(function(e){return t.$message.error(e),t.uploadImgLoading=!1,Promise.reject()}));return a||this.$message.error("只能上传图片格式!"),r||this.$message.error("上传头像图片大小不能超过 2MB!"),a&&r&&u}}},p=d,b=(l("11be"),l("2877")),m=Object(b["a"])(p,a,r,!1,null,"5d89af21",null);t["default"]=m.exports}}]);