Ver código fonte

餐券核销

gqx 2 anos atrás
pai
commit
9e172cb3c6

+ 1 - 1
src/views/markets/marketInfo.vue

@@ -33,7 +33,7 @@
         />
         <p>协议单位</p>
       </div>
-      <div class="height-100" @click="toPage()">
+      <div class="height-100" @click="toPage('/tenant/marketinfo/mealcouponsverify')">
         <img
           src="http://oss.qlan99.com/20200529/7a270d9a3a534034ac03c2fdd23139ab.png"
         />

+ 254 - 0
src/views/markets/mealcouponsverify.vue

@@ -0,0 +1,254 @@
+<template>
+  <a-card style="width: 100%; height: 100%">
+    <a-tabs type="card" default-active-key="0" @tabClick="tabClick">
+      <a-tab-pane key="">
+        <span slot="tab"> 全部 </span>
+        <!-- <member-list></member-list> -->
+      </a-tab-pane>
+      <a-tab-pane v-for="(item, index) in mealCouponTypeList" :key="item.value">
+        <span slot="tab">
+          {{ item.label }}
+        </span>
+        <!-- <market-recharge-list></market-recharge-list> -->
+      </a-tab-pane>
+    </a-tabs>
+    <div style="position: absolute; right: 50px; bottom: 120px; z-index: 99999">
+      <a-button
+        type="danger"
+        shape="circle"
+        icon="plus"
+        size="large"
+        @click="handleAdd"
+      />
+    </div>
+    <a-row type="flex">
+      <a-col :span="6" :order="1">
+        <div class="height-100">
+          <p class="header_num">{{ stat.dayCount || 0 }}</p>
+          <span class="header_name">今日总数</span>
+        </div>
+      </a-col>
+      <a-col :span="6" :order="2">
+        <div class="height-100">
+          <p class="header_num">{{ stat.dayUsedCount || 0 }}</p>
+          <span class="header_name">今日已核销</span>
+        </div>
+      </a-col>
+      <a-col :span="6" :order="3">
+        <div class="height-100">
+          <p class="header_num">{{ stat.dayReceivedCount || 0 }}</p>
+          <span class="header_name">今日待核销</span>
+        </div>
+      </a-col>
+      <a-col :span="6" :order="4">
+        <div class="height-100">
+          <p class="header_num">{{ stat.dayVoidedCount || 0 }}</p>
+          <span class="header_name">今日作废</span>
+        </div>
+      </a-col>
+    </a-row>
+    <div style="margin-top: 15px">
+      <a-table
+        ref="table"
+        size="middle"
+        :scroll="{ x: true }"
+        bordered
+        rowKey="id"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading"
+        :rowSelection="{
+          selectedRowKeys: selectedRowKeys,
+          onChange: onSelectChange,
+        }"
+        class="j-table-force-nowrap"
+        @change="handleTableChange"
+      >
+        <template slot="avatar" slot-scope="text">
+          <a-avatar v-if="text" :src="text" />
+          <a-avatar v-else icon="user" />
+        </template>
+        <template slot="imgSlot" slot-scope="text, record">
+          <span v-if="!text" style="font-size: 12px; font-style: italic"
+            >无图片</span
+          >
+          <img
+            v-else
+            :src="getImgView(text)"
+            :preview="record.id"
+            height="25px"
+            alt=""
+            style="max-width: 80px; font-size: 12px; font-style: italic"
+          />
+        </template>
+        <template slot="fileSlot" slot-scope="text">
+          <span v-if="!text" style="font-size: 12px; font-style: italic"
+            >无文件</span
+          >
+          <a-button
+            v-else
+            :ghost="true"
+            type="primary"
+            icon="download"
+            size="small"
+            @click="downloadFile(text)"
+          >
+            下载
+          </a-button>
+        </template>
+
+        <span slot="action" slot-scope="text, record">
+          <a @click="handlePointEdit(record)">积分调整</a>
+          <a-divider type="vertical" />
+          <a @click="handleEdit(record)">编辑</a>
+
+          <a-divider type="vertical" />
+          <a-dropdown>
+            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
+            <a-menu slot="overlay">
+              <a-menu-item>
+                <a @click="handleDetail(record)">详情</a>
+              </a-menu-item>
+              <a-menu-item>
+                <a-popconfirm
+                  title="确定删除吗?"
+                  @confirm="() => handleDelete(record.id)"
+                >
+                  <a>删除</a>
+                </a-popconfirm>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown>
+        </span>
+      </a-table>
+    </div>
+    <bus-market-meal-coupons-used-verify-modal
+      ref="modalMarketMealCouponsUsedVerifyModal"
+      @fatherLoadData="fatherLoadData"
+    ></bus-market-meal-coupons-used-verify-modal>
+  </a-card>
+</template>
+
+<script>
+import BusMarketMealCouponsUsedVerifyModal from "./modules/mealCoupons/BusMarketMealCouponsUsedVerifyModal.vue";
+import { httpAction, getAction } from "@/api/manage";
+import { mixinDevice } from "@/utils/mixin";
+import { JeecgListMixin } from "@/mixins/JeecgListMixin";
+const hotelInfo = JSON.parse(localStorage.getItem("storeInfo"));
+export default {
+  mixins: [JeecgListMixin, mixinDevice],
+  components: {
+    BusMarketMealCouponsUsedVerifyModal,
+  },
+  data() {
+    return {
+      mealCouponTypeList: [],
+      description: "餐券核销页面",
+      // 表头
+      columns: [
+        {
+          title: "餐券名称",
+          align: "center",
+          dataIndex: "couponsName",
+        },
+        {
+          title: "餐券类型",
+          align: "center",
+          dataIndex: "typeName",
+        },
+        {
+          title: "券号",
+          align: "center",
+          dataIndex: "code",
+        },
+        {
+          title: "房间号",
+          align: "center",
+          dataIndex: "roomNumber",
+        },
+        {
+          title: "核销人",
+          align: "center",
+          dataIndex: "usedUserName",
+        },
+        {
+          title: "核销时间",
+          align: "center",
+          dataIndex: "usedTime",
+        },
+      ],
+      url: {
+        list: "/business/busMarketMealCouponsUsed/verifyList",
+        delete: "/business/busMarketMealCouponsUsed/delete",
+        deleteBatch: "/business/busMarketMealCouponsUsed/deleteBatch",
+        exportXlsUrl: "/business/busMarketMealCouponsUsed/exportXls",
+        importExcelUrl: "business/busMarketMealCouponsUsed/importExcel",
+      },
+      dictOptions: {},
+      superFieldList: [],
+      stat: {},
+    };
+  },
+  created() {
+    httpAction(
+      "/rooms/cesMealCoupon/fetch",
+      { hotelId: hotelInfo.id },
+      "get"
+    ).then((res) => {
+      if (res.success) {
+        this.mealCouponTypeList = res.result;
+      }
+    });
+    this.getStat();
+  },
+  methods: {
+    getStat() {
+      console.log("this.queryParam.type",this.queryParam.type)
+      getAction(
+        "/business/busMarketMealCouponsUsed/stat",
+        { hotelId: hotelInfo.id, type: this.queryParam.type }
+      ).then((res) => {
+        if (res.success) {
+          this.stat = res.result;
+        }
+      });
+    },
+    tabClick(e) {
+      console.log(e);
+      this.queryParam.type = e;
+      this.loadData();
+      this.getStat();
+    },
+    handleAdd() {
+      this.$refs.modalMarketMealCouponsUsedVerifyModal.visible = true;
+      this.$refs.modalMarketMealCouponsUsedVerifyModal.title = "详情";
+      this.$refs.modalMarketMealCouponsUsedVerifyModal.disableSubmit = true;
+      this.$refs.modalMarketMealCouponsUsedVerifyModal.add();
+    },
+    fatherLoadData() {
+      console.log(2);
+      this.loadData();
+    },
+  },
+};
+</script>
+
+<style scoped>
+.main {
+  height: 70% !important;
+}
+.height-100 {
+  padding: 2px;
+  border: 1px solid #d8d8d8;
+  text-align: center;
+}
+.header_num {
+  font-size: 24px;
+  color: #5197ee;
+  font-weight: bold;
+}
+.header_name {
+  font-size: 17px;
+}
+</style>

