修改
This commit is contained in:
parent
20ad78b4e8
commit
e1c8a1105e
@ -14,7 +14,7 @@ export function getCouponDetail(id){
|
||||
}
|
||||
export function addCoupon(data){//系统-新增系统优惠卷
|
||||
return request({
|
||||
url:'/admin/coupon/system/'+id,
|
||||
url:'/admin/coupon/system/',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
|
||||
@ -9,7 +9,11 @@
|
||||
<a-textarea v-model.trim="form.cancel_remarks" allow-clear placeholder="请输入取消订单理由"></a-textarea>
|
||||
</a-form-item>
|
||||
<a-form-item field="refund_amount" label="退款金额(元)" >
|
||||
<a-input-number v-model="form.refund_amount" placeholder="请输入退款金额" size="large" class="input-demo" :min="0"/>
|
||||
<a-input-number v-model="form.refund_amount" placeholder="请输入退款金额" size="large" class="input-demo" :min="0" :max="payment_amount_total"/>
|
||||
</a-form-item>
|
||||
<a-form-item field="" label="" v-if="type=='service'">
|
||||
温馨提示:退款金额不可大于实际付款金额,请谨慎填写;\n
|
||||
退款理由请认真填写,会显示给患者(本单实付金额金额:{{payment_amount_total}}元)。
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
<template #footer>
|
||||
@ -33,6 +37,10 @@ const props = defineProps({
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
type:{
|
||||
type: String,
|
||||
default:'',
|
||||
},
|
||||
id:{
|
||||
type: String,
|
||||
default:'',
|
||||
@ -53,7 +61,7 @@ const props = defineProps({
|
||||
},
|
||||
});
|
||||
const emits = defineEmits(['closeChange']);
|
||||
const {okVisible,title,id,api,payment_amount_total} = toRefs(props);
|
||||
const {okVisible,title,id,api,payment_amount_total,type} = toRefs(props);
|
||||
|
||||
// Akiraka 20230210 关闭弹窗
|
||||
const handleClose = () => {
|
||||
@ -61,7 +69,10 @@ const handleClose = () => {
|
||||
// alert(flag)
|
||||
}
|
||||
watch(()=>props.payment_amount_total,(newVal,oldVal)=>{
|
||||
form.refund_amount=Number(newVal);
|
||||
if(!props.type){
|
||||
form.refund_amount=Number(newVal);
|
||||
}
|
||||
//
|
||||
},{immediate:true})
|
||||
// Akiraka 20230210 删除数据校验
|
||||
const rules = reactive({
|
||||
|
||||
@ -38,7 +38,7 @@
|
||||
<a-col :span="12">
|
||||
<a-form-item field="application_scope" label="使用范围:">
|
||||
<a-select
|
||||
@change="changeScope"
|
||||
@change="changeScope"
|
||||
placeholder="请选择使用范围"
|
||||
v-model="modalForm.application_scope"
|
||||
>
|
||||
@ -75,16 +75,25 @@
|
||||
</a-row>
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<a-form-item field="inquiry_type" label="有效时间:">
|
||||
<a-range-picker
|
||||
style="width: 360px; margin: 0 24px 24px 0"
|
||||
show-time
|
||||
:time-picker-props="{ defaultValue: ['00:00:00', '09:09:06'] }"
|
||||
format="YYYY-MM-DD HH:mm"
|
||||
@change="onChange"
|
||||
@select="onSelect"
|
||||
@ok="onOk"
|
||||
/>
|
||||
<a-form-item field="distribution_object" label="发放对象:">
|
||||
<a-select
|
||||
placeholder="请选择发放对象"
|
||||
v-model="modalForm.distribution_object"
|
||||
@change="changeObject"
|
||||
>
|
||||
<!-- 1:全部用户 2:新注册用户 3:会员 4:近期消费 5:近期购药 6:存量用户 7:健康包服务用户 -->
|
||||
<a-option :key="1" :value="1" label="全部用户">全部用户</a-option>
|
||||
<a-option :key="2" :value="2" label="新注册用户"
|
||||
>新注册用户</a-option
|
||||
>
|
||||
<a-option :key="3" :value="3" label="会员">会员</a-option>
|
||||
<a-option :key="4" :value="4" label="近期消费">近期消费</a-option>
|
||||
<a-option :key="5" :value="5" label="近期购药">近期购药</a-option>
|
||||
<a-option :key="6" :value="6" label="存量用户">存量用户</a-option>
|
||||
<a-option :key="7" :value="7" label="健康包服务用户"
|
||||
>健康包服务用户</a-option
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
@ -101,60 +110,182 @@
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="24">
|
||||
<a-row :gutter="24" v-if="showConnectType">
|
||||
<a-col a-col :span="24">
|
||||
<a-form-item field="valid_days" label="有效天数:">
|
||||
<a-input-number v-model="modalForm.valid_days" :style="{width:'320px'}" placeholder="请输入有效天数" class="input-demo" :min="1" />
|
||||
</a-form-item>
|
||||
<a-form-item field="inquiry_type" label="问诊类型:">
|
||||
<a-select
|
||||
:style="{ width: '320px' }"
|
||||
placeholder="请选择问诊类型"
|
||||
v-model="modalForm.inquiry_type"
|
||||
|
||||
>
|
||||
<!-- 1:'专家问诊', 2:'快速问诊', 3:'公益问诊', 4:'问诊购药',5:'糖组检测') -->
|
||||
<a-option key="1" value="1" label="专家问诊">专家问诊</a-option>
|
||||
<a-option key="2" value="2" label="快速问诊">快速问诊</a-option>
|
||||
<a-option key="3" value="3" label="公益问诊">公益问诊</a-option>
|
||||
<a-option key="4" value="4" label="问诊购药">问诊购药</a-option>
|
||||
<a-option key="5" value="5" label="糖组检测">糖组检测</a-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="24">
|
||||
<a-row :gutter="24" v-if="showTimeRange">
|
||||
<a-col :span="12">
|
||||
<a-form-item field="inquiry_type" label="有效时间:">
|
||||
<a-range-picker
|
||||
style="width: 360px; margin: 0 24px 24px 0"
|
||||
show-time
|
||||
:defaultValue="defaultValue"
|
||||
:disabled-date="disabledDate"
|
||||
format="YYYY-MM-DD HH:mm"
|
||||
@ok="onOk"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="24" v-if="showValidDay">
|
||||
<a-col a-col :span="24">
|
||||
<a-form-item field="valid_days" label="领取之日起有效天数:">
|
||||
<a-input-number
|
||||
v-model="modalForm.valid_days"
|
||||
:style="{ width: '320px' }"
|
||||
placeholder="请输入有效天数"
|
||||
class="input-demo"
|
||||
:min="1"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<!-- <a-row :gutter="24">
|
||||
<a-col a-col :span="24">
|
||||
<a-form-item field="inquiry_type" label="发放个数:">
|
||||
<a-input-number v-model="value" :style="{width:'320px'}" placeholder="请输入发放个数" class="input-demo" :min="1" />
|
||||
</a-form-item>
|
||||
<a-input-number
|
||||
v-model="value"
|
||||
:style="{ width: '320px' }"
|
||||
placeholder="请输入发放个数"
|
||||
class="input-demo"
|
||||
:min="1"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="24">
|
||||
</a-row> -->
|
||||
<a-row :gutter="24" v-if="showManjian">
|
||||
<a-col a-col :span="24">
|
||||
<a-form-item field="with_amount" label="满减金额(元):">
|
||||
<a-input-number v-model="modalForm.with_amount" :style="{width:'320px'}" placeholder="请输入满减金额" class="input-demo" :min="0" />
|
||||
</a-form-item>
|
||||
<a-input-number
|
||||
v-model="modalForm.with_amount"
|
||||
:style="{ width: '320px' }"
|
||||
placeholder="请输入满减金额"
|
||||
class="input-demo"
|
||||
:min="0"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="24">
|
||||
<a-col a-col :span="24">
|
||||
<a-form-item field="min_usable_number" label="单商品最小可使用数量:">
|
||||
<a-input-number v-model="modalForm.min_usable_number" :style="{width:'320px'}" placeholder="请输入单商品最小可使用数量" class="input-demo" :min="1" />
|
||||
</a-form-item>
|
||||
<a-input-number
|
||||
v-model="modalForm.min_usable_number"
|
||||
:style="{ width: '320px' }"
|
||||
placeholder="请输入单商品最小可使用数量"
|
||||
class="input-demo"
|
||||
:min="1"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="24">
|
||||
<a-col a-col :span="24">
|
||||
<a-form-item field="distribution_with_day" label="发放关联天数:">
|
||||
<a-input-number v-model="modalForm.distribution_with_day" :style="{width:'320px'}" placeholder="请输入发放关联天数" class="input-demo" :min="1" />
|
||||
</a-form-item>
|
||||
<a-input-number
|
||||
v-model="modalForm.distribution_with_day"
|
||||
:style="{ width: '320px' }"
|
||||
placeholder="请输入发放关联天数"
|
||||
class="input-demo"
|
||||
:min="1"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="24">
|
||||
<!-- <a-row :gutter="24">
|
||||
<a-col a-col :span="24">
|
||||
<a-form-item field="brand_id" label="关联品牌:">
|
||||
<a-input-number v-model="modalForm.brand_id" :style="{width:'320px'}" placeholder="请选择关联品牌" class="input-demo" :min="1" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row> -->
|
||||
<a-row :gutter="24" v-if="showProduct">
|
||||
<a-col a-col :span="24">
|
||||
<a-form-item field="product_id" label="关联商品:">
|
||||
<a-input-number
|
||||
v-model="modalForm.product_id"
|
||||
:style="{ width: '320px' }"
|
||||
placeholder="请选择关联商品"
|
||||
class="input-demo"
|
||||
:min="1"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="24">
|
||||
<a-col a-col :span="24">
|
||||
<a-form-item field="product_id" label="关联商品:">
|
||||
<a-input-number v-model="modalForm.product_id" :style="{width:'320px'}" placeholder="请选择关联商品" class="input-demo" :min="1" />
|
||||
</a-form-item>
|
||||
<a-form-item field="is_display" label="是否展示:">
|
||||
<a-switch v-model="modalForm.is_display" :checked-value="1" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="24">
|
||||
<a-col a-col :span="24">
|
||||
<a-form-item field="is_mutex" label="是否互斥:">
|
||||
<a-switch v-model="modalForm.is_mutex" :checked-value="1" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="24">
|
||||
<a-col a-col :span="24">
|
||||
<a-form-item
|
||||
field="is_reissuable_after_expire"
|
||||
label="是否允许过期之后再次发放:"
|
||||
>
|
||||
<a-switch
|
||||
v-model="modalForm.is_reissuable_after_expire"
|
||||
:checked-value="1"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="24">
|
||||
<a-col a-col :span="24">
|
||||
<a-form-item field="inquiry_type" label="是否发放:">
|
||||
<a-switch v-model="modalForm.coupon_status" :checked-value="1" :disabled="modalForm.coupon_status==1"/>
|
||||
</a-form-item>
|
||||
<a-switch
|
||||
v-model="modalForm.coupon_status"
|
||||
:checked-value="1"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="24">
|
||||
<a-col a-col :span="24">
|
||||
<a-form-item field="is_popup" label="是否弹窗:">
|
||||
<a-switch
|
||||
v-model="modalForm.is_popup"
|
||||
:checked-value="1"
|
||||
:unchecked-value="0"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="24">
|
||||
<a-col a-col :span="12">
|
||||
<a-form-item field="coupon_desc" label="优惠卷描述:">
|
||||
<a-textarea
|
||||
v-model="modalForm.coupon_desc"
|
||||
placeholder="请输入优惠卷描述"
|
||||
allow-clear
|
||||
:style="{ minHeight: '100px' }"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
@ -166,75 +297,33 @@
|
||||
<a-row :gutter="24" style="margin-top: 35px">
|
||||
<a-col :span="24">
|
||||
<a-form-item field="" label="" no-style>
|
||||
<a-space
|
||||
style="margin-right: 8px"
|
||||
>
|
||||
<a-space style="margin-right: 8px" v-if="!modalForm.coupon_id">
|
||||
<a-button
|
||||
type="primary"
|
||||
v-has="'admin:sysProductList:report'"
|
||||
@click="
|
||||
() => {
|
||||
isVisible = true;
|
||||
modalForm.coupon_id='';
|
||||
}
|
||||
"
|
||||
@click="handleAddCoupon"
|
||||
>添加</a-button
|
||||
>
|
||||
</a-space>
|
||||
<!-- 订单状态=2退款状态=4,5支付状态=2上报状态!=1 -->
|
||||
<a-space
|
||||
style="margin-right: 8px"
|
||||
|
||||
>
|
||||
|
||||
<a-space style="margin-right: 8px" v-else>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-has="'admin:sysProductList:cancel'"
|
||||
status="danger"
|
||||
@click="
|
||||
() => {
|
||||
okVisible = true;
|
||||
modalForm.coupon_id='';
|
||||
}
|
||||
"
|
||||
>保存</a-button
|
||||
@click="handleUpdateCoupon"
|
||||
>修改</a-button
|
||||
>
|
||||
</a-space>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-modal>
|
||||
<!-- 医生详情弹框 -->
|
||||
<doctorModal
|
||||
:doctorVisible="doctorVisible"
|
||||
:doctor_id="doctor_id"
|
||||
@doctorVisibleChange="
|
||||
() => {
|
||||
doctorVisible = false;
|
||||
doctor_id = '';
|
||||
}
|
||||
"
|
||||
></doctorModal>
|
||||
<!-- 患者详情弹窗 -->
|
||||
<patientModal
|
||||
:patientVisible="patientVisible"
|
||||
:data="patientData"
|
||||
@patientVisibleChange="
|
||||
() => {
|
||||
patientVisible = false;
|
||||
}
|
||||
"
|
||||
></patientModal>
|
||||
</template>
|
||||
<script setup>
|
||||
import { ref, toRefs, reactive, watch, nextTick } from 'vue';
|
||||
import { formatDoctorTitle } from '@/utils/format';
|
||||
import { parseTime } from '@/utils/parseTime';
|
||||
import { inquiryCase } from '@/api/order/list';
|
||||
import {
|
||||
formatInquiryType,
|
||||
formatInquiryStatus,
|
||||
formatMode,
|
||||
} from '@/utils/format';
|
||||
import { ref, toRefs, reactive, watch} from 'vue';
|
||||
import { addCoupon,updateCoupon } from '@/api/coupon/list';
|
||||
import { Message } from '@arco-design/web-vue';
|
||||
const emits = defineEmits(['closeChange']);
|
||||
const props = defineProps({
|
||||
// 是否显示
|
||||
@ -245,51 +334,106 @@ const props = defineProps({
|
||||
modalForm: {
|
||||
type: Object,
|
||||
default: {
|
||||
order_inquiry_case: {
|
||||
inquiry_case_id: '',
|
||||
},
|
||||
|
||||
},
|
||||
},
|
||||
});
|
||||
const doctorVisible = ref(false);
|
||||
const doctor_id = ref('');
|
||||
const patientVisible = ref(false);
|
||||
|
||||
const patientData = reactive({});
|
||||
const valid_start_time = ref('');
|
||||
const valid_end_time = ref('');
|
||||
const { modalVisible, modalForm } = toRefs(props);
|
||||
const showManjian = ref(false);
|
||||
const showMinNumber = ref(false);
|
||||
const showConnectType = ref(false);
|
||||
const showProduct = ref(false);
|
||||
const showTimeRange =ref(false);
|
||||
const showValidDay = ref(false);
|
||||
const defaultValue = ref([]);
|
||||
const changeType = (val) => {
|
||||
showManjian.value = false;
|
||||
showMinNumber.value = false;
|
||||
if (val == 2) {
|
||||
showManjian.value = true;
|
||||
} else if (val == 3) {
|
||||
showMinNumber.value = true;
|
||||
}
|
||||
};
|
||||
const changeValidType = (val) => {
|
||||
showTimeRange.value=false;
|
||||
showValidDay.value=false;
|
||||
if (val == 1) {
|
||||
showTimeRange.value=true;
|
||||
}else{
|
||||
showValidDay.value=true;
|
||||
}
|
||||
};
|
||||
const changeScope = (val) => {
|
||||
showConnectType.value = false;
|
||||
showProduct.value = false;
|
||||
showManjian.value = false;
|
||||
showMinNumber.value = false;
|
||||
if (val == 1) {
|
||||
modalForm.coupon_type == 2 && (showManjian.value = true);
|
||||
modalForm.coupon_type == 3 && (showMinNumber.value = true);
|
||||
} else if (val == 2) {
|
||||
showConnectType.value = true;
|
||||
} else if (val == 5) {
|
||||
showProduct.value = true;
|
||||
}
|
||||
};
|
||||
const changeObject = (val) => {
|
||||
showMinNumber.value = false;
|
||||
if(val==4){
|
||||
showMinNumber.value = true;
|
||||
};
|
||||
};
|
||||
|
||||
const order_inquiry_id = ref('');
|
||||
watch(
|
||||
() => props.modalForm,
|
||||
() => {
|
||||
if (
|
||||
props.modalForm.order_inquiry_case &&
|
||||
props.modalForm.order_inquiry_case.inquiry_case_id
|
||||
) {
|
||||
let id = props.modalForm.order_inquiry_case.inquiry_case_id;
|
||||
inquiryCase(id).then((data) => {
|
||||
Object.assign(patientData, data.data);
|
||||
});
|
||||
console.log(props.modalForm);
|
||||
if(props.modalForm.coupon_id){
|
||||
changeType(props.modalForm.coupon_type);
|
||||
changeScope(props.modalForm.application_scope);
|
||||
changeObject(props.modalForm.distribution_object);
|
||||
changeValidType(props.modalForm.valid_type)
|
||||
}
|
||||
},
|
||||
{ immediate: true, deep: true }
|
||||
);
|
||||
const changeType=(val)=>{
|
||||
alert(val)
|
||||
}
|
||||
const changeValidType=(val)=>{
|
||||
alert(val)
|
||||
}
|
||||
const changeScope=(val)=>{
|
||||
alert(val)
|
||||
}
|
||||
const changeObject=(val)=>{
|
||||
alert(val)
|
||||
}
|
||||
const onOk = (dateString, date) => {
|
||||
[valid_start_time.value, valid_end_time.value] = dateString;
|
||||
};
|
||||
|
||||
|
||||
const handleClose = () => {
|
||||
emits('closeChange', (modalVisible.value = false));
|
||||
};
|
||||
const disabledDate = (time) => {
|
||||
return time.getTime() < Date.now() - 8.64e7;
|
||||
};
|
||||
const handleAddCoupon=async()=>{
|
||||
const {code}=await addCoupon({
|
||||
|
||||
})
|
||||
if(code==200){
|
||||
Message.success("添加成功");
|
||||
handleClose();
|
||||
}
|
||||
};
|
||||
const handleUpdateCoupon=async()=>{
|
||||
const {code}=await updateCoupon({
|
||||
|
||||
})
|
||||
if(code==200){
|
||||
Message.success("修改成功");
|
||||
handleClose()
|
||||
}
|
||||
};
|
||||
const rules = {
|
||||
coupon_name: [{ required: true, message: '请输入优惠卷名称' }],
|
||||
department_custom_id: [{ required: true, message: '请选择所在科室' }],
|
||||
};
|
||||
|
||||
</script>
|
||||
<style scoped>
|
||||
.infobox {
|
||||
|
||||
@ -464,6 +464,7 @@
|
||||
type="primary"
|
||||
v-has="'admin:sysProductList:cancel'"
|
||||
status="danger"
|
||||
v-show="showCancelOrderBtn"
|
||||
@click="
|
||||
() => {
|
||||
okVisible = true;
|
||||
@ -503,7 +504,7 @@
|
||||
:api="cancelProduct"
|
||||
:dealType="'order_inquiry_id'"
|
||||
:payment_amount_total="modalForm.payment_amount_total
|
||||
"
|
||||
" :type="'service'"
|
||||
:id="cur_product_id"
|
||||
@closeChange="closeChange"
|
||||
></confirmModal>
|
||||
@ -541,7 +542,10 @@ const props = defineProps({
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
|
||||
showCancelOrderBtn:{
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
modalForm: {
|
||||
type: Object,
|
||||
default: {
|
||||
@ -553,7 +557,7 @@ const props = defineProps({
|
||||
},
|
||||
},
|
||||
});
|
||||
const { medinceVisible, modalForm } = toRefs(props);
|
||||
const { medinceVisible, modalForm,showCancelOrderBtn } = toRefs(props);
|
||||
const IMG_URL = import.meta.env.VITE_IMG_URL;
|
||||
const emits = defineEmits(['medinceVisibleChange']);
|
||||
|
||||
|
||||
@ -728,9 +728,7 @@
|
||||
|
||||
<a-space
|
||||
style="margin-right: 8px"
|
||||
v-if="
|
||||
modalForm.order_service_status == 2 ||
|
||||
modalForm.order_service_status == 3 || modalForm.order_service_status == 4
|
||||
v-if="modalForm.order_service_status == 3 || modalForm.order_service_status == 4
|
||||
"
|
||||
>
|
||||
<a-button
|
||||
@ -1058,7 +1056,7 @@
|
||||
|
||||
|
||||
<!-- 药品订单详情Modal -->
|
||||
<medinceOrderModal :medinceVisible="medinceVisible" :modalForm="modalMedinceForm" @medinceVisibleChange="()=>{medinceVisible=false; modalMedinceForm.refund_status=5}"></medinceOrderModal>
|
||||
<medinceOrderModal :showCancelOrderBtn="false" :medinceVisible="medinceVisible" :modalForm="modalMedinceForm" @medinceVisibleChange="()=>{medinceVisible=false; modalMedinceForm.refund_status=5}"></medinceOrderModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user