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

query.vue 30KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs="crumbs"></bread-crumb>
  5. <div>
  6. <el-button
  7. size="small"
  8. class="filter-item"
  9. type="primary"
  10. @click="setting"
  11. >设置
  12. </el-button
  13. >
  14. <el-button
  15. size="small"
  16. class="filter-item"
  17. type="primary"
  18. icon="el-icon-printer"
  19. @click="printOrder"
  20. >打印
  21. </el-button>
  22. <el-button
  23. size="small"
  24. class="filter-item"
  25. type="primary"
  26. @click="exportStock"
  27. >导出
  28. </el-button>
  29. </div>
  30. </div>
  31. <div class="app-container ">
  32. <div class="cell clearfix">
  33. <el-select v-model="drug_type" style="width:160px;margin-right:10px;" placeholder="请选择" @change="changeDrug">
  34. <el-option
  35. v-for="(item,index) in drugTypeList"
  36. :key="index"
  37. :label="item.name"
  38. :value="item.id">
  39. </el-option>
  40. </el-select>
  41. <el-date-picker
  42. v-model="start_time"
  43. prefix-icon="el-icon-date"
  44. :editable="false"
  45. style="width: 196px;"
  46. type="date"
  47. placeholder="选择日期时间"
  48. align="right"
  49. format="yyyy-MM-dd"
  50. value-format="yyyy-MM-dd"
  51. @change="startTimeChange"
  52. ></el-date-picker>-
  53. <el-date-picker
  54. v-model="end_time"
  55. prefix-icon="el-icon-date"
  56. :editable="false"
  57. style="width: 196px;margin-right:10px;"
  58. type="date"
  59. placeholder="选择日期时间"
  60. align="right"
  61. format="yyyy-MM-dd"
  62. value-format="yyyy-MM-dd"
  63. @change="endTimeChange"
  64. ></el-date-picker>
  65. <el-input
  66. style="width: 200px;"
  67. class="filter-item"
  68. v-model.trim="keywords"
  69. placeholder="药品名称"
  70. />
  71. <el-button
  72. size="small"
  73. class="filter-item"
  74. type="primary"
  75. icon="el-icon-search"
  76. @click="search"
  77. >搜索
  78. </el-button>
  79. </div>
  80. <el-table :data="tableList" border style="width: 100%">
  81. <el-table-column prop="drug_type" label="药品类型" width="180" align="center">
  82. <template slot-scope="scope">
  83. {{getDrugType(scope.row.drug_type)}}
  84. </template>
  85. </el-table-column>
  86. <el-table-column prop="drug_name" label="药品名称" align="center">
  87. <template slot-scope="scope">
  88. {{scope.row.drug_name}}
  89. </template>
  90. </el-table-column>
  91. <el-table-column prop="drug_name" label="规格&&单位" align="center">
  92. <template slot-scope="scope">
  93. {{scope.row.dose + scope.row.dose_unit +"*"+scope.row.min_number+scope.row.min_unit+"/"+scope.row.max_unit}}
  94. </template>
  95. </el-table-column>
  96. <el-table-column prop="drug_name" label="国家编码" align="center">
  97. <template slot-scope="scope">
  98. {{scope.row.medical_insurance_number}}
  99. </template>
  100. </el-table-column>
  101. <el-table-column prop="drug_name" label="进货单价" align="center">
  102. <template slot-scope="scope">
  103. {{scope.row.last_price}}
  104. </template>
  105. </el-table-column>
  106. <el-table-column prop="drug_name" label="厂家" align="center">
  107. <template slot-scope="scope">
  108. {{getManufacturerList(scope.row.manufacturer)}}
  109. </template>
  110. </el-table-column>
  111. <el-table-column prop="drug_name" label="入库数量" align="center">
  112. <template slot-scope="scope">
  113. <span v-if="getWarehoseInfo(scope.row.drug_warehouse_info)>0">
  114. {{getWarehoseInfoOne(scope.row.drug_warehouse_info,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}
  115. </span>
  116. </template>
  117. </el-table-column>
  118. <el-table-column prop="drug_name" label="出库数量" align="center" v-if="showOne">
  119. <template slot-scope="scope">
  120. <span>
  121. {{getOutFlush(scope.row.drug_warehouse_info,scope.row.max_unit,scope.row.min_unit,scope.row.min_number,scope.row.drug_cancel_stock_info)}}
  122. </span>
  123. </template>
  124. </el-table-column>
  125. <el-table-column prop="drug_name" label="出库数量" align="center" v-if="showTwo">
  126. <template slot-scope="scope">
  127. <span>{{getOutCount(scope.row.id)+getAutoCount(scope.row.id)}}{{scope.row.max_unit}}</span>
  128. </template>
  129. </el-table-column>
  130. <el-table-column prop="drug_name" label="剩余库存量" align="center" v-if="showThree">
  131. <template slot-scope="scope">
  132. <div v-if="getWarehoseInfo(scope.row.drug_warehouse_info)>0">
  133. {{ getOverFlushInfo(scope.row.drug_warehouse_info,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)?getOverFlushInfo(scope.row.drug_warehouse_info,scope.row.max_unit,scope.row.min_unit,scope.row.min_number):0}}
  134. </div>
  135. </template>
  136. </el-table-column>
  137. <el-table-column prop="drug_name" label="剩余库存量" align="center" v-if="showFour">
  138. <template slot-scope="scope">
  139. <div v-if="getWarehoseInfo(scope.row.drug_warehouse_info) >0">
  140. <span>{{getWarehoseInfo(scope.row.drug_warehouse_info) - getOutCount(scope.row.id) - getAutoCount(scope.row.id)}}{{scope.row.max_unit}} </span>
  141. </div>
  142. </template>
  143. </el-table-column>
  144. <el-table-column prop="drug_name" label="操作" align="center" width="200px">
  145. <template slot-scope="scope">
  146. <el-button
  147. size="small"
  148. type="primary"
  149. @click="handleDetail(scope.row)"
  150. >库存流水
  151. </el-button>
  152. <el-button
  153. size="small"
  154. type="primary"
  155. @click="handleBatch(scope.row)"
  156. >批次
  157. </el-button>
  158. </template>
  159. </el-table-column>
  160. </el-table>
  161. <el-pagination
  162. @size-change="handleSizeChange"
  163. @current-change="handleCurrentChange"
  164. :page-sizes="[10, 50, 100,200,500,1000]"
  165. :page-size="10"
  166. background
  167. align="right"
  168. style="margin-top:20px;"
  169. layout="total, sizes, prev, pager, next, jumper"
  170. :total="total"
  171. >
  172. </el-pagination>
  173. </div>
  174. <setting-dialog
  175. ref="dialog"
  176. ></setting-dialog>
  177. </div>
  178. </template>
  179. <script>
  180. import { uParseTime } from '@/utils/tools'
  181. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  182. import { getDrugStockList,getDrugCountList } from '@/api/drug/drug_stock'
  183. import SettingDialog from './settingDialog/index'
  184. import { getDictionaryDataConfig } from "@/utils/data";
  185. import { min } from 'moment'
  186. export default {
  187. name: 'stockIn',
  188. created() {
  189. var start_time = window.sessionStorage.getItem('start_time')
  190. var end_time = window.sessionStorage.getItem('end_time')
  191. if(start_time !=null){
  192. this.start_time = start_time
  193. }
  194. if(end_time!=null){
  195. this.end_time = end_time
  196. }
  197. window.sessionStorage.removeItem('start_time')
  198. window.sessionStorage.removeItem('end_time')
  199. this.getlist()
  200. var drugCategory = getDictionaryDataConfig('system','drug_category')
  201. this.drugCategory.push(...drugCategory)
  202. var drugTypeList = getDictionaryDataConfig('system','drug_type')
  203. this.drugTypeList.push(...drugTypeList)
  204. this.org_id = this.$store.getters.xt_user.org.id
  205. console.log("机构ID",this.org_id)
  206. // this.getDrugCountList()
  207. },
  208. components: {
  209. SettingDialog,
  210. BreadCrumb
  211. },
  212. data() {
  213. return {
  214. crumbs: [
  215. { path: false, name: '库存管理' },
  216. { path: '/stock/drugs/stock/query', name: '药品库存查询' }
  217. ],
  218. keywords: '',
  219. multipleSelection: [],
  220. signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
  221. start_time: '',
  222. end_time: '',
  223. page: 1,
  224. limit: 10,
  225. total: 0,
  226. goodType: [],
  227. goodInfo: [],
  228. tempArr: [],
  229. sameRowArr: [],
  230. WarehouseInfo: {
  231. loading: false,
  232. warehouseInfoDate: []
  233. },
  234. tableData:[],
  235. drug_category:0,
  236. drugCategory:[
  237. {id:0,name:"全部"}
  238. ],
  239. drugTypeList:[
  240. {id:0,name:"全部"}
  241. ],
  242. tableList:[],
  243. manufacturerList:[],
  244. countList:[],
  245. outCountList:[],
  246. autoCountList:[],
  247. keyword:"",
  248. drug_type:0,
  249. minCount:[],
  250. drugOutList:[],
  251. cancelCountList:[],
  252. allCountList:[],
  253. org_id:"",
  254. showOne:true,
  255. showTwo:false,
  256. showThree:true,
  257. showFour:false,
  258. }
  259. },
  260. methods: {
  261. //获取库存
  262. getlist(){
  263. const params = {
  264. page: this.page,
  265. limit: this.limit,
  266. keyword: this.keywords,
  267. drug_type:this.drug_type,
  268. start_time:this.start_time,
  269. end_time:this.end_time,
  270. }
  271. getDrugStockList(params).then(response=>{
  272. if(response.data.state == 1){
  273. var list = response.data.data.list
  274. for(let i=0;i<list.length;i++){
  275. for(let j=0;j<list[i].drug_warehouse_info.length;j++){
  276. if(list[i].max_unit == list[i].drug_warehouse_info[j].max_unit){
  277. list[i].drug_warehouse_info[j].stock_max_number = list[i].min_number * list[i].drug_warehouse_info[j].stock_max_number
  278. list[i].drug_warehouse_info[j].warehousing_count = list[i].min_number * list[i].drug_warehouse_info[j].warehousing_count
  279. }
  280. }
  281. for(let y=0;y<list[i].drug_warehouse_out.length;y++){
  282. if(list[i].drug_warehouse_out[y].count_unit == list[i].max_unit){
  283. list[i].drug_warehouse_out[y].count = list[i].drug_warehouse_out[y].count * list[i].min_number
  284. }
  285. }
  286. for(let z=0;z<list[i].drug_cancel_stock_info.length;z++){
  287. if(list[i].drug_cancel_stock_info[z].max_unit == list[i].max_unit){
  288. list[i].drug_cancel_stock_info[z].count = list[i].drug_cancel_stock_info[z].count * list[i].min_number
  289. }
  290. }
  291. }
  292. console.log("列表list232323323232323223",list)
  293. this.tableList = list
  294. var total = response.data.data.total
  295. this.total = total
  296. this.manufacturerList = response.data.data.manufacturerList
  297. }
  298. })
  299. },
  300. handleSpanTempArr() {
  301. this.tempArr = []
  302. for (let i = 0; i < this.WarehouseInfo.warehouseInfoDate.length; i++) {
  303. if (i === 0) {
  304. this.tempArr.push(1)
  305. this.pos = 0
  306. } else {
  307. // 判断当前元素与上一个元素是否相同
  308. if (this.WarehouseInfo.warehouseInfoDate[i].drug_name === this.WarehouseInfo.warehouseInfoDate[i - 1].drug_name) {
  309. this.tempArr[this.pos] += 1
  310. this.tempArr.push(0)
  311. } else {
  312. this.tempArr.push(1)
  313. this.pos = i
  314. }
  315. }
  316. }
  317. let sameRowArr = [], sIdx = 0
  318. this.WarehouseInfo.warehouseInfoDate.forEach((item, index) => {
  319. item.index = index
  320. if (index === 0) {
  321. sameRowArr.push([index])
  322. } else {
  323. if (item.drug_name === this.WarehouseInfo.warehouseInfoDate[index - 1].drug_name) {
  324. sameRowArr[sIdx].push(index)
  325. } else {
  326. sIdx = sIdx + 1
  327. sameRowArr.push([index])
  328. }
  329. }
  330. })
  331. this.sameRowArr = sameRowArr
  332. },
  333. merge({ row, column, rowIndex, columnIndex }) {
  334. if (columnIndex === 0) {
  335. const _row = this.tempArr[rowIndex]
  336. const _col = _row > 0 ? 1 : 0
  337. return {
  338. rowspan: _row,
  339. colspan: _col
  340. }
  341. }
  342. },
  343. getSpecificationName: function(id) {
  344. let name = ''
  345. for (let i = 0; i < this.goodInfo.length; i++) {
  346. if (this.goodInfo[i].id == id) {
  347. name = this.goodInfo[i].specification_name
  348. }
  349. }
  350. return name
  351. },
  352. getTypeName: function(id) {
  353. let name = ''
  354. for (let i = 0; i < this.goodType.length; i++) {
  355. if (this.goodType[i].id == id) {
  356. name = this.goodType[i].type_name
  357. }
  358. }
  359. return name
  360. },
  361. handleBack: function() {
  362. this.$router.go(-1)
  363. },
  364. handleSizeChange(val) {
  365. this.limit = val
  366. this.getlist()
  367. },
  368. handleCurrentChange(val) {
  369. this.page = val
  370. this.getlist()
  371. },
  372. calculate: function(val) {
  373. return Math.round(parseFloat(val) * 100) / 100
  374. },
  375. startTimeChange: function(val) {
  376. window.sessionStorage.removeItem('start_time')
  377. var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
  378. if (time > 0) {
  379. this.$message.error("开始时间不能大于结束时间");
  380. this.start_time = "";
  381. } else {
  382. this.getlist()
  383. }
  384. },
  385. endTimeChange: function(val) {
  386. window.sessionStorage.removeItem('end_time')
  387. var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
  388. if (time < 0) {
  389. this.$message.error("结束时间不能小于开始时间");
  390. this.end_time = "";
  391. } else {
  392. if(this.end_time == ""){
  393. this.showOne = true
  394. this.showTwo = false
  395. this.showThree = true
  396. this.showFour = false
  397. this.getlist()
  398. }
  399. if(this.end_time !=""){
  400. this.showOne = false
  401. this.showTwo = true
  402. this.showThree = false
  403. this.showFour = true
  404. this.getlist()
  405. this.getDrugCountList()
  406. }
  407. }
  408. },
  409. stockInCount: function(row) {
  410. let total = 0
  411. for (let i = 0; i < row.query_drug_warehousing_info.length; i++) {
  412. total = total + row.query_drug_warehousing_info[i].warehousing_count
  413. }
  414. return total
  415. },
  416. salesReturnCount: function(row) {
  417. let total = 0
  418. for (let i = 0; i < row.query_drug_sales_return_info.length; i++) {
  419. total = total + row.query_drug_sales_return_info[i].count
  420. }
  421. return total
  422. },
  423. stockOutCount: function(row) {
  424. let total = 0
  425. for (let i = 0; i < row.query_drug_warehouseout_info.length; i++) {
  426. total = total + row.query_drug_warehouseout_info[i].count
  427. }
  428. return total
  429. },
  430. cancelStockCount: function(row) {
  431. let total = 0
  432. for (let i = 0; i < row.query_drug_cancel_stock_info.length; i++) {
  433. total = total + row.query_drug_cancel_stock_info[i].count
  434. }
  435. return total
  436. },
  437. search: function() {
  438. this.getlist()
  439. },
  440. setting: function() {
  441. this.$refs.dialog.show()
  442. },
  443. exportStock(){
  444. for(let i=0;i<this.tableList.length;i++){
  445. this.tableList[i].index = i+1
  446. this.tableList[i].drug_type_name = this.getDrugType(this.tableList[i].drug_type)
  447. this.tableList[i].unit = this.tableList[i].dose + this.tableList[i].dose_unit +"*"+this.tableList[i].min_number+this.tableList[i].min_unit+"/"+this.tableList[i].max_unit
  448. this.tableList[i].manufacturer_name = this.getManufacturerList(this.tableList[i].manufacturer)
  449. this.tableList[i].inCount = this.getWarehoseInfoOne(this.tableList[i].drug_warehouse_info,this.tableList[i].max_unit,this.tableList[i].min_unit,this.tableList[i].min_number)
  450. if(this.end_time == 0){
  451. this.tableList[i].outCount = this.getWarehouseOutInfo(this.tableList[i].drug_warehouse_out,this.tableList[i].max_unit,this.tableList[i].min_unit,this.tableList[i].min_number)
  452. this.tableList[i].overplusCount = this.getOverFlushInfo(this.tableList[i].drug_warehouse_info,this.tableList[i].max_unit,this.tableList[i].min_unit,this.tableList[i].min_number)
  453. }
  454. if(this.end_time!=0){
  455. this.tableList[i].outCount = this.getOutCount(this.tableList[i].id)+ this.getAutoCount(this.tableList[i].id)
  456. this.tableList[i].overplusCount = this.getWarehoseInfo(this.tableList[i].drug_warehouse_info) - this.getOutCount(this.tableList[i].id) - this.getAutoCount(this.tableList[i].id)
  457. }
  458. }
  459. import('@/vendor/Export2Excel').then(excel => {
  460. const tHeader = ['序号', '药品类型', '药品名称','规格型号&单位','国家编码','进货单价','厂家','入库数量','出库数量','剩余库存量']
  461. const filterVal = ['index', 'drug_type_name', 'drug_name','unit','medical_insurance_number','last_price','manufacturer_name','inCount','outCount','overplusCount']
  462. const data = this.formatJson(filterVal, this.tableList)
  463. excel.export_json_to_excel({
  464. header: tHeader,
  465. data,
  466. filename: '药品查询'
  467. })
  468. this.downloadLoading = false
  469. })
  470. },
  471. formatJson(filterVal, jsonData) {
  472. return jsonData.map(v => filterVal.map(j => v[j]));
  473. },
  474. getDictionaryDataConfig(module, filed_name) {
  475. return getDictionaryDataConfig(module, filed_name)
  476. },
  477. getTimestamp(time) { // 把时间日期转成时间戳
  478. return (new Date(time)).getTime() / 1000
  479. },
  480. changeDrug(){
  481. this.getlist()
  482. },
  483. printOrder(){
  484. window.sessionStorage.setItem('start_time',this.start_time)
  485. window.sessionStorage.setItem('end_time',this.end_time)
  486. this.$router.push({
  487. name: "drugQueryPrint",
  488. query: {drug_type:this.drug_type,keyword:this.keywords,start_time:this.start_time,end_time:this.end_time,page:this.page,limit:this.limit}
  489. });
  490. },
  491. getDrugType(id){
  492. var name = ""
  493. for(let i=0;i<this.drugTypeList.length;i++){
  494. if(this.drugTypeList[i].id == id){
  495. name = this.drugTypeList[i].name
  496. }
  497. }
  498. return name
  499. },
  500. getManufacturerList(id){
  501. var name = ""
  502. for(let i=0;i<this.manufacturerList.length;i++){
  503. if(id == this.manufacturerList[i].id){
  504. name = this.manufacturerList[i].manufacturer_name
  505. }
  506. }
  507. return name
  508. },
  509. handleDetail(val){
  510. console.log("val232332323223323",val)
  511. var manufacturer_name = ""
  512. for(let i=0;i<this.manufacturerList.length;i++){
  513. if(val.manufacturer == this.manufacturerList[i].id){
  514. manufacturer_name = this.manufacturerList[i].manufacturer_name
  515. }
  516. }
  517. var unit = val.dose + val.dose_unit +"*"+val.min_number+val.min_unit+"/"+val.max_unit
  518. var over_plus = this.getOverFlushInfo(val.drug_warehouse_info,val.max_unit,val.min_unit,val.min_number)
  519. this.$router.push({path:'/drugstock/in/drugstockflow?drug_id='+val.id+"&manufacturer="+manufacturer_name+"&unit="+unit+"&min_number="+val.min_number+"&max_unit="+val.max_unit+"&min_unit="+val.min_unit+"&over_plus="+over_plus})
  520. window.sessionStorage.setItem('start_time',this.start_time)
  521. window.sessionStorage.setItem('end_time',this.end_time)
  522. },
  523. handleBatch(val){
  524. console.log("val322332323232",val)
  525. var manufacturer_name = ""
  526. for(let i=0;i<this.manufacturerList.length;i++){
  527. if(val.manufacturer == this.manufacturerList[i].id){
  528. manufacturer_name = this.manufacturerList[i].manufacturer_name
  529. }
  530. }
  531. var unit = val.dose + val.dose_unit +"*"+val.min_number+val.min_unit+"/"+val.max_unit
  532. var over_plus = this.getOverFlushInfo(val.drug_warehouse_info,val.max_unit,val.min_unit,val.min_number)
  533. window.sessionStorage.setItem('start_time',this.start_time)
  534. window.sessionStorage.setItem('end_time',this.end_time)
  535. this.$router.push({path:'/drugstock/in/drugbatchnumber?drug_id='+val.id+"&manufacturer="+manufacturer_name+"&unit="+unit+"&min_number="+val.min_number+"&max_unit="+val.max_unit+"&min_unit="+val.min_unit+"&over_plus="+over_plus})
  536. },
  537. getDrugCountList(){
  538. var params = {
  539. keyword: this.keywords,
  540. start_time:this.start_time,
  541. end_time:this.end_time,
  542. }
  543. console.log("paramsw2ww",params)
  544. getDrugCountList(params).then(response=>{
  545. if(response.data.state == 1){
  546. var minCount = response.data.data.minCount
  547. console.log("minCount",minCount)
  548. this.minCount = minCount
  549. var cancelCountList = response.data.data.cancelCountList
  550. this.cancelCountList = cancelCountList
  551. var info = response.data.data.info
  552. for(let i=0;i<info.length;i++){
  553. if(info[i].count_unit == info[i].max_unit){
  554. info[i].count = info[i].count * info[i].min_number
  555. }
  556. }
  557. this.outCountList = response.data.data.outCountList
  558. console.log("手动出库",this.outCountList)
  559. this.auCountList = response.data.data.auCountList
  560. console.log("自动出库",this.auCountList)
  561. this.drugOutList = info
  562. }
  563. })
  564. },
  565. getInCount(id){
  566. var count = 0
  567. for(let i=0;i<this.countList.length;i++){
  568. if(id == this.countList[i].drug_id){
  569. count = this.countList[i].count
  570. }
  571. }
  572. return count
  573. },
  574. getOutCount(id){
  575. var count = 0
  576. for(let i=0;i<this.outCountList.length;i++){
  577. if(id == this.outCountList[i].drug_id){
  578. count = this.outCountList[i].count
  579. }
  580. }
  581. return count
  582. },
  583. getAutoCount(id){
  584. var count= 0
  585. for(let i=0;i<this.autoCountList.length;i++){
  586. if(id == this.autoCountList[i].drug_id){
  587. count = this.autoCountList[i].count
  588. }
  589. }
  590. return count
  591. },
  592. getMinCount(id){
  593. var count= 0
  594. for(let i=0;i<this.minCount.length;i++){
  595. if(id == this.minCount[i].drug_id){
  596. count = this.minCount[i].count
  597. }
  598. }
  599. return count
  600. },
  601. getCount(drug_id,min_number,max_unit,min_unit){
  602. var total= 0
  603. var str = ""
  604. var min_str = ""
  605. var arr = []
  606. for(let i=0;i<this.allCountList.length;i++){
  607. if(drug_id == this.allCountList[i].drug_id){
  608. arr.push(this.allCountList[i])
  609. }
  610. }
  611. var arrTwo = []
  612. for(let i=0;i<arr.length;i++){
  613. if(arr[i].drug_id == 1236){
  614. arrTwo.push(arr[i])
  615. }
  616. if(arr[i].count_unit == max_unit){
  617. arr[i].count = arr[i].count * min_number
  618. }
  619. if(arr[i].count_unit == min_unit){
  620. arr[i].count = arr[i].count
  621. }
  622. total += arr[i].count
  623. }
  624. if(total<min_number){
  625. str = ""
  626. min_str = total + min_unit
  627. }
  628. if(total >= min_number){
  629. if(parseInt(total/min_number)!=0){
  630. str = parseInt(total/min_number)+ max_unit
  631. }
  632. if((total%min_number)!=0){
  633. min_str = total%min_number + min_unit
  634. }
  635. }
  636. return str + min_str
  637. },
  638. getCountOne(drug_id){
  639. var count= 0
  640. for(let i=0;i<this.drugOutList.length;i++){
  641. if(drug_id == this.drugOutList[i].drug_id){
  642. count += parseInt(this.drugOutList[i].count)
  643. }
  644. }
  645. return count
  646. },
  647. getCountTwo(drug_id,min_number,max_unit,min_unit){
  648. var total_count = 0
  649. var out_count = 0
  650. var count = 0
  651. var str = ""
  652. var str_min = ""
  653. total_count = this.getInCount(drug_id) * min_number
  654. out_count = this.getCountOne(drug_id)
  655. count = total_count-out_count
  656. if(parseInt(count/min_number)!=0){
  657. str = parseInt(count/min_number) + max_unit
  658. }
  659. if((count%min_number)!=0){
  660. str_min = count%min_number + min_unit
  661. }
  662. return str+str_min
  663. },
  664. getCancelCount(id){
  665. var count= 0
  666. for(let i=0;i<this.cancelCountList.length;i++){
  667. if(id == this.cancelCountList[i].drug_id){
  668. count = this.cancelCountList[i].count
  669. }
  670. }
  671. return count
  672. },
  673. getWarehoseInfo(arr){
  674. var total = 0
  675. if (arr.length > 0) {
  676. for(let i=0;i<arr.length;i++){
  677. total += parseInt(arr[i].warehousing_count)
  678. }
  679. }
  680. if(total == 0){
  681. total = ""
  682. }
  683. return total
  684. },
  685. getWarehoseInfoOne(arr,max_unit,min_unit,min_number){
  686. var total = 0
  687. var max_str= ""
  688. var min_str = ""
  689. if (arr.length > 0) {
  690. for(let i=0;i<arr.length;i++){
  691. total += parseInt(arr[i].warehousing_count)
  692. }
  693. }
  694. if (total < min_number){
  695. min_str = total + min_unit
  696. }
  697. if (total == 0) {
  698. min_str = ""
  699. max_str = ""
  700. }
  701. if (total >=min_number) {
  702. if(parseInt(total/min_number)!=0){
  703. max_str = parseInt(total/min_number) + max_unit
  704. }
  705. if(total%min_number!=0){
  706. min_str = total%min_number + min_unit
  707. }
  708. }
  709. return max_str + min_str
  710. },
  711. getOverFlushInfo(arr,max_unit,min_unit,min_number){
  712. var max_str= ""
  713. var min_str = ""
  714. var total = 0
  715. var newarr = arr
  716. if(newarr.length > 0 ){
  717. for(let i=0;i<newarr.length;i++){
  718. total += (newarr[i].stock_max_number+newarr[i].stock_min_number)
  719. }
  720. }
  721. if (total < min_number){
  722. min_str = total + min_unit
  723. }
  724. if (total == 0) {
  725. min_str = ""
  726. max_str = ""
  727. }
  728. if (total >=min_number) {
  729. if(parseInt(total/min_number)!=0){
  730. max_str = parseInt(total/min_number) + max_unit
  731. }
  732. if(total%min_number!=0){
  733. min_str = total%min_number + min_unit
  734. }
  735. }
  736. return max_str + min_str
  737. },
  738. getWarehouseOutInfo(arr,max_unit,min_unit,min_number){
  739. var min_str = ""
  740. var max_str = ""
  741. var total = 0
  742. if (arr.length > 0) {
  743. for(let i=0;i<arr.length;i++){
  744. total += parseInt(arr[i].count)
  745. }
  746. }
  747. if (total < min_number){
  748. min_str = total + min_unit
  749. }
  750. if (total == 0) {
  751. min_str = ""
  752. max_str = ""
  753. }
  754. if (total >=min_number) {
  755. if(parseInt(total/min_number)!=0){
  756. max_str = parseInt(total/min_number) + max_unit
  757. }
  758. if(total%min_number!=0){
  759. min_str = total%min_number + min_unit
  760. }
  761. }
  762. return max_str + min_str
  763. },
  764. getDrugOutList(arr,max_unit,min_unit,min_number){
  765. var str = ""
  766. var str_min = ""
  767. if(arr.length > 0){
  768. for(let i=0;i<arr.length;i++){
  769. if(parseInt(arr[i].count/min_number)!=0){
  770. str = parseInt(arr[i].count/min_number)+ max_unit
  771. }
  772. if(arr[i].count%min_number !=0){
  773. str_min = arr[i].count%min_number + min_unit
  774. }
  775. }
  776. }
  777. return str + str_min
  778. },
  779. getDrugChaCount(info,out_info,max_unit,min_unit,min_number,cancel_info){
  780. var total_info = 0
  781. var total_out = 0
  782. var cha_count = 0
  783. var cancel_count = 0
  784. if(info.length > 0 ){
  785. for(let i=0;i<info.length;i++){
  786. total_info += info[i].warehousing_count * min_number
  787. }
  788. }
  789. if(out_info.length>0){
  790. for(let j=0;j<out_info.length;j++){
  791. total_out += out_info[j].count
  792. }
  793. }
  794. if(cancel_info.length >0){
  795. for(let z=0;z<cancel_info.length;z++){
  796. cancel_count +=cancel_info[z].count
  797. }
  798. }
  799. cha_count = total_info - total_out + cancel_count
  800. var str = ""
  801. var str_min = ""
  802. if(parseInt(cha_count/min_number)!=0){
  803. str = parseInt(cha_count/min_number)+ max_unit
  804. }
  805. if(cha_count%min_number !=0){
  806. str_min = cha_count%min_number + min_unit
  807. }
  808. return str + str_min
  809. },
  810. getOutFlush(info,max_unit,min_unit,min_number,cancel_info){
  811. var str = ""
  812. var str_min = ""
  813. //总库存
  814. var total = 0
  815. var out_count = 0
  816. var over_count = 0
  817. var cancel_count = 0
  818. for(let i=0;i<info.length;i++){
  819. total += info[i].warehousing_count
  820. }
  821. for(let j=0;j<info.length;j++){
  822. out_count += (info[j].stock_max_number + info[j].stock_min_number)
  823. }
  824. // for(let z=0;z<cancel_info.length;z++){
  825. // cancel_count += cancel_info[z].count
  826. // }
  827. // over_count = total - out_count + cancel_count
  828. over_count = total - out_count
  829. if(parseInt(over_count/min_number)!=0){
  830. str = parseInt(over_count/min_number)+ max_unit
  831. }
  832. if(over_count%min_number !=0){
  833. str_min = over_count%min_number + min_unit
  834. }
  835. return str+str_min
  836. }
  837. }
  838. }
  839. </script>
  840. <style rel="stylesheet/css" lang="scss" scoped>
  841. .information {
  842. border: 1px #dcdfe6 solid;
  843. padding: 30px 20px 30px 20px;
  844. .border {
  845. border-bottom: 1px #dcdfe6 solid;
  846. margin: 0px 0 20px 0;
  847. }
  848. }
  849. .title {
  850. background: #409eff;
  851. height: 44px;
  852. line-height: 44px;
  853. padding: 0 0 0 10px;
  854. color: #fff;
  855. margin: 0 0 10px 0;
  856. }
  857. .edit_separater {
  858. border-top: 1px solid rgb(233, 233, 233);
  859. margin-top: 15px;
  860. margin-bottom: 15px;
  861. }
  862. </style>
  863. <style>
  864. .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
  865. font-size: 12px;
  866. }
  867. .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
  868. background: #6fb5fa;
  869. }
  870. .count {
  871. color: #bd2c00;
  872. }
  873. .el-table td,
  874. .el-table th.is-leaf,
  875. .el-table--border,
  876. .el-table--group {
  877. border-color: #d0d3da;
  878. }
  879. .el-table--border::after,
  880. .el-table--group::after,
  881. .el-table::before {
  882. background-color: #d0d3da;
  883. }
  884. </style>