+ 276 - 0
src/views/markets/modules/mealCoupons/BusMarketMealCouponsUsedVerify.vue

@@ -0,0 +1,276 @@
+<template>
+  <a-card :bordered="false">
+    <!-- 查询区域 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="searchQuery">
+        <a-row :gutter="24">
+          <a-col :span="6">
+            <a-form-item label="">
+              <a-input placeholder="房间号" v-model="queryParam.roomNumber"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="8">
+            <span
+              style="float: left; overflow: hidden"
+              class="table-page-search-submitButtons"
+            >
+              <a-button type="primary" @click="searchQuery" icon="search"
+                >查询</a-button
+              >
+              <a-button
+                type="primary"
+                @click="searchReset"
+                icon="reload"
+                style="margin-left: 8px"
+                >重置</a-button
+              >
+            </span>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 查询区域-END -->
+
+    <!-- table区域-begin -->
+    <div>
+      <a-table
+        ref="table"
+        size="middle"
+        :scroll="{ x: true }"
+        bordered
+        rowKey="id"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading"
+        :rowSelection="{
+          selectedRowKeys: selectedRowKeys,
+          onChange: onSelectChange,
+        }"
+        class="j-table-force-nowrap"
+        @change="handleTableChange"
+      >
+        <template slot="htmlSlot" slot-scope="text">
+          <div v-html="text"></div>
+        </template>
+        <template slot="imgSlot" slot-scope="text, record">
+          <span v-if="!text" style="font-size: 12px; font-style: italic"
+            >无图片</span
+          >
+          <img
+            v-else
+            :src="getImgView(text)"
+            :preview="record.id"
+            height="25px"
+            alt=""
+            style="max-width: 80px; font-size: 12px; font-style: italic"
+          />
+        </template>
+        <template slot="fileSlot" slot-scope="text">
+          <span v-if="!text" style="font-size: 12px; font-style: italic"
+            >无文件</span
+          >
+          <a-button
+            v-else
+            :ghost="true"
+            type="primary"
+            icon="download"
+            size="small"
+            @click="downloadFile(text)"
+          >
+            下载
+          </a-button>
+        </template>
+
+        <span slot="action" slot-scope="text, record">
+          <a @click="handleEdit(record)"
+            >核销</a
+          >
+        </span>
+      </a-table>
+    </div>
+
+    <!-- <bus-market-meal-coupons-generate-form-modal
+      ref="modalForm"
+      @ok="modalFormOk"
+    ></bus-market-meal-coupons-generate-form-modal> -->
+  </a-card>
+</template>
+
+<script>
+import "@/assets/less/TableExpand.less";
+import { mixinDevice } from "@/utils/mixin";
+import { JeecgListMixin } from "@/mixins/JeecgListMixin";
+// import BusMarketMealCouponsGenerateFormModal from "./BusMarketMealCouponsGenerateFormModal";
+import { httpAction, getAction } from "@/api/manage";
+
+export default {
+  name: "BusMarketCouponsUsedList",
+  mixins: [JeecgListMixin, mixinDevice],
+  components: {
+    // BusMarketMealCouponsGenerateFormModal,
+  },
+  props: {
+    couponsId: {
+      type: String,
+      default: "",
+    },
+  },
+  data() {
+    return {
+      description: "餐券领取使用表管理页面",
+      // 表头
+      columns: [
+        {
+          title: "券号",
+          align: "center",
+          dataIndex: "code",
+        },
+        {
+          title: "餐券名称",
+          align: "center",
+          dataIndex: "conponsName",
+        },
+        {
+          title: "金额",
+          align: "center",
+          dataIndex: "cost",
+        },
+        {
+          title: "房间号",
+          align: "center",
+          dataIndex: "roomNumber",
+        },
+        {
+          title: "操作",
+          dataIndex: "action",
+          align: "center",
+          fixed: "right",
+          width: 80,
+          scopedSlots: { customRender: "action" },
+        },
+      ],
+      url: {
+        list: "/business/busMarketMealCouponsUsed/list?status=1",
+        delete: "/business/busMarketMealCouponsUsed/delete",
+        deleteBatch: "/business/busMarketMealCouponsUsed/deleteBatch",
+        exportXlsUrl: "/business/busMarketMealCouponsUsed/exportXls",
+        importExcelUrl: "business/busMarketMealCouponsUsed/importExcel",
+      },
+      dictOptions: {},
+      superFieldList: [],
+    };
+  },
+  created() {
+    this.getSuperFieldList();
+  },
+  computed: {
+    importExcelUrl: function () {
+      return `${window._CONFIG["domianURL"]}/${this.url.importExcelUrl}`;
+    },
+  },
+  methods: {
+    handleEdit(item) {
+      var that = this;
+      this.$confirm({
+        title: "确认核销",
+        content: "是否核销?",
+        onOk: function () {
+          httpAction(
+            "/business/busMarketMealCouponsUsed/verify",
+            { id: item.id },
+            "post"
+          )
+            .then((res) => {
+              if (res.success) {
+                that.$message.success(res.message);
+                that.reCalculatePage(1)
+                that.loadData();
+                that.$emit('fatherLoadData');
+              } else {
+                that.$message.warning(res.message);
+              }
+            })
+            .finally(() => {});
+        },
+        onCancel: function () {},
+      });
+    },
+    initDictConfig() {},
+    getSuperFieldList() {
+      let fieldList = [];
+      fieldList.push({
+        type: "string",
+        value: "tenantId",
+        text: "关联租户",
+        dictCode: "",
+      });
+      fieldList.push({
+        type: "string",
+        value: "hotelId",
+        text: "关联酒店",
+        dictCode: "",
+      });
+      fieldList.push({
+        type: "string",
+        value: "couponsId",
+        text: "餐券id",
+        dictCode: "",
+      });
+      fieldList.push({
+        type: "string",
+        value: "code",
+        text: "券号",
+        dictCode: "",
+      });
+      fieldList.push({
+        type: "int",
+        value: "status",
+        text: "状态 0未领取 1已领取 2已使用 3已作废",
+        dictCode: "",
+      });
+      fieldList.push({
+        type: "string",
+        value: "userid",
+        text: "会员id",
+        dictCode: "",
+      });
+      fieldList.push({
+        type: "string",
+        value: "userName",
+        text: "姓名",
+        dictCode: "",
+      });
+      fieldList.push({
+        type: "string",
+        value: "roomNumber",
+        text: "房间号",
+        dictCode: "",
+      });
+      fieldList.push({
+        type: "string",
+        value: "checkedInNo",
+        text: "入住单号",
+        dictCode: "",
+      });
+      fieldList.push({
+        type: "string",
+        value: "mobile",
+        text: "手机号",
+        dictCode: "",
+      });
+      fieldList.push({ type: "date", value: "gainTime", text: "领取时间" });
+      fieldList.push({ type: "date", value: "usedTime", text: "使用时间" });
+      this.superFieldList = fieldList;
+    },
+    handleAdd() {
+      this.$refs.modalForm.add(this.ipagination.total, this.couponsId);
+      this.$refs.modalForm.title = "优惠券生成";
+      this.$refs.modalForm.disableSubmit = false;
+    },
+  },
+};
+</script>
+<style scoped>
+@import "~@assets/less/common.less";
+</style>

