瀏覽代碼

Merge branch 'master' of http://49.4.53.36:3000/hotel/hotel-saas-tenant-frontend

gqx 2 年之前
父節點
當前提交
7dab2daf47

+ 5 - 7
src/views/room/modules/checkIn/BillRoomForm.vue

@@ -1827,17 +1827,10 @@ export default {
         ele.editPriceTime = [];
         ele.editPrice = [];
         ele.edit.forEach((t,tdx)=>{
-          // console.log(t.price);
           ele.editPriceTime.push(t.day),
           ele.editPrice.push(t.price)
-          this.onCellChange(
-            "prefPrice",
-            index,
-            ele.edit[tdx].price
-          );
         })
         ele.prefPrice = ele.edit[0].price;
-        
       })
       // this.editPriceData.forEach((ele, index) => {
       //   if (this.model.roomPrices[index].roomId==ele.roomId) {
@@ -2185,6 +2178,11 @@ export default {
         // target.deposit = this.compuleDeposit(value);
         this.model.roomPrices = dataSource;
       }
+      // this.editPriceData.forEach(ele=>{
+      //   if (target.roomId==ele.roomId) {
+      //     ele.deposit = target.deposit
+      //   }
+      // })
 
       var sum = 0;
       var money2 = 0;

+ 212 - 159
src/views/room/modules/checkIn/FeeForm.vue

@@ -1,175 +1,228 @@
 <template>
-  <a-spin :spinning="confirmLoading">
+<a-spin :spinning="confirmLoading">
     <j-form-container :disabled="formDisabled">
-      <a-form-model
-        ref="form"
-        :model="model"
-        :rules="validatorRules"
-        slot="detail"
-      >
-        <a-row>
-          <a-col :span="24">
-            <a-form-model-item
-              label="消费项目"
-              :labelCol="labelCol"
-              :wrapperCol="wrapperCol"
-              prop="subjectType"
-            >
-              <a-select
-                v-model="model.subjectType"
-                style="width: 100%"
-                placeholder="消费项目"
-                :allowClear="true"
-              >
-                <a-select-option :value="1">押金</a-select-option>
-                <a-select-option :value="2">预收房费</a-select-option>
-                <a-select-option :value="3">每日房费</a-select-option>
-                <a-select-option :value="6">商品</a-select-option>
-                <a-select-option :value="7">点餐</a-select-option>
-              </a-select>
-            </a-form-model-item>
-          </a-col>
-          <a-col :span="24">
-            <a-form-model-item
-              label="金额"
-              :labelCol="labelCol"
-              :wrapperCol="wrapperCol"
-              prop="money"
-            >
-              <a-input-number
-                v-model="model.money"
-                placeholder="请输入金额"
-                :min="0"
-              ></a-input-number>
-            </a-form-model-item>
-          </a-col>
-        </a-row>
-      </a-form-model>
+        <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
+            <a-row>
+                <a-col :span="model.subjectType==6? 12: 24">
+                    <a-form-model-item label="消费项目" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="subjectType">
+                        <a-select v-model="model.subjectType" style="width: 100%" placeholder="消费项目" :allowClear="true">
+                            <a-select-option :value="1">押金</a-select-option>
+                            <a-select-option :value="2">预收房费</a-select-option>
+                            <a-select-option :value="3">每日房费</a-select-option>
+                            <a-select-option :value="6">商品</a-select-option>
+                            <a-select-option :value="7">点餐</a-select-option>
+                        </a-select>
+                    </a-form-model-item>
+                    <a-row>
+                        <a-col :span="24">
+                            <a-form-model-item label="金额" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="money">
+                                <a-input-number v-model="model.money" placeholder="请输入金额" :min="0"></a-input-number>
+                            </a-form-model-item>
+                        </a-col>
+                    </a-row>
+                </a-col>
+                <a-col v-if="model.subjectType==6" :span="12">
+                    <a-row>
+                        <a-col :span="24">
+                            <a-space>
+                                <a-input v-model="queryParams.goodsName" placeholder="名称" />
+                                <a-button type="primary">搜索</a-button>
+                            </a-space>
+
+                        </a-col>
+                    </a-row>
+                    <a-table :columns="columns" :dataSource="dataSource" style="margin-top:10px;">
+                      <template slot="price">
+                        <a-input-number :min="0"></a-input-number>
+                      </template>
+                      <template slot="num">
+                        <a-input-number :min="0"></a-input-number>
+                      </template>
+                    </a-table>
+                </a-col>
+            </a-row>
+            <!-- <a-row>
+                <a-col :span="24">
+                    <a-form-model-item label="金额" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="money">
+                        <a-input-number v-model="model.money" placeholder="请输入金额" :min="0"></a-input-number>
+                    </a-form-model-item>
+                </a-col>
+            </a-row> -->
+        </a-form-model>
     </j-form-container>
