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

stockFlow.vue 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425
  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. 耗材名称:{{this.$route.query.good_name}} &nbsp;
  9. 库存:{{getInCount(this.$route.query.id)}} &nbsp;
  10. 规格:{{this.$route.query.specification_name}} &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. </div>
  51. <el-table
  52. :data="tableList"
  53. border
  54. style="width: 100%">
  55. <el-table-column prop="date" label="序号" width="180" align="center">
  56. <template slot-scope="scope">
  57. {{scope.$index + 1}}
  58. </template>
  59. </el-table-column>
  60. <el-table-column prop="drug_type" label="出入库方式" width="180" align="center">
  61. <template slot-scope="scope">
  62. <span v-if="scope.row.stock_way == 4">采购入库</span>
  63. <span v-if="scope.row.stock_way == 3">手动出库</span>
  64. <span v-if="scope.row.stock_way == 2">自动出库</span>
  65. </template>
  66. </el-table-column>
  67. <el-table-column prop="drug_name" label="出/入库单据编码" align="center">
  68. <template slot-scope="scope">
  69. <span v-if="scope.row.stock_way == 2 || scope.row.stock_way == 3"> {{scope.row.warehouse_out_order_number}}</span>
  70. <span v-if="scope.row.stock_way == 4">{{scope.row.warehousing_order}}</span>
  71. </template>
  72. </el-table-column>
  73. <el-table-column prop="drug_name" label="操作日期" align="center">
  74. <template slot-scope="scope">
  75. {{getTime(scope.row.ctime)}}
  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.stock_way == 4 && scope.row.warehousing_count!=0"> {{scope.row.warehousing_count}}{{packing_unit}}</span>
  81. <span v-if="(scope.row.stock_way == 2 || scope.row.stock_way == 3) && scope.row.count!=0">{{scope.row.count}}{{packing_unit}}</span>
  82. </template>
  83. </el-table-column>
  84. <el-table-column prop="drug_name" label="剩余库存量" align="center">
  85. <template slot-scope="scope">
  86. <!-- <span v-if="scope.row.stock_way == 4 && scope.row.stock_count!=0">{{scope.row.stock_count}} </span> -->
  87. {{getInCount(scope.row.good_id)- getOutCount(scope.row.good_id) - getAutoCount(scope.row.good_id)}}{{packing_unit}}
  88. </template>
  89. </el-table-column>
  90. <el-table-column prop="drug_name" label="进/出货单价" align="center">
  91. <template slot-scope="scope">
  92. <span v-if="scope.row.stock_way == 4"> {{scope.row.price}}</span>
  93. <span v-if="scope.row.stock_way == 2 || scope.row.stock_way == 3">{{scope.row.price}}</span>
  94. </template>
  95. </el-table-column>
  96. <el-table-column prop="drug_name" label="有效期" align="center">
  97. <template slot-scope="scope" >
  98. <span v-if="scope.row.stock_way == 4"> {{getTime(scope.row.expiry_date)}}</span>
  99. <span v-if="scope.row.stock_way == 2 || scope.row.stock_way == 3">{{getTime(scope.row.expiry_date)}}</span>
  100. </template>
  101. </el-table-column>
  102. <el-table-column prop="drug_name" label="批号" align="center">
  103. <template slot-scope="scope" >
  104. <span v-if="scope.row.stock_way == 2"> {{scope.row.number}}</span>
  105. <span v-if="scope.row.stock_way == 4 || scope.row.stock_way == 3">{{scope.row.number}}</span>
  106. </template>
  107. </el-table-column>
  108. <el-table-column prop="drug_name" label="生产商" align="center">
  109. <template slot-scope="scope">
  110. <span v-if="scope.row.stock_way == 4"> {{getManufacturer(scope.row.manufacturer)}}</span>
  111. <span v-if="scope.row.stock_way == 2 || scope.row.stock_way == 3">{{getManufacturer(scope.row.manufacturer)}}</span>
  112. </template>
  113. </el-table-column>
  114. </el-table>
  115. <el-pagination
  116. @size-change="handleSizeChange"
  117. @current-change="handleCurrentChange"
  118. :page-sizes="[10, 50, 100,500,1000]"
  119. :page-size="10"
  120. background
  121. align="right"
  122. style="margin-top:20px;"
  123. layout="total, sizes, prev, pager, next, jumper"
  124. :total="total"
  125. >
  126. </el-pagination>
  127. </div>
  128. </div>
  129. </template>
  130. <script>
  131. import { uParseTime } from '@/utils/tools'
  132. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  133. import {getStockInList,getStockOutList} from "@/api/drug/drug_stock";
  134. import {getStockDrugCount} from "@/api/stock"
  135. export default {
  136. name: 'stockIn',
  137. created() {
  138. this.getlist()
  139. this.getStockDrugCount()
  140. this.getStockOutList()
  141. this.packing_unit = this.$route.query.packing_unit
  142. },
  143. components: {
  144. BreadCrumb
  145. },
  146. data() {
  147. return {
  148. crumbs: [
  149. { path: false, name: '库存管理' },
  150. { path: '/stock/drugs/stock/query', name: '药品库存查询' },
  151. { path:'/drugstock/in/drugstockflow',name:'库存流水'}
  152. ],
  153. keywords: '',
  154. total: 0,
  155. multipleSelection: [],
  156. signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
  157. start_time: '',
  158. end_time: '',
  159. page: 1,
  160. limit: 10,
  161. goodType: [],
  162. goodInfo: [],
  163. tempArr: [],
  164. sameRowArr: [],
  165. WarehouseInfo: {
  166. loading: false,
  167. warehouseInfoDate: []
  168. },
  169. tableData:[],
  170. drug_category:0,
  171. stock_type:0,
  172. drugCategory:[
  173. {id:0,name:"全部"}
  174. ],
  175. drugTypeList:[],
  176. tableList:[],
  177. manufacturerList:[],
  178. stockType:[
  179. {id:0,name:"全部"},
  180. {id:3,name:"手动出库"},
  181. {id:2,name:"自动出库"},
  182. {id:4,name:"采购入库"},
  183. ],
  184. countList:[],
  185. outCountList:[],
  186. autoCountList:[],
  187. keywords:"",
  188. obj:{},
  189. packing_unit:""
  190. }
  191. },
  192. methods:{
  193. handleSizeChange(val) {
  194. this.limit = val
  195. this.getlist()
  196. this.getStockOutList()
  197. },
  198. handleCurrentChange(val) {
  199. this.page = val
  200. this.getlist()
  201. this.getStockOutList()
  202. },
  203. startTimeChange: function(val) {
  204. var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
  205. if (time > 0) {
  206. this.$message.error("开始时间不能大于结束时间");
  207. this.start_time = "";
  208. } else {
  209. this.getlist()
  210. this.getStockOutList()
  211. }
  212. },
  213. endTimeChange: function(val) {
  214. var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
  215. if (time < 0) {
  216. this.$message.error("结束时间不能小于开始时间");
  217. this.end_time = "";
  218. } else {
  219. this.getlist()
  220. this.getStockOutList()
  221. }
  222. },
  223. getManufacturer(id){
  224. var name = ""
  225. for(let i=0;i<this.manufacturerList.length;i++){
  226. if(id == this.manufacturerList[i].id){
  227. name = this.manufacturerList[i].manufacturer_name
  228. }
  229. }
  230. return name
  231. },
  232. getTime(val) {
  233. if(val < 0){
  234. return ""
  235. }
  236. if(val == ""){
  237. return ""
  238. }else {
  239. return uParseTime(val, '{y}-{m}-{d}')
  240. }
  241. },
  242. //入库详情
  243. getlist(){
  244. var params= {
  245. limit:this.limit,
  246. page:this.page,
  247. id:this.$route.query.id,
  248. start_time:this.start_time,
  249. end_time:this.end_time,
  250. is_sys:this.stockType
  251. }
  252. getStockInList(params).then(response=>{
  253. if(response.data.state == 1){
  254. var list = response.data.data.list
  255. for(let i=0;i<list.length;i++){
  256. list[i].stock_way = 4
  257. this.tableList.push(list[i])
  258. }
  259. var total = response.data.data.total
  260. this.total = total
  261. console.log("入库数据",this.tableList)
  262. var manufacturerList = response.data.data.manufacturerList
  263. this.manufacturerList = manufacturerList
  264. }
  265. })
  266. },
  267. getStockOutList(){
  268. var params= {
  269. limit:this.limit,
  270. page:this.page,
  271. id:this.$route.query.id,
  272. start_time:this.start_time,
  273. end_time:this.end_time,
  274. is_sys:this.stock_type
  275. }
  276. getStockOutList(params).then(response=>{
  277. if(response.data.state == 1){
  278. var outList = response.data.data.outList
  279. console.log("outList990-0000990",outList)
  280. for(let i=0;i<outList.length;i++){
  281. if(outList[i].is_sys == 0){
  282. outList[i].stock_way = 3
  283. }
  284. if(outList[i].is_sys == 1){
  285. outList[i].stock_way = 2
  286. }
  287. this.tableList.push(outList[i])
  288. }
  289. var total = response.data.data.total
  290. this.total = total
  291. }
  292. })
  293. },
  294. getStockDrugCount(){
  295. var params ={
  296. keywords: this.keywords,
  297. start_time:this.start_time,
  298. end_time:this.end_time,
  299. }
  300. getStockDrugCount(params).then(response=>{
  301. if(response.data.state == 1){
  302. var count = response.data.data.count
  303. console.log("详情入库统计",count)
  304. this.countList = count
  305. var outlist = response.data.data.outList
  306. console.log("详情出库数量",outlist)
  307. this.outCountList = outlist
  308. var autoCount = response.data.data.autoCount
  309. console.log("详情自动出库",autoCount)
  310. this.autoCountList = autoCount
  311. }
  312. })
  313. },
  314. getInCount(id){
  315. var count= ""
  316. for(let i=0;i<this.countList.length;i++){
  317. if(id == this.countList[i].good_id){
  318. count = this.countList[i].count
  319. }
  320. }
  321. return count
  322. },
  323. getOutCount(id){
  324. console.log("id222",id)
  325. var count = ""
  326. for(let i=0;i<this.outCountList.length;i++){
  327. if(id == this.outCountList[i].good_id){
  328. count = this.outCountList[i].count
  329. }
  330. }
  331. return count
  332. },
  333. getAutoCount(id){
  334. var count= ""
  335. for(let i=0;i<this.autoCountList.length;i++){
  336. if(id == this.autoCountList[i].good_id){
  337. count = this.autoCountList[i].count
  338. }
  339. }
  340. return count
  341. },
  342. getTimestamp(time) {
  343. // 把时间日期转成时间戳
  344. return new Date(time).getTime() / 1000;
  345. },
  346. changeDrug(val){
  347. this.tableList= []
  348. if(val == 4 || val == 0){
  349. this.getlist()
  350. }
  351. if(val == 2 || val == 3 || val == 0){
  352. this.getStockOutList()
  353. }
  354. }
  355. }
  356. }
  357. </script>
  358. <style rel="stylesheet/css" lang="scss" scoped>
  359. .information {
  360. border: 1px #dcdfe6 solid;
  361. padding: 30px 20px 30px 20px;
  362. .border {
  363. border-bottom: 1px #dcdfe6 solid;
  364. margin: 0px 0 20px 0;
  365. }
  366. }
  367. .title {
  368. background: #409eff;
  369. height: 44px;
  370. line-height: 44px;
  371. padding: 0 0 0 10px;
  372. color: #fff;
  373. margin: 0 0 10px 0;
  374. }
  375. .edit_separater {
  376. border-top: 1px solid rgb(233, 233, 233);
  377. margin-top: 15px;
  378. margin-bottom: 15px;
  379. }
  380. </style>
  381. <style>
  382. .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
  383. font-size: 12px;
  384. }
  385. .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
  386. background: #6fb5fa;
  387. }
  388. .count {
  389. color: #bd2c00;
  390. }
  391. .el-table td,
  392. .el-table th.is-leaf,
  393. .el-table--border,
  394. .el-table--group {
  395. border-color: #d0d3da;
  396. }
  397. .el-table--border::after,
  398. .el-table--group::after,
  399. .el-table::before {
  400. background-color: #d0d3da;
  401. }
  402. </style>