+ 71 - 0
src/views/markets/modules/mealCoupons/BusMarketMealCouponsUsedVerifyModal.vue

@@ -0,0 +1,71 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }"
+    @cancel="handleCancel"
+    cancelText="关闭"
+  >
+    <bus-market-meal-coupons-used-verify
+      @fatherLoadData="fatherLoadData"
+      ref="modalMarketMealCouponsUsedVerifyModal"
+    ></bus-market-meal-coupons-used-verify>
+  </j-modal>
+</template>
+
+<script>
+import BusMarketMealCouponsUsedVerify from "./BusMarketMealCouponsUsedVerify";
+export default {
+  name: "BusMarketCouponsCashUsedListModal",
+  components: {
+    BusMarketMealCouponsUsedVerify,
+  },
+  props: {
+    couponsId: {
+      type: String,
+      default: "",
+    },
+  },
+  data() {
+    return {
+      title: "",
+      width: 1200,
+      visible: false,
+      disableSubmit: false,
+      // eventId:'',
+    };
+  },
+  methods: {
+    fatherLoadData() {
+      console.log(1)
+      this.$emit("fatherLoadData");
+    },
+    add() {
+      this.visible = true;
+    },
+    edit(record) {
+      this.visible = true;
+      this.$nextTick(() => {
+        this.$refs.modalMarketMealCouponsUsedVerifyModal.edit(record);
+      });
+    },
+    close() {
+      this.$emit("close");
+      this.visible = false;
+    },
+    handleOk() {
+      this.$refs.modalMarketMealCouponsUsedVerifyModal.submitForm();
+    },
+    submitCallback() {
+      this.$emit("ok");
+      this.visible = false;
+    },
+    handleCancel() {
+      this.close();
+    },
+  },
+};
+</script>