浏览代码

修改价格

gqx 2 年之前
父节点
当前提交
e408aa4666
共有 2 个文件被更改,包括 30 次插入14 次删除
  1. 15 13
      src/mixins/JeecgListMixin2.js
  2. 15 1
      src/views/orders/roompriceinfo.vue

+ 15 - 13
src/mixins/JeecgListMixin2.js

@@ -85,19 +85,21 @@ export const JeecgListMixin = {
       getAction(this.url.list, params).then((res) => {
         if (res.success) {
           if (res.result.records) {
-            var keys = Object.keys(res.result.records[0]).sort()
-            console.log('keys', keys)
-            this.columns.splice(2, this.columns.length)
-            keys.forEach(t => {
-              if (t !== 'layout_name' && t !== 'price_name' && t !== 'id' && t !== 'hotel_name') {
-                this.columns.push({
-                  title: t,
-                  align: "center",
-                  dataIndex: t,
-                  scopedSlots: { customRender: t },
-                })
-              }
-            })
+            if (res.result.records.length > 0) {
+              var keys = Object.keys(res.result.records[0]).sort()
+              console.log('keys', keys)
+              this.columns.splice(3, this.columns.length)
+              keys.forEach(t => {
+                if (t !== 'layout_name' && t !== 'price_name' && t !== 'id' && t !== 'hotel_name' && t !== 'price_id') {
+                  this.columns.push({
+                    title: t,
+                    align: "center",
+                    dataIndex: t,
+                    scopedSlots: { customRender: t },
+                  })
+                }
+              })
+            }
           }
           //update-begin---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
           this.dataSource = res.result.records || res.result;

+ 15 - 1
src/views/orders/roompriceinfo.vue

@@ -163,7 +163,7 @@ import { mixinDevice } from "@/utils/mixin";
 import { JeecgListMixin } from "@/mixins/JeecgListMixin2";
 import { formatDate } from "@/utils/util";
 import EditableCell from "@views/room/modules/checkIn/EditableCell.vue";
-import { httpAction } from "@/api/manage";
+import { httpAction, postAction } from "@/api/manage";
 const hotelInfo = JSON.parse(localStorage.getItem("storeInfo"));
 import moment from "moment";
 const date = new Date();
@@ -244,6 +244,20 @@ export default {
         this.dataSourcea = dataSource;
       }
       console.log("this.dataSource", this.dataSource);
+
+      postAction("/rooms/cesRoomLayoutPriceDate/editPrice", {
+        roomLayoutPriceId: target.price_id,
+        date: key,
+        price: value,
+      })
+        .then((res) => {
+          if (res.success) {
+            this.$message.success(res.message);
+          } else {
+            this.$message.warning(res.message);
+          }
+        })
+        .finally(() => {});
     },
     moment,
     searchQuery() {