-  </a-spin>
+</a-spin>
 </template>
 
 <script>
-import { httpAction, getAction } from "@/api/manage";
-import { validateDuplicateValue } from "@/utils/util";
+import {
+    httpAction,
+    getAction
+} from "@/api/manage";
+import {
+    validateDuplicateValue
+} from "@/utils/util";
 
 export default {
-  name: "BusMemberCardForm",
-  components: {},
-  props: {
-    //表单禁用
-    disabled: {
-      type: Boolean,
-      default: false,
-      required: false,
-    },
-    livingOrderId: {
-      type: String,
+    name: "BusMemberCardForm",
+    components: {},
+    props: {
+        //表单禁用
+        disabled: {
+            type: Boolean,
+            default: false,
+            required: false,
+        },
+        livingOrderId: {
+            type: String,
+        },
     },
-  },
-  data() {
-    return {
-      model: { payType: 1, livingOrderId: "", certType: 1, gender: 1 },
-      labelCol: {
-        xs: { span: 24 },
-        sm: { span: 5 },
-      },
-      wrapperCol: {
-        xs: { span: 24 },
-        sm: { span: 16 },
-      },
-      confirmLoading: false,
-      validatorRules: {
-        subjectType: [{ required: true, message: "请输入消费项目!" }],
-        money: [{ required: true, message: "请输入金额!" }],
-      },
-      url: {
-        add: "/business/busRoomBookingOrders/booking-to-live",
-        edit: "/business/busMemberCard/edit",
-        queryById: "/business/busMemberCard/queryById",
-      },
-      gradeList: [],
-      paymentMethodList: [],
-      staffList: [],
-      customerList: [],
-      oldcustomerList: [],
-    };
-  },
-  computed: {
-    formDisabled() {
-      return this.disabled;
+    data() {
+        return {
+          dataSource:[],
+            columns: [{
+                    title: "名称",
+                    align: "center",
+                    dataIndex: "waiter_name",
+                },
+                {
+                    title: "售价",
+                    align: "center",
+                    dataIndex: "price",
+                    scopedSlots: { customRender: 'price' },
+                },
+                {
+                    title: "数量",
+                    align: "center",
+                    dataIndex: "num",
+                    scopedSlots: { customRender: 'num' },
+                },
+                {
+                    title: "剩余库存",
+                    align: "center",
+                    dataIndex: "stock",
+                },
+            ],
+            model: {
+                payType: 1,
+                livingOrderId: "",
+                certType: 1,
+                gender: 1
+            },
+            queryParams: {},
+            labelCol: {
+                xs: {
+                    span: 24
+                },
+                sm: {
+                    span: 5
+                },
+            },
+            wrapperCol: {
+                xs: {
+                    span: 24
+                },
+                sm: {
+                    span: 16
+                },
+            },
+            confirmLoading: false,
+            validatorRules: {
+                subjectType: [{
+                    required: true,
+                    message: "请输入消费项目!"
+                }],
+                money: [{
+                    required: true,
+                    message: "请输入金额!"
+                }],
+            },
+            url: {
+                add: "/business/busRoomBookingOrders/booking-to-live",
+                edit: "/business/busMemberCard/edit",
+                queryById: "/business/busMemberCard/queryById",
+            },
+            gradeList: [],
+            paymentMethodList: [],
+            staffList: [],
+            customerList: [],
+            oldcustomerList: [],
+        };
     },
-  },
-  created() {
-    var _info = JSON.parse(localStorage.getItem("storeInfo"));
-    if (_info) {
-      this.model.hotelId = _info.id;
-    }
-    //备份model原始值
-    this.modelDefault = JSON.parse(JSON.stringify(this.model));
-    this.getbusCustomer();
-  },
-  methods: {
-    handleSearch(value) {
-      let result;
-      if (!value) {
-        result = this.oldcustomerList;
-      } else {
-        result = this.oldcustomerList.filter((t) => t.name.includes(value));
-      }
-      this.customerList = result;
+    computed: {
+        formDisabled() {
+            return this.disabled;
+        },
     },
-    handleSelectMember(e) {
-      var find = this.customerList.find((t) => t.id === e);
-      this.model.phone = find.phone;
-      this.model.customerName = find.name;
-      this.model.customerId = find.id;
-    },
-    getbusCustomer() {
-      getAction("/bus/busCustomer/list", {}).then((res) => {
-        if (res.success) {
-          this.customerList = res.result.records;
-          this.oldcustomerList = JSON.parse(JSON.stringify(this.customerList));
+    created() {
+        var _info = JSON.parse(localStorage.getItem("storeInfo"));
+        if (_info) {
+            this.model.hotelId = _info.id;
         }
-      });
-    },
-    add(livingOrderId, roomId) {
-      this.modelDefault.livingOrderId = livingOrderId;
-      this.modelDefault.roomId = roomId;
-      this.edit(this.modelDefault);
+        //备份model原始值
+        this.modelDefault = JSON.parse(JSON.stringify(this.model));
+        this.getbusCustomer();
     },
-    edit(record) {
-      this.model = Object.assign({}, record);
-      this.visible = true;
-    },
-    submitForm() {
-      const that = this;
-      // 触发表单验证
-      this.$refs.form.validate((valid) => {
-        if (valid) {
-          that.confirmLoading = true;
-          var orders = [];
-          orders.push({
-            money: this.model.money,
-            subjectType: this.model.subjectType,
-          });
-          this.model.orders = orders;
-          this.model.livingOrderId = this.livingOrderId;
-          httpAction("/business/busRoomBookingOrders/set-living-order-fee?livingOrderId="+this.livingOrderId, orders, "post")
-            .then((res) => {
-              if (res.success) {
-                that.$message.success(res.message);
-                that.$emit("ok");
-              } else {
-                that.$message.warning(res.message);
-              }
-            })
-            .finally(() => {
-              that.confirmLoading = false;
+    methods: {
+        handleSearch(value) {
+            let result;
+            if (!value) {
+                result = this.oldcustomerList;
+            } else {
+                result = this.oldcustomerList.filter((t) => t.name.includes(value));
+            }
+            this.customerList = result;
+        },
+        handleSelectMember(e) {
+            var find = this.customerList.find((t) => t.id === e);
+            this.model.phone = find.phone;
+            this.model.customerName = find.name;
+            this.model.customerId = find.id;
+        },
+        getbusCustomer() {
+            getAction("/bus/busCustomer/list", {}).then((res) => {
+                if (res.success) {
+                    this.customerList = res.result.records;
+                    this.oldcustomerList = JSON.parse(JSON.stringify(this.customerList));
+                }
             });
-        }
-      });
+        },
+        add(livingOrderId, roomId) {
+            this.modelDefault.livingOrderId = livingOrderId;
+            this.modelDefault.roomId = roomId;
+            this.edit(this.modelDefault);
+        },
+        edit(record) {
+            this.model = Object.assign({}, record);
+            this.visible = true;
+        },
+        submitForm() {
+            const that = this;
+            // 触发表单验证
+            this.$refs.form.validate((valid) => {
+                if (valid) {
+                    that.confirmLoading = true;
+                    var orders = [];
+                    orders.push({
+                        money: this.model.money,
+                        subjectType: this.model.subjectType,
+                    });
+                    this.model.orders = orders;
+                    this.model.livingOrderId = this.livingOrderId;
+                    httpAction("/business/busRoomBookingOrders/set-living-order-fee?livingOrderId=" + this.livingOrderId, orders, "post")
+                        .then((res) => {
+                            if (res.success) {
+                                that.$message.success(res.message);
+                                that.$emit("ok");
+                            } else {
+                                that.$message.warning(res.message);
+                            }
+                        })
+                        .finally(() => {
+                            that.confirmLoading = false;
+                        });
+                }
+            });
+        },
     },
-  },
 };
-</script>
+</script>

+ 1 - 1
src/views/room/modules/checkIn/FeeModal.vue

@@ -23,7 +23,7 @@
     data () {
       return {
         title:'',
-        width:800,
+        width:1200,
         visible: false,
         disableSubmit: false,
         livingOrderId:''