1 line
34 KiB
JavaScript
1 line
34 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5bad561a"],{"3bbe":function(t,e,n){var a=n("861d");t.exports=function(t){if(!a(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype");return t}},"419d":function(t,e,n){"use strict";var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"body"},[n("el-dialog",{attrs:{title:t.title,visible:t.dialogFormVisible,width:"600px","close-on-click-modal":!1},on:{"update:visible":function(e){t.dialogFormVisible=e},close:t.close}},[n("el-form",{ref:"form",attrs:{model:t.form,"label-width":"120px"}},["name"==t.type?n("el-form-item",{attrs:{label:"商品名称",prop:"name"}},[n("el-input",{attrs:{autocomplete:"off"},model:{value:t.form.name,callback:function(e){t.$set(t.form,"name","string"===typeof e?e.trim():e)},expression:"form.name"}})],1):t._e(),"price"==t.type?n("el-form-item",{attrs:{label:"价格",prop:"price"}},[n("el-input-number",{staticStyle:{width:"300px"},attrs:{precision:2,step:1,min:0},model:{value:t.form.price,callback:function(e){t.$set(t.form,"price",e)},expression:"form.price"}})],1):t._e(),"stock"==t.type?n("el-form-item",{attrs:{label:"库存",prop:"stock"}},[n("el-input-number",{staticStyle:{width:"300px"},attrs:{min:0},model:{value:t.form.stock,callback:function(e){t.$set(t.form,"stock",e)},expression:"form.stock"}})],1):t._e(),"sort"==t.type?n("el-form-item",{attrs:{label:"排序",prop:"sort"}},[n("el-input",{attrs:{autocomplete:"off"},model:{value:t.form.sort,callback:function(e){t.$set(t.form,"sort","string"===typeof e?e.trim():e)},expression:"form.sort"}})],1):t._e()],1),n("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{attrs:{size:"medium"},on:{click:t.close}},[t._v("取 消")]),n("el-button",{attrs:{size:"medium",type:"primary"},on:{click:t.save}},[t._v("确 定")])],1)],1)],1)},r=[],o=(n("b0c0"),n("96cf"),n("1da1")),s=n("5a4a"),i={name:"goodlistedit",created:function(){},data:function(){return{form:{name:"",price:"",stock:"",sort:""},type:"",title:"",dialogFormVisible:!1,storeId:""}},components:{},methods:{showEdit:function(t,e){t?(this.title="编辑",this.form=Object.assign({},t),this.type=e):this.title="添加",this.dialogFormVisible=!0},setStoreId:function(t){this.storeId=t},close:function(){this.$refs["form"].resetFields(),this.form=this.$options.data().form,this.dialogFormVisible=!1},save:function(){var t=this;return Object(o["a"])(regeneratorRuntime.mark((function e(){var n,a,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return n={},"name"==t.type?n={id:t.form.id,name:t.form.name}:"price"==t.type?n={id:t.form.id,price:t.form.price,storeId:t.storeId}:"stock"==t.type?n={id:t.form.id,stock:t.form.stock,storeId:t.storeId}:"sort"==t.type&&(n={id:t.form.id,sort:t.form.sort,storeId:t.storeId}),console.log(n),e.next=5,Object(s["D"])(n);case 5:a=e.sent,r=a.msg,t.$baseMessage(r,"success"),t.$emit("fetchData"),t.close();case 10:case"end":return e.stop()}}),e)})))()}}},c=i,l=n("2877"),u=Object(l["a"])(c,a,r,!1,null,null,null);e["a"]=u.exports},4249:function(t,e,n){},"4cd2":function(t,e,n){},"5a4a":function(t,e,n){"use strict";n.d(e,"B",(function(){return r})),n.d(e,"d",(function(){return o})),n.d(e,"G",(function(){return s})),n.d(e,"z",(function(){return i})),n.d(e,"r",(function(){return c})),n.d(e,"y",(function(){return l})),n.d(e,"W",(function(){return u})),n.d(e,"A",(function(){return d})),n.d(e,"F",(function(){return m})),n.d(e,"D",(function(){return p})),n.d(e,"f",(function(){return f})),n.d(e,"e",(function(){return h})),n.d(e,"g",(function(){return b})),n.d(e,"i",(function(){return g})),n.d(e,"w",(function(){return v})),n.d(e,"ab",(function(){return w})),n.d(e,"o",(function(){return y})),n.d(e,"Z",(function(){return _})),n.d(e,"C",(function(){return k})),n.d(e,"H",(function(){return x})),n.d(e,"q",(function(){return O})),n.d(e,"c",(function(){return j})),n.d(e,"h",(function(){return I})),n.d(e,"b",(function(){return C})),n.d(e,"u",(function(){return N})),n.d(e,"N",(function(){return $})),n.d(e,"m",(function(){return R})),n.d(e,"L",(function(){return D})),n.d(e,"x",(function(){return S})),n.d(e,"db",(function(){return P})),n.d(e,"j",(function(){return M})),n.d(e,"cb",(function(){return E})),n.d(e,"t",(function(){return T})),n.d(e,"J",(function(){return V})),n.d(e,"l",(function(){return F})),n.d(e,"I",(function(){return z})),n.d(e,"v",(function(){return A})),n.d(e,"S",(function(){return G})),n.d(e,"n",(function(){return q})),n.d(e,"R",(function(){return L})),n.d(e,"bb",(function(){return W})),n.d(e,"E",(function(){return H})),n.d(e,"s",(function(){return J})),n.d(e,"X",(function(){return U})),n.d(e,"T",(function(){return X})),n.d(e,"Y",(function(){return Y})),n.d(e,"V",(function(){return B})),n.d(e,"Q",(function(){return K})),n.d(e,"k",(function(){return Q})),n.d(e,"M",(function(){return Z})),n.d(e,"a",(function(){return tt})),n.d(e,"K",(function(){return et})),n.d(e,"U",(function(){return nt})),n.d(e,"P",(function(){return at})),n.d(e,"p",(function(){return rt})),n.d(e,"O",(function(){return ot}));var a=n("b775");function r(t){return Object(a["a"])({url:"channel/good/good-render",method:"get",params:t})}function o(t){return Object(a["a"])({url:"channel/good/attr-show",method:"get",params:t})}function s(t){return Object(a["a"])({url:"channel/good/goods-save",method:"post",data:t})}function i(t){return Object(a["a"])({url:"channel/good/good-detail",method:"get",params:t})}function c(t){return Object(a["a"])({url:"channel/good/get-good-list",method:"get",params:t})}function l(t){return Object(a["a"])({url:"channel/good/good-del",method:"post",data:t})}function u(t){return Object(a["a"])({url:"channel/good/set-good-num",method:"post",data:t})}function d(t){return Object(a["a"])({url:"channel/good/good-down",method:"post",data:t})}function m(t){return Object(a["a"])({url:"channel/good/goods-recovery",method:"post",data:t})}function p(t){return Object(a["a"])({url:"channel/good/good-usave",method:"post",data:t})}function f(t){return Object(a["a"])({url:"channel/category/get-category-list",method:"get",params:t})}function h(t){return Object(a["a"])({url:"channel/category/category-del",method:"post",data:t})}function b(t){return Object(a["a"])({url:"channel/category/category-save",method:"post",data:t})}function g(t){return Object(a["a"])({url:"channel/category/change-switch",method:"post",data:t})}function v(t){return Object(a["a"])({url:"channel/specs/get-specs-list",method:"get",params:t})}function w(t){return Object(a["a"])({url:"channel/specs/specs-save",method:"post",data:t})}function y(t){return Object(a["a"])({url:"channel/specs/change-specs",method:"post",data:t})}function _(t){return Object(a["a"])({url:"channel/specs/specs-del",method:"post",data:t})}function k(t){return Object(a["a"])({url:"channel/good/specs-list",method:"post",data:t})}function x(t){return Object(a["a"])({url:"channel/good/specs-save",method:"post",data:t})}function O(t){return Object(a["a"])({url:"channel/attribute/get-attr-list",method:"get",params:t})}function j(t){return Object(a["a"])({url:"channel/attribute/attr-save",method:"post",data:t})}function I(t){return Object(a["a"])({url:"channel/attribute/change-attr",method:"post",data:t})}function C(t){return Object(a["a"])({url:"channel/attribute/attr-del",method:"post",data:t})}function N(t){return Object(a["a"])({url:"channel/material/get-materia-list",method:"get",params:t})}function $(t){return Object(a["a"])({url:"channel/material/meteria-save",method:"post",data:t})}function R(t){return Object(a["a"])({url:"channel/material/change-materia",method:"post",data:t})}function D(t){return Object(a["a"])({url:"channel/material/materia-del",method:"post",data:t})}function S(t){return Object(a["a"])({url:"channel/unit/get-unit-list",method:"get",params:t})}function P(t){return Object(a["a"])({url:"channel/unit/unit-save",method:"post",data:t})}function M(t){return Object(a["a"])({url:"channel/unit/change-display",method:"post",data:t})}function E(t){return Object(a["a"])({url:"channel/unit/unit-del",method:"post",data:t})}function T(t){return Object(a["a"])({url:"channel/good-label/get-label-list",method:"get",params:t})}function V(t){return Object(a["a"])({url:"channel/good-label/label-save",method:"post",data:t})}function F(t){return Object(a["a"])({url:"channel/good-label/change-label",method:"post",data:t})}function z(t){return Object(a["a"])({url:"channel/good-label/label-del",method:"post",data:t})}function A(t){return Object(a["a"])({url:"channel/print/get-print-list",method:"get",params:t})}function G(t){return Object(a["a"])({url:"channel/print/print-save",method:"post",data:t})}function q(t){return Object(a["a"])({url:"channel/print/change-print",method:"post",data:t})}function L(t){return Object(a["a"])({url:"channel/print/print-del",method:"post",data:t})}function W(t){return Object(a["a"])({url:"channel/good/synchro-goods",method:"post",data:t})}function H(t){return Object(a["a"])({url:"channel/activity/goods-activity-list",method:"get",params:t})}function J(t){return Object(a["a"])({url:"channel/activity/save-goods-activity",method:"get",params:t})}function U(t){return Object(a["a"])({url:"channel/activity/save-goods-activity",method:"post",data:t})}function X(t){return Object(a["a"])({url:"channel/activity/modify-goods-activity",method:"post",data:t})}function Y(t){return Object(a["a"])({url:"channel/category/special-category",method:"get",params:t})}function B(t){return Object(a["a"])({url:"channel/category/save-special",method:"post",data:t})}function K(t){return Object(a["a"])({url:"channel/category/modify-special",method:"post",data:t})}function Q(t){return Object(a["a"])({url:"channel/good/change-goods",method:"post",data:t})}function Z(t){return Object(a["a"])({url:"channel/good/merge-goods",method:"post",data:t})}function tt(t){return Object(a["a"])({url:"channel/good/all-down",method:"post",data:t})}function et(t){return Object(a["a"])({url:"channel/comment/label-list",method:"get",params:t})}function nt(t){return Object(a["a"])({url:"channel/comment/save-label",method:"post",data:t})}function at(t){return Object(a["a"])({url:"channel/comment/modify-label",method:"post",data:t})}function rt(t){return Object(a["a"])({url:"channel/comment/comment-list",method:"get",params:t})}function ot(t){return Object(a["a"])({url:"channel/comment/modify-comment",method:"post",data:t})}},"6cce":function(t,e,n){"use strict";var a=n("4cd2"),r=n.n(a);r.a},7156:function(t,e,n){var a=n("861d"),r=n("d2bb");t.exports=function(t,e,n){var o,s;return r&&"function"==typeof(o=e.constructor)&&o!==n&&a(s=o.prototype)&&s!==n.prototype&&r(t,s),t}},"71e3":function(t,e,n){"use strict";var a=n("4249"),r=n.n(a);r.a},9945:function(t,e,n){"use strict";n.r(e);var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"outmain ba_f"},[n("el-tabs",{attrs:{type:"card"},on:{"tab-click":t.handleTabClick2},model:{value:t.activeName2,callback:function(e){t.activeName2=e},expression:"activeName2"}},[n("el-tab-pane",{attrs:{label:"外卖商品",name:"1"}}),"3"==t.storeData.goodsModel?n("el-tab-pane",{attrs:{label:"外卖商品分类",name:"2"}}):t._e()],1),t._m(0),n("el-tabs",{on:{"tab-click":t.handleTabClick},model:{value:t.activeName,callback:function(e){t.activeName=e},expression:"activeName"}},[n("el-tab-pane",{attrs:{label:"已上架",name:"1"}},[n("span",{attrs:{slot:"label"},slot:"label"},[t._v("已上架("+t._s(""==t.allTotal?0:t.allTotal)+")")])]),n("el-tab-pane",{attrs:{label:"库存不足",name:"2"}},[n("span",{attrs:{slot:"label"},slot:"label"},[t._v("库存不足("+t._s(""==t.noStock?0:t.noStock)+")")])]),n("el-tab-pane",{attrs:{label:"库存不足",name:"5"}},[n("span",{attrs:{slot:"label"},slot:"label"},[t._v("已售罄("+t._s(""==t.sellOutTotal?0:t.sellOutTotal)+")")])]),n("el-tab-pane",{attrs:{label:"已下架",name:"3"}},[n("span",{attrs:{slot:"label"},slot:"label"},[t._v("已下架("+t._s(""==t.errDisplay?0:t.errDisplay)+")")])]),n("el-tab-pane",{attrs:{label:"待上架",name:"4"}},[n("span",{attrs:{slot:"label"},slot:"label"},[t._v("待上架("+t._s(""==t.noDisplay?0:t.noDisplay)+")")])]),n("el-tab-pane",{attrs:{label:"回收站",name:"6"}},[n("span",{attrs:{slot:"label"},slot:"label"},[t._v("回收站("+t._s(""==t.recycleTotal?0:t.recycleTotal)+")")])])],1),n("div",{staticClass:"content ba_f"},[n("div",{staticClass:"flex-bet pad_20"},[n("div",[n("el-form",{staticClass:"demo-form-inline searchform",attrs:{inline:!0,model:t.formInline}},[n("div",[n("el-form-item",{attrs:{label:"商品名称"}},[n("el-input",{attrs:{size:"medium",placeholder:"请输入商品名称"},on:{input:t.onSearch},model:{value:t.formInline.name,callback:function(e){t.$set(t.formInline,"name",e)},expression:"formInline.name"}})],1),n("el-form-item",{attrs:{label:"商品分类"}},[n("el-select",{attrs:{clearable:"",placeholder:"请选择分类"},on:{change:t.onSearch},model:{value:t.formInline.typePid,callback:function(e){t.$set(t.formInline,"typePid",e)},expression:"formInline.typePid"}},t._l(t.typeOptions,(function(t){return n("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})})),1)],1),n("el-form-item",[n("el-button",{attrs:{size:"medium"},on:{click:t.onSearch}},[t._v("搜索")])],1)],1)])],1),n("div",{staticClass:"flex"},[n("ul",{directives:[{name:"show",rawName:"v-show",value:"6"!=t.activeName,expression:"activeName!='6'"}],staticClass:"flex tablebtn mar_r40"},[n("li",{staticClass:"t_btn bor_dd curs"},[n("el-button",{attrs:{size:"medium"},on:{click:function(e){return t.handleGoodEdit("row","1")}}},[t._v("沽清")])],1),n("li",{staticClass:"t_btn bor_dd curs"},[n("el-button",{attrs:{size:"medium"},on:{click:function(e){return t.handleGoodEdit("row","2")}}},[t._v("置满")])],1),n("li",{staticClass:"t_btn bor_dd curs"},[n("el-button",{attrs:{size:"medium"},on:{click:function(e){return t.handlexgkc()}}},[t._v("修改库存")])],1),n("li",{staticClass:"t_btn bor_dd curs"},[n("el-button",{attrs:{size:"medium"},on:{click:function(e){return t.goodDown("row",2)}}},[t._v("上架")])],1),n("li",{staticClass:"t_btn bor_dd curs"},[n("el-button",{attrs:{size:"medium"},on:{click:function(e){return t.goodDown("row",1)}}},[t._v("下架")])],1)]),t.goodsModel>2?n("div",[n("el-button",{attrs:{size:"medium"},on:{click:t.handleDelete}},[t._v("批量删除")]),n("el-button",{attrs:{type:"primary",size:"medium"},on:{click:t.addgood}},[t._v("添加商品")])],1):t._e()])]),n("div",{staticClass:"tabledata"},[n("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],staticStyle:{width:"100%"},attrs:{"element-loading-text":t.elementLoadingText,data:t.list,stripe:""},on:{"selection-change":t.setSelectRows}},[n("el-table-column",{attrs:{type:"selection",width:"55",selectable:t.handleSelection}}),n("el-table-column",{attrs:{prop:"id",label:"商品ID",width:"100"}}),n("el-table-column",{attrs:{prop:"name",label:"商品名称",width:"390"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",{staticClass:"flex flex-y-top"},[n("div",{},[n("img",{staticClass:"goodlogo bor_rad5",attrs:{src:e.row.icon}})]),n("div",{staticClass:"mar_l10"},[n("div",{staticClass:"flex bixuan"},[n("div",{staticClass:"flex"},[t._v(t._s(e.row.name))]),t.goodsModel>2?n("span",{staticClass:"el-icon-edit-outline curs subjectcolor2",on:{click:function(n){return t.handleEdit(e.row,"name")}}}):t._e(),n("el-tag",{directives:[{name:"show",rawName:"v-show",value:"1"==e.row.isRecommend,expression:"scope.row.isRecommend=='1'"}],staticClass:"mar_l10",attrs:{size:"medium",type:"danger"}},[t._v("推荐")])],1),n("div",{staticClass:"fon_12 color_9 mar_t5 flex bixuan"},[t._v(" 销量:"+t._s(e.row.salesNum)+" ")])])])]}}])}),n("el-table-column",{attrs:{prop:"category_name",label:"商品分类"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",{staticClass:"flex"},[n("p",[n("el-tag",{attrs:{size:"medium",type:"info"}},[t._v(t._s(e.row.category_name))])],1)])]}}])}),n("el-table-column",{attrs:{prop:"price",label:"价格"},scopedSlots:t._u([{key:"default",fn:function(e){return["2"==e.row.isSpecs?n("div",[t._v(" ¥"+t._s(e.row.price)+" "),t.goodsModel>1&&"6"!=t.activeName?n("el-button",{staticClass:"el-icon-edit-outline",attrs:{type:"text"},on:{click:function(n){return t.handleEdit(e.row,"price")}}}):t._e()],1):n("div",[t._v(" "+t._s(e.row.price)+"~"+t._s(e.row.maxPrice)+" "),t.goodsModel>1&&"6"!=t.activeName?n("el-button",{staticClass:"el-icon-edit-outline",attrs:{type:"text"},on:{click:function(n){return t.handleGoodSpec(e.row,"dPrice")}}}):t._e()],1)]}}])}),n("el-table-column",{attrs:{prop:"stock",label:"库存"},scopedSlots:t._u([{key:"default",fn:function(e){return["2"==e.row.isSpecs&&"6"!=t.activeName?n("div",{staticClass:"flex"},[n("div",{staticClass:"mar_r5"},[t._v(" "+t._s(e.row.stock))]),n("el-button",{staticClass:"el-icon-edit-outline",attrs:{type:"text"},on:{click:function(n){return t.handleEdit(e.row,"stock")}}}),n("el-button",{staticClass:"color_6",attrs:{type:"text"},on:{click:function(n){return t.handleGoodEdit(e.row,"1")}}},[t._v("估清 ")]),n("el-button",{staticClass:"color_6",attrs:{type:"text"},on:{click:function(n){return t.handleGoodEdit(e.row,"2")}}},[t._v("置满 ")])],1):n("div",[t._v(" 多规格 "),"6"!=t.activeName?n("el-button",{staticClass:"color_6 mar_l10",attrs:{type:"text"},on:{click:function(n){return t.handleGoodSpec(e.row,"dStock")}}},[t._v("库存管理 ")]):t._e()],1)]}}])}),n("el-table-column",{attrs:{label:"操作"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",{directives:[{name:"show",rawName:"v-show",value:"6"!=t.activeName,expression:"activeName!='6'"}],staticClass:"flex"},["3"==t.goodsModel?n("el-button",{attrs:{type:"text"},on:{click:function(n){return t.editGood(e.row)}}},[t._v("编辑")]):t._e(),n("el-button",{directives:[{name:"show",rawName:"v-show",value:"1"==e.row.display,expression:"scope.row.display=='1'"}],attrs:{type:"text"},on:{click:function(n){return t.goodDown(e.row,1)}}},[t._v(" 下架 ")]),n("el-button",{directives:[{name:"show",rawName:"v-show",value:"2"==e.row.display||"3"==e.row.display,expression:"scope.row.display=='2' || scope.row.display=='3'"}],attrs:{type:"text",disabled:"2"==e.row.mainDisplay&&"2"==e.row.display},on:{click:function(n){return t.goodDown(e.row,2)}}},[t._v(" 上架 ")]),n("el-dropdown",{directives:[{name:"show",rawName:"v-show",value:"3"==t.goodsModel,expression:"goodsModel=='3'"}]},[n("span",{staticClass:"curs subjectcolor2 mar_l10"},[t._v(" 更多"),n("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),n("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[n("el-dropdown-item",{directives:[{name:"show",rawName:"v-show",value:"2"==e.row.isRecommend,expression:"scope.row.isRecommend=='2'"}]},[n("el-button",{attrs:{type:"text"},on:{click:function(n){return t.handleRecommend(e.row,2)}}},[t._v("商品推荐 ")])],1),n("el-dropdown-item",{directives:[{name:"show",rawName:"v-show",value:"1"==e.row.isRecommend,expression:"scope.row.isRecommend=='1'"}]},[n("el-button",{attrs:{type:"text"},on:{click:function(n){return t.handleRecommend(e.row,1)}}},[t._v("取消推荐 ")])],1),n("el-dropdown-item",[n("el-button",{attrs:{type:"text"},on:{click:function(n){return t.handleDelete(e.row)}}},[t._v("商品删除")])],1)],1)],1)],1),n("el-button",{directives:[{name:"show",rawName:"v-show",value:"6"==t.activeName&&"3"==t.goodsModel,expression:"activeName=='6' && goodsModel=='3'"}],attrs:{type:"text"},on:{click:function(n){return t.goodRecovery(e.row)}}},[t._v(" 恢复 ")]),n("el-button",{directives:[{name:"show",rawName:"v-show",value:"6"==t.activeName,expression:"activeName=='6'"}],attrs:{type:"text"},on:{click:function(n){return t.handleDelete(e.row)}}},[t._v(" 删除 ")])]}}])})],1),n("el-dialog",{attrs:{title:"批量修改库存",visible:t.dialogVisible,width:"30%"},on:{"update:visible":function(e){t.dialogVisible=e}}},[n("div",[n("el-input",{attrs:{type:"number",autocomplete:"off"},model:{value:t.plkc,callback:function(e){t.plkc="string"===typeof e?e.trim():e},expression:"plkc"}})],1),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:function(e){t.dialogVisible=!1}}},[t._v("取 消")]),n("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.qrplxg()}}},[t._v("确 定")])],1)]),n("el-pagination",{attrs:{background:"",layout:"prev, pager, next",total:t.page.total,"page-size":t.page.pagesize,"current-page":t.page.currentPage},on:{"update:currentPage":function(e){return t.$set(t.page,"currentPage",e)},"update:current-page":function(e){return t.$set(t.page,"currentPage",e)},"current-change":t.handleCurrentChange}}),n("edit",{ref:"edit",on:{fetchData:t.fetchData}}),n("specs",{ref:"specs",on:{fetchData:t.fetchData}})],1)])],1)},r=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"shuju_title mar_b20 mar_t20"},[n("div",{staticClass:"shuju_title_text"},[n("span",[t._v("商品列表")])])])}],o=(n("99af"),n("d81d"),n("b0c0"),n("a9e3"),n("96cf"),n("1da1")),s=n("5530"),i=n("419d"),c=n("e6b2"),l=n("5a4a"),u=n("2f62"),d={name:"goodlist",components:{Edit:i["a"],Specs:c["a"]},computed:Object(s["a"])({},Object(u["d"])(["storeId","storeData"])),created:function(){this.$route.query.currentPage||this.$route.query.activeName?(this.page.currentPage=+this.$route.query.currentPage,this.activeName=this.$route.query.activeName?this.$route.query.activeName:"1",this.type=this.$route.query.type?this.$route.query.type:1,this.fetchData()):this.fetchData()},data:function(){return{formInline:{name:"",typePid:""},typeOptions:[],activeName:"1",activeName2:"1",tdHover:!1,list:[],listLoading:!0,selectRows:"",elementLoadingText:"正在加载...",page:{total:0,size:10,currentPage:1},stock:"1",msg:"",display:"1",dialogVisible:!1,plkc:"",allTotal:"",errDisplay:"",noDisplay:"",noStock:"",sellOutTotal:"",goodsModel:"",type:1,recycleTotal:""}},methods:{fetchData:function(){var t=this;return Object(o["a"])(regeneratorRuntime.mark((function e(){var n,a,r,o,s;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return n={page:t.page.currentPage,type:t.type,name:t.formInline.name,typePid:t.formInline.typePid,storeId:t.storeId},t.listLoading=!1,e.next=4,Object(l["r"])(n);case 4:a=e.sent,r=a.data,o=a.count,s=a.msg,t.msg=s,t.list=r.data,t.page.total=o,t.typeOptions=r.categoryData?r.categoryData:[],t.allTotal=r.allTotal?r.allTotal:0,t.errDisplay=r.errDisplay?r.errDisplay:0,t.noDisplay=r.noDisplay?r.noDisplay:0,t.noStock=r.noStock?r.noStock:0,t.sellOutTotal=r.sellOutTotal?r.sellOutTotal:0,t.recycleTotal=r.recycleTotal?r.recycleTotal:0,t.goodsModel=Number(r.goodsModel);case 19:case"end":return e.stop()}}),e)})))()},handleSelection:function(t){return"2"!=t.mainDisplay||"2"!=t.display},onSearch:function(){this.fetchData()},setSelectRows:function(t){this.selectRows=t},handleCurrentChange:function(t){this.page.currentPage=t,this.fetchData()},goodRecovery:function(t){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function n(){var a,r;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,Object(l["F"])({id:t.id,storeId:e.storeId});case 2:a=n.sent,r=a.msg,e.$baseMessage(r,"success"),e.fetchData();case 6:case"end":return n.stop()}}),n)})))()},addgood:function(){var t=this;"无效的门店"==this.msg?this.$baseConfirm2("请完善门店信息",null,"去完善信息",null,Object(o["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:t.$router.push({path:"/storeinformation"});case 1:case"end":return e.stop()}}),e)})))):"请添加商品分类"==this.msg?this.$baseConfirm2("请先添加商品分类",null,"去添加分类",null,Object(o["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:t.$router.push({path:"/goodclassify"});case 1:case"end":return e.stop()}}),e)})))):"请添加商品单位"==this.msg?this.$baseConfirm2("请先添加商品单位",null,"去添加单位",null,Object(o["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:t.$router.push({path:"/goodunit"});case 1:case"end":return e.stop()}}),e)})))):this.$router.push("/storeaddgood1?currentPage=".concat(this.page.currentPage,"&activeName=").concat(this.activeName,"&type=").concat(this.type))},editGood:function(t){this.$router.push("/storeaddgood1?id=".concat(t.id,"¤tPage=").concat(this.page.currentPage,"&activeName=").concat(this.activeName,"&type=").concat(this.type))},handleGoodSpec:function(t,e){this.$refs["specs"].setStoreId(this.storeId),t.id&&this.$refs["specs"].showEdit(t,e)},handleEdit:function(t,e){this.$refs["edit"].setStoreId(this.storeId),t.id&&this.$refs["edit"].showEdit(t,e)},handleTabClick:function(){var t=this;return Object(o["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:t.page.currentPage=1,e.t0=+t.activeName,e.next=1===e.t0?4:2===e.t0?9:3===e.t0?14:4===e.t0?19:5===e.t0?24:6===e.t0?29:34;break;case 4:return t.stock=1,t.display=1,t.type=1,t.fetchData(),e.abrupt("break",34);case 9:return t.stock=0,t.display=1,t.type=2,t.fetchData(),e.abrupt("break",34);case 14:return t.display=2,t.stock=1,t.type=4,t.fetchData(),e.abrupt("break",34);case 19:return t.display=3,t.stock=1,t.type=5,t.fetchData(),e.abrupt("break",34);case 24:return t.display=3,t.stock=1,t.type=3,t.fetchData(),e.abrupt("break",34);case 29:return t.display=3,t.stock=1,t.type=6,t.fetchData(),e.abrupt("break",34);case 34:case"end":return e.stop()}}),e)})))()},handleTabClick2:function(){"1"==this.activeName2?this.$router.push("/storegoodlist"):"2"==this.activeName2&&this.$router.push("/storegoodclassify")},handleDelete:function(t){var e=this;if(t.id){var n=1;"6"==this.activeName&&(n=2),this.$baseConfirm("你确定要删除当前项吗",null,Object(o["a"])(regeneratorRuntime.mark((function a(){var r,o;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.next=2,Object(l["y"])({id:t.id,storeId:e.storeId,type:n});case 2:r=a.sent,o=r.msg,e.$baseMessage(o,"success"),e.fetchData();case 6:case"end":return a.stop()}}),a)}))))}else{if(!(this.selectRows.length>0))return this.$baseMessage("未选中任何行","error"),!1;var a=this.selectRows.map((function(t){return t.id}));this.$baseConfirm("你确定要删除选中项吗",null,Object(o["a"])(regeneratorRuntime.mark((function t(){var n,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(l["y"])({id:a,storeId:e.storeId,type:"6"==e.activeName?2:1});case 2:n=t.sent,r=n.msg,e.$baseMessage(r,"success"),e.fetchData();case 6:case"end":return t.stop()}}),t)}))))}},handlexgkc:function(){if(!(this.selectRows.length>0))return this.$baseMessage("未选中任何行","error"),!1;this.dialogVisible=!0},qrplxg:function(){var t=this;return Object(o["a"])(regeneratorRuntime.mark((function e(){var n,a,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n=t.selectRows.map((function(t){return t.id})),!t.plkc){e.next=11;break}return e.next=4,Object(l["W"])({id:n,num:t.plkc,storeId:t.storeId});case 4:a=e.sent,r=a.msg,t.$baseMessage(r,"success"),t.dialogVisible=!1,t.fetchData(),e.next=13;break;case 11:return t.$baseMessage("未输入内容","error"),e.abrupt("return",!1);case 13:case"end":return e.stop()}}),e)})))()},goodDown:function(t,e){var n,a=this;if(n="1"==e?"下架":"上架",t.id)this.$baseConfirm("你确定要".concat(n,"当前商品吗"),null,Object(o["a"])(regeneratorRuntime.mark((function n(){var r,o;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,Object(l["A"])({id:t.id,display:e,storeId:a.storeId});case 2:r=n.sent,o=r.msg,a.$baseMessage(o,"success"),a.fetchData();case 6:case"end":return n.stop()}}),n)}))));else{if(!(this.selectRows.length>0))return this.$baseMessage("未选中任何行","error"),!1;var r=this.selectRows.map((function(t){return t.id}));this.$baseConfirm("你确定".concat(n,"商品吗"),null,Object(o["a"])(regeneratorRuntime.mark((function t(){var n,o;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(l["A"])({id:r,display:e,storeId:a.storeId});case 2:n=t.sent,o=n.msg,a.$baseMessage(o,"success"),a.fetchData();case 6:case"end":return t.stop()}}),t)}))))}},handleGoodEdit:function(t,e){var n,a=this;if(n="1"==e?"估清":"置满",t.id)this.$baseConfirm("你确定".concat(n,"商品吗"),null,Object(o["a"])(regeneratorRuntime.mark((function n(){var r,o;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,Object(l["W"])({id:t.id,type:e,storeId:a.storeId});case 2:r=n.sent,o=r.msg,a.$baseMessage(o,"success"),a.fetchData();case 6:case"end":return n.stop()}}),n)}))));else{if(!(this.selectRows.length>0))return this.$baseMessage("未选中任何行","error"),!1;var r=this.selectRows.map((function(t){return t.id}));this.$baseConfirm("你确定".concat(n,"商品吗"),null,Object(o["a"])(regeneratorRuntime.mark((function t(){var n,o;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(l["W"])({id:r,type:e,storeId:a.storeId});case 2:n=t.sent,o=n.msg,a.$baseMessage(o,"success"),a.fetchData();case 6:case"end":return t.stop()}}),t)}))))}},handleRecommend:function(t,e){var n,a=this;n="1"==e?"取消推荐":"推荐",t.id&&this.$baseConfirm("你确定要".concat(n,"当前商品吗"),null,Object(o["a"])(regeneratorRuntime.mark((function e(){var n,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(l["A"])({id:t.id,isRecommend:t.isRecommend,storeId:a.storeId});case 2:n=e.sent,r=n.msg,a.$baseMessage(r,"success"),a.fetchData();case 6:case"end":return e.stop()}}),e)}))))},tongjiGood:function(t){this.$router.push("/goodtongji?id=".concat(t.id))}}},m=d,p=(n("71e3"),n("2877")),f=Object(p["a"])(m,a,r,!1,null,null,null);e["default"]=f.exports},a9e3:function(t,e,n){"use strict";var a=n("83ab"),r=n("da84"),o=n("94ca"),s=n("6eeb"),i=n("5135"),c=n("c6b6"),l=n("7156"),u=n("c04e"),d=n("d039"),m=n("7c73"),p=n("241c").f,f=n("06cf").f,h=n("9bf2").f,b=n("58a8").trim,g="Number",v=r[g],w=v.prototype,y=c(m(w))==g,_=function(t){var e,n,a,r,o,s,i,c,l=u(t,!1);if("string"==typeof l&&l.length>2)if(l=b(l),e=l.charCodeAt(0),43===e||45===e){if(n=l.charCodeAt(2),88===n||120===n)return NaN}else if(48===e){switch(l.charCodeAt(1)){case 66:case 98:a=2,r=49;break;case 79:case 111:a=8,r=55;break;default:return+l}for(o=l.slice(2),s=o.length,i=0;i<s;i++)if(c=o.charCodeAt(i),c<48||c>r)return NaN;return parseInt(o,a)}return+l};if(o(g,!v(" 0o1")||!v("0b1")||v("+0x1"))){for(var k,x=function(t){var e=arguments.length<1?0:t,n=this;return n instanceof x&&(y?d((function(){w.valueOf.call(n)})):c(n)!=g)?l(new v(_(e)),n,x):_(e)},O=a?p(v):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),j=0;O.length>j;j++)i(v,k=O[j])&&!i(x,k)&&h(x,k,f(v,k));x.prototype=w,w.constructor=x,s(r,g,x)}},d2bb:function(t,e,n){var a=n("825a"),r=n("3bbe");t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set,t.call(n,[]),e=n instanceof Array}catch(o){}return function(n,o){return a(n),r(o),e?t.call(n,o):n.__proto__=o,n}}():void 0)},e6b2:function(t,e,n){"use strict";var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"body"},[n("el-dialog",{attrs:{title:t.title,visible:t.dialogFormVisible,width:"600px","close-on-click-modal":!1},on:{"update:visible":function(e){t.dialogFormVisible=e},close:t.close}},[n("el-form",{ref:"form",attrs:{model:t.form,"label-width":"60px"}},["dPrice"==t.type?n("el-form-item",{attrs:{label:"",prop:"price"}},t._l(t.dPrice,(function(e,a){return n("div",{key:a,staticClass:"flex wid mar_b10"},[n("div",{staticClass:"t_r flex-g-0 wid20 pad_r_25"},[t._v(t._s(e.specsName))]),n("div",{staticClass:"flex-g-1 wid80"},[n("el-input-number",{staticStyle:{width:"300px"},attrs:{precision:2,step:1,min:0},model:{value:e.SalesPrice,callback:function(n){t.$set(e,"SalesPrice",n)},expression:"item.SalesPrice"}})],1)])})),0):t._e(),"dStock"==t.type?n("el-form-item",{attrs:{label:"",prop:"stock"}},t._l(t.dStock,(function(e,a){return n("div",{key:a,staticClass:"flex wid mar_b10"},[n("div",{staticClass:"t_r flex-g-0 wid20 pad_r_25"},[t._v(t._s(e.specsName))]),n("div",{staticClass:"flex-g-1 wid80"},[n("el-input-number",{staticStyle:{width:"300px"},attrs:{min:0},model:{value:e.SalesStock,callback:function(n){t.$set(e,"SalesStock",n)},expression:"item.SalesStock"}})],1)])})),0):t._e()],1),n("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{attrs:{size:"medium"},on:{click:t.close}},[t._v("取 消")]),n("el-button",{attrs:{size:"medium",type:"primary"},on:{click:t.save}},[t._v("确 定")])],1)],1)],1)},r=[],o=(n("96cf"),n("1da1")),s=n("5a4a"),i={name:"goodlistedit",created:function(){},data:function(){return{form:{name:"",price:"",stock:""},dStock:[{name:"大份",stock:"10"},{name:"中份",stock:"1000"},{name:"小份",stock:"100"}],dPrice:[{name:"大份",stock:"10"},{name:"中份",stock:"1000"},{name:"小份",stock:"100"}],type:"",title:"",dialogFormVisible:!1,storeId:""}},components:{},methods:{showEdit:function(t,e){this.title="编辑",this.form=Object.assign({},t),this.type=e,this.specData(),this.dialogFormVisible=!0},setStoreId:function(t){this.storeId=t},specData:function(){var t=this;return Object(o["a"])(regeneratorRuntime.mark((function e(){var n,a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(s["C"])({id:t.form.id,storeId:t.storeId});case 2:n=e.sent,a=n.data,"dPrice"==t.type&&(t.dPrice=a),"dStock"==t.type&&(t.dStock=a);case 6:case"end":return e.stop()}}),e)})))()},close:function(){this.$refs["form"].resetFields(),this.form=this.$options.data().form,this.dialogFormVisible=!1},save:function(){var t=this;return Object(o["a"])(regeneratorRuntime.mark((function e(){var n,a,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return n={},"dPrice"==t.type?n={id:t.form.id,price:t.dPrice,storeId:t.storeId}:"dStock"==t.type&&(n={id:t.form.id,stock:t.dStock,storeId:t.storeId}),e.next=4,Object(s["H"])(n);case 4:a=e.sent,r=a.msg,t.$baseMessage(r,"success"),t.$emit("fetchData"),t.close();case 9:case"end":return e.stop()}}),e)})))()}}},c=i,l=(n("6cce"),n("2877")),u=Object(l["a"])(c,a,r,!1,null,null,null);e["a"]=u.exports}}]); |