|
@@ -52,9 +52,9 @@
|
|
|
:disabled="batchTableData.length <= 0">批量转移</el-button>
|
|
|
<el-button type="primary" @click="batchDeteleItem()" :disabled="batchTableData.length <= 0">批量删除</el-button>
|
|
|
<el-button type="primary">阶段设置</el-button>
|
|
|
- <el-button type="primary">回收站</el-button>
|
|
|
- <el-button type="primary">导入</el-button>
|
|
|
- <el-button type="primary">导出</el-button>
|
|
|
+ <el-button type="primary" @click="showVisible('deteleBusinessVisible')">回收站</el-button>
|
|
|
+ <el-button type="primary" @click="allVisible.importVisible = true">导入</el-button>
|
|
|
+ <el-button type="primary" @click="exportBusinessTableList()" :loading="allLoading.exoprtLoading">导出</el-button>
|
|
|
</div>
|
|
|
<div class="flex-1 w-full overflow-hidden">
|
|
|
<el-table ref="businessTableRef" :data="businessTable" border v-loading="allLoading.businessTableLading"
|
|
@@ -105,11 +105,6 @@
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
|
- <!-- 新建任务 -->
|
|
|
- <TaskModal :visible="allVisible.taskModalVisible" :edit-form="taskModalForm" :save-loading="taskLoading"
|
|
|
- @close="closeVisible('taskModalVisible')" @submit="submitForm" :title="'新建任务'"
|
|
|
- :disabled-list="['taskType', 'businessOpportunityId']" />
|
|
|
-
|
|
|
<!-- 批量转移 -->
|
|
|
<el-dialog v-model="allVisible.batchTransferVisible" width="600" :show-close="false" top="10vh">
|
|
|
<template #header="{ close, titleId, titleClass }">
|
|
@@ -131,22 +126,52 @@
|
|
|
<div class="pl-3 text-[#e94a4a]">转移后,将看不到此商机</div>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <!-- 导入 -->
|
|
|
+ <el-dialog v-model="allVisible.importVisible" width="680" :show-close="false" top="10vh">
|
|
|
+ <template #header="{ close, titleId, titleClass }">
|
|
|
+ <div class="flex justify-between items-center border-b pb-3 dialog-header">
|
|
|
+ <h4 :id="titleId">导入产品</h4>
|
|
|
+ <div class="flex">
|
|
|
+ <el-upload class="upload-demo mr-3" :limit="1" :show-file-list="false" accept=".xlsx" :http-request="importBusiness">
|
|
|
+ <el-button type="primary" :loading="allLoading.importLoading">导入</el-button>
|
|
|
+ </el-upload>
|
|
|
+ <el-button @click="allVisible.importVisible = false">取消</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <div class="p-8">
|
|
|
+ <div class="ml-4 mr-4">
|
|
|
+ <div class="flex items-center">1、点击下载 <el-link type="primary" @click="downloadTemplate(MODURL, '商机导入模板.xlsx')">商机导入模板.xlsx</el-link></div>
|
|
|
+ <div class="mt-4">2、填写excel文件、商机名称、商机金额、商机阶段</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!-- 新建任务 -->
|
|
|
+ <TaskModal :visible="allVisible.taskModalVisible" :edit-form="taskModalForm" :save-loading="taskLoading"
|
|
|
+ @close="closeVisible('taskModalVisible')" @submit="submitForm" :title="'新建任务'"
|
|
|
+ :disabled-list="['taskType', 'businessOpportunityId']" />
|
|
|
+
|
|
|
+ <!-- 回收站 -->
|
|
|
+ <DeteleBusiness :visibles="allVisible.deteleBusinessVisible" @closeVisible="closeVisible" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
import { ref, reactive, onMounted, inject } from "vue";
|
|
|
-import type { ElTable, FormInstance, FormRules } from 'element-plus'
|
|
|
+import type { ElTable, FormInstance, FormRules, UploadRequestOptions } from 'element-plus'
|
|
|
import { useRouter, useRoute } from "vue-router";
|
|
|
-import { GETSYSFILED, MOD, GETPERSONNEL, GETGENERATEFOEM, GETBUSINESSLIST, UPDATEINSET, BUSINESSDETELE, BATCHTRANSFER, tableColumn } from './api'
|
|
|
+import { GETSYSFILED, MOD, GETPERSONNEL, GETGENERATEFOEM, GETBUSINESSLIST, UPDATEINSET, BUSINESSDETELE, BATCHTRANSFER, MODURL, tableColumn } from './api'
|
|
|
import { GETTABLELIST } from '@/pages/product/api'
|
|
|
-import { post, get } from "@/utils/request";
|
|
|
-import { getAllListByCode, getFromValue, resetFromValue, getFirstDayOfMonth, createTaskFromType, formatDate, confirmAction } from '@/utils/tools'
|
|
|
+import { post, get, uploadFile } from "@/utils/request";
|
|
|
+import { getAllListByCode, getFromValue, resetFromValue, getFirstDayOfMonth, createTaskFromType, formatDate, confirmAction, downloadTemplate, downloadFile } from '@/utils/tools'
|
|
|
import { createTask } from '@/components/TaskModal/taskFunction'
|
|
|
import { formatDateTime } from '@/utils/times'
|
|
|
import { GenerateForm } from '@zmjs/form-design';
|
|
|
import RelatedProducts from './component/relatedProducts.vue'
|
|
|
import TaskModal from '@/components/TaskModal/index.vue'
|
|
|
+import DeteleBusiness from './component/deteleTables.vue'
|
|
|
|
|
|
const route = useRoute()
|
|
|
const router = useRouter()
|
|
@@ -164,13 +189,17 @@ const allLoading = reactive({
|
|
|
businessTableLading: false,
|
|
|
businessSaveLading: false,
|
|
|
newBusinessSaveLading: false,
|
|
|
- transferLoading: false
|
|
|
+ transferLoading: false,
|
|
|
+ importLoading: false,
|
|
|
+ exoprtLoading: false,
|
|
|
})
|
|
|
const allVisible = reactive({
|
|
|
newBusinessisible: false,
|
|
|
recycleVisible: false,
|
|
|
taskModalVisible: false,
|
|
|
- batchTransferVisible: false
|
|
|
+ batchTransferVisible: false,
|
|
|
+ deteleBusinessVisible: false,
|
|
|
+ importVisible: false
|
|
|
})
|
|
|
const allText = reactive({
|
|
|
newBusinessisibleText: '新建商机',
|
|
@@ -284,6 +313,31 @@ function businessDeteleItem(value: string | number, label: string, batch: boolea
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+async function importBusiness(param: UploadRequestOptions) {
|
|
|
+ allLoading.importLoading = true
|
|
|
+ const formData = new FormData();
|
|
|
+ formData.append('multipartFile', param.file)
|
|
|
+ const res = await uploadFile('接口名称', formData).finally(() => {
|
|
|
+ allLoading.importLoading = false
|
|
|
+ })
|
|
|
+ if (res.code == 'ok') {
|
|
|
+ globalPopup?.showSuccess('导入成功' || '')
|
|
|
+ getBusinessTableList()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ globalPopup?.showError(res.msg || '')
|
|
|
+}
|
|
|
+
|
|
|
+function exportBusinessTableList() {
|
|
|
+ allLoading.exoprtLoading = true
|
|
|
+ let valueForm = getFromValue(businessOpportunityForm)
|
|
|
+ post('接口名称', {...valueForm}).then((res) => {
|
|
|
+ downloadFile(res.data, '商机表导出.xlsx')
|
|
|
+ }).finally(() => {
|
|
|
+ allLoading.exoprtLoading = false
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
function changeBatch(flag: boolean = true) {
|
|
|
if (flag) {
|
|
|
batchTableData.value = businessTableRef.value && businessTableRef.value.getSelectionRows()
|