mirror of
https://gitee.com/hzchunfen/erp.git
synced 2025-11-30 22:20:45 +00:00
2 lines
8.6 KiB
JavaScript
Vendored
2 lines
8.6 KiB
JavaScript
Vendored
"use strict";(self["webpackChunkerp"]=self["webpackChunkerp"]||[]).push([[651],{8744:function(t,e,a){a.r(e),a.d(e,{default:function(){return u}});var i=function(){var t=this,e=t._self._c;return e("div",{staticClass:"pageBox"},[e("div",{staticClass:"cardBox"},[e("div",{staticClass:"searchBox"},[e("div",{staticClass:"row"},[e("span",[t._v("商品名称:")]),e("el-input",{attrs:{clearable:""},model:{value:t.searchForm.sku_title,callback:function(e){t.$set(t.searchForm,"sku_title",e)},expression:"searchForm.sku_title"}})],1),e("div",{staticClass:"row"},[e("span",[t._v("商品编码:")]),e("el-input",{attrs:{clearable:""},model:{value:t.searchForm.external_sku_id,callback:function(e){t.$set(t.searchForm,"external_sku_id",e)},expression:"searchForm.external_sku_id"}})],1),e("div",{staticClass:"row"},[e("el-button",{attrs:{type:"primary",icon:"el-icon-search"},on:{click:function(e){return t.handleChoose(1)}}},[t._v("筛选")])],1)])]),e("el-card",[e("div",{staticClass:"opaBox"},[e("el-upload",{ref:"myUpload",staticStyle:{display:"inline-block",margin:"0 15px 0 0"},attrs:{action:"/api/combination/goods",multiple:!1,name:"combinationGoods","show-file-list":!1,"on-success":t.uploadSuccess,"before-upload":t.beforeUpload,"on-error":t.uploadError}},[e("el-button",{attrs:{type:"warning",icon:"el-icon-upload2"}},[t._v("组合商品导入")])],1),e("el-button",{attrs:{type:"primary",plain:"",icon:"el-icon-plus"},on:{click:t.addGoodsCombination}},[t._v("新增组合商品")])],1),e("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],ref:"multipleTable",staticClass:"table",staticStyle:{width:"100%"},attrs:{data:t.tableData,"tooltip-effect":"dark",border:"","row-key":"id","tree-props":{children:"children"}}},[e("el-table-column",{attrs:{label:"商品信息",width:"400"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("div",{staticClass:"commodityimg"},[e("img",{staticClass:"Img",attrs:{src:a.row.img_url}})]),e("div",[e("p",[t._v(t._s(a.row.title))]),e("p",[t._v(t._s(a.row.external_sku_id))]),e("p",[t._v(t._s(a.row.updated_at))])])]}}])}),e("el-table-column",{attrs:{prop:"num",label:"组合数量"}}),e("el-table-column",{attrs:{sortable:"",prop:"stock",label:"库存"}}),e("el-table-column",{attrs:{prop:"status",label:"状态"}}),e("el-table-column",{attrs:{label:"操作",width:"130"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("el-button",{attrs:{type:"text"},on:{click:function(e){return t.handleEdit(a.row.id)}}},[t._v("编辑")])]}}])})],1),e("div",{staticClass:"page-pagination"},[e("el-pagination",{attrs:{"current-page":t.current_page,"page-sizes":[15,50,100,150,200],"page-size":t.per_page,layout:"total, sizes, prev, pager, next, jumper",total:t.Paginationdata.total},on:{"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange}})],1)],1),e("el-dialog",{attrs:{title:"新增组合商品",visible:t.dialogVisible},on:{"update:visible":function(e){t.dialogVisible=e}}},[e("el-form",{ref:"dynamicValidateForm",staticClass:"demo-dynamic",attrs:{model:t.dynamicValidateForm,"label-width":"100px"}},[e("el-form-item",{attrs:{label:"商品名称",prop:"title",rules:[{required:!0,message:"请输入商品名称",trigger:"blur"}]}},[e("el-input",{model:{value:t.dynamicValidateForm.title,callback:function(e){t.$set(t.dynamicValidateForm,"title",e)},expression:"dynamicValidateForm.title"}})],1),e("el-form-item",{attrs:{label:"商品编码",prop:"external_sku_id"}},[e("el-input",{model:{value:t.dynamicValidateForm.external_sku_id,callback:function(e){t.$set(t.dynamicValidateForm,"external_sku_id",e)},expression:"dynamicValidateForm.external_sku_id"}})],1),t._l(t.dynamicValidateForm.combination_goods,(function(a,i){return e("el-form-item",{key:a.item_id,attrs:{label:"子商品"+i,prop:"combination_goods."+i+".item_id",rules:{required:!0,message:"子商品不能为空",trigger:"blur"}}},[e("el-col",{attrs:{span:8}},[e("el-select",{attrs:{filterable:"",remote:"","reserve-keyword":"",placeholder:"请选择子商品","remote-method":t.remoteMethod,loading:t.remoteLoading},model:{value:a.item_id,callback:function(e){t.$set(a,"item_id",e)},expression:"item.item_id"}},t._l(t.skus,(function(t){return e("el-option",{key:t.id,attrs:{label:t.title,value:t.id}})})),1)],1),e("el-col",{attrs:{span:2}},[e("el-input",{attrs:{placeholder:"数量"},model:{value:a.item_num,callback:function(e){t.$set(a,"item_num",e)},expression:"item.item_num"}})],1),e("el-button",{attrs:{type:"danger"},on:{click:function(e){return e.preventDefault(),t.removeItem(i)}}},[t._v("删除")])],1)})),e("el-form-item",[e("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.submitForm("dynamicValidateForm")}}},[t._v("提交")]),e("el-button",{on:{click:t.addItem}},[t._v("添加子商品")]),e("el-button",{on:{click:function(e){return t.resetForm("dynamicValidateForm")}}},[t._v("重置")])],1)],2)],1)],1)},o=[],n=(a(560),a(9036)),r={data(){return{dialogVisible:!1,loading:!1,tableData:[],searchForm:{external_sku_id:"",sku_title:""},Paginationdata:{},current_page:1,per_page:100,dynamicValidateForm:{id:0,title:"",external_sku_id:"",combination_goods:[{item_id:"",item_num:1}]},skus:[],remoteLoading:!1}},methods:{handleEdit(t){this.dialogVisible=!0,(0,n.JS)(t).then((t=>{this.dynamicValidateForm=t.data.data,this.skus=t.data.data.skus}))},handleDelete(t){},getList(t){(0,n.CD)(t).then((t=>{this.tableData=t.data.data,this.Paginationdata=t.data.meta,this.currentPage=t.data.meta.current_page,this.per_page=parseInt(t.data.meta.per_page),this.loading=!1}))},handleChoose(){this.searchForm={...this.searchForm,page:this.current_page,per_page:this.per_page},this.getList(this.searchForm)},handleSizeChange(t){this.per_page=t,this.current_page=1,this.handleChoose()},handleCurrentChange(t){this.current_page=t,this.handleChoose()},submitForm(t){this.$refs[t].validate((t=>{if(!t)return!1;(0,n.gM)(this.dynamicValidateForm).then((t=>{this.$message({message:t.data.message,type:"success"}),this.dialogVisible=!1,this.handleCurrentChange(1)}))}))},resetForm(t){this.$refs[t].resetFields()},removeItem(t){this.dynamicValidateForm.combination_goods.splice(t,1)},addItem(){this.dynamicValidateForm.combination_goods.push({item_id:"",item_num:1})},remoteMethod(t){""!==t?(this.remoteLoading=!0,(0,n.no)(t).then((t=>{this.skus=t.data.data,this.remoteLoading=!1}))):this.skus=[]},addGoodsCombination(){this.dialogVisible=!0,this.dynamicValidateForm={id:0,title:"",external_sku_id:"",combination_goods:[{item_id:"",item_num:1}]}},beforeUpload(){this.loadingModule=this.$loading({lock:!0,text:"表格导入中...",spinner:"el-icon-loading",background:"rgba(0, 0, 0, 0.7)"})},uploadSuccess(t){this.$message({message:t.message,type:"success"}),this.loadingModule.close()},uploadError(t){this.$message({message:t.errorMessage,type:"error"}),this.loadingModule.close()}},mounted(){this.handleCurrentChange(1)}},s=r,l=a(1001),d=(0,l.Z)(s,i,o,!1,null,"0bad7cd5",null),u=d.exports},9036:function(t,e,a){a.d(e,{CD:function(){return b},JS:function(){return k},K1:function(){return u},NR:function(){return h},Rq:function(){return n},Vx:function(){return d},b9:function(){return v},cM:function(){return c},e3:function(){return l},gM:function(){return f},lO:function(){return o},no:function(){return _},od:function(){return m},rQ:function(){return r},sx:function(){return g},t5:function(){return s},zl:function(){return p}});var i=a(8430);function o(t){return(0,i.Z)({url:"/api/goods_skus",method:"get",params:t})}function n(t){return(0,i.Z)({url:"/api/goods",method:"post",data:t})}function r(t){return(0,i.Z)({url:`/api/goods_skus/${t}`,method:"get"})}function s(t){return(0,i.Z)({url:"/api/goods",method:"get",params:t})}function l(t,e){return(0,i.Z)({url:`/api/goods_skus/${t}`,method:"patch",data:e})}function d(t){return(0,i.Z)({url:"/api/batch/goods_skus",method:"patch",data:t})}function u(t,e){return(0,i.Z)({url:`/api/single/goods_skus/${t}`,method:"patch",data:e})}function c(t,e){return(0,i.Z)({url:"/api/upload",Headers:e,method:"post",data:t})}function m(t){return(0,i.Z)({url:"/api/goodsList",method:"get",params:t})}function p(t){return(0,i.Z)({url:"/api/goods_sku_location",method:"get",params:t})}function h(t){return(0,i.Z)({url:"/api/goodsSkusList",method:"get",params:{title:t}})}function g(){return(0,i.Z)({url:"/api/stock/goods_skus",method:"get"})}function _(t){return(0,i.Z)({url:"/api/goods/filter/"+t,method:"get"})}function f(t){return(0,i.Z)({url:"/api/goods_combination",method:"post",data:t})}function b(t){return(0,i.Z)({url:"/api/goods_combination",method:"get",params:t})}function k(t){return(0,i.Z)({url:"/api/goods_combination/"+t,method:"get"})}function v(t){return(0,i.Z)({url:"/api/batch/goods_skus",method:"patch",data:t})}}}]);
|
|
//# sourceMappingURL=651.4e5b66ad.js.map
|