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

cancelStockOrder.vue 17KB

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