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

stockQuery.vue 38KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs="crumbs"></bread-crumb>
  5. </div>
  6. <div class="app-container">
  7. <div
  8. style="
  9. justify-content: space-between;
  10. margin: 0px 0 12px 0;
  11. display: flex;
  12. align-items: center;
  13. "
  14. >
  15. <div>
  16. <span>仓库名称:</span>
  17. <el-select v-model="storehouse_id" style="width:200px;margin-right:10px;" placeholder="请选择"
  18. filterable
  19. @change="changeStorehouseName">
  20. <el-option
  21. v-for="item in houseList"
  22. :key="item.id"
  23. :label="item.storehouse_name"
  24. :value="item.id">
  25. </el-option>
  26. </el-select>
  27. <span>耗材名称:</span>
  28. <el-select v-model="good_id" style="width:250px;margin-right:10px;" placeholder="请选择"
  29. filterable
  30. @change="changeGoodName">
  31. <el-option
  32. v-for="item in goodList"
  33. :key="item.id"
  34. :label="item.good_name"
  35. :value="item.id">
  36. </el-option>
  37. </el-select>
  38. <!-- <el-select v-model="type_name" style="width:140px;margin-right:10px;" placeholder="请选择"
  39. @change="changeTypeName">
  40. <el-select
  41. v-model="type_name"
  42. style="width: 140px; margin-right: 10px"
  43. placeholder="请选择"
  44. @change="changeTypeName"
  45. >
  46. <el-option
  47. v-for="item in types"
  48. :key="item.id"
  49. :label="item.type_name"
  50. :value="item.id"
  51. >
  52. </el-option>
  53. </el-select> -->
  54. <!-- <el-date-picker
  55. size="small"
  56. v-model="start_time"
  57. prefix-icon="el-icon-date"
  58. :editable="false"
  59. style="width: 196px"
  60. type="date"
  61. placeholder="选择日期时间"
  62. align="right"
  63. format="yyyy-MM-dd"
  64. value-format="yyyy-MM-dd"
  65. @change="startTimeChange"
  66. ></el-date-picker
  67. >-
  68. <el-date-picker
  69. size="small"
  70. v-model="end_time"
  71. prefix-icon="el-icon-date"
  72. :editable="false"
  73. style="width: 196px"
  74. type="date"
  75. placeholder="选择日期时间"
  76. align="right"
  77. format="yyyy-MM-dd"
  78. value-format="yyyy-MM-dd"
  79. @change="endTimeChange"
  80. ></el-date-picker>
  81. <el-input
  82. ></el-date-picker>-
  83. <el-date-picker
  84. size="small"
  85. v-model="end_time"
  86. prefix-icon="el-icon-date"
  87. :editable="false"
  88. style="width: 196px;"
  89. type="date"
  90. placeholder="选择日期时间"
  91. align="right"
  92. format="yyyy-MM-dd"
  93. value-format="yyyy-MM-dd"
  94. @change="endTimeChange"
  95. ></el-date-picker> -->
  96. <!-- <el-input
  97. size="small"
  98. style="width: 200px; margin-left: 10px"
  99. class="filter-item"
  100. v-model.trim="keywords"
  101. placeholder="耗材名称"
  102. /> -->
  103. <!-- <el-button
  104. size="small"
  105. class="filter-item"
  106. type="primary"
  107. icon="el-icon-search"
  108. @click="search"
  109. >搜索</el-button
  110. > -->
  111. </div>
  112. <div>
  113. <el-button size="small" type="primary" @click="exportList"
  114. >导出</el-button
  115. >
  116. <el-button size="small" type="primary" @click="toPrint"
  117. >打印</el-button
  118. >
  119. </div>
  120. </div>
  121. <el-table
  122. <el-table
  123. :cell-class-name="cellStyle"
  124. :row-style="{ color: '#303133' }"
  125. :header-cell-style="{
  126. backgroundColor: 'rgb(245, 247, 250)',
  127. color: '#606266',
  128. }"
  129. :data="tableList"
  130. :class="signAndWeighBoxPatients"
  131. border
  132. v-loading="WarehouseInfo.loading"
  133. :span-method="objectOneMethod"
  134. >
  135. <el-table-column label="耗材类型" align="center">
  136. <template slot-scope="scope">
  137. <span>{{ getGoodType(scope.row.good_type_id) }}</span>
  138. </template>
  139. </el-table-column>
  140. <el-table-column label="耗材名称" align="center">
  141. <template slot-scope="scope">
  142. {{ scope.row.good_name }}
  143. </template>
  144. </el-table-column>
  145. <el-table-column label="规格&单位" align="center">
  146. <template slot-scope="scope">
  147. <span
  148. >{{ scope.row.specification_name }} /
  149. {{ scope.row.packing_unit }}</span
  150. >
  151. </template>
  152. </el-table-column>
  153. <el-table-column label="国家编码" align="center">
  154. <template slot-scope="scope">
  155. <span>{{ scope.row.social_security_directory_code }}</span>
  156. </template>
  157. </el-table-column>
  158. <el-table-column label="进货单价" align="center">
  159. <template slot-scope="scope">
  160. {{ scope.row.buy_price }}
  161. </template>
  162. </el-table-column>
  163. <el-table-column label="生产商" align="center">
  164. <template slot-scope="scope">
  165. <!-- <tr style="background: none">
  166. <td style="border-right: none; border-inline-end: none">
  167. {{ getManufacture(scope.row.manufacturer) }}
  168. </td>
  169. </tr> -->
  170. <span>
  171. {{ getManufacture(scope.row.manufacturer) }}
  172. </span>
  173. </template>
  174. </el-table-column>
  175. <el-table-column label="仓库名称" align="center" width="150">
  176. <template slot-scope="scope">
  177. <tr style="background: none" v-for="(item,index) in scope.row.warehouse_info" :key="index">
  178. <td style="border-right: none; border-inline-end: none;text-align: center" >
  179. {{getHouseName(item.storehouse_id)}}
  180. </td>
  181. </tr>
  182. </template>
  183. </el-table-column>
  184. <el-table-column label="入库数量" align="center">
  185. <template slot-scope="scope">
  186. <tr style="background: none" v-for="(item,index) in scope.row.warehouse_info" :key="index">
  187. <td style="border-right: none; border-inline-end: none;text-align: center">
  188. {{getWareInfoCount(scope.row.xt_warehouse_info,item.storehouse_id)}}
  189. </td>
  190. </tr>
  191. </template>
  192. </el-table-column>
  193. <el-table-column label="出库数量" align="center">
  194. <template slot-scope="scope">
  195. <span>
  196. <tr style="background: none" v-for="(item,index) in scope.row.warehouse_info" :key="index">
  197. <td style="border-right: none; border-inline-end: none;text-align: center">
  198. {{getWareInfoCount(scope.row.xt_warehouse_info,item.storehouse_id) - getWareInfoCountOne(scope.row.xt_warehouse_info,item.storehouse_id)}}
  199. </td>
  200. </tr>
  201. </span>
  202. </template>
  203. </el-table-column>
  204. <el-table-column label="剩余库存量" align="center">
  205. <template slot-scope="scope">
  206. <tr style="background: none" v-for="(item,index) in scope.row.warehouse_info" :key="index">
  207. <td style="border-right: none; border-inline-end: none;text-align: center">
  208. {{getWareInfoCountOne(scope.row.xt_warehouse_info,item.storehouse_id)}}
  209. </td>
  210. </tr>
  211. </template>
  212. </el-table-column>
  213. <el-table-column label="总库存量" align="center">
  214. <template slot-scope="scope">
  215. {{getOverFlushInfo(scope.row.xt_warehouse_info)}}
  216. </template>
  217. </el-table-column>
  218. <el-table-column label="总库存量" align="center" v-if="showTwo">
  219. <template slot-scope="scope">
  220. <span>{{getWareInfoCountTwo(scope.row.xt_warehouse_info)}} </span>
  221. </template>
  222. </el-table-column>
  223. <el-table-column label="入库数量" align="center">
  224. <template slot-scope="scope">
  225. <span
  226. v-if="getWareInfo(scope.row.xt_warehouse_info) > 0"
  227. >
  228. {{ getWareInfo(scope.row.xt_warehouse_info)
  229. }}{{ scope.row.packing_unit }}
  230. </span>
  231. <!-- <span v-if="getWareInfo(scope.row.xt_warehouse_info)>0">{{getWareInfo(scope.row.xt_warehouse_info)}}{{scope.row.packing_unit}}</span> -->
  232. </template>
  233. </el-table-column>
  234. <el-table-column label="出库数量" align="center" v-if="showOne">
  235. <template slot-scope="scope">
  236. <span
  237. v-if="
  238. org_id == 9671 ||
  239. org_id == 10138 ||
  240. org_id == 10028 ||
  241. org_id == 9675 ||
  242. org_id == 4 ||
  243. org_id == 3877 ||
  244. org_id == 10243 ||
  245. org_id == 10088 ||
  246. org_id == 10245 ||
  247. org_id == 9779 ||
  248. org_id == 10106 ||
  249. org_id == 9504 ||
  250. org_id == 10215 ||
  251. org_id == 10188 ||
  252. org_id == 10191 ||
  253. org_id == 9919 ||
  254. org_id == 10265 ||
  255. org_id == 10164 ||
  256. org_id == 10290
  257. "
  258. >
  259. <span>
  260. {{
  261. getWareInfo(scope.row.xt_warehouse_info) -
  262. getOverFlushInfo(scope.row.xt_warehouse_info)
  263. }}
  264. </span>
  265. </span>
  266. <span v-else
  267. >{{ getAutoCount(scope.row.id) + getOutCount(scope.row.id) }}
  268. </span>
  269. </template>
  270. </el-table-column>
  271. <el-table-column label="剩余库存量" align="center" v-if="showThree">
  272. <template slot-scope="scope">
  273. <span
  274. v-if="
  275. org_id == 9671 ||
  276. org_id == 10138 ||
  277. org_id == 10028 ||
  278. org_id == 9675 ||
  279. org_id == 4 ||
  280. org_id == 3877 ||
  281. org_id == 10243 ||
  282. org_id == 10088 ||
  283. org_id == 10245 ||
  284. org_id == 9779 ||
  285. org_id == 10106 ||
  286. org_id == 9504 ||
  287. org_id == 10215 ||
  288. org_id == 10188 ||
  289. org_id == 10191 ||
  290. org_id == 9919 ||
  291. org_id == 10265 ||
  292. org_id == 10164 ||
  293. org_id == 10290
  294. "
  295. >
  296. {{ getOverFlushInfo(scope.row.xt_warehouse_info) }}
  297. </span>
  298. <span v-else>
  299. {{
  300. getWareInfo(scope.row.xt_warehouse_info) -
  301. getAutoCount(scope.row.id) -
  302. getOutCount(scope.row.id) +
  303. getCancelCount(scope.row.id)
  304. }}
  305. </span>
  306. <!-- <span
  307. v-if="
  308. org_id == 9671 ||
  309. org_id == 10138 ||
  310. org_id == 10028 ||
  311. org_id == 9675 ||
  312. org_id == 4 ||
  313. org_id == 3877 ||
  314. org_id == 10243 ||
  315. org_id == 10088 ||
  316. org_id == 10245 ||
  317. org_id == 9779 ||
  318. org_id == 10106 ||
  319. org_id == 9504 ||
  320. org_id == 10215 ||
  321. org_id == 10188 ||
  322. org_id == 10191 ||
  323. org_id == 9919 ||
  324. org_id == 10265 ||
  325. org_id == 10164 ||
  326. org_id == 10290
  327. "
  328. >
  329. {{ getOverFlushInfo(scope.row.xt_warehouse_info) }}
  330. </span>
  331. <span v-else>{{
  332. getWareInfo(scope.row.xt_warehouse_info) -
  333. getAutoCount(scope.row.id) -
  334. getOutCount(scope.row.id) +
  335. getCancelCount(scope.row.id)
  336. }}</span> -->
  337. </template>
  338. </el-table-column>
  339. <el-table-column label="剩余库存量" align="center" v-if="showFour">
  340. <template slot-scope="scope">
  341. <span>{{
  342. getWareInfo(scope.row.xt_warehouse_info) -
  343. getAutoCount(scope.row.id) -
  344. getOutCount(scope.row.id) +
  345. getCancelCount(scope.row.id)
  346. }}</span>
  347. </template>
  348. </el-table-column>
  349. <el-table-column label="出库数量" align="center" v-if="showTwo">
  350. <template slot-scope="scope">
  351. <span
  352. >{{ getAutoCount(scope.row.id) + getOutCount(scope.row.id) }}
  353. </span>
  354. </template>
  355. </el-table-column>
  356. <el-table-column label="操作" align="center" width="200px">
  357. <el-table-column label="操作" align="center" width="260px">
  358. <template slot-scope="scope">
  359. <el-button size="small" type="primary" @click="toClick(scope.row)"
  360. >库存流水
  361. </el-button>
  362. <el-button
  363. size="small"
  364. type="primary"
  365. @click="toClickOne(scope.row)"
  366. >批次
  367. </el-button>
  368. </template>
  369. </el-table-column>
  370. </el-table>
  371. <el-pagination
  372. @size-change="handleSizeChange"
  373. @current-change="handleCurrentChange"
  374. :page-sizes="[10, 50, 100, 200, 500, 1000]"
  375. :page-size="10"
  376. background
  377. align="right"
  378. style="margin-top: 20px"
  379. layout="total, sizes, prev, pager, next, jumper"
  380. :total="total"
  381. >
  382. </el-pagination>
  383. </div>
  384. </div>
  385. </template>
  386. <script>
  387. import BreadCrumb from "@/xt_pages/components/bread-crumb";
  388. import {
  389. GetAllGoodType,
  390. getAllStockList,
  391. getStockDrugCount,
  392. } from "@/api/stock";
  393. export default {
  394. name: "stockIn",
  395. created() {
  396. this.org_id = this.$store.getters.xt_user.org_id;
  397. var start_time = window.sessionStorage.getItem("start_time");
  398. var end_time = window.sessionStorage.getItem("end_time");
  399. if (start_time != null) {
  400. this.start_time = start_time;
  401. }
  402. if (end_time != null) {
  403. this.end_time = end_time;
  404. }
  405. window.sessionStorage.removeItem("start_time");
  406. window.sessionStorage.removeItem("end_time");
  407. this.GetAllGoodType();
  408. this.getlist();
  409. this.getStockDrugCount();
  410. },
  411. components: {
  412. BreadCrumb,
  413. },
  414. data() {
  415. return {
  416. crumbs: [
  417. { path: false, name: "库存管理" },
  418. { path: "/stock/query", name: "库存查询" },
  419. ],
  420. keywords: "",
  421. total: 0,
  422. multipleSelection: [],
  423. signAndWeighBoxPatients: "sign-and-weigh-box-patients",
  424. start_time: "",
  425. end_time: "",
  426. page: 1,
  427. limit: 10,
  428. goodType: [],
  429. goodInfo: [],
  430. WarehouseInfo: {
  431. loading: false,
  432. warehouseInfoDate: [],
  433. },
  434. options: [],
  435. value: "",
  436. type_name: 0,
  437. types: [],
  438. tableList: [],
  439. manufacturerList: [],
  440. countList: [],
  441. outCountList: [],
  442. autoCountList: [],
  443. cancelCountList: [],
  444. org_id: 0,
  445. showOne: true,
  446. showTwo: false,
  447. showThree: true,
  448. showFour: false,
  449. options:[],
  450. value:"",
  451. type_name:0,
  452. types:[],
  453. tableList:[],
  454. manufacturerList:[],
  455. countList:[],
  456. outCountList:[],
  457. autoCountList:[],
  458. cancelCountList:[],
  459. org_id:0,
  460. showOne:true,
  461. showTwo:false,
  462. showThree:true,
  463. showFour:false,
  464. houseList:[],
  465. storehouse_id:0,
  466. goodList:[],
  467. good_id:0,
  468. tempArr:[],
  469. storehouseList:[],
  470. };
  471. },
  472. methods: {
  473. GetAllGoodType: function () {
  474. GetAllGoodType().then((response) => {
  475. if (response.data.state == 0) {
  476. this.$message.error(response.data.msg);
  477. return false;
  478. } else {
  479. var obj = {
  480. id: 0,
  481. type_name: "全部",
  482. };
  483. this.types.push(obj);
  484. var obj = {
  485. id:0,
  486. type_name:'全部'
  487. }
  488. var objOne = {
  489. id:0,
  490. storehouse_name:"全部",
  491. }
  492. var objTwo = {
  493. id:0,
  494. good_name:"全部",
  495. }
  496. this.types.push(obj)
  497. this.houseList.push(objOne)
  498. this.goodList.push(objTwo)
  499. for (let i = 0; i < response.data.data.goodType.length; i++) {
  500. this.goodType.push(response.data.data.goodType[i]);
  501. this.types.push(response.data.data.goodType[i]);
  502. }
  503. for(let i=0;i<response.data.data.houseList.length;i++){
  504. this.houseList.push(response.data.data.houseList[i])
  505. }
  506. for(let i=0;i<response.data.data.goodInfo.length;i++){
  507. for(let j=0;j<response.data.data.manufacturerList.length;j++){
  508. if(response.data.data.goodInfo[i].manufacturer == response.data.data.manufacturerList[j].id){
  509. response.data.data.goodInfo[i].manufacturer = response.data.data.manufacturerList[j].manufacturer_name
  510. }
  511. }
  512. response.data.data.goodInfo[i].good_name = response.data.data.goodInfo[i].good_name + " " + response.data.data.goodInfo[i].specification_name + " " + response.data.data.goodInfo[i].manufacturer
  513. this.goodList.push(response.data.data.goodInfo[i])
  514. }
  515. this.storehouseList = response.data.data.storehouseList
  516. }
  517. });
  518. },
  519. GetAllGoodInfo: function () {
  520. GetAllGoodInfo().then((response) => {
  521. if (response.data.state == 0) {
  522. this.$message.error(response.data.msg);
  523. return false;
  524. } else {
  525. for (let i = 0; i < response.data.data.goodInfo.length; i++) {
  526. this.goodInfo.push(response.data.data.goodInfo[i]);
  527. }
  528. }
  529. });
  530. },
  531. handleBack: function () {
  532. this.$router.go(-1);
  533. },
  534. handleSizeChange(val) {
  535. this.limit = val;
  536. this.getlist();
  537. this.getStockDrugCount();
  538. },
  539. handleCurrentChange(val) {
  540. this.page = val;
  541. this.getlist();
  542. this.getStockDrugCount();
  543. },
  544. calculate: function (val) {
  545. return Math.round(parseFloat(val) * 100) / 100;
  546. },
  547. startTimeChange: function (val) {
  548. window.sessionStorage.removeItem("start_time");
  549. var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
  550. if (time > 0) {
  551. this.$message.error("开始时间不能大于结束时间");
  552. this.start_time = "";
  553. } else {
  554. this.start_time = val;
  555. this.getlist();
  556. this.getStockDrugCount();
  557. }
  558. },
  559. endTimeChange: function (val) {
  560. window.sessionStorage.removeItem("end_time");
  561. var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
  562. if (time < 0) {
  563. this.$message.error("结束时间不能小于开始时间");
  564. this.end_time = "";
  565. } else {
  566. this.end_time = val;
  567. this.getlist();
  568. this.getStockDrugCount();
  569. }
  570. },
  571. stockInCount: function (row) {
  572. let total = 0;
  573. for (let i = 0; i < row.query_warehousing_info.length; i++) {
  574. total = total + row.query_warehousing_info[i].warehousing_count;
  575. }
  576. return total;
  577. },
  578. salesReturnCount: function (row) {
  579. let total = 0;
  580. for (let i = 0; i < row.query_sales_return_info.length; i++) {
  581. total = total + row.query_sales_return_info[i].count;
  582. }
  583. return total;
  584. },
  585. stockOutCount: function (row) {
  586. let total = 0;
  587. for (let i = 0; i < row.query_warehouseout_info.length; i++) {
  588. total = total + row.query_warehouseout_info[i].count;
  589. }
  590. return total;
  591. },
  592. cancelStockCount: function (row) {
  593. let total = 0;
  594. for (let i = 0; i < row.query_cancel_stock_info.length; i++) {
  595. total = total + row.query_cancel_stock_info[i].count;
  596. }
  597. return total;
  598. },
  599. search: function () {
  600. this.getlist();
  601. this.getStockDrugCount();
  602. },
  603. // 合并单元格样式
  604. cellStyle({ row, column, rowIndex, columnIndex }) {
  605. let arr = [6, 7, 8, 9];
  606. if (arr.indexOf(columnIndex) > -1) {
  607. return "spanClass";
  608. }
  609. },
  610. // 合并单元格样式
  611. cellStyle({ row, column, rowIndex, columnIndex }) {
  612. let arr = [6, 7, 8, 9];
  613. if (arr.indexOf(columnIndex) > -1) {
  614. return "spanClass";
  615. }
  616. },
  617. exportList() {
  618. import("@/vendor/Export2Excel").then((excel) => {
  619. const tHeader = [
  620. "耗材类型",
  621. "耗材名称",
  622. "规格&单位",
  623. "国家编码",
  624. "进货单价",
  625. "生产商",
  626. "入库数量",
  627. "出库数量",
  628. "库存剩余量",
  629. ];
  630. const filterVal = [
  631. "type_name",
  632. "good_name",
  633. "unit",
  634. "social_security_directory_code",
  635. "buy_price",
  636. "prodect_name",
  637. "inCount",
  638. "outCount",
  639. "overplus",
  640. ];
  641. for (let i = 0; i < this.tableList.length; i++) {
  642. this.tableList[i].type_name = this.getGoodType(
  643. this.tableList[i].good_type_id
  644. );
  645. this.tableList[i].unit =
  646. this.tableList[i].specification_name +
  647. "/" +
  648. this.tableList[i].packing_unit;
  649. this.tableList[i].prodect_name = this.getManufacture(
  650. this.tableList[i].manufacturer
  651. );
  652. this.tableList[i].inCount = this.getWareInfo(
  653. this.tableList[i].xt_warehouse_info
  654. );
  655. if (this.end_time == "") {
  656. if (
  657. this.org_id == 9671 ||
  658. this.org_id == 10138 ||
  659. this.org_id == 10028 ||
  660. this.org_id == 9675 ||
  661. this.org_id == 4 ||
  662. this.org_id == 3877 ||
  663. this.org_id == 10243 ||
  664. this.org_id == 10088 ||
  665. this.org_id == 10245 ||
  666. this.org_id == 9779 ||
  667. this.org_id == 10106 ||
  668. this.org_id == 9504 ||
  669. this.org_id == 10215 ||
  670. this.org_id == 10088 ||
  671. this.org_id == 10191 ||
  672. this.org_id == 9919 ||
  673. this.org_id == 10265 ||
  674. this.org_id == 10164 ||
  675. this.org_id == 10290
  676. ) {
  677. this.tableList[i].outCount =
  678. this.getWareInfo(this.tableList[i].xt_warehouse_info) -
  679. this.getOverFlushInfo(this.tableList[i].xt_warehouse_info) +
  680. this.getCancelSotckInfo(this.tableList[i].cancel_stock_info);
  681. } else {
  682. this.tableList[i].outCount =
  683. this.getAutoCount(this.tableList[i].id) +
  684. this.getOutCount(this.tableList[i].id);
  685. }
  686. if (
  687. this.org_id == 9671 ||
  688. this.org_id == 10138 ||
  689. this.org_id == 10028 ||
  690. this.org_id == 9675 ||
  691. this.org_id == 4 ||
  692. this.org_id == 3877 ||
  693. this.org_id == 10243 ||
  694. this.org_id == 10088 ||
  695. this.org_id == 10245 ||
  696. this.org_id == 9779 ||
  697. this.org_id == 10106 ||
  698. this.org_id == 9504 ||
  699. this.org_id == 10215 ||
  700. this.org_id == 10088 ||
  701. this.org_id == 10191 ||
  702. this.org_id == 9919 ||
  703. this.org_id == 10265 ||
  704. this.org_id == 10164 ||
  705. this.org_id == 10290
  706. ) {
  707. this.tableList[i].overplus = this.getOverFlushInfo(
  708. this.tableList[i].xt_warehouse_info
  709. );
  710. } else {
  711. this.tableList[i].overplus =
  712. this.getWareInfo(this.tableList[i].xt_warehouse_info) -
  713. this.getAutoCount(this.tableList[i].id) -
  714. this.getOutCount(this.tableList[i].id) +
  715. this.getCancelCount(this.tableList[i].id);
  716. }
  717. } else {
  718. this.tableList[i].outCount =
  719. this.getAutoCount(this.tableList[i].id) +
  720. this.getOutCount(this.tableList[i].id);
  721. this.tableList[i].overplus =
  722. this.getWareInfo(this.tableList[i].xt_warehouse_info) -
  723. this.getAutoCount(this.tableList[i].id) -
  724. this.getOutCount(this.tableList[i].id) +
  725. this.getCancelCount(this.tableList[i].id);
  726. }
  727. }
  728. const data = this.formatJson(filterVal, this.tableList);
  729. excel.export_json_to_excel({
  730. header: tHeader,
  731. data,
  732. filename: "库存查询",
  733. });
  734. this.downloadLoading = false;
  735. });
  736. },
  737. formatJson(filterVal, jsonData) {
  738. return jsonData.map((v) => filterVal.map((j) => v[j]));
  739. },
  740. changeTypeName() {
  741. this.getlist();
  742. },
  743. toPrint() {
  744. window.sessionStorage.setItem("start_time", this.start_time);
  745. window.sessionStorage.setItem("end_time", this.end_time);
  746. this.$router.push(
  747. "/stock/stockprint?start_time=" +
  748. this.start_time +
  749. "&end_time=" +
  750. this.end_time +
  751. "&keyword=" +
  752. this.keywords +
  753. "&type_name=" +
  754. this.type_name +
  755. "&page=" +
  756. this.page +
  757. "&limit=" +
  758. this.limit
  759. );
  760. },
  761. getUnit(id) {
  762. var name = "";
  763. for (let i = 0; i < this.$store.getters.good_unit.length; i++) {
  764. if (id == this.$store.getters.good_unit[i].id) {
  765. name = this.$store.getters.good_unit[i].name;
  766. }
  767. }
  768. return name;
  769. },
  770. getTimestamp(time) {
  771. // 把时间日期转成时间戳
  772. return new Date(time).getTime() / 1000;
  773. },
  774. getGoodType(id) {
  775. var name = "";
  776. for (let i = 0; i < this.goodType.length; i++) {
  777. if (id == this.goodType[i].id) {
  778. name = this.goodType[i].type_name;
  779. }
  780. }
  781. return name;
  782. },
  783. getlist() {
  784. const params = {
  785. page: this.page,
  786. limit: this.limit,
  787. keywords: this.keywords,
  788. start_time: this.start_time,
  789. end_time: this.end_time,
  790. type: this.type_name,
  791. start_time:this.start_time,
  792. end_time:this.end_time,
  793. type:this.type_name,
  794. good_id:this.good_id,
  795. storehouse_id:this.storehouse_id,
  796. };
  797. console.log("params232322323", params);
  798. getAllStockList(params).then((response) => {
  799. if (response.data.state == 1) {
  800. if (this.end_time == "") {
  801. this.showTwo = false;
  802. this.showFour = false;
  803. this.showThree = true;
  804. this.showOne = true;
  805. }
  806. if (this.end_time != "") {
  807. this.showThree = false;
  808. this.showOne = false;
  809. this.showTwo = true;
  810. console.log("hh3223322323", this.showTwo);
  811. this.showFour = true;
  812. }
  813. var list = response.data.data.list;
  814. this.tableList = list;
  815. var total = response.data.data.total;
  816. this.total = total;
  817. var manufacturerList = response.data.data.manufacturerList;
  818. this.manufacturerList = manufacturerList;
  819. }
  820. });
  821. getAllStockList(params).then(response=>{
  822. if(response.data.state == 1){
  823. var list = response.data.data.list
  824. this.tableList = list
  825. var total = response.data.data.total
  826. this.total = total
  827. var manufacturerList = response.data.data.manufacturerList
  828. this.manufacturerList = manufacturerList
  829. }
  830. })
  831. },
  832. getManufacture(id) {
  833. var name = "";
  834. for (let i = 0; i < this.manufacturerList.length; i++) {
  835. if (id == this.manufacturerList[i].id) {
  836. name = this.manufacturerList[i].manufacturer_name;
  837. }
  838. }
  839. return name;
  840. },
  841. toClick(val) {
  842. var manufacturer_name = "";
  843. var specification_name = "";
  844. for (let i = 0; i < this.manufacturerList.length; i++) {
  845. if (val.manufacturer == this.manufacturerList[i].id) {
  846. manufacturer_name = this.manufacturerList[i].manufacturer_name;
  847. }
  848. }
  849. specification_name = val.specification_name + "/" + val.packing_unit;
  850. var overCount = this.getOverplus(val.xt_warehouse_info);
  851. window.sessionStorage.setItem("start_time", this.start_time);
  852. window.sessionStorage.setItem("end_time", this.end_time);
  853. this.$router.push({
  854. path:
  855. "/stock/in/stockflow?id=" +
  856. val.id +
  857. "&good_name=" +
  858. val.good_name +
  859. "&manufacturer=" +
  860. manufacturer_name +
  861. "&specification_name=" +
  862. specification_name +
  863. "&packing_unit=" +
  864. val.packing_unit +
  865. "&overCount=" +
  866. overCount,
  867. });
  868. },
  869. toClickOne(val) {
  870. var manufacturer_name = "";
  871. var specification_name = "";
  872. for (let i = 0; i < this.manufacturerList.length; i++) {
  873. if (val.manufacturer == this.manufacturerList[i].id) {
  874. manufacturer_name = this.manufacturerList[i].manufacturer_name;
  875. }
  876. }
  877. specification_name = val.specification_name + "/" + val.packing_unit;
  878. var overCount = this.getOverplus(val.xt_warehouse_info);
  879. window.sessionStorage.setItem("start_time", this.start_time);
  880. window.sessionStorage.setItem("end_time", this.end_time);
  881. this.$router.push({
  882. path:
  883. "/stock/in/stockbatchnumber?id=" +
  884. val.id +
  885. "&good_name=" +
  886. val.good_name +
  887. "&manufacturer=" +
  888. manufacturer_name +
  889. "&specification_name=" +
  890. specification_name +
  891. "&packing_unit=" +
  892. val.packing_unit +
  893. "&overCount=" +
  894. overCount,
  895. });
  896. },
  897. getStockDrugCount() {
  898. var params = {
  899. keywords: this.keywords,
  900. start_time: this.start_time,
  901. end_time: this.end_time,
  902. };
  903. console.log("参数23233223", params);
  904. getStockDrugCount(params).then((response) => {
  905. if (response.data.state == 1) {
  906. var outlist = response.data.data.outList;
  907. console.log("outlist22323232233", outlist);
  908. this.outCountList = outlist;
  909. var autoCount = response.data.data.autoCount;
  910. this.autoCountList = autoCount;
  911. var totalCount = response.data.data.totalCount;
  912. this.cancelCountList = totalCount;
  913. }
  914. });
  915. getStockDrugCount(){
  916. var params ={
  917. keywords: this.keywords,
  918. start_time:this.start_time,
  919. end_time:this.end_time,
  920. }
  921. getStockDrugCount(params).then(response=>{
  922. if(response.data.state == 1){
  923. var outlist = response.data.data.outList
  924. this.outCountList = outlist
  925. var autoCount = response.data.data.autoCount
  926. this.autoCountList = autoCount
  927. var totalCount = response.data.data.totalCount
  928. this.cancelCountList = totalCount
  929. }
  930. })
  931. },
  932. getInCount(id) {
  933. var count = 0;
  934. for (let i = 0; i < this.countList.length; i++) {
  935. if (id == this.countList[i].good_id) {
  936. count = this.countList[i].count;
  937. }
  938. }
  939. return count;
  940. },
  941. getOutCount(id) {
  942. var count = 0;
  943. for (let i = 0; i < this.outCountList.length; i++) {
  944. if (id == this.outCountList[i].good_id) {
  945. count = this.outCountList[i].count;
  946. }
  947. }
  948. return count;
  949. },
  950. getAutoCount(id) {
  951. var count = 0;
  952. for (let i = 0; i < this.autoCountList.length; i++) {
  953. if (id == this.autoCountList[i].good_id) {
  954. count = this.autoCountList[i].count;
  955. }
  956. }
  957. return count;
  958. },
  959. getCancelCount(id) {
  960. var count = 0;
  961. for (let i = 0; i < this.cancelCountList.length; i++) {
  962. if (id == this.cancelCountList[i].good_id) {
  963. count = this.cancelCountList[i].count;
  964. }
  965. }
  966. return count;
  967. },
  968. getStockCount(id) {
  969. var stock_count = 0;
  970. for (let i = 0; i < this.countList.length; i++) {
  971. if (id == this.countList[i].good_id) {
  972. stock_count = this.countList[i].stock_count;
  973. }
  974. }
  975. return stock_count;
  976. },
  977. getWareInfo(arr) {
  978. var total = 0;
  979. if (arr.length > 0) {
  980. for (let i = 0; i < arr.length; i++) {
  981. total += parseInt(arr[i].warehousing_count);
  982. }
  983. } else {
  984. total = "";
  985. }
  986. return total;
  987. },
  988. getOverplus(arr) {
  989. var total = 0;
  990. if (arr.length > 0) {
  991. for (let i = 0; i < arr.length; i++) {
  992. total += arr[i].stock_count;
  993. }
  994. } else {
  995. total = "";
  996. }
  997. return total;
  998. },
  999. getCancelInfo(arr) {
  1000. var total = 0;
  1001. if (arr.length > 0) {
  1002. for (let i = 0; i < arr.length; i++) {
  1003. total += arr[i].count;
  1004. }
  1005. } else {
  1006. total = "";
  1007. }
  1008. return total;
  1009. },
  1010. getOverFlushInfo(arr) {
  1011. var total = 0;
  1012. if (arr.length > 0) {
  1013. for (let i = 0; i < arr.length; i++) {
  1014. total += arr[i].stock_count;
  1015. }
  1016. }
  1017. return total;
  1018. },
  1019. getCancelSotckInfo(arr) {
  1020. var cancle_toal = 0;
  1021. if (arr.length > 0) {
  1022. for (let z = 0; z < arr.length; z++) {
  1023. cancle_toal += arr[z].count;
  1024. }
  1025. }
  1026. return cancle_toal;
  1027. },
  1028. },
  1029. return count
  1030. },
  1031. getAutoCount(id){
  1032. var count= 0
  1033. for(let i=0;i<this.autoCountList.length;i++){
  1034. if(id == this.autoCountList[i].good_id){
  1035. count = this.autoCountList[i].count
  1036. }
  1037. }
  1038. return count
  1039. },
  1040. getCancelCount(id){
  1041. var count = 0
  1042. for(let i=0;i<this.cancelCountList.length;i++){
  1043. if(id == this.cancelCountList[i].good_id){
  1044. count = this.cancelCountList[i].count
  1045. }
  1046. }
  1047. return count
  1048. },
  1049. getStockCount(id){
  1050. var stock_count = 0
  1051. for(let i=0;i<this.countList.length;i++){
  1052. if(id == this.countList[i].good_id){
  1053. stock_count = this.countList[i].stock_count
  1054. }
  1055. }
  1056. return stock_count
  1057. },
  1058. getWareInfo(arr){
  1059. var total = 0
  1060. if(arr.length > 0){
  1061. for(let i=0;i<arr.length;i++){
  1062. total += parseInt(arr[i].warehousing_count)
  1063. }
  1064. }else{
  1065. total = ""
  1066. }
  1067. return total
  1068. },
  1069. getOverplus(arr){
  1070. var total = 0
  1071. if(arr.length > 0){
  1072. for(let i=0;i<arr.length;i++){
  1073. total += arr[i].stock_count
  1074. }
  1075. }else{
  1076. total = ""
  1077. }
  1078. return total
  1079. },
  1080. getCancelInfo(arr){
  1081. var total = 0
  1082. if(arr.length > 0){
  1083. for(let i=0;i<arr.length;i++){
  1084. total += arr[i].count
  1085. }
  1086. }else{
  1087. total = ""
  1088. }
  1089. return total
  1090. },
  1091. getOverFlushInfo(arr){
  1092. var total = 0
  1093. if(arr.length >0){
  1094. for(let i=0;i<arr.length;i++){
  1095. total += arr[i].stock_count
  1096. }
  1097. }
  1098. return total
  1099. },
  1100. getCancelSotckInfo(arr){
  1101. var cancle_toal = 0
  1102. if(arr.length >0){
  1103. for(let z=0;z<arr.length;z++){
  1104. cancle_toal += arr[z].count
  1105. }
  1106. }
  1107. return cancle_toal
  1108. },
  1109. getHouseName(id){
  1110. var storehouse_name = ""
  1111. for(let i=0;i<this.storehouseList.length;i++){
  1112. if(id == this.storehouseList[i].id){
  1113. storehouse_name = this.storehouseList[i].storehouse_name
  1114. }
  1115. }
  1116. return storehouse_name
  1117. },
  1118. objectOneMethod({ row, column, rowIndex, columnIndex }) {
  1119. console.log("column",column)
  1120. console.log("rowindex",rowIndex)
  1121. console.log("columnninex",columnIndex)
  1122. // if(columnIndex === 1){
  1123. // if(rowIndex === 1){
  1124. // return {
  1125. // rowspan: 1,
  1126. // colspan: 3
  1127. // };
  1128. // }
  1129. // }
  1130. },
  1131. getWareInfoCount(val,storehouse_id){
  1132. var count = 0
  1133. if(val.length > 0){
  1134. for(let i=0;i<val.length;i++){
  1135. if(val[i].storehouse_id == storehouse_id){
  1136. count +=val[i].warehousing_count
  1137. }
  1138. }
  1139. }
  1140. if(count > 0){
  1141. return count
  1142. }else{
  1143. return ""
  1144. }
  1145. },
  1146. getWareInfoCountOne(val,storehouse_id){
  1147. var count = 0
  1148. if(val.length > 0){
  1149. for(let i=0;i<val.length;i++){
  1150. if(val[i].storehouse_id == storehouse_id){
  1151. count +=val[i].stock_count
  1152. }
  1153. }
  1154. }
  1155. if(count > 0){
  1156. return count
  1157. }else{
  1158. return ""
  1159. }
  1160. },
  1161. getWareInfoCountTwo(val,storehouse_id){
  1162. var count = 0
  1163. if(val.length > 0){
  1164. for(let i=0;i<val.length;i++){
  1165. count +=val[i].stock_count
  1166. }
  1167. }
  1168. if(count > 0){
  1169. return count
  1170. }else{
  1171. return ""
  1172. }
  1173. },
  1174. changeStorehouseName(){
  1175. this.getlist()
  1176. },
  1177. changeGoodName(){
  1178. this.getlist()
  1179. },
  1180. arraySpanMethod({ row, column, rowIndex, columnIndex }) {
  1181. console.log("当前行",row)
  1182. console.log("当前列",column)
  1183. console.log("当前行号",rowIndex)
  1184. console.log("当前列号",columnIndex)
  1185. if(rowIndex == 1 && columnIndex === 4){
  1186. return {
  1187. rowspan: 2,
  1188. colspan: 1
  1189. };
  1190. }
  1191. },
  1192. }
  1193. };
  1194. </script>
  1195. <style rel="stylesheet/css" lang="scss" scoped>
  1196. .information {
  1197. border: 1px #dcdfe6 solid;
  1198. padding: 30px 20px 30px 20px;
  1199. .border {
  1200. border-bottom: 1px #dcdfe6 solid;
  1201. margin: 0px 0 20px 0;
  1202. }
  1203. }
  1204. .title {
  1205. background: #409eff;
  1206. height: 44px;
  1207. line-height: 44px;
  1208. padding: 0 0 0 10px;
  1209. color: #fff;
  1210. margin: 0 0 10px 0;
  1211. }
  1212. .edit_separater {
  1213. border-top: 1px solid rgb(233, 233, 233);
  1214. margin-top: 15px;
  1215. margin-bottom: 15px;
  1216. }
  1217. </style>
  1218. <style>
  1219. .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
  1220. font-size: 12px;
  1221. }
  1222. .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
  1223. background: #6fb5fa;
  1224. }
  1225. .count {
  1226. color: #bd2c00;
  1227. }
  1228. .el-table td,
  1229. .el-table th.is-leaf,
  1230. .el-table--border,
  1231. .el-table--group {
  1232. border-color: #d0d3da;
  1233. }
  1234. .el-table--border::after,
  1235. .el-table--group::after,
  1236. .el-table::before {
  1237. background-color: #d0d3da;
  1238. }
  1239. /* 合并表格线样式 */
  1240. .spanClass .cell {
  1241. padding: 0 !important;
  1242. }
  1243. .spanClass .cell tr {
  1244. display: inline-block;
  1245. width: 100%;
  1246. }
  1247. .spanClass .cell tr td {
  1248. padding: 10px 0;
  1249. border-bottom: 1px solid #ebeef5;
  1250. display: block;
  1251. width: 100%;
  1252. }
  1253. .spanClass .cell tr:last-of-type td {
  1254. border-bottom: none;
  1255. }
  1256. /* 合并表格线样式 */
  1257. .spanClass .cell {
  1258. padding: 0 !important;
  1259. }
  1260. .spanClass .cell tr {
  1261. display: inline-block;
  1262. width: 100%;
  1263. }
  1264. .spanClass .cell tr td {
  1265. padding: 10px 0;
  1266. border-bottom: 1px solid #ebeef5;
  1267. display: block;
  1268. width: 100%;
  1269. }
  1270. .spanClass .cell tr:last-of-type td{
  1271. border-bottom: none;
  1272. }
  1273. </style>