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

query.vue 27KB

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