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

stockBatchNumber.vue 11KB

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