mirror of
https://gitee.com/hzchunfen/erp.git
synced 2025-11-30 22:20:45 +00:00
2 lines
12 KiB
JavaScript
Vendored
2 lines
12 KiB
JavaScript
Vendored
"use strict";(self["webpackChunkerp"]=self["webpackChunkerp"]||[]).push([[555],{9052:function(e,t,i){i.r(t),i.d(t,{default:function(){return m}});var a=function(){var e=this,t=e._self._c;return t("div",{staticClass:"pageBox"},[t("div",{staticClass:"cardBox"},[t("div",{staticClass:"searchBox"},[t("div",{staticClass:"row"},[t("span",[e._v("商品名称:")]),t("el-input",{attrs:{clearable:""},model:{value:e.filter.title,callback:function(t){e.$set(e.filter,"title",t)},expression:"filter.title"}})],1),t("div",{staticClass:"row"},[t("span",[e._v("商品编码:")]),t("el-input",{attrs:{clearable:""},model:{value:e.filter.external_sku_id,callback:function(t){e.$set(e.filter,"external_sku_id",t)},expression:"filter.external_sku_id"}})],1),t("div",{staticClass:"row"},[t("span",[e._v("创建时间:")]),t("el-date-picker",{staticStyle:{width:"340px"},attrs:{type:"datetimerange","range-separator":"-","start-placeholder":"开始时间","end-placeholder":"结束时间","value-format":"yyyy-MM-dd HH:mm:ss"},model:{value:e.addTime,callback:function(t){e.addTime=t},expression:"addTime"}})],1),t("div",{staticClass:"row"},[t("el-button",{attrs:{type:"primary",icon:"el-icon-search"},on:{click:e.handleSearch}},[e._v("筛选")])],1)])]),t("el-card",[t("div",{staticClass:"opaBox"},[t("el-button",{attrs:{type:"primary",icon:"el-icon-plus"},on:{click:e.handleAdd}},[e._v("新增")]),t("el-button",{attrs:{type:"warning",icon:"el-icon-upload2"},on:{click:e.handleImport}},[e._v("导入")])],1),t("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:e.supplierList,border:""}},[t("el-table-column",{attrs:{prop:"id",label:"ID",width:"80",align:"center"}}),t("el-table-column",{attrs:{prop:"goods_sku.name",label:"商品名称"}}),t("el-table-column",{attrs:{prop:"external_sku_id",label:"商品编码"}}),t("el-table-column",{attrs:{prop:"num",label:"数量"}}),t("el-table-column",{attrs:{prop:"cost",label:"成本"}}),t("el-table-column",{attrs:{prop:"buyer_name",label:"采购人姓名"}}),t("el-table-column",{attrs:{prop:"reason",label:"报损原因"}}),t("el-table-column",{attrs:{prop:"phenomenon",label:"报损现象"}}),t("el-table-column",{attrs:{prop:"created_at",label:"创建时间",align:"center"}}),t("el-table-column",{attrs:{label:"操作",width:"120",align:"center"},scopedSlots:e._u([{key:"default",fn:function(i){return[t("el-button",{attrs:{type:"primary",icon:"el-icon-edit",size:"mini"},on:{click:function(t){return e.handleEdit(i.row)}}},[e._v("编辑")])]}}])})],1),t("div",{staticClass:"page-pagination"},[t("el-pagination",{attrs:{"current-page":e.page,"page-sizes":[10,20,50,100],"page-size":e.pageSize,layout:"prev, pager, next, jumper, sizes, total",total:e.total},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}})],1)],1),t("el-dialog",{attrs:{title:"新增",visible:e.dialogVisible,width:"500px"},on:{"update:visible":function(t){e.dialogVisible=t}}},[t("el-form",{attrs:{"label-width":"90px"}},[t("el-form-item",{attrs:{label:"采购人"}},[t("el-select",{ref:"userBatchRef",attrs:{clearable:"",filterable:""},model:{value:e.curInfo.buyer_id,callback:function(t){e.$set(e.curInfo,"buyer_id",t)},expression:"curInfo.buyer_id"}},e._l(e.usersList,(function(e){return t("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1)],1),e._l(e.lossOrders,(function(i,a){return t("div",{key:a,staticClass:"bgBox"},[t("div",{staticClass:"close",on:{click:function(t){return e.delItem(a)}}},[t("i",{staticClass:"el-icon-delete-solid"})]),t("el-form",{attrs:{"label-width":"90px"}},[t("el-form-item",{attrs:{label:"商品编码"}},[t("el-input",{attrs:{clearable:""},model:{value:i.external_sku_id,callback:function(t){e.$set(i,"external_sku_id",t)},expression:"item.external_sku_id"}})],1),t("el-form-item",{attrs:{label:"数量"}},[t("el-input",{attrs:{clearable:""},model:{value:i.num,callback:function(t){e.$set(i,"num",t)},expression:"item.num"}})],1),t("el-form-item",{attrs:{label:"成本"}},[t("el-input",{attrs:{clearable:""},model:{value:i.cost,callback:function(t){e.$set(i,"cost",t)},expression:"item.cost"}})],1),t("el-form-item",{attrs:{label:"报损原因"}},[t("el-input",{attrs:{clearable:""},model:{value:i.reason,callback:function(t){e.$set(i,"reason",t)},expression:"item.reason"}})],1),t("el-form-item",{attrs:{label:"报损现象"}},[t("el-input",{attrs:{clearable:""},model:{value:i.phenomenon,callback:function(t){e.$set(i,"phenomenon",t)},expression:"item.phenomenon"}})],1)],1)],1)})),t("div",{staticClass:"btn",on:{click:function(t){return e.addItem()}}},[t("i",{staticClass:"el-icon-plus"}),e._v("添加标签")]),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.dialogVisible=!1}}},[e._v("取 消")]),t("el-button",{attrs:{type:"primary",loading:e.commitloading},on:{click:e.commitBatchLoss}},[e._v("确 定")])],1)],2),t("el-dialog",{attrs:{title:"编辑",visible:e.editDialog,width:"500px"},on:{"update:visible":function(t){e.editDialog=t}}},[t("el-form",{attrs:{"label-width":"90px"}},[t("el-form-item",{attrs:{label:"商品编码"}},[t("el-input",{attrs:{clearable:""},model:{value:e.curInfo.external_sku_id,callback:function(t){e.$set(e.curInfo,"external_sku_id",t)},expression:"curInfo.external_sku_id"}})],1),t("el-form-item",{attrs:{label:"数量"}},[t("el-input",{attrs:{disabled:""},model:{value:e.curInfo.num,callback:function(t){e.$set(e.curInfo,"num",t)},expression:"curInfo.num"}})],1),t("el-form-item",{attrs:{label:"成本"}},[t("el-input",{attrs:{clearable:""},model:{value:e.curInfo.cost,callback:function(t){e.$set(e.curInfo,"cost",t)},expression:"curInfo.cost"}})],1),t("el-form-item",{attrs:{label:"采购人"}},[t("el-select",{ref:"userRef",attrs:{clearable:"",filterable:""},model:{value:e.curInfo.buyer_id,callback:function(t){e.$set(e.curInfo,"buyer_id",t)},expression:"curInfo.buyer_id"}},e._l(e.usersList,(function(e){return t("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1),t("el-form-item",{attrs:{label:"报损原因"}},[t("el-input",{attrs:{clearable:""},model:{value:e.curInfo.reason,callback:function(t){e.$set(e.curInfo,"reason",t)},expression:"curInfo.reason"}})],1),t("el-form-item",{attrs:{label:"报损现象"}},[t("el-input",{attrs:{clearable:""},model:{value:e.curInfo.phenomenon,callback:function(t){e.$set(e.curInfo,"phenomenon",t)},expression:"curInfo.phenomenon"}})],1)],1),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.dialogVisible=!1}}},[e._v("取 消")]),t("el-button",{attrs:{type:"primary",loading:e.commitloading},on:{click:e.commitEditLoss}},[e._v("确 定")])],1)],1),t("el-dialog",{attrs:{title:"导入",visible:e.showImport,width:"500px"},on:{"update:visible":function(t){e.showImport=t}}},[t("div",{staticStyle:{"text-align":"center"}},[t("el-upload",{staticClass:"upload-demo",attrs:{drag:"",action:"",limit:1,multiple:!1,accept:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel","file-list":e.fileList,"auto-upload":!1,"on-change":e.importFileChange,"on-remove":e.fileRemove}},[t("i",{staticClass:"el-icon-upload"}),t("div",{staticClass:"el-upload__text"},[e._v("将文件拖到此处,或"),t("em",[e._v("点击上传")])])])],1),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.showImport=!1}}},[e._v("取 消")]),t("el-button",{attrs:{type:"primary",loading:e.commitloading},on:{click:e.commitUpload}},[e._v("上 传")])],1)])],1)},l=[],s=(i(560),i(3550)),r=i(9669),o=i.n(r),n=i(2900),c={data(){return{loading:!1,page:1,pageSize:10,total:0,supplierList:[],dialogVisible:!1,curInfo:{},commitloading:!1,filter:{title:"",external_sku_id:""},addTime:[],showImport:!1,fileList:[],usersList:[],lossOrders:[],editDialog:!1}},methods:{fetchList(){this.loading=!0;let e={page:this.page,per_page:this.pageSize,...this.filter,start_time:this.addTime?this.addTime[0]:"",end_time:this.addTime?this.addTime[1]:""};(0,s.Mo)(e).then((e=>{this.supplierList=e.data.data,this.total=e.data.meta.total,this.loading=!1})).catch((()=>{this.loading=!1}))},handleSizeChange(e){this.page=1,this.pageSize=e,this.fetchList()},handleCurrentChange(e){this.page=e,this.fetchList()},handleSearch(){this.page=1,this.fetchList()},handleAdd(){this.curInfo={buyer_id:""},this.lossOrders=[{external_sku_id:"",num:"",cost:"",reason:"",phenomenon:""}],this.dialogVisible=!0},delItem(e){this.lossOrders.splice(e,1)},addItem(){this.lossOrders.push({external_sku_id:"",num:"",cost:"",reason:"",phenomenon:""})},handleEdit(e){this.curInfo=JSON.parse(JSON.stringify(e)),this.dialogVisible=!0},commitBatchLoss(){this.commitloading=!0;let e=[],t={...this.curInfo};t.buyer_name="",t.buyer_id&&(t.buyer_name=this.$refs.userBatchRef.selectedLabel),this.lossOrders.forEach((i=>{e.push({...i,buyer_name:t.buyer_name,buyer_id:t.buyer_id})})),(0,s.oK)({lossOrders:e}).then((e=>{this.page=1,this.fetchList(),this.$message({type:"success",message:"新增成功!"}),this.dialogVisible=!1,this.commitloading=!1})).catch((()=>{this.commitloading=!1}))},commitEditLoss(){this.commitloading=!0;let e={...this.curInfo};e.buyer_name="",e.buyer_id&&(e.buyer_name=this.$refs.userRef.selectedLabel),(0,s.EY)(this.curInfo.id,e).then((e=>{this.fetchList(),this.$message({type:"success",message:"更新成功!"}),this.editDialog=!1,this.commitloading=!1})).catch((()=>{this.commitloading=!1}))},handleImport(){this.fileList=[],this.showImport=!0},importFileChange(e,t){console.log(t),this.fileList=t},fileRemove(){this.fileList=[]},commitUpload(){if(this.fileList.length){this.commitloading=!0;const e=new FormData;e.append("lossFile",this.fileList[0].raw);let t=localStorage.getItem("token");o().post("/api/supplier/loss_record/loss_import",e,{headers:{Authorization:`Bearer ${t}`}}).then((e=>{200===e.status?(this.$message.success("导入成功"),this.page=1,this.fetchList(),this.commitloading=!1,this.showImport=!1):this.commitloading=!1})).catch((()=>{this.commitloading=!1}))}else this.$message.error("请先上传文件")},getUserList(){let e={page:1,per_page:9999};(0,n.Lh)(e).then((e=>{this.usersList=e.data.data}))}},mounted(){this.fetchList(),this.getUserList()}},u=c,d=i(1001),p=(0,d.Z)(u,a,l,!1,null,"c963a484",null),m=p.exports},3550:function(e,t,i){i.d(t,{EY:function(){return m},Fb:function(){return l},GI:function(){return r},JI:function(){return u},Js:function(){return n},Mo:function(){return d},S6:function(){return o},X2:function(){return s},iY:function(){return c},oK:function(){return p},zB:function(){return h},zo:function(){return f}});var a=i(8430);function l(e){return(0,a.Z)({url:"/api/supplier",method:"get",params:e})}function s(e){return(0,a.Z)({url:`/api/supplier/${e}`,method:"delete"})}function r(e){return(0,a.Z)({url:"/api/supplier",method:"post",data:e})}function o(e,t){return(0,a.Z)({url:`/api/supplier/${e}`,method:"patch",data:t})}function n(e){return(0,a.Z)({url:"/api/supplier/purchase_record",method:"get",params:e})}function c(e){return(0,a.Z)({url:"/api/purchase_record/purchase_batch_store",method:"post",data:e})}function u(e,t){return(0,a.Z)({url:`/api/supplier/purchase_record/${e}`,method:"patch",data:t})}function d(e){return(0,a.Z)({url:"/api/supplier/loss_record",method:"get",params:e})}function p(e){return(0,a.Z)({url:"/api/loss_record/loss_batch_store",method:"post",data:e})}function m(e,t){return(0,a.Z)({url:`/api/supplier/loss_record/${e}`,method:"patch",data:t})}function h(e){return(0,a.Z)({url:"/api/supplier/daily_stock_record",method:"get",params:e})}function f(e){return(0,a.Z)({url:"/api/daily_stock_record/inventory_batch_store",method:"post",data:e})}},2900:function(e,t,i){i.d(t,{A0:function(){return u},AX:function(){return n},Lh:function(){return s},RF:function(){return r},Uy:function(){return l},f7:function(){return o},nO:function(){return c}});var a=i(8430);function l(){return(0,a.Z)({url:"/api/roles",method:"get"})}function s(e){return(0,a.Z)({url:"/api/users",method:"get",params:e})}function r(e){return(0,a.Z)({url:"/api/users",method:"post",data:e})}function o(e){return(0,a.Z)({url:`/api/users/${e}`,method:"get"})}function n(e,t){return(0,a.Z)({url:`/api/users/${e}`,method:"patch",data:t})}function c(e){return(0,a.Z)({url:"/api/website_message",method:"get",params:e})}function u(e,t){return(0,a.Z)({url:`/api/website_message/${e}`,method:"patch",data:t})}}}]);
|
|
//# sourceMappingURL=555.238f8a05.js.map
|