代码更新
This commit is contained in:
parent
ccc0c587bd
commit
3beaa04908
|
@ -0,0 +1,48 @@
|
|||
import request from '@/utils/request'
|
||||
//审批类型列表
|
||||
export function apiCateLists(params: any) {
|
||||
return request.get({ url: '/dict.dict/lists', params })
|
||||
}
|
||||
//审批流程列表
|
||||
export function apiFlowLists(params: any) {
|
||||
return request.get({ url: '/task.scheduling/approve', params })
|
||||
}
|
||||
|
||||
//创建审批类型
|
||||
export function apiCateCreat(params: any) {
|
||||
return request.post({ url: '/cate/create', params })
|
||||
}
|
||||
// 创建流程
|
||||
export function apiFlowCreat(params: any) {
|
||||
return request.post({ url: '/flow/create', params })
|
||||
}
|
||||
|
||||
// 启用审批类型
|
||||
export function apiCateStatus(params: any) {
|
||||
return request.get({ url: '/cate/status', params })
|
||||
}
|
||||
// 启用审批流程
|
||||
export function apiFlowStatus(params: any) {
|
||||
return request.get({ url: '/flow/status', params })
|
||||
}
|
||||
// 审批流程详情
|
||||
export function apiFlowDetil(params: any) {
|
||||
return request.get({ url: '/flow/view', params })
|
||||
}
|
||||
|
||||
// 任务
|
||||
|
||||
// 任务审批列表(待审批列表)
|
||||
export function apiApproveList(params: any) {
|
||||
return request.get({ url: '/task.scheduling/approve', params })
|
||||
}
|
||||
|
||||
// 任务审批(待审批列表)
|
||||
export function apiApproveAudit(params: any) {
|
||||
return request.post({ url: '/approve.approve/audit', params })
|
||||
}
|
||||
|
||||
// 商户入驻,开通交易审批列表
|
||||
export function apiApproveList2(params: any) {
|
||||
return request.get({ url: '/company.Merchant/merchantApplyLists', params })
|
||||
}
|
|
@ -2,22 +2,27 @@ import request from '@/utils/request'
|
|||
|
||||
// 余额明细
|
||||
export function accountLog(params?: any) {
|
||||
return request.get({ url: '/finance.account_log/lists', params })
|
||||
return request.get({ url: '/finance.account_log/taskLists', params })
|
||||
}
|
||||
|
||||
// 成员信息
|
||||
export function getCompanyUserList(params?: any) {
|
||||
return request.get({ url: '/finance.account_log/getTaskCompanyUserList', params })
|
||||
}
|
||||
|
||||
// 充值记录
|
||||
export function rechargeLists(params?: any) {
|
||||
return request.get({ url: '/recharge.recharge/lists', params }, { ignoreCancelToken: true })
|
||||
return request.get({ url: '/recharge.recharge/taskLists', params }, { ignoreCancelToken: true })
|
||||
}
|
||||
|
||||
// 余额变动类型
|
||||
export function getUmChangeType(params?: any) {
|
||||
return request.get({ url: '/finance.account_log/getUmChangeType', params })
|
||||
return request.get({ url: '/finance.account_log/getTaskUmChangeType', params })
|
||||
}
|
||||
|
||||
//退款
|
||||
export function refund(params?: any) {
|
||||
return request.post({ url: '/recharge.recharge/refund', params })
|
||||
return request.post({ url: '/recharge.recharge/taskRefund', params })
|
||||
}
|
||||
|
||||
//重新退款
|
||||
|
@ -27,15 +32,16 @@ export function refundAgain(params?: any) {
|
|||
|
||||
//退款记录
|
||||
export function refundRecord(params?: any) {
|
||||
return request.get({ url: '/finance.refund/record', params })
|
||||
return request.get({ url: '/finance.refund/taskRecord', params })
|
||||
}
|
||||
|
||||
//退款日志
|
||||
export function refundLog(params?: any) {
|
||||
return request.get({ url: '/finance.refund/log', params })
|
||||
return request.get({ url: '/finance.refund/taskLog', params })
|
||||
}
|
||||
|
||||
//退款统计
|
||||
export function refundStat(params?: any) {
|
||||
return request.get({ url: '/finance.refund/stat', params })
|
||||
return request.get({ url: '/finance.refund/taskStat', params })
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
import request from "@/utils/request";
|
||||
|
||||
// 档案列表
|
||||
|
||||
export function fileManagelist(params: any) {
|
||||
return request.get({ url: "/archives.Archives/lists", params });
|
||||
}
|
||||
|
||||
// 档案详情
|
||||
export function fileManageDetil(params: any) {
|
||||
return request.get({ url: "/archives.Archives/detail", params });
|
||||
}
|
|
@ -27,3 +27,15 @@ export function adminDelete(params: any) {
|
|||
export function adminDetail(params: any) {
|
||||
return request.get({ url: '/auth.admin/detail', params })
|
||||
}
|
||||
// 生成合同
|
||||
export function generateGontract(params: any) {
|
||||
return request.get({ url: '/auth.admin/Draftingcontracts', params })
|
||||
}
|
||||
// 发送短信
|
||||
export function sendMsgApi(params: any) {
|
||||
return request.get({ url: '/auth.admin/postsms', params })
|
||||
}
|
||||
// 废除合同
|
||||
export function abolition(params: any) {
|
||||
return request.get({ url: '/auth.admin/abolition', params })
|
||||
}
|
||||
|
|
|
@ -59,3 +59,8 @@ export function dictDataDelete(params: any) {
|
|||
export function dictDataDetail(params: any) {
|
||||
return request.get({ url: '/setting.dict.dict_data/detail', params })
|
||||
}
|
||||
|
||||
// 审批任务类型
|
||||
export function getTaskApproveTypeList(params: any|undefined) {
|
||||
return request.get({ url: '/dict.dict/getTaskApproveTypeList', params })
|
||||
}
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 商户合同列表
|
||||
export function apiShopContractLists(params: any) {
|
||||
return request.get({ url: '/contract.ShopContract/lists', params })
|
||||
}
|
||||
|
||||
// 添加商户合同
|
||||
export function apiShopContractAdd(params: any) {
|
||||
return request.post({ url: '/shop_contract/add', params })
|
||||
}
|
||||
|
||||
// 编辑商户合同
|
||||
export function apiShopContractEdit(params: any) {
|
||||
return request.post({ url: '/shop_contract/edit', params })
|
||||
}
|
||||
|
||||
// 删除商户合同
|
||||
export function apiShopContractDelete(params: any) {
|
||||
return request.post({ url: '/shop_contract/delete', params })
|
||||
}
|
||||
|
||||
// 商户合同详情
|
||||
export function apiShopContractDetail(params: any) {
|
||||
return request.get({ url: '/contract.ShopContract/detail', params })
|
||||
}
|
||||
|
||||
// 合同上传
|
||||
export function apiShopWindControl(params: any) {
|
||||
return request.post({ url: '/contract.CompanyContract/uploadContract', params })
|
||||
}
|
||||
|
||||
// 发送合同
|
||||
export function apiShopDraftingcontracts(params: any) {
|
||||
return request.post({ url: '/contract.CompanyContract/DraftingContract', params })
|
||||
}
|
||||
|
||||
// 重新发送短信
|
||||
export function apiShopSendMsgApi(params: any) {
|
||||
return request.get({ url: '/contract.ShopContract/sendSms', params })
|
||||
}
|
||||
|
||||
//请求证据包下载地址
|
||||
export function contractEvidence(params: any) {
|
||||
return request.get({ url: "/contract.ShopContract/evidence", params });
|
||||
}
|
||||
|
||||
// 设置备注
|
||||
export function apiShopContractAddNotes(params: any) {
|
||||
return request.post({ url: '/shop_contract/addNote', params })
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 商城商户列表
|
||||
export function apiShopMerchantLists(params: any) {
|
||||
return request.get({ url: '/company.Merchant/merchantRecordLists', params })
|
||||
}
|
||||
|
||||
// 添加商城商户
|
||||
export function apiShopMerchantAdd(params: any) {
|
||||
return request.post({ url: '/shop_merchant/add', params })
|
||||
}
|
||||
|
||||
// 编辑商城商户
|
||||
export function apiShopMerchantEdit(params: any) {
|
||||
return request.post({ url: '/shop_merchant/edit', params })
|
||||
}
|
||||
|
||||
// 删除商城商户
|
||||
export function apiShopMerchantDelete(params: any) {
|
||||
return request.post({ url: '/shop_merchant/delete', params })
|
||||
}
|
||||
|
||||
// 商城商户详情
|
||||
export function apiShopMerchantDetail(params: any) {
|
||||
return request.get({ url: '/shop_merchant/detail', params })
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
import request from "@/utils/request/indexs";
|
||||
|
||||
/**
|
||||
* 绑定scoket
|
||||
*/
|
||||
export const bindScoket = (data: any) =>
|
||||
request.post({ url: "/common/im/doBindUid", data });
|
||||
// 发送消息
|
||||
export const sendMsgApi = (data: any) =>
|
||||
request.post({ url: "/common/im/sendTextMsg", data });
|
||||
// 发送文件
|
||||
export const sendFileApi = (data: any) =>
|
||||
request.post({ url: "/common/im/sendFileMsg", data });
|
||||
// 消息列表
|
||||
export const getMsgListApi = (data: any) =>
|
||||
request.post({ url: "/common/im/msgList", data });
|
||||
// 片区经理id
|
||||
export const getAreaManagerApi = (data: any) =>
|
||||
request.post({ url: "/common/im/getAreaManager", data });
|
||||
// 联系人列表
|
||||
export const getContactListApi = (data: any) =>
|
||||
request.post({ url: "/common/im/contactList", data });
|
|
@ -0,0 +1,27 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
//添加任务
|
||||
export function apiTaskAdd(params: any) {
|
||||
return request.post({ url: '/task_scheduling_plan.task_scheduling_plan/add', params })
|
||||
}
|
||||
|
||||
//修改任务
|
||||
export function apiTaskEdit(params: any) {
|
||||
return request.post({ url: '/task_scheduling_plan.task_scheduling_plan/edit', params })
|
||||
}
|
||||
|
||||
//删除任务
|
||||
export function apiTaskDelete(params: any) {
|
||||
return request.post({ url: '/task_scheduling_plan.task_scheduling_plan/delete', params })
|
||||
}
|
||||
|
||||
|
||||
//任务日程-列表
|
||||
export function apiTaskList(params: any) {
|
||||
return request.get({ url: '/task.scheduling/plan', params })
|
||||
}
|
||||
|
||||
//任务日程-详情
|
||||
export function apiTaskDetails(params: any) {
|
||||
return request.get({ url: '/task_scheduling_plan.task_scheduling_plan/detail', params })
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 任务公司排期列表
|
||||
export function apiTaskSchedulingLists(params: any) {
|
||||
return request.get({ url: '/task.scheduling/lists', params })
|
||||
}
|
||||
|
||||
// 添加任务公司排期
|
||||
export function apiTaskSchedulingAdd(params: any) {
|
||||
return request.post({ url: '/task.scheduling/addTemplate', params })
|
||||
}
|
||||
|
||||
// 编辑任务公司排期
|
||||
export function apiTaskSchedulingEdit(params: any) {
|
||||
return request.post({ url: '/task.scheduling/edit', params })
|
||||
}
|
||||
|
||||
// 删除任务公司排期
|
||||
export function apiTaskSchedulingDelete(params: any) {
|
||||
return request.post({ url: '/task.scheduling/deleteTemplate', params })
|
||||
}
|
||||
|
||||
// 任务公司排期详情
|
||||
export function apiTaskSchedulingDetail(params: any) {
|
||||
return request.get({ url: '/task.scheduling/detail', params })
|
||||
}
|
||||
|
||||
// 任务公司排期详情
|
||||
export function apiTaskSchedulingEditMoney(params: any) {
|
||||
return request.post({ url: '/task.scheduling/editMoney', params })
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 任务日历列表
|
||||
export function apiTaskSchedulingPlanLists(params: any) {
|
||||
return request.get({ url: '/task_scheduling_plan.task_scheduling_plan/lists', params })
|
||||
}
|
||||
|
||||
// 添加任务日历
|
||||
export function apiTaskSchedulingPlanAdd(params: any) {
|
||||
return request.post({ url: '/task_scheduling_plan.task_scheduling_plan/add', params })
|
||||
}
|
||||
|
||||
// 编辑任务日历
|
||||
export function apiTaskSchedulingPlanEdit(params: any) {
|
||||
return request.post({ url: '/task_scheduling_plan.task_scheduling_plan/edit', params })
|
||||
}
|
||||
|
||||
// 删除任务日历
|
||||
export function apiTaskSchedulingPlanDelete(params: any) {
|
||||
return request.post({ url: '/task_scheduling_plan.task_scheduling_plan/delete', params })
|
||||
}
|
||||
|
||||
// 任务日历详情
|
||||
export function apiTaskSchedulingPlanDetail(params: any) {
|
||||
return request.get({ url: '/task_scheduling_plan.task_scheduling_plan/detail', params })
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 任务安排列表
|
||||
export function apiTaskTemplateLists(params: any) {
|
||||
return request.get({ url: '/task.scheduling/template', params })
|
||||
}
|
||||
|
||||
// 添加任务安排
|
||||
export function apiTaskTemplateAdd(params: any) {
|
||||
return request.post({ url: '/task.scheduling/addTemplate', params })
|
||||
}
|
||||
|
||||
// 编辑任务安排
|
||||
export function apiTaskTemplateEdit(params: any) {
|
||||
return request.post({ url: '/task.scheduling/editTemplate', params })
|
||||
}
|
||||
|
||||
// 删除任务安排
|
||||
export function apiTaskTemplateDelete(params: any) {
|
||||
return request.post({ url: '/task.scheduling/deleteTemplate', params })
|
||||
}
|
||||
|
||||
// 任务安排详情
|
||||
export function apiTaskTemplateDetail(params: any) {
|
||||
return request.get({ url: '/task.scheduling/deleteTemplate', params })
|
||||
}
|
||||
|
||||
// 任务类型
|
||||
export function apiTaskTypeList(params: any) {
|
||||
return request.get({ url: '/dict.dict/lists', params })
|
||||
}
|
||||
|
||||
// 指定商品
|
||||
export function apiGetProductList(params: any) {
|
||||
return request.get({ url: '/task_template.task_template/getProductList', params })
|
||||
}
|
|
@ -20,3 +20,8 @@ export function getUserInfo() {
|
|||
export function setUserInfo(params: any) {
|
||||
return request.post({ url: '/auth.admin/editSelf', params })
|
||||
}
|
||||
|
||||
// 编辑管理员信息
|
||||
export function getUserList(params: any) {
|
||||
return request.get({ url: '/user.user/lists', params })
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 系统菜单表列表
|
||||
export function apiUserMenuLists(params: any) {
|
||||
return request.get({ url: '/user.user_menu/lists', params })
|
||||
}
|
||||
|
||||
// 添加系统菜单表
|
||||
export function apiUserMenuAdd(params: any) {
|
||||
return request.post({ url: '/user.user_menu/add', params })
|
||||
}
|
||||
|
||||
// 编辑系统菜单表
|
||||
export function apiUserMenuEdit(params: any) {
|
||||
return request.post({ url: '/user.user_menu/edit', params })
|
||||
}
|
||||
|
||||
// 删除系统菜单表
|
||||
export function apiUserMenuDelete(params: any) {
|
||||
return request.post({ url: '/user.user_menu/delete', params })
|
||||
}
|
||||
|
||||
// 系统菜单表详情
|
||||
export function apiUserMenuDetail(params: any) {
|
||||
return request.get({ url: '/user.user_menu/detail', params })
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 角色表列表
|
||||
export function apiUserRoleLists(params: any) {
|
||||
return request.get({ url: '/user.user_role/lists', params })
|
||||
}
|
||||
|
||||
// 添加角色表
|
||||
export function apiUserRoleAdd(params: any) {
|
||||
return request.post({ url: '/user.user_role/add', params })
|
||||
}
|
||||
|
||||
// 编辑角色表
|
||||
export function apiUserRoleEdit(params: any) {
|
||||
return request.post({ url: '/user.user_role/edit', params })
|
||||
}
|
||||
|
||||
// 删除角色表
|
||||
export function apiUserRoleDelete(params: any) {
|
||||
return request.post({ url: '/user.user_role/delete', params })
|
||||
}
|
||||
|
||||
// 角色表详情
|
||||
export function apiUserRoleDetail(params: any) {
|
||||
return request.get({ url: '/user.user_role/detail', params })
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 提现申请列表
|
||||
export function apiWithdrawLists(params: any) {
|
||||
return request.get({ url: '/finance.withdraw/index', params })
|
||||
}
|
||||
|
||||
// 添加提现申请
|
||||
export function apiWithdrawAdd(params: any) {
|
||||
return request.post({ url: '/finance.withdraw/add', params })
|
||||
}
|
||||
|
||||
// 编辑提现申请
|
||||
export function apiWithdrawEdit(params: any) {
|
||||
return request.post({ url: '/finance.withdraw/edit', params })
|
||||
}
|
||||
|
||||
// 删除提现申请
|
||||
export function apiWithdrawDelete(params: any) {
|
||||
return request.post({ url: '/finance.withdraw/delete', params })
|
||||
}
|
||||
|
||||
// 提现申请详情
|
||||
export function apiWithdrawDetail(params: any) {
|
||||
return request.get({ url: '/finance.withdraw/detail', params })
|
||||
}
|
||||
|
||||
//提现审核
|
||||
export function withdrawAudit(params?: any) {
|
||||
return request.post({ url: '/finance.withdraw/audit', params })
|
||||
}
|
|
@ -0,0 +1,93 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="公司名称" prop="company_name">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.company_name"
|
||||
clearable
|
||||
placeholder="请输入公司名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="公司类型" prop="company_type">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.company_type"
|
||||
clearable
|
||||
placeholder="请输入公司类型"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @cell-click="handleCurrentChange">
|
||||
<el-table-column label="签约公司" property="company_name" />
|
||||
<el-table-column label="公司类型" property="company_type" />
|
||||
<el-table-column label="区县" property="area" />
|
||||
<el-table-column label="乡镇" property="street" />
|
||||
<el-table-column label="主联系人" property="master_name" />
|
||||
<el-table-column label="联系方式" property="master_phone" />
|
||||
<el-table-column label="片区经理" property="area_manager" />
|
||||
<el-table-column label="是否签约" property="is_contract" />
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="companyLists">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiCompanyLists, apiCompanyDelete } from '@/api/company'
|
||||
import { defineEmits } from 'vue'
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
level_two: '',
|
||||
level_one: '',
|
||||
company_name: '',
|
||||
organization_code: '',
|
||||
city: '',
|
||||
area: '',
|
||||
street: '',
|
||||
company_type: '',
|
||||
master_name: '',
|
||||
master_position: '',
|
||||
master_phone: '',
|
||||
master_email: '',
|
||||
other_contacts: '',
|
||||
area_manager: '',
|
||||
is_contract: '',
|
||||
account: '',
|
||||
password: '',
|
||||
deposit: '',
|
||||
deposit_time: '',
|
||||
qualification: '',
|
||||
status: ''
|
||||
})
|
||||
|
||||
// 选中数据
|
||||
const emits = defineEmits(['customEvent'])
|
||||
|
||||
// 选中数据子父传递
|
||||
const handleCurrentChange = (value: any) => {
|
||||
emits('customEvent', value)
|
||||
}
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiCompanyLists,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
getLists()
|
||||
</script>
|
|
@ -0,0 +1,159 @@
|
|||
<template>
|
||||
<div id="container" ref="map"></div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="mapContainer">
|
||||
import AMapLoader from "@amap/amap-jsapi-loader";
|
||||
import { shallowRef } from "@vue/reactivity";
|
||||
|
||||
const map = shallowRef(null);
|
||||
let AMap: any = null;
|
||||
let markerList: Array<any> = [];
|
||||
let m_index: Number = 0;
|
||||
let geocoder: any = null;
|
||||
let marker: any = null;
|
||||
|
||||
const emits = defineEmits(["changeMaps"]);
|
||||
|
||||
const resetMap = () => {
|
||||
try {
|
||||
markerList = [];
|
||||
map.value?.clearMap();
|
||||
m_index = 0;
|
||||
emits("changeMaps", markerList);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
};
|
||||
|
||||
const initMap = async () => {
|
||||
const loader = AMapLoader.load({
|
||||
key: "4f8f55618010007147aab96fc72bb408",
|
||||
version: "2.0",
|
||||
});
|
||||
|
||||
AMap = await loader;
|
||||
|
||||
map.value = new AMap.Map("container", {
|
||||
zoom: 13,
|
||||
viewMode: "2D",
|
||||
center: [105.4423, 28.8717],
|
||||
});
|
||||
|
||||
AMap.plugin("AMap.Geocoder", function () {
|
||||
geocoder = new AMap.Geocoder({
|
||||
radius: 10, // 逆地理编码范围,默认值:1000,单位:米
|
||||
extensions: "all", // 返回地址描述结果时是否包含引擎内置的POI,默认值:base,可选值:base、all
|
||||
}); // 经纬度数组
|
||||
});
|
||||
|
||||
AMap.plugin("AMap.Geolocation", function () {
|
||||
let geolocation = new AMap.Geolocation({
|
||||
enableHighAccuracy: true, // 是否使用高精度定位,默认:true
|
||||
timeout: 10000, // 超过1秒后停止定位,默认:无穷大
|
||||
buttonPosition: "RB", // 定位按钮的停靠位置
|
||||
zoomToAccuracy: true, // 定位成功后是否自动调整地图视野到定位点
|
||||
});
|
||||
|
||||
map.value.addControl(geolocation);
|
||||
|
||||
// geolocation.getCurrentPosition(function (status, result) {
|
||||
// console.log(status, result);
|
||||
// });
|
||||
});
|
||||
|
||||
map.value.setFitView();
|
||||
|
||||
map.value.on("click", (e: any) => {
|
||||
// if (m_index >= 1) return;
|
||||
if (m_index >= 1) {
|
||||
map.value?.remove(marker);
|
||||
m_index = 0;
|
||||
}
|
||||
// 调用函数并传入经纬度
|
||||
getDistrictName(e.lnglat.lng, e.lnglat.lat, e);
|
||||
|
||||
// 创建标记并添加到地图
|
||||
marker = new AMap.Marker({
|
||||
position: e.lnglat,
|
||||
offset: new AMap.Pixel(0, 0),
|
||||
title: "位置",
|
||||
});
|
||||
map.value.add(marker);
|
||||
m_index++;
|
||||
|
||||
// 添加标记点击事件监听器
|
||||
marker.on("click", (event: any) => {
|
||||
// markerList = markerList.filter((item: any) => {
|
||||
// item[0] == marker._position.pos[0] &&
|
||||
// item[0] == marker._position.pos[0];
|
||||
// });
|
||||
markerList = [];
|
||||
emits("changeMaps", markerList);
|
||||
map.value.remove(marker);
|
||||
m_index--;
|
||||
marker = null;
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const searchMap = (address: any) => {
|
||||
// ElMessage.error("搜索功能开发中");
|
||||
AMap.plugin("AMap.PlaceSearch", async function () {
|
||||
try {
|
||||
const placeSearch = new AMap.PlaceSearch({
|
||||
pageSize: 5, // 单页显示结果条数
|
||||
pageIndex: 1, // 页码
|
||||
city: "510500", // 兴趣点城市
|
||||
citylimit: true, //是否强制限制在设置的城市内搜索
|
||||
map: map.value, // 展现结果的地图实例
|
||||
panel: false, // 结果列表将在此容器中进行展示。
|
||||
autoFitView: true, // 是否自动调整地图视野使绘制的 Marker点都处于视口的可见范围
|
||||
});
|
||||
AMap.Event.addListener(placeSearch, "markerClick", (e: any) => {
|
||||
marker ? map.value?.remove(marker) : null;
|
||||
getDistrictName(e.event.lnglat.lng, e.event.lnglat.lat, e.event);
|
||||
});
|
||||
placeSearch.search(address);
|
||||
} catch (error) {
|
||||
ElMessage.error("没找到");
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 获取地区名称
|
||||
const getDistrictName = (lng: any, lat: any, e: any) => {
|
||||
geocoder.getAddress([lng, lat], function (status: any, result: any) {
|
||||
if (status === "complete" && result.info === "OK") {
|
||||
markerList = [];
|
||||
markerList.push({
|
||||
lnglat: e.lnglat,
|
||||
address: result.regeocode.formattedAddress,
|
||||
});
|
||||
emits("changeMaps", markerList);
|
||||
} else {
|
||||
// 解析失败
|
||||
ElMessage.error("逆地理编码失败");
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
defineExpose({
|
||||
resetMap,
|
||||
searchMap,
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
initMap();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<style lang="scss" scoped>
|
||||
#container {
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
width: 400px;
|
||||
height: 400px;
|
||||
}
|
||||
</style>
|
|
@ -4,31 +4,19 @@
|
|||
<!-- 触发弹窗 -->
|
||||
<slot name="trigger"></slot>
|
||||
</div>
|
||||
<el-dialog
|
||||
v-model="visible"
|
||||
:custom-class="customClass"
|
||||
:center="center"
|
||||
:append-to-body="true"
|
||||
:width="width"
|
||||
:close-on-click-modal="clickModalClose"
|
||||
@closed="close"
|
||||
>
|
||||
<el-dialog v-model="visible" :custom-class="customClass" :center="center" :append-to-body="true" :width="width" :close-on-click-modal="clickModalClose" @closed="close">
|
||||
<!-- 弹窗内容 -->
|
||||
<template v-if="title" #header>{{ title }}</template>
|
||||
|
||||
<!-- 自定义内容 -->
|
||||
<slot>{{ content }}</slot>
|
||||
<!-- 底部弹窗页脚 -->
|
||||
<template #footer>
|
||||
<template v-if="button" #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button v-if="cancelButtonText" @click="handleEvent('cancel')">
|
||||
{{ cancelButtonText }}
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="confirmButtonText"
|
||||
type="primary"
|
||||
@click="handleEvent('confirm')"
|
||||
>
|
||||
<el-button v-if="confirmButtonText" type="primary" @click="handleEvent('confirm')">
|
||||
{{ confirmButtonText }}
|
||||
</el-button>
|
||||
</div>
|
||||
|
@ -43,86 +31,91 @@ export default defineComponent({
|
|||
title: {
|
||||
// 弹窗标题
|
||||
type: String,
|
||||
default: ''
|
||||
default: "",
|
||||
},
|
||||
button: {
|
||||
// 是否显示按钮
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
content: {
|
||||
// 弹窗内容
|
||||
type: String,
|
||||
default: ''
|
||||
default: "",
|
||||
},
|
||||
confirmButtonText: {
|
||||
// 确认按钮内容
|
||||
type: [String, Boolean],
|
||||
default: '确定'
|
||||
default: "确定",
|
||||
},
|
||||
cancelButtonText: {
|
||||
// 取消按钮内容
|
||||
type: [String, Boolean],
|
||||
default: '取消'
|
||||
default: "取消",
|
||||
},
|
||||
width: {
|
||||
// 弹窗的宽度
|
||||
type: String,
|
||||
default: '400px'
|
||||
default: "400px",
|
||||
},
|
||||
disabled: {
|
||||
// 是否禁用
|
||||
type: Boolean,
|
||||
default: false
|
||||
default: false,
|
||||
},
|
||||
async: {
|
||||
// 是否开启异步关闭
|
||||
type: Boolean,
|
||||
default: false
|
||||
default: false,
|
||||
},
|
||||
clickModalClose: {
|
||||
// 点击遮罩层关闭对话窗口
|
||||
type: Boolean,
|
||||
default: false
|
||||
default: false,
|
||||
},
|
||||
center: {
|
||||
// 是否居中布局
|
||||
type: Boolean,
|
||||
default: false
|
||||
default: false,
|
||||
},
|
||||
customClass: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
default: "",
|
||||
},
|
||||
emits: ['confirm', 'cancel', 'close', 'open'],
|
||||
},
|
||||
emits: ["confirm", "cancel", "close", "open"],
|
||||
setup(props, { emit }) {
|
||||
const visible = ref(false)
|
||||
const visible = ref(false);
|
||||
|
||||
const handleEvent = (type: 'confirm' | 'cancel') => {
|
||||
emit(type)
|
||||
if (!props.async || type === 'cancel') {
|
||||
close()
|
||||
}
|
||||
const handleEvent = (type: "confirm" | "cancel") => {
|
||||
emit(type);
|
||||
if (!props.async || type === "cancel") {
|
||||
close();
|
||||
}
|
||||
};
|
||||
|
||||
const close = () => {
|
||||
visible.value = false
|
||||
visible.value = false;
|
||||
nextTick(() => {
|
||||
emit('close')
|
||||
})
|
||||
}
|
||||
emit("close");
|
||||
});
|
||||
};
|
||||
const open = () => {
|
||||
if (props.disabled) {
|
||||
return
|
||||
return;
|
||||
}
|
||||
emit('open')
|
||||
visible.value = true
|
||||
}
|
||||
provide('visible', visible)
|
||||
emit("open");
|
||||
visible.value = true;
|
||||
};
|
||||
provide("visible", visible);
|
||||
return {
|
||||
visible,
|
||||
handleEvent,
|
||||
close,
|
||||
open
|
||||
}
|
||||
}
|
||||
})
|
||||
open,
|
||||
};
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
|
|
@ -7,7 +7,8 @@ const config = {
|
|||
}/`, //请求接口域名
|
||||
urlPrefix: "adminapi", //请求默认前缀
|
||||
timeout: 10 * 1000, //请求超时时长
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
export default config;
|
||||
// const config = {
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
|
||||
// 合同类型
|
||||
export const dictContractTypeList: Array<String|Number> = [23,24,25,29]
|
|
@ -0,0 +1,221 @@
|
|||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup
|
||||
ref="popupRef"
|
||||
:title="popupTitle"
|
||||
:async="true"
|
||||
width="550px"
|
||||
@confirm="handleSubmit"
|
||||
@close="handleClose"
|
||||
>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
label-width="120px"
|
||||
:rules="formRules"
|
||||
>
|
||||
<el-form-item label="标题" prop="title">
|
||||
<el-input
|
||||
v-model="formData.title"
|
||||
clearable
|
||||
placeholder="请输入标题"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="内容" prop="content">
|
||||
<el-input
|
||||
v-model="formData.content"
|
||||
clearable
|
||||
placeholder="请输入内容"
|
||||
type="textarea"
|
||||
autosize
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="APP类型" prop="type">
|
||||
<el-radio-group v-model="formData.type" placeholder="请选择APP类型">
|
||||
<el-radio
|
||||
v-for="(item, index) in dictData.app_type"
|
||||
:key="index"
|
||||
:label="parseInt(item.value)"
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="版本" prop="version">
|
||||
<el-input
|
||||
v-model="formData.version"
|
||||
clearable
|
||||
placeholder="请输入版本,例如1.0.1"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新包文件" prop="dow_url">
|
||||
<el-upload
|
||||
class="upload-demo"
|
||||
style="width: 100%"
|
||||
drag
|
||||
accept=".apk, .ipa, .wgt"
|
||||
:headers="{ Token: userStore.token }"
|
||||
:action="base_url + '/upload/taskFile'"
|
||||
:limit="1"
|
||||
:on-success="handleFile"
|
||||
:on-exceed="handleExceed"
|
||||
:before-upload="handleBeforeUpload"
|
||||
ref="upload"
|
||||
>
|
||||
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
||||
<div class="el-upload__text">文件拖入或点击上传</div>
|
||||
<template #tip>
|
||||
<div class="el-upload__tip">请上传APK/IPA/WGT文件</div>
|
||||
</template>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否强制更新" prop="force">
|
||||
<el-radio-group
|
||||
v-model="formData.force"
|
||||
placeholder="请选择是否强制更新"
|
||||
>
|
||||
<el-radio
|
||||
v-for="(item, index) in dictData.app_force_quiet"
|
||||
:key="index"
|
||||
:label="parseInt(item.value)"
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否静默更新" prop="quiet">
|
||||
<el-radio-group
|
||||
v-model="formData.quiet"
|
||||
placeholder="请选择是否静默更新"
|
||||
>
|
||||
<el-radio
|
||||
v-for="(item, index) in dictData.app_force_quiet"
|
||||
:key="index"
|
||||
:label="parseInt(item.value)"
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="appUpdateEdit">
|
||||
import type { FormInstance } from "element-plus";
|
||||
import { genFileId } from "element-plus";
|
||||
import Popup from "@/components/popup/index.vue";
|
||||
import {
|
||||
apiAppUpdateAdd,
|
||||
apiAppUpdateEdit,
|
||||
apiAppUpdateDetail,
|
||||
} from "@/api/app_update";
|
||||
import { timeFormat } from "@/utils/util";
|
||||
import type { PropType } from "vue";
|
||||
import { inject } from "vue";
|
||||
const base_url: any = inject("base_url");
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({}),
|
||||
},
|
||||
});
|
||||
const emit = defineEmits(["success", "close"]);
|
||||
const formRef = shallowRef<FormInstance>();
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>();
|
||||
const mode = ref("add");
|
||||
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
const userStore = useUserStore();
|
||||
|
||||
const handleFile = (e: any) => {
|
||||
formData.dow_url = e.data.uri;
|
||||
};
|
||||
|
||||
const upload = ref(null);
|
||||
const handleExceed = (files: any) => {
|
||||
upload.value!.clearFiles();
|
||||
const file = files[0] as UploadRawFile;
|
||||
file.uid = genFileId();
|
||||
upload.value!.handleStart(file);
|
||||
upload.value!.submit();
|
||||
};
|
||||
|
||||
const appTypeList = [".apk", ".ipa", ".wgt"];
|
||||
const handleBeforeUpload = (e: any) => {
|
||||
let a = appTypeList.find((item: any) => {
|
||||
return item == e?.name?.substring(e.name.length - 4, e.name.length);
|
||||
});
|
||||
if (a) return true;
|
||||
else {
|
||||
ElMessage.error("仅支持上传APK/IPA/WGT文件");
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == "edit" ? "编辑app更新" : "新增app更新";
|
||||
});
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: "",
|
||||
title: "",
|
||||
content: "",
|
||||
type: "",
|
||||
version: "",
|
||||
dow_url: "",
|
||||
force: "",
|
||||
quiet: "",
|
||||
});
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({});
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiAppUpdateDetail({
|
||||
id: row.id,
|
||||
});
|
||||
setFormData(data);
|
||||
};
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate();
|
||||
const data = { ...formData };
|
||||
mode.value == "edit"
|
||||
? await apiAppUpdateEdit(data)
|
||||
: await apiAppUpdateAdd(data);
|
||||
popupRef.value?.close();
|
||||
emit("success");
|
||||
};
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = "add") => {
|
||||
mode.value = type;
|
||||
popupRef.value?.open();
|
||||
};
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit("close");
|
||||
};
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail,
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,236 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="标题" prop="title">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.title"
|
||||
clearable
|
||||
placeholder="请输入标题"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="内容" prop="content">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.content"
|
||||
clearable
|
||||
placeholder="请输入内容"
|
||||
type="textarea"
|
||||
autosize
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="APP类型" prop="type">
|
||||
<el-select
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.type"
|
||||
clearable
|
||||
placeholder="请选择APP类型"
|
||||
>
|
||||
<el-option label="全部" value=""></el-option>
|
||||
<el-option
|
||||
v-for="(item, index) in dictData.app_type"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="版本" prop="version">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.version"
|
||||
clearable
|
||||
placeholder="请输入版本"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否强制更新" prop="force">
|
||||
<el-select
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.force"
|
||||
clearable
|
||||
placeholder="请选择是否强制更新"
|
||||
>
|
||||
<el-option label="全部" value=""></el-option>
|
||||
<el-option
|
||||
v-for="(item, index) in dictData.app_force_quiet"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否静默更新" prop="quiet">
|
||||
<el-select
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.quiet"
|
||||
clearable
|
||||
placeholder="请选择是否静默更新"
|
||||
>
|
||||
<el-option label="全部" value=""></el-option>
|
||||
<el-option
|
||||
v-for="(item, index) in dictData.app_force_quiet"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<el-button v-perms="['app_update/add']" type="primary" @click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['app_update/delete']"
|
||||
:disabled="!selectData.length"
|
||||
@click="handleDelete(selectData)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="标题" prop="title" show-overflow-tooltip />
|
||||
<el-table-column label="内容" prop="content" show-overflow-tooltip />
|
||||
<el-table-column label="APP类型" prop="type">
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.app_type" :value="row.type" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="版本" prop="version" show-overflow-tooltip />
|
||||
<el-table-column
|
||||
label="app链接"
|
||||
prop="dow_url"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column label="是否强制更新" prop="force">
|
||||
<template #default="{ row }">
|
||||
<dict-value
|
||||
:options="dictData.app_force_quiet"
|
||||
:value="row.force"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否静默更新" prop="quiet">
|
||||
<template #default="{ row }">
|
||||
<dict-value
|
||||
:options="dictData.app_force_quiet"
|
||||
:value="row.quiet"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="更新时间"
|
||||
prop="update_time"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
v-perms="['app_update/edit']"
|
||||
type="primary"
|
||||
link
|
||||
@click="handleEdit(row)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['app_update/delete']"
|
||||
type="danger"
|
||||
link
|
||||
@click="handleDelete(row.id)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<edit-popup
|
||||
v-if="showEdit"
|
||||
ref="editRef"
|
||||
:dict-data="dictData"
|
||||
@success="getLists"
|
||||
@close="showEdit = false"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="appUpdateLists">
|
||||
import { usePaging } from "@/hooks/usePaging";
|
||||
import { useDictData } from "@/hooks/useDictOptions";
|
||||
import { apiAppUpdateLists, apiAppUpdateDelete } from "@/api/app_update";
|
||||
import { timeFormat } from "@/utils/util";
|
||||
import feedback from "@/utils/feedback";
|
||||
import EditPopup from "./edit.vue";
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>();
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false);
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
title: "",
|
||||
content: "",
|
||||
type: "",
|
||||
version: "",
|
||||
dow_url: "",
|
||||
force: "",
|
||||
quiet: "",
|
||||
});
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([]);
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id);
|
||||
};
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData("app_type,app_force_quiet");
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiAppUpdateLists,
|
||||
params: queryParams,
|
||||
});
|
||||
|
||||
// 添加
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true;
|
||||
await nextTick();
|
||||
editRef.value?.open("add");
|
||||
};
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (data: any) => {
|
||||
showEdit.value = true;
|
||||
await nextTick();
|
||||
editRef.value?.open("edit");
|
||||
editRef.value?.setFormData(data);
|
||||
};
|
||||
|
||||
// 删除
|
||||
const handleDelete = async (id: number | any[]) => {
|
||||
await feedback.confirm("确定要删除?");
|
||||
await apiAppUpdateDelete({ id });
|
||||
getLists();
|
||||
};
|
||||
|
||||
getLists();
|
||||
</script>
|
||||
|
|
@ -0,0 +1,176 @@
|
|||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup
|
||||
ref="popupRef"
|
||||
:title="popupTitle"
|
||||
:async="true"
|
||||
width="550px"
|
||||
@confirm="handleSubmit"
|
||||
@close="handleClose"
|
||||
|
||||
>
|
||||
<el-form ref="formRef" :model="formData" label-width="90px" :disabled="mode=='check'" :rules="formRules">
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model="formData.name" clearable placeholder="请输入名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="顶级分类" prop="pid">
|
||||
<el-select
|
||||
class="flex-1"
|
||||
v-model="formData.pid"
|
||||
clearable
|
||||
placeholder="请选择上级分类"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in List.value"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="parseInt(item.id)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input v-model="formData.sort" clearable placeholder="请输入排序" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="formData.status" placeholder="请选择状态">
|
||||
<el-radio
|
||||
v-for="(item, index) in dictData.show_status"
|
||||
:key="index"
|
||||
:label="parseInt(item.value)"
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="categoryBusinessEdit">
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import {
|
||||
apiCategoryBusinessAdd,
|
||||
apiCategoryBusinessEdit,
|
||||
apiCategoryBusinessDetail,
|
||||
apiCategoryBusinessLists
|
||||
} from '@/api/category_business'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import { computed, reactive, ref, shallowRef, type PropType } from 'vue'
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑商机分类表' : '新增商机分类表'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
name: '',
|
||||
pid: '',
|
||||
sort: '99',
|
||||
status: ''
|
||||
})
|
||||
const List = reactive([])
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
name: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入名称',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
pid: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择上级id',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
sort: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入排序',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
status: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择状态(0停用 1正常)',
|
||||
trigger: ['blur']
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiCategoryBusinessDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
const getList = async () => {
|
||||
const data = await apiCategoryBusinessLists({
|
||||
page: 1,
|
||||
limit: 1000,
|
||||
pid: 0
|
||||
})
|
||||
List.value = [
|
||||
{
|
||||
id: 0,
|
||||
name: '顶级分类'
|
||||
},
|
||||
...data.lists
|
||||
]
|
||||
console.log(List)
|
||||
}
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData }
|
||||
mode.value == 'edit' ? await apiCategoryBusinessEdit(data) : await apiCategoryBusinessAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
getList()
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
|
@ -0,0 +1,200 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.name"
|
||||
clearable
|
||||
placeholder="请输入名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.sort"
|
||||
clearable
|
||||
placeholder="请输入排序"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.status"
|
||||
clearable
|
||||
placeholder="请选择状态"
|
||||
>
|
||||
<el-option label="全部" value=""></el-option>
|
||||
<el-option
|
||||
v-for="(item, index) in dictData.show_status"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<el-button
|
||||
v-perms="['category_business.category_business/add']"
|
||||
type="primary"
|
||||
@click="handleAdd"
|
||||
>
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['category_business.category_business/delete']"
|
||||
:disabled="!selectData.length"
|
||||
@click="handleDelete(selectData)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
<div class="mt-4">
|
||||
<el-table
|
||||
:data="pager.lists"
|
||||
@selection-change="handleSelectionChange"
|
||||
row-key="id"
|
||||
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
||||
>
|
||||
<el-table-column label="id" prop="id" show-overflow-tooltip />
|
||||
<el-table-column label="名称" prop="name" show-overflow-tooltip />
|
||||
<el-table-column label="上级id" prop="pid" show-overflow-tooltip />
|
||||
<el-table-column label="排序" prop="sort" show-overflow-tooltip />
|
||||
<el-table-column label="状态" prop="status">
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.show_status" :value="row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
width="180"
|
||||
align="center"
|
||||
fixed="right"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
v-perms="[
|
||||
'category_business.category_business/edit',
|
||||
'category_business.category_business/delete',
|
||||
'category_business.category_business/edit',
|
||||
]"
|
||||
type="primary"
|
||||
link
|
||||
@click="handleCheck(row)"
|
||||
>
|
||||
详情
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['category_business.category_business/edit']"
|
||||
type="primary"
|
||||
link
|
||||
@click="handleEdit(row)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['category_business.category_business/delete']"
|
||||
type="danger"
|
||||
link
|
||||
@click="handleDelete(row.id)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<edit-popup
|
||||
v-if="showEdit"
|
||||
ref="editRef"
|
||||
:dict-data="dictData"
|
||||
@success="getLists"
|
||||
@close="showEdit = false"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="categoryBusinessLists">
|
||||
import { usePaging } from "@/hooks/usePaging";
|
||||
import { useDictData } from "@/hooks/useDictOptions";
|
||||
import {
|
||||
apiCategoryBusinessLists,
|
||||
apiCategoryBusinessDelete,
|
||||
} from "@/api/category_business";
|
||||
import { timeFormat } from "@/utils/util";
|
||||
import feedback from "@/utils/feedback";
|
||||
import EditPopup from "./edit.vue";
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>();
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false);
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
name: "",
|
||||
sort: "",
|
||||
status: "",
|
||||
});
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([]);
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id);
|
||||
};
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData("show_status");
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiCategoryBusinessLists,
|
||||
params: queryParams,
|
||||
});
|
||||
|
||||
// 添加
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true;
|
||||
await nextTick();
|
||||
editRef.value?.open("add");
|
||||
};
|
||||
// 查看
|
||||
const handleCheck = async (data: any) => {
|
||||
showEdit.value = true;
|
||||
await nextTick();
|
||||
editRef.value?.open("check");
|
||||
editRef.value?.setFormData(data);
|
||||
};
|
||||
// 编辑
|
||||
const handleEdit = async (data: any) => {
|
||||
showEdit.value = true;
|
||||
await nextTick();
|
||||
editRef.value?.open("edit");
|
||||
editRef.value?.setFormData(data);
|
||||
};
|
||||
|
||||
// 删除
|
||||
const handleDelete = async (id: number | any[]) => {
|
||||
await feedback.confirm("确定要删除?");
|
||||
await apiCategoryBusinessDelete({ id });
|
||||
getLists();
|
||||
};
|
||||
|
||||
getLists().then((res) => {
|
||||
console.log(res);
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,67 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-dialog v-model="props.showEdit" @close="closeEdit">
|
||||
<h1>重要提醒</h1>
|
||||
<div class="content">
|
||||
请确认信息是否有误,发送合同,请确认信息是否有误,发送电子合同后短时间内将不可再次发送.
|
||||
</div>
|
||||
<p class="btn_menu">
|
||||
<el-button type="primary" size="large">确认创建</el-button>
|
||||
<el-button type="info" size="large">返回</el-button>
|
||||
</p>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { reactive, ref } from "vue";
|
||||
|
||||
// const dialogFormVisible = ref(true)
|
||||
const formLabelWidth = "140px";
|
||||
const props = defineProps({
|
||||
showEdit: {
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
const closeEdit = () => {
|
||||
content.emit("close");
|
||||
// console.log(defineProps.showEdit)
|
||||
};
|
||||
const form = reactive({
|
||||
name: "",
|
||||
region: "",
|
||||
date1: "",
|
||||
date2: "",
|
||||
delivery: false,
|
||||
type: [],
|
||||
resource: "",
|
||||
desc: "",
|
||||
});
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
h1 {
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
font-size: 30px;
|
||||
color: red;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.content {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.info {
|
||||
color: red;
|
||||
font-weight: bold;
|
||||
font-size: 18px;
|
||||
display: inline-block;
|
||||
margin: 0 5px;
|
||||
}
|
||||
|
||||
.btn_menu {
|
||||
margin-top: 10vh;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,152 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="公司名称" prop="company_name">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.company_name"
|
||||
clearable
|
||||
placeholder="请输入公司名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="公司类型" prop="company_type">
|
||||
<el-select
|
||||
v-model="queryParams.company_type"
|
||||
placeholder="公司类型"
|
||||
clearable
|
||||
@change="changeType"
|
||||
:style="{ width: '100%' }"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in typeList"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
<!-- <el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.company_type"
|
||||
clearable
|
||||
placeholder="请输入公司类型"
|
||||
/> -->
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<div class="mt-4">
|
||||
|
||||
<el-table :data="pager.lists" @cell-click="handleCurrentChange">
|
||||
<el-table-column label="公司名称" property="company_name" />
|
||||
<el-table-column label="公司类型" property="company_type">
|
||||
<template #default="{ row }">
|
||||
<span
|
||||
>
|
||||
{{row.company_type}}
|
||||
|
||||
</span
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="区县" property="area" />
|
||||
<el-table-column label="乡镇" property="street" />
|
||||
<el-table-column label="主联系人" property="master_name" />
|
||||
<el-table-column label="联系方式" property="master_phone" />
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="companyLists">
|
||||
import { usePaging } from "@/hooks/usePaging";
|
||||
import { useDictData } from "@/hooks/useDictOptions";
|
||||
import {
|
||||
apiCompanyLists,
|
||||
companyListTwo,
|
||||
apiCompanyDelete,
|
||||
companyType,
|
||||
} from "@/api/company";
|
||||
import { defineEmits } from "vue";
|
||||
|
||||
// 当前类型
|
||||
const props = defineProps({
|
||||
type: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
companyTypeList: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return [];
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
// 可选公司类型
|
||||
const typeList = ref([]);
|
||||
companyType({}).then((res) => {
|
||||
typeList.value = res
|
||||
});
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
level_two: "",
|
||||
level_one: "",
|
||||
company_name: "",
|
||||
organization_code: "",
|
||||
city: "",
|
||||
area: "",
|
||||
street: "",
|
||||
company_type: "",
|
||||
master_name: "",
|
||||
master_position: "",
|
||||
master_phone: "",
|
||||
master_email: "",
|
||||
other_contacts: "",
|
||||
area_manager: "",
|
||||
is_contract: "",
|
||||
account: "",
|
||||
password: "",
|
||||
deposit: "",
|
||||
deposit_time: "",
|
||||
qualification: "",
|
||||
status: "",
|
||||
});
|
||||
|
||||
|
||||
console.log(queryParams.company_type)
|
||||
if (props.type) queryParams.company_type = props.type;
|
||||
|
||||
// 选中数据
|
||||
const emits = defineEmits(["customEvent"]);
|
||||
|
||||
// 选中数据子父传递
|
||||
const handleCurrentChange = (value: any) => {
|
||||
emits("customEvent", value);
|
||||
};
|
||||
|
||||
// 选择公司类型
|
||||
const changeType = (e: any) => {
|
||||
getLists();
|
||||
};
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: companyListTwo,
|
||||
params: queryParams,
|
||||
});
|
||||
|
||||
|
||||
getLists();
|
||||
|
||||
console.log(pager)
|
||||
</script>
|
|
@ -0,0 +1,111 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="管理员名称" prop="name">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.name"
|
||||
clearable
|
||||
placeholder="请输入管理员名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="请选择管理员角色" prop="role_id">
|
||||
<el-select class="w-[280px]" v-model="queryParams.role_id">
|
||||
<el-option label="全部" value />
|
||||
<el-option
|
||||
v-for="(item, index) in optionsData.role"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @cell-click="handleCurrentChange">
|
||||
<el-table-column label="账号" prop="account" min-width="120" />
|
||||
<el-table-column label="名称" prop="name" min-width="100" />
|
||||
<el-table-column
|
||||
label="角色"
|
||||
prop="role_name"
|
||||
min-width="100"
|
||||
show-tooltip-when-overflow
|
||||
/>
|
||||
<el-table-column
|
||||
label="部门"
|
||||
prop="dept_name"
|
||||
min-width="100"
|
||||
show-tooltip-when-overflow
|
||||
/>
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
prop="create_time"
|
||||
min-width="180"
|
||||
/>
|
||||
<el-table-column
|
||||
label="最近登录时间"
|
||||
prop="login_time"
|
||||
min-width="180"
|
||||
/>
|
||||
<el-table-column label="最近登录IP" prop="login_ip" min-width="120" />
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="companyLists">
|
||||
import { usePaging } from "@/hooks/usePaging";
|
||||
import { roleAll } from "@/api/perms/role";
|
||||
import { useDictData, useDictOptions } from "@/hooks/useDictOptions";
|
||||
import { adminLists } from "@/api/perms/admin";
|
||||
const { optionsData } = useDictOptions<{
|
||||
role: any[];
|
||||
}>({
|
||||
role: {
|
||||
api: roleAll,
|
||||
},
|
||||
});
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
name: "",
|
||||
role_id: "",
|
||||
});
|
||||
|
||||
const props = defineProps({
|
||||
type: {
|
||||
type: Number,
|
||||
defualt: 0,
|
||||
},
|
||||
});
|
||||
|
||||
if (props.type == 8) {
|
||||
queryParams.role_id = 8;
|
||||
}
|
||||
|
||||
// 选中数据
|
||||
const emits = defineEmits(["customEvent"]);
|
||||
|
||||
// 选中数据子父传递
|
||||
const handleCurrentChange = (value: any) => {
|
||||
emits("customEvent", value);
|
||||
};
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: adminLists,
|
||||
params: queryParams,
|
||||
});
|
||||
|
||||
getLists();
|
||||
</script>
|
|
@ -0,0 +1,83 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="管理员名称" prop="name">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.name"
|
||||
clearable
|
||||
placeholder="请输入管理员名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="请选择管理员角色" prop="role_id">
|
||||
<el-select class="w-[280px]" v-model="queryParams.role_id">
|
||||
<el-option label="全部" value />
|
||||
<el-option
|
||||
v-for="(item, index) in optionsData.role"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @cell-click="handleCurrentChange">
|
||||
<el-table-column label="账号" prop="account" min-width="120" />
|
||||
<el-table-column label="名称" prop="name" min-width="100" />
|
||||
<el-table-column label="角色" prop="role_name" min-width="100" show-tooltip-when-overflow />
|
||||
<el-table-column label="部门" prop="dept_name" min-width="100" show-tooltip-when-overflow />
|
||||
<el-table-column label="创建时间" prop="create_time" min-width="180" />
|
||||
<el-table-column label="最近登录时间" prop="login_time" min-width="180" />
|
||||
<el-table-column label="最近登录IP" prop="login_ip" min-width="120" />
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="companyLists">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { roleAll } from "@/api/perms/role";
|
||||
import { useDictData,useDictOptions } from '@/hooks/useDictOptions'
|
||||
import { adminLists} from "@/api/perms/admin";
|
||||
import { defineEmits } from 'vue'
|
||||
const { optionsData } = useDictOptions<{
|
||||
role: any[];
|
||||
}>({
|
||||
role: {
|
||||
api: roleAll,
|
||||
},
|
||||
});
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
name: "",
|
||||
role_id: "",
|
||||
})
|
||||
|
||||
// 选中数据
|
||||
const emits = defineEmits(['customEvent'])
|
||||
|
||||
// 选中数据子父传递
|
||||
const handleCurrentChange = (value: any) => {
|
||||
emits('customEvent', value)
|
||||
}
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: adminLists,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
getLists()
|
||||
</script>
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,593 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px] formdata" :model="queryParams" inline>
|
||||
<el-form-item label="公司名称" prop="company_name">
|
||||
<el-input class="w-[280px]" v-model="queryParams.company_name" clearable placeholder="请输入公司名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="区" prop="area" v-show="company_type_show">
|
||||
<el-input class="w-[280px]" v-model="queryParams.area" clearable placeholder="请输入区" />
|
||||
</el-form-item>
|
||||
<el-form-item label="镇" prop="street" v-show="company_type_show">
|
||||
<el-input class="w-[280px]" v-model="queryParams.street" clearable placeholder="请输入镇" />
|
||||
</el-form-item>
|
||||
<el-form-item label="公司类型" prop="company_type" v-show="company_type_show">
|
||||
<el-select v-model="queryParams.company_type" placeholder="请选择公司类型" clearable class="w-[280px]">
|
||||
<el-option v-for="(item, index) in datas.dictTypeLists" :key="index" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="片区经理" prop="area_manager">
|
||||
<el-input class="w-[280px]" v-model="queryParams.area_manager" clearable placeholder="请输入片区经理" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否签约" prop="is_contract">
|
||||
<el-select v-model="queryParams.is_contract" placeholder="是否签约" clearable class="w-[240px]">
|
||||
<el-option label="已签约" value="1"></el-option>
|
||||
<el-option label="未签约" value="0"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<router-link v-perms="['company/add:edit']" :to="{
|
||||
path: getRoutePath('company/add:edit'),
|
||||
query: {
|
||||
flag: true,
|
||||
},
|
||||
}">
|
||||
<el-button type="primary" class="mb-4">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
创建
|
||||
</el-button>
|
||||
</router-link>
|
||||
<!-- <router-link
|
||||
:to="{
|
||||
path: getRoutePath('company/add:edit'),
|
||||
query: {
|
||||
id: userStore.userInfo.company_id,
|
||||
read: true,
|
||||
},
|
||||
}"
|
||||
>
|
||||
<el-button type="primary" class="mb-4">
|
||||
我的公司
|
||||
</el-button></router-link -->
|
||||
|
||||
<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" width="200" 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>
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.is_contract == 1" style="color: #67c23a">已签约</span>
|
||||
<span v-else-if="row.contract?.check_status == 1" style="color: #e6a23c; cursor: pointer" @click="auditing(1)">审核中</span>
|
||||
<span v-else-if="
|
||||
row.contract?.check_status == 2 ||
|
||||
row.contract?.check_status == 3
|
||||
" @click="auditing(2)" style="color: #e6a23c; cursor: pointer">签约中</span>
|
||||
<span v-else style="color: #fe0000">未签约</span>
|
||||
</template></el-table-column>
|
||||
<el-table-column label="认证反馈" prop="notes" show-overflow-tooltip />
|
||||
<el-table-column label="操作" align="center" width="420" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<div style="display: flex; flex-wrap: wrap">
|
||||
<el-button type="primary" link>
|
||||
<router-link :to="{
|
||||
|
||||
path: getRoutePath('company/userlist'),
|
||||
|
||||
query: {
|
||||
company_id: row.id,
|
||||
read: true,
|
||||
},
|
||||
}">查看成员</router-link>
|
||||
</el-button>
|
||||
|
||||
<el-button type="primary" link>
|
||||
<router-link :to="{
|
||||
path: getRoutePath('company/subordinate/lists'),
|
||||
|
||||
query: {
|
||||
company_id: row.id,
|
||||
read: true,
|
||||
},
|
||||
}">下属公司</router-link>
|
||||
</el-button>
|
||||
<el-button v-perms="['company/add:edit']" type="primary" link>
|
||||
<router-link :to="{
|
||||
path: getRoutePath('company/add:edit'),
|
||||
query: {
|
||||
id: row.id,
|
||||
read: true,
|
||||
isshow: true,
|
||||
},
|
||||
}">详情</router-link>
|
||||
</el-button>
|
||||
<el-button v-if="row.is_authentication == 0" v-perms="['company/add:edit']" type="primary" link>
|
||||
<router-link :to="{
|
||||
path: getRoutePath('company/add:edit'),
|
||||
query: {
|
||||
id: row.id,
|
||||
edit: true,
|
||||
},
|
||||
}">编辑</router-link>
|
||||
</el-button>
|
||||
<el-button v-perms="['company/delete']" type="danger" link @click="handleDelete(row.id)">删除</el-button>
|
||||
<el-button v-if="row.is_authentication == 0" v-perms="['company/authentication']" type="primary" link @click="authBefore(row)">{{ auth_text }}</el-button>
|
||||
<template v-if="row.is_authentication && row.is_contract == 0">
|
||||
<!-- <el-button
|
||||
v-if="!row.face_create_status"
|
||||
v-perms="['company/authentication']"
|
||||
type="primary"
|
||||
link
|
||||
@click="
|
||||
auth_id = row;
|
||||
facePop = true;
|
||||
"
|
||||
>人脸采集</el-button
|
||||
> -->
|
||||
<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-else-if="row.contract?.check_status == 2"
|
||||
v-perms="['company/Draftingcontracts']"
|
||||
type="primary"
|
||||
link
|
||||
@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>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<el-dialog v-model="showInitiateContractPop" @close="offInitiateContractPop">
|
||||
<h1>重要提醒</h1>
|
||||
<div>
|
||||
<div class="content">请确认信息是否有误</div>
|
||||
<el-card>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label-width="100px" label="甲方" prop="field130">
|
||||
<el-input v-model="contractFormData.party_a_name" placeholder="请选择甲方" @click="showCompany = true" clearable :style="{ width: '100%' }"></el-input>
|
||||
<!-- <el-select
|
||||
v-model="contractFormData.party_a"
|
||||
placeholder="请选择甲方"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in company_list"
|
||||
:key="index"
|
||||
:label="item.company_name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select> -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label-width="100px" label="乙方" prop="field131">
|
||||
<el-input :disabled="true" v-model="contractFormData.party_b_name" placeholder="请选择乙方" clearable :style="{ width: '100%' }"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label-width="100px" label="合同类型" prop="contract_type">
|
||||
<el-select v-model="contractFormData.contract_type" placeholder="请选择合同类型" clearable :style="{ width: '100%' }">
|
||||
<el-option v-for="(item, index) in contract_type" :key="index" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label-width="100px" label="合同编号" prop="field133">
|
||||
<el-input placeholder="系统自动生成" v-model="contractFormData.contract_no" clearable :style="{ width: '100%' }" :disabled="true"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</div>
|
||||
<p class="btn_menu">
|
||||
<el-button type="primary" size="large" @click="InitiateContract">确认</el-button>
|
||||
<el-button type="info" size="large" @click="offInitiateContractPop">返回</el-button>
|
||||
</p>
|
||||
<el-dialog v-model="showCompany">
|
||||
<DialogIndex :companyTypeList="datas.dictTypeLists" :type="30" @customEvent="customEvent"></DialogIndex>
|
||||
</el-dialog>
|
||||
</el-dialog>
|
||||
<el-dialog v-model="showPop" @close="offPop">
|
||||
<h1>重要提醒</h1>
|
||||
<div class="content" v-if="showConctactPop">
|
||||
请确认信息是否有误,发送合同,请确认信息是否有误,发送电子合同后短时间内将不可再次发送.
|
||||
</div>
|
||||
<div class="content" v-else>
|
||||
确认签约短信将在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-else @click="sendMsg">确认</el-button>
|
||||
<el-button type="info" size="large" @click="offPop">返回</el-button>
|
||||
</p>
|
||||
</el-dialog>
|
||||
<el-dialog v-model="authPop" @close="offAuthPop">
|
||||
<h1>企业认证提醒</h1>
|
||||
<div>
|
||||
<div style="font-size: 18px; font-weight: bold; padding-bottom: 10px">
|
||||
企业认证前,请检查以下重要信息是否正确
|
||||
</div>
|
||||
<el-form ref="formRef" label-width="90px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="公司名称" prop="company_name">
|
||||
<el-input placeholder="请输入公司名称" clearable :value="auth_id.company_name" readonly :style="{ width: '100%' }"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="企业代码" prop="company_name">
|
||||
<el-input placeholder="请输入企业代码" clearable :value="auth_id.organization_code" readonly :style="{ width: '100%' }"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="主要联系人" prop="company_name">
|
||||
<el-input placeholder="请输入主要联系人" clearable :value="auth_id.master_name" readonly :style="{ width: '100%' }"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="手机号码" prop="company_name">
|
||||
<el-input placeholder="请输入手机号码" clearable :value="auth_id.master_phone" readonly :style="{ width: '100%' }"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<p class="btn_menu">
|
||||
<el-button type="primary" size="large" @click="handleAuthentication(auth_id.id)">确认</el-button>
|
||||
<el-button type="warning" size="large" @click="toEditCompany">修改</el-button>
|
||||
<el-button type="info" size="large" @click="offAuthPop">返回</el-button>
|
||||
</p>
|
||||
</el-dialog>
|
||||
<el-dialog v-model="facePop" @close="offFacePop">
|
||||
<h1>人脸采集提醒</h1>
|
||||
<div>
|
||||
<div style="font-size: 18px; font-weight: bold; padding-bottom: 10px">
|
||||
人脸采集前,请检查以下重要信息是否正确
|
||||
</div>
|
||||
<el-form ref="formRef" label-width="90px">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="公司名称" prop="company_name">
|
||||
<el-input placeholder="请输入公司名称" clearable :value="auth_id.company_name" readonly :style="{ width: '100%' }"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="企业代码" prop="organization_code">
|
||||
<el-input placeholder="请输入企业代码" clearable :value="auth_id.organization_code" readonly :style="{ width: '100%' }"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="主要联系人" prop="master_name">
|
||||
<el-input placeholder="请输入主要联系人" clearable :value="auth_id.master_name" readonly :style="{ width: '100%' }"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="手机号码" prop="master_phone">
|
||||
<el-input placeholder="请输入手机号码" clearable :value="auth_id.master_phone" readonly :style="{ width: '100%' }"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="邮箱" prop="master_email">
|
||||
<el-input placeholder="请输入邮箱" clearable :value="auth_id.master_email" readonly :style="{ width: '100%' }"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<p class="btn_menu">
|
||||
<el-button type="primary" size="large" @click="handleFaceGather(auth_id.id)">确认</el-button>
|
||||
<el-button type="warning" size="large" @click="toEditCompany">修改</el-button>
|
||||
<el-button type="info" size="large" @click="offFacePop">返回</el-button>
|
||||
</p>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="companyLists">
|
||||
import { usePaging } from "@/hooks/usePaging";
|
||||
import { useDictData } from "@/hooks/useDictOptions";
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
import {
|
||||
apiCompanyLists,
|
||||
companyListTwo,
|
||||
apiCompanyDelete,
|
||||
generateGontract,
|
||||
sendMsgApi,
|
||||
authentication,
|
||||
apiCompanyDetail,
|
||||
initiate_contract,
|
||||
organizationFaceCreate,
|
||||
contractType,
|
||||
} from "@/api/company";
|
||||
import { timeFormat } from "@/utils/util";
|
||||
import feedback from "@/utils/feedback";
|
||||
import { dictDataLists } from "@/api/setting/dict";
|
||||
import { getRoutePath } from "@/router";
|
||||
import { dictContractTypeList } from "@/utils/dict.ts";
|
||||
import DialogIndex from "./dialog_index.vue";
|
||||
|
||||
const showCompany = ref(false);
|
||||
const customEvent = (e: any) => {
|
||||
contractFormData.value.party_a = e.id;
|
||||
contractFormData.value.party_a_name = e.company_name;
|
||||
showCompany.value = false;
|
||||
};
|
||||
|
||||
const userStore = useUserStore();
|
||||
console.log(userStore.userInfo.company_id);
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const company_type_show = ref(true);
|
||||
// 创建合同与发送短信
|
||||
//弹窗
|
||||
const showPop = ref(false);
|
||||
const showConctactPop = ref(false);
|
||||
const offPop = () => {
|
||||
showPop.value = false;
|
||||
showConctactPop.value = false;
|
||||
};
|
||||
const InitiateContractPop = ref(false);
|
||||
const showInitiateContractPop = ref(false);
|
||||
const offInitiateContractPop = () => {
|
||||
showInitiateContractPop.value = false;
|
||||
InitiateContractPop.value = false;
|
||||
};
|
||||
// 创建合同的id
|
||||
const contractId = ref("");
|
||||
|
||||
//企业认证弹窗
|
||||
const authPop = ref(false);
|
||||
const offAuthPop = () => {
|
||||
authPop.value = false;
|
||||
};
|
||||
|
||||
//人脸采集弹窗
|
||||
const facePop = ref(false);
|
||||
const offFacePop = () => {
|
||||
facePop.value = false;
|
||||
};
|
||||
|
||||
const handleFaceGather = async (id: any) => {
|
||||
let res = await organizationFaceCreate({
|
||||
id: id,
|
||||
});
|
||||
offFacePop();
|
||||
};
|
||||
|
||||
const toEditCompany = () => {
|
||||
router.push({
|
||||
path: getRoutePath("company/add:edit"),
|
||||
query: {
|
||||
id: auth_id.value.id,
|
||||
edit: true,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
// 合同
|
||||
const contractFormData = ref({
|
||||
party_a: "",
|
||||
party_a_name: "",
|
||||
party_b: "",
|
||||
party_b_name: "",
|
||||
contract_type: "",
|
||||
contract_no: "",
|
||||
});
|
||||
|
||||
const company_list = ref([]);
|
||||
const contract_type = ref([]);
|
||||
|
||||
const getDetails = async (id: any) => {
|
||||
const data = await apiCompanyDetail({
|
||||
id: id,
|
||||
});
|
||||
companyListTwo().then((res) => {
|
||||
company_list.value = res;
|
||||
});
|
||||
contractType().then((res) => {
|
||||
contract_type.value = res.filter((item: any) => {
|
||||
return dictContractTypeList.find((t: String | Number) => t == item.id);
|
||||
});
|
||||
});
|
||||
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;
|
||||
} else {
|
||||
contractFormData.value.party_a = "";
|
||||
contractFormData.value.party_a_name = "";
|
||||
}
|
||||
};
|
||||
|
||||
const showChangeCompany = (row: any) => {
|
||||
contractId.value = row.id;
|
||||
getDetails(row.id);
|
||||
// showPop.value = true
|
||||
ShowInitiateContractPop();
|
||||
};
|
||||
|
||||
const ShowInitiateContractPop = () => {
|
||||
(InitiateContractPop.value = true), (showInitiateContractPop.value = true);
|
||||
};
|
||||
const showCreateConctPop = (row) => {
|
||||
(showPop.value = true),
|
||||
(showConctactPop.value = true),
|
||||
(contractId.value = row.id);
|
||||
};
|
||||
const InitiateContract = async () => {
|
||||
if (!contractFormData.value.party_a) return ElMessage.error("甲方不能为空");
|
||||
if (!contractFormData.value.contract_type)
|
||||
return ElMessage.error("合同类型不能为空");
|
||||
let data = {
|
||||
contract_type: contractFormData.value.contract_type,
|
||||
party_a: contractFormData.value.party_a,
|
||||
};
|
||||
await initiate_contract({
|
||||
id: contractId.value,
|
||||
// ...contractFormData.value,
|
||||
...data
|
||||
});
|
||||
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: "",
|
||||
// 是否签约
|
||||
is_contract: "",
|
||||
});
|
||||
|
||||
if (route.query.company_type) {
|
||||
company_type_show.value = false;
|
||||
queryParams["company_type"] = route.query.company_type?.toString() || "";
|
||||
}
|
||||
|
||||
const datas = reactive({
|
||||
dictTypeLists: [],
|
||||
});
|
||||
const getdictTypeLists = async () => {
|
||||
const data = await dictDataLists({ type_id: 6 });
|
||||
datas["dictTypeLists"] = data["lists"];
|
||||
};
|
||||
getdictTypeLists();
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([]);
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id);
|
||||
};
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData("");
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiCompanyLists,
|
||||
params: queryParams,
|
||||
});
|
||||
|
||||
// 删除
|
||||
const handleDelete = async (id: number | any[]) => {
|
||||
await feedback.confirm("确定要删除?");
|
||||
await apiCompanyDelete({ id });
|
||||
getLists();
|
||||
};
|
||||
|
||||
const auth_id = ref("");
|
||||
const auth_text = ref("企业认证");
|
||||
let timer: any;
|
||||
let time_count = 10;
|
||||
const authBefore = (row: any) => {
|
||||
if (timer) return ElMessage.warning("认证中,请耐心等待");
|
||||
auth_id.value = row;
|
||||
authPop.value = true;
|
||||
};
|
||||
const handleAuthentication = async (id: number | string | any[]) => {
|
||||
await feedback.confirm("确定要认证?");
|
||||
await authentication({ id });
|
||||
timer = setInterval(() => {
|
||||
auth_text.value = time_count + "秒后刷新";
|
||||
if (time_count == 0) {
|
||||
clearInterval(timer);
|
||||
auth_text.value = "企业认证";
|
||||
time_count = 10;
|
||||
getLists();
|
||||
} else time_count--;
|
||||
}, 1000);
|
||||
getLists();
|
||||
authPop.value = false;
|
||||
};
|
||||
|
||||
// 审核中
|
||||
const auditing = (type: number) => {
|
||||
ElMessage.warning(type == 1 ? "请等待合同审核完成!" : "合同双方正在签约!");
|
||||
};
|
||||
|
||||
getLists();
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.btn {
|
||||
position: absolute;
|
||||
}
|
||||
h1 {
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
font-size: 30px;
|
||||
color: red;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.content {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.info {
|
||||
color: red;
|
||||
font-weight: bold;
|
||||
font-size: 18px;
|
||||
display: inline-block;
|
||||
margin: 0 5px;
|
||||
}
|
||||
|
||||
.btn_menu {
|
||||
margin-top: 10vh;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
}
|
||||
.formdata {
|
||||
.el-form-item {
|
||||
width: 20%;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,320 @@
|
|||
<template>
|
||||
<div>
|
||||
<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="片区经理"
|
||||
prop="area_manager_name"
|
||||
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-else style="color: #fe0000">未签约</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
width="300"
|
||||
fixed="right"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<div style="display: flex">
|
||||
<el-button type="primary" link>
|
||||
<router-link
|
||||
:to="{
|
||||
path: getRoutePath('auth.admin/lists'),
|
||||
query: {
|
||||
company_id: row.id,
|
||||
read: true,
|
||||
},
|
||||
}"
|
||||
>查看成员</router-link
|
||||
>
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['company/edit', 'company/add']"
|
||||
type="primary"
|
||||
link
|
||||
>
|
||||
<router-link
|
||||
:to="{
|
||||
path: getRoutePath('company/add:edit'),
|
||||
query: {
|
||||
id: row.id,
|
||||
read: true,
|
||||
},
|
||||
}"
|
||||
>详情</router-link
|
||||
>
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['company/edit', 'company/add']"
|
||||
type="primary"
|
||||
link
|
||||
>
|
||||
<router-link
|
||||
:to="{
|
||||
path: getRoutePath('company/add:edit'),
|
||||
query: {
|
||||
id: row.id,
|
||||
edit: true,
|
||||
},
|
||||
}"
|
||||
>编辑</router-link
|
||||
>
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['company/delete']"
|
||||
type="danger"
|
||||
link
|
||||
@click="handleDelete(row.id)"
|
||||
>删除</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="row.is_authentication == 0"
|
||||
v-perms="['company/authentication']"
|
||||
type="primary"
|
||||
link
|
||||
@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-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="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>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<el-dialog v-model="showPop" @close="offPop">
|
||||
<h1>重要提醒</h1>
|
||||
<div class="content" v-if="showConctactPop">
|
||||
请确认信息是否有误,发送合同,请确认信息是否有误,发送电子合同后短时间内将不可再次发送.
|
||||
</div>
|
||||
<div class="content" v-else>
|
||||
确认签约短信将在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-else @click="sendMsg"
|
||||
>确认</el-button
|
||||
>
|
||||
<el-button type="info" size="large" @click="offPop">返回</el-button>
|
||||
</p>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</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 EditPopup from './edit.vue'
|
||||
import { getRoutePath } from "@/router";
|
||||
|
||||
const route = useRoute();
|
||||
const company_type_show = ref(true);
|
||||
// 创建合同与发送短信
|
||||
//弹窗
|
||||
const showPop = ref(false);
|
||||
const showConctactPop = ref(false);
|
||||
const offPop = () => {
|
||||
showPop.value = false;
|
||||
showConctactPop.value = false;
|
||||
};
|
||||
// 创建合同的id
|
||||
const contractId = ref("");
|
||||
const showCreateConctPop = (row) => {
|
||||
(showPop.value = true),
|
||||
(showConctactPop.value = true),
|
||||
(contractId.value = row.id);
|
||||
};
|
||||
const creContct = () => {
|
||||
generateGontract({ id: contractId.value });
|
||||
offPop();
|
||||
};
|
||||
const sendMsg = () => {
|
||||
sendMsgApi({ id: contractId.value });
|
||||
offPop();
|
||||
};
|
||||
// 创建合同与发送短信结束
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
// company_name: "",
|
||||
// area: "",
|
||||
// street: "",
|
||||
// company_type: "",
|
||||
// area_manager: "",
|
||||
// // 是否签约
|
||||
// is_contract: "",
|
||||
id: "",
|
||||
});
|
||||
|
||||
// if (route.query.company_type) {
|
||||
// company_type_show.value = false;
|
||||
// queryParams["company_type"] = route.query.company_type?.toString() || "";
|
||||
// }
|
||||
if (route.query.company_id) {
|
||||
queryParams.id = route.query.company_id?.toString() || "";
|
||||
}
|
||||
|
||||
const datas = reactive({
|
||||
dictTypeLists: [],
|
||||
});
|
||||
const getdictTypeLists = async () => {
|
||||
const data = await dictDataLists({ type_id: 6 });
|
||||
datas["dictTypeLists"] = data["lists"];
|
||||
};
|
||||
getdictTypeLists();
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([]);
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id);
|
||||
};
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData("");
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiSubordinateList,
|
||||
params: queryParams,
|
||||
});
|
||||
|
||||
// 删除
|
||||
const handleDelete = async (id: number | any[]) => {
|
||||
await feedback.confirm("确定要删除?");
|
||||
await apiCompanyDelete({ id });
|
||||
getLists();
|
||||
};
|
||||
|
||||
getLists();
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.btn {
|
||||
position: absolute;
|
||||
}
|
||||
h1 {
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
font-size: 30px;
|
||||
color: red;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.content {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.info {
|
||||
color: red;
|
||||
font-weight: bold;
|
||||
font-size: 18px;
|
||||
display: inline-block;
|
||||
margin: 0 5px;
|
||||
}
|
||||
|
||||
.btn_menu {
|
||||
margin-top: 10vh;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,587 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none" shadow="never">
|
||||
<el-page-header content="用户详情" @back="$router.back()" />
|
||||
</el-card>
|
||||
<el-card class="mt-4 !border-none" shadow="never">
|
||||
<el-form ref="formRef" :model="formData" label-width="84px">
|
||||
<div style="font-size: 1.2rem; margin: 10px 0">基本信息</div>
|
||||
<div class="headimg">
|
||||
<el-upload v-model="formData.avatar" class="avatar-uploader-head" :disabled="flag" :data="{ cid: 1 }" :headers="{ Token: userStore.token }" :action="base_url + '/upload/taskImage'" :show-file-list="false" :on-success="handleAvatarSuccessAvatar">
|
||||
<img v-if="formData.avatar" :src="formData.avatar" class="avatar" />
|
||||
<el-icon v-else class="avatar-uploader-icon">
|
||||
<Plus />
|
||||
</el-icon>
|
||||
</el-upload>
|
||||
</div>
|
||||
<el-col class="pt-6 !border-none">
|
||||
<el-row>
|
||||
<el-col :span="11">
|
||||
<el-form-item label="姓名" prop="nickname">
|
||||
<el-input v-model="formData.nickname" :disabled="flag" placeholder="请输入姓名" clearable :style="{ width: '100%' }"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="13">
|
||||
<el-form-item label="性别" prop="gender">
|
||||
<el-select v-model="formData.sex" :disabled="flag" placeholder="请选择性别" :style="{ width: '100%' }">
|
||||
<el-option label="男" :value="0" />
|
||||
<el-option label="女" :value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<!-- <el-col :span="11">
|
||||
<el-form-item label="身份证号" prop="id_card">
|
||||
<el-input v-model="formData.id_card" :disabled="flag" placeholder="请输入身份证号" clearable :style="{ width: '100%' }"></el-input>
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-col :span="13">
|
||||
<el-form-item label="联系电话" prop="mobile">
|
||||
|
||||
<el-input v-model="formData.mobile" placeholder="请输入联系电话" :disabled="flag" clearable :style="{ width: '100%' }"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- <el-row>
|
||||
<el-form-item label="省" prop="province" style="flex: 1">
|
||||
<el-select v-model="formData.province" placeholder="请选择省" :disabled="flag" clearable @change="province_change" :style="{ width: '100%' }">
|
||||
<el-option v-for="(item, index) in datas.provinceOptions" :key="index" :label="item.province_name" :value="item.province_code"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="市" prop="city" style="flex: 1">
|
||||
<el-select v-model="formData.city" placeholder="请选择市" clearable :disabled="flag" @change="city_change" :style="{ width: '100%' }">
|
||||
<el-option v-for="(item, index) in datas.cityOptions" :key="index" :label="item.city_name" :value="item.city_code"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="区" prop="area" style="flex: 1">
|
||||
<el-select v-model="formData.area" placeholder="请选择区" :disabled="flag" clearable @change="area_change" :style="{ width: '100%' }">
|
||||
<el-option v-for="(item, index) in datas.areaOptions" :key="index" :label="item.area_name" :value="item.area_code"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="镇" prop="street" style="flex: 1">
|
||||
<el-select v-model="formData.street" placeholder="请选择镇" :disabled="flag" clearable @change="street_change" :style="{ width: '100%' }">
|
||||
<el-option v-for="(item, index) in datas.streetOptions" :key="index" :label="item.street_name" :value="item.street_code"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="村社小队" prop="address" style="flex: 1.5">
|
||||
<el-input v-model="formData.address" :disabled="flag" placeholder="请输入村社小队" clearable :style="{ width: '100%' }"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
</el-row> -->
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24" style="margin-top: 1vh">
|
||||
<!-- <el-row>
|
||||
<el-col :span="12" v-if="mode == 'initiate' || formData.party_b">
|
||||
<el-form-item label="签约方" prop="field130">
|
||||
<el-input
|
||||
v-model="formData.party_b_name"
|
||||
placeholder="请选择签约方"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
@click="isCompany = true"
|
||||
@clear="clearPartyA"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row> -->
|
||||
</el-col>
|
||||
<!-- <div style="font-size: 1.2rem; margin: 10px 0">资质信息</div>
|
||||
<div style="display: flex; justify-content: space-between">
|
||||
<div>
|
||||
<el-form-item label="身份证" prop="id_card">
|
||||
<el-upload v-model="formData.qualification.id_card" :disabled="flag" class="avatar-uploader pl-3" :data="{ cid: 1 }" :headers="{ Token: userStore.token }" :action="base_url + '/upload/taskImage'" :show-file-list="false" :on-success="handleAvatarSuccessIdA">
|
||||
<img v-if="formData.qualification.id_card" :src="formData.qualification.id_card" class="avatar" />
|
||||
<el-icon v-else class="avatar-uploader-icon">
|
||||
<Plus />
|
||||
</el-icon>
|
||||
</el-upload>
|
||||
<el-upload v-model="formData.qualification.id_card_b" :disabled="flag" class="avatar-uploader pl-3" :data="{ cid: 1 }" :headers="{ Token: userStore.token }" :action="base_url + '/upload/taskImage'" :show-file-list="false" :on-success="handleAvatarSuccessIdB">
|
||||
<img v-if="formData.qualification.id_card_b" :src="formData.qualification.id_card_b" class="avatar" />
|
||||
<el-icon v-else class="avatar-uploader-icon">
|
||||
<Plus />
|
||||
</el-icon>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div>
|
||||
<el-form-item label="银行卡" prop="bank_account">
|
||||
<el-upload v-model="formData.qualification.bank_account" :disabled="flag" class="avatar-uploader pl-3" :data="{ cid: 1 }" :headers="{ Token: userStore.token }" :action="base_url + '/upload/taskImage'" :show-file-list="false" :on-success="handleAvatarSuccessBankA" :before-upload="beforeAvatarUpload_three">
|
||||
<img v-if="formData.qualification.bank_account" :src="formData.qualification.bank_account" class="avatar" />
|
||||
<el-icon v-else class="avatar-uploader-icon">
|
||||
<Plus />
|
||||
</el-icon>
|
||||
</el-upload>
|
||||
<el-upload v-model="formData.qualification.bank_account_b" :disabled="flag" class="avatar-uploader pl-3" :data="{ cid: 1 }" :headers="{ Token: userStore.token }" :action="base_url + '/upload/taskImage'" :show-file-list="false" :on-success="handleAvatarSuccessBankB" :before-upload="beforeAvatarUpload_three">
|
||||
<img v-if="formData.qualification.bank_account_b" :src="formData.qualification.bank_account_b" class="avatar" />
|
||||
<el-icon v-else class="avatar-uploader-icon">
|
||||
<Plus />
|
||||
</el-icon>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</div>-->
|
||||
|
||||
<!-- <div>
|
||||
<el-form-item label="行驶证" prop="car_card">
|
||||
<el-upload
|
||||
v-model="formData.qualification.car_card"
|
||||
:disabled="flag"
|
||||
class="avatar-uploader pl-3"
|
||||
:data="{ cid: 1 }"
|
||||
:headers="{ Token: userStore.token }"
|
||||
:action="base_url + '/upload/taskImage'"
|
||||
:show-file-list="false"
|
||||
:on-success="handleAvatarSuccessCarA"
|
||||
>
|
||||
<img
|
||||
v-if="formData.qualification.car_card"
|
||||
:src="formData.qualification.car_card"
|
||||
class="avatar"
|
||||
/>
|
||||
<el-icon v-else class="avatar-uploader-icon">
|
||||
<Plus />
|
||||
</el-icon>
|
||||
</el-upload>
|
||||
<el-upload
|
||||
v-model="formData.qualification.car_card_b"
|
||||
:disabled="flag"
|
||||
class="avatar-uploader pl-3"
|
||||
:data="{ cid: 1 }"
|
||||
:headers="{ Token: userStore.token }"
|
||||
:action="base_url + '/upload/taskImage'"
|
||||
:show-file-list="false"
|
||||
:on-success="handleAvatarSuccessCarB"
|
||||
:before-upload="beforeAvatarUpload_two"
|
||||
>
|
||||
<img
|
||||
v-if="formData.qualification.car_card_b"
|
||||
:src="formData.qualification.car_card_b"
|
||||
class="avatar"
|
||||
/>
|
||||
<el-icon v-else class="avatar-uploader-icon">
|
||||
<Plus />
|
||||
</el-icon>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
</div> -->
|
||||
<template v-if="disabledPartyA">
|
||||
<el-col :span="24">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="签约姓名" prop="name">
|
||||
<el-input v-model="formData.nickname" placeholder="请输入签约姓名" :disabled="true" clearable :style="{ width: '100%' }"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="性别" prop="sex">
|
||||
<el-input placeholder="请输入性别" :disabled="true" clearable :style="{ width: '100%' }" :value="formData.gender== '0' ? '男' : '女'"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="身份证号" prop="id_card">
|
||||
<el-input v-model="formData.id_card" placeholder="请输入身份证号" :disabled="true" clearable :style="{ width: '100%' }"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系电话" prop="account">
|
||||
<el-input v-model="formData.account" placeholder="请输入联系电话" :disabled="true" clearable :style="{ width: '100%' }"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="formData.name">
|
||||
<el-form-item label="账号">
|
||||
<el-input v-model="formData.account" :disabled="true" clearable :style="{ width: '100%' }"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="formData.name">
|
||||
<el-form-item label="初始密码" prop="password">
|
||||
<el-input :model-value="'m' + formData.account" :disabled="true" clearable :style="{ width: '100%' }"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</template>
|
||||
<el-col :span="24" v-if="mode == 'uplode'">
|
||||
<el-form-item label="合同上传" prop="field127">
|
||||
<el-upload :headers="{ Token: userStore.token }" v-model:file-list="fileList" class="upload-demo" :action="base_url + '/upload/taskFile'" :on-success="handleAvatarSuccess_four" multiple :limit="1">
|
||||
<el-button type="primary">上传</el-button>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="24" v-if="formData.contract">
|
||||
<el-form-item label="合同地址">
|
||||
<el-link
|
||||
type="success"
|
||||
:href="formData.contract.file"
|
||||
target="_blank"
|
||||
>在线查看</el-link
|
||||
>
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
|
||||
<el-col :span="24" v-if="mode == 'initiate'" class="pt-6">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同类型" prop="contract_type">
|
||||
<el-col :span="24">
|
||||
<el-select v-model="formData.contract_type" placeholder="请选择合同类型" clearable :style="{ width: '100%' }">
|
||||
<el-option v-for="(item, index) in datas.contract_type" :key="index" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item prop="field139">
|
||||
<el-button type="primary" v-if="mode == 'initiate'" @click="initiateContactFn">发起合同</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<account-adjust v-model:show="adjustState.show" :value="adjustState.value" @confirm="handleConfirmAdjust" />
|
||||
<!-- <el-dialog v-model="isCompany" title="选择签约方" width="60%">
|
||||
<DialogIndex @customEvent="customEvent" />
|
||||
</el-dialog> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="consumerDetail">
|
||||
import type {
|
||||
FormInstance,
|
||||
UploadProps,
|
||||
ElMessage,
|
||||
UploadUserFile,
|
||||
} from "element-plus";
|
||||
import {
|
||||
adjustMoney,
|
||||
getUserDetail,
|
||||
userEdit,
|
||||
creatContact,
|
||||
initiateContact,
|
||||
upContact,
|
||||
} from "@/api/consumer";
|
||||
import { companyUserDetail } from "@/api/company";
|
||||
import {
|
||||
apiCityList,
|
||||
apiAreaList,
|
||||
apiStreetList,
|
||||
apiProvinceList,
|
||||
} from "@/api/common";
|
||||
import { dictDataLists } from "@/api/setting/dict";
|
||||
import DialogIndex from "@/components/dialog_index.vue";
|
||||
import { isEmpty } from "@/utils/util";
|
||||
// import AccountAdjust from "../components/account-adjust.vue";
|
||||
import useMultipleTabs from "@/hooks/useMultipleTabs";
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
import feedback from "@/utils/feedback";
|
||||
import { inject } from "vue";
|
||||
const base_url: any = inject("base_url");
|
||||
const { removeTab } = useMultipleTabs();
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const flag = ref(true);
|
||||
const formData = reactive({
|
||||
id: "",
|
||||
sex: "",
|
||||
id_card: "",
|
||||
nickname: "",
|
||||
province: "",
|
||||
city: "",
|
||||
area: "",
|
||||
street: "",
|
||||
address: "",
|
||||
account: "",
|
||||
is_contract: 0,
|
||||
// 签约方
|
||||
party_b_name: "",
|
||||
party_b: "",
|
||||
qualification: {
|
||||
id_card: "",
|
||||
id_card_b: "",
|
||||
car_card: "",
|
||||
car_card_b: "",
|
||||
bank_account: "",
|
||||
bank_account_b: "",
|
||||
},
|
||||
// 合同类型
|
||||
contract_type: "",
|
||||
file: "",
|
||||
avatar: "",
|
||||
multipoint_login: 1,
|
||||
contract: {
|
||||
url: "",
|
||||
},
|
||||
});
|
||||
const disabledPartyA = ref(false);
|
||||
|
||||
const adjustState = reactive({
|
||||
show: false,
|
||||
value: "",
|
||||
});
|
||||
// 字典信息
|
||||
const datas: any = reactive({
|
||||
provinceOptions: [],
|
||||
cityOptions: [],
|
||||
areaOptions: [],
|
||||
streetOptions: [],
|
||||
dictTypeLists: [],
|
||||
contract_type: [],
|
||||
contract: [],
|
||||
});
|
||||
|
||||
const formRef = shallowRef<FormInstance>();
|
||||
const isEdit = ref(false);
|
||||
|
||||
const isCompany = ref(false);
|
||||
const userStore = useUserStore();
|
||||
|
||||
function customEvent(data: any) {
|
||||
isCompany.value = false;
|
||||
formData.party_b = data.id;
|
||||
formData.party_b_name = data.company_name;
|
||||
disabledPartyA.value = true;
|
||||
}
|
||||
function clearPartyA() {
|
||||
formData.party_b = "";
|
||||
formData.party_b_name = "";
|
||||
}
|
||||
const getcontract_type = async () => {
|
||||
const data = await dictDataLists({ type_id: 7 });
|
||||
datas["contract_type"] = data["lists"];
|
||||
};
|
||||
const mode = ref(null);
|
||||
getcontract_type();
|
||||
const getDetails = async () => {
|
||||
const data = await companyUserDetail({
|
||||
user_id: route.query.id,
|
||||
});
|
||||
console.log(data);
|
||||
|
||||
Object.keys(formData).forEach((key) => {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key];
|
||||
});
|
||||
mode.value = route.query.mode;
|
||||
formData.sex = data.sex;
|
||||
formData.mobile = data.mobile;
|
||||
|
||||
formData.contract_type = data.contract?.contract_type;
|
||||
formData.party_b_name = data.contract?.party_b_name;
|
||||
formData.party_b = data.contract?.party_b;
|
||||
formData.file = data.contract?.file;
|
||||
data.contract
|
||||
? (fileList.value[0] = {
|
||||
url: data.contract?.file,
|
||||
name: data.contract ?? "合同文件",
|
||||
})
|
||||
: "";
|
||||
await getCityList();
|
||||
await getAreaList();
|
||||
await getStreetList();
|
||||
};
|
||||
|
||||
const handleEdit = async (value: string, field: string) => {
|
||||
if (isEmpty(value)) return;
|
||||
await userEdit({
|
||||
id: route.query.id,
|
||||
field,
|
||||
value,
|
||||
});
|
||||
getDetails();
|
||||
};
|
||||
const fileList = ref<UploadUserFile[]>([]);
|
||||
// 图片上传成功返回的url
|
||||
const handleAvatarSuccessIdA: UploadProps["onSuccess"] = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
}
|
||||
formData.qualification.id_card = response.data.uri;
|
||||
};
|
||||
const handleAvatarSuccessAvatar: UploadProps["onSuccess"] = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
}
|
||||
formData.avatar = response.data.uri;
|
||||
};
|
||||
const handleAvatarSuccessIdB: UploadProps["onSuccess"] = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
}
|
||||
formData.qualification.id_card_b = response.data.uri;
|
||||
};
|
||||
const handleAvatarSuccessCarA: UploadProps["onSuccess"] = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
}
|
||||
formData.qualification.car_card = response.data.uri;
|
||||
};
|
||||
const handleAvatarSuccessCarB: UploadProps["onSuccess"] = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
}
|
||||
formData.qualification.car_card_b = response.data.uri;
|
||||
};
|
||||
const beforeAvatarUpload_two: UploadProps["beforeUpload"] = (rawFile) => {
|
||||
return true;
|
||||
};
|
||||
const handleAvatarSuccessBankA: UploadProps["onSuccess"] = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
}
|
||||
formData.qualification.bank_account = response.data.uri;
|
||||
};
|
||||
const handleAvatarSuccessBankB: UploadProps["onSuccess"] = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
}
|
||||
formData.qualification.bank_account_b = response.data.uri;
|
||||
};
|
||||
const handleAvatarSuccess_four: UploadProps["onSuccess"] = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
}
|
||||
formData.file = response.data.uri;
|
||||
upContact({ file: formData.file, id: route.query.mdoeid }).then((res) => [
|
||||
(mode.value = false),
|
||||
]);
|
||||
};
|
||||
const beforeAvatarUpload_three: UploadProps["beforeUpload"] = (rawFile) => {
|
||||
return true;
|
||||
};
|
||||
|
||||
//获取省份
|
||||
function province_change(value: string) {
|
||||
getCityList();
|
||||
}
|
||||
function city_change(value: string) {
|
||||
getAreaList();
|
||||
}
|
||||
function area_change(value: string) {
|
||||
getStreetList();
|
||||
}
|
||||
function street_change(value: string) {
|
||||
formData.street = value;
|
||||
}
|
||||
// const getProvinceList = async () => {
|
||||
// const data = await apiProvinceList({});
|
||||
// datas["provinceOptions"] = data;
|
||||
// };
|
||||
// const getCityList = async () => {
|
||||
// const data = await apiCityList({ city: formData.province });
|
||||
// datas["cityOptions"] = data;
|
||||
// };
|
||||
// const getAreaList = async () => {
|
||||
// const data = await apiAreaList({ area: formData.city });
|
||||
// datas["areaOptions"] = data;
|
||||
// };
|
||||
// const getStreetList = async () => {
|
||||
// const data = await apiStreetList({ street: formData.area });
|
||||
// datas["streetOptions"] = data;
|
||||
// };
|
||||
const handleAdjust = (value: string) => {
|
||||
adjustState.show = true;
|
||||
adjustState.value = value;
|
||||
};
|
||||
const handleConfirmAdjust = async (value: any) => {
|
||||
await adjustMoney({ user_id: route.query.id, ...value });
|
||||
adjustState.show = false;
|
||||
getDetails();
|
||||
};
|
||||
// 发起合同
|
||||
const initiateContactFn = () => {
|
||||
const { contract_type } = formData;
|
||||
// console.log(party_b, contract_type);
|
||||
initiateContact({ party_b: route.query.id, contract_type, type: 2 }).then(
|
||||
(res) => {
|
||||
feedback.msgSuccess("发起成功,等待平台风控部上传合同");
|
||||
}
|
||||
);
|
||||
};
|
||||
getDetails();
|
||||
// getProvinceList();
|
||||
console.log(formData);
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.headimg {
|
||||
margin-top: 24px;
|
||||
width: 6.2vw;
|
||||
height: 7.2vw;
|
||||
float: left;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.avatar-uploader-head .el-upload {
|
||||
width: 6.2vw;
|
||||
height: 7.2vw;
|
||||
background-color: #fff;
|
||||
border: 1px dashed var(--el-border-color);
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
transition: var(--el-transition-duration-fast);
|
||||
}
|
||||
|
||||
.avatar-uploader .el-upload {
|
||||
width: 9.9vw;
|
||||
height: 6.3vw;
|
||||
background-color: #fff;
|
||||
border: 1px dashed var(--el-border-color);
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
transition: var(--el-transition-duration-fast);
|
||||
}
|
||||
|
||||
.avatar-uploader .el-upload:hover {
|
||||
border-color: var(--el-color-primary);
|
||||
}
|
||||
|
||||
.el-icon.avatar-uploader-icon {
|
||||
font-size: 28px;
|
||||
color: #8c939d;
|
||||
width: 178px;
|
||||
height: 178px;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,113 @@
|
|||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup
|
||||
ref="popupRef"
|
||||
:title="popupTitle"
|
||||
:async="true"
|
||||
width="550px"
|
||||
@confirm="handleSubmit"
|
||||
@close="handleClose"
|
||||
>
|
||||
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
|
||||
<el-form-item label="公司" prop="company_id">
|
||||
<el-input v-model="formData.company_id" clearable placeholder="请输入公司" />
|
||||
</el-form-item>
|
||||
<el-form-item label="内容" prop="content">
|
||||
<el-input v-model="formData.content" clearable placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="companyComplaintFeedbackEdit">
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiCompanyComplaintFeedbackAdd, apiCompanyComplaintFeedbackEdit, apiCompanyComplaintFeedbackDetail } from '@/api/company_complaint_feedback'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import type { PropType } from 'vue'
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑投诉反馈' : '新增投诉反馈'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
company_id: '',
|
||||
content: '',
|
||||
})
|
||||
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
content: [{
|
||||
required: true,
|
||||
message: '请输入内容',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
})
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiCompanyComplaintFeedbackDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiCompanyComplaintFeedbackEdit(data)
|
||||
: await apiCompanyComplaintFeedbackAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
|
@ -0,0 +1,161 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="公司" prop="company_id">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.company_id"
|
||||
clearable
|
||||
placeholder="请输入公司"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="内容" prop="content">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.content"
|
||||
clearable
|
||||
placeholder="请输入内容"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<el-button
|
||||
v-perms="['company_complaint_feedback/add']"
|
||||
type="primary"
|
||||
@click="handleAdd"
|
||||
>
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['company_complaint_feedback/delete']"
|
||||
:disabled="!selectData.length"
|
||||
@click="handleDelete(selectData)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column
|
||||
label="id"
|
||||
prop="id"
|
||||
width="120"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="公司"
|
||||
prop="company_name"
|
||||
width="220"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column label="内容" prop="content" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
v-perms="['company_complaint_feedback/edit']"
|
||||
type="primary"
|
||||
link
|
||||
@click="handleEdit(row)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['company_complaint_feedback/delete']"
|
||||
type="danger"
|
||||
link
|
||||
@click="handleDelete(row.id)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<edit-popup
|
||||
v-if="showEdit"
|
||||
ref="editRef"
|
||||
:dict-data="dictData"
|
||||
@success="getLists"
|
||||
@close="showEdit = false"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="companyComplaintFeedbackLists">
|
||||
import { usePaging } from "@/hooks/usePaging";
|
||||
import { useDictData } from "@/hooks/useDictOptions";
|
||||
import {
|
||||
apiCompanyComplaintFeedbackLists,
|
||||
apiCompanyComplaintFeedbackDelete,
|
||||
} from "@/api/company_complaint_feedback";
|
||||
import { timeFormat } from "@/utils/util";
|
||||
import feedback from "@/utils/feedback";
|
||||
import EditPopup from "./edit.vue";
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>();
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false);
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
company_id: "",
|
||||
content: "",
|
||||
});
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([]);
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id);
|
||||
};
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData("");
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiCompanyComplaintFeedbackLists,
|
||||
params: queryParams,
|
||||
});
|
||||
|
||||
// 添加
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true;
|
||||
await nextTick();
|
||||
editRef.value?.open("add");
|
||||
};
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (data: any) => {
|
||||
showEdit.value = true;
|
||||
await nextTick();
|
||||
editRef.value?.open("edit");
|
||||
editRef.value?.setFormData(data);
|
||||
};
|
||||
|
||||
// 删除
|
||||
const handleDelete = async (id: number | any[]) => {
|
||||
await feedback.confirm("确定要删除?");
|
||||
await apiCompanyComplaintFeedbackDelete({ id });
|
||||
getLists();
|
||||
};
|
||||
|
||||
getLists();
|
||||
</script>
|
||||
|
|
@ -0,0 +1,170 @@
|
|||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup
|
||||
ref="popupRef"
|
||||
:title="popupTitle"
|
||||
:async="true"
|
||||
width="550px"
|
||||
@confirm="handleSubmit"
|
||||
@close="handleClose"
|
||||
>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
label-width="90px"
|
||||
:rules="formRules"
|
||||
>
|
||||
<el-form-item label="商户名称" prop="company_name">
|
||||
<el-input
|
||||
v-model="formData.company_name"
|
||||
clearable
|
||||
placeholder="请输入商户名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="社会信用统一代码" prop="organization_code">
|
||||
<el-input
|
||||
v-model="formData.organization_code"
|
||||
clearable
|
||||
placeholder="请输入社会信用统一代码"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="详细地址" prop="address">
|
||||
<el-input
|
||||
v-model="formData.address"
|
||||
clearable
|
||||
placeholder="请输入详细地址"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="法人名称" prop="master_name">
|
||||
<el-input
|
||||
v-model="formData.master_name"
|
||||
clearable
|
||||
placeholder="请输入法人名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="" prop="type">
|
||||
<el-input v-model="formData.type" clearable placeholder="请输入" />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="法人邮箱" prop="master_email">
|
||||
<el-input
|
||||
v-model="formData.master_email"
|
||||
clearable
|
||||
placeholder="请输入法人邮箱"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="notes">
|
||||
<el-input v-model="formData.notes" clearable placeholder="请输入" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="companyFormEdit">
|
||||
import type { FormInstance } from "element-plus";
|
||||
import Popup from "@/components/popup/index.vue";
|
||||
import {
|
||||
apiCompanyFormAdd,
|
||||
apiCompanyFormEdit,
|
||||
apiCompanyFormDetail,
|
||||
} from "@/api/company_form";
|
||||
import { timeFormat } from "@/utils/util";
|
||||
import type { PropType } from "vue";
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({}),
|
||||
},
|
||||
});
|
||||
const emit = defineEmits(["success", "close"]);
|
||||
const formRef = shallowRef<FormInstance>();
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>();
|
||||
const mode = ref("add");
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == "edit" ? "编辑公司认证表格" : "新增公司认证表格";
|
||||
});
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: "",
|
||||
company_name: "",
|
||||
organization_code: "",
|
||||
address: "",
|
||||
master_name: "",
|
||||
type: "",
|
||||
master_email: "",
|
||||
notes: "",
|
||||
});
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
company_name: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入商户名称",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
organization_code: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入社会信用统一代码",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
master_name: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入法人名称",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiCompanyFormDetail({
|
||||
id: row.id,
|
||||
});
|
||||
setFormData(data);
|
||||
};
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate();
|
||||
const data = { ...formData };
|
||||
mode.value == "edit"
|
||||
? await apiCompanyFormEdit(data)
|
||||
: await apiCompanyFormAdd(data);
|
||||
popupRef.value?.close();
|
||||
emit("success");
|
||||
};
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = "add") => {
|
||||
mode.value = type;
|
||||
popupRef.value?.open();
|
||||
};
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit("close");
|
||||
};
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail,
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,200 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="商户名称" prop="merchant_name">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.merchant_name"
|
||||
clearable
|
||||
placeholder="请输入商户名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="社会代码" prop="organization_code">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.organization_code"
|
||||
clearable
|
||||
placeholder="请输入社会代码"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="详细地址" prop="address">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.address"
|
||||
clearable
|
||||
placeholder="请输入详细地址"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="法人名称" prop="master_name">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.master_name"
|
||||
clearable
|
||||
placeholder="请输入法人名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="法人邮箱" prop="master_email">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.master_email"
|
||||
clearable
|
||||
placeholder="请输入法人邮箱"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<!-- <el-button v-perms="['company_form/add']" type="primary" @click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['company_form/delete']"
|
||||
:disabled="!selectData.length"
|
||||
@click="handleDelete(selectData)"
|
||||
>
|
||||
删除
|
||||
</el-button> -->
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column
|
||||
label="ID"
|
||||
prop="id"
|
||||
width="150px"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="商户名称"
|
||||
width="330px"
|
||||
prop="company_name"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="社会代码"
|
||||
prop="organization_code"
|
||||
width="250px"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="详细地址"
|
||||
width="350px"
|
||||
prop="address"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="法人名称"
|
||||
width="120px"
|
||||
prop="master_name"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<!-- <el-table-column
|
||||
label="法人邮箱"
|
||||
prop="master_email"
|
||||
show-overflow-tooltip
|
||||
/> -->
|
||||
<el-table-column label="备注" prop="notes" show-overflow-tooltip />
|
||||
|
||||
<!-- <el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" link>
|
||||
<router-link
|
||||
:to="{
|
||||
path: '',
|
||||
query: {
|
||||
id: row.id,
|
||||
},
|
||||
}"
|
||||
>详情</router-link
|
||||
>
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<edit-popup
|
||||
v-if="showEdit"
|
||||
ref="editRef"
|
||||
:dict-data="dictData"
|
||||
@success="getLists"
|
||||
@close="showEdit = false"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="companyFormLists">
|
||||
import { usePaging } from "@/hooks/usePaging";
|
||||
import { useDictData } from "@/hooks/useDictOptions";
|
||||
import { apiCompanyFormLists, apiCompanyFormDelete } from "@/api/company_form";
|
||||
import { timeFormat } from "@/utils/util";
|
||||
import feedback from "@/utils/feedback";
|
||||
import EditPopup from "./edit.vue";
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>();
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false);
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
merchant_name: "",
|
||||
organization_code: "",
|
||||
address: "",
|
||||
master_name: "",
|
||||
type: "",
|
||||
master_email: "",
|
||||
notes: "",
|
||||
});
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([]);
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id);
|
||||
};
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData("");
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiCompanyFormLists,
|
||||
params: queryParams,
|
||||
});
|
||||
|
||||
// 添加
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true;
|
||||
await nextTick();
|
||||
editRef.value?.open("add");
|
||||
};
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (data: any) => {
|
||||
showEdit.value = true;
|
||||
await nextTick();
|
||||
editRef.value?.open("edit");
|
||||
editRef.value?.setFormData(data);
|
||||
};
|
||||
|
||||
// 删除
|
||||
const handleDelete = async (id: number | any[]) => {
|
||||
await feedback.confirm("确定要删除?");
|
||||
await apiCompanyFormDelete({ id });
|
||||
getLists();
|
||||
};
|
||||
|
||||
getLists();
|
||||
</script>
|
||||
|
|
@ -0,0 +1,204 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none" shadow="never">
|
||||
<el-page-header content="用户详情" @back="$router.back()" />
|
||||
</el-card>
|
||||
<el-card class="mt-4 !border-none" header="基本资料" shadow="never">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
class="ls-form"
|
||||
:model="formData"
|
||||
label-width="120px"
|
||||
>
|
||||
<div class="bg-page flex py-5 mb-10 items-center">
|
||||
<div class="basis-40 flex flex-col justify-center items-center">
|
||||
<div class="mb-2 text-tx-regular">用户头像</div>
|
||||
<el-avatar :src="formData.avatar" :size="58" />
|
||||
</div>
|
||||
<div class="basis-40 flex flex-col justify-center items-center">
|
||||
<div class="text-tx-regular">账户余额</div>
|
||||
<div class="mt-2 flex items-center">
|
||||
¥{{ formData.user_money }}
|
||||
<el-button
|
||||
v-perms="['user.user/adjustMoney']"
|
||||
type="primary"
|
||||
link
|
||||
@click="handleAdjust(formData.user_money)"
|
||||
>
|
||||
调整
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-col :span="24" class="el-card pt-6">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="用户编号:">
|
||||
{{ formData.sn }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="用户昵称:">
|
||||
{{ formData.nickname }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="账号:">
|
||||
{{ formData.account }}
|
||||
<popover-input
|
||||
class="ml-[10px]"
|
||||
@confirm="handleEdit($event, 'account')"
|
||||
:limit="32"
|
||||
v-perms="['user.user/edit']"
|
||||
>
|
||||
<el-button type="primary" link>
|
||||
<icon name="el-icon-EditPen" />
|
||||
</el-button>
|
||||
</popover-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="真实姓名:">
|
||||
{{ formData.real_name || "-" }}
|
||||
<popover-input
|
||||
class="ml-[10px]"
|
||||
@confirm="handleEdit($event, 'real_name')"
|
||||
:limit="32"
|
||||
v-perms="['user.user/edit']"
|
||||
>
|
||||
<el-button type="primary" link>
|
||||
<icon name="el-icon-EditPen" />
|
||||
</el-button>
|
||||
</popover-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="性别:">
|
||||
{{ formData.sex }}
|
||||
<popover-input
|
||||
class="ml-[10px]"
|
||||
type="select"
|
||||
:options="[
|
||||
{
|
||||
label: '未知',
|
||||
value: 0,
|
||||
},
|
||||
{
|
||||
label: '男',
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
label: '女',
|
||||
value: 2,
|
||||
},
|
||||
]"
|
||||
@confirm="handleEdit($event, 'sex')"
|
||||
v-perms="['user.user/edit']"
|
||||
>
|
||||
<el-button type="primary" link>
|
||||
<icon name="el-icon-EditPen" />
|
||||
</el-button>
|
||||
</popover-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系电话:">
|
||||
{{ formData.mobile || "-" }}
|
||||
<popover-input
|
||||
class="ml-[10px]"
|
||||
type="number"
|
||||
@confirm="handleEdit($event, 'mobile')"
|
||||
v-perms="['user.user/edit']"
|
||||
>
|
||||
<el-button type="primary" link>
|
||||
<icon name="el-icon-EditPen" />
|
||||
</el-button>
|
||||
</popover-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="注册来源:">
|
||||
{{ formData.channel }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="注册时间:">
|
||||
{{ formData.create_time }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="最近登录时间:">
|
||||
{{ formData.login_time }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<account-adjust
|
||||
v-model:show="adjustState.show"
|
||||
:value="adjustState.value"
|
||||
@confirm="handleConfirmAdjust"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="consumerDetail">
|
||||
import type { FormInstance } from "element-plus";
|
||||
import { adjustMoney, getUserDetail, userEdit } from "@/api/consumer";
|
||||
import { isEmpty } from "@/utils/util";
|
||||
import AccountAdjust from "../components/account-adjust.vue";
|
||||
const route = useRoute();
|
||||
const formData = reactive({
|
||||
avatar: "",
|
||||
channel: "",
|
||||
create_time: "",
|
||||
login_time: "",
|
||||
mobile: "",
|
||||
nickname: "",
|
||||
real_name: 0,
|
||||
sex: 0,
|
||||
sn: "",
|
||||
account: "",
|
||||
user_money: "",
|
||||
});
|
||||
|
||||
const adjustState = reactive({
|
||||
show: false,
|
||||
value: "",
|
||||
});
|
||||
const formRef = shallowRef<FormInstance>();
|
||||
|
||||
const getDetails = async () => {
|
||||
const data = await getUserDetail({
|
||||
id: route.query.id,
|
||||
});
|
||||
Object.keys(formData).forEach((key) => {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key];
|
||||
key == "sex" ? (formData[key] = Number(data[key])) : "";
|
||||
});
|
||||
};
|
||||
|
||||
const handleEdit = async (value: string, field: string) => {
|
||||
if (isEmpty(value)) return;
|
||||
await userEdit({
|
||||
id: route.query.id,
|
||||
field,
|
||||
value,
|
||||
});
|
||||
getDetails();
|
||||
};
|
||||
|
||||
const handleAdjust = (value: string) => {
|
||||
adjustState.show = true;
|
||||
adjustState.value = value;
|
||||
};
|
||||
const handleConfirmAdjust = async (value: any) => {
|
||||
await adjustMoney({ user_id: route.query.id, ...value });
|
||||
adjustState.show = false;
|
||||
getDetails();
|
||||
};
|
||||
getDetails();
|
||||
</script>
|
|
@ -3,166 +3,584 @@
|
|||
<el-card class="!border-none" shadow="never">
|
||||
<el-page-header content="用户详情" @back="$router.back()" />
|
||||
</el-card>
|
||||
<el-card class="mt-4 !border-none" header="基本资料" shadow="never">
|
||||
<el-form ref="formRef" class="ls-form" :model="formData" label-width="120px">
|
||||
<div class="bg-page flex py-5 mb-10 items-center">
|
||||
<div class="basis-40 flex flex-col justify-center items-center">
|
||||
<div class="mb-2 text-tx-regular">用户头像</div>
|
||||
<el-avatar :src="formData.avatar" :size="58" />
|
||||
<el-card class="mt-4 !border-none" shadow="never">
|
||||
<el-form ref="formRef" :model="formData" label-width="84px">
|
||||
<div style="font-size: 1.2rem; margin: 10px 0">基本信息创建</div>
|
||||
<div class="headimg">
|
||||
<el-upload v-model="formData.avatar" class="avatar-uploader-head" :disabled="flag" :data="{ cid: 1 }" :headers="{ Token: userStore.token }" :action="base_url + '/upload/taskImage'" :show-file-list="false" :on-success="handleAvatarSuccessAvatar">
|
||||
<img v-if="formData.avatar" :src="formData.avatar" class="avatar" />
|
||||
<el-icon v-else class="avatar-uploader-icon">
|
||||
<Plus />
|
||||
</el-icon>
|
||||
</el-upload>
|
||||
</div>
|
||||
<div class="basis-40 flex flex-col justify-center items-center">
|
||||
<div class="text-tx-regular">账户余额</div>
|
||||
<div class="mt-2 flex items-center">
|
||||
¥{{ formData.user_money }}
|
||||
<el-button
|
||||
v-perms="['user.user/adjustMoney']"
|
||||
type="primary"
|
||||
link
|
||||
@click="handleAdjust(formData.user_money)"
|
||||
>
|
||||
调整
|
||||
</el-button>
|
||||
<el-col class="pt-6 !border-none">
|
||||
<el-row>
|
||||
<el-col :span="11">
|
||||
<el-form-item label="姓名" prop="nickname">
|
||||
<el-input v-model="formData.nickname" :disabled="flag" placeholder="请输入姓名" clearable :style="{ width: '100%' }"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="13">
|
||||
<el-form-item label="性别" prop="gender">
|
||||
<el-select v-model="formData.gender" :disabled="flag" placeholder="请选择性别" :style="{ width: '100%' }">
|
||||
<el-option label="男" :value="0" />
|
||||
<el-option label="女" :value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<!-- <el-col :span="11">
|
||||
<el-form-item label="身份证号" prop="id_card">
|
||||
<el-input v-model="formData.id_card" :disabled="flag" placeholder="请输入身份证号" clearable :style="{ width: '100%' }"></el-input>
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-col :span="13">
|
||||
|
||||
<el-form-item label="联系电话" prop="phone">
|
||||
<el-input v-model="formData.phone" placeholder="请输入联系电话" :disabled="flag" clearable :style="{ width: '100%' }"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- <el-row>
|
||||
<el-form-item label="省" prop="province" style="flex: 1">
|
||||
<el-select v-model="formData.province" placeholder="请选择省" :disabled="flag" clearable @change="province_change" :style="{ width: '100%' }">
|
||||
<el-option v-for="(item, index) in datas.provinceOptions" :key="index" :label="item.province_name" :value="item.province_code"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="市" prop="city" style="flex: 1">
|
||||
<el-select v-model="formData.city" placeholder="请选择市" clearable :disabled="flag" @change="city_change" :style="{ width: '100%' }">
|
||||
<el-option v-for="(item, index) in datas.cityOptions" :key="index" :label="item.city_name" :value="item.city_code"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="区" prop="area" style="flex: 1">
|
||||
<el-select v-model="formData.area" placeholder="请选择区" :disabled="flag" clearable @change="area_change" :style="{ width: '100%' }">
|
||||
<el-option v-for="(item, index) in datas.areaOptions" :key="index" :label="item.area_name" :value="item.area_code"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="镇" prop="street" style="flex: 1">
|
||||
<el-select v-model="formData.street" placeholder="请选择镇" :disabled="flag" clearable @change="street_change" :style="{ width: '100%' }">
|
||||
<el-option v-for="(item, index) in datas.streetOptions" :key="index" :label="item.street_name" :value="item.street_code"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="村社小队" prop="address" style="flex: 1.5">
|
||||
<el-input v-model="formData.address" :disabled="flag" placeholder="请输入村社小队" clearable :style="{ width: '100%' }"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
</el-row> -->
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24" style="margin-top: 1vh">
|
||||
<!-- <el-row>
|
||||
<el-col :span="12" v-if="mode == 'initiate' || formData.party_b">
|
||||
<el-form-item label="签约方" prop="field130">
|
||||
<el-input
|
||||
v-model="formData.party_b_name"
|
||||
placeholder="请选择签约方"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
@click="isCompany = true"
|
||||
@clear="clearPartyA"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row> -->
|
||||
</el-col>
|
||||
<!-- <div style="font-size: 1.2rem; margin: 10px 0">资质信息</div>
|
||||
<div style="display: flex; justify-content: space-between">
|
||||
<div>
|
||||
<el-form-item label="身份证" prop="id_card">
|
||||
<el-upload v-model="formData.qualification.id_card" :disabled="flag" class="avatar-uploader pl-3" :data="{ cid: 1 }" :headers="{ Token: userStore.token }" :action="base_url + '/upload/taskImage'" :show-file-list="false" :on-success="handleAvatarSuccessIdA">
|
||||
<img v-if="formData.qualification.id_card" :src="formData.qualification.id_card" class="avatar" />
|
||||
<el-icon v-else class="avatar-uploader-icon">
|
||||
<Plus />
|
||||
</el-icon>
|
||||
</el-upload>
|
||||
<el-upload v-model="formData.qualification.id_card_b" :disabled="flag" class="avatar-uploader pl-3" :data="{ cid: 1 }" :headers="{ Token: userStore.token }" :action="base_url + '/upload/taskImage'" :show-file-list="false" :on-success="handleAvatarSuccessIdB">
|
||||
<img v-if="formData.qualification.id_card_b" :src="formData.qualification.id_card_b" class="avatar" />
|
||||
<el-icon v-else class="avatar-uploader-icon">
|
||||
<Plus />
|
||||
</el-icon>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div>
|
||||
<el-form-item label="银行卡" prop="bank_account">
|
||||
<el-upload v-model="formData.qualification.bank_account" :disabled="flag" class="avatar-uploader pl-3" :data="{ cid: 1 }" :headers="{ Token: userStore.token }" :action="base_url + '/upload/taskImage'" :show-file-list="false" :on-success="handleAvatarSuccessBankA" :before-upload="beforeAvatarUpload_three">
|
||||
<img v-if="formData.qualification.bank_account" :src="formData.qualification.bank_account" class="avatar" />
|
||||
<el-icon v-else class="avatar-uploader-icon">
|
||||
<Plus />
|
||||
</el-icon>
|
||||
</el-upload>
|
||||
<el-upload v-model="formData.qualification.bank_account_b" :disabled="flag" class="avatar-uploader pl-3" :data="{ cid: 1 }" :headers="{ Token: userStore.token }" :action="base_url + '/upload/taskImage'" :show-file-list="false" :on-success="handleAvatarSuccessBankB" :before-upload="beforeAvatarUpload_three">
|
||||
<img v-if="formData.qualification.bank_account_b" :src="formData.qualification.bank_account_b" class="avatar" />
|
||||
<el-icon v-else class="avatar-uploader-icon">
|
||||
<Plus />
|
||||
</el-icon>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</div>-->
|
||||
|
||||
<!-- <div>
|
||||
<el-form-item label="行驶证" prop="car_card">
|
||||
<el-upload
|
||||
v-model="formData.qualification.car_card"
|
||||
:disabled="flag"
|
||||
class="avatar-uploader pl-3"
|
||||
:data="{ cid: 1 }"
|
||||
:headers="{ Token: userStore.token }"
|
||||
:action="base_url + '/upload/taskImage'"
|
||||
:show-file-list="false"
|
||||
:on-success="handleAvatarSuccessCarA"
|
||||
>
|
||||
<img
|
||||
v-if="formData.qualification.car_card"
|
||||
:src="formData.qualification.car_card"
|
||||
class="avatar"
|
||||
/>
|
||||
<el-icon v-else class="avatar-uploader-icon">
|
||||
<Plus />
|
||||
</el-icon>
|
||||
</el-upload>
|
||||
<el-upload
|
||||
v-model="formData.qualification.car_card_b"
|
||||
:disabled="flag"
|
||||
class="avatar-uploader pl-3"
|
||||
:data="{ cid: 1 }"
|
||||
:headers="{ Token: userStore.token }"
|
||||
:action="base_url + '/upload/taskImage'"
|
||||
:show-file-list="false"
|
||||
:on-success="handleAvatarSuccessCarB"
|
||||
:before-upload="beforeAvatarUpload_two"
|
||||
>
|
||||
<img
|
||||
v-if="formData.qualification.car_card_b"
|
||||
:src="formData.qualification.car_card_b"
|
||||
class="avatar"
|
||||
/>
|
||||
<el-icon v-else class="avatar-uploader-icon">
|
||||
<Plus />
|
||||
</el-icon>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
<el-form-item label="用户编号:"> {{ formData.sn }} </el-form-item>
|
||||
<el-form-item label="用户昵称:">
|
||||
{{ formData.nickname }}
|
||||
|
||||
</div> -->
|
||||
<template v-if="disabledPartyA">
|
||||
<el-col :span="24">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="签约姓名" prop="name">
|
||||
<el-input v-model="formData.nickname" placeholder="请输入签约姓名" :disabled="true" clearable :style="{ width: '100%' }"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="账号:">
|
||||
{{ formData.account }}
|
||||
<popover-input
|
||||
class="ml-[10px]"
|
||||
@confirm="handleEdit($event, 'account')"
|
||||
:limit="32"
|
||||
v-perms="['user.user/edit']"
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="性别" prop="sex">
|
||||
<el-input placeholder="请输入性别" :disabled="true" clearable :style="{ width: '100%' }" :value="formData.gender== '0' ? '男' : '女'"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="身份证号" prop="id_card">
|
||||
<el-input v-model="formData.id_card" placeholder="请输入身份证号" :disabled="true" clearable :style="{ width: '100%' }"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系电话" prop="account">
|
||||
<el-input v-model="formData.account" placeholder="请输入联系电话" :disabled="true" clearable :style="{ width: '100%' }"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="formData.name">
|
||||
<el-form-item label="账号">
|
||||
<el-input v-model="formData.account" :disabled="true" clearable :style="{ width: '100%' }"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="formData.name">
|
||||
<el-form-item label="初始密码" prop="password">
|
||||
<el-input :model-value="'m' + formData.account" :disabled="true" clearable :style="{ width: '100%' }"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</template>
|
||||
<el-col :span="24" v-if="mode == 'uplode'">
|
||||
<el-form-item label="合同上传" prop="field127">
|
||||
<el-upload :headers="{ Token: userStore.token }" v-model:file-list="fileList" class="upload-demo" :action="base_url + '/upload/taskFile'" :on-success="handleAvatarSuccess_four" multiple :limit="1">
|
||||
<el-button type="primary">上传</el-button>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="24" v-if="formData.contract">
|
||||
<el-form-item label="合同地址">
|
||||
<el-link
|
||||
type="success"
|
||||
:href="formData.contract.file"
|
||||
target="_blank"
|
||||
>在线查看</el-link
|
||||
>
|
||||
<el-button type="primary" link>
|
||||
<icon name="el-icon-EditPen" />
|
||||
</el-button>
|
||||
</popover-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="真实姓名:">
|
||||
{{ formData.real_name || '-' }}
|
||||
<popover-input
|
||||
class="ml-[10px]"
|
||||
@confirm="handleEdit($event, 'real_name')"
|
||||
:limit="32"
|
||||
v-perms="['user.user/edit']"
|
||||
>
|
||||
<el-button type="primary" link>
|
||||
<icon name="el-icon-EditPen" />
|
||||
</el-button>
|
||||
</popover-input>
|
||||
</el-col> -->
|
||||
|
||||
<el-col :span="24" v-if="mode == 'initiate'" class="pt-6">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同类型" prop="contract_type">
|
||||
<el-col :span="24">
|
||||
<el-select v-model="formData.contract_type" placeholder="请选择合同类型" clearable :style="{ width: '100%' }">
|
||||
<el-option v-for="(item, index) in datas.contract_type" :key="index" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="性别:">
|
||||
{{ formData.sex }}
|
||||
<popover-input
|
||||
class="ml-[10px]"
|
||||
type="select"
|
||||
:options="[
|
||||
{
|
||||
label: '未知',
|
||||
value: 0
|
||||
},
|
||||
{
|
||||
label: '男',
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
label: '女',
|
||||
value: 2
|
||||
}
|
||||
]"
|
||||
@confirm="handleEdit($event, 'sex')"
|
||||
v-perms="['user.user/edit']"
|
||||
>
|
||||
<el-button type="primary" link>
|
||||
<icon name="el-icon-EditPen" />
|
||||
</el-button>
|
||||
</popover-input>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item prop="field139">
|
||||
<el-button type="primary" v-if="mode == 'initiate'" @click="initiateContactFn">发起合同</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="联系电话:">
|
||||
{{ formData.mobile || '-' }}
|
||||
<popover-input
|
||||
class="ml-[10px]"
|
||||
type="number"
|
||||
@confirm="handleEdit($event, 'mobile')"
|
||||
v-perms="['user.user/edit']"
|
||||
>
|
||||
<el-button type="primary" link>
|
||||
<icon name="el-icon-EditPen" />
|
||||
</el-button>
|
||||
</popover-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="注册来源:"> {{ formData.channel }} </el-form-item>
|
||||
<el-form-item label="注册时间:"> {{ formData.create_time }} </el-form-item>
|
||||
<el-form-item label="最近登录时间:"> {{ formData.login_time }} </el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<account-adjust
|
||||
v-model:show="adjustState.show"
|
||||
:value="adjustState.value"
|
||||
@confirm="handleConfirmAdjust"
|
||||
/>
|
||||
<account-adjust v-model:show="adjustState.show" :value="adjustState.value" @confirm="handleConfirmAdjust" />
|
||||
<!-- <el-dialog v-model="isCompany" title="选择签约方" width="60%">
|
||||
<DialogIndex @customEvent="customEvent" />
|
||||
</el-dialog> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="consumerDetail">
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import { adjustMoney, getUserDetail, userEdit } from '@/api/consumer'
|
||||
import { isEmpty } from '@/utils/util'
|
||||
import AccountAdjust from '../components/account-adjust.vue'
|
||||
const route = useRoute()
|
||||
import type {
|
||||
FormInstance,
|
||||
UploadProps,
|
||||
ElMessage,
|
||||
UploadUserFile,
|
||||
} from "element-plus";
|
||||
import {
|
||||
adjustMoney,
|
||||
getUserDetail,
|
||||
userEdit,
|
||||
creatContact,
|
||||
initiateContact,
|
||||
upContact,
|
||||
} from "@/api/consumer";
|
||||
import {
|
||||
apiCityList,
|
||||
apiAreaList,
|
||||
apiStreetList,
|
||||
apiProvinceList,
|
||||
} from "@/api/common";
|
||||
import { dictDataLists } from "@/api/setting/dict";
|
||||
import DialogIndex from "@/components/dialog_index.vue";
|
||||
import { isEmpty } from "@/utils/util";
|
||||
import AccountAdjust from "../components/account-adjust.vue";
|
||||
import useMultipleTabs from "@/hooks/useMultipleTabs";
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
import feedback from "@/utils/feedback";
|
||||
import { inject } from "vue";
|
||||
const base_url: any = inject("base_url");
|
||||
const { removeTab } = useMultipleTabs();
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const flag = ref(true);
|
||||
const formData = reactive({
|
||||
avatar: '',
|
||||
channel: '',
|
||||
create_time: '',
|
||||
login_time: '',
|
||||
mobile: '',
|
||||
nickname: '',
|
||||
real_name: 0,
|
||||
sex: 0,
|
||||
sn: '',
|
||||
account: '',
|
||||
user_money: ''
|
||||
})
|
||||
id: "",
|
||||
sex: "",
|
||||
id_card: "",
|
||||
nickname: "",
|
||||
province: "",
|
||||
city: "",
|
||||
area: "",
|
||||
street: "",
|
||||
address: "",
|
||||
account: "",
|
||||
is_contract: 0,
|
||||
// 签约方
|
||||
party_b_name: "",
|
||||
party_b: "",
|
||||
qualification: {
|
||||
id_card: "",
|
||||
id_card_b: "",
|
||||
car_card: "",
|
||||
car_card_b: "",
|
||||
bank_account: "",
|
||||
bank_account_b: "",
|
||||
},
|
||||
// 合同类型
|
||||
contract_type: "",
|
||||
file: "",
|
||||
avatar: "",
|
||||
multipoint_login: 1,
|
||||
contract: {
|
||||
url: "",
|
||||
},
|
||||
});
|
||||
const disabledPartyA = ref(false);
|
||||
|
||||
const adjustState = reactive({
|
||||
show: false,
|
||||
value: ''
|
||||
})
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
value: "",
|
||||
});
|
||||
// 字典信息
|
||||
const datas: any = reactive({
|
||||
provinceOptions: [],
|
||||
cityOptions: [],
|
||||
areaOptions: [],
|
||||
streetOptions: [],
|
||||
dictTypeLists: [],
|
||||
contract_type: [],
|
||||
contract: [],
|
||||
});
|
||||
|
||||
const formRef = shallowRef<FormInstance>();
|
||||
const isEdit = ref(false);
|
||||
|
||||
const isCompany = ref(false);
|
||||
const userStore = useUserStore();
|
||||
|
||||
function customEvent(data: any) {
|
||||
isCompany.value = false;
|
||||
formData.party_b = data.id;
|
||||
formData.party_b_name = data.company_name;
|
||||
disabledPartyA.value = true;
|
||||
}
|
||||
function clearPartyA() {
|
||||
formData.party_b = "";
|
||||
formData.party_b_name = "";
|
||||
}
|
||||
const getcontract_type = async () => {
|
||||
const data = await dictDataLists({ type_id: 7 });
|
||||
datas["contract_type"] = data["lists"];
|
||||
};
|
||||
const mode = ref(null);
|
||||
getcontract_type();
|
||||
const getDetails = async () => {
|
||||
const data = await getUserDetail({
|
||||
id: route.query.id
|
||||
})
|
||||
id: route.query.id,
|
||||
});
|
||||
console.log(data);
|
||||
|
||||
Object.keys(formData).forEach((key) => {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
formData[key] = data[key];
|
||||
});
|
||||
mode.value = route.query.mode;
|
||||
formData.gender = data.gender;
|
||||
formData.phone = data.phone;
|
||||
formData.gender = data.gender;
|
||||
|
||||
formData.contract_type = data.contract?.contract_type;
|
||||
formData.party_b_name = data.contract?.party_b_name;
|
||||
formData.party_b = data.contract?.party_b;
|
||||
formData.file = data.contract?.file;
|
||||
data.contract
|
||||
? (fileList.value[0] = {
|
||||
url: data.contract?.file,
|
||||
name: data.contract ?? "合同文件",
|
||||
})
|
||||
}
|
||||
: "";
|
||||
await getCityList();
|
||||
await getAreaList();
|
||||
await getStreetList();
|
||||
};
|
||||
|
||||
const handleEdit = async (value: string, field: string) => {
|
||||
if (isEmpty(value)) return
|
||||
if (isEmpty(value)) return;
|
||||
await userEdit({
|
||||
id: route.query.id,
|
||||
field,
|
||||
value
|
||||
})
|
||||
getDetails()
|
||||
value,
|
||||
});
|
||||
getDetails();
|
||||
};
|
||||
const fileList = ref<UploadUserFile[]>([]);
|
||||
// 图片上传成功返回的url
|
||||
const handleAvatarSuccessIdA: UploadProps["onSuccess"] = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
}
|
||||
formData.qualification.id_card = response.data.uri;
|
||||
};
|
||||
const handleAvatarSuccessAvatar: UploadProps["onSuccess"] = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
}
|
||||
formData.avatar = response.data.uri;
|
||||
};
|
||||
const handleAvatarSuccessIdB: UploadProps["onSuccess"] = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
}
|
||||
formData.qualification.id_card_b = response.data.uri;
|
||||
};
|
||||
const handleAvatarSuccessCarA: UploadProps["onSuccess"] = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
}
|
||||
formData.qualification.car_card = response.data.uri;
|
||||
};
|
||||
const handleAvatarSuccessCarB: UploadProps["onSuccess"] = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
}
|
||||
formData.qualification.car_card_b = response.data.uri;
|
||||
};
|
||||
const beforeAvatarUpload_two: UploadProps["beforeUpload"] = (rawFile) => {
|
||||
return true;
|
||||
};
|
||||
const handleAvatarSuccessBankA: UploadProps["onSuccess"] = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
}
|
||||
formData.qualification.bank_account = response.data.uri;
|
||||
};
|
||||
const handleAvatarSuccessBankB: UploadProps["onSuccess"] = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
}
|
||||
formData.qualification.bank_account_b = response.data.uri;
|
||||
};
|
||||
const handleAvatarSuccess_four: UploadProps["onSuccess"] = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
}
|
||||
formData.file = response.data.uri;
|
||||
upContact({ file: formData.file, id: route.query.mdoeid }).then((res) => [
|
||||
(mode.value = false),
|
||||
]);
|
||||
};
|
||||
const beforeAvatarUpload_three: UploadProps["beforeUpload"] = (rawFile) => {
|
||||
return true;
|
||||
};
|
||||
|
||||
//获取省份
|
||||
function province_change(value: string) {
|
||||
getCityList();
|
||||
}
|
||||
function city_change(value: string) {
|
||||
getAreaList();
|
||||
}
|
||||
function area_change(value: string) {
|
||||
getStreetList();
|
||||
}
|
||||
function street_change(value: string) {
|
||||
formData.street = value;
|
||||
}
|
||||
// const getProvinceList = async () => {
|
||||
// const data = await apiProvinceList({});
|
||||
// datas["provinceOptions"] = data;
|
||||
// };
|
||||
// const getCityList = async () => {
|
||||
// const data = await apiCityList({ city: formData.province });
|
||||
// datas["cityOptions"] = data;
|
||||
// };
|
||||
// const getAreaList = async () => {
|
||||
// const data = await apiAreaList({ area: formData.city });
|
||||
// datas["areaOptions"] = data;
|
||||
// };
|
||||
// const getStreetList = async () => {
|
||||
// const data = await apiStreetList({ street: formData.area });
|
||||
// datas["streetOptions"] = data;
|
||||
// };
|
||||
const handleAdjust = (value: string) => {
|
||||
adjustState.show = true;
|
||||
adjustState.value = value;
|
||||
};
|
||||
const handleConfirmAdjust = async (value: any) => {
|
||||
await adjustMoney({ user_id: route.query.id, ...value });
|
||||
adjustState.show = false;
|
||||
getDetails();
|
||||
};
|
||||
// 发起合同
|
||||
const initiateContactFn = () => {
|
||||
const { contract_type } = formData;
|
||||
// console.log(party_b, contract_type);
|
||||
initiateContact({ party_b: route.query.id, contract_type, type: 2 }).then(
|
||||
(res) => {
|
||||
feedback.msgSuccess("发起成功,等待平台风控部上传合同");
|
||||
}
|
||||
);
|
||||
};
|
||||
getDetails();
|
||||
// getProvinceList();
|
||||
console.log(formData);
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.headimg {
|
||||
margin-top: 24px;
|
||||
width: 6.2vw;
|
||||
height: 7.2vw;
|
||||
float: left;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
const handleAdjust = (value: string) => {
|
||||
adjustState.show = true
|
||||
adjustState.value = value
|
||||
.avatar-uploader-head .el-upload {
|
||||
width: 6.2vw;
|
||||
height: 7.2vw;
|
||||
background-color: #fff;
|
||||
border: 1px dashed var(--el-border-color);
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
transition: var(--el-transition-duration-fast);
|
||||
}
|
||||
const handleConfirmAdjust = async (value: any) => {
|
||||
await adjustMoney({ user_id: route.query.id, ...value })
|
||||
adjustState.show = false
|
||||
getDetails()
|
||||
|
||||
.avatar-uploader .el-upload {
|
||||
width: 9.9vw;
|
||||
height: 6.3vw;
|
||||
background-color: #fff;
|
||||
border: 1px dashed var(--el-border-color);
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
transition: var(--el-transition-duration-fast);
|
||||
}
|
||||
getDetails()
|
||||
</script>
|
||||
|
||||
.avatar-uploader .el-upload:hover {
|
||||
border-color: var(--el-color-primary);
|
||||
}
|
||||
|
||||
.el-icon.avatar-uploader-icon {
|
||||
font-size: 28px;
|
||||
color: #8c939d;
|
||||
width: 178px;
|
||||
height: 178px;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -0,0 +1,146 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="公司名称" prop="company_name">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.company_name"
|
||||
clearable
|
||||
placeholder="请输入公司名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="公司类型" prop="company_type">
|
||||
<el-select
|
||||
v-model="queryParams.company_type"
|
||||
placeholder="公司类型"
|
||||
clearable
|
||||
@change="changeType"
|
||||
:style="{ width: '100%' }"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in typeList"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
<!-- <el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.company_type"
|
||||
clearable
|
||||
placeholder="请输入公司类型"
|
||||
/> -->
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @cell-click="handleCurrentChange">
|
||||
<el-table-column label="公司名称" property="company_name" />
|
||||
<el-table-column label="公司类型" property="company_type">
|
||||
<template #default="{ row }">
|
||||
<span
|
||||
>{{typeList.find((item: any)=>item.id==row.company_type).name}}</span
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="区县" property="area_name" />
|
||||
<el-table-column label="乡镇" property="street_name" />
|
||||
<el-table-column label="主联系人" property="master_name" />
|
||||
<el-table-column label="联系方式" property="master_phone" />
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="companyLists">
|
||||
import { usePaging } from "@/hooks/usePaging";
|
||||
import { useDictData } from "@/hooks/useDictOptions";
|
||||
import {
|
||||
apiCompanyLists,
|
||||
companyListTwo,
|
||||
apiCompanyDelete,
|
||||
companyType,
|
||||
} from "@/api/company";
|
||||
import { dictDataLists } from "@/api/setting/dict";
|
||||
import { defineEmits } from "vue";
|
||||
|
||||
// 当前类型
|
||||
const props = defineProps({
|
||||
type: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
companyTypeList: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return [];
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
// 可选公司类型
|
||||
const typeList = ref([]);
|
||||
dictDataLists({
|
||||
type_id: 6,
|
||||
}).then((res) => {
|
||||
typeList.value = res.lists;
|
||||
});
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
level_two: "",
|
||||
level_one: "",
|
||||
company_name: "",
|
||||
organization_code: "",
|
||||
city: "",
|
||||
area: "",
|
||||
street: "",
|
||||
company_type: "",
|
||||
master_name: "",
|
||||
master_position: "",
|
||||
master_phone: "",
|
||||
master_email: "",
|
||||
other_contacts: "",
|
||||
area_manager: "",
|
||||
is_contract: "",
|
||||
account: "",
|
||||
password: "",
|
||||
deposit: "",
|
||||
deposit_time: "",
|
||||
qualification: "",
|
||||
status: "",
|
||||
});
|
||||
|
||||
if (props.type) queryParams.company_type = props.type;
|
||||
|
||||
// 选中数据
|
||||
const emits = defineEmits(["customEvent"]);
|
||||
|
||||
// 选中数据子父传递
|
||||
const handleCurrentChange = (value: any) => {
|
||||
emits("customEvent", value);
|
||||
};
|
||||
|
||||
// 选择公司类型
|
||||
const changeType = (e: any) => {
|
||||
getLists();
|
||||
};
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: companyListTwo,
|
||||
params: queryParams,
|
||||
});
|
||||
|
||||
getLists();
|
||||
</script>
|
|
@ -0,0 +1,665 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none" shadow="never">
|
||||
<el-page-header content="新增用户" @back="$router.back()" />
|
||||
</el-card>
|
||||
<el-card class="mt-4 !border-none" shadow="never">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="rules"
|
||||
label-width="84px"
|
||||
>
|
||||
<div style="font-size: 1.2rem; margin: 10px 0">基本信息创建</div>
|
||||
<div class="headimg">
|
||||
<el-upload
|
||||
v-model="formData.avatar"
|
||||
class="avatar-uploader-head"
|
||||
:data="{ cid: 1 }"
|
||||
:headers="{ Token: userStore.token }"
|
||||
:action="base_url + '/upload/taskImage'"
|
||||
:show-file-list="false"
|
||||
:on-success="handleAvatarSuccessAvatar"
|
||||
>
|
||||
<img v-if="formData.avatar" :src="formData.avatar" class="avatar" />
|
||||
<el-icon v-else class="avatar-uploader-icon">
|
||||
<Plus />
|
||||
</el-icon>
|
||||
</el-upload>
|
||||
</div>
|
||||
<el-col class="pt-6 !border-none">
|
||||
<el-row>
|
||||
<el-col :span="11">
|
||||
<el-form-item label="公司" prop="company_name">
|
||||
<el-input
|
||||
v-model="formData.company_name"
|
||||
placeholder="请选择公司"
|
||||
readonly
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
@click="showCompany = true"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="13">
|
||||
<el-form-item label="角色" prop="group_id">
|
||||
<el-select
|
||||
v-model="formData.group_id"
|
||||
placeholder="请选择角色"
|
||||
readonly
|
||||
:style="{ width: '100%' }"
|
||||
@change="formRef?.clearValidate(['group_id'])"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in roleList"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="11">
|
||||
<el-form-item label="姓名" prop="nickname">
|
||||
<el-input
|
||||
v-model="formData.nickname"
|
||||
placeholder="请输入姓名"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="13">
|
||||
<el-form-item label="性别" prop="sex">
|
||||
<el-select
|
||||
v-model="formData.sex"
|
||||
placeholder="请选择性别"
|
||||
:style="{ width: '100%' }"
|
||||
@change="formRef?.clearValidate(['sex'])"
|
||||
>
|
||||
<el-option label="男" :value="1" />
|
||||
<el-option label="女" :value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="11">
|
||||
<el-form-item label="身份证号" prop="id_card">
|
||||
<el-input
|
||||
v-model="formData.id_card"
|
||||
placeholder="请输入身份证号"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="13">
|
||||
<el-form-item label="联系电话" prop="account">
|
||||
<el-input
|
||||
v-model="formData.account"
|
||||
placeholder="请输入联系电话"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-form-item label="省" prop="province">
|
||||
<el-select
|
||||
v-model="formData.province_name"
|
||||
placeholder="请选择省"
|
||||
:disabled="flag"
|
||||
clearable
|
||||
@change="province_change"
|
||||
:style="{ width: '100%' }"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in datas.provinceOptions"
|
||||
:key="index"
|
||||
:label="item.province_name"
|
||||
:value="item.province_code"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="市" prop="city">
|
||||
<el-select
|
||||
v-model="formData.city_name"
|
||||
placeholder="请选择市"
|
||||
clearable
|
||||
:disabled="flag"
|
||||
@change="city_change"
|
||||
:style="{ width: '100%' }"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in datas.cityOptions"
|
||||
:key="index"
|
||||
:label="item.city_name"
|
||||
:value="item.city_code"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="区县" prop="area">
|
||||
<el-select
|
||||
v-model="formData.area_name"
|
||||
placeholder="请选择区县"
|
||||
:disabled="flag"
|
||||
clearable
|
||||
@change="area_change"
|
||||
:style="{ width: '100%' }"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in datas.areaOptions"
|
||||
:key="index"
|
||||
:label="item.area_name"
|
||||
:value="item.area_code"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item
|
||||
v-if="formData.street_name"
|
||||
label="乡镇"
|
||||
prop="street"
|
||||
>
|
||||
<el-select
|
||||
v-model="formData.street_name"
|
||||
placeholder="请选择乡镇"
|
||||
:disabled="flag"
|
||||
clearable
|
||||
@change="street_change"
|
||||
:style="{ width: '100%' }"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in datas.streetOptions"
|
||||
:key="index"
|
||||
:label="item.street_name"
|
||||
:value="item.street_code"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="formData.village_name"
|
||||
label="村社"
|
||||
prop="village"
|
||||
>
|
||||
<el-input
|
||||
v-model="formData.village_name"
|
||||
:disabled="flag"
|
||||
placeholder="请输入村社"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="formData.brigade_name"
|
||||
label="小队"
|
||||
prop="brigade"
|
||||
>
|
||||
<el-input
|
||||
v-model="formData.brigade_name"
|
||||
:disabled="flag"
|
||||
placeholder="请输入小队"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-col>
|
||||
|
||||
<div style="font-size: 1.2rem; margin: 10px 0">资质信息</div>
|
||||
<div style="display: flex; justify-content: space-between">
|
||||
<div>
|
||||
<el-form-item label="身份证" prop="qualification.id_card">
|
||||
<el-upload
|
||||
v-model="formData.qualification.id_card"
|
||||
class="avatar-uploader pl-3"
|
||||
:data="{ cid: 1 }"
|
||||
:headers="{ Token: userStore.token }"
|
||||
:action="base_url + '/upload/taskImage'"
|
||||
:show-file-list="false"
|
||||
:on-success="handleAvatarSuccessIdA"
|
||||
>
|
||||
<img
|
||||
v-if="formData.qualification.id_card"
|
||||
:src="formData.qualification.id_card"
|
||||
class="avatar"
|
||||
/>
|
||||
<el-icon v-else class="avatar-uploader-icon">
|
||||
<Plus />
|
||||
</el-icon>
|
||||
</el-upload>
|
||||
<el-upload
|
||||
v-model="formData.qualification.id_card_b"
|
||||
class="avatar-uploader pl-3"
|
||||
:data="{ cid: 1 }"
|
||||
:headers="{ Token: userStore.token }"
|
||||
:action="base_url + '/upload/taskImage'"
|
||||
:show-file-list="false"
|
||||
:on-success="handleAvatarSuccessIdB"
|
||||
>
|
||||
<img
|
||||
v-if="formData.qualification.id_card_b"
|
||||
:src="formData.qualification.id_card_b"
|
||||
class="avatar"
|
||||
/>
|
||||
<el-icon v-else class="avatar-uploader-icon">
|
||||
<Plus />
|
||||
</el-icon>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div>
|
||||
<el-form-item label="银行卡" prop="qualification.bank_account">
|
||||
<el-upload
|
||||
v-model="formData.qualification.bank_account"
|
||||
class="avatar-uploader pl-3"
|
||||
:data="{ cid: 1 }"
|
||||
:headers="{ Token: userStore.token }"
|
||||
:action="base_url + '/upload/taskImage'"
|
||||
:show-file-list="false"
|
||||
:on-success="handleAvatarSuccessBankA"
|
||||
:before-upload="beforeAvatarUpload_three"
|
||||
>
|
||||
<img
|
||||
v-if="formData.qualification.bank_account"
|
||||
:src="formData.qualification.bank_account"
|
||||
class="avatar"
|
||||
/>
|
||||
<el-icon v-else class="avatar-uploader-icon">
|
||||
<Plus />
|
||||
</el-icon>
|
||||
</el-upload>
|
||||
<el-upload
|
||||
v-model="formData.qualification.bank_account_b"
|
||||
class="avatar-uploader pl-3"
|
||||
:data="{ cid: 1 }"
|
||||
:headers="{ Token: userStore.token }"
|
||||
:action="base_url + '/upload/taskImage'"
|
||||
:show-file-list="false"
|
||||
:on-success="handleAvatarSuccessBankB"
|
||||
:before-upload="beforeAvatarUpload_three"
|
||||
>
|
||||
<img
|
||||
v-if="formData.qualification.bank_account_b"
|
||||
:src="formData.qualification.bank_account_b"
|
||||
class="avatar"
|
||||
/>
|
||||
<el-icon v-else class="avatar-uploader-icon">
|
||||
<Plus />
|
||||
</el-icon>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<el-form-item label="行驶证" prop="car_card">
|
||||
<el-upload
|
||||
v-model="formData.qualification.car_card"
|
||||
class="avatar-uploader pl-3"
|
||||
:data="{ cid: 1 }"
|
||||
:headers="{ Token: userStore.token }"
|
||||
:action="base_url + '/upload/taskImage'"
|
||||
:show-file-list="false"
|
||||
:on-success="handleAvatarSuccessCarA"
|
||||
>
|
||||
<img
|
||||
v-if="formData.qualification.car_card"
|
||||
:src="formData.qualification.car_card"
|
||||
class="avatar"
|
||||
/>
|
||||
<el-icon v-else class="avatar-uploader-icon">
|
||||
<Plus />
|
||||
</el-icon>
|
||||
</el-upload>
|
||||
<el-upload
|
||||
v-model="formData.qualification.car_card_b"
|
||||
class="avatar-uploader pl-3"
|
||||
:data="{ cid: 1 }"
|
||||
:headers="{ Token: userStore.token }"
|
||||
:action="base_url + '/upload/taskImage'"
|
||||
:show-file-list="false"
|
||||
:on-success="handleAvatarSuccessCarB"
|
||||
:before-upload="beforeAvatarUpload_two"
|
||||
>
|
||||
<img
|
||||
v-if="formData.qualification.car_card_b"
|
||||
:src="formData.qualification.car_card_b"
|
||||
class="avatar"
|
||||
/>
|
||||
<el-icon v-else class="avatar-uploader-icon">
|
||||
<Plus />
|
||||
</el-icon>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
<el-button type="primary" @click="submit">创建</el-button>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-dialog v-model="showCompany">
|
||||
<DialogIndex
|
||||
:companyTypeList="datas.dictTypeLists"
|
||||
:type="41"
|
||||
@customEvent="customEvent"
|
||||
></DialogIndex>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="consumerDetail">
|
||||
import {
|
||||
type FormInstance,
|
||||
type UploadProps,
|
||||
ElMessage,
|
||||
type UploadUserFile,
|
||||
} from "element-plus";
|
||||
import {
|
||||
upContact,
|
||||
userAdd,
|
||||
getRolelist,
|
||||
getCompanyList,
|
||||
} from "@/api/consumer";
|
||||
import {
|
||||
apiCityList,
|
||||
apiAreaList,
|
||||
apiStreetList,
|
||||
apiProvinceList,
|
||||
} from "@/api/common";
|
||||
import { dictDataLists } from "@/api/setting/dict";
|
||||
import { isEmpty } from "@/utils/util";
|
||||
import AccountAdjust from "../components/account-adjust.vue";
|
||||
import useMultipleTabs from "@/hooks/useMultipleTabs";
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
import feedback from "@/utils/feedback";
|
||||
import DialogIndex from "./dialog_index.vue";
|
||||
import { inject } from "vue";
|
||||
const base_url: any = inject("base_url");
|
||||
const { removeTab } = useMultipleTabs();
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const flag = ref(true);
|
||||
const formData = reactive({
|
||||
id: "",
|
||||
sex: "",
|
||||
id_card: "",
|
||||
nickname: "",
|
||||
group_id: "",
|
||||
company_id: "",
|
||||
company_name: "",
|
||||
province: "",
|
||||
city: "",
|
||||
area: "",
|
||||
street: "",
|
||||
village: "",
|
||||
brigade: "",
|
||||
province_name: "",
|
||||
city_name: "",
|
||||
area_name: "",
|
||||
street_name: "",
|
||||
village_name: "",
|
||||
brigade_name: "",
|
||||
address: "",
|
||||
account: "",
|
||||
qualification: {
|
||||
id_card: "",
|
||||
id_card_b: "",
|
||||
car_card: "",
|
||||
car_card_b: "",
|
||||
bank_account: "",
|
||||
bank_account_b: "",
|
||||
},
|
||||
avatar: "",
|
||||
multipoint_login: 1,
|
||||
});
|
||||
|
||||
const rules = ref({
|
||||
company_name: [{ required: true, message: "请选择公司", trigger: "blur" }],
|
||||
group_id: [{ required: true, message: "请选择角色", trigger: "blur" }],
|
||||
nickname: [{ required: true, message: "请输入姓名", trigger: "blur" }],
|
||||
sex: [{ required: true, message: "请选择性别", trigger: "blur" }],
|
||||
id_card: [{ required: true, message: "请输入身份证号", trigger: "blur" }],
|
||||
account: [{ required: true, message: "请输入联系电话", trigger: "blur" }],
|
||||
"qualification.bank_account": [
|
||||
{ required: true, message: "请上传银行卡", trigger: "blur" },
|
||||
],
|
||||
"qualification.id_card": [
|
||||
{ required: true, message: "请上传身份证", trigger: "blur" },
|
||||
],
|
||||
});
|
||||
|
||||
// 字典信息
|
||||
const datas: any = reactive({
|
||||
provinceOptions: [],
|
||||
cityOptions: [],
|
||||
areaOptions: [],
|
||||
streetOptions: [],
|
||||
dictTypeLists: [],
|
||||
contract_type: [],
|
||||
contract: [],
|
||||
});
|
||||
|
||||
const showCompany = ref(false);
|
||||
const customEvent = (e: any) => {
|
||||
formData.company_id = e.id;
|
||||
formData.company_name = e.company_name;
|
||||
formData.province = e.province;
|
||||
formData.city = e.city;
|
||||
formData.area = e.area;
|
||||
formData.street = e.street;
|
||||
formData.village = e.village;
|
||||
formData.brigade = e.brigade;
|
||||
formData.province_name = e.province_name;
|
||||
formData.city_name = e.city_name;
|
||||
formData.area_name = e.area_name;
|
||||
formData.street_name = e.street_name;
|
||||
formData.village_name = e.village_name;
|
||||
formData.brigade_name = e.brigade_name;
|
||||
formRef.value?.clearValidate(["company_name"]);
|
||||
showCompany.value = false;
|
||||
};
|
||||
|
||||
// 角色列表
|
||||
const roleList = ref([]);
|
||||
getRolelist({}).then((res: any) => {
|
||||
roleList.value = res;
|
||||
});
|
||||
|
||||
const formRef = shallowRef<FormInstance>();
|
||||
const isEdit = ref(false);
|
||||
|
||||
const userStore = useUserStore();
|
||||
|
||||
const fileList = ref<UploadUserFile[]>([]);
|
||||
// 图片上传成功返回的url
|
||||
const handleAvatarSuccessIdA: UploadProps["onSuccess"] = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
}
|
||||
formData.qualification.id_card = response.data.uri;
|
||||
};
|
||||
const handleAvatarSuccessAvatar: UploadProps["onSuccess"] = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
}
|
||||
formData.avatar = response.data.uri;
|
||||
};
|
||||
const handleAvatarSuccessIdB: UploadProps["onSuccess"] = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
}
|
||||
formData.qualification.id_card_b = response.data.uri;
|
||||
};
|
||||
const handleAvatarSuccessCarA: UploadProps["onSuccess"] = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
}
|
||||
formData.qualification.car_card = response.data.uri;
|
||||
};
|
||||
const handleAvatarSuccessCarB: UploadProps["onSuccess"] = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
}
|
||||
formData.qualification.car_card_b = response.data.uri;
|
||||
};
|
||||
const beforeAvatarUpload_two: UploadProps["beforeUpload"] = (rawFile) => {
|
||||
return true;
|
||||
};
|
||||
const handleAvatarSuccessBankA: UploadProps["onSuccess"] = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
}
|
||||
formData.qualification.bank_account = response.data.uri;
|
||||
};
|
||||
const handleAvatarSuccessBankB: UploadProps["onSuccess"] = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
}
|
||||
formData.qualification.bank_account_b = response.data.uri;
|
||||
};
|
||||
const handleAvatarSuccess_four: UploadProps["onSuccess"] = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
}
|
||||
formData.file = response.data.uri;
|
||||
upContact({ file: formData.file, id: route.query.mdoeid }).then((res) => [
|
||||
(mode.value = false),
|
||||
]);
|
||||
};
|
||||
const beforeAvatarUpload_three: UploadProps["beforeUpload"] = (rawFile) => {
|
||||
return true;
|
||||
};
|
||||
|
||||
//获取省份
|
||||
function province_change(value: string) {
|
||||
getCityList();
|
||||
}
|
||||
function city_change(value: string) {
|
||||
getAreaList();
|
||||
}
|
||||
function area_change(value: string) {
|
||||
getStreetList();
|
||||
}
|
||||
function street_change(value: string) {
|
||||
formData.street = value;
|
||||
}
|
||||
const getProvinceList = async () => {
|
||||
const data = await apiProvinceList({});
|
||||
datas["provinceOptions"] = data;
|
||||
};
|
||||
const getCityList = async () => {
|
||||
const data = await apiCityList({ city: formData.province });
|
||||
datas["cityOptions"] = data;
|
||||
};
|
||||
const getAreaList = async () => {
|
||||
const data = await apiAreaList({ area: formData.city });
|
||||
datas["areaOptions"] = data;
|
||||
};
|
||||
const getStreetList = async () => {
|
||||
const data = await apiStreetList({ street: formData.area });
|
||||
datas["streetOptions"] = data;
|
||||
};
|
||||
|
||||
getProvinceList();
|
||||
|
||||
// 创建用户
|
||||
const submit = () => {
|
||||
if (!formData.avatar) return ElMessage.error("请上传头像");
|
||||
formRef.value?.validate((e) => {
|
||||
if (e) {
|
||||
if (!formData.qualification.id_card || !formData.qualification.id_card_b)
|
||||
return ElMessage.error("请上传身份证信息");
|
||||
if (
|
||||
!formData.qualification.bank_account ||
|
||||
!formData.qualification.bank_account_b
|
||||
)
|
||||
return ElMessage.error("请上传银行卡信息");
|
||||
userAdd(formData).then(() => {
|
||||
ElMessage.success("添加成功");
|
||||
router.back();
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.headimg {
|
||||
margin-top: 24px;
|
||||
width: 115px;
|
||||
height: 138px;
|
||||
float: left;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.avatar-uploader-head .el-upload {
|
||||
width: 115px;
|
||||
height: 138px;
|
||||
background-color: #fff;
|
||||
border: 1px dashed var(--el-border-color);
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
transition: var(--el-transition-duration-fast);
|
||||
}
|
||||
|
||||
.avatar-uploader .el-upload {
|
||||
width: 9.9vw;
|
||||
height: 6.3vw;
|
||||
background-color: #fff;
|
||||
border: 1px dashed var(--el-border-color);
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
transition: var(--el-transition-duration-fast);
|
||||
}
|
||||
|
||||
.avatar-uploader .el-upload:hover {
|
||||
border-color: var(--el-color-primary);
|
||||
}
|
||||
|
||||
.el-icon.avatar-uploader-icon {
|
||||
font-size: 28px;
|
||||
color: #8c939d;
|
||||
width: 178px;
|
||||
height: 178px;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -2,73 +2,125 @@
|
|||
<div>
|
||||
<el-card class="!border-none" shadow="never">
|
||||
<el-form ref="formRef" class="mb-[-16px]" :model="queryParams" :inline="true">
|
||||
<el-form-item label="用户信息">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.keyword"
|
||||
placeholder="用户编号/昵称/手机号码"
|
||||
clearable
|
||||
@keyup.enter="resetPage"
|
||||
/>
|
||||
<el-form-item label="手机号码">
|
||||
<el-input class="w-[280px]" v-model="queryParams.phone" placeholder="用户手机号码" clearable @keyup.enter="resetPage" />
|
||||
</el-form-item>
|
||||
<el-form-item label="注册时间">
|
||||
<daterange-picker
|
||||
v-model:startTime="queryParams.create_time_start"
|
||||
v-model:endTime="queryParams.create_time_end"
|
||||
/>
|
||||
<el-form-item label="用户昵称">
|
||||
<el-input class="w-[280px]" v-model="queryParams.nickname" placeholder="用户昵称" clearable @keyup.enter="resetPage" />
|
||||
</el-form-item>
|
||||
<el-form-item label="注册来源">
|
||||
<el-select class="w-[280px]" v-model="queryParams.channel">
|
||||
<el-option
|
||||
v-for="(item, key) in ClientMap"
|
||||
:key="key"
|
||||
:label="item"
|
||||
:value="key"
|
||||
/>
|
||||
<el-form-item label="用户状态">
|
||||
<el-select v-model="queryParams.status" clearable placeholder="请选择状态">
|
||||
<el-option label="正常" :value="0"></el-option>
|
||||
<el-option label="冻结" :value="1"></el-option>
|
||||
<el-option label="删除" :value="2"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
<export-data
|
||||
class="ml-2.5"
|
||||
:fetch-fun="getUserList"
|
||||
:params="queryParams"
|
||||
:page-size="pager.size"
|
||||
/>
|
||||
<!-- <export-data class="ml-2.5" :fetch-fun="getUserList" :params="queryParams" :page-size="pager.size" /> -->
|
||||
<!-- <el-button v-perms="['user.user/edit']" class="ml-2.5" type="primary">
|
||||
<router-link :to="{
|
||||
path: getRoutePath('user.user/edit')
|
||||
}">
|
||||
创建
|
||||
</router-link>
|
||||
</el-button> -->
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</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="用户编号" prop="sn" min-width="120" />
|
||||
<!-- <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 }">
|
||||
<el-avatar :src="row.avatar" :size="50" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="昵称" prop="nickname" min-width="100" />
|
||||
<el-table-column label="账号" prop="account" min-width="120" />
|
||||
<el-table-column label="手机号码" prop="mobile" min-width="100" />
|
||||
<el-table-column label="注册来源" prop="channel" min-width="100" />
|
||||
<el-table-column label="注册时间" prop="create_time" min-width="120" />
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<el-table-column label="账号" prop="phone" min-width="120" />
|
||||
<el-table-column label="姓名" prop="nickname" min-width="100" />
|
||||
<el-table-column label="联系方式" prop="phone" min-width="120" />
|
||||
<!-- <el-table-column label="隶属公司" prop="company_name" min-width="180" align="center">
|
||||
<template #default="{ row }">
|
||||
{{ 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>
|
||||
<span v-else style="color: #fe0000">无</span>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<!-- <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-else style="color: #fe0000">未签约</span>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="操作" min-width="200" align="center" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button v-perms="['user.user/detail']" type="primary" link>
|
||||
<router-link
|
||||
:to="{
|
||||
<router-link :to="{
|
||||
path: getRoutePath('user.user/detail'),
|
||||
query: {
|
||||
id: row.id
|
||||
}
|
||||
}"
|
||||
>
|
||||
}">
|
||||
详情
|
||||
</router-link>
|
||||
</el-button>
|
||||
<template v-if="row.is_contract == 0">
|
||||
<el-button v-perms="['user.user/launch']" type="primary" link v-if="!row.contract">
|
||||
<router-link :to="{
|
||||
path: getRoutePath('user.user/detail'),
|
||||
query: {
|
||||
id: row.id,
|
||||
mode: 'initiate'
|
||||
}
|
||||
}">
|
||||
生成合同
|
||||
</router-link>
|
||||
</el-button>
|
||||
|
||||
<el-button v-perms="['user.user/uplode']" type="primary" link v-if="row.contract?.check_status == 1">
|
||||
<router-link :to="{
|
||||
path: getRoutePath('user.user/detail'),
|
||||
query: {
|
||||
id: row.id,
|
||||
mode: 'uplode',
|
||||
mdoeid: row.contract.id
|
||||
}
|
||||
}">
|
||||
上传合同
|
||||
</router-link>
|
||||
</el-button>
|
||||
<el-button v-perms="['user.user/launch']" type="primary" v-if="row.contract?.check_status == 2" link @click="
|
||||
;(showPop = true),
|
||||
(showConctactPop = true),
|
||||
(contractId = row.id)
|
||||
">发送合同</el-button>
|
||||
<el-button v-if="row.is_contract == 0 && row.contract?.check_status == 3" v-perms="['user.user/launch']" type="primary" link @click=";(showPop = true), (contractId = row.id)">重新发送短信</el-button>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<el-dialog v-model="showPop" @close="offPop">
|
||||
<h1>重要提醒</h1>
|
||||
<div class="content" v-if="showConctactPop">
|
||||
请确认信息是否有误,发送合同,请确认信息是否有误,发送电子合同后短时间内将不可再次发送.
|
||||
</div>
|
||||
<div class="content" v-else>
|
||||
确认签约短信将在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-else @click="sendMsg">确认</el-button>
|
||||
<el-button type="info" size="large" @click="offPop">返回</el-button>
|
||||
</p>
|
||||
</el-dialog>
|
||||
<div class="flex justify-end mt-4">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
|
@ -76,24 +128,86 @@
|
|||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup name="consumerLists">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { getRoutePath } from '@/router'
|
||||
import { getUserList } from '@/api/consumer'
|
||||
import { ClientMap } from '@/enums/appEnums'
|
||||
const queryParams = reactive({
|
||||
keyword: '',
|
||||
channel: '',
|
||||
create_time_start: '',
|
||||
create_time_end: ''
|
||||
})
|
||||
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({
|
||||
phone: "",
|
||||
nickname: "",
|
||||
status: "",
|
||||
});
|
||||
if (route.query.company_id) {
|
||||
queryParams.company_id = route.query.company_id;
|
||||
}
|
||||
const contractId = ref(0);
|
||||
const showPop = ref(false);
|
||||
const showConctactPop = ref(false);
|
||||
const offPop = () => {
|
||||
showPop.value = false;
|
||||
showConctactPop.value = false;
|
||||
};
|
||||
const creContct = () => {
|
||||
console.log(contractId.value);
|
||||
// feedback.msgSuccess("复制成功");
|
||||
creatContact({ id: contractId.value }).then(() => {
|
||||
feedback.msgSuccess("发送成功");
|
||||
});
|
||||
offPop();
|
||||
};
|
||||
const sendMsg = () => {
|
||||
sendMsgApi({ id: contractId.value }).then((res) => {
|
||||
feedback.msgSuccess("发送成功");
|
||||
});
|
||||
offPop();
|
||||
};
|
||||
// const handleDelete = async (id: number) => {
|
||||
// await feedback.confirm('确定要删除?')
|
||||
// await adminDelete({ id })
|
||||
// getLists()
|
||||
// }
|
||||
// const handleAbolition = async (id: number) => {
|
||||
// await feedback.confirm('确定要废除合同?')
|
||||
// await abolition({ id })
|
||||
// getLists()
|
||||
// }
|
||||
const { pager, getLists, resetPage, resetParams } = usePaging({
|
||||
fetchFun: getUserList,
|
||||
params: queryParams
|
||||
})
|
||||
params: queryParams,
|
||||
});
|
||||
onActivated(() => {
|
||||
getLists()
|
||||
})
|
||||
getLists();
|
||||
});
|
||||
|
||||
getLists()
|
||||
getLists();
|
||||
</script>
|
||||
<style scoped>
|
||||
h1 {
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
font-size: 30px;
|
||||
color: red;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.content {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.info {
|
||||
color: red;
|
||||
font-weight: bold;
|
||||
font-size: 18px;
|
||||
display: inline-block;
|
||||
margin: 0 5px;
|
||||
}
|
||||
|
||||
.btn_menu {
|
||||
margin-top: 10vh;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -0,0 +1,607 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px] formdata" :model="queryParams" inline>
|
||||
<el-form-item label="公司名称" prop="company_name">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.company_name"
|
||||
clearable
|
||||
placeholder="请输入公司名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="区" prop="area" v-show="company_type_show">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.area"
|
||||
clearable
|
||||
placeholder="请输入区"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="镇" prop="street" v-show="company_type_show">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.street"
|
||||
clearable
|
||||
placeholder="请输入镇"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="公司类型"
|
||||
prop="company_type"
|
||||
v-show="company_type_show"
|
||||
>
|
||||
<el-select
|
||||
v-model="queryParams.company_type"
|
||||
placeholder="请选择公司类型"
|
||||
clearable
|
||||
class="w-[280px]"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in datas.dictTypeLists"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="片区经理" prop="area_manager">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.area_manager"
|
||||
clearable
|
||||
placeholder="请输入片区经理"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否签约" prop="is_contract">
|
||||
<el-select
|
||||
v-model="queryParams.is_contract"
|
||||
placeholder="是否签约"
|
||||
clearable
|
||||
class="w-[240px]"
|
||||
>
|
||||
<el-option label="已签约" value="1"></el-option>
|
||||
<el-option label="未签约" value="0"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<router-link
|
||||
v-perms="['company/add:edit']"
|
||||
:to="{
|
||||
path: getRoutePath('company/add:edit'),
|
||||
query: {
|
||||
flag: true,
|
||||
},
|
||||
}"
|
||||
>
|
||||
<!-- <el-button type="primary" class="mb-4">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
创建
|
||||
</el-button> -->
|
||||
</router-link>
|
||||
<!-- <router-link
|
||||
:to="{
|
||||
path: getRoutePath('company/add:edit'),
|
||||
query: {
|
||||
id: userStore.userInfo.company_id,
|
||||
read: true,
|
||||
},
|
||||
}"
|
||||
>
|
||||
<el-button type="primary" class="mb-4">
|
||||
我的公司
|
||||
</el-button></router-link -->
|
||||
|
||||
<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"
|
||||
width="250px"
|
||||
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
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<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"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<div style="display: flex">
|
||||
<!-- <el-button type="primary" link>
|
||||
<router-link
|
||||
:to="{
|
||||
path: getRoutePath('user.user/lists'),
|
||||
query: {
|
||||
company_id: row.id,
|
||||
read: true,
|
||||
},
|
||||
}"
|
||||
>查看成员</router-link
|
||||
>
|
||||
</el-button> -->
|
||||
<el-button type="primary" link>
|
||||
<router-link
|
||||
:to="{
|
||||
path: getRoutePath('company/subordinate/lists'),
|
||||
query: {
|
||||
company_id: row.id,
|
||||
read: true,
|
||||
},
|
||||
}"
|
||||
>下属公司</router-link
|
||||
>
|
||||
</el-button>
|
||||
<el-button v-perms="['company/add:edit']" type="primary" link>
|
||||
<router-link
|
||||
:to="{
|
||||
path: getRoutePath('company/add:edit'),
|
||||
query: {
|
||||
id: row.id,
|
||||
read: true,
|
||||
isshow: true,
|
||||
},
|
||||
}"
|
||||
>详情</router-link
|
||||
>
|
||||
</el-button>
|
||||
<!-- <el-button v-perms="['company/add:edit']" type="primary" link>
|
||||
<router-link
|
||||
:to="{
|
||||
path: getRoutePath('company/add:edit'),
|
||||
query: {
|
||||
id: row.id,
|
||||
edit: true,
|
||||
},
|
||||
}"
|
||||
>编辑</router-link
|
||||
>
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['company/delete']"
|
||||
type="danger"
|
||||
link
|
||||
@click="handleDelete(row.id)"
|
||||
>删除</el-button
|
||||
> -->
|
||||
<el-button
|
||||
v-if="row.is_authentication == 0"
|
||||
v-perms="['company/authentication']"
|
||||
type="primary"
|
||||
link
|
||||
@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-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="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>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<el-dialog
|
||||
v-model="showInitiateContractPop"
|
||||
@close="offInitiateContractPop"
|
||||
>
|
||||
<h1>重要提醒</h1>
|
||||
<div>
|
||||
<div class="content">请确认信息是否有误</div>
|
||||
<el-card>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label-width="100px" label="甲方" prop="field130">
|
||||
<el-input
|
||||
v-model="contractFormData.party_a_name"
|
||||
placeholder="请选择甲方"
|
||||
@click="showCompany = true"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
></el-input>
|
||||
<!-- <el-select
|
||||
v-model="contractFormData.party_a"
|
||||
placeholder="请选择甲方"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in company_list"
|
||||
:key="index"
|
||||
:label="item.company_name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select> -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label-width="100px" label="乙方" prop="field131">
|
||||
<el-input
|
||||
:disabled="true"
|
||||
v-model="contractFormData.party_b_name"
|
||||
placeholder="请选择乙方"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label-width="100px"
|
||||
label="合同类型"
|
||||
prop="contract_type"
|
||||
>
|
||||
<el-select
|
||||
v-model="contractFormData.contract_type"
|
||||
placeholder="请选择合同类型"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in contract_type"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label-width="100px"
|
||||
label="合同编号"
|
||||
prop="field133"
|
||||
>
|
||||
<el-input
|
||||
placeholder="系统自动生成"
|
||||
v-model="contractFormData.contract_no"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
:disabled="true"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</div>
|
||||
<p class="btn_menu">
|
||||
<el-button type="primary" size="large" @click="InitiateContract"
|
||||
>确认</el-button
|
||||
>
|
||||
<el-button type="info" size="large" @click="offInitiateContractPop"
|
||||
>返回</el-button
|
||||
>
|
||||
</p>
|
||||
<el-dialog v-model="showCompany">
|
||||
<DialogIndex
|
||||
:companyTypeList="datas.dictTypeLists"
|
||||
:type="30"
|
||||
@customEvent="customEvent"
|
||||
></DialogIndex>
|
||||
</el-dialog>
|
||||
</el-dialog>
|
||||
<el-dialog v-model="showPop" @close="offPop">
|
||||
<h1>重要提醒</h1>
|
||||
<div class="content" v-if="showConctactPop">
|
||||
请确认信息是否有误,发送合同,请确认信息是否有误,发送电子合同后短时间内将不可再次发送.
|
||||
</div>
|
||||
<div class="content" v-else>
|
||||
确认签约短信将在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-else @click="sendMsg"
|
||||
>确认</el-button
|
||||
>
|
||||
<el-button type="info" size="large" @click="offPop">返回</el-button>
|
||||
</p>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="companyLists">
|
||||
import { usePaging } from "@/hooks/usePaging";
|
||||
import { useDictData } from "@/hooks/useDictOptions";
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
import {
|
||||
apiCompanyLists,
|
||||
companyListTwo,
|
||||
apiCompanyDelete,
|
||||
generateGontract,
|
||||
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 { dictContractTypeList } from "@/utils/dict.ts";
|
||||
import DialogIndex from "./dialog_index.vue";
|
||||
|
||||
const showCompany = ref(false);
|
||||
const customEvent = (e: any) => {
|
||||
contractFormData.value.party_a = e.id;
|
||||
contractFormData.value.party_a_name = e.company_name;
|
||||
showCompany.value = false;
|
||||
};
|
||||
|
||||
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 offPop = () => {
|
||||
showPop.value = false;
|
||||
showConctactPop.value = false;
|
||||
};
|
||||
const InitiateContractPop = ref(false);
|
||||
const showInitiateContractPop = ref(false);
|
||||
const offInitiateContractPop = () => {
|
||||
showInitiateContractPop.value = false;
|
||||
InitiateContractPop.value = false;
|
||||
};
|
||||
// 创建合同的id
|
||||
const contractId = ref("");
|
||||
|
||||
// 合同
|
||||
const contractFormData = ref({
|
||||
party_a: "",
|
||||
party_a_name: "",
|
||||
party_b: "",
|
||||
party_b_name: "",
|
||||
contract_type: "",
|
||||
contract_no: "",
|
||||
});
|
||||
|
||||
const company_list = ref([]);
|
||||
const contract_type = ref([]);
|
||||
|
||||
const getDetails = async (id: any) => {
|
||||
const data = await apiCompanyDetail({
|
||||
id: id,
|
||||
});
|
||||
companyListTwo().then((res) => {
|
||||
company_list.value = res;
|
||||
});
|
||||
dictDataLists({ type_id: 7 }).then((res) => {
|
||||
contract_type.value = res.lists.filter((item: any) => {
|
||||
return dictContractTypeList.find((t: String | Number) => t == item.id);
|
||||
});
|
||||
});
|
||||
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;
|
||||
} else {
|
||||
contractFormData.value.party_a = "";
|
||||
contractFormData.value.party_a_name = "";
|
||||
}
|
||||
};
|
||||
|
||||
const showChangeCompany = (row: any) => {
|
||||
contractId.value = row.id;
|
||||
getDetails(row.id);
|
||||
// showPop.value = true
|
||||
ShowInitiateContractPop();
|
||||
};
|
||||
|
||||
const ShowInitiateContractPop = () => {
|
||||
(InitiateContractPop.value = true), (showInitiateContractPop.value = true);
|
||||
};
|
||||
const showCreateConctPop = (row) => {
|
||||
(showPop.value = true),
|
||||
(showConctactPop.value = true),
|
||||
(contractId.value = row.id);
|
||||
};
|
||||
const InitiateContract = async () => {
|
||||
await initiate_contract({
|
||||
id: contractId.value,
|
||||
...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: "",
|
||||
// 是否签约
|
||||
is_contract: "",
|
||||
});
|
||||
|
||||
if (route.query.company_type) {
|
||||
company_type_show.value = false;
|
||||
queryParams["company_type"] = route.query.company_type?.toString() || "";
|
||||
}
|
||||
|
||||
const datas = reactive({
|
||||
dictTypeLists: [],
|
||||
});
|
||||
const getdictTypeLists = async () => {
|
||||
const data = await dictDataLists({ type_id: 6 });
|
||||
datas["dictTypeLists"] = data["lists"];
|
||||
};
|
||||
getdictTypeLists();
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([]);
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id);
|
||||
};
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData("");
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiCompanyLists,
|
||||
params: queryParams,
|
||||
});
|
||||
|
||||
// 删除
|
||||
const handleDelete = async (id: number | any[]) => {
|
||||
await feedback.confirm("确定要删除?");
|
||||
await apiCompanyDelete({ id });
|
||||
getLists();
|
||||
};
|
||||
const handleAuthentication = async (id: number | any[]) => {
|
||||
await feedback.confirm("确定要认证?");
|
||||
await authentication({ id });
|
||||
getLists();
|
||||
};
|
||||
|
||||
// 审核中
|
||||
const auditing = () => {
|
||||
ElMessage.warning("请等待合同审核完成!");
|
||||
};
|
||||
|
||||
getLists();
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.btn {
|
||||
position: absolute;
|
||||
}
|
||||
h1 {
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
font-size: 30px;
|
||||
color: red;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.content {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.info {
|
||||
color: red;
|
||||
font-weight: bold;
|
||||
font-size: 18px;
|
||||
display: inline-block;
|
||||
margin: 0 5px;
|
||||
}
|
||||
|
||||
.btn_menu {
|
||||
margin-top: 10vh;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
}
|
||||
.formdata {
|
||||
.el-form-item {
|
||||
width: 20%;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,668 @@
|
|||
<template>
|
||||
<el-card class="box-card">
|
||||
<template #header>
|
||||
<span>甲方基本信息</span>
|
||||
</template>
|
||||
<el-form
|
||||
:inline="true"
|
||||
ref="formRef"
|
||||
:model="compeny"
|
||||
label-width="91.5px"
|
||||
:rules="formRules"
|
||||
class="select"
|
||||
>
|
||||
<el-form-item label="公司名称" prop="company_name" required>
|
||||
<el-input
|
||||
disabled
|
||||
v-model="compeny.company_name"
|
||||
placeholder="请输入公司名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="社会代码" prop="organization_code" required>
|
||||
<el-input
|
||||
disabled
|
||||
v-model="compeny.organization_code"
|
||||
placeholder="请输入社会代码"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="主要联系人" prop="company_name" required>
|
||||
<el-input
|
||||
disabled
|
||||
v-model="compeny.master_name"
|
||||
placeholder="请输入主要联系人"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="公司类型" prop="compeny">
|
||||
<el-select
|
||||
disabled
|
||||
v-model="compeny.company_type_name"
|
||||
placeholder="请输入公司类型"
|
||||
>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="省" prop="province">
|
||||
<el-select
|
||||
disabled
|
||||
v-model="compeny.province_name"
|
||||
placeholder="请选择省"
|
||||
>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="市" prop="city">
|
||||
<el-select disabled v-model="compeny.city_name" placeholder="请选择市">
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="区" prop="area">
|
||||
<el-select disabled v-model="compeny.area_name" placeholder="请选择区">
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="镇"
|
||||
v-if="compeny.company_type != 30"
|
||||
prop="company_type_name"
|
||||
>
|
||||
<el-select
|
||||
disabled
|
||||
v-model="compeny.street_name"
|
||||
placeholder="请选择镇"
|
||||
>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="compeny.company_type != 30"
|
||||
label="地址"
|
||||
prop="address"
|
||||
>
|
||||
<el-input
|
||||
disabled
|
||||
v-model="compeny.address"
|
||||
placeholder="请输入公司地址"
|
||||
:style="{ width: '32rem' }"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<template #header>
|
||||
<span>甲方资质信息</span>
|
||||
</template>
|
||||
<el-form
|
||||
:inline="true"
|
||||
ref="formRef"
|
||||
:model="compeny"
|
||||
label-width="90px"
|
||||
:rules="formRules"
|
||||
class="company_z"
|
||||
>
|
||||
<el-form-item label="公司资质" prop="contract_type" required>
|
||||
<div class="company">
|
||||
<el-image
|
||||
:src="compenyimg.business_license"
|
||||
:preview-src-list="[compenyimg.business_license]"
|
||||
:initial-index="0"
|
||||
fit="cover"
|
||||
/>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label-width="120px"
|
||||
label="开户许可证"
|
||||
prop="contract_no"
|
||||
required
|
||||
>
|
||||
<div class="company">
|
||||
<el-image
|
||||
:src="compenyimg.business_licenseB"
|
||||
:preview-src-list="[compenyimg.business_licenseB]"
|
||||
:initial-index="0"
|
||||
fit="cover"
|
||||
/>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="compenyimg.other_qualifications?.length > 0"
|
||||
class="other"
|
||||
label="其他资质"
|
||||
prop="contract_no"
|
||||
required
|
||||
>
|
||||
<div
|
||||
class="company"
|
||||
v-for="(v, i) in compenyimg.other_qualifications"
|
||||
:key="i"
|
||||
>
|
||||
<el-image
|
||||
:src="v"
|
||||
:preview-src-list="compenyimg.other_qualifications"
|
||||
:initial-index="i"
|
||||
fit="cover"
|
||||
/>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card v-if="show">
|
||||
<template #header>
|
||||
<span>乙方基本信息</span>
|
||||
</template>
|
||||
<el-form
|
||||
:inline="true"
|
||||
ref="formRef"
|
||||
:model="compenyB"
|
||||
label-width="91.5px"
|
||||
:rules="formRules"
|
||||
class="select"
|
||||
>
|
||||
<el-form-item label="公司名称" prop="company_name" required>
|
||||
<el-input
|
||||
disabled
|
||||
v-model="compenyB.company_name"
|
||||
placeholder="请输入公司名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="社会代码" prop="organization_code" required>
|
||||
<el-input
|
||||
disabled
|
||||
v-model="compenyB.organization_code"
|
||||
placeholder="请输入社会代码"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="公司类型" prop="company_type">
|
||||
<el-select
|
||||
disabled
|
||||
v-model="compenyB.company_type_name"
|
||||
placeholder="请输入社会类型"
|
||||
>
|
||||
<el-option></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="主要联系人" prop="master_name" required>
|
||||
<el-input
|
||||
disabled
|
||||
v-model="compenyB.master_name"
|
||||
placeholder="请输入主要联系人"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="省" prop="province">
|
||||
<el-select
|
||||
disabled
|
||||
v-model="compenyB.province_name"
|
||||
placeholder="请选择省"
|
||||
>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="市" prop="city">
|
||||
<el-select disabled v-model="compenyB.city_name" placeholder="请选择市">
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="区" prop="area">
|
||||
<el-select disabled v-model="compenyB.area_name" placeholder="请选择区">
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="镇" prop="street">
|
||||
<el-select
|
||||
disabled
|
||||
v-model="compenyB.street_name"
|
||||
placeholder="请选择镇"
|
||||
>
|
||||
<el-option></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="地址" prop="street">
|
||||
<el-input
|
||||
disabled
|
||||
v-model="compenyB.address"
|
||||
placeholder="请输入公司地址"
|
||||
:style="{ width: '31.5rem' }"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card v-if="show">
|
||||
<template #header>
|
||||
<span>乙方资质信息</span>
|
||||
</template>
|
||||
<el-form
|
||||
:inline="true"
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
label-width="90px"
|
||||
:rules="formRules"
|
||||
class="company_z"
|
||||
>
|
||||
<el-form-item label="公司资质" prop="contract_type" required>
|
||||
<div class="company">
|
||||
<el-image
|
||||
:src="compenyBimg.business_license"
|
||||
:preview-src-list="[compenyBimg.business_license]"
|
||||
:initial-index="0"
|
||||
fit="cover"
|
||||
/>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label-width="120px"
|
||||
label="开户许可证"
|
||||
prop="contract_no"
|
||||
required
|
||||
>
|
||||
<div class="company">
|
||||
<el-image
|
||||
:src="compenyBimg.business_licenseB"
|
||||
:preview-src-list="[compenyBimg.business_licenseB]"
|
||||
:initial-index="0"
|
||||
fit="cover"
|
||||
/>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="compenyBimg.other_qualifications?.length > 0"
|
||||
class="other"
|
||||
label="其他资质"
|
||||
prop="contract_no"
|
||||
required
|
||||
>
|
||||
<div
|
||||
class="company"
|
||||
v-for="(v, i) in compenyBimg.other_qualifications"
|
||||
:key="i"
|
||||
>
|
||||
<el-image
|
||||
:src="v"
|
||||
:preview-src-list="compenyBimg.other_qualifications"
|
||||
:initial-index="i"
|
||||
fit="cover"
|
||||
/>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card v-if="flag">
|
||||
<template #header>
|
||||
<span>个人基本信息</span>
|
||||
</template>
|
||||
<div class="persenal">
|
||||
<img :src="persen.avatar" />
|
||||
<el-form
|
||||
:inline="true"
|
||||
ref="formRef"
|
||||
:model="persen"
|
||||
label-width="90px"
|
||||
:rules="formRules"
|
||||
class="person_select"
|
||||
>
|
||||
<el-form-item label="姓名">
|
||||
<el-input
|
||||
disabled
|
||||
v-model="persen.nickname"
|
||||
placeholder="请输入姓名"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="性别">
|
||||
<el-input disabled v-model="persen.sex" placeholder="请输入性别" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系电话">
|
||||
<el-input
|
||||
disabled
|
||||
v-model="persen.mobile"
|
||||
placeholder="请输入联系电话"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="身份证号">
|
||||
<el-input
|
||||
v-model="persen.id_card"
|
||||
placeholder="请输入身份证号"
|
||||
disabled
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="省" prop="province">
|
||||
<el-select
|
||||
disabled
|
||||
v-model="persen.province_name"
|
||||
placeholder="请选择省"
|
||||
>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="市" prop="city">
|
||||
<el-select disabled v-model="persen.city_name" placeholder="请选择市">
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="区" prop="area">
|
||||
<el-select disabled v-model="persen.area_name" placeholder="请选择区">
|
||||
<el-option></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="镇" prop="street">
|
||||
<el-select
|
||||
disabled
|
||||
v-model="persen.street_name"
|
||||
placeholder="请选择镇"
|
||||
>
|
||||
<el-option></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card v-if="flag">
|
||||
<template #header>
|
||||
<span>个人资质信息</span>
|
||||
</template>
|
||||
<el-form class="idcard" :model="persenimg" :inline="true">
|
||||
<el-form-item label="身份证">
|
||||
<img :src="persenimg.id_card" />
|
||||
<img :src="persenimg.id_card_b" />
|
||||
</el-form-item>
|
||||
<el-form-item label="银行卡">
|
||||
<img :src="persenimg.bank_account" />
|
||||
<img :src="persenimg.bank_account_b" />
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="persenimg.car_card || persenimg.car_card_b"
|
||||
label="行驶证"
|
||||
>
|
||||
<img v-if="persenimg.car_card" :src="persenimg.car_card" />
|
||||
<img v-if="persenimg.car_card_b" :src="persenimg.car_card_b" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<template #header>
|
||||
<span>电子合同</span>
|
||||
</template>
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="frame"
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
label-width="90px"
|
||||
:rules="formRules"
|
||||
>
|
||||
<el-form-item label="甲方" prop="contract_type">
|
||||
<el-input
|
||||
v-model="compeny.company_name"
|
||||
:disabled="true"
|
||||
placeholder="暂无甲方方"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="乙方" prop="contract_no">
|
||||
<el-input
|
||||
v-model="compenyB.company_name"
|
||||
:disabled="true"
|
||||
placeholder="暂无乙方"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="合同类型" prop="contract_no">
|
||||
<el-input
|
||||
v-model="basicdata.contract_type_name"
|
||||
:disabled="true"
|
||||
placeholder="暂无合同"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="合同编号" prop="contract_no">
|
||||
<el-input
|
||||
v-model="formData.party_b_name"
|
||||
:disabled="true"
|
||||
placeholder="暂无签约方"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<el-form label-width="100px">
|
||||
<el-form-item
|
||||
v-if="isshow || formData?.status == 0"
|
||||
label="合同上传"
|
||||
prop="field127"
|
||||
>
|
||||
<el-upload
|
||||
accept=".pdf"
|
||||
:headers="{ Token: userStore.token }"
|
||||
class="upload-demo"
|
||||
:action="base_url + '/upload/taskFile'"
|
||||
:on-success="handleAvatarSuccess_four"
|
||||
:before-upload="handleBeforeUpload"
|
||||
:limit="1"
|
||||
v-if="formData?.status == 0"
|
||||
:on-exceed="handleExceed"
|
||||
ref="upload"
|
||||
v-perms="['contract.contract/wind_control']"
|
||||
>
|
||||
<el-button type="primary">{{
|
||||
formData.file ? "重新上传" : "上传"
|
||||
}}</el-button>
|
||||
</el-upload>
|
||||
<a
|
||||
v-if="formData.file"
|
||||
style="margin-left: 10px; color: #4a5dff; align-self: flex-start"
|
||||
:href="formData.file"
|
||||
target="_blank"
|
||||
>合同已上传,点击查看</a
|
||||
>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="isshow || formData.status == 0">
|
||||
<el-button
|
||||
v-perms="['contract.contract/wind_control']"
|
||||
type="primary"
|
||||
@click="submitContract"
|
||||
>确定</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
<el-form-item v-else-if="formData.file && formData.status">
|
||||
<a
|
||||
v-if="formData.file"
|
||||
style="margin-left: 10px; color: #4a5dff"
|
||||
:href="
|
||||
formData.signed_contract_url
|
||||
? formData.signed_contract_url
|
||||
: formData.file
|
||||
"
|
||||
target="_blank"
|
||||
>查看合同</a
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {
|
||||
type FormInstance,
|
||||
type UploadProps,
|
||||
ElMessage,
|
||||
type UploadUserFile,
|
||||
} from "element-plus";
|
||||
import { apiContractDetail } from "@/api/contract";
|
||||
import { ref, reactive, defineExpose, computed, inject } from "vue";
|
||||
import { useRoute } from "vue-router";
|
||||
import { dictDataLists } from "@/api/setting/dict";
|
||||
import { upContact } from "@/api/consumer";
|
||||
import { genFileId } from "element-plus";
|
||||
const { query } = useRoute();
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
import useMultipleTabs from "@/hooks/useMultipleTabs";
|
||||
const { removeTab } = useMultipleTabs();
|
||||
const base_url: any = inject("base_url");
|
||||
|
||||
const formData = reactive({
|
||||
id: "",
|
||||
company_id: "",
|
||||
contract_type: "",
|
||||
contract_type_name: "",
|
||||
contract_no: "",
|
||||
file: "",
|
||||
status: "",
|
||||
check_status: "",
|
||||
party_a: "",
|
||||
party_a_name: "",
|
||||
party_b: "",
|
||||
party_b_name: "",
|
||||
area_manager: "",
|
||||
area_manager_name: "",
|
||||
type_name: "",
|
||||
url: "",
|
||||
status_name: "",
|
||||
signed_contract_url: "",
|
||||
});
|
||||
const fileList = ref<UploadUserFile[]>([]);
|
||||
const basicdata = ref({});
|
||||
const compeny = ref({});
|
||||
const compenyimg = ref([]);
|
||||
const compenyB = ref([]);
|
||||
const compenyBimg = ref([]);
|
||||
const persen = ref([]);
|
||||
const persenimg = ref([]);
|
||||
const show = ref(true);
|
||||
const flag = ref(true);
|
||||
const isshow = ref(true);
|
||||
const route = useRoute();
|
||||
const userStore = useUserStore();
|
||||
|
||||
async function render() {
|
||||
// 传值赋值
|
||||
const res = await apiContractDetail({ id: query.id });
|
||||
Object.keys(formData).forEach((key: any) => {
|
||||
if (res[key] != null && res[key] != undefined) formData[key] = res[key];
|
||||
});
|
||||
compeny.value = res.party_a_info;
|
||||
basicdata.value = res;
|
||||
if (basicdata.value.status == 1 || res.check_status == 3 || res.status == 1) {
|
||||
isshow.value = false;
|
||||
}
|
||||
try {
|
||||
res.party_a_info.qualification.bank_account = JSON.parse(
|
||||
res.party_a_info.qualification.bank_account
|
||||
);
|
||||
compenyimg.value = res.party_a_info.qualification;
|
||||
res.party_b_info.qualification.other_qualifications = JSON.parse(
|
||||
res.party_b_info.qualification.other_qualifications
|
||||
);
|
||||
compenyBimg.value = res.party_b_info.qualification;
|
||||
} catch (error) {}
|
||||
compenyimg.value = res.party_a_info.qualification;
|
||||
if (res.type == 2) {
|
||||
show.value = false;
|
||||
res.party_b_info.sex == 1
|
||||
? (res.party_b_info.sex = "男")
|
||||
: (res.party_b_info.sex = "女");
|
||||
persen.value = res.party_b_info;
|
||||
persenimg.value = res.party_b_info.qualification;
|
||||
}
|
||||
if (res.type == 1) {
|
||||
compenyB.value = res.party_b_info;
|
||||
compenyBimg.value = res.party_b_info.qualification;
|
||||
flag.value = false;
|
||||
} else {
|
||||
compenyB.value.company_name = res.party_b_info.nickname;
|
||||
}
|
||||
}
|
||||
|
||||
const handleBeforeUpload = (e: any) => {
|
||||
if (e?.name?.substring(e.name.length - 4, e.name.length) != ".pdf") {
|
||||
ElMessage.error("仅支持上传.pdf文件");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
const upload = ref(null);
|
||||
const handleExceed = (files: any) => {
|
||||
upload.value!.clearFiles();
|
||||
const file = files[0] as UploadRawFile;
|
||||
file.uid = genFileId();
|
||||
upload.value!.handleStart(file);
|
||||
upload.value!.submit();
|
||||
};
|
||||
|
||||
const handleAvatarSuccess_four: UploadProps["onSuccess"] = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
}
|
||||
formData.file = response.data.uri;
|
||||
};
|
||||
|
||||
const router = useRouter();
|
||||
const submitContract = () => {
|
||||
if (!formData.file) return ElMessage.error("请先上传合同!");
|
||||
upContact({ file: formData.file, id: route.query.id });
|
||||
removeTab();
|
||||
router.back();
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
await render();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.frame {
|
||||
.el-form-item {
|
||||
width: 40%;
|
||||
.el-input {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
.select {
|
||||
.el-form-item {
|
||||
.el-select {
|
||||
width: 12rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
.person_select {
|
||||
.el-form-item {
|
||||
width: 30%;
|
||||
.el-select {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
.company {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.el-image {
|
||||
width: 10vw;
|
||||
height: 6.3vw;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
.persenal {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
img {
|
||||
width: 10vw;
|
||||
height: 6.3vw;
|
||||
}
|
||||
}
|
||||
.idcard {
|
||||
img {
|
||||
width: 10vw;
|
||||
height: 6.3vw;
|
||||
margin-right: 12px;
|
||||
}
|
||||
}
|
||||
.company_z {
|
||||
.el-form-item {
|
||||
width: 40%;
|
||||
}
|
||||
.other {
|
||||
width: 100% !important;
|
||||
}
|
||||
}
|
||||
.el-card {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.el-upload-list .el-upload-list__item-thumbnail {
|
||||
width: 500px; /* 设置文件缩略图的宽度 */
|
||||
}
|
||||
|
||||
.el-upload-list .el-upload-list__item-name {
|
||||
max-width: 450px; /* 设置文件名的最大宽度 */
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,140 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="公司名称" prop="company_name">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.company_name"
|
||||
clearable
|
||||
placeholder="请输入公司名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="公司类型" prop="company_type">
|
||||
<el-select
|
||||
v-model="queryParams.company_type"
|
||||
placeholder="公司类型"
|
||||
clearable
|
||||
@change="changeType"
|
||||
:style="{ width: '100%' }"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in typeList"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
<!-- <el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.company_type"
|
||||
clearable
|
||||
placeholder="请输入公司类型"
|
||||
/> -->
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @cell-click="handleCurrentChange">
|
||||
<el-table-column label="公司名称" property="company_name" />
|
||||
<el-table-column label="公司类型" property="company_type">
|
||||
<template #default="{ row }">
|
||||
<span
|
||||
>{{typeList.find((item: any)=>item.id==row.company_type).name}}</span
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="区县" property="area_name" />
|
||||
<el-table-column label="乡镇" property="street_name" />
|
||||
<el-table-column label="主联系人" property="master_name" />
|
||||
<el-table-column label="联系方式" property="master_phone" />
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="companyLists">
|
||||
import { usePaging } from "@/hooks/usePaging";
|
||||
import { useDictData } from "@/hooks/useDictOptions";
|
||||
import {
|
||||
apiCompanyLists,
|
||||
companyListTwo,
|
||||
apiCompanyDelete,
|
||||
} from "@/api/company";
|
||||
import { defineEmits } from "vue";
|
||||
|
||||
// 当前类型
|
||||
const props = defineProps({
|
||||
type: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
companyTypeList: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return [];
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const typeList = props.companyTypeList.filter((item: any) => {
|
||||
return item.id == 30 || item.id == 16;
|
||||
});
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
level_two: "",
|
||||
level_one: "",
|
||||
company_name: "",
|
||||
organization_code: "",
|
||||
city: "",
|
||||
area: "",
|
||||
street: "",
|
||||
company_type: "",
|
||||
master_name: "",
|
||||
master_position: "",
|
||||
master_phone: "",
|
||||
master_email: "",
|
||||
other_contacts: "",
|
||||
area_manager: "",
|
||||
is_contract: "",
|
||||
account: "",
|
||||
password: "",
|
||||
deposit: "",
|
||||
deposit_time: "",
|
||||
qualification: "",
|
||||
status: "",
|
||||
});
|
||||
|
||||
if (props.type) queryParams.company_type = props.type;
|
||||
|
||||
// 选中数据
|
||||
const emits = defineEmits(["customEvent"]);
|
||||
|
||||
// 选中数据子父传递
|
||||
const handleCurrentChange = (value: any) => {
|
||||
emits("customEvent", value);
|
||||
};
|
||||
|
||||
// 选择公司类型
|
||||
const changeType = (e: any) => {
|
||||
getLists();
|
||||
};
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: companyListTwo,
|
||||
params: queryParams,
|
||||
});
|
||||
|
||||
getLists();
|
||||
</script>
|
|
@ -0,0 +1,175 @@
|
|||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup
|
||||
v-if="true"
|
||||
ref="popupRef"
|
||||
:title="popupTitle"
|
||||
:async="true"
|
||||
width="550px"
|
||||
@confirm="handleSubmit"
|
||||
@close="handleClose"
|
||||
>
|
||||
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
|
||||
<el-form-item label="合同类型" prop="contract_type_name">
|
||||
<el-input
|
||||
v-model="formData.contract_type_name"
|
||||
clearable
|
||||
placeholder="请输入合同类型"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="合同编号" prop="contract_no">
|
||||
<el-input
|
||||
v-model="formData.contract_no"
|
||||
clearable
|
||||
placeholder="请输入合同编号"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-input v-model="formData.status" clearable placeholder="请输入状态" />
|
||||
</el-form-item>
|
||||
<el-form-item label="甲方" prop="party_a_name">
|
||||
<el-input v-model="formData.party_a_name" clearable placeholder="请输入甲方" />
|
||||
</el-form-item>
|
||||
<el-form-item label="乙方" prop="party_b_name">
|
||||
<el-input v-model="formData.party_b_name" clearable placeholder="请输入乙方" />
|
||||
</el-form-item>
|
||||
<el-form-item label="片区经理" prop="area_manager_name">
|
||||
<el-input
|
||||
v-model="formData.area_manager_name"
|
||||
clearable
|
||||
placeholder="请输入片区经理"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="contractEdit">
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiContractAdd, apiContractEdit, apiContractDetail } from '@/api/contract'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import type { PropType } from 'vue'
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑合同' : '新增合同'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
company_id: '',
|
||||
contract_type: '',
|
||||
contract_type_name: '',
|
||||
contract_no: '',
|
||||
file: '',
|
||||
status: '',
|
||||
party_a: '',
|
||||
party_a_name: '',
|
||||
party_b: '',
|
||||
party_b_name: '',
|
||||
area_manager: '',
|
||||
area_manager_name: ''
|
||||
})
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
company_id: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入公司',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
contract_type: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入合同类型',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
contract_no: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入合同编号',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
file: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入文件',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
party_a: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入甲方',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
party_b: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入乙方',
|
||||
trigger: ['blur']
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiContractDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData }
|
||||
mode.value == 'edit' ? await apiContractEdit(data) : await apiContractAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
|
@ -0,0 +1,294 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="公司名称" prop="company_name">
|
||||
<el-input class="w-[280px]" v-model="queryParams.company_name" clearable placeholder="请输入公司" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合同类型" prop="contract_type">
|
||||
<el-select v-model="queryParams.contract_type" clearable placeholder="请输入合同类型">
|
||||
<el-option v-for="item in datalist" :key="item.label" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="合同编号" prop="contract_no">
|
||||
<el-input class="w-[280px]" v-model="queryParams.contract_no" clearable placeholder="请输入合同编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="contract_status">
|
||||
<el-select v-model="queryParams.contract_status" clearable placeholder="请选择状态">
|
||||
<el-option v-for="item in statusdata" :key="item.label" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="甲方片区经理" prop="area_manager">
|
||||
<el-input class="w-[280px]" v-model="queryParams.area_manager" clearable placeholder="请输入甲方片区经理" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<!-- <el-button v-perms="['contract.contract/add']" type="primary" @click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>-->
|
||||
<!-- <el-button
|
||||
v-perms="['contract.contract/delete']"
|
||||
:disabled="!selectData.length"
|
||||
@click="handleDelete(selectData)"
|
||||
>删除</el-button
|
||||
> -->
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<!-- <el-table-column type="selection" width="55" /> -->
|
||||
<el-table-column label="id" prop="id" show-overflow-tooltip />
|
||||
<!-- <el-table-column label="公司" prop="company_name" show-overflow-tooltip /> -->
|
||||
<el-table-column label="合同类型" prop="contract_type_name" show-overflow-tooltip />
|
||||
<el-table-column label="合同编号" prop="contract_no" show-overflow-tooltip />
|
||||
<el-table-column label="甲方" prop="party_a_name" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row?.party_a_info?.company_name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="乙方" prop="party_b_name" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="甲方片区经理" prop="area_manager_name" show-overflow-tooltip />
|
||||
<el-table-column label="类型" prop="type" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<span>{{
|
||||
scope.row.type == 1 ? "公司" : scope.row.type == 0 ? "" : "个人"
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" prop="status_name" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.status_name == '已签约'" style="color: #67c23a">已签约</span>
|
||||
<span v-else style="color: #fe0000">未签约</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="180" fixed="right" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" link>
|
||||
<router-link :to="{ path: '/contract/detail', query: { id: row.id } }">{{ row.status ? "详情" : "审核" }}</router-link>
|
||||
</el-button>
|
||||
<template v-if="row.status == 0">
|
||||
<el-button v-if="row.check_status == 1" type="warning" link>
|
||||
<router-link :to="{ path: '/contract/detail', query: { id: row.id } }">待审核</router-link>
|
||||
</el-button>
|
||||
<el-button v-else-if="row.check_status == 2" v-perms="['contract.contract/contract_send']" type="primary" link @click="showCreateConctPop(row)">发送合同</el-button>
|
||||
<el-button v-else-if="row.check_status == 3" v-perms="['contract.contract/contract_send_again']" type="primary" link @click="
|
||||
(showPop = true),
|
||||
(party_b_id = row.party_b),
|
||||
(contract_id = row.id)
|
||||
">发送短信</el-button>
|
||||
</template>
|
||||
<el-button v-else type="primary" link @click="loadContractZip(row)">
|
||||
下载证据包
|
||||
</el-button>
|
||||
<!-- <el-button v-perms="['contract.contract/delete']" type="danger" link
|
||||
@click="handleDelete(row.id)">删除</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex justify-end mt-4">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<el-dialog v-model="showPop" @close="offPop">
|
||||
<h1>重要提醒</h1>
|
||||
<div class="content" v-if="showConctactPop">
|
||||
请确认信息是否有误,发送合同,请确认信息是否有误,发送电子合同后短时间内将不可再次发送.
|
||||
</div>
|
||||
<div class="content" v-else>
|
||||
确认签约短信将在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-else @click="sendMsg">确认</el-button>
|
||||
<el-button type="info" size="large" @click="offPop">返回</el-button>
|
||||
</p>
|
||||
</el-dialog>
|
||||
<!-- <contractDetil ref="childDetil"></contractDetil> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="contractLists">
|
||||
// import contractDetil from './contractDetil.vue'
|
||||
import { usePaging } from "@/hooks/usePaging";
|
||||
import { useDictData } from "@/hooks/useDictOptions";
|
||||
import {
|
||||
apiContractLists,
|
||||
apiContractDelete,
|
||||
apiContractDetail,
|
||||
contractEvidence,
|
||||
} from "@/api/contract";
|
||||
import { contractType } from "@/api/company";
|
||||
import { timeFormat } from "@/utils/util";
|
||||
import feedback from "@/utils/feedback";
|
||||
import { dictDataLists } from "@/api/setting/dict";
|
||||
import { generateGontract, sendMsgApi, userGontract } from "@/api/company";
|
||||
const route = useRoute();
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>();
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false);
|
||||
const datalist = ref([]);
|
||||
let isIndividual = false;
|
||||
//弹窗
|
||||
const showPop = ref(false);
|
||||
const showConctactPop = ref(false);
|
||||
// 发送合同的id
|
||||
const contract_id = ref("");
|
||||
const party_b_id = ref("");
|
||||
const type = ref("");
|
||||
|
||||
// 发送合同
|
||||
const showCreateConctPop = (row: any) => {
|
||||
(showPop.value = true),
|
||||
(showConctactPop.value = true),
|
||||
(contract_id.value = row.id),
|
||||
(party_b_id.value = row.party_b);
|
||||
type.value = row.type;
|
||||
|
||||
console.log(row);
|
||||
if (row.contract_type == 22) {
|
||||
isIndividual = true;
|
||||
}
|
||||
};
|
||||
const offPop = () => {
|
||||
showPop.value = false;
|
||||
showConctactPop.value = false;
|
||||
};
|
||||
const creContct = async () => {
|
||||
if (isIndividual) {
|
||||
await userGontract({
|
||||
part_b: party_b_id.value,
|
||||
|
||||
contract_id: contract_id.value,
|
||||
});
|
||||
} else {
|
||||
await generateGontract({
|
||||
part_b: party_b_id.value,
|
||||
type: type.value,
|
||||
id: contract_id.value,
|
||||
});
|
||||
}
|
||||
isIndividual = false;
|
||||
getLists();
|
||||
offPop();
|
||||
};
|
||||
const sendMsg = async () => {
|
||||
await sendMsgApi({
|
||||
id: contract_id.value
|
||||
|
||||
});
|
||||
getLists();
|
||||
offPop();
|
||||
};
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
company_name: "",
|
||||
contract_type: "",
|
||||
contract_no: "",
|
||||
contract_status: "",
|
||||
area_manager: "",
|
||||
});
|
||||
const statusdata = reactive([
|
||||
{ id: "1", name: "已签约" },
|
||||
{ id: "0", name: "未签约" },
|
||||
]);
|
||||
if (route.query.type) {
|
||||
queryParams.type = route.query.type?.toString();
|
||||
}
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([]);
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id);
|
||||
};
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData("");
|
||||
contractType().then((res) => {
|
||||
datalist.value = res;
|
||||
});
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiContractLists,
|
||||
params: queryParams,
|
||||
});
|
||||
|
||||
// 详情
|
||||
const childDetil = ref();
|
||||
const showDetil = async (id) => {
|
||||
// const res = await apiContractDetail({ id })
|
||||
// childDetil.value.setFormData(res)
|
||||
// childDetil.value.shoeEditFn(true)
|
||||
};
|
||||
// 查看合同
|
||||
const checkContcat = (id: number) => {
|
||||
apiContractDetail({ id }).then((res) => {
|
||||
res.file ? window.open(res.file) : feedback.msgError("暂无合同可以查看");
|
||||
});
|
||||
};
|
||||
// 删除
|
||||
const handleDelete = async (id: number | any[]) => {
|
||||
await feedback.confirm("确定要删除?");
|
||||
await apiContractDelete({ id });
|
||||
getLists();
|
||||
};
|
||||
|
||||
// 下载证据包
|
||||
const loadContractZip = (row: any) => {
|
||||
contractEvidence({ id: row.id }).then((res) => {
|
||||
downloadFile(res.url, "");
|
||||
});
|
||||
};
|
||||
const downloadFile = (url: string, fileName: string) => {
|
||||
let link = document.createElement("a");
|
||||
link.href = url;
|
||||
link.download = fileName;
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
};
|
||||
|
||||
getLists();
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.btn {
|
||||
position: absolute;
|
||||
}
|
||||
h1 {
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
font-size: 30px;
|
||||
color: red;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.content {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.info {
|
||||
color: red;
|
||||
font-weight: bold;
|
||||
font-size: 18px;
|
||||
display: inline-block;
|
||||
margin: 0 5px;
|
||||
}
|
||||
|
||||
.btn_menu {
|
||||
margin-top: 10vh;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,334 @@
|
|||
<template>
|
||||
<div class="edit-popup">
|
||||
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules" :disabled="true">
|
||||
<el-col :span="24" class="el-card pt-6">
|
||||
<div class="tit">甲方信息</div>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="公司名称" prop="company_name">
|
||||
<el-input v-model="formData.company_a_name" placeholder="请输入公司名称" clearable
|
||||
:disabled="isDisabled" :style="{ width: '100%' }"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="社会代码" prop="organization_code">
|
||||
<el-input :disabled="isDisabled" v-model="formData.company_a_code" placeholder="请输入社会代码"
|
||||
clearable :style="{ width: '100%' }"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="24" class="el-card pt-6">
|
||||
<div class="tit">主要联系人</div>
|
||||
<el-row>
|
||||
<div style="display: flex; justify-content: left">
|
||||
<div class="right">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="姓名" prop="master_name">
|
||||
<el-input :disabled="isDisabled" v-model="formData.company_a_user"
|
||||
placeholder="请输入姓名" clearable :style="{ width: '100%' }"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="手机" prop="master_phone">
|
||||
<el-input :disabled="isDisabled" v-model="formData.company_a_phone"
|
||||
placeholder="请输入手机" clearable :style="{ width: '100%' }"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="邮箱">
|
||||
<el-input :disabled="isDisabled" v-model="formData.company_a_email"
|
||||
placeholder="请输入邮箱" clearable :style="{ width: '100%' }"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="24" class="el-card pt-6">
|
||||
<div class="tit">乙方信息</div>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="公司名称" prop="company_name">
|
||||
<el-input v-model="formData.company_b_name" placeholder="请输入公司名称" clearable
|
||||
:disabled="isDisabled" :style="{ width: '100%' }"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="社会代码" prop="organization_code">
|
||||
<el-input :disabled="isDisabled" v-model="formData.company_b_code" placeholder="请输入社会代码"
|
||||
clearable :style="{ width: '100%' }"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="24" class="el-card pt-6">
|
||||
<div class="tit">主要联系人</div>
|
||||
<el-row>
|
||||
<div style="display: flex; justify-content: left">
|
||||
<div class="right">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="姓名" prop="master_name">
|
||||
<el-input :disabled="isDisabled" v-model="formData.company_b_user"
|
||||
placeholder="请输入姓名" clearable :style="{ width: '100%' }"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="手机" prop="master_phone">
|
||||
<el-input :disabled="isDisabled" v-model="formData.company_b_phone"
|
||||
placeholder="请输入手机" clearable :style="{ width: '100%' }"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="邮箱">
|
||||
<el-input :disabled="isDisabled" v-model="formData.company_b_email"
|
||||
placeholder="请输入邮箱" clearable :style="{ width: '100%' }"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<!-- -->
|
||||
<el-col :span="24" class="el-card pt-6" v-if="formData.cars_info">
|
||||
<div class="tit">租赁信息</div>
|
||||
<div>
|
||||
<el-row v-for="(item,index) in formData.cars_info" :key="index">
|
||||
<el-col :span="4">
|
||||
<el-form-item label-width="120px" label="车牌号"><el-input v-model="item.license"
|
||||
placeholder="请输入车牌号" clearable :style="{ width: '100%' }"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item label-width="120px" label="车辆类型">
|
||||
<el-input v-model="item.type" placeholder="请输入车辆类型" clearable
|
||||
:style="{ width: '100%' }"></el-input></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label-width="120px" label="使用公司"><el-input v-model="formData.company_b_name"
|
||||
placeholder="请输入使用公司" clearable :style="{ width: '100%' }"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label-width="120px" label="签约时间">
|
||||
<el-input v-model="item.rent_time" placeholder="请输入签约时间" clearable
|
||||
:style="{ width: '100%' }"></el-input></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-form>
|
||||
<!-- 小组公司申请车辆 -->
|
||||
<!-- {{ formData.contract_logistic_id }}
|
||||
{{ formData.type }} -->
|
||||
|
||||
<div v-if="formData.contract_logistic_id && formData.type == 0 && formData.status==0" class="el-card pt-6">
|
||||
<div class="tit">租赁信息</div>
|
||||
<div style="padding: 0 2vw">
|
||||
<el-checkbox-group :max="formData.num" v-model="checkList" @change="handChangeFn">
|
||||
<el-checkbox :label="item.license" v-for="(item, index) in formData.car_list" :key="index" />
|
||||
</el-checkbox-group>
|
||||
</div>
|
||||
</div>
|
||||
<div class="el-card pt-6">
|
||||
<el-upload style="display: inline-block" :headers="{ Token: userStore.token }"
|
||||
:action="base_url + '/upload/taskFile'" :on-success="handleAvatarSuccess_three"
|
||||
:before-upload="handleBeforeUpload" :limit="1" v-if="formData?.status == 0" :on-exceed="handleExceed"
|
||||
ref="upload">
|
||||
<el-button type="primary">{{
|
||||
formData.file ? "重新上传" : "上传合同"
|
||||
}}</el-button>
|
||||
</el-upload>
|
||||
<a v-if="formData.file && formData?.status == 0" style="margin-left: 10px; color: #4a5dff" :href="formData.file"
|
||||
target="_blank">合同已上传,点击查看</a>
|
||||
<a style="margin-left: 10px; color: #4a5dff" :href="formData.file" v-if="formData.status > 0">查看合同</a>
|
||||
</div>
|
||||
<el-button type="primary" v-if="formData.status == 0" @click="create">确定</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { reactive, ref, inject } from "vue";
|
||||
import { leaseUpContract, leaseContractDetail } from "@/api/contract";
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
const userStore = useUserStore();
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const checkList = ref([]);
|
||||
const formData = reactive({
|
||||
contract_logistic_id: "",
|
||||
contract_no: "",
|
||||
company_a_id: "",
|
||||
company_a_name: "",
|
||||
company_a_code: "",
|
||||
company_a_user: "",
|
||||
company_a_phone: "",
|
||||
company_a_email: "@service.ebaoquan.org",
|
||||
company_b_id: "",
|
||||
company_b_name: "",
|
||||
company_b_user: "",
|
||||
company_b_phone: "",
|
||||
company_b_code: "",
|
||||
company_b_email: "@service.ebaoquan.org",
|
||||
num: "",
|
||||
cars_info:
|
||||
[
|
||||
{
|
||||
id: "",
|
||||
license: "",
|
||||
type:"",
|
||||
rent_time:""
|
||||
}
|
||||
]
|
||||
,
|
||||
car_list: [],
|
||||
type: 0,
|
||||
status: 0,
|
||||
file: "",
|
||||
contract_url: "",
|
||||
signing_timer: 0,
|
||||
url: null,
|
||||
create_time: "2023-08-31 14:26:42",
|
||||
update_time: "2023-08-31 14:26:49",
|
||||
reject_message: "",
|
||||
});
|
||||
let arrs = [];
|
||||
|
||||
const base_url = inject("base_url");
|
||||
const handChangeFn = (e) => {
|
||||
arrs = [];
|
||||
e.map((item) => {
|
||||
formData.car_list.forEach((element) => {
|
||||
if (element.license == item) {
|
||||
arrs.push(element);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
const typeFn=(type)=>{
|
||||
if(type==0)return"租赁车辆"
|
||||
if(type==1)return"自有车辆"
|
||||
if(type==2)return"购买车辆"
|
||||
}
|
||||
const test = () => {
|
||||
window.open(formData.file, "_blank");
|
||||
};
|
||||
leaseContractDetail({ id: route.query.id }).then((res) => {
|
||||
for (let key in formData) {
|
||||
formData[key] = res[key];
|
||||
}
|
||||
// formData.type ? (formData.type = "自有车辆") : (formData.type = "租赁车辆");
|
||||
formData.cars_info.forEach(item=>{
|
||||
item.type=typeFn(item.type)
|
||||
})
|
||||
});
|
||||
|
||||
const handleAvatarSuccess_three = (response, uploadFile) => {
|
||||
formData.file = response.data.uri;
|
||||
};
|
||||
|
||||
const create = () => {
|
||||
leaseUpContract({
|
||||
id: route.query.id,
|
||||
file: formData.file,
|
||||
cars: JSON.stringify(arrs),
|
||||
}).then((res) => {
|
||||
setTimeout(() => {
|
||||
router.go(-1);
|
||||
}, 1000);
|
||||
// console.log(res);
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.tit {
|
||||
font-size: 1.2rem;
|
||||
translate: 1vw -1vw;
|
||||
}
|
||||
|
||||
.avatar-uploader .el-upload {
|
||||
width: 10vw;
|
||||
height: 6.3vw;
|
||||
background-color: #fff;
|
||||
border: 1px dashed var(--el-border-color);
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
transition: var(--el-transition-duration-fast);
|
||||
}
|
||||
|
||||
.headimg {
|
||||
margin-left: 18px;
|
||||
margin-bottom: 18px;
|
||||
width: 120px;
|
||||
height: 140px;
|
||||
overflow: hidden;
|
||||
border: 1px dashed var(--el-border-color);
|
||||
border-radius: 6px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.upload-demo {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.avatar-uploader-head .el-upload {
|
||||
width: 120px;
|
||||
height: 140px;
|
||||
background-color: #fff;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
transition: var(--el-transition-duration-fast);
|
||||
}
|
||||
|
||||
.avatar-uploader .el-upload:hover {
|
||||
border-color: var(--el-color-primary);
|
||||
}
|
||||
|
||||
.el-icon.avatar-uploader-icon {
|
||||
font-size: 28px;
|
||||
color: #8c939d;
|
||||
width: 178px;
|
||||
height: 178px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.el-icon.avatar-uploader-icon {
|
||||
font-size: 28px;
|
||||
color: #8c939d;
|
||||
width: 178px;
|
||||
height: 178px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.otherimg {
|
||||
img {
|
||||
width: 10vw;
|
||||
height: 6.3vw;
|
||||
border-radius: 5px;
|
||||
margin-left: 12px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.el-card {
|
||||
margin-bottom: 10px;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.tit {
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
.others {
|
||||
width: 100% !important;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,241 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<el-form class="mb-[-16px]" inline>
|
||||
<el-form-item label="公司名称" prop="company_name">
|
||||
<el-input class="w-[280px]" v-model="queryParams.company_name" clearable placeholder="请输入公司名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合同编号" prop="contract_no">
|
||||
<el-input class="w-[280px]" v-model="queryParams.contract_no" clearable placeholder="请输入合同编号" />
|
||||
</el-form-item><el-form-item label="合同状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择合同类型" clearable class="w-[280px]">
|
||||
<el-option label="未上传" :value="0"></el-option>
|
||||
<el-option label="已上传" :value="1"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" :default-sort="{ prop: 'create_time', order: 'descending' }"
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column label="id" prop="id" />
|
||||
<el-table-column label="合同类型" align="center">
|
||||
<template #default="{ row }">
|
||||
{{ typeFn(row.type) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="合同编号" prop="contract_no" align="center" show-overflow-tooltip />
|
||||
<el-table-column label="甲方" prop="company_a_name" align="center" show-overflow-tooltip />
|
||||
<el-table-column label="乙方" prop="company_b_name" align="center" show-overflow-tooltip />
|
||||
<el-table-column label="类型" prop="product_count" align="center" show-overflow-tooltip>
|
||||
<template #default="{ row }"> 公司 </template>
|
||||
</el-table-column>
|
||||
<el-table-column label="租车数量(辆)" prop="num" align="center" show-overflow-tooltip />
|
||||
<el-table-column label="状态" prop="product_count" align="center" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<span :style="`color:${statusFn(row.status).color}`">
|
||||
{{ statusFn(row.status).tit }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="auto" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" link v-perms="['contract.contract/wind_control']"
|
||||
v-if="row.status == 0">
|
||||
<router-link :to="{
|
||||
path: 'vehicle_detail',
|
||||
query: {
|
||||
id: row.id,
|
||||
},
|
||||
}">审核</router-link>
|
||||
</el-button>
|
||||
<el-button type="primary" link v-perms="['contract.contract/wind_control']"
|
||||
v-if="row.status > 0">
|
||||
<router-link :to="{
|
||||
path: 'vehicle_detail',
|
||||
query: {
|
||||
id: row.id,
|
||||
},
|
||||
}">详情</router-link>
|
||||
</el-button>
|
||||
<el-button v-if="row.status == 1 " type="primary" link
|
||||
@click="sendContractPopFn(row.id)">发送合同</el-button>
|
||||
<el-button v-if="row.status == 2" :disabled="row.nums > 0" @click="sendAgaintPopFn(row.id)" link
|
||||
type="primary">重新发送{{ row.nums ? row.nums + "s" : "" }}</el-button>
|
||||
<el-button v-if="row.status == 3" type="primary" link>
|
||||
<a :href="JSON.parse(row.contract_evidence).party_a">下载证据</a>
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-dialog v-model="showPop" @close="offPop">
|
||||
<h1>重要提醒</h1>
|
||||
<div class="content" v-if="!sendAgainPop">
|
||||
请确认信息是否有误,发送合同,请确认信息是否有误,发送电子合同后短时间内将不可再次发送.
|
||||
</div>
|
||||
<div class="content" v-else>
|
||||
确认签约短信将在60秒后发送,请注意查收,并点击短信链接进行线上合同签约
|
||||
</div>
|
||||
<p class="btn_menu">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="large"
|
||||
v-if="!sendAgainPop"
|
||||
@click="sendContractFn"
|
||||
>确认</el-button
|
||||
>
|
||||
<el-button type="primary" size="large" v-else @click="sendAgain"
|
||||
>重新发送</el-button
|
||||
>
|
||||
<el-button type="info" size="large" @click="offPop">返回</el-button>
|
||||
</p>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="flowTypeLists">
|
||||
import { usePaging } from "@/hooks/usePaging";
|
||||
import { useDictData } from "@/hooks/useDictOptions";
|
||||
import { leaseContractList } from "@/api/contract";
|
||||
import { sendContract, sendMsg } from "@/api/car_contract";
|
||||
import feedback from "@/utils/feedback";
|
||||
// 发送合同与重新发送(弹窗)
|
||||
|
||||
const index = ref(0);
|
||||
// 发送合同的id
|
||||
var contractId = 0;
|
||||
const showPop = ref(false);
|
||||
const sendAgainPop = ref(false);
|
||||
const sendAgain = () => {
|
||||
sendMsg({ id: contractId }).then((res) => {
|
||||
var inde = pager.lists.findIndex(function (element) {
|
||||
return element.id === contractId;
|
||||
});
|
||||
(sendAgainPop.value = true), (index.value = inde);
|
||||
pager.lists[index.value].nums = 10;
|
||||
timeFn(index.value);
|
||||
});
|
||||
};
|
||||
const timeFn = (i: number) => {
|
||||
const timers = setInterval(() => {
|
||||
pager.lists[i].nums--;
|
||||
if (pager.lists[i].nums <= 0) {
|
||||
clearInterval(timers);
|
||||
}
|
||||
}, 1000);
|
||||
};
|
||||
const sendContractPopFn = (id: number) => {
|
||||
(showPop.value = true), (sendAgainPop.value = false), (contractId = id);
|
||||
};
|
||||
const sendAgaintPopFn = (id: number) => {
|
||||
(showPop.value = true), (contractId = id);
|
||||
};
|
||||
const sendContractFn = () => {
|
||||
sendContract({ id: contractId }).then((res) => {
|
||||
feedback.msgSuccess("发送成功");
|
||||
var inde = pager.lists.findIndex(function (element) {
|
||||
return element.id === contractId;
|
||||
});
|
||||
index.value = inde;
|
||||
showPop.value = false;
|
||||
pager.lists[index.value].status = 2;
|
||||
pager.lists[index.value].nums = 10;
|
||||
timeFn(index.value);
|
||||
});
|
||||
};
|
||||
|
||||
const offPop = () => {
|
||||
showPop.value = false;
|
||||
// showConctactPop.value = false;
|
||||
};
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
company_name: "",
|
||||
contract_no: "",
|
||||
status: "",
|
||||
});
|
||||
const statusFn = (status: number) => {
|
||||
switch (status) {
|
||||
case 0:
|
||||
return { tit: "待上传", color: "rgb(238, 190, 119)" };
|
||||
case 1:
|
||||
return { tit: "已上传", color: "rgb(103, 194, 58)" };
|
||||
case 2:
|
||||
return { tit: "签约中", color: "red" };
|
||||
case 3:
|
||||
return { tit: "已签约", color: "rgb(103, 194, 58)" };
|
||||
// default:
|
||||
// return { tit: "审核通过", color: "green" };
|
||||
}
|
||||
};
|
||||
const typeFn = (status: number) => {
|
||||
switch (status) {
|
||||
case 0:
|
||||
return "租赁合同";
|
||||
case 1:
|
||||
return "自有车辆合同";
|
||||
case 2:
|
||||
return "解除合同";
|
||||
case 3:
|
||||
return "购买合同";
|
||||
default:
|
||||
}
|
||||
};
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([]);
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id);
|
||||
};
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData("");
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: leaseContractList,
|
||||
params: queryParams,
|
||||
});
|
||||
|
||||
getLists();
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.btn {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
h1 {
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
font-size: 30px;
|
||||
color: red;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.content {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.info {
|
||||
color: red;
|
||||
font-weight: bold;
|
||||
font-size: 18px;
|
||||
display: inline-block;
|
||||
margin: 0 5px;
|
||||
}
|
||||
|
||||
.btn_menu {
|
||||
margin-top: 10vh;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
}
|
||||
</style>
|
Loading…
Reference in New Issue