|
@@ -1,9 +1,12 @@
|
|
|
<script setup lang="ts">
|
|
|
-import { reactive, ref, computed } from "vue";
|
|
|
+import { reactive, ref, computed, watchEffect } from "vue";
|
|
|
import { ElForm } from "element-plus";
|
|
|
|
|
|
const props = defineProps<{
|
|
|
isNormal?: boolean;
|
|
|
+ isJs?: boolean;
|
|
|
+ isOutMonth?: string;
|
|
|
+ invType?: string;
|
|
|
}>();
|
|
|
|
|
|
const emit = defineEmits(["approval"]);
|
|
@@ -14,7 +17,7 @@ const formData = reactive({
|
|
|
return_type: "2",
|
|
|
return_reason: "",
|
|
|
remark: "",
|
|
|
- status: "",
|
|
|
+ status: "1",
|
|
|
invCode: "",
|
|
|
invNum: "",
|
|
|
open_date: "",
|
|
@@ -46,7 +49,7 @@ const rules = reactive({
|
|
|
],
|
|
|
remark: [
|
|
|
{
|
|
|
- required: true,
|
|
|
+ required: false,
|
|
|
trigger: "change",
|
|
|
message: "请输入备注"
|
|
|
}
|
|
@@ -106,10 +109,27 @@ const noPassRule = reactive({
|
|
|
});
|
|
|
|
|
|
const formRef = ref<InstanceType<typeof ElForm>>(null);
|
|
|
+const outMonthAndPaper = ref(false);
|
|
|
|
|
|
const handlePaymentReceipt = () => {
|
|
|
- formRef.value.validate(isValid => isValid && emit("approval", formData));
|
|
|
+ formRef.value.validate(
|
|
|
+ isValid => isValid && emit("approval", formData, outMonthAndPaper)
|
|
|
+ );
|
|
|
};
|
|
|
+
|
|
|
+watchEffect(() => (formData.return_type = props.isJs ? "1" : "2"));
|
|
|
+
|
|
|
+watchEffect(() => {
|
|
|
+ const { invType, isOutMonth } = props;
|
|
|
+ //类型是否跨月
|
|
|
+ outMonthAndPaper.value =
|
|
|
+ String(isOutMonth) === "1" &&
|
|
|
+ (invType === "normal" || invType === "special");
|
|
|
+
|
|
|
+ //校验码是否必填
|
|
|
+ rules.checkCode[0].required =
|
|
|
+ invType === "special_electronic" || invType === "electronic";
|
|
|
+});
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
@@ -127,14 +147,14 @@ const handlePaymentReceipt = () => {
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
|
|
|
- <template v-if="formData.status !== '3'">
|
|
|
+ <template v-if="formData.status !== '3' || outMonthAndPaper">
|
|
|
<el-form-item label="退票方式" prop="return_type">
|
|
|
<el-select
|
|
|
w-300px
|
|
|
v-model="formData.return_type"
|
|
|
placeholder="请选择退票方式"
|
|
|
>
|
|
|
- <el-option value="1" label="金税" />
|
|
|
+ <el-option :disabled="!isJs" value="1" label="金税" />
|
|
|
<el-option value="2" label="线下" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|