修复bug

This commit is contained in:
weipengfei 2023-08-18 12:04:14 +08:00
parent d05710a997
commit b21d4266d1
7 changed files with 1212 additions and 1010 deletions

View File

@ -10,6 +10,8 @@ const map = shallowRef(null);
let AMap: any = null;
let markerList: Array<any> = [];
let m_index: Number = 0;
let geocoder: any = null;
let autocomplete: any = null;
const emits = defineEmits("changeMaps");
@ -20,10 +22,6 @@ const resetMap = () => {
emits("changeMaps", markerList);
};
defineExpose({
resetMap,
});
const initMap = async () => {
const loader = AMapLoader.load({
key: "4f8f55618010007147aab96fc72bb408",
@ -36,37 +34,23 @@ const initMap = async () => {
zoom: 13,
});
AMap.plugin("AMap.Geocoder", function () {
geocoder = new AMap.Geocoder({
radius: 10, // 1000
extensions: "all", // POIbasebaseall
}); //
});
// // Autocomplete
// autocomplete = new AMap.Autocomplete({
// city: "", //
// });
map.value.on("click", (e: any) => {
// console.log("", e.lnglat);
if (m_index >= 3) return;
//
getDistrictName(e.lnglat.lng, e.lnglat.lat);
//
function getDistrictName(lng, lat) {
AMap.plugin("AMap.Geocoder", function () {
var geocoder = new AMap.Geocoder({
radius: 10, // 1000
extensions: "all", // POIbasebaseall
}); //
geocoder.getAddress([lng, lat], function (status, result) {
if (status === "complete" && result.info === "OK") {
//
var district = result.regeocode.addressComponent.district;
// console.log(district, result.regeocode); //
markerList.push({
lnglat: e.lnglat,
address: result.regeocode.formattedAddress,
});
emits("changeMaps", markerList);
} else {
//
console.log("逆地理编码失败");
}
});
});
}
getDistrictName(e.lnglat.lng, e.lnglat.lat, e);
// Marker
var customIcon = new AMap.Icon({
@ -107,6 +91,47 @@ const initMap = async () => {
});
};
const searchMap = (address: any) => {
console.log(address);
ElMessage.error("搜索功能开发中");
// autocomplete.search(address, function (status: any, result: any) {
// console.log(status, result);
// if (status === "complete" && result.info === "OK") {
// //
// var tips = result.tips;
// //
// // ...
// }
// });
};
//
const getDistrictName = (lng: any, lat: any, e: any) => {
geocoder.getAddress([lng, lat], function (status: any, result: any) {
if (status === "complete" && result.info === "OK") {
//
var district = result.regeocode.addressComponent.district;
// console.log(district, result.regeocode); //
markerList.push({
lnglat: e.lnglat,
address: result.regeocode.formattedAddress,
});
emits("changeMaps", markerList);
} else {
//
console.log("逆地理编码失败");
}
});
};
defineExpose({
resetMap,
searchMap,
});
onMounted(() => {
initMap();
});

View File

@ -18,17 +18,20 @@
</template>
<script setup lang="ts">
import useUserStore from '@/stores/modules/user'
import feedback from '@/utils/feedback'
const userStore = useUserStore()
import useUserStore from "@/stores/modules/user";
import feedback from "@/utils/feedback";
import cache from "@/utils/cache";
import { ACCOUNT_KEY } from "@/enums/cacheEnums";
const userStore = useUserStore();
const userInfo = computed(() => userStore.userInfo)
const userInfo = computed(() => userStore.userInfo);
const handleCommand = async (command: string) => {
switch (command) {
case 'logout':
await feedback.confirm('确定退出登录吗?')
userStore.logout()
case "logout":
await feedback.confirm("确定退出登录吗?");
cache.set("logout", cache.get(ACCOUNT_KEY).account);
userStore.logout();
}
}
};
</script>

View File

@ -8,7 +8,9 @@
<div
class="login-form bg-body flex flex-col justify-center px-10 py-10 md:w-[400px] w-[375px] flex-none mx-auto"
>
<div class="text-center text-3xl font-medium mb-8">{{ config.web_name }}</div>
<div class="text-center text-3xl font-medium mb-8">
{{ config.web_name }}
</div>
<el-form ref="formRef" :model="formData" size="large" :rules="rules">
<el-form-item prop="account">
<el-input
@ -38,7 +40,12 @@
<div class="mb-5">
<el-checkbox v-model="remAccount" label="记住账号"></el-checkbox>
</div>
<el-button type="primary" size="large" :loading="isLock" @click="lockLogin">
<el-button
type="primary"
size="large"
:loading="isLock"
@click="lockLogin"
>
登录
</el-button>
</div>
@ -49,79 +56,83 @@
</template>
<script lang="ts" setup>
import { computed, onMounted, reactive, ref, shallowRef } from 'vue'
import type { InputInstance, FormInstance } from 'element-plus'
import LayoutFooter from '@/layout/components/footer.vue'
import useAppStore from '@/stores/modules/app'
import useUserStore from '@/stores/modules/user'
import cache from '@/utils/cache'
import { ACCOUNT_KEY } from '@/enums/cacheEnums'
import { PageEnum } from '@/enums/pageEnum'
import { useLockFn } from '@/hooks/useLockFn'
const passwordRef = shallowRef<InputInstance>()
const formRef = shallowRef<FormInstance>()
const appStore = useAppStore()
const userStore = useUserStore()
const route = useRoute()
const router = useRouter()
const remAccount = ref(false)
const config = computed(() => appStore.config)
import { computed, onMounted, reactive, ref, shallowRef } from "vue";
import type { InputInstance, FormInstance } from "element-plus";
import LayoutFooter from "@/layout/components/footer.vue";
import useAppStore from "@/stores/modules/app";
import useUserStore from "@/stores/modules/user";
import cache from "@/utils/cache";
import { ACCOUNT_KEY } from "@/enums/cacheEnums";
import { PageEnum } from "@/enums/pageEnum";
import { useLockFn } from "@/hooks/useLockFn";
const passwordRef = shallowRef<InputInstance>();
const formRef = shallowRef<FormInstance>();
const appStore = useAppStore();
const userStore = useUserStore();
const route = useRoute();
const router = useRouter();
const remAccount = ref(false);
const config = computed(() => appStore.config);
const formData = reactive({
account: '',
password: ''
})
account: "",
password: "",
});
const rules = {
account: [
{
required: true,
message: '请输入账号',
trigger: ['blur']
}
message: "请输入账号",
trigger: ["blur"],
},
],
password: [
{
required: true,
message: '请输入密码',
trigger: ['blur']
}
]
}
message: "请输入密码",
trigger: ["blur"],
},
],
};
//
const handleEnter = () => {
if (!formData.password) {
return passwordRef.value?.focus()
return passwordRef.value?.focus();
}
handleLogin()
}
handleLogin();
};
//
const handleLogin = async () => {
await formRef.value?.validate()
await formRef.value?.validate();
//
cache.set(ACCOUNT_KEY, {
remember: remAccount.value,
account: remAccount.value ? formData.account : ''
})
await userStore.login(formData)
account: remAccount.value ? formData.account : "",
});
await userStore.login(formData);
const {
query: { redirect }
} = route
const path = typeof redirect === 'string' ? redirect : PageEnum.INDEX
router.push(path)
}
const { isLock, lockFn: lockLogin } = useLockFn(handleLogin)
query: { redirect },
} = route;
const path = typeof redirect === "string" ? redirect : PageEnum.INDEX;
router.push(
cache.get("logout") == formData.account || typeof redirect === "string"
? path
: PageEnum.INDEX
);
};
const { isLock, lockFn: lockLogin } = useLockFn(handleLogin);
onMounted(() => {
const value = cache.get(ACCOUNT_KEY)
const value = cache.get(ACCOUNT_KEY);
if (value?.remember) {
remAccount.value = value.remember
formData.account = value.account
remAccount.value = value.remember;
formData.account = value.account;
}
})
});
</script>
<style lang="scss" scoped>
.login {
background-image: url('./images/login_bg.png');
background-image: url("./images/login_bg.png");
@apply min-h-screen bg-no-repeat bg-center bg-cover;
.login-card {
height: 400px;

View File

@ -26,7 +26,11 @@
placeholder="请输入镇"
/>
</el-form-item>
<el-form-item label="公司类型" prop="company_type" v-show="company_type_show">
<el-form-item
label="公司类型"
prop="company_type"
v-show="company_type_show"
>
<el-select
v-model="queryParams.company_type"
placeholder="请选择公司类型"
@ -72,8 +76,8 @@
:to="{
path: getRoutePath('company/add:edit'),
query: {
flag: true
}
flag: true,
},
}"
>
<el-button type="primary" class="mb-4">
@ -98,21 +102,57 @@
<div class="mt-4">
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
<el-table-column label="id" prop="id" show-overflow-tooltip width="60" />
<el-table-column label="公司名称" prop="company_name" show-overflow-tooltip />
<el-table-column label="公司类型" prop="company_type" show-overflow-tooltip />
<el-table-column
label="id"
prop="id"
show-overflow-tooltip
width="60"
/>
<el-table-column
label="公司名称"
prop="company_name"
show-overflow-tooltip
/>
<el-table-column
label="公司类型"
prop="company_type"
show-overflow-tooltip
/>
<el-table-column label="区县" prop="area" show-overflow-tooltip />
<el-table-column label="乡镇" prop="street" show-overflow-tooltip />
<el-table-column label="主联系人" prop="master_name" show-overflow-tooltip />
<el-table-column label="联系方式" prop="master_phone" show-overflow-tooltip />
<el-table-column label="片区经理" prop="area_manager" show-overflow-tooltip />
<el-table-column label="是否签约" prop="is_contract" show-overflow-tooltip>
<el-table-column
label="主联系人"
prop="master_name"
show-overflow-tooltip
/>
<el-table-column
label="联系方式"
prop="master_phone"
show-overflow-tooltip
/>
<el-table-column
label="片区经理"
prop="area_manager"
show-overflow-tooltip
/>
<el-table-column
label="是否签约"
prop="is_contract"
show-overflow-tooltip
>
<template #default="{ row }">
<span v-if="row.is_contract == 1" style="color: #67c23a">已签约</span>
<span v-if="row.is_contract == 1" style="color: #67c23a"
>已签约</span
>
<span v-else style="color: #fe0000">未签约</span>
</template></el-table-column
>
<el-table-column label="操作" align="center" width="510" fixed="right">
<el-table-column
label="操作"
align="center"
width="510"
fixed="right"
>
<template #default="{ row }">
<div style="display: flex">
<el-button type="primary" link>
@ -121,8 +161,8 @@
path: getRoutePath('user.user/lists'),
query: {
company_id: row.id,
read: true
}
read: true,
},
}"
>查看成员</router-link
>
@ -133,8 +173,8 @@
path: getRoutePath('company/subordinate/lists'),
query: {
company_id: row.id,
read: true
}
read: true,
},
}"
>下属公司</router-link
>
@ -146,8 +186,8 @@
query: {
id: row.id,
read: true,
isshow: true
}
isshow: true,
},
}"
>详情</router-link
>
@ -158,8 +198,8 @@
path: getRoutePath('company/add:edit'),
query: {
id: row.id,
edit: true
}
edit: true,
},
}"
>编辑</router-link
>
@ -211,7 +251,7 @@
v-perms="['company/postsms']"
type="primary"
link
@click=";(showPop = true), (contractId = row.id)"
@click="(showPop = true), (contractId = row.id)"
>发送短信</el-button
>
</template>
@ -224,12 +264,14 @@
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
<el-dialog v-model="showInitiateContractPop" @close="offInitiateContractPop">
<el-dialog
v-model="showInitiateContractPop"
@close="offInitiateContractPop"
>
<h1>重要提醒</h1>
<div>
<div class="content">请确认信息是否有误</div>
<el-card>
<el-col :span="24" class="el-card pt-6">
<el-row>
<el-col :span="12">
<el-form-item label-width="100px" label="签约方" prop="field130">
@ -286,7 +328,11 @@
</el-col>
<el-col :span="12">
<el-form-item label-width="100px" label="合同编号" prop="field133">
<el-form-item
label-width="100px"
label="合同编号"
prop="field133"
>
<el-input
placeholder="系统自动生成"
v-model="contractFormData.contract_no"
@ -297,14 +343,15 @@
</el-form-item>
</el-col>
</el-row>
</el-col>
</el-card>
</div>
<p class="btn_menu">
<el-button type="primary" size="large" @click="InitiateContract"
>确认创建</el-button
>确认</el-button
>
<el-button type="info" size="large" @click="offInitiateContractPop"
>返回</el-button
>
<el-button type="info" size="large" @click="offInitiateContractPop">返回</el-button>
</p>
</el-dialog>
<el-dialog v-model="showPop" @close="offPop">
@ -316,10 +363,16 @@
确认签约短信将在60秒后发送,请注意查收,并点击短信链接进行线上合同签约
</div>
<p class="btn_menu">
<el-button type="primary" size="large" v-if="showConctactPop" @click="creContct"
>确认创建</el-button
<el-button
type="primary"
size="large"
v-if="showConctactPop"
@click="creContct"
>确认</el-button
>
<el-button type="primary" size="large" v-else @click="sendMsg"
>确认</el-button
>
<el-button type="primary" size="large" v-else @click="sendMsg">确认</el-button>
<el-button type="info" size="large" @click="offPop">返回</el-button>
</p>
</el-dialog>
@ -327,9 +380,9 @@
</template>
<script lang="ts" setup name="companyLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import useUserStore from '@/stores/modules/user'
import { usePaging } from "@/hooks/usePaging";
import { useDictData } from "@/hooks/useDictOptions";
import useUserStore from "@/stores/modules/user";
import {
apiCompanyLists,
companyListTwo,
@ -338,161 +391,163 @@ import {
sendMsgApi,
authentication,
apiCompanyDetail,
initiate_contract
} from '@/api/company'
import { timeFormat } from '@/utils/util'
import feedback from '@/utils/feedback'
import { dictDataLists } from '@/api/setting/dict'
import { getRoutePath } from '@/router'
import DialogIndex from './dialog_index.vue'
initiate_contract,
} from "@/api/company";
import { timeFormat } from "@/utils/util";
import feedback from "@/utils/feedback";
import { dictDataLists } from "@/api/setting/dict";
import { getRoutePath } from "@/router";
import DialogIndex from "./dialog_index.vue";
const userStore = useUserStore()
console.log(userStore.userInfo.company_id)
const route = useRoute()
const company_type_show = ref(true)
const userStore = useUserStore();
console.log(userStore.userInfo.company_id);
const route = useRoute();
const company_type_show = ref(true);
//
//
const showPop = ref(false)
const showConctactPop = ref(false)
const showPop = ref(false);
const showConctactPop = ref(false);
const offPop = () => {
showPop.value = false
showConctactPop.value = false
}
const InitiateContractPop = ref(false)
const showInitiateContractPop = ref(false)
showPop.value = false;
showConctactPop.value = false;
};
const InitiateContractPop = ref(false);
const showInitiateContractPop = ref(false);
const offInitiateContractPop = () => {
showInitiateContractPop.value = false
InitiateContractPop.value = false
}
showInitiateContractPop.value = false;
InitiateContractPop.value = false;
};
// id
const contractId = ref('')
const contractId = ref("");
//
const contractFormData = ref({
party_a: '',
party_a_name: '',
party_b: '',
party_b_name: '',
contract_type: '',
contract_no: ''
})
party_a: "",
party_a_name: "",
party_b: "",
party_b_name: "",
contract_type: "",
contract_no: "",
});
const company_list = ref([])
const contract_type = ref([])
const company_list = ref([]);
const contract_type = ref([]);
const getDetails = async (id: any) => {
const data = await apiCompanyDetail({
id: id
})
id: id,
});
companyListTwo().then((res) => {
company_list.value = res
})
company_list.value = res;
});
dictDataLists({ type_id: 7 }).then((res) => {
contract_type.value = res.lists
})
contractFormData.value.party_b = data.id
contractFormData.value.party_b_name = data.company_name
contract_type.value = res.lists;
});
contractFormData.value.party_b = data.id;
contractFormData.value.party_b_name = data.company_name;
if (userStore.userInfo.company.id) {
contractFormData.value.party_a = userStore.userInfo.company.id
contractFormData.value.party_a_name = userStore.userInfo.company.company_name
contractFormData.value.party_a = userStore.userInfo.company.id;
contractFormData.value.party_a_name =
userStore.userInfo.company.company_name;
} else {
contractFormData.value.party_a = ''
contractFormData.value.party_a_name = ''
contractFormData.value.party_a = "";
contractFormData.value.party_a_name = "";
}
}
};
const showChangeCompany = (row: any) => {
contractId.value = row.id
getDetails(row.id)
contractId.value = row.id;
getDetails(row.id);
// showPop.value = true
ShowInitiateContractPop()
}
ShowInitiateContractPop();
};
const ShowInitiateContractPop = () => {
;(InitiateContractPop.value = true), (showInitiateContractPop.value = true)
}
(InitiateContractPop.value = true), (showInitiateContractPop.value = true);
};
const showCreateConctPop = (row) => {
;(showPop.value = true), (showConctactPop.value = true), (contractId.value = row.id)
}
const InitiateContract = () => {
initiate_contract({
(showPop.value = true),
(showConctactPop.value = true),
(contractId.value = row.id);
};
const InitiateContract = async () => {
await initiate_contract({
id: contractId.value,
...contractFormData.value
}).catch((res) => {
console.log(res)
})
offInitiateContractPop()
}
const creContct = () => {
generateGontract({ id: contractId.value }).catch((res) => {
console.log(res)
})
offPop()
}
const sendMsg = () => {
sendMsgApi({ id: contractId.value })
offPop()
}
...contractFormData.value,
});
getLists();
offInitiateContractPop();
};
const creContct = async () => {
await generateGontract({ id: contractId.value });
getLists();
offPop();
};
const sendMsg = async () => {
await sendMsgApi({ id: contractId.value });
getLists();
offPop();
};
//
//
const queryParams = reactive({
company_name: '',
area: '',
street: '',
company_type: '',
area_manager: '',
company_name: "",
area: "",
street: "",
company_type: "",
area_manager: "",
//
is_contract: ''
})
is_contract: "",
});
if (route.query.company_type) {
company_type_show.value = false
queryParams['company_type'] = route.query.company_type?.toString() || ''
company_type_show.value = false;
queryParams["company_type"] = route.query.company_type?.toString() || "";
}
const datas = reactive({
dictTypeLists: []
})
dictTypeLists: [],
});
const getdictTypeLists = async () => {
const data = await dictDataLists({ type_id: 6 })
datas['dictTypeLists'] = data['lists']
}
getdictTypeLists()
const data = await dictDataLists({ type_id: 6 });
datas["dictTypeLists"] = data["lists"];
};
getdictTypeLists();
//
const selectData = ref<any[]>([])
const selectData = ref<any[]>([]);
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
selectData.value = val.map(({ id }) => id);
};
//
const { dictData } = useDictData('')
const { dictData } = useDictData("");
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiCompanyLists,
params: queryParams
})
params: queryParams,
});
//
const handleDelete = async (id: number | any[]) => {
await feedback.confirm('确定要删除?')
await apiCompanyDelete({ id })
getLists()
}
await feedback.confirm("确定要删除?");
await apiCompanyDelete({ id });
getLists();
};
const handleAuthentication = async (id: number | any[]) => {
await feedback.confirm('确定要认证?')
await authentication({ id })
getLists()
}
await feedback.confirm("确定要认证?");
await authentication({ id });
getLists();
};
//
const auditing = () => {
ElMessage.warning('请等待合同审核完成!')
}
ElMessage.warning("请等待合同审核完成!");
};
getLists()
getLists();
</script>
<style lang="scss">
.btn {

View File

@ -3,25 +3,65 @@
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
<div class="mt-4">
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
<el-table-column label="id" prop="id" show-overflow-tooltip width="60" />
<el-table-column label="公司名称" prop="company_name" show-overflow-tooltip />
<el-table-column label="公司类型" prop="company_type" show-overflow-tooltip />
<el-table-column label="区县" prop="area_name" show-overflow-tooltip />
<el-table-column label="乡镇" prop="street_name" show-overflow-tooltip />
<el-table-column label="主联系人" prop="master_name" show-overflow-tooltip />
<el-table-column label="联系方式" prop="master_phone" show-overflow-tooltip />
<el-table-column
label="id"
prop="id"
show-overflow-tooltip
width="60"
/>
<el-table-column
label="公司名称"
prop="company_name"
show-overflow-tooltip
/>
<el-table-column
label="公司类型"
prop="company_type"
show-overflow-tooltip
/>
<el-table-column
label="区县"
prop="area_name"
show-overflow-tooltip
/>
<el-table-column
label="乡镇"
prop="street_name"
show-overflow-tooltip
/>
<el-table-column
label="主联系人"
prop="master_name"
show-overflow-tooltip
/>
<el-table-column
label="联系方式"
prop="master_phone"
show-overflow-tooltip
/>
<el-table-column
label="片区经理"
prop="area_manager_name"
show-overflow-tooltip
/>
<el-table-column label="是否签约" prop="is_contract" show-overflow-tooltip>
<el-table-column
label="是否签约"
prop="is_contract"
show-overflow-tooltip
>
<template #default="{ row }">
<span v-if="row.is_contract == 1" style="color: #67c23a">已签约</span>
<span v-if="row.is_contract == 1" style="color: #67c23a"
>已签约</span
>
<span v-else style="color: #fe0000">未签约</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="450" fixed="right">
<el-table-column
label="操作"
align="center"
width="300"
fixed="right"
>
<template #default="{ row }">
<div style="display: flex">
<el-button type="primary" link>
@ -30,8 +70,8 @@
path: getRoutePath('auth.admin/lists'),
query: {
company_id: row.id,
read: true
}
read: true,
},
}"
>查看成员</router-link
>
@ -46,8 +86,8 @@
path: getRoutePath('company/add:edit'),
query: {
id: row.id,
read: true
}
read: true,
},
}"
>详情</router-link
>
@ -62,8 +102,8 @@
path: getRoutePath('company/add:edit'),
query: {
id: row.id,
edit: true
}
edit: true,
},
}"
>编辑</router-link
>
@ -76,19 +116,49 @@
>删除</el-button
>
<el-button
v-perms="['company/edit', 'company/add']"
v-if="row.is_authentication == 0"
v-perms="['company/authentication']"
type="primary"
link
@click="showCreateConctPop(row)"
@click="handleAuthentication(row.id)"
>企业认证</el-button
>
<template v-if="row.is_authentication && row.is_contract == 0">
<el-button
v-if="
Array.isArray(row.contract) && row.contract.length == 0
"
v-perms="['company/initiate_contract']"
type="primary"
link
@click="showChangeCompany(row)"
>生成合同</el-button
>
<el-button
v-perms="['company/edit', 'company/add']"
v-else-if="row.contract?.check_status == 1"
v-perms="['company/initiate_contract']"
type="warning"
link
@click="auditing"
>审核中</el-button
>
<el-button
v-else-if="row.contract?.check_status == 2"
v-perms="['company/Draftingcontracts']"
type="primary"
link
@click=";(showPop = true), (contractId = row.id)"
@click="showCreateConctPop(row)"
>发送合同</el-button
>
<el-button
v-else-if="row.contract?.check_status == 3"
v-perms="['company/postsms']"
type="primary"
link
@click="(showPop = true), (contractId = row.id)"
>发送短信</el-button
>
</template>
</div>
</template>
</el-table-column>
@ -107,10 +177,16 @@
确认签约短信将在60秒后发送,请注意查收,并点击短信链接进行线上合同签约
</div>
<p class="btn_menu">
<el-button type="primary" size="large" v-if="showConctactPop" @click="creContct"
<el-button
type="primary"
size="large"
v-if="showConctactPop"
@click="creContct"
>确认创建</el-button
>
<el-button type="primary" size="large" v-else @click="sendMsg">确认</el-button>
<el-button type="primary" size="large" v-else @click="sendMsg"
>确认</el-button
>
<el-button type="info" size="large" @click="offPop">返回</el-button>
</p>
</el-dialog>
@ -118,93 +194,99 @@
</template>
<script lang="ts" setup name="companyLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiCompanyLists, apiCompanyDelete, apiSubordinateList } from '@/api/company'
import { generateGontract, sendMsgApi } from '@/api/perms/admin'
import { timeFormat } from '@/utils/util'
import feedback from '@/utils/feedback'
import { dictDataLists } from '@/api/setting/dict'
import { usePaging } from "@/hooks/usePaging";
import { useDictData } from "@/hooks/useDictOptions";
import {
apiCompanyLists,
apiCompanyDelete,
apiSubordinateList,
} from "@/api/company";
import { generateGontract, sendMsgApi } from "@/api/perms/admin";
import { timeFormat } from "@/utils/util";
import feedback from "@/utils/feedback";
import { dictDataLists } from "@/api/setting/dict";
// import EditPopup from './edit.vue'
import { getRoutePath } from '@/router'
import { getRoutePath } from "@/router";
const route = useRoute()
const company_type_show = ref(true)
const route = useRoute();
const company_type_show = ref(true);
//
//
const showPop = ref(false)
const showConctactPop = ref(false)
const showPop = ref(false);
const showConctactPop = ref(false);
const offPop = () => {
showPop.value = false
showConctactPop.value = false
}
showPop.value = false;
showConctactPop.value = false;
};
// id
const contractId = ref('')
const contractId = ref("");
const showCreateConctPop = (row) => {
;(showPop.value = true), (showConctactPop.value = true), (contractId.value = row.id)
}
(showPop.value = true),
(showConctactPop.value = true),
(contractId.value = row.id);
};
const creContct = () => {
generateGontract({ id: contractId.value })
offPop()
}
generateGontract({ id: contractId.value });
offPop();
};
const sendMsg = () => {
sendMsgApi({ id: contractId.value })
offPop()
}
sendMsgApi({ id: contractId.value });
offPop();
};
//
//
const queryParams = reactive({
company_name: '',
area: '',
street: '',
company_type: '',
area_manager: '',
company_name: "",
area: "",
street: "",
company_type: "",
area_manager: "",
//
is_contract: '',
company_id: ''
})
is_contract: "",
company_id: "",
});
if (route.query.company_type) {
company_type_show.value = false
queryParams['company_type'] = route.query.company_type?.toString() || ''
company_type_show.value = false;
queryParams["company_type"] = route.query.company_type?.toString() || "";
}
if (route.query.company_id) {
queryParams.company_id = route.query.company_id?.toString() || ''
queryParams.company_id = route.query.company_id?.toString() || "";
}
const datas = reactive({
dictTypeLists: []
})
dictTypeLists: [],
});
const getdictTypeLists = async () => {
const data = await dictDataLists({ type_id: 6 })
datas['dictTypeLists'] = data['lists']
}
getdictTypeLists()
const data = await dictDataLists({ type_id: 6 });
datas["dictTypeLists"] = data["lists"];
};
getdictTypeLists();
//
const selectData = ref<any[]>([])
const selectData = ref<any[]>([]);
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
selectData.value = val.map(({ id }) => id);
};
//
const { dictData } = useDictData('')
const { dictData } = useDictData("");
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiSubordinateList,
params: queryParams
})
params: queryParams,
});
//
const handleDelete = async (id: number | any[]) => {
await feedback.confirm('确定要删除?')
await apiCompanyDelete({ id })
getLists()
}
await feedback.confirm("确定要删除?");
await apiCompanyDelete({ id });
getLists();
};
getLists()
getLists();
</script>
<style lang="scss">
.btn {

View File

@ -1,7 +1,12 @@
<template>
<div>
<el-card class="!border-none" shadow="never">
<el-form ref="formRef" class="mb-[-16px]" :model="queryParams" :inline="true">
<el-form
ref="formRef"
class="mb-[-16px]"
:model="queryParams"
:inline="true"
>
<el-form-item label="用户信息">
<el-input
class="w-[280px]"
@ -25,6 +30,7 @@
</el-card>
<el-card class="!border-none mt-4" shadow="never">
<el-table size="large" v-loading="pager.loading" :data="pager.lists">
<el-table-column label="ID" prop="id" min-width="100" />
<el-table-column label="用户编号" prop="sn" min-width="120" />
<el-table-column label="头像" min-width="100">
<template #default="{ row }">
@ -33,7 +39,7 @@
</el-table-column>
<el-table-column label="账号" prop="account" min-width="120" />
<el-table-column label="姓名" prop="nickname" min-width="100" />
<el-table-column label="联系方式" prop="mobile" min-width="100" />
<el-table-column label="联系方式" prop="mobile" min-width="120" />
<el-table-column
label="隶属公司"
prop="company_name"
@ -41,33 +47,47 @@
align="center"
>
<template #default="{ row }">
{{ row.company?.company_name || '/' }}
{{ row.company?.company_name || "/" }}
</template>
</el-table-column>
<el-table-column label="所在乡镇" prop="street_name" min-width="120" />
<el-table-column label="授权身份" prop="role_name" min-width="120">
<template #default="{ row }">
<span v-if="row.admin_id == row.company?.admin_id" style="color: #67c23a"
<span
v-if="row.admin_id == row.company?.admin_id"
style="color: #67c23a"
>公司后台管理人员</span
>
<span v-else style="color: #fe0000"></span>
</template>
</el-table-column>
<el-table-column label="是否签约" prop="is_contract" align="center" min-width="120">
<el-table-column
label="是否签约"
prop="is_contract"
align="center"
min-width="120"
>
<template #default="{ row }">
<span v-if="row.is_contract == 1" style="color: #67c23a">已签约</span>
<span v-if="row.is_contract == 1" style="color: #67c23a"
>已签约</span
>
<span v-else style="color: #fe0000">未签约</span>
</template>
</el-table-column>
<el-table-column label="操作" width="400" align="center" fixed="right">
<el-table-column
label="操作"
min-width="300"
align="center"
fixed="right"
>
<template #default="{ row }">
<el-button v-perms="['user.user/detail']" type="primary" link>
<router-link
:to="{
path: getRoutePath('user.user/detail'),
query: {
id: row.id
}
id: row.id,
},
}"
>
详情
@ -85,8 +105,8 @@
path: getRoutePath('user.user/detail'),
query: {
id: row.id,
mode: 'initiate'
}
mode: 'initiate',
},
}"
>
发起合同
@ -105,8 +125,8 @@
query: {
id: row.id,
mode: 'uplode',
mdoeid: row.contract.id
}
mdoeid: row.contract.id,
},
}"
>
上传合同
@ -118,7 +138,7 @@
v-if="row.contract?.check_status == 2"
link
@click="
;(showPop = true),
(showPop = true),
(showConctactPop = true),
(contractId = row.id)
"
@ -129,7 +149,7 @@
v-perms="['user.user/launch']"
type="primary"
link
@click=";(showPop = true), (contractId = row.id)"
@click="(showPop = true), (contractId = row.id)"
>重新短信</el-button
>
</template>
@ -146,10 +166,16 @@
确认签约短信将在60秒后发送,请注意查收,并点击短信链接进行线上合同签约
</div>
<p class="btn_menu">
<el-button type="primary" size="large" v-if="showConctactPop" @click="creContct"
<el-button
type="primary"
size="large"
v-if="showConctactPop"
@click="creContct"
>确认创建</el-button
>
<el-button type="primary" size="large" v-else @click="sendMsg">确认</el-button>
<el-button type="primary" size="large" v-else @click="sendMsg"
>确认</el-button
>
<el-button type="info" size="large" @click="offPop">返回</el-button>
</p>
</el-dialog>
@ -160,44 +186,44 @@
</div>
</template>
<script lang="ts" setup name="consumerLists">
import { usePaging } from '@/hooks/usePaging'
import { getRoutePath } from '@/router'
import { getUserList, creatContact, sendMsgApi } from '@/api/consumer'
import { ClientMap } from '@/enums/appEnums'
import feedback from '@/utils/feedback'
const route = useRoute()
import { usePaging } from "@/hooks/usePaging";
import { getRoutePath } from "@/router";
import { getUserList, creatContact, sendMsgApi } from "@/api/consumer";
import { ClientMap } from "@/enums/appEnums";
import feedback from "@/utils/feedback";
const route = useRoute();
const queryParams = reactive({
keyword: '',
channel: '',
create_time_start: '',
create_time_end: '',
company_id: ''
})
keyword: "",
channel: "",
create_time_start: "",
create_time_end: "",
company_id: "",
});
if (route.query.company_id) {
queryParams.company_id = route.query.company_id
queryParams.company_id = route.query.company_id;
}
const contractId = ref(0)
const showPop = ref(false)
const showConctactPop = ref(false)
const contractId = ref(0);
const showPop = ref(false);
const showConctactPop = ref(false);
const offPop = () => {
showPop.value = false
showConctactPop.value = false
}
showPop.value = false;
showConctactPop.value = false;
};
const creContct = () => {
console.log(contractId.value)
console.log(contractId.value);
// feedback.msgSuccess("");
creatContact({ id: contractId.value }).then(() => {
feedback.msgSuccess('发送成功')
})
offPop()
}
feedback.msgSuccess("发送成功");
});
offPop();
};
const sendMsg = () => {
sendMsgApi({ id: contractId.value }).then((res) => {
feedback.msgSuccess('发送成功')
})
offPop()
}
feedback.msgSuccess("发送成功");
});
offPop();
};
// const handleDelete = async (id: number) => {
// await feedback.confirm('')
// await adminDelete({ id })
@ -210,13 +236,13 @@ const sendMsg = () => {
// }
const { pager, getLists, resetPage, resetParams } = usePaging({
fetchFun: getUserList,
params: queryParams
})
params: queryParams,
});
onActivated(() => {
getLists()
})
getLists();
});
getLists()
getLists();
</script>
<style scoped>
h1 {

View File

@ -465,7 +465,7 @@ async function render() {
});
compeny.value = res.party_a_info;
basicdata.value = res;
if (basicdata.value.status == 1) {
if (basicdata.value.status == 1 || res.check_status == 3 || res.status == 1) {
isshow.value = false;
}
try {