健康包列表
This commit is contained in:
parent
83932947f0
commit
a222ff2444
@ -42,8 +42,9 @@
|
|||||||
<a-row :gutter="24" >
|
<a-row :gutter="24" >
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item field="service_rate" label="服务费率(%):">
|
<a-form-item field="service_rate" label="服务费率(%):">
|
||||||
<a-input-number
|
<a-input
|
||||||
v-model="modalForm.service_rate"
|
v-model="modalForm.service_rate"
|
||||||
|
|
||||||
:style="{ width: '320px' }"
|
:style="{ width: '320px' }"
|
||||||
placeholder="请选择服务费率"
|
placeholder="请选择服务费率"
|
||||||
class="input-demo"
|
class="input-demo"
|
||||||
@ -54,7 +55,7 @@
|
|||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item field="effective_days" label="服务有效天数:">
|
<a-form-item field="effective_days" label="服务有效天数:">
|
||||||
<a-input-number
|
<a-input
|
||||||
v-model="modalForm.effective_days"
|
v-model="modalForm.effective_days"
|
||||||
:style="{ width: '320px' }"
|
:style="{ width: '320px' }"
|
||||||
placeholder="请输入服务有效天数"
|
placeholder="请输入服务有效天数"
|
||||||
@ -67,9 +68,9 @@
|
|||||||
</a-row>
|
</a-row>
|
||||||
<a-row :gutter="24" >
|
<a-row :gutter="24" >
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item field="product_id" label="关联商品:" :rules="[{required: true,message:'请选择关联商品'}]">
|
<a-form-item field="my_package_product" label="关联商品:" >
|
||||||
<a-select multiple v-model="modalForm.product_id" placeholder="请选择关联商品" allow-search
|
<a-select multiple v-model="modalForm.my_package_product" placeholder="请选择关联商品" allow-search
|
||||||
:loading="loading" @search="handleGetProduct">
|
:loading="loading" @search="handleGetProduct" @change="changeProduct" >
|
||||||
<a-option v-for="item in productList" :key="item.product_id" :value="item.product_id" :label="item.product_name">
|
<a-option v-for="item in productList" :key="item.product_id" :value="item.product_id" :label="item.product_name">
|
||||||
{{ item.product_name }}
|
{{ item.product_name }}
|
||||||
</a-option>
|
</a-option>
|
||||||
@ -77,6 +78,21 @@
|
|||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
|
<a-row :gutter="24" >
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item field="" label="修改关联商品信息:" >
|
||||||
|
<a-table :columns="product_columns" :data="product_data" style="width:100%;">
|
||||||
|
<template #discount_product_price="{ record }">
|
||||||
|
<a-input-number v-model="record.discount_product_price" :min="0"/>
|
||||||
|
</template>
|
||||||
|
<template #quantity="{ record }">
|
||||||
|
<a-input-number v-model="record.quantity" :step="1" :precision="0" :min="1"/>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
</a-table>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
<a-divider />
|
<a-divider />
|
||||||
</a-form>
|
</a-form>
|
||||||
<div class="titlebox" >
|
<div class="titlebox" >
|
||||||
@ -98,8 +114,9 @@
|
|||||||
import { ref,toRefs,watch,getCurrentInstance,reactive,defineExpose} from 'vue';
|
import { ref,toRefs,watch,getCurrentInstance,reactive,defineExpose} from 'vue';
|
||||||
import { addHealth,updateHealth} from '@/api/inquiry/service';
|
import { addHealth,updateHealth} from '@/api/inquiry/service';
|
||||||
import { parseTime } from '@/utils/parseTime';
|
import { parseTime } from '@/utils/parseTime';
|
||||||
|
import {getProduct} from '@/api/coupon/list';
|
||||||
const { proxy } = getCurrentInstance();
|
const { proxy } = getCurrentInstance();
|
||||||
let multi_point_status='';
|
const product_data=ref([]);
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
// 是否显示
|
// 是否显示
|
||||||
modalVisible: {
|
modalVisible: {
|
||||||
@ -112,13 +129,17 @@
|
|||||||
},
|
},
|
||||||
modalForm:{
|
modalForm:{
|
||||||
type:Object,
|
type:Object,
|
||||||
default:{}
|
default:{}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const title=ref('添加问诊配置');
|
const title=ref('添加问诊配置');
|
||||||
const productList=ref([]);
|
const productList=ref([]);
|
||||||
const loading=ref(false);
|
const loading=ref(false);
|
||||||
|
let initData=[];
|
||||||
|
const reset=()=>{
|
||||||
|
product_data.value=[];
|
||||||
|
};
|
||||||
const handleGetProduct=async(name='',id='')=>{
|
const handleGetProduct=async(name='',id='')=>{
|
||||||
loading.value=true;
|
loading.value=true;
|
||||||
const {code,data}=await getProduct({
|
const {code,data}=await getProduct({
|
||||||
@ -135,24 +156,65 @@ const handleGetProduct=async(name='',id='')=>{
|
|||||||
const {modalVisible,id,modalForm}=toRefs(props);
|
const {modalVisible,id,modalForm}=toRefs(props);
|
||||||
const emits = defineEmits(['healthVisibleChange','freshList']);
|
const emits = defineEmits(['healthVisibleChange','freshList']);
|
||||||
watch(()=>props.id,(newVal,oldValval)=>{
|
watch(()=>props.id,(newVal,oldValval)=>{
|
||||||
if(newVal){
|
if(props.id){
|
||||||
title.value='修改健康包'
|
title.value='修改健康包';
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
//handleDoctorList();
|
|
||||||
title.value='添加健康包';
|
title.value='添加健康包';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
},{immediate:true})
|
},{immediate:true})
|
||||||
|
watch(()=>props.modalForm,()=>{
|
||||||
|
handleGetProduct();
|
||||||
|
if(id.value){
|
||||||
|
let product=modalForm.value.health_package_product;
|
||||||
|
initData=modalForm.value.health_package_product;
|
||||||
|
if(product && product.length>0){
|
||||||
|
|
||||||
|
modalForm.value.my_package_product=product.map((item)=>item.product_id);
|
||||||
|
product_data.value=product;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
},{immediate:true})
|
||||||
|
const changeProduct=(val)=>{
|
||||||
|
console.log(val);
|
||||||
|
product_data.value=[];
|
||||||
|
for (let i = 0; i < val.length; i++) {
|
||||||
|
if(initData.length>0){
|
||||||
|
for (let j = 0; j < initData.length; j++) {
|
||||||
|
if (val[i]=== initData[j].product_id){
|
||||||
|
product_data.value.push({
|
||||||
|
product_id:initData[j].product_id,
|
||||||
|
product_name:initData[j].product_name,
|
||||||
|
quantity:initData[j].quantity,
|
||||||
|
discount_product_price:initData[j].discount_product_price
|
||||||
|
})
|
||||||
|
continue;
|
||||||
|
}else{
|
||||||
|
let arr=productList.value.filter((item)=>item.product_id==val[i]);
|
||||||
|
product_data.value.push({
|
||||||
|
product_id:arr[0].product_id,
|
||||||
|
product_name:arr[0].product_name,
|
||||||
|
quantity:1,
|
||||||
|
discount_product_price:10
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
let arr=productList.value.filter((item)=>item.product_id==val[i]);
|
||||||
|
product_data.value.push({
|
||||||
|
product_id:arr[0].product_id,
|
||||||
|
product_name:arr[0].product_name,
|
||||||
|
quantity:1,
|
||||||
|
discount_product_price:10
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const reset=()=>{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -169,15 +231,17 @@ const handleGetProduct=async(name='',id='')=>{
|
|||||||
const handleSubmit=()=>{
|
const handleSubmit=()=>{
|
||||||
proxy.$refs.modalFormRefConfig.validate(async (valid) => {
|
proxy.$refs.modalFormRefConfig.validate(async (valid) => {
|
||||||
let data=null;
|
let data=null;
|
||||||
|
let obj=Object.assign({},modalForm.value,{health_package_product:product_data.value});
|
||||||
|
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
if(props.inquiry_config_id){
|
if(props.id){
|
||||||
data= await editInquiryconfig(modalForm,props.inquiry_config_id)
|
data= await updateHealth(props.id,obj)
|
||||||
}else{
|
}else{
|
||||||
data= await addInquiryconfig(modalForm);
|
data= await addHealth(obj);
|
||||||
}
|
}
|
||||||
if(data.code==200){
|
if(data.code==200){
|
||||||
props.inquiry_config_id?proxy.$message.success('修改成功'):proxy.$message.success('添加成功');
|
props.id?proxy.$message.success('修改成功'):proxy.$message.success('添加成功');
|
||||||
emits('freshList', '');
|
//emits('freshList', '');
|
||||||
}
|
}
|
||||||
handleClose();
|
handleClose();
|
||||||
}else {
|
}else {
|
||||||
@ -192,8 +256,30 @@ const handleGetProduct=async(name='',id='')=>{
|
|||||||
monthly_frequency:[{ required: true, message: '请输入每月次数' }],
|
monthly_frequency:[{ required: true, message: '请输入每月次数' }],
|
||||||
effective_days: [{ required: true, message: '请输入服务有效天数' }],
|
effective_days: [{ required: true, message: '请输入服务有效天数' }],
|
||||||
service_rate:[{ required: true, message: '请输入服务费率' }],
|
service_rate:[{ required: true, message: '请输入服务费率' }],
|
||||||
health_package_product:[{ required: true, message: '请选关联商品' }],
|
my_package_product: {type: 'array',required: true,message:'请选择关联商品'}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
const product_columns=[
|
||||||
|
{
|
||||||
|
title: '商品id',
|
||||||
|
dataIndex: 'product_id',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '商品名称',
|
||||||
|
dataIndex: 'product_name',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '商品数量',
|
||||||
|
dataIndex: 'quantity',
|
||||||
|
slotName: 'quantity'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '商品打折后价格',
|
||||||
|
dataIndex: 'discount_product_price',
|
||||||
|
slotName: 'discount_product_price'
|
||||||
|
}
|
||||||
|
|
||||||
|
]
|
||||||
defineExpose({
|
defineExpose({
|
||||||
reset
|
reset
|
||||||
});
|
});
|
||||||
|
|||||||
@ -345,7 +345,7 @@
|
|||||||
<a-space style="margin-right: 8px" v-if="modalForm.coupon_id && modalForm.coupon_status==1">
|
<a-space style="margin-right: 8px" v-if="modalForm.coupon_id && modalForm.coupon_status==1">
|
||||||
<a-button
|
<a-button
|
||||||
type="primary"
|
type="primary"
|
||||||
v-has="'admin:sysCouponList:edit'"
|
v-has="'admin:sysCouponList:force'"
|
||||||
status="danger"
|
status="danger"
|
||||||
@click="showCoupon"
|
@click="showCoupon"
|
||||||
>强制失效</a-button
|
>强制失效</a-button
|
||||||
|
|||||||
@ -45,7 +45,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</a-table>
|
</a-table>
|
||||||
|
|
||||||
<addHealthModal :modalVisible="modalVisible" :id="package_id" :modalForm="modalForm" @freshList="getInquiryInfo(pager);" @healthVisibleChange="()=>{modalVisible=false;package_id='';}"></addHealthModal>
|
<addHealthModal ref="addChild" :modalVisible="modalVisible" :id="package_id" :modalForm="modalForm" @freshList="getInquiryInfo(pager);" @healthVisibleChange="()=>{modalVisible=false;package_id='';}"></addHealthModal>
|
||||||
<a-modal v-model:visible="okVisible" :modal-style="{width:'320px'}" body-class="okmodal"
|
<a-modal v-model:visible="okVisible" :modal-style="{width:'320px'}" body-class="okmodal"
|
||||||
@cancel="()=>okVisible=false">
|
@cancel="()=>okVisible=false">
|
||||||
<template #title>
|
<template #title>
|
||||||
@ -74,7 +74,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const file = ref();
|
const addChild = ref(null);
|
||||||
const { proxy } = getCurrentInstance();
|
const { proxy } = getCurrentInstance();
|
||||||
const currentPage = ref(1);
|
const currentPage = ref(1);
|
||||||
const family_data=ref([]);
|
const family_data=ref([]);
|
||||||
@ -138,6 +138,13 @@
|
|||||||
const handleAdd = () => {
|
const handleAdd = () => {
|
||||||
modalVisible.value = true;
|
modalVisible.value = true;
|
||||||
package_id.value='';
|
package_id.value='';
|
||||||
|
modalForm.service_count=null;
|
||||||
|
modalForm.monthly_frequency=null;
|
||||||
|
modalForm.effective_days=null;
|
||||||
|
modalForm.health_package_product=[];
|
||||||
|
modalForm.my_package_product=[];
|
||||||
|
addChild.value.reset();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//详情
|
//详情
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user