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

stockQuery.vue 27KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869
  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 style="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
  8. <div>
  9. <span>仓库名称:</span>
  10. <el-select v-model="storehouse_id" style="width:200px;margin-right:10px;" placeholder="请选择"
  11. filterable
  12. @change="changeStorehouseName">
  13. <el-option
  14. v-for="item in houseList"
  15. :key="item.id"
  16. :label="item.storehouse_name"
  17. :value="item.id">
  18. </el-option>
  19. </el-select>
  20. <span>耗材名称:</span>
  21. <el-select v-model="good_id" style="width:250px;margin-right:10px;" placeholder="请选择"
  22. filterable
  23. @change="changeGoodName">
  24. <el-option
  25. v-for="item in goodList"
  26. :key="item.id"
  27. :label="item.good_name"
  28. :value="item.id">
  29. </el-option>
  30. </el-select>
  31. <!-- <el-select v-model="type_name" style="width:140px;margin-right:10px;" placeholder="请选择"
  32. @change="changeTypeName">
  33. <el-option
  34. v-for="item in types"
  35. :key="item.id"
  36. :label="item.type_name"
  37. :value="item.id">
  38. </el-option>
  39. </el-select> -->
  40. <!-- <el-date-picker
  41. size="small"
  42. v-model="start_time"
  43. prefix-icon="el-icon-date"
  44. :editable="false"
  45. style="width: 196px;"
  46. type="date"
  47. placeholder="选择日期时间"
  48. align="right"
  49. format="yyyy-MM-dd"
  50. value-format="yyyy-MM-dd"
  51. @change="startTimeChange"
  52. ></el-date-picker>-
  53. <el-date-picker
  54. size="small"
  55. v-model="end_time"
  56. prefix-icon="el-icon-date"
  57. :editable="false"
  58. style="width: 196px;"
  59. type="date"
  60. placeholder="选择日期时间"
  61. align="right"
  62. format="yyyy-MM-dd"
  63. value-format="yyyy-MM-dd"
  64. @change="endTimeChange"
  65. ></el-date-picker> -->
  66. <!-- <el-input
  67. size="small"
  68. style="width: 200px;margin-left:10px;"
  69. class="filter-item"
  70. v-model.trim="keywords"
  71. placeholder="耗材名称"
  72. /> -->
  73. <!-- <el-button
  74. size="small"
  75. class="filter-item"
  76. type="primary"
  77. icon="el-icon-search"
  78. @click="search"
  79. >搜索</el-button
  80. > -->
  81. </div>
  82. <div>
  83. <el-button size="small" type="primary" @click="exportList">导出</el-button>
  84. <el-button size="small" type="primary" @click="toPrint">打印</el-button>
  85. </div>
  86. </div>
  87. <el-table
  88. :cell-class-name="cellStyle"
  89. :row-style="{ color: '#303133' }"
  90. :header-cell-style="{
  91. backgroundColor: 'rgb(245, 247, 250)',
  92. color: '#606266'
  93. }"
  94. :data="tableList"
  95. :class="signAndWeighBoxPatients"
  96. border
  97. v-loading="WarehouseInfo.loading"
  98. >
  99. <el-table-column label="耗材类型" align="center">
  100. <template slot-scope="scope">
  101. <span>{{getGoodType(scope.row.good_type_id)}}</span>
  102. </template>
  103. </el-table-column>
  104. <el-table-column label="耗材名称" align="center">
  105. <template slot-scope="scope">
  106. {{ scope.row.good_name }}
  107. </template>
  108. </el-table-column>
  109. <el-table-column label="规格&单位" align="center">
  110. <template slot-scope="scope">
  111. <span>{{ scope.row.specification_name }} / {{scope.row.packing_unit}}</span>
  112. </template>
  113. </el-table-column>
  114. <el-table-column label="国家编码" align="center">
  115. <template slot-scope="scope">
  116. <span>{{ scope.row.social_security_directory_code}}</span>
  117. </template>
  118. </el-table-column>
  119. <el-table-column label="进货单价" align="center">
  120. <template slot-scope="scope">
  121. {{scope.row.buy_price}}
  122. </template>
  123. </el-table-column>
  124. <el-table-column label="生产商" align="center">
  125. <template slot-scope="scope">
  126. {{getManufacture(scope.row.manufacturer)}}
  127. </template>
  128. </el-table-column>
  129. <el-table-column label="仓库名称" align="center" width="150">
  130. <template slot-scope="scope">
  131. <tr style="background: none" v-for="(item,index) in scope.row.warehouse_info" :key="index">
  132. <td style="border-right: none; border-inline-end: none;text-align: center" >
  133. {{getHouseName(item.storehouse_id)}}
  134. </td>
  135. </tr>
  136. </template>
  137. </el-table-column>
  138. <el-table-column label="入库数量" align="center">
  139. <template slot-scope="scope">
  140. <tr style="background: none" v-for="(item,index) in scope.row.warehouse_info" :key="index">
  141. <td style="border-right: none; border-inline-end: none;text-align: center">
  142. {{getWareInfoCount(scope.row.xt_warehouse_info,item.storehouse_id)}}&nbsp;
  143. </td>
  144. </tr>
  145. </template>
  146. </el-table-column>
  147. <el-table-column label="出库数量" align="center">
  148. <template slot-scope="scope">
  149. <span v-if="org_id == 9675 || org_id == 3907 || org_id == 9583">{{ getAutoCount(scope.row.id) + getOutCount(scope.row.id) }}</span>
  150. <span v-if="org_id!=9675 && org_id!=3907 && org_id!=9583">
  151. <tr style="background: none" v-for="(item,index) in scope.row.warehouse_info" :key="index">
  152. <td style="border-right: none; border-inline-end: none;text-align: center">
  153. {{getWareInfoCount(scope.row.xt_warehouse_info,item.storehouse_id) - getWareInfoCountOne(scope.row.xt_warehouse_info,item.storehouse_id)}}&nbsp;
  154. </td>
  155. </tr>
  156. </span>
  157. </template>
  158. </el-table-column>
  159. <el-table-column label="剩余库存量" align="center">
  160. <template slot-scope="scope">
  161. <span v-if="org_id == 9675 || org_id == 3907 || org_id == 9583">
  162. {{
  163. getWareInfo(scope.row.xt_warehouse_info) -
  164. getAutoCount(scope.row.id) -
  165. getOutCount(scope.row.id) +
  166. getCancelCount(scope.row.id)
  167. }}
  168. </span>
  169. <span v-if="org_id!=9675 && org_id!=3907 && org_id!=9583">
  170. <tr style="background: none" v-for="(item,index) in scope.row.warehouse_info" :key="index">
  171. <td style="border-right: none; border-inline-end: none;text-align: center">
  172. {{getWareInfoCountOne(scope.row.xt_warehouse_info,item.storehouse_id)}}&nbsp;&nbsp;
  173. </td>
  174. </tr>
  175. </span>
  176. </template>
  177. </el-table-column>
  178. <el-table-column label="总库存量" align="center">
  179. <template slot-scope="scope">
  180. <span v-if="org_id == 9675 || org_id == 3907 || org_id == 9583">
  181. {{
  182. getWareInfo(scope.row.xt_warehouse_info) -
  183. getAutoCount(scope.row.id) -
  184. getOutCount(scope.row.id) +
  185. getCancelCount(scope.row.id)
  186. }}
  187. </span>
  188. <span v-if="org_id != 9675 && org_id != 3907 && org_id != 9583">
  189. {{getOverFlushInfo(scope.row.xt_warehouse_info)}}
  190. </span>
  191. </template>
  192. </el-table-column>
  193. <el-table-column label="总库存量" align="center" v-if="showTwo">
  194. <template slot-scope="scope">
  195. <span>{{getWareInfoCountTwo(scope.row.xt_warehouse_info)}} </span>
  196. </template>
  197. </el-table-column>
  198. <el-table-column label="操作" align="center" width="200px">
  199. <template slot-scope="scope">
  200. <el-button
  201. size="small"
  202. type="primary"
  203. @click="toClick(scope.row)"
  204. >库存流水
  205. </el-button>
  206. <el-button
  207. size="small"
  208. type="primary"
  209. @click="toClickOne(scope.row)"
  210. >批次
  211. </el-button>
  212. </template>
  213. </el-table-column>
  214. </el-table>
  215. <el-pagination
  216. @size-change="handleSizeChange"
  217. @current-change="handleCurrentChange"
  218. :page-sizes="[10, 50, 100,200,500,1000]"
  219. :page-size="10"
  220. background
  221. align="right"
  222. style="margin-top:20px;"
  223. layout="total, sizes, prev, pager, next, jumper"
  224. :total="total"
  225. >
  226. </el-pagination>
  227. </div>
  228. </div>
  229. </template>
  230. <script>
  231. import BreadCrumb from "@/xt_pages/components/bread-crumb";
  232. import {
  233. GetAllGoodType,
  234. getAllStockList,
  235. getStockDrugCount
  236. } from "@/api/stock";
  237. export default {
  238. name: "stockIn",
  239. created() {
  240. this.org_id = this.$store.getters.xt_user.org_id
  241. var start_time = window.sessionStorage.getItem('start_time')
  242. var end_time = window.sessionStorage.getItem('end_time')
  243. if(start_time !=null){
  244. this.start_time = start_time
  245. }
  246. if(end_time!=null){
  247. this.end_time = end_time
  248. }
  249. window.sessionStorage.removeItem('start_time')
  250. window.sessionStorage.removeItem('end_time')
  251. this.GetAllGoodType();
  252. this.getlist()
  253. this.getStockDrugCount()
  254. },
  255. components: {
  256. BreadCrumb
  257. },
  258. data() {
  259. return {
  260. crumbs: [
  261. { path: false, name: "库存管理" },
  262. { path: "/stock/query", name: "库存查询" }
  263. ],
  264. keywords: "",
  265. total: 0,
  266. multipleSelection: [],
  267. signAndWeighBoxPatients: "sign-and-weigh-box-patients",
  268. start_time: "",
  269. end_time: "",
  270. page: 1,
  271. limit: 10,
  272. goodType: [],
  273. goodInfo: [],
  274. WarehouseInfo: {
  275. loading: false,
  276. warehouseInfoDate: []
  277. },
  278. options:[],
  279. value:"",
  280. type_name:0,
  281. types:[],
  282. tableList:[],
  283. manufacturerList:[],
  284. countList:[],
  285. outCountList:[],
  286. autoCountList:[],
  287. cancelCountList:[],
  288. org_id:0,
  289. showOne:true,
  290. showTwo:false,
  291. showThree:true,
  292. showFour:false,
  293. houseList:[],
  294. storehouse_id:0,
  295. goodList:[],
  296. good_id:0,
  297. tempArr:[],
  298. storehouseList:[],
  299. };
  300. },
  301. methods: {
  302. GetAllGoodType: function() {
  303. GetAllGoodType().then(response => {
  304. if (response.data.state == 0) {
  305. this.$message.error(response.data.msg);
  306. return false;
  307. } else {
  308. var obj = {
  309. id:0,
  310. type_name:'全部'
  311. }
  312. var objOne = {
  313. id:0,
  314. storehouse_name:"全部",
  315. }
  316. var objTwo = {
  317. id:0,
  318. good_name:"全部",
  319. }
  320. this.types.push(obj)
  321. this.houseList.push(objOne)
  322. this.goodList.push(objTwo)
  323. for (let i = 0; i < response.data.data.goodType.length; i++) {
  324. this.goodType.push(response.data.data.goodType[i]);
  325. this.types.push(response.data.data.goodType[i])
  326. }
  327. for(let i=0;i<response.data.data.houseList.length;i++){
  328. this.houseList.push(response.data.data.houseList[i])
  329. }
  330. for(let i=0;i<response.data.data.goodInfo.length;i++){
  331. for(let j=0;j<response.data.data.manufacturerList.length;j++){
  332. if(response.data.data.goodInfo[i].manufacturer == response.data.data.manufacturerList[j].id){
  333. response.data.data.goodInfo[i].manufacturer = response.data.data.manufacturerList[j].manufacturer_name
  334. }
  335. }
  336. 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
  337. this.goodList.push(response.data.data.goodInfo[i])
  338. }
  339. this.storehouseList = response.data.data.storehouseList
  340. }
  341. });
  342. },
  343. GetAllGoodInfo: function() {
  344. GetAllGoodInfo().then(response => {
  345. if (response.data.state == 0) {
  346. this.$message.error(response.data.msg);
  347. return false;
  348. } else {
  349. for (let i = 0; i < response.data.data.goodInfo.length; i++) {
  350. this.goodInfo.push(response.data.data.goodInfo[i]);
  351. }
  352. }
  353. });
  354. },
  355. handleBack: function() {
  356. this.$router.go(-1);
  357. },
  358. handleSizeChange(val) {
  359. this.limit = val;
  360. this.getlist()
  361. this.getStockDrugCount()
  362. },
  363. handleCurrentChange(val) {
  364. this.page = val;
  365. this.getlist()
  366. this.getStockDrugCount()
  367. },
  368. calculate: function(val) {
  369. return Math.round(parseFloat(val) * 100) / 100;
  370. },
  371. startTimeChange: function(val) {
  372. window.sessionStorage.removeItem('start_time')
  373. var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
  374. if (time > 0) {
  375. this.$message.error("开始时间不能大于结束时间");
  376. this.start_time = "";
  377. } else {
  378. this.start_time = val
  379. this.getlist()
  380. this.getStockDrugCount()
  381. }
  382. },
  383. endTimeChange: function(val) {
  384. window.sessionStorage.removeItem('end_time')
  385. var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
  386. if (time < 0) {
  387. this.$message.error("结束时间不能小于开始时间");
  388. this.end_time = "";
  389. } else {
  390. this.end_time = val
  391. this.getlist()
  392. this.getStockDrugCount()
  393. }
  394. },
  395. stockInCount: function(row) {
  396. let total = 0;
  397. for (let i = 0; i < row.query_warehousing_info.length; i++) {
  398. total = total + row.query_warehousing_info[i].warehousing_count;
  399. }
  400. return total;
  401. },
  402. salesReturnCount: function(row) {
  403. let total = 0;
  404. for (let i = 0; i < row.query_sales_return_info.length; i++) {
  405. total = total + row.query_sales_return_info[i].count;
  406. }
  407. return total;
  408. },
  409. stockOutCount: function(row) {
  410. let total = 0;
  411. for (let i = 0; i < row.query_warehouseout_info.length; i++) {
  412. total = total + row.query_warehouseout_info[i].count;
  413. }
  414. return total;
  415. },
  416. cancelStockCount: function(row) {
  417. let total = 0;
  418. for (let i = 0; i < row.query_cancel_stock_info.length; i++) {
  419. total = total + row.query_cancel_stock_info[i].count;
  420. }
  421. return total;
  422. },
  423. search: function() {
  424. this.getlist()
  425. this.getStockDrugCount()
  426. },
  427. // 合并单元格样式
  428. cellStyle({ row, column, rowIndex, columnIndex }) {
  429. let arr = [6, 7, 8, 9];
  430. if (arr.indexOf(columnIndex) > -1) {
  431. return "spanClass";
  432. }
  433. },
  434. exportList(){
  435. import('@/vendor/Export2Excel').then(excel => {
  436. const tHeader = ['耗材类型', '耗材名称', '规格&单位','国家编码','进货单价','生产商','入库数量','出库数量','库存剩余量']
  437. const filterVal = ['type_name', 'good_name', 'unit','social_security_directory_code','buy_price','prodect_name','inCount','outCount','overplus']
  438. for(let i=0;i<this.tableList.length;i++){
  439. this.tableList[i].type_name = this.getGoodType(this.tableList[i].good_type_id)
  440. this.tableList[i].unit = this.tableList[i].specification_name + "/" + this.tableList[i].packing_unit
  441. this.tableList[i].prodect_name = this.getManufacture(this.tableList[i].manufacturer)
  442. this.tableList[i].inCount = this.getWareInfo(this.tableList[i].xt_warehouse_info)
  443. if(this.end_time == ""){
  444. if(this.org_id == 9671 || this.org_id == 10138 || this.org_id == 10028 || this.org_id == 9675 || this.org_id == 4 || this.org_id ==3877 || this.org_id == 10243 || this.org_id == 10088 || this.org_id == 10245 || this.org_id == 9779 || this.org_id == 10106 || this.org_id == 9504 || this.org_id == 10215 || this.org_id == 10088 || this.org_id == 10191 || this.org_id == 9919 || this.org_id == 10265 || this.org_id ==10164 || this.org_id == 10290){
  445. this.tableList[i].outCount = this.getWareInfo(this.tableList[i].xt_warehouse_info) - this.getOverFlushInfo(this.tableList[i].xt_warehouse_info) + this.getCancelSotckInfo(this.tableList[i].cancel_stock_info)
  446. }else{
  447. this.tableList[i].outCount = this.getAutoCount(this.tableList[i].id) + this.getOutCount(this.tableList[i].id)
  448. }
  449. if(this.org_id == 9671 || this.org_id == 10138 || this.org_id == 10028 || this.org_id == 9675 || this.org_id == 4 || this.org_id ==3877 || this.org_id == 10243 || this.org_id == 10088 || this.org_id == 10245 || this.org_id == 9779 || this.org_id == 10106 || this.org_id == 9504 || this.org_id == 10215 || this.org_id == 10088 || this.org_id == 10191 || this.org_id == 9919 || this.org_id == 10265 || this.org_id == 10164 || this.org_id == 10290){
  450. this.tableList[i].overplus = this.getOverFlushInfo(this.tableList[i].xt_warehouse_info)
  451. }else{
  452. this.tableList[i].overplus = this.getWareInfo(this.tableList[i].xt_warehouse_info) - this.getAutoCount(this.tableList[i].id) - this.getOutCount(this.tableList[i].id) + this.getCancelCount(this.tableList[i].id)
  453. }
  454. }else{
  455. this.tableList[i].outCount = this.getAutoCount(this.tableList[i].id) + this.getOutCount(this.tableList[i].id)
  456. this.tableList[i].overplus = this.getWareInfo(this.tableList[i].xt_warehouse_info) - this.getAutoCount(this.tableList[i].id) - this.getOutCount(this.tableList[i].id) + this.getCancelCount(this.tableList[i].id)
  457. }
  458. }
  459. const data = this.formatJson(filterVal, this.tableList)
  460. excel.export_json_to_excel({
  461. header: tHeader,
  462. data,
  463. filename: '库存查询'
  464. })
  465. this.downloadLoading = false
  466. })
  467. },
  468. formatJson(filterVal, jsonData) {
  469. return jsonData.map(v => filterVal.map(j => v[j]));
  470. },
  471. changeTypeName(){
  472. this.getlist()
  473. },
  474. toPrint(){
  475. window.sessionStorage.setItem('start_time',this.start_time)
  476. window.sessionStorage.setItem('end_time',this.end_time)
  477. this.$router.push("/stock/stockprint?start_time="+this.start_time+"&end_time="+this.end_time+"&keyword="+this.keywords+"&type_name="+this.type_name+"&page="+this.page+"&limit="+this.limit)
  478. },
  479. getUnit(id){
  480. var name = ""
  481. for(let i=0;i<this.$store.getters.good_unit.length;i++){
  482. if(id == this.$store.getters.good_unit[i].id){
  483. name = this.$store.getters.good_unit[i].name
  484. }
  485. }
  486. return name
  487. },
  488. getTimestamp(time) {
  489. // 把时间日期转成时间戳
  490. return new Date(time).getTime() / 1000;
  491. },
  492. getGoodType(id){
  493. var name = ""
  494. for(let i=0;i<this.goodType.length;i++){
  495. if(id == this.goodType[i].id){
  496. name = this.goodType[i].type_name
  497. }
  498. }
  499. return name
  500. },
  501. getlist(){
  502. const params = {
  503. page: this.page,
  504. limit: this.limit,
  505. keywords: this.keywords,
  506. start_time:this.start_time,
  507. end_time:this.end_time,
  508. type:this.type_name,
  509. good_id:this.good_id,
  510. storehouse_id:this.storehouse_id,
  511. };
  512. getAllStockList(params).then(response=>{
  513. if(response.data.state == 1){
  514. var list = response.data.data.list
  515. var arr = []
  516. for(let i=0;i<list.length;i++){
  517. if(list[i].warehouse_info.length > 0 ){
  518. arr.push(list[i])
  519. }
  520. }
  521. this.tableList = arr
  522. var total = response.data.data.total
  523. this.total = total
  524. var manufacturerList = response.data.data.manufacturerList
  525. this.manufacturerList = manufacturerList
  526. }
  527. })
  528. },
  529. getManufacture(id){
  530. var name = ""
  531. for(let i=0;i<this.manufacturerList.length;i++){
  532. if(id == this.manufacturerList[i].id){
  533. name = this.manufacturerList[i].manufacturer_name
  534. }
  535. }
  536. return name
  537. },
  538. toClick(val){
  539. var manufacturer_name = ""
  540. var specification_name = ""
  541. for(let i=0;i<this.manufacturerList.length;i++){
  542. if(val.manufacturer == this.manufacturerList[i].id){
  543. manufacturer_name = this.manufacturerList[i].manufacturer_name
  544. }
  545. }
  546. specification_name = val.specification_name + "/" + val.packing_unit
  547. var overCount = this.getOverplus(val.xt_warehouse_info)
  548. window.sessionStorage.setItem('start_time',this.start_time)
  549. window.sessionStorage.setItem('end_time',this.end_time)
  550. console.log("val3234243423324324234",val.id)
  551. this.$router.push({path:"/stock/in/stockflow?id="+val.id+"&manufacturer="+manufacturer_name+"&packing_unit="+val.packing_unit+"&overCount="+overCount})
  552. },
  553. toClickOne(val){
  554. var manufacturer_name = ""
  555. var specification_name = ""
  556. for(let i=0;i<this.manufacturerList.length;i++){
  557. if(val.manufacturer == this.manufacturerList[i].id){
  558. manufacturer_name = this.manufacturerList[i].manufacturer_name
  559. }
  560. }
  561. specification_name = val.specification_name + "/" + val.packing_unit
  562. var overCount = this.getOverplus(val.xt_warehouse_info)
  563. window.sessionStorage.setItem('start_time',this.start_time)
  564. window.sessionStorage.setItem('end_time',this.end_time)
  565. this.$router.push({path:"/stock/in/stockbatchnumber?id="+val.id+"&manufacturer="+manufacturer_name+"&packing_unit="+val.packing_unit+"&overCount="+overCount})
  566. },
  567. getStockDrugCount(){
  568. var params ={
  569. keywords: this.keywords,
  570. start_time:this.start_time,
  571. end_time:this.end_time,
  572. }
  573. getStockDrugCount(params).then(response=>{
  574. if(response.data.state == 1){
  575. var outlist = response.data.data.outList
  576. this.outCountList = outlist
  577. var autoCount = response.data.data.autoCount
  578. this.autoCountList = autoCount
  579. var totalCount = response.data.data.totalCount
  580. this.cancelCountList = totalCount
  581. }
  582. })
  583. },
  584. getInCount(id){
  585. var count= 0
  586. for(let i=0;i<this.countList.length;i++){
  587. if(id == this.countList[i].good_id){
  588. count = this.countList[i].count
  589. }
  590. }
  591. return count
  592. },
  593. getOutCount(id){
  594. var count = 0
  595. for(let i=0;i<this.outCountList.length;i++){
  596. if(id == this.outCountList[i].good_id){
  597. count = this.outCountList[i].count
  598. }
  599. }
  600. return count
  601. },
  602. getAutoCount(id){
  603. var count= 0
  604. for(let i=0;i<this.autoCountList.length;i++){
  605. if(id == this.autoCountList[i].good_id){
  606. count = this.autoCountList[i].count
  607. }
  608. }
  609. return count
  610. },
  611. getCancelCount(id){
  612. var count = 0
  613. for(let i=0;i<this.cancelCountList.length;i++){
  614. if(id == this.cancelCountList[i].good_id){
  615. count = this.cancelCountList[i].count
  616. }
  617. }
  618. return count
  619. },
  620. getStockCount(id){
  621. var stock_count = 0
  622. for(let i=0;i<this.countList.length;i++){
  623. if(id == this.countList[i].good_id){
  624. stock_count = this.countList[i].stock_count
  625. }
  626. }
  627. return stock_count
  628. },
  629. getWareInfo(arr){
  630. var total = 0
  631. if(arr.length > 0){
  632. for(let i=0;i<arr.length;i++){
  633. total += parseInt(arr[i].warehousing_count)
  634. }
  635. }else{
  636. total = ""
  637. }
  638. return total
  639. },
  640. getOverplus(arr){
  641. var total = 0
  642. if(arr.length > 0){
  643. for(let i=0;i<arr.length;i++){
  644. total += arr[i].stock_count
  645. }
  646. }else{
  647. total = ""
  648. }
  649. return total
  650. },
  651. getCancelInfo(arr){
  652. var total = 0
  653. if(arr.length > 0){
  654. for(let i=0;i<arr.length;i++){
  655. total += arr[i].count
  656. }
  657. }else{
  658. total = ""
  659. }
  660. return total
  661. },
  662. getOverFlushInfo(arr){
  663. var total = 0
  664. if(arr.length >0){
  665. for(let i=0;i<arr.length;i++){
  666. total += arr[i].stock_count
  667. }
  668. }
  669. return total
  670. },
  671. getCancelSotckInfo(arr){
  672. var cancle_toal = 0
  673. if(arr.length >0){
  674. for(let z=0;z<arr.length;z++){
  675. cancle_toal += arr[z].count
  676. }
  677. }
  678. return cancle_toal
  679. },
  680. getHouseName(id){
  681. var storehouse_name = ""
  682. for(let i=0;i<this.storehouseList.length;i++){
  683. if(id == this.storehouseList[i].id){
  684. storehouse_name = this.storehouseList[i].storehouse_name
  685. }
  686. }
  687. return storehouse_name
  688. },
  689. objectOneMethod({ row, column, rowIndex, columnIndex }) {
  690. // console.log("column",column)
  691. // console.log("rowindex",rowIndex)
  692. // console.log("columnninex",columnIndex)
  693. // if(columnIndex === 1){
  694. // if(rowIndex === 1){
  695. // return {
  696. // rowspan: 1,
  697. // colspan: 3
  698. // };
  699. // }
  700. // }
  701. },
  702. getWareInfoCount(val,storehouse_id){
  703. var count = 0
  704. if(val.length > 0){
  705. for(let i=0;i<val.length;i++){
  706. if(val[i].storehouse_id == storehouse_id){
  707. count +=val[i].warehousing_count
  708. }
  709. }
  710. }
  711. if(count > 0){
  712. return count
  713. }else{
  714. return ""
  715. }
  716. },
  717. getWareInfoCountOne(val,storehouse_id){
  718. var count = 0
  719. if(val.length > 0){
  720. for(let i=0;i<val.length;i++){
  721. if(val[i].storehouse_id == storehouse_id){
  722. count +=val[i].stock_count
  723. }
  724. }
  725. }
  726. if(count > 0){
  727. return count
  728. }else{
  729. return ""
  730. }
  731. },
  732. getWareInfoCountTwo(val,storehouse_id){
  733. var count = 0
  734. if(val.length > 0){
  735. for(let i=0;i<val.length;i++){
  736. count +=val[i].stock_count
  737. }
  738. }
  739. if(count > 0){
  740. return count
  741. }else{
  742. return ""
  743. }
  744. },
  745. changeStorehouseName(){
  746. this.getlist()
  747. },
  748. changeGoodName(){
  749. this.getlist()
  750. },
  751. arraySpanMethod({ row, column, rowIndex, columnIndex }) {
  752. if(rowIndex == 1 && columnIndex === 4){
  753. return {
  754. rowspan: 2,
  755. colspan: 1
  756. };
  757. }
  758. },
  759. }
  760. };
  761. </script>
  762. <style rel="stylesheet/css" lang="scss" scoped>
  763. .information {
  764. border: 1px #dcdfe6 solid;
  765. padding: 30px 20px 30px 20px;
  766. .border {
  767. border-bottom: 1px #dcdfe6 solid;
  768. margin: 0px 0 20px 0;
  769. }
  770. }
  771. .title {
  772. background: #409eff;
  773. height: 44px;
  774. line-height: 44px;
  775. padding: 0 0 0 10px;
  776. color: #fff;
  777. margin: 0 0 10px 0;
  778. }
  779. .edit_separater {
  780. border-top: 1px solid rgb(233, 233, 233);
  781. margin-top: 15px;
  782. margin-bottom: 15px;
  783. }
  784. </style>
  785. <style>
  786. .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
  787. font-size: 12px;
  788. }
  789. .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
  790. background: #6fb5fa;
  791. }
  792. .count {
  793. color: #bd2c00;
  794. }
  795. .el-table td,
  796. .el-table th.is-leaf,
  797. .el-table--border,
  798. .el-table--group {
  799. border-color: #d0d3da;
  800. }
  801. .el-table--border::after,
  802. .el-table--group::after,
  803. .el-table::before {
  804. background-color: #d0d3da;
  805. }
  806. /* 合并表格线样式 */
  807. .spanClass .cell {
  808. padding: 0 !important;
  809. }
  810. .spanClass .cell tr {
  811. display: inline-block;
  812. width: 100%;
  813. /* height: 44px; */
  814. }
  815. .spanClass .cell tr td {
  816. padding: 10px 0;
  817. border-bottom: 1px solid #ebeef5;
  818. display: block;
  819. width: 100%;
  820. min-height: 44px;
  821. }
  822. .spanClass .cell tr:last-of-type td{
  823. border-bottom: none;
  824. }
  825. </style>