1 line
4.5 KiB
JavaScript
1 line
4.5 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-6b8f76da"],{"283f":function(e,t,l){"use strict";l.r(t);var i=function(){var e=this,t=e.$createElement,l=e._self._c||t;return l("div",{staticClass:"divBox"},[l("div",[l("el-form",{attrs:{inline:"",size:"small"},nativeOn:{submit:function(e){e.preventDefault()}}},[l("el-form-item",[l("el-input",{staticClass:"selWidth",attrs:{placeholder:"请输入商品名称,关键字,产品编号",clearable:"",size:"small"},model:{value:e.tableFrom.keyword,callback:function(t){e.$set(e.tableFrom,"keyword",t)},expression:"tableFrom.keyword"}})],1),e._v(" "),l("el-form-item",[l("el-button",{attrs:{type:"primary",size:"small"},on:{click:e.getList}},[e._v("查询")])],1)],1)],1),e._v(" "),l("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],ref:"multipleSelection",attrs:{data:e.tableData.data,size:"small","highlight-current-row":"","row-key":function(e){return e.id}},on:{"selection-change":e.handleSelectionChange}},[l("el-table-column",{attrs:{type:"selection",width:"55"}}),e._v(" "),l("el-table-column",{attrs:{prop:"broadcast_goods_id",label:"ID","min-width":"50"}}),e._v(" "),l("el-table-column",{attrs:{label:"商品图","min-width":"80"},scopedSlots:e._u([{key:"default",fn:function(e){return[l("div",{staticClass:"demo-image__preview"},[l("el-image",{staticStyle:{width:"36px",height:"36px"},attrs:{src:e.row.cover_img,"preview-src-list":[e.row.cover_img]}})],1)]}}])}),e._v(" "),l("el-table-column",{attrs:{prop:"name",label:"商品名称","min-width":"200"}})],1),e._v(" "),l("div",{staticClass:"block mb20"},[l("el-pagination",{attrs:{"page-size":e.tableFrom.limit,"current-page":e.tableFrom.page,layout:"prev, pager, next, jumper",total:e.tableData.total},on:{"size-change":e.handleSizeChange,"current-change":e.pageChange}})],1)],1)},a=[],n=(l("ac6a"),l("b7be")),o=l("83d6"),s={name:"GoodList",data:function(){return{templateRadio:0,merCateList:[],roterPre:o["roterPre"],listLoading:!0,tableData:{data:[],total:0},tableFrom:{page:1,limit:20,status_tag:1,keyword:"",mer_valid:1},multipleSelectionAll:window.form_create_helper.get(this.$route.query.field)||[],multipleSelection:[],checked:[],broadcast_room_id:""}},mounted:function(){this.getList();var e=[];this.multipleSelectionAll=e,form_create_helper.onOk(this.unloadHandler)},methods:{unloadHandler:function(){this.multipleSelectionAll.length>0?this.$route.query.field&&(form_create_helper.set(this.$route.query.field,this.multipleSelectionAll.map((function(e){return{id:e.product_id,src:e.cover_img}}))),console.log(this.multipleSelectionAll),localStorage.setItem("broadcastPro",JSON.stringify(this.multipleSelectionAll))):this.$message.warning("请先选择商品")},handleSelectionChange:function(e){var t=this;this.multipleSelection=e,this.multipleSelectionAll=e,setTimeout((function(){t.changePageCoreRecordData()}),50)},setSelectRow:function(){if(this.multipleSelectionAll&&!(this.multipleSelectionAll.length<=0)){var e=this.idKey,t=[];this.multipleSelectionAll.forEach((function(l){t.push(l[e])})),this.$refs.table.clearSelection();for(var l=0;l<this.tableData.data.length;l++)t.indexOf(this.tableData.data[l][e])>=0&&this.$refs.table.toggleRowSelection(this.tableData.data[l],!0)}},changePageCoreRecordData:function(){var e=this.idKey,t=this;if(this.multipleSelectionAll.length<=0)this.multipleSelectionAll=this.multipleSelection;else{var l=[];this.multipleSelectionAll.forEach((function(t){l.push(t[e])}));var i=[];this.multipleSelection.forEach((function(a){i.push(a[e]),l.indexOf(a[e])<0&&t.multipleSelectionAll.push(a)}));var a=[];this.tableData.data.forEach((function(t){i.indexOf(t[e])<0&&a.push(t[e])})),a.forEach((function(i){if(l.indexOf(i)>=0)for(var a=0;a<t.multipleSelectionAll.length;a++)if(t.multipleSelectionAll[a][e]==i){t.multipleSelectionAll.splice(a,1);break}}))}},getList:function(){var e=this;this.listLoading=!0,Object(n["k"])(this.tableFrom).then((function(t){e.tableData.data=[],e.tableData.data=t.data.list,e.tableData.total=t.data.count,e.$nextTick((function(){this.setSelectRow()})),e.listLoading=!1})).catch((function(t){e.listLoading=!1,e.$message.error(t.message)}))},pageChange:function(e){this.changePageCoreRecordData(),this.tableFrom.page=e,this.getList()},handleSizeChange:function(e){this.changePageCoreRecordData(),this.tableFrom.limit=e,this.getList()}}},r=s,c=(l("991b"),l("2877")),u=Object(c["a"])(r,i,a,!1,null,"c8ee86a4",null);t["default"]=u.exports},"481b0":function(e,t,l){},"991b":function(e,t,l){"use strict";l("481b0")}}]); |