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

otherStockInOrder.vue 18KB

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