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

drugStockFlow.vue 28KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs="crumbs"></bread-crumb>
  5. </div>
  6. <div class="app-container ">
  7. <div class="cell clearfix">
  8. 药品名称:<span>{{getName(this.$route.query.drug_id)}}</span>&nbsp;
  9. 库存: {{this.$route.query.over_plus}}
  10. 规格:<span>{{drug.dose}}{{drug.dose_unit}}*{{drug.min_number}}{{drug.min_unit}}/{{drug.max_unit}}</span>&nbsp;
  11. 厂家:<span>{{this.$route.query.manufacturer}}</span>&nbsp;
  12. </div>
  13. <div class="cell clearfix">
  14. <span>日期查询:</span>
  15. <el-date-picker
  16. size="small"
  17. v-model="start_time"
  18. prefix-icon="el-icon-date"
  19. :editable="false"
  20. style="width: 196px;"
  21. type="date"
  22. placeholder="选择日期时间"
  23. align="right"
  24. format="yyyy-MM-dd"
  25. value-format="yyyy-MM-dd"
  26. @change="startTimeChange"
  27. ></el-date-picker>-
  28. <el-date-picker
  29. size="small"
  30. v-model="end_time"
  31. prefix-icon="el-icon-date"
  32. :editable="false"
  33. style="width: 196px;margin-right:10px;"
  34. type="date"
  35. placeholder="选择日期时间"
  36. align="right"
  37. format="yyyy-MM-dd"
  38. value-format="yyyy-MM-dd"
  39. @change="endTimeChange"
  40. ></el-date-picker>
  41. <span>出入库方式:</span>
  42. <el-select v-model="stock_type" style="width:160px;margin-right:10px;" placeholder="请选择" @change="changeDrug">
  43. <el-option
  44. v-for="(item,index) in stockType"
  45. :key="index"
  46. :label="item.name"
  47. :value="item.id">
  48. </el-option>
  49. </el-select>
  50. <span>
  51. <el-button type="primary" size="small" @click="toExprot">导出</el-button>
  52. </span>
  53. </div>
  54. <el-table
  55. :data="tableList"
  56. border
  57. style="width: 100%">
  58. <el-table-column prop="date" label="序号" width="180" align="center">
  59. <template slot-scope="scope">
  60. {{scope.$index + 1}}
  61. </template>
  62. </el-table-column>
  63. <el-table-column prop="drug_type" label="出入库方式" width="180" align="center">
  64. <template slot-scope="scope">
  65. <span v-if="scope.row.consumable_type == 1">手动入库</span>
  66. <span v-if="scope.row.consumable_type == 2">手动出库</span>
  67. <span v-if="scope.row.consumable_type == 3">自动出库</span>
  68. <span v-if="scope.row.consumable_type == 4">手动退库</span>
  69. <span v-if="scope.row.consumable_type == 7">自动退库</span>
  70. <span v-if="scope.row.consumable_type == 5">报损数量</span>
  71. <span v-if="scope.row.consumable_type == 10">盘盈</span>
  72. <span v-if="scope.row.consumable_type == 11">盘亏</span>
  73. <span v-if="scope.row.consumable_type == 12">调拨出库</span>
  74. <span v-if="scope.row.consumable_type == 13">调拨入库</span>
  75. <span v-if="scope.row.consumable_type == 15">结算出库</span>
  76. </template>
  77. </el-table-column>
  78. <el-table-column prop="drug_name" label="出/入库单据编码" align="center">
  79. <template slot-scope="scope">
  80. <span v-if="scope.row.consumable_type == 1">{{scope.row.warehousing_order}}</span>
  81. <span v-if="scope.row.consumable_type == 2 || scope.row.consumable_type == 3 || scope.row.consumable_type == 12 || scope.row.consumable_type == 15">{{scope.row.warehouse_out_order_number}}</span>
  82. <span v-if="scope.row.consumable_type == 4 || scope.row.consumable_type == 7">{{scope.row.cancel_order_number}}</span>
  83. <span v-if="scope.row.consumable_type == 5">{{scope.row.warehouse_out_order_number}}</span>
  84. <span v-if="scope.row.consumable_type == 10 || scope.row.consumable_type == 11 || scope.row.consumable_type == 13">{{scope.row.warehousing_order}}</span>
  85. </template>
  86. </el-table-column>
  87. <el-table-column prop="drug_name" label="操作日期" align="center">
  88. <template slot-scope="scope">
  89. {{getTime(scope.row.ctime,"{y}-{h}-{d}")}}
  90. </template>
  91. </el-table-column>
  92. <el-table-column prop="drug_name" label="仓库名称" align="center">
  93. <template slot-scope="scope">
  94. <span>{{getHouseName(scope.row.storehouse_id)}}</span>
  95. </template>
  96. </el-table-column>
  97. <el-table-column prop="drug_name" label="数量&单位" align="center">
  98. <template slot-scope="scope">
  99. <span v-if="scope.row.consumable_type != 2 && scope.row.consumable_type != 3 && scope.row.consumable_type != 5 && scope.row.consumable_type != 7">{{scope.row.count}}{{scope.row.max_unit}}</span>
  100. <span v-if="(scope.row.consumable_type == 2 || scope.row.consumable_type == 3 || scope.row.consumable_type == 5 || scope.row.consumable_type == 7) && parseInt(scope.row.count/scope.row.BaseDrugLib.min_number) >0">{{parseInt(scope.row.count/scope.row.BaseDrugLib.min_number)}}{{scope.row.BaseDrugLib.max_unit}}</span>
  101. <span v-if="(scope.row.consumable_type == 2 || scope.row.consumable_type == 3 || scope.row.consumable_type == 5 || scope.row.consumable_type == 7) && scope.row.count%scope.row.BaseDrugLib.min_number >0">{{scope.row.count%scope.row.BaseDrugLib.min_number}}{{scope.row.BaseDrugLib.min_unit}}</span>
  102. </template>
  103. </el-table-column>
  104. <!-- <el-table-column prop="drug_name" label="单位" align="center">
  105. <template slot-scope="scope">
  106. {{scope.row.max_unit}}
  107. </template>
  108. </el-table-column> -->
  109. <!-- <el-table-column prop="drug_name" label="剩余量" align="center">
  110. <template slot-scope="scope">
  111. {{getCountList(scope.row.BaseDrugLib.min_number,scope.row.DrugWarehouseInfo,scope.row.BaseDrugLib.max_unit,scope.row.BaseDrugLib.min_unit)}}
  112. </template>
  113. </el-table-column> -->
  114. <el-table-column prop="drug_name" label="单价" align="center">
  115. <template slot-scope="scope">
  116. <span v-if="scope.row.consumable_type == 2 && scope.row.xt_drug_warehouse_out_info!=null">{{scope.row.xt_drug_warehouse_out_info.price}}</span>
  117. <span v-else>
  118. <span v-if="scope.row.price >0">{{scope.row.price}}</span>
  119. <span v-if="scope.row.price == 0">{{getPrice(scope.row.drug_id)}}</span>
  120. </span>
  121. </template>
  122. </el-table-column>
  123. <el-table-column prop="drug_name" label="有效期" align="center">
  124. <template slot-scope="scope">
  125. {{getTime(scope.row.expire_date,"{y}-{h}-{d}")}}
  126. </template>
  127. </el-table-column>
  128. <!-- <el-table-column prop="drug_name" label="剩余库存" align="center">
  129. <template slot-scope="scope">
  130. {{scope.row.over_count}}
  131. </template>
  132. </el-table-column> -->
  133. <el-table-column prop="drug_name" label="使用人" align="center">
  134. <template slot-scope="scope">
  135. <span > {{getPatientName(scope.row.patient_id)}}</span>
  136. </template>
  137. </el-table-column>
  138. <el-table-column prop="drug_name" label="剩余库存" align="center">
  139. <template slot-scope="scope">
  140. <span > {{getDrugCount(scope.row.over_count,scope.row.BaseDrugLib.max_unit,scope.row.BaseDrugLib.min_unit,scope.row.BaseDrugLib.min_number)}}</span>
  141. </template>
  142. </el-table-column>
  143. <!-- <el-table-column prop="drug_name" label="批号" align="center">
  144. <template slot-scope="scope">
  145. <span>{{scope.row.batch_number}}</span>
  146. </template>
  147. </el-table-column> -->
  148. <!-- <el-table-column prop="drug_name" label="生产商" align="center">
  149. <template slot-scope="scope">
  150. {{getManufacturer(scope.row.manufacturer)}}
  151. </template>
  152. </el-table-column> -->
  153. </el-table>
  154. <el-pagination
  155. @size-change="handleSizeChange"
  156. @current-change="handleCurrentChange"
  157. :page-sizes="[10, 50, 100,500,1000]"
  158. :page-size="10"
  159. background
  160. align="right"
  161. style="margin-top:20px;"
  162. layout="total, sizes, prev, pager, next, jumper"
  163. :total="total"
  164. >
  165. </el-pagination>
  166. </div>
  167. <setting-dialog
  168. ref="dialog"
  169. ></setting-dialog>
  170. </div>
  171. </template>
  172. <script>
  173. import { uParseTime } from '@/utils/tools'
  174. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  175. import { getDrugStockFlow,getOutDrugStockFlow,getDrugCountList,getDrugFlow } from '@/api/drug/drug_stock'
  176. import SettingDialog from './settingDialog/index'
  177. import { getDictionaryDataConfig } from "@/utils/data";
  178. export default {
  179. name: 'stockIn',
  180. created() {
  181. var nowDate = new Date();
  182. var nowYear = nowDate.getFullYear();
  183. var nowMonth = nowDate.getMonth() + 1;
  184. var nowDay = nowDate.getDate();
  185. this.end_time =
  186. nowYear +
  187. "-" +
  188. (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
  189. "-" +
  190. (nowDay < 10 ? "0" + nowDay : nowDay);
  191. nowDate.setMonth(nowDate.getMonth() - 1);
  192. nowYear = nowDate.getFullYear();
  193. nowMonth = nowDate.getMonth() + 1;
  194. nowDay = nowDate.getDate();
  195. this.start_time =
  196. nowYear +
  197. "-" +
  198. (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
  199. "-" +
  200. (nowDay < 10 ? "0" + nowDay : nowDay);
  201. var drugCategory = getDictionaryDataConfig('system','drug_category')
  202. this.drugCategory.push(...drugCategory)
  203. this.drugTypeList = getDictionaryDataConfig('system','drug_type')
  204. this.getDrugFlow()
  205. },
  206. components: {
  207. SettingDialog,
  208. BreadCrumb
  209. },
  210. data() {
  211. return {
  212. crumbs: [
  213. { path: false, name: '库存管理' },
  214. { path: '/stock/drugs/stock/query', name: '药品库存查询' },
  215. { path:'/drugstock/in/drugstockflow',name:'库存流水'}
  216. ],
  217. keywords: '',
  218. total: 0,
  219. multipleSelection: [],
  220. signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
  221. start_time: '',
  222. end_time: '',
  223. page: 1,
  224. limit: 10,
  225. goodType: [],
  226. goodInfo: [],
  227. tempArr: [],
  228. sameRowArr: [],
  229. WarehouseInfo: {
  230. loading: false,
  231. warehouseInfoDate: []
  232. },
  233. tableData:[],
  234. drug_category:0,
  235. stock_type:0,
  236. drugCategory:[
  237. {id:0,name:"全部"}
  238. ],
  239. drugTypeList:[],
  240. tableList:[],
  241. manufacturerList:[],
  242. list:[],
  243. stockType:[
  244. {id:0,name:"全部"},
  245. {id:1,name:"手动入库"},
  246. {id:2,name:"手动出库"},
  247. {id:3,name:"自动出库"},
  248. {id:4,name:"手动退库"},
  249. {id:10,name:"盘盈"},
  250. {id:11,name:"盘亏"},
  251. {id:12,name:"调拨出库"},
  252. {id:13,name:"调拨入库"},
  253. {id:15,name:"结算出库"}
  254. ],
  255. outList:[],
  256. countList:[],
  257. outCountList:[],
  258. autoCountList:[],
  259. drugOutList:[],
  260. total:0,
  261. drug:{},
  262. houseList:[],
  263. patientList:[],
  264. }
  265. },
  266. methods:{
  267. getlist(){
  268. var params = {
  269. drug_id:this.$route.query.drug_id,
  270. start_time:this.start_time,
  271. end_time:this.end_time,
  272. page:this.page,
  273. limit:this.limit,
  274. stock_type:this.stock_type,
  275. }
  276. getDrugStockFlow(params).then(response=>{
  277. if(response.data.state == 1){
  278. var list = response.data.data.list
  279. for(let i=0;i<list.length;i++){
  280. list[i].drug_way = 4
  281. this.tableList.push(list[i])
  282. }
  283. console.log("tablelist323223232323wode",this.tableList)
  284. var total = response.data.data.total
  285. this.total = total
  286. var manufacturerList = response.data.data.manufacturerList
  287. this.manufacturerList = manufacturerList
  288. this.drug = response.data.data.drug
  289. var outlist = response.data.data.outlist
  290. console.log("outlist",outlist)
  291. }
  292. })
  293. },
  294. getOutList(){
  295. var params = {
  296. drug_id:this.$route.query.drug_id,
  297. start_time:this.start_time,
  298. end_time:this.end_time,
  299. page:this.page,
  300. limit:this.limit,
  301. stock_type:this.stock_type,
  302. }
  303. getOutDrugStockFlow(params).then(response=>{
  304. if(response.data.state == 1){
  305. var outList = response.data.data.outList
  306. for(let i=0;i<outList.length;i++){
  307. if(outList[i].is_sys == 1){
  308. outList[i].drug_way = 2
  309. }
  310. if(outList[i].is_sys == 0){
  311. outList[i].drug_way = 1
  312. }
  313. this.tableList.push(outList[i])
  314. }
  315. this.total = response.data.data.total
  316. }
  317. })
  318. },
  319. handleSizeChange(val) {
  320. this.limit = val
  321. this.getDrugFlow()
  322. },
  323. handleCurrentChange(val) {
  324. this.page = val
  325. this.getDrugFlow()
  326. },
  327. startTimeChange: function(val) {
  328. var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
  329. if (time > 0) {
  330. this.$message.error("开始时间不能大于结束时间");
  331. this.start_time = "";
  332. } else {
  333. this.getDrugFlow()
  334. }
  335. },
  336. endTimeChange: function(val) {
  337. var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
  338. if (time < 0) {
  339. this.$message.error("结束时间不能小于开始时间");
  340. this.end_time = "";
  341. } else {
  342. this.getDrugFlow()
  343. }
  344. },
  345. getManufacturer(id){
  346. var name = ""
  347. for(let i=0;i<this.manufacturerList.length;i++){
  348. if(id == this.manufacturerList[i].id){
  349. name = this.manufacturerList[i].manufacturer_name
  350. }
  351. }
  352. return name
  353. },
  354. getTime(val) {
  355. if(val < 0){
  356. return ""
  357. }
  358. if(val == ""){
  359. return ""
  360. }else {
  361. return uParseTime(val, '{y}-{m}-{d}')
  362. }
  363. },
  364. getDrugCountList(){
  365. var params = {
  366. keyword: this.keywords,
  367. start_time:this.start_time,
  368. end_time:this.end_time,
  369. }
  370. getDrugCountList(params).then(response=>{
  371. if(response.data.state == 1){
  372. var countlist = response.data.data.countList
  373. this.countList = countlist
  374. var outcountlist = response.data.data.outCountList
  375. this.outCountList = outcountlist
  376. var aucountlist = response.data.data.auCountList
  377. this.autoCountList = aucountlist
  378. var minCount = response.data.data.minCount
  379. this.minCount = minCount
  380. var info = response.data.data.info
  381. for(let i=0;i<info.length;i++){
  382. if(info[i].count_unit == info[i].max_unit){
  383. info[i].count = info[i].count * info[i].min_number
  384. }
  385. }
  386. this.drugOutList = info
  387. }
  388. })
  389. },
  390. getInCount(id){
  391. var count = ""
  392. for(let i=0;i<this.countList.length;i++){
  393. if(id == this.countList[i].drug_id){
  394. count = this.countList[i].count
  395. }
  396. }
  397. return count
  398. },
  399. getOutCount(id){
  400. var count = ""
  401. for(let i=0;i<this.outCountList.length;i++){
  402. if(id == this.outCountList[i].drug_id){
  403. count = this.outCountList[i].count
  404. }
  405. }
  406. return count
  407. },
  408. getAutoCount(id){
  409. var count= ""
  410. for(let i=0;i<this.autoCountList.length;i++){
  411. if(id == this.autoCountList[i].drug_id){
  412. count = this.autoCountList[i].count
  413. }
  414. }
  415. return count
  416. },
  417. getTimestamp(time) { // 把时间日期转成时间戳
  418. return (new Date(time)).getTime() / 1000
  419. },
  420. changeDrug(val){
  421. this.tableList = []
  422. this.getDrugFlow()
  423. },
  424. getMinCount(id){
  425. var count=""
  426. for(let i=0;i<this.minCount.length;i++){
  427. if(id == this.minCount[i].drug_id){
  428. count = this.minCount[i].count
  429. }
  430. }
  431. return count
  432. },
  433. getCount(drug_id,min_number,max_unit,min_unit){
  434. var count= 0
  435. var str = ""
  436. var min_str = ""
  437. for(let i=0;i<this.drugOutList.length;i++){
  438. if(drug_id == this.drugOutList[i].drug_id){
  439. count += parseInt(this.drugOutList[i].count)
  440. }
  441. }
  442. if(parseInt(count/min_number)!=0){
  443. str = parseInt(count/min_number)+ max_unit
  444. }
  445. if((count%min_number)!=0){
  446. min_str = count%min_number + min_unit
  447. }
  448. return str + min_str
  449. },
  450. getCountOne(drug_id){
  451. var count= 0
  452. for(let i=0;i<this.drugOutList.length;i++){
  453. if(drug_id == this.drugOutList[i].drug_id){
  454. count += parseInt(this.drugOutList[i].count)
  455. }
  456. }
  457. return count
  458. },
  459. getCountTwo(drug_id,min_number,max_unit,min_unit){
  460. var total_count = 0
  461. var out_count = 0
  462. var count = 0
  463. var str = ""
  464. var str_min = ""
  465. total_count = this.getInCount(drug_id) * min_number
  466. out_count = this.getCountOne(drug_id)
  467. count = total_count-out_count
  468. if(parseInt(count/min_number)!=0){
  469. str = parseInt(count/min_number) + max_unit
  470. }
  471. if((count%min_number)!=0){
  472. str_min = count%min_number + min_unit
  473. }
  474. return str+str_min
  475. },
  476. getDrugFlow(){
  477. var params = {
  478. drug_id:this.$route.query.drug_id,
  479. start_time:this.start_time,
  480. end_time:this.end_time,
  481. page:this.page,
  482. limit:this.limit,
  483. stock_type:this.stock_type,
  484. }
  485. getDrugFlow(params).then(response=>{
  486. if(response.data.state ==1){
  487. var list = response.data.data.list
  488. console.log("list2o2o33o23233o3oowo",list)
  489. this.tableList = list
  490. var total = response.data.data.total
  491. this.total =total
  492. this.manufacturerList = response.data.data.manufacturerList
  493. this.dealerList = response.data.data.dealerList
  494. var drug = response.data.data.drug
  495. this.drug = drug
  496. this.patientList = response.data.data.patientList
  497. this.houseList = response.data.data.houseList
  498. }
  499. })
  500. },
  501. getCountList(min_number,val,max_unit,min_unit){
  502. var total = 0
  503. var str = ""
  504. var str_min = ""
  505. for(let i=0;i<val.length;i++){
  506. total += (val[i].stock_max_number * min_number + val[i].stock_min_number)
  507. }
  508. if(parseInt(total/min_number)!=0){
  509. str = parseInt(total/min_number) + max_unit
  510. }
  511. if((total%min_number)!=0){
  512. str_min = total%min_number + min_unit
  513. }
  514. return str+str_min
  515. },
  516. getName(drug_id){
  517. var name = ""
  518. if(drug_id == this.drug.id){
  519. name = this.drug.drug_name
  520. }
  521. return name
  522. },
  523. getPrice(id){
  524. var min_price = 0
  525. if(id == this.drug.id){
  526. min_price = this.drug.min_price
  527. }
  528. return min_price
  529. },
  530. getHouseName(id){
  531. var storehouse_name = ""
  532. for(let i=0;i<this.houseList.length;i++){
  533. if(id == this.houseList[i].id){
  534. storehouse_name = this.houseList[i].storehouse_name
  535. }
  536. }
  537. return storehouse_name
  538. },
  539. getPatientName(id){
  540. var name = ""
  541. for(let i=0;i<this.patientList.length;i++){
  542. if(id == this.patientList[i].id){
  543. name = this.patientList[i].name
  544. }
  545. }
  546. return name
  547. },
  548. getDrugCount(total,max_unit,min_unit,min_number){
  549. var max_str = "";
  550. var min_str = "";
  551. if (total < min_number) {
  552. min_str = total + min_unit;
  553. }
  554. if (total == 0) {
  555. min_str = "";
  556. max_str = "";
  557. }
  558. if (total >= min_number) {
  559. if (parseInt(total / min_number) != 0) {
  560. max_str = parseInt(total / min_number) + max_unit;
  561. }
  562. if (total % min_number != 0) {
  563. min_str = (total % min_number) + min_unit;
  564. }
  565. }
  566. return max_str + min_str;
  567. },
  568. toExprot(){
  569. import('@/vendor/Export2Excel').then(excel => {
  570. console.log("tableList",this.tableList)
  571. if(this.tableList!=null && this.tableList.length>0){
  572. for(let i=0;i<this.tableList.length;i++){
  573. this.tableList[i].index = i+1
  574. if(this.tableList[i].consumable_type == 1){
  575. this.tableList[i].consumable_type_name = "手动入库"
  576. }
  577. if(this.tableList[i].consumable_type == 2){
  578. this.tableList[i].consumable_type_name = "手动出库"
  579. }
  580. if(this.tableList[i].consumable_type == 3){
  581. this.tableList[i].consumable_type_name = "自动出库"
  582. }
  583. if(this.tableList[i].consumable_type == 4){
  584. this.tableList[i].consumable_type_name = "手动退库"
  585. }
  586. if(this.tableList[i].consumable_type == 5){
  587. this.tableList[i].consumable_type_name = "报损数量"
  588. }
  589. if(this.tableList[i].consumable_type == 7){
  590. this.tableList[i].consumable_type_name = "自动退库"
  591. }
  592. if(this.tableList[i].consumable_type == 10){
  593. this.tableList[i].consumable_type_name = "盘盈"
  594. }
  595. if(this.tableList[i].consumable_type == 11){
  596. this.tableList[i].consumable_type_name = "盘亏"
  597. }
  598. if(this.tableList[i].consumable_type == 12){
  599. this.tableList[i].consumable_type_name = "调拨出库"
  600. }
  601. if(this.tableList[i].consumable_type == 13){
  602. this.tableList[i].consumable_type_name = "调拨入库"
  603. }
  604. if(this.tableList[i].consumable_type == 15){
  605. this.tableList[i].consumable_type_name = "结算出库"
  606. }
  607. if(this.tableList[i].consumable_type == 1){
  608. this.tableList[i].order_number = this.tableList[i].warehousing_order
  609. }
  610. if(this.tableList[i].consumable_type == 2){
  611. this.tableList[i].order_number = this.tableList[i].warehouse_out_order_number
  612. }
  613. if(this.tableList[i].consumable_type == 3){
  614. this.tableList[i].order_number = this.tableList[i].warehouse_out_order_number
  615. }
  616. if(this.tableList[i].consumable_type == 4 || this.tableList[i].consumable_type == 7){
  617. this.tableList[i].order_number = this.tableList[i].cancel_order_number
  618. }
  619. if(this.tableList[i].consumable_type == 10){
  620. this.tableList[i].order_number = this.tableList[i].warehouse_out_order_number
  621. }
  622. if(this.tableList[i].consumable_type == 11){
  623. this.tableList[i].order_number = this.tableList[i].warehouse_out_order_number
  624. }
  625. if(this.tableList[i].consumable_type == 12){
  626. this.tableList[i].order_number = this.tableList[i].warehouse_out_order_number
  627. }
  628. if(this.tableList[i].consumable_type == 13){
  629. this.tableList[i].order_number = this.tableList[i].warehousing_order
  630. }
  631. if(this.tableList[i].consumable_type == 15){
  632. this.tableList[i].order_number = this.tableList[i].warehouse_out_order_number
  633. }
  634. this.tableList[i].record_time = this.getTime(this.tableList[i].ctime)
  635. this.tableList[i].storehouse_name = this.getHouseName(this.tableList[i].storehouse_id)
  636. if(this.tableList[i].consumable_type!=2 && this.tableList[i].consumable_type!=3 && this.tableList[i].consumable_type!=5 && this.tableList[i].consumable_type != 7){
  637. this.tableList[i].coutn_unit = (this.tableList[i].count.toString()) +this.tableList[i].max_unit
  638. }
  639. if(this.tableList[i].consumable_type == 2 ||this.tableList[i].consumable_type == 3 || this.tableList[i].consumable_type == 5 || this.tableList[i].consumable_type ==7 && (parseInt(this.tableList[i].count/this.tableList[i].BaseDrugLib.min_number) >0)){
  640. this.tableList[i].coutn_unit = (parseInt(this.tableList[i].count/this.tableList[i].BaseDrugLib.min_number)).toString() + this.tableList[i].BaseDrugLib.max_unit
  641. }
  642. if(this.tableList[i].consumable_type == 2 ||this.tableList[i].consumable_type == 3 || this.tableList[i].consumable_type == 5 || this.tableList[i].consumable_type ==7 && (this.tableList[i].count%this.tableList[i].BaseDrugLib.min_number >0)){
  643. this.tableList[i].coutn_unit = (parseInt(this.tableList[i].count%this.tableList[i].BaseDrugLib.min_number)).toString() + this.tableList[i].BaseDrugLib.min_unit
  644. }
  645. if(this.tableList[i].price>0){
  646. this.tableList[i].total_price = this.tableList[i].price
  647. }
  648. if(this.tableList[i].price == 0){
  649. this.tableList[i].total_price = this.getPrice(this.tableList[i].drug_id)
  650. }
  651. this.tableList[i].expire_date_name = this.getTime(this.tableList[i].expire_date,"{y}-{h}-{d}")
  652. this.tableList[i].manufacturer_name = this.getManufacturer( this.tableList[i].manufacturer)
  653. this.tableList[i].patient_name = this.getPatientName(this.tableList[i].patient_id)
  654. this.tableList[i].over_count_name = this.getDrugCount(this.tableList[i].over_count,this.tableList[i].BaseDrugLib.max_unit,this.tableList[i].BaseDrugLib.min_unit,this.tableList[i].BaseDrugLib.min_number)
  655. }
  656. }
  657. const multiHeader =['序号','出入库方式','出入库单据编码','操作日期','仓库名称','数量','单价','有效期','使用人','剩余库存']
  658. const filterVal = ['index', 'consumable_type_name', 'order_number', 'record_time', 'storehouse_name', 'coutn_unit', 'total_price', 'expire_date_name','patient_name','over_count_name']
  659. const data = this.formatJson(filterVal, this.tableList)
  660. console.log("datawoowow",data)
  661. excel.export_json_to_excel({
  662. header: multiHeader,
  663. data,
  664. filename: '药品流水'
  665. })
  666. })
  667. },
  668. formatJson(filterVal, jsonData) {
  669. return jsonData.map(v => filterVal.map(j => v[j]))
  670. },
  671. }
  672. }
  673. </script>
  674. <style rel="stylesheet/css" lang="scss" scoped>
  675. .information {
  676. border: 1px #dcdfe6 solid;
  677. padding: 30px 20px 30px 20px;
  678. .border {
  679. border-bottom: 1px #dcdfe6 solid;
  680. margin: 0px 0 20px 0;
  681. }
  682. }
  683. .title {
  684. background: #409eff;
  685. height: 44px;
  686. line-height: 44px;
  687. padding: 0 0 0 10px;
  688. color: #fff;
  689. margin: 0 0 10px 0;
  690. }
  691. .edit_separater {
  692. border-top: 1px solid rgb(233, 233, 233);
  693. margin-top: 15px;
  694. margin-bottom: 15px;
  695. }
  696. </style>
  697. <style>
  698. .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
  699. font-size: 12px;
  700. }
  701. .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
  702. background: #6fb5fa;
  703. }
  704. .count {
  705. color: #bd2c00;
  706. }
  707. .el-table td,
  708. .el-table th.is-leaf,
  709. .el-table--border,
  710. .el-table--group {
  711. border-color: #d0d3da;
  712. }
  713. .el-table--border::after,
  714. .el-table--group::after,
  715. .el-table::before {
  716. background-color: #d0d3da;
  717. }
  718. </style>