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

stockFlow.vue 15KB

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