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

query.vue 24KB

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