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

drugsExpiryDate.vue 17KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <!--<bread-crumb :crumbs='crumbs'></bread-crumb>-->
  5. <bread-crumb :crumbs="crumbs"></bread-crumb>
  6. <el-button
  7. size="small"
  8. @click="handleWarehouse"
  9. class="filter-item"
  10. style="float:right;"
  11. type="primary"
  12. icon="el-icon-circle-plus-outline"
  13. >新增</el-button
  14. >
  15. </div>
  16. <div class="app-container">
  17. <div style="display:flex;justify-content: space-between;">
  18. <div class="cell clearfix">
  19. <el-input
  20. size="small"
  21. style="width: 400px;"
  22. v-model.trim="searchKey"
  23. class="filter-item"
  24. placeholder="单据编码/制单人/厂商"
  25. />
  26. <el-button
  27. size="small"
  28. class="filter-item"
  29. type="primary"
  30. icon="el-icon-search"
  31. @click="search"
  32. >搜索</el-button
  33. >
  34. </div>
  35. <div>
  36. <el-button size="small" type="primary">打印</el-button>
  37. <el-button size="small" type="primary">报表下载</el-button>
  38. </div>
  39. </div>
  40. <el-table :data="tableData" border style="width: 100%;" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
  41. <el-table-column align="center" prop="dialysis_no" label="自编码">
  42. <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
  43. </el-table-column>
  44. <el-table-column align="center" prop="name" label="药品名称">
  45. <template slot-scope="scope">{{ scope.row.name }}</template>
  46. </el-table-column>
  47. <el-table-column align="center" prop="dialysis_no" label="生产厂家">
  48. <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
  49. </el-table-column>
  50. <el-table-column align="center" prop="name" label="规格型号">
  51. <template slot-scope="scope">{{ scope.row.name }}</template>
  52. </el-table-column>
  53. <el-table-column align="center" prop="name" label="批次号">
  54. <template slot-scope="scope">{{ scope.row.name }}</template>
  55. </el-table-column>
  56. <el-table-column align="center" prop="name" label="入库时间">
  57. <template slot-scope="scope">{{ scope.row.name }}</template>
  58. </el-table-column>
  59. <el-table-column align="center" prop="name" label="入库数量">
  60. <template slot-scope="scope">{{ scope.row.name }}</template>
  61. </el-table-column>
  62. <el-table-column align="center" prop="name" label="基本单位">
  63. <template slot-scope="scope">{{ scope.row.name }}</template>
  64. </el-table-column>
  65. <el-table-column align="center" prop="name" label="零价">
  66. <template slot-scope="scope">{{ scope.row.name }}</template>
  67. </el-table-column>
  68. <el-table-column align="center" prop="name" label="有效期">
  69. <template slot-scope="scope">{{ scope.row.name }}</template>
  70. </el-table-column>
  71. </el-table>
  72. <el-pagination
  73. @size-change="handleSizeChange"
  74. @current-change="handleCurrentChange"
  75. :page-sizes="[10, 50, 100]"
  76. :page-size="10"
  77. background
  78. style="margin-top:20px;float: right"
  79. layout="total, sizes, prev, pager, next, jumper"
  80. :total="total"
  81. >
  82. </el-pagination>
  83. </div>
  84. </div>
  85. </template>
  86. <script>
  87. import { uParseTime } from "@/utils/tools";
  88. import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from "@/api/doctor";
  89. import {
  90. deleteWarehouseInfo,
  91. GetAllConfig,
  92. GetAllGoodInfo,
  93. GetAllGoodType,
  94. getWarehouseInfoList,
  95. getWarehouseList
  96. } from "@/api/stock";
  97. import BreadCrumb from "../../components/bread-crumb";
  98. export default {
  99. name: "stockIn",
  100. components: { BreadCrumb },
  101. created() {
  102. // var nowDate = new Date();
  103. //
  104. // var year = new Date().getFullYear()
  105. // var month = new Date().getMonth() + 1
  106. // var day = nowDate.getDate()
  107. // if (parseInt(month) < 10) {
  108. // month = '0' + month
  109. // }
  110. // if (parseInt(day) < 10) {
  111. // day = '0' + day
  112. // }
  113. // const endTime = year + '-' + month + '-' + day
  114. // this.end_time = endTime
  115. //
  116. //
  117. // var year = new Date().getFullYear()
  118. // var month = new Date().getMonth()
  119. // var day = new Date().getDate()
  120. //
  121. // day.setMonth(day.getMonth() - 3);
  122. //
  123. // if (parseInt(month) < 10) {
  124. // month = '0' + month
  125. // }
  126. // if (parseInt(day) < 10) {
  127. // day = '0' + day
  128. // }
  129. // const startTime = year + '-' + month + '-' + day
  130. // this.start_time = startTime
  131. var nowDate = new Date();
  132. var nowYear = nowDate.getFullYear();
  133. var nowMonth = nowDate.getMonth() + 1;
  134. var nowDay = nowDate.getDate();
  135. this.end_time =
  136. nowYear +
  137. "-" +
  138. (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
  139. "-" +
  140. (nowDay < 10 ? "0" + nowDay : nowDay);
  141. nowDate.setMonth(nowDate.getMonth() - 1);
  142. nowYear = nowDate.getFullYear();
  143. nowMonth = nowDate.getMonth() + 1;
  144. nowDay = nowDate.getDate();
  145. this.start_time =
  146. nowYear +
  147. "-" +
  148. (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
  149. "-" +
  150. (nowDay < 10 ? "0" + nowDay : nowDay);
  151. this.GetWarehouse();
  152. this.GetConfigInfo();
  153. this.fetchAllAdminUsers();
  154. },
  155. data() {
  156. return {
  157. crumbs: [
  158. { path: false, name: "库存管理" },
  159. { path: false, name: "药品有效期预警" }
  160. ],
  161. searchKey: "",
  162. type: 1,
  163. page: 1,
  164. limit: 10,
  165. checked: false,
  166. total: 0,
  167. pageTotal: 0,
  168. pageSelect: 0,
  169. adminUserOptions: [],
  170. multipleSelection: [],
  171. signAndWeighBoxPatients: "sign-and-weigh-box-patients",
  172. start_time: "",
  173. end_time: "",
  174. goodType: [],
  175. goodInfo: [],
  176. manufacturer: [],
  177. selectedTableData: [],
  178. dealer: [],
  179. Warehouse: {
  180. loading: false,
  181. warehouseDate: [],
  182. tableCurrentIndex: ""
  183. },
  184. WarehouseInfo: {
  185. loading: false,
  186. warehouseInfoDate: []
  187. },
  188. startTime: ""
  189. };
  190. },
  191. methods: {
  192. search: function() {
  193. const Params = {
  194. page: this.page,
  195. limit: this.limit,
  196. start_time: this.start_time,
  197. end_time: this.end_time,
  198. type: this.type,
  199. keywords: this.searchKey
  200. };
  201. this.Warehouse.warehouseDate = [];
  202. getWarehouseList(Params).then(response => {
  203. if (response.data.state == 0) {
  204. this.Warehouse.loading = false;
  205. this.$message.error(response.data.msg);
  206. return false;
  207. } else {
  208. this.Warehouse.loading = false;
  209. this.total = response.data.data.total;
  210. for (let i = 0; i < response.data.data.list.length; i++) {
  211. this.Warehouse.warehouseDate.push(response.data.data.list[i]);
  212. }
  213. }
  214. });
  215. },
  216. GetWarehouse: function() {
  217. const Params = {
  218. page: this.page,
  219. limit: this.limit,
  220. start_time: this.start_time,
  221. end_time: this.end_time,
  222. type: this.type
  223. };
  224. this.Warehouse.warehouseDate = [];
  225. getWarehouseList(Params).then(response => {
  226. if (response.data.state == 0) {
  227. this.Warehouse.loading = false;
  228. this.$message.error(response.data.msg);
  229. return false;
  230. } else {
  231. this.Warehouse.loading = false;
  232. this.total = response.data.data.total;
  233. for (let i = 0; i < response.data.data.list.length; i++) {
  234. this.Warehouse.warehouseDate.push(response.data.data.list[i]);
  235. }
  236. }
  237. });
  238. },
  239. tableRowClassName({ row, rowIndex }) {
  240. // 把每一行的索引放进row
  241. row.index = rowIndex;
  242. },
  243. onRowClick(row, event, column) {
  244. this.WarehouseInfo.warehouseInfoDate = [];
  245. this.Warehouse.tableCurrentIndex = row.index;
  246. const params = {
  247. id: row.id
  248. };
  249. this.WarehouseInfo.loading = true;
  250. getWarehouseInfoList(params).then(response => {
  251. if (response.data.state == 0) {
  252. this.WarehouseInfo.loading = false;
  253. this.$message.error(response.data.msg);
  254. return false;
  255. } else {
  256. this.WarehouseInfo.loading = false;
  257. for (let i = 0; i < response.data.data.info.length; i++) {
  258. this.WarehouseInfo.warehouseInfoDate.push(
  259. response.data.data.info[i]
  260. );
  261. }
  262. }
  263. });
  264. },
  265. getXuserName(id) {
  266. if (id <= 0) {
  267. return "";
  268. }
  269. var name = "";
  270. if (
  271. this.adminUserOptions == null ||
  272. typeof this.adminUserOptions.length === "undefined"
  273. ) {
  274. return name;
  275. }
  276. var leng = this.adminUserOptions.length;
  277. if (leng == 0) {
  278. return name;
  279. }
  280. for (let index = 0; index < leng; index++) {
  281. if (this.adminUserOptions[index].id == id) {
  282. name = this.adminUserOptions[index].name;
  283. break;
  284. }
  285. }
  286. return name;
  287. },
  288. fetchAllDoctorAndNurse() {
  289. fetchAllDoctorAndNurse().then(response => {
  290. if (response.data.state == 1) {
  291. this.doctorOptions = response.data.data.doctors;
  292. }
  293. });
  294. },
  295. fetchAllAdminUsers() {
  296. fetchAllAdminUsers().then(response => {
  297. console.log(response);
  298. if (response.data.state == 1) {
  299. this.adminUserOptions = response.data.data.users;
  300. var alen = this.adminUserOptions.length;
  301. for (let index = 0; index < alen; index++) {
  302. if (this.adminUserOptions[index].user_type == 2) {
  303. // this.doctorOptions.push(this.adminUserOptions[index]);
  304. }
  305. }
  306. }
  307. });
  308. },
  309. getSpecificationName: function(id) {
  310. let name = "";
  311. for (let i = 0; i < this.goodInfo.length; i++) {
  312. if (this.goodInfo[i].id == id) {
  313. name = this.goodInfo[i].specification_name;
  314. }
  315. }
  316. return name;
  317. },
  318. getTypeName: function(id) {
  319. let name = "";
  320. for (let i = 0; i < this.goodType.length; i++) {
  321. if (this.goodType[i].id == id) {
  322. name = this.goodType[i].type_name;
  323. }
  324. }
  325. return name;
  326. },
  327. GetAllGoodType: function() {
  328. GetAllGoodType().then(response => {
  329. if (response.data.state == 0) {
  330. this.$message.error(response.data.msg);
  331. return false;
  332. } else {
  333. for (let i = 0; i < response.data.data.goodType.length; i++) {
  334. this.goodType.push(response.data.data.goodType[i]);
  335. }
  336. }
  337. });
  338. },
  339. GetAllGoodInfo: function() {
  340. GetAllGoodInfo().then(response => {
  341. if (response.data.state == 0) {
  342. this.$message.error(response.data.msg);
  343. return false;
  344. } else {
  345. for (let i = 0; i < response.data.data.goodInfo.length; i++) {
  346. this.goodInfo.push(response.data.data.goodInfo[i]);
  347. }
  348. }
  349. });
  350. },
  351. clicks: function() {
  352. console.log(this.WarehouseInfo.warehouseInfoDate);
  353. },
  354. handleWarehouse: function() {
  355. this.$router.push({ path: "/stock/in/add", query: { type: this.type } });
  356. },
  357. handleReturnSales: function() {
  358. // this.$router.push({path:'/patients/create'}
  359. if (this.multipleSelection.length <= 0) {
  360. this.$message.error("请选择退货商品");
  361. return;
  362. }
  363. const ids = [];
  364. for (let i = 0; i < this.multipleSelection.length; i++) {
  365. ids.push(this.multipleSelection[i].id);
  366. }
  367. this.$router.push({ name: "salesReturn", query: { id: ids.join("&") } });
  368. },
  369. handleReturnSalesRecord: function() {
  370. this.$router.push({ name: "salesReutrnRecord" });
  371. },
  372. handleWarehouseRecord: function() {
  373. this.$router.push({ name: "warehouseRecord" });
  374. },
  375. handleSelectionChange: function(val) {
  376. this.multipleSelection = val;
  377. },
  378. handleSizeChange(val) {
  379. this.limit = val;
  380. this.GetWarehouse();
  381. },
  382. handleCurrentChange(val) {
  383. this.page = val;
  384. this.GetWarehouse();
  385. },
  386. startTimeChange(val) {
  387. var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
  388. if (time > 0) {
  389. this.$message.error("结束时间不能小于开始时间");
  390. this.start_time = "";
  391. } else {
  392. this.startTime = this.getTimestamp(val);
  393. this.GetWarehouse();
  394. }
  395. },
  396. endTimeChange(val) {
  397. var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
  398. if (time < 0) {
  399. this.$message.error("结束时间不能小于开始时间");
  400. this.end_time = "";
  401. } else {
  402. this.GetWarehouse();
  403. }
  404. },
  405. getTimestamp(time) {
  406. // 把时间日期转成时间戳
  407. return new Date(time).getTime() / 1000;
  408. },
  409. calculate: function(val) {
  410. return Math.round(parseFloat(val) * 100) / 100;
  411. },
  412. GetConfigInfo: function() {
  413. GetAllConfig().then(response => {
  414. if (response.data.state == 0) {
  415. this.$message.error(response.data.msg);
  416. return false;
  417. } else {
  418. this.manufacturer = response.data.data.manufacturer;
  419. this.dealer = response.data.data.dealer;
  420. }
  421. });
  422. },
  423. getManufactuerName: function(manufacturer_id) {
  424. for (let i = 0; i < this.manufacturer.length; i++) {
  425. if (this.manufacturer[i].id == manufacturer_id) {
  426. return this.manufacturer[i].manufacturer_name;
  427. }
  428. }
  429. },
  430. getDealerName: function(dealer_id) {
  431. for (let i = 0; i < this.dealer.length; i++) {
  432. if (this.dealer[i].id == dealer_id) {
  433. return this.dealer[i].dealer_name;
  434. }
  435. }
  436. },
  437. handleEdit: function(index, row) {
  438. this.$router.push({
  439. name: "stockInDetail",
  440. query: { id: row.id, type: this.type }
  441. });
  442. },
  443. handleDelete: function(index, row) {
  444. const ids = [];
  445. ids.push(row.id);
  446. const idStr = ids.join(",");
  447. const params = {
  448. ids: idStr
  449. };
  450. this.$confirm("确认删除入库单记录?", "删除入库单记录", {
  451. confirmButtonText: "确定",
  452. cancelButtonText: "取消",
  453. type: "warning"
  454. })
  455. .then(() => {
  456. deleteWarehouseInfo(params).then(response => {
  457. if (response.data.state == 0) {
  458. this.$message.error(response.data.msg);
  459. return false;
  460. } else {
  461. this.$notify({
  462. title: "成功",
  463. message: "删除成功",
  464. type: "success",
  465. duration: 2000
  466. });
  467. for (let i = 0; i < ids.length; i++) {
  468. for (let y = 0; y < this.Warehouse.warehouseDate.length; y++) {
  469. if (ids[i] == this.Warehouse.warehouseDate[y].id) {
  470. this.Warehouse.warehouseDate.splice(y, 1);
  471. }
  472. }
  473. }
  474. }
  475. });
  476. })
  477. .catch(() => {});
  478. },
  479. changeAllSelected: function(val) {
  480. if (val) {
  481. this.$refs.multipleTable.toggleAllSelection();
  482. } else {
  483. this.$refs.multipleTable.clearSelection();
  484. }
  485. },
  486. select(selection) {
  487. this.selectedTableData = selection;
  488. },
  489. batchDelete() {
  490. if (this.selectedTableData.length <= 0) {
  491. this.$message.error("请选择要删除的记录");
  492. return;
  493. }
  494. const ids = [];
  495. for (let i = 0; i < this.selectedTableData.length; i++) {
  496. ids.push(this.selectedTableData[i].id);
  497. }
  498. const idStr = ids.join(",");
  499. const params = {
  500. ids: idStr
  501. };
  502. this.$confirm("确认删除入库单记录?", "删除入库单记录", {
  503. confirmButtonText: "确定",
  504. cancelButtonText: "取消",
  505. type: "warning"
  506. })
  507. .then(() => {
  508. deleteWarehouseInfo(params).then(response => {
  509. if (response.data.state == 0) {
  510. this.$message.error(response.data.msg);
  511. return false;
  512. } else {
  513. this.$notify({
  514. title: "成功",
  515. message: "删除成功",
  516. type: "success",
  517. duration: 2000
  518. });
  519. for (let i = 0; i < ids.length; i++) {
  520. for (let y = 0; y < this.Warehouse.warehouseDate.length; y++) {
  521. if (ids[i] == this.Warehouse.warehouseDate[y].id) {
  522. this.Warehouse.warehouseDate.splice(y, 1);
  523. }
  524. }
  525. }
  526. }
  527. });
  528. })
  529. .catch(() => {});
  530. }
  531. }
  532. };
  533. </script>
  534. <style rel="stylesheet/css" lang="scss" scoped>
  535. .information {
  536. border: 1px #dcdfe6 solid;
  537. padding: 30px 20px 30px 20px;
  538. .border {
  539. border-bottom: 1px #dcdfe6 solid;
  540. margin: 0px 0 20px 0;
  541. }
  542. }
  543. .edit_separater {
  544. border-top: 1px solid rgb(233, 233, 233);
  545. margin-top: 15px;
  546. margin-bottom: 15px;
  547. }
  548. </style>
  549. <style>
  550. .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
  551. font-size: 12px;
  552. }
  553. .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
  554. background: #6fb5fa;
  555. }
  556. .count {
  557. color: #bd2c00;
  558. }
  559. .el-table td,
  560. .el-table th.is-leaf,
  561. .el-table--border,
  562. .el-table--group {
  563. border-color: #d0d3da;
  564. }
  565. .el-table--border::after,
  566. .el-table--group::after,
  567. .el-table::before {
  568. background-color: #d0d3da;
  569. }
  570. </style>