Selaa lähdekoodia

fix: 添加快捷键、团体下拉等问题

LaveyD 2 viikkoa sitten
vanhempi
commit
a78d7b3d9a

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "ticket",
-  "version": "1.0.5",
+  "version": "1.0.6",
   "private": true,
   "description": "售检票系统",
   "author": "",

+ 3 - 0
src/components/GlobalComponents/OrderDetail.vue

@@ -71,6 +71,9 @@
       <el-form-item label="导游名称">
         {{ orderData.guideName || '无' }}
       </el-form-item>
+      <el-form-item label="下单备注">
+        {{ orderData.createOrderRemark || '无' }}
+      </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;">

+ 9 - 9
src/pages/config/index.vue

@@ -59,15 +59,6 @@
                 inactive-color="#ff4949">
               </el-switch>
             </el-form-item>
-            <el-form-item
-              label="售票快捷键支持"
-              prop="quickSupport">
-              <el-switch
-                v-model="form.quickSupport"
-                active-color="#13ce66"
-                inactive-color="#ff4949">
-              </el-switch>
-            </el-form-item>
 
             <el-form-item
               label="显示景点便签(售票界面)"
@@ -225,6 +216,15 @@
         </el-tab-pane>
         <el-tab-pane label="其他配置" name="other">
           <el-form>
+            <el-form-item
+              label="售票快捷键支持"
+              prop="quickSupport">
+              <el-switch
+                v-model="form.quickSupport"
+                active-color="#13ce66"
+                inactive-color="#ff4949">
+              </el-switch>
+            </el-form-item>
             <el-form-item label="身份证阅读器">
               <el-select
                 v-model="form.idDevice"

+ 1 - 0
src/pages/queryReport/OrderStatistic.vue

