2 lines
27 KiB
JavaScript
2 lines
27 KiB
JavaScript
|
import{_ as E,l as L,L as z,a as c,S as r}from"./main-9b36f05f.js";import{a as n,o as p,s as h,e,d as a,b as i,w as l,t as d,A as b,u as I,ab as V,ao as Y,_ as u}from"./vendor-adef9cb4.js";import"./vue-persian-datetime-picker.common-0e5ba5b7.js";import{q as j,a as R}from"./quickAddCommodity-50dce749.js";import{q as O}from"./quickAdd-3f821e67.js";import{m as G}from"./mostdes-26bfade0.js";import"./vue3-treeselect.common-f8cf97d9.js";/* empty css */const H={name:"mod",components:{Money3:L,Loading:z,quickView:j,quickAdd:O,quickAddCommodity:R,mostdes:G},data:()=>({addsheet:!1,editsheet:!1,priceList:[],selectedPriceList:{id:0,label:"پیشفرض"},plugins:{},maliyatCheck:!0,maliyatPercent:0,bid:{maliyatafzode:0},desSubmit:{id:"",des:""},sumSelected:0,sumTax:0,sumTotal:0,itemsSelected:[],items:[],headers:[{text:"کالا",value:"commodity.name"},{text:"شرح",value:"des"},{text:"تعداد/مقدار",value:"count"},{text:"مبلغ واحد",value:"price"},{text:"تخفیف",value:"discount"},{text:"مالیات",value:"tax"},{text:"جمع بدون مالیات",value:"sumWithoutTax"},{text:"مبلغ کل",value:"sumTotal"},{text:"عملیات",value:"operation"}],selectedPersonWithDet:{},loading:!1,canSubmit:!0,updateID:null,sum:0,balance:0,currencyConfig:{masked:!1,prefix:"",suffix:"ریال",thousands:",",decimal:".",precision:0,disableNegative:!0,disabled:!1,min:0,max:null,allowBlank:!1,minimumNumberOfCharacters:1,shouldRound:!1,focusOnRight:!0},unitConfig:{masked:!1,prefix:"",suffix:"",thousands:",",decimal:".",precision:0,disableNegative:!0,disabled:!1,allowBlank:!1,shouldRound:!1,focusOnRight:!0},data:{date:"",des:"",person:"",transferCost:0,discountAll:0},year:{},persons:[],commodity:[],units:[],itemData:{id:0,commodity:{unit:"",unitData:{name:"",floatNumber:0}},count:0,price:0,sumTotal:0,sumWithoutTax:0,tax:0,des:"",discount:0},editItemData:{index:0,id:0,commodity:{unit:"",unitData:{name:"",floatNumber:0}},count:0,price:0,sumTotal:0,sumWithoutTax:0,tax:0,des:"",discount:0}}),watch:{"editItemData.price":function(){this.editCalc()},"editItemData.discount":function(){this.editCalc()},"editItemData.count":function(){this.editCalc()},"editItemData.commodity":function(s,t){s!=""&&s!=null&&(this.unitConfig.precision=this.editItemData.commodity.unitData.floatNumber,this.editItemData.des=this.editItemData.commodity.des)},"desSubmit.id":function(){this.data.des=this.desSubmit.des},"itemData.price":function(){this.calc()},"itemData.discount":function(){this.calc()},maliyatCheck:function(s){s===!1?this.maliyatPercent=0:this.maliyatPercent=this.bid.maliyatafzode},maliyatPercent:function(s){this.maliyatPercent==""&&(this.maliyatPercent=0),this.items.forEach((t,m)=>{t.sumWithoutTax=t.price*t.count-t.discount,t.tax=(t.price*t.count-t.discount)*s/100,t.sumTotal=(parseFloat(t.price)*parseFloat(t.count)-parseFloat(t.discount))*(100+parseFloat(this.maliyatPercent))/100})},"itemData.count":function(){this.calc()},"itemData.commodity":function(s,t){s!=""&&s!=null&&(this.selectedPriceList.id==0?this.itemData.price=this.itemData.commodity.priceSell:Array.from(this.itemData.commodity.prices).forEach(D=>{D.list.id==this.selectedPriceList.id&&(this.itemData.price=D.priceSell)}),this.unitConfig.precision=this.itemData.commodity.unitData.floatNumber,this.itemData.des=this.itemData.commodity.des)},itemsSelected:{handler:function(s,t){this.sumSelected=0,this.itemsSelected.forEach(m=>{this.sumSelected+=parseFloat(m.sumTotal)})},deep:!0},selectedPriceList:{handler:function(s,t){this.selectedPriceList.id==0?this.itemData.price=this.itemData.commodity.priceSell:Array.from(this.itemData.commodity.prices).forEach(D=>{D.list.id==this.selectedPriceList.id&&(this.itemData.price=D.priceSell)})},deep:!0},items:{handler:function(s,t){this.calcInvoice()},deep:!0},"data.transferCost":{handler:function(s,t){this.calcInvoice()},deep:!1},"data.discountAll":{handler:function(s,t){this.calcInvoice()},deep:!1},"data.person":{handler:function(s,t){c.post("/api/person/info/"+this.data.person.code).then(m=>{this.selectedPersonWithDet=m.data})},dee
|