|
@@ -56,7 +56,7 @@
|
|
<el-button type="primary" @click="batchTransfer()">批量转移</el-button>
|
|
<el-button type="primary" @click="batchTransfer()">批量转移</el-button>
|
|
<el-button type="primary" @click="batchDeletes()">批量删除</el-button>
|
|
<el-button type="primary" @click="batchDeletes()">批量删除</el-button>
|
|
<el-button type="primary" @click="showDeteleClue(true)">回收站</el-button>
|
|
<el-button type="primary" @click="showDeteleClue(true)">回收站</el-button>
|
|
- <el-button type="primary">导入</el-button>
|
|
|
|
|
|
+ <el-button type="primary" @click="dialogVisible.importVisible = true">导入</el-button>
|
|
<el-button type="primary">导出</el-button>
|
|
<el-button type="primary">导出</el-button>
|
|
</div>
|
|
</div>
|
|
<div class="flex-1 w-full overflow-hidden">
|
|
<div class="flex-1 w-full overflow-hidden">
|
|
@@ -83,8 +83,7 @@
|
|
<el-button link type="primary" size="large" @click="editClue(scope.row)">编辑</el-button>
|
|
<el-button link type="primary" size="large" @click="editClue(scope.row)">编辑</el-button>
|
|
<!-- <el-button link type="primary" size="large"
|
|
<!-- <el-button link type="primary" size="large"
|
|
@click="dialogVisible.taskModalVisible = true">新建任务</el-button> -->
|
|
@click="dialogVisible.taskModalVisible = true">新建任务</el-button> -->
|
|
- <el-button link type="primary" size="large"
|
|
|
|
- @click="newTask(scope.row)">新建任务</el-button>
|
|
|
|
|
|
+ <el-button link type="primary" size="large" @click="newTask(scope.row)">新建任务</el-button>
|
|
<el-button link type="danger" size="large" @click.prevent="deleteRow(scope.row)">删除</el-button>
|
|
<el-button link type="danger" size="large" @click.prevent="deleteRow(scope.row)">删除</el-button>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -140,21 +139,45 @@
|
|
|
|
|
|
<DeteleTables :visibles="dialogVisible.deteleClueDialogVisible" @showDeteleClue="showDeteleClue" />
|
|
<DeteleTables :visibles="dialogVisible.deteleClueDialogVisible" @showDeteleClue="showDeteleClue" />
|
|
|
|
|
|
- <TaskModal :visible="dialogVisible.taskModalVisible" :edit-form="taskModalForm" :save-loading="'1'"
|
|
|
|
|
|
+ <TaskModal :visible="dialogVisible.taskModalVisible" :edit-form="taskModalForm" :save-loading="taskLoading"
|
|
@close="closeTaskModal" @submit="submitForm" :title="'新建任务'" :disabled-list="['taskType', 'clueId']" />
|
|
@close="closeTaskModal" @submit="submitForm" :title="'新建任务'" :disabled-list="['taskType', 'clueId']" />
|
|
|
|
+
|
|
|
|
+ <!-- 导入线索 -->
|
|
|
|
+ <el-dialog v-model="dialogVisible.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="importProducts">
|
|
|
|
+ <el-button type="primary" :loading="allLoading.importLoading">导入</el-button>
|
|
|
|
+ </el-upload>
|
|
|
|
+ <el-button @click="dialogVisible.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(IMPORMOD, '线索导入模板.xlsx')">线索导入模板.xlsx</el-link></div>
|
|
|
|
+ <div class="mt-4">2、填写excel文件、线索名称、线索来源必填</div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </el-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
import { ref, reactive, onMounted, inject } from "vue";
|
|
import { ref, reactive, onMounted, inject } from "vue";
|
|
-import { GETSYSFILED, MOD, GETPERSONNEL, GETTABLE, GETTEMPLATE, GETDETAIL, UNDATECLAIM, UNDATEFORM, DELTEROW } from './constant'
|
|
|
|
-import { getAllListByCode, getFromValue, resetFromValue, getFirstDayOfMonth, getLastDayOfMonth, formatDate, createTaskFromType, confirmAction } from '@/utils/tools'
|
|
|
|
-import { FormInstance, FormRules, ElMessageBox, ElTable } from 'element-plus'
|
|
|
|
-import { post, get } from "@/utils/request";
|
|
|
|
|
|
+import { GETSYSFILED, MOD, IMPORMOD, GETPERSONNEL, GETTABLE, GETTEMPLATE, GETDETAIL, UNDATECLAIM, UNDATEFORM, DELTEROW } from './constant'
|
|
|
|
+import { getAllListByCode, getFromValue, resetFromValue, getFirstDayOfMonth, getLastDayOfMonth, formatDate, createTaskFromType, confirmAction, downloadTemplate } from '@/utils/tools'
|
|
|
|
+import { FormInstance, FormRules, ElMessageBox, ElTable, UploadRequestOptions } from 'element-plus'
|
|
|
|
+import { post, get, uploadFile } from "@/utils/request";
|
|
import { useRouter, useRoute } from "vue-router";
|
|
import { useRouter, useRoute } from "vue-router";
|
|
import { GenerateForm } from '@zmjs/form-design';
|
|
import { GenerateForm } from '@zmjs/form-design';
|
|
import TaskModal from '@/components/TaskModal/index.vue'
|
|
import TaskModal from '@/components/TaskModal/index.vue'
|
|
import DeteleTables from "./deteleTables.vue";
|
|
import DeteleTables from "./deteleTables.vue";
|
|
|
|
+import { createTask } from "@/components/TaskModal/taskFunction";
|
|
|
|
|
|
// 定义类型
|
|
// 定义类型
|
|
interface fixedDataInterface {
|
|
interface fixedDataInterface {
|
|
@@ -190,16 +213,19 @@ const filterCriteriaForm = reactive<filterCriteriaFormType>({ // 筛选条件for
|
|
pageFrom: 10
|
|
pageFrom: 10
|
|
})
|
|
})
|
|
const generateFormKey = ref(1)
|
|
const generateFormKey = ref(1)
|
|
|
|
+const taskLoading = ref<saveLoadingType>('1')
|
|
const allLoading = reactive({
|
|
const allLoading = reactive({
|
|
clueTableLading: false,
|
|
clueTableLading: false,
|
|
generateFormLading: false,
|
|
generateFormLading: false,
|
|
clueLoading: false,
|
|
clueLoading: false,
|
|
|
|
+ importLoading: false,
|
|
})
|
|
})
|
|
const dialogVisible = reactive({
|
|
const dialogVisible = reactive({
|
|
editClueDialogVisible: false,
|
|
editClueDialogVisible: false,
|
|
taskModalVisible: false,
|
|
taskModalVisible: false,
|
|
clueDialogVisible: false,
|
|
clueDialogVisible: false,
|
|
- deteleClueDialogVisible: false
|
|
|
|
|
|
+ deteleClueDialogVisible: false,
|
|
|
|
+ importVisible: false
|
|
})
|
|
})
|
|
const allText = reactive({
|
|
const allText = reactive({
|
|
editClueText: '新建线索',
|
|
editClueText: '新建线索',
|
|
@@ -272,7 +298,18 @@ function closeTaskModal() {
|
|
}
|
|
}
|
|
|
|
|
|
function submitForm(submitData: any, isClose: boolean) {
|
|
function submitForm(submitData: any, isClose: boolean) {
|
|
- console.log(submitData, isClose)
|
|
|
|
|
|
+ taskLoading.value = '2'
|
|
|
|
+ createTask(submitData, isClose).then((res) => {
|
|
|
|
+ const { saveLoading, isClose } = res
|
|
|
|
+ taskLoading.value = saveLoading
|
|
|
|
+ dialogVisible.taskModalVisible = isClose
|
|
|
|
+ globalPopup?.showSuccess('新增成功')
|
|
|
|
+ }).catch((err) => {
|
|
|
|
+ const { saveLoading, isClose, message } = err
|
|
|
|
+ taskLoading.value = saveLoading
|
|
|
|
+ dialogVisible.taskModalVisible = isClose
|
|
|
|
+ globalPopup?.showError(message)
|
|
|
|
+ })
|
|
}
|
|
}
|
|
|
|
|
|
function editClue(item: any) {
|
|
function editClue(item: any) {
|
|
@@ -327,6 +364,22 @@ function deleteRow(row: any) {
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+async function importProducts(param: UploadRequestOptions) {
|
|
|
|
+ allLoading.importLoading = true
|
|
|
|
+ const formData = new FormData();
|
|
|
|
+ formData.append('multipartFile', param.file)
|
|
|
|
+ const res = await uploadFile('导入接口', formData).finally(() => {
|
|
|
|
+ allLoading.importLoading = false
|
|
|
|
+ })
|
|
|
|
+ allLoading.importLoading = false
|
|
|
|
+ if (res.code == 'ok') {
|
|
|
|
+ globalPopup?.showSuccess('导入成功' || '')
|
|
|
|
+
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ globalPopup?.showError(res.msg || '')
|
|
|
|
+}
|
|
|
|
+
|
|
function batchTransfer() {
|
|
function batchTransfer() {
|
|
const data = clueTableRef.value && clueTableRef.value.getSelectionRows()
|
|
const data = clueTableRef.value && clueTableRef.value.getSelectionRows()
|
|
if (!data.length) {
|
|
if (!data.length) {
|