|
@@ -96,7 +96,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<template v-if="currentStep === 2">
|
|
|
- <div class="second-step-form-wrap">
|
|
|
+ <div class="second-step-form-wrap" v-if="currentRoute !== 'editBusiness'"">
|
|
|
<t-form :data="secondFormData" :rules="rules" ref="formRef" label-width="120px" inline
|
|
|
class="second-step-form">
|
|
|
<div class="form-line">
|
|
@@ -109,6 +109,24 @@
|
|
|
</div>
|
|
|
</t-form>
|
|
|
</div>
|
|
|
+ <div class="second-step-form-wrap" v-else>
|
|
|
+ <t-button theme="primary" type="submit"
|
|
|
+ style="margin: 20px;"
|
|
|
+ @click="handleShowRenewal()">添加续约</t-button>
|
|
|
+ <t-table
|
|
|
+ :columns="tableColOpts"
|
|
|
+ :data="recordData"
|
|
|
+ row-key="EtaBusinessContractId"
|
|
|
+ :bordered="true"
|
|
|
+ :table-layout="'auto'"
|
|
|
+ >
|
|
|
+ <template #opt="{row}">
|
|
|
+ <t-button variant="text" theme="primary" size="small" @click="editRenewal(row)">编辑</t-button>
|
|
|
+ <t-button variant="text" theme="primary" size="small" class="color-hint"
|
|
|
+ @click="deleteRenewal(row)">删除</t-button>
|
|
|
+ </template>
|
|
|
+ </t-table>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
<template v-if="currentStep === 3">
|
|
|
<div class="second-step-form-wrap tree">
|
|
@@ -139,6 +157,15 @@
|
|
|
<template v-if="currentRoute === 'businessDetail' || currentRoute === 'editBusiness'">
|
|
|
<EditBox :EtaBusinessId="businessId" :currentRoute="currentRoute" @editEtaBusiness="editEtaBusiness" />
|
|
|
</template>
|
|
|
+ <!-- 添加续约 -->
|
|
|
+ <t-dialog
|
|
|
+ :header="renewalDiaTitle"
|
|
|
+ :visible.sync="showRenewal"
|
|
|
+ :footer="false"
|
|
|
+ @close="showRenewal = false"
|
|
|
+ >
|
|
|
+ <AddRenewal @addRenewal="handleAddRenewal" @close="showRenewal = false" :renewalForm="modifyData" />
|
|
|
+ </t-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script setup>
|
|
@@ -149,6 +176,7 @@ import EditBox from "./components/EditBox.vue";
|
|
|
import { customInterence, roadshowInterence, businessCustomInterence } from '@/api/api.js';
|
|
|
import { locationOptions } from '@/utils/location';
|
|
|
import countryData from "@/utils/countryData";
|
|
|
+import AddRenewal from './components/AddRenewal.vue';
|
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
|
|
|
|
const router = useRouter()
|
|
@@ -170,6 +198,11 @@ const PermissionList = ref([]);
|
|
|
const allCheckedList = ref([]);
|
|
|
const handleEtaBusinessId = ref(0);
|
|
|
const isPermissionSearch = ref(false);
|
|
|
+
|
|
|
+// 编辑商家
|
|
|
+const renewalDiaTitle = ref('添加续约');
|
|
|
+const modifyData = ref(null);
|
|
|
+const showRenewal = ref(false);
|
|
|
const firstFormData = reactive({
|
|
|
areaType: '国内',
|
|
|
name: '',
|
|
@@ -213,6 +246,25 @@ const teamSizeOpts = reactive([
|
|
|
label: '超过200人'
|
|
|
}
|
|
|
])
|
|
|
+const tableColOpts = ref([
|
|
|
+ {
|
|
|
+ colKey:'SigningTime',
|
|
|
+ title:'运维时间',
|
|
|
+ align: 'center'
|
|
|
+ },{
|
|
|
+ colKey:'ExpiredTime',
|
|
|
+ title:'到期时间',
|
|
|
+ align: 'center'
|
|
|
+ },{
|
|
|
+ colKey:'ExpireDay',
|
|
|
+ title:'到期天数',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ align: 'center', colKey: 'opt', title: '操作'
|
|
|
+ }
|
|
|
+])
|
|
|
+
|
|
|
const tradeArr = ref([]); // 需要在getIndustry方法中赋值
|
|
|
const salesArr = ref([]); // 需要在getSale方法中赋值
|
|
|
const rules = {
|
|
@@ -483,7 +535,8 @@ const changeActiveStep = (index) => {
|
|
|
// 编辑
|
|
|
const editEtaBusiness = async () => {
|
|
|
const {creditCode, province, city, decisionMaker,industry,nation,teamSize} = firstFormData;
|
|
|
- console.log('editEtaBusiness', firstFormData);
|
|
|
+ const {signDate,expirationDate} = secondFormData;
|
|
|
+ console.log('editEtaBusiness', secondFormData);
|
|
|
|
|
|
const IndustryName = tradeArr.value.find(item => item.IndustryId === industry)?.IndustryName || '';
|
|
|
const query = {
|
|
@@ -496,12 +549,66 @@ const editEtaBusiness = async () => {
|
|
|
IndustryId:Number(industry),
|
|
|
Province:province,
|
|
|
City:city,
|
|
|
+ SigningTime: signDate || '',
|
|
|
+ ExpiredTime: expirationDate || '',
|
|
|
}
|
|
|
const res = await businessCustomInterence.editBusiness(query);
|
|
|
if (res.Ret !== 200) return;
|
|
|
handleAddBusiness('edit')
|
|
|
}
|
|
|
|
|
|
+// 编辑签约信息
|
|
|
+const handleShowRenewal = (data) => {
|
|
|
+ showRenewal.value = true;
|
|
|
+};
|
|
|
+
|
|
|
+// 删除续约
|
|
|
+const deleteRenewal = async (row) => {
|
|
|
+ try {
|
|
|
+ const confirmResult = await confirm('是否确认删除该签约信息?', '提示', {
|
|
|
+ confirmButtonText: '确认',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning',
|
|
|
+ });
|
|
|
+ if (confirmResult) {
|
|
|
+ const res = await businessCustomInterence.removeContract({ EtaBusinessContractId: row.EtaBusinessContractId });
|
|
|
+ if (res.Ret === 200) {
|
|
|
+ MessagePlugin.success("删除成功");
|
|
|
+ await getTableData();
|
|
|
+ await getTimeLineData();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.error('删除续约失败:', error);
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+// 编辑续约
|
|
|
+const editRenewal = (row) => {
|
|
|
+ renewalDiaTitle.value = "编辑续约";
|
|
|
+ console.log('editRenewal', row);
|
|
|
+
|
|
|
+ modifyData.value = {
|
|
|
+ id: row.EtaBusinessContractId,
|
|
|
+ signDate: row.SigningTime,
|
|
|
+ expirationDate: row.ExpiredTime
|
|
|
+ };
|
|
|
+ showRenewal.value = true;
|
|
|
+};
|
|
|
+
|
|
|
+const handleAddRenewal = ({ signDate, expirationDate }) => {
|
|
|
+ // 处理添加续约逻辑
|
|
|
+ businessCustomInterence.addNewContract({
|
|
|
+ EtaBusinessId: businessId.value,
|
|
|
+ SigningTime: signDate,
|
|
|
+ ExpiredTime: expirationDate
|
|
|
+ }).then(res=>{
|
|
|
+ if(res.Ret!==200) return
|
|
|
+ MessagePlugin.success('添加续约成功')
|
|
|
+ showRenewal.value = false
|
|
|
+ getTableData()
|
|
|
+ })
|
|
|
+};
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
.add-business-box {
|