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

cancelDrugStockOrder.vue 15KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534
  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="AddNewOrder"
  9. class="filter-item"
  10. style="float:right;"
  11. type="primary"
  12. icon="el-icon-circle-plus-outline"
  13. >新增
  14. </el-button>
  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="filter-container" style="margin-top: 10px">
  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-row :gutter="12" style="margin-top: 10px">
  76. <el-table
  77. :data="cancelStockDate"
  78. :class="signAndWeighBoxPatients"
  79. border
  80. highlight-current-row
  81. ref="multipleTable"
  82. @selection-change="select"
  83. :row-style="{ color: '#303133' }"
  84. :header-cell-style="{
  85. backgroundColor: 'rgb(245, 247, 250)',
  86. color: '#606266'
  87. }"
  88. >
  89. <el-table-column type="selection" width="55"> </el-table-column>
  90. <el-table-column label="单据日期" align="center">
  91. <template slot-scope="scope">
  92. {{ scope.row.return_time | parseTime("{y}-{m}-{d}") }}
  93. </template>
  94. </el-table-column>
  95. <el-table-column label="单据编号" align="center">
  96. <template slot-scope="scope">
  97. {{ scope.row.order_number }}
  98. </template>
  99. </el-table-column>
  100. <el-table-column label="制单人" align="center">
  101. <template slot-scope="scope">
  102. {{ getXuserName(scope.row.creater) }}
  103. </template>
  104. </el-table-column>
  105. <el-table-column label="厂家" align="center">
  106. <template slot-scope="scope">
  107. {{ getManufactuerName(scope.row.manufacturer) }}
  108. </template>
  109. </el-table-column>
  110. <el-table-column label="经销商" align="center">
  111. <template slot-scope="scope">
  112. {{ getDealerName(scope.row.dealer) }}
  113. </template>
  114. </el-table-column>
  115. <el-table-column label="操作" align="center">
  116. <template slot-scope="scope">
  117. <el-tooltip
  118. class="item"
  119. effect="dark"
  120. content="编辑"
  121. placement="top"
  122. >
  123. <el-button
  124. size="mini"
  125. type="primary"
  126. icon="el-icon-edit-outline"
  127. @click="handleEdit(scope.$index, scope.row)"
  128. >
  129. </el-button>
  130. </el-tooltip>
  131. <el-tooltip
  132. class="item"
  133. effect="dark"
  134. content="删除"
  135. placement="top"
  136. >
  137. <el-button
  138. size="mini"
  139. type="danger"
  140. icon="el-icon-delete"
  141. @click="handleDelete(scope.$index, scope.row)"
  142. >
  143. </el-button>
  144. </el-tooltip>
  145. </template>
  146. </el-table-column>
  147. </el-table>
  148. <el-pagination
  149. @size-change="handleSizeChange"
  150. @current-change="handleCurrentChange"
  151. :page-sizes="[10, 50, 100]"
  152. :page-size="10"
  153. background
  154. style="margin-top:20px;float: right"
  155. layout="total, sizes, prev, pager, next, jumper"
  156. :total="total"
  157. >
  158. </el-pagination>
  159. </el-row>
  160. </div>
  161. </div>
  162. </template>
  163. <script>
  164. import { uParseTime } from "@/utils/tools";
  165. import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from "@/api/doctor";
  166. import {
  167. deleteDrugCancelStock,
  168. GetAllConfig,
  169. getDrugCancelStockList
  170. } from "@/api/drug/drug_stock";
  171. import BreadCrumb from '../../components/bread-crumb'
  172. // import BreadCrumb from "../components/bread-crumb";
  173. export default {
  174. name: "salesReturnOrder",
  175. components: { BreadCrumb },
  176. created() {
  177. var nowDate = new Date();
  178. var nowYear = nowDate.getFullYear();
  179. var nowMonth = nowDate.getMonth() + 1;
  180. var nowDay = nowDate.getDate();
  181. this.end_time =
  182. nowYear +
  183. "-" +
  184. (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
  185. "-" +
  186. (nowDay < 10 ? "0" + nowDay : nowDay);
  187. nowDate.setMonth(nowDate.getMonth() - 1);
  188. nowYear = nowDate.getFullYear();
  189. nowMonth = nowDate.getMonth() + 1;
  190. nowDay = nowDate.getDate();
  191. this.start_time =
  192. nowYear +
  193. "-" +
  194. (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
  195. "-" +
  196. (nowDay < 10 ? "0" + nowDay : nowDay);
  197. this.GetCancelStock();
  198. this.GetConfigInfo();
  199. this.fetchAllAdminUsers();
  200. },
  201. data() {
  202. return {
  203. crumbs: [
  204. { path: false, name: "库存管理" },
  205. { path: false, name: "出库退库单" }
  206. ],
  207. searchKey: "",
  208. type: 1,
  209. page: 1,
  210. limit: 10,
  211. checked: false,
  212. total: 0,
  213. pageTotal: 0,
  214. pageSelect: 0,
  215. adminUserOptions: [],
  216. multipleSelection: [],
  217. signAndWeighBoxPatients: "sign-and-weigh-box-patients",
  218. start_time: "",
  219. cancelStockDate: [],
  220. end_time: "",
  221. goodType: [],
  222. goodInfo: [],
  223. manufacturer: [],
  224. selectedTableData: [],
  225. dealer: []
  226. };
  227. },
  228. methods: {
  229. search: function() {
  230. const Params = {
  231. page: this.page,
  232. limit: this.limit,
  233. start_time: this.start_time,
  234. end_time: this.end_time,
  235. type: this.type,
  236. keywords: this.searchKey
  237. };
  238. this.cancelStockDate = [];
  239. getDrugCancelStockList(Params).then(response => {
  240. if (response.data.state == 0) {
  241. this.$message.error(response.data.msg);
  242. return false;
  243. } else {
  244. this.total = response.data.data.total;
  245. for (let i = 0; i < response.data.data.list.length; i++) {
  246. this.cancelStockDate.push(response.data.data.list[i]);
  247. }
  248. }
  249. });
  250. },
  251. AddNewOrder: function() {
  252. this.$router.push({
  253. name: "cancelDrugStockOrderAdd",
  254. query: { type: this.type }
  255. });
  256. },
  257. GetCancelStock: function() {
  258. const Params = {
  259. page: this.page,
  260. limit: this.limit,
  261. start_time: this.start_time,
  262. end_time: this.end_time,
  263. type: this.type
  264. };
  265. this.cancelStockDate = [];
  266. getDrugCancelStockList(Params).then(response => {
  267. if (response.data.state == 0) {
  268. this.$message.error(response.data.msg);
  269. return false;
  270. } else {
  271. this.total = response.data.data.total;
  272. for (let i = 0; i < response.data.data.list.length; i++) {
  273. this.cancelStockDate.push(response.data.data.list[i]);
  274. }
  275. }
  276. });
  277. },
  278. getXuserName(id) {
  279. if (id <= 0) {
  280. return "";
  281. }
  282. var name = "";
  283. if (
  284. this.adminUserOptions == null ||
  285. typeof this.adminUserOptions.length === "undefined"
  286. ) {
  287. return name;
  288. }
  289. var leng = this.adminUserOptions.length;
  290. if (leng == 0) {
  291. return name;
  292. }
  293. for (let index = 0; index < leng; index++) {
  294. if (this.adminUserOptions[index].id == id) {
  295. name = this.adminUserOptions[index].name;
  296. break;
  297. }
  298. }
  299. return name;
  300. },
  301. fetchAllAdminUsers() {
  302. fetchAllAdminUsers().then(response => {
  303. console.log(response);
  304. if (response.data.state == 1) {
  305. this.adminUserOptions = response.data.data.users;
  306. var alen = this.adminUserOptions.length;
  307. for (let index = 0; index < alen; index++) {
  308. if (this.adminUserOptions[index].user_type == 2) {
  309. // this.doctorOptions.push(this.adminUserOptions[index]);
  310. }
  311. }
  312. }
  313. });
  314. },
  315. handleSelectionChange: function(val) {
  316. this.multipleSelection = val;
  317. },
  318. handleSizeChange(val) {
  319. this.limit = val;
  320. this.GetCancelStock();
  321. },
  322. handleCurrentChange(val) {
  323. this.page = val;
  324. this.GetCancelStock();
  325. },
  326. startTimeChange(val) {
  327. var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
  328. if (time > 0) {
  329. this.$message.error("结束时间不能小于开始时间");
  330. this.start_time = "";
  331. } else {
  332. this.GetCancelStock();
  333. }
  334. this.GetCancelStock();
  335. },
  336. endTimeChange(val) {
  337. var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
  338. if (time < 0) {
  339. this.$message.error("结束时间不能小于开始时间");
  340. this.end_time = "";
  341. } else {
  342. this.GetCancelStock();
  343. }
  344. },
  345. getTimestamp(time) {
  346. // 把时间日期转成时间戳
  347. return new Date(time).getTime() / 1000;
  348. },
  349. calculate: function(val) {
  350. return Math.round(parseFloat(val) * 100) / 100;
  351. },
  352. GetConfigInfo: function() {
  353. GetAllConfig().then(response => {
  354. if (response.data.state == 0) {
  355. this.$message.error(response.data.msg);
  356. return false;
  357. } else {
  358. this.manufacturer = response.data.data.manufacturer;
  359. this.dealer = response.data.data.dealer;
  360. }
  361. });
  362. },
  363. getManufactuerName: function(manufacturer_id) {
  364. for (let i = 0; i < this.manufacturer.length; i++) {
  365. if (this.manufacturer[i].id == manufacturer_id) {
  366. return this.manufacturer[i].manufacturer_name;
  367. }
  368. }
  369. },
  370. getDealerName: function(dealer_id) {
  371. for (let i = 0; i < this.dealer.length; i++) {
  372. if (this.dealer[i].id == dealer_id) {
  373. return this.dealer[i].dealer_name;
  374. }
  375. }
  376. },
  377. handleEdit: function(index, row) {
  378. this.$router.push({
  379. name: "cancelDrugStockDetail",
  380. query: { id: row.id, type: this.type }
  381. });
  382. },
  383. handleDelete: function(index, row) {
  384. const ids = [];
  385. ids.push(row.id);
  386. const idStr = ids.join(",");
  387. const params = {
  388. ids: idStr
  389. };
  390. this.$confirm("确认删除出库退库单记录?", "删除出库退库单记录", {
  391. confirmButtonText: "确定",
  392. cancelButtonText: "取消",
  393. type: "warning"
  394. })
  395. .then(() => {
  396. deleteDrugCancelStock(params).then(response => {
  397. if (response.data.state == 0) {
  398. this.$message.error(response.data.msg);
  399. return false;
  400. } else {
  401. this.$notify({
  402. title: "成功",
  403. message: "删除成功",
  404. type: "success",
  405. duration: 2000
  406. });
  407. for (let i = 0; i < ids.length; i++) {
  408. for (let y = 0; y < this.cancelStockDate.length; y++) {
  409. if (ids[i] == this.cancelStockDate[y].id) {
  410. this.cancelStockDate.splice(y, 1);
  411. }
  412. }
  413. }
  414. }
  415. });
  416. })
  417. .catch(() => {});
  418. },
  419. changeAllSelected: function(val) {
  420. if (val) {
  421. this.$refs.multipleTable.toggleAllSelection();
  422. } else {
  423. this.$refs.multipleTable.clearSelection();
  424. }
  425. },
  426. select(selection) {
  427. this.selectedTableData = selection;
  428. },
  429. batchDelete() {
  430. if (this.selectedTableData.length <= 0) {
  431. this.$message.error("请选择要删除的记录");
  432. return;
  433. }
  434. const ids = [];
  435. for (let i = 0; i < this.selectedTableData.length; i++) {
  436. ids.push(this.selectedTableData[i].id);
  437. }
  438. const idStr = ids.join(",");
  439. const params = {
  440. ids: idStr
  441. };
  442. this.$confirm("确认删除出库退库单记录?", "删除出库退库单记录", {
  443. confirmButtonText: "确定",
  444. cancelButtonText: "取消",
  445. type: "warning"
  446. })
  447. .then(() => {
  448. deleteDrugCancelStock(params).then(response => {
  449. if (response.data.state == 0) {
  450. this.$message.error(response.data.msg);
  451. return false;
  452. } else {
  453. this.$notify({
  454. title: "成功",
  455. message: "删除成功",
  456. type: "success",
  457. duration: 2000
  458. });
  459. for (let i = 0; i < ids.length; i++) {
  460. for (let y = 0; y < this.cancelStockDate.length; y++) {
  461. if (ids[i] == this.cancelStockDate[y].id) {
  462. this.cancelStockDate.splice(y, 1);
  463. }
  464. }
  465. }
  466. }
  467. });
  468. })
  469. .catch(() => {});
  470. }
  471. }
  472. };
  473. </script>
  474. <style rel="stylesheet/css" lang="scss" scoped>
  475. .information {
  476. border: 1px #dcdfe6 solid;
  477. padding: 30px 20px 30px 20px;
  478. .border {
  479. border-bottom: 1px #dcdfe6 solid;
  480. margin: 0px 0 20px 0;
  481. }
  482. }
  483. .edit_separater {
  484. border-top: 1px solid rgb(233, 233, 233);
  485. margin-top: 15px;
  486. margin-bottom: 15px;
  487. }
  488. </style>
  489. <style>
  490. .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
  491. font-size: 12px;
  492. }
  493. .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
  494. background: #6fb5fa;
  495. }
  496. .count {
  497. color: #bd2c00;
  498. }
  499. .el-table td,
  500. .el-table th.is-leaf,
  501. .el-table--border,
  502. .el-table--group {
  503. border-color: #d0d3da;
  504. }
  505. .el-table--border::after,
  506. .el-table--group::after,
  507. .el-table::before {
  508. background-color: #d0d3da;
  509. }
  510. </style>