客户自定义表单流程
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
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
7
src/views/secondDev/Empty.vue
Normal file
7
src/views/secondDev/Empty.vue
Normal file
@ -0,0 +1,7 @@
|
||||
<template>
|
||||
<div> 加载中 </div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts"></script>
|
||||
|
||||
<style scoped></style>
|
||||
@ -38,7 +38,9 @@
|
||||
</template>
|
||||
</a-space>
|
||||
</div>
|
||||
<component v-if="customFormConfig.codeList.includes(curPageCode)" :is="componentName" :disabled="readonly" />
|
||||
<FormInformation
|
||||
v-else
|
||||
:key="renderKey"
|
||||
ref="formInformation"
|
||||
:disabled="readonly"
|
||||
@ -74,7 +76,7 @@
|
||||
|
||||
<script setup>
|
||||
import { useRouter } from 'vue-router';
|
||||
import { onMounted, reactive, ref, unref, createVNode, provide } from 'vue';
|
||||
import { onMounted, reactive, ref, unref, createVNode, provide,computed,defineAsyncComponent } from 'vue';
|
||||
import FormInformation from '/@/views/secondDev/FormInformation.vue';
|
||||
import userTaskItem from '/@/views/workflow/task/hooks/userTaskItem';
|
||||
import { getApprovalProcess, postApproval, postGetNextTaskMaybeArrival, postTransfer, getDrawNode, withdraw } from '/@/api/workflow/task';
|
||||
@ -97,6 +99,7 @@
|
||||
import { TaskTypeUrl } from '/@/enums/workflowEnum';
|
||||
import { postSetSign, postSetSignV2 } from '/@/api/workflow/task';
|
||||
import FlowRecord from '/@/views/workflow/task/components/flow/FlowRecord.vue';
|
||||
import {customFormConfig} from './customFormConfig'
|
||||
|
||||
const spinning = ref(false);
|
||||
const userStore = useUserStore();
|
||||
@ -174,7 +177,17 @@
|
||||
nextTaskUser: {} // 格式为taskKey: 用户id(逗号分隔)
|
||||
});
|
||||
let approvedType = ref(ApproveType.AGREE);
|
||||
|
||||
|
||||
const componentName = computed(() => {
|
||||
if (!data.formInfos.length) {
|
||||
return defineAsyncComponent({
|
||||
loader: () => import('/@/views/secondDev/Empty.vue')
|
||||
});
|
||||
}
|
||||
return defineAsyncComponent({
|
||||
loader: () => import(`/@/views/${data.formInfos[0]?.functionalModule}/${data.formInfos[0]?.functionName}/components/createForm.vue`)
|
||||
});
|
||||
});
|
||||
function showButton(btn) {
|
||||
// 撤回有drawNode才显示,流程图任何情况下都显示
|
||||
let show =
|
||||
@ -570,10 +583,11 @@
|
||||
return data.taskApproveOpinions || [];
|
||||
}
|
||||
}
|
||||
|
||||
const curPageCode = ref()
|
||||
onMounted(async () => {
|
||||
try {
|
||||
let res = await getApprovalProcess(unref(taskId), unref(processId));
|
||||
curPageCode.value = res?.schemaInfo?.code
|
||||
initProcessData(res);
|
||||
await getBackNode();
|
||||
processInfo.value = res;
|
||||
|
||||
@ -32,7 +32,8 @@
|
||||
</a-space>
|
||||
</div>
|
||||
<div class="flow-content">
|
||||
<FormInformation :key="randKey" ref="formInformation" :disabled="false" :formAssignmentData="data.formAssignmentData" :formInfos="data.formInfos" :opinions="data.opinions" :opinionsComponents="data.opinionsComponents" />
|
||||
<component v-if="customFormConfig.codeList.includes(curPageCode)" :is="componentName" ref="formInformation" />
|
||||
<FormInformation v-else :key="randKey" ref="formInformation" :disabled="false" :formAssignmentData="data.formAssignmentData" :formInfos="data.formInfos" :opinions="data.opinions" :opinionsComponents="data.opinionsComponents" />
|
||||
</div>
|
||||
</div>
|
||||
<a-modal :visible="showFlowChart" centered class="geg" closable title="流程图" width="1200px" @cancel="closeFlowChart">
|
||||
@ -54,7 +55,7 @@
|
||||
import { getStartProcessInfo, getReStartProcessInfo, reLaunch, postLaunch, postApproval, postGetNextTaskMaybeArrival } from '/@/api/workflow/task';
|
||||
import { useMultipleTabStore } from '/@/store/modules/multipleTab';
|
||||
import { CloseOutlined, SendOutlined, ClockCircleOutlined, PrinterOutlined, ApartmentOutlined } from '@ant-design/icons-vue';
|
||||
import { nextTick, onMounted, ref, toRaw, reactive } from 'vue';
|
||||
import { nextTick, onMounted, ref, toRaw, reactive, computed, defineAsyncComponent } from 'vue';
|
||||
import { deleteDraft, postDraft, putDraft } from '/@/api/workflow/process';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
import { separator } from '/@bpmn/config/info';
|
||||
@ -62,12 +63,13 @@
|
||||
import OpinionDialog from '/@/components/SecondDev/OpinionDialog.vue';
|
||||
import { ApproveCode, ApproveType } from '/@/enums/workflowEnum';
|
||||
import useEventBus from '/@/hooks/event/useEventBus';
|
||||
import {customFormConfig} from './customFormConfig'
|
||||
|
||||
const { bus, CREATE_FLOW } = useEventBus();
|
||||
|
||||
const router = useRouter();
|
||||
const tabStore = useMultipleTabStore();
|
||||
|
||||
const curPageCode = ref()
|
||||
const { t } = useI18n();
|
||||
const { data, approveUserData, initProcessData, notificationSuccess, notificationError } = userTaskItem();
|
||||
const currentRoute = router.currentRoute.value;
|
||||
@ -130,6 +132,17 @@
|
||||
}
|
||||
});
|
||||
|
||||
const componentName = computed(() => {
|
||||
if (!data.formInfos.length) {
|
||||
return defineAsyncComponent({
|
||||
loader: () => import('/@/views/secondDev/Empty.vue')
|
||||
});
|
||||
}
|
||||
return defineAsyncComponent({
|
||||
loader: () => import(`/@/views/${data.formInfos[0]?.functionalModule}/${data.formInfos[0]?.functionName}/components/createForm.vue`)
|
||||
});
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
// 发起流程
|
||||
@ -139,6 +152,7 @@
|
||||
const tabPrefix = pageMode === 'new' ? '新建' : '草稿';
|
||||
tabStore.changeTitle(fullPath, `${tabPrefix}:${title}`);
|
||||
}
|
||||
curPageCode.value = res?.schemaInfo?.code
|
||||
initProcessData(res);
|
||||
} catch (error) {}
|
||||
randKey.value = Math.random() + '';
|
||||
@ -272,8 +286,18 @@
|
||||
|
||||
async function getApproveParams() {
|
||||
let formModels = mainFormModels.value;
|
||||
let system = formInformation.value.getSystemType();
|
||||
let fileFolderIds = getUploadFileFolderIds(formModels);
|
||||
let fileFolderIds = []
|
||||
let system = {}
|
||||
if (customFormConfig.codeList.includes(curPageCode.value)) {
|
||||
let key = data.formInfos[0]?.formConfig?.key
|
||||
let obj = {}
|
||||
system[key] = false
|
||||
fileFolderIds = []
|
||||
} else {
|
||||
system = formInformation.value.getSystemType();
|
||||
fileFolderIds = getUploadFileFolderIds(formModels);
|
||||
}
|
||||
|
||||
return {
|
||||
approvedType: approvalData.approvedType,
|
||||
approvedResult: approvalData.approvedResult, // approvalData.approvedType 审批结果 如果为 4 就需要传buttonCode
|
||||
@ -291,7 +315,115 @@
|
||||
};
|
||||
}
|
||||
|
||||
async function saveLaunchNew() {
|
||||
if (!taskId.value && rDraftsId.value != '0') {
|
||||
try {
|
||||
await new Promise((resolve, reject) => {
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
content: '请确认是否提交流程,提交后流程不能删除',
|
||||
okText: '确定',
|
||||
cancelText: '取消',
|
||||
onOk: () => resolve(),
|
||||
onCancel: () => reject()
|
||||
});
|
||||
});
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
}
|
||||
try {
|
||||
// let validateForms = await formInformation.value.validateForm();
|
||||
// let system = formInformation.value.getSystemType();
|
||||
let key = data.formInfos[0]?.formConfig?.key
|
||||
let system = {}
|
||||
let obj = {}
|
||||
system[key] = false
|
||||
|
||||
let value = await formInformation.value.handleSubmit(true);
|
||||
obj[key] = value
|
||||
mainFormModels.value = obj
|
||||
console.log(mainFormModels.value, 6666)
|
||||
if (!value) return
|
||||
|
||||
data.submitLoading = true;
|
||||
loading.value = true;
|
||||
// if (validateForms.length > 0) {
|
||||
// let successValidate = validateForms.filter((ele) => {
|
||||
// return ele.validate;
|
||||
// });
|
||||
// console.info('validateForms:' + JSON.stringify(validateForms));
|
||||
// if (successValidate.length == validateForms.length) {
|
||||
// mainFormModels.value = await formInformation.value.getFormModels(true);
|
||||
/*for (let i in mainFormModels.value) {
|
||||
const item = mainFormModels.value[i];
|
||||
if (!item['_id']) {
|
||||
throw new Error('发起失败');
|
||||
} else {
|
||||
delete item['_id'];
|
||||
}
|
||||
}*/
|
||||
let relationTasks = [];
|
||||
if (data.predecessorTasks && data.predecessorTasks.length > 0) {
|
||||
relationTasks = data.predecessorTasks.map((ele) => {
|
||||
return { taskId: ele.taskId, schemaId: ele.schemaId };
|
||||
});
|
||||
}
|
||||
// let fileFolderIds = getUploadFileFolderIds(mainFormModels.value);
|
||||
let fileFolderIds = []
|
||||
if (taskId.value) {
|
||||
// 如果在草稿节点取消,重新从草稿开始走
|
||||
return createFlowSuccess(true);
|
||||
}
|
||||
//如果传入了processId 代表是重新发起流程
|
||||
let res;
|
||||
res = await postLaunch(rSchemaId, mainFormModels.value, relationTasks, fileFolderIds, system);
|
||||
// 下一节点审批人
|
||||
let taskList = [];
|
||||
if (res && res.length > 0) {
|
||||
taskId.value = res[0].taskId;
|
||||
taskList = res
|
||||
.filter((ele) => {
|
||||
return ele.isMultiInstance == false && ele.isAppoint == true;
|
||||
})
|
||||
.map((ele) => {
|
||||
return {
|
||||
taskId: ele.taskId,
|
||||
taskName: ele.taskName,
|
||||
provisionalApprover: ele.provisionalApprover,
|
||||
selectIds: []
|
||||
};
|
||||
});
|
||||
const strictDesign = false;
|
||||
console.log(taskList, 'taskList')
|
||||
if (strictDesign && taskList.length > 0) {
|
||||
notificationError('提交失败', '流程设计错误,开始后的第一个节点必须是审批人为发起人的起草节点。');
|
||||
data.submitLoading = false;
|
||||
loading.value = false;
|
||||
} else {
|
||||
createFlowSuccess(taskList);
|
||||
}
|
||||
} else {
|
||||
createFlowSuccess();
|
||||
}
|
||||
// } else {
|
||||
// data.submitLoading = false;
|
||||
// notificationError(t('发起流程'), t('表单校验未通过'));
|
||||
// loading.value = false;
|
||||
// }
|
||||
// }
|
||||
} catch (error) {
|
||||
console.log(error, 'error')
|
||||
data.submitLoading = false;
|
||||
loading.value = false;
|
||||
notificationError(t('发起流程'), t('发起流程失败'));
|
||||
}
|
||||
}
|
||||
async function saveLaunch() {
|
||||
if (customFormConfig.codeList.includes(curPageCode.value)){
|
||||
saveLaunchNew()
|
||||
return
|
||||
}
|
||||
if (!taskId.value && rDraftsId.value != '0') {
|
||||
try {
|
||||
await new Promise((resolve, reject) => {
|
||||
|
||||
6
src/views/secondDev/customFormConfig.ts
Normal file
6
src/views/secondDev/customFormConfig.ts
Normal file
@ -0,0 +1,6 @@
|
||||
export const customFormConfig = {
|
||||
codeList: ['addCustomer'],
|
||||
router: [
|
||||
{code: 'addCustomer', src: ''}
|
||||
]
|
||||
};
|
||||
@ -10,6 +10,8 @@
|
||||
<template #left>
|
||||
<FlowPanel :xml="data.xml" :taskRecords="data.taskRecords" :predecessorTasks="selectedPredecessorTasks" :processId="props.processId" :schemaId="props.schemaId" position="top">
|
||||
<FormInformation
|
||||
:curPageCode="curPageCode"
|
||||
:id="id"
|
||||
:opinionsComponents="data.opinionsComponents"
|
||||
:opinions="data.opinions"
|
||||
:disabled="false"
|
||||
@ -143,12 +145,14 @@
|
||||
schemaId: string;
|
||||
processId: string;
|
||||
taskId: string;
|
||||
id: string;
|
||||
visible?: boolean;
|
||||
}>(),
|
||||
{
|
||||
schemaId: '',
|
||||
processId: '',
|
||||
taskId: '',
|
||||
id: '',
|
||||
visible: false
|
||||
}
|
||||
);
|
||||
@ -210,7 +214,8 @@
|
||||
return ele.taskId;
|
||||
});
|
||||
});
|
||||
|
||||
const curPageCode = ref()
|
||||
const id = ref()
|
||||
// 审批
|
||||
async function approval() {
|
||||
showLoading.value = true;
|
||||
@ -218,6 +223,8 @@
|
||||
if (props.taskId) {
|
||||
try {
|
||||
let res = await getApprovalProcess(props.taskId, props.processId);
|
||||
curPageCode.value = res?.schemaInfo?.code
|
||||
id.value = res?.formInfos[0]?.formData?.id
|
||||
initProcessData(res);
|
||||
if (res.buttonConfigs) {
|
||||
approvalData.buttonConfigs = res.buttonConfigs;
|
||||
|
||||
@ -35,8 +35,13 @@
|
||||
<div id="approveExtendButton"></div>
|
||||
<div id="approveRightButton"></div>
|
||||
</div>
|
||||
<SystemForm class="form-box" v-if="item.formType == FormType.SYSTEM" :systemComponent="item.systemComponent" :isViewProcess="props.disabled" :formModel="item.formModel" :workflowConfig="item" :ref="setItemRef" />
|
||||
<SimpleForm v-else-if="item.formType == FormType.CUSTOM" class="form-box testClass" :ref="setItemRef" :formProps="item.formProps" :formModel="item.formModel" :isWorkFlow="true" />
|
||||
<div style="height: 500px;" v-if="customFormConfig.codeList.includes(props.curPageCode)">
|
||||
<component :id="props.id" :is="componentName" :disabled="props.disabled" />
|
||||
</div>
|
||||
<div v-else>
|
||||
<SystemForm class="form-box" v-if="item.formType == FormType.SYSTEM" :systemComponent="item.systemComponent" :isViewProcess="props.disabled" :formModel="item.formModel" :workflowConfig="item" :ref="setItemRef" />
|
||||
<SimpleForm v-else-if="item.formType == FormType.CUSTOM" class="form-box testClass" :ref="setItemRef" :formProps="item.formProps" :formModel="item.formModel" :isWorkFlow="true" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -50,7 +55,7 @@
|
||||
import { FewerLeft, FewerRight } from '/@/components/ModalPanel';
|
||||
import { NodeHead } from '/@/components/ModalPanel/index';
|
||||
import IconFontSymbol from '/@/components/IconFontSymbol/Index.vue';
|
||||
import { onBeforeUpdate, nextTick, onMounted, reactive, computed, ref } from 'vue';
|
||||
import { onBeforeUpdate, nextTick, onMounted, reactive, computed, ref, defineAsyncComponent } from 'vue';
|
||||
import { TaskApproveOpinion, ValidateForms } from '/@/model/workflow/bpmnConfig';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
@ -62,6 +67,7 @@
|
||||
import { createFormEvent, loadFormEvent, submitFormEvent } from '/@/hooks/web/useFormEvent';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { updateWorkflow } from '/@/api/workflow/adminOperation';
|
||||
import {customFormConfig} from '/@/views/secondDev/customFormConfig'
|
||||
const { t } = useI18n();
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
@ -71,13 +77,17 @@
|
||||
opinionsComponents?: Array<string> | undefined;
|
||||
formAssignmentData?: null | Recordable;
|
||||
processId: string;
|
||||
curPageCode: string;
|
||||
id: string;
|
||||
}>(),
|
||||
{
|
||||
disabled: false,
|
||||
formInfos: () => {
|
||||
return [];
|
||||
},
|
||||
processId: ''
|
||||
processId: '',
|
||||
curPageCode: '',
|
||||
id: ''
|
||||
}
|
||||
);
|
||||
|
||||
@ -143,6 +153,16 @@
|
||||
formEventConfigs: [],
|
||||
modes: []
|
||||
});
|
||||
const componentName = computed(() => {
|
||||
if (!props.formInfos.length) {
|
||||
return defineAsyncComponent({
|
||||
loader: () => import('/@/views/secondDev/Empty.vue')
|
||||
});
|
||||
}
|
||||
return defineAsyncComponent({
|
||||
loader: () => import(`/@/views/${props.formInfos[0]?.functionalModule}/${props.formInfos[0]?.functionName}/components/createForm.vue`)
|
||||
});
|
||||
});
|
||||
onMounted(async () => {
|
||||
for await (let element of props.formInfos) {
|
||||
let formModels = {};
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
:formDataId="data.formInfos[0].formData.id"
|
||||
:formInfos="data.formInfos"
|
||||
>
|
||||
<FormInformation :opinionsComponents="data.opinionsComponents" :opinions="data.opinions" :formInfos="data.formInfos" :disabled="true" :processId="props.processId" />
|
||||
<FormInformation :curPageCode="curPageCode" :id="id" :opinionsComponents="data.opinionsComponents" :opinions="data.opinions" :formInfos="data.formInfos" :disabled="true" :processId="props.processId" />
|
||||
</FlowPanel>
|
||||
</template>
|
||||
|
||||
@ -27,11 +27,15 @@
|
||||
let props = defineProps(['position', 'processId', 'taskId', 'schemaId']);
|
||||
let visible = ref(false);
|
||||
const { data, initProcessData } = userTaskItem();
|
||||
const curPageCode = ref()
|
||||
const id = ref()
|
||||
onMounted(async () => {
|
||||
try {
|
||||
let res = await getApprovalProcess(props.taskId, props.processId);
|
||||
initProcessData(res);
|
||||
visible.value = true;
|
||||
curPageCode.value = res?.schemaInfo?.code
|
||||
id.value = res?.formInfos[0]?.formData?.id
|
||||
console.error('555555', data);
|
||||
} catch (error) {}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user