Bläddra i källkod

logo图标修复

soft5566 2 år sedan
förälder
incheckning
615fc890bd
4 ändrade filer med 126 tillägg och 26 borttagningar
  1. 27 3
      src/api/order.js
  2. BIN
      src/icons/images/index/title_icon.png
  3. 2 2
      src/styles/sidebar.scss
  4. 97 21
      src/views/order/index.vue

+ 27 - 3
src/api/order.js

@@ -24,13 +24,37 @@ export function getTableData(forData) {
   })
   })
 }
 }
 
 
-// 核销   退款    退房
-export function collate_refund_checkout(forData) {
+// 核销
+export function collate(forData) {
   let data = new FormData()
   let data = new FormData()
   data.append('id', forData.id)
   data.append('id', forData.id)
   data.append('status', forData.status)
   data.append('status', forData.status)
   return request({
   return request({
-    url: '/bookoperate.action',
+    url: '/bookoperate_live.action',
+    method: 'post',
+    data
+  })
+}
+
+// 退款
+export function refund(forData) {
+  let data = new FormData()
+  data.append('id', forData.id)
+  data.append('status', forData.status)
+  return request({
+    url: '/bookrefund_money.action',
+    method: 'post',
+    data
+  })
+}
+
+// 退房
+export function checkout(forData) {
+  let data = new FormData()
+  data.append('id', forData.id)
+  data.append('status', forData.status)
+  return request({
+    url: '/bookrefund_room.action',
     method: 'post',
     method: 'post',
     data
     data
   })
   })

BIN
src/icons/images/index/title_icon.png


+ 2 - 2
src/styles/sidebar.scss

@@ -55,7 +55,7 @@
     }
     }
 
 
     .svg-icon {
     .svg-icon {
-      margin-right: 16px;
+      margin-right: 12px;
     }
     }
 
 
     .sub-el-icon {
     .sub-el-icon {
@@ -219,7 +219,7 @@
 .el-menu--vertical {
 .el-menu--vertical {
   &>.el-menu {
   &>.el-menu {
     .svg-icon {
     .svg-icon {
-      margin-right: 16px;
+      margin-right: 12px;
     }
     }
     .sub-el-icon {
     .sub-el-icon {
       margin-right: 12px;
       margin-right: 12px;

+ 97 - 21
src/views/order/index.vue

@@ -50,7 +50,8 @@
                   <span v-else-if="scope.row.status === '3'" class="txt-cell-green">已入住</span>
                   <span v-else-if="scope.row.status === '3'" class="txt-cell-green">已入住</span>
                   <span v-else-if="scope.row.status === '4'" class="txt-cell-red">已取消</span>
                   <span v-else-if="scope.row.status === '4'" class="txt-cell-red">已取消</span>
                   <span v-else-if="scope.row.status === '5'" class="txt-cell-red">已退款</span>
                   <span v-else-if="scope.row.status === '5'" class="txt-cell-red">已退款</span>
-                  <span v-else class="txt-cell-red">已退房</span>
+                  <span v-else-if="scope.row.status === '6'" class="txt-cell-red">已退房</span>
+                  <span v-else class="txt-cell-red">未知</span>
                 </template>
                 </template>
               </el-table-column>
               </el-table-column>
               <el-table-column label="房间" align="center">
               <el-table-column label="房间" align="center">
@@ -85,9 +86,9 @@
               </el-table-column>
               </el-table-column>
               <el-table-column label="操作" align="center" width="300">
               <el-table-column label="操作" align="center" width="300">
                 <template slot-scope="scope">
                 <template slot-scope="scope">
-                  <el-button size="mini" round type="primary" @click="collate_refund_checkout_handler(scope.$index, scope.row, 1)">核销</el-button>
-                  <el-button size="mini" round type="danger" @click="collate_refund_checkout_handler(scope.$index, scope.row, 2)">退款</el-button>
-                  <el-button size="mini" round type="warning" @click="collate_refund_checkout_handler(scope.$index, scope.row, 3)">退房</el-button>
+                  <el-button size="mini" round type="primary" @click="collate_handler(scope.$index, scope.row)">核销</el-button>
+                  <el-button size="mini" round type="danger" @click="refund_handler(scope.$index, scope.row)">退款</el-button>
+                  <el-button size="mini" round type="warning" @click="checkout_handler(scope.$index, scope.row)">退房</el-button>
                 </template>
                 </template>
               </el-table-column>
               </el-table-column>
             </el-table>
             </el-table>
@@ -106,7 +107,9 @@
 <script>
 <script>
   import {
   import {
     getTableData,
     getTableData,
-    collate_refund_checkout,
+    collate,
+    refund,
+    checkout,
     downloadExcel
     downloadExcel
   } from '@/api/order'
   } from '@/api/order'
   export default {
   export default {
@@ -153,19 +156,91 @@
     },
     },
     methods: {
     methods: {
       /**
       /**
-       * 核销  退款  退房
+       * 核销
        */
        */
-      collate_refund_checkout_handler(index, row, param) {
-        // console.log(index, row, row.status, param);
-        var txt = '';
-        if (param === 1) {
-          txt = '核销';
-        } else if (param === 2) {
-          txt = '退款';
-        } else {
-          txt = '退房';
-        }
-        this.$confirm('确定' + txt + '?', '提示', {
+      collate_handler(index, row) {
+        // console.log(index, row, row.status);
+        this.$confirm('确定核销?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning',
+          closeOnClickModal: false
+        }).then(() => {
+          let data = {
+            id: row.id,
+            status: 3,
+            dom: row.dom
+          };
+          // console.log(data);
+          collate(data).then((res) => {
+            // console.log(res);
+            if (res.code === 200) {
+              this.$message({
+                type: 'success',
+                message: res.message
+              });
+              // 刷新列表
+              this.get_table_data('pages');
+            } else {
+              this.$message.warning(res.message)
+            }
+          }).catch((err) => {
+            // console.log(err);
+            this.$message.error(err.message)
+          });
+        }).catch(() => {
+          this.$message({
+            type: 'info',
+            message: '已取消核销'
+          });
+        });
+      },
+      /**
+       * 退款
+       */
+      refund_handler(index, row, param) {
+        // console.log(index, row, row.status);
+        this.$confirm('确定退款?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning',
+          closeOnClickModal: false
+        }).then(() => {
+          let data = {
+            id: row.id,
+            status: 5,
+            dom: row.dom
+          };
+          // console.log(data);
+          refund(data).then((res) => {
+            // console.log(res);
+            if (res.code === 200) {
+              this.$message({
+                type: 'success',
+                message: res.message
+              });
+              // 刷新列表
+              this.get_table_data('pages');
+            } else {
+              this.$message.warning(res.message)
+            }
+          }).catch((err) => {
+            // console.log(err);
+            this.$message.error(err.message)
+          });
+        }).catch(() => {
+          this.$message({
+            type: 'info',
+            message: '已取消退款'
+          });
+        });
+      },
+      /**
+       * 退房
+       */
+      checkout_handler(index, row) {
+        // console.log(index, row, row.status);
+        this.$confirm('确定退房?', '提示', {
           confirmButtonText: '确定',
           confirmButtonText: '确定',
           cancelButtonText: '取消',
           cancelButtonText: '取消',
           type: 'warning',
           type: 'warning',
@@ -173,17 +248,19 @@
         }).then(() => {
         }).then(() => {
           let data = {
           let data = {
             id: row.id,
             id: row.id,
-            status: row.status,
+            status: 6,
             dom: row.dom
             dom: row.dom
           };
           };
           // console.log(data);
           // console.log(data);
-          collate_refund_checkout(data).then((res) => {
+          checkout(data).then((res) => {
             // console.log(res);
             // console.log(res);
             if (res.code === 200) {
             if (res.code === 200) {
               this.$message({
               this.$message({
                 type: 'success',
                 type: 'success',
                 message: res.message
                 message: res.message
               });
               });
+              // 刷新列表
+              this.get_table_data('pages');
             } else {
             } else {
               this.$message.warning(res.message)
               this.$message.warning(res.message)
             }
             }
@@ -194,7 +271,7 @@
         }).catch(() => {
         }).catch(() => {
           this.$message({
           this.$message({
             type: 'info',
             type: 'info',
-            message: '已取消' + txt
+            message: '已取消退房'
           });
           });
         });
         });
       },
       },
@@ -443,7 +520,6 @@
 
 
             .txt-cell-red {
             .txt-cell-red {
               color: #F56C6C;
               color: #F56C6C;
-              font-size: 16px;
             }
             }
 
 
             .pagination-table {
             .pagination-table {