|
@@ -1,15 +1,33 @@
|
|
|
<template>
|
|
|
<!-- 添加或修改菜单对话框 -->
|
|
|
- <el-dialog :title="客户导出" v-model="visible" width="680px" append-to-body draggable>
|
|
|
+ <el-dialog
|
|
|
+ :title="客户导出"
|
|
|
+ v-model="visible"
|
|
|
+ width="680px"
|
|
|
+ append-to-body
|
|
|
+ draggable
|
|
|
+ >
|
|
|
<el-form ref="menuRef" :model="form" size="small" label-width="100px">
|
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="选择列" prop="name">
|
|
|
- <el-checkbox v-model="allChecked" @change="changeAll" :indeterminate="isIndeterminate">全选</el-checkbox>
|
|
|
- <el-checkbox-group v-model="columns" ref="columnRef" @change="columnChange">
|
|
|
- <el-checkbox v-for="column in defaultColumns" :key="column.field" :label="column.field">{{
|
|
|
- column.label
|
|
|
- }}</el-checkbox>
|
|
|
+ <el-checkbox
|
|
|
+ v-model="allChecked"
|
|
|
+ @change="changeAll"
|
|
|
+ :indeterminate="isIndeterminate"
|
|
|
+ >全选</el-checkbox
|
|
|
+ >
|
|
|
+ <el-checkbox-group
|
|
|
+ v-model="columns"
|
|
|
+ ref="columnRef"
|
|
|
+ @change="columnChange"
|
|
|
+ >
|
|
|
+ <el-checkbox
|
|
|
+ v-for="column in defaultColumns"
|
|
|
+ :key="column.field"
|
|
|
+ :label="column.field"
|
|
|
+ >{{ column.label }}</el-checkbox
|
|
|
+ >
|
|
|
<!-- <el-checkbox label="code">客户编号</el-checkbox>
|
|
|
<el-checkbox label="name">客户名称</el-checkbox>
|
|
|
<el-checkbox label="sourceCategoryName">客户来源类型</el-checkbox>
|
|
@@ -24,8 +42,14 @@
|
|
|
</el-form>
|
|
|
<template #footer>
|
|
|
<div class="dialog-footer">
|
|
|
- <el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
- <el-button @click="cancel">取 消</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ icon="Finished"
|
|
|
+ size="small"
|
|
|
+ @click="submitForm"
|
|
|
+ >确 定</el-button
|
|
|
+ >
|
|
|
+ <el-button icon="Close" size="small" @click="cancel">取 消</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
@@ -33,158 +57,179 @@
|
|
|
|
|
|
|
|
|
<script setup>
|
|
|
-import { getToken, getTenant } from '@/utils/auth'
|
|
|
-import { addCompany } from "@/api/business/crm/company"
|
|
|
-import useUserStore from '@/store/modules/user'
|
|
|
-import { listSource } from '@/api/settings/source'
|
|
|
-import { deepClone } from '@/utils'
|
|
|
-import { incomeDefault, taxTypes, confirmDefault } from "@/utils/default"
|
|
|
-const { proxy } = getCurrentInstance()
|
|
|
+import { getToken, getTenant } from "@/utils/auth";
|
|
|
+import { addCompany } from "@/api/business/crm/company";
|
|
|
+import useUserStore from "@/store/modules/user";
|
|
|
+import { listSource } from "@/api/settings/source";
|
|
|
+import { deepClone } from "@/utils";
|
|
|
+import { incomeDefault, taxTypes, confirmDefault } from "@/utils/default";
|
|
|
+const { proxy } = getCurrentInstance();
|
|
|
/** 父组件传参 */
|
|
|
const props = defineProps({
|
|
|
getList: {
|
|
|
type: Function,
|
|
|
- default: () => { }
|
|
|
- }
|
|
|
-})
|
|
|
-const { getList } = toRefs(props)
|
|
|
+ default: () => {},
|
|
|
+ },
|
|
|
+});
|
|
|
+const { getList } = toRefs(props);
|
|
|
/** 字典数组区 */
|
|
|
-const { develop_type } = proxy.useDict('develop_type')
|
|
|
+const { develop_type } = proxy.useDict("develop_type");
|
|
|
/** 表单抽屉 页变量 */
|
|
|
-const title = ref("")
|
|
|
-const loading = ref(false)
|
|
|
-const multiple = ref(true)
|
|
|
-const visible = ref(false)
|
|
|
-const editStatus = ref(false)
|
|
|
-const isFullscreen = ref(false)
|
|
|
-const addDetailNum = ref(1)
|
|
|
-const currentMember = {}
|
|
|
-const column = ref([])
|
|
|
-
|
|
|
-const defaultColumns = ref([{
|
|
|
- field: 'name', label: '客户名称'
|
|
|
-}, {
|
|
|
- field: 'code', label: '客户编码'
|
|
|
-}, {
|
|
|
- field: 'sourceCategoryName', label: '客户来源类型'
|
|
|
-}, {
|
|
|
- field: 'sourceName', label: '客户来源'
|
|
|
-}, {
|
|
|
- field: 'area', label: '所属区域'
|
|
|
-}, {
|
|
|
- field: 'taxNo', label: '税号'
|
|
|
-}, {
|
|
|
- field: 'annualIncome', label: '年收入'
|
|
|
-}, {
|
|
|
- field: 'taxType', label: '纳税类型'
|
|
|
-}, {
|
|
|
- field: 'isZero', label: '是否零申报'
|
|
|
-}, {
|
|
|
- field: 'collectionMethod', label: '征收方式'
|
|
|
-}, {
|
|
|
- field: 'quotaAmount', label: '定额金额'
|
|
|
-}])
|
|
|
-
|
|
|
-const sourceCategories = ref([])
|
|
|
-
|
|
|
-const allChecked = ref(false)
|
|
|
-const isIndeterminate = ref(true)
|
|
|
-
|
|
|
-const addType = ref(1)
|
|
|
-
|
|
|
-const webHost = import.meta.env.VITE_APP_BASE_API
|
|
|
+const title = ref("");
|
|
|
+const loading = ref(false);
|
|
|
+const multiple = ref(true);
|
|
|
+const visible = ref(false);
|
|
|
+const editStatus = ref(false);
|
|
|
+const isFullscreen = ref(false);
|
|
|
+const addDetailNum = ref(1);
|
|
|
+const currentMember = {};
|
|
|
+const column = ref([]);
|
|
|
+
|
|
|
+const defaultColumns = ref([
|
|
|
+ {
|
|
|
+ field: "name",
|
|
|
+ label: "客户名称",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: "code",
|
|
|
+ label: "客户编码",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: "sourceCategoryName",
|
|
|
+ label: "客户来源类型",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: "sourceName",
|
|
|
+ label: "客户来源",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: "area",
|
|
|
+ label: "所属区域",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: "taxNo",
|
|
|
+ label: "税号",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: "annualIncome",
|
|
|
+ label: "年收入",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: "taxType",
|
|
|
+ label: "纳税类型",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: "isZero",
|
|
|
+ label: "是否零申报",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: "collectionMethod",
|
|
|
+ label: "征收方式",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: "quotaAmount",
|
|
|
+ label: "定额金额",
|
|
|
+ },
|
|
|
+]);
|
|
|
+
|
|
|
+const sourceCategories = ref([]);
|
|
|
+
|
|
|
+const allChecked = ref(false);
|
|
|
+const isIndeterminate = ref(true);
|
|
|
+
|
|
|
+const addType = ref(1);
|
|
|
+
|
|
|
+const webHost = import.meta.env.VITE_APP_BASE_API;
|
|
|
|
|
|
const setHeaders = {
|
|
|
- Authorization: getToken()
|
|
|
-}
|
|
|
+ Authorization: getToken(),
|
|
|
+};
|
|
|
const data = reactive({
|
|
|
- columns: []
|
|
|
-})
|
|
|
+ columns: [],
|
|
|
+});
|
|
|
|
|
|
/*** 客户导入参数 */
|
|
|
const upload = reactive({
|
|
|
// 是否禁用上传
|
|
|
isUploading: false,
|
|
|
// 设置上传的请求头部
|
|
|
- headers: { Authorization: 'Bearer ' + getToken(), tenantId: getTenant() },
|
|
|
+ headers: { Authorization: "Bearer " + getToken(), tenantId: getTenant() },
|
|
|
// 上传的地址
|
|
|
- url: '/ezhizao-yzbh-crm/business/company/importData'
|
|
|
-})
|
|
|
+ url: "/ezhizao-yzbh-crm/business/company/importData",
|
|
|
+});
|
|
|
|
|
|
const contactorEmptyData = {
|
|
|
id: null,
|
|
|
- name: '',
|
|
|
- position: '',
|
|
|
- gender: '男',
|
|
|
- phone: '',
|
|
|
- email: '',
|
|
|
- isMain: '是',
|
|
|
- remark: ''
|
|
|
-}
|
|
|
+ name: "",
|
|
|
+ position: "",
|
|
|
+ gender: "男",
|
|
|
+ phone: "",
|
|
|
+ email: "",
|
|
|
+ isMain: "是",
|
|
|
+ remark: "",
|
|
|
+};
|
|
|
|
|
|
-const companyEmptyData = {
|
|
|
-}
|
|
|
+const companyEmptyData = {};
|
|
|
|
|
|
-const followQuery = ref({})
|
|
|
-const { columns } = toRefs(data)
|
|
|
-const conditions = ref({})
|
|
|
+const followQuery = ref({});
|
|
|
+const { columns } = toRefs(data);
|
|
|
+const conditions = ref({});
|
|
|
|
|
|
/*********************** 表单页方法 ****************************/
|
|
|
|
|
|
/** 抽屉打开 */
|
|
|
function open(options) {
|
|
|
reset();
|
|
|
- conditions.value = options
|
|
|
+ conditions.value = options;
|
|
|
visible.value = true;
|
|
|
}
|
|
|
|
|
|
-function init() {
|
|
|
-}
|
|
|
+function init() {}
|
|
|
|
|
|
function reset() {
|
|
|
- columns.values = []
|
|
|
- allChecked.value = false
|
|
|
- isIndeterminate.value = false
|
|
|
+ columns.values = [];
|
|
|
+ allChecked.value = false;
|
|
|
+ isIndeterminate.value = false;
|
|
|
}
|
|
|
|
|
|
function cancel() {
|
|
|
- visible.value = false
|
|
|
- reset()
|
|
|
+ visible.value = false;
|
|
|
+ reset();
|
|
|
}
|
|
|
|
|
|
function submitForm() {
|
|
|
- conditions.value.columns = columns.value
|
|
|
- console.log(conditions.value)
|
|
|
+ conditions.value.columns = columns.value;
|
|
|
+ console.log(conditions.value);
|
|
|
proxy.download(
|
|
|
"business/company/export",
|
|
|
- conditions.value
|
|
|
- ,
|
|
|
+ conditions.value,
|
|
|
`客户管理_${new Date().getTime()}.xlsx`
|
|
|
);
|
|
|
- cancel()
|
|
|
+ cancel();
|
|
|
}
|
|
|
|
|
|
function changeAll(arg) {
|
|
|
if (arg) {
|
|
|
- columns.value = defaultColumns.value.map(l => l.field)
|
|
|
+ columns.value = defaultColumns.value.map((l) => l.field);
|
|
|
} else {
|
|
|
- columns.value = []
|
|
|
+ columns.value = [];
|
|
|
}
|
|
|
}
|
|
|
|
|
|
function columnChange(value) {
|
|
|
- const checkedCount = value.length
|
|
|
- allChecked.value = checkedCount === defaultColumns.value.length
|
|
|
- isIndeterminate.value = checkedCount > 0 && checkedCount < defaultColumns.value.length
|
|
|
- console.log(columns.value)
|
|
|
+ const checkedCount = value.length;
|
|
|
+ allChecked.value = checkedCount === defaultColumns.value.length;
|
|
|
+ isIndeterminate.value =
|
|
|
+ checkedCount > 0 && checkedCount < defaultColumns.value.length;
|
|
|
+ console.log(columns.value);
|
|
|
}
|
|
|
|
|
|
// 暴露给父组件的方法
|
|
|
defineExpose({
|
|
|
open,
|
|
|
- close
|
|
|
-})
|
|
|
-init()
|
|
|
+ close,
|
|
|
+});
|
|
|
+init();
|
|
|
</script>
|
|
|
|
|
|
<style></style>
|