Browse Source

2024.09.04
- 财务明细页更改页面结构样式,提现增加查询可提现金额并赋值逻辑;
- 完成打印机列表页,对接打印机模块相关接口;

zweiqin 7 months ago
parent
commit
583a928142

+ 46 - 0
src/api/mealManagement/printerList.js

@@ -0,0 +1,46 @@
+import request from '@/utils/request'
+
+// 打印机(分页)列表
+export function getPageAllShopLaPrinter(data) {
+  return request({
+    url: '/shopLaPrinter/getPageAll',
+    method: 'post',
+    data
+  })
+}
+
+// 新增打印机
+export function savePostShopLaPrinter(data) {
+  return request({
+    url: '/shopLaPrinter/addPrinter',
+    method: 'post',
+    data
+  })
+}
+
+// 修改打印机
+export function updatePostShopLaPrinter(data) {
+  return request({
+    url: '/shopLaPrinter/updatePrinter',
+    method: 'post',
+    data
+  })
+}
+
+// 打印机详情
+export function detailPostShopLaPrinter(params) {
+  return request({
+    url: '/shopLaPrinter/detailPrinter',
+    method: 'get',
+    params
+  })
+}
+
+// 打印机删除
+export function deletePostShopLaPrinter(params) {
+  return request({
+    url: '/shopLaPrinter/deletePrinter',
+    method: 'get',
+    params
+  })
+}

+ 18 - 0
src/api/voucherManagement/voucherOperation.js

@@ -45,6 +45,24 @@ export function updateTransferExchangeShopVoucher(data) {
   })
 }
 
