客户自定义表单流程
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
<template>
|
||||
<div class="bankListTb">
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" width="60%" :title="getTitle" @ok="handleSubmit" >
|
||||
<BasicModal v-bind="$attrs" :zIndex="2000" @register="registerModal" width="60%" :title="getTitle" @ok="handleSubmit"
|
||||
@visible-change="handleVisibleChange" >
|
||||
<BasicTable @register="registerTable" class="bankListModal">
|
||||
|
||||
</BasicTable>
|
||||
@ -9,7 +10,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, computed, unref } from 'vue';
|
||||
import { ref, computed, unref, nextTick } from 'vue';
|
||||
import { BasicModal, useModalInner, useModal } from '/@/components/Modal';
|
||||
import { BasicForm, useForm } from '/@/components/Form/index';
|
||||
import { BasicTable, useTable, FormSchema, BasicColumn, TableAction } from '/@/components/Table';
|
||||
@ -111,7 +112,7 @@
|
||||
}
|
||||
});
|
||||
|
||||
const [registerTable, { getDataSource, setTableData, updateTableDataRecord }] = useTable({
|
||||
const [registerTable, { getDataSource, setTableData, updateTableDataRecord, reload }] = useTable({
|
||||
title: t('银行列表'),
|
||||
api: getLngBBankPage,
|
||||
columns,
|
||||
@ -124,6 +125,7 @@
|
||||
schemas: codeFormSchema,
|
||||
showResetButton: true,
|
||||
},
|
||||
immediate: false, // 设置为不立即调用
|
||||
beforeFetch: (params) => {
|
||||
return { ...params, valid: 'Y'};
|
||||
},
|
||||
@ -132,6 +134,13 @@
|
||||
onChange: onSelectChange
|
||||
},
|
||||
});
|
||||
const handleVisibleChange = (visible: boolean) => {
|
||||
if (visible) {
|
||||
nextTick(() => {
|
||||
reload();
|
||||
});
|
||||
}
|
||||
};
|
||||
function onSelectChange(rowKeys: string[], e) {
|
||||
selectedKeys.value = rowKeys;
|
||||
selectedValues.value = e
|
||||
|
||||
@ -75,7 +75,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
|
||||
console.log(isUpdate, 8,!unref(isUpdate),data?.isUpdate )
|
||||
disable.value = data?.btnType == 'view' ? true : false
|
||||
if (unref(isUpdate)) {
|
||||
formState=data.record || {}
|
||||
Object.assign(formState, data.record || {})
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" destroyOnClose @register="registerModal" showFooter :title="getTitle" width="40%" @ok="handleSubmit" @cancel="handleCancel">
|
||||
<BasicModal v-bind="$attrs" destroyOnClose @register="registerModal" showFooter :title="getTitle" width="40%" @ok="handleSubmit" @cancel="handleCancel" :showOkBtn="!isDisable">
|
||||
<a-form ref="formRef" :model="formState" :rules="rules" v-bind="{labelCol: { span: 8 },wrapperCol: { span: 16 },}">
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="证书名称" name="docTypeCode" :label-col="{ span: 4 }" :wrapper-col="{ span: 24 }">
|
||||
<a-select v-model:value="formState.docTypeCode" placeholder="请选择证书名称" style="width: 100%" allow-clear>
|
||||
<a-select v-model:value="formState.docTypeCode" placeholder="请选择证书名称" :disabled="isDisable" style="width: 100%" allow-clear>
|
||||
<a-select-option v-for="item in optionList" :key="item.code" :value="item.code">
|
||||
{{ item.fullName }}
|
||||
</a-select-option>
|
||||
@ -13,22 +13,22 @@
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="有效期开始" name="dateFrom" :label-col="{ span: 8 }" :wrapper-col="{ span: 24 }">
|
||||
<a-date-picker v-model:value="formState.dateFrom" format="YYYY-MM-DD" :disabled-date="disabledDateStart" style="width: 100%" placeholder="请选择有效期开始" />
|
||||
<a-date-picker v-model:value="formState.dateFrom" format="YYYY-MM-DD" :disabled="isDisable" :disabled-date="disabledDateStart" style="width: 100%" placeholder="请选择有效期开始" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="有效期结束" name="dateTo" :label-col="{ span: 8 }" :wrapper-col="{ span: 24 }">
|
||||
<a-date-picker v-model:value="formState.dateTo" format="YYYY-MM-DD" :disabled-date="disabledDateEnd" style="width: 100%" placeholder="请选择有效期结束" />
|
||||
<a-date-picker v-model:value="formState.dateTo" format="YYYY-MM-DD" :disabled="isDisable" :disabled-date="disabledDateEnd" style="width: 100%" placeholder="请选择有效期结束" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="备注" name="note" :label-col="{ span: 4 }" :wrapper-col="{ span: 24 }">
|
||||
<a-textarea v-model:value="formState.note" placeholder="请输入备注,最多50字" :maxlength="50" :auto-size="{ minRows: 2, maxRows: 5 }"/>
|
||||
<a-textarea v-model:value="formState.note" placeholder="请输入备注,最多50字" :disabled="isDisable" :maxlength="50" :auto-size="{ minRows: 2, maxRows: 5 }"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="上传附件" name="parentNname" :label-col="{ span: 4 }" :wrapper-col="{ span: 24 }">
|
||||
<Upload :fileList="formState.fileList" :maxSize="200" :accept="accept"></Upload>
|
||||
<a-form-item label="上传附件" name="fileList" :label-col="{ span: 4 }" :wrapper-col="{ span: 24 }">
|
||||
<Upload v-model:value="formState.filePath" @change="changeUplod" :multiple="true" :maxSize="200" :accept="accept"></Upload>
|
||||
<div style="color: #ccc; font-size: 12px">{{ fileTip }}</div>
|
||||
|
||||
</a-form-item>
|
||||
@ -49,10 +49,11 @@ import Upload from '/@/components/Form/src/components/Upload.vue';
|
||||
import { getDocCpList } from '/@/api/sales/Customer';
|
||||
import type { FormInstance } from 'ant-design-vue';
|
||||
import dayjs from 'dayjs';
|
||||
import { object } from 'vue-types';
|
||||
|
||||
const { t } = useI18n();
|
||||
const isUpdate = ref(true);
|
||||
const disable = ref(false);
|
||||
const isDisable = ref(false);
|
||||
let optionList = reactive([])
|
||||
const fileTip = '支持格式.rar .zip .doc .docx .pdf ,单个文件不能超过20MB';
|
||||
const accept ='.rar,.zip, .doc, .docx, .pdf, .RAR, .ZIP, .DOC, .DOCX, .PDF'
|
||||
@ -62,6 +63,7 @@ const emit = defineEmits(['success','register']);
|
||||
const getTitle = computed(() => (!unref(isUpdate) ? t('新增证书') : t('编辑证书')));
|
||||
let formState = reactive({
|
||||
docTypeCode: '',
|
||||
fileList: []
|
||||
});
|
||||
const rules = {
|
||||
docTypeCode: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
@ -71,9 +73,11 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
|
||||
getOption()
|
||||
setModalProps({ confirmLoading: false });
|
||||
isUpdate.value = !!data?.isUpdate;
|
||||
disable.value = data?.btnType == 'view' ? true : false
|
||||
isDisable.value = data?.btnType == 'view' ? true : false
|
||||
if (unref(isUpdate)) {
|
||||
formState=data.record || {}
|
||||
let dateFrom = data.record?.dateFrom ? dayjs(data.record?.dateFrom) : null
|
||||
let dateTo = data.record?.dateTo ? dayjs(data.record?.dateTo) : null
|
||||
Object.assign(formState, {...data.record,dateFrom, dateTo})
|
||||
}
|
||||
});
|
||||
|
||||
@ -97,6 +101,9 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
|
||||
|
||||
const handleChangeFile = (val) => {
|
||||
|
||||
}
|
||||
function changeUplod (val) {
|
||||
console.log(val, 532)
|
||||
}
|
||||
async function getOption() {
|
||||
optionList = await getDocCpList({'valid': 'Y'})
|
||||
@ -108,13 +115,13 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
|
||||
try {
|
||||
await formRef.value.validate();
|
||||
// 验证通过,提交表单
|
||||
let docNo = (optionList.find(v=>v.code === formState.docTypeCode) || {}).fullName
|
||||
let obj = {
|
||||
...formState,
|
||||
docNo: docNo,
|
||||
dateFrom: formState.dateFrom ? dayjs(formState.dateFrom).format('YYYY-MM-DD') : null,
|
||||
dateTo: formState.dateTo ? dayjs(formState.dateTo).format('YYYY-MM-DD') : null,
|
||||
dateFrom: formState.dateFrom ? dayjs(formState.dateFrom).format('YYYY-MM-DD') : '',
|
||||
dateTo: formState.dateTo ? dayjs(formState.dateTo).format('YYYY-MM-DD') : '',
|
||||
}
|
||||
console.log(obj,543)
|
||||
|
||||
emit('success', obj);
|
||||
notification.success({
|
||||
message: t('操作'),
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<a-spin :spinning="spinning" tip="请稍后...">
|
||||
<div class="page-bg-wrap">
|
||||
<div class="top-toolbar" id="formViewPage">
|
||||
<a-space :size="10" wrap style="gap: 0">
|
||||
<!-- <div class="top-toolbar" id="formViewPage"> -->
|
||||
<!-- <a-space :size="10" wrap style="gap: 0">
|
||||
<a-button style="margin-right: 10px" @click="close">
|
||||
<slot name="icon"><close-outlined /></slot>取消
|
||||
</a-button>
|
||||
@ -19,7 +19,7 @@
|
||||
<slot name="icon"><upload-outlined /></slot>导入
|
||||
</a-button>
|
||||
</a-space>
|
||||
</div>
|
||||
</div> -->
|
||||
<a-form ref="formRef" :model="formState" :rules="rules" v-bind="layout">
|
||||
<a-card title="客户基本信息" :bordered="false" >
|
||||
<div>
|
||||
@ -32,12 +32,12 @@
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="集团编码" name="cuName">
|
||||
<a-input v-model:value="formState.cuName" placeholder="请输入集团编码" />
|
||||
<a-input v-model:value="formState.cuName" :disabled="isDisable" placeholder="请输入集团编码" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="企业性质" name="cuMcode">
|
||||
<a-select v-model:value="formState.cuMcode" placeholder="请选择企业性质" style="width: 100%" allow-clear>
|
||||
<a-select v-model:value="formState.cuMcode" :disabled="isDisable" placeholder="请选择企业性质" style="width: 100%" allow-clear>
|
||||
<a-select-option v-for="item in optionSelect.cuMcodeList" :key="item.code" :value="item.code">
|
||||
{{ item.name }}
|
||||
</a-select-option>
|
||||
@ -46,17 +46,17 @@
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="客户名称" name="cuSname" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||
<a-textarea v-model:value="formState.cuSname" placeholder="请输入客户名称" :auto-size="{ minRows: 1, maxRows: 5 }"/>
|
||||
<a-textarea v-model:value="formState.cuSname" :disabled="isDisable" placeholder="请输入客户名称" :auto-size="{ minRows: 1, maxRows: 5 }"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="客户简称" name="di">
|
||||
<a-input v-model:value="formState.di" placeholder="请输入客户简称" />
|
||||
<a-input v-model:value="formState.di" :disabled="isDisable" placeholder="请输入客户简称" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="国内/国际" name="natureCode">
|
||||
<a-select v-model:value="formState.natureCode" placeholder="请选择国内/国际" style="width: 100%" allow-clear>
|
||||
<a-select v-model:value="formState.natureCode" :disabled="isDisable" placeholder="请选择国内/国际" style="width: 100%" allow-clear>
|
||||
<a-select-option v-for="item in optionSelect.natureCodeList" :key="item.code" :value="item.code">
|
||||
{{ item.name }}
|
||||
</a-select-option>
|
||||
@ -65,47 +65,47 @@
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="母公司名称" name="parentNname">
|
||||
<a-input v-model:value="formState.parentNname" placeholder="请输入母公司名称" />
|
||||
<a-input v-model:value="formState.parentNname" :disabled="isDisable" placeholder="请输入母公司名称" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="统一社会信用代码" name="creditNo">
|
||||
<a-input v-model:value="formState.creditNo" placeholder="请输入统一社会信用代码" />
|
||||
<a-input v-model:value="formState.creditNo" :disabled="isDisable" placeholder="请输入统一社会信用代码" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="纳税人识别号" name="tiNo">
|
||||
<a-input v-model:value="formState.tiNo" placeholder="请输入纳税人识别号" />
|
||||
<a-input v-model:value="formState.tiNo" :disabled="isDisable" placeholder="请输入纳税人识别号" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="法定代表人" name="representative">
|
||||
<a-input v-model:value="formState.representative" placeholder="请输入法定代表人" />
|
||||
<a-input v-model:value="formState.representative" :disabled="isDisable" placeholder="请输入法定代表人" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="成立日期" name="dateEstab">
|
||||
<a-date-picker v-model:value="formState.dateEstab" style="width: 100%" placeholder="请选择成立日期" />
|
||||
<a-date-picker v-model:value="formState.dateEstab" :disabled="isDisable" style="width: 100%" placeholder="请选择成立日期" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="准入时间" name="dateEntry">
|
||||
<a-date-picker v-model:value="formState.dateEntry" style="width: 100%" placeholder="请选择准入时间" />
|
||||
<a-date-picker v-model:value="formState.dateEntry" :disabled="isDisable" style="width: 100%" placeholder="请选择准入时间" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="注册资本(万元)" name="amtReg">
|
||||
<a-input-number v-model:value="formState.amtReg" :min="0" style="width: 100%" placeholder="请输入注册资本"/>
|
||||
<a-input-number v-model:value="formState.amtReg" :disabled="isDisable" :min="0" style="width: 100%" placeholder="请输入注册资本"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="注册地址" name="addrReg" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||
<a-textarea v-model:value="formState.addrReg" placeholder="请输入注册地址" :auto-size="{ minRows: 1, maxRows: 5 }"/>
|
||||
<a-textarea v-model:value="formState.addrReg" :disabled="isDisable" placeholder="请输入注册地址" :auto-size="{ minRows: 1, maxRows: 5 }"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="通讯地址" name="addrMail" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||
<a-textarea v-model:value="formState.addrMail" placeholder="请输入通讯地址" :auto-size="{ minRows: 1, maxRows: 5 }"/>
|
||||
<a-textarea v-model:value="formState.addrMail" :disabled="isDisable" placeholder="请输入通讯地址" :auto-size="{ minRows: 1, maxRows: 5 }"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
@ -128,7 +128,7 @@
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="备注" name="note" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||
<a-textarea v-model:value="formState.note" placeholder="请输入备注,最多200字" :maxlength="200" :auto-size="{ minRows: 2, maxRows: 5 }"/>
|
||||
<a-textarea v-model:value="formState.note" :disabled="isDisable" placeholder="请输入备注,最多200字" :maxlength="200" :auto-size="{ minRows: 2, maxRows: 5 }"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@ -138,7 +138,7 @@
|
||||
<a-row>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="客户分类" name="classCode">
|
||||
<a-select v-model:value="formState.classCode" placeholder="请选择客户分类" style="width: 100%" allow-clear>
|
||||
<a-select v-model:value="formState.classCode" :disabled="isDisable" placeholder="请选择客户分类" style="width: 100%" allow-clear>
|
||||
<a-select-option v-for="item in optionSelect.classCodeList" :key="item.code" :value="item.code">
|
||||
{{ item.name }}
|
||||
</a-select-option>
|
||||
@ -147,7 +147,7 @@
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="客户类别" name="typeCode">
|
||||
<a-select v-model:value="formState.typeCode" placeholder="请选择客户类别" @change="typeCodeChange" style="width: 100%" allow-clear>
|
||||
<a-select v-model:value="formState.typeCode" :disabled="isDisable" placeholder="请选择客户类别" @change="typeCodeChange" style="width: 100%" allow-clear>
|
||||
<a-select-option v-for="item in optionSelect.typeCodeList" :key="item.code" :value="item.code">
|
||||
{{ item.name }}
|
||||
</a-select-option>
|
||||
@ -156,7 +156,7 @@
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="统计分类" name="propCode">
|
||||
<a-select v-model:value="formState.propCode" placeholder="请选择统计分类" style="width: 100%" allow-clear>
|
||||
<a-select v-model:value="formState.propCode" :disabled="isDisable" placeholder="请选择统计分类" style="width: 100%" allow-clear>
|
||||
<a-select-option v-for="item in optionSelect.propCodeList" :key="item.code" :value="item.code">
|
||||
{{ item.name }}
|
||||
</a-select-option>
|
||||
@ -166,11 +166,11 @@
|
||||
<a-col :span="8">
|
||||
<a-form-item label="国有企业持股" name="stateSign" :offset="8">
|
||||
<div style="display: flex;">
|
||||
<a-radio-group v-model:value="formState.stateSign" style="display: flex;" @change="stateSignChange">
|
||||
<a-radio-group v-model:value="formState.stateSign" :disabled="isDisable" style="display: flex;" @change="stateSignChange">
|
||||
<a-radio v-for="item in optionSelect.signList" :value="item.code">{{ item.name }}</a-radio>
|
||||
</a-radio-group>
|
||||
<a-form-item label="持股比例" name="rateShare" style="position: relative;">
|
||||
<a-input-number v-model:value="formState.rateShare" :disabled="formState.stateSign!='Y'" :min="0" :max="100"></a-input-number>
|
||||
<a-input-number v-model:value="formState.rateShare" style="width: 80px" :disabled="formState.stateSign!='Y' || isDisable" :min="0" :max="100"></a-input-number>
|
||||
<span class="rateStyle">%</span>
|
||||
</a-form-item>
|
||||
</div>
|
||||
@ -178,31 +178,31 @@
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="第一大股东名称" name="shareName">
|
||||
<a-input v-model:value="formState.shareName" placeholder="请输入第一大股东名称" />
|
||||
<a-input v-model:value="formState.shareName" :disabled="isDisable" placeholder="请输入第一大股东名称" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="集团持股比例" name="rateShareGn">
|
||||
<a-input-number v-model:value="formState.rateShareGn" style="width: 100%" :min="0" :max="100"></a-input-number>
|
||||
<a-input-number v-model:value="formState.rateShareGn" :disabled="isDisable" style="width: 100%" :min="0" :max="100"></a-input-number>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="预付款校验" name="prepaySign">
|
||||
<a-radio-group v-model:value="formState.prepaySign">
|
||||
<a-radio-group v-model:value="formState.prepaySign" :disabled="isDisable">
|
||||
<a-radio v-for="item in optionSelect.signList" :value="item.code">{{ item.name }}</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="竞拍" name="onlineSign">
|
||||
<a-radio-group v-model:value="formState.onlineSign">
|
||||
<a-radio-group v-model:value="formState.onlineSign" :disabled="isDisable">
|
||||
<a-radio v-for="item in optionSelect.signList" :value="item.code">{{ item.code == 'Y'?'有': '无' }}</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="自有终端" name="tSign">
|
||||
<a-radio-group v-model:value="formState.tSign">
|
||||
<a-radio-group v-model:value="formState.tSign" :disabled="isDisable">
|
||||
<a-radio v-for="item in optionSelect.signList" :value="item.code">{{ item.name }}</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
@ -215,12 +215,12 @@
|
||||
<a-row>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="装机量(万KW)" name="capacity">
|
||||
<a-input-number v-model:value="formState.lngCustomerAttrPowerList[0].capacity" :disabled="formState.typeCode!='DC'" style="width: 100%" :min="0" placeholder="请输入机量"></a-input-number>
|
||||
<a-input-number v-model:value="formState.lngCustomerAttrPowerList[0].capacity" :disabled="formState.typeCode!='DC' || isDisable" style="width: 100%" :min="0" placeholder="请输入机量"></a-input-number>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="备注" name="note" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||
<a-textarea v-model:value="formState.lngCustomerAttrPowerList[0].note" :disabled="formState.typeCode!='DC'" placeholder="请输入备注" :auto-size="{ minRows: 2, maxRows: 5 }"/>
|
||||
<a-textarea v-model:value="formState.lngCustomerAttrPowerList[0].note" :disabled="formState.typeCode!='DC' || isDisable" placeholder="请输入备注" :auto-size="{ minRows: 2, maxRows: 5 }"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@ -235,11 +235,14 @@
|
||||
<span style="font-size: 12px;font-weight: normal;">(需上传证书营业执照,危险化学品许可证/燃气经营许可证/危险化学品道路运输许可证等证书。)</span>
|
||||
</div>
|
||||
</template>
|
||||
<a-button v-if="mode != 'view'" type="primary" style="margin-bottom: 10px;" @click="handleAdd('certificate')">新增证书</a-button>
|
||||
<a-button v-if="!isDisable" type="primary" style="margin-bottom: 10px;" @click="handleAdd('certificate')">新增证书</a-button>
|
||||
<a-table :columns="columnsCertificate" :data-source="dataCertificate" >
|
||||
<template #bodyCell="{ column, record, index }">
|
||||
<template v-if="column.dataIndex === 'docTypeCode'">
|
||||
{{ (optionSelect.docCpList.find(v=>v.code == record.docTypeCode) || {}).fullName }}
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'operation'">
|
||||
<a style="margin-right: 10px" @click="btnCheck('certificate', 'edit', record)">编辑</a>
|
||||
<a style="margin-right: 10px" @click="btnCheck('certificate', 'edit', record, index)">编辑</a>
|
||||
<a style="margin-right: 10px" @click="btnCheck('certificate', 'delete', record, index)">删除</a>
|
||||
<a style="margin-right: 10px" @click="btnCheck('certificate', 'view', record)">查看</a>
|
||||
<ArrowUpOutlined style="margin-right: 10px;" class="btn" @click="btnCheck('certificate', 'up', record, index)" />
|
||||
@ -256,11 +259,14 @@
|
||||
<span style="font-size: 12px;font-weight: normal;">(至少填写一条银行信息)</span>
|
||||
</div>
|
||||
</template>
|
||||
<a-button v-if="mode != 'view'" type="primary" style="margin-bottom: 10px;" @click="handleAdd('bank')">新增银行账户</a-button>
|
||||
<a-button v-if="!isDisable" type="primary" style="margin-bottom: 10px;" @click="handleAdd('bank')">新增银行账户</a-button>
|
||||
<a-table :columns="columnsBank" :data-source="dataBank" >
|
||||
<template #bodyCell="{ column, record, index }">
|
||||
<template v-if="column.dataIndex === 'defaultSign'">
|
||||
{{ (optionSelect.signList.find(v=>v.code == record.defaultSign) || {}).name }}
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'operation'">
|
||||
<a style="margin-right: 10px" @click="btnCheck('bank', 'edit', record)">编辑</a>
|
||||
<a style="margin-right: 10px" @click="btnCheck('bank', 'edit', record, index)">编辑</a>
|
||||
<a style="margin-right: 10px" @click="btnCheck('bank', 'delete', record, index)">删除</a>
|
||||
</template>
|
||||
</template>
|
||||
@ -274,11 +280,11 @@
|
||||
<span style="font-size: 12px;font-weight: normal;">(至少填写一条联系人信息)</span>
|
||||
</div>
|
||||
</template>
|
||||
<a-button v-if="mode != 'view'" type="primary" style="margin-bottom: 10px;" @click="handleAdd('contact')">新增联系人</a-button>
|
||||
<a-button v-if="!isDisable" type="primary" style="margin-bottom: 10px;" @click="handleAdd('contact')">新增联系人</a-button>
|
||||
<a-table :columns="columnsContact" :data-source="dataContact" >
|
||||
<template #bodyCell="{ column, record, index }">
|
||||
<template v-if="column.dataIndex === 'operation'">
|
||||
<a style="margin-right: 10px" @click="btnCheck('contact', 'edit', record)">编辑</a>
|
||||
<a style="margin-right: 10px" @click="btnCheck('contact', 'edit', record, index)">编辑</a>
|
||||
<a style="margin-right: 10px" @click="btnCheck('contact', 'delete', record, index)">删除</a>
|
||||
</template>
|
||||
</template>
|
||||
@ -292,6 +298,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<a-upload
|
||||
v-if="!isDisable"
|
||||
:multiple="true"
|
||||
:showUploadList="false"
|
||||
name="file"
|
||||
@ -310,7 +317,7 @@
|
||||
<a :href="record.filePath" :download="record.fileOrg" target="_blank">{{record.fileOrg}}</a>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'docDesc'">
|
||||
<a-input :placeholder="t('请输入附件说明')" v-model:value="record.docDesc" />
|
||||
<a-input :placeholder="t('请输入附件说明')" :disabled="isDisable" v-model:value="record.docDesc" />
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'operation'">
|
||||
<a style="margin-right: 10px" @click="btnCheck('file', 'delete', record, index)">删除</a>
|
||||
@ -331,17 +338,17 @@
|
||||
<script lang="ts" setup>
|
||||
import { useRouter } from 'vue-router';
|
||||
import { FromPageType } from '/@/enums/workflowEnum';
|
||||
import { ref, computed, onMounted, onBeforeMount, nextTick, defineAsyncComponent, reactive, defineComponent} from 'vue';
|
||||
import { ref, computed, onMounted, onBeforeMount, nextTick, defineAsyncComponent, reactive, defineComponent, watch} from 'vue';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
import { CheckCircleOutlined, StopOutlined, CloseOutlined, UploadOutlined, SaveOutlined, DownloadOutlined,ArrowUpOutlined, ArrowDownOutlined } from '@ant-design/icons-vue';
|
||||
import { useMultipleTabStore } from '/@/store/modules/multipleTab';
|
||||
import useEventBus from '/@/hooks/event/useEventBus';
|
||||
import type { Rule } from 'ant-design-vue/es/form';
|
||||
import { getDictionary } from '/@/api/sales/Customer';
|
||||
import certificateModal from './components/certificateModal.vue';
|
||||
import contactModal from './components/contactModal.vue';
|
||||
import bankModal from './components/bankModal.vue';
|
||||
import { getDocCpList, getDictionary } from '/@/api/sales/Customer';
|
||||
import certificateModal from './certificateModal.vue';
|
||||
import contactModal from './contactModal.vue';
|
||||
import bankModal from './bankModal.vue';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { addLngCustomer,updateLngCustomer,getLngCustomer } from '/@/api/sales/Customer';
|
||||
import dayjs from 'dayjs';
|
||||
@ -350,25 +357,30 @@
|
||||
import { uploadSrc, uploadBlobApi } from '/@/api/sys/upload';
|
||||
import { message } from 'ant-design-vue';
|
||||
|
||||
const dynamicComponent = ref(null);
|
||||
|
||||
const formType = ref('2'); // 0 新建 1 修改 2 查看
|
||||
const formRef = ref();
|
||||
const props = defineProps({});
|
||||
const props = defineProps({
|
||||
disabled: false,
|
||||
id: ''
|
||||
|
||||
});
|
||||
const { bus, FORM_LIST_MODIFIED } = useEventBus();
|
||||
|
||||
const router = useRouter();
|
||||
const { currentRoute } = router;
|
||||
|
||||
const isDisable = ref(false);
|
||||
const { formPath } = currentRoute.value.query;
|
||||
const pathArr = formPath.split('/');
|
||||
const pathArr = [];
|
||||
|
||||
const tabStore = useMultipleTabStore();
|
||||
const formProps = ref(null);
|
||||
const formId = ref(currentRoute.value?.params?.id);
|
||||
const pageType = ref(currentRoute.value?.params?.type);
|
||||
const pageId = ref(currentRoute.value?.params?.id || '');
|
||||
const spinning = ref(false);
|
||||
const pageType = ref(currentRoute.value.query?.type);
|
||||
const pageId = ref(currentRoute.value.query?.id)
|
||||
|
||||
const spinning = ref(false);
|
||||
const curIdx = ref(null)
|
||||
const { notification } = useMessage();
|
||||
const { t } = useI18n();
|
||||
const data = reactive({
|
||||
@ -393,7 +405,7 @@
|
||||
const [registerContact, { openModal:openModalContact }] = useModal();
|
||||
const [registerBank, { openModal:openModalBank}] = useModal();
|
||||
|
||||
const fileList = reactive([])
|
||||
|
||||
const rules: Record<string, Rule[]> = {
|
||||
cuMcode: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
di: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
@ -413,7 +425,7 @@
|
||||
|
||||
const columnsCertificate = ref([
|
||||
{ title: t('序号'), dataIndex: 'index', key: 'index', sorter: true, customRender: (column) => `${column.index + 1}` ,width: 100},
|
||||
{ title: t('资质证书名称'), dataIndex: 'docNo', sorter: true, width:200},
|
||||
{ title: t('资质证书名称'), dataIndex: 'docTypeCode', sorter: true, width:200},
|
||||
{ title: t('有效期开始'), dataIndex: 'dateFrom', sorter: true, width: 140},
|
||||
{ title: t('有效期结束'), dataIndex: 'dateTo', sorter: true, width: 140},
|
||||
{ title: t('备注'), dataIndex: 'note', sorter: true},
|
||||
@ -456,10 +468,24 @@
|
||||
classCodeList: [],
|
||||
typeCodeList: [],
|
||||
propCodeList: [],
|
||||
signList: []
|
||||
signList: [],
|
||||
docCpList: []
|
||||
});
|
||||
|
||||
watch(
|
||||
() => props.id,
|
||||
(val) => {
|
||||
if (val) {
|
||||
if (val) {
|
||||
getList(val)
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
immediate: true
|
||||
}
|
||||
);
|
||||
onMounted(() => {
|
||||
isDisable.value = props.disabled || false
|
||||
getOption()
|
||||
if (pageId.value) {
|
||||
getList(pageId.value)
|
||||
@ -487,7 +513,7 @@
|
||||
optionSelect.validList = await getDictionary('LNG_VALID')
|
||||
optionSelect.approCodeList = await getDictionary('LNG_APPRO')
|
||||
|
||||
|
||||
optionSelect.docCpList = await getDocCpList({'valid': 'Y'})
|
||||
}
|
||||
function stateSignChange(val) {
|
||||
if (val!='Y'){
|
||||
@ -501,6 +527,7 @@
|
||||
}
|
||||
}
|
||||
const handleAdd = (val)=> {
|
||||
curIdx.value = null
|
||||
if (val ==='certificate') {
|
||||
openModalCertificate(true,{isUpdate: false});
|
||||
}
|
||||
@ -514,6 +541,8 @@
|
||||
}
|
||||
const btnCheck = (type, btn, record, index) => {
|
||||
console.log(index, 555, type, )
|
||||
curIdx.value = null
|
||||
btn=='edit' && (curIdx.value = index)
|
||||
// 证书
|
||||
if (type == 'certificate') {
|
||||
if (btn == 'edit' || btn == 'view') {
|
||||
@ -575,20 +604,29 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
const swapItems = (arr, index1, index2,direction) =>{
|
||||
arr[index1] = arr.splice(index2, 1, arr[index1])[0];
|
||||
return arr;
|
||||
};
|
||||
const handleSuccessCertificate = (val) => {
|
||||
// 编辑
|
||||
if (curIdx.value != null) {
|
||||
dataCertificate[curIdx.value] = {...val}
|
||||
return
|
||||
}
|
||||
let idx =dataCertificate.findIndex(v => v.docTypeCode == val.docTypeCode)
|
||||
if (idx <0) {
|
||||
dataCertificate.push(val)
|
||||
}
|
||||
}
|
||||
const handleSuccessContact = (val)=> {
|
||||
if (curIdx.value != null) {
|
||||
dataContact[curIdx.value] = {...val}
|
||||
return
|
||||
}
|
||||
dataContact.push(val)
|
||||
}
|
||||
const handleSuccessBank = (val) => {
|
||||
if (curIdx.value != null) {
|
||||
dataBank[curIdx.value] = {...val}
|
||||
return
|
||||
}
|
||||
dataBank.push(val)
|
||||
}
|
||||
function handleChangeFile(info) {
|
||||
@ -621,28 +659,6 @@
|
||||
}
|
||||
|
||||
|
||||
|
||||
dynamicComponent.value = defineAsyncComponent({
|
||||
loader: () => import(`./../../views/${pathArr[0]}/${pathArr[1]}/components/Form.vue`)
|
||||
});
|
||||
|
||||
function onFormMounted(_formProps) {
|
||||
formProps.value = _formProps;
|
||||
setFormType();
|
||||
}
|
||||
|
||||
async function setFormType() {
|
||||
const _mode = mode.value;
|
||||
if (_mode === 'create') {
|
||||
return;
|
||||
}
|
||||
await nextTick();
|
||||
if (_mode === 'view') {
|
||||
await formRef.value.setDisabledForm();
|
||||
}
|
||||
await formRef.value.setFormDataFromId(formId.value);
|
||||
}
|
||||
|
||||
function close() {
|
||||
tabStore.closeTab(currentRoute.value, router);
|
||||
}
|
||||
@ -676,37 +692,43 @@
|
||||
lngCustomerBankList: dataBank,
|
||||
lngCustomerDocList: dataCertificate,
|
||||
lngCustomerContactList: dataContact,
|
||||
|
||||
lngFileUploadList: dataFile
|
||||
|
||||
}
|
||||
spinning.value = true;
|
||||
let request = pageType.value === 'add' ? addLngCustomer :updateLngCustomer
|
||||
|
||||
|
||||
try {
|
||||
obj.lngCustomerDocList.forEach(v => {
|
||||
v.dateFrom = dayjs(v.dateFrom ).valueOf()
|
||||
v.dateTo = dayjs(v.dateTo ).valueOf()
|
||||
})
|
||||
await request(obj);
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: pageType.value === 'add' ? t('新增成功!') : t('修改成功!')
|
||||
}); //提示消息
|
||||
formRef.value.resetFields();
|
||||
setTimeout(() => {
|
||||
bus.emit(FORM_LIST_MODIFIED, { path: formPath });
|
||||
close();
|
||||
}, 1000);
|
||||
const data = await addLngCustomer(obj);
|
||||
obj.id = data
|
||||
// notification.success({
|
||||
// message: 'Tip',
|
||||
// description: pageType.value === 'add' ? t('新增成功!') : t('修改成功!')
|
||||
// }); //提示消息
|
||||
// formRef.value.resetFields();
|
||||
return obj
|
||||
// setTimeout(() => {
|
||||
// bus.emit(FORM_LIST_MODIFIED, { path: formPath });
|
||||
// close();
|
||||
// }, 1000);
|
||||
|
||||
} finally {
|
||||
spinning.value = false;
|
||||
}
|
||||
|
||||
} catch (errorInfo) {
|
||||
notification.warning({
|
||||
spinning.value = false;
|
||||
console.log(errorInfo, 'errorInfo')
|
||||
errorInfo?.value && notification.warning({
|
||||
message: 'Tip',
|
||||
description: '请完善信息'
|
||||
});
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
@ -736,6 +758,11 @@
|
||||
console.error('saveModal Error: ', error);
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
handleSubmit,
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
@ -159,7 +159,8 @@
|
||||
query: {
|
||||
taskId: taskIds[0],
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
formId:currentRoute.value.meta.formId,
|
||||
id: record.id
|
||||
}
|
||||
});
|
||||
} else if (schemaId && !taskIds && processId) {
|
||||
@ -169,7 +170,8 @@
|
||||
readonly: 1,
|
||||
taskId: '',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
formId:currentRoute.value.meta.formId,
|
||||
id: record.id
|
||||
}
|
||||
});
|
||||
} else {
|
||||
@ -212,17 +214,30 @@
|
||||
}
|
||||
|
||||
function handleEdit(record: Recordable) {
|
||||
|
||||
router.push({
|
||||
path: '/form/Customer/' + record.id + '/createFormCustomer',
|
||||
query: {
|
||||
if (schemaIdComputedRef.value) {
|
||||
router.push({
|
||||
path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow',
|
||||
query: {
|
||||
formPath: 'sales/Customer',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId,
|
||||
type:'edit',
|
||||
id: record.id
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
router.push({
|
||||
path: '/form/Customer/' + record.id + '/createFormCustomer',
|
||||
query: {
|
||||
formPath: 'sales/Customer',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId,
|
||||
type:'edit',
|
||||
id: record.id
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
function handleDelete(record: Recordable) {
|
||||
deleteList([record.id]);
|
||||
@ -381,7 +396,8 @@
|
||||
query: {
|
||||
readonly: 1,
|
||||
taskId: '',
|
||||
formName: formName
|
||||
formName: formName,
|
||||
id: record.id
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user