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

goodNewQuery.vue 38KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217
  1. <template>
  2. <div class="main-contain">
  3. <div class="app-container" style="padding-left:0px;margin: 0px;"
  4. v-loading="loading"
  5. element-loading-text="拼命加载中">
  6. <div style="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
  7. <div>
  8. <span style="font-size:14px;color:#606266">仓库:</span>
  9. <el-select v-model="storehouse_id" style="width:200px;margin-right:10px;" placeholder="请选择"
  10. filterable
  11. @change="changeStorehouseName">
  12. <el-option
  13. v-for="item in houseList"
  14. :key="item.id"
  15. :label="item.storehouse_name"
  16. :value="item.id">
  17. </el-option>
  18. </el-select>
  19. <span style="font-size:14px;color:#606266">库存预警:</span>
  20. <el-select v-model="good_type" style="width:250px;margin-right:10px;" placeholder="请选择"
  21. filterable
  22. @change="changeGoodName">
  23. <el-option
  24. v-for="item in goodList"
  25. :key="item.id"
  26. :label="item.name"
  27. :value="item.id">
  28. </el-option>
  29. </el-select>
  30. <el-input v-model="keyword" style="width:200px" placeholder="请输入耗材名称或生产厂商" ></el-input>
  31. <el-button type="primary" icon="el-icon-search" @click="seach">搜索</el-button>
  32. </div>
  33. <div>
  34. <!-- <el-button size="small" type="primary" @click="toClickTwo">脚本</el-button> -->
  35. <el-button size="small" type="primary" @click="exportList">导出</el-button>
  36. <el-button size="small" type="primary" @click="toPrint">打印</el-button>
  37. </div>
  38. </div>
  39. <el-table
  40. :row-style="{ color: '#303133' }"
  41. :header-cell-style="{
  42. backgroundColor: 'rgb(245, 247, 250)',
  43. color: '#606266'
  44. }"
  45. :data="tableList"
  46. :class="signAndWeighBoxPatients"
  47. border
  48. :cell-class-name="cellStyle"
  49. >
  50. <el-table-column label="耗材编码" align="center" v-if="org_id ==9956 || org_id == 0">
  51. <template slot-scope="scope">
  52. {{ scope.row.good_number?scope.row.good_number:"" }}
  53. </template>
  54. </el-table-column>
  55. <el-table-column label="耗材类型" align="center">
  56. <template slot-scope="scope">
  57. {{getGoodTypeName(scope.row.good_type_id)}}
  58. </template>
  59. </el-table-column>
  60. <el-table-column label="耗材名称" align="center">
  61. <template slot-scope="scope">
  62. {{scope.row.good_name}}
  63. </template>
  64. </el-table-column>
  65. <el-table-column label="规格&单位" align="center">
  66. <template slot-scope="scope">
  67. {{scope.row.specification_name}}/{{scope.row.packing_unit}}
  68. </template>
  69. </el-table-column>
  70. <el-table-column label="生产厂商" align="center">
  71. <template slot-scope="scope">
  72. {{getManufacturName(scope.row.manufacturer)}}
  73. </template>
  74. </el-table-column>
  75. <el-table-column label="经销商" align="center" v-if="org_id ==10485">
  76. <template slot-scope="scope">
  77. {{getDearName(scope.row.dealer)}}
  78. </template>
  79. </el-table-column>
  80. <el-table-column label="批准文号" align="center">
  81. <template slot-scope="scope">
  82. {{scope.row.number}}
  83. </template>
  84. </el-table-column>
  85. <el-table-column label="国家编码" align="center">
  86. <template slot-scope="scope">
  87. {{scope.row.social_security_directory_code}}
  88. </template>
  89. </el-table-column>
  90. <el-table-column label="仓库名称" align="center">
  91. <template slot-scope="scope">
  92. <tr style="background: none" v-for="(item,index) in scope.row.xt_good_stock_info" :key="index">
  93. <td style="border-right: none; border-inline-end: none;text-align: center" >
  94. {{getHouseName(item.storehouse_id)}}
  95. </td>
  96. </tr>
  97. </template>
  98. </el-table-column>
  99. <el-table-column label="入库数量" align="center">
  100. <template slot-scope="scope">
  101. <tr style="background: none" v-for="(item,index) in scope.row.xt_good_stock_info" :key="index">
  102. <td style="border-right: none; border-inline-end: none;text-align: center">
  103. {{getGoodIn(scope.row.xt_good_stock,item.storehouse_id)}}
  104. </td>
  105. </tr>
  106. </template>
  107. </el-table-column>
  108. <el-table-column label="出库数量" align="center">
  109. <template slot-scope="scope">
  110. <span>
  111. <tr style="background: none" v-for="(item,index) in scope.row.xt_good_stock_info" :key="index">
  112. <td style="border-right: none; border-inline-end: none;text-align: center">
  113. <span>
  114. {{getGoodAct(scope.row.xt_good_stock,item.storehouse_id)}}
  115. </span>
  116. </td>
  117. </tr>
  118. </span>
  119. </template>
  120. </el-table-column>
  121. <el-table-column label="退库数量" align="center">
  122. <template slot-scope="scope">
  123. <tr style="background: none" v-for="(item,index) in scope.row.xt_good_stock_info" :key="index">
  124. <td style="border-right: none; border-inline-end: none;text-align: center">
  125. {{getGoodCancel(scope.row.xt_good_stock,item.storehouse_id)}}
  126. </td>
  127. </tr>
  128. </template>
  129. </el-table-column>
  130. <el-table-column label="实际出库" align="center">
  131. <template slot-scope="scope">
  132. <span>
  133. <tr style="background: none" v-for="(item,index) in scope.row.xt_good_stock_info" :key="index">
  134. <td style="border-right: none; border-inline-end: none;text-align: center">
  135. <span style="color:#0099FF" @click="toDialogClick(scope.row.id,scope.row.good_name,scope.row.specification_name,item.storehouse_id)">
  136. {{getGoodOut(scope.row.xt_good_stock,item.storehouse_id)}}
  137. </span>
  138. </td>
  139. </tr>
  140. </span>
  141. </template>
  142. </el-table-column>
  143. <el-table-column label="剩余库存" align="center">
  144. <template slot-scope="scope">
  145. <span>
  146. <tr style="background: none" v-for="(item,index) in scope.row.xt_good_stock_info" :key="index">
  147. <td style="border-right: none; border-inline-end: none;text-align: center">
  148. {{getGoodFlush(scope.row.xt_good_stock,item.storehouse_id)}}
  149. </td>
  150. </tr>
  151. </span>
  152. </template>
  153. </el-table-column>
  154. <el-table-column label="总库存量" align="center">
  155. <template slot-scope="scope">
  156. <span>
  157. <span v-if="getOverFlushInfo(scope.row.xt_warehouse_info) <= scope.row.stock_warn_count" style="color:red">
  158. {{getSumCount(scope.row.xt_good_stock,scope.row.id)}}
  159. <i class="el-icon-warning"></i>
  160. </span>
  161. <span v-if="getOverFlushInfo(scope.row.xt_warehouse_info) > scope.row.stock_warn_count">
  162. {{getSumCount(scope.row.xt_good_stock,scope.row.id)}}
  163. </span>
  164. </span>
  165. </template>
  166. </el-table-column>
  167. <el-table-column label="操作" align="center" width="200px">
  168. <template slot-scope="scope">
  169. <el-button
  170. size="small"
  171. type="primary"
  172. @click="toClick(scope.row)"
  173. >库存流水
  174. </el-button>
  175. <el-button
  176. size="small"
  177. type="primary"
  178. @click="toClickOne(scope.row)"
  179. >批次
  180. </el-button>
  181. </template>
  182. </el-table-column>
  183. </el-table>
  184. <el-pagination
  185. @size-change="handleSizeChange"
  186. @current-change="handleCurrentChange"
  187. :page-sizes="[10, 50, 100,200,300,400,500,1000]"
  188. :page-size="10"
  189. background
  190. align="right"
  191. style="margin-top:20px;"
  192. layout="total, sizes, prev, pager, next, jumper"
  193. :total="total"
  194. >
  195. </el-pagination>
  196. </div>
  197. <el-dialog
  198. title="出库详情"
  199. :visible.sync="dialogVisible"
  200. width="70%">
  201. <span>
  202. 耗材名称:{{good_name}}
  203. 规格&单位:{{specification_name}}
  204. 查询日期:
  205. <el-date-picker
  206. size="small"
  207. v-model="start_first_time"
  208. prefix-icon="el-icon-date"
  209. :editable="false"
  210. style="width: 150px;"
  211. type="date"
  212. placeholder="选择日期时间"
  213. align="right"
  214. format="yyyy-MM-dd"
  215. value-format="yyyy-MM-dd"
  216. @change="startFirstTimeChange"
  217. ></el-date-picker>
  218. <span>-</span>
  219. <el-date-picker
  220. size="small"
  221. v-model="end_first_time"
  222. prefix-icon="el-icon-date"
  223. :editable="false"
  224. style="width: 150px;"
  225. type="date"
  226. placeholder="选择日期时间"
  227. align="right"
  228. format="yyyy-MM-dd"
  229. value-format="yyyy-MM-dd"
  230. @change="endEndTimeChange"
  231. ></el-date-picker>
  232. </span>
  233. <el-divider></el-divider>
  234. <el-table
  235. :row-style="{ color: '#303133' }"
  236. :header-cell-style="{
  237. backgroundColor: 'rgb(245, 247, 250)',
  238. color: '#606266'
  239. }"
  240. :data="tableData"
  241. :class="signAndWeighBoxPatients"
  242. border
  243. >
  244. <el-table-column label="序号" align="center">
  245. <template slot-scope="scope">
  246. {{scope.$index + 1}}
  247. </template>
  248. </el-table-column>
  249. <el-table-column label="单据编号" align="center">
  250. <template slot-scope="scope">
  251. {{scope.row.warehouse_out_order_number}}
  252. </template>
  253. </el-table-column>
  254. <el-table-column label="操作时间" align="center">
  255. <template slot-scope="scope">
  256. {{getTimeOne(scope.row.ctime)}}
  257. </template>
  258. </el-table-column>
  259. <el-table-column label="出库数量" align="center">
  260. <template slot-scope="scope">
  261. {{scope.row.count}}{{scope.row.GoodInfo.packing_unit}}
  262. </template>
  263. </el-table-column>
  264. <el-table-column label="库存数量" align="center">
  265. <template slot-scope="scope">
  266. {{scope.row.over_count}}
  267. </template>
  268. </el-table-column>
  269. <el-table-column label="使用人" align="center">
  270. <template slot-scope="scope">
  271. {{getName(scope.row.patient_id)}}
  272. </template>
  273. </el-table-column>
  274. <el-table-column label="备注" align="center">
  275. <template slot-scope="scope">
  276. {{scope.row.remark}}
  277. </template>
  278. </el-table-column>
  279. </el-table>
  280. <el-pagination
  281. @size-change="handleSizeChangeOne"
  282. @current-change="handleCurrentChangeOne"
  283. :page-sizes="[10, 50, 100,200,500,1000]"
  284. :page-size="10"
  285. background
  286. align="right"
  287. style="margin-top:20px;"
  288. layout="total, sizes, prev, pager, next, jumper"
  289. :total="totalone"
  290. >
  291. </el-pagination>
  292. <span slot="footer" class="dialog-footer">
  293. <el-button @click="dialogVisible = false">取 消</el-button>
  294. <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
  295. </span>
  296. </el-dialog>
  297. </div>
  298. </template>
  299. <script>
  300. import { getStorehouseList,getGoodNewQuery,getGoodWarehouseOutInfoById,toSendGoodInfomation } from "@/api/drug/drug"
  301. import {
  302. getStockDrugCount
  303. } from "@/api/stock";
  304. import { uParseTime } from '@/utils/tools'
  305. const moment = require('moment')
  306. export default {
  307. data(){
  308. return{
  309. tableList:[],
  310. goodList:[
  311. {id:1,name:"全部耗材"},
  312. {id:2,name:"库存预警"},
  313. {id:3,name:"库存为零"},
  314. {id:4,name:"库存不为零"},
  315. ],
  316. houseList:[],
  317. storehouse_id:0,
  318. good_type:1,
  319. multipleSelection: [],
  320. signAndWeighBoxPatients: "sign-and-weigh-box-patients",
  321. manufacturerList:[],
  322. limit:10,
  323. page:1,
  324. total:0,
  325. limitone:10,
  326. pageone:1,
  327. totalone:0,
  328. keyword:"",
  329. goodTypeList:[],
  330. start_time:"",
  331. end_time:"",
  332. countList:[],
  333. outCountList:[],
  334. autoCountList:[],
  335. cancelCountList:[],
  336. org_id:this.$store.getters.xt_user.org_id,
  337. dialogVisible:false,
  338. start_first_time:moment().startOf('month').format("YYYY-MM-DD"),
  339. end_first_time:moment().endOf('month').format("YYYY-MM-DD"),
  340. tableData:[],
  341. good_id:0,
  342. patientList:[],
  343. good_name:"",
  344. specification_name:"",
  345. loading:false,
  346. warehouseInfoByList:[],
  347. cancelStockInfoByList:[],
  348. warehouseOutByList:[],
  349. flushList:[],
  350. type_name:0,
  351. storehouseId:0,
  352. dealerList:[]
  353. }
  354. },
  355. methods:{
  356. changeStorehouseName(){
  357. this.getlist()
  358. },
  359. changeGoodName(){
  360. this.getlist()
  361. },
  362. toClick(val){
  363. var manufacturer_name = ""
  364. var specification_name = ""
  365. for(let i=0;i<this.manufacturerList.length;i++){
  366. if(val.manufacturer == this.manufacturerList[i].id){
  367. manufacturer_name = this.manufacturerList[i].manufacturer_name
  368. }
  369. }
  370. specification_name = val.specification_name + "/" + val.packing_unit
  371. var overCount = this.getOverplus(val.xt_warehouse_info)
  372. // window.sessionStorage.setItem('start_time',this.start_time)
  373. // window.sessionStorage.setItem('end_time',this.end_time)
  374. this.$router.push({path:"/stock/in/stockflow?id="+val.id+"&manufacturer="+manufacturer_name+"&packing_unit="+val.packing_unit+"&overCount="+overCount})
  375. },
  376. toClickOne(val){
  377. var manufacturer_name = ""
  378. var specification_name = ""
  379. for(let i=0;i<this.manufacturerList.length;i++){
  380. if(val.manufacturer == this.manufacturerList[i].id){
  381. manufacturer_name = this.manufacturerList[i].manufacturer_name
  382. }
  383. }
  384. specification_name = val.specification_name + "/" + val.packing_unit
  385. var overCount = this.getOverplus(val.xt_warehouse_info)
  386. // window.sessionStorage.setItem('start_time',this.start_time)
  387. // window.sessionStorage.setItem('end_time',this.end_time)
  388. this.$router.push({path:"/stock/in/stockbatchnumber?id="+val.id+"&manufacturer="+manufacturer_name+"&packing_unit="+val.packing_unit+"&overCount="+overCount})
  389. },
  390. getStorehouseList(){
  391. getStorehouseList().then(response=>{
  392. if(response.data.state == 1){
  393. var houseList = response.data.data.list
  394. var obj = {id:0,storehouse_name:"全部"}
  395. this.houseList.push(obj)
  396. for(let i=0;i<houseList.length;i++){
  397. this.houseList.push(houseList[i])
  398. }
  399. this.manufacturerList = response.data.data.manufacturerList
  400. this.goodTypeList = response.data.data.goodTypeList
  401. this.patientList = response.data.data.patientList
  402. this.dealerList = response.data.data.dealerList
  403. }
  404. })
  405. },
  406. getlist(){
  407. this.loading = true
  408. var params = {
  409. storehouse_id:this.storehouse_id,
  410. good_type:this.good_type,
  411. keyword:this.keyword,
  412. page:this.page,
  413. limit:this.limit,
  414. start_time:this.start_time,
  415. end_time:this.end_time,
  416. }
  417. getGoodNewQuery(params).then(response=>{
  418. if(response.data.state == 1){
  419. // var list = response.data.data.list
  420. var list = response.data.data.stockList
  421. this.loading = false
  422. this.tableList = list
  423. this.total = response.data.data.total
  424. }
  425. })
  426. },
  427. getManufacturName(id){
  428. var manufacturer_name = ""
  429. for(let i=0;i<this.manufacturerList.length;i++){
  430. if(id == this.manufacturerList[i].id){
  431. manufacturer_name = this.manufacturerList[i].manufacturer_name
  432. }
  433. }
  434. return manufacturer_name
  435. },
  436. getDearName(id){
  437. var dear_name = ""
  438. for(let i=0;i<this.dealerList.length;i++){
  439. if(id == this.dealerList[i].id){
  440. dear_name = this.dealerList[i].dealer_name
  441. }
  442. }
  443. return dear_name
  444. },
  445. handleSizeChange(val) {
  446. this.limit = val;
  447. this.getlist()
  448. },
  449. handleCurrentChange(val) {
  450. this.page = val;
  451. this.getlist()
  452. },
  453. handleSizeChangeOne(val) {
  454. this.limitone = val;
  455. this.toDialogClick(this.good_id,this.good_name,this.specification_name,this.storehouseId)
  456. },
  457. handleCurrentChangeOne(val) {
  458. this.pageone = val;
  459. this.toDialogClick(this.good_id,this.good_name,this.specification_name,this.storehouseId)
  460. },
  461. seach(){
  462. this.getlist()
  463. },
  464. getGoodTypeName(id){
  465. var type_name = ""
  466. for(let i=0;i<this.goodTypeList.length;i++){
  467. if(id == this.goodTypeList[i].id){
  468. type_name = this.goodTypeList[i].type_name
  469. }
  470. }
  471. return type_name
  472. },
  473. getHouseName(id){
  474. var storehouse_name = ""
  475. for(let i=0;i<this.houseList.length;i++){
  476. if(id == this.houseList[i].id){
  477. storehouse_name = this.houseList[i].storehouse_name
  478. }
  479. }
  480. return storehouse_name
  481. },
  482. getWareInfoCount(val,storehouse_id){
  483. var count = 0
  484. if(val!=null&&val.length > 0){
  485. for(let i=0;i<val.length;i++){
  486. if(val[i].storehouse_id == storehouse_id){
  487. count +=val[i].warehousing_count
  488. }
  489. }
  490. }
  491. if(count > 0){
  492. return count
  493. }else{
  494. return ""
  495. }
  496. },
  497. getStockDrugCount(){
  498. var params ={
  499. keywords: this.keywords,
  500. start_time:this.start_time,
  501. end_time:this.end_time,
  502. }
  503. getStockDrugCount(params).then(response=>{
  504. if(response.data.state == 1){
  505. var outlist = response.data.data.outList
  506. this.outCountList = outlist
  507. var autoCount = response.data.data.autoCount
  508. this.autoCountList = autoCount
  509. var totalCount = response.data.data.totalCount
  510. this.cancelCountList = totalCount
  511. }
  512. })
  513. },
  514. getWareInfoCountOne(val,storehouse_id){
  515. var count = 0
  516. if(val!=null&&val.length > 0){
  517. for(let i=0;i<val.length;i++){
  518. if(val[i].storehouse_id == storehouse_id){
  519. count +=val[i].stock_count
  520. }
  521. }
  522. }
  523. if(count > 0){
  524. return count
  525. }else{
  526. return ""
  527. }
  528. },
  529. getOutCount(id){
  530. var count = 0
  531. for(let i=0;i<this.outCountList.length;i++){
  532. if(id == this.outCountList[i].good_id){
  533. count = this.outCountList[i].count
  534. }
  535. }
  536. return count
  537. },
  538. getAutoCount(id){
  539. var count= 0
  540. for(let i=0;i<this.autoCountList.length;i++){
  541. if(id == this.autoCountList[i].good_id){
  542. count = this.autoCountList[i].count
  543. }
  544. }
  545. return count
  546. },
  547. getCancelCount(id){
  548. var count = 0
  549. for(let i=0;i<this.cancelCountList.length;i++){
  550. if(id == this.cancelCountList[i].good_id){
  551. count = this.cancelCountList[i].count
  552. }
  553. }
  554. return count
  555. },
  556. getCancelCountInfo(cancel_stock_info,storehouse_id){
  557. var count = 0
  558. if(cancel_stock_info!=null && cancel_stock_info.length >0){
  559. for(let i=0;i<cancel_stock_info.length;i++){
  560. if(cancel_stock_info[i].storehouse_id == storehouse_id){
  561. count += cancel_stock_info[i].count
  562. }
  563. }
  564. }
  565. return count
  566. },
  567. getWareOutInfoCount(warehouse_out_info,storehouse_id){
  568. var count = 0
  569. if(warehouse_out_info!=null && warehouse_out_info.length > 0){
  570. for(let i=0;i<warehouse_out_info.length;i++){
  571. if(storehouse_id == warehouse_out_info[i].storehouse_id){
  572. count +=warehouse_out_info[i].count
  573. }
  574. }
  575. }
  576. return count
  577. },
  578. getInCount(id){
  579. var count= 0
  580. for(let i=0;i<this.countList.length;i++){
  581. if(id == this.countList[i].good_id){
  582. count = this.countList[i].count
  583. }
  584. }
  585. return count
  586. },
  587. getOutCount(id){
  588. var count = 0
  589. for(let i=0;i<this.outCountList.length;i++){
  590. if(id == this.outCountList[i].good_id){
  591. count = this.outCountList[i].count
  592. }
  593. }
  594. return count
  595. },
  596. getAutoCount(id){
  597. var count= 0
  598. for(let i=0;i<this.autoCountList.length;i++){
  599. if(id == this.autoCountList[i].good_id){
  600. count = this.autoCountList[i].count
  601. }
  602. }
  603. return count
  604. },
  605. getCancelCount(id){
  606. var count = 0
  607. for(let i=0;i<this.cancelCountList.length;i++){
  608. if(id == this.cancelCountList[i].good_id){
  609. count = this.cancelCountList[i].count
  610. }
  611. }
  612. return count
  613. },
  614. getStockCount(id){
  615. var stock_count = 0
  616. for(let i=0;i<this.countList.length;i++){
  617. if(id == this.countList[i].good_id){
  618. stock_count = this.countList[i].stock_count
  619. }
  620. }
  621. return stock_count
  622. },
  623. getWareInfo(arr){
  624. var total = 0
  625. if(arr.length > 0){
  626. for(let i=0;i<arr.length;i++){
  627. total += parseInt(arr[i].warehousing_count)
  628. }
  629. }else{
  630. total = ""
  631. }
  632. return total
  633. },
  634. getOverplus(arr){
  635. var total = 0
  636. if(arr.length > 0){
  637. for(let i=0;i<arr.length;i++){
  638. total += arr[i].stock_count
  639. }
  640. }else{
  641. total = ""
  642. }
  643. return total
  644. },
  645. getCancelInfo(arr){
  646. var total = 0
  647. if(arr.length > 0){
  648. for(let i=0;i<arr.length;i++){
  649. total += arr[i].count
  650. }
  651. }else{
  652. total = ""
  653. }
  654. return total
  655. },
  656. getOverFlushInfo(arr){
  657. var total = 0
  658. if(arr!=null&&arr.length >0){
  659. for(let i=0;i<arr.length;i++){
  660. total += arr[i].stock_count
  661. }
  662. }
  663. return total
  664. },
  665. toDialogClick(id,good_name,specification_name,storehouse_id){
  666. this.good_id = id
  667. this.good_name = good_name
  668. this.specification_name = specification_name
  669. this.storehouseId = storehouse_id
  670. var params = {
  671. good_id:id,
  672. limit:this.limitone,
  673. page:this.pageone,
  674. start_first_time:this.start_first_time,
  675. end_first_time:this.end_first_time,
  676. storehouse_id:storehouse_id,
  677. }
  678. getGoodWarehouseOutInfoById(params).then(response=>{
  679. if(response.data.state == 1){
  680. this.dialogVisible = true
  681. var list = response.data.data.list
  682. this.tableData = list
  683. this.totalone = response.data.data.total
  684. // this.flushList = response.data.data.flushList
  685. }
  686. })
  687. },
  688. startFirstTimeChange(){
  689. this.toDialogClick(this.good_id,this.good_name,this.specification_name,this.storehouseId)
  690. },
  691. endEndTimeChange(){
  692. this.toDialogClick(this.good_id,this.good_name,this.specification_name,this.storehouseId)
  693. },
  694. getTime(val) {
  695. if(val < 0){
  696. return ""
  697. }
  698. if(val == ""){
  699. return ""
  700. }else {
  701. return uParseTime(val, '{y}-{m}-{d}')
  702. }
  703. },
  704. getTimeOne(val) {
  705. if(val < 0){
  706. return ""
  707. }
  708. if(val == ""){
  709. return ""
  710. }else {
  711. return uParseTime(val, '{y}-{m}-{d} {h}:{i}')
  712. }
  713. },
  714. getName(id){
  715. var name = ""
  716. for(let i=0;i<this.patientList.length;i++){
  717. if(id == this.patientList[i].id){
  718. name = this.patientList[i].name
  719. }
  720. }
  721. return name
  722. },
  723. getCount(ctime){
  724. var arr = []
  725. var arrOut = []
  726. var total_in = 0
  727. var total_out = 0
  728. for(let i=0;i<this.warehouseInfoByList.length;i++){
  729. if(ctime >= this.warehouseInfoByList[i].ctime){
  730. arr.push(this.warehouseInfoByList[i])
  731. }
  732. }
  733. if(arr.length > 0){
  734. for(let i=0;i<arr.length;i++){
  735. total_in +=arr[i].warehousing_count
  736. }
  737. }
  738. for(let i=0;i<this.warehouseOutByList.length;i++){
  739. if(ctime <=this.warehouseOutByList[i].ctime){
  740. arrOut.push(this.warehouseOutByList[i])
  741. }
  742. }
  743. if(arrOut.length >0){
  744. for(let i=0;i<arrOut.length;i++){
  745. total_out +=arrOut[i].count
  746. }
  747. }
  748. console.log("total23323223",total_in)
  749. return total_in - total_out
  750. },
  751. getStockCountOne(warehouse_out_id,good_id,patient_id,sys_record_time){
  752. var flush_count = 0
  753. if(this.flushList!=null && this.flushList.length > 0){
  754. for(let i=0;i<this.flushList.length;i++){
  755. if(warehouse_out_id == this.flushList[i].warehouse_out_id && good_id == this.flushList[i].good_id && patient_id == this.flushList[i].patient_id && sys_record_time == this.flushList[i].system_time){
  756. flush_count = this.flushList[i].flush_count
  757. }
  758. }
  759. }
  760. return flush_count
  761. },
  762. // 合并单元格样式
  763. cellStyle({ row, column, rowIndex, columnIndex }) {
  764. let arr = [5,6, 7, 8, 9,10,11];
  765. if (arr.indexOf(columnIndex) > -1) {
  766. return "spanClass";
  767. }
  768. },
  769. exportList(){
  770. import('@/vendor/Export2Excel').then(excel => {
  771. if(this.org_id!=0 && this.org_id!=9956){
  772. if(this.tableList!=null && this.tableList.length > 0){
  773. for(let i=0;i<this.tableList.length;i++){
  774. this.tableList[i].index = i+1
  775. this.tableList[i].type_name = this.getGoodTypeName(this.tableList[i].good_type_id)
  776. this.tableList[i].spec = this.tableList[i].specification_name +"/"+ this.tableList[i].packing_unit
  777. this.tableList[i].manufacturer_name = this.getManufacturName(this.tableList[i].manufacturer)
  778. this.tableList[i].dealer_name = this.getDearName(this.tableList[i].dealer)
  779. this.tableList[i].stock_in_count = this.GetExportStockInCount(this.tableList[i].xt_good_stock,this.tableList[i].id)
  780. this.tableList[i].stock_out_count =this.getExportStockOutCount(this.tableList[i].xt_good_stock,this.tableList[i].id)
  781. this.tableList[i].stock_cancel_count = this.getExportCancelStockInfo(this.tableList[i].xt_good_stock,this.tableList[i].id)
  782. this.tableList[i].act_out_count = this.getExportActStockOutCount(this.tableList[i].xt_good_stock,this.tableList[i].id)
  783. this.tableList[i].over_count = this.getExportOverCount(this.tableList[i].xt_good_stock,this.tableList[i].id)
  784. this.tableList[i].sum_count = this.getOverCount(this.tableList[i].xt_warehouse_info)
  785. }
  786. }
  787. const tHeader = ['序号','耗材类型', '耗材名称', '规格&单位','生产厂商','经销商','批准文号','国家编码','入库数量','出库数量','退库数量','实际出库','剩余库存','总库存']
  788. const filterVal = ['index','type_name', 'good_name', 'spec','manufacturer_name','dealer_name','number','social_security_directory_code','stock_in_count','act_out_count','stock_cancel_count','stock_out_count','over_count','sum_count']
  789. const data = this.formatJson(filterVal, this.tableList)
  790. excel.export_json_to_excel({
  791. header: tHeader,
  792. data,
  793. filename: '库存查询'
  794. })
  795. this.downloadLoading = false
  796. }
  797. if(this.org_id == 0 || this.org_id == 9956){
  798. if(this.tableList!=null && this.tableList.length > 0){
  799. for(let i=0;i<this.tableList.length;i++){
  800. this.tableList[i].index = i+1
  801. this.tableList[i].type_name = this.getGoodTypeName(this.tableList[i].good_type_id)
  802. this.tableList[i].spec = this.tableList[i].specification_name +"/"+ this.tableList[i].packing_unit
  803. this.tableList[i].manufacturer_name = this.getManufacturName(this.tableList[i].manufacturer)
  804. this.tableList[i].dealer_name = this.getDearName(this.tableList[i].dealer)
  805. this.tableList[i].stock_in_count = this.GetExportStockInCount(this.tableList[i].xt_good_stock,this.tableList[i].id)
  806. this.tableList[i].stock_out_count =this.getExportStockOutCount(this.tableList[i].xt_good_stock,this.tableList[i].id)
  807. this.tableList[i].stock_cancel_count = this.getExportCancelStockInfo(this.tableList[i].xt_good_stock,this.tableList[i].id)
  808. this.tableList[i].act_out_count = this.getExportActStockOutCount(this.tableList[i].xt_good_stock,this.tableList[i].id)
  809. this.tableList[i].over_count = this.getExportOverCount(this.tableList[i].xt_good_stock,this.tableList[i].id)
  810. this.tableList[i].sum_count = this.getOverCount(this.tableList[i].xt_warehouse_info)
  811. }
  812. }
  813. const tHeader = ['序号','耗材编码','耗材类型', '耗材名称', '规格&单位','生产厂商','经销商','批准文号','国家编码','入库数量','出库数量','退库数量','实际出库','剩余库存','总库存']
  814. const filterVal = ['index','good_number','type_name', 'good_name', 'spec','manufacturer_name','dealer_name','number','social_security_directory_code','stock_in_count','act_out_count','stock_cancel_count','stock_out_count','over_count','sum_count']
  815. const data = this.formatJson(filterVal, this.tableList)
  816. excel.export_json_to_excel({
  817. header: tHeader,
  818. data,
  819. filename: '库存查询'
  820. })
  821. this.downloadLoading = false
  822. }
  823. })
  824. },
  825. formatJson(filterVal, jsonData) {
  826. return jsonData.map(v => filterVal.map(j => v[j]));
  827. },
  828. toPrint(){
  829. this.$router.push("/good/new/query/print?start_time="+this.start_time+"&end_time="+this.end_time+"&keyword="+this.keyword+"&storehouse_id="+this.storehouse_id+"&page="+this.page+"&limit="+this.limit+"&good_type="+this.good_type)
  830. },
  831. getCancelSotckInfo(arr){
  832. var cancle_toal = 0
  833. if(arr.length >0){
  834. for(let z=0;z<arr.length;z++){
  835. cancle_toal += arr[z].count
  836. }
  837. }
  838. return cancle_toal
  839. },
  840. getStockOutFlow(arr,storehouse_id){
  841. var count = 0
  842. if(arr!=null && arr.length > 0){
  843. for(let i=0;i<arr.length;i++){
  844. if(arr[i].storehouse_id == storehouse_id){
  845. count +=arr[i].count
  846. }
  847. }
  848. }
  849. if(count > 0){
  850. return count
  851. }else{
  852. return 0
  853. }
  854. },
  855. GetStockInCount(val){
  856. var count = 0
  857. if(val!=null && val.length >0){
  858. for(let i=0;i<val.length;i++){
  859. count +=val[i].warehousing_count
  860. }
  861. }
  862. if(count > 0){
  863. return count
  864. }else{
  865. return 0
  866. }
  867. },
  868. getStockOutCount(val){
  869. var count = 0
  870. if(val!=null && val.length >0){
  871. for(let i=0;i<val.length;i++){
  872. count +=val[i].count
  873. }
  874. }
  875. if(count > 0){
  876. return count
  877. }else{
  878. return 0
  879. }
  880. },
  881. getCancelStockInfo(val){
  882. var count = 0
  883. if(val!=null && val.length >0){
  884. for(let i=0;i<val.length;i++){
  885. count +=val[i].count
  886. }
  887. }
  888. if(count > 0){
  889. return count
  890. }else{
  891. return 0
  892. }
  893. },
  894. getOverCount(val){
  895. var count = 0
  896. if(val!=null && val.length >0){
  897. for(let i=0;i<val.length;i++){
  898. count +=val[i].stock_count
  899. }
  900. }
  901. if(count > 0){
  902. return count
  903. }else{
  904. return 0
  905. }
  906. },
  907. // 修改后接口
  908. getGoodIn(val,storehouse_id){
  909. var sum_count = 0
  910. if(val!=null && val!=undefined){
  911. for(let i=0;i<val.length;i++){
  912. if(storehouse_id == val[i].storehouse_id){
  913. sum_count = val[i].stock_in_count
  914. }
  915. }
  916. }
  917. if(sum_count > 0){
  918. return sum_count
  919. }else{
  920. return 0
  921. }
  922. },
  923. getGoodOut(val,storehouse_id){
  924. var sum_count = 0
  925. if(val!=null && val!=undefined){
  926. for(let i=0;i<val.length;i++){
  927. if(storehouse_id == val[i].storehouse_id){
  928. sum_count = val[i].stock_out_count
  929. }
  930. }
  931. }
  932. if(sum_count > 0){
  933. return sum_count
  934. }else{
  935. return 0
  936. }
  937. },
  938. getGoodCancel(val,storehouse_id){
  939. var sum_count = 0
  940. if(val!=null && val!=undefined){
  941. for(let i=0;i<val.length;i++){
  942. if(storehouse_id == val[i].storehouse_id){
  943. sum_count = val[i].stock_cancel_count
  944. }
  945. }
  946. }
  947. if(sum_count > 0){
  948. return sum_count
  949. }else{
  950. return 0
  951. }
  952. },
  953. getGoodAct(val,storehouse_id){
  954. var sum_count = 0
  955. if(val!=null && val!=undefined){
  956. for(let i=0;i<val.length;i++){
  957. if(storehouse_id == val[i].storehouse_id){
  958. sum_count = val[i].stock_act_out_count
  959. }
  960. }
  961. }
  962. if(sum_count > 0){
  963. return sum_count
  964. }else{
  965. return 0
  966. }
  967. },
  968. getGoodFlush(val,storehouse_id){
  969. var sum_count = 0
  970. if(val!=null && val!=undefined){
  971. for(let i=0;i<val.length;i++){
  972. if(storehouse_id == val[i].storehouse_id){
  973. sum_count = val[i].flush_count
  974. }
  975. }
  976. }
  977. if(sum_count > 0){
  978. return sum_count
  979. }else{
  980. return 0
  981. }
  982. },
  983. getSumCount(val,good_id){
  984. var sum_count = 0
  985. var arr = []
  986. if(val!=null && val!=undefined){
  987. for(let i=0;i<val.length;i++){
  988. if(good_id == val[i].good_id){
  989. arr.push(val[i])
  990. }
  991. }
  992. }
  993. for(let i=0;i<arr.length;i++){
  994. sum_count +=arr[i].flush_count
  995. }
  996. if(sum_count > 0){
  997. return sum_count
  998. }else{
  999. return 0
  1000. }
  1001. },
  1002. toClickTwo(){
  1003. toSendGoodInfomation().then(response=>{
  1004. if(response.data.state == 1){
  1005. var msg = response.data.data.msg
  1006. console.log("脚本保存成功!")
  1007. }
  1008. })
  1009. },
  1010. //导出
  1011. GetExportStockInCount(val,id){
  1012. var sum_count = 0
  1013. var arr = []
  1014. if(val!=null && val.length > 0){
  1015. for(let i=0;i<val.length;i++){
  1016. if(val[i].good_id == id){
  1017. arr.push(val[i])
  1018. }
  1019. }
  1020. }
  1021. for(let i=0;i<arr.length;i++){
  1022. sum_count +=arr[i].stock_in_count
  1023. }
  1024. if(sum_count > 0){
  1025. return sum_count
  1026. }else{
  1027. return 0
  1028. }
  1029. },
  1030. getExportStockOutCount(val,id){
  1031. var sum_count = 0
  1032. var arr = []
  1033. if(val!=null && val.length > 0){
  1034. for(let i=0;i<val.length;i++){
  1035. if(val[i].good_id == id){
  1036. arr.push(val[i])
  1037. }
  1038. }
  1039. }
  1040. for(let i=0;i<arr.length;i++){
  1041. sum_count +=arr[i].stock_out_count
  1042. }
  1043. if(sum_count > 0){
  1044. return sum_count
  1045. }else{
  1046. return 0
  1047. }
  1048. },
  1049. getExportCancelStockInfo(val,id){
  1050. var sum_count = 0
  1051. var arr = []
  1052. if(val!=null && val.length > 0){
  1053. for(let i=0;i<val.length;i++){
  1054. if(val[i].good_id == id){
  1055. arr.push(val[i])
  1056. }
  1057. }
  1058. }
  1059. for(let i=0;i<arr.length;i++){
  1060. sum_count +=arr[i].stock_cancel_count
  1061. }
  1062. if(sum_count > 0){
  1063. return sum_count
  1064. }else{
  1065. return 0
  1066. }
  1067. },
  1068. getExportActStockOutCount(val,id){
  1069. var sum_count = 0
  1070. var arr = []
  1071. if(val!=null && val.length > 0){
  1072. for(let i=0;i<val.length;i++){
  1073. if(val[i].good_id == id){
  1074. arr.push(val[i])
  1075. }
  1076. }
  1077. }
  1078. for(let i=0;i<arr.length;i++){
  1079. sum_count +=arr[i].stock_act_out_count
  1080. }
  1081. if(sum_count > 0){
  1082. return sum_count
  1083. }else{
  1084. return 0
  1085. }
  1086. },
  1087. getExportOverCount(val,id){
  1088. var sum_count = 0
  1089. var arr = []
  1090. if(val!=null && val.length > 0){
  1091. for(let i=0;i<val.length;i++){
  1092. if(val[i].good_id == id){
  1093. arr.push(val[i])
  1094. }
  1095. }
  1096. }
  1097. for(let i=0;i<arr.length;i++){
  1098. sum_count +=arr[i].flush_count
  1099. }
  1100. if(sum_count > 0){
  1101. return sum_count
  1102. }else{
  1103. return 0
  1104. }
  1105. }
  1106. },
  1107. created(){
  1108. this.houseList = []
  1109. this.getStorehouseList()
  1110. this.getlist()
  1111. // var org_id = this.$store.getters.xt_user.org_id
  1112. // if(org_id == 9583 || org_id == 3907){
  1113. // this.getStockDrugCount()
  1114. // }
  1115. }
  1116. }
  1117. </script>
  1118. <style>
  1119. .app-container{
  1120. /* padding-left: 0;
  1121. margin-left: 0; */
  1122. }
  1123. .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
  1124. font-size: 12px;
  1125. }
  1126. .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
  1127. background: #6fb5fa;
  1128. }
  1129. .count {
  1130. color: #bd2c00;
  1131. }
  1132. .el-table td,
  1133. .el-table th.is-leaf,
  1134. .el-table--border,
  1135. .el-table--group {
  1136. border-color: #d0d3da;
  1137. }
  1138. .el-table--border::after,
  1139. .el-table--group::after,
  1140. .el-table::before {
  1141. background-color: #d0d3da;
  1142. }
  1143. /* 合并表格线样式 */
  1144. .spanClass .cell {
  1145. padding: 0 !important;
  1146. }
  1147. .spanClass .cell tr {
  1148. display: inline-block;
  1149. width: 100%;
  1150. }
  1151. .spanClass .cell tr td {
  1152. padding: 10px 0;
  1153. border-bottom: 1px solid #ebeef5;
  1154. display: block;
  1155. width: 100%;
  1156. }
  1157. .spanClass .cell tr:last-of-type td {
  1158. border-bottom: none;
  1159. }
  1160. </style>