purchaseNewDrugQueryPrint.vue 54KB

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