【服务列表】 优化# 表格的前台价格字段
parent
6c34d8e94d
commit
0d510cee1b
|
@ -239,7 +239,9 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column property="goodsPrice" label="价格" width="120" />
|
<el-table-column property="goodsPrice" label="价格" width="120">
|
||||||
|
<template #default="scope">{{ parsePrice(scope.row) }}</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column property="unitName" label="单位" width="120" />
|
<el-table-column property="unitName" label="单位" width="120" />
|
||||||
<el-table-column property="goodsNum" label="数量" width="120" />
|
<el-table-column property="goodsNum" label="数量" width="120" />
|
||||||
<el-table-column property="totalAmount" label="总价格" width="120" />
|
<el-table-column property="totalAmount" label="总价格" width="120" />
|
||||||
|
@ -293,7 +295,7 @@
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { apiDispatchStaff, apiDispatchStaffScore, apiMasterLists, apiOrderDetail } from '@/api/order/lists'
|
import { apiDispatchStaff, apiDispatchStaffScore, apiMasterLists, apiOrderDetail } from '@/api/order/lists'
|
||||||
import { ReceiveOrderEnum, getTypeMap, useGoodsTypeMap } from '@/enums/modeEnum'
|
import { PriceEnum, ReceiveOrderEnum, getTypeMap, useGoodsTypeMap } from '@/enums/modeEnum'
|
||||||
import { useCreateModal } from '@/hooks/useCreateModal'
|
import { useCreateModal } from '@/hooks/useCreateModal'
|
||||||
import area from '@/utils/area'
|
import area from '@/utils/area'
|
||||||
import feedback from '@/utils/feedback'
|
import feedback from '@/utils/feedback'
|
||||||
|
@ -329,7 +331,9 @@ const goodsData = ref<any>([
|
||||||
deductionMoney: '',
|
deductionMoney: '',
|
||||||
totalAmount: '',
|
totalAmount: '',
|
||||||
orderAmount: '',
|
orderAmount: '',
|
||||||
couponDetailVo: {}
|
couponDetailVo: {},
|
||||||
|
priceType: PriceEnum.CUSTOMER_PRICE,
|
||||||
|
priceRange: ''
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
const couponInfo = ref([
|
const couponInfo = ref([
|
||||||
|
@ -395,6 +399,11 @@ const orderRefundDetailVo = computed(() => (unref(isShowOrderRefundDetailVo) ? u
|
||||||
|
|
||||||
/**是否派发给师傅 */
|
/**是否派发给师傅 */
|
||||||
const isDispatch = computed(() => (status: number) => status === ReceiveOrderEnum.PAUSE)
|
const isDispatch = computed(() => (status: number) => status === ReceiveOrderEnum.PAUSE)
|
||||||
|
const parsePrice = computed(() => row => {
|
||||||
|
const { priceType, priceRange, goodsPrice } = row
|
||||||
|
const [minPrice = 0, maxPrice = 0] = priceRange.split('-')
|
||||||
|
return priceType == PriceEnum.CUSTOMER_PRICE ? goodsPrice : minPrice + '-' + maxPrice
|
||||||
|
})
|
||||||
|
|
||||||
function generateCouponFields(res: any) {
|
function generateCouponFields(res: any) {
|
||||||
const fields = {
|
const fields = {
|
||||||
|
|
|
@ -90,7 +90,7 @@
|
||||||
</div>
|
</div>
|
||||||
<router-link :to="`/service/lists/edit?id=${row.goodsId}`" class="ml-2 xs">
|
<router-link :to="`/service/lists/edit?id=${row.goodsId}`" class="ml-2 xs">
|
||||||
<div class="goods-name truncate w-44">{{ row.goodsName }}</div>
|
<div class="goods-name truncate w-44">{{ row.goodsName }}</div>
|
||||||
<div class="form-tips">{{ row.goodsPrice }} {{ row.unitName }}</div>
|
<div class="form-tips">{{ parsePrice(row) }} {{ row.unitName }}</div>
|
||||||
</router-link>
|
</router-link>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -162,7 +162,7 @@
|
||||||
import { apiOrderLists, apiOrderStatis } from '@/api/order/lists'
|
import { apiOrderLists, apiOrderStatis } from '@/api/order/lists'
|
||||||
import { reactive, onMounted, computed } from 'vue'
|
import { reactive, onMounted, computed } from 'vue'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import { OrderMode } from '@/enums/modeEnum'
|
import { OrderMode, PriceEnum } from '@/enums/modeEnum'
|
||||||
import Operation from './components/operation.vue'
|
import Operation from './components/operation.vue'
|
||||||
import Pagination from '@/components/pagination/index.vue'
|
import Pagination from '@/components/pagination/index.vue'
|
||||||
import DataPicker from '@/components/daterange-picker/index.vue'
|
import DataPicker from '@/components/daterange-picker/index.vue'
|
||||||
|
@ -182,6 +182,8 @@ interface formDataObj {
|
||||||
orderStatus: string | number //否 int 订单状态;0-待支付;1-预约中;2-服务中;3-已完成;4-已取消
|
orderStatus: string | number //否 int 订单状态;0-待支付;1-预约中;2-服务中;3-已完成;4-已取消
|
||||||
staffInfo: string // 否 师傅信息
|
staffInfo: string // 否 师傅信息
|
||||||
isDispatch: string | number // 否 int 派单状态;0-委派单;1-已派单
|
isDispatch: string | number // 否 int 派单状态;0-委派单;1-已派单
|
||||||
|
priceType: PriceEnum
|
||||||
|
priceRange: string
|
||||||
}
|
}
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
@ -195,7 +197,9 @@ const formData = reactive<formDataObj>({
|
||||||
orderTimeEnd: '',
|
orderTimeEnd: '',
|
||||||
orderStatus: '',
|
orderStatus: '',
|
||||||
staffInfo: route.query.staffInfo ?? '',
|
staffInfo: route.query.staffInfo ?? '',
|
||||||
isDispatch: ''
|
isDispatch: '',
|
||||||
|
priceType: PriceEnum.CUSTOMER_PRICE,
|
||||||
|
priceRange: ''
|
||||||
})
|
})
|
||||||
const getOrderAmount = async () => {
|
const getOrderAmount = async () => {
|
||||||
countData.value = await apiOrderStatis(formData)
|
countData.value = await apiOrderStatis(formData)
|
||||||
|
@ -205,6 +209,11 @@ const setStatusColor = computed(() => {
|
||||||
return val === '待支付' || val === '已退款' || val === '退款中'
|
return val === '待支付' || val === '已退款' || val === '退款中'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
const parsePrice = computed(() => row => {
|
||||||
|
const { priceType, priceRange, goodsPrice } = row
|
||||||
|
const [minPrice = 0, maxPrice = 0] = priceRange.split('-')
|
||||||
|
return priceType == PriceEnum.CUSTOMER_PRICE ? goodsPrice : minPrice + '-' + maxPrice
|
||||||
|
})
|
||||||
|
|
||||||
const { pager, getLists, resetPage, resetParams } = usePaging({
|
const { pager, getLists, resetPage, resetParams } = usePaging({
|
||||||
fetchFun: apiOrderLists,
|
fetchFun: apiOrderLists,
|
||||||
|
|
|
@ -74,16 +74,17 @@
|
||||||
<el-table-column property="category" label="服务分类" min-width="145" />
|
<el-table-column property="category" label="服务分类" min-width="145" />
|
||||||
<el-table-column property="price" label="前台价格" min-width="80">
|
<el-table-column property="price" label="前台价格" min-width="80">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-input v-if="isEdit" v-model="scope.row.price" placeholder="请输入价格"></el-input>
|
{{ parsePrice(scope.row) }}
|
||||||
<div v-if="!isEdit">¥{{ scope.row.price }}</div>
|
<!-- <el-input v-if="isEdit" v-model="scope.row.price" placeholder="请输入价格"></el-input>
|
||||||
|
<div v-if="!isEdit">¥{{ scope.row.price }}</div> -->
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column property="scribingPrice" label="折前价格" min-width="80">
|
<!-- <el-table-column property="scribingPrice" label="折前价格" min-width="80">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-input v-if="isEdit" v-model="scope.row.scribingPrice" placeholder="请输入价格"></el-input>
|
<el-input v-if="isEdit" v-model="scope.row.scribingPrice" placeholder="请输入价格"></el-input>
|
||||||
<div v-if="!isEdit">{{ scope.row.scribingPrice ? '¥' + scope.row.scribingPrice : '' }}</div>
|
<div v-if="!isEdit">{{ scope.row.scribingPrice ? '¥' + scope.row.scribingPrice : '' }}</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<el-table-column property="unit" label="单位" min-width="80" />
|
<el-table-column property="unit" label="单位" min-width="80" />
|
||||||
<el-table-column property="orderNum" label="预约人数" min-width="80" />
|
<el-table-column property="orderNum" label="预约人数" min-width="80" />
|
||||||
<el-table-column property="statusDesc" label="销售状态" min-width="80">
|
<el-table-column property="statusDesc" label="销售状态" min-width="80">
|
||||||
|
@ -159,6 +160,7 @@ import { ref } from 'vue'
|
||||||
import Pagination from '@/components/pagination/index.vue'
|
import Pagination from '@/components/pagination/index.vue'
|
||||||
import { usePaging } from '@/hooks/usePaging'
|
import { usePaging } from '@/hooks/usePaging'
|
||||||
import feedback from '@/utils/feedback'
|
import feedback from '@/utils/feedback'
|
||||||
|
import { PriceEnum } from '@/enums/modeEnum'
|
||||||
|
|
||||||
interface formDataObj {
|
interface formDataObj {
|
||||||
name: string //服务名称
|
name: string //服务名称
|
||||||
|
@ -174,6 +176,10 @@ const formData = ref<formDataObj>({
|
||||||
status: '',
|
status: '',
|
||||||
categoryId: ''
|
categoryId: ''
|
||||||
})
|
})
|
||||||
|
const parsePrice = computed(() => row => {
|
||||||
|
const { priceType, price, minPrice, maxPrice } = row
|
||||||
|
return priceType == PriceEnum.CUSTOMER_PRICE ? price + '元' : minPrice + '-' + maxPrice + '元'
|
||||||
|
})
|
||||||
|
|
||||||
const getOrderAmount = async () => {
|
const getOrderAmount = async () => {
|
||||||
countData.value = await apiServiceStatis({ ...formData.value, status: '' })
|
countData.value = await apiServiceStatis({ ...formData.value, status: '' })
|
||||||
|
|
Loading…
Reference in New Issue