goodNewQuery.vue 46KB

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