Elizabeth's proactive approach involves introducing urinal toilet attachment , an ingenious concept that optimizes space and functionality.

drugQuery.vue 49KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547
  1. <template>
  2. <div class="main-contain">
  3. <div class="app-container " style="padding-left:0px;margin:0px;" v-loading="loading"
  4. element-loading-text="拼命加载中">
  5. <div style="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
  6. <div>
  7. <span style="font-size:14px;color:#606266">仓库:</span>
  8. <el-select v-model="storehouse_id" style="width:200px;margin-right:10px;" placeholder="请选择"
  9. filterable
  10. @change="changeStorehouseName">
  11. <el-option
  12. v-for="item in houseList"
  13. :key="item.id"
  14. :label="item.storehouse_name"
  15. :value="item.id">
  16. </el-option>
  17. </el-select>
  18. <span style="font-size:14px;color:#606266">库存预警:</span>
  19. <el-select v-model="good_type" style="width:250px;margin-right:10px;" placeholder="请选择"
  20. filterable
  21. @change="changeGoodName">
  22. <el-option
  23. v-for="item in goodList"
  24. :key="item.id"
  25. :label="item.name"
  26. :value="item.id">
  27. </el-option>
  28. </el-select>
  29. <el-input v-model="keyword" style="width:200px" placeholder="请输入药品名称或生产厂商" ></el-input>
  30. <el-button type="primary" icon="el-icon-search" @click="seach">搜索</el-button>
  31. </div>
  32. <div>
  33. <!-- <el-button
  34. size="small"
  35. class="filter-item"
  36. type="primary"
  37. @click="toCheck"
  38. >调试
  39. </el-button> -->
  40. <el-button
  41. size="small"
  42. class="filter-item"
  43. type="primary"
  44. @click="toSet"
  45. >设置
  46. </el-button>
  47. <el-button
  48. size="small"
  49. class="filter-item"
  50. type="primary"
  51. icon="el-icon-printer"
  52. @click="printOrder"
  53. >打印
  54. </el-button>
  55. <el-button
  56. size="small"
  57. class="filter-item"
  58. type="primary"
  59. @click="exportStock"
  60. >导出
  61. </el-button>
  62. </div>
  63. </div>
  64. <el-table
  65. :row-style="{ color: '#303133' }"
  66. :header-cell-style="{
  67. backgroundColor: 'rgb(245, 247, 250)',
  68. color: '#606266'
  69. }"
  70. :data="tableList"
  71. :class="signAndWeighBoxPatients"
  72. border
  73. :cell-class-name="cellStyle"
  74. >
  75. <el-table-column label="药品类型" align="center">
  76. <template slot-scope="scope">
  77. {{getDrugTypeName(scope.row.drug_type)}}
  78. </template>
  79. </el-table-column>
  80. <el-table-column label="药品名称" align="center">
  81. <template slot-scope="scope">
  82. {{scope.row.drug_name}}
  83. </template>
  84. </el-table-column>
  85. <el-table-column label="规格&单位" align="center">
  86. <template slot-scope="scope">
  87. {{scope.row.dose}}{{scope.row.dose_unit}}*{{scope.row.min_number}}{{scope.row.min_unit}}/{{scope.row.max_unit}}
  88. </template>
  89. </el-table-column>
  90. <el-table-column label="生产厂商" align="center">
  91. <template slot-scope="scope">
  92. {{getManufacturName(scope.row.manufacturer)}}
  93. </template>
  94. </el-table-column>
  95. <el-table-column label="批准文号" align="center">
  96. <template slot-scope="scope">
  97. {{scope.row.number}}
  98. </template>
  99. </el-table-column>
  100. <el-table-column label="国家编码" align="center">
  101. <template slot-scope="scope">
  102. {{scope.row.medical_insurance_number}}
  103. </template>
  104. </el-table-column>
  105. <el-table-column label="仓库名称" align="center">
  106. <template slot-scope="scope">
  107. <tr style="background: none" v-for="(item, index) in scope.row.drug_stock_info" :key="index">
  108. <td style="border-right: none;border-inline-end: none;text-align: center;">
  109. {{ getHouseName(item.storehouse_id) }}
  110. </td>
  111. </tr>
  112. </template>
  113. </el-table-column>
  114. <el-table-column label="入库数量" align="center">
  115. <template slot-scope="scope">
  116. <tr style="background: none" v-for="(item, index) in scope.row.drug_stock_info" :key="index">
  117. <td style="border-right: none;border-inline-end: none;text-align: center; ">
  118. {{getDrugIn(item.storehouse_id,scope.row.drug_stock_count,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}
  119. </td>
  120. </tr>
  121. </template>
  122. </el-table-column>
  123. <el-table-column label="出库数量" align="center">
  124. <template slot-scope="scope">
  125. <tr style="background: none" v-for="(item, index) in scope.row.drug_stock_info" :key="index">
  126. <td style="border-right: none;border-inline-end: none;text-align: center;">
  127. <span>
  128. {{getActOut(item.storehouse_id,scope.row.drug_stock_count,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}
  129. </span>
  130. </td>
  131. </tr>
  132. </template>
  133. </el-table-column>
  134. <el-table-column label="退库数量" align="center">
  135. <template slot-scope="scope">
  136. <tr style="background: none" v-for="(item, index) in scope.row.drug_stock_info" :key="index">
  137. <td style="border-right: none;border-inline-end: none;text-align: center;">
  138. {{getDrugCancel(item.storehouse_id,scope.row.drug_stock_count,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}
  139. </td>
  140. </tr>
  141. </template>
  142. </el-table-column>
  143. <el-table-column label="实际出库" align="center">
  144. <template slot-scope="scope">
  145. <tr style="background: none" v-for="(item, index) in scope.row.drug_stock_info" :key="index">
  146. <td style="border-right: none;border-inline-end: none;text-align: center;">
  147. <span style="color:#0099FF" @click="toDialogClick(scope.row.id,scope.row.drug_name,scope.row.dose,scope.row.dose_unit,scope.row.min_number,scope.row.min_unit,scope.row.max_unit,item.storehouse_id)">
  148. {{getDrugOut(item.storehouse_id,scope.row.drug_stock_count,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}
  149. </span>
  150. </td>
  151. </tr>
  152. </template>
  153. </el-table-column>
  154. <el-table-column label="剩余库存" align="center">
  155. <template slot-scope="scope">
  156. <tr style="background: none" v-for="(item, index) in scope.row.drug_stock_info" :key="index">
  157. <td style="border-right: none;border-inline-end: none;text-align: center;">
  158. {{getFlushCount(item.storehouse_id,scope.row.drug_stock_count,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}
  159. </td>
  160. </tr>
  161. </template>
  162. </el-table-column>
  163. <el-table-column label="总库存量" align="center">
  164. <template slot-scope="scope">
  165. <div v-if="getWarehoseInfo(scope.row.drug_warehouse_info) > 0">
  166. <span v-if="scope.row.total_count<=scope.row.drug_stock_limit_count" style="color:red">{{getSumCount(scope.row.drug_stock_count,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}<i class="el-icon-warning"></i></span>
  167. <span v-if="scope.row.total_count >scope.row.drug_stock_limit_count">{{getSumCount(scope.row.drug_stock_count,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}</span>
  168. </div>
  169. </template>
  170. </el-table-column>
  171. <el-table-column
  172. prop="drug_name"
  173. label="操作"
  174. align="center"
  175. width="200px"
  176. >
  177. <template slot-scope="scope">
  178. <el-button
  179. size="small"
  180. type="primary"
  181. @click="handleDetail(scope.row)"
  182. >库存流水
  183. </el-button>
  184. <el-button
  185. size="small"
  186. type="primary"
  187. @click="handleBatch(scope.row)"
  188. >批次
  189. </el-button>
  190. </template>
  191. </el-table-column>
  192. </el-table>
  193. <el-pagination
  194. @size-change="handleSizeChange"
  195. @current-change="handleCurrentChange"
  196. :page-sizes="[10, 50, 100,200,500,1000]"
  197. :page-size="10"
  198. background
  199. align="right"
  200. style="margin-top:20px;"
  201. layout="total, sizes, prev, pager, next, jumper"
  202. :total="total"
  203. >
  204. </el-pagination>
  205. </div>
  206. <el-dialog
  207. title="出库详情"
  208. :visible.sync="dialogVisible"
  209. width="70%">
  210. <span>
  211. 药品名称:{{drug_name}}
  212. 规格&单位:{{specification_name}}
  213. 查询日期:
  214. <el-date-picker
  215. size="small"
  216. v-model="start_first_time"
  217. prefix-icon="el-icon-date"
  218. :editable="false"
  219. style="width: 150px;"
  220. type="date"
  221. placeholder="选择日期时间"
  222. align="right"
  223. format="yyyy-MM-dd"
  224. value-format="yyyy-MM-dd"
  225. @change="startFirstTimeChange"
  226. ></el-date-picker>
  227. <span>-</span>
  228. <el-date-picker
  229. size="small"
  230. v-model="end_first_time"
  231. prefix-icon="el-icon-date"
  232. :editable="false"
  233. style="width: 150px;"
  234. type="date"
  235. placeholder="选择日期时间"
  236. align="right"
  237. format="yyyy-MM-dd"
  238. value-format="yyyy-MM-dd"
  239. @change="endEndTimeChange"
  240. ></el-date-picker>
  241. </span>
  242. <el-divider></el-divider>
  243. <el-table
  244. :row-style="{ color: '#303133' }"
  245. :header-cell-style="{
  246. backgroundColor: 'rgb(245, 247, 250)',
  247. color: '#606266'
  248. }"
  249. :data="tableData"
  250. :class="signAndWeighBoxPatients"
  251. border
  252. >
  253. <el-table-column label="序号" align="center">
  254. <template slot-scope="scope">
  255. {{scope.$index + 1}}
  256. </template>
  257. </el-table-column>
  258. <el-table-column label="单据编号" align="center">
  259. <template slot-scope="scope">
  260. {{scope.row.warehouse_out_order_number}}
  261. </template>
  262. </el-table-column>
  263. <el-table-column label="操作时间" align="center">
  264. <template slot-scope="scope">
  265. {{getTimeOne(scope.row.ctime)}}
  266. </template>
  267. </el-table-column>
  268. <el-table-column label="出库数量" align="center">
  269. <template slot-scope="scope">
  270. {{scope.row.count}}{{scope.row.count_unit}}
  271. </template>
  272. </el-table-column>
  273. <el-table-column label="库存数量" align="center">
  274. <template slot-scope="scope">
  275. <span v-if="parseInt(scope.row.over_count/scope.row.drug.min_number) > 0">{{parseInt(scope.row.over_count/scope.row.drug.min_number)}}{{scope.row.drug.max_unit}}</span>
  276. <span v-if="scope.row.over_count%scope.row.drug.min_number > 0">{{scope.row.over_count%scope.row.drug.min_number}}{{scope.row.drug.min_unit}}</span>
  277. </template>
  278. </el-table-column>
  279. <el-table-column label="使用人" align="center">
  280. <template slot-scope="scope">
  281. {{getName(scope.row.patient_id)}}
  282. </template>
  283. </el-table-column>
  284. <el-table-column label="备注" align="center">
  285. <template slot-scope="scope">
  286. {{scope.row.remark}}
  287. </template>
  288. </el-table-column>
  289. </el-table>
  290. <el-pagination
  291. @size-change="handleSizeChangeOne"
  292. @current-change="handleCurrentChangeOne"
  293. :page-sizes="[10, 50, 100,200,500,1000]"
  294. :page-size="10"
  295. background
  296. align="right"
  297. style="margin-top:20px;"
  298. layout="total, sizes, prev, pager, next, jumper"
  299. :total="totalone"
  300. >
  301. </el-pagination>
  302. <span slot="footer" class="dialog-footer">
  303. <el-button @click="dialogVisible = false">取 消</el-button>
  304. <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
  305. </span>
  306. </el-dialog>
  307. <el-dialog title="设置" :visible.sync="visibility" :close-on-click-modal="isClose"
  308. :close-on-press-escape="isClose">
  309. <div style="text-align: center;">
  310. <div>
  311. <el-button type="primary" v-if="!is_open" @click="changeOpen(1)">启用自动扣减</el-button>
  312. <el-button type="danger" v-if="is_open" @click="changeOpen(2)">关闭自动扣减</el-button>
  313. <div style="margin-top: 40px;"><p style="color:#909399;text-align: center;">
  314. 启用“药品管理”后,在开透析医嘱时,医生可以选择药品后将自动产生出库单</p></div>
  315. </div>
  316. </div>
  317. <span slot="footer" class="dialog-footer">
  318. <el-button @click="hide()">取 消</el-button>
  319. </span>
  320. </el-dialog>
  321. </div>
  322. </template>
  323. <script>
  324. import { getStorehouseList,getDrugNewQuery,getDrugWarehouseOutInfoById } from "@/api/drug/drug"
  325. import { createDrugStockAutomaticReduceConfig, getDrugStockAutomaticReduceConfig,getDrugInitDataList } from '@/api/drug/drug_stock'
  326. import { uParseTime } from '@/utils/tools'
  327. import { max } from 'moment'
  328. const moment = require('moment')
  329. export default {
  330. data(){
  331. return{
  332. tableList:[],
  333. goodList:[
  334. {id:1,name:"全部药品"},
  335. {id:2,name:"库存预警"},
  336. {id:3,name:"库存为零"},
  337. {id:4,name:"库存不为零"},
  338. ],
  339. houseList:[],
  340. storehouse_id:0,
  341. good_type:1,
  342. multipleSelection: [],
  343. signAndWeighBoxPatients: "sign-and-weigh-box-patients",
  344. manufacturerList:[],
  345. limit:10,
  346. page:1,
  347. total:0,
  348. limitone:10,
  349. pageone:1,
  350. totalone:0,
  351. keyword:"",
  352. goodTypeList:[],
  353. start_time:"",
  354. end_time:"",
  355. countList:[],
  356. outCountList:[],
  357. autoCountList:[],
  358. cancelCountList:[],
  359. org_id:this.$store.getters.xt_user.org_id,
  360. dialogVisible:false,
  361. start_first_time:moment().startOf('month').format("YYYY-MM-DD"),
  362. end_first_time:moment().endOf('month').format("YYYY-MM-DD"),
  363. tableData:[],
  364. drug_id:0,
  365. patientList:[],
  366. drug_name:"",
  367. specification_name:"",
  368. drugTypeList:[],
  369. loading:false,
  370. flushList:[],
  371. flushListOne:[],
  372. dose:"",
  373. dose_unit:"",
  374. min_number:0,
  375. max_unit:"",
  376. min_unit:"",
  377. is_open: false,
  378. visibility: false,
  379. isClose: false,
  380. drug_type: 0,
  381. storehouseId:0,
  382. }
  383. },
  384. methods:{
  385. changeStorehouseName(){
  386. this.getlist()
  387. },
  388. changeGoodName(){
  389. this.getlist()
  390. },
  391. toClick(val){
  392. var manufacturer_name = ""
  393. var specification_name = ""
  394. for(let i=0;i<this.manufacturerList.length;i++){
  395. if(val.manufacturer == this.manufacturerList[i].id){
  396. manufacturer_name = this.manufacturerList[i].manufacturer_name
  397. }
  398. }
  399. specification_name = val.specification_name + "/" + val.packing_unit
  400. var overCount = this.getOverplus(val.xt_warehouse_info)
  401. // window.sessionStorage.setItem('start_time',this.start_time)
  402. // window.sessionStorage.setItem('end_time',this.end_time)
  403. this.$router.push({path:"/stock/in/stockflow?id="+val.id+"&manufacturer="+manufacturer_name+"&packing_unit="+val.packing_unit+"&overCount="+overCount})
  404. },
  405. toClickOne(val){
  406. var manufacturer_name = ""
  407. var specification_name = ""
  408. for(let i=0;i<this.manufacturerList.length;i++){
  409. if(val.manufacturer == this.manufacturerList[i].id){
  410. manufacturer_name = this.manufacturerList[i].manufacturer_name
  411. }
  412. }
  413. specification_name = val.specification_name + "/" + val.packing_unit
  414. var overCount = this.getOverplus(val.xt_warehouse_info)
  415. // window.sessionStorage.setItem('start_time',this.start_time)
  416. // window.sessionStorage.setItem('end_time',this.end_time)
  417. this.$router.push({path:"/stock/in/stockbatchnumber?id="+val.id+"&manufacturer="+manufacturer_name+"&packing_unit="+val.packing_unit+"&overCount="+overCount})
  418. },
  419. getStorehouseList(){
  420. getStorehouseList().then(response=>{
  421. if(response.data.state == 1){
  422. var houseList = response.data.data.list
  423. var obj = {id:0,storehouse_name:"全部"}
  424. this.houseList.push(obj)
  425. for(let i=0;i<houseList.length;i++){
  426. this.houseList.push(houseList[i])
  427. }
  428. this.manufacturerList = response.data.data.manufacturerList
  429. this.goodTypeList = response.data.data.goodTypeList
  430. this.patientList = response.data.data.patientList
  431. }
  432. })
  433. },
  434. getlist(){
  435. this.loading = true
  436. var params = {
  437. storehouse_id:this.storehouse_id,
  438. good_type:this.good_type,
  439. keyword:this.keyword,
  440. page:this.page,
  441. limit:this.limit,
  442. start_time:this.start_time,
  443. end_time:this.end_time,
  444. }
  445. this.tableList = []
  446. getDrugNewQuery(params).then(response=>{
  447. if(response.data.state == 1){
  448. this.loading = false
  449. // var list = response.data.data.list
  450. var countList = response.data.data.countList
  451. console.log("countList999999999999",countList)
  452. for (let i = 0; i < countList.length; i++) {
  453. for (let j = 0; j < countList[i].drug_warehouse_info.length; j++) {
  454. if (countList[i].max_unit == countList[i].drug_warehouse_info[j].max_unit) {
  455. countList[i].drug_warehouse_info[j].stock_max_number =countList[i].min_number *countList[i].drug_warehouse_info[j].stock_max_number
  456. countList[i].drug_warehouse_info[j].warehousing_count =countList[i].min_number *countList[i].drug_warehouse_info[j].warehousing_count
  457. }
  458. }
  459. }
  460. this.tableList = countList
  461. // for (let i = 0; i < list.length; i++) {
  462. // for (let j = 0; j < list[i].drug_warehouse_info.length; j++) {
  463. // if (list[i].max_unit == list[i].drug_warehouse_info[j].max_unit) {
  464. // list[i].drug_warehouse_info[j].stock_max_number =list[i].min_number *list[i].drug_warehouse_info[j].stock_max_number
  465. // list[i].drug_warehouse_info[j].warehousing_count =list[i].min_number *list[i].drug_warehouse_info[j].warehousing_count
  466. // }
  467. // }
  468. // for (let y = 0; y < list[i].drug_warehouse_out.length; y++) {
  469. // if (list[i].drug_warehouse_out[y].count_unit == list[i].max_unit) {
  470. // list[i].drug_warehouse_out[y].count =list[i].drug_warehouse_out[y].count * list[i].min_number
  471. // }
  472. // }
  473. // for (let z = 0; z < list[i].drug_cancel_stock_info.length; z++) {
  474. // if (list[i].drug_cancel_stock_info[z].max_unit == list[i].max_unit) {
  475. // list[i].drug_cancel_stock_info[z].count =list[i].drug_cancel_stock_info[z].count * list[i].min_number
  476. // }
  477. // }
  478. // for (let m = 0; m < list[i].drug_flow_info.length; m++) {
  479. // if (list[i].drug_flow_info[m].max_unit == list[i].max_unit) {
  480. // list[i].drug_flow_info[m].count =list[i].drug_flow_info[m].count * list[i].min_number
  481. // }
  482. // }
  483. // for (let n = 0; n< list[i].drug_act_flow_info.length; n++) {
  484. // if (list[i].drug_act_flow_info[n].max_unit == list[i].max_unit) {
  485. // list[i].drug_act_flow_info[n].count =list[i].drug_act_flow_info[n].count * list[i].min_number
  486. // }
  487. // }
  488. // }
  489. // var arr = [];
  490. // for (let i = 0; i < list.length; i++) {
  491. // if (list[i].drug_warehouse_info.length > 0) {
  492. // arr.push(list[i]);
  493. // }
  494. // }
  495. // this.tableList = arr;
  496. this.total = response.data.data.total
  497. this.drugTypeList = response.data.data.drugTypeList
  498. }
  499. })
  500. },
  501. getManufacturName(id){
  502. var manufacturer_name = ""
  503. for(let i=0;i<this.manufacturerList.length;i++){
  504. if(id == this.manufacturerList[i].id){
  505. manufacturer_name = this.manufacturerList[i].manufacturer_name
  506. }
  507. }
  508. return manufacturer_name
  509. },
  510. handleSizeChange(val) {
  511. this.limit = val;
  512. this.getlist()
  513. },
  514. handleCurrentChange(val) {
  515. this.page = val;
  516. this.getlist()
  517. },
  518. handleSizeChangeOne(val) {
  519. this.limitone = val;
  520. this.toDialogClick(this.drug_id,this.drug_name,this.dose,this.dose_unit,this.min_number,this.min_unit,this.max_unit,this.storehouseId)
  521. },
  522. handleCurrentChangeOne(val) {
  523. this.pageone = val;
  524. this.toDialogClick(this.drug_id,this.drug_name,this.dose,this.dose_unit,this.min_number,this.min_unit,this.max_unit,this.storehouseId)
  525. },
  526. seach(){
  527. this.getlist()
  528. },
  529. getGoodTypeName(id){
  530. var type_name = ""
  531. for(let i=0;i<this.goodTypeList.length;i++){
  532. if(id == this.goodTypeList[i].id){
  533. type_name = this.goodTypeList[i].type_name
  534. }
  535. }
  536. return type_name
  537. },
  538. getHouseName(id){
  539. var storehouse_name = ""
  540. for(let i=0;i<this.houseList.length;i++){
  541. if(id == this.houseList[i].id){
  542. storehouse_name = this.houseList[i].storehouse_name
  543. }
  544. }
  545. return storehouse_name
  546. },
  547. getWareInfoCount(val,storehouse_id){
  548. var count = 0
  549. if(val.length > 0){
  550. for(let i=0;i<val.length;i++){
  551. if(val[i].storehouse_id == storehouse_id){
  552. count +=val[i].warehousing_count
  553. }
  554. }
  555. }
  556. if(count > 0){
  557. return count
  558. }else{
  559. return ""
  560. }
  561. },
  562. getOverFlushInfo(arr, max_unit, min_unit, min_number) {
  563. console.log("ar232323232323232wo",arr)
  564. var max_str = "";
  565. var min_str = "";
  566. var total = 0;
  567. var newarr = arr;
  568. if (newarr.length > 0) {
  569. for (let i = 0; i < newarr.length; i++) {
  570. total += newarr[i].stock_max_number + newarr[i].stock_min_number;
  571. }
  572. }
  573. if (total < min_number) {
  574. min_str = total + min_unit;
  575. }
  576. if (total == 0) {
  577. min_str = "";
  578. max_str = "";
  579. }
  580. if (total >= min_number) {
  581. if (parseInt(total / min_number) != 0) {
  582. max_str = parseInt(total / min_number) + max_unit;
  583. }
  584. if (total % min_number != 0) {
  585. min_str = (total % min_number) + min_unit;
  586. }
  587. }
  588. return max_str + min_str;
  589. },
  590. toDialogClick(id,drug_name,dose,dose_unit,min_number,min_unit,max_unit,storehouse_id){
  591. this.drug_id = id
  592. this.drug_name = drug_name
  593. this.dose = dose
  594. this.dose_unit = dose_unit
  595. this.min_number = min_number
  596. this.min_unit = min_unit
  597. this.max_unit = max_unit
  598. this.specification_name = dose + dose_unit + "*"+min_number+min_unit +"/"+ max_unit
  599. this.storehouseId = storehouse_id
  600. var params = {
  601. drug_id:id,
  602. limit:this.limitone,
  603. page:this.pageone,
  604. start_first_time:this.start_first_time,
  605. end_first_time:this.end_first_time,
  606. storehouse_id:storehouse_id,
  607. }
  608. getDrugWarehouseOutInfoById(params).then(response=>{
  609. if(response.data.state == 1){
  610. var list = response.data.data.list
  611. console.log("list23233233232w",list)
  612. this.tableData = list
  613. var flushList = response.data.data.flushList
  614. console.log("flushList",flushList)
  615. this.flushList = flushList
  616. var flushListOne = response.data.data.flushListOne
  617. this.flushListOne = flushListOne
  618. this.totalone = response.data.data.total
  619. this.dialogVisible = true
  620. }
  621. })
  622. },
  623. startFirstTimeChange(){
  624. this.toDialogClick(this.drug_id,this.drug_name,this.dose,this.dose_unit,this.min_number,this.min_unit,this.max_unit,this.storehouseId)
  625. },
  626. endEndTimeChange(){
  627. this.toDialogClick(this.drug_id,this.drug_name,this.dose,this.dose_unit,this.min_number,this.min_unit,this.max_unit,this.storehouseId)
  628. },
  629. getTime(val) {
  630. if(val < 0){
  631. return ""
  632. }
  633. if(val == ""){
  634. return ""
  635. }else {
  636. return uParseTime(val, '{y}-{m}-{d}')
  637. }
  638. },
  639. getTimeOne(val) {
  640. if(val < 0){
  641. return ""
  642. }
  643. if(val == ""){
  644. return ""
  645. }else {
  646. return uParseTime(val, '{y}-{m}-{d} {h}:{i}')
  647. }
  648. },
  649. getName(id){
  650. var name = ""
  651. for(let i=0;i<this.patientList.length;i++){
  652. if(id == this.patientList[i].id){
  653. name = this.patientList[i].name
  654. }
  655. }
  656. return name
  657. },
  658. getDrugTypeName(id){
  659. var type_name = ""
  660. for(let i=0;i<this.drugTypeList.length;i++){
  661. if(id == this.drugTypeList[i].value){
  662. type_name = this.drugTypeList[i].name
  663. }
  664. }
  665. return type_name
  666. },
  667. getWarehoseInfoSeven(arr, max_unit, min_unit, min_number, storehouse_id) {
  668. var total = 0;
  669. var max_str = "";
  670. var min_str = "";
  671. if (arr.length > 0) {
  672. for (let i = 0; i < arr.length; i++) {
  673. if (arr[i].storehouse_id == storehouse_id) {
  674. total += parseInt(arr[i].warehousing_count);
  675. }
  676. }
  677. }
  678. if (total < min_number) {
  679. min_str = total + min_unit;
  680. }
  681. if (total == 0) {
  682. min_str = "";
  683. max_str = "";
  684. }
  685. if (total >= min_number) {
  686. if (parseInt(total / min_number) != 0) {
  687. max_str = parseInt(total / min_number) + max_unit;
  688. }
  689. if (total % min_number != 0) {
  690. min_str = (total % min_number) + min_unit;
  691. }
  692. }
  693. return max_str + min_str;
  694. },
  695. getOutFlushNightSix(info, max_unit, min_unit,min_number,storehouse_id,val){
  696. var str = "";
  697. var str_min = "";
  698. //总库存
  699. var total = 0;
  700. var total_one = 0
  701. var total_two = 0
  702. for (let i = 0; i < info.length; i++) {
  703. if (info[i].storehouse_id == storehouse_id) {
  704. total_one += info[i].count;
  705. }
  706. }
  707. if(val!=null && val.length > 0){
  708. for (let i = 0; i < val.length; i++) {
  709. if (val[i].storehouse_id == storehouse_id) {
  710. total_two += val[i].count;
  711. }
  712. }
  713. }
  714. if((total_one - total_two) > 0){
  715. total = total_one - total_two
  716. }
  717. if (parseInt(total / min_number) != 0) {
  718. str = parseInt(total / min_number) + max_unit;
  719. }
  720. if (total % min_number != 0) {
  721. str_min = (total % min_number) + min_unit;
  722. }
  723. return str + str_min;
  724. },
  725. getOutFlushNightSeven(info, max_unit, min_unit,min_number,storehouse_id){
  726. var str = "";
  727. var str_min = "";
  728. //总库存
  729. var total = 0;
  730. var totalOne = 0
  731. var totalTwo = 0
  732. if(info!=null && info.length > 0){
  733. for (let i = 0; i < info.length; i++) {
  734. if (info[i].storehouse_id == storehouse_id) {
  735. totalOne += info[i].count;
  736. }
  737. }
  738. }
  739. total = totalOne
  740. if (parseInt(total / min_number) != 0) {
  741. str = parseInt(total / min_number) + max_unit;
  742. }
  743. if (total % min_number != 0) {
  744. str_min = (total % min_number) + min_unit;
  745. }
  746. return str + str_min;
  747. },
  748. getOutFlushNight(info, max_unit, min_unit,min_number, cancel_info,storehouse_id){
  749. var str = "";
  750. var str_min = "";
  751. //总库存
  752. var total = 0;
  753. var out_count = 0;
  754. var over_count = 0;
  755. var cancel_count = 0;
  756. for (let i = 0; i < info.length; i++) {
  757. if (info[i].storehouse_id == storehouse_id) {
  758. total += info[i].warehousing_count;
  759. }
  760. }
  761. for (let j = 0; j < info.length; j++) {
  762. if (info[j].storehouse_id == storehouse_id) {
  763. out_count += info[j].stock_max_number + info[j].stock_min_number;
  764. }
  765. }
  766. over_count = total - out_count;
  767. if (parseInt(over_count / min_number) != 0) {
  768. str = parseInt(over_count / min_number) + max_unit;
  769. }
  770. if (over_count % min_number != 0) {
  771. str_min = (over_count % min_number) + min_unit;
  772. }
  773. return str + str_min;
  774. },
  775. getOverFlushInfoEight(arr, max_unit, min_unit, min_number, storehouse_id) {
  776. var max_str = "";
  777. var min_str = "";
  778. var total = 0;
  779. var newarr = arr;
  780. if (newarr.length > 0) {
  781. for (let i = 0; i < newarr.length; i++) {
  782. if (newarr[i].storehouse_id == storehouse_id) {
  783. total += newarr[i].stock_max_number + newarr[i].stock_min_number;
  784. }
  785. }
  786. }
  787. if (total < min_number) {
  788. min_str = total + min_unit;
  789. }
  790. if (total == 0) {
  791. min_str = "";
  792. max_str = "";
  793. }
  794. if (total >= min_number) {
  795. if (parseInt(total / min_number) != 0) {
  796. max_str = parseInt(total / min_number) + max_unit;
  797. }
  798. if (total % min_number != 0) {
  799. min_str = (total % min_number) + min_unit;
  800. }
  801. }
  802. return max_str + min_str;
  803. },
  804. getWarehoseInfo(arr) {
  805. var total = 0;
  806. if (arr.length > 0) {
  807. for (let i = 0; i < arr.length; i++) {
  808. total += parseInt(arr[i].warehousing_count);
  809. }
  810. }
  811. if (total == 0) {
  812. total = "";
  813. }
  814. return total;
  815. },
  816. getOutFlushTen(info, max_unit, min_unit,min_number,storehouse_id){
  817. var str = "";
  818. var str_min = "";
  819. //总库存
  820. var total = 0;
  821. for (let i = 0; i < info.length; i++) {
  822. if (info[i].storehouse_id == storehouse_id) {
  823. total += info[i].count;
  824. }
  825. }
  826. if (parseInt(total / min_number) != 0) {
  827. str = parseInt(total / min_number) + max_unit;
  828. }
  829. if (total % min_number != 0) {
  830. str_min = (total % min_number) + min_unit;
  831. }
  832. return str + str_min;
  833. },
  834. getDrugOut(info, max_unit, min_unit,min_number,storehouse_id,cancel_stock_info){
  835. var str = "";
  836. var str_min = "";
  837. var cancel_count = 0
  838. var cha_count = 0
  839. //总库存
  840. var total = 0;
  841. for (let i = 0; i < info.length; i++) {
  842. if (info[i].storehouse_id == storehouse_id) {
  843. total += info[i].count;
  844. }
  845. }
  846. for (let i = 0; i < cancel_stock_info.length; i++) {
  847. if(cancel_stock_info[i].storehouse_id == storehouse_id) {
  848. cancel_count += cancel_stock_info[i].count;
  849. }
  850. }
  851. cha_count = total - cancel_count
  852. if (parseInt(cha_count / min_number) != 0) {
  853. str = parseInt(cha_count / min_number) + max_unit;
  854. }
  855. if (cha_count % min_number != 0) {
  856. str_min = (cha_count % min_number) + min_unit;
  857. }
  858. return str + str_min;
  859. },
  860. handleDetail(val) {
  861. var manufacturer_name = "";
  862. for (let i = 0; i < this.manufacturerList.length; i++) {
  863. if (val.manufacturer == this.manufacturerList[i].id) {
  864. manufacturer_name = this.manufacturerList[i].manufacturer_name;
  865. }
  866. }
  867. var over_plus = this.getOverFlushInfo(
  868. val.drug_warehouse_info,
  869. val.max_unit,
  870. val.min_unit,
  871. val.min_number
  872. );
  873. this.$router.push({
  874. path:
  875. "/drugstock/in/drugstockflow?drug_id=" +
  876. val.id +
  877. "&manufacturer=" +
  878. manufacturer_name +
  879. "&min_number=" +
  880. val.min_number +
  881. "&max_unit=" +
  882. val.max_unit +
  883. "&min_unit=" +
  884. val.min_unit +
  885. "&over_plus=" +
  886. over_plus,
  887. });
  888. window.sessionStorage.setItem("start_time", this.start_time);
  889. window.sessionStorage.setItem("end_time", this.end_time);
  890. },
  891. handleBatch(val) {
  892. var manufacturer_name = "";
  893. for (let i = 0; i < this.manufacturerList.length; i++) {
  894. if (val.manufacturer == this.manufacturerList[i].id) {
  895. manufacturer_name = this.manufacturerList[i].manufacturer_name;
  896. }
  897. }
  898. var unit =
  899. val.dose +
  900. val.dose_unit +
  901. "*" +
  902. val.min_number +
  903. val.min_unit +
  904. "/" +
  905. val.max_unit;
  906. var over_plus = this.getOverFlushInfo(
  907. val.drug_warehouse_info,
  908. val.max_unit,
  909. val.min_unit,
  910. val.min_number
  911. );
  912. window.sessionStorage.setItem("start_time", this.start_time);
  913. window.sessionStorage.setItem("end_time", this.end_time);
  914. this.$router.push({
  915. path:
  916. "/drugstock/in/drugbatchnumber?drug_id=" +
  917. val.id +
  918. "&manufacturer=" +
  919. manufacturer_name +
  920. "&unit=" +
  921. unit +
  922. "&min_number=" +
  923. val.min_number +
  924. "&max_unit=" +
  925. val.max_unit +
  926. "&min_unit=" +
  927. val.min_unit +
  928. "&over_plus=" +
  929. over_plus,
  930. });
  931. },
  932. // 合并单元格样式
  933. cellStyle({ row, column, rowIndex, columnIndex }) {
  934. let arr = [5,6, 7, 8, 9,10,11];
  935. if (arr.indexOf(columnIndex) > -1) {
  936. return "spanClass";
  937. }
  938. },
  939. hide: function() {
  940. this.visibility = false
  941. },
  942. toSet: function() {
  943. this.getConfig()
  944. this.visibility = true
  945. }, changeOpen(val) {
  946. var message = ''
  947. if (val == 1) {
  948. message = '启用药品自动扣减功能'
  949. } else {
  950. message = '关闭药品自动扣减功能'
  951. }
  952. this.$confirm(message, '提示', {
  953. confirmButtonText: '确定',
  954. cancelButtonText: '取消',
  955. type: 'info'
  956. }).then(() => {
  957. createDrugStockAutomaticReduceConfig(val).then(response => {
  958. if (response.data.state == 0) {
  959. this.$message.error(response.data.msg)
  960. return false
  961. } else {
  962. if (response.data.data.is_open == 1) {
  963. this.is_open = true
  964. this.$message({
  965. type: 'success',
  966. message: '已启用'
  967. })
  968. } else {
  969. this.is_open = false
  970. this.$message({
  971. type: 'success',
  972. message: '已关闭'
  973. })
  974. }
  975. }
  976. })
  977. }).catch(() => {
  978. })
  979. },
  980. getConfig() {
  981. getDrugStockAutomaticReduceConfig().then(response => {
  982. if (response.data.state == 0) {
  983. this.$message.error(response.data.msg)
  984. return false
  985. } else {
  986. var config = response.data.data.config
  987. if (config.is_open == 1) {
  988. this.is_open = true
  989. } else {
  990. this.is_open = false
  991. }
  992. }
  993. })
  994. },
  995. printOrder() {
  996. this.$router.push("/drugs/query/print?start_time="+this.start_time+"&end_time="+this.end_time+"&keyword="+this.keyword+"&storehouse_id="+this.storehouse_id+"&page="+this.page+"&limit="+this.limit+"&good_type="+this.good_type)
  997. },
  998. exportStock() {
  999. console.log("tablelist23322332",this.tableList)
  1000. if(this.tableList!=null && this.tableList.length > 0){
  1001. for(let i=0;i<this.tableList.length;i++){
  1002. this.tableList[i].index = i +1
  1003. this.tableList[i].drug_type_name = this.getDrugTypeName(this.tableList[i].drug_type)
  1004. this.tableList[i].specification_name = this.tableList[i].dose + this.tableList[i].dose_unit + "*" +this.tableList[i].min_number + this.tableList[i].min_unit +"/"+this.tableList[i].max_unit
  1005. this.tableList[i].manufacturer_name = this.getManufacturName(this.tableList[i].manufacturer)
  1006. this.tableList[i].stock_in_count = this.getStockIn(this.tableList[i].drug_stock_count, this.tableList[i].max_unit, this.tableList[i].min_unit,this.tableList[i].min_number);
  1007. this.tableList[i].stock_out_count = this.getActCount(this.tableList[i].drug_stock_count,this.tableList[i].max_unit,this.tableList[i].min_unit,this.tableList[i].min_number)
  1008. this.tableList[i].cancle_out_count = this.getCancleOut(this.tableList[i].drug_stock_count,this.tableList[i].max_unit,this.tableList[i].min_unit,this.tableList[i].min_number)
  1009. this.tableList[i].act_cout = this.getStockOut(this.tableList[i].drug_stock_count,this.tableList[i].max_unit,this.tableList[i].min_unit,this.tableList[i].min_number,this.tableList[i].drug_cancel_stock_info)
  1010. this.tableList[i].over_count = this.getOverCount(this.tableList[i].drug_stock_count,this.tableList[i].max_unit,this.tableList[i].min_unit,this.tableList[i].min_number)
  1011. this.tableList[i].sum_count = this.getOverCount(this.tableList[i].drug_stock_count,this.tableList[i].max_unit,this.tableList[i].min_unit,this.tableList[i].min_number)
  1012. }
  1013. }
  1014. import("@/vendor/Export2Excel").then((excel) => {
  1015. const tHeader = [
  1016. "序号",
  1017. "药品类型",
  1018. "药品名称",
  1019. "规格&单位",
  1020. "生产厂商",
  1021. "批准文号",
  1022. "国家编码",
  1023. "入库数量",
  1024. "出库数量",
  1025. "退库数量",
  1026. "实际出库",
  1027. "剩余库存",
  1028. "总库存",
  1029. ];
  1030. const filterVal = [
  1031. "index",
  1032. "drug_type_name",
  1033. "drug_name",
  1034. "specification_name",
  1035. "manufacturer_name",
  1036. "number",
  1037. "medical_insurance_number",
  1038. "stock_in_count",
  1039. "stock_out_count",
  1040. "cancle_out_count",
  1041. "act_cout",
  1042. "over_count",
  1043. "sum_count",
  1044. ];
  1045. const data = this.formatJson(filterVal, this.tableList);
  1046. excel.export_json_to_excel({
  1047. header: tHeader,
  1048. data,
  1049. filename: "药品查询",
  1050. });
  1051. this.downloadLoading = false;
  1052. });
  1053. },
  1054. formatJson(filterVal, jsonData) {
  1055. return jsonData.map((v) => filterVal.map((j) => v[j]));
  1056. },
  1057. getDrugType(id) {
  1058. var name = "";
  1059. for (let i = 0; i < this.drugTypeList.length; i++) {
  1060. if (this.drugTypeList[i].id == id) {
  1061. name = this.drugTypeList[i].name;
  1062. }
  1063. }
  1064. return name;
  1065. },
  1066. getManufacturerList(id) {
  1067. var name = "";
  1068. for (let i = 0; i < this.manufacturerList.length; i++) {
  1069. if (id == this.manufacturerList[i].id) {
  1070. name = this.manufacturerList[i].manufacturer_name;
  1071. }
  1072. }
  1073. return name;
  1074. },
  1075. getWarehoseInfoOne(arr, max_unit, min_unit, min_number) {
  1076. var total = 0;
  1077. var max_str = "";
  1078. var min_str = "";
  1079. if (arr.length > 0) {
  1080. for (let i = 0; i < arr.length; i++) {
  1081. total += parseInt(arr[i].warehousing_count);
  1082. }
  1083. }
  1084. if (total < min_number) {
  1085. min_str = total + min_unit;
  1086. }
  1087. if (total == 0) {
  1088. min_str = "";
  1089. max_str = "";
  1090. }
  1091. if (total >= min_number) {
  1092. if (parseInt(total / min_number) != 0) {
  1093. max_str = parseInt(total / min_number) + max_unit;
  1094. }
  1095. if (total % min_number != 0) {
  1096. min_str = (total % min_number) + min_unit;
  1097. }
  1098. }
  1099. return max_str + min_str;
  1100. },
  1101. getWarehouseOutInfo(arr, max_unit, min_unit, min_number) {
  1102. var min_str = "";
  1103. var max_str = "";
  1104. var total = 0;
  1105. if (arr.length > 0) {
  1106. for (let i = 0; i < arr.length; i++) {
  1107. total += parseInt(arr[i].count);
  1108. }
  1109. }
  1110. if (total < min_number) {
  1111. min_str = total + min_unit;
  1112. }
  1113. if (total == 0) {
  1114. min_str = "";
  1115. max_str = "";
  1116. }
  1117. if (total >= min_number) {
  1118. if (parseInt(total / min_number) != 0) {
  1119. max_str = parseInt(total / min_number) + max_unit;
  1120. }
  1121. if (total % min_number != 0) {
  1122. min_str = (total % min_number) + min_unit;
  1123. }
  1124. }
  1125. return max_str + min_str;
  1126. },
  1127. getStockIn(arr, max_unit, min_unit, min_number) {
  1128. var total = 0;
  1129. var max_str = "";
  1130. var min_str = "";
  1131. if (arr.length > 0) {
  1132. for (let i = 0; i < arr.length; i++) {
  1133. total += parseInt(arr[i].sum_in_count);
  1134. }
  1135. }
  1136. if (total < min_number) {
  1137. min_str = total + min_unit;
  1138. }
  1139. if (total == 0) {
  1140. min_str = "";
  1141. max_str = "";
  1142. }
  1143. if (total >= min_number) {
  1144. if (parseInt(total / min_number) != 0) {
  1145. max_str = parseInt(total / min_number) + max_unit;
  1146. }
  1147. if (total % min_number != 0) {
  1148. min_str = (total % min_number) + min_unit;
  1149. }
  1150. }
  1151. return max_str + min_str;
  1152. },
  1153. getStockOut(info, max_unit, min_unit,min_number,val){
  1154. var str = "";
  1155. var str_min = "";
  1156. //总库存
  1157. var total = 0;
  1158. var totalOne = 0
  1159. // var totalTwo = 0
  1160. if(info!=null && info.length > 0){
  1161. for (let i = 0; i < info.length; i++) {
  1162. totalOne += info[i].sum_out_count;
  1163. }
  1164. }
  1165. // if(val!=null && val.length > 0){
  1166. // for (let i = 0; i < val.length; i++) {
  1167. // totalTwo += val[i].sum_cancel_count;
  1168. // }
  1169. // }
  1170. total = totalOne
  1171. if (parseInt(total / min_number) != 0) {
  1172. str = parseInt(total / min_number) + max_unit;
  1173. }
  1174. if (total % min_number != 0) {
  1175. str_min = (total % min_number) + min_unit;
  1176. }
  1177. return str + str_min;
  1178. },
  1179. getCancleOut(info, max_unit, min_unit,min_number){
  1180. var str = "";
  1181. var str_min = "";
  1182. //总库存
  1183. var total = 0;
  1184. for (let i = 0; i < info.length; i++) {
  1185. total += info[i].sum_cancel_count;
  1186. }
  1187. if (parseInt(total / min_number) != 0) {
  1188. str = parseInt(total / min_number) + max_unit;
  1189. }
  1190. if (total % min_number != 0) {
  1191. str_min = (total % min_number) + min_unit;
  1192. }
  1193. return str + str_min;
  1194. },
  1195. getActCount(info, max_unit, min_unit,min_number){
  1196. var str = "";
  1197. var str_min = "";
  1198. //总库存
  1199. var total = 0;
  1200. for (let i = 0; i < info.length; i++) {
  1201. total += info[i].sum_act_out_count;
  1202. }
  1203. if (parseInt(total / min_number) != 0) {
  1204. str = parseInt(total / min_number) + max_unit;
  1205. }
  1206. if (total % min_number != 0) {
  1207. str_min = (total % min_number) + min_unit;
  1208. }
  1209. return str + str_min;
  1210. },
  1211. getOverCount(arr, max_unit, min_unit, min_number) {
  1212. var max_str = "";
  1213. var min_str = "";
  1214. var total = 0;
  1215. if (arr.length > 0) {
  1216. for (let i = 0; i < arr.length; i++) {
  1217. total += arr[i].flush_count
  1218. }
  1219. }
  1220. if (total < min_number) {
  1221. min_str = total + min_unit;
  1222. }
  1223. if (total == 0) {
  1224. min_str = "";
  1225. max_str = "";
  1226. }
  1227. if (total >= min_number) {
  1228. if (parseInt(total / min_number) != 0) {
  1229. max_str = parseInt(total / min_number) + max_unit;
  1230. }
  1231. if (total % min_number != 0) {
  1232. min_str = (total % min_number) + min_unit;
  1233. }
  1234. }
  1235. return max_str + min_str;
  1236. },
  1237. //修改后的
  1238. getDrugIn(storehouse_id,val,max_unit,min_unit,min_number){
  1239. var max_str = "";
  1240. var min_str = "";
  1241. var total = 0;
  1242. if(val!=null && val!=undefined){
  1243. for(let i=0;i<val.length;i++){
  1244. if(storehouse_id == val[i].storehouse_id){
  1245. total = val[i].sum_in_count
  1246. }
  1247. }
  1248. }
  1249. if (total < min_number) {
  1250. min_str = total + min_unit;
  1251. }
  1252. if (total == 0) {
  1253. min_str = "";
  1254. max_str = "";
  1255. }
  1256. if (total >= min_number) {
  1257. if (parseInt(total / min_number) != 0) {
  1258. max_str = parseInt(total / min_number) + max_unit;
  1259. }
  1260. if (total % min_number != 0) {
  1261. min_str = (total % min_number) + min_unit;
  1262. }
  1263. }
  1264. return max_str + min_str;
  1265. },
  1266. getDrugOut(storehouse_id,val,max_unit,min_unit,min_number){
  1267. var max_str = "";
  1268. var min_str = "";
  1269. var total = 0;
  1270. if(val!=null && val!=undefined){
  1271. for(let i=0;i<val.length;i++){
  1272. if(storehouse_id == val[i].storehouse_id){
  1273. total = val[i].sum_out_count
  1274. }
  1275. }
  1276. }
  1277. if (total < min_number) {
  1278. min_str = total + min_unit;
  1279. }
  1280. if (total == 0) {
  1281. min_str = "";
  1282. max_str = "";
  1283. }
  1284. if (total >= min_number) {
  1285. if (parseInt(total / min_number) != 0) {
  1286. max_str = parseInt(total / min_number) + max_unit;
  1287. }
  1288. if (total % min_number != 0) {
  1289. min_str = (total % min_number) + min_unit;
  1290. }
  1291. }
  1292. return max_str + min_str;
  1293. },
  1294. getDrugCancel(storehouse_id,val,max_unit,min_unit,min_number){
  1295. var max_str = "";
  1296. var min_str = "";
  1297. var total = 0;
  1298. if(val!=null && val!=undefined){
  1299. for(let i=0;i<val.length;i++){
  1300. if(storehouse_id == val[i].storehouse_id){
  1301. total = val[i].sum_cancel_count
  1302. }
  1303. }
  1304. }
  1305. if (total < min_number) {
  1306. min_str = total + min_unit;
  1307. }
  1308. if (total == 0) {
  1309. min_str = "";
  1310. max_str = "";
  1311. }
  1312. if (total >= min_number) {
  1313. if (parseInt(total / min_number) != 0) {
  1314. max_str = parseInt(total / min_number) + max_unit;
  1315. }
  1316. if (total % min_number != 0) {
  1317. min_str = (total % min_number) + min_unit;
  1318. }
  1319. }
  1320. return max_str + min_str;
  1321. },
  1322. getActOut(storehouse_id,val,max_unit,min_unit,min_number){
  1323. var max_str = "";
  1324. var min_str = "";
  1325. var total = 0;
  1326. if(val!=null && val!=undefined){
  1327. for(let i=0;i<val.length;i++){
  1328. if(storehouse_id == val[i].storehouse_id){
  1329. total = val[i].sum_act_out_count
  1330. }
  1331. }
  1332. }
  1333. if (total < min_number) {
  1334. min_str = total + min_unit;
  1335. }
  1336. if (total == 0) {
  1337. min_str = "";
  1338. max_str = "";
  1339. }
  1340. if (total >= min_number) {
  1341. if (parseInt(total / min_number) != 0) {
  1342. max_str = parseInt(total / min_number) + max_unit;
  1343. }
  1344. if (total % min_number != 0) {
  1345. min_str = (total % min_number) + min_unit;
  1346. }
  1347. }
  1348. return max_str + min_str;
  1349. },
  1350. getFlushCount(storehouse_id,val,max_unit,min_unit,min_number){
  1351. var max_str = "";
  1352. var min_str = "";
  1353. var total = 0;
  1354. if(val!=null && val!=undefined){
  1355. for(let i=0;i<val.length;i++){
  1356. if(storehouse_id == val[i].storehouse_id){
  1357. total = val[i].flush_count
  1358. }
  1359. }
  1360. }
  1361. if (total < min_number) {
  1362. min_str = total + min_unit;
  1363. }
  1364. if (total == 0) {
  1365. min_str = "";
  1366. max_str = "";
  1367. }
  1368. if (total >= min_number) {
  1369. if (parseInt(total / min_number) != 0) {
  1370. max_str = parseInt(total / min_number) + max_unit;
  1371. }
  1372. if (total % min_number != 0) {
  1373. min_str = (total % min_number) + min_unit;
  1374. }
  1375. }
  1376. return max_str + min_str;
  1377. },
  1378. getSumCount(val,max_unit,min_unit,min_number){
  1379. var max_str = "";
  1380. var min_str = "";
  1381. var total = 0;
  1382. if(val!=null && val!=undefined){
  1383. for(let i=0;i<val.length;i++){
  1384. total += val[i].flush_count
  1385. }
  1386. }
  1387. if (total < min_number) {
  1388. min_str = total + min_unit;
  1389. }
  1390. if (total == 0) {
  1391. min_str = "";
  1392. max_str = "";
  1393. }
  1394. if (total >= min_number) {
  1395. if (parseInt(total / min_number) != 0) {
  1396. max_str = parseInt(total / min_number) + max_unit;
  1397. }
  1398. if (total % min_number != 0) {
  1399. min_str = (total % min_number) + min_unit;
  1400. }
  1401. }
  1402. return max_str + min_str;
  1403. },
  1404. toCheck(){
  1405. getDrugInitDataList().then(response=>{
  1406. if(response.data.state == 1){
  1407. this.$message.success("保存成功!")
  1408. }
  1409. })
  1410. }
  1411. },
  1412. created(){
  1413. this.getStorehouseList()
  1414. this.getlist()
  1415. }
  1416. }
  1417. </script>
  1418. <style>
  1419. .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
  1420. font-size: 12px;
  1421. }
  1422. .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
  1423. background: #6fb5fa;
  1424. }
  1425. .count {
  1426. color: #bd2c00;
  1427. }
  1428. .el-table td,
  1429. .el-table th.is-leaf,
  1430. .el-table--border,
  1431. .el-table--group {
  1432. border-color: #d0d3da;
  1433. }
  1434. .el-table--border::after,
  1435. .el-table--group::after,
  1436. .el-table::before {
  1437. background-color: #d0d3da;
  1438. }
  1439. /* 合并表格线样式 */
  1440. .spanClass .cell {
  1441. padding: 0 !important;
  1442. }
  1443. .spanClass .cell tr {
  1444. display: inline-block;
  1445. width: 100%;
  1446. }
  1447. .spanClass .cell tr td {
  1448. padding: 10px 0;
  1449. border-bottom: 1px solid #ebeef5;
  1450. display: block;
  1451. width: 100%;
  1452. }
  1453. .spanClass .cell tr:last-of-type td {
  1454. border-bottom: none;
  1455. }
  1456. </style>