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

query.vue 29KB

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