dct 5 месяцев назад
Родитель
Сommit
b0f9bd228b

+ 25 - 0
src/api/checker.js

@@ -86,6 +86,31 @@ export function updateTeam (params) {
   return http.post('/admin/team/update', { data: params })
 }
 
+// 导游列表
+export function getGuideList (params) {
+  return http.post('/admin/guide', { data: params })
+}
+
+// 导游详情
+export function getGuideDetail (id) {
+  return http.post('/admin/guide/detail', { data: { id } })
+}
+
+// 导游删除
+export function deleteGuide (id) {
+  return http.post('/admin/guide/delete', { data: { idList: [id] } })
+}
+
+// 导游添加
+export function addGuide (params) {
+  return http.post('/admin/guide/add', { data: params })
+}
+
+// 导游修改
+export function updateGuide (params) {
+  return http.post('/admin/guide/update', { data: params })
+}
+
 // 子项列表
 export function getSubProjectList (params) {
   return http.post('/admin/subProject', { data: params })

+ 4 - 1
src/components/GlobalComponents/OrderDetail.vue

@@ -64,9 +64,12 @@
       <el-form-item label="订单状态">
         <OrderStatusTag :value="orderData.status"></OrderStatusTag>
       </el-form-item>
-      <el-form-item label="团名称">
+      <el-form-item label="团名称">
         {{ orderData.teamName || '无' }}
       </el-form-item>
+      <el-form-item label="导游名称">
+        {{ orderData.guideName || '无' }}
+      </el-form-item>
       <el-tabs v-model="activeTab" type="card">
         <el-tab-pane class="block-title" label="门票信息" name="ticketCheckInfo">
           <div class="title" style="display: flex;justify-content: space-between;margin-bottom: 10px;">

+ 231 - 0
src/pages/checkerManage/guideManage.vue

@@ -0,0 +1,231 @@
+<template>
+  <div class="form-wrap">
+    <el-form
+      class="search-box"
+      ref="form"
+      :model="form"
+      :inline="true"
+    >
+      <div class="block-title">
+        查询条件
+      </div>
+      <el-form-item
+        label="导游名称"
+        prop="name">
+        <el-input v-model="form.name" clearable></el-input>
+      </el-form-item>
+      <el-form-item
+        label="联系方式"
+        prop="phone">
+        <el-input v-model="form.phone" clearable></el-input>
+      </el-form-item>
+      <el-form-item
+        label="证件号"
+        prop="idcard">
+        <el-input v-model="form.idcard" clearable></el-input>
+      </el-form-item>
+      <div class="btn-wrap">
+        <el-button
+          @click="reset">
+          重置
+        </el-button>
+        <el-button
+          type="primary"
+          @click="getList(true)">
+          搜索
+        </el-button>
+        <el-button
+          type="primary"
+          @click="openAddDialog(true)">
+          新增导游
+        </el-button>
+      </div>
+    </el-form>
+
+    <div class="table-box">
+      <!-- <div class="block-title">
+        导游列表
+      </div> -->
+      <el-table
+        border
+        v-loading="loading"
+        :data="tableData">
+        <el-table-column
+          prop="name"
+          label="导游名称">
+        </el-table-column>
+        <el-table-column
+          prop="phone"
+          label="联系方式">
+        </el-table-column>
+        <el-table-column
+          prop="idcard"
+          label="证件号">
+        </el-table-column>
+        <el-table-column
+          width="150px"
+          label="操作">
+          <template slot-scope="scope">
+            <el-link
+              type="primary"
+              @click="openEditDialog(scope.row)"
+            >
+              编辑
+            </el-link>
+
+            <el-link
+              type="primary"
+              @click="deleteGuide(scope.row)">
+              删除
+            </el-link>
+          </template>
+        </el-table-column>
+      </el-table>
+      <el-pagination
+        background
+        layout="total, sizes, prev, pager, next, jumper"
+        :current-page.sync="form.pageNum"
+        :page-sizes="[10, 20, 50, 100]"
+        :page-size="form.pageSize"
+        @size-change="handleSizeChange"
+        @current-change="getList()"
+        :total="total"
+      >
+      </el-pagination>
+    </div>
+    <!-- 弹框 -->
+
+    <ElDialog
+      :title="`${currentItem.id ? '编辑' : '新增'}导游`"
+      width="500px"
+      v-model="dialogVisible"
+    >
+      <el-form
+        inline
+        :model="currentItem"
+        ref="form"
+        class="form-wrap"
+        label-width="150px"
+        style="margin-top: 20px">
+        <el-form-item
+          label="导游名称"
+          verify
+          prop="name">
+          <el-input v-model="currentItem.name"></el-input>
+        </el-form-item>
+        <el-form-item
+          label="联系人"
+          prop="idcard">
+          <el-input v-model="currentItem.idcard"></el-input>
+        </el-form-item>
+        <el-form-item
+          label="联系方式"
+          prop="phone">
+          <el-input v-model="currentItem.phone"></el-input>
+        </el-form-item>
+      </el-form>
+      <div style="margin: 20px; float: right;">
+        <el-button @click="dialogVisible = false">取消</el-button>
+        <el-button type="primary" @click="confirmOptGuide">确定</el-button>
+      </div>
+    </ElDialog>
+  </div>
+</template>
+
+<script>
+import { getGuideList, addGuide, updateGuide, deleteGuide } from '@/api/checker'
+import ElDialog from '@/components/Dialog'
+
+// import ConfigSetting from './deviceManage/ConfigSetting'
+export default {
+  data () {
+    return {
+      form: {
+        name: '', // 名称
+        pageNum: 1,
+        pageSize: 10,
+        idcard: '', // 联系人
+        phone: '' // 联系电话
+      },
+      loading: false,
+      tableData: [],
+      total: 0,
+      dialogVisible: false,
+      configDialogVisible: false,
+      currentItem: {}
+    }
+  },
+  computed: {
+    scenicList () {
+      return this.$store.state.app.scenicList
+    }
+  },
+  created () {
+    this.getList()
+  },
+  components: {
+    ElDialog
+  },
+  methods: {
+    reset () {
+      this.$refs.form.resetFields()
+    },
+    handleSizeChange (size) {
+      this.form.pageSize = size
+      this.getList()
+    },
+    // 获取通道列表
+    getList (goFirst) {
+      let params = { ...this.form }
+
+      goFirst && (params.pageNum = 1)
+      this.loading = true
+      getGuideList(params).then(res => {
+        const list = res.data?.records || []
+        this.total = res.data?.total || 0
+        this.tableData = list
+        this.loading = false
+      })
+    },
+    // 打开弹框
+    openAddDialog () {
+      this.currentItem = {
+        id: '',
+        name: '',
+        idcard: '',
+        phone: '',
+        remark: ''
+      }
+      this.dialogVisible = true
+    },
+    openEditDialog (item) {
+      this.currentItem = Object.assign({}, item)
+      this.dialogVisible = true
+    },
+    deleteGuide (data) {
+      this.$confirm('确定删除导游吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        deleteGuide(data.id).then(res => {
+          this.$message.success('操作成功')
+          this.getList()
+        })
+      }).catch(() => {})
+    },
+    confirmOptGuide () {
+      const opt = this.currentItem.id ? updateGuide : addGuide
+      opt(this.currentItem).then(res => {
+        this.$message.success('操作成功')
+        this.dialogVisible = false
+        this.getList()
+      })
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 0 - 4
src/pages/dashboard/dataTables/OrderStatistics.vue

@@ -19,10 +19,6 @@
         prop="saleCheckNum"
         label="人数">
       </el-table-column>
-      <el-table-column
-        prop="actualCheckNum"
-        label="售票总人次">
-      </el-table-column>
       <el-table-column
         prop="actualPrice"
         label="金额">

+ 2 - 2
src/pages/queryReport/handOverReport.vue

@@ -64,7 +64,7 @@
                 </template>
               </el-table-column>
 
-              <el-table-column
+              <!-- <el-table-column
                 prop="actualCheckNum"
                 label="售票总人次">
                 <template
@@ -72,7 +72,7 @@
                   售票总人次
                   <Tip msg="售票人数 × 票种人数"></Tip>
                 </template>
-              </el-table-column>
+              </el-table-column> -->
 
               <el-table-column
                 prop="cancelPrice"

+ 8 - 0
src/pages/sellManage/batchSale/Confirm.vue

@@ -54,6 +54,14 @@
         <el-table-column
           prop="total"
           label="小计">
+          <template slot-scope="scope">
+            <span v-if="scope.row.distinctPrice">
+              {{ scope.row.total - scope.row.distinctPrice * scope.row.tickets.length }} <s style="color: #f56c6c;">{{ scope.row.total }}</s>
+            </span>
+            <span v-else>
+              {{ scope.row.total }}
+            </span>
+          </template>
         </el-table-column>
       </el-table>
 

+ 8 - 1
src/pages/sellManage/common/confirmMixin.js

@@ -249,8 +249,9 @@ export default {
     },
     createOrder (params) {
       this.submitDisable = true
-
       params.tickets.forEach(ticket => {
+        const { price, distinctPrice } = ticket
+
         if (params.checkWay !== 5) {
           ticket.ticketNo = ''
           ticket.isStorage = 0
@@ -261,8 +262,14 @@ export default {
         ticket.face = {
           faceImg: ticket.face
         }
+
+        ticket.price = distinctPrice ? price - distinctPrice : price
+        ticket.originalPrice = price
       })
 
+      params.discountDescription = params.tickets.map((item) => item.discountDescription).filter(i => i).join(',')
+      this.tickets = params.tickets
+
       if (this.createOrderStatus === 1) {
         handlePay(this.params, this.orderTempInfo, this, () => { })
         if (this.payStatus !== 1) {

+ 7 - 4
src/pages/sellManage/common/orderItemMixin.js

@@ -29,22 +29,25 @@ export default {
       this.$refs.touristList.show()
     },
     updateTourist (data) {
-      const { id: ticketTypeId, playDateBegin, playDateEnd, isDiscount, price, batchConfigId } = this.currentRecord.currentTicket
+      const { currentTicket, distinctPrice = 0 } = this.currentRecord
+      const { id: ticketTypeId, playDateBegin, playDateEnd, isDiscount, price, batchConfigId } = currentTicket
       this.currentRecord.tickets = data.map(item => {
         const data = {
           ...item,
           playDateBegin,
           playDateEnd,
           isDiscount,
-          price,
-          ticketTypeId
+          ticketTypeId,
+          price: distinctPrice ? price - distinctPrice : price,
+          distinctPrice,
+          originalPrice: price
         }
 
         batchConfigId && (data.batchConfigId = batchConfigId)
 
         return data
       })
-
+      this.currentRecord.discountDescription = this.currentRecord.tickets.map((item) => item.discountDescription).filter(i => i).join(',')
       this.currentRecord.count = data.length
       this.currentRecord.total = this.$NP.times(this.currentRecord.price, this.currentRecord.count)
     },

+ 13 - 1
src/pages/sellManage/retail/Confirm.vue

@@ -47,6 +47,14 @@
         <el-table-column
           prop="total"
           label="小计">
+          <template slot-scope="scope">
+            <span v-if="scope.row.distinctPrice">
+              {{ scope.row.total - scope.row.distinctPrice * scope.row.tickets.length }} <s style="color: #f56c6c;">{{ scope.row.total }}</s>
+            </span>
+            <span v-else>
+              {{ scope.row.total }}
+            </span>
+          </template>
         </el-table-column>
       </el-table>
 
@@ -269,7 +277,11 @@ export default {
 
         params.tickets = allTickets
       } else {
-        params.tickets = tickets
+        params.tickets = tickets.map((item, idx) => {
+          const orderItem = this.orderInfo[idx]
+          item.distinctPrice = orderItem ? orderItem.distinctPrice : 0
+          return item
+        })
       }
       // params.count = this.totalCount
       params.payChannel = this.currentPayChannel

+ 21 - 2
src/pages/sellManage/retail/FormInfo.vue

@@ -41,6 +41,20 @@
             </el-option>
           </el-select>
         </el-form-item>
+        <el-form-item
+          v-if="isTeam"
+          label="导游">
+          <el-select
+            filterable
+            v-model="form.guideId">
+            <el-option
+              v-for="item in guideList"
+              :key="item.id"
+              :label="item.name"
+              :value="item.id">
+            </el-option>
+          </el-select>
+        </el-form-item>
         <el-form-item
           verify
           can-be-empty
@@ -229,7 +243,7 @@ import TouristList from '../common/TouristList'
 // import ReaderInput from '@/components/ReaderInput'
 import moment from 'moment'
 import { IDENTIFY_TYPES } from '@/const'
-import { getTeamList } from '@/api/checker'
+import { getTeamList, getGuideList } from '@/api/checker'
 
 export default {
   props: {
@@ -325,6 +339,7 @@ export default {
         playDateEnd: '',
         price: 0,
         teamId: '',
+        guideId: '',
         checkWay: this.isTeam ? 2 : 1,
         actualMoney: 0 // 实付金额,不需要传给后台
       },
@@ -337,7 +352,8 @@ export default {
         }
       },
       disablePlayDateBegin: false,
-      teamList: []
+      teamList: [],
+      guideList: []
     }
   },
   created () {
@@ -345,6 +361,9 @@ export default {
       getTeamList({ pageSize: -1, pageNum: 1 }).then(res => {
         this.teamList = res.data.records || []
       })
+      getGuideList({ pageSize: -1, pageNum: 1 }).then(res => {
+        this.guideList = res.data.records || []
+      })
     }
   },
   methods: {

+ 97 - 9
src/pages/sellManage/retail/OrderInfo.vue

@@ -3,8 +3,14 @@
   <el-card>
     <div
       slot="header"
-      class="card-title">
-      <span class="top-title">订单明细</span>
+      class="card-title"
+      style="display: flex">
+      <div class="top-title">订单明细</div>
+      <!-- <el-button
+        type="text"
+        @click="distinctOrder">
+        优惠/说明
+      </el-button> -->
     </div>
     <div>
       <div class="is-flex">
@@ -91,29 +97,84 @@
       <el-table-column
         prop="price"
         label="单价">
+        <template slot-scope="scope">
+          <span v-if="scope.row.distinctPrice">
+            {{ scope.row.price - scope.row.distinctPrice }} <s style="color: #f56c6c;">{{ scope.row.price }}</s>
+          </span>
+          <span v-else>
+            {{ scope.row.price }}
+          </span>
+        </template>
       </el-table-column>
       <el-table-column
         prop="total"
         label="小计">
+        <template slot-scope="scope">
+          <span v-if="scope.row.distinctPrice">
+            {{ scope.row.total - scope.row.distinctPrice * scope.row.tickets.length }} <s style="color: #f56c6c;">{{ scope.row.total }}</s>
+          </span>
+          <span v-else>
+            {{ scope.row.total }}
+          </span>
+        </template>
       </el-table-column>
       <el-table-column
         label="操作"
-        width="140">
+        width="160">
         <template slot-scope="scope">
           <el-button
-            @click="handleDelete(scope.row)"
+            @click="showTouristList(scope.row)"
             type="text">
-            删除
+            门票列表
           </el-button>
           <el-button
-            @click="showTouristList(scope.row)"
+            @click="distinctTicket(scope.row)"
             type="text">
-            门票列表
+            优惠
+          </el-button>
+          <el-button
+            @click="handleDelete(scope.row)"
+            type="text">
+            删除
           </el-button>
         </template>
       </el-table-column>
     </el-table>
 
+    <!-- 设置优惠说明的弹框 -->
+    <el-dialog
+      title="优惠/说明"
+      :visible.sync="showDistinctDialog"
+      width="400px"
+      @close="showDistinctDialog = false"
+    >
+      <el-form label-width="80px">
+        <el-form-item label="票单价">
+          <span>{{ distinctInfo.ticketPrice }}</span>
+        </el-form-item>
+        <el-form-item label="优惠金额">
+          <el-input-number
+            v-model.number="distinctInfo.discountPrice"
+            :min="0"
+            :precision="2"
+            style="width: 200px"
+          ></el-input-number>
+        </el-form-item>
+        <el-form-item label="说明">
+          <el-input
+            type="textarea"
+            v-model="distinctInfo.description"
+            :rows="3"
+            placeholder="请输入说明"
+          ></el-input>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="showDistinctDialog = false">取消</el-button>
+        <el-button type="primary" @click="confirmDistinct">确定</el-button>
+      </span>
+    </el-dialog>
+
     <Confirm
       :remark="remark"
       :tickets="tickets"
@@ -184,7 +245,7 @@ export default {
     orderPrice () {
       return this.value.reduce((init, item) => {
         let price = this.$NP.times(item.count, item.price)
-        return this.$NP.plus(init, price)
+        return this.$NP.plus(init, price, item.distinctPrice ? -item.distinctPrice * item.tickets.length : 0)
       }, 0)
     },
     tickets () {
@@ -205,10 +266,37 @@ export default {
         remark: ''
       }],
       autoPrint: this.$localStore.get('autoPrint'),
-      autoPrintSmallTicket: this.$localStore.get('autoPrintSmallTicket')
+      autoPrintSmallTicket: this.$localStore.get('autoPrintSmallTicket'),
+      showDistinctDialog: false,
+      currentItem: null,
+      distinctInfo: {
+        ticketPrice: 0,
+        discountPrice: 0,
+        description: ''
+      }
     }
   },
   methods: {
+    distinctOrder () {
+      if (this.tickets.length === 0) {
+        this.$message.warning('请先添加订单项')
+        return
+      }
+      this.showDistinctDialog = true
+    },
+    distinctTicket (item) {
+      this.currentItem = item
+      console.log(item, 'item')
+      this.distinctInfo.ticketPrice = item.currentTicket.price
+      this.distinctInfo.discountPrice = item.distinctPrice || 0
+      this.distinctInfo.description = item.description || ''
+      this.showDistinctDialog = true
+    },
+    confirmDistinct () {
+      this.$set(this.currentItem, 'distinctPrice', this.distinctInfo.discountPrice)
+      this.$set(this.currentItem, 'description', this.distinctInfo.description)
+      this.showDistinctDialog = false
+    },
     // 更新图片备注列表
     updateRemarks (data) {
       this.pictureRemarks = data

+ 6 - 0
src/router/index.js

@@ -204,6 +204,12 @@ let routerMap = [
         component: require('@/pages/checkerManage/teamManage').default,
         meta: { title: '团队管理', permissionName: 'ticket-manage:team-manage' }
       },
+      {
+        path: 'guideManage',
+        name: 'guideManage',
+        component: require('@/pages/checkerManage/guideManage').default,
+        meta: { title: '导游管理', permissionName: 'ticket-manage:guide-manage' }
+      },
       {
         path: 'subProjectManage',
         name: 'subProjectManage',