purchaseNewDrugQueryPrint.vue 56KB

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