goodNewQuery.vue 47KB

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