| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185 |
- <style scoped lang="scss">
- </style>
- <template>
- <div class="system-dialog-container">
- <el-drawer
- :title="state.dialog.title"
- v-model="state.dialog.isShowDialog"
- width="820px"
- append-to-body
- destroy-on-close
- :close-on-click-modal="false"
- >
- <el-form
- :model="state.form"
- :rules="rules"
- label-position="left"
- ref="formRef"
- size="default"
- label-width="100px"
- class="mt5">
- <el-input
- v-model="state.formQuery.adminUserId"
- placeholder="客户用户id"
- clearable
- class="wd150">
- </el-input>
- <el-input
- v-model="state.formQuery.adminUserName"
- placeholder="客户姓名"
- clearable
- class="wd150">
- </el-input>
- <el-input
- v-model="state.formQuery.stationId"
- placeholder="站点id"
- clearable
- class="wd150">
- </el-input>
- <el-input
- v-model="state.formQuery.vatRate"
- placeholder="增值税率 0.06表示6%"
- clearable
- class="wd150">
- </el-input>
- <el-input
- v-model="state.formQuery.splittingProportion"
- placeholder="分成比例 0.45表示45%"
- clearable
- class="wd150">
- </el-input>
- <el-input
- v-model="state.formQuery.accountName"
- placeholder="账户名"
- clearable
- class="wd150">
- </el-input>
- <el-input
- v-model="state.formQuery.telephone"
- placeholder="电话号码"
- clearable
- class="wd150">
- </el-input>
- <el-input
- v-model="state.formQuery.bankName"
- placeholder="开户行名称"
- clearable
- class="wd150">
- </el-input>
- <el-input
- v-model="state.formQuery.bankCardNo"
- placeholder="银行卡号"
- clearable
- class="wd150">
- </el-input>
- <el-input
- v-model="state.formQuery.status"
- placeholder="状态:0-无效,1-有效"
- clearable
- class="wd150">
- </el-input>
- <el-input
- v-model="state.formQuery.remark"
- placeholder="备注"
- clearable
- class="wd150">
- </el-input>
- </el-form>
- <template #footer>
- <div class="dialog-footer">
- <el-button @click="onCancel" size="default">取 消</el-button>
- <el-button :loading="state.btnLoading" type="primary" @click="onSubmit" size="default">{{ state.dialog.submitTxt }}</el-button>
- </div>
- </template>
- </el-drawer>
- </div>
- </template>
- <script setup lang="ts" name="InvestorInfoDialog">
- import {defineAsyncComponent, reactive, onMounted, ref} from 'vue';
- import {Msg} from "/@/utils/message";
- import {$body, $get} from "/@/utils/request";
- import u from '/@/utils/u'
- // 定义子组件向父组件传值/事件
- const emit = defineEmits(['refresh']);
- const formRef = ref();
- //定义初始变量,重置使用
- const initState = ()=>({
- ruleForm: {
- id:0
- },
- btnLoading: false,
- dialog: {
- isShowDialog: false,
- type: '',
- title: '',
- submitTxt: '',
- },
- rules: {},
- })
- // 定义变量内容
- const state = reactive(initState());
- // 打开弹窗
- const open = (action: string='add', row: any) => {
- state.dialog.title = u.dialog.actions[action].title +"『投资者-物业信息表』"
- state.dialog.submitTxt = u.dialog.actions[action].btn +"『投资者-物业信息表』"
- state.dialog.isShowDialog = true;
- if (action !=='add') {
- loadData(row.id);
- }
- };
- // 关闭弹窗
- const onClose = () => {
- state.dialog.isShowDialog = false;
- Object.assign(state,initState())
- };
- // 取消
- const onCancel = () => {
- onClose();
- };
- // 提交
- const onSubmit = () => {
- formRef.value.validate((valid, fields) => {
- // console.log('basic checkForm!', valid,fields)
- if (valid) {
- state.btnLoading = true;
- const url = state.ruleForm.id > 0 ? "investorInfo/modify" : "investorInfo/add"
- $body(url, state.ruleForm).then(() => {
- state.btnLoading = false;
- Msg.message('操作成功');
- console.log('submit!')
- onClose();
- emit('refresh');
- })
- } else {
- state.btnLoading = false;
- Msg.message('表单校验失败', 'error');
- }
- })
- };
- const handleFormChange = (formData: any) => {
- console.log(formData)
- }
- // 初始化表格数据
- const loadData = (id: any) => {
- $get(`investorInfo/detail/${id}`).then((res: any) => {
- state.ruleForm = res;
- })
- }
- // 暴露变量
- defineExpose({
- open
- });
- </script>
|