|
@@ -17,7 +17,8 @@
|
|
|
<div class="layout_main layout_el-table">
|
|
|
<el-table :data="packageList" stripe>
|
|
|
<el-table-column prop="name" label="套餐名称" />
|
|
|
- <el-table-column prop="price" label="套餐价格" />
|
|
|
+ <el-table-column prop="originPrice" label="套餐原价" />
|
|
|
+ <el-table-column prop="discountPrice" label="套餐优惠价" />
|
|
|
<el-table-column prop="description" label="套餐描述" />
|
|
|
<el-table-column prop="createTime" label="创建时间" />
|
|
|
<el-table-column prop="createStaffName" label="创建人" />
|
|
@@ -119,11 +120,14 @@
|
|
|
<el-form-item label="名称" required>
|
|
|
<el-input v-model="item.hisName" readonly @click="displaySearchPanel(index)"/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="单价" required>
|
|
|
- <el-input v-model="item.price" type="number" class="w-80" />
|
|
|
+ <el-form-item label="原价">
|
|
|
+ <el-input disabled v-model="item.originPrice" type="number" class="w-60" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="优惠价" required>
|
|
|
+ <el-input v-model="item.discountPrice" type="number" class="w-60" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="数量" required>
|
|
|
- <el-input v-model.number="item.quantity" class="w-80" />
|
|
|
+ <el-input v-model.number="item.quantity" class="w-60" />
|
|
|
</el-form-item>
|
|
|
<el-form-item v-if="!disableEdit">
|
|
|
<el-button
|
|
@@ -145,7 +149,10 @@
|
|
|
</el-form>
|
|
|
|
|
|
<template #footer>
|
|
|
- <div style="flex: auto" v-if="!disableEdit">
|
|
|
+ <div v-if="disableEdit">
|
|
|
+ <el-button @click="mode = 'edit'" type="primary" size="default">编辑</el-button>
|
|
|
+ </div>
|
|
|
+ <div style="flex: auto" v-else>
|
|
|
<el-button @click="showCreation = false" size="default">取消</el-button>
|
|
|
<el-button @click="submitUpload" size="default" type="primary">提交</el-button>
|
|
|
</div>
|
|
@@ -154,8 +161,10 @@
|
|
|
<Search
|
|
|
v-if="showSearch"
|
|
|
med-type="01"
|
|
|
- target="SFXM"
|
|
|
+ target="JY"
|
|
|
title="收费项目查询"
|
|
|
+ width="520px"
|
|
|
+ show-mall-type
|
|
|
@close="showSearch = false"
|
|
|
@click-item="handleClickSearchItem"
|
|
|
/>
|
|
@@ -165,6 +174,7 @@
|
|
|
<script setup>
|
|
|
import {
|
|
|
getPackagesByCondition,
|
|
|
+ getOriginalPrice,
|
|
|
getPackageDetail,
|
|
|
createNewPackage2,
|
|
|
updatePackageState
|
|
@@ -257,10 +267,20 @@ function displaySearchPanel(index) {
|
|
|
currentIndex.value = index
|
|
|
showSearch.value = true
|
|
|
}
|
|
|
-function handleClickSearchItem(val) {
|
|
|
+async function handleClickSearchItem(val) {
|
|
|
packageItemList.value[currentIndex.value].hisCode = val.code
|
|
|
packageItemList.value[currentIndex.value].hisName = val.name
|
|
|
- showSearch.value = false
|
|
|
+ packageItemList.value[currentIndex.value].type = val.type
|
|
|
+ if (val.type === 'ZL') {
|
|
|
+ packageItemList.value[currentIndex.value].originPrice = val.price
|
|
|
+ packageItemList.value[currentIndex.value].discountPrice = val.price
|
|
|
+ } else {
|
|
|
+ await getOriginalPrice(val.type, val.code).then(price => {
|
|
|
+ packageItemList.value[currentIndex.value].originPrice = price
|
|
|
+ packageItemList.value[currentIndex.value].discountPrice = price
|
|
|
+ })
|
|
|
+ }
|
|
|
+ showSearch.value = false;
|
|
|
}
|
|
|
function addNewItemLine(index) {
|
|
|
let item = packageItemList.value[index]
|
|
@@ -278,8 +298,8 @@ function isValidItem(item) {
|
|
|
ElMessage.error('请先填写项目名称')
|
|
|
return false
|
|
|
}
|
|
|
- if (!item.price || item.price < 0) {
|
|
|
- ElMessage.error('项目单价不能小于 0')
|
|
|
+ if (!item.discountPrice || item.discountPrice < 0) {
|
|
|
+ ElMessage.error('项目优惠价不能小于 0')
|
|
|
return false
|
|
|
}
|
|
|
if (!item.quantity || item.quantity < 1) {
|
|
@@ -392,6 +412,9 @@ function beforeEditPackage(id) {
|
|
|
.w-80 {
|
|
|
width: 80px;
|
|
|
}
|
|
|
+ .w-60 {
|
|
|
+ width: 60px;
|
|
|
+ }
|
|
|
.gray-text {
|
|
|
color: gray;
|
|
|
}
|
|
@@ -420,6 +443,10 @@ function beforeEditPackage(id) {
|
|
|
height: 100px;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ .el-form--inline .el-form-item {
|
|
|
+ margin-right: 16px;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
</style>
|