stockQuery.vue 26KB

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