purchaseNewStockQuery.vue 44KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360
  1. <template>
  2. <div class="main-contain">
  3. <div class="app-container "
  4. style="padding-left:0px;margin:0px;"
  5. v-loading="loading"
  6. element-loading-text="拼命加载中">
  7. <div style="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
  8. <div>
  9. <span style="font-size:14px;color:#606266">操作时间:</span>
  10. <el-date-picker
  11. size="small"
  12. v-model="start_time"
  13. prefix-icon="el-icon-date"
  14. :editable="false"
  15. style="width: 150px;"
  16. type="date"
  17. placeholder="选择日期时间"
  18. align="right"
  19. format="yyyy-MM-dd"
  20. value-format="yyyy-MM-dd"
  21. :picker-options="pickerOptions"
  22. :clearable="false"
  23. ></el-date-picker>
  24. <span>-</span>
  25. <el-date-picker
  26. size="small"
  27. v-model="end_time"
  28. prefix-icon="el-icon-date"
  29. :editable="false"
  30. style="width: 150px;"
  31. type="date"
  32. placeholder="选择日期时间"
  33. align="right"
  34. format="yyyy-MM-dd"
  35. value-format="yyyy-MM-dd"
  36. :picker-options="pickerOptions"
  37. :clearable="false"
  38. ></el-date-picker>
  39. <el-button type="primary" icon="el-icon-search" @click="getAllQuery">查询</el-button>
  40. <span style="font-size:14px;color:#606266">耗材类型:</span>
  41. <el-select v-model="good_type" style="width:200px;margin-right:10px;" placeholder="请选择"
  42. filterable
  43. @change="changeGoodTypeName">
  44. <el-option
  45. v-for="item in goodTypeList"
  46. :key="item.id"
  47. :label="item.type_name"
  48. :value="item.id">
  49. </el-option>
  50. </el-select>
  51. <el-input v-model="keyword" style="width:200px" placeholder="请输入耗材名称或生产厂商" ></el-input>
  52. <el-button type="primary" icon="el-icon-search" @click="seach">搜索</el-button>
  53. </div>
  54. <div>
  55. <!-- <el-button type="primary" size="small" @click="toOverCount">调试</el-button> -->
  56. <el-button type="primary" size="small" @click="toPrint">打印</el-button>
  57. <el-button type="primary" size="small" @click="exportList">导出</el-button>
  58. </div>
  59. </div>
  60. <el-table
  61. :row-style="{ color: '#303133' }"
  62. :header-cell-style="{
  63. backgroundColor: 'rgb(245, 247, 250)',
  64. color: '#606266'
  65. }"
  66. :data="tableList"
  67. :class="signAndWeighBoxPatients"
  68. border
  69. >
  70. <el-table-column label="耗材编码" align="center" v-if="org_id ==9956 || org_id == 0">
  71. <template slot-scope="scope">
  72. <span>{{ scope.row.good_number?scope.row.good_number:"" }}</span>
  73. </template>
  74. </el-table-column>
  75. <el-table-column label="国家编码" align="center">
  76. <template slot-scope="scope">
  77. <span>{{ scope.row.social_security_directory_code?scope.row.social_security_directory_code:"" }}</span>
  78. </template>
  79. </el-table-column>
  80. <el-table-column label="耗材类型" align="center">
  81. <template slot-scope="scope">
  82. {{getGoodTypeName(scope.row.good_type_id)}}
  83. </template>
  84. </el-table-column>
  85. <el-table-column label="耗材名称" align="center">
  86. <template slot-scope="scope">
  87. {{scope.row.good_name}}
  88. </template>
  89. </el-table-column>
  90. <el-table-column label="规格&单位" align="center">
  91. <template slot-scope="scope">
  92. {{scope.row.specification_name}}/{{scope.row.packing_unit}}
  93. </template>
  94. </el-table-column>
  95. <el-table-column label="生产厂商" align="center" v-if="org_id!=10679">
  96. <template slot-scope="scope">
  97. {{getManufacturName(scope.row.manufacturer)}}
  98. </template>
  99. </el-table-column>
  100. <el-table-column label="经销商" align="center">
  101. <template slot-scope="scope">
  102. {{getDearName(scope.row.dealer)}}
  103. </template>
  104. </el-table-column>
  105. <el-table-column label="期初结余" align="center">
  106. <el-table-column prop="stockIn" label="数量" width="100">
  107. </el-table-column>
  108. <el-table-column prop="stock_in_price" label="进货金额" width="100">
  109. </el-table-column>
  110. <el-table-column prop="stockMoney" label="销售金额" width="100">
  111. </el-table-column>
  112. </el-table-column>
  113. <el-table-column label="本期增加" align="center">
  114. <el-table-column prop="stockAdd" label="数量" width="100">
  115. </el-table-column>
  116. <el-table-column prop="addStockMoney" label="进货金额" width="100">
  117. </el-table-column>
  118. <el-table-column prop="saleStockMoney" label="销售金额" width="100">
  119. </el-table-column>
  120. </el-table-column>
  121. <el-table-column label="本期减少" align="center">
  122. <el-table-column prop="outStock" label="数量" width="100">
  123. </el-table-column>
  124. <el-table-column prop="stockOutprice" label="进货金额" width="100">
  125. </el-table-column>
  126. <el-table-column prop="saleOutMoney" label="销售金额" width="100">
  127. </el-table-column>
  128. </el-table-column>
  129. <el-table-column label="期末结余" align="center">
  130. <el-table-column prop="overStock" label="数量" width="100">
  131. </el-table-column>
  132. <el-table-column prop="overPrice" label="进货金额" width="100">
  133. </el-table-column>
  134. <el-table-column prop="overMoney" label="销售金额" width="100">
  135. </el-table-column>
  136. </el-table-column>
  137. </el-table>
  138. <el-pagination
  139. @size-change="handleSizeChange"
  140. @current-change="handleCurrentChange"
  141. :page-sizes="[10, 50, 100,200,300,400,500,1000]"
  142. :page-size="10"
  143. background
  144. align="right"
  145. style="margin-top:20px;"
  146. layout="total, sizes, prev, pager, next, jumper"
  147. :total="total"
  148. >
  149. </el-pagination>
  150. </div>
  151. </div>
  152. </template>
  153. <script>
  154. import { getStorehouseList,getNewPurchaseStockQuery,getGoodOverCount } from "@/api/drug/drug"
  155. import {
  156. getStockDrugCount
  157. } from "@/api/stock";
  158. import { uParseTime } from '@/utils/tools'
  159. const moment = require('moment')
  160. export default {
  161. data(){
  162. return{
  163. tableList:[],
  164. goodList:[
  165. {id:1,name:"全部耗材"},
  166. {id:2,name:"库存预警"},
  167. ],
  168. houseList:[],
  169. storehouse_id:0,
  170. good_type:0,
  171. multipleSelection: [],
  172. signAndWeighBoxPatients: "sign-and-weigh-box-patients",
  173. manufacturerList:[],
  174. limit:10,
  175. page:1,
  176. total:0,
  177. keyword:"",
  178. goodTypeList:[],
  179. start_time:"",
  180. end_time:"",
  181. countList:[],
  182. outCountList:[],
  183. autoCountList:[],
  184. cancelCountList:[],
  185. org_id:this.$store.getters.xt_user.org_id,
  186. dialogVisible:false,
  187. start_first_time:"",
  188. end_first_time:"",
  189. tableData:[],
  190. good_id:0,
  191. patientList:[],
  192. good_name:"",
  193. specification_name:"",
  194. loading:false,
  195. pickerOptions:{ //禁用当前日期之前的日期
  196. disabledDate(v) {
  197. return v.getTime() < 1667491200000
  198. },
  199. },
  200. dealerList:[],
  201. medicalInsuranceLevelList:[]
  202. }
  203. },
  204. methods:{
  205. changeStorehouseName(){
  206. },
  207. changeGoodTypeName(){
  208. this.getlist()
  209. },
  210. getStorehouseList(){
  211. getStorehouseList().then(response=>{
  212. if(response.data.state == 1){
  213. var houseList = response.data.data.list
  214. var obj = {id:0,storehouse_name:"全部"}
  215. this.houseList.push(obj)
  216. for(let i=0;i<houseList.length;i++){
  217. this.houseList.push(houseList[i])
  218. }
  219. this.manufacturerList = response.data.data.manufacturerList
  220. var obj = {id:0,type_name:"全部"}
  221. this.goodTypeList.push(obj)
  222. var goodTypeList = response.data.data.goodTypeList
  223. for(let i=0;i<goodTypeList.length;i++){
  224. this.goodTypeList.push(goodTypeList[i])
  225. }
  226. this.patientList = response.data.data.patientList
  227. this.dealerList = response.data.data.dealerList
  228. }
  229. })
  230. },
  231. getlist(){
  232. this.loading = true
  233. var params = {
  234. good_type:this.good_type,
  235. keyword:this.keyword,
  236. page:this.page,
  237. limit:this.limit,
  238. start_time:this.start_time,
  239. end_time:this.end_time,
  240. }
  241. getNewPurchaseStockQuery(params).then(response=>{
  242. if(response.data.state == 1){
  243. var list = response.data.data.list
  244. this.loading = false
  245. for(let i=0;i<list.length;i++){
  246. if(this.org_id ==10210 || this.org_id ==10215 || this.org_id == 10265){
  247. list[i].stockIn = list[i].GoodStartFlowInfo.over_count
  248. }else{
  249. console.log("HHAHHAHA",list[i].id)
  250. console.log("耗材id",list[i].specification_name)
  251. console.log("入库",this.getAllStockIn(list[i].StWarehousingInfoTwo))
  252. console.log("盘盈",this.getAllStockInFlow(list[i].WareStartInStockFlow))
  253. console.log("出库",this.getAllOutStockIn(list[i].WarehouseOutInfoTenty) )
  254. console.log("盘亏",this.getAllStockOutFlow(list[i].WareStartOutStockFlow))
  255. //针对武穴软水盐的问题
  256. if(list[i].id== 5052){
  257. list[i].stockIn = list[i].GoodStartFlowInfo.over_count
  258. }else{
  259. list[i].stockIn = this.getAllStockIn(list[i].StWarehousingInfoTwo) + this.getAllStockInFlow(list[i].WareStartInStockFlow) - this.getAllOutStockIn(list[i].WarehouseOutInfoTenty) - this.getAllStockOutFlow(list[i].WareStartOutStockFlow)
  260. if(list[i].stockIn <0){
  261. list[i].stockIn =0
  262. }
  263. }
  264. }
  265. if(this.org_id ==10697){
  266. list[i].stock_in_price = list[i].buy_price
  267. list[i].stockMoney = (list[i].buy_price * list[i].stockIn).toFixed(2)
  268. }else if(this.org_id == 0 || this.org_id == 10644){
  269. list[i].stock_in_price = "/"
  270. list[i].stockMoney = (this.getAllStockInPrice(list[i].StWarehousingInfoTwo) + this.getAllStockInFlowPrice(list[i].WareStartInStockFlow) - this.getAllOutStockInPrice(list[i].WarehouseOutInfoTenty) - this.getAllStockOutFlowPrice(list[i].WareStartOutStockFlow)).toFixed(2)
  271. }else{
  272. list[i].stock_in_price = "/"
  273. list[i].stockMoney = "/"
  274. }
  275. list[i].stockAdd = this.getWarehouseInfoOne(list[i].StartFlowWarehouseInfo,list[i].WareStartEndStockInventoryProfit)//期间增加
  276. if(this.org_id ==10697){
  277. list[i].addStockMoney = list[i].buy_price
  278. list[i].saleStockMoney = (list[i].buy_price *list[i].stockAdd).toFixed(2)
  279. }else if(this.org_id == 0 || this.org_id == 10644){
  280. list[i].addStockMoney = "/"
  281. list[i].saleStockMoney = this.getWarehouseInfoOnePrice(list[i].StartFlowWarehouseInfo,list[i].WareStartEndStockInventoryProfit).toFixed(2)
  282. } else{
  283. list[i].addStockMoney = "/"
  284. list[i].saleStockMoney = "/"
  285. }
  286. list[i].outStock = this.getWarehosueOutInfo(list[i].WarehouseOutInfoStart,list[i].WareStartEndStockInventoryLosses,list[i].StartEndCancelFLowInfo)//本期减少
  287. if(this.org_id == 10697){
  288. list[i].stockOutprice = list[i].packing_price
  289. list[i].saleOutMoney = (list[i].packing_price * list[i].outStock).toFixed(2)
  290. }else if(this.org_id == 0 || this.org_id == 10644){
  291. list[i].stockOutprice = "/"
  292. list[i].saleOutMoney = this.getWarehosueOutInfoPrice(list[i].WarehouseOutInfoStart,list[i].WareStartEndStockInventoryLosses,list[i].StartEndCancelFLowInfo)
  293. if(list[i].saleOutMoney == "NaN"){
  294. list[i].saleOutMoney = ""
  295. }
  296. console.log("list[i].saleOutMoney",list[i].saleOutMoney)
  297. }else{
  298. list[i].stockOutprice = "/"
  299. list[i].saleOutMoney = "/"
  300. }
  301. if(this.org_id == 10265){
  302. list[i].overStock = list[i].GoodEndFlowInfo.over_count
  303. }else{
  304. // console.log("期初",list[i].stockIn)
  305. // console.log("增加",list[i].stockAdd)
  306. // console.log("出库",list[i].outStock)
  307. if((list[i].stockIn + list[i].stockAdd - list[i].outStock)>0 ){
  308. list[i].overStock = list[i].stockIn + list[i].stockAdd - list[i].outStock
  309. }else{
  310. list[i].overStock = 0
  311. }
  312. }
  313. if(this.org_id ==10697){
  314. list[i].overPrice = list[i].packing_price
  315. list[i].overMoney = (list[i].packing_price*list[i].overStock).toFixed(2)
  316. }else if(this.org_id == 0 || this.org_id ==10644){
  317. list[i].overPrice = "/"
  318. console.log("stockMoney-00000000000000",list[i].stockMoney)
  319. console.log("saleStockMoney-00000000000000",list[i].saleStockMoney)
  320. console.log("saleOutMoney-00000000000000",list[i].saleOutMoney)
  321. list[i].overMoney = (parseFloat(list[i].stockMoney) + parseFloat(list[i].saleStockMoney) - parseFloat(list[i].saleOutMoney)).toFixed(2)
  322. // console.log("hahahha",list[i].overMoney)
  323. }else{
  324. list[i].overPrice = "/"
  325. list[i].overMoney = "/"
  326. }
  327. }
  328. console.log("listwowowoowowowow",list)
  329. var obj = {good_number:"",medical_insurance_level:"",social_security_directory_code:"合计",good_type_id:"",good_name:"",specification_name:"",packing_unit:"",manufacturer:"",dealer:"",stockIn:"",stock_in_price:"",stockMoney:0,outStock:"",stockOutprice:"",saleStockMoney:0,saleOutMoney:0,overStock:"",overPrice:"",overMoney:0}
  330. if(this.org_id == 0 || this.org_id == 10697){
  331. if(list.length!=null){
  332. for(let i=0;i<list.length;i++){
  333. obj.stockMoney += parseFloat(list[i].stockMoney)
  334. obj.saleStockMoney += parseFloat(list[i].saleStockMoney)
  335. obj.saleOutMoney += parseFloat(list[i].saleOutMoney)
  336. obj.overMoney += parseFloat(list[i].overMoney)
  337. }
  338. obj.stockMoney = obj.stockMoney.toFixed(2)
  339. obj.saleStockMoney = obj.saleStockMoney.toFixed(2)
  340. obj.overMoney = obj.overMoney.toFixed(2)
  341. obj.saleOutMoney = obj.saleOutMoney.toFixed(2)
  342. list.push(obj)
  343. }
  344. }
  345. console.log("list233333333333333333333333333333333",list)
  346. this.tableList = list
  347. this.total = response.data.data.total
  348. this.manufacturerList = response.data.data.manufacturerList
  349. }
  350. })
  351. },
  352. getManufacturName(id){
  353. var manufacturer_name = ""
  354. for(let i=0;i<this.manufacturerList.length;i++){
  355. if(id == this.manufacturerList[i].id){
  356. manufacturer_name = this.manufacturerList[i].manufacturer_name
  357. }
  358. }
  359. return manufacturer_name
  360. },
  361. handleSizeChange(val) {
  362. this.limit = val;
  363. this.getlist()
  364. },
  365. handleCurrentChange(val) {
  366. this.page = val;
  367. this.getlist()
  368. },
  369. handleSizeChangeOne(val) {
  370. this.limitone = val;
  371. this.toDialogClick(this.good_id,this.good_name,this.specification_name)
  372. },
  373. handleCurrentChangeOne(val) {
  374. this.pageone = val;
  375. this.toDialogClick(this.good_id,this.good_name,this.specification_name)
  376. },
  377. seach(){
  378. this.goodTypeList = []
  379. this.getStorehouseList()
  380. this.getlist()
  381. },
  382. getGoodTypeName(id){
  383. var type_name = ""
  384. for(let i=0;i<this.goodTypeList.length;i++){
  385. if(id == this.goodTypeList[i].id){
  386. type_name = this.goodTypeList[i].type_name
  387. }
  388. }
  389. if(type_name !='全部'){
  390. return type_name
  391. }
  392. },
  393. getHouseName(id){
  394. var storehouse_name = ""
  395. for(let i=0;i<this.houseList.length;i++){
  396. if(id == this.houseList[i].id){
  397. storehouse_name = this.houseList[i].storehouse_name
  398. }
  399. }
  400. return storehouse_name
  401. },
  402. getWareInfoCount(val,storehouse_id){
  403. var count = 0
  404. if(val.length > 0){
  405. for(let i=0;i<val.length;i++){
  406. if(val[i].storehouse_id == storehouse_id){
  407. count +=val[i].warehousing_count
  408. }
  409. }
  410. }
  411. if(count > 0){
  412. return count
  413. }else{
  414. return ""
  415. }
  416. },
  417. getStockDrugCount(){
  418. var params ={
  419. keywords: this.keywords,
  420. start_time:this.start_time,
  421. end_time:this.end_time,
  422. }
  423. getStockDrugCount(params).then(response=>{
  424. if(response.data.state == 1){
  425. var outlist = response.data.data.outList
  426. this.outCountList = outlist
  427. var autoCount = response.data.data.autoCount
  428. this.autoCountList = autoCount
  429. var totalCount = response.data.data.totalCount
  430. this.cancelCountList = totalCount
  431. }
  432. })
  433. },
  434. getWareInfoCountOne(val,storehouse_id){
  435. var count = 0
  436. if(val.length > 0){
  437. for(let i=0;i<val.length;i++){
  438. if(val[i].storehouse_id == storehouse_id){
  439. count +=val[i].stock_count
  440. }
  441. }
  442. }
  443. if(count > 0){
  444. return count
  445. }else{
  446. return ""
  447. }
  448. },
  449. getOutCount(id){
  450. var count = 0
  451. for(let i=0;i<this.outCountList.length;i++){
  452. if(id == this.outCountList[i].good_id){
  453. count = this.outCountList[i].count
  454. }
  455. }
  456. return count
  457. },
  458. getAutoCount(id){
  459. var count= 0
  460. for(let i=0;i<this.autoCountList.length;i++){
  461. if(id == this.autoCountList[i].good_id){
  462. count = this.autoCountList[i].count
  463. }
  464. }
  465. return count
  466. },
  467. getCancelCount(id){
  468. var count = 0
  469. for(let i=0;i<this.cancelCountList.length;i++){
  470. if(id == this.cancelCountList[i].good_id){
  471. count = this.cancelCountList[i].count
  472. }
  473. }
  474. return count
  475. },
  476. getCancelCountInfo(cancel_stock_info,storehouse_id){
  477. var count = 0
  478. if(cancel_stock_info.length >0){
  479. for(let i=0;i<cancel_stock_info.length;i++){
  480. if(storehouse_id == cancel_stock_info[i].storehouse_id){
  481. count += cancel_stock_info[i].count
  482. }
  483. }
  484. }
  485. return count
  486. },
  487. getWareOutInfoCount(warehouse_out_info,storehouse_id){
  488. var count = 0
  489. if(warehouse_out_info.length > 0){
  490. for(let i=0;i<warehouse_out_info.length;i++){
  491. if(storehouse_id == warehouse_out_info[i].storehouse_id){
  492. count +=warehouse_out_info[i].count
  493. }
  494. }
  495. }
  496. return count
  497. },
  498. getInCount(id){
  499. var count= 0
  500. for(let i=0;i<this.countList.length;i++){
  501. if(id == this.countList[i].good_id){
  502. count = this.countList[i].count
  503. }
  504. }
  505. return count
  506. },
  507. getOutCount(id){
  508. var count = 0
  509. for(let i=0;i<this.outCountList.length;i++){
  510. if(id == this.outCountList[i].good_id){
  511. count = this.outCountList[i].count
  512. }
  513. }
  514. return count
  515. },
  516. getAutoCount(id){
  517. var count= 0
  518. for(let i=0;i<this.autoCountList.length;i++){
  519. if(id == this.autoCountList[i].good_id){
  520. count = this.autoCountList[i].count
  521. }
  522. }
  523. return count
  524. },
  525. getCancelCount(id){
  526. var count = 0
  527. for(let i=0;i<this.cancelCountList.length;i++){
  528. if(id == this.cancelCountList[i].good_id){
  529. count = this.cancelCountList[i].count
  530. }
  531. }
  532. return count
  533. },
  534. getStockCount(id){
  535. var stock_count = 0
  536. for(let i=0;i<this.countList.length;i++){
  537. if(id == this.countList[i].good_id){
  538. stock_count = this.countList[i].stock_count
  539. }
  540. }
  541. return stock_count
  542. },
  543. getWareInfo(arr){
  544. var total = 0
  545. if(arr.length > 0){
  546. for(let i=0;i<arr.length;i++){
  547. total += parseInt(arr[i].warehousing_count)
  548. }
  549. }else{
  550. total = ""
  551. }
  552. return total
  553. },
  554. getOverplus(arr){
  555. var total = 0
  556. if(arr.length > 0){
  557. for(let i=0;i<arr.length;i++){
  558. total += arr[i].stock_count
  559. }
  560. }else{
  561. total = ""
  562. }
  563. return total
  564. },
  565. getCancelInfo(arr){
  566. var total = 0
  567. if(arr.length > 0){
  568. for(let i=0;i<arr.length;i++){
  569. total += arr[i].count
  570. }
  571. }else{
  572. total = ""
  573. }
  574. return total
  575. },
  576. getOverFlushInfo(arr){
  577. var total = 0
  578. if(arr.length >0){
  579. for(let i=0;i<arr.length;i++){
  580. total += arr[i].stock_count
  581. }
  582. }
  583. return total
  584. },
  585. startFirstTimeChange(){
  586. this.getlist()
  587. },
  588. endEndTimeChange(){
  589. this.getlist()
  590. },
  591. getTime(val) {
  592. if(val < 0){
  593. return ""
  594. }
  595. if(val == ""){
  596. return ""
  597. }else {
  598. return uParseTime(val, '{y}-{m}-{d}')
  599. }
  600. },
  601. getName(id){
  602. var name = ""
  603. for(let i=0;i<this.patientList.length;i++){
  604. if(id == this.patientList[i].id){
  605. name = this.patientList[i].name
  606. }
  607. }
  608. return name
  609. },
  610. endTimeChange(){
  611. this.getlist()
  612. },
  613. startTimeChange(){
  614. this.getlist()
  615. },
  616. getWarehouseInfoStart(arr1,arr2,arr3,arr4,arr5){
  617. var count =0
  618. var countOne =0
  619. var countTwo= 0
  620. var countthree = 0 //期初
  621. var countfour = 0
  622. var countfive = 0
  623. if(arr1!=null && arr1.length > 0){
  624. for(let i=0;i<arr1.length;i++){
  625. countOne +=arr1[i].count
  626. }
  627. }
  628. if(arr2!=null && arr2.length > 0){
  629. for(let i=0;i<arr2.length;i++){
  630. countTwo +=arr2[i].count
  631. }
  632. }
  633. if(arr3!=null && arr3.length > 0){
  634. for(let i=0;i<arr3.length;i++){
  635. countthree +=arr3[i].count
  636. }
  637. }
  638. if(arr4!=null && arr4.length > 0){
  639. for(let i=0;i<arr4.length;i++){
  640. countfour +=arr4[i].count
  641. }
  642. }
  643. if(arr5!=null && arr5.length > 0){
  644. for(let i=0;i<arr5.length;i++){
  645. countfive +=arr5[i].count
  646. }
  647. }
  648. count = countOne - countTwo + countthree - countfour + countfive
  649. if(count > 0 ){
  650. return count
  651. }else{
  652. return 0
  653. }
  654. },
  655. getWarehouseInfo(val){
  656. var count =0
  657. for(let i=0;i<val.length;i++){
  658. count +=val[i].stock_count
  659. }
  660. if(count > 0 ){
  661. return count
  662. }else{
  663. return 0
  664. }
  665. },
  666. getWarehouseInfoOne(val,val2){
  667. var count =0
  668. var countOne = 0
  669. var all_count = 0
  670. if(val!=null && val.length >0){
  671. for(let i=0;i<val.length;i++){
  672. count +=val[i].count
  673. }
  674. }
  675. if(val2!=null && val2.length > 0){
  676. for(let i=0;i<val2.length;i++){
  677. countOne +=val2[i].count
  678. }
  679. }
  680. all_count = count + countOne
  681. if(all_count > 0 ){
  682. return all_count
  683. }else{
  684. return 0
  685. }
  686. },
  687. getWarehouseInfoOnePrice(val,val2){
  688. var count_price =0
  689. var count_one_price = 0
  690. var all_count_price = 0
  691. if(val!=null && val.length >0){
  692. for(let i=0;i<val.length;i++){
  693. count_price +=val[i].count * val[i].price
  694. }
  695. }
  696. if(val2!=null && val2.length > 0){
  697. for(let i=0;i<val2.length;i++){
  698. count_one_price +=val2[i].count * val[i].price
  699. }
  700. }
  701. all_count_price = count_price + count_one_price
  702. if(all_count_price > 0 ){
  703. return all_count_price
  704. }else{
  705. return 0
  706. }
  707. },
  708. getAddStockMony(val,val2){
  709. var total_price =0
  710. var total_price_one = 0
  711. var all_price = 0
  712. if(val!=null && val.length >0){
  713. for(let i=0;i<val.length;i++){
  714. total_price +=val[i].count * val[i].buy_price
  715. }
  716. }
  717. if(val2!=null && val2.length > 0){
  718. for(let i=0;i<val2.length;i++){
  719. total_price_one +=val2[i].count * val2[i].price
  720. }
  721. }
  722. all_price = total_price + total_price_one
  723. if(all_price >0 ){
  724. return total_price.toFixed(2)
  725. }else{
  726. return "0.00"
  727. }
  728. },
  729. getSaleStockMony(val,val2){
  730. var total_price =0
  731. var total_price_one = 0
  732. var all_price = 0
  733. if(val!=null && val.length >0){
  734. for(let i=0;i<val.length;i++){
  735. total_price +=val[i].count * val[i].price
  736. }
  737. }
  738. if(val2!=null && val2.length > 0){
  739. for(let i=0;i<val2.length;i++){
  740. total_price_one +=val2[i].count * val2[i].price
  741. }
  742. }
  743. all_price = total_price + total_price_one
  744. if(all_price >0 ){
  745. return all_price.toFixed(2)
  746. }else{
  747. return "0.00"
  748. }
  749. },
  750. getWarehouseOut(val){
  751. var count = 0
  752. for(let i=0;i<val.length;i++){
  753. count +=val[i].count
  754. }
  755. if(count >0){
  756. return count
  757. }else{
  758. return 0
  759. }
  760. },
  761. open(){
  762. // this.start_time = moment().year(2022).month(10).date(4).format('YYYY-MM-DD')
  763. this.start_time = moment().startOf('month').format('YYYY-MM-DD')
  764. this.end_time = moment(new Date()).add('year',0).format("YYYY-MM-DD")
  765. this.houseList = []
  766. this.goodTypeList= []
  767. this.getStorehouseList()
  768. this.getlist()
  769. //this.getStockDrugCount()
  770. },
  771. getWarehouseInfoStartPrice(arr,arr1,arr2,arr3,arr4){
  772. var total_price = 0
  773. var total_price_one = 0
  774. var total_price_two = 0
  775. var total_price_three = 0
  776. var total_price_four = 0
  777. var total_price_all = 0
  778. if(arr!=null&&arr.length > 0){
  779. for(let i=0;i<arr.length;i++){
  780. total_price += arr[i].count * arr[i].buy_price
  781. }
  782. }
  783. if(arr1!=null && arr1.length > 0){
  784. for(let i=0;i<arr1.length;i++){
  785. total_price_one +=arr1[i].count * arr1[i].buy_price
  786. }
  787. }
  788. if(arr2!=null && arr2.length > 0){
  789. for(let i=0;i<arr2.length;i++){
  790. total_price_two +=arr2[i].count * arr2[i].buy_price
  791. }
  792. }
  793. if(arr3!=null && arr3.length > 0){
  794. for(let i=0;i<arr3.length;i++){
  795. total_price_three +=arr3[i].count * arr3[i].buy_price
  796. }
  797. }
  798. if(arr4!=null && arr4.length > 0){
  799. for(let i=0;i<arr4.length;i++){
  800. total_price_three +=arr4[i].count * arr4[i].buy_price
  801. }
  802. }
  803. total_price_all = total_price - total_price_one + total_price_two - total_price_three + total_price_four
  804. if (total_price_all > 0) {
  805. return total_price_all.toFixed(2)
  806. }else{
  807. return "0.00"
  808. }
  809. },
  810. getWarehouseInfoStartMoney(arr,arr1,arr2,arr3,arr4){
  811. var total_price = 0
  812. var total_price_one = 0
  813. var total_price_two = 0
  814. var total_price_three = 0
  815. var total_price_four = 0
  816. var total_price_all = 0
  817. if(arr!=null && arr.length >0){
  818. for(let i=0;i<arr.length;i++){
  819. total_price +=arr[i].count * arr[i].price
  820. }
  821. }
  822. if(arr1!=null && arr1.length > 0){
  823. for(let i=0;i<arr1.length;i++){
  824. total_price_one +=arr1[i].count * arr1[i].price
  825. }
  826. }
  827. if(arr2!=null && arr2.length > 0){
  828. for(let i=0;i<arr2.length;i++){
  829. total_price_two +=arr2[i].count * arr2[i].price
  830. }
  831. }
  832. if(arr3!=null && arr3.length > 0){
  833. for(let i=0;i<arr3.length;i++){
  834. total_price_three +=arr3[i].count * arr3[i].price
  835. }
  836. }
  837. if(arr4!=null && arr4.length > 0){
  838. for(let i=0;i<arr4.length;i++){
  839. total_price_four +=arr4[i].count * arr4[i].price
  840. }
  841. }
  842. total_price_all = total_price - total_price_one + total_price_two - total_price_three + total_price_four
  843. if (total_price_all > 0) {
  844. return total_price_all.toFixed(2)
  845. }else{
  846. return "0.00"
  847. }
  848. },
  849. getWarehosueOutInfo(val,val2,val3){
  850. var count = 0
  851. var count_one = 0
  852. var all_count = 0
  853. var count_two = 0
  854. if(val!=null && val.length >0){
  855. for(let i=0;i<val.length;i++){
  856. count +=val[i].count
  857. }
  858. }
  859. if(val2!=null && val2.length > 0){
  860. for(let i=0;i<val2.length;i++){
  861. count_one +=val2[i].count
  862. }
  863. }
  864. if(val3!=null && val3.length > 0){
  865. for(let i=0;i<val3.length;i++){
  866. count_two +=val3[i].count
  867. }
  868. }
  869. console.log("本期减少",count)
  870. console.log("盘亏",count_one)
  871. console.log("退库",count_two)
  872. all_count = count +count_one - count_two
  873. console.log("数据我哦我我",all_count)
  874. if(all_count >0){
  875. return all_count
  876. }else{
  877. return 0
  878. }
  879. },
  880. getWarehosueOutInfoPrice(val,val2,val3){
  881. var count_price = 0
  882. var count_one_price = 0
  883. var all_count_price = 0
  884. var count_two_price = 0
  885. if(val!=null && val.length >0){
  886. for(let i=0;i<val.length;i++){
  887. count_price += val[i].count * val[i].price
  888. }
  889. }
  890. if(val2!=null && val2.length > 0){
  891. for(let i=0;i<val2.length;i++){
  892. count_one_price +=val2[i].count * val[i].price
  893. }
  894. }
  895. if(val3!=null && val3.length > 0){
  896. for(let i=0;i<val3.length;i++){
  897. count_two_price +=val3[i].count * val[i].price
  898. }
  899. }
  900. console.log("本期减少",count_price)
  901. console.log("盘亏",count_one_price)
  902. console.log("退库",all_count_price)
  903. all_count_price = count_price +count_one_price - count_two_price
  904. console.log("数据我哦我我",all_count_price)
  905. if(all_count_price >0){
  906. return all_count_price
  907. }
  908. },
  909. stockOutprice(val,val2,val3){
  910. var total_price = 0
  911. var total_price_one = 0
  912. var total_price_two = 0
  913. var all_price = 0
  914. if(val!=null && val.length >0){
  915. for(let i=0;i<val.length;i++){
  916. total_price +=val[i].count * val[i].buy_price
  917. }
  918. }
  919. if(val2!=null && val2.length > 0){
  920. for(let i=0;i<val2.length;i++){
  921. total_price_one +=val2[i].count * val2[i].buy_price
  922. }
  923. }
  924. if(val3!=null && val3.length > 0){
  925. for(let i=0;i<val3.length;i++){
  926. total_price_two +=val3[i].count * val3[i].buy_price
  927. }
  928. }
  929. all_price = total_price + total_price_one - total_price_two
  930. if(all_price >0){
  931. return all_price.toFixed(2)
  932. }else{
  933. return "0.00"
  934. }
  935. },
  936. saleOutprice(val,val2,val3){
  937. var total_price = 0
  938. var total_price_one = 0
  939. var all_price = 0
  940. var total_price_two = 0
  941. if(val!=null && val.length >0){
  942. for(let i=0;i<val.length;i++){
  943. total_price +=val[i].count * val[i].xt_warehouse_info.packing_price
  944. }
  945. }
  946. if(val2!=null && val2.length > 0){
  947. for(let i=0;i<val2.length;i++){
  948. total_price_one +=val2[i].count * val2[i].price
  949. }
  950. }
  951. if(val3!=null && val3.length > 0){
  952. for(let i=0;i<val3.length;i++){
  953. total_price_two +=val3[i].count * val3[i].price
  954. }
  955. }
  956. all_price = total_price + total_price_one - total_price_two
  957. if(all_price >0){
  958. return all_price.toFixed(2)
  959. }else{
  960. return "0.00"
  961. }
  962. },
  963. getEndWarehouseInfo(val,val3,val1,val2,val4){
  964. var count = 0
  965. var count_one = 0
  966. var count_two = 0
  967. var count_three =0
  968. var count_four = 0
  969. var all_count = 0
  970. if(val!=null && val.length >0){
  971. for(let i=0;i<val.length;i++){
  972. count +=val[i].count
  973. }
  974. }
  975. if(val1!=null&&val1.length >0){
  976. for(let i=0;i<val1.length;i++){
  977. count_one +=val1[i].count
  978. }
  979. }
  980. if(val3!=null&& val3.length > 0){
  981. for(let i=0;i<val3.length;i++){
  982. count_three +=val3[i].count
  983. }
  984. }
  985. if(val2!=null&&val2.length >0){
  986. for(let i=0;i<val2.length;i++){
  987. count_two +=val2[i].count
  988. }
  989. }
  990. if(val4!=null&&val4.length >0){
  991. for(let i=0;i<val4.length;i++){
  992. count_four +=val4[i].count
  993. }
  994. }
  995. all_count = count- count_three + count_one - count_two + count_four
  996. if(all_count >0){
  997. return all_count
  998. }else{
  999. return 0
  1000. }
  1001. },
  1002. getEndOverPrice(val,val3,val1,val2,val4){
  1003. var total_price = 0
  1004. var total_price_one = 0
  1005. var total_price_two = 0
  1006. var total_price_three = 0
  1007. var total_price_four =0
  1008. var all_price = 0
  1009. if(val!=null && val.length >0){
  1010. for(let i=0;i<val.length;i++){
  1011. total_price +=val[i].count * val[i].buy_price
  1012. }
  1013. }
  1014. if(val1!=null && val1.length > 0){
  1015. for(let i=0;i<val1.length;i++){
  1016. total_price_one +=val1[i].count * val1[i].buy_price
  1017. }
  1018. }
  1019. if(val3!=null && val3.length > 0){
  1020. for(let i=0;i<val3.length;i++){
  1021. total_price_three +=val3[i].count * val3[i].buy_price
  1022. }
  1023. }
  1024. if(val2!=null && val2.length > 0){
  1025. for(let i=0;i<val2.length;i++){
  1026. total_price_two +=val2[i].count * val2[i].buy_price
  1027. }
  1028. }
  1029. if(val4!=null && val4.length > 0){
  1030. for(let i=0;i<val4.length;i++){
  1031. total_price_four +=val4[i].count * val4[i].buy_price
  1032. }
  1033. }
  1034. console.log("total_price",total_price)
  1035. console.log("total_price_three",total_price_three)
  1036. console.log("total_price_two",total_price_two)
  1037. console.log("total_price_one",total_price_one)
  1038. console.log("total_price_four",total_price_four)
  1039. all_price = total_price- total_price_three +total_price_one - total_price_two + total_price_four
  1040. console.log("arrll_price",all_price)
  1041. if(all_price >0){
  1042. return all_price.toFixed(2)
  1043. }else{
  1044. return "0.00"
  1045. }
  1046. },
  1047. getEndSalePrice(val,val3,val1,val2,val4){
  1048. var total_price = 0
  1049. var total_price_one = 0
  1050. var total_price_two = 0
  1051. var total_price_three = 0
  1052. var total_price_four = 0
  1053. var all_price= 0
  1054. if(val!=null && val.length >0){
  1055. for(let i=0;i<val.length;i++){
  1056. total_price +=val[i].count * val[i].price
  1057. }
  1058. }
  1059. if(val1!=null && val1.length >0){
  1060. for(let i=0;i<val1.length;i++){
  1061. total_price_one +=val1[i].count * val1[i].price
  1062. }
  1063. }
  1064. if(val3!=null && val3.length >0){
  1065. for(let i=0;i<val3.length;i++){
  1066. total_price_three +=val3[i].count * val3[i].price
  1067. }
  1068. }
  1069. if(val2!=null && val2.length >0){
  1070. for(let i=0;i<val2.length;i++){
  1071. total_price_two +=val2[i].count * val2[i].price
  1072. }
  1073. }
  1074. if(val4!=null && val4.length >0){
  1075. for(let i=0;i<val4.length;i++){
  1076. total_price_four +=val4[i].count * val4[i].price
  1077. }
  1078. }
  1079. var all_price = total_price-total_price_three + total_price_one - total_price_two + total_price_four
  1080. if(all_price >0){
  1081. return all_price.toFixed(2)
  1082. }else{
  1083. return "0.00"
  1084. }
  1085. },
  1086. toPrint(){
  1087. this.$router.push({path:"/purchase/new/stock/query/print?start_time="+this.start_time+"&end_time="+this.end_time+"&page="+this.page+"&limit="+this.limit+"&keyword="+this.keyword+"&good_type="+this.good_type})
  1088. },
  1089. exportList: function() {
  1090. if(this.org_id!=0&& this.org_id!=9956 && this.org_id!=10697){
  1091. for(let i=0;i<this.tableList.length;i++){
  1092. this.tableList[i].index = i+1
  1093. this.tableList[i].query_date = this.start_time+"~"+this.end_time
  1094. this.tableList[i].good_type = this.getGoodTypeName(this.tableList[i].good_type_id)
  1095. this.tableList[i].manufacturer_name = this.getManufacturName(this.tableList[i].manufacturer)
  1096. this.tableList[i].dealer_name = this.getDearName(this.tableList[i].dealer)
  1097. this.tableList[i].specification_name_one = this.tableList[i].specification_name + "/"+this.tableList[i].packing_unit
  1098. }
  1099. import('@/vendor/Export2Excel').then(excel => {
  1100. const multiHeader = [['序号', '查询日期',' 耗材类型','耗材名称','规格&单位','生产产商','经销商', '期初结余' , '', '', '本期增加', '', '', '本期减少' , '', '', '期末结余' , '', '']]
  1101. const header = ['', '','','','','','', '数量', '进货金额', '销售金额', '数量', '进货金额', '销售金额', '数量', '进货金额', '销售金额', '数量', '进货金额', '销售金额']
  1102. const merges = ['A1:A2', 'B1:B2','C1:C2','D1:D2','E1:E2','F1:F2','G1:G2','H1:J1', 'K1:M1', 'N1:P1', 'Q1:S1']
  1103. const filterVal = ['index', 'query_date', 'good_type','good_name','specification_name_one','manufacturer_name','dealer_name','stockIn','stock_in_price','stockMoney','stockAdd','addStockMoney','saleStockMoney','outStock','stockOutprice','saleOutMoney','overStock','overPrice','overMoney']
  1104. const data = this.formatJson(filterVal, this.tableList)
  1105. const filename = '进销存查询'
  1106. excel.export_json_to_excel({
  1107. multiHeader,
  1108. header,
  1109. merges,
  1110. data,
  1111. filename
  1112. })
  1113. })
  1114. }
  1115. if(this.org_id == 9956){
  1116. for(let i=0;i<this.tableList.length;i++){
  1117. this.tableList[i].index = i+1
  1118. this.tableList[i].query_date = this.start_time+"~"+this.end_time
  1119. this.tableList[i].good_type = this.getGoodTypeName(this.tableList[i].good_type_id)
  1120. this.tableList[i].manufacturer_name = this.getManufacturName(this.tableList[i].manufacturer)
  1121. this.tableList[i].dealer_name = this.getDearName(this.tableList[i].dealer)
  1122. this.tableList[i].specification_name_one = this.tableList[i].specification_name + "/"+this.tableList[i].packing_unit
  1123. }
  1124. import('@/vendor/Export2Excel').then(excel => {
  1125. const multiHeader = [['序号','耗材编码', '查询日期',' 耗材类型','耗材名称','规格&单位','生产产商','经销商', '期初结余' , '', '', '本期增加', '', '', '本期减少' , '', '', '期末结余' , '', '']]
  1126. const header = ['','', '','','','','','', '数量', '进货金额', '销售金额', '数量', '进货金额', '销售金额', '数量', '进货金额', '销售金额', '数量', '进货金额', '销售金额']
  1127. const merges = ['A1:A2', 'B1:B2','C1:C2','D1:D2','E1:E2','F1:F2','G1:G2','H1:H2','I1:K1', 'L1:N1', 'O1:Q1', 'R1:T1']
  1128. const filterVal = ['index','good_number', 'query_date', 'good_type','good_name','specification_name_one','manufacturer_name','dealer_name','stockIn','stock_in_price','stockMoney','stockAdd','addStockMoney','saleStockMoney','outStock','stockOutprice','saleOutMoney','overStock','overPrice','overMoney']
  1129. const data = this.formatJson(filterVal, this.tableList)
  1130. const filename = '进销存查询'
  1131. excel.export_json_to_excel({
  1132. multiHeader,
  1133. header,
  1134. merges,
  1135. data,
  1136. filename
  1137. })
  1138. })
  1139. }
  1140. if(this.org_id == 10697 || this.org_id == 0){
  1141. for(let i=0;i<this.tableList.length;i++){
  1142. this.tableList[i].index = i+1
  1143. this.tableList[i].query_date = this.start_time+"~"+this.end_time
  1144. this.tableList[i].good_type = this.getGoodTypeName(this.tableList[i].good_type_id)
  1145. this.tableList[i].manufacturer_name = this.getManufacturName(this.tableList[i].manufacturer)
  1146. this.tableList[i].dealer_name = this.getDearName(this.tableList[i].dealer)
  1147. this.tableList[i].specification_name_one = this.tableList[i].specification_name + "/"+this.tableList[i].packing_unit
  1148. }
  1149. import('@/vendor/Export2Excel').then(excel => {
  1150. const multiHeader = [['序号','国家编码', '查询日期',' 耗材类型','耗材名称','规格&单位','生产产商','经销商', '期初结余' , '', '', '本期增加', '', '', '本期减少' , '', '', '期末结余' , '', '']]
  1151. const header = ['','', '','','','','','', '数量', '进货金额', '销售金额', '数量', '进货金额', '销售金额', '数量', '进货金额', '销售金额', '数量', '进货金额', '销售金额']
  1152. const merges = ['A1:A2', 'B1:B2','C1:C2','D1:D2','E1:E2','F1:F2','G1:G2','H1:H2','I1:K1', 'L1:N1', 'O1:Q1', 'R1:T1']
  1153. const filterVal = ['index','social_security_directory_code', 'query_date', 'good_type','good_name','specification_name_one','manufacturer_name','dealer_name','stockIn','stock_in_price','stockMoney','stockAdd','addStockMoney','saleStockMoney','outStock','stockOutprice','saleOutMoney','overStock','overPrice','overMoney']
  1154. const data = this.formatJson(filterVal, this.tableList)
  1155. const filename = '进销存查询'
  1156. excel.export_json_to_excel({
  1157. multiHeader,
  1158. header,
  1159. merges,
  1160. data,
  1161. filename
  1162. })
  1163. })
  1164. }
  1165. },
  1166. formatJson(filterVal, jsonData) {
  1167. return jsonData.map(v => filterVal.map(j => v[j]));
  1168. },
  1169. toOverCount(){
  1170. getGoodOverCount().then(response=>{
  1171. if(response.data.state == 1){
  1172. var msg = response.data.data.msg
  1173. this.$message.success("调试成功")
  1174. }
  1175. })
  1176. },
  1177. getDearName(id){
  1178. var dear_name = ""
  1179. for(let i=0;i<this.dealerList.length;i++){
  1180. if(id == this.dealerList[i].id){
  1181. dear_name = this.dealerList[i].dealer_name
  1182. }
  1183. }
  1184. return dear_name
  1185. },
  1186. getAllStockIn(val){
  1187. var count = 0
  1188. if(val!=null && val.length>0){
  1189. for(let i=0;i<val.length;i++){
  1190. count+= val[i].warehousing_count
  1191. }
  1192. }
  1193. return count
  1194. },
  1195. getAllStockInPrice(val){
  1196. var total_price =0
  1197. if(val!=null && val.length>0){
  1198. for(let i=0;i<val.length;i++){
  1199. total_price += val[i].warehousing_count * val[i].price
  1200. }
  1201. }
  1202. return total_price
  1203. },
  1204. getAllOutStockIn(val){
  1205. var count = 0
  1206. if(val!=null && val.length>0){
  1207. for(let i=0;i<val.length;i++){
  1208. count +=val[i].count
  1209. }
  1210. }
  1211. return count
  1212. },
  1213. getAllOutStockInPrice(val){
  1214. var total_price = 0
  1215. if(val!=null && val.length>0){
  1216. for(let i=0;i<val.length;i++){
  1217. total_price += val[i].count * val[i].price
  1218. }
  1219. }
  1220. return total_price
  1221. },
  1222. getAllStockInFlow(val){
  1223. var count = 0
  1224. if(val!=null && val.length>0){
  1225. for(let i=0;i<val.length;i++){
  1226. count+= val[i].count
  1227. }
  1228. }
  1229. return count
  1230. },
  1231. getAllStockInFlowPrice(val){
  1232. var total_price = 0
  1233. if(val!=null && val.length>0){
  1234. for(let i=0;i<val.length;i++){
  1235. total_price+= val[i].count * val[i].total_price
  1236. }
  1237. }
  1238. return total_price
  1239. },
  1240. getAllStockOutFlow(val){
  1241. var count = 0
  1242. if(val!=null && val.length>0){
  1243. for(let i=0;i<val.length;i++){
  1244. count+= val[i].count
  1245. }
  1246. }
  1247. return count
  1248. },
  1249. getAllStockOutFlowPrice(val){
  1250. var total_price = 0
  1251. if(val!=null && val.length>0){
  1252. for(let i=0;i<val.length;i++){
  1253. total_price+= val[i].count * val[i].price
  1254. }
  1255. }
  1256. return total_price
  1257. },
  1258. getAllQuery(){
  1259. this.getlist()
  1260. }
  1261. },
  1262. created(){
  1263. }
  1264. }
  1265. </script>