+// 商家充值代金券:商家转用户转账操作
+export function orderShopToUserTransferVoucher(params) {
+  return request({
+    url: '/shopVoucherEntryRecord/orderShopToUserTransfer',
+    method: 'get',
+    params
+  })
+}
+
+// 商家兑换代金券:商家转用户转账操作
+export function shopToUserTransferVoucher(params) {
+  return request({
+    url: '/shopVoucherEntryRecord/shopToUserTransfer',
+    method: 'get',
+    params
+  })
+}
+
 // 代金券购买提交订单
 export function submitShopVoucherEntryRecord(data) {
   return request({

+ 3 - 0
src/views/customer/customerList/components/VoucherTransfer.vue

@@ -59,6 +59,9 @@ export default {
         voucherType: '1',
         buyerUserId: '',
         number: ''
+        // phone: '',
+        // value: '',
+        // voucherId: ''
       },
       formRules: {
         voucherType: [ { required: true, message: '请选择代金券类型' } ],

+ 142 - 134
src/views/finance/list/index.vue

@@ -1,6 +1,38 @@
 <template>
   <div class="app-container">
-    <!-- 顶部卡片 -->
+    <!-- 查询和其他操作 -->
+    <div class="filter-container">
+      <el-select
+        v-model="listQuery.condition" size="mini" class="filter-item"
+        style="width: 200px;" placeholder="请选择汇款类型"
+      >
+        <el-option label="日汇款" value="1" />
+        <el-option label="月汇款" value="2" />
+      </el-select>
+      <el-select
+        v-model="listQuery.paymentMode" size="mini" class="filter-item"
+        style="width: 200px;margin-left: 10px;" placeholder="请选择类型"
+      >
+        <el-option label="普通订单" :value="1" />
+        <el-option label="消费金" :value="2" />
+        <el-option label="代金券" :value="3" />
+        <el-option label="余额" :value="4" />
+        <el-option label="佣金" :value="5" />
+      </el-select>
+      <el-date-picker
+        v-model="listQuery.time" type="month" placeholder="选择日期" size="mini"
+        class="filter-item" value-format="yyyy-MM"
+        style="margin-left: 10px;line-height: 1;"
+      />
+      <el-button
+        size="mini" class="filter-item" type="primary" icon="el-icon-search"
+        style="margin-left:10px;"
+        @click="getList"
+      >
+        查找
+      </el-button>
+    </div>
+
     <div>
       <el-card>
         <div slot="header">
@@ -14,6 +46,7 @@
             <el-button type="primary" @click="handleWithdrawal">提现</el-button>
           </div>
         </div>
+
         <div>
           <div style="font-size: 18px;font-weight: bold;">基本数据</div>
           <div style="display: flex;justify-content: space-around;align-items: center;text-align: center;">
@@ -31,6 +64,12 @@
             </div>
             <div style="padding: 8px;">
               <div style="font-size: 30px;font-weight: bold;color: #ffae11;margin-bottom: 6px;">
+                {{ financialData.alreadyArrived || '0' }}
+              </div>
+              <div style="font-size: 16px;color: #333333;">已提现金额</div>
+            </div>
+            <div style="padding: 8px;">
+              <div style="font-size: 30px;font-weight: bold;color: #ffae11;margin-bottom: 6px;">
                 {{ financialData.withdrawableMoney || '0' }}
               </div>
               <div style="font-size: 16px;color: #333333;">可提现金额(元)</div>
@@ -50,7 +89,9 @@
           </div>
         </div>
         <div>
-          <div class="correlation" style="font-size: 18px;font-weight: bold;">
+          <div
+            style="display: flex;align-items: center;padding: 10px 0px;font-size: 18px;font-weight: bold;"
+          >
             <span>消费金相关</span>
             <el-tooltip placement="top" effect="light">
               <div slot="content" style="font-size: 18px;">
@@ -59,7 +100,7 @@
                 可提现:客户已支付已核销订单的消费金可提现金额(按照提现比例折算);<br />
                 待到账冻结:客户已支付未核销订单的消费金支付金额;<br />
               </div>
-              <div class="icon">
+              <div style="color: rgb(255, 174, 17);">
                 <i class="el-icon-warning-outline" :size="34"></i>
               </div>
             </el-tooltip>
@@ -99,7 +140,9 @@
         </div>
         <div>
           <div style="font-size: 18px;font-weight: bold;">代金券相关</div>
-          <div style="display: flex;justify-content: space-around;align-items: center;flex-wrap: wrap;text-align: center;">
+          <div
+            style="display: flex;justify-content: space-around;align-items: center;flex-wrap: wrap;text-align: center;"
+          >
             <div style="padding: 8px;">
               <div style="font-size: 30px;font-weight: bold;color: #ffae11;margin-bottom: 6px;">
                 {{ financialData.voucherTurnover || '0' }}
@@ -147,7 +190,9 @@
         </div>
         <div>
           <div style="font-size: 18px;font-weight: bold;">余额相关</div>
-          <div style="display: flex;justify-content: space-around;align-items: center;flex-wrap: wrap;text-align: center;">
+          <div
+            style="display: flex;justify-content: space-around;align-items: center;flex-wrap: wrap;text-align: center;"
+          >
             <div style="padding: 8px;">
               <div style="font-size: 30px;font-weight: bold;color: #ffae11;margin-bottom: 6px;">
                 {{ financialData.rechargeTurnover || '0' }}
@@ -183,80 +228,52 @@
       </el-card>
     </div>
     <!-- 选项卡 -->
-    <div style="position: relative;">
-      <div style="position: absolute;top: 6px;right: 20px;z-index: 999;">
-        <el-select
-          v-model="listQuery.paymentMode" size="mini" class="filter-item"
-          style="width: 200px;margin-left: 10px;" placeholder="请选择类型"
-          @change="getList()"
-        >
-          <el-option label="普通订单" value="1" />
-          <el-option label="消费金" value="2" />
-          <el-option label="代金券" value="3" />
-          <el-option label="余额" value="4" />
-        </el-select>
-        <el-date-picker
-          v-model="listQuery.time" type="month" placeholder="选择日期" size="mini"
-          style="margin-left: 10px;line-height: 1;" value-format="yyyy-MM"
-          @change="getList()"
-        />
-      </div>
-      <el-tabs v-model="listQuery.condition" @tab-click="getList()">
-        <el-tab-pane label="日汇款" name="1" />
-        <el-tab-pane label="月汇款" name="2" />
-        <!-- <el-tab-pane label="交易金流水" name="3" /> -->
-      </el-tabs>
-      <div>
-        <el-table
-          ref="multipleTable" :data="financialData.finances" border
-          :header-cell-style="{ background: '#EEF3FF', color: '#333333' }" tooltip-effect="dark" style="width: 100%"
-        >
-          <el-table-column label="日期" width="220">
-            <template slot-scope="scope">{{ scope.row.time }}</template>
-          </el-table-column>
-          <el-table-column prop="income" label="收入(元)" width="220" />
-          <el-table-column prop="expenditure" label="支出(元)" show-overflow-tooltip />
-          <el-table-column label="操作" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <div class="btnList">
-                <el-button type="text" @click="seeMore(scope.row)">查看</el-button>
-              </div>
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
+    <div>
+      <el-table
+        ref="multipleTable" :data="financialData.finances" border
+        :header-cell-style="{ background: '#EEF3FF', color: '#333333' }" tooltip-effect="dark" style="width: 100%"
+      >
+        <el-table-column label="日期" width="220">
+          <template slot-scope="scope">{{ scope.row.time }}</template>
+        </el-table-column>
+        <el-table-column prop="income" label="收入(元)" width="220" />
+        <el-table-column prop="expenditure" label="支出(元)" show-overflow-tooltip />
+        <el-table-column label="操作" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <div class="btnList">
+              <el-button type="text" @click="seeMore(scope.row)">查看</el-button>
+            </div>
+          </template>
+        </el-table-column>
+      </el-table>
     </div>
 
     <el-dialog title="提现" :visible.sync="isVisible" width="50%">
+      <p style="margin-left: 50px;">
+        <span>提现至:</span>
+        <span v-if="Number(privacyTime) === 0">
+          {{ bankDetails.bankCard &&
+            bankDetails.bankCard.replace(/\s/g, '')
+              .replace(/(\d{4})\d+(\d{4})$/, "$1 **** **** $2") }}
+        </span>
+        <span v-else>{{ bankDetails.bankCard }}</span>
+        <span style="margin-left: 40px;">{{ bankDetails.bankName }}</span>
+      </p>
       <el-form v-if="show" ref="formData" :model="formData" label-width="120px" size="small" :rules="rules">
-        <p class="text_tip">
-          <span>提现至:</span>
-          <span v-if="Number(privacyTime) === 0">
-            {{ bankDetails.bankCard &&
-              bankDetails.bankCard.replace(/\s/g, '')
-                .replace(/(\d{4})\d+(\d{4})$/, "$1 **** **** $2") }}
-          </span>
-          <span v-else>{{ bankDetails.bankCard }}</span>
-          <span style="margin-left: 40px;">{{ bankDetails.bankName }}</span>
-        </p>
         <el-form-item label="提现类型" prop="withdrawalType">
-          <el-radio-group v-model="formData.withdrawalType">
-            <el-radio :label="1">正常支付订单</el-radio>
-            <el-radio :label="2">交易金</el-radio>
+          <el-radio-group v-model="formData.withdrawalType" @input="handleWithdrawalSearch">
+            <el-radio :label="1">普通订单</el-radio>
+            <el-radio :label="2">消费金</el-radio>
             <el-radio :label="3">代金券</el-radio>
-            <el-radio :label="4">平台余额</el-radio>
+            <el-radio :label="4">余额</el-radio>
+            <el-radio :label="5">佣金</el-radio>
           </el-radio-group>
         </el-form-item>
         <el-form-item label="提现金额" prop="withdrawalMoney">
-          <el-col :span="16">
-            <el-input
-              v-model="formData.withdrawalMoney" maxlength="9"
-              :placeholder="`可提现金额:${formData.withdrawalType === 1 ? financialData.withdrawableMoney : formData.withdrawalType === 2 ? financialData.beeWithdrawal : '--'}`"
-            />
-          </el-col>
-          <el-col :span="6" style="text-align:center">
-            <el-button type="warning" @click="getAllwithdrawalAmount">全部提现</el-button>
-          </el-col>
+          <el-input
+            v-model="formData.withdrawalMoney" maxlength="9" disabled
+            placeholder="请输入提现金额(只能全部提现)"
+          />
         </el-form-item>
       </el-form>
       <p v-else class="tips">您的账户尚未绑定银行卡,无法提现</p>
@@ -336,11 +353,16 @@ export default {
   name: 'List',
   data() {
     return {
-      moneydio: false,
+      listQuery: {
+        condition: '1', // 时间条件 1-日汇总 2-月汇总
+        time: '', // 时间值
+        paymentMode: 1
+      },
       financialData: {
         finances: [],
         turnover: 0,
         frozenMoney: 0,
+        alreadyArrived: 0,
         withdrawableMoney: 0,
         withdrawableStayMoney: 0,
         presenterVoucher: 0,
@@ -364,10 +386,21 @@ export default {
         presenterRechargeVoucher: 0, // 余额赠送代金券
         ordersForRechargeWithdrawal: [] // 余额支付金额(可提现)的相关订单
       },
+
+      privacyTime: 0,
       formData: {
-        withdrawalType: 1,
+        withdrawalType: '',
         withdrawalMoney: ''
       },
+      rules: {
+        withdrawalType: [ { required: true, message: '请选择提现类型', trigger: 'blur' } ],
+        withdrawalMoney: [ { required: true, message: '请输入提现金额', trigger: 'blur' } ]
+      },
+      isVisible: false,
+      show: false,
+      bankDetails: {},
+
+      moneydio: false,
       moneyForm: {
         time: '',
         income: '',
@@ -375,22 +408,8 @@ export default {
         page: 1,
         pageSize: 10
       },
-      total: 1,
-      rules: {
-        withdrawalType: [ { required: true, message: '请选择提现类型', trigger: 'blur' } ],
-        withdrawalMoney: [ { required: true, message: '请输入提现金额', trigger: 'blur' } ]
-      },
-      listQuery: {
-        condition: '1', // 时间条件 1-日汇总 2-月汇总
-        time: '', // 时间值
-        // paymentMode:4
-        paymentMode: '1'
-      },
       tableDatas: [],
-      isVisible: false,
-      bankDetails: {},
-      show: false,
-      privacyTime: 0
+      total: 0
     }
   },
   created() {
@@ -398,17 +417,20 @@ export default {
     this.getList()
   },
   methods: {
-    seeMore(row) {
-      this.moneydio = true
-      this.moneyForm.time = row.time
-      this.moneyForm.page = 1
-      this.total = 1
-      this.tableDatas = []
-      this.getInfo()
+    async getList() {
+      const loading = this.$loading({ text: '加载中' })
+      try {
+        const res = await getFinanceCount(this.listQuery)
+        this.financialData = res.data
+      } finally {
+        loading.close()
+      }
     },
+
     // 提现
     async handleWithdrawal() {
       this.isVisible = true
+      this.formData.withdrawalType = this.listQuery.paymentMode
       this.formData.withdrawalMoney = ''
       // const res = await getWithdrawalDetails(this.listQuery);
       const res = await getBank({})
@@ -417,23 +439,18 @@ export default {
       } else {
         this.show = true
         this.bankDetails = res.data
+        this.handleWithdrawalSearch(this.formData.withdrawalType)
       }
     },
     // 提现确定
     async handleConfirm() {
       if (this.show) {
         if (this.formData.withdrawalMoney <= 0) {
-          this.$message({
-            message: '请输入正确的提现金额',
-            type: 'warning'
-          })
+          this.$message({ message: '请输入正确的提现金额', type: 'warning' })
           return false
         }
         if (!this.formData.withdrawalType) {
-          this.$message({
-            message: '请选择提现类型',
-            type: 'warning'
-          })
+          this.$message({ message: '请选择提现类型', type: 'warning' })
           return false
         }
         const res = await withdrawal({
@@ -445,13 +462,8 @@ export default {
           withdrawalType: this.formData.withdrawalType, // 提现类型
           withdrawalMoney: this.formData.withdrawalMoney // 提现金额
         })
-        if (res.code === '') {
-          this.$message({
-            message: '成功',
-            type: 'success'
-          })
-          this.isVisible = false
-        }
+        this.$message({ message: '成功', type: 'success' })
+        this.isVisible = false
       } else {
         this.isVisible = false
         this.$router.push({
@@ -459,18 +471,23 @@ export default {
         })
       }
     },
-    // 全部提现
-    getAllwithdrawalAmount() {
-      if (this.formData.withdrawalType === 1) {
-        this.formData.withdrawalMoney = this.financialData.withdrawableMoney || 0
-      } else if (this.formData.withdrawalType === 2) {
-        this.formData.withdrawalMoney = this.financialData.beeWithdrawal || 0
+    async handleWithdrawalSearch(e) {
+      const loading = this.$loading({ text: '加载中' })
+      try {
+        const res = await getFinanceCount({ condition: '1', time: '', paymentMode: e })
+        this.formData.withdrawalMoney = res.data.withdrawableMoney
+      } finally {
+        loading.close()
       }
     },
-    // 初始化查询所有数据
-    async getList() {
-      const res = await getFinanceCount(this.listQuery)
-      this.financialData = res.data
+
+    seeMore(row) {
+      this.moneydio = true
+      this.moneyForm.time = row.time
+      this.moneyForm.page = 1
+      this.total = 0
+      this.tableDatas = []
+      this.getInfo()
     },
     // 查询明细
     async getInfo() {
@@ -487,22 +504,13 @@ export default {
 	padding: 20px;
 	display: flex;
 	flex-direction: column;
-}
-
-.text_tip {
-	margin-left: 50px;
-}
-
-.correlation {
-	display: flex;
-	align-items: center;
-	gap: 10px;
-	padding: 10px 0px;
 
-	.icon {
-		color: rgb(255, 174, 17);
-		font-size: 24px;
-		cursor: pointer;
+	.filter-container {
+		.filter-item {
+			display: inline-block;
+			vertical-align: middle;
+			margin-bottom: 10px;
+		}
 	}
 }
 </style>

+ 121 - 0
src/views/mealManagement/printerList/components/DetailModal.vue

@@ -0,0 +1,121 @@
+<template>
+  <el-dialog
+    :visible.sync="visible"
+    v-bind="modalOptions"
+  >
+    <el-form
+      ref="formData"
+      :model="formData"
+      size="mini"
+      label-position="left"
+      label-suffix=":"
+      label-width="200px"
+    >
+      <!-- 区域信息 -->
+      <el-form-item label="设备ID" prop="id">
+        {{ formData.id || '--' }}
+      </el-form-item>
+      <el-form-item label="商家ID" prop="aid">
+        {{ formData.aid || '--' }}
+      </el-form-item>
+      <el-form-item label="设备名称" prop="name">
+        {{ formData.name || '--' }}
+      </el-form-item>
+      <el-form-item label="设备类型" prop="type">
+        <span v-if="formData.type === 1">文鼎创</span>
+        <span v-else>--</span>
+      </el-form-item>
+      <el-form-item label="编号" prop="finalNumber">
+        {{ formData.finalNumber || '--' }}
+      </el-form-item>
+      <el-form-item label="秘钥" prop="secret">
+        {{ formData.secret || '--' }}
+      </el-form-item>
+      <el-form-item label="小票模板" prop="mode">
+        <span v-if="formData.mode === 1">模版1</span>
+        <span v-else>--</span>
+      </el-form-item>
+      <el-form-item label="状态" prop="isDelete">
+        <span v-if="formData.isDelete === 1">启用</span>
+        <span v-else-if="formData.isDelete === 2">禁用</span>
+        <span v-else>--</span>
+      </el-form-item>
+      <el-form-item label="是否删除" prop="isDelete">
+        <span v-if="formData.isDelete === 0">否</span>
+        <span v-else-if="formData.isDelete === 1">是</span>
+        <span v-else>--</span>
+      </el-form-item>
+      <el-form-item label="创建时间" prop="createTime">
+        {{ formData.createTime || '--' }}
+      </el-form-item>
+      <el-form-item label="更新时间" prop="deleteTime">
+        {{ formData.deleteTime || '--' }}
+      </el-form-item>
+    </el-form>
+  </el-dialog>
+</template>
+
+<script>
+import { detailPostShopLaPrinter } from '@/api/mealManagement/printerList'
+
+export default {
+  name: 'DetailModal',
+  data() {
+    return {
+      modalOptions: {
+        closeOnClickModal: false,
+        width: '800px',
+        title: '查看设备详情'
+      },
+      visible: false,
+      formData: {
+        id: '',
+        aid: '',
+        name: '',
+        type: '',
+        finalNumber: '',
+        secret: '',
+        mode: '',
+        status: '',
+        isDelete: '',
+        createTime: '',
+        deleteTime: ''
+      }
+    }
+  },
+  methods: {
+    handleClose() {
+      this.visible = false
+    },
+    handleOpen(params = {}) {
+      this.formData = Object.assign(this.$options.data().formData, params)
+      if (params.id) {
+        this.getInfo(params.id)
+      }
+      this.visible = true
+    },
+    async getInfo(id) {
+      const loading = this.$loading({ text: '加载中' })
+      try {
+        const res = await detailPostShopLaPrinter({ id })
+        this.formData = Object.assign(this.$options.data().formData, res.data, {
+          id: res.data.id || '',
+          aid: res.data.aid || '',
+          name: res.data.name || '',
+          type: res.data.type,
+          finalNumber: res.data.finalNumber || '',
+          secret: res.data.secret || '',
+          mode: res.data.mode,
+          status: res.data.status,
+          isDelete: res.data.isDelete,
+          createTime: res.data.createTime || '',
+          deleteTime: res.data.deleteTime || ''
+        })
+      } finally {
+        loading.close()
+      }
+    }
+  }
+}
+</script>
+

+ 159 - 0
src/views/mealManagement/printerList/components/EditModal.vue

@@ -0,0 +1,159 @@
+<template>
+  <el-dialog
+    :visible.sync="visible"
+    v-bind="modalOptions"
+  >
+    <el-form
+      ref="formData"
+      :model="formData"
+      :rules="formRules"
+      size="mini"
+      label-suffix=":"
+      label-width="150px"
+    >
+      <el-form-item label="设备名称" prop="name">
+        <el-input v-model="formData.name" placeholder="请输入设备名称" maxlength="30" show-word-limit />
+      </el-form-item>
+      <el-form-item label="设备类型" prop="type">
+        <el-select v-model="formData.type" size="mini" placeholder="请选择设备类型">
+          <el-option label="文鼎创" :value="1" />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="编号" prop="finalNumber">
+        <el-input v-model="formData.finalNumber" placeholder="请输入编号" />
+      </el-form-item>
+      <el-form-item label="秘钥" prop="secret">
+        <el-input v-model="formData.secret" placeholder="请输入秘钥" />
+      </el-form-item>
+      <el-form-item label="小票模板" prop="mode">
+        <el-select v-model="formData.mode" size="mini" placeholder="请选择小票模板">
+          <el-option label="模版1" :value="1" />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="状态" prop="status">
+        <el-select v-model="formData.status" size="mini" placeholder="请选择状态">
+          <el-option label="启用" :value="1" />
+          <el-option label="禁用" :value="2" />
+        </el-select>
+      </el-form-item>
+    </el-form>
+    <span slot="footer" class="dialog-footer">
+      <el-button size="mini" @click="handleClose">取 消</el-button>
+      <el-button type="primary" size="mini" @click="handleSubmit">确 定</el-button>
+    </span>
+  </el-dialog>
+</template>
+
+<script>
+import { detailPostShopLaPrinter, savePostShopLaPrinter, updatePostShopLaPrinter } from '@/api/mealManagement/printerList'
+
+export default {
+  name: 'EditModal',
+  components: {
+  },
+  data() {
+    return {
+      modalOptions: {
+        closeOnClickModal: false,
+        width: '820px',
+        title: ''
+      },
+      visible: false,
+      formData: {
+        id: '',
+        // aid: '',
+        name: '',
+        type: '',
+        finalNumber: '',
+        secret: '',
+        mode: '',
+        status: ''
+      },
+      formRules: {
+        name: [
+          { required: true, message: '请输入设备名称' }
+        ],
+        type: [
+          { required: true, message: '请选择设备类型' }
+        ],
+        finalNumber: [
+          { required: true, message: '请输入编号' }
+        ],
+        secret: [
+          { required: false, message: '请输入秘钥' }
+        ],
+        mode: [
+          { required: true, message: '请选择小票模板' }
+        ],
+        status: [
+          { required: true, message: '请选择状态' }
+        ]
+      }
+    }
+  },
+  methods: {
+    handleClose() {
+      this.visible = false
+    },
+    initList() {
+    },
+    handleOpen(params = {}) {
+      this.modalOptions.title = params.id ? '编辑设备' : '添加设备'
+      this.formData = Object.assign(this.$options.data().formData, params)
+      this.visible = true
+      this.initList()
+      if (params.id) {
+        this.getInfo(params.id)
+      } else {
+        this.$refs.formData && this.$refs.formData.resetFields()
+      }
+    },
+    async getInfo(id) {
+      const loading = this.$loading({ text: '加载中' })
+      try {
+        const res = await detailPostShopLaPrinter({ id })
+        this.formData = Object.assign(this.$options.data().formData, res.data, {
+          id: res.data.id || '',
+          name: res.data.name || '',
+          type: res.data.type,
+          finalNumber: res.data.finalNumber || '',
+          secret: res.data.secret || '',
+          mode: res.data.mode,
+          status: res.data.status
+        })
+        this.$nextTick(() => {
+          this.$refs.formData && this.$refs.formData.validate()
+        })
+      } finally {
+        loading.close()
+      }
+    },
+    handleSubmit() {
+      this.$refs.formData.validate(async (valid) => {
+        if (valid) {
+          const loading = this.$loading({ text: '提交中,请稍候……' })
+          try {
+            const { ...otps } = this.formData
+            const params = {
+              ...otps
+            }
+            this.formData.id ? await updatePostShopLaPrinter(params) : await savePostShopLaPrinter(params)
+            loading.close()
+            this.$message({ message: `${this.formData.id ? '编辑' : '添加'}成功!`, type: 'success' })
+            this.$emit('success')
+            this.visible = false
+          } catch (e) {
+            loading.close()
+          } finally {
+            loading.close()
+          }
+        } else {
+          this.$message({ message: '请输入相关信息', type: 'warning' })
+          return false
+        }
+      })
+    }
+  }
+}
+</script>
+

+ 209 - 0
src/views/mealManagement/printerList/index.vue

@@ -0,0 +1,209 @@
+<template>
+  <div class="app-container">
+    <!-- 查询和其他操作 -->
+    <div class="filter-container">
+      <el-input
+        v-model="listQuery.name" clearable size="mini" class="filter-item"
+        style="width: 200px;" placeholder="请输入设备名称"
+      />
+      <el-select
+        v-model="listQuery.type" clearable size="mini" class="filter-item"
+        style="width: 200px;margin-left: 10px;" placeholder="请选择设备类型"
+      >
+        <el-option label="文鼎创" :value="1" />
+      </el-select>
+      <el-input
+        v-model="listQuery.secret" clearable size="mini" class="filter-item"
+        style="width: 200px;margin-left: 10px;" placeholder="请输入秘钥"
+      />
+      <el-select
+        v-model="listQuery.mode" clearable size="mini" class="filter-item"
+        style="width: 200px;margin-left: 10px;" placeholder="请选择小票模板"
+      >
+        <el-option label="模板1" :value="1" />
+      </el-select>
+      <el-select
+        v-model="listQuery.status" clearable size="mini" class="filter-item"
+        style="width: 200px;margin-left: 10px;" placeholder="请选择状态"
+      >
+        <el-option label="启用" :value="1" />
+        <el-option label="禁用" :value="2" />
+      </el-select>
+      <el-button
+        size="mini" class="filter-item" type="primary" icon="el-icon-search"
+        style="margin-left:10px;"
+        @click="handleSearch"
+      >
+        查找
+      </el-button>
+      <br />
+      <el-button
+        size="mini" type="primary" icon="el-icon-plus"
+        @click="$refs.EditModal && $refs.EditModal.handleOpen({ id: '' })"
+      >
+        添加
+      </el-button>
+    </div>
+
+    <!-- 查询结果 -->
+    <div v-tableHeight>
+      <el-table
+        v-loading="listLoading" height="100%" element-loading-text="正在查询中。。。" :data="list"
+        v-bind="{ stripe: true, size: 'small', border: true, fit: true, highlightCurrentRow: true }"
+      >
+        <el-table-column align="center" width="100" label="设备ID" prop="id" fixed="left" />
+        <el-table-column align="center" width="150" label="设备名称" prop="name" fixed="left" show-overflow-tooltip />
+        <el-table-column align="center" width="120" label="商家ID" prop="aid" show-overflow-tooltip />
+        <el-table-column align="center" label="设备类型" prop="type">
+          <template slot-scope="{ row }">
+            <el-tag v-if="row.type === 1" effect="plain" type="info">文鼎创</el-tag>
+            <span v-else>--</span>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" width="120" label="编号" prop="finalNumber" show-overflow-tooltip />
+        <el-table-column align="center" min-width="150" label="秘钥" prop="secret" show-overflow-tooltip />
+        <el-table-column align="center" label="小票模板" prop="mode">
+          <template slot-scope="{ row }">
+            <el-tag v-if="row.mode === 1" effect="plain" type="info">模板1</el-tag>
+            <span v-else>--</span>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="状态" prop="status">
+          <template slot-scope="{ row }">
+            <el-tag v-if="row.status === 1" effect="plain" type="success">启用</el-tag>
+            <el-tag v-else-if="row.status === 2" effect="plain" type="danger">禁用</el-tag>
+            <span v-else>--</span>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="是否删除" prop="isDelete">
+          <template slot-scope="{ row }">
+            <el-tag v-if="row.isDelete === 0" effect="plain" type="info">否</el-tag>
+            <el-tag v-else-if="row.isDelete === 1" effect="plain" type="success">是</el-tag>
+            <span v-else>--</span>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" width="150" label="创建时间" prop="createTime" />
+        <el-table-column align="center" label="操作" width="300" fixed="right" class-name="small-padding fixed-width">
+          <template slot-scope="{ row }">
+            <el-button type="warning" size="mini" @click="handleDetail(row)">
+              详情
+            </el-button>
+            <el-button size="mini" @click="handleEdit(row)">
+              编辑
+            </el-button>
+            <el-button type="danger" size="mini" @click="handleDelete(row)">
+              删除
+            </el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+
+    <div>
+      <el-pagination
+        :current-page="listQuery.page" :page-sizes="[10, 20, 50, 100]" :page-size="listQuery.pageSize"
+        layout="total, sizes, prev, pager, next, jumper" :total="total"
+        @size-change="(val) => ((listQuery.pageSize = val) && getList())"
+        @current-change="(val) => ((listQuery.page = val) && getList())"
+      />
+    </div>
+
+    <!-- 新增编辑 -->
+    <EditModal ref="EditModal" @success="getList" />
+    <!-- 查看详情 -->
+    <DetailModal ref="DetailModal" />
+  </div>
+</template>
+
+<script>
+import EditModal from './components/EditModal'
+import DetailModal from './components/DetailModal'
+import { getPageAllShopLaPrinter, deletePostShopLaPrinter } from '@/api/mealManagement/printerList'
+
+export default {
+  name: 'PrinterList',
+  components: {
+    EditModal,
+    DetailModal
+  },
+  data() {
+    return {
+      list: [],
+      total: 0,
+      listLoading: true,
+      listQuery: {
+        page: 1,
+        pageSize: 20,
+        name: '',
+        type: '',
+        secret: '',
+        mode: '',
+        status: ''
+      }
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    async getList() {
+      this.listLoading = true
+      try {
+        const res = await getPageAllShopLaPrinter(this.listQuery)
+        this.list = res.data.list
+        this.total = res.data.total
+      } finally {
+        this.listLoading = false
+      }
+    },
+    handleSearch() {
+      this.listQuery.page = 1
+      this.getList()
+    },
+    handleDetail(row) {
+      this.$refs.DetailModal && this.$refs.DetailModal.handleOpen(row)
+    },
+    handleEdit(row) {
+      this.$refs.EditModal && this.$refs.EditModal.handleOpen(row)
+    },
+    handleDelete(row) {
+      this.$confirm('确定删除此项?')
+        .then(async () => {
+          await deletePostShopLaPrinter({ id: row.id })
+          this.$message({ message: '删除成功!', type: 'success' })
+          this.handleSearch()
+        })
+        .catch(() => {})
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.app-container {
+	padding: 20px;
+	display: flex;
+	flex-direction: column;
+
+	.filter-container {
+		.filter-item {
+			display: inline-block;
+			vertical-align: middle;
+			margin-bottom: 10px;
+		}
+	}
+
+	.small-padding {
+		.cell {
+			padding-left: 5px;
+			padding-right: 5px;
+		}
+	}
+
+	.fixed-width {
+		.el-button--mini {
+			padding: 7px 10px;
+		}
+	}
+}
+</style>

+ 3 - 0
src/views/voucherManagement/voucherOperation/index.vue

@@ -145,6 +145,9 @@ export default {
         voucherType: '1',
         buyerUserId: '',
         number: ''
+        // phone: '',
+        // value: '',
+        // voucherId: ''
       },
       transferFormRules: {
         voucherType: [ { required: true, message: '请选择代金券类型' } ],