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

query.vue 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  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 class="cell clearfix">
  8. <el-input
  9. size="small"
  10. style="width: 400px;"
  11. class="filter-item"
  12. v-model.trim="keywords"
  13. placeholder="商品名称/规格名称"
  14. />
  15. <el-button
  16. size="small"
  17. class="filter-item"
  18. type="primary"
  19. icon="el-icon-search"
  20. @click="search"
  21. >搜索</el-button
  22. >
  23. </div>
  24. <div class="cell clearfix">
  25. <el-button
  26. size="small"
  27. class="filter-item"
  28. type="primary"
  29. icon="el-icon-search"
  30. @click="setting"
  31. >设置</el-button
  32. >
  33. </div>
  34. <el-table
  35. :row-style="{ color: '#303133' }"
  36. :header-cell-style="{
  37. backgroundColor: 'rgb(245, 247, 250)',
  38. color: '#606266'
  39. }"
  40. :data="WarehouseInfo.warehouseInfoDate"
  41. :class="signAndWeighBoxPatients"
  42. border
  43. v-loading="WarehouseInfo.loading"
  44. :span-method="merge"
  45. >
  46. <el-table-column label="药品名称" align="center">
  47. <template slot-scope="scope">
  48. {{ scope.row.drug_name }}
  49. </template>
  50. </el-table-column>
  51. <el-table-column label="规格名称" align="center">
  52. <template slot-scope="scope">
  53. <span>{{ scope.row.drug_spec }}</span>
  54. </template>
  55. </el-table-column>
  56. <el-table-column label="入库数量" align="center">
  57. <template slot-scope="scope">
  58. <span
  59. @click="showStockInDetailDialog(scope.row.drug_id)"
  60. >{{ stockInCount(scope.row) }}</span
  61. >
  62. </template>
  63. </el-table-column>
  64. <el-table-column label="入库退货" align="center">
  65. <template slot-scope="scope">
  66. <span
  67. @click="showSaleReturnDetailDialog(scope.row)"
  68. >{{ salesReturnCount(scope.row) }}</span
  69. >
  70. </template>
  71. </el-table-column>
  72. <el-table-column label="实际入库" align="center">
  73. <template slot-scope="scope">
  74. {{ stockInCount(scope.row) - salesReturnCount(scope.row) }}
  75. </template>
  76. </el-table-column>
  77. <el-table-column label="出库数量" align="center">
  78. <template slot-scope="scope">
  79. <span
  80. @click="showStockOutDetailDialog(scope.row.drug_id)"
  81. >{{ stockOutCount(scope.row) }}</span
  82. >
  83. </template>
  84. </el-table-column>
  85. <el-table-column label="出库退库" align="center">
  86. <template slot-scope="scope">
  87. <span
  88. @click="showCancelStockDetailDialog(scope.row)"
  89. >{{ cancelStockCount(scope.row) }}</span
  90. >
  91. </template>
  92. </el-table-column>
  93. <el-table-column label="实际出库" align="center">
  94. <template slot-scope="scope">
  95. {{ stockOutCount(scope.row) - cancelStockCount(scope.row) }}
  96. </template>
  97. </el-table-column>
  98. <el-table-column label="剩余库存" align="center">
  99. <template slot-scope="scope">
  100. <span>{{
  101. stockInCount(scope.row) -
  102. salesReturnCount(scope.row) -
  103. stockOutCount(scope.row) +
  104. cancelStockCount(scope.row)
  105. }}</span>
  106. </template>
  107. </el-table-column>
  108. </el-table>
  109. <el-pagination
  110. @size-change="handleSizeChange"
  111. @current-change="handleCurrentChange"
  112. :page-sizes="[10, 50, 100]"
  113. :page-size="10"
  114. background
  115. align="right"
  116. style="margin-top:20px;"
  117. layout="total, sizes, prev, pager, next, jumper"
  118. :total="total"
  119. >
  120. </el-pagination>
  121. </div>
  122. <setting-dialog
  123. ref="dialog"
  124. ></setting-dialog>
  125. </div>
  126. </template>
  127. <script>
  128. import { uParseTime } from '@/utils/tools'
  129. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  130. import { getAllDrugStockQueryList } from '@/api/drug/drug_stock'
  131. import SettingDialog from './settingDialog/index'
  132. export default {
  133. name: "stockIn",
  134. created() {
  135. this.GetAllDrugStockQueryList();
  136. },
  137. components: {
  138. SettingDialog,
  139. BreadCrumb
  140. },
  141. data() {
  142. return {
  143. crumbs: [
  144. { path: false, name: "库存管理" },
  145. { path: "/stock/drugs/stock/query", name: "药品库存查询" }
  146. ],
  147. keywords: "",
  148. total: 0,
  149. multipleSelection: [],
  150. signAndWeighBoxPatients: "sign-and-weigh-box-patients",
  151. start_time: "",
  152. end_time: "",
  153. page: 1,
  154. limit: 10,
  155. goodType: [],
  156. goodInfo: [],
  157. tempArr:[],
  158. sameRowArr: [],
  159. WarehouseInfo: {
  160. loading: false,
  161. warehouseInfoDate: []
  162. }
  163. };
  164. },
  165. methods: {
  166. handleSpanTempArr(){
  167. this.tempArr = []
  168. for (let i = 0; i < this.WarehouseInfo.warehouseInfoDate.length; i++) {
  169. if (i === 0) {
  170. this.tempArr.push(1)
  171. this.pos = 0
  172. } else {
  173. // 判断当前元素与上一个元素是否相同
  174. if (this.WarehouseInfo.warehouseInfoDate[i].drug_name === this.WarehouseInfo.warehouseInfoDate[i - 1].drug_name) {
  175. this.tempArr[this.pos] += 1
  176. this.tempArr.push(0)
  177. } else {
  178. this.tempArr.push(1)
  179. this.pos = i
  180. }
  181. }
  182. }
  183. let sameRowArr = [], sIdx = 0
  184. this.WarehouseInfo.warehouseInfoDate.forEach((item, index) => {
  185. item.index = index
  186. if (index === 0) {
  187. sameRowArr.push([index])
  188. } else {
  189. if (item.drug_name === this.WarehouseInfo.warehouseInfoDate[index - 1].drug_name) {
  190. sameRowArr[sIdx].push(index)
  191. } else {
  192. sIdx = sIdx + 1
  193. sameRowArr.push([index])
  194. }
  195. }
  196. })
  197. this.sameRowArr = sameRowArr
  198. },
  199. merge({ row, column, rowIndex, columnIndex }) {
  200. if (columnIndex === 0) {
  201. const _row = this.tempArr[rowIndex]
  202. const _col = _row > 0 ? 1 : 0
  203. return {
  204. rowspan: _row,
  205. colspan: _col
  206. }
  207. }
  208. },
  209. GetAllDrugStockQueryList: function() {
  210. console.log(this.keywords);
  211. const Params = {
  212. page: this.page,
  213. limit: this.limit,
  214. keyword: this.keywords
  215. };
  216. this.WarehouseInfo.loading = true;
  217. this.WarehouseInfo.warehouseInfoDate = [];
  218. getAllDrugStockQueryList(Params).then(response => {
  219. if (response.data.state == 0) {
  220. this.WarehouseInfo.loading = false;
  221. this.$message.error(response.data.msg);
  222. return false;
  223. } else {
  224. this.WarehouseInfo.loading = false;
  225. this.total = response.data.data.total;
  226. for (let i = 0; i < response.data.data.list.length; i++) {
  227. this.WarehouseInfo.warehouseInfoDate.push(
  228. response.data.data.list[i]
  229. );
  230. }
  231. this.handleSpanTempArr()
  232. }
  233. });
  234. },
  235. getSpecificationName: function(id) {
  236. let name = "";
  237. for (let i = 0; i < this.goodInfo.length; i++) {
  238. if (this.goodInfo[i].id == id) {
  239. name = this.goodInfo[i].specification_name;
  240. }
  241. }
  242. return name;
  243. },
  244. getTypeName: function(id) {
  245. let name = "";
  246. for (let i = 0; i < this.goodType.length; i++) {
  247. if (this.goodType[i].id == id) {
  248. name = this.goodType[i].type_name;
  249. }
  250. }
  251. return name;
  252. },
  253. handleBack: function() {
  254. this.$router.go(-1);
  255. },
  256. handleSizeChange(val) {
  257. this.limit = val;
  258. this.GetAllDrugStockQueryList();
  259. },
  260. handleCurrentChange(val) {
  261. this.page = val;
  262. this.GetAllDrugStockQueryList();
  263. },
  264. calculate: function(val) {
  265. return Math.round(parseFloat(val) * 100) / 100;
  266. },
  267. startTimeChange: function() {
  268. this.GetAllDrugStockQueryList();
  269. },
  270. endTimeChange: function() {
  271. this.GetAllDrugStockQueryList();
  272. },
  273. stockInCount: function(row) {
  274. let total = 0;
  275. for (let i = 0; i < row.query_drug_warehousing_info.length; i++) {
  276. total = total + row.query_drug_warehousing_info[i].warehousing_count;
  277. }
  278. return total;
  279. },
  280. salesReturnCount: function(row) {
  281. let total = 0;
  282. for (let i = 0; i < row.query_drug_sales_return_info.length; i++) {
  283. total = total + row.query_drug_sales_return_info[i].count;
  284. }
  285. return total;
  286. },
  287. stockOutCount: function(row) {
  288. let total = 0;
  289. for (let i = 0; i < row.query_drug_warehouseout_info.length; i++) {
  290. total = total + row.query_drug_warehouseout_info[i].count;
  291. }
  292. return total;
  293. },
  294. cancelStockCount: function(row) {
  295. let total = 0;
  296. for (let i = 0; i < row.query_drug_cancel_stock_info.length; i++) {
  297. total = total + row.query_drug_cancel_stock_info[i].count;
  298. }
  299. return total;
  300. },
  301. showStockInDetailDialog: function(val) {},
  302. showSaleReturnDetailDialog: function() {},
  303. showStockOutDetailDialog: function() {},
  304. showCancelStockDetailDialog: function() {},
  305. search: function() {
  306. this.GetAllDrugStockQueryList();
  307. },setting:function() {
  308. this.$refs.dialog.show()
  309. }
  310. }
  311. };
  312. </script>
  313. <style rel="stylesheet/css" lang="scss" scoped>
  314. .information {
  315. border: 1px #dcdfe6 solid;
  316. padding: 30px 20px 30px 20px;
  317. .border {
  318. border-bottom: 1px #dcdfe6 solid;
  319. margin: 0px 0 20px 0;
  320. }
  321. }
  322. .title {
  323. background: #409eff;
  324. height: 44px;
  325. line-height: 44px;
  326. padding: 0 0 0 10px;
  327. color: #fff;
  328. margin: 0 0 10px 0;
  329. }
  330. .edit_separater {
  331. border-top: 1px solid rgb(233, 233, 233);
  332. margin-top: 15px;
  333. margin-bottom: 15px;
  334. }
  335. </style>
  336. <style>
  337. .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
  338. font-size: 12px;
  339. }
  340. .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
  341. background: #6fb5fa;
  342. }
  343. .count {
  344. color: #bd2c00;
  345. }
  346. .el-table td,
  347. .el-table th.is-leaf,
  348. .el-table--border,
  349. .el-table--group {
  350. border-color: #d0d3da;
  351. }
  352. .el-table--border::after,
  353. .el-table--group::after,
  354. .el-table::before {
  355. background-color: #d0d3da;
  356. }
  357. </style>