|
@@ -49,9 +49,10 @@
|
|
|
</template>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column :label="'操作'" :width="'140px'" fixed="right">
|
|
|
+ <el-table-column :label="'操作'" :width="'200px'" fixed="right">
|
|
|
<template #default="scope">
|
|
|
<el-button link type="primary" size="large" @click="editContacts(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="contactsDeteleItem(scope.row.id, scope.row.customName)">删除</el-button>
|
|
|
</template>
|
|
@@ -113,12 +114,18 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <!-- 任务 -->
|
|
|
+ <TaskModal :visible="allVisible.taskModalVisible" :edit-form="taskModalForm" :save-loading="taskLoading"
|
|
|
+ @close="closeVisible('taskModalVisible')" @submit="submitForm" :title="'新建任务'"
|
|
|
+ :disabled-list="['contactsId']" />
|
|
|
+
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
import { ref, reactive, onMounted, inject } from "vue";
|
|
|
-import { getAllListByCode, getFromValue, resetFromValue, getTemplateKey, confirmAction, downloadTemplate, downloadFile } from '@/utils/tools'
|
|
|
+import { getAllListByCode, getFromValue, resetFromValue, getTemplateKey, confirmAction, downloadTemplate, downloadFile, createTaskFromType } from '@/utils/tools'
|
|
|
import { post, get, uploadFile } from "@/utils/request";
|
|
|
import { actionButtons, tableColumns, GETSYSFILED, GETPERSONNEL, GETGENERATEFOEM, MOD, URL_PAGECONTACTS, getSex, URL_ADD, URL_UPLOAD, URL_BATCHDETELE, URL_DETELERECYCLE, IMPORTMOD } from "./api";
|
|
|
import { useRouter, useRoute } from "vue-router";
|
|
@@ -127,6 +134,8 @@ import { URL_FETALL } from "../customer/api";
|
|
|
import { ElTable, UploadRequestOptions } from "element-plus";
|
|
|
|
|
|
import DeteleTables from './component/deteleTables.vue'
|
|
|
+import TaskModal from '@/components/TaskModal/index.vue'
|
|
|
+import { createTask } from "@/components/TaskModal/taskFunction";
|
|
|
|
|
|
const router = useRouter()
|
|
|
const globalPopup = inject<GlobalPopup>('globalPopup')
|
|
@@ -166,6 +175,8 @@ const contactsTemplateRef = ref<typeof GenerateForm>()
|
|
|
const contactsTableRef = ref<InstanceType<typeof ElTable>>()
|
|
|
const formTable = ref([]) // 表格数据
|
|
|
const batchTableData = ref([])
|
|
|
+const taskModalForm = ref({})
|
|
|
+const taskLoading = ref<saveLoadingType>('1')
|
|
|
const allLoading = reactive({ // 按钮加载 Loading
|
|
|
formTableLading: false,
|
|
|
editContactsSaveLoading: false,
|
|
@@ -186,6 +197,27 @@ const allText = reactive({
|
|
|
})
|
|
|
|
|
|
// 方法
|
|
|
+function submitForm(submitData: any, isClose: boolean) {
|
|
|
+ taskLoading.value = '2'
|
|
|
+ createTask(submitData, isClose).then((res) => {
|
|
|
+ const { saveLoading, isClose } = res
|
|
|
+ taskLoading.value = saveLoading
|
|
|
+ allVisible.taskModalVisible = isClose
|
|
|
+ globalPopup?.showSuccess('新增成功')
|
|
|
+ }).catch((err) => {
|
|
|
+ const { saveLoading, isClose, message } = err
|
|
|
+ taskLoading.value = saveLoading
|
|
|
+ allVisible.taskModalVisible = isClose
|
|
|
+ globalPopup?.showError(message)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+function newTask(item: any) {
|
|
|
+ const { id } = item
|
|
|
+ taskModalForm.value = { ...createTaskFromType(0), contactsId: id, }
|
|
|
+ showVisible('taskModalVisible')
|
|
|
+}
|
|
|
+
|
|
|
function exportCustomerTableList() {
|
|
|
allLoading.exoprtLoading = true
|
|
|
let valueForm = getFromValue(filterForm)
|
|
@@ -296,7 +328,7 @@ function setTemplateVal(val: any = {}) {
|
|
|
function toDetali(row: any) {
|
|
|
router.push({
|
|
|
path: `${MOD}/detail`,
|
|
|
- query: { id: row.name }
|
|
|
+ query: { id: row.id }
|
|
|
})
|
|
|
}
|
|
|
|