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

query.vue 28KB

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