| 1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0e21c1"],{"7cfe":function(t,e,i){"use strict";i.r(e);var s=function(){var t=this,e=t._self._c;return e("div",[0==t.id?e("div",[e("div",{staticStyle:{width:"35vw",margin:"0 auto","margin-top":"90px","text-align":"center","font-size":"25px"}},[t._v("请选择订单")])]):e("div",{staticStyle:{width:"62vw",margin:"0 auto","margin-top":"10px"}},[e("el-table",{staticStyle:{width:"100%"},attrs:{data:t.flowersList}},[e("el-table-column",{attrs:{prop:"name",label:"名称"}}),e("el-table-column",{attrs:{prop:"suggestHjPrice",label:"大客价"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("el-input",{attrs:{placeholder:"请填写大客价",size:"small"},on:{focus:function(t){i.row.suggestHjPrice=""}},model:{value:i.row.suggestHjPrice,callback:function(e){t.$set(i.row,"suggestHjPrice",e)},expression:"scope.row.suggestHjPrice"}})]}}])}),e("el-table-column",{attrs:{prop:"suggestPrice",label:"批发价"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("el-input",{staticStyle:{border:"1px solid #CCCCCC","border-radius":"5px"},attrs:{placeholder:"请填写批发价",size:"small"},on:{focus:function(t){i.row.suggestPrice=""},input:function(e){return t.linkChange(i.$index)}},model:{value:i.row.suggestPrice,callback:function(e){t.$set(i.row,"suggestPrice",e)},expression:"scope.row.suggestPrice"}})]}}])}),e("el-table-column",{attrs:{prop:"suggestSkPrice",label:"零售价"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("el-input",{attrs:{placeholder:"请填写零售价",size:"small"},on:{focus:function(t){i.row.suggestSkPrice=""}},model:{value:i.row.suggestSkPrice,callback:function(e){t.$set(i.row,"suggestSkPrice",e)},expression:"scope.row.suggestSkPrice"}})]}}])}),e("el-table-column",{attrs:{prop:"bigPrice",label:"进货价"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(" "+t._s(e.row.bigPrice?parseFloat(e.row.bigPrice):0)+" ")]}}])}),e("el-table-column",{attrs:{prop:"cost",label:"成本价"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(" "+t._s(e.row.cost?parseFloat(e.row.cost):0)+" ")]}}])}),e("el-table-column",{attrs:{prop:"beforeModifyPrice",label:"旧批发价"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(" "+t._s(e.row.beforeModifyPrice?parseFloat(e.row.beforeModifyPrice):0)+" ")]}}])}),e("el-table-column",{attrs:{prop:"itemNum",label:"入库数"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(" "+t._s(e.row.itemNum?parseFloat(e.row.itemNum):0)+" ")]}}])}),e("el-table-column",{attrs:{prop:"beforeModifyStock",label:"入库前库存"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(" "+t._s(e.row.beforeModifyStock?parseFloat(e.row.beforeModifyStock):0)+" ")]}}])})],1),e("div",{staticStyle:{"text-align":"left","margin-top":"18px"}},[3==t.info.status?e("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.commitChange(1)}}},[t._v("改价并入库")]):t._e(),3!=t.info.status?e("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.commitChange(2)}}},[t._v("确认改价")]):t._e(),3==t.info.status?e("el-button",{attrs:{type:"danger"},on:{click:t.confirmIn}},[t._v("仅入库不改价")]):t._e(),3==t.info.status?e("el-button",{attrs:{type:"success"},on:{click:t.savePrice}},[t._v("保存价格,稍后入库")]):t._e(),5!=t.info.status?e("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.printOrder()}}},[t._v("打小票("+t._s(t.info.printNum)+")")]):e("el-button",{attrs:{disabled:""}},[t._v("打小票("+t._s(t.info.printNum)+")")]),5!=t.info.status?e("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.printPaper()}}},[t._v("打多联("+t._s(t.info.printNum)+")")]):e("el-button",{attrs:{disabled:""}},[t._v("打多联("+t._s(t.info.printNum)+")")]),e("el-button",{attrs:{plain:""},on:{click:t.goBackFn}},[t._v("返回")])],1)],1)])},r=[],o=(i("b138"),i("8f26"),i("666b"),i("963e"),i("209c"),i("f803"),i("5880")),n=i("54a1"),c={name:"change",components:{},data(){return{flowersList:[],info:{},id:0,orderSn:""}},computed:{...Object(o["mapGetters"])(["shopInfo","userInfo"])},created(){this.$route.query.id&&(this.id=this.$route.query.id,this.getItemList()),this.$route.query.orderSn&&(this.orderSn=this.$route.query.orderSn,this.getDetail())},methods:{printPaper(){this.info.printNum>=1?this.$confirm("已打过,确认要补打?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{this.toPrint()}):this.toPrint()},toPrint(){this.$service.purchaseOrder.printPaper({id:this.id}).then(t=>{let e=t.printData?t.printData:"",i=t.template?t.template:"",s=JSON.parse(i);var r=new n["hiprint"].PrintTemplate({template:s});r.print(e),this.info.printNum++})},printOrder(){this.info.printNum>=1?this.$confirm("已打过,确认要补打?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{this.$service.purchaseOrder.printBill({id:this.id}).then(t=>{this.info.printNum++,this.$notify({title:"已打印",message:"操作成功",type:"success"})})}):this.$service.purchaseOrder.printBill({id:this.id}).then(t=>{this.info.printNum++,this.$notify({title:"已打印",message:"操作成功",type:"success"})})},confirmIn(){let t=this;this.$confirm("确认只入库不改价?","提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(()=>{this.$service.purchaseOrder.confirmPutIn({id:t.id}).then(e=>{4==e.status&&t.$notify({title:"成功",message:"操作成功",type:"success"})})})},savePrice(){let t=this,e=!1,i="";if(this.flowersList.forEach((function(s){if(0==t.$util.isMoney(s.suggestPrice)){let t=s.name;i="请填写 "+t+" 批发价",e=!0}if(0==t.$util.isMoney(s.suggestSkPrice)){let t=s.name;i="请填写 "+t+" 零售价",e=!0}if(0==t.$util.isMoney(s.suggestHjPrice)){let t=s.name;i="请填写 "+t+" 大客价",e=!0}})),e)return this.$message({message:i,type:"warning"}),!1;this.$confirm("确认保存?","提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(()=>{let e=this.id?this.id:0,i=this.flowersList.map(t=>({id:t.id,savePrice:t.suggestPrice,saveSkPrice:t.suggestSkPrice,saveHjPrice:t.suggestHjPrice}));this.$service.purchaseOrderItem.saveCgPrice({data:JSON.stringify(i),cgId:e}).then(e=>{t.$notify({title:"成功",message:"操作成功",type:"success"})})})},goBackFn(){this.goBackBefore()},commitChange(t){let e=this,i=!1,s="";if(this.flowersList.forEach((function(t){if(0==e.$util.isMoney(t.suggestPrice)){let e=t.name;s="请填写 "+e+" 批发价",i=!0}if(0==e.$util.isMoney(t.suggestSkPrice)){let e=t.name;s="请填写 "+e+" 零售价",i=!0}if(0==e.$util.isMoney(t.suggestHjPrice)){let e=t.name;s="请填写 "+e+" 大客价",i=!0}})),i)return this.$message({message:s,type:"warning"}),!1;let r="确认提交?";1==t&&(r="确认改价并入库?"),2==t&&(r="确认改价?"),this.$confirm(r,"提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(()=>{e.commitModify()})},commitModify(){let t=this,e=this.id||0,i=this.flowersList.map(t=>({id:t.productId,price:t.suggestPrice,skPrice:t.suggestSkPrice,hjPrice:t.suggestHjPrice}));t.$service.product.batchChangePrice({data:JSON.stringify(i),changeType:"cg",targetId:e,appVersion:1}).then(e=>{t.$notify({title:"成功",message:"操作成功",type:"success"})})},goBackBefore(){let t={},e=this.$route.query.backType?this.$route.query.backType:"add";"add"==e&&this.$router.push({path:"/in/add",query:t}),"list"==e&&this.$router.push({path:"/in/list",query:t})},linkChange(t){if(this.flowersList[t].suggestPrice&&Number(this.flowersList[t].suggestPrice)>0){let e=this.flowersList[t].skMore?Number(this.flowersList[t].skMore):0,i=this.flowersList[t].hjAddPrice?Number(this.flowersList[t].hjAddPrice):0,s=this.flowersList[t].addPrice?Number(this.flowersList[t].addPrice):0,r=Number(e)-Number(s);r=r.toFixed(2);let o=Number(r)+Number(this.flowersList[t].suggestPrice);o>0?(o=o.toFixed(2),o=parseFloat(o),this.flowersList[t].suggestSkPrice=o):this.flowersList[t].suggestSkPrice="";let n=Number(s)-Number(i);n=n.toFixed(2);let c=Number(this.flowersList[t].suggestPrice)-Number(n);c>0?(c=c.toFixed(2),c=parseFloat(c),this.flowersList[t].suggestHjPrice=c):this.flowersList[t].suggestHjPrice=""}else this.flowersList[t].suggestSkPrice="",this.flowersList[t].suggestHjPrice=""},getItemList(){this.$service.purchaseOrderItem.getItemList({id:this.id}).then(t=>{this.flowersList=t.list})},getDetail(){this.$service.purchaseOrder.detail({orderSn:this.orderSn}).then(t=>{this.info=t})}}},u=c,a=i("1805"),l=Object(a["a"])(u,s,r,!1,null,"6081477c",null);e["default"]=l.exports}}]);
|