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

stockBatchNumber.vue 11KB

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