zx/public/mer/js/chunk-2d2217d4.db9d1e53.js

1 line
6.0 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d2217d4"],{cb21:function(e,t,i){"use strict";i.r(t);var l=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"divBox"},[i("div",{staticClass:"container"},[i("el-form",{attrs:{size:"small",inline:"","label-width":"85px"}},[i("el-form-item",{attrs:{label:"商品分类:"}},[i("el-select",{staticClass:"dialogWidth",attrs:{placeholder:"请选择",clearable:""},on:{change:function(t){return e.getList(1)}},model:{value:e.tableFrom.mer_cate_id,callback:function(t){e.$set(e.tableFrom,"mer_cate_id",t)},expression:"tableFrom.mer_cate_id"}},e._l(e.merCateList,(function(e){return i("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),e._v(" "),i("el-form-item",{attrs:{label:"商品搜索:"}},[i("el-input",{staticClass:"dialogWidth",attrs:{placeholder:"请输入商品名称,关键字",clearable:"",size:"small"},on:{change:function(t){return e.getList(1)}},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.getList(1)}},model:{value:e.tableFrom.keyword,callback:function(t){e.$set(e.tableFrom,"keyword",t)},expression:"tableFrom.keyword"}})],1),e._v(" "),i("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(t){return e.getList(1)}}},[e._v("查询")])],1)],1),e._v(" "),i("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],ref:"table",attrs:{data:e.tableData.data,size:"small","highlight-current-row":""},on:{"selection-change":e.handleSelectionChange}},["1"==e.singleChoice?i("el-table-column",{attrs:{width:"50"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-radio",{attrs:{label:t.row.product_id},nativeOn:{change:function(i){return e.getTemplateRow(t.row)}},model:{value:e.templateRadio,callback:function(t){e.templateRadio=t},expression:"templateRadio"}},[e._v(" ")])]}}],null,!1,3465899556)}):i("el-table-column",{attrs:{type:"selection",width:"55"}}),e._v(" "),i("el-table-column",{attrs:{prop:"product_id",label:"ID","min-width":"50"}}),e._v(" "),i("el-table-column",{attrs:{label:"商品图","min-width":"80"},scopedSlots:e._u([{key:"default",fn:function(e){return[i("div",{staticClass:"demo-image__preview"},[i("el-image",{staticStyle:{width:"36px",height:"36px"},attrs:{src:e.row.image,"preview-src-list":[e.row.image]}})],1)]}}])}),e._v(" "),i("el-table-column",{attrs:{prop:"store_name",label:"商品名称","min-width":"200"}})],1),e._v(" "),i("div",[i("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=(i("ac6a"),i("c4c8")),o=i("83d6"),r={name:"GoodList",data:function(){return{templateRadio:0,idKey:"product_id",merCateList:[],roterPre:o["roterPre"],listLoading:!0,tableData:{data:[],total:0},tableFrom:{page:1,limit:6,mer_cate_id:"",type:"1",is_gift_bag:"",cate_id:"",store_name:"",keyword:""},checked:[],multipleSelection:[],multipleSelectionAll:window.form_create_helper.get(this.$route.query.field)||[],nextPageFlag:!1,singleChoice:0,singleSelection:{}}},mounted:function(){var e=this;if(this.singleChoice=sessionStorage.getItem("singleChoice"),this.getList(""),this.getCategorySelect(),1!=this.singleChoice){var t=window.form_create_helper.get(this.$route.query.field).map((function(e){return{product_id:e.id,image:e.src}}))||[];this.multipleSelectionAll=t}form_create_helper.onOk((function(){e.unloadHandler()}))},destroyed:function(){sessionStorage.setItem("singleChoice",0)},methods:{getTemplateRow:function(e){this.singleSelection={src:e.image,id:e.product_id}},unloadHandler:function(){1!=this.singleChoice?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.image}}))):this.$message.warning("请先选择商品"):this.singleSelection&&this.singleSelection.src&&this.singleSelection.id?this.$route.query.field&&form_create_helper.set(this.$route.query.field,this.singleSelection):this.$message.warning("请先选择商品")},handleSelectionChange:function(e){var t=this;this.multipleSelection=e,setTimeout((function(){t.changePageCoreRecordData()}),50)},setSelectRow:function(){if(this.multipleSelectionAll&&!(this.multipleSelectionAll.length<=0)){var e=this.idKey,t=[];this.multipleSelectionAll.forEach((function(i){t.push(i[e])})),this.$refs.table.clearSelection();for(var i=0;i<this.tableData.data.length;i++)t.indexOf(this.tableData.data[i][e])>=0&&this.$refs.table.toggleRowSelection(this.tableData.data[i],!0)}},changePageCoreRecordData:function(){var e=this.idKey,t=this;if(this.multipleSelectionAll.length<=0)this.multipleSelectionAll=this.multipleSelection;else{var i=[];this.multipleSelectionAll.forEach((function(t){i.push(t[e])}));var l=[];this.multipleSelection.forEach((function(a){l.push(a[e]),i.indexOf(a[e])<0&&t.multipleSelectionAll.push(a)}));var a=[];this.tableData.data.forEach((function(t){l.indexOf(t[e])<0&&a.push(t[e])})),a.forEach((function(l){if(i.indexOf(l)>=0)for(var a=0;a<t.multipleSelectionAll.length;a++)if(t.multipleSelectionAll[a][e]==l){t.multipleSelectionAll.splice(a,1);break}}))}},getCategorySelect:function(){var e=this;Object(n["u"])().then((function(t){e.merCateList=t.data})).catch((function(t){e.$message.error(t.message)}))},getList:function(e){var t=this;this.listLoading=!0,this.tableFrom.page=e||this.tableFrom.page,Object(n["lb"])(this.tableFrom).then((function(e){t.tableData.data=e.data.list,t.tableData.total=e.data.count,t.$nextTick((function(){this.setSelectRow()})),t.listLoading=!1})).catch((function(e){t.listLoading=!1,t.$message.error(e.message)}))},pageChange:function(e){this.changePageCoreRecordData(),this.tableFrom.page=e,this.getList("")},handleSizeChange:function(e){this.changePageCoreRecordData(),this.tableFrom.limit=e,this.getList("")}}},s=r,c=i("2877"),u=Object(c["a"])(s,l,a,!1,null,"728a8f2c",null);t["default"]=u.exports}}]);