purchaseNewDrugQueryPrint.vue 47KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs="crumbs"></bread-crumb>
  5. <el-row style="float:right;">
  6. <el-col :span="24">
  7. <el-button size="small" icon="el-icon-printer" type="primary" @click="printAction">打印</el-button>
  8. </el-col>
  9. </el-row>
  10. </div>
  11. <div class="app-container" style="background-color: white;">
  12. <div id="print_content">
  13. <div class="print_main_content">
  14. <div class="order_title_panl">
  15. <span class="main_title">药品进销存查询表</span>
  16. </div>
  17. <div style="text-align:left;margin-bottom:20px;font-size: 14px;margin-bottom:-30px">
  18. <span class="time_p">查询日期:{{start_time}} ~</span><span class="time_p">{{end_time}}</span>
  19. </div>
  20. <div style="text-align:right;margin-bottom:20px;font-size: 14px;">
  21. <span class="time_p">打印时间:{{time_now}}</span>
  22. </div>
  23. <div class="table_panel">
  24. <table class="table">
  25. <thead>
  26. <tr>
  27. <td rowspan="2" width="60">序号</td>
  28. <td rowspan="2" width="80">药品类型</td>
  29. <td rowspan="2" width="80">药品名称</td>
  30. <td rowspan="2" width="80">规格&单位</td>
  31. <td rowspan="2" width="80">生产厂商</td>
  32. <td rowspan="2" width="80">经销商</td>
  33. <td width="80" colspan="3">期初结余</td>
  34. <td width="80" colspan="3">本期增加</td>
  35. <td width="80" colspan="3">本期减少</td>
  36. <td width="80" colspan="3">期末结余</td>
  37. </tr>
  38. <tr>
  39. <td>数量</td>
  40. <td>进货金额</td>
  41. <td>销售金额</td>
  42. <td>数量</td>
  43. <td>进货金额</td>
  44. <td>销售金额</td>
  45. <td>数量</td>
  46. <td>进货金额</td>
  47. <td>销售金额</td>
  48. <td>数量</td>
  49. <td>进货金额</td>
  50. <td>销售金额</td>
  51. </tr>
  52. </thead>
  53. <tbody>
  54. <tr v-for="(item,index) in this.tableList" :key="index">
  55. <td>{{index + 1 }}</td>
  56. <td> {{getDrugTypeName(item.drug_type)}}</td>
  57. <td> {{item.drug_name}}</td>
  58. <td> {{item.dose}}{{item.dose_unit}}*{{item.min_number}}{{item.min_unit}}/{{item.max_unit}}</td>
  59. <td>{{getManufacturName(item.manufacturer)}}</td>
  60. <td>{{getDearName(item.dealer)}}</td>
  61. <td>{{item.drugIn}}</td>
  62. <td>{{item.drugInMoney}}</td>
  63. <td>{{item.drugSaleMoney}}</td>
  64. <td>{{item.drugAdd}}</td>
  65. <td>{{item.drugAddPrice}}</td>
  66. <td>{{item.drugAddSalePrice}}</td>
  67. <td>{{item.drugOut}}</td>
  68. <td>{{item.drugOutPrice}}</td>
  69. <td>{{item.drugOutSalePrice}}</td>
  70. <td>{{item.overDrug}}</td>
  71. <td>{{item.overDrugPrice}}</td>
  72. <td>{{item.oveDrugSaleMoney}}</td>
  73. </tr>
  74. </tbody>
  75. </table>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. </template>
  82. <script>
  83. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  84. import { getStorehouseList,getPurchaseNewDrugQuery } from "@/api/drug/drug"
  85. import print from 'print-js'
  86. const moment = require('moment')
  87. export default {
  88. components:{
  89. BreadCrumb
  90. },
  91. data(){
  92. return{
  93. crumbs: [
  94. { path: false, name: '库存管理' },
  95. { path: false, name: '库存查询' },
  96. { path: false, name: '库存查询打印' },
  97. ],
  98. start_time:"",
  99. end_time:"",
  100. drug_name:"",
  101. drug_spec:"",
  102. keyword:"",
  103. tableData:[],
  104. time_now:moment(new Date()).add('year',0).format("YYYY-MM-DD"),
  105. type_name:"",
  106. limit:"",
  107. page:"",
  108. WarehouseInfo: {
  109. loading: false,
  110. warehouseInfoDate: [],
  111. },
  112. tableList:[],
  113. good_type:[],
  114. manufacturerList:[],
  115. countList:[],
  116. outCountList:[],
  117. autoCountList:[],
  118. cancelCountList:[],
  119. org_id:0,
  120. drugTypeList:[],
  121. dealerList:[]
  122. }
  123. },
  124. methods:{
  125. printAction: function() {
  126. const style = '@media print { .print_main_content { background-color: white; width:1500px; margin:0 auto; padding: 0 0 20px 0; } .order_title_panl { text-align: center; } .time_p{font-size:16px;} .main_title { font-size: 18px; line-height: 40px; font-weight: 500; } .table_panel { } .table { width: 100%; border: 1px solid; border-collapse: collapse; padding: 2px; } thead tr td { border: 1px solid; text-align: center; font-size: 16px; padding: 15px 5px; } tbody tr td { border: 1px solid; text-align: center; font-size: 16px; padding: 10px 5px; white-space: pre-line;} .proj { padding: 5px 0; text-align: left; } .proj_title { font-size: 16px; font-weight: 500; line-height: 25px; } .proj_item { font-size: 15px; line-height: 20px; } .zone_name { font-weight: 500; } }'
  127. printJS({
  128. printable: 'print_content',
  129. type: 'html',
  130. documentTitle: ' ',
  131. style: style,
  132. scanStyles: false
  133. })
  134. },
  135. getStorehouseList(){
  136. getStorehouseList().then(response=>{
  137. if(response.data.state == 1){
  138. this.manufacturerList = response.data.data.manufacturerList
  139. this.dealerList= response.data.data.dealerList
  140. }
  141. })
  142. },
  143. getlist(){
  144. this.loading = true
  145. var params = {
  146. good_type:this.good_type,
  147. keyword:this.keyword,
  148. page:this.page,
  149. limit:this.limit,
  150. start_time:this.start_time,
  151. end_time:this.end_time,
  152. }
  153. getPurchaseNewDrugQuery(params).then(response=>{
  154. if(response.data.state == 1){
  155. this.loading = false
  156. var list = response.data.data.list
  157. for (let i = 0; i < list.length; i++) {
  158. //期初结余入库
  159. if(list[i].DrugWarehouseInfoStart!=null && list[i].DrugWarehouseInfoStart.length > 0){
  160. for(let j=0;j<list[i].DrugWarehouseInfoStart.length;j++){
  161. if(list[i].max_unit == list[i].DrugWarehouseInfoStart[j].max_unit){
  162. list[i].DrugWarehouseInfoStart[j].count =list[i].min_number * list[i].DrugWarehouseInfoStart[j].count
  163. }
  164. }
  165. }
  166. //期初结余出库
  167. if(list[i].DrugWarehouseOutInfoStart!=null && list[i].DrugWarehouseOutInfoStart.length>0){
  168. for(let j=0;j<list[i].DrugWarehouseOutInfoStart.length;j++){
  169. if(list[i].max_unit == list[i].DrugWarehouseOutInfoStart[j].max_unit){
  170. list[i].DrugWarehouseOutInfoStart[j].count = list[i].DrugWarehouseOutInfoStart[j].count*list[i].min_number
  171. }
  172. }
  173. }
  174. //期初结余退库
  175. if(list[i].WareStartStockCancelInfo!=null && list[i].WareStartStockCancelInfo.length>0){
  176. for(let j=0;j<list[i].WareStartStockCancelInfo.length;j++){
  177. if(list[i].max_unit == list[i].WareStartStockCancelInfo[j].max_unit){
  178. list[i].WareStartStockCancelInfo[j].count = list[i].WareStartStockCancelInfo[j].count*list[i].min_number
  179. }
  180. }
  181. }
  182. //期末结余入库
  183. if(list[i].DrugWarehouseInfoEnd!=null && list[i].DrugWarehouseInfoEnd.length > 0){
  184. for(let j=0;j<list[i].DrugWarehouseInfoEnd.length;j++){
  185. if(list[i].max_unit == list[i].DrugWarehouseInfoEnd[j].max_unit){
  186. list[i].DrugWarehouseInfoEnd[j].count = list[i].min_number * list[i].DrugWarehouseInfoEnd[j].count
  187. }
  188. }
  189. }
  190. //期末结余出库
  191. if(list[i].DrugWarehouseOutInfoEnd!=null && list[i].DrugWarehouseOutInfoEnd.length>0){
  192. for(let j=0;j<list[i].DrugWarehouseOutInfoEnd.length;j++){
  193. if(list[i].max_unit == list[i].DrugWarehouseOutInfoEnd[j].max_unit){
  194. list[i].DrugWarehouseOutInfoEnd[j].count = list[i].DrugWarehouseOutInfoEnd[j].count*list[i].min_number
  195. }
  196. }
  197. }
  198. //期末结余退库
  199. if(list[i].WareEndStockCancelInfo!=null && list[i].WareEndStockCancelInfo.length>0){
  200. for(let j=0;j<list[i].WareEndStockCancelInfo.length;j++){
  201. if(list[i].max_unit == list[i].WareEndStockCancelInfo[j].max_unit){
  202. list[i].WareEndStockCancelInfo[j].count = list[i].WareEndStockCancelInfo[j].count*list[i].min_number
  203. }
  204. }
  205. }
  206. //期中增加
  207. if(list[i].DrugWarehouseInfoStartEnd!=null && list[i].DrugWarehouseInfoStartEnd.length > 0){
  208. for(let j=0;j<list[i].DrugWarehouseInfoStartEnd.length;j++){
  209. if(list[i].max_unit == list[i].DrugWarehouseInfoStartEnd[j].max_unit){
  210. list[i].DrugWarehouseInfoStartEnd[j].count =list[i].min_number * list[i].DrugWarehouseInfoStartEnd[j].count
  211. }
  212. }
  213. }
  214. //期中减少
  215. if(list[i].DrugWarehouseOutInfoStartEnd!=null && list[i].DrugWarehouseOutInfoStartEnd.length > 0){
  216. for(let j=0;j<list[i].DrugWarehouseOutInfoStartEnd.length;j++){
  217. if(list[i].max_unit == list[i].DrugWarehouseOutInfoStartEnd[j].max_unit){
  218. list[i].DrugWarehouseOutInfoStartEnd[j].count =list[i].min_number * list[i].DrugWarehouseOutInfoStartEnd[j].count
  219. }
  220. }
  221. }
  222. //期中退库
  223. if(list[i].WareStartEndStockCancelInfo!=null && list[i].WareStartEndStockCancelInfo.length > 0){
  224. for(let j=0;j<list[i].WareStartEndStockCancelInfo.length;j++){
  225. if(list[i].max_unit == list[i].WareStartEndStockCancelInfo[j].max_unit){
  226. list[i].WareStartEndStockCancelInfo[j].count =list[i].min_number * list[i].WareStartEndStockCancelInfo[j].count
  227. }
  228. }
  229. }
  230. //期初盘盈
  231. if(list[i].WareStartStockInventoryProfit!=null && list[i].WareStartStockInventoryProfit.length > 0){
  232. for(let j=0;j<list[i].WareStartStockInventoryProfit.length;j++){
  233. if(list[i].max_unit == list[i].WareStartStockInventoryProfit[j].max_unit){
  234. list[i].WareStartStockInventoryProfit[j].count = list[i].WareStartStockInventoryProfit[j].count * list[i].min_number
  235. }
  236. }
  237. }
  238. //期初盘亏
  239. if(list[i].WareStartStockInventoryLosses!=null && list[i].WareStartStockInventoryLosses.length > 0){
  240. for(let j=0;j<list[i].WareStartStockInventoryLosses.length;j++){
  241. if(list[i].max_unit == list[i].WareStartStockInventoryLosses[j].max_unit){
  242. list[i].WareStartStockInventoryLosses.count = list[i].WareStartStockInventoryLosses[j].count * list[i].min_number
  243. }
  244. }
  245. }
  246. //期中盘盈
  247. if(list[i].WareStartEndStockInventoryProfit!=null && list[i].WareStartEndStockInventoryProfit.length > 0){
  248. for(let j=0;j<list[i].WareStartEndStockInventoryProfit.length;j++){
  249. if(list[i].max_unit == list[i].WareStartEndStockInventoryProfit[j].max_unit){
  250. list[i].WareStartEndStockInventoryProfit[j].count = list[i].WareStartEndStockInventoryProfit[j].count * list[i].min_number
  251. }
  252. }
  253. }
  254. //期中盘亏
  255. if(list[i].WareStartEndStockInventoryLosses!=null && list[i].WareStartEndStockInventoryLosses.length > 0){
  256. for(let j=0;j<list[i].WareStartEndStockInventoryLosses.length;j++){
  257. if(list[i].max_unit == list[i].WareStartEndStockInventoryLosses[j].max_unit){
  258. list[i].WareStartEndStockInventoryLosses[j].count = list[i].WareStartEndStockInventoryLosses[j].count * list[i].min_number
  259. }
  260. }
  261. }
  262. //期末盘盈
  263. if(list[i].WareEndStockInventoryProfit!=null && list[i].WareEndStockInventoryProfit.length >0){
  264. for(let j=0;j<list[i].WareEndStockInventoryProfit.length;j++){
  265. if(list[i].max_unit == list[i].WareEndStockInventoryProfit[j].max_unit){
  266. list[i].WareEndStockInventoryProfit[j].count = list[i].WareEndStockInventoryProfit[j].count * list[i].min_number
  267. }
  268. }
  269. }
  270. //期末盘亏
  271. if(list[i].WareEndStockInventoryLosses!=null && list[i].WareEndStockInventoryLosses.length > 0){
  272. for(let j=0;j<list[i].WareEndStockInventoryLosses.length;j++){
  273. if(list[i].max_unit == list[i].WareEndStockInventoryLosses[j].max_unit){
  274. list[i].WareEndStockInventoryLosses[j].count = list[i].WareEndStockInventoryLosses[j].count * list[i].min_number
  275. }
  276. }
  277. }
  278. // 新版
  279. if(list[i].new_drug_in_flow_info!=null && list[i].new_drug_in_flow_info.length>0){
  280. for(let j=0;j<list[i].new_drug_in_flow_info.length;j++){
  281. if(list[i].max_unit == list[i].new_drug_in_flow_info[j].max_unit){
  282. list[i].new_drug_in_flow_info[j].count = list[i].new_drug_in_flow_info[j].count * list[i].min_number
  283. }
  284. }
  285. }
  286. if(list[i].new_drug_cancel_flow_info!=null && list[i].new_drug_cancel_flow_info.length>0){
  287. for(let j=0;j<list[i].new_drug_cancel_flow_info.length;j++){
  288. if(list[i].max_unit == list[i].new_drug_cancel_flow_info[j].max_unit){
  289. list[i].new_drug_cancel_flow_info[j].count = list[i].new_drug_cancel_flow_info[j].count * list[i].min_number
  290. }
  291. }
  292. }
  293. if(list[i].new_drug_no_profit_flow_info!=null && list[i].new_drug_no_profit_flow_info.length>0){
  294. for(let j=0;j<list[i].new_drug_no_profit_flow_info.length;j++){
  295. if(list[i].max_unit == list[i].new_drug_no_profit_flow_info[j].max_unit){
  296. list[i].new_drug_no_profit_flow_info[j].count = list[i].new_drug_no_profit_flow_info[j].count * list[i].min_number
  297. }
  298. }
  299. }
  300. if(list[i].new_drug_out_flow_info!=null && list[i].new_drug_out_flow_info.length>0){
  301. for(let j=0;j<list[i].new_drug_out_flow_info.length;j++){
  302. if(list[i].max_unit == list[i].new_drug_out_flow_info[j].max_unit){
  303. list[i].new_drug_out_flow_info[j].count = list[i].new_drug_out_flow_info[j].count * list[i].min_number
  304. }
  305. }
  306. }
  307. if(list[i].new_drug_profit_flow_info!=null && list[i].new_drug_profit_flow_info.length>0){
  308. for(let j=0;j<list[i].new_drug_profit_flow_info.length;j++){
  309. if(list[i].max_unit == list[i].new_drug_profit_flow_info[j].max_unit){
  310. list[i].new_drug_profit_flow_info[j].count = list[i].new_drug_profit_flow_info[j].count * list[i].min_number
  311. }
  312. }
  313. }
  314. }
  315. for(let i=0;i<list.length;i++){
  316. list[i].last_price_in = 0
  317. list[i].drugAddOne= 0
  318. list[i].drugOutOne =0
  319. if(this.org_id ==10210 || this.org_id ==10402 || this.org_id ==10215){
  320. list[i].drugIn = this.GetDrugStartFlow(list[i].DrugStatFlow.over_count,list[i].min_number,list[i].min_unit,list[i].max_unit)
  321. }else{
  322. list[i].drugIn = this.GetInitStartFlow(list[i].new_drug_in_flow_info,list[i].new_drug_profit_flow_info,list[i].new_drug_out_flow_info,list[i].new_drug_no_profit_flow_info,list[i].new_drug_cancel_flow_info,list[i].min_number,list[i].min_unit,list[i].max_unit)
  323. }
  324. list[i].over_count_one = this.GetInitStartFlowOne(list[i].new_drug_in_flow_info,list[i].new_drug_profit_flow_info,list[i].new_drug_out_flow_info,list[i].new_drug_no_profit_flow_info,list[i].new_drug_cancel_flow_info,list[i].min_number,list[i].min_unit,list[i].max_unit)
  325. list[i].drugInMoney = "/"
  326. list[i].drugSaleMoney = "/"
  327. list[i].drugAdd = this.drugAddInfo(list[i].DrugWarehouseInfoStartEnd,list[i].min_number,list[i].min_unit,list[i].max_unit,list[i].WareStartEndStockInventoryProfit)
  328. list[i].drugAddOne= this.drugAddInfoOne(list[i].DrugWarehouseInfoStartEnd,list[i].min_number,list[i].min_unit,list[i].max_unit,list[i].WareStartEndStockInventoryProfit)
  329. list[i].drugAddPrice = "/"
  330. list[i].drugAddSalePrice = "/"
  331. list[i].drugOut= this.getDrugOut(list[i].DrugWarehouseOutInfoStartEnd,list[i].min_number,list[i].min_unit,list[i].max_unit,list[i].WareStartEndStockInventoryLosses,list[i].WareStartEndStockCancelInfo)
  332. list[i].drugOutOne = this.getDrugOutOne(list[i].DrugWarehouseOutInfoStartEnd,list[i].min_number,list[i].min_unit,list[i].max_unit,list[i].WareStartEndStockInventoryLosses,list[i].WareStartEndStockCancelInfo)
  333. list[i].drugOutPrice = "/"
  334. list[i].drugOutSalePrice = "/"
  335. if(this.org_id ==10265 || this.org_id ==10210 || this.org_id ==10402 || this.org_id ==10215){
  336. list[i].overDrug = this.GetDrugEndFlow(list[i].DrugEndFlow.over_count,list[i].min_number,list[i].min_unit,list[i].max_unit)
  337. }else{
  338. list[i].overDrug = this.GetDrugOver(list[i].over_count_one,list[i].drugAddOne,list[i].drugOutOne,list[i].min_number,list[i].min_unit,list[i].max_unit)
  339. }
  340. list[i].overDrugPrice = "/"
  341. list[i].oveDrugSaleMoney = "/"
  342. }
  343. this.tableList = list;
  344. this.total = response.data.data.total
  345. this.manufacturerList = response.data.data.manufacturerList
  346. var drugTypeList = response.data.data.drugTypeList
  347. var obj = {value:0,name:"全部"}
  348. this.drugTypeList.push(obj)
  349. for(let i=0;i<drugTypeList.length;i++){
  350. this.drugTypeList.push(drugTypeList[i])
  351. }
  352. }
  353. })
  354. },
  355. getManufacturName(id){
  356. var manufacturer_name = ""
  357. for(let i=0;i<this.manufacturerList.length;i++){
  358. if(id == this.manufacturerList[i].id){
  359. manufacturer_name = this.manufacturerList[i].manufacturer_name
  360. }
  361. }
  362. return manufacturer_name
  363. },
  364. handleSizeChange(val) {
  365. this.limit = val;
  366. this.getlist()
  367. },
  368. handleCurrentChange(val) {
  369. this.page = val;
  370. this.getlist()
  371. },
  372. seach(){
  373. this.drugTypeList = []
  374. this.houseList= []
  375. this.getlist()
  376. },
  377. getDrugTypeName(id){
  378. var type_name = ""
  379. for(let i=0;i<this.drugTypeList.length;i++){
  380. if(id == this.drugTypeList[i].value){
  381. type_name = this.drugTypeList[i].name
  382. }
  383. }
  384. return type_name
  385. },
  386. getHouseName(id){
  387. var storehouse_name = ""
  388. for(let i=0;i<this.houseList.length;i++){
  389. if(id == this.houseList[i].id){
  390. storehouse_name = this.houseList[i].storehouse_name
  391. }
  392. }
  393. return storehouse_name
  394. },
  395. startFirstTimeChange(){
  396. this.getlist()
  397. },
  398. endEndTimeChange(){
  399. this.getlist()
  400. },
  401. getTime(val) {
  402. if(val < 0){
  403. return ""
  404. }
  405. if(val == ""){
  406. return ""
  407. }else {
  408. return uParseTime(val, '{y}-{m}-{d}')
  409. }
  410. },
  411. getName(id){
  412. var name = ""
  413. for(let i=0;i<this.patientList.length;i++){
  414. if(id == this.patientList[i].id){
  415. name = this.patientList[i].name
  416. }
  417. }
  418. return name
  419. },
  420. endTimeChange(){
  421. this.getlist()
  422. },
  423. startTimeChange(){
  424. this.getlist()
  425. },
  426. getDrugWarehouseInfoOne(arr,min_number,min_unit,max_unit,arr2,arr3,arr4,arr5){
  427. var total = 0
  428. var totalOne =0
  429. var totalTwo = 0
  430. var totalthree= 0
  431. var totalfour = 0
  432. var totalfive = 0
  433. var max_str = "";
  434. var min_str = "";
  435. if(arr!=null && arr.length > 0){
  436. for(let i=0;i<arr.length;i++){
  437. totalOne += arr[i].count
  438. }
  439. }
  440. if(arr2!=null && arr2.length > 0){
  441. for(let i=0;i<arr2.length;i++){
  442. totalTwo += arr2[i].count
  443. }
  444. }
  445. if(arr3!=null && arr3.length > 0){
  446. for(let i=0;i<arr3.length;i++){
  447. totalthree += arr3[i].count
  448. }
  449. }
  450. if(arr4!=null && arr4.length > 0){
  451. for(let i=0;i<arr4.length;i++){
  452. totalfour += arr4[i].count
  453. }
  454. }
  455. if(arr5!=null && arr5.length > 0){
  456. for(let i=0;i<arr5.length;i++){
  457. totalfive += arr5[i].count
  458. }
  459. }
  460. total = totalOne - totalTwo + totalthree - totalfour + totalfive
  461. if (total < min_number) {
  462. min_str = total + min_unit;
  463. }
  464. if (total == 0) {
  465. min_str = "";
  466. max_str = "";
  467. }
  468. if (total >= min_number) {
  469. if (parseInt(total / min_number) != 0) {
  470. max_str = parseInt(total / min_number) + max_unit;
  471. }
  472. if (total % min_number != 0) {
  473. min_str = (total % min_number) + min_unit;
  474. }
  475. }
  476. if(max_str == "" && min_str == ""){
  477. return "0"
  478. }else{
  479. return max_str + min_str;
  480. }
  481. },
  482. getDrugWarehouseInfo(arr,arr4,min_number,min_unit,max_unit,arr2,arr3,arr5){
  483. var total = 0
  484. var total_one= 0
  485. var total_two = 0
  486. var total_three = 0
  487. var total_four = 0
  488. var total_five = 0
  489. var max_str = "";
  490. var min_str = "";
  491. if(arr!=null && arr.length > 0){
  492. for(let i=0;i<arr.length;i++){
  493. total_one += arr[i].count
  494. }
  495. }
  496. if(arr4!=null && arr4.length > 0){
  497. for(let i=0;i<arr4.length;i++){
  498. total_four += arr4[i].count
  499. }
  500. }
  501. if(arr2!=null && arr2.length > 0){
  502. for(let i=0;i<arr2.length;i++){
  503. total_two+= arr2[i].count
  504. }
  505. }
  506. if(arr3!=null && arr3.length >0){
  507. for(let i=0;i<arr3.length;i++){
  508. total_three +=arr3[i].count
  509. }
  510. }
  511. if(arr5!=null && arr5.length >0){
  512. for(let i=0;i<arr5.length;i++){
  513. total_five +=arr5[i].count
  514. }
  515. }
  516. total = total_one - total_four +total_two - total_three + total_five
  517. if(total < 0){
  518. total = 0
  519. }
  520. if (total < min_number) {
  521. min_str = total + min_unit;
  522. }
  523. if (total == 0) {
  524. min_str = "";
  525. max_str = "";
  526. }
  527. if (total >= min_number) {
  528. if (parseInt(total / min_number) != 0) {
  529. max_str = parseInt(total / min_number) + max_unit;
  530. }
  531. if (total % min_number != 0) {
  532. min_str = (total % min_number) + min_unit;
  533. }
  534. }
  535. if(max_str == ""&&min_str == ""){
  536. return "0"
  537. }else{
  538. return max_str + min_str;
  539. }
  540. },
  541. getDrugWarehouseInfoStart(arr,min_number,min_unit,max_unit,outArr){
  542. var total = 0
  543. var add_total = 0
  544. var out_total = 0
  545. var max_str = "";
  546. var min_str = "";
  547. if(arr!=null &&arr.length > 0){
  548. for(let i=0;i<arr.length;i++){
  549. add_total += arr[i].warehousing_count
  550. }
  551. }
  552. if(outArr.length > 0){
  553. for(let i=0;i<outArr.length;i++){
  554. out_total+= outArr[i].count
  555. }
  556. }
  557. total = add_total - out_total
  558. if (total < min_number) {
  559. min_str = total + min_unit;
  560. }
  561. if (total == 0) {
  562. min_str = "";
  563. max_str = "";
  564. }
  565. if (total >= min_number) {
  566. if (parseInt(total / min_number) != 0) {
  567. max_str = parseInt(total / min_number) + max_unit;
  568. }
  569. if (total % min_number != 0) {
  570. min_str = (total % min_number) + min_unit;
  571. }
  572. }
  573. return max_str + min_str;
  574. },
  575. getDrugWarehouseInfoMoneyStart(arr,min_number,min_unit,max_unit,last_price,outArr){
  576. var total = 0
  577. var min_str = 0
  578. var max_str = 0
  579. var addTotal = 0
  580. var outTotal = 0
  581. var total_price = 0
  582. if(arr.length > 0){
  583. for(let i=0;i<arr.length;i++){
  584. addTotal += arr[i].warehousing_count
  585. }
  586. }
  587. if(outArr.length > 0){
  588. for(let i=0;i<outArr.length;i++){
  589. outTotal += outArr[i].count
  590. }
  591. }
  592. console.log("adw23223wode",addTotal)
  593. console.log("233232232tade",outTotal)
  594. total = addTotal - outTotal
  595. if (total < min_number) {
  596. min_str = total
  597. }
  598. if (total >= min_number) {
  599. if (parseInt(total / min_number) != 0) {
  600. max_str = parseInt(total / min_number);
  601. }
  602. if (total % min_number != 0) {
  603. min_str = (total % min_number);
  604. }
  605. }
  606. total_price = (max_str * last_price + min_str*(last_price/min_number)).toFixed(2)
  607. console.log("total_price",total_price)
  608. return total_price
  609. },
  610. getDrugWarehouseInfoMoney(arr,min_number,min_unit,max_unit,last_price){
  611. var total = 0
  612. var min_str = 0
  613. var max_str = 0
  614. var total_price = 0
  615. if(arr.length > 0){
  616. for(let i=0;i<arr.length;i++){
  617. total += arr[i].stock_max_number + arr[i].stock_min_number
  618. }
  619. }
  620. if (total < min_number) {
  621. min_str = total
  622. }
  623. if (total >= min_number) {
  624. if (parseInt(total / min_number) != 0) {
  625. max_str = parseInt(total / min_number);
  626. }
  627. if (total % min_number != 0) {
  628. min_str = (total % min_number);
  629. }
  630. }
  631. total_price = (max_str * last_price + min_str*(last_price/min_number)).toFixed(2)
  632. console.log("total_price",total_price)
  633. return total_price
  634. },
  635. getDrugWarehouseInfoStockAdd(arr,min_number,min_unit,max_unit){
  636. var total = 0
  637. var max_str = "";
  638. var min_str = "";
  639. if(arr.length > 0){
  640. for(let i=0;i<arr.length;i++){
  641. total += arr[i].warehousing_count
  642. }
  643. }
  644. if (total < min_number) {
  645. min_str = total + min_unit;
  646. }
  647. if (total == 0) {
  648. min_str = "";
  649. max_str = "";
  650. }
  651. if (total >= min_number) {
  652. if (parseInt(total / min_number) != 0) {
  653. max_str = parseInt(total / min_number) + max_unit;
  654. }
  655. if (total % min_number != 0) {
  656. min_str = (total % min_number) + min_unit;
  657. }
  658. }
  659. return max_str + min_str;
  660. },
  661. getDrugWarehouseInfoaddMoney(arr,min_number,min_unit,max_unit,last_price){
  662. var total = 0
  663. var min_str = 0
  664. var max_str = 0
  665. var total_price = 0
  666. if(arr.length > 0){
  667. for(let i=0;i<arr.length;i++){
  668. total += arr[i].warehousing_count
  669. }
  670. }
  671. if (total < min_number) {
  672. min_str = total
  673. }
  674. if (total >= min_number) {
  675. if (parseInt(total / min_number) != 0) {
  676. max_str = parseInt(total / min_number);
  677. }
  678. if (total % min_number != 0) {
  679. min_str = (total % min_number);
  680. }
  681. }
  682. total_price = (max_str * last_price + min_str*(last_price/min_number)).toFixed(2)
  683. return total_price
  684. },
  685. getDrugInMoneyOne(arr,min_number,min_unit,max_unit,arr2,arr3,arr4,arr5){
  686. var totalOne = 0
  687. var totalTwo =0
  688. var total_three = 0
  689. var total_four = 0
  690. var totalFive = 0
  691. var total_price = 0
  692. if(arr!=null&&arr.length > 0){
  693. for(let i=0;i<arr.length;i++){
  694. totalOne += arr[i].count*(arr[i].price/min_number)+ arr[i].count*(arr[i].price%min_number)
  695. }
  696. }
  697. if(arr2!=null&&arr2.length > 0){
  698. for(let i=0;i<arr2.length;i++){
  699. totalTwo += ((arr2[i].count/min_number) * arr2[i].price) + ((arr2[i].count%min_number)*(arr2[i].price/min_number))
  700. }
  701. }
  702. if(arr3!=null&&arr3.length > 0){
  703. for(let i=0;i<arr3.length;i++){
  704. total_three+=arr3[i].count* arr3[i].xt_drug_warehouse_info.retail_price
  705. }
  706. }
  707. if(arr4!=null&&arr4.length > 0){
  708. for(let i=0;i<arr4.length;i++){
  709. total_four+=arr4[i].count * arr4[i].xt_drug_warehouse_info.retail_price
  710. }
  711. }
  712. if(arr5!=null&&arr5.length > 0){
  713. for(let i=0;i<arr5.length;i++){
  714. totalFive += ((arr5[i].count/min_number) * arr5[i].price) + ((arr5[i].count%min_number)*(arr5[i].price/min_number))
  715. }
  716. }
  717. total_price =(totalOne - totalTwo + total_three - total_four + totalFive).toFixed(2)
  718. if(total_price >0){
  719. return total_price
  720. }else{
  721. return "0.00"
  722. }
  723. },
  724. getDrugInMoney(arr,arr4,min_number,min_unit,max_unit,arr2,arr3,arr5){
  725. var total_price = 0
  726. var total_one_price = 0
  727. var total_two_price = 0
  728. var total_four_price =0
  729. var total_three_price = 0
  730. var total_five_price = 0
  731. if(arr!=null&&arr.length > 0){
  732. for(let i=0;i<arr.length;i++){
  733. total_one_price += (arr[i].count/min_number*arr[i].price) + arr[i].count*(arr[i].price%min_number)
  734. }
  735. }
  736. if(arr4!=null && arr4.length > 0){
  737. for(let i=0;i<arr4.length;i++){
  738. // total_four_price +=arr4[i].count * arr4[i].xt_drug_warehouse_info.price/min_number
  739. total_four_price+= ((arr4[i].count/min_number) * arr4[i].price) + ((arr4[i].count%min_number)*(arr4[i].price/min_number))
  740. }
  741. }
  742. if(arr2!=null && arr2.length > 0){
  743. for(let i=0;i<arr2.length;i++){
  744. total_two_price += arr2[i].count * arr2[i].xt_drug_warehouse_info.price/min_number
  745. }
  746. }
  747. if(arr3!=null && arr3.length > 0){
  748. for(let i=0;i<arr3.length;i++){
  749. total_three_price += arr3[i].count * arr3[i].xt_drug_warehouse_info.price/min_number
  750. }
  751. }
  752. if(arr5!=null && arr5.length > 0){
  753. for(let i=0;i<arr5.length;i++){
  754. total_five_price += arr5[i].count * arr5[i].xt_drug_warehouse_info.price/min_number
  755. }
  756. }
  757. total_price = total_one_price - total_four_price + total_two_price - total_three_price + total_five_price
  758. if(total_price > 0){
  759. return total_price.toFixed(2)
  760. }else{
  761. return "0.00"
  762. }
  763. },
  764. getSaleMoney(arr,arr4,min_number,min_unit,max_unit,arr2,arr3,arr5){
  765. var total_price = 0
  766. var total_price_one = 0
  767. var total_price_two = 0
  768. var total_price_four = 0
  769. var total_price_three =0
  770. var total_price_five = 0
  771. if(arr!=null&&arr.length > 0){
  772. for(let i=0;i<arr.length;i++){
  773. total_price_one += arr[i].count * arr[i].xt_drug_warehouse_info.retail_price
  774. }
  775. }
  776. if(arr4!=null && arr4.length>0){
  777. for(let i=0;i<arr4.length > 0;i++){
  778. total_price_four += arr4[i].count * arr4[i].xt_drug_warehouse_info.retail_price
  779. }
  780. }
  781. if(arr2!=null && arr2.length > 0){
  782. for(let i=0;i<arr2.length;i++){
  783. total_price_two += arr2[i].count * arr2[i].xt_drug_warehouse_info.retail_price
  784. }
  785. }
  786. if(arr3!=null && arr3.length > 0){
  787. for(let i=0;i<arr3.length;i++){
  788. total_price_three += arr3[i].count * arr3[i].xt_drug_warehouse_info.retail_price
  789. }
  790. }
  791. if(arr5!=null && arr5.length > 0){
  792. for(let i=0;i<arr5.length;i++){
  793. total_price_five += arr5[i].count * arr5[i].xt_drug_warehouse_info.retail_price
  794. }
  795. }
  796. total_price = total_price_one - total_price_four + total_price_two - total_price_three + total_price_five
  797. if(total_price >0){
  798. return total_price.toFixed(2)
  799. }else{
  800. return "0.00"
  801. }
  802. },
  803. getSaleMoneyOne(arr,min_number,min_unit,max_unit,arr2,arr3,arr4,arr5){
  804. var totalOne = 0
  805. var totalTwo =0
  806. var total_price = 0
  807. var total_three= 0
  808. var total_four = 0
  809. var total_five = 0
  810. if(arr!=null&&arr.length > 0){
  811. for(let i=0;i<arr.length;i++){
  812. totalOne += arr[i].count*arr[i].xt_drug_warehouse_info.retail_price
  813. }
  814. }
  815. if(arr2!=null&&arr2.length > 0){
  816. for(let i=0;i<arr2.length;i++){
  817. totalTwo += arr2[i].count * arr2[i].xt_drug_warehouse_info.retail_price
  818. }
  819. }
  820. if(arr3!=null&&arr3.length > 0){
  821. for(let i=0;i<arr3.length;i++){
  822. total_three+=arr3[i].count* arr3[i].xt_drug_warehouse_info.retail_price
  823. }
  824. }
  825. if(arr4!=null&&arr4.length > 0){
  826. for(let i=0;i<arr4.length;i++){
  827. total_four+=arr4[i].count * arr4[i].xt_drug_warehouse_info.retail_price
  828. }
  829. }
  830. if(arr5!=null&&arr5.length > 0){
  831. for(let i=0;i<arr5.length;i++){
  832. total_five+=arr5[i].count * arr5[i].xt_drug_warehouse_info.retail_price
  833. }
  834. }
  835. total_price =(totalOne - totalTwo+total_three - total_four + total_five).toFixed(2)
  836. if(total_price > 0){
  837. return total_price
  838. }else{
  839. return "0.00"
  840. }
  841. },
  842. getDrugWarehouseOutInfo(arr,min_number,min_unit,max_unit){
  843. var total = 0
  844. var max_str = "";
  845. var min_str = "";
  846. if(arr.length > 0){
  847. for(let i=0;i<arr.length;i++){
  848. total += arr[i].count
  849. }
  850. }
  851. if (total < min_number) {
  852. min_str = total + min_unit;
  853. }
  854. if (total == 0) {
  855. min_str = "";
  856. max_str = "";
  857. }
  858. if (total >= min_number) {
  859. if (parseInt(total / min_number) != 0) {
  860. max_str = parseInt(total / min_number) + max_unit;
  861. }
  862. if (total % min_number != 0) {
  863. min_str = (total % min_number) + min_unit;
  864. }
  865. }
  866. return max_str + min_str;
  867. },
  868. getDrugWarehouseOutMoney(arr,min_number,min_unit,max_unit,last_price){
  869. var total = 0
  870. var min_str = 0
  871. var max_str = 0
  872. var total_price = 0
  873. if(arr.length > 0){
  874. for(let i=0;i<arr.length;i++){
  875. total += arr[i].count
  876. }
  877. }
  878. if (total < min_number) {
  879. min_str = total
  880. }
  881. if (total >= min_number) {
  882. if (parseInt(total / min_number) != 0) {
  883. max_str = parseInt(total / min_number);
  884. }
  885. if (total % min_number != 0) {
  886. min_str = (total % min_number);
  887. }
  888. total_price = (max_str * last_price + min_str*(last_price/min_number)).toFixed(2)
  889. return total_price
  890. }
  891. },
  892. drugAddInfo(arr,min_number,min_unit,max_unit,arr2){
  893. var total = 0
  894. var totalone = 0
  895. var totaltwo = 0
  896. var max_str = "";
  897. var min_str = "";
  898. if(arr!=null && arr.length > 0){
  899. for(let i=0;i<arr.length;i++){
  900. totalone += arr[i].count
  901. }
  902. }
  903. if(arr2!=null && arr2.length >0){
  904. for(let i=0;i<arr2.length;i++){
  905. totaltwo += arr2[i].count
  906. }
  907. }
  908. total = totalone + totaltwo
  909. if (total < min_number) {
  910. min_str = total + min_unit;
  911. }
  912. if (total == 0) {
  913. min_str = "";
  914. max_str = "";
  915. }
  916. if (total >= min_number) {
  917. if (parseInt(total / min_number) != 0) {
  918. max_str = parseInt(total / min_number) + max_unit;
  919. }
  920. if (total % min_number != 0) {
  921. min_str = (total % min_number) + min_unit;
  922. }
  923. }
  924. if(max_str == ""&& min_str == ""){
  925. return "0"
  926. }else{
  927. return max_str + min_str;
  928. }
  929. },
  930. drugAddInfoOne(arr,min_number,min_unit,max_unit,arr2){
  931. var total = 0
  932. var totalone = 0
  933. var totaltwo = 0
  934. var max_str = "";
  935. var min_str = "";
  936. if(arr!=null && arr.length > 0){
  937. for(let i=0;i<arr.length;i++){
  938. totalone += arr[i].count
  939. }
  940. }
  941. if(arr2!=null && arr2.length >0){
  942. for(let i=0;i<arr2.length;i++){
  943. totaltwo += arr2[i].count
  944. }
  945. }
  946. total = totalone + totaltwo
  947. return total
  948. },
  949. getdrugAddPrice(arr,min_number,min_unit,max_unit,arr2){
  950. var total = 0
  951. var totalone =0
  952. var totaltwo = 0
  953. var total_price = 0
  954. if(arr!=null&&arr.length > 0){
  955. for(let i=0;i<arr.length;i++){
  956. totalone += arr[i].count * arr[i].xt_drug_warehouse_info.price/min_number
  957. }
  958. }
  959. if(arr2!=null && arr2.length > 0){
  960. for(let i=0;i<arr2.length;i++){
  961. totaltwo +=arr2[i].count * arr2[i].xt_drug_warehouse_info.price/min_number
  962. }
  963. }
  964. total = totalone + totaltwo
  965. total_price =total.toFixed(2)
  966. return total_price
  967. },
  968. drugAddSalePrice(arr,min_number,min_unit,max_unit,arr2){
  969. var total = 0
  970. var total_one = 0
  971. var total_two = 0
  972. var total_price = 0
  973. if(arr!=null&&arr.length > 0){
  974. for(let i=0;i<arr.length;i++){
  975. total_one += arr[i].count * arr[i].xt_drug_warehouse_info.retail_price
  976. }
  977. }
  978. if(arr2!=null&&arr2.length > 0){
  979. for(let i=0;i<arr2.length;i++){
  980. total_two +=arr2[i].count * arr2[i].xt_drug_warehouse_info.retail_price
  981. }
  982. }
  983. total = total_one + total_two
  984. total_price = total.toFixed(2)
  985. return total_price
  986. },
  987. getDrugOut(arr,min_number,min_unit,max_unit,arr2,arr3){
  988. var total = 0
  989. var totalone = 0
  990. var totaltwo = 0
  991. var totalthree = 0
  992. var min_str = ""
  993. var max_str = ""
  994. if(arr!=null&&arr.length > 0){
  995. for(let i=0;i<arr.length;i++){
  996. totalone +=arr[i].count
  997. }
  998. }
  999. if(arr2!=null && arr2.length>0){
  1000. for(let i=0;i<arr2.length;i++){
  1001. totaltwo +=arr2[i].count
  1002. }
  1003. }
  1004. if(arr3!=null && arr3.length>0){
  1005. for(let i=0;i<arr3.length;i++){
  1006. totalthree +=arr3[i].count
  1007. }
  1008. }
  1009. total = totalone + totaltwo - totalthree
  1010. if (total < min_number) {
  1011. min_str = total + min_unit;
  1012. }
  1013. if (total == 0) {
  1014. min_str = "";
  1015. max_str = "";
  1016. }
  1017. if (total >= min_number) {
  1018. if (parseInt(total / min_number) != 0) {
  1019. max_str = parseInt(total / min_number) + max_unit;
  1020. }
  1021. if (total % min_number != 0) {
  1022. min_str = (total % min_number) + min_unit;
  1023. }
  1024. }
  1025. if(max_str == "" && min_str == ""){
  1026. return "0"
  1027. }else{
  1028. return max_str + min_str;
  1029. }
  1030. },
  1031. getDrugOutOne(arr,min_number,min_unit,max_unit,arr2,arr3){
  1032. var total = 0
  1033. var totalone = 0
  1034. var totaltwo = 0
  1035. var totalthree = 0
  1036. var min_str = ""
  1037. var max_str = ""
  1038. if(arr!=null&&arr.length > 0){
  1039. for(let i=0;i<arr.length;i++){
  1040. totalone +=arr[i].count
  1041. }
  1042. }
  1043. if(arr2!=null && arr2.length>0){
  1044. for(let i=0;i<arr2.length;i++){
  1045. totaltwo +=arr2[i].count
  1046. }
  1047. }
  1048. if(arr3!=null && arr3.length>0){
  1049. for(let i=0;i<arr3.length;i++){
  1050. totalthree +=arr3[i].count
  1051. }
  1052. }
  1053. total = totalone + totaltwo - totalthree
  1054. return total
  1055. },
  1056. getDrugOutPrice(arr,min_number,min_unit,max_unit,arr2,arr3){
  1057. var total_price = 0
  1058. var total_one_price =0
  1059. var total_two_price = 0
  1060. var total_three_price = 0
  1061. var total = 0
  1062. var total_two = 0
  1063. var total_three = 0
  1064. if(arr!=null&&arr.length > 0){
  1065. for(let i=0;i<arr.length;i++){
  1066. total_one_price += arr[i].count * (arr[i].xt_drug_warehouse_info.price/min_number)
  1067. total += arr[i].count
  1068. }
  1069. }
  1070. if(arr2!=null && arr2.length>0){
  1071. for(let i=0;i<arr2.length;i++){
  1072. total_two_price +=arr2[i].count * arr2[i].xt_drug_warehouse_info.price/min_number
  1073. total_two +=arr2[i].count
  1074. }
  1075. }
  1076. if(arr3!=null && arr3.length>0){
  1077. for(let i=0;i<arr3.length;i++){
  1078. total_three_price +=arr3[i].count * arr3[i].xt_drug_warehouse_info.price/min_number
  1079. total_three +=arr3[i].count
  1080. }
  1081. }
  1082. total_price = total_one_price + total_two_price - total_three_price
  1083. if(total_price > 0){
  1084. return total_price.toFixed(2)
  1085. }else{
  1086. return "0.00"
  1087. }
  1088. },
  1089. getDrugOutSaleprice(arr,min_number,min_unit,max_unit,arr3,arr4){
  1090. var total_price = 0
  1091. var total_price_one = 0
  1092. var total_price_two = 0
  1093. var total_price_three = 0
  1094. if(arr!=null&&arr.length > 0){
  1095. for(let i=0;i<arr.length;i++){
  1096. total_price_one += arr[i].count * arr[i].xt_drug_warehouse_info.retail_price
  1097. }
  1098. }
  1099. if(arr3!=null && arr3.length >0){
  1100. for(let i=0;i<arr3.length;i++){
  1101. total_price_two +=arr3[i].count * arr3[i].xt_drug_warehouse_info.retail_price
  1102. }
  1103. }
  1104. if(arr4!=null && arr4.length >0){
  1105. for(let i=0;i<arr4.length;i++){
  1106. total_price_three +=arr4[i].count * arr4[i].xt_drug_warehouse_info.retail_price
  1107. }
  1108. }
  1109. total_price = total_price_one + total_price_two - total_price_three
  1110. if(total_price > 0){
  1111. return total_price.toFixed(2)
  1112. }else{
  1113. return "0.00"
  1114. }
  1115. },
  1116. GetDrugStartFlow(total,min_number,min_unit,max_unit){
  1117. var min_str = ""
  1118. var max_str = ""
  1119. if (total < min_number) {
  1120. min_str = total + min_unit;
  1121. }
  1122. if (total == 0) {
  1123. min_str = "";
  1124. max_str = "";
  1125. }
  1126. if (total >= min_number) {
  1127. if (parseInt(total / min_number) != 0) {
  1128. max_str = parseInt(total / min_number) + max_unit;
  1129. }
  1130. if (total % min_number != 0) {
  1131. min_str = (total % min_number) + min_unit;
  1132. }
  1133. }
  1134. if(max_str == "" && min_str == ""){
  1135. return "0"
  1136. }else{
  1137. return max_str + min_str;
  1138. }
  1139. },
  1140. GetDrugEndFlow(total,min_number,min_unit,max_unit){
  1141. var min_str = ""
  1142. var max_str = ""
  1143. if (total < min_number) {
  1144. min_str = total + min_unit;
  1145. }
  1146. if (total == 0) {
  1147. min_str = "";
  1148. max_str = "";
  1149. }
  1150. if (total >= min_number) {
  1151. if (parseInt(total / min_number) != 0) {
  1152. max_str = parseInt(total / min_number) + max_unit;
  1153. }
  1154. if (total % min_number != 0) {
  1155. min_str = (total % min_number) + min_unit;
  1156. }
  1157. }
  1158. if(max_str == "" && min_str == ""){
  1159. return "0"
  1160. }else{
  1161. return max_str + min_str;
  1162. }
  1163. },
  1164. getDearName(id){
  1165. var dear_name = ""
  1166. for(let i=0;i<this.dealerList.length;i++){
  1167. if(id == this.dealerList[i].id){
  1168. dear_name = this.dealerList[i].dealer_name
  1169. }
  1170. }
  1171. return dear_name
  1172. },
  1173. GetDrugOver(totalone,totaltwo,totalthree,min_number,min_unit,max_unit){
  1174. var total = 0
  1175. var min_str = ""
  1176. var max_str = ""
  1177. total = totalone + totaltwo - totalthree
  1178. if (total < min_number) {
  1179. min_str = total + min_unit;
  1180. }
  1181. if (total == 0) {
  1182. min_str = "";
  1183. max_str = "";
  1184. }
  1185. if (total >= min_number) {
  1186. if (parseInt(total / min_number) != 0) {
  1187. max_str = parseInt(total / min_number) + max_unit;
  1188. }
  1189. if (total % min_number != 0) {
  1190. min_str = (total % min_number) + min_unit;
  1191. }
  1192. }
  1193. if(max_str == "" && min_str == ""){
  1194. return "0"
  1195. }else{
  1196. return max_str + min_str;
  1197. }
  1198. },
  1199. GetInitStartFlow(val1,val2,val3,val4,val5,min_number,min_unit,max_unit){
  1200. var total_one =0
  1201. var total_two = 0
  1202. var total_three =0
  1203. var total_four =0
  1204. var total_five = 0
  1205. var total =0
  1206. var min_str = ""
  1207. var max_str = ""
  1208. if(val1!=null && val1.length>0){
  1209. for(let i=0;i<val1.length;i++){
  1210. total_one +=val1[i].count
  1211. }
  1212. }
  1213. if(val2!=null && val2.length>0){
  1214. for(let i=0;i<val2.length;i++){
  1215. total_two +=val2[i].count
  1216. }
  1217. }
  1218. console.log("val3",val3)
  1219. if(val3!=null && val3.length>0){
  1220. for(let i=0;i<val3.length;i++){
  1221. total_three +=val3[i].count
  1222. }
  1223. }
  1224. if(val4!=null && val4.length>0){
  1225. for(let i=0;i<val4.length;i++){
  1226. total_four +=val4[i].count
  1227. }
  1228. }
  1229. if(val5!=null && val5.length>0){
  1230. for(let i=0;i<val5.length;i++){
  1231. total_five +=val5[i].count
  1232. }
  1233. }
  1234. var total = total_one + total_two -total_three-total_four + total_five
  1235. if (total >0) {
  1236. if (total < min_number) {
  1237. min_str = total + min_unit;
  1238. }
  1239. if (total == 0) {
  1240. min_str = "";
  1241. max_str = "";
  1242. }
  1243. if (total >= min_number) {
  1244. if (parseInt(total / min_number) != 0) {
  1245. max_str = parseInt(total / min_number) + max_unit;
  1246. }
  1247. if (total % min_number != 0) {
  1248. min_str = (total % min_number) + min_unit;
  1249. }
  1250. }
  1251. if(max_str == "" && min_str == ""){
  1252. return "0"
  1253. }else{
  1254. return max_str + min_str;
  1255. }
  1256. }else{
  1257. return 0
  1258. }
  1259. },
  1260. GetInitStartFlowOne(val1,val2,val3,val4,val5,min_number,min_unit,max_unit){
  1261. var total_one =0
  1262. var total_two = 0
  1263. var total_three =0
  1264. var total_four =0
  1265. var total_five = 0
  1266. var total =0
  1267. var min_str = ""
  1268. var max_str = ""
  1269. if(val1!=null && val1.length>0){
  1270. for(let i=0;i<val1.length;i++){
  1271. total_one +=val1[i].count
  1272. }
  1273. }
  1274. if(val2!=null && val2.length>0){
  1275. for(let i=0;i<val2.length;i++){
  1276. total_two +=val2[i].count
  1277. }
  1278. }
  1279. console.log("val3",val3)
  1280. if(val3!=null && val3.length>0){
  1281. for(let i=0;i<val3.length;i++){
  1282. total_three +=val3[i].count
  1283. }
  1284. }
  1285. if(val4!=null && val4.length>0){
  1286. for(let i=0;i<val4.length;i++){
  1287. total_four +=val4[i].count
  1288. }
  1289. }
  1290. if(val5!=null && val5.length>0){
  1291. for(let i=0;i<val5.length;i++){
  1292. total_five +=val5[i].count
  1293. }
  1294. }
  1295. var total = total_one + total_two -total_three-total_four + total_five
  1296. if (total > 0) {
  1297. return total
  1298. }else{
  1299. return 0
  1300. }
  1301. }
  1302. },
  1303. created(){
  1304. this.org_id = this.$store.getters.xt_user.org_id
  1305. var starttime = this.$route.query.start_time
  1306. this.start_time = starttime
  1307. var endtime = this.$route.query.end_time
  1308. this.end_time = endtime
  1309. var good_type = parseInt(this.$route.query.good_type)
  1310. this.good_type = good_type
  1311. var keyword = this.$route.query.keyword
  1312. this.keyword = keyword
  1313. this.page = parseInt(this.$route.query.page)
  1314. this.limit = parseInt(this.$route.query.limit)
  1315. this.getStorehouseList()
  1316. this.getlist()
  1317. }
  1318. }
  1319. </script>
  1320. <style rel="stylesheet/scss" lang="scss" scoped>
  1321. .print_main_content {
  1322. background-color: white;
  1323. max-width: 1500px;
  1324. margin: 0 auto;
  1325. padding: 0 0 20px 0;
  1326. .order_title_panl {
  1327. text-align: center;
  1328. .main_title {
  1329. font-size: 18px;
  1330. line-height: 40px;
  1331. font-weight: 500;
  1332. }
  1333. }
  1334. .table_panel {
  1335. .table {
  1336. width: 100%;
  1337. border: 1px solid;
  1338. border-collapse: collapse;
  1339. padding: 2px;
  1340. thead {
  1341. tr {
  1342. td {
  1343. border: 1px solid;
  1344. text-align: center;
  1345. font-size: 14px;
  1346. padding: 15px 5px;
  1347. }
  1348. }
  1349. }
  1350. tbody {
  1351. tr {
  1352. td {
  1353. border: 1px solid;
  1354. text-align: center;
  1355. font-size: 14px;
  1356. padding: 10px 5px;
  1357. white-space: pre-line;
  1358. .proj {
  1359. padding: 5px 0;
  1360. text-align: left;
  1361. .proj_title {
  1362. font-size: 16px;
  1363. font-weight: 500;
  1364. line-height: 25px;
  1365. }
  1366. .proj_item {
  1367. font-size: 15px;
  1368. line-height: 20px;
  1369. .zone_name {
  1370. font-weight: 500;
  1371. }
  1372. }
  1373. }
  1374. }
  1375. }
  1376. }
  1377. }
  1378. }
  1379. }
  1380. </style>