|
@@ -28,7 +28,7 @@
|
|
<!-- <el-button v-for="(button, index) in actionButtons" :key="index" type="primary">{{ button.text }}</el-button> -->
|
|
<!-- <el-button v-for="(button, index) in actionButtons" :key="index" type="primary">{{ button.text }}</el-button> -->
|
|
<el-button type="primary" @click="editContacts(false)">新建联系人</el-button>
|
|
<el-button type="primary" @click="editContacts(false)">新建联系人</el-button>
|
|
<el-button type="primary" @click="batchDeteleItem" :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" @click="showVisible('deteleContactsVisible')">回收站</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>
|
|
</div>
|
|
</div>
|
|
@@ -87,18 +87,46 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
+
|
|
|
|
+ <!-- 回收站 -->
|
|
|
|
+ <DeteleTables :visibles="allVisible.deteleContactsVisible" @closeVisible="closeVisible" />
|
|
|
|
+
|
|
|
|
+ <!-- 导入 -->
|
|
|
|
+ <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(IMPORTMOD, allText.importText)">{{ allText.importText }}</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 { getAllListByCode, getFromValue, resetFromValue, getFirstDayOfMonth, getLastDayOfMonth, formatDate, getTemplateKey, confirmAction, createTaskFromType } from '@/utils/tools'
|
|
|
|
-import { post, get } from "@/utils/request";
|
|
|
|
-import { actionButtons, tableColumns, GETSYSFILED, GETPERSONNEL, GETGENERATEFOEM, MOD, URL_PAGECONTACTS, getSex, URL_ADD, URL_UPLOAD, URL_BATCHDETELE, URL_DETELERECYCLE } from "./api";
|
|
|
|
|
|
+import { getAllListByCode, getFromValue, resetFromValue, getTemplateKey, confirmAction, downloadTemplate } 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";
|
|
import { useRouter, useRoute } from "vue-router";
|
|
import { GenerateForm } from '@zmjs/form-design';
|
|
import { GenerateForm } from '@zmjs/form-design';
|
|
import { URL_FETALL } from "../customer/api";
|
|
import { URL_FETALL } from "../customer/api";
|
|
-import { ElTable } from "element-plus";
|
|
|
|
|
|
+import { ElTable, UploadRequestOptions } from "element-plus";
|
|
|
|
+
|
|
|
|
+import DeteleTables from './component/deteleTables.vue'
|
|
|
|
|
|
const router = useRouter()
|
|
const router = useRouter()
|
|
const globalPopup = inject<GlobalPopup>('globalPopup')
|
|
const globalPopup = inject<GlobalPopup>('globalPopup')
|
|
@@ -141,17 +169,35 @@ const batchTableData = ref([])
|
|
const allLoading = reactive({ // 按钮加载 Loading
|
|
const allLoading = reactive({ // 按钮加载 Loading
|
|
formTableLading: false,
|
|
formTableLading: false,
|
|
editContactsSaveLoading: false,
|
|
editContactsSaveLoading: false,
|
|
- contactsTemplateRefLoading: false
|
|
|
|
|
|
+ contactsTemplateRefLoading: false,
|
|
|
|
+ importLoading: false
|
|
})
|
|
})
|
|
const allVisible = reactive({
|
|
const allVisible = reactive({
|
|
editContactsVisible: false,
|
|
editContactsVisible: false,
|
|
taskModalVisible: false,
|
|
taskModalVisible: false,
|
|
|
|
+ deteleContactsVisible: false,
|
|
|
|
+ importVisible: false
|
|
})
|
|
})
|
|
const allText = reactive({
|
|
const allText = reactive({
|
|
editContactsText: '新建联系人',
|
|
editContactsText: '新建联系人',
|
|
|
|
+ importText: '联系人导入模板.xlsx'
|
|
})
|
|
})
|
|
|
|
|
|
// 方法
|
|
// 方法
|
|
|
|
+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('导入成功' || '')
|
|
|
|
+ getContactPerson()
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ globalPopup?.showError(res.msg || '')
|
|
|
|
+}
|
|
|
|
|
|
function batchDeteleItem() {
|
|
function batchDeteleItem() {
|
|
const value = batchTableData.value.map((item: any) => item.id).join(',')
|
|
const value = batchTableData.value.map((item: any) => item.id).join(',')
|