chunk-4cd382ae.7d8bece8.js 4.3 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4cd382ae"],{2771:function(e,t,n){},"845d":function(e,t,n){"use strict";n("2771")},fd0a:function(e,t,n){"use strict";n.r(t);var a=function(){var e=this,t=e._self._c;return t("div",{staticClass:"app-list-content"},[t("x-crud",{staticClass:"liu-crud-wrap",on:{load:e.onLoad},scopedSlots:e._u([{key:"slot-tabs",fn:function(){return[t("el-tabs",{staticClass:"liu-tabs",attrs:{type:"border-card"},on:{"tab-click":e.handleClick},model:{value:e.tabIndex,callback:function(t){e.tabIndex=t},expression:"tabIndex"}},e._l(e.tabsData,(function(e,n){return t("el-tab-pane",{key:n,attrs:{label:""+e.text,name:e.key}})})),1)]},proxy:!0},{key:"table-column-mobile",fn:function({scope:n}){return[""!=n.row.mobile?t("span",[e._v(e._s(n.row.mobile))]):t("span",[e._v("-")])]}},{key:"table-column-debtAmount",fn:function({scope:t}){return[e._v(" "+e._s(t.row.debtAmount?parseFloat(t.row.debtAmount):0)+" ")]}},{key:"table-column-location",fn:function({scope:n}){return[1==n.row.location?t("span",{staticStyle:{cursor:"pointer",color:"blue","font-weight":"bold"},on:{click:function(t){return e.modifyLocation(n.row)}}},[e._v("本地")]):t("span",{staticStyle:{cursor:"pointer"},on:{click:function(t){return e.modifyLocation(n.row)}}},[e._v("上游")])]}},{key:"table-column-buyAmount",fn:function({scope:n}){return[t("span",[e._v(e._s(n.row.buyAmount?parseFloat(n.row.buyAmount):0))])]}},{key:"slot-column-option",fn:function({scope:n}){return[t("el-upload",{staticClass:"upload-demo",staticStyle:{display:"inline-block","margin-right":"20px"},attrs:{action:`${e.fileUrl}?id=${n.row.id}`,headers:{token:e.token},multiple:"","show-file-list":!1,"on-success":e.fileUpSuccess,accept:".xls,.xlsx",limit:1}},[t("el-button",{attrs:{size:"small",type:"primary"}},[e._v("导入Excel")])],1),t("el-button",{staticStyle:{"margin-left":"30px"},attrs:{size:"small",type:"primary"},on:{click:function(t){return e.goCg(n.row)}}},[e._v("新增采购")])]}},{key:"slot-top-element",fn:function(){return[t("el-input",{ref:"ghsSearchRef",staticStyle:{width:"400px"},attrs:{placeholder:"搜索供货商",size:"big"},on:{input:function(t){return e.changeText()}},model:{value:e.name,callback:function(t){e.name=t},expression:"name"}})]},proxy:!0}])})],1)},o=[],s=(n("f16c"),n("5880")),i=n("51be"),l={components:{},data(){return{app:null,tabIndex:"0",tabsData:[{text:"供货商",key:"0",val:0}],modalData:{},drapShow:!1,confirmMobile1:"",addPop:!1,name:"",fileUrl:""}},computed:{...Object(s["mapGetters"])({levelData:"level"}),...Object(s["mapGetters"])(["token"])},created(){this.fileUrl=i["baseUrl"]+"/purchase-order/import-create",this.getLevel()},mounted(){this.$nextTick(()=>{this.$refs.ghsSearchRef.focus()})},methods:{...Object(s["mapActions"])(["getLevel"]),fileUpSuccess(e){if(1==e.code){this.$notify({title:"提交成功",message:"success",type:"success"});let e=this;setTimeout(()=>{e.$router.push({path:"/in/list"})},1e3)}else this.$message.error(e.msg)},modifyLocation(e){let t=this;t.$confirm("确认修改类型?","提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(()=>{t.$service.ghs.changeLocation({id:e.id}).then(e=>{t.$message.success("修改成功"),t.app.refresh({type:t.tabIndex,name:t.name})})})},changeText(){this.app.refresh({type:this.tabIndex,name:this.name})},goCg(e){let t={};t.ghsId=e.id,t.ghsName=e.name,t.location=e.location||0,this.$router.push({path:"/in/confirm",query:t})},handleClick(e,t){this.app.refresh({type:this.tabIndex,name:this.name})},onLoad({ctx:e,app:t}){this.app=t,this.$route.query.type&&(this.tabIndex=this.$route.query.type),e.service(this.$service.ghs).set("table",{columns:[{prop:"name",label:"名称",align:"center",width:200},{prop:"location",label:"类型",align:"center",width:90},{prop:"mobile",label:"手机号",align:"center",width:110},{prop:"id",label:"ID",align:"center",width:90},{prop:"debtAmount",label:"欠款",align:"center",width:100},{prop:"balance",label:"余额",align:"center",width:90}],op:{visible:!0,props:{width:260,align:"center",fixed:"left",label:"操作"},layout:["slot-column-option"]}}).set("layout",[["slot-tabs"],["slot-top-element","flex1"],["data-table"],["flex1","pagination"]]).on("refresh",async(e,{next:t})=>{await t(e)}).done(),t.refresh({type:this.tabIndex,name:this.name})}}},r=l,c=(n("845d"),n("1805")),p=Object(c["a"])(r,a,o,!1,null,"807c2ed6",null);t["default"]=p.exports}}]);