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

purchaseStockQuery.vue 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571
  1. <template>
  2. <div class="main-contain">
  3. <div class="app-container ">
  4. <div style="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
  5. <div>
  6. <span>操作时间:</span>
  7. <el-date-picker
  8. size="small"
  9. v-model="start_time"
  10. prefix-icon="el-icon-date"
  11. :editable="false"
  12. style="width: 150px;"
  13. type="date"
  14. placeholder="选择日期时间"
  15. align="right"
  16. format="yyyy-MM-dd"
  17. value-format="yyyy-MM-dd"
  18. @change="startTimeChange"
  19. ></el-date-picker>
  20. <span>-</span>
  21. <el-date-picker
  22. size="small"
  23. v-model="end_time"
  24. prefix-icon="el-icon-date"
  25. :editable="false"
  26. style="width: 150px;"
  27. type="date"
  28. placeholder="选择日期时间"
  29. align="right"
  30. format="yyyy-MM-dd"
  31. value-format="yyyy-MM-dd"
  32. @change="endTimeChange"
  33. ></el-date-picker>
  34. <span>耗材类型:</span>
  35. <el-select v-model="good_type" style="width:200px;margin-right:10px;" placeholder="请选择"
  36. filterable
  37. @change="changeGoodTypeName">
  38. <el-option
  39. v-for="item in goodTypeList"
  40. :key="item.id"
  41. :label="item.type_name"
  42. :value="item.id">
  43. </el-option>
  44. </el-select>
  45. <el-input v-model="keyword" style="width:200px" placeholder="请输入耗材名称或生产厂商" ></el-input>
  46. <el-button type="primary" icon="el-icon-search" @click="seach">搜索</el-button>
  47. </div>
  48. </div>
  49. <el-table
  50. :row-style="{ color: '#303133' }"
  51. :header-cell-style="{
  52. backgroundColor: 'rgb(245, 247, 250)',
  53. color: '#606266'
  54. }"
  55. :data="tableList"
  56. :class="signAndWeighBoxPatients"
  57. border
  58. >
  59. <el-table-column label="耗材类型" align="center">
  60. <template slot-scope="scope">
  61. {{getGoodTypeName(scope.row.good_type_id)}}
  62. </template>
  63. </el-table-column>
  64. <el-table-column label="耗材名称" align="center">
  65. <template slot-scope="scope">
  66. {{scope.row.good_name}}
  67. </template>
  68. </el-table-column>
  69. <el-table-column label="规格&单位" align="center">
  70. <template slot-scope="scope">
  71. {{scope.row.specification_name}}
  72. </template>
  73. </el-table-column>
  74. <el-table-column label="生产厂商" align="center">
  75. <template slot-scope="scope">
  76. {{getManufacturName(scope.row.manufacturer)}}
  77. </template>
  78. </el-table-column>
  79. <el-table-column label="期初结余" align="center">
  80. <el-table-column prop="stockIn" label="数量" width="100">
  81. </el-table-column>
  82. <el-table-column prop="buy_price" label="进货金额" width="100">
  83. </el-table-column>
  84. <el-table-column prop="stockMoney" label="销售金额" width="100">
  85. </el-table-column>
  86. </el-table-column>
  87. <el-table-column label="本期增加" align="center">
  88. <el-table-column prop="stockAdd" label="数量" width="100">
  89. </el-table-column>
  90. <el-table-column prop="buy_price" label="进货金额" width="100">
  91. </el-table-column>
  92. <el-table-column prop="addStockMoney" label="销售金额" width="100">
  93. </el-table-column>
  94. </el-table-column>
  95. <el-table-column label="本期减少" align="center">
  96. <el-table-column prop="outStock" label="数量" width="100">
  97. </el-table-column>
  98. <el-table-column prop="buy_price" label="进货金额" width="100">
  99. </el-table-column>
  100. <el-table-column prop="stockOutMoney" label="销售金额" width="100">
  101. </el-table-column>
  102. </el-table-column>
  103. <el-table-column label="期末结余" align="center">
  104. <el-table-column prop="overStock" label="数量" width="100">
  105. </el-table-column>
  106. <el-table-column prop="buy_price" label="进货金额" width="100">
  107. </el-table-column>
  108. <el-table-column prop="oveMoney" label="销售金额" width="100">
  109. </el-table-column>
  110. </el-table-column>
  111. </el-table>
  112. <el-pagination
  113. @size-change="handleSizeChange"
  114. @current-change="handleCurrentChange"
  115. :page-sizes="[10, 50, 100,200,500,1000]"
  116. :page-size="10"
  117. background
  118. align="right"
  119. style="margin-top:20px;"
  120. layout="total, sizes, prev, pager, next, jumper"
  121. :total="total"
  122. >
  123. </el-pagination>
  124. </div>
  125. </div>
  126. </template>
  127. <script>
  128. import { getStorehouseList,getPurchaseStockQuery } from "@/api/drug/drug"
  129. import {
  130. getStockDrugCount
  131. } from "@/api/stock";
  132. import { uParseTime } from '@/utils/tools'
  133. export default {
  134. data(){
  135. return{
  136. tableList:[],
  137. goodList:[
  138. {id:1,name:"全部耗材"},
  139. {id:2,name:"库存预警"},
  140. ],
  141. houseList:[],
  142. storehouse_id:0,
  143. good_type:0,
  144. multipleSelection: [],
  145. signAndWeighBoxPatients: "sign-and-weigh-box-patients",
  146. manufacturerList:[],
  147. limit:10,
  148. page:1,
  149. total:0,
  150. keyword:"",
  151. goodTypeList:[],
  152. start_time:"",
  153. end_time:"",
  154. countList:[],
  155. outCountList:[],
  156. autoCountList:[],
  157. cancelCountList:[],
  158. org_id:this.$store.getters.xt_user.org_id,
  159. dialogVisible:false,
  160. start_first_time:"",
  161. end_first_time:"",
  162. tableData:[],
  163. good_id:0,
  164. patientList:[],
  165. good_name:"",
  166. specification_name:""
  167. }
  168. },
  169. methods:{
  170. changeStorehouseName(){
  171. },
  172. changeGoodTypeName(){
  173. this.getlist()
  174. },
  175. getStorehouseList(){
  176. getStorehouseList().then(response=>{
  177. if(response.data.state == 1){
  178. var houseList = response.data.data.list
  179. var obj = {id:0,storehouse_name:"全部"}
  180. this.houseList.push(obj)
  181. for(let i=0;i<houseList.length;i++){
  182. this.houseList.push(houseList[i])
  183. }
  184. this.manufacturerList = response.data.data.manufacturerList
  185. var obj = {id:0,type_name:"全部"}
  186. this.goodTypeList.push(obj)
  187. var goodTypeList = response.data.data.goodTypeList
  188. for(let i=0;i<goodTypeList.length;i++){
  189. this.goodTypeList.push(goodTypeList[i])
  190. }
  191. this.patientList = response.data.data.patientList
  192. }
  193. })
  194. },
  195. getlist(){
  196. var params = {
  197. good_type:this.good_type,
  198. keyword:this.keyword,
  199. page:this.page,
  200. limit:this.limit,
  201. start_time:this.start_time,
  202. end_time:this.end_time,
  203. }
  204. getPurchaseStockQuery(params).then(response=>{
  205. if(response.data.state == 1){
  206. var list = response.data.data.list
  207. for(let i=0;i<list.length;i++){
  208. list[i].stockIn = this.getWarehouseInfoStart(list[i].warehouse_info,list[i].warehouse_out_info)
  209. list[i].stockMoney = (this.getWarehouseInfoStart(list[i].warehouse_info,list[i].warehouse_out_info) * list[i].buy_price).toFixed(2)
  210. list[i].stockAdd = this.getWarehouseInfoOne(list[i].warehouse_info)
  211. list[i].addStockMoney = (this.getWarehouseInfoOne(list[i].warehouse_info) *list[i].buy_price).toFixed(2)
  212. list[i].outStock = this.getWarehouseOut(list[i].warehouse_out_info)
  213. list[i].stockOutMoney = (this.getWarehouseOut(list[i].warehouse_out_info)*list[i].buy_price).toFixed(2)
  214. list[i].overStock = this.getWarehouseInfo(list[i].warehouse_info)
  215. list[i].oveMoney = (this.getWarehouseInfo(list[i].warehouse_info)*list[i].buy_price).toFixed(2)
  216. }
  217. this.tableList = list
  218. this.total = response.data.data.total
  219. this.manufacturerList = response.data.data.manufacturerList
  220. }
  221. })
  222. },
  223. getManufacturName(id){
  224. var manufacturer_name = ""
  225. for(let i=0;i<this.manufacturerList.length;i++){
  226. if(id == this.manufacturerList[i].id){
  227. manufacturer_name = this.manufacturerList[i].manufacturer_name
  228. }
  229. }
  230. return manufacturer_name
  231. },
  232. handleSizeChange(val) {
  233. this.limit = val;
  234. this.getlist()
  235. },
  236. handleCurrentChange(val) {
  237. this.page = val;
  238. this.getlist()
  239. },
  240. handleSizeChangeOne(val) {
  241. this.limitone = val;
  242. this.toDialogClick(this.good_id,this.good_name,this.specification_name)
  243. },
  244. handleCurrentChangeOne(val) {
  245. this.pageone = val;
  246. this.toDialogClick(this.good_id,this.good_name,this.specification_name)
  247. },
  248. seach(){
  249. this.getlist()
  250. },
  251. getGoodTypeName(id){
  252. var type_name = ""
  253. for(let i=0;i<this.goodTypeList.length;i++){
  254. if(id == this.goodTypeList[i].id){
  255. type_name = this.goodTypeList[i].type_name
  256. }
  257. }
  258. return type_name
  259. },
  260. getHouseName(id){
  261. var storehouse_name = ""
  262. for(let i=0;i<this.houseList.length;i++){
  263. if(id == this.houseList[i].id){
  264. storehouse_name = this.houseList[i].storehouse_name
  265. }
  266. }
  267. return storehouse_name
  268. },
  269. getWareInfoCount(val,storehouse_id){
  270. var count = 0
  271. if(val.length > 0){
  272. for(let i=0;i<val.length;i++){
  273. if(val[i].storehouse_id == storehouse_id){
  274. count +=val[i].warehousing_count
  275. }
  276. }
  277. }
  278. if(count > 0){
  279. return count
  280. }else{
  281. return ""
  282. }
  283. },
  284. getStockDrugCount(){
  285. var params ={
  286. keywords: this.keywords,
  287. start_time:this.start_time,
  288. end_time:this.end_time,
  289. }
  290. getStockDrugCount(params).then(response=>{
  291. if(response.data.state == 1){
  292. var outlist = response.data.data.outList
  293. this.outCountList = outlist
  294. var autoCount = response.data.data.autoCount
  295. this.autoCountList = autoCount
  296. var totalCount = response.data.data.totalCount
  297. this.cancelCountList = totalCount
  298. }
  299. })
  300. },
  301. getWareInfoCountOne(val,storehouse_id){
  302. var count = 0
  303. if(val.length > 0){
  304. for(let i=0;i<val.length;i++){
  305. if(val[i].storehouse_id == storehouse_id){
  306. count +=val[i].stock_count
  307. }
  308. }
  309. }
  310. if(count > 0){
  311. return count
  312. }else{
  313. return ""
  314. }
  315. },
  316. getOutCount(id){
  317. var count = 0
  318. for(let i=0;i<this.outCountList.length;i++){
  319. if(id == this.outCountList[i].good_id){
  320. count = this.outCountList[i].count
  321. }
  322. }
  323. return count
  324. },
  325. getAutoCount(id){
  326. var count= 0
  327. for(let i=0;i<this.autoCountList.length;i++){
  328. if(id == this.autoCountList[i].good_id){
  329. count = this.autoCountList[i].count
  330. }
  331. }
  332. return count
  333. },
  334. getCancelCount(id){
  335. var count = 0
  336. for(let i=0;i<this.cancelCountList.length;i++){
  337. if(id == this.cancelCountList[i].good_id){
  338. count = this.cancelCountList[i].count
  339. }
  340. }
  341. return count
  342. },
  343. getCancelCountInfo(cancel_stock_info,storehouse_id){
  344. var count = 0
  345. if(cancel_stock_info.length >0){
  346. for(let i=0;i<cancel_stock_info.length;i++){
  347. if(storehouse_id == cancel_stock_info[i].storehouse_id){
  348. count += cancel_stock_info[i].count
  349. }
  350. }
  351. }
  352. return count
  353. },
  354. getWareOutInfoCount(warehouse_out_info,storehouse_id){
  355. var count = 0
  356. if(warehouse_out_info.length > 0){
  357. for(let i=0;i<warehouse_out_info.length;i++){
  358. if(storehouse_id == warehouse_out_info[i].storehouse_id){
  359. count +=warehouse_out_info[i].count
  360. }
  361. }
  362. }
  363. return count
  364. },
  365. getInCount(id){
  366. var count= 0
  367. for(let i=0;i<this.countList.length;i++){
  368. if(id == this.countList[i].good_id){
  369. count = this.countList[i].count
  370. }
  371. }
  372. return count
  373. },
  374. getOutCount(id){
  375. var count = 0
  376. for(let i=0;i<this.outCountList.length;i++){
  377. if(id == this.outCountList[i].good_id){
  378. count = this.outCountList[i].count
  379. }
  380. }
  381. return count
  382. },
  383. getAutoCount(id){
  384. var count= 0
  385. for(let i=0;i<this.autoCountList.length;i++){
  386. if(id == this.autoCountList[i].good_id){
  387. count = this.autoCountList[i].count
  388. }
  389. }
  390. return count
  391. },
  392. getCancelCount(id){
  393. var count = 0
  394. for(let i=0;i<this.cancelCountList.length;i++){
  395. if(id == this.cancelCountList[i].good_id){
  396. count = this.cancelCountList[i].count
  397. }
  398. }
  399. return count
  400. },
  401. getStockCount(id){
  402. var stock_count = 0
  403. for(let i=0;i<this.countList.length;i++){
  404. if(id == this.countList[i].good_id){
  405. stock_count = this.countList[i].stock_count
  406. }
  407. }
  408. return stock_count
  409. },
  410. getWareInfo(arr){
  411. var total = 0
  412. if(arr.length > 0){
  413. for(let i=0;i<arr.length;i++){
  414. total += parseInt(arr[i].warehousing_count)
  415. }
  416. }else{
  417. total = ""
  418. }
  419. return total
  420. },
  421. getOverplus(arr){
  422. var total = 0
  423. if(arr.length > 0){
  424. for(let i=0;i<arr.length;i++){
  425. total += arr[i].stock_count
  426. }
  427. }else{
  428. total = ""
  429. }
  430. return total
  431. },
  432. getCancelInfo(arr){
  433. var total = 0
  434. if(arr.length > 0){
  435. for(let i=0;i<arr.length;i++){
  436. total += arr[i].count
  437. }
  438. }else{
  439. total = ""
  440. }
  441. return total
  442. },
  443. getOverFlushInfo(arr){
  444. var total = 0
  445. if(arr.length >0){
  446. for(let i=0;i<arr.length;i++){
  447. total += arr[i].stock_count
  448. }
  449. }
  450. return total
  451. },
  452. startFirstTimeChange(){
  453. this.getlist()
  454. },
  455. endEndTimeChange(){
  456. this.getlist()
  457. },
  458. getTime(val) {
  459. if(val < 0){
  460. return ""
  461. }
  462. if(val == ""){
  463. return ""
  464. }else {
  465. return uParseTime(val, '{y}-{m}-{d}')
  466. }
  467. },
  468. getName(id){
  469. var name = ""
  470. for(let i=0;i<this.patientList.length;i++){
  471. if(id == this.patientList[i].id){
  472. name = this.patientList[i].name
  473. }
  474. }
  475. return name
  476. },
  477. endTimeChange(){
  478. },
  479. startTimeChange(){
  480. },
  481. getWarehouseInfoStart(arr1,arr2){
  482. var count =0
  483. var addCount = 0
  484. var outCount = 0
  485. for(let i=0;i<arr1.length;i++){
  486. addCount +=arr1[i].warehousing_count
  487. }
  488. for(let i=0;i<arr2.length;i++){
  489. outCount +=arr2[i].count
  490. }
  491. count = addCount - outCount
  492. if(count > 0 ){
  493. return count
  494. }else{
  495. return count
  496. }
  497. },
  498. getWarehouseInfo(val){
  499. var count =0
  500. for(let i=0;i<val.length;i++){
  501. count +=val[i].stock_count
  502. }
  503. if(count > 0 ){
  504. return count
  505. }else{
  506. return count
  507. }
  508. },
  509. getWarehouseInfoOne(val){
  510. var count =0
  511. for(let i=0;i<val.length;i++){
  512. count +=val[i].warehousing_count
  513. }
  514. if(count > 0 ){
  515. return count
  516. }else{
  517. return count
  518. }
  519. },
  520. getWarehouseOut(val){
  521. var count = 0
  522. for(let i=0;i<val.length;i++){
  523. count +=val[i].count
  524. }
  525. if(count >0){
  526. return count
  527. }else{
  528. return count
  529. }
  530. }
  531. },
  532. created(){
  533. this.getStorehouseList()
  534. this.getlist()
  535. this.getStockDrugCount()
  536. }
  537. }
  538. </script>