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

stockFlow.vue 22KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664
  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. 耗材名称:{{getGoodName(this.$route.query.id)}} &nbsp;
  9. 库存: {{this.$route.query.overCount}}{{packing_unit}} &nbsp;
  10. 规格:{{getSpecName(this.$route.query.id)}} &nbsp;
  11. 厂家:{{this.$route.query.manufacturer}}
  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 == 10">盘盈</span>
  71. <span v-if="scope.row.consumable_type == 11">盘亏</span>
  72. <span v-if="scope.row.consumable_type == 12">调拨出库</span>
  73. <span v-if="scope.row.consumable_type == 13">调拨入库</span>
  74. <span v-if="scope.row.consumable_type == 15">结算出库</span>
  75. </template>
  76. </el-table-column>
  77. <el-table-column prop="drug_name" label="出/入库单据编码" align="center">
  78. <template slot-scope="scope">
  79. <span v-if="scope.row.consumable_type == 1">{{scope.row.warehousing_order}}</span>
  80. <span v-if="scope.row.consumable_type == 2">{{scope.row.warehouse_out_order_number}}</span>
  81. <span v-if="scope.row.consumable_type == 3">{{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 == 10">{{scope.row.warehouse_out_order_number}}</span>
  84. <span v-if="scope.row.consumable_type == 11">{{scope.row.warehouse_out_order_number}}</span>
  85. <span v-if="scope.row.consumable_type == 12">{{scope.row.warehouse_out_order_number}}</span>
  86. <span v-if="scope.row.consumable_type == 13">{{scope.row.warehousing_order}}</span>
  87. <span v-if="scope.row.consumable_type == 15">{{scope.row.warehouse_out_order_number}}</span>
  88. </template>
  89. </el-table-column>
  90. <el-table-column prop="drug_name" label="操作日期" align="center">
  91. <template slot-scope="scope">
  92. {{getTime(scope.row.ctime)}}
  93. </template>
  94. </el-table-column>
  95. <el-table-column prop="drug_name" label="仓库名称" align="center">
  96. <template slot-scope="scope">
  97. <span>{{getHouseName(scope.row.storehouse_id)}}</span>
  98. </template>
  99. </el-table-column>
  100. <el-table-column prop="drug_name" label="数量" align="center">
  101. <template slot-scope="scope">
  102. <span>{{scope.row.count}}{{packing_unit}}</span>
  103. </template>
  104. </el-table-column>
  105. <!-- <el-table-column label="批次" align="center">
  106. <template slot-scope="scope">
  107. <span>{{scope.row.number}}</span>
  108. </template>
  109. </el-table-column> -->
  110. <el-table-column prop="drug_name" label="单价" align="center">
  111. <template slot-scope="scope">
  112. <span v-if="scope.row.price >0">{{scope.row.price}}</span>
  113. <span v-if="scope.row.price == 0">{{good.packing_price}}</span>
  114. </template>
  115. </el-table-column>
  116. <el-table-column prop="drug_name" label="有效期" align="center">
  117. <template slot-scope="scope" >
  118. <span>{{getTime(scope.row.expire_date,"{y}-{h}-{d}")}}</span>
  119. </template>
  120. </el-table-column>
  121. <!-- <el-table-column prop="drug_name" label="批准文号" align="center">
  122. <template slot-scope="scope" >
  123. <span>{{scope.row.license_number}}</span>
  124. </template>
  125. </el-table-column> -->
  126. <el-table-column prop="drug_name" label="生产商" align="center">
  127. <template slot-scope="scope">
  128. <span > {{getManufacturer(scope.row.manufacturer)}}</span>
  129. </template>
  130. </el-table-column>
  131. <el-table-column prop="drug_name" label="使用人" align="center">
  132. <template slot-scope="scope">
  133. <span > {{getPatientName(scope.row.patient_id)}}</span>
  134. </template>
  135. </el-table-column>
  136. <el-table-column prop="drug_name" label="剩余库存" align="center">
  137. <template slot-scope="scope">
  138. <span > {{scope.row.over_count}}</span>
  139. </template>
  140. </el-table-column>
  141. </el-table>
  142. <el-pagination
  143. @size-change="handleSizeChange"
  144. @current-change="handleCurrentChange"
  145. :page-sizes="[10, 50, 100,500,1000]"
  146. :page-size="10"
  147. background
  148. align="right"
  149. style="margin-top:20px;"
  150. layout="total, sizes, prev, pager, next, jumper"
  151. :total="total"
  152. >
  153. </el-pagination>
  154. </div>
  155. </div>
  156. </template>
  157. <script>
  158. import { uParseTime } from '@/utils/tools'
  159. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  160. import {getStockDrugCount,getStockFlow} from "@/api/stock"
  161. export default {
  162. name: 'stockIn',
  163. created() {
  164. var nowDate = new Date();
  165. var nowYear = nowDate.getFullYear();
  166. var nowMonth = nowDate.getMonth() + 1;
  167. var nowDay = nowDate.getDate();
  168. this.end_time =
  169. nowYear +
  170. "-" +
  171. (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
  172. "-" +
  173. (nowDay < 10 ? "0" + nowDay : nowDay);
  174. nowDate.setMonth(nowDate.getMonth() - 1);
  175. nowYear = nowDate.getFullYear();
  176. nowMonth = nowDate.getMonth() + 1;
  177. nowDay = nowDate.getDate();
  178. this.start_time =
  179. nowYear +
  180. "-" +
  181. (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
  182. "-" +
  183. (nowDay < 10 ? "0" + nowDay : nowDay);
  184. this.getStockFlow()
  185. this.packing_unit = this.$route.query.packing_unit
  186. },
  187. components: {
  188. BreadCrumb
  189. },
  190. data() {
  191. return {
  192. crumbs: [
  193. { path: false, name: '库存管理' },
  194. { path: '/stock/drugs/stock/query', name: '药品库存查询' },
  195. { path:'/drugstock/in/drugstockflow',name:'库存流水'}
  196. ],
  197. keywords: '',
  198. total: 0,
  199. multipleSelection: [],
  200. signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
  201. start_time: '',
  202. end_time: '',
  203. page: 1,
  204. limit: 10,
  205. goodType: [],
  206. goodInfo: [],
  207. tempArr: [],
  208. sameRowArr: [],
  209. WarehouseInfo: {
  210. loading: false,
  211. warehouseInfoDate: []
  212. },
  213. tableData:[],
  214. drug_category:0,
  215. stock_type:0,
  216. drugCategory:[
  217. {id:0,name:"全部"}
  218. ],
  219. drugTypeList:[],
  220. tableList:[],
  221. manufacturerList:[],
  222. stockType:[
  223. {id:0,name:"全部"},
  224. {id:1,name:"手动入库"},
  225. {id:2,name:"手动出库"},
  226. {id:3,name:"自动出库"},
  227. {id:4,name:"手动退库"},
  228. {id:7,name:"自动退库"},
  229. {id:10,name:"盘盈"},
  230. {id:11,name:"盘亏"},
  231. {id:12,name:"调拨出库"},
  232. {id:13,name:"调拨入库"},
  233. {id:15,name:"结算出库"},
  234. ],
  235. countList:[],
  236. outCountList:[],
  237. autoCountList:[],
  238. keywords:"",
  239. obj:{},
  240. packing_unit:"",
  241. cancelCountList:[],
  242. good:{},
  243. houseList:[],
  244. patientList:[]
  245. }
  246. },
  247. methods:{
  248. handleSizeChange(val) {
  249. this.limit = val
  250. this.getStockFlow()
  251. },
  252. handleCurrentChange(val) {
  253. this.page = val
  254. this.getStockFlow()
  255. },
  256. startTimeChange: function(val) {
  257. this.tableList = []
  258. var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
  259. if (time > 0) {
  260. this.$message.error("开始时间不能大于结束时间");
  261. this.start_time = "";
  262. } else {
  263. this.getStockFlow()
  264. }
  265. },
  266. endTimeChange: function(val) {
  267. this.tableList = []
  268. var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
  269. if (time < 0) {
  270. this.$message.error("结束时间不能小于开始时间");
  271. this.end_time = "";
  272. } else {
  273. this.getStockFlow()
  274. }
  275. },
  276. getManufacturer(id){
  277. var name = ""
  278. for(let i=0;i<this.manufacturerList.length;i++){
  279. if(id == this.manufacturerList[i].id){
  280. name = this.manufacturerList[i].manufacturer_name
  281. }
  282. }
  283. return name
  284. },
  285. getTime(val) {
  286. if(val < 0){
  287. return ""
  288. }
  289. if(val == ""){
  290. return ""
  291. }else {
  292. return uParseTime(val, '{y}-{m}-{d}')
  293. }
  294. },
  295. //入库详情
  296. // getlist(){
  297. // var params= {
  298. // limit:this.limit,
  299. // page:this.page,
  300. // id:this.$route.query.id,
  301. // start_time:this.start_time,
  302. // end_time:this.end_time,
  303. // is_sys:this.stockType
  304. // }
  305. // getStockInList(params).then(response=>{
  306. // if(response.data.state == 1){
  307. // var list = response.data.data.list
  308. // for(let i=0;i<list.length;i++){
  309. // list[i].stock_way = 4
  310. // this.tableList.push(list[i])
  311. // }
  312. // var total = response.data.data.total
  313. // this.total = total
  314. // // console.log("入库数据",this.tableList)
  315. // var manufacturerList = response.data.data.manufacturerList
  316. // this.manufacturerList = manufacturerList
  317. // }
  318. // })
  319. // },
  320. // getStockOutList(){
  321. // var params= {
  322. // limit:this.limit,
  323. // page:this.page,
  324. // id:this.$route.query.id,
  325. // start_time:this.start_time,
  326. // end_time:this.end_time,
  327. // is_sys:this.stock_type
  328. // }
  329. // getStockOutList(params).then(response=>{
  330. // if(response.data.state == 1){
  331. // var outList = response.data.data.outList
  332. // console.log("outList990-0000990",outList)
  333. // for(let i=0;i<outList.length;i++){
  334. // if(outList[i].is_sys == 0){
  335. // outList[i].stock_way = 3
  336. // }
  337. // if(outList[i].is_sys == 1){
  338. // outList[i].stock_way = 2
  339. // }
  340. // this.tableList.push(outList[i])
  341. // }
  342. // console.log("hhhhhhhhhh",this.tableList)
  343. // var total = response.data.data.total
  344. // this.total = total
  345. // }
  346. // })
  347. // },
  348. getStockDrugCount(){
  349. var params ={
  350. keywords: this.keywords,
  351. start_time:this.start_time,
  352. end_time:this.end_time,
  353. }
  354. getStockDrugCount(params).then(response=>{
  355. if(response.data.state == 1){
  356. var count = response.data.data.count
  357. this.countList = count
  358. var outlist = response.data.data.outList
  359. this.outCountList = outlist
  360. var autoCount = response.data.data.autoCount
  361. this.autoCountList = autoCount
  362. var totalCount = response.data.data.totalCount
  363. this.cancelCountList = totalCount
  364. }
  365. })
  366. },
  367. getInCount(id){
  368. var count= ""
  369. for(let i=0;i<this.countList.length;i++){
  370. if(id == this.countList[i].good_id){
  371. count = this.countList[i].count
  372. }
  373. }
  374. return count
  375. },
  376. getOutCount(id){
  377. var count = ""
  378. for(let i=0;i<this.outCountList.length;i++){
  379. if(id == this.outCountList[i].good_id){
  380. count = this.outCountList[i].count
  381. }
  382. }
  383. return count
  384. },
  385. getAutoCount(id){
  386. var count= ""
  387. for(let i=0;i<this.autoCountList.length;i++){
  388. if(id == this.autoCountList[i].good_id){
  389. count = this.autoCountList[i].count
  390. }
  391. }
  392. return count
  393. },
  394. getCancelCount(id){
  395. var count = 0
  396. for(let i=0;i<this.cancelCountList.length;i++){
  397. if(id == this.cancelCountList[i].good_id){
  398. count = this.cancelCountList[i].count
  399. }
  400. }
  401. return count
  402. },
  403. getTimestamp(time) {
  404. // 把时间日期转成时间戳
  405. return new Date(time).getTime() / 1000;
  406. },
  407. changeDrug(val){
  408. this.tableList= []
  409. this.stock_type = val
  410. this.getStockFlow()
  411. },
  412. getStockCount(id){
  413. var stock_count = 0
  414. for(let i=0;i<this.countList.length;i++){
  415. if(id == this.countList[i].good_id){
  416. stock_count = this.countList[i].stock_count
  417. }
  418. }
  419. return stock_count
  420. },
  421. getStockFlow(){
  422. var params= {
  423. limit:this.limit,
  424. page:this.page,
  425. good_id:this.$route.query.id,
  426. start_time:this.start_time,
  427. end_time:this.end_time,
  428. is_sys:this.stock_type
  429. }
  430. getStockFlow(params).then(response=>{
  431. if(response.data.state == 1){
  432. var list = response.data.data.list
  433. var total = response.data.data.total
  434. this.tableList = list
  435. this.total = total
  436. this.good = response.data.data.good
  437. var manufacturerList = response.data.data.manufacturerList
  438. this.manufacturerList = manufacturerList
  439. this.houseList = response.data.data.houseList
  440. this.patientList = response.data.data.patients
  441. }
  442. })
  443. },
  444. getHouseName(id){
  445. var storehouse_name = ""
  446. for(let i=0;i<this.houseList.length;i++){
  447. if(id == this.houseList[i].id){
  448. storehouse_name = this.houseList[i].storehouse_name
  449. }
  450. }
  451. return storehouse_name
  452. },
  453. getGoodName(id){
  454. var good_name = ""
  455. if(id == this.good.id){
  456. good_name = this.good.good_name
  457. }
  458. return good_name
  459. },
  460. getSpecName(id){
  461. var specification_name = ""
  462. if(id == this.good.id){
  463. specification_name = this.good.specification_name
  464. }
  465. return specification_name
  466. },
  467. getPatientName(id){
  468. var name = ""
  469. for(let i=0;i<this.patientList.length;i++){
  470. if(id == this.patientList[i].id){
  471. name = this.patientList[i].name
  472. }
  473. }
  474. return name
  475. },
  476. toExprot(){
  477. import('@/vendor/Export2Excel').then(excel => {
  478. console.log("tableList",this.tableList)
  479. if(this.tableList!=null && this.tableList.length>0){
  480. for(let i=0;i<this.tableList.length;i++){
  481. this.tableList[i].index = i+1
  482. if(this.tableList[i].consumable_type == 1){
  483. this.tableList[i].consumable_type_name = "手动入库"
  484. }
  485. if(this.tableList[i].consumable_type == 2){
  486. this.tableList[i].consumable_type_name = "手动出库"
  487. }
  488. if(this.tableList[i].consumable_type == 3){
  489. this.tableList[i].consumable_type_name = "自动出库"
  490. }
  491. if(this.tableList[i].consumable_type == 4){
  492. this.tableList[i].consumable_type_name = "手动退库"
  493. }
  494. if(this.tableList[i].consumable_type == 7){
  495. this.tableList[i].consumable_type_name = "自动退库"
  496. }
  497. if(this.tableList[i].consumable_type == 10){
  498. this.tableList[i].consumable_type_name = "盘盈"
  499. }
  500. if(this.tableList[i].consumable_type == 11){
  501. this.tableList[i].consumable_type_name = "盘亏"
  502. }
  503. if(this.tableList[i].consumable_type == 12){
  504. this.tableList[i].consumable_type_name = "调拨出库"
  505. }
  506. if(this.tableList[i].consumable_type == 13){
  507. this.tableList[i].consumable_type_name = "调拨入库"
  508. }
  509. if(this.tableList[i].consumable_type == 15){
  510. this.tableList[i].consumable_type_name = "结算出库"
  511. }
  512. if(this.tableList[i].consumable_type == 1){
  513. this.tableList[i].order_number = this.tableList[i].warehousing_order
  514. }
  515. if(this.tableList[i].consumable_type == 2){
  516. this.tableList[i].order_number = this.tableList[i].warehouse_out_order_number
  517. }
  518. if(this.tableList[i].consumable_type == 3){
  519. this.tableList[i].order_number = this.tableList[i].warehouse_out_order_number
  520. }
  521. if(this.tableList[i].consumable_type == 5){
  522. this.tableList[i].order_number = this.tableList[i].warehouse_out_order_number
  523. }
  524. if(this.tableList[i].consumable_type == 12){
  525. this.tableList[i].order_number = this.tableList[i].warehouse_out_order_number
  526. }
  527. if(this.tableList[i].consumable_type == 15){
  528. this.tableList[i].order_number = this.tableList[i].warehouse_out_order_number
  529. }
  530. if(this.tableList[i].consumable_type == 4 || this.tableList[i].consumable_type == 7){
  531. this.tableList[i].order_number = this.tableList[i].cancel_order_number
  532. }
  533. if(this.tableList[i].consumable_type == 7){
  534. this.tableList[i].order_number = this.tableList[i].cancel_order_number
  535. }
  536. if(this.tableList[i].consumable_type == 11|| this.tableList[i].consumable_type == 13 ||this.tableList[i].consumable_type == 10 ){
  537. this.tableList[i].warehousing_order = this.tableList[i].warehousing_order
  538. }
  539. this.tableList[i].record_time = this.getTime(this.tableList[i].ctime)
  540. this.tableList[i].storehouse_name = this.getHouseName(this.tableList[i].storehouse_id)
  541. this.tableList[i].coutn_unit = (this.tableList[i].count.toString()) +this.packing_unit
  542. if(this.tableList[i].price>0){
  543. this.tableList[i].total_price = this.tableList[i].price
  544. }
  545. if(this.tableList[i].price == 0){
  546. this.tableList[i].total_price = this.tableList[i].packing_price
  547. }
  548. this.tableList[i].expire_date_name = this.getTime(this.tableList[i].expire_date,"{y}-{h}-{d}")
  549. this.tableList[i].manufacturer_name = this.getManufacturer( this.tableList[i].manufacturer)
  550. this.tableList[i].patient_name = this.getPatientName(this.tableList[i].patient_id)
  551. }
  552. }
  553. const multiHeader =['序号','出入库方式','出入库单据编码','操作日期','仓库名称','数量','单价','有效期','生产商','使用人','剩余库存']
  554. const filterVal = ['index', 'consumable_type_name', 'order_number', 'record_time', 'storehouse_name', 'coutn_unit', 'total_price', 'expire_date_name','manufacturer_name','patient_name','over_count']
  555. const data = this.formatJson(filterVal, this.tableList)
  556. console.log("datawoowow",data)
  557. excel.export_json_to_excel({
  558. header: multiHeader,
  559. data,
  560. filename: '耗材流水'
  561. })
  562. })
  563. },
  564. formatJson(filterVal, jsonData) {
  565. return jsonData.map(v => filterVal.map(j => v[j]))
  566. },
  567. }
  568. }
  569. </script>
  570. <style rel="stylesheet/css" lang="scss" scoped>
  571. .information {
  572. border: 1px #dcdfe6 solid;
  573. padding: 30px 20px 30px 20px;
  574. .border {
  575. border-bottom: 1px #dcdfe6 solid;
  576. margin: 0px 0 20px 0;
  577. }
  578. }
  579. .title {
  580. background: #409eff;
  581. height: 44px;
  582. line-height: 44px;
  583. padding: 0 0 0 10px;
  584. color: #fff;
  585. margin: 0 0 10px 0;
  586. }
  587. .edit_separater {
  588. border-top: 1px solid rgb(233, 233, 233);
  589. margin-top: 15px;
  590. margin-bottom: 15px;
  591. }
  592. </style>
  593. <style>
  594. .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
  595. font-size: 12px;
  596. }
  597. .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
  598. background: #6fb5fa;
  599. }
  600. .count {
  601. color: #bd2c00;
  602. }
  603. .el-table td,
  604. .el-table th.is-leaf,
  605. .el-table--border,
  606. .el-table--group {
  607. border-color: #d0d3da;
  608. }
  609. .el-table--border::after,
  610. .el-table--group::after,
  611. .el-table::before {
  612. background-color: #d0d3da;
  613. }
  614. </style>