|
@@ -1,332 +0,0 @@
|
|
|
-<template>
|
|
|
- <!-- <el-dialog v-model="dialogVisible" title="测试函数式弹窗" width="50%" draggable overflow :closed="closed"> -->
|
|
|
- <LjDialog
|
|
|
- ref="LjDrawerFjFileRef"
|
|
|
- v-bind="{
|
|
|
- ...drawerDefineProp
|
|
|
- }"
|
|
|
- :modal="false"
|
|
|
- :style="{ height: '60%' }"
|
|
|
- >
|
|
|
- <template #header>
|
|
|
- <div class="flx-1">
|
|
|
- <span class="text-h5-b">{{ $t("business.selector.cust.title") }}</span>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <div class="flx-col h-full">
|
|
|
- <LjHeaderMenu :update="dialogVisible" :data="initParams" :action="action" />
|
|
|
- <LjFoldLayoutDouble v-bind="layoutDefault" class="flx-1">
|
|
|
- <template #firstLeft>
|
|
|
- <TreeFilter id="value" label="text" :expand-on-click-node="true" :request-api="getCusarea" @change="changeTreeFilter" />
|
|
|
- </template>
|
|
|
- <template #secondMain>
|
|
|
- <div class="flx h-full">
|
|
|
- <div class="flx-col w-full">
|
|
|
- <LjVxeTable
|
|
|
- row-key="key"
|
|
|
- :columns="columns"
|
|
|
- :request-api="getData"
|
|
|
- :data-callback="dataCallback"
|
|
|
- :init-param="initParams"
|
|
|
- :dwname="DwnameEnum.custCrm"
|
|
|
- pagination
|
|
|
- :table-events="tableEvents"
|
|
|
- :table-props="tableProps"
|
|
|
- :tool-button="['refresh', 'setting', 'search']"
|
|
|
- :auto-load-layout="false"
|
|
|
- collapse-buttons
|
|
|
- >
|
|
|
- <!-- <template #tableHeader>
|
|
|
- <UploadWidget :params="initParams" :limit="props.limit" @uploaded="autoUploaded">
|
|
|
- <template #default="scope">
|
|
|
- <el-button
|
|
|
- v-if="addPower && CheckPower(addPower)"
|
|
|
- type="primary"
|
|
|
- :plain="selectList.length > 0"
|
|
|
- @click="scope.show"
|
|
|
- >
|
|
|
- <template #icon>
|
|
|
- <i class="iconfont iconupload-01"></i>
|
|
|
- </template>
|
|
|
- {{ $t("common.uploadFile") }}
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
- </UploadWidget>
|
|
|
- <el-button
|
|
|
- v-if="powerList.includes('save')"
|
|
|
- :disabled="!selectList.length"
|
|
|
- type="primary"
|
|
|
- :plain="!selectList.length"
|
|
|
- @click="downloadRowEvent(selectList)"
|
|
|
- >
|
|
|
- <template #icon>
|
|
|
- <i class="iconfont icondownload-01"></i>
|
|
|
- </template>
|
|
|
- <span class="text-body-c">{{ `${$t("common.download")}${selectSize ? "(" + selectSize + ")" : ""}` }}</span>
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- v-if="powerList.includes('del')"
|
|
|
- :disabled="!selectList.length"
|
|
|
- type="danger"
|
|
|
- plain
|
|
|
- @click="delRowEvent(selectList)"
|
|
|
- >
|
|
|
- <template #icon>
|
|
|
- <i class="iconfont icontrash-02"></i>
|
|
|
- </template>
|
|
|
- <span class="text-body-c">{{ `${$t("common.delText")}(${selectList.length})` }}</span>
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
- <template #operation="scope" v-if="powerList.includes('edit') || powerList.includes('del')">
|
|
|
- <template v-if="isActiveStatus(scope.row)">
|
|
|
- <el-button type="success" plain circle size="small" @click="saveRowEvent(scope.row)">
|
|
|
- <template #icon>
|
|
|
- <i class="iconfont iconsave-01" style="font-size: 12px"></i>
|
|
|
- </template>
|
|
|
- </el-button>
|
|
|
- <el-button type="info" plain circle size="small" @click="cancelRowEvent(scope.row)">
|
|
|
- <template #icon>
|
|
|
- <i class="iconfont iconwrong_light" style="font-size: 12px"></i>
|
|
|
- </template>
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
- <template v-else>
|
|
|
- <el-button type="primary" plain circle size="small" @click="editRowEvent(scope.row)">
|
|
|
- <template #icon>
|
|
|
- <i class="iconfont iconedit-02" style="font-size: 12px"></i>
|
|
|
- </template>
|
|
|
- </el-button>
|
|
|
- <el-popconfirm :title="$t('business.tips.file.delConfirm')" @confirm="delRowEvent(scope.row)">
|
|
|
- <template #reference>
|
|
|
- <el-button type="danger" plain circle size="small">
|
|
|
- <template #icon>
|
|
|
- <i class="iconfont icontrash-02" style="font-size: 12px"></i>
|
|
|
- </template>
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
- </el-popconfirm>
|
|
|
- </template>
|
|
|
- </template> -->
|
|
|
- </LjVxeTable>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </LjFoldLayoutDouble>
|
|
|
- </div>
|
|
|
- <!-- <template #footer>
|
|
|
- <span class="dialog-footer">
|
|
|
- <el-button @click="handleCancel">{{ $t("common.cancelText") }}</el-button>
|
|
|
- <el-button type="primary" @click="handleSubmit"> {{ $t("common.okText") }} </el-button>
|
|
|
- </span>
|
|
|
- </template> -->
|
|
|
- <!-- </el-dialog> -->
|
|
|
- </LjDialog>
|
|
|
-</template>
|
|
|
-
|
|
|
-<script lang="tsx" setup name="SelectorCustDialog">
|
|
|
-import { reactive, toRefs, ref, onMounted, nextTick, inject, watch } from "vue";
|
|
|
-import LjDialog from "@/components/LjDialog/index.vue";
|
|
|
-import LjFoldLayoutDouble from "@/components/LjFoldLayoutDouble/index.vue";
|
|
|
-import LjVxeTable from "@/components/LjVxeTable/index.vue";
|
|
|
-// 注意: 需要按需引入使用到的第三方UI组件
|
|
|
-import { ElDialog, ElButton } from "element-plus";
|
|
|
-
|
|
|
-import { getL1Cusarea } from "@/api/modules/saletask";
|
|
|
-import TreeFilter from "@/components/TreeFilter/index.vue";
|
|
|
-import { useCust } from "@/views/saletask/cust/hooks/index";
|
|
|
-import { useI18n } from "vue-i18n";
|
|
|
-import { DwnameEnum } from "@/enums/dwnameEnum";
|
|
|
-import { cloneDeep, pick, defaultsDeep } from "lodash-es";
|
|
|
-import { CommonDynamicSelect } from "@/api/modules/common";
|
|
|
-import LjHeaderMenu from "@/components/LjHeaderMenu/index.vue";
|
|
|
-import { useAuthButtons } from "@/hooks/useAuthButtons";
|
|
|
-import { detailAction } from "@/components/LjDetail/interface";
|
|
|
-
|
|
|
-const props = withDefaults(
|
|
|
- defineProps<{
|
|
|
- // show?: boolean; // moadl开关
|
|
|
- content?: string; // 内容
|
|
|
- closed?: () => any;
|
|
|
- }>(),
|
|
|
- {}
|
|
|
-);
|
|
|
-
|
|
|
-const { t } = useI18n();
|
|
|
-const { columns } = useCust(t);
|
|
|
-const LjDrawerFjFileRef = ref();
|
|
|
-const { CheckPower, CheckOption, buttonNew, buttonDefault } = useAuthButtons(t);
|
|
|
-/*
|
|
|
- * @description 抽屉默认属性
|
|
|
- */
|
|
|
-const drawerDefineProp = {
|
|
|
- draggable: true,
|
|
|
- overflow: true,
|
|
|
- width: "60%",
|
|
|
- modalClass: "lj-file-dialog"
|
|
|
-};
|
|
|
-
|
|
|
-const initParams = ref({ cusareaid: -1, cusareaidarry: [] });
|
|
|
-const tableProps = {
|
|
|
- height: "auto",
|
|
|
- editConfig: { trigger: "click", mode: "cell" }
|
|
|
- // rowClassName: rowClsNameFunc
|
|
|
-};
|
|
|
-// 返回绑定的事件
|
|
|
-const tableEvents = {
|
|
|
- // "cell-dblclick": handleDBlClickTable,
|
|
|
- // "cell-click": handleClickTable
|
|
|
-};
|
|
|
-
|
|
|
-/**
|
|
|
- * @description 修改时,按钮展示
|
|
|
- */
|
|
|
-const action: detailAction[] = [
|
|
|
- buttonDefault({
|
|
|
- label: t("common.cancelText"),
|
|
|
- icon: "iconchevron-left",
|
|
|
- clickFunc: item => {
|
|
|
- // if (route.path.indexOf("/new") > -1) {
|
|
|
- // tabRemove(route.fullPath);
|
|
|
- // router.replace("/saletask/sale/saletaskCrm");
|
|
|
- // } else {
|
|
|
- // router.replace(
|
|
|
- // `/saletask/sale/saletaskCrm/detail?scid=${LjDetailRef.value._mainData.scid}&taskid=${LjDetailRef.value._mainData.taskid}&code=${LjDetailRef.value._mainData.taskcode}`
|
|
|
- // );
|
|
|
- // }
|
|
|
- }
|
|
|
- }),
|
|
|
- buttonDefault({
|
|
|
- label: t("common.saveText"),
|
|
|
- icon: "iconsave-01",
|
|
|
- path: "/saletask/sale/saletaskCrm/new"
|
|
|
- })
|
|
|
-];
|
|
|
-
|
|
|
-const dataCallback = (data: any) => {
|
|
|
- console.log("data :>> ", data);
|
|
|
- return {
|
|
|
- list: data.datatable,
|
|
|
- tableinfo: data.tableinfo,
|
|
|
- total: data.totalcnt,
|
|
|
- pageNum: data.pageindex,
|
|
|
- pageSize: data.pagesize
|
|
|
- };
|
|
|
-};
|
|
|
-
|
|
|
-const getData = (params: any) => {
|
|
|
- console.log("getData params :>> ", params);
|
|
|
- let newParams: any = {};
|
|
|
- params.pageNum && (newParams.pageindex = params.pageNum);
|
|
|
- params.pageSize && (newParams.pagesize = params.pageSize);
|
|
|
- // // inusescid = 0;
|
|
|
- // params.quoteid = params.lastOutware[0];
|
|
|
- // params.inuse = 4;
|
|
|
- // params.cusareaid = [1, 2, 3];
|
|
|
-
|
|
|
- // params.cusareaidarry = [23];
|
|
|
- delete params.lastOutware;
|
|
|
- delete params.pageNum;
|
|
|
- delete params.pageSize;
|
|
|
- newParams.queryParams = params;
|
|
|
- console.log("params :>> ", params);
|
|
|
- newParams.dsname = "web_cust_crm_index";
|
|
|
-
|
|
|
- return CommonDynamicSelect(newParams, DwnameEnum.custCrm);
|
|
|
- // return [];
|
|
|
-};
|
|
|
-
|
|
|
-const emits = defineEmits(["update:show", "submit", "cancel"]);
|
|
|
-const dialogVisible = ref(false);
|
|
|
-// const state = reactive({
|
|
|
-// dialogVisible: false
|
|
|
-// });
|
|
|
-// const { dialogVisible } = toRefs(state);
|
|
|
-// onMounted(() => {
|
|
|
-// nextTick(() => {
|
|
|
-// dialogVisible.value = props.show;
|
|
|
-// });
|
|
|
-// });
|
|
|
-// watch(
|
|
|
-// () => props.show,
|
|
|
-// newVal => {
|
|
|
-// console.log("watch show newVal :>> ", newVal);
|
|
|
-// dialogVisible.value = newVal;
|
|
|
-// },
|
|
|
-// );
|
|
|
-const show = (params: any) => {
|
|
|
- initParams.value = defaultsDeep(params, initParams.value);
|
|
|
- LjDrawerFjFileRef.value.show();
|
|
|
-
|
|
|
- nextTick(() => {
|
|
|
- dialogVisible.value = true;
|
|
|
- });
|
|
|
-};
|
|
|
-/** submit */
|
|
|
-const handleSubmit = () => {
|
|
|
- // 回调
|
|
|
- emits("submit", { action: "submit", msg: "submit back" });
|
|
|
- // 关闭弹窗
|
|
|
- // props.closed && props.closed();
|
|
|
- LjDrawerFjFileRef.value.hide();
|
|
|
- dialogVisible.value = false;
|
|
|
-};
|
|
|
-/** cancel */
|
|
|
-const handleCancel = () => {
|
|
|
- // 回调
|
|
|
- emits("cancel", { action: "cancel", msg: "cancel back" });
|
|
|
- // 关闭弹窗
|
|
|
- // props.closed && props.closed();
|
|
|
- LjDrawerFjFileRef.value.hide();
|
|
|
- dialogVisible.value = false;
|
|
|
-};
|
|
|
-
|
|
|
-const layoutDefault: any = {
|
|
|
- first: {
|
|
|
- left: {
|
|
|
- minWidth: "0"
|
|
|
- // minWidth: "20%"
|
|
|
- }
|
|
|
- },
|
|
|
- params: {}
|
|
|
-};
|
|
|
-const getCusarea = async () => {
|
|
|
- const data = await getL1Cusarea({ RecurionType: 1 });
|
|
|
- return data.RecurionList;
|
|
|
-};
|
|
|
-
|
|
|
-// const cusareaid = ref(0);
|
|
|
-// const cusareaidarry = ref([]);
|
|
|
-
|
|
|
-const getChildNode = (nodes: any) => {
|
|
|
- let arr: any = [];
|
|
|
- arr.push(nodes.value);
|
|
|
- if (nodes.children) {
|
|
|
- console.log("nodes.children :>> ", nodes.children);
|
|
|
- nodes.children.map((item: any) => {
|
|
|
- if (item.children) {
|
|
|
- let arr1 = getChildNode(item);
|
|
|
- arr = arr.concat(arr1);
|
|
|
- } else {
|
|
|
- arr.push(item.value);
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- return arr;
|
|
|
-};
|
|
|
-
|
|
|
-const changeTreeFilter = (val: any) => {
|
|
|
- console.log("val :>> ", val);
|
|
|
- // alert(getCheckedNodes());
|
|
|
- //proTable.value!.pageable.pageNum = 1;
|
|
|
- // cusareaid.value = val.children ?? [];
|
|
|
- initParams.value.cusareaid = val.value ?? -1;
|
|
|
- // 访问当前选中节点的下级节点数值
|
|
|
- initParams.value.cusareaidarry = getChildNode(val);
|
|
|
- // childrenValues.value.push(val.value);
|
|
|
- console.log("val :>>Children Values:", initParams.value);
|
|
|
-};
|
|
|
-
|
|
|
-defineExpose({
|
|
|
- show
|
|
|
-});
|
|
|
-</script>
|