|
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-9dab12da"],{"6b2f":function(e,t,a){"use strict";a.r(t);var r=function(){var e=this,t=e._self._c;return t("div",[t("div",{staticClass:"main-content"},[e._m(0),t("div",{staticClass:"content"},[t("div",{staticClass:"content-btn"},[t("el-button",{staticClass:"init-button",attrs:{icon:"el-icon-plus"},on:{click:function(t){return e.add()}}},[e._v("商品创建")])],1),t("div",{},[t("VueTable",{ref:"table",attrs:{config:e.config},on:{tableCheck:e.tableCheck}},[t("template",{slot:"tabs"},[t("el-tabs",{on:{"tab-click":e.handleClick},model:{value:e.activeName,callback:function(t){e.activeName=t},expression:"activeName"}},[t("el-tab-pane",{attrs:{label:"全部",name:"0"}}),t("el-tab-pane",{attrs:{label:"已上架",name:"1"}}),t("el-tab-pane",{attrs:{label:"已下架",name:"2"}})],1)],1),t("template",{slot:"footer"},[t("div",{staticClass:"table-footer"},[t("button",{on:{click:function(t){return e.sploading(e.table_row)}}},[e._v(" 上架 ")]),t("button",{on:{click:function(t){return e.unloading(e.table_row)}}},[e._v(" 下架 ")]),t("button",{on:{click:function(t){return e.del(e.table_row)}}},[e._v("删除")])])])],2)],1),t("Drawer",{attrs:{drawerTitle:"商品创建",drawerVrisible:e.add_vrisible},on:{drawerClose:e.addClose}},[t("div",{staticStyle:{padding:"30px"}},[t("FromCard",[t("template",{slot:"title"},[e._v("填写商品信息")]),[t("VueForm",{ref:"addForm",attrs:{formObj:e.addForm},on:{ruleSuccess:e.addRuleSuccess},scopedSlots:e._u([{key:"supplierId",fn:function(){return[t("el-select",{staticStyle:{width:"240px"},attrs:{"remote-method":e.remoteMethod,loading:e.loading,remote:"",filterable:"",placeholder:"请选择"},on:{change:e.change,focus:e.sefocus},model:{value:e.addForm.ruleForm.supplierId,callback:function(t){e.$set(e.addForm.ruleForm,"supplierId",t)},expression:"\n addForm.ruleForm.supplierId\n "}},e._l(e.supplierOptions,(function(e){return t("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)]},proxy:!0},{key:"category",fn:function(){return[t("el-select",{staticStyle:{width:"240px"},attrs:{"remote-method":e.remoteMethod,loading:e.loading,remote:"",filterable:"",placeholder:"请选择"},on:{change:e.change,focus:e.sefocus},model:{value:e.addForm.ruleForm.category,callback:function(t){e.$set(e.addForm.ruleForm,"category",t)},expression:"addForm.ruleForm.category"}},e._l(e.cateOptions,(function(e){return t("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)]},proxy:!0}])},[t("template",{slot:"imgUrls"},[[t("el-upload",{ref:"myUpload1",attrs:{action:e.$baseUrl+"upload/uploadShoppingGoods","on-success":e.ImgeSuccess,"file-list":e.imglist,"on-exceed":e.handleExceed,limit:5,accept:".jpg,.png,.JPG,.PNG","before-upload":e.beforeAvatarUpload}},[t("el-button",{attrs:{icon:"el-icon-edit",size:"small"}},[e._v("上传图片")]),t("span",{staticStyle:{"margin-left":"10px","font-size":"12px",color:"#444444"}},[e._v("建议比例:3:2")]),t("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[t("span",[e._v("支持扩展名:png,jpg")])])],1)]],2)],2)]],2)],1),t("div",{attrs:{slot:"footer"},slot:"footer"},[t("button",{staticClass:"btn-orange",on:{click:function(t){return e.addSubmit()}}},[t("span",[t("i",{staticClass:"el-icon-circle-check"}),e._v("提交")])]),t("button",{staticClass:"btn-gray",on:{click:e.addClose}},[t("span",[e._v("取消")])])])])],1)])])},o=[function(){var e=this,t=e._self._c;return t("div",{staticClass:"main-titel"},[t("span",[e._v("商品管理")])])}],l=a("e692"),s={data(){return{add_vrisible:!1,addDate:null,table_row:[],loading:!1,cateOptions:[],supplierOptions:[],addForm:{ruleForm:{imgUrls:[]},rules:{category:[{required:!0,message:"请输入",trigger:"change"}],categoryId:[{required:!0,message:"请输入",trigger:"change"}],title:[{required:!0,message:"请选择",trigger:"change"}],recommend:[{required:!0,message:"请选择",trigger:"change"}],supplierId:[{required:!0,message:"请选择",trigger:"change"}],detail:[{required:!0,message:"请输入",trigger:"change"}],sellingPrice:[{required:!0,message:"请选择",trigger:"change"}],markingPrice:[{required:!0,message:"请选择",trigger:"change"}],stock:[{required:!0,message:"请选择",trigger:"change"}],status:[{required:!0,message:"请选择",trigger:"change"}],arrivalTime:[{required:!0,message:"请选择",trigger:"change"}]},form_item:[{type:"Slot",label:"所属大类",placeholder:"请选择",width:"50%",prop:"category",slotName:"category"},{type:"Select",label:"所属小类",placeholder:"请选择",width:"50%",prop:"categoryId",options:[]},{type:"Input",label:"商品标题",placeholder:"请输入",width:"50%",prop:"title"},{type:"Input",label:"推荐语",placeholder:"请输入",width:"50%",prop:"recommend"},{type:"Slot",label:"供应商",placeholder:"请输入",width:"50%",prop:"supplierId",slotName:"supplierId"},{type:"textarea",label:"商品详情",placeholder:"请输入",width:"100%",prop:"detail"},{type:"Input",label:"售卖价",placeholder:"请输入",width:"50%",prop:"sellingPrice"},{type:"Input",label:"划线价",placeholder:"请输入",width:"50%",prop:"markingPrice"},{type:"Int",label:"库存",placeholder:"请输入",width:"50%",prop:"stock"},{type:"Select",label:"状态",placeholder:"请输入",width:"50%",prop:"status",options:[{value:"1",label:"立即上架"},{value:"2",label:"手动上架"}]},{type:"Input",label:"到货时间说明",placeholder:"请输入",width:"50%",prop:"arrivalTime"},{type:"Slot",label:"图片上传",placeholder:"请输入",width:"100%",prop:"imgUrls",slotName:"imgUrls"}]},imglist:[],activeName:"0",config:{thead:[{label:"序号",type:"index",width:"80"},{label:"商品编号",prop:"code",width:"auto"},{label:"商品标题",prop:"title",width:"auto"},{label:"售价",prop:"sellingPrice",width:"auto"},{label:"划线价",prop:"markingPrice",width:"auto"},{label:"库存",prop:"stock",width:"auto"},{label:"预约量",prop:"subscribeNum",width:"auto"},{label:"状态",prop:"status",width:"auto",type:"function",callback(e,t){switch(e.status){case 1:return"上架";case 2:return"下架"}}},{label:"创建时间",prop:"createDate",width:"220"}],table_data:[],url:"shopGoodsList",search_item:[{type:"Input",label:"商品编号",placeholder:"请输入",prop:"code"},{type:"Input",label:"商品标题",placeholder:"请输入",prop:"title"},{type:"select",label:"状态",placeholder:"请选择",value:null,options:[{value:1,label:"上架"},{value:2,label:"下架"}],prop:"status"},{type:"picker",label:"创建时间",placeholder:"请输入",prop:"date",startDate:"createDateStart",endDate:"createDateEnd",width:"280px"}],data:{pageNum:1,size:10}}}},methods:{getUserList(e){let t={pageNum:1,size:20};this.loading=!0,Object(l["n"])(t).then(e=>{console.log(e),this.supplierOptions=e.tableList,this.loading=!1}),Object(l["e"])({parentId:0}).then(e=>{this.cateOptions=e.data,this.loading=!1})},remoteMethod(e){this.getUserList(e)},sefocus(){this.getUserList()},change(e){console.log(e),this.addForm.form_item[1].options=[];let t={parentId:e};Object(l["e"])(t).then(e=>{console.log(e),e.data.forEach(e=>{let t={value:e.id,label:e.name};this.addForm.form_item[1].options.push(t)}),console.log(this.addForm.form_item[1].options),this.loading=!1})},sChange(e){console.log(e),this.addForm.form_item[1].options=[];let t={parentId:e};Object(l["e"])(t).then(e=>{console.log(e),e.tableList.forEach(e=>{let t={value:e.id,label:e.actualName};this.addForm.form_item[1].options.push(t)}),console.log(this.addForm.form_item[1].options),this.loading=!1})},add(){this.add_vrisible=!0},addClose(){this.$refs.addForm.reset(),this.add_vrisible=!1,this.$refs.myUpload1.clearFiles()},addRuleSuccess(){let e={...this.addForm.ruleForm};Object(l["h"])(e).then(e=>{e.status&&(this.$message({message:e.message,type:"success"}),this.$refs.table.loadData(),this.addClose())})},addSubmit(){this.$refs.addForm.submitForm()},sploading(e){e.length>1?this.$message.error("只能操作一条数据"):e.length?1==e[0].status?this.$message({message:"上架失败",type:"error"}):Object(l["i"])({id:e[0].id}).then(e=>{console.log(e),e.status&&(this.$message({message:e.message,type:"success"}),this.$refs.table.loadData())}):this.$message.error("请选择")},unloading(e){console.log(e[0].id),e.length>1?this.$message.error("只能操作一条数据"):e.length?Object(l["j"])({id:e[0].id}).then(e=>{console.log(e),e.status&&(this.$message({message:e.message,type:"success"}),this.$refs.table.loadData())}):this.$message.error("请选择")},handleClick(e,t){let a=null;a=0!=this.activeName?this.activeName:null;const r={pageNum:1,size:10,status:a};this.$refs.table.requestData(r)},del(e){if(e.length){let e=[];for(let t=0;t<this.table_row.length;t++)e.push(this.table_row[t].id);this.$confirm("是否确认删除?删除不可恢复","删除",{confirmButtonText:"确定",cancelButtonText:"取消",confirmButtonClass:"confirmButton",cancelButtonClass:"cancelButton"}).then(()=>{this.$refs.table.tableDelete(e)}).catch(e=>{})}else this.$message.error("请选中需要删除的数据")},tableCheck(e){this.table_row=e},ImgeSuccess(e,t){this.addForm.ruleForm.imgUrls[0]=t.response.url},beforeAvatarUpload(e){const t=e.size/1024/1024<2,a="image/png"===e.type,r="image/jpeg"===e.type;return a||r||this.$message.error("上传头像图片只能是 JPG/PNG 格式!"),t||this.$message.error("上传头像图片大小不能超过 2MB!"),(a||r)&&t},handleExceed(e,t){this.$message.warning(`当前限制选择 5 个文件,本次选择了 ${e.length} 个文件,共选择了 ${e.length+t.length} 个文件`)}}},i=s,n=a("2877"),d=Object(n["a"])(i,r,o,!1,null,null,null);t["default"]=d.exports},e692:function(e,t,a){"use strict";a.d(t,"m",(function(){return o})),a.d(t,"h",(function(){return l})),a.d(t,"n",(function(){return s})),a.d(t,"a",(function(){return i})),a.d(t,"e",(function(){return n})),a.d(t,"f",(function(){return d})),a.d(t,"c",(function(){return c})),a.d(t,"d",(function(){return u})),a.d(t,"i",(function(){return p})),a.d(t,"j",(function(){return h})),a.d(t,"k",(function(){return m})),a.d(t,"b",(function(){return g})),a.d(t,"l",(function(){return b})),a.d(t,"g",(function(){return f}));var r=a("b775");a("2c37");function o(e){return r["a"].request({method:"POST",url:"shop/supplier/insert",data:e})}function l(e){return r["a"].request({method:"POST",url:"shop/goods/insert",data:e})}function s(e){return r["a"].request({method:"GET",url:"shop/supplier/list",params:e})}function i(e){return r["a"].request({method:"POST",url:"shop/order/arrivalGoods",data:e})}function n(e){return r["a"].request({method:"GET",url:"shop/category/list",params:e})}function d(e){return r["a"].request({method:"POST",url:"shop/category/update",data:e})}function c(e){return r["a"].request({method:"GET",url:"shop/category/delete",params:e})}function u(e){return r["a"].request({method:"POST",url:"shop/category/insert",data:e})}function p(e){return r["a"].request({method:"GET",url:"shop/goods/loading",params:e})}function h(e){return r["a"].request({method:"GET",url:"shop/goods/unloading",params:e})}function m(e){return r["a"].request({method:"POST",url:"shop/order/deliverGoods",data:e})}function g(e){return r["a"].request({method:"GET",url:"shop/refund/exchangeGoods",params:e})}function b(e){return r["a"].request({method:"POST",url:"shop/refund/examine",data:e})}function f(e){return r["a"].request({method:"POST",url:"shop/evaluation/reply",data:e})}}}]);
|