@@ -380,6 +380,7 @@ const groupKeys = [
   { value: 'unitPrice', label: '单价', prop: 'unitPrice' },
   { value: 'otaSourceName', label: '销售渠道' },
   { value: 'team', label: '团体' },
+  { value: 'teamIndividual', label: '团散' },
   { value: 'guide', label: '导游' },
   { value: 'batch', label: '场次' },
   { value: 'orderDateDay', label: '统计日期' },

+ 26 - 0
src/pages/queryReport/salesQuery.vue

@@ -243,6 +243,23 @@
           :step="0.01"
           :precision="2"></el-input-number>
       </el-form-item>
+      <el-form-item
+        label="团队"
+        prop="teamIdList"
+      >
+        <el-select
+          v-model="form.teamIdList"
+          multiple
+          placeholder="请选择"
+          filterable>
+          <el-option
+            v-for="item in teamList"
+            :key="item.id"
+            :label="item.name"
+            :value="item.id">
+          </el-option>
+        </el-select>
+      </el-form-item>
       <div class="btn-wrap">
         <el-button
           @click="reset"
@@ -1559,6 +1576,7 @@ import { getPayStatus } from '@/utils/index'
 import ReaderInput from '@/components/ReaderInput'
 import moment from 'moment'
 import { payPOS } from '@/api/pay'
+import { getTeamList, getGuideList } from '@/api/checker'
 import { getSelf } from '@/api/systemSetting/account'
 import { getSystemConfigList } from '@/api/systemConfig'
 import { addUserConfig, getUserConfig } from '@/api/configSetting'
@@ -1683,6 +1701,7 @@ export default {
     return {
       projecticketTypeName: process.env.VUE_APP_PROJECT,
       channelList,
+      teamList: [],
       otaSourceList: [],
       orderStatusDic,
       ticketStatusDic,
@@ -1715,6 +1734,7 @@ export default {
         scenicIdList: [], // 景点列表
         unitPriceBegin: undefined, // 单价
         unitPriceEnd: undefined, // 单价
+        teamIdList: [],
         pageNum: 1,
         pageSize: 10
       },
@@ -1812,6 +1832,7 @@ export default {
   mounted () {
     this.getSaleChannelList()
     this.getOrderList()
+    this.getTeams()
 
     EventBus.$on('activeTag', (tag) => {
       if (tag === '/queryReport/salesQuery') {
@@ -1821,6 +1842,11 @@ export default {
   },
   methods: {
     getPayStatus,
+    getTeams () {
+      getTeamList({ pageSize: -1, pageNum: 1 }).then(res => {
+        this.teamList = res.data.records || []
+      })
+    },
     showColumnConfig () {
       this.dialogVisible = true
       this.loadUserConfig(false)

+ 3 - 0
src/pages/sellManage/common/QuickType.vue

@@ -41,6 +41,9 @@ export default {
     handleClose () {
       this.$localStore.set('hideNote', true)
     }
+  },
+  mounted () {
+    this.$localStore.set('hideNote', false)
   }
 }
 </script>

+ 16 - 1
src/pages/sellManage/retail.vue

@@ -1,8 +1,8 @@
 <template>
   <div class="sale-container">
     <div style="display: flex; gap: 20px;">
+      <QuickType class="quick-type"></QuickType>
       <div style="width: 380px; flex-shrink: 0;margin-right: 20px;">
-        <QuickType></QuickType>
         <!-- 票种列表 -->
         <TicketList
           ref="ticketList"
@@ -96,3 +96,18 @@ export default {
   }
 }
 </script>
+
+<style lang="scss">
+
+.sale-container .quick-type {
+  position: absolute;
+  padding: 0 20px;
+  margin-top: -18px;
+  width: calc(100% - 40px);
+
+  .el-alert__closebtn {
+    top: 0px;
+  }
+}
+
+</style>

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

@@ -269,6 +269,9 @@ export default {
     ReaderInput
   },
   computed: {
+    projectName () {
+      return this.$store.state.app.projectName
+    },
     totalPrice () {
       if (!this.currentTicket) {
         return 0
@@ -617,7 +620,7 @@ export default {
       this.form.price = this.currentPrice
     },
     defaultPapersType () {
-      if (process.env.VUE_APP_PROJECT === 'zql') {
+      if (this.projectName === 'zql') {
         return 0
       } else if (this.$localStore.get(`${this.saleType}_identify`)) {
         return this.$localStore.get(`${this.saleType}_identify`)
@@ -632,8 +635,10 @@ export default {
       if (!ticket) return
       this.currentTicket = ticket
 
+      if (this.category === 'batch') return
+      if (this.projectName === 'jingxianlvyou') return
+
       setTimeout(() => {
-        if (this.category === 'batch') return
         // if (!this.ticketAutoAddMap[this.currentTicket.id]) {
         //   this.ticketAutoAddMap[this.currentTicket.id] = true
         // }

+ 56 - 4
src/pages/sellManage/retail/OrderInfo.vue

@@ -93,6 +93,11 @@
       <el-table-column
         prop="count"
         label="数量">
+        <template slot-scope="scope">
+          <el-input-number
+            v-model="scope.row.count"
+            :min="1"></el-input-number>
+        </template>
       </el-table-column>
       <el-table-column
         prop="price"
@@ -111,10 +116,10 @@
         label="小计">
         <template slot-scope="scope">
           <span v-if="scope.row.discountPrice">
-            {{ scope.row.total + scope.row.discountPrice * scope.row.tickets.length }} <s style="color: #f56c6c;">{{ scope.row.total }}</s>
+            {{ numCalc(scope.row.count, scope.row.price, '*') + numCalc(scope.row.count, scope.row.discountPrice, '*') }} <s style="color: #f56c6c;">{{ numCalc(scope.row.count, scope.row.originalPrice, '*') }}</s>
           </span>
           <span v-else>
-            {{ scope.row.total }}
+            {{ numCalc(scope.row.count, scope.row.price, '*') }}
           </span>
         </template>
       </el-table-column>
@@ -212,6 +217,52 @@ import PrintSmallTicketCheckbox from '../common/PrintSmallTicketCheckbox'
 import UploadImgList from '../common/uploadImgList'
 import orderItemMixin from '../common/orderItemMixin'
 
+/** 封装一个公共方法numCalc() 用于浮点数运算 */
+// num1 num2传入两个值 symbol +-*/符号
+const numCalc = (num1, num2, symbol) => {
+  const str1 = num1.toString()
+  const str2 = num2.toString()
+  let result
+  let str1Length
+  let str2Length
+  try {
+    // 获取小数点后的精度
+    str1Length = str1.split('.')[1].length
+  } catch (error) {
+    // 解决整数没有小数点方法
+    str1Length = 0
+  }
+  try {
+    str2Length = str2.split('.')[1].length
+  } catch (error) {
+    str2Length = 0
+  }
+  // 取两个数的最小精度,即小数点后数字的最大长度
+  const maxLen = Math.max(str1Length, str2Length)
+  // step将两个数都转化为整数至少小数点后移多少位
+  const step = Math.pow(10, maxLen)
+
+  switch (symbol) {
+    case '+':
+      // toFixed()根据最小精度截取运算结果
+      result = ((num1 * step + num2 * step) / step).toFixed(maxLen)
+      break
+    case '-':
+      result = ((num1 * step - num2 * step) / step).toFixed(maxLen)
+      break
+    case '*':
+      result = (((num1 * step) * (num2 * step)) / step / step).toFixed(maxLen)
+      break
+    case '/':
+      result = ((num1 * step) / (num2 * step)).toFixed(maxLen)
+      break
+    default:
+      break
+  }
+  // 由于toFixed方法返回结果是字符串,还需要转回number输出
+  return Number(result)
+}
+
 export default {
   mixins: [mixin, orderItemMixin],
   props: {
@@ -244,8 +295,8 @@ export default {
     },
     orderPrice () {
       return this.value.reduce((init, item) => {
-        let price = this.$NP.times(item.count, item.originalPrice)
-        return this.$NP.plus(init, price, item.discountPrice ? item.discountPrice * item.tickets.length : 0)
+        let price = numCalc(item.count, item.originalPrice, '*')
+        return numCalc(init, numCalc(price, item.discountPrice ? numCalc(item.discountPrice, item.count, '*') : 0, '+'), '+')
       }, 0)
     },
     tickets () {
@@ -277,6 +328,7 @@ export default {
     }
   },
   methods: {
+    numCalc,
     distinctOrder () {
       if (this.tickets.length === 0) {
         this.$message.warning('请先添加订单项')