饭卡充值钱包类型选择暂时禁用
This commit is contained in:
1 parent
37c775b7ab
commit
e999023c83
3 files changed
+107
-96
No files matched your search
@@ -31,12 +31,14 @@ import { getWalletTypeSimple } from "/@/api/wallet/wallet-type"
|
|||||||
|
|
||||||
const selectId = defineModel()
|
const selectId = defineModel()
|
||||||
|
|
||||||
export type Props = {
|
const props = withDefaults(
|
||||||
placeholder?: string
|
defineProps<{
|
||||||
}
|
placeholder?: string
|
||||||
const props = withDefaults(defineProps<Props>(), {
|
}>(),
|
||||||
placeholder: "请选择",
|
{
|
||||||
})
|
placeholder: "请选择",
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
const queryForm = reactive<any>({
|
const queryForm = reactive<any>({
|
||||||
name: "",
|
name: "",
|
||||||
|
|||||||
@@ -1,122 +1,127 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog :title="form.id ? '编辑' : '新增'" v-model="visible" width="30%" :close-on-click-modal="false" draggable>
|
<el-dialog :title="form.id ? '编辑' : '新增'" v-model="visible" width="30%" :close-on-click-modal="false" draggable>
|
||||||
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="90px" v-loading="loading">
|
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="90px" v-loading="loading">
|
||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<el-col :span="24" class="mb20">
|
<el-col :span="24" class="mb20">
|
||||||
<el-form-item label="充值时间" prop="importTime">
|
<el-form-item label="充值时间" prop="importTime">
|
||||||
<el-date-picker v-model="form.importTime" type="month" value-format="YYYY-MM-DD" placeholder="请选择充值时间" />
|
<el-date-picker v-model="form.importTime" type="month" value-format="YYYY-MM-DD" placeholder="请选择充值时间" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="24" class="mb20">
|
<el-col :span="24" class="mb20">
|
||||||
<el-form-item label="充值类型" prop="bizType">
|
<el-form-item label="充值类型" prop="bizType">
|
||||||
<dict-select v-model="form.bizType" dict-code="wallet_biz_recharge" placeholder="请选择饭卡类型" />
|
<dict-select v-model="form.bizType" dict-code="wallet_biz_recharge" placeholder="请选择饭卡类型" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="24" class="mb20">
|
<el-col :span="24" class="mb20">
|
||||||
<el-form-item label="钱包" prop="walletTypeId">
|
<el-form-item label="钱包" prop="walletTypeId">
|
||||||
<select-wallet-type v-model="form.walletTypeId" placeholder="请选择钱包" />
|
<!-- <select-wallet-type v-model="form.walletTypeId" placeholder="请选择钱包" :disabled="false" /> -->
|
||||||
</el-form-item>
|
<el-select v-model="form.walletTypeId" :disabled="true">
|
||||||
</el-col>
|
<el-option v-for="item in walletTypeOptions" :key="item.id" :label="item.name" :value="item.id" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="24" class="mb20">
|
<el-col :span="24" class="mb20">
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="备注" prop="remark">
|
||||||
<el-input v-model="form.remark" placeholder="请输入备注" type="textarea" :autosize="{ minRows: 6 }" />
|
<el-input v-model="form.remark" placeholder="请输入备注" type="textarea" :autosize="{ minRows: 6 }" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
</el-row>
|
||||||
</el-row>
|
</el-form>
|
||||||
</el-form>
|
<template #footer>
|
||||||
<template #footer>
|
<span class="dialog-footer">
|
||||||
<span class="dialog-footer">
|
<el-button @click="visible = false">取消</el-button>
|
||||||
<el-button @click="visible = false">取消</el-button>
|
<el-button type="primary" @click="onSubmit" :disabled="loading">确认</el-button>
|
||||||
<el-button type="primary" @click="onSubmit" :disabled="loading">确认</el-button>
|
</span>
|
||||||
</span>
|
</template>
|
||||||
</template>
|
</el-dialog>
|
||||||
</el-dialog>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts" name="WalletRechargeApplyDialog">
|
<script setup lang="ts" name="WalletRechargeApplyDialog">
|
||||||
import { useDict } from '/@/hooks/dict';
|
import { useMessage } from "/@/hooks/message"
|
||||||
import { useMessage } from "/@/hooks/message";
|
import { getObj, addObj, putObj } from "/@/api/wallet/wallet-recharge-apply"
|
||||||
import { getObj, addObj, putObj } from '/@/api/wallet/wallet-recharge-apply'
|
const emit = defineEmits(["refresh"])
|
||||||
import { rule } from '/@/utils/validate';
|
import { getWalletTypeSimple } from "/@/api/wallet/wallet-type"
|
||||||
const emit = defineEmits(['refresh']);
|
|
||||||
|
|
||||||
// 定义变量内容
|
// 定义变量内容
|
||||||
const dataFormRef = ref();
|
const dataFormRef = ref()
|
||||||
const visible = ref(false)
|
const visible = ref(false)
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
// 定义字典
|
// 定义字典
|
||||||
|
|
||||||
// 提交表单数据
|
// 提交表单数据
|
||||||
const form = reactive({
|
const form = reactive({
|
||||||
id: '',
|
id: "",
|
||||||
userId: '',
|
userId: "",
|
||||||
bizType: '',
|
bizType: "",
|
||||||
walletTypeId: '',
|
walletTypeId: "",
|
||||||
deptId: '',
|
deptId: "",
|
||||||
importTime: '',
|
importTime: "",
|
||||||
remark: '',
|
remark: "",
|
||||||
});
|
})
|
||||||
|
const walletTypeOptions = ref()
|
||||||
|
|
||||||
// 定义校验规则
|
// 定义校验规则
|
||||||
const dataRules = ref({
|
const dataRules = ref({
|
||||||
importTime: [{ required: true, message: '导入时间(手动选择)不能为空', trigger: 'change' }],
|
importTime: [{ required: true, message: "导入时间(手动选择)不能为空", trigger: "change" }],
|
||||||
bizType: [{ required: true, message: '请选择充值类型', trigger: 'change' }],
|
bizType: [{ required: true, message: "请选择充值类型", trigger: "change" }],
|
||||||
walletTypeId: [{ required: true, message: '请选择钱包类型', trigger: 'change' }],
|
walletTypeId: [{ required: true, message: "请选择钱包类型", trigger: "change" }],
|
||||||
})
|
})
|
||||||
|
|
||||||
// 打开弹窗
|
// 打开弹窗
|
||||||
const openDialog = (id: string) => {
|
const openDialog = async (id: string) => {
|
||||||
visible.value = true
|
visible.value = true
|
||||||
form.id = ''
|
form.id = ""
|
||||||
|
|
||||||
// 重置表单数据
|
// 重置表单数据
|
||||||
nextTick(() => {
|
dataFormRef.value?.resetFields()
|
||||||
dataFormRef.value?.resetFields();
|
|
||||||
});
|
|
||||||
|
|
||||||
// 获取walletRechargeApply信息
|
// 获取walletRechargeApply信息
|
||||||
if (id) {
|
if (id) {
|
||||||
form.id = id
|
form.id = id
|
||||||
getwalletRechargeApplyData(id)
|
getwalletRechargeApplyData(id)
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
const res = await getWalletTypeSimple()
|
||||||
|
walletTypeOptions.value = res.data.records
|
||||||
|
form.walletTypeId = res.data.records.find((item: any) => item.uniqueCode == "1").id
|
||||||
|
}
|
||||||
|
|
||||||
// 提交
|
// 提交
|
||||||
const onSubmit = async () => {
|
const onSubmit = async () => {
|
||||||
const valid = await dataFormRef.value.validate().catch(() => { });
|
const valid = await dataFormRef.value.validate().catch(() => {})
|
||||||
if (!valid) return false;
|
if (!valid) return false
|
||||||
|
|
||||||
try {
|
|
||||||
loading.value = true;
|
|
||||||
form.id ? await putObj(form) : await addObj(form);
|
|
||||||
useMessage().success(form.id ? '修改成功' : '添加成功');
|
|
||||||
visible.value = false;
|
|
||||||
emit('refresh');
|
|
||||||
} catch (err: any) {
|
|
||||||
useMessage().error(err.msg);
|
|
||||||
} finally {
|
|
||||||
loading.value = false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
try {
|
||||||
|
loading.value = true
|
||||||
|
form.id ? await putObj(form) : await addObj(form)
|
||||||
|
useMessage().success(form.id ? "修改成功" : "添加成功")
|
||||||
|
visible.value = false
|
||||||
|
emit("refresh")
|
||||||
|
} catch (err: any) {
|
||||||
|
useMessage().error(err.msg)
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 初始化表单数据
|
// 初始化表单数据
|
||||||
const getwalletRechargeApplyData = (id: string) => {
|
const getwalletRechargeApplyData = (id: string) => {
|
||||||
// 获取数据
|
// 获取数据
|
||||||
loading.value = true
|
loading.value = true
|
||||||
getObj(id).then((res: any) => {
|
getObj(id)
|
||||||
Object.assign(form, res.data)
|
.then((res: any) => {
|
||||||
}).finally(() => {
|
Object.assign(form, res.data)
|
||||||
loading.value = false
|
})
|
||||||
})
|
.finally(() => {
|
||||||
};
|
loading.value = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 暴露变量
|
// 暴露变量
|
||||||
defineExpose({
|
defineExpose({
|
||||||
openDialog
|
openDialog,
|
||||||
});
|
})
|
||||||
</script>
|
</script>
|
||||||
@@ -74,7 +74,11 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="deptName" width="200" label="部门" />
|
<el-table-column prop="deptName" width="200" label="部门" />
|
||||||
<el-table-column prop="importTime" width="100" label="充值月" />
|
<el-table-column prop="importTime" width="100" label="充值月">
|
||||||
|
<template #default="{ row }">
|
||||||
|
{{ row.importTime?.substring(0, 7) }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column prop="processStatus" width="100" label="审核状态">
|
<el-table-column prop="processStatus" width="100" label="审核状态">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<dict-tag :options="check_status" :value="row.processStatus" />
|
<dict-tag :options="check_status" :value="row.processStatus" />
|
||||||
|
|||||||
Reference in new issue
Block a user