Compare commits

...

92 Commits

Author SHA1 Message Date
zmj
5564df2f7f add 2024-02-26 15:51:04 +08:00
zmj
0119870a32 任务下发编辑页面修改 2024-02-21 17:38:44 +08:00
zmj
004af44815 add 2024-02-05 16:46:21 +08:00
zmj
d643900fe6 更新 2024-02-02 23:31:09 +08:00
zmj
c982e885b6 用户信息查询 2024-01-23 22:00:23 +08:00
zmj
6440e2aecb 更新 2024-01-23 08:57:35 +08:00
lxz
b3f830138a 新增任务下发 2024-01-16 10:33:20 +08:00
lxz
a030a96bda 用户创建新增字段 2024-01-12 11:40:56 +08:00
lxz
c28169ade9 gognxiao 2023-12-29 18:49:40 +08:00
lxz
a46a49e750 任务 2023-12-26 18:00:18 +08:00
zmj
408ff1c8b0 页面xiugai 2023-12-23 18:04:45 +08:00
zmj
e67c693c01 任务详情 2023-12-23 13:38:11 +08:00
zmj
d3d0f5d7fd 创建公司非必选 2023-12-23 11:51:25 +08:00
zmj
8b75c65885 yemian 2023-12-22 11:31:39 +08:00
zmj
b68233f940 页面修改 2023-12-22 11:04:10 +08:00
zmj
c0e799f4c7 任务下发时间 2023-12-20 23:39:23 +08:00
zmj
94acc43af9 任务模板 2023-12-19 14:04:38 +08:00
zmj
08df68d6c1 任务模板 2023-12-19 11:43:25 +08:00
zmj
00b8687aec 任务模板新增 2023-12-18 18:48:18 +08:00
chenbo
3b6214d40e add 2023-12-18 15:19:46 +08:00
chenbo
20155577ee add 2023-12-18 15:08:37 +08:00
chenbo
1130fe0640 任务模板管理 2023-12-18 15:01:44 +08:00
chenbo
3d622262af 任务模板管理 2023-12-18 14:54:49 +08:00
chenbo
7c5fae74fb 任务创建模板管理 2023-12-18 14:15:24 +08:00
chenbo
f2a4ea7dce 镇农科公司任务改到镇合伙人公司 2023-11-23 15:30:54 +08:00
zmj
cb9cfdf0f2 页面修改 2023-11-18 20:17:42 +08:00
zmj
dd8682772e test 2023-11-18 14:01:37 +08:00
zmj
04a4122641 三轮车合同状态修改 2023-11-18 13:39:44 +08:00
zmj
e50a2ae9ed s 2023-11-18 10:37:28 +08:00
zmj
4442cd01b3 sd 2023-11-17 17:49:16 +08:00
zmj
5c38208f01 ye 2023-11-17 17:44:48 +08:00
chenbo
4f523974e4 Merge branch 'feature' of https://gitea.lihaink.cn/mkm/TaskSystem-admin into feature 2023-11-17 17:20:32 +08:00
chenbo
c27afa15a0 打包时不打后端api接口地址 2023-11-17 12:01:03 +08:00
zmj
3f19b55b3a 页面修改 2023-11-17 11:36:44 +08:00
zmj
a99a555ef9 页面修改 2023-11-13 14:27:53 +08:00
zmj
be86fee989 bug修复 2023-11-13 09:51:13 +08:00
zmj
fb97af61f2 bug修复 2023-11-11 13:46:17 +08:00
zmj
ae9ddf81d5 bug修复 2023-11-10 16:35:25 +08:00
zmj
caf22885f7 合同 2023-11-09 19:04:32 +08:00
zmj
5421d71140 镇负责人收集任务 2023-11-08 09:51:19 +08:00
jia
16c46dcf32 供销后台:档案管理-档案列表,列表中已分析的档案需要增加一个“查看商机”的按钮 2023-11-07 18:14:39 +08:00
weipengfei
ed8c15cc3b 修复bug 2023-10-30 16:05:30 +08:00
weipengfei
c422239a05 更新商品多选 2023-10-27 10:59:22 +08:00
weipengfei
369e7a5c23 新增商户申请审批列表 2023-10-26 14:39:23 +08:00
weipengfei
58716ed3cc 修复镇级公司详情不选中地址的问题 2023-10-24 17:53:38 +08:00
weipengfei
48bc4f6331 修复公司详情不选中菜单的问题 2023-10-24 16:56:58 +08:00
weipengfei
b0b1d53f8e 更新指定商品功能 2023-10-24 15:44:39 +08:00
weipengfei
09cb9a43df 更新任务审批 2023-10-24 15:44:16 +08:00
weipengfei
bf64e4d08b 更新任务审批类型 2023-10-23 18:06:34 +08:00
weipengfei
f91a4f520b 入股甲方公司新增目标数 2023-10-23 13:47:50 +08:00
weipengfei
943a7224e0 更新村公司任务目标数数显示逻辑 2023-10-20 18:06:58 +08:00
weipengfei
79a2625328 更新 2023-10-20 17:22:20 +08:00
weipengfei
ccbafb95a0 Merge branch 'xin' of https://gitea.lihaink.cn/mkm/TaskSystem-admin into feature 2023-10-20 17:18:02 +08:00
weipengfei
37aca92d81 更新 2023-10-20 17:17:10 +08:00
weipengfei
4e52a2c364 更新镇村任务的目标数 2023-10-20 11:28:39 +08:00
weipengfei
5a9f9ae5f5 更新市场部长任务审批 2023-10-20 10:39:11 +08:00
weipengfei
e87ebdc5da 市场部长任务2新增目标数 2023-10-20 09:23:15 +08:00
weipengfei
3cc548e5c6 市场部长任务3显示目标数 2023-10-20 09:19:58 +08:00
weipengfei
0f1bdc9215 Merge branch 'feature' of https://gitea.lihaink.cn/mkm/TaskSystem-admin into feature 2023-10-19 18:09:56 +08:00
weipengfei
217d58da50 更新市场部长任务审批 2023-10-19 18:09:50 +08:00
zmj
4f12a72e28 im 2023-10-19 14:49:57 +08:00
zmj
d1676f26d9 im合并 2023-10-19 14:47:05 +08:00
zmj
61046a45d1 域名配置 2023-10-19 14:33:52 +08:00
zmj
085cc12542 购买三轮车修复 2023-10-19 14:20:28 +08:00
weipengfei
66e6c3889c 取消选择任务时控制台打印 2023-10-19 10:36:57 +08:00
weipengfei
1a002ce6f2 更新村公司任务 2023-10-19 10:34:26 +08:00
weipengfei
3cdf79a6e4 更新目标数 2023-10-19 09:23:42 +08:00
weipengfei
b9c1d0684a 新增了按照任务类型划分可填写阶段 2023-10-17 21:00:15 +08:00
weipengfei
255719bb20 更新了不同任务设置目标数 2023-10-17 19:11:49 +08:00
weipengfei
0f8f13b629 修复镇级公司地区显示异常的bug 2023-10-17 18:33:27 +08:00
weipengfei
e6ee848d36 更新押金充值凭证功能 2023-10-17 17:15:32 +08:00
weipengfei
805fa91f52 修复余额错误的问题 2023-10-17 17:15:08 +08:00
weipengfei
37ac601469 更新域名配置 2023-10-17 15:37:08 +08:00
weipengfei
46680f8985 新增凭证录入时回显甲方公司 2023-10-17 15:02:44 +08:00
weipengfei
dde799e222 新增押金凭证录入 2023-10-17 14:42:57 +08:00
weipengfei
58dfac9a55 优化上传文件效果 2023-10-17 14:42:16 +08:00
weipengfei
2500669524 修改对公账号 2023-10-16 19:24:03 +08:00
weipengfei
c470fbc2dc 更新创建公司时输入对公账户 2023-10-16 19:19:42 +08:00
jia
2d50a10cd0 增加商机分析功能 2023-10-16 16:13:34 +08:00
THK3121
8c4c26f554 im页面完成 2023-10-11 16:59:50 +08:00
THK3121
4dfbb67c65 测试 2023-10-11 16:15:48 +08:00
weipengfei
82410a97a7 新增添加用户,优化用户详情页 2023-10-11 14:36:56 +08:00
weipengfei
3c12f41818 取消长度限制 2023-10-11 11:40:03 +08:00
weipengfei
68e15cdcb2 修复任务安排回显bug 2023-10-11 11:35:37 +08:00
weipengfei
35a0f3364f 更新任务负责人 2023-10-11 09:37:42 +08:00
weipengfei
793ce79b89 更新生成合同选择甲方公司列表 2023-10-10 15:40:52 +08:00
weipengfei
288554451e 更新公司类型选择地区冲突的问题,新增同级别地区公司类型切换时清空已选地区 2023-10-10 11:20:25 +08:00
weipengfei
3f9a62fac1 更新镇农科任务指派角色 2023-10-10 09:40:17 +08:00
chenbo
2ad137c5b7 镇农科新增任务模板-选择任务角色 2023-10-10 09:11:30 +08:00
weipengfei
4e86927b77 新增企业认证后不可编辑 2023-10-09 09:09:44 +08:00
weipengfei
95c7d2e588 更新三轮车 2023-09-27 11:00:41 +08:00
weipengfei
177cc9db9f 更新镇农科任务安排第五个的任务日期安排 2023-09-26 14:14:27 +08:00
85 changed files with 12667 additions and 6709 deletions

View File

@ -1,5 +1,9 @@
NODE_ENV = 'development'
VITE_APP_BASE_URL = 'https://ceshi-worker-task.lihaink.cn'
# VITE_APP_BASE_URL = 'https://new-worker.lihaink.cn/'
#
# VITE_APP_BASE_URL = 'https://ceshi-new-wokr.lihaink.cn/'
# VITE_APP_BASE_URL = 'https://worker-task.lihaink.cn'
VITE_APP_BASE_URL = 'https://ceshi-new-wokr.lihaink.cn/'
# VITE_APP_BASE_URL = 'http://192.168.1.30:8083'

2592
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -20,7 +20,7 @@
"axios": "^0.27.2",
"css-color-function": "^1.3.3",
"echarts": "^5.3.3",
"element-plus": "^2.2.9",
"element-plus": "^2.4.4",
"highlight.js": "^11.6.0",
"nprogress": "^0.2.0",
"pinia": "^2.0.14",

View File

@ -1,6 +1,7 @@
<script setup lang="ts">
import { useDark, useWindowSize, useThrottleFn } from '@vueuse/core'
import zhCn from 'element-plus/lib/locale/lang/zh-cn'
// import zhCn from 'element-plus/lib/locale/lang/zh-cn'
import zhCn from "element-plus/es/locale/lang/zh-cn";
import useAppStore from './stores/modules/app'
import useSettingStore from './stores/modules/setting'
import { ScreenEnum } from './enums/appEnums'

View File

@ -29,6 +29,12 @@ export function apiCompanyDetail(params: any) {
export function apiSubordinateList(params: any) {
return request.get({ url: '/company/subordinate', params })
}
// 获取甲方公司类型
export function getContractPartyACompanyTypeList(params: any) {
return request.get({ url: '/setting.dict.dict_data/getContractPartyACompanyTypeList', params })
}
// 重新发送短信
export function sendMsgApi(params: any) {
return request.get({ url: '/company/postsms', params })
@ -41,6 +47,10 @@ export function initiate_contract(params: any) {
export function generateGontract(params: any) {
return request.get({ url: '/company/Draftingcontracts', params })
}
// 发送个人合同
export function userGontract(params: any) {
return request.get({ url: '/user.user/Draftingcontracts', params })
}
// 发送短信
export function authentication(params: any) {
return request.get({ url: '/company/authentication', params })
@ -59,4 +69,21 @@ export function companyResponsibleArea(params: any) {
// 人脸采集
export function organizationFaceCreate(params: any) {
return request.get({ url: '/company/organizationFaceCreate', params })
}
}
// 押金线下对公账号转账凭证录入接口
export function depositRechargeTransferVoucher(params: any) {
return request.post({ url: '/company/depositRechargeTransferVoucher', params })
}
// 获取押金凭证录入列表
export function getDepositRechargeTransferVoucherList(params: any) {
return request.get({ url: '/company/getDepositRechargeTransferVoucherList', params })
}
// 根据公司id获取甲方公司信息
export function getPartyAbyCompanyId(params: any) {
return request.get({ url: '/company/getPartyA', params })
}

View File

@ -12,7 +12,10 @@ export function getUserList(params: any) {
export function getUserDetail(params: any) {
return request.get({ url: "/user.user/detail", params });
}
// 导出用户
export function exportUerLists(params: any) {
return request.get({ url: "/user.user/lists?export=2", params });
}
// 用户编辑
export function userEdit(params: any) {
return request.post({ url: "/user.user/edit", params });
@ -38,3 +41,18 @@ export function creatContact(params: any) {
export function sendMsgApi(params: any) {
return request.get({ url: "/contract.contract/postsms", params });
}
//公司下拉列表
export function getCompanyList(params: any) {
return request.get({ url: "/user.user/getCompanyList", params });
}
//角色下拉列表
export function getRolelist(params: any) {
return request.get({ url: "/user.userRole/getlist", params });
}
//创建用户
export function userAdd(params: any) {
return request.post({ url: "/user.user/add", params });
}

View File

@ -0,0 +1,39 @@
import request from '@/utils/request'
// 任务创建模板列表
export function apiCreateTaskTemplateLists(params: any) {
return request.get({ url: '/create_task_template.create_task_template/lists', params })
}
// 添加任务创建模板
export function apiCreateTaskTemplateAdd(params: any) {
return request.post({ url: '/create_task_template.create_task_template/add', params })
}
// 编辑任务创建模板
export function apiCreateTaskTemplateEdit(params: any) {
return request.post({ url: '/create_task_template.create_task_template/edit', params })
}
// 删除任务创建模板
export function apiCreateTaskTemplateDelete(params: any) {
return request.post({ url: '/create_task_template.create_task_template/delete', params })
}
// 任务创建模板详情
export function apiCreateTaskTemplateDetail(params: any) {
return request.get({ url: '/create_task_template.create_task_template/detail', params })
}
// 任务创建模板列表
export function apiCreateTaskTypeLists(params: any) {
return request.get({ url: '/create_task_template.create_task_template/taskTypeList', params })
}
// 任务创建模板列表
export function apiCreatetaskTypeInfo() {
return request.get({ url: '/create_task_template.create_task_template/taskTypeInfo' })
}
// 任务创建模板列表
export function apiSelectList(params: any) {
return request.get({ url: '/create_task_template.create_task_template/selectList',params })
}

View File

@ -37,5 +37,10 @@ export function apiApproveList(params: any) {
// 任务审批(待审批列表)
export function apiApproveAudit(params: any) {
return request.get({ url: "/approve.approve/audit", params });
return request.post({ url: "/approve.approve/audit", params });
}
// 商户入驻,开通交易审批列表
export function apiApproveList2(params: any) {
return request.get({ url: "/approve.approve/lists2", params });
}

19
src/api/newTask.ts Normal file
View File

@ -0,0 +1,19 @@
import request from '@/utils/request'
//添加任务
export function addTask(params: any) {
return request.post({ url: '/task/addTask', params })
}
//任务列表
export function taskList(params: any) {
return request.get({ url: '/task/taskList', params })
}
//任务列表
export function editTask(params: any) {
return request.post({ url: '/task/editTask', params })
}
// 用户角色
export function apiUserRoleLists() {
return request.get({ url: '/user.user_role/getList' })
}

View File

@ -59,3 +59,12 @@ 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: '/setting.dict.dict_data/getTaskApproveTypeList', params })
}
// 入股任务类型
export function getShareholderMoneyTaskApproveTypeList() {
return request.get({ url: '/setting.dict.dict_data/getShareholderMoneyTaskApproveTypeList' })
}

View File

@ -0,0 +1,12 @@
import request from '@/utils/request'
// 商户合同列表
export function apiApproveLists(params: any) {
return request.get({ url: '/approve.approve/lists3', params })
}
// 任务审批(待审批列表)
export function apiApproveAudit(params: any) {
return request.post({ url: "/approve.approve/shareholderMoneyTaskAudit", params });
}

22
src/api/talk.ts Normal file
View File

@ -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 });

View File

@ -20,7 +20,20 @@ export function apiTaskDelete(params: any) {
export function apiTaskList(params: any) {
return request.get({ url: '/task_scheduling_plan.task_scheduling_plan/lists', params })
}
//任务日程-详情
export function apiTaskDetails(params: any) {
return request.get({ url: '/task_scheduling_plan.task_scheduling_plan/detail', params })
}
// renwu
//任务日程-详情
export function getDayTaskList(params: any) {
return request.get({ url: '/task_scheduling_plan.task_scheduling_plan/getDayTaskList', params })
}
//任务日程-详情
export function taskProgress(params: any) {
return request.get({ url: '/task/taskProgress', params })
}

View File

@ -17,7 +17,7 @@ export function apiTaskTemplateEdit(params: any) {
// 删除任务安排
export function apiTaskTemplateDelete(params: any) {
return request.post({ url: '/task_template.task_template/delete', params })
return request.post({ url: '/task.task/delete', params })
}
// 任务安排详情
@ -29,3 +29,8 @@ export function apiTaskTemplateDetail(params: any) {
export function apiTaskTypeList(params: any) {
return request.get({ url: '/setting.dict.dict_data/lists', params })
}
// 指定商品
export function apiGetProductList(params: any) {
return request.get({ url: '/task_template.task_template/getProductList', params })
}

View File

@ -0,0 +1,26 @@
import request from '@/utils/request'
// 村或社区人员建档目标数列表
export function apiUserInformationThresholdLists(params: any) {
return request.get({ url: '/user_information_threshold/lists', params })
}
// 添加村或社区人员建档目标数
export function apiUserInformationThresholdAdd(params: any) {
return request.post({ url: '/user_information_threshold/add', params })
}
// 编辑村或社区人员建档目标数
export function apiUserInformationThresholdEdit(params: any) {
return request.post({ url: '/user_information_threshold/edit', params })
}
// 删除村或社区人员建档目标数
export function apiUserInformationThresholdDelete(params: any) {
return request.post({ url: '/user_information_threshold/delete', params })
}
// 村或社区人员建档目标数详情
export function apiUserInformationThresholdDetail(params: any) {
return request.get({ url: '/user_information_threshold/detail', params })
}

7
src/api/villageInfo.ts Normal file
View File

@ -0,0 +1,7 @@
import request from '@/utils/request'
// 提现申请列表
export function apivillageInfoLists(params: any) {
return request.get({ url: '/user.user/villageInfoList',params })
}

BIN
src/assets/images/SP.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

BIN
src/assets/images/XC.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

View File

@ -8,5 +8,4 @@ const config = {
urlPrefix: "adminapi", //请求默认前缀
timeout: 20 * 1000, //请求超时时长
};
export default config;

View File

@ -8,6 +8,7 @@ interface Options {
fetchFun: (_arg: any) => Promise<any>;
params?: Record<any, any>;
firstLoading?: boolean;
json: string | undefined; // 用户指定返回的数据中包含json时, 转换
}
export function usePaging(options: Options) {
@ -17,6 +18,7 @@ export function usePaging(options: Options) {
fetchFun,
params = {},
firstLoading = false,
json
} = options;
// 记录分页初始参数
const paramsInit: Record<any, any> = Object.assign({}, toRaw(params));
@ -43,6 +45,11 @@ export function usePaging(options: Options) {
if(pager.lists==[]||pager.lists==null||pager.lists==undefined)res.list ? pager.lists = res.list: null;
// pager.lists = res?.lists
pager.extend = res?.extend;
if(json){
res.lists.forEach((item:any)=>{
typeof item[json] == 'string' ? item[json] = JSON.parse(item[json]) : null ;
})
}
return Promise.resolve(res);
})
.catch((err: any) => {

View File

@ -1,6 +1,10 @@
import { createApp } from 'vue'
import App from './App.vue'
import install from './install'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import './permission'
import './styles/index.scss'
import 'virtual:svg-icons-register'
@ -12,6 +16,7 @@ window._AMapSecurityConfig = {
const app = createApp(App)
app.use(install)
app.use(ElementPlus)
app.provide('base_url', configs.baseUrl+configs.urlPrefix);
app.mount('#app')
app.config.warnHandler = () => null
app.config.warnHandler = () => null

131
src/utils/request/indexs.ts Normal file
View File

@ -0,0 +1,131 @@
import { merge } from "lodash";
import configs from "@/config";
import { Axios } from "./axios";
import {
ContentTypeEnum,
RequestCodeEnum,
RequestMethodsEnum,
} from "@/enums/requestEnums";
import type { AxiosHooks } from "./type";
import { clearAuthInfo, getToken } from "../auth";
import feedback from "../feedback";
import NProgress from "nprogress";
import { AxiosError, type AxiosRequestConfig } from "axios";
import router from "@/router";
import { PageEnum } from "@/enums/pageEnum";
// 处理axios的钩子函数
const axiosHooks: AxiosHooks = {
requestInterceptorsHook(config) {
NProgress.start();
const { withToken, isParamsToData } = config.requestOptions;
const params = config.params || {};
const headers = config.headers || {};
// 添加token
if (withToken) {
const token = getToken();
headers.token = token;
}
// POST请求下如果无data则将params视为data
if (
isParamsToData &&
!Reflect.has(config, "data") &&
config.method?.toUpperCase() === RequestMethodsEnum.POST
) {
config.data = params;
config.params = {};
}
config.headers = headers;
return config;
},
requestInterceptorsCatchHook(err) {
NProgress.done();
return err;
},
async responseInterceptorsHook(response) {
NProgress.done();
const { isTransformResponse, isReturnDefaultResponse } =
response.config.requestOptions;
//返回默认响应,当需要获取响应头及其他数据时可使用
if (isReturnDefaultResponse) {
return response;
}
// 是否需要对数据进行处理
if (!isTransformResponse) {
return response.data;
}
const { code, data, show, msg } = response.data;
switch (code) {
case RequestCodeEnum.SUCCESS:
if (show) {
msg && feedback.msgSuccess(msg);
}
return data;
case RequestCodeEnum.FAIL:
if (show) {
msg && feedback.msgError(msg);
}
return Promise.reject(data);
case RequestCodeEnum.LOGIN_FAILURE:
clearAuthInfo();
router.push(PageEnum.LOGIN);
return Promise.reject();
case RequestCodeEnum.OPEN_NEW_PAGE:
window.location.href = data.url;
return data;
default:
return data;
}
},
responseInterceptorsCatchHook(error) {
NProgress.done();
if (error.code !== AxiosError.ERR_CANCELED) {
error.message && feedback.msgError(error.message);
}
return Promise.reject(error);
},
};
const defaultOptions: AxiosRequestConfig = {
//接口超时时间
timeout: configs.timeout,
// 基础接口地
baseURL: configs.baseUrl,
// baseURL: "http://192.168.1.11:8081/",
//请求头
headers: { "Content-Type": ContentTypeEnum.JSON, version: configs.version },
// 处理 axios的钩子函数
axiosHooks: axiosHooks,
// 每个接口可以单独配置
requestOptions: {
// 是否将params视为data参数仅限post请求
isParamsToData: true,
//是否返回默认的响应
isReturnDefaultResponse: false,
// 需要对返回数据进行处理
isTransformResponse: true,
// 接口拼接地址
urlPrefix: "",
// 忽略重复请求
ignoreCancelToken: false,
// 是否携带token
withToken: true,
// 开启请求超时重新发起请求请求机制
isOpenRetry: true,
// 重新请求次数
retryCount: 2,
},
};
function createAxios(opt?: Partial<AxiosRequestConfig>) {
return new Axios(
// 深度合并
merge(defaultOptions, opt || {})
);
}
const request = createAxios();
export default request;

View File

@ -0,0 +1,686 @@
<template>
<div class="box">
<div class="talk-list">
<div class="mt-4 serch">
<el-input v-model="queryUserName" placeholder="搜索联系人" class="input-with-select">
<template #append>
<el-button :icon="Search" @click="serchUserFn" />
</template>
</el-input>
</div>
<div style="height: 5vh;"></div>
<div class="contacts" v-for="(item, index) in userList" :key="index" @click="choseTalkFn(item, index)">
<div class="l">
<div style="position: relative;">
<el-image style="width: 40px; height: 40px" :src="item.avatar" />
<div class="brage" v-if="item.no_read_num">{{ item.no_read_num }}</div>
</div>
<div class="tit-a">
<div>{{ item.name }}</div>
<div v-if="item.last_msg_type == 'text'" class="value">{{ item.last_msg_content }}</div>
<div v-if="item.last_msg_type == 'image'" class="value">[图片]</div>
<div v-if="item.last_msg_type == 'video'" class="value">[视频]</div>
</div>
</div>
<div class="r">
{{ timeFn(item.last_msg_time) }}
</div>
</div>
</div>
<div class="talk-detail" id="content">
<div class="top">
{{ talkDetail.name }}
</div>
<div style="height: 4vh"></div>
<div class="center" id="center" @scroll="handleScroll">
<div class="talk" v-for="(item, index) in talkDetail.talkList" :key="index">
<div style="text-align: center;" v-show="index % 5 == 0">{{ timeFn(item.create_time) }}</div>
<!-- 我的消息 -->
<div class="my_task" v-if="item.from_user_id == user_id">
<div class="content">
<!-- 文本 -->
<div v-if="item.type == 'text'">
<a :href="item.content" v-if="isLink(item.content)" target="_blank"
style="color: #576B95;">{{
item.content }}
</a>
<div v-else> {{ item.content }}</div>
</div>
<!-- 图片 -->
<div v-if="item.type == 'image'">
<el-image style="width: 100px;height: auto;" :src="item.content" :preview-src-list="srcList"
@click="PreviewImgFn(item)"></el-image>
</div>
<!-- 视频 -->
<div v-if="item.type == 'video'">
<video controls :src="item.content"></video>
</div>
</div>
<el-image style="width: 40px; height: 40px" :src="userStore.userInfo.avatar" />
</div>
<!-- 对方消息 -->
<div class="to_task" v-else>
<el-image style="width: 40px; height: 40px;margin-right: 5px;" :src="item.from_user_avatar" />
<div class="content">
<!-- 文本 -->
<div v-if="item.type == 'text'">
<a :href="item.content" target="_blank" v-if="isLink(item.content)"
style="color: #576B95;">{{
item.content }}
</a>
<div v-else> {{ item.content }}</div>
</div>
<!-- 图片 -->
<div v-if="item.type == 'image'">
<el-image style="width: 100px;height: auto;" :src="item.content" :preview-src-list="srcList"
@click="PreviewImgFn(item)"></el-image>
</div>
<!-- 视频 -->
<div v-if="item.type == 'video'">
<video controls :src="item.content"></video>
</div>
</div>
</div>
</div>
<!-- 本地 -->
<div v-show="item.status" class="my_task" v-for="item, index in local">
<!-- <div></div> -->
<!-- <div >上传中</div> -->
<div class="content" v-loading="true">
<div style="width: 120px;margin-right: 10px;">
<video controls :src="item.localSrc" v-if="item.type == 'video'"></video>
<img controls :src="item.localSrc" v-else />
</div>
<!-- <el-progress :text-inside="true" :stroke-width="14" :percentage="item.percentage" /> -->
</div>
<el-image style="width: 40px; height: 40px;margin-right: 10px;" :src="url" />
</div>
</div>
<div class="bottom">
<div style="display: flex;">
<el-upload :action="base_url + '/common/im/sendFileMsg'" :data="{
from_user_id: user_id,
to_user_id: talkDetail.to_user_id,
scene: 1,
type: 'image',
msg_id: msg_id
}" multiple :show-file-list="false" :on-success="handleAvatarSuccess" :before-upload="changeFile">
<img class="img_cls" src="@/assets/images/XC.png" style="width: 50px;height: 50px;" />
</el-upload>
<el-upload :action="base_url + '/common/im/sendFileMsg'" :data="{
from_user_id: user_id,
to_user_id: talkDetail.to_user_id,
scene: 1,
type: 'video',
msg_id: msg_id
}" multiple :show-file-list="false" :on-success="handleAvatarSuccess" :before-upload="changeFile1">
<img style="width: 50px; height: 50px" src="@/assets/images/SP.png" />
</el-upload>
</div>
<el-input v-model="textarea" style="border: none;outline: none;" placeholder="请输入..."
@keydown="keyup_submit(event)" />
<div class="send-btn" @click="sendMsgFn">发送</div>
</div>
<!-- <div style="height: 30vh;"></div> -->
</div>
</div>
</template>
<script lang="ts" scoped setup>
import { reactive, ref, onBeforeUnmount } from 'vue';
import { Search } from '@element-plus/icons-vue'
import feedback from '@/utils/feedback'
import {
sendMsgApi, getMsgListApi, bindScoket, sendFileApi, getContactListApi
} from "@/api/talk"
import { ElMessage } from 'element-plus'
import useUserStore from "@/stores/modules/user";
import { inject } from "vue";
const base_url: any = inject("base_url").replace('adminapi', '');
const userStore = useUserStore();
const user_id = userStore.userInfo.id
let page_no = 1
let to_id: any = null
//
const srcList: any = reactive(
[]
)
const PreviewImgFn = (item: any) => {
srcList[0] = item.content
}
//
const handleScroll = (e) => {
let top = e.target.scrollTop
if (top <= 0) {
page_no++
getMsgListApi({
from_user_id: user_id,
to_user_id: to_id,
scene: 1,
page_no: page_no,
page_size: 10
}).then(res2 => {
if (res2.length <= 0) return
talkDetail.talkList = res2.reverse().concat(talkDetail.talkList)
e.target.scrollTop = 100
})
}
}
let bind = false
//
const userList = reactive([])
let queryList = reactive([])
const talkDetail = reactive({
name: "",
to_user_id: "",
talkList: [],
index: 0,
})
getContactListApi({ user_id: user_id }).then(res => {
res.forEach((element: any) => {
userList.push(element)
queryList.push(element)
});
// queryList = userList
console.log(queryList, 6666)
talkDetail.name = userList[0].name
talkDetail.to_user_id = userList[0].id
to_id = userList[0].id
getMsgListApi({
from_user_id: user_id,
to_user_id: userList[0].id,
scene: 1,
page_no: 1,
page_size: 10
}).then(res2 => {
talkDetail.talkList = res2.reverse()
// console.log(talkDetail)
})
})
const url = 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg'
//
const queryUserName = ref('')
const serchUserFn = () => {
getContactListApi({ user_id: user_id, keywords: queryUserName.value }).then(res => {
userList.splice(0, userList.length);
res.forEach((element: any) => {
// @ts-ignore
userList.push(element)
// queryList.push(element)
});
})
}
//
const isLink = (text: string) => {
var pattern = /^(https?:\/\/|www\.|.*\.com).*$/i;
return pattern.test(text);
}
const textarea = ref("")
const sendMsgFn = () => {
if (!textarea.value) return
sendMsgApi({
from_user_id: user_id,
to_user_id: talkDetail.to_user_id,
type: "text",
content: textarea.value,
scene: 1,
msg_id: msg_id.value
}).then(res => {
talkDetail.talkList.push(res)
userList[talkDetail.index].last_msg_content = textarea.value
userList[talkDetail.index].last_msg_time = res.create_time
userList[talkDetail.index].last_msg_type = 'text'
// userList[talkDetail.index].last_msg_content = textarea.value
scrollFn()
textarea.value = ""
generateRandId()
})
}
const keyup_submit = (evt: any) => {
var evt = window.event || evt;
if (evt.keyCode == 13) {
sendMsgFn()
}
}
//
let msg_id: any = ref('')
const generateRandId = () => {
var d = new Date().getTime();
var uuid = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) {
var r = (d + Math.random() * 16) % 16 | 0;
d = Math.floor(d / 16);
return (c == "x" ? r : r & 0x3 | 0x8).toString(16);
});
// return uuid;
msg_id.value = uuid
}
generateRandId()
const local = reactive([])
let localData = () => {
return {
status: false,
localType: null,
localSrc: null,
type: "",
percentage: 0,
msg_id: msg_id.value
}
}
const changeFile = (res) => {
console.log(res.type)
if (!res.type.includes('image')) {
ElMessage.error('请选择正确的图片格式!!')
return false
}
local.push(localData())
let type = 'image'
var localIndex = local.findIndex(function (element) {
return element.msg_id === msg_id.value;
});
// userList[talkDetail.index].last_msg_type = type
let file = res
local[localIndex].type = type
const blob = file;
var reader = new FileReader();
reader.readAsDataURL(blob);
//
reader.onloadend = function (e) {
local[localIndex].status = true
local[localIndex].localSrc = e.target?.result
scrollFn()
generateRandId()
};
}
const changeFile1 = (res) => {
if (!res.type.includes('video')) {
ElMessage.error('请选择正确的视频格式!!')
return false
}
local.push(localData())
let type = 'video'
var localIndex = local.findIndex(function (element) {
return element.msg_id === msg_id.value;
});
// userList[talkDetail.index].last_msg_type = type
let file = res
local[localIndex].type = type
const blob = file;
var reader = new FileReader();
reader.readAsDataURL(blob);
//
reader.onloadend = function (e) {
local[localIndex].status = true
local[localIndex].localSrc = e.target?.result
scrollFn()
generateRandId()
};
}
const handleAvatarSuccess: any = (
res: any
) => {
if (res.show == 0) {
talkDetail.talkList.push(res.data)
}
else {
feedback.msgError(res.msg)
}
var localIndex = local.findIndex(function (element) {
return element.msg_id === res.data.msg_id;
});
local[localIndex].status = false
userList[talkDetail.index].last_msg_type = res.data.type
console.log(res.data)
}
//
const choseTalkFn = (item: any, index: number) => {
userList[index].no_read_num = 0
talkDetail.name = item.name
talkDetail.to_user_id = item.id
talkDetail.index = index
to_id = item.id
getMsgListApi({
from_user_id: user_id,
to_user_id: item.id,
scene: 1,
page_no: 1,
page_size: 10
}).then(res2 => {
talkDetail.talkList = res2.reverse()
scrollFn()
})
}
//
let scrollTop: any = null
onMounted(() => {
scrollTop = document.getElementById('center')
})
const scrollFn = () => {
setTimeout(() => {
scrollTop.scrollTop = 9999999
}, 100)
}
//
const timeFn = (time) => {
const currentDate = new Date(); //
const targetDate = new Date(time * 1000);
if (isSameDay(currentDate, targetDate)) {
const hours = targetDate.getHours(); //
const minutes = targetDate.getMinutes(); //
return hours + ':' + (minutes < 10 ? '0' + minutes : minutes);
} else if (isYesterday(currentDate, targetDate)) {
return '昨天';
}
const month = targetDate.getMonth() + 1; // 01
const day = targetDate.getDate(); //
return month + '月' + day + '日';
}
const isSameDay = (date1, date2) => {
return (
date1.getFullYear() === date2.getFullYear() &&
date1.getMonth() === date2.getMonth() &&
date1.getDate() === date2.getDate()
);
}
const isYesterday = (currentDate, targetDate) => {
const yesterday = new Date(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate() - 1);
return isSameDay(yesterday, targetDate);
}
// scoket
const socket = new WebSocket('wss://worker-task.lihaink.cn/wss');
const onSocketOpen = (event: any) => {
console.log('WebSocket连接已打开');
}
const onSocketMessage = (event: any) => {
let data = JSON.parse(event.data)
if (!bind) {
let client_id = (JSON.parse(event.data).client_id)
bindScoket({
client_id: client_id,
user_id: user_id,
scene: 1,
}).then(res => {
bind = true
console.log('绑定成功')
})
}
else if (data.id) {
var index = userList.findIndex(function (element) {
return element.id == data.from_user_id;
});
// talkDetail.talkList.push(data)
if (data.from_user_id == talkDetail.to_user_id) {
console.log(data, "收到scoket消息")
talkDetail.talkList.push(data)
userList[index].last_msg_content = data.content
userList[index].last_msg_time = data.create_time
userList[index].last_msg_type = data.type
scrollFn()
} else {
userList[index].no_read_num++
userList[index].last_msg_content = data.content
userList[index].last_msg_time = data.create_time
userList[index].last_msg_type = data.type
// userList.forEach
}
}
console.log(data)
}
const onSocketClose = (event: any) => {
console.log('WebSocket连接已关闭');
}
const onSocketError = (event: any) => {
console.error('WebSocket连接发生错误');
}
socket.addEventListener('open', onSocketOpen);
socket.addEventListener('message', onSocketMessage);
socket.addEventListener('close', onSocketClose);
socket.addEventListener('error', onSocketError);
onBeforeUnmount(() => {
socket.close()
})
</script>
<style lang="scss" scoped>
:deep(.el-input__wrapper) {
box-shadow: none !important;
// border-bottom: 1px solid black;
border-radius: 0;
}
.box {
display: flex;
.serch {
background-color: #F6F6F6;
position: fixed;
top: 9vh;
width: 17vw;
z-index: 99;
padding-left: 10px;
padding-top: 10px;
}
.talk-list {
width: 20vw;
overflow: hidden;
height: 85vh;
position: relative;
// background-color: #fff;
cursor: pointer;
.contacts {
// margin-bottom: 10px;
// background-color: red;
padding: 10px;
display: flex;
justify-content: space-between;
.l {
display: flex;
.tit-a {
margin-left: 10px;
display: flex;
flex-direction: column;
justify-content: space-around;
.value {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 8vw;
}
}
}
}
}
.contacts:active {
background-color: #fff;
}
.contacts:hover {
background-color: #fff;
}
.talk-list::-webkit-scrollbar {
width: 2px;
/* 滚动条宽度 */
}
.talk-list::-webkit-scrollbar-thumb {
background-color: #888;
/* 滚动条颜色 */
border-radius: 1px;
/* 滚动条圆角 */
}
.img_cls {
margin-right: 10PX;
margin-bottom: 10PX;
cursor: pointer;
}
.talk-list:hover {
// background-color: #888;
overflow: scroll;
}
.talk-detail {
width: 80vw;
height: 85vh;
.top {
position: fixed;
height: 4vh;
width: 70vw;
box-sizing: border-box;
padding: 10px;
background-color: #fff;
z-index: 9;
border-bottom: 1px solid #EAE8E7;
}
.center {
height: 65vh;
overflow-y: scroll;
background-color: #fff;
}
.bottom {
position: fixed;
background-color: white;
height: 20vh;
border-top: 1px solid #EAE8E7;
width: 70vw;
box-sizing: border-box;
// padding-top: 10px;
padding: 10px;
}
// overflow: scroll;
}
.center::-webkit-scrollbar {
width: 2px;
/* 滚动条宽度 */
}
.center::-webkit-scrollbar-thumb {
background-color: #888;
/* 滚动条颜色 */
border-radius: 5px;
/* 滚动条圆角 */
}
.talk {
// height: 4vh;
// background-color: #fff;
padding: 10px;
margin-bottom: 10px;
}
.send-btn {
width: 50px;
height: 30px;
background-color: green;
color: white;
line-height: 30px;
text-align: center;
border-radius: 5px;
float: right;
margin-top: 5px;
cursor: pointer;
}
.send-btn:active {
background-color: yellowgreen;
}
.my_task {
display: flex;
justify-content: flex-end;
.content {
background-color: #95EC69;
border-radius: 5px;
// height: 30px;
padding: 5px;
// height: 40px;
// min-height: 40px;
margin-right: 5px;
line-height: 30px;
max-width: 20vw;
// overflow: hidden;
word-break: break-all;
overflow-wrap: break-word;
}
}
.to_task {
display: flex;
// justify-content: flex-end;
.content {
background-color: #95EC69;
border-radius: 5px;
// height: 30px;
padding: 5px 10px;
// height: 40px;
// min-height: 40px;
margin-right: 5px;
line-height: 30px;
max-width: 20vw;
word-break: break-all;
overflow-wrap: break-word;
}
}
.brage {
background-color: red;
color: white;
width: 16px;
height: 16px;
border-radius: 16px;
text-align: center;
line-height: 16px;
position: absolute;
font-size: 12px;
top: -8px;
right: -5px;
}
}
</style>

View File

@ -69,6 +69,7 @@ import {
apiCompanyLists,
companyListTwo,
apiCompanyDelete,
getContractPartyACompanyTypeList,
} from "@/api/company";
import { defineEmits } from "vue";
@ -86,8 +87,10 @@ const props = defineProps({
},
});
const typeList = props.companyTypeList.filter((item: any) => {
return item.id == 30 || item.id == 16;
//
const typeList = ref([]);
getContractPartyACompanyTypeList({}).then((res) => {
typeList.value = res;
});
//

View File

@ -7,7 +7,7 @@
:rules="formRules"
>
<!-- <div style="font-size: 1.2rem; margin: 10px 0">公司基本信息创建</div> -->
<el-col :span="24" class="el-card pt-6">
<el-col :span="24" class="pt-6 el-card">
<div class="tit">公司基本信息创建</div>
<el-row>
<el-form-item label="公司名称" prop="company_name">
@ -28,6 +28,21 @@
:style="{ width: '300px' }"
></el-input>
</el-form-item>
<el-form-item
label="对公账号"
:rules="[
{ required: true, message: '请输入对公账号', trigger: 'blur' },
]"
prop="qualification.corporate_account"
>
<el-input
v-model="formData.qualification.corporate_account"
placeholder="请输入对公账号"
clearable
:disabled="isDisabled"
:style="{ width: '300px' }"
></el-input>
</el-form-item>
<el-form-item
label="公司类型"
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]"
@ -44,6 +59,7 @@
v-for="(item, index) in datas.dictTypeLists"
:key="index"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
@ -195,7 +211,7 @@
<el-checkbox-group
v-model="formData.responsible_area"
@change="handleCheckedCitiesChange"
:disabled="isDisabled"
:disabled="isDisabled ||formData.company_type==17"
>
<el-checkbox
:disabled="
@ -217,7 +233,7 @@
</el-col>
</el-row>
</el-col>
<el-col :span="24" class="el-card pt-6">
<el-col :span="24" class="pt-6 el-card">
<div class="tit">主要联系人</div>
<!-- <div
style="
@ -337,7 +353,7 @@
</el-main>
</el-container>
</el-col>
<el-col :span="24" class="el-card pt-6">
<el-col :span="24" class="pt-6 el-card">
<div class="tit">其他联系人</div>
<el-row>
@ -413,7 +429,7 @@
</el-row>
</el-col>
<!-- <div style="font-size: 1.2rem; margin: 10px 0">资质信息</div> -->
<el-col :span="24" class="el-card pt-6">
<el-col :span="24" class="pt-6 el-card">
<div class="tit">资质信息</div>
<el-row>
@ -423,7 +439,7 @@
:disabled="isDisabled"
:accept="acceptFileTypes"
v-model="formData.qualification.business_license"
class="avatar-uploader pl-3"
class="pl-3 avatar-uploader"
:data="{ cid: 1 }"
:headers="{ Token: userStore.token }"
:action="base_url + '/upload/image'"
@ -452,7 +468,7 @@
v-if="imgflag"
:accept="acceptFileTypes"
:disabled="isDisabled"
class="avatar-uploader pl-3"
class="pl-3 avatar-uploader"
:data="{ cid: 1 }"
:headers="{ Token: userStore.token }"
:action="base_url + '/upload/image'"
@ -472,7 +488,7 @@
:disabled="isDisabled"
:accept="acceptFileTypes"
v-model="formData.qualification.business_licenseB"
class="avatar-uploader pl-3"
class="pl-3 avatar-uploader"
:data="{ cid: 1 }"
:headers="{ Token: userStore.token }"
:action="base_url + '/upload/image'"
@ -493,8 +509,8 @@
</el-row>
</el-col>
<!-- <div style="font-size: 1.2rem; margin: 10px 0">电子合同</div> -->
<!-- <el-col v-if="isshow" :span="24" class="el-card pt-6"> -->
<el-col v-if="false" :span="24" class="el-card pt-6">
<!-- <el-col v-if="isshow" :span="24" class="pt-6 el-card"> -->
<el-col v-if="false" :span="24" class="pt-6 el-card">
<div class="tit">电子合同</div>
<el-row>
@ -575,7 +591,7 @@
</el-col>
</el-row>
</el-col>
<!-- <el-col v-if="isshow" :span="24" class="el-card pt-6">
<!-- <el-col v-if="isshow" :span="24" class="pt-6 el-card">
<el-row>
<el-col :span="24">
<el-form-item label="合同上传" required>
@ -599,7 +615,7 @@
<el-col
v-if="(isDisabled == false && isEdit == false) || isEdit"
:span="24"
class="el-card pt-6"
class="pt-6 el-card"
>
<el-form-item label prop="field139">
<el-button v-if="isEdit" type="primary" size="medium" @click="create"
@ -676,7 +692,6 @@ if (route.query.isshow) {
}
const acceptFileTypes = ref(".png, .jpg, .jpeg, image/png, image/jpeg");
console.log(isDisabled);
//
const indexType = ref(0);
@ -727,6 +742,7 @@ const formData = reactive({
master_email: "",
other_contacts: [],
qualification: {
corporate_account: "", //
business_license: "",
business_licenseB: "",
other_qualifications: [],
@ -878,6 +894,7 @@ const setFormData = async (data: Record<any, any>) => {
formData[key] = data[key];
}
}
console.log(formData);
};
const getDetail = async (row: Record<string, any>) => {
@ -962,7 +979,7 @@ function otherdelete() {
email: "",
});
}
function company_type_change(type: any) {
function company_type_change(type: any, clear: boolean | undefined = true) {
//
const arr = [30, 14, 15];
if (arr.indexOf(type) > -1) {
@ -976,7 +993,7 @@ function company_type_change(type: any) {
regionType.value = "area";
return true;
}
//
//
if (type == 16) {
isArea.value = true;
isStreet.value = true;
@ -984,6 +1001,12 @@ function company_type_change(type: any) {
isBrigade.value = false;
formData.village = "";
formData.brigade = "";
if (!formData.id) {
//
formData.street = "";
formData.area = "";
}
if (clear) formData.responsible_area = []; //
partyDisabled.value = true;
indexType.value = 30;
regionType.value = "street";
@ -992,7 +1015,7 @@ function company_type_change(type: any) {
if (type != 16) {
partyDisabled.value = false;
}
//
//
if (type == 41) {
isArea.value = true;
isStreet.value = true;
@ -1000,6 +1023,12 @@ function company_type_change(type: any) {
isBrigade.value = false;
formData.village = "";
formData.brigade = "";
if (!formData.id) {
//
formData.street = "";
formData.area = "";
}
if (clear) formData.responsible_area = []; //
// partyDisabled.value = true;
// indexType.value = 30;
regionType.value = "street";
@ -1059,12 +1088,12 @@ const getAreaList = async () => {
};
const getStreetList = async () => {
const data = await apiStreetList({ street: formData.area });
if (formData.company_type == 16) {
if (formData.company_type == 16 || formData.company_type == 41) {
const f = await companyResponsibleArea({
key: "area",
value: formData.area,
company_type: formData.company_type,
});
console.log(f);
data.forEach((item: any) => {
if (Object.values(f).find((t: any) => item.street_code == t + ""))
@ -1080,6 +1109,7 @@ const getVillageList = async () => {
const f = await companyResponsibleArea({
key: "street",
value: formData.street,
company_type: formData.company_type,
});
data.forEach((item: any) => {
if (Object.values(f).find((t: any) => item.village_code == t + ""))
@ -1095,6 +1125,7 @@ const getBrigadeList = async () => {
const f = await companyResponsibleArea({
key: "village",
value: formData.village,
company_type: formData.company_type,
});
data.forEach((item: any) => {
if (Object.values(f).find((t: any) => item.id == t + ""))
@ -1126,14 +1157,6 @@ const getDetails = async () => {
partyDisabled.value = true;
}
Object.keys(formData).forEach((key) => {
const stringArr = [
"province",
"city",
"area",
"street",
"village",
"brigade",
];
if (data[key] != null && data[key] != undefined) {
formData[key] = data[key];
// if (
@ -1161,7 +1184,17 @@ const getDetails = async () => {
// }
// }
}
if (stringArr.includes(key)) formData[key] = formData[key].toString();
});
const stringArr = [
"province",
"city",
"area",
"street",
"village",
"brigade",
];
stringArr.forEach((key: string) => {
formData[key] = formData[key].toString();
});
await getCityList();
await getAreaList();
@ -1174,7 +1207,8 @@ const getDetails = async () => {
// fileList.value[0].url = data.contract?.file
// fileList.value[0].name = ''
// }
company_type_change(formData.company_type);
company_type_change(formData.company_type, false);
};
const clickdelete = (index) => {
if (!route.query.read) {

View File

@ -213,7 +213,12 @@
>详情</router-link
>
</el-button>
<el-button v-perms="['company/add:edit']" type="primary" link>
<el-button
v-if="row.is_authentication == 0"
v-perms="['company/add:edit']"
type="primary"
link
>
<router-link
:to="{
path: getRoutePath('company/add:edit'),

View File

@ -1,22 +1,15 @@
<template>
<div>
<div>
<el-card class="!border-none" shadow="never">
<el-page-header content="用户详情" @back="$router.back()" />
<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">
<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"
:disabled="flag"
:data="{ cid: 1 }"
:headers="{ Token: userStore.token }"
:action="base_url + '/upload/image'"
:show-file-list="false"
:on-success="handleAvatarSuccessAvatar"
>
<el-upload v-model="formData.avatar" class="avatar-uploader-head" :data="{ cid: 1 }"
:headers="{ Token: userStore.token }" :action="base_url + '/upload/image'" :show-file-list="false"
:on-success="handleAvatarSuccessAvatar" :disabled="mode=='detail'">
<img v-if="formData.avatar" :src="formData.avatar" class="avatar" />
<el-icon v-else class="avatar-uploader-icon">
<Plus />
@ -25,278 +18,300 @@
</div>
<el-col class="pt-6 !border-none">
<el-row>
<el-col :span="11">
<el-form-item label="姓名" prop="nickname">
<!-- <el-col :span="11">
<el-form-item label="公司" prop="company_name">
<el-input
v-model="formData.nickname"
:disabled="flag"
placeholder="请输入姓名"
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" :readonly="mode=='detail'" placeholder="请输入姓名" clearable :style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
<el-col :span="13">
<el-form-item label="性别" prop="sex">
<el-form-item label="角色" prop="group_id">
<el-select v-model="formData.group_id" placeholder="请选择角色" :style="{ width: '100%' }"
@change="formRef?.clearValidate(['group_id'])" :disabled="mode=='detail'">
<el-option v-for="(item, index) in roleList" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<!-- <el-form-item label="性别" >
<el-select
v-model="formData.sex"
:disabled="flag"
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="account">
<el-input v-model="formData.account" :readonly="mode=='detail'" placeholder="请输入联系电话" clearable
:style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
<el-col :span="13">
<el-form-item label="身份证号">
<el-input v-model="formData.id_card" :readonly="mode=='detail'" placeholder="请输入身份证号" clearable
:style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="押金" >
<el-input v-model="formData.deposit" :readonly="mode=='detail'" placeholder="请输入押金" clearable type="number"
:style="{ width: '100%' }"></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-form-item label="押金缴纳时间" label-width="120px">
<!-- <el-input v-model="formData.deposit_date" placeholder="请输入押金" clearable type="number"
:style="{ width: '100%' }"></el-input> -->
<el-date-picker :readonly="mode=='detail'" format="YYYY/MM/DD" value-format="YYYY-MM-DD" v-model="formData.deposit_date" style="width: 150%" placeholder="请选择押金缴纳时间" clearable></el-date-picker>
</el-form-item>
<!-- <el-form-item label="性别">
<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="12">
<el-form-item label="管理户数" prop="user_information_count" label-width="200px">
<el-input v-model="formData.user_information_count" placeholder="管理户数" :readonly="mode=='detail'" clearable type="number"
:style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="性别">
<el-select v-model="formData.sex" placeholder="请选择性别" :readonly="mode=='detail'" :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-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="id_card">
<el-input
v-model="formData.id_card"
:disabled="flag"
placeholder="请输入身份证号"
clearable
:style="{ width: '100%' }"
></el-input>
<el-col :span="12">
<el-form-item label="注册用户数" prop="register_num" label-width="200px">
<el-input v-model="formData.register_num" :readonly="mode=='detail'" placeholder="请输入" clearable type="number"
: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="请输入联系电话"
:disabled="flag"
clearable
:style="{ width: '100%' }"
></el-input>
<el-col :span="12">
<el-form-item label="入驻商户数" prop="merchant_num" label-width="100px">
<el-input v-model="formData.merchant_num" placeholder="请输入" clearable :readonly="mode=='detail'" type="number"
: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-col :span="12">
<el-form-item label="交易金额" prop="trade_amount" label-width="200px">
<el-input v-model="formData.trade_amount" placeholder="请输入" :readonly="mode=='detail'" clearable type="number"
:style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
<el-col :span="12" v-if="mode=='detail'">
<el-form-item label="邀请码" prop="invite_code" >
<el-input v-model="formData.invite_code" placeholder="请输入" clearable
:style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-form-item label="省" prop="province" label-width="200px">
<el-select v-model="formData.province" placeholder="请选择省" :readonly="mode=='detail'" clearable @change="province_change"
:style="{ width: '100%' }" :disabled="mode=='detail'">
<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-form-item label="市" prop="city">
<el-select v-model="formData.city" placeholder="请选择市" clearable @change="city_change"
:style="{ width: '100%' }" :disabled="mode=='detail'">
<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-form-item label="区县" prop="area">
<el-select v-model="formData.area" placeholder="请选择区县" clearable @change="area_change"
:style="{ width: '100%' }" :disabled="mode=='detail'">
<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-form-item label="乡镇" prop="street">
<el-select v-model="formData.street" placeholder="请选择乡镇" clearable @change="street_change"
:style="{ width: '100%' }" :disabled="mode=='detail'">
<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 label="村社" prop="village">
<el-select v-model="formData.village" placeholder="请选择村社" clearable
:style="{ width: '100%' }" :disabled="mode=='detail'">
<el-option v-for="(item, index) in datas.villageOptions" :key="index" :label="item.village_name"
:value="item.village_code"></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="小队" prop="brigade" label-width="200px">
<el-select v-model="formData.brigade" placeholder="请选择小队" clearable
:style="{ width: '100%' }" @change="brigadeChange" :disabled="mode=='detail'">
<el-option v-for="(item, index) in datas.brigadeOptions" :key="index" :label="item.brigade_name"
:value="item.id"></el-option>
</el-select>
</el-form-item> -->
<el-form-item label="队/小区" prop="brigade" label-width="200px">
<!-- <el-select v-model="formData.brigade" placeholder="请选择小队" clearable
:style="{ width: '100%' }" @change="brigadeChange">
<el-option v-for="(item, index) in datas.brigadeOptions" :key="index" :label="item.brigade_name"
:value="item.id"></el-option>
</el-select> -->
<el-input v-model="formData.brigade" 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/image'"
:show-file-list="false"
:on-success="handleAvatarSuccessIdA"
>
<img
v-if="formData.qualification.id_card"
:src="formData.qualification.id_card"
class="avatar"
/>
<el-form-item label="身份证">
<el-upload v-model="formData.qualification.id_card" class="pl-3 avatar-uploader" :data="{ cid: 1 }"
:headers="{ Token: userStore.token }" :action="base_url + '/upload/image'" :show-file-list="false"
:on-success="handleAvatarSuccessIdA" :disabled="mode=='detail'">
<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/image'"
:show-file-list="false"
:on-success="handleAvatarSuccessIdB"
>
<img
v-if="formData.qualification.id_card_b"
:src="formData.qualification.id_card_b"
class="avatar"
/>
<el-upload v-model="formData.qualification.id_card_b" class="pl-3 avatar-uploader" :data="{ cid: 1 }"
:headers="{ Token: userStore.token }" :action="base_url + '/upload/image'" :show-file-list="false"
:on-success="handleAvatarSuccessIdB" :disabled="mode=='detail'">
<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="银行卡">
<el-upload v-model="formData.qualification.bank_account" class="pl-3 avatar-uploader" :data="{ cid: 1 }"
:headers="{ Token: userStore.token }" :action="base_url + '/upload/image'" :show-file-list="false"
:on-success="handleAvatarSuccessBankA" :before-upload="beforeAvatarUpload_three" :disabled="mode=='detail'">
<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="pl-3 avatar-uploader" :data="{ cid: 1 }"
:headers="{ Token: userStore.token }" :action="base_url + '/upload/image'" :show-file-list="false"
:on-success="handleAvatarSuccessBankB" :before-upload="beforeAvatarUpload_three" :disabled="mode=='detail'">
<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/image'"
:show-file-list="false"
:on-success="handleAvatarSuccessCarA"
>
<img
v-if="formData.qualification.car_card"
:src="formData.qualification.car_card"
class="avatar"
/>
<el-upload v-model="formData.qualification.car_card" class="pl-3 avatar-uploader" :data="{ cid: 1 }"
:headers="{ Token: userStore.token }" :action="base_url + '/upload/image'" :show-file-list="false"
:on-success="handleAvatarSuccessCarA" :disabled="mode=='detail'">
<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/image'"
: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="银行卡号" 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/image'"
: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/image'"
: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-upload v-model="formData.qualification.car_card_b" class="pl-3 avatar-uploader" :data="{ cid: 1 }"
:headers="{ Token: userStore.token }" :action="base_url + '/upload/image'" :show-file-list="false"
:on-success="handleAvatarSuccessCarB" :before-upload="beforeAvatarUpload_two" :disabled="mode=='detail'">
<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>
@ -304,145 +319,12 @@
</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.sex == '1' ? '男' : '女'"
></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/file'"
: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-button v-if="mode=='edit'" type="primary" @click="submit">修改</el-button>
</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 v-model="showCompany">
<DialogIndex :companyTypeList="datas.dictTypeLists" :type="41" @customEvent="customEvent"></DialogIndex>
</el-dialog> -->
</div>
</template>
@ -459,6 +341,7 @@ import {
getUserDetail,
userEdit,
creatContact,
getRolelist,
initiateContact,
upContact,
} from "@/api/consumer";
@ -466,7 +349,10 @@ import {
apiCityList,
apiAreaList,
apiStreetList,
apiVillageList,
apiProvinceList,
// apiBrigadeList
} from "@/api/common";
import { dictDataLists } from "@/api/setting/dict";
import DialogIndex from "@/components/dialog_index.vue";
@ -486,16 +372,26 @@ const formData = reactive({
sex: "",
id_card: "",
nickname: "",
group_id: "",
company_id: 0,
user_information_count: "",
company_name: "",
deposit_date: "",
deposit: "",
province: "",
city: "",
area: "",
street: "",
village: "",
brigade: "",
province_name: "",
city_name: "",
area_name: "",
street_name: "",
village_name: "",
brigade_name: "",
address: "",
account: "",
is_contract: 0,
//
party_b_name: "",
party_b: "",
qualification: {
id_card: "",
id_card_b: "",
@ -504,14 +400,26 @@ const formData = reactive({
bank_account: "",
bank_account_b: "",
},
//
contract_type: "",
file: "",
avatar: "",
multipoint_login: 1,
contract: {
url: "",
},
register_num:"",
merchant_num:"",
trade_amount :"",
invite_code:""
});
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 disabledPartyA = ref(false);
@ -525,8 +433,10 @@ const datas: any = reactive({
cityOptions: [],
areaOptions: [],
streetOptions: [],
villageOptions:[],
dictTypeLists: [],
contract_type: [],
brigadeOptions:[],
contract: [],
});
@ -535,7 +445,11 @@ const isEdit = ref(false);
const isCompany = ref(false);
const userStore = useUserStore();
//
const roleList = ref([]);
getRolelist({}).then((res: any) => {
roleList.value = res;
});
function customEvent(data: any) {
isCompany.value = false;
formData.party_b = data.id;
@ -561,7 +475,7 @@ const getDetails = async () => {
formData[key] = data[key];
});
mode.value = route.query.mode;
// formData.brigade=(formData.brigade)
formData.contract_type = data.contract?.contract_type;
formData.party_b_name = data.contract?.party_b_name;
formData.party_b = data.contract?.party_b;
@ -575,6 +489,10 @@ const getDetails = async () => {
await getCityList();
await getAreaList();
await getStreetList();
await getVillageList()
// await getBrigadeList()
};
const handleEdit = async (value: string, field: string) => {
@ -586,7 +504,10 @@ const handleEdit = async (value: string, field: string) => {
});
getDetails();
};
const fileList = ref<UploadUserFile[]>([]);
// url
const handleAvatarSuccessIdA: UploadProps["onSuccess"] = (
response,
@ -598,6 +519,8 @@ const handleAvatarSuccessIdA: UploadProps["onSuccess"] = (
}
formData.qualification.id_card = response.data.uri;
};
const handleAvatarSuccessAvatar: UploadProps["onSuccess"] = (
response,
uploadFile
@ -608,6 +531,8 @@ const handleAvatarSuccessAvatar: UploadProps["onSuccess"] = (
}
formData.avatar = response.data.uri;
};
const handleAvatarSuccessIdB: UploadProps["onSuccess"] = (
response,
uploadFile
@ -618,6 +543,8 @@ const handleAvatarSuccessIdB: UploadProps["onSuccess"] = (
}
formData.qualification.id_card_b = response.data.uri;
};
const handleAvatarSuccessCarA: UploadProps["onSuccess"] = (
response,
uploadFile
@ -661,19 +588,19 @@ const handleAvatarSuccessBankB: UploadProps["onSuccess"] = (
}
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 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;
};
@ -690,6 +617,12 @@ function area_change(value: string) {
}
function street_change(value: string) {
formData.street = value;
getVillageList()
}
function brigadeChange(value: string) {
// getVillageList()
formData.brigade = value;
console.log(value)
}
const getProvinceList = async () => {
const data = await apiProvinceList({});
@ -707,14 +640,46 @@ const getStreetList = async () => {
const data = await apiStreetList({ street: formData.area });
datas["streetOptions"] = data;
};
const handleAdjust = (value: string) => {
adjustState.show = true;
adjustState.value = value;
const getVillageList = async () => {
const data = await apiVillageList({ village: formData.street });
datas["villageOptions"] = data;
// datas["streetOptions"] = data;
};
const handleConfirmAdjust = async (value: any) => {
await adjustMoney({ user_id: route.query.id, ...value });
adjustState.show = false;
getDetails();
const getBrigadeList = async () => {
const data = await apiBrigadeList({ brigade: formData.village });
datas["brigadeOptions"] = data;
// 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 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("");
userEdit(formData).then(() => {
ElMessage.success("添加成功");
router.back();
});
}
});
};
//
const initiateContactFn = () => {
@ -728,7 +693,10 @@ const initiateContactFn = () => {
};
getDetails();
getProvinceList();
console.log(formData);
console.log(mode.value);
</script>
<style lang="scss">

View File

@ -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 justify-end mt-4">
<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,
getContractPartyACompanyTypeList,
} 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>

View File

@ -0,0 +1,682 @@
<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/image'" :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="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-form-item label="性别" >
<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="account">
<el-input v-model="formData.account" placeholder="请输入联系电话" clearable
:style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
<el-col :span="13">
<el-form-item label="身份证号">
<el-input v-model="formData.id_card" placeholder="请输入身份证号" clearable
:style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="押金" >
<el-input v-model="formData.deposit" placeholder="请输入押金" clearable type="number"
:style="{ width: '100%' }"></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-form-item label="押金缴纳时间" label-width="120px">
<!-- <el-input v-model="formData.deposit_date" placeholder="请输入押金" clearable type="number"
:style="{ width: '100%' }"></el-input> -->
<el-date-picker v-model="formData.deposit_date" style="width: 150%" placeholder="请选择押金缴纳时间" @change="dateChange" clearable></el-date-picker>
</el-form-item>
<!-- <el-form-item label="性别">
<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="12">
<el-form-item label="管理户数" prop="user_information_count" label-width="200px">
<el-input v-model="formData.user_information_count" placeholder="管理户数" clearable type="number"
:style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="性别">
<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-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="12">
<el-form-item label="注册用户数" prop="register_num" label-width="200px">
<el-input v-model="formData.register_num" placeholder="请输入" clearable type="number"
:style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="入驻商户数" prop="merchant_num" label-width="100px">
<el-input v-model="formData.merchant_num" placeholder="请输入" clearable type="number"
:style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="交易金额" prop="trade_amount" label-width="200px">
<el-input v-model="formData.trade_amount" placeholder="请输入" clearable type="number"
:style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
<!-- <el-col :span="12">
<el-form-item label="邀请码" prop="invite_code" >
<el-input v-model="formData.invite_code" placeholder="请输入" clearable type="number"
:style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col> -->
</el-row>
<el-row>
<el-form-item label="省" prop="province" label-width="200px">
<el-select v-model="formData.province" placeholder="请选择省" 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" placeholder="请选择市" clearable @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" placeholder="请选择区县" 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">
<el-select v-model="formData.street" placeholder="请选择乡镇" 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="village">
<el-select v-model="formData.village" placeholder="请选择村社" clearable @change="village_change"
:style="{ width: '100%' }">
<el-option v-for="(item, index) in datas.villageOptions" :key="index" :label="item.village_name"
:value="item.village_code"></el-option>
</el-select>
</el-form-item>
<el-form-item label="队/小区" prop="brigade" label-width="200px">
<!-- <el-select v-model="formData.brigade" placeholder="请选择小队" clearable
:style="{ width: '100%' }" @change="brigadeChange">
<el-option v-for="(item, index) in datas.brigadeOptions" :key="index" :label="item.brigade_name"
:value="item.id"></el-option>
</el-select> -->
<el-input v-model="formData.brigade" 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="身份证">
<el-upload v-model="formData.qualification.id_card" class="pl-3 avatar-uploader" :data="{ cid: 1 }"
:headers="{ Token: userStore.token }" :action="base_url + '/upload/image'" :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="pl-3 avatar-uploader" :data="{ cid: 1 }"
:headers="{ Token: userStore.token }" :action="base_url + '/upload/image'" :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="银行卡">
<el-upload v-model="formData.qualification.bank_account" class="pl-3 avatar-uploader" :data="{ cid: 1 }"
:headers="{ Token: userStore.token }" :action="base_url + '/upload/image'" :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="pl-3 avatar-uploader" :data="{ cid: 1 }"
:headers="{ Token: userStore.token }" :action="base_url + '/upload/image'" :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="pl-3 avatar-uploader" :data="{ cid: 1 }"
:headers="{ Token: userStore.token }" :action="base_url + '/upload/image'" :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="pl-3 avatar-uploader" :data="{ cid: 1 }"
:headers="{ Token: userStore.token }" :action="base_url + '/upload/image'" :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,
apiVillageList,
apiBrigadeList
} 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: 0,
user_information_count: "",
company_name: "",
deposit_date: "",
deposit: "",
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,
register_num:"",
merchant_num:"",
trade_amount :"",
invite_code:""
});
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 dateChange=()=>{
let date=formData.deposit_date
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
formData.deposit_date=`${year}-${month}-${day}`
}
//
const datas: any = reactive({
provinceOptions: [],
cityOptions: [],
areaOptions: [],
streetOptions: [],
villageOptions:[],
dictTypeLists: [],
brigadeOptions:[],
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) {
console.log(formData)
getCityList();
}
function city_change(value: string) {
getAreaList();
}
function area_change(value: string) {
getStreetList();
}
function street_change(value: string) {
getVillageList()
formData.street = value;
}
function village_change(value: string) {
// getVillageList()
getBrigadeList()
// formData.street = value;
}
function brigadeChange(value: string) {
// getVillageList()
formData.brigade = 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 getVillageList = async () => {
const data = await apiVillageList({ village: formData.street });
datas["villageOptions"] = data;
// datas["streetOptions"] = data;
};
const getBrigadeList = async () => {
const data = await apiBrigadeList({ brigade: formData.village });
// datas["villageOptions"] = data;
datas["brigadeOptions"] = data;
// 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>

View File

@ -1,30 +1,65 @@
<template>
<div>
<el-card class="!border-none" shadow="never">
<el-form
ref="formRef"
class="mb-[-16px]"
:model="queryParams"
:inline="true"
>
<el-form ref="formRef" class="mb-[-16px]" :model="queryParams" :inline="true">
<el-form-item label="用户信息">
<el-input
class="w-[280px]"
v-model="queryParams.keyword"
placeholder="用户编号/昵称/手机号码"
clearable
@keyup.enter="resetPage"
/>
<el-input class="w-[280px]" v-model="queryParams.keyword" placeholder="用户编号/昵称/手机号码" clearable
@keyup.enter="resetPage" />
</el-form-item>
<el-form-item label="时间段">
<el-date-picker v-model="queryTime" type="daterange" unlink-panels range-separator="-" start-placeholder="开始时间"
end-placeholder="结束时间" @change="changeTime" value-format="YYYY-MM-DD" />
</el-form-item>
<el-form-item label="省" >
<el-select class="w-[280px]" v-model="queryParams.province" placeholder="请选择省" clearable @change="province_change"
>
<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="市">
<el-select class="w-[280px]" v-model="queryParams.city" placeholder="请选择市" clearable @change="city_change"
>
<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="区县" >
<el-select class="w-[280px]" v-model="queryParams.area" placeholder="请选择区县" clearable @change="area_change"
>
<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="乡镇" >
<el-select class="w-[280px]" v-model="queryParams.street" placeholder="请选择乡镇" clearable @change="street_change"
>
<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="村社" >
<el-select class="w-[280px]" v-model="queryParams.village" placeholder="请选择村社" clearable @change="village_change"
>
<el-option v-for="(item, index) in datas.villageOptions" :key="index" :label="item.village_name"
:value="item.village_code"></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"
/>
<el-button type="primary" @click="exportUerListsFn">导出</el-button>
<router-link :to="{
path: getRoutePath('user.user/edit'),
}">
<el-button v-perms="['user.user/edit']" class="ml-2.5" type="primary"> 创建
</el-button>
</router-link>
</el-form-item>
</el-form>
</el-card>
@ -40,145 +75,43 @@
<el-table-column label="账号" prop="account" min-width="120" />
<el-table-column label="姓名" prop="nickname" min-width="100" />
<el-table-column label="联系方式" prop="mobile" min-width="120" />
<el-table-column
label="隶属公司"
prop="company_name"
min-width="180"
align="center"
>
<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="300"
align="center"
fixed="right"
>
<el-table-column label="操作" min-width="300" align="center" fixed="right">
<template #default="{ row }">
<el-button v-perms="['user.user/detail']" type="primary" link>
<router-link
:to="{
path: getRoutePath('user.user/detail'),
query: {
id: row.id,
},
}"
>
<router-link :to="{
path: getRoutePath('user.user/detail'),
query: {
id: row.id,
mode: 'detail'
},
}">
详情
</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>
<el-button v-perms="['user.user/detail']" type="primary" link>
<router-link :to="{
path: getRoutePath('user.user/detail'),
query: {
id: row.id,
mode: 'edit'
},
}">
编辑
</router-link>
</el-button>
</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>
@ -188,61 +121,92 @@
<script lang="ts" setup name="consumerLists">
import { usePaging } from "@/hooks/usePaging";
import { getRoutePath } from "@/router";
import { getUserList, creatContact, sendMsgApi } from "@/api/consumer";
import { ClientMap } from "@/enums/appEnums";
import feedback from "@/utils/feedback";
const route = useRoute();
import { getUserList, exportUerLists } from "@/api/consumer";
import {
apiCityList,
apiAreaList,
apiStreetList,
apiProvinceList,
apiVillageList,
apiBrigadeList
} from "@/api/common";
const queryTime = ref('')
const changeTime = () => {
queryParams.create_time_start = queryTime.value[0]
queryParams.create_time_end = queryTime.value[1]
}
const datas: any = reactive({
provinceOptions: [],
cityOptions: [],
areaOptions: [],
streetOptions: [],
villageOptions:[],
brigadeOptions:[],
});
const queryParams = reactive({
keyword: "",
channel: "",
create_time_start: "",
create_time_end: "",
company_id: "",
province:"",
city:"",
area:"",
street:"",
village:"",
});
if (route.query.company_id) {
queryParams.company_id = route.query.company_id;
//
function province_change(value: string) {
getCityList();
}
const contractId = ref(0);
const showPop = ref(false);
const showConctactPop = ref(false);
const offPop = () => {
showPop.value = false;
showConctactPop.value = false;
function city_change(value: string) {
getAreaList();
}
function area_change(value: string) {
getStreetList();
}
function street_change(value: string) {
getVillageList()
}
function village_change(value: string) {
}
const getProvinceList = async () => {
const data = await apiProvinceList({});
datas["provinceOptions"] = data;
};
const creContct = () => {
console.log(contractId.value);
// feedback.msgSuccess("");
creatContact({ id: contractId.value }).then(() => {
feedback.msgSuccess("发送成功");
});
offPop();
const getCityList = async () => {
const data = await apiCityList({ city: queryParams.province });
datas["cityOptions"] = data;
};
const sendMsg = () => {
sendMsgApi({ id: contractId.value }).then((res) => {
feedback.msgSuccess("发送成功");
});
offPop();
const getAreaList = async () => {
const data = await apiAreaList({ area: queryParams.city });
datas["areaOptions"] = data;
};
// 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 getStreetList = async () => {
const data = await apiStreetList({ street: queryParams.area });
datas["streetOptions"] = data;
};
const getVillageList = async () => {
const data = await apiVillageList({ village: queryParams.street });
datas["villageOptions"] = data;
// datas["streetOptions"] = data;
};
const { pager, getLists, resetPage, resetParams } = usePaging({
fetchFun: getUserList,
params: queryParams,
});
onActivated(() => {
getLists();
});
getLists();
getProvinceList()
//
const exportUerListsFn = () => {
exportUerLists({ ...queryParams })
}
</script>
<style scoped>
h1 {

View File

@ -186,7 +186,7 @@
</el-table-column>
</el-table>
</div>
<div class="flex mt-4 justify-end">
<div class="flex justify-end mt-4">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
@ -229,13 +229,13 @@ import {
import { timeFormat } from "@/utils/util";
import feedback from "@/utils/feedback";
import { dictDataLists } from "@/api/setting/dict";
import { generateGontract, sendMsgApi } from "@/api/company";
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);
@ -248,16 +248,29 @@ const showCreateConctPop = (row: any) => {
(showConctactPop.value = true),
(contract_id.value = row.id),
(party_b_id.value = row.party_b);
if(row.contract_type==22){
isIndividual=true
}
};
const offPop = () => {
showPop.value = false;
showConctactPop.value = false;
};
const creContct = async () => {
if(isIndividual){
await userGontract({
id: party_b_id.value,
contract_id: contract_id.value,
});
}else{
await generateGontract({
id: party_b_id.value,
contract_id: contract_id.value,
});
}
isIndividual=false
getLists();
offPop();
};

View File

@ -99,15 +99,15 @@
<el-col :span="24" class="el-card pt-6" v-if="formData.cars_info">
<div class="tit">租赁信息</div>
<div>
<el-row>
<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="formData.cars_info.license"
<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="formData.type" placeholder="请输入车辆类型" clearable
<el-input v-model="item.type" placeholder="请输入车辆类型" clearable
:style="{ width: '100%' }"></el-input></el-form-item>
</el-col>
<el-col :span="6">
@ -117,7 +117,7 @@
</el-col>
<el-col :span="6">
<el-form-item label-width="120px" label="签约时间">
<el-input v-model="formData.update_time" placeholder="请输入签约时间" clearable
<el-input v-model="item.rent_time" placeholder="请输入签约时间" clearable
:style="{ width: '100%' }"></el-input></el-form-item>
</el-col>
</el-row>
@ -127,9 +127,9 @@
<!-- 小组公司申请车辆 -->
<!-- {{ formData.contract_logistic_id }}
{{ formData.type }} -->
<div v-if="formData.contract_logistic_id && formData.type == '租赁车辆'" class="el-card pt-6">
<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" />
@ -176,10 +176,16 @@ const formData = reactive({
company_b_code: "",
company_b_email: "@service.ebaoquan.org",
num: "",
cars_info: {
cars_info:
[
{
id: "",
license: "",
},
type:"",
rent_time:""
}
]
,
car_list: [],
type: 0,
status: 0,
@ -204,6 +210,11 @@ const handChangeFn = (e) => {
});
});
};
const typeFn=(type)=>{
if(type==0)return"租赁车辆"
if(type==1)return"自有车辆"
if(type==2)return"购买车辆"
}
const test = () => {
window.open(formData.file, "_blank");
};
@ -211,7 +222,10 @@ leaseContractDetail({ id: route.query.id }).then((res) => {
for (let key in formData) {
formData[key] = res[key];
}
formData.type ? (formData.type = "自有车辆") : (formData.type = "租赁车辆");
// formData.type ? (formData.type = "") : (formData.type = "");
formData.cars_info.forEach(item=>{
item.type=typeFn(item.type)
})
});
const handleAvatarSuccess_three = (response, uploadFile) => {

View File

@ -52,7 +52,7 @@
}">审核</router-link>
</el-button>
<el-button type="primary" link v-perms="['contract.contract/wind_control']"
v-if="row.status > 0">
v-if="row.status > 0 ||row.status==-1">
<router-link :to="{
path: 'vehicle_detail',
query: {
@ -60,7 +60,7 @@
},
}">详情</router-link>
</el-button>
<el-button v-if="row.status == 1 && row.contract_logistic_id != 0" type="primary" link
<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>
@ -71,26 +71,34 @@
</el-table-column>
</el-table>
</div>
<div class="flex mt-4 justify-end">
<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="!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>
<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">
@ -107,78 +115,81 @@ 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;
});
index.value = inde;
pager.lists[index.value].nums = 10;
timeFn(index.value);
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 timers = setInterval(() => {
pager.lists[i].nums--;
if (pager.lists[i].nums <= 0) {
clearInterval(timers);
}
}, 1000);
};
const sendContractPopFn = (id: number) => {
(showPop.value = true), (sendAgainPop.value = true), (contractId = id);
(showPop.value = true), (sendAgainPop.value = false), (contractId = id);
};
const sendAgaintPopFn = (id: number) => {
(showPop.value = true), (contractId = id);
(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);
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;
showPop.value = false;
// showConctactPop.value = false;
};
//
const queryParams = reactive({
company_name: "",
contract_no: "",
status: "",
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" };
switch (status) {
case -1:{
return { tit: "待审核", color: "black" }
}
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 "自由车辆合同";
return "自有车辆合同";
case 2:
return "解除合同";
case 3:
return "购买合同";
default:
}
};
@ -187,47 +198,47 @@ const selectData = ref<any[]>([]);
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id);
selectData.value = val.map(({ id }) => id);
};
//
const { dictData } = useDictData("");
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: leaseContractList,
params: queryParams,
fetchFun: leaseContractList,
params: queryParams,
});
getLists();
</script>
<style lang="scss" scoped>
.btn {
position: absolute;
position: absolute;
}
h1 {
text-align: center;
font-weight: bold;
font-size: 30px;
color: red;
margin-bottom: 10px;
text-align: center;
font-weight: bold;
font-size: 30px;
color: red;
margin-bottom: 10px;
}
.content {
font-size: 20px;
font-size: 20px;
}
.info {
color: red;
font-weight: bold;
font-size: 18px;
display: inline-block;
margin: 0 5px;
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;
margin-top: 10vh;
display: flex;
justify-content: space-around;
}
</style>

View File

@ -0,0 +1,199 @@
<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="title">
<el-input v-model="formData.title" clearable placeholder="请输入主题" />
</el-form-item>
<!-- <el-form-item label="创建人" prop="admin_id">
<el-input v-model="formData.admin_id" clearable placeholder="请输入创建人" />
</el-form-item> -->
<el-form-item label="任务角色" prop="task_role_id">
<el-select class="flex-1" v-model="formData.task_role_id" clearable @change="roleChangeFn"
placeholder="请选择任务角色">
<el-option v-for="(item, index) in dictData.create_task_template_select_role" :key="index"
:label="item.name" :value="parseInt(item.value)" />
</el-select>
</el-form-item>
<el-form-item label="任务类型" prop="type">
<el-select class="flex-1" v-model="formData.type" clearable placeholder="请选择任务类型">
<el-option v-for="(item, index) in typeList" :key="index" :label="item.name"
:value="parseInt(item.id)" />
</el-select>
<!-- <el-input v-model="formData.type" clearable placeholder="请输入任务类型" /> -->
</el-form-item>
<el-form-item label="阶段类型" prop="types">
<el-select class="flex-1" v-model="formData.types" clearable placeholder="请选择任务类型">
<el-option label="循环" :value="1" />
<el-option label="长期" :value="2" />
<el-option label="单次" :value="3" />
</el-select>
<!-- <el-input v-model="formData.types" clearable placeholder="请输入1循环2长期3单次" /> -->
</el-form-item>
<el-form-item label="一阶段天数" prop="stage_day_one">
<el-input v-model="formData.stage_day_one" clearable placeholder="请输入一阶天数" />
</el-form-item>
<el-form-item label="一阶段金额" prop="money">
<el-input v-model="formData.money" clearable placeholder="请输入第一阶段金额" />
</el-form-item>
<!-- <el-form-item label="一阶比例" prop="proportion_one">
<el-input v-model="formData.proportion_one" clearable placeholder="请输入一阶比例" />
</el-form-item> -->
<el-form-item label="二阶段天数" prop="stage_day_two">
<el-input v-model="formData.stage_day_two" clearable placeholder="请输入二阶天数 0代表无天数" />
</el-form-item>
<!-- <el-form-item label="二阶比例" prop="proportion_two">
<el-input v-model="formData.proportion_two" clearable placeholder="请输入二阶比例" />
</el-form-item> -->
<el-form-item label="二阶段金额" prop="money_two">
<el-input v-model="formData.money_two" clearable placeholder="请输入二阶段金额" />
</el-form-item>
<el-form-item label="三阶段天数" prop="stage_day_three">
<el-input v-model="formData.stage_day_three" clearable placeholder="请输入三阶段天数" />
</el-form-item>
<el-form-item label="三阶段金额" prop="new_money_three">
<el-input v-model="formData.new_money_three" clearable placeholder="请输入三阶段金额" />
</el-form-item>
<el-form-item label="长期金额" prop="money_longtime">
<el-input v-model="formData.money_longtime" clearable placeholder="请输入长期金额" />
</el-form-item>
<!-- <el-form-item label="扩展字段" prop="extend">
<el-input v-model="formData.extend" clearable placeholder="请输入扩展字段" />
</el-form-item> -->
<!-- <el-form-item label="充值金额" prop="recharge">
<el-input v-model="formData.recharge" 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="createTaskTemplateEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiCreateTaskTemplateAdd, apiCreateTaskTemplateEdit, apiCreateTaskTemplateDetail, apiCreateTaskTypeLists } from '@/api/create_task_template'
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 typeList = reactive([])
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑任务创建模板' : '新增任务创建模板'
})
//
const formData = reactive({
id: '',
title: '',
// admin_id: '',
task_role_id: '',
type: '',
stage_day_one: '',
money: '',
// proportion_one: '',
stage_day_two: '',
// proportion_two: '',
money_two: '',
stage_day_three: '',
new_money_three: '',
money_longtime: '',
types: '',
// extend: '',
// recharge: '',
content: '',
})
const roleChangeFn = () => {
typeList.splice(0, typeList.length)
apiCreateTaskTypeLists({
task_role_id: formData.task_role_id
}).then(res => {
for (let key in res) {
res[key].forEach(item => {
typeList.push(item)
});
}
// console.log(res)
})
}
//
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]
}
}
roleChangeFn()
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiCreateTaskTemplateDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
await formRef.value?.validate()
const data = { ...formData, }
mode.value == 'edit'
? await apiCreateTaskTemplateEdit(data)
: await apiCreateTaskTemplateAdd(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>

View File

@ -0,0 +1,185 @@
<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="任务角色">
<el-select v-model="queryParams.task_role_id">
<el-option label="全部" value=""></el-option>
<el-option
v-for="(item, index) in dictData.create_task_template_select_role"
:key="index"
:label="item.name"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="任务类型" prop="type">
<el-input class="w-[280px]" v-model="queryParams.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">
<el-button v-perms="['create_task_template.create_task_template/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button
v-perms="['create_task_template.create_task_template/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="admin_name" show-overflow-tooltip />
<el-table-column label="任务角色" prop="task_role_id">
<template #default="{ row }">
<dict-value :options="dictData.create_task_template_select_role" :value="row.task_role_id" />
</template>
</el-table-column>
<el-table-column label="任务类型" show-overflow-tooltip >
<template #default="{ row }">
{{ roleTypeList[row.type] }}
</template>
</el-table-column>
<el-table-column label="一阶天数" prop="stage_day_one" show-overflow-tooltip />
<el-table-column label="第一阶段金额" prop="money" show-overflow-tooltip />
<el-table-column label="一阶比例" prop="proportion_one" show-overflow-tooltip />
<el-table-column label="二阶天数" prop="stage_day_two" show-overflow-tooltip />
<el-table-column label="二阶比例" prop="proportion_two" show-overflow-tooltip />
<el-table-column label="二阶段金额" prop="money_two" show-overflow-tooltip />
<el-table-column label="三阶段天数" prop="stage_day_three" show-overflow-tooltip />
<el-table-column label="三阶段金额" prop="new_money_three" show-overflow-tooltip />
<el-table-column label="长期金额" prop="money_longtime" show-overflow-tooltip />
<el-table-column label="阶段类型" show-overflow-tooltip >
<template #default="{ row }">
<!-- <dict-value :options="dictData.create_task_template_select_role" :value="row.task_role_id" /> -->
{{ row.types==1?"循坏":row.types==2?'长期':"单次" }}
</template>
</el-table-column>
<el-table-column label="扩展字段" prop="extend" show-overflow-tooltip />
<el-table-column label="充值金额" prop="recharge" 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="['create_task_template.create_task_template/edit']"
type="primary"
link
@click="handleEdit(row)"
>
编辑
</el-button>
<el-button
v-perms="['create_task_template.create_task_template/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="createTaskTemplateLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiCreateTaskTemplateLists, apiCreateTaskTemplateDelete,apiCreatetaskTypeInfo } from '@/api/create_task_template'
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: '',
task_role_id: '',
type: ''
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('create_task_template_select_role')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiCreateTaskTemplateLists,
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 apiCreateTaskTemplateDelete({ id })
getLists()
}
//
const roleTypeList=reactive({})
apiCreatetaskTypeInfo().then(res=>{
// console.log(res)
for (let key in res){
roleTypeList[key]=res[key]
}
})
// const getRoleTypeFn=(type)=>{
// }
getLists()
</script>

View File

@ -0,0 +1,326 @@
<template>
<div class="edit-popup">
<popup
ref="popupRef"
:title="popupTitle"
:async="true"
width="800px"
@confirm="handleSubmit"
@close="handleClose"
:button="mode == 'edit'"
:clickModalClose="mode == 'details'"
>
<el-form
ref="formRef"
:model="formData"
:rules="formRules"
label-width="120px"
>
<el-row>
<el-col :span="12">
<el-form-item label="ID" prop="id">
<el-input readonly v-model="formData.id" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="任务名称" prop="task.title">
<el-input readonly v-model="formData.task.title" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="任务金额" prop="task.money">
<el-input readonly v-model="formData.task.money" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="所属公司" prop="company_name">
<el-input readonly v-model="formData.company_name" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="任务描述" prop="task.content">
<el-input
readonly
v-model="formData.task.content"
clearable
type="textarea"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="任务提交时间" prop="id">
<el-input readonly v-model="formData.task.update_time" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="片区经理" prop="flow_cate">
<el-input readonly v-model="formData.area_manager" />
</el-form-item>
</el-col>
</el-row>
<el-divider />
<el-row>
<el-col :span="24">
<el-form-item label="详情描述" prop="remark">
<el-input
readonly
:value="formData.task?.extend?.other?.note"
clearable
type="textarea"
/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="图片附件">
<el-image
class="attachment"
v-for="(item, index) in formData.task?.extend?.other?.annex"
:key="index"
:src="item"
:preview-src-list="formData.task?.extend?.other?.annex"
:initial-index="index"
fit="cover"
></el-image>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="视频附件">
<video
class="video"
:src="item"
v-for="(item, index) in formData.task?.extend?.other
?.video_annex"
:key="index"
controls
/>
</el-form-item>
</el-col>
</el-row>
<el-divider />
<!-- <el-col :span="24">
<el-form-item label="">
<el-timeline>
<el-timeline-item
v-for="(activity, index) in activities"
:key="index"
:type="activity.type"
:hollow="activity.hollow"
:timestamp="activity.timestamp"
>
{{ activity.content }}
</el-timeline-item>
</el-timeline>
</el-form-item>
</el-col> -->
<el-col :span="12">
<el-form-item
label="审核"
prop="check_status"
clearable
:style="{ width: '100%' }"
>
<el-radio-group
:disabled="mode == 'details'"
v-model="formData.check_status"
>
<el-radio :label="2">通过</el-radio>
<el-radio :label="3">驳回</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-row v-if="showInput.includes(formData.type)">
<el-col>
<el-form-item label="政策补贴金额" prop="amount" v-if="formData.type==6">
<el-input
:readonly="mode == 'details'"
v-model="formData.amount"
clearable
/>
</el-form-item>
<el-form-item :label="InputTit" prop="amount" v-else>
<el-input
:readonly="mode == 'details'"
v-model="formData.amount"
clearable
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col>
<el-form-item label="备注" prop="remark">
<el-input
:readonly="mode == 'details'"
v-model="formData.remark"
clearable
type="textarea"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="flowEdit">
import type { FormInstance } from "element-plus";
import Popup from "@/components/popup/index.vue";
import { apiApproveAudit } from "@/api/examined";
import { timeFormat } from "@/utils/util";
import type { PropType } from "vue";
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
default: () => ({}),
},
});
const isCompany = ref(false);
const emit = defineEmits(["success", "close"]);
const formRef = shallowRef<FormInstance>();
const popupRef = shallowRef<InstanceType<typeof Popup>>();
const mode = ref("add");
const showInput=reactive([7,6,8])
const InputTit=ref("销售金额")
//
const popupTitle = computed(() => {
return mode.value == "edit" ? "审核" : "详情";
});
const activities = ref([
{
content: "任务完成",
timestamp: "2023-8-28 13:30:00",
},
{
content: "张三三审核",
timestamp: "2023-8-28 13:30:00",
},
{
content: "李思思审核",
timestamp: "2023-8-28 13:30:00",
type: "primary",
hollow: true,
},
]);
//
const formData = reactive({
id: "",
task: {},
company_name: "",
area_manager: "",
check_status: 1,
remark: "",
amount:"",
type:-1
});
//
const formRules = reactive<any>({
check_status: [
{
required: true,
validator: (rules: any, value: any, callback: any) => {
if (value != 2 && value != 3) callback("请选择审核状态");
else callback();
},
trigger: ["blur"],
},
],
// remark: [
// {
// required: false,
// validator: (rules: any, value: any, callback: any) => {
// if (formData.check_status == 3) callback("");
// else callback();
// },
// trigger: ["blur"],
// },
// ],
});
function customEvent(data: any) {
isCompany.value = false;
}
//
const setFormData = async (data: Record<any, any>) => {
// let res = await apiFlowDetil(data.id);
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 apiFlowDetail({
// id: row.id,
// });
// setFormData(data);
};
//
const handleSubmit = async () => {
await formRef.value?.validate();
if (formData.check_status == 3 && formData.remark == "")
return ElMessage.error("驳回必须填写备注");
if(showInput.includes(formData.type) ){
await apiApproveAudit({
id: formData.id,
check_status: formData.check_status,
remark: formData.remark,
amount:formData.amount
});
}else{
await apiApproveAudit({
id: formData.id,
check_status: formData.check_status,
remark: formData.remark,
});
}
popupRef.value?.close();
emit("success");
};
//
const open = (type = "add") => {
mode.value = type;
popupRef.value?.open();
};
//
const handleClose = () => {
emit("close");
};
defineExpose({
open,
setFormData,
getDetail,
});
</script>
<style lang="scss" scoped>
:deep(.el-timeline-item__wrapper) {
top: -8px !important;
}
.attachment {
width: 150px;
height: 150px;
/* background-color: red; */
margin-right: 10px;
margin-bottom: 10px;
}
.video {
width: 300px;
height: 150px;
/* background-color: red; */
margin-right: 10px;
margin-bottom: 10px;
}
</style>

View File

@ -0,0 +1,311 @@
<template>
<div class="edit-popup">
<popup
ref="popupRef"
:title="popupTitle"
:async="true"
width="800px"
@confirm="handleSubmit"
@close="handleClose"
:button="mode == 'edit'"
:clickModalClose="mode == 'details'"
>
<el-form
ref="formRef"
:model="formData"
:rules="formRules"
label-width="120px"
>
<el-row>
<el-col :span="12">
<el-form-item label="ID" prop="id">
<el-input readonly v-model="formData.id" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="任务名称" prop="task.title">
<el-input readonly v-model="formData.task.title" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="任务金额" prop="task.money">
<el-input readonly v-model="formData.task.money" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="所属公司" prop="company_name">
<el-input readonly v-model="formData.company_name" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="任务描述" prop="task.content">
<el-input
readonly
v-model="formData.task.content"
clearable
type="textarea"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="任务提交时间" prop="id">
<el-input readonly v-model="formData.task.update_time" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="片区经理" prop="flow_cate">
<el-input readonly v-model="formData.area_manager" />
</el-form-item>
</el-col>
</el-row>
<el-divider />
<el-row>
<el-col :span="24">
<el-form-item label="补充说明" prop="remark">
<el-input
readonly
:value="taskExtend.remark"
clearable
type="textarea"
/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="完成证明">
<el-image
class="attachment"
v-for="(item, index) in taskExtend.file"
:key="index"
:src="item"
:preview-src-list="taskExtend.file"
:initial-index="index"
fit="cover"
></el-image>
</el-form-item>
</el-col>
</el-row>
<el-divider />
<!-- <el-col :span="24">
<el-form-item label="">
<el-timeline>
<el-timeline-item
v-for="(activity, index) in activities"
:key="index"
:type="activity.type"
:hollow="activity.hollow"
:timestamp="activity.timestamp"
>
{{ activity.content }}
</el-timeline-item>
</el-timeline>
</el-form-item>
</el-col> -->
<el-col :span="12">
<el-form-item
label="审核"
prop="check_status"
clearable
:style="{ width: '100%' }"
>
<el-radio-group
:disabled="mode == 'details'"
v-model="formData.check_status"
>
<el-radio :label="2">通过</el-radio>
<el-radio :label="3">驳回</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-row>
<el-col>
<el-form-item label="备注" prop="remark">
<el-input
:readonly="mode == 'details'"
v-model="formData.remark"
clearable
type="textarea"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="flowEdit">
import type { FormInstance } from "element-plus";
import Popup from "@/components/popup/index.vue";
import { apiApproveAudit } from "@/api/examined";
import { timeFormat } from "@/utils/util";
import type { PropType } from "vue";
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
default: () => ({}),
},
});
const isCompany = ref(false);
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 activities = ref([
{
content: "任务完成",
timestamp: "2023-8-28 13:30:00",
},
{
content: "张三三审核",
timestamp: "2023-8-28 13:30:00",
},
{
content: "李思思审核",
timestamp: "2023-8-28 13:30:00",
type: "primary",
hollow: true,
},
]);
//
const formData = reactive({
id: "",
task: {
extend: [],
},
company_name: "",
area_manager: "",
check_status: 1,
remark: "",
});
const taskExtend = reactive({
remark: "",
file: [],
});
//
const formRules = reactive<any>({
check_status: [
{
required: true,
validator: (rules: any, value: any, callback: any) => {
if (value != 2 && value != 3) callback("请选择审核状态");
else callback();
},
trigger: ["blur"],
},
],
// remark: [
// {
// required: false,
// validator: (rules: any, value: any, callback: any) => {
// if (formData.check_status == 3) callback("");
// else callback();
// },
// trigger: ["blur"],
// },
// ],
});
function customEvent(data: any) {
isCompany.value = false;
}
//
const setFormData = async (data: Record<any, any>) => {
// let res = await apiFlowDetil(data.id);
if (typeof data.extend == "string") data.extend = JSON.parse(data.extend);
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
formData[key] = data[key];
}
}
if (formData.task?.extend?.stage) {
switch (+formData.task.extend.stage) {
case 1:
setTaskExtend(formData.task.extend.stage1);
break;
case 2:
setTaskExtend(formData.task.extend.stage2);
break;
case 3:
setTaskExtend(formData.task.extend.stage3);
break;
case 4:
setTaskExtend(formData.task.extend.stage4);
break;
}
}
};
const setTaskExtend = (data: any) => {
Object.keys(taskExtend).forEach((key: string) => {
if (data[key] != null && data[key] != undefined) {
taskExtend[key] = data[key];
}
});
};
const getDetail = async (row: Record<string, any>) => {
// const data = await apiFlowDetail({
// id: row.id,
// });
// setFormData(data);
};
//
const handleSubmit = async () => {
await formRef.value?.validate();
if (formData.check_status == 3 && formData.remark == "")
return ElMessage.error("驳回必须填写备注");
await apiApproveAudit({
id: formData.id,
check_status: formData.check_status,
remark: formData.remark,
});
popupRef.value?.close();
emit("success");
};
//
const open = (type = "add") => {
mode.value = type;
popupRef.value?.open();
};
//
const handleClose = () => {
emit("close");
};
defineExpose({
open,
setFormData,
getDetail,
});
</script>
<style lang="scss" scoped>
:deep(.el-timeline-item__wrapper) {
top: -8px !important;
}
.attachment {
width: 150px;
height: 150px;
/* background-color: red; */
margin-right: 10px;
margin-bottom: 10px;
}
.video {
width: 300px;
height: 150px;
/* background-color: red; */
margin-right: 10px;
margin-bottom: 10px;
}
</style>

View File

@ -112,13 +112,20 @@
</el-table-column>
</el-table>
</div>
<div class="flex mt-4 justify-end">
<div class="flex justify-end mt-4">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
<edit-popup
v-if="showEdit"
ref="editRef"
<audit-other-popup
v-if="showEdit && showAuditOther"
ref="auditOtherRef"
:dict-data="dictData"
@success="getLists"
@close="showEdit = false"
/>
<audit-town-market-popup
v-else-if="showEdit && openType == 4"
ref="auditTownMarketRef"
:dict-data="dictData"
@success="getLists"
@close="showEdit = false"
@ -132,17 +139,23 @@ import { useDictData } from "@/hooks/useDictOptions";
import { apiApproveList } from "@/api/examined";
import { timeFormat } from "@/utils/util";
import feedback from "@/utils/feedback";
import EditPopup from "./index_list_popup.vue";
import auditOtherPopup from "./components/audit_other.vue";
import auditTownMarketPopup from "./components/audit_town_market.vue";
import { getTaskApproveTypeList } from "@/api/setting/dict";
import { show } from "dom7";
const editRef = shallowRef<InstanceType<typeof EditPopup>>();
const auditOtherRef = shallowRef<InstanceType<typeof auditOtherPopup>>();
const auditTownMarketRef =
shallowRef<InstanceType<typeof auditTownMarketPopup>>();
//
const showEdit = ref(false);
const openType = ref(1);
//
const queryParams = reactive({
name: "",
check_status: "",
type: 1,
type: "1,4",
});
const checkStatusList = ref([
@ -160,6 +173,12 @@ const checkStatusList = ref([
},
]);
//
const showAuditTypeList = ref([1, 5, 6,7,8,9]);
const showAuditOther = computed(() => {
return showAuditTypeList.value.includes(openType.value);
});
//
const selectData = ref<any[]>([]);
@ -181,15 +200,24 @@ const { pager, getLists, resetParams, resetPage } = usePaging({
const handleAdd = async () => {
showEdit.value = true;
await nextTick();
editRef.value?.open("add");
auditOtherRef.value?.open("add");
};
//
const handleEdit = async (data: any, type = "edit") => {
console.log(data.type)
openType.value = data.type;
showEdit.value = true;
await nextTick();
editRef.value?.open(type);
editRef.value?.setFormData(data);
if (showAuditOther.value) {
auditOtherRef.value?.open(type);
auditOtherRef.value?.setFormData(data);
} else if (data.type == 4) {
auditTownMarketRef.value?.open(type);
auditTownMarketRef.value?.setFormData(data);
}
};
//
@ -199,6 +227,9 @@ const handleEdit = async (data: any, type = "edit") => {
// getLists();
// };
getLists();
getTaskApproveTypeList().then((res) => {
queryParams.type = res.join(",");
getLists();
});
</script>

View File

@ -64,7 +64,7 @@
<el-form-item label="详情描述" prop="remark">
<el-input
readonly
:value="formData.task?.extend.other.note"
:value="formData.task?.extend?.other?.note"
clearable
type="textarea"
/>
@ -74,10 +74,10 @@
<el-form-item label="图片附件">
<el-image
class="attachment"
v-for="(item, index) in formData.task.extend.other.annex"
v-for="(item, index) in formData.task?.extend?.other?.annex"
:key="index"
:src="item"
:preview-src-list="formData.task.extend.other.annex"
:preview-src-list="formData.task?.extend?.other?.annex"
:initial-index="index"
fit="cover"
></el-image>
@ -88,7 +88,8 @@
<video
class="video"
:src="item"
v-for="(item, index) in formData.task.extend.other.video_annex"
v-for="(item, index) in formData.task?.extend?.other
?.video_annex"
:key="index"
controls
/>
@ -117,6 +118,7 @@
prop="check_status"
clearable
:style="{ width: '100%' }"
>
<el-radio-group
:disabled="mode == 'details'"

View File

@ -0,0 +1,273 @@
<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="name">
<el-select
v-model="queryParams.type"
placeholder="请选择审批类型"
clearable
class="w-[280px]"
@select="getLists"
>
<el-option
v-for="(item, index) in typeList"
:key="index"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="审核状态" prop="name">
<el-select
v-model="queryParams.check_status"
placeholder="请选择审核状态"
clearable
class="w-[280px]"
@select="getLists"
>
<el-option
v-for="(item, index) in checkStatusList"
:key="index"
:label="item.name"
:value="item.id"
></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">
<div class="mt-4">
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
<el-table-column label="ID" prop="id" />
<el-table-column
label="店铺名称"
prop="extend.company_name"
show-overflow-tooltip
/>
<el-table-column
label="店铺类型"
prop="extend.type_name"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
label="商户分类"
prop="extend.category_name"
show-overflow-tooltip
>
</el-table-column>
<el-table-column label="类型" show-overflow-tooltip>
<template #default="{ row }">
<span v-if="row.type == 2" style="color: #4a5dff">{{
row.name
}}</span>
<span v-else-if="row.type == 3" style="color: #67c23a">{{
row.name
}}</span>
<span v-else>{{ row.name }}</span>
</template>
</el-table-column>
<el-table-column
label="申请时间"
prop="create_time"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
label="公司名称"
prop="company_name"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="片区经理"
prop="area_manager"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
label="审核状态"
prop="check_status"
show-overflow-tooltip
>
<template #default="{ row }">
<span v-if="row.check_status == 3" style="color: #f56c6c"
>未通过</span
>
<span v-if="row.check_status == 2" style="color: #67c23a"
>已通过</span
>
<span v-if="row.check_status == 1" style="color: #e6a23c"
>待审核</span
>
</template>
</el-table-column>
<el-table-column label="备注" prop="remark" show-overflow-tooltip>
</el-table-column>
<!-- <el-table-column label="操作" width="120" fixed="right">
<template #default="{ row }">
<el-button
v-if="row.check_status <= 1"
v-perms="['flow/edit']"
type="primary"
link
@click="handleEdit(row, 'edit')"
>
审核
</el-button>
<el-button
v-else
type="primary"
link
@click="handleEdit(row, 'details')"
>
详情
</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>
<audit-other-popup
v-if="showEdit && showAuditOther"
ref="auditOtherRef"
:dict-data="dictData"
@success="getLists"
@close="showEdit = false"
/>
<audit-town-market-popup
v-else-if="showEdit && openType == 4"
ref="auditTownMarketRef"
:dict-data="dictData"
@success="getLists"
@close="showEdit = false"
/>
</div>
</template>
<script lang="ts" setup name="flowLists">
import { usePaging } from "@/hooks/usePaging";
import { useDictData } from "@/hooks/useDictOptions";
import { apiApproveList2 } from "@/api/examined";
import { timeFormat } from "@/utils/util";
import feedback from "@/utils/feedback";
import auditOtherPopup from "./components/audit_other.vue";
import auditTownMarketPopup from "./components/audit_town_market.vue";
import { watch } from "vue";
import { extend } from "lodash-es";
const auditOtherRef = shallowRef<InstanceType<typeof auditOtherPopup>>();
const auditTownMarketRef =
shallowRef<InstanceType<typeof auditTownMarketPopup>>();
//
const showEdit = ref(false);
const openType = ref(1);
//
const queryParams = reactive({
name: "",
check_status: "",
type: "2,3",
});
const typeList = ref([
{
id: "2,3",
name: "全部",
},
{
id: "2",
name: "商户入驻审批",
},
{
id: "3",
name: "开通交易审批",
},
]);
const checkStatusList = ref([
{
id: 1,
name: "待审核",
},
{
id: 2,
name: "已通过",
},
{
id: 3,
name: "未通过",
},
]);
//
const showAuditTypeList = ref([1, 5, 6]);
const showAuditOther = computed(() => {
return showAuditTypeList.value.includes(openType.value);
});
//
const selectData = ref<any[]>([]);
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id);
};
//
const { dictData } = useDictData("");
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiApproveList2,
params: queryParams,
json: "extend",
});
//
const handleAdd = async () => {
showEdit.value = true;
await nextTick();
auditOtherRef.value?.open("add");
};
//
const handleEdit = async (data: any, type = "edit") => {
openType.value = data.type;
showEdit.value = true;
await nextTick();
if (showAuditOther) {
auditOtherRef.value?.open(type);
auditOtherRef.value?.setFormData(data);
} else if (data.type == 4) {
auditTownMarketRef.value?.open(type);
auditTownMarketRef.value?.setFormData(data);
}
};
//
// const handleDelete = async (id: number | any[]) => {
// await feedback.confirm("");
// await apiFlowDelete({ id });
// getLists();
// };
getLists();
</script>

View File

@ -88,6 +88,7 @@
:on-success="handleFile"
:on-exceed="handleExceed"
:before-upload="beforeUpload"
:before-remove="removeFile"
ref="upload"
>
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
@ -111,7 +112,12 @@
</template>
<script lang="ts" setup name="withdrawEdit">
import type { FormInstance, UploadRawFile } from "element-plus";
import type {
FormInstance,
UploadRawFile,
UploadFile,
UploadFiles,
} from "element-plus";
import Popup from "@/components/popup/index.vue";
import {
apiWithdrawAdd,
@ -243,6 +249,11 @@ const handleExceed = (files: any) => {
upload.value!.submit();
};
const removeFile = (uploadFile: UploadFile, uploadFiles: UploadFiles) => {
formData.voucher = "";
return true;
};
//
const handleFile = (e: any) => {
if (e.code == 0 && e.show == 1) {

View File

@ -120,7 +120,7 @@
</template>
</el-table-column>
<el-table-column label="来源单号" prop="source_sn" min-width="100" />
<el-table-column label="来源" prop="remark" min-width="100" />
<el-table-column label="记录时间" prop="create_time" min-width="140" />
</el-table>
<div class="flex justify-end mt-4">

View File

@ -82,11 +82,11 @@
/>
<el-table-column
label="公司收益"
prop="deposit"
prop="company_money"
show-overflow-tooltip
>
<template #default="{ row }">
<span class="text-success">{{ row.deposit }}</span>
<span class="text-success">{{ row.company_money }}</span>
</template>
</el-table-column>
<el-table-column label="区县" prop="area" show-overflow-tooltip />

View File

@ -14,9 +14,9 @@
>
</el-col>
<el-col :span="12"
>收益:
>余额:
<span style="color: #67c23a; font-weight: bold">{{
datas.income
datas.user_money
}}</span
>
</el-col>

View File

@ -0,0 +1,290 @@
<template>
<div class="edit-popup">
<popup
ref="popupRef"
:title="popupTitle"
:async="true"
width="580px"
@confirm="handleSubmit"
@close="handleClose"
>
<el-form
ref="formRef"
:model="formData"
label-width="120px"
:rules="formRules"
>
<el-form-item label="甲方公司名称">
<el-input
readonly
v-model="partyA.company_name"
clearable
placeholder=""
/>
</el-form-item>
<el-form-item label="甲方对公账号">
<el-input
readonly
v-model="partyA.qualification.corporate_account"
clearable
placeholder=""
/>
</el-form-item>
<el-form-item label="公司名称" prop="company_name">
<el-input
readonly
v-model="formData.company_name"
clearable
placeholder=""
/>
</el-form-item>
<el-form-item label="主要联系人" prop="master_name">
<el-input
readonly
v-model="formData.master_name"
clearable
placeholder=""
/>
</el-form-item>
<el-form-item label="联系电话" prop="master_phone">
<el-input
readonly
v-model="formData.master_phone"
clearable
placeholder=""
/>
</el-form-item>
<el-form-item label="押金金额" prop="deposit">
<el-input
v-model="formData.deposit"
type="number"
:maxlength="10"
clearable
placeholder="请输入押金金额"
/>
</el-form-item>
<el-form-item label="上传凭证" prop="voucher">
<el-upload
class="upload-demo"
style="width: 100%"
drag
:accept="fileTypeList.join(', ')"
:headers="{ Token: userStore.token }"
:action="actionUrl"
:limit="1"
:on-success="handleFile"
:on-exceed="handleExceed"
:before-upload="beforeUpload"
:before-remove="removeFile"
:on-preview="onPreview"
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">请上传JPG/JPEG/PNG/GIF/PDF文件</div>
</template>
</el-upload>
</el-form-item>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="withdrawEdit">
import type {
FormInstance,
UploadRawFile,
UploadFile,
UploadFiles,
} from "element-plus";
import { genFileId } from "element-plus";
import Popup from "@/components/popup/index.vue";
import { getPartyAbyCompanyId } from "@/api/company";
import { timeFormat } from "@/utils/util";
import type { PropType } from "vue";
import { depositRechargeTransferVoucher } from "@/api/company.ts";
import { inject } from "vue";
const base_url: any = inject("base_url");
import useUserStore from "@/stores/modules/user";
import { rules } from "@/views/channel/wx_oa/menu_com/useMenuOa";
const userStore = useUserStore();
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 "凭证录入";
});
//
const formData = reactive({
id: "",
company_name: "",
master_name: "",
master_phone: "",
deposit: "", //
voucher: "", //
});
//
const formRules = reactive<any>({
deposit: [
{
required: true,
message: "请输入押金金额",
trigger: ["blur"],
},
],
voucher: [
{
required: true,
message: "请上传凭证",
trigger: ["blur", "change"],
},
],
});
//
const upload = ref(null);
//
const actionUrl = ref("");
const fileTypeList = [
"application/pdf",
"image/jpeg",
"image/gif",
"image/png",
];
//
const beforeUpload = (rawFile: UploadRawFile) => {
if (!fileTypeList.includes(rawFile.type)) {
ElMessage.error("请上传JPG/JPEG/PNG/GIF/PDF文件");
return false;
}
if (rawFile.type != "application/pdf") {
actionUrl.value = base_url + "/upload/image";
} else {
actionUrl.value = base_url + "/upload/file";
}
return true;
};
const handleExceed = (files: any) => {
upload.value!.clearFiles();
const file = files[0] as UploadRawFile;
file.uid = genFileId();
upload.value!.handleStart(file);
upload.value!.submit();
};
const removeFile = (uploadFile: UploadFile, uploadFiles: UploadFiles) => {
formData.voucher = "";
return true;
};
const onPreview = (event: any) => {
if (event?.response?.data?.uri) openTransfer(event?.response?.data?.uri);
else ElMessage("文件错误");
};
//
const openTransfer = (uri: any) => {
window.open(uri);
};
//
const handleFile = (e: any) => {
if (e.code == 0 && e.show == 1) {
formData.voucher = "";
upload.value!.clearFiles();
return ElMessage.error(e.msg || "上传失败");
}
formData.voucher = e.data.uri;
};
//
const setFormData = async (data: Record<any, any>) => {
let obj = {
id: "",
company_name: "",
master_name: "",
master_phone: "",
};
for (const key in obj) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
formData[key] = data[key];
}
}
getDetail();
};
//
const partyA = reactive({
company_name: "",
qualification: {
corporate_account: "",
},
});
const getDetail = async () => {
getPartyAbyCompanyId({
company_id: formData.id,
}).then((data) => {
partyA["company_name"] = data["company_name"];
if (typeof data.qualification == "string") {
data.qualification = JSON.parse(data.qualification);
partyA.qualification.corporate_account =
data.qualification.corporate_account;
} else {
partyA.qualification.corporate_account =
data.qualification.corporate_account;
}
if (!partyA.qualification.corporate_account) {
ElMessage.error("甲方公司没有对公账号,请补充账号后再试");
}
});
};
//
const handleSubmit = async () => {
if (!partyA.company_name) return ElMessage.error("甲方公司不可为空");
if (!partyA.qualification.corporate_account)
return ElMessage.error("甲方公司对公账户不可为空");
if (!formData.id) return ElMessage.error("请先选择公司");
await formRef.value?.validate();
const data = { ...formData };
await depositRechargeTransferVoucher({
company_id: data.id,
deposit: data.deposit,
voucher: data.voucher,
});
ElMessage.success("录入成功");
popupRef.value?.close();
emit("success");
};
//
const open = (type = "add") => {
mode.value = type;
popupRef.value?.open();
};
//
const handleClose = () => {
emit("close");
};
defineExpose({
open,
setFormData,
});
</script>

View File

@ -0,0 +1,253 @@
<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>
<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" @selection-change="handleSelectionChange">
<el-table-column
label="ID"
prop="id"
show-overflow-tooltip
width="80"
/>
<el-table-column
label="公司名称"
prop="company_name"
width="300"
show-overflow-tooltip
/>
<el-table-column
label="公司类型"
prop="company_type"
show-overflow-tooltip
/>
<el-table-column label="押金" prop="deposit" show-overflow-tooltip>
<template #default="{ row }">
<span class="text-success">{{ row.deposit }}</span>
</template>
</el-table-column>
<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="操作"
align="center"
width="200"
fixed="right"
>
<template #default="{ row }">
<div style="display: flex">
<el-button type="primary" link @click="handleEdit(row)">
凭证录入
</el-button>
<el-button type="primary" link>
<router-link
:to="{
path: getRoutePath('finance.depositList'),
query: {
company_id: row.id,
},
}"
>凭证列表</router-link
>
</el-button>
</div>
</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="financeCompanyLists">
import { usePaging } from "@/hooks/usePaging";
import { useDictData } from "@/hooks/useDictOptions";
import useUserStore from "@/stores/modules/user";
import { apiCompanyLists } from "@/api/company";
import { timeFormat } from "@/utils/util";
import { dictDataLists } from "@/api/setting/dict";
import { getRoutePath } from "@/router";
import { dictContractTypeList } from "@/utils/dict.ts";
import EditPopup from "./component/voucher.vue";
const userStore = useUserStore();
// console.log(userStore.userInfo.company_id);
const route = useRoute();
const company_type_show = ref(true);
//
const showEdit = ref(false);
const editRef = ref(null);
//
const handleEdit = async (data: any) => {
showEdit.value = true;
await nextTick();
editRef.value?.open("edit");
editRef.value?.setFormData(data);
};
//
//
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,
});
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>

View File

@ -0,0 +1,215 @@
<template>
<div>
<!-- <el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px] formdata" :model="queryParams" inline>
<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 type="primary" @click="handleEdit(company_info)"
>添加凭证</el-button
>
<div class="mt-4">
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
<el-table-column
label="ID"
prop="id"
show-overflow-tooltip
width="80"
/>
<el-table-column
label="公司名称"
prop="company_name"
width="300"
show-overflow-tooltip
>
<span>{{ company_info.company_name }}</span>
</el-table-column>
<el-table-column
label="充值金额"
prop="deposit"
width="180"
show-overflow-tooltip
/>
<el-table-column
label="凭证地址"
prop="voucher"
show-overflow-tooltip
/>
<el-table-column
label="创建时间"
prop="create_time"
width="200"
show-overflow-tooltip
/>
<el-table-column
label="更新时间"
prop="update_time"
width="200"
show-overflow-tooltip
/>
<el-table-column
label="操作"
align="center"
width="100"
fixed="right"
>
<template #default="{ row }">
<div style="display: flex">
<el-button
type="primary"
link
@click="openTransfer(row.voucher)"
>
查看凭证
</el-button>
</div>
</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="financeCompanyLists">
import { usePaging } from "@/hooks/usePaging";
import { useDictData } from "@/hooks/useDictOptions";
import useUserStore from "@/stores/modules/user";
import {
apiCompanyLists,
apiCompanyDetail,
getDepositRechargeTransferVoucherList,
} from "@/api/company";
import { timeFormat } from "@/utils/util";
import { dictDataLists } from "@/api/setting/dict";
import { getRoutePath } from "@/router";
import { dictContractTypeList } from "@/utils/dict.ts";
import EditPopup from "./component/voucher.vue";
const userStore = useUserStore();
// console.log(userStore.userInfo.company_id);
const route = useRoute();
//
const showEdit = ref(false);
const editRef = ref(null);
//
const handleEdit = async (data: any) => {
showEdit.value = true;
await nextTick();
editRef.value?.open("edit");
editRef.value?.setFormData(data);
};
const company_info = reactive({
id: "",
company_name: "",
master_name: "",
master_phone: "",
});
const getCompanyInfo = () => {
apiCompanyDetail({ id: queryParams.company_id }).then((data) => {
for (const key in company_info) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
company_info[key] = data[key];
}
}
});
};
//
const openTransfer = (uri: any) => {
window.open(uri);
};
//
//
const queryParams = reactive({
company_id: "",
});
if (route.query.company_id) {
queryParams["company_id"] = route.query.company_id;
getCompanyInfo();
}
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: getDepositRechargeTransferVoucherList,
params: queryParams,
});
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>

View File

@ -1,126 +1,134 @@
<template>
<div class="edit-popup">
<popup
ref="popupRef"
:title="popupTitle"
:async="true"
width="550px"
@confirm="handleSubmit"
@close="handleClose"
>
<el-form
class="ls-form"
ref="formRef"
:rules="rules"
:model="formData"
label-width="84px"
>
<el-form-item label="字典类型">
<el-input
:model-value="formData.type_value"
placeholder="请输入字典类型"
disabled
/>
</el-form-item>
<el-form-item label="数据名称" prop="name">
<el-input v-model="formData.name" placeholder="请输入数据名称" clearable />
</el-form-item>
<el-form-item label="数据值" prop="value">
<el-input v-model="formData.value" placeholder="请输入数据值" clearable />
</el-form-item>
<el-form-item label="排序" prop="sort">
<div>
<el-input-number v-model="formData.sort" :min="0" :max="9999" />
<div class="form-tips">数值越大越排前</div>
</div>
</el-form-item>
<el-form-item label="状态" required prop="status">
<el-radio-group v-model="formData.status">
<el-radio :label="1">正常</el-radio>
<el-radio :label="0">停用</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input
v-model="formData.remark"
type="textarea"
:autosize="{ minRows: 4, maxRows: 6 }"
clearable
maxlength="200"
show-word-limit
/>
</el-form-item>
</el-form>
</popup>
</div>
<div class="edit-popup">
<popup
ref="popupRef"
:title="popupTitle"
:async="true"
width="550px"
@confirm="handleSubmit"
@close="handleClose"
>
<el-form
class="ls-form"
ref="formRef"
:rules="rules"
:model="formData"
label-width="84px"
>
<el-form-item label="字典类型">
<el-input
:model-value="formData.type_value"
placeholder="请输入字典类型"
disabled
/>
</el-form-item>
<el-form-item label="数据名称" prop="name">
<el-input
v-model="formData.name"
placeholder="请输入数据名称"
clearable
/>
</el-form-item>
<el-form-item label="数据值" prop="value">
<el-input
v-model="formData.value"
placeholder="请输入数据值"
clearable
/>
</el-form-item>
<el-form-item label="排序" prop="sort">
<div>
<el-input-number v-model="formData.sort" :min="0" :max="9999" />
<div class="form-tips">数值越大越排前</div>
</div>
</el-form-item>
<el-form-item label="状态" required prop="status">
<el-radio-group v-model="formData.status">
<el-radio :label="1">正常</el-radio>
<el-radio :label="0">停用</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input
v-model="formData.remark"
type="textarea"
:autosize="{ minRows: 4, maxRows: 6 }"
clearable
/>
</el-form-item>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup>
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { dictDataAdd, dictDataEdit } from '@/api/setting/dict'
import type { FormInstance } from "element-plus";
import Popup from "@/components/popup/index.vue";
import { dictDataAdd, dictDataEdit } from "@/api/setting/dict";
const emit = defineEmits(['success', 'close'])
const formRef = shallowRef<FormInstance>()
const popupRef = shallowRef<InstanceType<typeof Popup>>()
const mode = ref('add')
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' ? '编辑字典数据' : '新增字典数据'
})
return mode.value == "edit" ? "编辑字典数据" : "新增字典数据";
});
const formData = reactive({
id: '',
type_value: '',
name: '',
value: '',
sort: 0,
status: 1,
remark: '',
type_id: 0
})
id: "",
type_value: "",
name: "",
value: "",
sort: 0,
status: 1,
remark: "",
type_id: 0,
});
const rules = {
name: [
{
required: true,
message: '请输入数据名称',
trigger: ['blur']
}
],
value: [
{
required: true,
message: '请输入数据值',
trigger: ['blur']
}
]
}
name: [
{
required: true,
message: "请输入数据名称",
trigger: ["blur"],
},
],
value: [
{
required: true,
message: "请输入数据值",
trigger: ["blur"],
},
],
};
const handleSubmit = async () => {
await formRef.value?.validate()
mode.value == 'edit' ? await dictDataEdit(formData) : await dictDataAdd(formData)
popupRef.value?.close()
emit('success')
}
await formRef.value?.validate();
mode.value == "edit"
? await dictDataEdit(formData)
: await dictDataAdd(formData);
popupRef.value?.close();
emit("success");
};
const handleClose = () => {
emit('close')
}
emit("close");
};
const open = (type = 'add') => {
mode.value = type
popupRef.value?.open()
}
const open = (type = "add") => {
mode.value = type;
popupRef.value?.open();
};
const setFormData = (data: Record<any, any>) => {
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
formData[key] = data[key]
}
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
formData[key] = data[key];
}
}
}
};
defineExpose({
open,
setFormData
})
open,
setFormData,
});
</script>

View File

@ -0,0 +1,222 @@
<template>
<div class="edit-popup">
<popup
ref="popupRef"
:title="popupTitle"
:async="true"
width="800px"
@confirm="handleSubmit"
@close="handleClose"
:button="mode == 'edit'"
:clickModalClose="mode == 'details'"
>
<el-form
ref="formRef"
:model="formData"
:rules="formRules"
label-width="120px"
>
<el-row>
<el-col :span="24">
<el-form-item label="参股公司:">
<div > {{ formData.company_b_name }}</div>
</el-form-item>
</el-col>
</el-row> <el-row>
<el-col :span="24">
<el-form-item label="被参股公司:">
<div > {{ formData.company_a_name }}</div>
</el-form-item>
</el-col>
</el-row> <el-row>
<el-col :span="24">
<el-form-item label="金额:">
<div > {{ taskExtend.amount }}</div>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="完成凭证:">
<div v-if="taskExtend.file_type=='image'" >
<el-image
style="width: 100px; height: 100px"
:src="taskExtend.annex"
:zoom-rate="1.2"
:max-scale="7"
:min-scale="0.2"
:preview-src-list="[taskExtend.annex]"
fit="cover"
/>
</div>
<div style="cursor: pointer;color:blue" v-else @click="annexFn(taskExtend.annex)"> 查看凭证</div>
</el-form-item>
</el-col>
</el-row>
<el-col :span="12">
<el-form-item
label="审核"
prop="check_status"
clearable
:style="{ width: '100%' }"
>
<el-radio-group
:class="{disabled:mode == 'details'}"
v-model="formData.check_status"
>
<el-radio :label="2">通过</el-radio>
<el-radio :label="3">驳回</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-row>
<el-col>
<el-form-item label="备注" prop="remark">
<el-input
:readonly="mode == 'details'"
v-model="formData.remark"
clearable
type="textarea"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="flowEdit">
import type { FormInstance } from "element-plus";
import Popup from "@/components/popup/index.vue";
import { apiApproveAudit } from "@/api/shareholdingReview";
import type { PropType } from "vue";
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
default: () => ({}),
},
});
const isCompany = ref(false);
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 annexFn=(href:string)=>{
window.open(href, '_blank')
}
//
const formData = reactive({
id: "",
check_status: 1,
remark: "",
company_a_name:"",
company_b_name:"",
});
const taskExtend = reactive({
amount: "",
annex: "",
file_type:"",
});
//
const formRules = reactive<any>({
check_status: [
{
required: true,
validator: (rules: any, value: any, callback: any) => {
if (value != 2 && value != 3) callback("请选择审核状态");
else callback();
},
trigger: ["blur"],
},
],
});
//
const setFormData = async (data: Record<any, any>) => {
// console.log(data)
// return
formData.id=data.id
for ( let key in taskExtend){
//@ts-ignore
taskExtend[key]=JSON.parse(data.extend)[key]
}
formData.company_a_name=data.company_a_name
formData.company_b_name=data.company_b_name
if(mode.value=='details'){
formData.check_status=data.check_status
formData.remark=data.remark
}
};
//
const handleSubmit = async () => {
await formRef.value?.validate();
if (formData.check_status == 3 && formData.remark == "")
return ElMessage.error("驳回必须填写备注");
await apiApproveAudit({
id: formData.id,
check_status: formData.check_status,
remark: formData.remark,
});
popupRef.value?.close();
emit("success");
};
//
const open = (type = "add") => {
mode.value = type;
popupRef.value?.open();
};
//
const handleClose = () => {
emit("close");
};
defineExpose({
open,
setFormData,
});
</script>
<style lang="scss" scoped>
:deep(.el-timeline-item__wrapper) {
top: -8px !important;
}
.attachment {
width: 150px;
height: 150px;
/* background-color: red; */
margin-right: 10px;
margin-bottom: 10px;
}
.video {
width: 300px;
height: 150px;
/* background-color: red; */
margin-right: 10px;
margin-bottom: 10px;
}
.disabled{
pointer-events: none;
cursor: not-allowed;
}
</style>

View File

@ -0,0 +1,182 @@
<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="name">
<el-select
v-model="queryParams.check_status"
placeholder="请选择审核状态"
clearable
class="w-[280px]"
>
<el-option
v-for="(item, index) in checkStatusList"
:key="index"
:label="item.name"
:value="item.id"
></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">
<div class="mt-4">
<el-table :data="pager.lists" >
<el-table-column label="ID" width="100" prop="id" />
<el-table-column
label="参股公司"
prop="company_b_name"
width="500"
show-overflow-tooltip
align="center"
/>
<el-table-column
label="被参股公司"
prop="company_a_name"
show-overflow-tooltip
width="500"
align="center"
>
</el-table-column>
<el-table-column
label="参股金额"
prop="amount"
show-overflow-tooltip
>
</el-table-column>
<el-table-column label="备注" prop="remark" show-overflow-tooltip>
</el-table-column>
<el-table-column label="操作" width="120" fixed="right">
<template #default="{ row }">
<el-button
v-if="row.check_status <= 1"
v-perms="['flow/edit']"
type="primary"
link
@click="handleEdit(row, 'edit')"
>
审核
</el-button>
<el-button
v-else
type="primary"
link
@click="handleEdit(row, 'details')"
>
详情
</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>
<audit-town-market-popup
v-if="showEdit "
ref="auditTownMarketRef"
:dict-data="dictData"
@success="getLists"
@close="showEdit = false"
/>
</div>
</template>
<script lang="ts" setup name="flowLists">
import { usePaging } from "@/hooks/usePaging";
import { useDictData } from "@/hooks/useDictOptions";
import { apiApproveLists } from "@/api/shareholdingReview";
import {getShareholderMoneyTaskApproveTypeList} from "@/api/setting/dict";
import auditTownMarketPopup from "./components/audit_town_market.vue";
const auditTownMarketRef =
shallowRef<InstanceType<typeof auditTownMarketPopup>>();
//
const showEdit = ref(false);
const openType = ref(1);
//
const queryParams = reactive({
name: "",
check_status: "",
type: "10",
});
getShareholderMoneyTaskApproveTypeList().then((res) => {
queryParams.type = res.join(",");
getLists();
});
const checkStatusList = ref([
{
id: 1,
name: "待审核",
},
{
id: 2,
name: "已通过",
},
{
id: 3,
name: "未通过",
},
]);
//
const showAuditTypeList = ref([1, 5, 6]);
const showAuditOther = computed(() => {
return showAuditTypeList.value.includes(openType.value);
});
//
const { dictData } = useDictData("");
//
//@ts-ignore
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiApproveLists,
params: queryParams,
});
//
const handleEdit = async (data: any, type = "edit") => {
console.log(data.type)
openType.value = data.type;
showEdit.value = true;
await nextTick();
auditTownMarketRef.value?.open(type);
auditTownMarketRef.value?.setFormData(data);
};
//
// const handleDelete = async (id: number | any[]) => {
// await feedback.confirm("");
// await apiFlowDelete({ id });
// getLists();
// };
// getTaskApproveTypeList().then((res) => {
// queryParams.type = res.join(",");
// });
</script>

View File

@ -0,0 +1,274 @@
<template>
<el-dialog v-model="dialogVisible" title="任务详情" width="30%">
<el-card class="box-card" v-loading="loading">
<template #header>
<div class="card-header">
<span class="tit">任务名称</span>
<span>{{ taskDeatil?.detail?.title }}</span>
</div>
</template>
<div style="margin-top: 1vh;display: flex;">
<!-- town_task_type_5任务 -->
<div v-if="taskDeatil?.detail?.task_type_value == 'town_task_type_5'"
style="display: flex; justify-content:space-between;width: 100%; " class="tit">
<div>
交易金额剩余池 {{ taskDeatil?.detail?.progress?.done }}
</div>
<div>
目标完成金额 {{ taskDeatil?.detail?.progress?.total }}
</div>
</div>
<!-- town_task_type_marketing_director_10任务 -->
<div v-else-if="taskDeatil?.detail?.task_type_value == 'town_task_type_marketing_director_10'">
<div style="width: 25.5vw;" v-if="taskDeatil.detail?.progress?.stage1">
<div class="tit">第一阶段</div>
<div>
<el-image style="width: 100px; height: 100px;margin: 10px 5px;" :src="items" fit="fill"
v-for=" items in taskDeatil.detail?.progress.stage1.stage1.file" />
</div>
<div>
备注: {{ taskDeatil.detail?.progress.stage1.stage1.remark }}
</div>
<el-divider />
</div>
<div style="width: 25.5vw;" v-if="taskDeatil.detail?.progress?.stage2">
<div class="tit">第二阶段</div>
<div>
<el-image style="width: 100px; height: 100px;margin: 10px 5px;" :src="items" fit="fill"
v-for=" items in taskDeatil.detail?.progress.stage2.stage2.file" />
</div>
<div>
备注: {{ taskDeatil.detail?.progress.stage2.stage2.remark }}
</div>
<el-divider />
</div>
<div style="width: 25.5vw;" v-if="taskDeatil.detail?.progress?.stage3">
<div class="tit">第三阶段</div>
<div>
<el-image style="width: 100px; height: 100px;margin: 10px 5px;" :src="items" fit="fill"
v-for=" items in taskDeatil.detail?.progress.stage3.stage3.file" />
</div>
<div>
备注: {{ taskDeatil.detail?.progress.stage3.stage3.remark }}
</div>
<el-divider />
</div>
<div style="width: 25.5vw;" v-if="taskDeatil.detail?.progress?.stage4">
<div class="tit">第四阶段</div>
<div>
<el-image style="width: 100px; height: 100px;margin: 10px 5px;" :src="items" fit="fill"
v-for=" items in taskDeatil.detail?.progress.stage4.stage4.file" />
</div>
<div>
备注: {{ taskDeatil.detail?.progress.stage4.stage4.remark }}
</div>
<el-divider />
</div>
</div>
<!-- town_task_type_marketing_director_4 及其他任务 -->
<div v-else-if="town_task_type_marketing_director_4TaskList.includes(taskDeatil?.detail?.task_type_value)"
style="width: 100%;">
<div class="tit"> 任务进度 {{ sue(taskDeatil?.detail?.progress, 'procure_amount') }} / {{
taskDeatil?.detail?.progress[0]?.total }}</div>
<el-table :data="taskDeatil?.detail?.progress">
<el-table-column label="商户名称" prop="merchant_name" show-overflow-tooltip />
<el-table-column label="已采购金额" prop="procure_amount" show-overflow-tooltip width="130px"
align="center" />
<el-table-column label="目标金额" prop="total" show-overflow-tooltip align="center" />
</el-table>
</div>
<!-- town_task_type_marketing_director_5 任务 -->
<div v-else-if="taskDeatil?.detail?.task_type_value == 'town_task_type_marketing_director_5'"
style="width: 100%;">
<div class="tit"> 任务进度 {{ sue(taskDeatil?.detail?.progress, 'trade_amount') }} / {{
taskDeatil?.detail?.progress[0]?.total }}</div>
<el-table :data="taskDeatil?.detail?.progress">
<el-table-column label="商户名称" prop="merchant_name" show-overflow-tooltip />
<el-table-column label="已销售金额" prop="trade_amount" show-overflow-tooltip width="130px"
align="center" />
<el-table-column label="目标金额" prop="total" show-overflow-tooltip align="center" />
</el-table>
</div>
<!-- town_task_type_marketing_director_3任务 -->
<div v-else-if="town_task_type_marketing_director_3TaskList.includes(taskDeatil?.detail?.task_type_value)"
style="width: 100%;">
<el-table :data="taskDeatil?.detail?.progress">
<el-table-column label="商户名称" prop="mer_name" show-overflow-tooltip />
<el-table-column label="产品上架目标数" prop="total" show-overflow-tooltip width="130px" align="center" />
<el-table-column label="已上架数" prop="count" show-overflow-tooltip align="center" />
<el-table-column label="是否更新库存" show-overflow-tooltip align="center">
<template #default="{ row }">
{{ row.is_update_stock ? '已更新' : "未更新" }}
</template>
</el-table-column>
</el-table>
</div>
<!-- 其他任务 -->
<div v-else class="tit">
任务进度 {{ taskDeatil?.detail?.progress?.done }} / {{ taskDeatil?.detail?.progress?.total }}
</div>
</div>
<!-- town_task_type_marketing_director_2任务 -->
<div style="margin-top: 1vh;"
v-if="taskDeatil?.detail?.task_type_value == 'town_task_type_marketing_director_2'">
<div class="tit"> 完成详情 </div>
<el-table :data="taskDeatil?.detail?.done_list">
<el-table-column label="商户ID" prop="mer_id" show-overflow-tooltip align="center" />
<el-table-column label= "商户名称" prop="mer_name" show-overflow-tooltip align="center" />
</el-table>
</div>
<!--town_task_type_master_5任务 -->
<div style="margin-top: 1vh;" v-if="taskDeatil?.detail?.task_type_value == 'town_task_type_master_5'">
<div class="tit"> 完成详情 </div>
<el-table :data="taskDeatil?.detail?.done_list">
<el-table-column label="ID" prop="id" show-overflow-tooltip align="center" width="38px" />
<el-table-column label="公司名称" prop="company_name" show-overflow-tooltip align="center" />
</el-table>
</div>
</el-card>
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<!-- 进行中的任务可以结算 -->
<el-button type="primary" @click="settlementFn" v-if="row?.task.status == 2">
结算
</el-button>
<el-button type="primary" @click="dialogVisible = false" v-else>
确定
</el-button>
</span>
</template>
</el-dialog>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
import { taskProgress } from "@/api/task"
const dialogVisible = ref(false)
const loading = ref(true)
const row = ref("")
const taskDeatil = ref('')
/* 狮心会的干部们对于该送什么样的花没有讨论出结果,于是决意扫光学院的花店,学院花店的鲜花不是外面运来的,而是源于基因科学系的温室,当天有整整一温室的黄色和白色的郁金香被采摘,于是被狮心会豪迈地包圆了。郁金香的花语是“博爱、体贴、高雅、富贵”,在法国人兰斯洛特想来倒也合适,不过最后这些鲜花摆在病房里的效果确实有些窘迫,于是兰斯洛特很有心地叫人再去买一些红玫瑰来放在床头。*/
// town_task_type_marketing_director_4
const town_task_type_marketing_director_4TaskList = reactive([
'town_task_type_marketing_director_4',
'town_task_type_marketing_director_9',
'town_task_type_marketing_director_8'
])
// town_task_type_marketing_director_3
const town_task_type_marketing_director_3TaskList = reactive([
'town_task_type_marketing_director_3',
'town_task_type_marketing_director_7'
])
const openDeatl = (item: any) => {
loading.value = true
row.value = item
dialogVisible.value = true
taskProgress({
task_id: item.task.id
}).then(res => {
taskDeatil.value = res
loading.value = false
console.log(taskDeatil.value)
})
}
// town_task_type_marketing_director_4
const sue = (list: any, key: string) => {
const sum = list.reduce((accumulator: number, currentValue: number) => accumulator + currentValue[key], 0);
return sum
}
//
const settlementFn = () => {
dialogVisible.value = false
}
defineExpose({
openDeatl,
});
</script>
<style scoped>
.dialog-footer button:first-child {
margin-right: 10px;
}
.card-header {
display: flex;
justify-content: space-between;
align-items: center;
}
.text {
font-size: 14px;
}
.item {
margin-bottom: 18px;
}
.box-card {
width: 100%;
}
.tit {
font-weight: bold;
}
.li {
justify-content: space-between;
display: flex;
margin: 5px 0;
padding: 3px 5px;
border-bottom: 1px solid #F8F8F8;
}
.li:hover {
background-color: #F8F8F8;
}
</style>

View File

@ -0,0 +1,106 @@
<template>
<div class="edit-popup">
<popup ref="popupRef" :title="title" :async="true" width="800px" @close="handleClose"
:clickModalClose="mode == 'show'" :button="false">
<el-table :data="pager.lists">
<el-table-column label="ID" prop="task.id" show-overflow-tooltip width="80" />
<el-table-column label="名称" prop="task.title" width="300" show-overflow-tooltip />
<el-table-column label="金额" prop="task.money" show-overflow-tooltip />
<el-table-column label="状态" prop="templateInfo.status" show-overflow-tooltip>
<template #default="{ row }">
<span
:style="{ color: row.task.status == 2 ? '#F5D984' : row.task.status == 3 ? '#37BE5F' : '#EBEBEB' }">
{{
statusFn(row.task.status) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" prop="street" show-overflow-tooltip align="center">
<template #default="{ row }">
<span style="cursor: pointer;color: #4A5DFF;" @click="openTask(row)">详情</span>
</template>
</el-table-column>
</el-table>
</popup>
</div>
</template>
<script lang="ts" setup name="taskEidt">
import Popup from "@/components/popup/index.vue";
import { usePaging } from "@/hooks/usePaging";
import { getDayTaskList } from "@/api/task";
import { timeFormat } from "@/utils/util";
const route = useRoute();
const emit = defineEmits(["success", "close",'openDeatl']);
const popupRef = shallowRef<InstanceType<typeof Popup>>();
const isShow = ref(false);
const title = ref("任务列表");
const mode = ref('')
const queryParams = {
company_id: '',
date: '',
page_size:50
}
const dayTaskList = ref("")
//
const open = async (date, id) => {
queryParams.company_id = id
queryParams.date = timeFormat(date)
await getLists();
popupRef.value?.open();
};
//
const openTask=(row)=>{
emit("openDeatl",row);
}
const statusFn = (status) => {
if (status == 2) return "进行中"
if (status == 3) return "已完成"
if (status == 5) return "已关闭"
}
const tagClick = (item) => {
emit("open", item);
}
//
const handleClose = () => {
emit("close");
};
defineExpose({
open,
});
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: getDayTaskList,
params: queryParams,
});
</script>
<style lang="scss" scoped>
.formdata {
.el-form-item {
.el-date-picker {
width: 100%;
}
}
}
.tag-li {
margin: 5px;
}
</style>

View File

@ -13,11 +13,11 @@
新增
</el-button>
</div> -->
<calendar
<!-- <calendar
:list="taskList"
@clickItem="clickTask"
@initShowDate="initShowDate"
></calendar>
></calendar> -->
<!-- <div class="mt-4">
<el-calendar v-model="dateValue">
<template #dateCell="{ data }">
@ -40,31 +40,60 @@
</template>
</el-calendar>
</div>-->
<el-calendar v-model="value" @click="dateClick">
<template #date-cell="{ data }">
{{ data.day.split('-').slice(1).join('-') }}
<p style=" text-align: center;margin-top: 4vh; ">
<el-tag class="ml-2" >查看任务</el-tag>
</p>
</template>
</el-calendar>
</el-card>
<EditTowPopup
ref="editTowRef"
:task="task"
:type="popupType"
:company_id="company_id"
@success="loadTask"
@close="showEditTow = false"
/>
<!-- <EditTowPopup ref="editTowRef" :task="task" :type="popupType" :company_id="company_id" @success="loadTask"
@close="showEditTow = false" /> -->
<popTaskList ref="popTaskTable" @openDeatl="openTask" @close="showEditTow = false" />
<popTaskDetail ref="popDeatil" />
</div>
</template>
<script lang="ts" setup name="task">
import { timeFormat } from "@/utils/util";
import feedback from "@/utils/feedback";
// import { getRoutePath } from "router";
import EditTowPopup from "./editTow.vue";
import popTaskList from "./popTaskList.vue";
import popTaskDetail from "./popTaskDetail.vue";
import { reactive, watch } from "vue";
import { apiTaskList, apiTaskDetails } from "@/api/task";
import calendar from "./calendar.vue";
// import { apiTaskList, apiTaskDetails } from "@/api/task";
// import calendar from "./calendar.vue";
const value = ref(new Date())
const route = useRoute();
const dateValue = ref(new Date());
//
const dateClick = () => {
popTaskTable.value?.open(value.value, route.query.company_id);
}
//
const popDeatil = ref('')
const openTask = (row) => {
popDeatil.value.openDeatl(row)
}
// return
//
const task = ref({
@ -82,17 +111,20 @@ const clickTask = (e: any) => {
popupType.value = "show";
// task.value = e;
task.value = taskList.value.find((item: any) => item.id == e) || null;
handleSelect();
// handleSelect();
};
//
const loading = ref(true);
const loading = ref(false);
const editRef = shallowRef<InstanceType<typeof EditPopup>>();
const editTowRef = shallowRef<InstanceType<typeof EditPopup>>();
const popTaskTable = shallowRef<InstanceType<typeof EditPopup>>();
//
const showEdit = ref(false);
const showEditTow = ref(false);
const showEditDeatil = ref(false);
//
const queryParams = reactive({
@ -109,107 +141,116 @@ const company_id = ref("");
if (route.query.company_id) company_id.value = route.query.company_id;
const taskList = ref<any>([]);
//
const loadTask = async () => {
apiTaskList(queryParams).then((res) => {
taskList.value = res.lists;
loading.value = false;
});
};
// const loadTask = async () => {
// apiTaskList(queryParams).then((res) => {
// taskList.value = res.lists;
// loading.value = false;
// });
// };
const start_date = ref("");
const end_date = ref("");
//
const initShowDate = (dateStr = "") => {
const currentDate = dateStr ? new Date(dateStr) : new Date();
const currentYear = currentDate.getFullYear();
const currentMonth = currentDate.getMonth();
const lastDay = new Date(currentYear, currentMonth + 1, 0).getDay(); //
const startDay = new Date(currentYear, currentMonth, 1).getDay(); //
// console.log(new Date(currentYear, currentMonth, 1-startDay).getDate());
// console.log(new Date(currentYear, currentMonth + 1, 6-lastDay).getDate());
start_date.value = timeFormat(
new Date(currentYear, currentMonth, 1 - startDay).getTime()
); //
end_date.value = timeFormat(
new Date(currentYear, currentMonth + 1, 6 - lastDay).getTime()
); //
if (queryParams.start_time != start_date.value) {
queryParams.start_time = start_date.value;
queryParams.end_time = end_date.value;
loading.value = true;
loadTask();
}
};
initShowDate();
// const initShowDate = (dateStr = "") => {
// const currentDate = dateStr ? new Date(dateStr) : new Date();
// const currentYear = currentDate.getFullYear();
// const currentMonth = currentDate.getMonth();
// const lastDay = new Date(currentYear, currentMonth + 1, 0).getDay(); //
// const startDay = new Date(currentYear, currentMonth, 1).getDay(); //
// // console.log(new Date(currentYear, currentMonth, 1-startDay).getDate());
// // console.log(new Date(currentYear, currentMonth + 1, 6-lastDay).getDate());
// start_date.value = timeFormat(
// new Date(currentYear, currentMonth, 1 - startDay).getTime()
// ); //
// end_date.value = timeFormat(
// new Date(currentYear, currentMonth + 1, 6 - lastDay).getTime()
// ); //
// if (queryParams.start_time != start_date.value) {
// queryParams.start_time = start_date.value;
// queryParams.end_time = end_date.value;
// // loading.value = true;
// // loadTask();
// }
// };[]
// initShowDate();
//
const taskListFilter = (e: any) => {
return taskList.value
.filter((item: any) => {
const now = new Date(e).getTime() / 1000;
const start = new Date(item.start_time).getTime() / 1000;
const end = new Date(item.end_time).getTime() / 1000;
return now - start >= 0 && now - end <= 0;
})
.slice(0, 5);
};
// //
// const taskListFilter = (e: any) => {
// return taskList.value
// .filter((item: any) => {
// const now = new Date(e).getTime() / 1000;
// const start = new Date(item.start_time).getTime() / 1000;
// const end = new Date(item.end_time).getTime() / 1000;
// return now - start >= 0 && now - end <= 0;
// })
// .slice(0, 5);
// };
//
const handleAdd = async () => {
popupType.value = "add";
showEditTow.value = true;
await nextTick();
editTowRef.value?.open("add");
editTowRef.value?.updatedForm();
};
//
const handleSelect = async () => {
popupType.value = "show";
showEditTow.value = true;
await nextTick();
editTowRef.value?.open("show");
editTowRef.value?.updatedForm(task.value);
};
// //
// const handleAdd = async () => {
// popupType.value = "add";
// showEditTow.value = true;
// await nextTick();
// editTowRef.value?.open("add");
// editTowRef.value?.updatedForm();
// };
// //
// const handleSelect = async () => {
// popupType.value = "show";
// showEditTow.value = true;
// await nextTick();
// editTowRef.value?.open("show");
// editTowRef.value?.updatedForm(task.value);
// };
//
const nowType = ref(0);
const handleTypeClick = (e) => {
console.log(e);
};
// //
// const nowType = ref(0);
// const handleTypeClick = (e) => {
// console.log(e);
// };
</script>
<style lang="scss">
.is-selected {
color: #1989fa;
}
.el-calendar-table .el-calendar-day {
min-height: 8.2rem;
padding: 0;
}
.task {
font-size: 0.8rem;
/* color: #f7ba2a; */
color: #1989fa;
padding: 0 8px;
white-space: nowrap; /* 设置文本不换行 */
overflow: hidden; /* 隐藏溢出的部分 */
text-overflow: ellipsis; /* 在溢出的部分显示省略号 */
white-space: nowrap;
/* 设置文本不换行 */
overflow: hidden;
/* 隐藏溢出的部分 */
text-overflow: ellipsis;
/* 在溢出的部分显示省略号 */
&:hover {
background-color: rgba($color: #f38200, $alpha: 0.7);
border-radius: 4px;
color: #fff;
}
}
.the {
color: #ff5100;
}
.tow {
color: #f38200;
}
.fou {
color: red;
}
.btn {
height: 30px;
width: 150px;
@ -218,14 +259,20 @@ const handleTypeClick = (e) => {
overflow: hidden;
display: flex;
cursor: pointer;
div {
flex: 1;
text-align: center;
line-height: 30px;
}
.active {
background-color: #4a5dff;
color: #fff;
}
}
.is-selected {
color: #1989fa;
}
</style>

View File

@ -0,0 +1,151 @@
<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.keyword" clearable placeholder="请输入商品名称" />
</el-form-item>
<el-form-item label="商品编号" prop="company_type">
<el-input class="w-[280px]" v-model="queryParams.no" 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-card class="!border-none" shadow="never">
<div class="mt-4">
<el-table ref="tableRef" :data="pager.lists" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" />
<el-table-column label="ID" property="product_id" />
<el-table-column label="图片" property="image">
<template #default="{ row }">
<el-image :src="row.image" style="width: 80px; height: 80px" fit="cover"></el-image>
</template>
</el-table-column>
<el-table-column label="商品名称" property="store_name" />
<el-table-column label="价格" property="price" />
</el-table>
</div>
<div class="flex justify-end mt-4">
<pagination v-model="pager" @change="getLists" :pageSizes="[10]" />
</div>
<div class="flex justify-end mt-2">
<el-button type="primary" @click="handleCurrentChange(changeList)">确认</el-button>
<el-button @click="commodityClose">取消</el-button>
</div>
</el-card>
</div>
</template>
<script lang="ts" setup name="companyLists">
import { usePaging } from "@/hooks/usePaging";
import { useDictData } from "@/hooks/useDictOptions";
import { apiGetProductList } from "@/api/task_template";
import { defineEmits, computed, watch } from "vue";
const tableRef = ref(null);
//
const props = defineProps({
ids: {
type: String,
default: "",
},
});
let goods_id = props?.ids?.split(",") || [];
//
const queryParams = reactive({
keyword: "",
no: "",
});
//
const emits = defineEmits(["customEvent", "close"]);
//
const handleCurrentChange = (value: any) => {
let arr: any = [];
value.forEach((item: any) => {
arr = [...arr, ...item];
});
// return console.log(value, arr);
emits("customEvent", arr);
};
const changeList = ref([[]]);
let count = 0;
const handleSelectionChange = (value: any[]) => {
// ,, 使
let index = pager.page ? pager.page - 1 : 0;
// , , , , , 使
if (index != count && value.length < changeList.value[index].length) {
console.log("加载中");
} else {
count = index;
changeList.value[index] = JSON.parse(JSON.stringify(value));
console.log("加载完成");
}
}; //
const commodityClose = () => {
emits("close", null);
};
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiGetProductList,
params: queryParams,
size: 10,
});
getLists().then(res=>{
for(let i=0;i<Math.ceil(pager.count / pager.size)-1;i++){
changeList.value.push([])
}
});
//
watch(
() => pager.lists,
(n, o) => {
//
nextTick(() => {
n.forEach((item: any) => {
item.product_id += "";
// console.log("", goods_id);
let f_ids = new Set(); // id
//
if (goods_id.includes(item.product_id)) {
let index = pager.page ? pager.page - 1 : 0;
if (
!changeList.value[index]?.find(
(e: any) => e.product_id == item.product_id
)
) {
f_ids.add(item.product_id);
changeList.value[index]?.push(item);
}
}
goods_id = goods_id.filter((item: string) => !f_ids.has(item)); //
// console.log("", goods_id);
// console.log("", changeList.value);
// changeList
changeList.value.forEach((c: any) => {
c.forEach((e: any) => {
if (e.product_id == item.product_id) {
tableRef.value.toggleRowSelection(item, true);
}
});
});
});
});
},
{ deep: true, immediate: true }
);
</script>

View File

@ -1,6 +1,6 @@
<template>
<div>
<!-- <el-card class="!border-none" shadow="never">
<el-card class="!border-none" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="负责人名称" prop="name">
<el-input
@ -10,11 +10,11 @@
placeholder="请输入负责人名称"
/>
</el-form-item>
<el-form-item label="请选择负责人角色" prop="role_id">
<el-select class="w-[280px]" v-model="queryParams.role_id">
<el-form-item label="请选择负责人角色" prop="group_id">
<el-select class="w-[280px]" v-model="queryParams.group_id">
<el-option label="全部" value />
<el-option
v-for="(item, index) in optionsData.role"
v-for="(item, index) in roleList"
:key="index"
:label="item.name"
:value="item.id"
@ -26,10 +26,11 @@
<el-button @click="resetParams">重置</el-button>
</el-form-item>
</el-form>
</el-card> -->
</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 :data="pager.lists" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" />
<el-table-column label="账号" prop="account" min-width="120" />
<el-table-column label="头像" prop="avatar" min-width="80">
<template #default="{ row }">
@ -57,31 +58,41 @@
<el-table-column label="最近登录IP" prop="login_ip" min-width="120" /> -->
</el-table>
</div>
<div class="flex mt-4 justify-end">
<div class="flex justify-end mt-4">
<pagination v-model="pager" @change="getLists" />
</div>
<template #footer>
<div style="float: right;">
<el-button @click="offPop">取消</el-button>
<el-button type="primary" @click="handleCurrentChange">确定</el-button>
</div>
</template>
</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 Popup from "@/components/popup/index.vue";
import {apiUserRoleLists} from "@/api/newTask.ts"
import { defineEmits } from "vue";
import { getUserList } from "@/api/user";
const { optionsData } = useDictOptions<{
role: any[];
}>({
role: {
api: roleAll,
},
});
const roleList=ref([])
const getRoleList=async()=>{
let res=await apiUserRoleLists()
roleList.value=res
}
//
const queryParams = reactive({
company_id: "",
nickname:"",
group_id:""
});
const props = defineProps({
company_id: {
@ -89,21 +100,32 @@ const props = defineProps({
defaults: 0,
},
});
queryParams.company_id = props.company_id;
//
const emits = defineEmits(["customEvent"]);
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map((item) => ( {id:item.id,nickName:item.nickname} ))
}
const emits = defineEmits(["customEvent",'off']);
//
const handleCurrentChange = (value: any) => {
emits("customEvent", value);
const handleCurrentChange = () => {
emits("customEvent", selectData);
};
const offPop=()=> (
emits("off")
)
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: getUserList,
params: queryParams,
});
getRoleList()
getLists();
</script>

View File

@ -1,35 +1,28 @@
<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="type">
<el-select
v-model="formData.type"
clearable
:disabled="mode != 'add'"
placeholder="请输入任务类型"
@change="changeTaskType"
>
<el-option
v-for="item in datalist"
:key="item.label"
:value="item.id"
:label="item.name"
/>
<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="任务模板">
<el-select v-model="taskTempId" clearable :disabled="mode != 'add'" placeholder="请选择任务模板"
@change="changeTaskTypeFn" style="width:100%">
<el-option v-for="item in taskTempList" :key="item.id" :value="item.id" :label="item.title" />
</el-select>
</el-form-item> -->
<el-form-item label="任务名称" prop="type">
<!-- <el-select v-model="formData.type" clearable placeholder="请输入任务类型" @change="changeTaskType" style="width:100%">
<el-option v-for="(item, index) in roleTypeList" :key="item" :value="item.id" :label="item.name" />
</el-select> -->
<el-input placeholder="请输入任务名称" v-model="formData.title" />
</el-form-item>
<!-- <el-form-item label="任务下发时间" prop="cron_time">
<el-date-picker format="YYYY/MM/DD" value-format="YYYY-MM-DD" :disabled="mode != 'add'" v-model="formData.cron_time" type="date"
placeholder="请选择时间" style="width: 50vw;" />
</el-form-item> -->
<!-- <el-form-item
v-if="formData.type == 32"
label="起点"
@ -42,178 +35,86 @@
:value="formData.extend?.origin?.address"
/>
</el-form-item> -->
<el-form-item
v-if="formData.type == 32"
label="中转点"
@click="changeMap(1)"
prop="extend.transfer.address"
>
<el-input
placeholder="请选择中转点"
readonly
:value="formData.extend?.transfer?.address"
/>
<!-- <el-form-item v-if="formData.type == 32" label="中转点" @click="changeMap(1)" prop="extend.transfer.address">
<el-input placeholder="请选择中转点" readonly :value="formData.extend?.transfer?.address" />
</el-form-item>
<el-form-item
v-if="formData.type == 32"
label="终点"
@click="changeMap(2)"
prop="extend.terminus.address"
>
<el-input
placeholder="请选择终点"
readonly
:value="formData.extend?.terminus?.address"
/>
<el-form-item v-if="formData.type == 32" label="终点" @click="changeMap(2)" prop="extend.terminus.address">
<el-input placeholder="请选择终点" readonly :value="formData.extend?.terminus?.address" />
</el-form-item> -->
<el-form-item label="负责人" prop="director_uid" @click="clickTaskAdmin">
<el-input placeholder="请选择负责人" :disabled="mode != 'add'" readonly v-model="formData.task_admin_name" />
</el-form-item>
<el-form-item
v-if="formData.type == 35"
label="负责人"
prop="task_admin"
@click="clickTaskAdmin"
>
<el-input
placeholder="请选择负责人"
readonly
v-model="formData.task_admin_name"
/>
</el-form-item>
<el-form-item label="阶段类型" prop="types">
<!-- <el-form-item label="阶段类型" prop="types">
<div>
<el-select
v-model="formData.types"
clearable
:disabled="mode != 'add'"
placeholder="请输入阶段类型"
>
<el-option
v-for="item in [
{ label: 1, name: '循环' },
{ label: 2, name: '长期' },
{ label: 3, name: '单次' },
]"
:key="item.label"
:value="item.label"
:label="item.name"
/>
<el-select v-model="formData.types" clearable placeholder="请输入阶段类型" style="width:21vw">
<el-option v-for="item in [
{ label: 1, name: '循环' },
{ label: 2, name: '长期' },
{ label: 3, name: '单次' },
]" :key="item.label" :value="item.label" :label="item.name" />
</el-select>
<div
v-if="formData.types == 3"
style="color: #e6a23c; font-size: 12px"
>
<div v-if="formData.types == 3" style="color: #e6a23c; font-size: 12px">
提示 : 单次任务不会每日结算,而是按阶段合计天数结算
</div>
</div>
</el-form-item>
<el-form-item label="一阶段天数">
<el-input
v-model="formData.stage_day_one"
clearable
placeholder="请输入天数"
type="number"
>
<el-input v-model="formData.stage_day_one" clearable placeholder="请输入天数" type="number" >
<template #append></template>
</el-input>
</el-form-item>
<el-form-item label="一阶段金额">
<div style="width: 100%">
<el-input
v-model="formData.money"
clearable
placeholder="请输入金额"
type="number"
>
<el-input v-model="formData.money" clearable placeholder="请输入金额" type="number">
<template #append></template>
</el-input>
<div
v-if="formData.type == 35"
style="color: #e6a23c; font-size: 12px"
>
<div v-if="formData.type == 35" style="color: #e6a23c; font-size: 12px">
提示 : 本任务的金额将会在任务完成后按阶段天数*阶段金额统一结算
</div>
</div>
</el-form-item>
<el-form-item label="二阶段天数">
<el-input
v-model="formData.stage_day_two"
clearable
placeholder="请输入天数"
type="number"
>
<el-input v-model="formData.stage_day_two" clearable placeholder="请输入天数" type="number">
<template #append></template>
</el-input>
</el-form-item>
<el-form-item label="二阶段金额">
<div style="width: 100%">
<el-input
v-model="formData.money_two"
clearable
placeholder="请输入金额"
type="number"
>
<el-input v-model="formData.money_two" clearable placeholder="请输入金额" type="number">
<template #append></template>
</el-input>
<div
v-if="formData.type == 35"
style="color: #e6a23c; font-size: 12px"
>
<div v-if="formData.type == 35" style="color: #e6a23c; font-size: 12px">
提示 : 本任务的金额将会在任务完成后按阶段天数*阶段金额统一结算
</div>
</div>
</el-form-item>
<el-form-item label="长期金额" v-if="+formData.types == 2">
<el-input
v-model="formData.money_three"
clearable
placeholder="请输入金额"
type="number"
>
<el-input v-model="formData.money_three" clearable placeholder="请输入金额" type="number">
<template #append></template>
</el-input>
</el-form-item>
<el-form-item
v-if="formData.type == 35"
label="充值金额(元)"
prop="recharge"
>
<el-input
placeholder="请输入充值金额(元)"
v-model="formData.recharge"
type="number"
/>
<el-form-item v-if="formData.type == 35" label="充值金额(元)" prop="recharge">
<el-input placeholder="请输入充值金额(元)" v-model="formData.recharge" type="number" />
</el-form-item>
-->
<el-form-item label="状态" prop="status">
<el-radio-group v-model="formData.status">
<el-radio :label="1">显示</el-radio>
<el-radio :label="0">隐藏</el-radio>
<el-radio :label="2">显示</el-radio>
<el-radio :label="5">隐藏</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="完成时间" prop="end_time">
<el-date-picker format="YYYY/MM/DD" value-format="YYYY-MM-DD"
v-model="formData.end_time" type="date" placeholder="请选择时间" style="width: 50vw;" />
</el-form-item>
<el-form-item label="任务描述" prop="content">
<el-input
v-model="formData.content"
clearable
placeholder="请输入任务描述"
type="textarea"
autosize
/>
<el-input v-model="formData.content" clearable placeholder="请输入任务描述" type="textarea" autosize />
</el-form-item>
</el-form>
<taskMap
v-if="mapShow"
ref="mapRef"
@success="setMap"
@close=""
></taskMap>
<el-dialog
v-model="personnelShow"
ref="personnelRef"
title="选择负责人"
width="60%"
>
<personnelPopup
@custom-event="changePersonner"
:company_id="formData.company_id"
></personnelPopup>
<taskMap v-if="mapShow" ref="mapRef" @success="setMap" @close=""></taskMap>
<el-dialog v-model="personnelShow" ref="personnelRef" title="选择负责人" width="60%">
<personnelPopup @custom-event="changePersonner" @off="personnelShow = false" :company_id="formData.company_id">
</personnelPopup>
</el-dialog>
</popup>
</div>
@ -228,6 +129,10 @@ import {
apiTaskTemplateDetail,
apiTaskTypeList,
} from "@/api/task_template";
import { addTask, taskList, editTask } from "@/api/newTask"
import { apiSelectList, apiCreatetaskTypeInfo } from '@/api/create_task_template'
import { timeFormat } from "@/utils/util";
import type { PropType } from "vue";
import { dictDataLists } from "@/api/setting/dict";
@ -255,43 +160,55 @@ const popupTitle = computed(() => {
//
const formData = reactive({
id: "",
task_scheduling: 0,
// task_scheduling: 0,
company_id: "",
title: "",
admin_id: "",
type: "",
// admin_id: "",
// type: "",
status: "",
content: "",
stage_day_one: 0,
money: 0, //
stage_day_two: 0,
money_two: 0, //
money_three: 0, //
types: "", //
task_admin: "", //
// cron_time: "",//
end_time: "",//
// stage_day_one: 0,
// money: 0, //
// stage_day_two: 0,
// money_two: 0, //
// money_three: 0, //
// types: "", //
director_uid: [], //
task_admin_name: "", //
recharge: "",
extend: {
// origin: {
// address: "",
// lnglat: [],
// }, //
transfer: {
address: "",
lnglat: [],
}, //
terminus: {
address: "",
lnglat: [],
}, //
},
// recharge: "",
// extend: {
// // origin: {
// // address: "",
// // lnglat: [],
// // }, //
// transfer: {
// address: "",
// lnglat: [],
// }, //
// terminus: {
// address: "",
// lnglat: [],
// }, //
// },
});
if (route.query.id) {
formData.task_scheduling = route.query.id;
// if (route.query.id) {
// formData.task_scheduling = route.query.id;
// }
let type_value = "xxx"
if (route.query.company_type == 18) {
type_value = "task_type"
}
//
apiTaskTypeList({ type_value: "task_type" }).then((res) => {
const roleTypeList = ref('')
//
apiTaskTypeList({ type_value: type_value }).then((res) => {
datalist.value = res.lists;
roleTypeList.value = res.lists
});
//
@ -303,20 +220,20 @@ const formRules = reactive<any>({
trigger: ["blur"],
},
],
admin_id: [
{
required: true,
message: "请输入创建人",
trigger: ["blur"],
},
],
type: [
{
required: true,
message: "请输入任务类型",
trigger: ["blur"],
},
],
// admin_id: [
// {
// required: true,
// message: "",
// trigger: ["blur"],
// },
// ],
// type: [
// {
// required: true,
// message: "",
// trigger: ["blur"],
// },
// ],
status: [
{
required: true,
@ -324,54 +241,87 @@ const formRules = reactive<any>({
trigger: ["blur"],
},
],
types: [
// types: [
// {
// required: true,
// message: "",
// trigger: ["blur"],
// },
// ],
// cron_time: [
// {
// required: true,
// message: "",
// trigger: ["blur"],
// },
// ],
end_time: [
{
required: true,
message: "请输入阶段类型",
message: "请选择任务下发时间",
trigger: ["blur"],
},
],
task_admin: [
director_uid: [
{
required: true,
message: "请选择负责人",
trigger: ["blur"],
},
],
recharge: [
{
required: true,
// message: "",
validator: (rule: any, value: any, callback: any) => {
if (value <= 0) callback(new Error("充值金额不能小于0"));
else callback();
},
trigger: ["blur"],
},
],
"extend.origin.address": [
{
required: true,
message: "请选择中转点",
trigger: ["blur"],
},
],
"extend.transfer.address": [
{
required: true,
message: "请选择中转点",
trigger: ["blur"],
},
],
"extend.terminus.address": [
{
required: true,
message: "请选择终点",
trigger: ["blur"],
},
],
// recharge: [
// {
// required: true,
// // message: "",
// validator: (rule: any, value: any, callback: any) => {
// if (value <= 0) callback(new Error("0"));
// else callback();
// },
// trigger: ["blur"],
// },
// ],
// "extend.origin.address": [
// {
// required: true,
// message: "",
// trigger: ["blur"],
// },
// ],
// "extend.transfer.address": [
// {
// required: true,
// message: "",
// trigger: ["blur"],
// },
// ],
// "extend.terminus.address": [
// {
// required: true,
// message: "",
// trigger: ["blur"],
// },
// ],
});
//
const taskTempList = reactive([])
const taskTempId = ref('')
let task_role_id = ''
if (route.query.company_type == 17) { task_role_id = 4 }
if (route.query.company_type == 18) { task_role_id = 5 }
//
// apiCreatetaskTypeInfo(
// ).then(res => {
// // console.log(res)
// for (let key in res) {
// roleTypeList[key] = res[key]
// }
// })
//
const setFormData = async (data: Record<any, any>) => {
for (const key in formData) {
@ -380,9 +330,12 @@ const setFormData = async (data: Record<any, any>) => {
formData[key] = data[key];
}
}
// formData.type=(formData.type)
if (formData.type == 32) {
mapShow.value = true;
}
};
const getDetail = async (row: Record<string, any>) => {
@ -398,6 +351,7 @@ const mapRef = shallowRef<InstanceType<typeof taskMap>>();
//
const changeTaskType = async (e: any) => {
datalist.value.forEach((item: any) => {
if (item.id == e) formData.title = item.name;
});
@ -431,6 +385,9 @@ const changeMap = async (e: number) => {
};
const setMap = (e: any) => {
formData.extend[mapType.value] = e[0];
};
@ -438,8 +395,13 @@ const setMap = (e: any) => {
const personnelShow = ref(false);
const personnelRef = shallowRef<InstanceType<typeof personnelPopup>>();
const changePersonner = (e: any) => {
formData.task_admin = e.id;
formData.task_admin_name = e.nickname;
const transformedArr = e.value.reduce((acc:any, obj:any) => {
acc[0].push(obj.id);
acc[1].push(obj.nickName);
return acc;
}, [[], []]);
formData.director_uid = transformedArr[0];
formData.task_admin_name = transformedArr[1].join(',');
personnelShow.value = false;
};
@ -451,10 +413,13 @@ const clickTaskAdmin = async () => {
const handleSubmit = async () => {
await formRef.value?.validate();
const data = { ...formData };
if (data.type != 32) data.extend = {}; // ,
const { title, content, status, id,end_time } = data
// if (data.type != 32) data.extend = {}; // ,
mode.value == "edit"
? await apiTaskTemplateEdit(data)
: await apiTaskTemplateAdd(data);
? await editTask({ title, content, status, id,end_time })
: await addTask(data);
popupRef.value?.close();
emit("success");
};
@ -469,10 +434,15 @@ const open = (type = "add") => {
const handleClose = () => {
emit("close");
};
// getTaskTempFn()
defineExpose({
open,
setFormData,
getDetail,
});
</script>
<style>
.el-input__wrapper {
width: 100% !important;
}
</style>

View File

@ -1,129 +1,104 @@
<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"
>
<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="任务45模板" >
<el-select v-model="taskTempId" clearable placeholder="请选择任务模板" @change="changeTaskTypeFn" style="width: 100%;" >
<el-option v-for="item in taskTempList" :key="item.id" :value="item.id" :label="item.title" />
</el-select>
</el-form-item>
<el-form-item label="任务下发时间" prop="cron_time" >
<el-date-picker format="YYYY/MM/DD" value-format="YYYY-MM-DD" :disabled="mode != 'add'"
v-model="formData.cron_time" type="date" placeholder="请选择时间" style="width:2500px" />
</el-form-item>
<el-form-item label="任务角色" prop="extend.task_role">
<el-select v-model="formData.extend.task_role" clearable placeholder="请选择任务角色"
@change="changeTaskRole" style="width: 100%">
<el-option v-for="item in taskRoleRow" :key="item.key" :value="item.key" :label="item.value" />
</el-select>
</el-form-item>
<el-form-item label="任务类型" prop="type">
<el-select
v-model="formData.type"
clearable
:disabled="mode != 'add'"
placeholder="请输入任务类型"
@change="changeTaskType"
>
<el-option
v-for="item in datalist"
:key="item.label"
:value="item.id"
:label="item.name"
/>
<el-select v-model="formData.type" clearable placeholder="请选择任务类型" @change="changeTaskType"
style="width: 54vw;">
<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="types">
<div>
<el-select
v-model="formData.types"
clearable
:disabled="mode != 'add'"
placeholder="请输入阶段类型"
>
<el-option
v-for="item in [
{ label: 1, name: '循环' },
{ label: 2, name: '长期' },
{ label: 3, name: '单次' },
]"
:key="item.label"
:value="item.label"
:label="item.name"
/>
<div style="width: 100%">
<el-select v-model="formData.types" clearable placeholder="请选择阶段类型" style="width: 100%">
<el-option v-for="item in [
{ label: 1, name: '循环' },
{ label: 2, name: '长期' },
{ label: 3, name: '单次' },
]" :key="item.label" :value="item.label" :label="item.name" />
</el-select>
<div
v-if="formData.types == 3"
style="color: #e6a23c; font-size: 12px"
>
<div v-if="formData.types == 3" style="color: #e6a23c; font-size: 12px">
提示 : 单次任务不会每日结算,而是按阶段合计天数结算
</div>
</div>
</el-form-item>
<el-form-item label="一阶段天数">
<!-- <el-form-item label="目标金额" prop="extend.target">
<el-input
v-model="formData.stage_day_one"
v-model="formData.extend.target"
clearable
placeholder="请输入天数"
placeholder="请输入目标金额"
type="number"
>
</el-input>
</el-form-item> -->
<el-form-item v-if="showCommodity" label="商品" prop="extend.goods_id">
<!-- <el-input
readonly
:value="formData.extend.store_name"
clearable
placeholder="请选择"
type="textarea"
autosize
>
</el-input> -->
<div style="width: 100%">{{ formData.extend.store_name }}</div>
<el-button class="mt-2" type="primary" @click="openCommodity">选择商品</el-button>
</el-form-item>
<el-form-item v-if="showTarget" label="目标数" prop="extend.target">
<el-input v-model="formData.extend.target" clearable placeholder="请输入目标数" type="number">
</el-input>
</el-form-item>
<el-form-item label="一阶段天数">
<el-input v-model="formData.stage_day_one" clearable placeholder="请输入天数" type="number">
<template #append></template>
</el-input>
</el-form-item>
<el-form-item label="一阶段金额">
<el-input
v-model="formData.money"
clearable
placeholder="请输入金额"
type="number"
>
<el-input v-model="formData.money" clearable placeholder="请输入金额" type="number">
<template #append></template>
</el-input>
</el-form-item>
<el-form-item label="二阶段天数">
<el-input
v-model="formData.stage_day_two"
clearable
placeholder="请输入天数"
type="number"
>
<el-form-item v-if="showTow && formData.type_value != 'town_task_type_5'" label="二阶段天数">
<el-input v-model="formData.stage_day_two" clearable placeholder="请输入天数" type="number">
<template #append></template>
</el-input>
</el-form-item>
<el-form-item label="二阶段金额">
<el-input
v-model="formData.money_two"
clearable
placeholder="请输入金额"
type="number"
>
<el-form-item v-if="showTow && formData.type_value != 'town_task_type_5'" label="二阶段金额">
<el-input v-model="formData.money_two" clearable placeholder="请输入金额" type="number">
<template #append></template>
</el-input>
</el-form-item>
<el-form-item v-if="noThreefilter(+formData.type)" label="三阶段天数">
<el-input
v-model="formData.stage_day_three"
clearable
placeholder="请输入天数"
type="number"
>
<el-form-item v-if="showThree && noThreefilter(formData.type_value)" label="三阶段天数">
<el-input v-model="formData.stage_day_three" clearable placeholder="请输入天数" type="number">
<template #append></template>
</el-input>
</el-form-item>
<el-form-item v-if="noThreefilter(+formData.type)" label="三阶段金额">
<el-input
v-model="formData.new_money_three"
clearable
placeholder="请输入金额"
type="number"
>
<el-form-item v-if="showThree && noThreefilter(formData.type_value)" label="三阶段金额">
<el-input v-model="formData.new_money_three" clearable placeholder="请输入金额" type="number">
<template #append></template>
</el-input>
</el-form-item>
<el-form-item label="长期金额" v-if="+formData.types == 2">
<el-input
v-model="formData.money_three"
clearable
placeholder="请输入金额"
type="number"
>
<el-input v-model="formData.money_three" clearable placeholder="请输入金额" type="number">
<template #append></template>
</el-input>
</el-form-item>
@ -134,31 +109,22 @@
</el-radio-group>
</el-form-item>
<el-form-item label="任务描述" prop="content">
<el-input
v-model="formData.content"
clearable
placeholder="请输入任务描述"
type="textarea"
autosize
/>
<el-input v-model="formData.content" clearable placeholder="请输入任务描述" type="textarea"
autosize />
</el-form-item>
</el-form>
<el-dialog
v-model="personnelShow"
ref="personnelRef"
title="选择负责人"
width="60%"
>
<personnelPopup
@custom-event="changePersonner"
:company_id="formData.company_id"
></personnelPopup>
<el-dialog v-model="personnelShow" ref="personnelRef" title="选择负责人" width="60%">
<personnelPopup @custom-event="changePersonner" :company_id="formData.company_id"></personnelPopup>
</el-dialog>
<el-dialog v-model="showDialogCommodity">
<dialogCommodity :ids="formData.extend.goods_id" @customEvent="customEventCommodity" @close="commodityClose">
</dialogCommodity>
</el-dialog>
</popup>
</div>
</template>
<script lang="ts" setup name="taskTemplateEdit">
<script lang="ts" setup name="taskTemplateEdit">
import type { FormInstance } from "element-plus";
import Popup from "@/components/popup/index.vue";
import {
@ -172,6 +138,9 @@ import type { PropType } from "vue";
import { dictDataLists } from "@/api/setting/dict";
import taskMap from "./map.vue";
import personnelPopup from "./dialog_index_personnel.vue";
import { apiSelectList, apiCreatetaskTypeInfo } from '@/api/create_task_template'
import dialogCommodity from "./dialog_commodity.vue";
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
@ -184,6 +153,12 @@ const popupRef = shallowRef<InstanceType<typeof Popup>>();
const mode = ref("add");
const datalist = ref([]);
const route = useRoute();
const taskType = ref("town_task_type");
const taskRoleRow = ref([
{ key: 1, value: "负责人" },
{ key: 2, value: "市场部长" },
{ key: 3, value: "服务部长" },
]);
//
const popupTitle = computed(() => {
@ -191,22 +166,29 @@ const popupTitle = computed(() => {
});
// ID, 使
const noThreeList = reactive([45, 48, 49]);
const noThreefilter = (id: number) => {
if (noThreeList.includes(id)) return false;
const noThreeList = reactive([
"town_task_type_2",
"town_task_type_5",
"town_task_type_6",
]);
const noThreefilter = (type: string) => {
if (noThreeList.includes(type)) return false;
else return true;
};
//
const formData = reactive({
id: "",
// task_role: 1,
task_scheduling: 0,
company_id: "",
title: "",
admin_id: "",
type: "", //
type_value: "",
status: "",
content: "",
cron_time: "",
stage_day_one: 0,
money: 0, //
stage_day_two: 0,
@ -218,29 +200,138 @@ const formData = reactive({
task_admin: "", //
task_admin_name: "", //
recharge: "",
task_role_id: "",
extend: {
// origin: {
// address: "",
// lnglat: [],
// }, //
transfer: {
address: "",
lnglat: [],
}, //
terminus: {
address: "",
lnglat: [],
}, //
task_role: "", //
target: "", //
goods_id: "", //id
store_name: "", //
},
});
if (route.query.id) {
formData.task_scheduling = route.query.id;
}
//
apiTaskTypeList({ type_value: "town_task_type" }).then((res) => {
datalist.value = res.lists;
// apiTaskTypeList({ type_value: taskType.value }).then((res) => {
// datalist.value = res.lists;
// });
//
const showCommodityTypeList = [
"town_task_type_marketing_director_9",
"town_task_type_marketing_director_8",
"town_task_type_marketing_director_5",
"town_task_type_marketing_director_4",
];
const showCommodity = computed(() => {
let flag = false;
if (showCommodityTypeList.includes(formData.type_value)) flag = true;
return flag;
});
//
const showTargetTypeList = [
"town_task_type_marketing_director_9",
"town_task_type_marketing_director_8",
"town_task_type_marketing_director_6",
"town_task_type_marketing_director_5",
"town_task_type_marketing_director_11",
"town_task_type_marketing_director_4",
"town_task_type_marketing_director_3",
"town_task_type_marketing_director_2",
'town_task_type_master_3',
"town_task_type_master_7",
];
const showTarget = computed(() => {
let flag = false;
if (showTargetTypeList.includes(formData.type_value)) flag = true;
return flag;
});
//
const noShowTowTypeList = [
"town_task_type_marketing_director_9",
"town_task_type_marketing_director_8",
"town_task_type_marketing_director_6",
"town_task_type_marketing_director_2",
"town_task_type_marketing_director_1",
];
const showTow = computed(() => {
let flag = true;
if (noShowTowTypeList.includes(formData.type_value)) flag = false;
return flag;
});
//
const noShowThreeTypeList = [
"town_task_type_marketing_director_9",
"town_task_type_marketing_director_8",
"town_task_type_marketing_director_7",
"town_task_type_marketing_director_6",
"town_task_type_marketing_director_3",
"town_task_type_marketing_director_2",
"town_task_type_marketing_director_1",
];
const showThree = computed(() => {
let flag = true;
if (noShowThreeTypeList.includes(formData.type_value)) flag = false;
return flag;
});
//
const showDialogCommodity = ref(false);
const openCommodity = () => {
showDialogCommodity.value = true;
};
const customEventCommodity = (e: any) => {
let id: string[] | number[] = [];
let name: string[] = [];
e.forEach((item: any) => {
id.push(item.product_id);
name.push(item.store_name);
});
formData.extend.goods_id = id.join(",");
formData.extend.store_name = name.join(";");
formRef.value?.clearValidate("extend.goods_id");
showDialogCommodity.value = false;
};
const commodityClose = () => {
showDialogCommodity.value = false;
};
//
const taskTempList = reactive([])
const taskTempId = ref('')
const getTaskTempFn = (role) => {
apiSelectList(
{
task_role_id: '1,2,3'
}
).then(res => {
res.forEach(item => {
taskTempList.push(item)
})
})
}
const changeTaskTypeFn = () => {
let i
taskTempList.forEach((item, index) => {
if (item.id == taskTempId.value) { i = index }
})
setFormData(taskTempList[i])
formData.type = Number(formData.type)
formData.money_three = taskTempList[i].money_longtime
formData.extend.task_role = formData.task_role_id
changeTaskRole(formData.task_role_id)
}
getTaskTempFn()
//
const formRules = reactive<any>({
title: [
@ -250,6 +341,13 @@ const formRules = reactive<any>({
trigger: ["blur"],
},
],
"extend.task_role": [
{
required: true,
message: "请选择任务角色",
trigger: ["blur"],
},
],
admin_id: [
{
required: true,
@ -260,7 +358,7 @@ const formRules = reactive<any>({
type: [
{
required: true,
message: "请输入任务类型",
message: "请选择任务类型",
trigger: ["blur"],
},
],
@ -271,10 +369,17 @@ const formRules = reactive<any>({
trigger: ["blur"],
},
],
cron_time: [
{
required: true,
message: "请选择状态",
trigger: ["blur"],
},
],
types: [
{
required: true,
message: "请输入阶段类型",
message: "请选择阶段类型",
trigger: ["blur"],
},
],
@ -296,24 +401,21 @@ const formRules = reactive<any>({
trigger: ["blur"],
},
],
"extend.origin.address": [
"extend.target": [
{
required: true,
message: "请选择中转点",
// message: "",
validator: (rule: any, value: any, callback: any) => {
if (value <= 0) callback(new Error("不能小于0"));
else callback();
},
trigger: ["blur"],
},
],
"extend.transfer.address": [
"extend.goods_id": [
{
required: true,
message: "请选择中转点",
trigger: ["blur"],
},
],
"extend.terminus.address": [
{
required: true,
message: "请选择终点",
message: "请选择商品",
trigger: ["blur"],
},
],
@ -327,9 +429,14 @@ const setFormData = async (data: Record<any, any>) => {
formData[key] = data[key];
}
}
if (formData.type == 32) {
mapShow.value = true;
if (typeof formData.extend.goods_id != "string") {
formData.extend.goods_id = "";
}
if (formData.extend?.task_role) {
formData.extend.task_role = +formData.extend.task_role;
changeTaskRole(formData.extend.task_role);
}
console.log(formData)
};
const getDetail = async (row: Record<string, any>) => {
@ -346,35 +453,36 @@ const mapRef = shallowRef<InstanceType<typeof taskMap>>();
//
const changeTaskType = async (e: any) => {
datalist.value.forEach((item: any) => {
if (item.id == e) formData.title = item.name;
if (item.id == e) {
formData.title = item.name;
formData.type_value = item.value;
}
});
if (e == 32) {
mapShow.value = true; //
// await nextTick();
// mapRef.value?.open();
}
};
// (,,)
const mapType = ref("");
const changeMap = async (e: number) => {
let map_title = "";
switch (e) {
case 0:
mapType.value = "origin";
map_title = "起点";
break;
case 1:
mapType.value = "transfer";
map_title = "中转点";
break;
case 2:
mapType.value = "terminus";
map_title = "终点";
break;
//
const changeTaskRole = async (e: any) => {
//
if (e == 1) {
taskType.value = "town_task_type_master";
}
await nextTick();
mapRef.value?.open(map_title);
//
if (e == 2) {
taskType.value = "town_task_type_marketing_director";
}
//
if (e == 3) {
taskType.value = "town_task_type";
}
apiTaskTypeList({ type_value: taskType.value }).then((res) => {
datalist.value = res.lists;
datalist.value.forEach((item: any) => {
if (item.id == formData.type) {
formData.type_value = item.value;
}
});
});
};
const setMap = (e: any) => {
@ -398,7 +506,6 @@ const clickTaskAdmin = async () => {
const handleSubmit = async () => {
await formRef.value?.validate();
const data = { ...formData };
if (data.type != 32) data.extend = {}; // ,
mode.value == "edit"
? await apiTaskTemplateEdit(data)
: await apiTaskTemplateAdd(data);
@ -410,6 +517,11 @@ const handleSubmit = async () => {
const open = (type = "add") => {
mode.value = type;
popupRef.value?.open();
// if (type == "edit") {
// apiTaskTypeList({ type_value: taskType.value }).then((res) => {
// datalist.value = res.lists;
// });
// }
};
//
@ -423,4 +535,11 @@ defineExpose({
getDetail,
});
</script>
<style>
.el-input__wrapper{
width: 100% !important;
}
</style>

View File

@ -0,0 +1,454 @@
<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="extend.task_role">
<el-select
v-model="formData.extend.task_role"
clearable
:disabled="mode != 'add'"
placeholder="请选择任务角色"
@change="changeTaskRole"
style="width: 100%"
>
<el-option
v-for="item in taskRoleRow"
:key="item.key"
:value="item.key"
:label="item.value"
/>
</el-select>
</el-form-item> -->
<el-form-item label="任务模板" >
<el-select v-model="taskTempId" clearable :disabled="mode != 'add'" placeholder="请输入任务类型"
@change="changeTaskTypeFn" style="width: 100%;">
<el-option v-for="item in taskTempList" :key="item.id" :value="item.id" :label="item.title" />
</el-select>
</el-form-item>
<el-form-item label="任务下发时间" prop="cron_time">
<el-date-picker format="YYYY/MM/DD" value-format="YYYY-MM-DD" :disabled="mode != 'add'" v-model="formData.cron_time" type="date"
placeholder="请选择时间" style="width: 50vw;"/>
</el-form-item>
<el-form-item label="任务类型" prop="type">
<el-select v-model="formData.type" clearable placeholder="请选择任务类型"
@change="changeTaskType" style="width: 100%">
<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="types">
<div style="width: 100%">
<el-select v-model="formData.types" clearable placeholder="请选择阶段类型"
style="width: 21vw;">
<el-option v-for="item in [
{ label: 1, name: '循环' },
{ label: 2, name: '长期' },
{ label: 3, name: '单次' },
]" :key="item.label" :value="item.label" :label="item.name" />
</el-select>
<div v-if="formData.types == 3" style="color: #e6a23c; font-size: 12px">
提示 : 单次任务不会每日结算,而是按阶段合计天数结算
</div>
</div>
</el-form-item>
<el-form-item v-if="showTarget" label="目标数" prop="extend.target">
<el-input v-model="formData.extend.target" clearable placeholder="请输入目标数" type="number">
</el-input>
</el-form-item>
<el-form-item label="一阶段天数">
<el-input v-model="formData.stage_day_one" clearable placeholder="请输入天数" type="number">
<template #append></template>
</el-input>
</el-form-item>
<el-form-item label="一阶段金额">
<el-input v-model="formData.money" clearable placeholder="请输入金额" type="number">
<template #append></template>
</el-input>
</el-form-item>
<el-form-item v-if="showTow && formData.type_value != 'town_task_type_5'" label="二阶段天数">
<el-input v-model="formData.stage_day_two" clearable placeholder="请输入天数" type="number">
<template #append></template>
</el-input>
</el-form-item>
<el-form-item v-if="showTow && formData.type_value != 'town_task_type_5'" label="二阶段金额">
<el-input v-model="formData.money_two" clearable placeholder="请输入金额" type="number">
<template #append></template>
</el-input>
</el-form-item>
<el-form-item v-if="showThree" label="三阶段天数">
<el-input v-model="formData.stage_day_three" clearable placeholder="请输入天数" type="number">
<template #append></template>
</el-input>
</el-form-item>
<el-form-item v-if="showThree" label="三阶段金额">
<el-input v-model="formData.new_money_three" clearable placeholder="请输入金额" type="number">
<template #append></template>
</el-input>
</el-form-item>
<el-form-item label="长期金额" v-if="+formData.types == 2">
<el-input v-model="formData.money_three" clearable placeholder="请输入金额" type="number">
<template #append></template>
</el-input>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-radio-group v-model="formData.status">
<el-radio :label="1">显示</el-radio>
<el-radio :label="0">隐藏</el-radio>
</el-radio-group>
</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>
<el-dialog v-model="personnelShow" ref="personnelRef" title="选择负责人" width="60%">
<personnelPopup @custom-event="changePersonner" :company_id="formData.company_id"></personnelPopup>
</el-dialog>
</popup>
</div>
</template>
<script lang="ts" setup name="taskTemplateEdit">
import type { FormInstance } from "element-plus";
import Popup from "@/components/popup/index.vue";
import {
apiTaskTemplateAdd,
apiTaskTemplateEdit,
apiTaskTemplateDetail,
apiTaskTypeList,
} from "@/api/task_template";
import { timeFormat } from "@/utils/util";
import type { PropType } from "vue";
import { dictDataLists } from "@/api/setting/dict";
import taskMap from "./map.vue";
import personnelPopup from "./dialog_index_personnel.vue";
import { apiSelectList, apiCreatetaskTypeInfo } from '@/api/create_task_template'
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 datalist = ref([]);
const route = useRoute();
const taskType = ref("village_task_type");
const taskRoleRow = ref([
{ key: 1, value: "负责人" },
{ key: 2, value: "市场部长" },
{ key: 3, value: "服务部长" },
]);
//
const popupTitle = computed(() => {
return mode.value == "edit" ? "编辑任务安排" : "新增任务安排";
});
//
const formData = reactive({
id: "",
// task_role: 1,
task_scheduling: 0,
company_id: "",
title: "",
admin_id: "",
type: "", //
type_value: "",
status: "",
content: "",
cron_time:"",
stage_day_one: 0,
money: 0, //
stage_day_two: 0,
money_two: 0, //
stage_day_three: 0,
new_money_three: 0, //
money_three: 0, //
types: "", //
task_admin: "", //
task_admin_name: "", //
recharge: "",
extend: {
task_role: "", //
target: "", //
},
});
if (route.query.id) {
formData.task_scheduling = route.query.id;
}
//
const showTargetTypeList = [
"village_task_type_1",
"village_task_type_4",
"village_task_type_5"
];
const showTarget = computed(() => {
let flag = false;
if (showTargetTypeList.includes(formData.type_value)) flag = true;
return flag;
});
//
const noShowTowTypeList = ["village_task_type_2"];
const showTow = computed(() => {
let flag = true;
if (noShowTowTypeList.includes(formData.type_value)) flag = false;
return flag;
});
//
const noShowThreeTypeList = [
"village_task_type_1",
"village_task_type_2",
"village_task_type_3",
"village_task_type_4",
"village_task_type_5",
"village_task_type_6",
];
const showThree = computed(() => {
let flag = true;
if (noShowThreeTypeList.includes(formData.type_value)) flag = false;
return flag;
});
//
const taskTempList = reactive([])
const taskTempId = ref('')
const getTaskTempFn = () => {
apiSelectList(
{
task_role_id: 4
}
).then(res => {
res.forEach(item => {
taskTempList.push(item)
})
})
}
const changeTaskTypeFn = () => {
let i
taskTempList.forEach((item, index) => {
if (item.id == taskTempId.value) {
i = index
}
})
setFormData(taskTempList[i])
formData.type = String(formData.type)
console.log(formData)
// console.log(taskTempId.value)
}
getTaskTempFn()
//
const formRules = reactive<any>({
title: [
{
required: true,
message: "请输入任务名称",
trigger: ["blur"],
},
],
"extend.task_role": [
{
required: true,
message: "请选择任务角色",
trigger: ["blur"],
},
],
admin_id: [
{
required: true,
message: "请输入创建人",
trigger: ["blur"],
},
],
type: [
{
required: true,
message: "请选择任务类型",
trigger: ["blur"],
},
],
cron_time: [
{
required: true,
message: "请选择任务类型",
trigger: ["blur"],
},
],
status: [
{
required: true,
message: "请选择状态",
trigger: ["blur"],
},
],
types: [
{
required: true,
message: "请选择阶段类型",
trigger: ["blur"],
},
],
task_admin: [
{
required: true,
message: "请选择负责人",
trigger: ["blur"],
},
],
recharge: [
{
required: true,
// message: "",
validator: (rule: any, value: any, callback: any) => {
if (value <= 0) callback(new Error("充值金额不能小于0"));
else callback();
},
trigger: ["blur"],
},
],
"extend.target": [
{
required: true,
// message: "",
validator: (rule: any, value: any, callback: any) => {
if (value <= 0) callback(new Error("不能小于0"));
else callback();
},
trigger: ["blur"],
},
],
});
//
const setFormData = async (data: Record<any, any>) => {
//
apiTaskTypeList({ type_value: taskType.value }).then((res) => {
datalist.value = res.lists;
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
formData[key] = data[key];
}
}
if (formData.type) {
datalist.value.forEach((item: any) => {
if (item.id == formData.type) {
formData.title = item.name;
formData.type_value = item.value;
}
});
}
});
};
const getDetail = async (row: Record<string, any>) => {
const data = await apiTaskTemplateDetail({
id: row.id,
});
setFormData(data);
};
//
const mapShow = ref(false);
const mapRef = shallowRef<InstanceType<typeof taskMap>>();
//
const changeTaskType = async (e: any) => {
datalist.value.forEach((item: any) => {
if (item.id == e) {
formData.title = item.name;
formData.type_value = item.value;
}
});
};
//
const changeTaskRole = async (e: any) => {
//
if (e == 1) {
taskType.value = "town_task_type_master";
}
//
if (e == 2) {
taskType.value = "town_task_type_marketing_director";
}
//
if (e == 3) {
taskType.value = "town_task_type";
}
apiTaskTypeList({ type_value: taskType.value }).then((res) => {
datalist.value = res.lists;
datalist.value.forEach((item: any) => {
if (item.id == formData.type) {
formData.type_value = item.value;
}
});
});
};
const setMap = (e: any) => {
formData.extend[mapType.value] = e[0];
};
//
const personnelShow = ref(false);
const personnelRef = shallowRef<InstanceType<typeof personnelPopup>>();
const changePersonner = (e: any) => {
formData.task_admin = e.id;
formData.task_admin_name = e.nickname;
personnelShow.value = false;
};
const clickTaskAdmin = async () => {
personnelShow.value = true;
};
//
const handleSubmit = async () => {
await formRef.value?.validate();
const data = { ...formData };
mode.value == "edit"
? await apiTaskTemplateEdit(data)
: await apiTaskTemplateAdd(data);
popupRef.value?.close();
emit("success");
};
//
const open = (type = "add") => {
mode.value = type;
popupRef.value?.open();
// if (type == "add") {
// apiTaskTypeList({ type_value: taskType.value }).then((res) => {
// datalist.value = res.lists;
// });
// }
};
//
const handleClose = () => {
emit("close");
};
defineExpose({
open,
setFormData,
getDetail,
});
</script>
<style>
.el-input__wrapper{
width: 100% !important;
}
</style>

View File

@ -3,14 +3,9 @@
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px] formtabel" :model="queryParams" inline>
<el-form-item label-width="100px" label="任务名称" prop="title">
<el-input
class="w-[280px]"
v-model="queryParams.title"
clearable
placeholder="请输入任务名称"
/>
<el-input class="w-[280px]" v-model="queryParams.title" clearable placeholder="请输入任务名称" />
</el-form-item>
<el-form-item label-width="100px" label="创建人" prop="admin_id">
<!-- <el-form-item label-width="100px" label="创建人" prop="admin_id">
<el-input
class="w-[280px]"
v-model="queryParams.admin_id"
@ -59,70 +54,44 @@
class="w-[280px]"
v-model="queryParams.content"
clearable
placeholder="请输入任务描述"
placeholder="请输入任务描454述"
/>
</el-form-item>
</el-form-item> -->
<el-form-item label-width="100px" label="">
<el-button class="el-btn" type="primary" @click="resetPage"
>查询</el-button
>
<el-button class="el-btn" 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="['task_template.task_template/add']"
type="primary"
@click="handleAdd"
>
<el-button v-perms="['task_template.task_template/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button
v-perms="['task_template.task_template/delete']"
:disabled="!selectData.length"
@click="handleDelete(selectData)"
>
<el-button v-perms="['task_template.task_template/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"
width="80"
prop="id"
show-overflow-tooltip
/>
<el-table-column
label="任务名称"
prop="title"
show-overflow-tooltip
/>
<el-table-column
label="创建人"
prop="admin_name"
show-overflow-tooltip
/>
<el-table-column label="金额" prop="money" show-overflow-tooltip />
<el-table-column
<el-table-column label="ID" width="80" prop="id" show-overflow-tooltip />
<el-table-column label="任务名称" prop="title" show-overflow-tooltip />
<el-table-column label="负责人" prop="directorInfo.nickname" show-overflow-tooltip />
<!-- <el-table-column label="金额" prop="money" show-overflow-tooltip /> -->
<!-- <el-table-column
label="任务类型"
prop="type_name"
show-overflow-tooltip
/>
/> -->
<el-table-column label="状态" show-overflow-tooltip>
<template #default="{ row }">
<span>{{ row.status == 1 ? "显示" : "隐藏" }}</span>
<span>{{ row.status == 2 ? "显示" : "隐藏" }}</span>
</template>
</el-table-column>
<el-table-column
label="任务描述"
prop="content"
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
@ -133,36 +102,27 @@
>
编辑
</el-button>
<el-button
<!-- <el-button
v-perms="['task_template.task_template/delete']"
type="danger"
link
@click="handleDelete(row.id)"
>
删除
</el-button>
</el-button> -->
</template>
</el-table-column>
</el-table>
</div>
<div class="flex mt-4 justify-end">
<div class="flex justify-end mt-4">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
<edit-popup
v-if="showEdit && taskTypeId != 15"
ref="editRef"
:dict-data="dictData"
@success="getLists"
@close="showEdit = false"
/>
<edit-admin-popup
v-else-if="showEdit"
ref="editRef"
:dict-data="dictData"
@success="getLists"
@close="showEdit = false"
/>
<edit-admin-popup v-if="showEdit && companyType == 16" ref="editRef" :dict-data="dictData" @success="getLists"
@close="showEdit = false" />
<edit-village-popup v-else-if="showEdit && companyType == 17" ref="editRef" :dict-data="dictData" @success="getLists"
@close="showEdit = false" />
<edit-popup v-else-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
</div>
</template>
@ -177,7 +137,11 @@ import { timeFormat } from "@/utils/util";
import feedback from "@/utils/feedback";
import EditPopup from "./edit.vue";
import EditAdminPopup from "./edit_admin.vue";
import EditVillagePopup from "./edit_village.vue";
import { dictDataLists } from "@/api/setting/dict";
import { taskList } from "@/api/newTask"
const editRef = shallowRef<InstanceType<typeof EditPopup>>();
const datalist = ref([]);
//
@ -196,10 +160,10 @@ const queryParams = reactive({
status: "",
content: "",
});
const taskTypeId = ref(10);
const companyType = ref(10);
if (route.query?.id) queryParams.id = route.query.id;
if (route.query?.company_id) queryParams.company_id = route.query.company_id;
if (route.query?.company_type == 41) taskTypeId.value = 15;
if (route.query?.company_type) companyType.value = route.query.company_type;
const statusdata = reactive([
{ id: 1, name: "显示" },
{ id: 2, name: "隐藏" },
@ -218,7 +182,7 @@ const { dictData } = useDictData("");
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiTaskTemplateLists,
fetchFun: taskList,
params: queryParams,
});
//
@ -234,6 +198,10 @@ const handleEdit = async (data: any) => {
showEdit.value = true;
await nextTick();
editRef.value?.open("edit");
data.task_admin_name=data.directorInfo.nickname
editRef.value?.setFormData(data);
};
@ -248,11 +216,13 @@ dictDataLists({ type_id: 10 }).then((res) => {
datalist.value = res.lists;
});
getLists();
</script>
<style lang="scss" scoped>
.formtabel {
.el-form-item {
width: 20%;
.el-btn {
margin-left: 60px;
}

View File

@ -0,0 +1,270 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px] formtabel" :model="queryParams" inline>
<el-form-item label-width="100px" label="任务名称" prop="title">
<el-input
class="w-[280px]"
v-model="queryParams.title"
clearable
placeholder="请输入任务名称"
/>
</el-form-item>
<el-form-item label-width="100px" label="创建人" prop="admin_id">
<el-input
class="w-[280px]"
v-model="queryParams.admin_id"
clearable
placeholder="请输入创建人"
/>
</el-form-item>
<el-form-item label-width="100px" label="金额" prop="money">
<el-input
class="w-[280px]"
v-model="queryParams.money"
clearable
placeholder="请输入金额"
/>
</el-form-item>
<el-form-item label-width="100px" label="任务类型" prop="type">
<el-select
v-model="queryParams.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-width="100px" label="状态" prop="status">
<el-select
v-model="queryParams.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-width="100px" label="任务描述" prop="content">
<el-input
class="w-[280px]"
v-model="queryParams.content"
clearable
placeholder="请输入任务描述"
/>
</el-form-item>
<el-form-item label-width="100px" label="">
<el-button class="el-btn" 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="['task_template.task_template/add']"
type="primary"
@click="handleAdd"
>
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button
v-perms="['task_template.task_template/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"
width="80"
prop="id"
show-overflow-tooltip
/>
<el-table-column
label="任务名称"
prop="title"
show-overflow-tooltip
/>
<el-table-column
label="创建人"
prop="admin_name"
show-overflow-tooltip
/>
<el-table-column label="金额" prop="money" show-overflow-tooltip />
<el-table-column
label="任务类型"
prop="type_name"
show-overflow-tooltip
/>
<el-table-column label="状态" show-overflow-tooltip>
<template #default="{ row }">
<span>{{ row.status == 1 ? "显示" : "隐藏" }}</span>
</template>
</el-table-column>
<el-table-column
label="任务描述"
prop="content"
show-overflow-tooltip
/>
<el-table-column label="操作" width="120" fixed="right">
<template #default="{ row }">
<el-button
v-perms="['task_template.task_template/edit']"
type="primary"
link
@click="handleEdit(row)"
>
编辑
</el-button>
<el-button
v-perms="['task_template.task_template/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>
<edit-admin-popup
v-if="showEdit && companyType == 16"
ref="editRef"
:dict-data="dictData"
@success="getLists"
@close="showEdit = false"
/>
<edit-village-popup
v-else-if="showEdit && companyType == 17"
ref="editRef"
:dict-data="dictData"
@success="getLists"
@close="showEdit = false"
/>
<edit-popup
v-else-if="showEdit"
ref="editRef"
:dict-data="dictData"
@success="getLists"
@close="showEdit = false"
/>
</div>
</template>
<script lang="ts" setup name="taskTemplateLists">
import { usePaging } from "@/hooks/usePaging";
import { useDictData } from "@/hooks/useDictOptions";
import {
apiTaskTemplateLists,
apiTaskTemplateDelete,
} from "@/api/task_template";
import { timeFormat } from "@/utils/util";
import feedback from "@/utils/feedback";
import EditPopup from "./edit.vue";
import EditAdminPopup from "./edit_admin.vue";
import EditVillagePopup from "./edit_village.vue";
import { dictDataLists } from "@/api/setting/dict";
const editRef = shallowRef<InstanceType<typeof EditPopup>>();
const datalist = ref([]);
//
const showEdit = ref(false);
const route = useRoute();
//
const queryParams = reactive({
id: "", //id
company_id: "",
title: "",
admin_id: "",
money: "",
type: "",
status: "",
content: "",
});
const companyType = ref(10);
if (route.query?.id) queryParams.id = route.query.id;
if (route.query?.company_id) queryParams.company_id = route.query.company_id;
if (route.query?.company_type) companyType.value = route.query.company_type;
const statusdata = reactive([
{ id: 1, name: "显示" },
{ id: 2, name: "隐藏" },
]);
//
const selectData = ref<any[]>([]);
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id);
};
//
const { dictData } = useDictData("");
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiTaskTemplateLists,
params: queryParams,
});
//
const handleAdd = async () => {
showEdit.value = true;
await nextTick();
editRef.value?.open("add");
editRef.value?.setFormData({ company_id: queryParams.company_id });
};
//
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 apiTaskTemplateDelete({ id });
getLists();
};
//
dictDataLists({ type_id: 10 }).then((res) => {
datalist.value = res.lists;
});
getLists();
</script>
<style lang="scss" scoped>
.formtabel {
.el-form-item {
width: 20%;
.el-btn {
margin-left: 60px;
}
}
}
</style>

View File

@ -49,7 +49,7 @@
/>
</el-table>
</div>
<div class="flex mt-4 justify-end">
<div class="flex justify-end mt-4">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>

View File

@ -0,0 +1,109 @@
<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="village_code">
<el-input class="flex-1" v-model="formData.village_code" type="textarea" rows="4" clearable placeholder="请输入" />
</el-form-item>
<el-form-item label="" prop="threshold_value">
<el-input v-model="formData.threshold_value" clearable placeholder="请输入" />
</el-form-item>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="userInformationThresholdEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiUserInformationThresholdAdd, apiUserInformationThresholdEdit, apiUserInformationThresholdDetail } from '@/api/user_information_threshold'
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: '',
village_code: '',
threshold_value: '',
})
//
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 apiUserInformationThresholdDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
await formRef.value?.validate()
const data = { ...formData, }
mode.value == 'edit'
? await apiUserInformationThresholdEdit(data)
: await apiUserInformationThresholdAdd(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>

View File

@ -0,0 +1,129 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form
class="mb-[-16px]"
:model="queryParams"
inline
>
<el-form-item label="" prop="threshold_value">
<el-input class="w-[280px]" v-model="queryParams.threshold_value" 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="['user_information_threshold/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button
v-perms="['user_information_threshold/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="village_code" show-overflow-tooltip />
<el-table-column label="" prop="threshold_value" show-overflow-tooltip />
<el-table-column label="操作" width="120" fixed="right">
<template #default="{ row }">
<el-button
v-perms="['user_information_threshold/edit']"
type="primary"
link
@click="handleEdit(row)"
>
编辑
</el-button>
<el-button
v-perms="['user_information_threshold/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>
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
</div>
</template>
<script lang="ts" setup name="userInformationThresholdLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiUserInformationThresholdLists, apiUserInformationThresholdDelete } from '@/api/user_information_threshold'
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({
village_code: '',
threshold_value: '',
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiUserInformationThresholdLists,
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 apiUserInformationThresholdDelete({ id })
getLists()
}
getLists()
</script>

View File

@ -17,7 +17,7 @@
<el-col :span="8">
<el-form-item label="时间" prop="start_date">
<el-input
v-model="datas.start_date"
v-model="datas.datas.start_date"
clearable
type="textarea"
:disabled="true"
@ -29,7 +29,7 @@
<el-col :span="8">
<el-form-item label="地点" prop="address">
<el-input
v-model="datas.address"
v-model="datas.datas.address"
clearable
type="textarea"
:disabled="true"
@ -41,7 +41,7 @@
<el-col :span="8">
<el-form-item label="人数" prop="people_count">
<el-input
v-model="datas.people_count"
v-model="datas.datas.people_count"
clearable
type="textarea"
:disabled="true"
@ -52,7 +52,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="请包办" prop="serve">
<el-radio-group v-model="datas.serve" size="medium">
<el-radio-group v-model="datas.datas.serve" size="medium">
<el-radio label="2">酒店</el-radio>
<el-radio label="1">一条龙</el-radio>
<el-radio label="0">只请厨师</el-radio>
@ -61,7 +61,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无歌舞表演" prop="perform">
<el-radio-group v-model="datas.perform" size="medium">
<el-radio-group v-model="datas.datas.perform" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -69,7 +69,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无交通工具" prop="vehicle">
<el-radio-group v-model="datas.vehicle" size="medium">
<el-radio-group v-model="datas.datas.vehicle" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -77,7 +77,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无住宿" prop="in_hotel">
<el-radio-group v-model="datas.in_hotel" size="medium">
<el-radio-group v-model="datas.datas.in_hotel" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -85,6 +85,14 @@
</el-col>
</el-row>
</el-form>
<div v-if="datas.ai_question">
<p class="tit"> 商机分析</p>
<div >
<div>AI提问{{datas.ai_question}}</div><br/>
<div>AI回答{{datas.ai_aianalyse}}</div><br/>
<br/>
</div>
</div>
</el-card>
</template>

View File

@ -17,7 +17,7 @@
<el-col :span="8">
<el-form-item label="时间" prop="start_date">
<el-input
v-model="datas.start_date"
v-model="datas.datas.start_date"
clearable
type="textarea"
:disabled="true"
@ -29,7 +29,7 @@
<el-col :span="8">
<el-form-item label="地点" prop="address">
<el-input
v-model="datas.address"
v-model="datas.datas.address"
clearable
type="textarea"
:disabled="true"
@ -41,7 +41,7 @@
<el-col :span="8">
<el-form-item label="人数" prop="people_count">
<el-input
v-model="datas.people_count"
v-model="datas.datas.people_count"
clearable
type="textarea"
:disabled="true"
@ -52,7 +52,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="请包办" prop="serve">
<el-radio-group v-model="datas.serve" size="medium">
<el-radio-group v-model="datas.datas.serve" size="medium">
<el-radio label="2">酒店</el-radio>
<el-radio label="1">一条龙</el-radio>
<el-radio label="0">只请厨师</el-radio>
@ -61,7 +61,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无歌舞表演" prop="perform">
<el-radio-group v-model="datas.perform" size="medium">
<el-radio-group v-model="datas.datas.perform" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -69,7 +69,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无交通工具" prop="vehicle">
<el-radio-group v-model="datas.vehicle" size="medium">
<el-radio-group v-model="datas.datas.vehicle" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -77,7 +77,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无住宿" prop="in_hotel">
<el-radio-group v-model="datas.in_hotel" size="medium">
<el-radio-group v-model="datas.datas.in_hotel" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -85,6 +85,14 @@
</el-col>
</el-row>
</el-form>
<div v-if="datas.ai_question">
<p class="tit"> 商机分析</p>
<div >
<div>AI提问{{datas.ai_question}}</div><br/>
<div>AI回答{{datas.ai_aianalyse}}</div><br/>
<br/>
</div>
</div>
</el-card>
</template>

View File

@ -17,7 +17,7 @@
<el-col :span="8">
<el-form-item label="地点" prop="address">
<el-input
v-model="datas.address"
v-model="datas.datas.address"
clearable
type="textarea"
:disabled="true"
@ -29,7 +29,7 @@
<el-col :span="8">
<el-form-item label="人数" prop="people_count">
<el-input
v-model="datas.people_count"
v-model="datas.datas.people_count"
clearable
type="textarea"
:disabled="true"
@ -40,7 +40,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="请包办" prop="serve">
<el-radio-group v-model="datas.serve" size="medium">
<el-radio-group v-model="datas.datas.serve" size="medium">
<el-radio label="2">酒店</el-radio>
<el-radio label="1">一条龙</el-radio>
<el-radio label="0">只请厨师</el-radio>
@ -49,7 +49,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无歌舞表演" prop="perform">
<el-radio-group v-model="datas.perform" size="medium">
<el-radio-group v-model="datas.datas.perform" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -57,7 +57,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无主持仪式" prop="host">
<el-radio-group v-model="datas.host" size="medium">
<el-radio-group v-model="datas.datas.host" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -65,7 +65,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无交通工具" prop="vehicle">
<el-radio-group v-model="datas.vehicle" size="medium">
<el-radio-group v-model="datas.datas.vehicle" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -73,7 +73,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无住宿" prop="in_hotel">
<el-radio-group v-model="datas.in_hotel" size="medium">
<el-radio-group v-model="datas.datas.in_hotel" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -81,7 +81,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无墓地" prop="graveyard">
<el-radio-group v-model="datas.graveyard" size="medium">
<el-radio-group v-model="datas.datas.graveyard" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -89,6 +89,15 @@
</el-col>
</el-row>
</el-form>
<div v-if="datas.ai_question">
<p class="tit"> 商机分析</p>
<div >
<div>AI提问{{datas.ai_question}}</div><br/>
<div>AI回答{{datas.ai_aianalyse}}</div><br/>
<br/>
</div>
</div>
</el-card>
</template>

View File

@ -17,7 +17,7 @@
<el-col :span="8">
<el-form-item label="时间" prop="start_date">
<el-input
v-model="datas.start_date"
v-model="datas.datas.start_date"
clearable
type="textarea"
:disabled="true"
@ -29,7 +29,7 @@
<el-col :span="8">
<el-form-item label="地点" prop="address">
<el-input
v-model="datas.address"
v-model="datas.datas.address"
clearable
type="textarea"
:disabled="true"
@ -41,7 +41,7 @@
<el-col :span="8">
<el-form-item label="人数" prop="people_count">
<el-input
v-model="datas.people_count"
v-model="datas.datas.people_count"
clearable
type="textarea"
:disabled="true"
@ -52,7 +52,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="请包办" prop="serve">
<el-radio-group v-model="datas.serve" size="medium">
<el-radio-group v-model="datas.datas.serve" size="medium">
<el-radio label="2">酒店</el-radio>
<el-radio label="1">一条龙</el-radio>
<el-radio label="0">只请厨师</el-radio>
@ -61,7 +61,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无歌舞表演" prop="perform">
<el-radio-group v-model="datas.perform" size="medium">
<el-radio-group v-model="datas.datas.perform" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -69,7 +69,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无主持仪式" prop="host">
<el-radio-group v-model="datas.host" size="medium">
<el-radio-group v-model="datas.datas.host" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -77,7 +77,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无交通工具" prop="vehicle">
<el-radio-group v-model="datas.vehicle" size="medium">
<el-radio-group v-model="datas.datas.vehicle" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -85,7 +85,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无住宿" prop="in_hotel">
<el-radio-group v-model="datas.in_hotel" size="medium">
<el-radio-group v-model="datas.datas.in_hotel" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -93,6 +93,14 @@
</el-col>
</el-row>
</el-form>
<div v-if="datas.ai_question">
<p class="tit"> 商机分析</p>
<div >
<div>AI提问{{datas.ai_question}}</div><br/>
<div>AI回答{{datas.ai_aianalyse}}</div><br/>
<br/>
</div>
</div>
</el-card>
</template>

View File

@ -29,7 +29,7 @@
<el-col :span="8">
<el-form-item label="时间" prop="start_date">
<el-input
v-model="datas.start_date"
v-model="datas.datas.start_date"
clearable
type="textarea"
:disabled="true"
@ -41,7 +41,7 @@
<el-col :span="8">
<el-form-item label="地点" prop="address">
<el-input
v-model="datas.address"
v-model="datas.datas.address"
clearable
type="textarea"
:disabled="true"
@ -53,7 +53,7 @@
<el-col :span="8">
<el-form-item label="人数" prop="people_count">
<el-input
v-model="datas.people_count"
v-model="datas.datas.people_count"
clearable
type="textarea"
:disabled="true"
@ -64,7 +64,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="请包办" prop="serve">
<el-radio-group v-model="datas.serve" size="medium">
<el-radio-group v-model="datas.datas.serve" size="medium">
<el-radio label="2">酒店</el-radio>
<el-radio label="1">一条龙</el-radio>
<el-radio label="0">只请厨师</el-radio>
@ -73,7 +73,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无歌舞表演" prop="perform">
<el-radio-group v-model="datas.perform" size="medium">
<el-radio-group v-model="datas.datas.perform" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -81,7 +81,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无交通工具" prop="vehicle">
<el-radio-group v-model="datas.vehicle" size="medium">
<el-radio-group v-model="datas.datas.vehicle" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -89,7 +89,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无住宿" prop="in_hotel">
<el-radio-group v-model="datas.in_hotel" size="medium">
<el-radio-group v-model="datas.datas.in_hotel" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -97,6 +97,14 @@
</el-col>
</el-row>
</el-form>
<div v-if="datas.ai_question">
<p class="tit"> 商机分析</p>
<div >
<div>AI提问{{datas.ai_question}}</div><br/>
<div>AI回答{{datas.ai_aianalyse}}</div><br/>
<br/>
</div>
</div>
</el-card>
</template>

View File

@ -16,7 +16,7 @@
<el-row>
<el-col :span="8">
<el-form-item label="有无养殖培训" prop="breeding_training">
<el-radio-group v-model="datas.breeding_training" size="medium">
<el-radio-group v-model="datas.datas.breeding_training" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -24,7 +24,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无注册成立养殖公司" prop="breeding_company">
<el-radio-group v-model="datas.breeding_company" size="medium">
<el-radio-group v-model="datas.datas.breeding_company" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -46,7 +46,7 @@
<el-col :span="8">
<el-form-item label="养殖类型" prop="breeding_type">
<el-input
v-model="datas.breeding_type"
v-model="datas.datas.breeding_type"
clearable
:disabled="true"
:style="{ width: '100%' }"
@ -57,7 +57,7 @@
<el-col :span="8">
<el-form-item label="开始时间" prop="breeding_time">
<el-input
v-model="datas.breeding_time"
v-model="datas.datas.breeding_time"
clearable
:disabled="true"
:style="{ width: '100%' }"
@ -68,7 +68,7 @@
<el-col :span="8">
<el-form-item label="上市时间" prop="mature_time">
<el-input
v-model="datas.mature_time"
v-model="datas.datas.mature_time"
clearable
:disabled="true"
:style="{ width: '100%' }"
@ -79,7 +79,7 @@
<el-col :span="8">
<el-form-item label="产量(斤)" prop="yield">
<el-input
v-model="datas.yield"
v-model="datas.datas.yield"
clearable
:disabled="true"
:style="{ width: '100%' }"
@ -90,7 +90,7 @@
<el-col :span="8">
<el-form-item label="预计收益(元)" prop="estimated_income">
<el-input
v-model="datas.estimated_income"
v-model="datas.datas.estimated_income"
clearable
:disabled="true"
:style="{ width: '100%' }"
@ -105,7 +105,7 @@
prop="farm_tools"
>
<el-input
v-model="datas.farm_tools"
v-model="datas.datas.farm_tools"
clearable
autosize
type="textarea"
@ -126,7 +126,7 @@
<el-col :span="8">
<el-form-item label="现代化程度(%)" prop="modernization">
<el-input
v-model="datas.modernization"
v-model="datas.datas.modernization"
clearable
:disabled="true"
:style="{ width: '100%' }"
@ -137,7 +137,7 @@
<el-col :span="8">
<el-form-item label="预售卖价格(元/500g)" prop="pre_price">
<el-input
v-model="datas.pre_price"
v-model="datas.datas.pre_price"
clearable
:disabled="true"
:style="{ width: '100%' }"
@ -147,7 +147,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="销售方式" prop="method_sales">
<el-radio-group v-model="datas.method_sales" size="medium">
<el-radio-group v-model="datas.datas.method_sales" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -155,7 +155,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无加工仓储" prop="processing_storage">
<el-radio-group v-model="datas.processing_storage" size="medium">
<el-radio-group v-model="datas.datas.processing_storage" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -163,7 +163,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无宣传推广" prop="promote">
<el-radio-group v-model="datas.promote" size="medium">
<el-radio-group v-model="datas.datas.promote" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -171,7 +171,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无运输" prop="transportation">
<el-radio-group v-model="datas.transportation" size="medium">
<el-radio-group v-model="datas.datas.transportation" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -179,7 +179,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="是否有扩大经营需求" prop="expand_business_needs">
<el-radio-group v-model="datas.expand_business_needs" size="medium">
<el-radio-group v-model="datas.datas.expand_business_needs" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -188,7 +188,7 @@
<el-col :span="8">
<el-form-item label="需求描述" prop="demand">
<el-input
v-model="datas.demand"
v-model="datas.datas.demand"
clearable
autosize
type="textarea"
@ -201,7 +201,7 @@
<el-col :span="8">
<el-form-item label="政策补助" prop="policy_subsidies">
<el-input
v-model="datas.policy_subsidies"
v-model="datas.datas.policy_subsidies"
clearable
autosize
type="textarea"
@ -213,6 +213,14 @@
</el-col>
</el-row>
</el-form>
<div v-if="datas.ai_question">
<p class="tit"> 商机分析</p>
<div >
<div>AI提问{{datas.ai_question}}</div><br/>
<div>AI回答{{datas.ai_aianalyse}}</div><br/>
<br/>
</div>
</div>
</el-card>
</template>

View File

@ -16,16 +16,16 @@
<el-row>
<el-col :span="8">
<el-form-item label="是否在经营" prop="is_manage">
<el-radio-group v-model="datas.is_manage" size="medium">
<el-radio-group v-model="datas.datas.is_manage" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<template v-if="datas.is_manage == 1">
<template v-if="datas.datas.is_manage == 1">
<el-col :span="8">
<el-form-item label="有无建设用地" prop="construction_land">
<el-radio-group v-model="datas.construction_land" size="medium">
<el-radio-group v-model="datas.datas.construction_land" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -34,7 +34,7 @@
<el-col :span="8">
<el-form-item label="面积(m²)" prop="land_area">
<el-input
v-model="datas.land_area"
v-model="datas.datas.land_area"
clearable
:disabled="true"
></el-input>
@ -43,7 +43,7 @@
<el-col :span="8">
<el-form-item label="经营地点" prop="manage_place">
<el-input
v-model="datas.manage_place"
v-model="datas.datas.manage_place"
clearable
:disabled="true"
></el-input>
@ -52,7 +52,7 @@
<el-col :span="8">
<el-form-item label="材料来源" prop="source_materials">
<el-input
v-model="datas.source_materials"
v-model="datas.datas.source_materials"
clearable
:disabled="true"
></el-input>
@ -60,7 +60,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无销售渠道" prop="marketing_channel">
<el-radio-group v-model="datas.marketing_channel" size="medium">
<el-radio-group v-model="datas.datas.marketing_channel" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -68,7 +68,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无技术指导" prop="technical_guidance">
<el-radio-group v-model="datas.technical_guidance" size="medium">
<el-radio-group v-model="datas.datas.technical_guidance" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -76,7 +76,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无品牌" prop="brand">
<el-radio-group v-model="datas.brand" size="medium">
<el-radio-group v-model="datas.datas.brand" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -84,7 +84,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无宣传推广" prop="advertising">
<el-radio-group v-model="datas.advertising" size="medium">
<el-radio-group v-model="datas.datas.advertising" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -92,7 +92,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无运输" prop="transport">
<el-radio-group v-model="datas.transport" size="medium">
<el-radio-group v-model="datas.datas.transport" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -101,7 +101,7 @@
<el-col :span="8">
<el-form-item label="经营诉求" prop="business_appeal">
<el-input
v-model="datas.business_appeal"
v-model="datas.datas.business_appeal"
clearable
autosize
type="textarea"
@ -115,7 +115,7 @@
<template v-else>
<el-col :span="8">
<el-form-item label="有无建设用地" prop="construction_land">
<el-radio-group v-model="datas.construction_land" size="medium">
<el-radio-group v-model="datas.datas.construction_land" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -124,7 +124,7 @@
<el-col :span="8">
<el-form-item label="经营类型" prop="manage_type">
<el-select
v-model="datas.manage_type"
v-model="datas.datas.manage_type"
clearable
:style="{ width: '100%' }"
>
@ -140,7 +140,7 @@
<el-col :span="8">
<el-form-item label="经营地点" prop="manage_place">
<el-input
v-model="datas.manage_place"
v-model="datas.datas.manage_place"
clearable
:disabled="true"
></el-input>
@ -149,7 +149,7 @@
<el-col :span="8">
<el-form-item label="人数" prop="people_count">
<el-input
v-model="datas.people_count"
v-model="datas.datas.people_count"
clearable
:disabled="true"
></el-input>
@ -157,7 +157,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无食堂" prop="canteen">
<el-radio-group v-model="datas.canteen" size="medium">
<el-radio-group v-model="datas.datas.canteen" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -166,7 +166,7 @@
<el-col :span="8">
<el-form-item label="材料来源" prop="source_materials">
<el-input
v-model="datas.source_materials"
v-model="datas.datas.source_materials"
clearable
:disabled="true"
></el-input>
@ -175,7 +175,7 @@
<el-col :span="8">
<el-form-item label="自动化办公程度" prop="automation">
<el-input
v-model="datas.automation"
v-model="datas.datas.automation"
clearable
:disabled="true"
></el-input>
@ -183,7 +183,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无用工需求" prop="employment">
<el-radio-group v-model="datas.employment" size="medium">
<el-radio-group v-model="datas.datas.employment" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -191,7 +191,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无品牌" prop="brand">
<el-radio-group v-model="datas.brand" size="medium">
<el-radio-group v-model="datas.datas.brand" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -199,7 +199,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无宣传推广" prop="advertising">
<el-radio-group v-model="datas.advertising" size="medium">
<el-radio-group v-model="datas.datas.advertising" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -208,7 +208,7 @@
<el-col :span="8">
<el-form-item label="库存情况" prop="repertory">
<el-input
v-model="datas.repertory"
v-model="datas.datas.repertory"
clearable
:disabled="true"
></el-input>
@ -216,7 +216,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无运输" prop="transport">
<el-radio-group v-model="datas.transport" size="medium">
<el-radio-group v-model="datas.datas.transport" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -225,7 +225,7 @@
<el-col :span="8">
<el-form-item label="经营诉求" prop="business_appeal">
<el-input
v-model="datas.business_appeal"
v-model="datas.datas.business_appeal"
clearable
autosize
type="textarea"
@ -238,6 +238,14 @@
</template>
</el-row>
</el-form>
<div v-if="datas.ai_question">
<p class="tit"> 商机分析</p>
<div >
<div>AI提问{{datas.ai_question}}</div><br/>
<div>AI回答{{datas.ai_aianalyse}}</div><br/>
<br/>
</div>
</div>
</el-card>
</template>

View File

@ -9,7 +9,7 @@
label-width="180px"
>
<div class="tit">
装房
装房1
<span class="time">更新于:{{ update_time }}</span>
</div>
@ -17,7 +17,7 @@
<el-col :span="8">
<el-form-item label="房屋面积(m²)" prop="house_area">
<el-input
v-model="datas.house_area"
v-model="datas.datas.house_area"
clearable
:disabled="true"
:style="{ width: '100%' }"
@ -28,7 +28,7 @@
<el-col :span="8">
<el-form-item label="装修风格" prop="decoration_style">
<el-input
v-model="datas.decoration_style"
v-model="datas.datas.decoration_style"
clearable
:disabled="true"
:style="{ width: '100%' }"
@ -39,7 +39,7 @@
<el-col :span="8">
<el-form-item label="装修地点" prop="decoration_site">
<el-input
v-model="datas.decoration_site"
v-model="datas.datas.decoration_site"
clearable
:disabled="true"
:style="{ width: '100%' }"
@ -50,7 +50,7 @@
<el-col :span="8">
<el-form-item label="装修预算" prop="budget">
<el-input
v-model="datas.budget"
v-model="datas.datas.budget"
clearable
:disabled="true"
:style="{ width: '100%' }"
@ -60,7 +60,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="装修类型" prop="decoration_type">
<el-radio-group v-model="datas.decoration_type" size="medium">
<el-radio-group v-model="datas.datas.decoration_type" size="medium">
<el-radio label="1">私人</el-radio>
<el-radio label="0">公共建设</el-radio>
</el-radio-group>
@ -68,6 +68,14 @@
</el-col>
</el-row>
</el-form>
<div v-if="datas.ai_question">
<p class="tit"> 商机分析</p>
<div >
<div>AI提问{{datas.ai_question}}</div><br/>
<div>AI回答{{datas.ai_aianalyse}}</div><br/>
<br/>
</div>
</div>
</el-card>
</template>
@ -82,6 +90,8 @@ const props = defineProps({
decoration_site: "",
budget: "",
decoration_type: "",
};
},
},

View File

@ -17,7 +17,7 @@
<el-col :span="8">
<el-form-item label="维护内容" prop="maintenance_contents">
<el-input
v-model="datas.maintenance_contents"
v-model="datas.datas.maintenance_contents"
clearable
type="textarea"
:disabled="true"
@ -28,7 +28,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="维护类型" prop="maintenance_type">
<el-radio-group v-model="datas.maintenance_type" size="medium">
<el-radio-group v-model="datas.datas.maintenance_type" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -36,6 +36,14 @@
</el-col>
</el-row>
</el-form>
<div v-if="datas.ai_question">
<p class="tit"> 商机分析</p>
<div >
<div>AI提问{{datas.ai_question}}</div><br/>
<div>AI回答{{datas.ai_aianalyse}}</div><br/>
<br/>
</div>
</div>
</el-card>
</template>

View File

@ -16,7 +16,7 @@
<el-row>
<el-col :span="8">
<el-form-item label="修房类型" prop="construction_type">
<el-radio-group v-model="datas.construction_type" size="medium">
<el-radio-group v-model="datas.datas.construction_type" size="medium">
<el-radio label="1">自建</el-radio>
<el-radio label="0">外包</el-radio>
</el-radio-group>
@ -25,7 +25,7 @@
<el-col :span="8">
<el-form-item label="建设面积(m²)" prop="construction_area">
<el-input
v-model="datas.construction_area"
v-model="datas.datas.construction_area"
clearable
:disabled="true"
:style="{ width: '100%' }"
@ -36,7 +36,7 @@
<el-col :span="8">
<el-form-item label="房屋风格" prop="house_style">
<el-input
v-model="datas.house_style"
v-model="datas.datas.house_style"
clearable
:disabled="true"
:style="{ width: '100%' }"
@ -47,7 +47,7 @@
<el-col :span="8">
<el-form-item label="修建地址" prop="construction_site">
<el-input
v-model="datas.construction_site"
v-model="datas.datas.construction_site"
clearable
:disabled="true"
:style="{ width: '100%' }"
@ -58,7 +58,7 @@
<el-col :span="8">
<el-form-item label="预算" prop="budget">
<el-input
v-model="datas.budget"
v-model="datas.datas.budget"
clearable
:disabled="true"
:style="{ width: '100%' }"
@ -68,7 +68,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无绿化" prop="afforest">
<el-radio-group v-model="datas.afforest" size="medium">
<el-radio-group v-model="datas.datas.afforest" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -76,7 +76,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无装修" prop="fitment">
<el-radio-group v-model="datas.fitment" size="medium">
<el-radio-group v-model="datas.datas.fitment" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -84,7 +84,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="房屋类型" prop="house_type">
<el-radio-group v-model="datas.house_type" size="medium">
<el-radio-group v-model="datas.datas.house_type" size="medium">
<el-radio label="1">私人</el-radio>
<el-radio label="0">公共建设</el-radio>
</el-radio-group>
@ -94,14 +94,22 @@
<el-form-item label="修建地照片" prop="construction_site_img">
<el-image
style="width: 500px; height: 320px"
:src="datas.construction_site_img"
:preview-src-list="[datas.construction_site_img]"
:src="datas.datas.construction_site_img"
:preview-src-list="[datas.datas.construction_site_img]"
fit="cover"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div v-if="datas.ai_question">
<p class="tit"> 商机分析</p>
<div >
<div>AI提问{{datas.ai_question}}</div><br/>
<div>AI回答{{datas.ai_aianalyse}}</div><br/>
<br/>
</div>
</div>
</el-card>
</template>

View File

@ -17,7 +17,7 @@
<el-col :span="8">
<el-form-item label="地点" prop="place">
<el-input
v-model="datas.place"
v-model="datas.datas.place"
clearable
:disabled="true"
:style="{ width: '100%' }"
@ -28,7 +28,7 @@
<el-col :span="8">
<el-form-item label="房型" prop="house_type">
<el-input
v-model="datas.house_type"
v-model="datas.datas.house_type"
clearable
:disabled="true"
:style="{ width: '100%' }"
@ -39,7 +39,7 @@
<el-col :span="8">
<el-form-item label="几房" prop="rooms">
<el-input
v-model="datas.rooms"
v-model="datas.datas.rooms"
clearable
:disabled="true"
:style="{ width: '100%' }"
@ -50,7 +50,7 @@
<el-col :span="8">
<el-form-item label="面积(m²)" prop="house_area">
<el-input
v-model="datas.house_area"
v-model="datas.datas.house_area"
clearable
:disabled="true"
:style="{ width: '100%' }"
@ -61,7 +61,7 @@
<el-col :span="8">
<el-form-item label="朝向" prop="orientation">
<el-input
v-model="datas.orientation"
v-model="datas.datas.orientation"
clearable
:disabled="true"
:style="{ width: '100%' }"
@ -72,7 +72,7 @@
<el-col :span="8">
<el-form-item label="楼层" prop="floor">
<el-input
v-model="datas.floor"
v-model="datas.datas.floor"
clearable
:disabled="true"
:style="{ width: '100%' }"
@ -82,7 +82,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="装修类型" prop="fitment">
<el-radio-group v-model="datas.fitment" size="medium">
<el-radio-group v-model="datas.datas.fitment" size="medium">
<el-radio label="1">精装</el-radio>
<el-radio label="0">清水</el-radio>
</el-radio-group>
@ -91,7 +91,7 @@
<el-col :span="8">
<el-form-item label="预算" prop="budget">
<el-input
v-model="datas.budget"
v-model="datas.datas.budget"
clearable
:disabled="true"
:style="{ width: '100%' }"
@ -101,7 +101,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="付款类型" prop="payment_type">
<el-radio-group v-model="datas.payment_type" size="medium">
<el-radio-group v-model="datas.datas.payment_type" size="medium">
<el-radio label="1">按揭</el-radio>
<el-radio label="0">全款</el-radio>
</el-radio-group>
@ -109,6 +109,14 @@
</el-col>
</el-row>
</el-form>
<div v-if="datas.ai_question">
<p class="tit"> 商机分析</p>
<div >
<div>AI提问{{datas.ai_question}}</div><br/>
<div>AI回答{{datas.ai_aianalyse}}</div><br/>
<br/>
</div>
</div>
</el-card>
</template>

View File

@ -17,7 +17,7 @@
<el-col :span="8">
<el-form-item label="土地总面积(亩)" prop="cultivated_area">
<el-input
v-model="datas.cultivated_area"
v-model="datas.datas.cultivated_area"
clearable
:disabled="true"
:style="{ width: '100%' }"
@ -29,7 +29,7 @@
<el-form-item label="土地规划" prop="cultivated_area">
<el-select
:disabled="isCheck"
v-model="datas.planning"
v-model="datas.datas.planning"
clearable
:style="{ width: '100%' }"
>
@ -44,7 +44,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无种植培训" prop="breeding_training">
<el-radio-group v-model="datas.breeding_training" size="medium">
<el-radio-group v-model="datas.datas.breeding_training" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -52,7 +52,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无注册成立种植公司" prop="planting_company">
<el-radio-group v-model="datas.planting_company" size="medium">
<el-radio-group v-model="datas.datas.planting_company" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -61,7 +61,7 @@
<el-col :span="8">
<el-form-item label="备注" prop="notes">
<el-input
v-model="datas.notes"
v-model="datas.datas.notes"
clearable
autosize
type="textarea"
@ -74,7 +74,7 @@
<el-col :span="8">
<el-form-item label="种植类型" prop="breeding_type">
<el-input
v-model="datas.breeding_type"
v-model="datas.datas.breeding_type"
clearable
:disabled="true"
:style="{ width: '100%' }"
@ -85,7 +85,7 @@
<el-col :span="8">
<el-form-item label="种植面积(亩)" prop="area">
<el-input
v-model="datas.area"
v-model="datas.datas.area"
clearable
:disabled="true"
:style="{ width: '100%' }"
@ -96,7 +96,7 @@
<el-col :span="8">
<el-form-item label="开始时间" prop="breeding_time">
<el-input
v-model="datas.breeding_time"
v-model="datas.datas.breeding_time"
clearable
:disabled="true"
:style="{ width: '100%' }"
@ -107,7 +107,7 @@
<el-col :span="8">
<el-form-item label="上市时间" prop="mature_time">
<el-input
v-model="datas.mature_time"
v-model="datas.datas.mature_time"
clearable
:disabled="true"
:style="{ width: '100%' }"
@ -118,7 +118,7 @@
<el-col :span="8">
<el-form-item label="产量(斤)" prop="yield">
<el-input
v-model="datas.yield"
v-model="datas.datas.yield"
clearable
:disabled="true"
:style="{ width: '100%' }"
@ -129,7 +129,7 @@
<el-col :span="8">
<el-form-item label="预计收益(元)" prop="estimated_income">
<el-input
v-model="datas.estimated_income"
v-model="datas.datas.estimated_income"
clearable
:disabled="true"
:style="{ width: '100%' }"
@ -144,7 +144,7 @@
prop="farm_tools"
>
<el-input
v-model="datas.farm_tools"
v-model="datas.datas.farm_tools"
clearable
autosize
type="textarea"
@ -156,7 +156,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="是否生态种植" prop="ecological_farming">
<el-radio-group v-model="datas.ecological_farming" size="medium">
<el-radio-group v-model="datas.datas.ecological_farming" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -165,7 +165,7 @@
<el-col :span="8">
<el-form-item label="现代化程度(%)" prop="modernization">
<el-input
v-model="datas.modernization"
v-model="datas.datas.modernization"
clearable
:disabled="true"
:style="{ width: '100%' }"
@ -176,7 +176,7 @@
<el-col :span="8">
<el-form-item label="预售卖价格(元/500g)" prop="pre_price">
<el-input
v-model="datas.pre_price"
v-model="datas.datas.pre_price"
clearable
:disabled="true"
:style="{ width: '100%' }"
@ -186,7 +186,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="销售方式" prop="method_sales">
<el-radio-group v-model="datas.method_sales" size="medium">
<el-radio-group v-model="datas.datas.method_sales" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -194,7 +194,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无加工仓储" prop="processing_storage">
<el-radio-group v-model="datas.processing_storage" size="medium">
<el-radio-group v-model="datas.datas.processing_storage" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -202,7 +202,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无宣传推广" prop="promote">
<el-radio-group v-model="datas.promote" size="medium">
<el-radio-group v-model="datas.datas.promote" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -210,7 +210,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无运输" prop="transportation">
<el-radio-group v-model="datas.transportation" size="medium">
<el-radio-group v-model="datas.datas.transportation" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -218,7 +218,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="是否有扩大经营需求" prop="expand_business_needs">
<el-radio-group v-model="datas.expand_business_needs" size="medium">
<el-radio-group v-model="datas.datas.expand_business_needs" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -227,7 +227,7 @@
<el-col :span="8">
<el-form-item label="需求描述" prop="demand">
<el-input
v-model="datas.demand"
v-model="datas.datas.demand"
clearable
autosize
type="textarea"
@ -240,7 +240,7 @@
<el-col :span="8">
<el-form-item label="政策补助" prop="policy_subsidies">
<el-input
v-model="datas.policy_subsidies"
v-model="datas.datas.policy_subsidies"
clearable
autosize
type="textarea"
@ -252,6 +252,14 @@
</el-col>
</el-row>
</el-form>
<div v-if="datas.ai_question">
<p class="tit"> 商机分析</p>
<div >
<div>AI提问{{datas.ai_question}}</div><br/>
<div>AI回答{{datas.ai_aianalyse}}</div><br/>
<br/>
</div>
</div>
</el-card>
</template>

View File

@ -16,7 +16,7 @@
<el-row>
<el-col :span="8">
<el-form-item label="有无门面" prop="shop_front">
<el-radio-group v-model="datas.shop_front" size="medium">
<el-radio-group v-model="datas.datas.shop_front" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -25,7 +25,7 @@
<el-col :span="8">
<el-form-item label="门面面积(m²)" prop="area">
<el-input
v-model="datas.area"
v-model="datas.datas.area"
clearable
:disabled="true"
:style="{ width: '100%' }"
@ -36,7 +36,7 @@
<el-col :span="8">
<el-form-item label="经营地点" prop="place">
<el-input
v-model="datas.place"
v-model="datas.datas.place"
clearable
:disabled="true"
:style="{ width: '100%' }"
@ -48,7 +48,7 @@
<el-form-item label="经营类型" prop="type">
<el-select
:disabled="isCheck"
v-model="datas.type"
v-model="datas.datas.type"
clearable
:style="{ width: '100%' }"
>
@ -64,7 +64,7 @@
<el-col :span="8">
<el-form-item label="门面环境" prop="environment">
<el-input
v-model="datas.environment"
v-model="datas.datas.environment"
clearable
:disabled="true"
:style="{ width: '100%' }"
@ -75,7 +75,7 @@
<el-col :span="8">
<el-form-item label="服务对象" prop="service">
<el-input
v-model="datas.service"
v-model="datas.datas.service"
clearable
:disabled="true"
:style="{ width: '100%' }"
@ -85,7 +85,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无营业资质" prop="qualification">
<el-radio-group v-model="datas.qualification" size="medium">
<el-radio-group v-model="datas.datas.qualification" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -93,7 +93,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无进货渠道" prop="stock">
<el-radio-group v-model="datas.stock" size="medium">
<el-radio-group v-model="datas.datas.stock" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -102,7 +102,7 @@
<el-col :span="8">
<el-form-item label="店铺规模" prop="scale">
<el-input
v-model="datas.scale"
v-model="datas.datas.scale"
clearable
:disabled="true"
:style="{ width: '100%' }"
@ -113,7 +113,7 @@
<el-col :span="8">
<el-form-item label="商品来源" prop="source">
<el-input
v-model="datas.source"
v-model="datas.datas.source"
clearable
:disabled="true"
:style="{ width: '100%' }"
@ -123,7 +123,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无线上展示" prop="brand">
<el-radio-group v-model="datas.brand" size="medium">
<el-radio-group v-model="datas.datas.brand" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -131,7 +131,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无品牌" prop="field134">
<el-radio-group v-model="datas.brand" size="medium">
<el-radio-group v-model="datas.datas.brand" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -139,7 +139,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="库存情况" prop="repertory">
<el-radio-group v-model="datas.repertory" size="medium">
<el-radio-group v-model="datas.datas.repertory" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -148,7 +148,7 @@
<el-col :span="8">
<el-form-item label="经营诉求" prop="appeal">
<el-input
v-model="datas.appeal"
v-model="datas.datas.appeal"
clearable
autosize
type="textarea"
@ -160,6 +160,14 @@
</el-col>
</el-row>
</el-form>
<div v-if="datas.ai_question">
<p class="tit"> 商机分析</p>
<div >
<div>AI提问{{datas.ai_question}}</div><br/>
<div>AI回答{{datas.ai_aianalyse}}</div><br/>
<br/>
</div>
</div>
</el-card>
</template>

View File

@ -16,16 +16,16 @@
<el-row>
<el-col :span="8">
<el-form-item label="是否在经营" prop="is_manage">
<el-radio-group v-model="datas.is_manage" size="medium">
<el-radio-group v-model="datas.datas.is_manage" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<template v-if="datas.is_manage == 1">
<template v-if="datas.datas.is_manage == 1">
<el-col :span="8">
<el-form-item label="有无建设用地" prop="construction_land">
<el-radio-group v-model="datas.construction_land" size="medium">
<el-radio-group v-model="datas.datas.construction_land" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -34,7 +34,7 @@
<el-col :span="8">
<el-form-item label="面积(m²)" prop="land_area">
<el-input
v-model="datas.land_area"
v-model="datas.datas.land_area"
clearable
:disabled="true"
></el-input>
@ -43,7 +43,7 @@
<el-col :span="8">
<el-form-item label="经营地点" prop="manage_place">
<el-input
v-model="datas.manage_place"
v-model="datas.datas.manage_place"
clearable
:disabled="true"
></el-input>
@ -52,7 +52,7 @@
<el-col :span="8">
<el-form-item label="材料来源" prop="source_materials">
<el-input
v-model="datas.source_materials"
v-model="datas.datas.source_materials"
clearable
:disabled="true"
></el-input>
@ -60,7 +60,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无销售渠道" prop="marketing_channel">
<el-radio-group v-model="datas.marketing_channel" size="medium">
<el-radio-group v-model="datas.datas.marketing_channel" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -68,7 +68,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无技术指导" prop="technical_guidance">
<el-radio-group v-model="datas.technical_guidance" size="medium">
<el-radio-group v-model="datas.datas.technical_guidance" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -76,7 +76,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无品牌" prop="brand">
<el-radio-group v-model="datas.brand" size="medium">
<el-radio-group v-model="datas.datas.brand" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -84,7 +84,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无宣传推广" prop="advertising">
<el-radio-group v-model="datas.advertising" size="medium">
<el-radio-group v-model="datas.datas.advertising" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -92,7 +92,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无运输" prop="transport">
<el-radio-group v-model="datas.transport" size="medium">
<el-radio-group v-model="datas.datas.transport" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -101,7 +101,7 @@
<el-col :span="8">
<el-form-item label="经营诉求" prop="business_appeal">
<el-input
v-model="datas.business_appeal"
v-model="datas.datas.business_appeal"
clearable
autosize
type="textarea"
@ -115,7 +115,7 @@
<template v-else>
<el-col :span="8">
<el-form-item label="有无建设用地" prop="construction_land">
<el-radio-group v-model="datas.construction_land" size="medium">
<el-radio-group v-model="datas.datas.construction_land" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -124,7 +124,7 @@
<el-col :span="8">
<el-form-item label="经营类型" prop="manage_type">
<el-select
v-model="datas.manage_type"
v-model="datas.datas.manage_type"
clearable
:style="{ width: '100%' }"
>
@ -140,7 +140,7 @@
<el-col :span="8">
<el-form-item label="经营地点" prop="manage_place">
<el-input
v-model="datas.manage_place"
v-model="datas.datas.manage_place"
clearable
:disabled="true"
></el-input>
@ -149,7 +149,7 @@
<el-col :span="8">
<el-form-item label="人数" prop="people_count">
<el-input
v-model="datas.people_count"
v-model="datas.datas.people_count"
clearable
:disabled="true"
></el-input>
@ -157,7 +157,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无食堂" prop="canteen">
<el-radio-group v-model="datas.canteen" size="medium">
<el-radio-group v-model="datas.datas.canteen" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -166,7 +166,7 @@
<el-col :span="8">
<el-form-item label="材料来源" prop="source_materials">
<el-input
v-model="datas.source_materials"
v-model="datas.datas.source_materials"
clearable
:disabled="true"
></el-input>
@ -175,7 +175,7 @@
<el-col :span="8">
<el-form-item label="自动化办公程度" prop="automation">
<el-input
v-model="datas.automation"
v-model="datas.datas.automation"
clearable
:disabled="true"
></el-input>
@ -183,7 +183,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无用工需求" prop="employment">
<el-radio-group v-model="datas.employment" size="medium">
<el-radio-group v-model="datas.datas.employment" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -191,7 +191,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无品牌" prop="brand">
<el-radio-group v-model="datas.brand" size="medium">
<el-radio-group v-model="datas.datas.brand" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -199,7 +199,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无宣传推广" prop="advertising">
<el-radio-group v-model="datas.advertising" size="medium">
<el-radio-group v-model="datas.datas.advertising" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -208,7 +208,7 @@
<el-col :span="8">
<el-form-item label="库存情况" prop="repertory">
<el-input
v-model="datas.repertory"
v-model="datas.datas.repertory"
clearable
:disabled="true"
></el-input>
@ -216,7 +216,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="有无运输" prop="transport">
<el-radio-group v-model="datas.transport" size="medium">
<el-radio-group v-model="datas.datas.transport" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
@ -225,7 +225,7 @@
<el-col :span="8">
<el-form-item label="经营诉求" prop="business_appeal">
<el-input
v-model="datas.business_appeal"
v-model="datas.datas.business_appeal"
clearable
autosize
type="textarea"
@ -238,6 +238,14 @@
</template>
</el-row>
</el-form>
<div v-if="datas.ai_question">
<p class="tit"> 商机分析</p>
<div >
<div>AI提问{{datas.ai_question}}</div><br/>
<div>AI回答{{datas.ai_aianalyse}}</div><br/>
<br/>
</div>
</div>
</el-card>
</template>

View File

@ -1,12 +1,6 @@
<template>
<el-card>
<el-form
ref="elForm"
:disabled="true"
:model="formData"
size="mini"
label-width="100px"
>
<el-form ref="elForm" :disabled="true" :model="formData" size="mini" label-width="100px">
<!-- <div style="font-size: 1.2rem; translate: 1vw 0; background-color: white">
个人信息
</div> -->
@ -16,12 +10,7 @@
<el-row>
<el-col :span="6">
<el-form-item label="姓名" prop="name">
<el-input
v-model="formData.name"
placeholder="请输入姓名"
clearable
:style="{ width: '100%' }"
>
<el-input v-model="formData.name" placeholder="请输入姓名" clearable :style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
@ -35,44 +24,25 @@
</el-col>
<el-col :span="6">
<el-form-item label="年龄" prop="age">
<el-input
v-model="formData.age"
placeholder="请输入年龄"
clearable
:style="{ width: '100%' }"
>
<el-input v-model="formData.age" placeholder="请输入年龄" clearable :style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="电话" prop="phone">
<el-input
v-model="formData.phone"
placeholder="请输入电话"
clearable
:style="{ width: '100%' }"
>
<el-input v-model="formData.phone" placeholder="请输入电话" clearable :style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="身份证号" prop="id_card">
<el-input
v-model="formData.id_card"
placeholder="请输入身份证号"
clearable
:style="{ width: '100%' }"
>
<el-input v-model="formData.id_card" placeholder="请输入身份证号" clearable :style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="地址" prop="field104">
<el-input
v-model="formData.address"
clearable
:style="{ width: '100%' }"
>
<el-input v-model="formData.address" clearable :style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
@ -84,36 +54,22 @@
<el-row>
<el-col :span="6">
<el-form-item label="地址">
<el-input
:value="
<el-input :value="
formData.area_name +
formData.street_name +
formData.village_name
"
placeholder="请输入地址"
clearable
:style="{ width: '100%' }"
>
" placeholder="请输入地址" clearable :style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="详细地址" prop="address">
<el-input
v-model="formData.address"
placeholder="请输入详细地址"
clearable
:style="{ width: '100%' }"
>
<el-input v-model="formData.address" placeholder="请输入详细地址" clearable :style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="汽车是否能到家"
label-width="200px"
prop="highway"
>
<el-form-item label="汽车是否能到家" label-width="200px" prop="highway">
<el-radio-group v-model="formData.highway" size="medium">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
@ -121,11 +77,7 @@
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item
label="是否使用智能手机"
label-width="200px"
prop="smart_phone"
>
<el-form-item label="是否使用智能手机" label-width="200px" prop="smart_phone">
<el-radio-group v-model="formData.smart_phone" size="medium">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
@ -134,12 +86,7 @@
</el-col>
<el-col :span="6" v-if="formData.smart_phone">
<el-form-item label="微信号" prop="field119">
<el-input
v-model="formData.skills"
placeholder="请输入微信号"
clearable
:style="{ width: '100%' }"
>
<el-input v-model="formData.skills" placeholder="请输入微信号" clearable :style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
@ -152,52 +99,25 @@
<el-row>
<el-col :span="6">
<el-form-item label="姓名" prop="name">
<el-input
v-model="item.name"
placeholder="请输入姓名"
clearable
:style="{ width: '100%' }"
>
<el-input v-model="item.name" placeholder="请输入姓名" clearable :style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="6" class="dates">
<el-form-item label="出生日期" prop="field110">
<el-date-picker
:disabled="true"
v-model="item.birth_time"
style="width: 150%"
placeholder="请输入出生日期"
clearable
></el-date-picker>
<el-date-picker :disabled="true" v-model="item.birth_time" style="width: 150%" placeholder="请输入出生日期" clearable></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="就业情况" prop="field111">
<el-select
:disabled="true"
v-model="item.situation"
placeholder="请输入就业情况"
clearable
:style="{ width: '100%' }"
>
<el-option
v-for="(items, indexs) in workLists"
:key="indexs"
:label="items.name"
:value="items.id"
></el-option>
<el-select :disabled="true" v-model="item.situation" placeholder="请输入就业情况" clearable :style="{ width: '100%' }">
<el-option v-for="(items, indexs) in workLists" :key="indexs" :label="items.name" :value="items.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="技能特长" prop="field119">
<el-input
v-model="item.skills"
placeholder="请输入技能特长"
clearable
:style="{ width: '100%' }"
>
<el-input v-model="item.skills" placeholder="请输入技能特长" clearable :style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
@ -216,35 +136,20 @@
<el-row>
<el-col :span="6">
<el-form-item label="年龄" prop="field134">
<el-input
v-model="item.age"
clearable
:disabled="true"
:style="{ width: '100%' }"
>
<el-input v-model="item.age" clearable :disabled="true" :style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="哺乳方式" prop="feeding">
<el-radio-group v-model="item.feeding" size="medium">
<el-radio
v-for="(items, indexs) in datas.feedsList"
:key="index"
:label="items.value"
>{{ items.label }}</el-radio
>
<el-radio v-for="(items, indexs) in datas.feedsList" :key="index" :label="items.value">{{ items.label }}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="备注" prop="field157">
<el-input
v-model="item.notes"
placeholder="请输入备注"
clearable
:style="{ width: '100%' }"
>
<el-input v-model="item.notes" placeholder="请输入备注" clearable :style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
@ -254,23 +159,13 @@
<el-row>
<el-col :span="6">
<el-form-item label="年龄" prop="field134">
<el-input
v-model="item.age"
clearable
:disabled="true"
:style="{ width: '100%' }"
>
<el-input v-model="item.age" clearable :disabled="true" :style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="6" v-if="formData.child_arr[index].age >= 3">
<el-form-item label="年级" prop="grade">
<el-input
v-model="item.grade"
placeholder="请输入年级"
clearable
:style="{ width: '100%' }"
>
<el-input v-model="item.grade" placeholder="请输入年级" clearable :style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
@ -284,38 +179,25 @@
</el-col>
<el-col :span="6" v-if="item.is_lesson">
<el-form-item label="补课情况" prop="lessons">
<el-input
v-model="item.lessons"
clearable
:style="{ width: '100%' }"
>
<el-input v-model="item.lessons" clearable :style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="备注" prop="field138">
<el-input
v-model="item.notes"
placeholder="请输入备注"
clearable
:style="{ width: '100%' }"
>
<el-input v-model="item.notes" placeholder="请输入备注" clearable :style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
</el-row>
</el-col>
</div>
</el-form>
</el-card>
<component v-for="(item, card_index) in formData.datas" :key="item.id" :is="isComponent(item.category_child || item.category_id)" :datas="item" :update_time="item.update_time"></component>
<component
v-for="(item, card_index) in formData.datas"
:key="item.id"
:is="isComponent(item.category_child || item.category_id)"
:datas="item.datas"
:update_time="item.update_time"
></component>
</template>
<script lang="ts" setup name="test">
@ -714,7 +596,7 @@ fileManageDetil({ id: route.query.id }).then(async (res) => {
formData.brigade_name +
formData.address;
console.log(formData);
// console.log(formData);
// await getCityList();
// await getAreaList();
// await getStreetList();

View File

@ -100,6 +100,23 @@
fixed="right"
>
<template #default="{ row }">
<el-button
v-if="row.aianalyse_status==1"
v-perms="['user_informationg.user_informationg/details']"
type="primary"
link
>
<router-link
:to="{
path: 'user_informationg/details',
query: {
id: row.id,
},
}"
>
查看商机
</router-link>
</el-button>
<el-button
v-perms="['user_informationg.user_informationg/details']"
type="primary"

View File

@ -59,6 +59,8 @@
<div class="mt-4">
<el-table
:data="pager.lists"
default-expand-all
:expand-all="true"
@selection-change="handleSelectionChange"
row-key="id"
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"

View File

@ -0,0 +1,220 @@
<template>
<div class="detail-popup">
<popup ref="popupRef" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData">
<el-descriptions :column="3" title="基本信息" border>
<el-descriptions-item label="户主姓名" label-align="left">
{{ formData.name }}
</el-descriptions-item>
<el-descriptions-item label="联系方式" label-align="left">
{{ formData.contact }}
</el-descriptions-item>
<el-descriptions-item label="家庭人数" label-align="left">
{{ formData.family_count }}
</el-descriptions-item>
<el-descriptions-item label="家庭地址" label-align="left">
{{ formData.address }}
</el-descriptions-item>
</el-descriptions>
<el-descriptions :column="3" title="房子出租" border v-if="formData.house_rent_info.area">
<el-descriptions-item label="面积" label-align="left">
{{ formData.house_rent_info.area }}
</el-descriptions-item>
<el-descriptions-item label="出租年限" label-align="left">
{{ formData.house_rent_info.ageLimit }}
</el-descriptions-item>
<el-descriptions-item label="出租要求" label-align="left">
{{ formData.house_rent_info.request }}
</el-descriptions-item>
<el-descriptions-item label="主题结构是否完成" label-align="left">
{{ formData.house_rent_info.isFinish }}
</el-descriptions-item>
<el-descriptions-item label="是否允许装修" label-align="left">
{{ formData.house_rent_info.fitment }}
</el-descriptions-item>
</el-descriptions>
<el-descriptions :column="3" title="空闲土地出租" border v-if="formData.land_rent_info.isBreeding">
<el-descriptions-item label="面是否可以种养积" label-align="left">
{{ formData.land_rent_info.isBreeding}}
</el-descriptions-item>
<el-descriptions-item label="面积" label-align="left">
{{ formData.land_rent_info.area }}
</el-descriptions-item>
<el-descriptions-item label="种养要求" label-align="left">
{{ formData.land_rent_info.request}}
</el-descriptions-item>
<el-descriptions-item label="租金和支付方式" label-align="left">
{{ formData.land_rent_info.payInfo }}
</el-descriptions-item>
<el-descriptions-item label="土地优势" label-align="left">
{{ formData.land_rent_info.advantage }}
</el-descriptions-item>
<el-descriptions-item label="土地缺点" label-align="left">
{{ formData.land_rent_info.shortcoming }}
</el-descriptions-item>
<el-descriptions-item label="闲置原因" label-align="left">
{{ formData.land_rent_info.reson }}
</el-descriptions-item>
<el-descriptions-item label="使用年限" label-align="left">
{{formData.land_rent_info.ageLimit }}
</el-descriptions-item>
</el-descriptions>
<el-descriptions :column="3" title="农副产品出售" border v-if="formData.product_info.type">
<el-descriptions-item label="种养类型" label-align="left">
{{ formData.product_info.type }}
</el-descriptions-item>
<el-descriptions-item label="种养面积" label-align="left">
{{ formData.product_info.area}}
</el-descriptions-item>
<el-descriptions-item label="土地性质" label-align="left">
{{ formData.product_info.quality}}
</el-descriptions-item>
<el-descriptions-item label="种养方式" label-align="left">
{{ formData.product_info.manner}}
</el-descriptions-item>
<el-descriptions-item label="成熟周期" label-align="left">
{{ formData.product_info.maturationCycle}}
</el-descriptions-item>
<el-descriptions-item label="最近成熟时间" label-align="left">
{{ formData.product_info.maturationTime}}
</el-descriptions-item>
<el-descriptions-item label="年产量" label-align="left">
{{ formData.product_info.yield}}
</el-descriptions-item>
<el-descriptions-item label="自己消化/市场销售" label-align="left">
{{ formData.product_info.sellType}}
</el-descriptions-item>
<el-descriptions-item label="销售方式" label-align="left">
{{ formData.product_info.sellMethods}}
</el-descriptions-item>
<el-descriptions-item label="年销量" label-align="left">
{{ formData.product_info.Sales}}
</el-descriptions-item>
<el-descriptions-item label="优势" label-align="left">
{{ formData.product_info.productName}}
</el-descriptions-item>
<el-descriptions-item label="产品名称" label-align="left">
{{ formData.product_info.advantage}}
</el-descriptions-item>
<el-descriptions-item label="产品有无品牌" label-align="left">
{{ formData.product_info.isBrand}}
</el-descriptions-item>
<el-descriptions-item label="是否进行粗加工" label-align="left">
{{ formData.product_info.isBrand}}
</el-descriptions-item>
<el-descriptions-item label="产品诉求" label-align="left">
{{ formData.product_info.isDemands}}
</el-descriptions-item>
<el-descriptions-item label="急需解决的问题" label-align="left">
{{ formData.product_info.quesition}}
</el-descriptions-item>
</el-descriptions>
<el-descriptions :column="3" title="空闲资产出租/出售" border v-if="formData.idle_asset_rent_info.area">
<el-descriptions-item label="资产名称" label-align="left">
{{ formData.idle_asset_rent_info.area }}
</el-descriptions-item>
<el-descriptions-item label="资产优势" label-align="left">
{{ formData.idle_asset_rent_info.advantage}}
</el-descriptions-item>
<el-descriptions-item label="数量" label-align="left">
{{ formData.idle_asset_rent_info.num}}
</el-descriptions-item>
<el-descriptions-item label="增收方式" label-align="left">
{{ formData.idle_asset_rent_info.type}}
</el-descriptions-item>
<el-descriptions-item label="其他可变现" label-align="left">
{{ formData.idle_asset_rent_info.other}}
</el-descriptions-item>
</el-descriptions>
<el-descriptions :column="3" title="房屋装饰建设" border v-if="formData.house_decoration_construction.area">
<el-descriptions-item label="施工地点" label-align="left">
{{ formData.house_decoration_construction.area }}
</el-descriptions-item>
<el-descriptions-item label="开始时间" label-align="left">
{{ formData.house_decoration_construction.startTime }}
</el-descriptions-item>
<el-descriptions-item label="修/建标准" label-align="left">
{{ formData.house_decoration_construction.standard }}
</el-descriptions-item>
<el-descriptions-item label="事主要求" label-align="left">
{{ formData.house_decoration_construction.ask}}
</el-descriptions-item>
<el-descriptions-item label="房屋建设时长" label-align="left">
{{ formData.house_decoration_construction.time}}
</el-descriptions-item>
<el-descriptions-item label="设计服务" label-align="left">
{{ formData.house_decoration_construction.serve}}
</el-descriptions-item>
</el-descriptions>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="customdetail">
import type { FormInstance } from 'element-plus'
const emit = defineEmits(['success', 'close'])
const formRef = shallowRef<FormInstance>()
const popupRef = shallowRef<InstanceType<typeof Popup>>()
//
const formData = reactive({
})
//
const setFormData = async (data: Record<any, any>) => {
Object.assign(formData, data)
toParse( ['house_decoration_construction','house_rent_info','idle_asset_rent_info','land_rent_info','product_info'] )
console.log(formData, "fromdar")
}
//
const handleSubmit = async () => {
popupRef.value?.close()
}
//
const open = () => {
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
//json
const toParse=(key) => {
for (let i = 0; i < key.length; i++) {
formData[key[i]] = JSON.parse(formData[key[i]])
}
}
defineExpose({
open,
setFormData,
})
</script>
<style lang="scss" scoped>
.tit {
font-size: 1.2em;
margin-bottom: 10px;
}
</style>

View File

@ -0,0 +1,95 @@
<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="contact">
<el-input class="w-[280px]" v-model="queryParams.contact" type="number" 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" @selection-change="handleSelectionChange">
<el-table-column label="序号" type="index" width="55" />
<el-table-column label="户主姓名" prop="name" show-overflow-tooltip />
<el-table-column label="联系方式" prop="contact" show-overflow-tooltip />
<el-table-column label="家庭人数" prop="family_count" show-overflow-tooltip />
<el-table-column label="家庭地址" prop="address" show-overflow-tooltip />
<el-table-column label="操作" width="160" fixed="right">
<template #default="{ row }">
<el-button link
@click="handledetail(row)" type="primary">
详情
</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div class="flex justify-end mt-4">
<!-- <pagination v-model="pager" @change="getLists" /> -->
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
<detail-popup v-if="showDtail" ref="detailRef" @close="showDtail = false" />
</div>
</template>
<script lang="ts" setup name="projectLists">
import { ref, reactive } from 'vue'
import { apivillageInfoLists } from "@/api/villageInfo"
import { usePaging } from "@/hooks/usePaging";
import DetailPopup from './detail.vue'
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
//
const showDtail = ref(false)
//
const queryParams = reactive({
name:"",
contact:""
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apivillageInfoLists,
params: queryParams
})
//
const handledetail = async (data: any) => {
// let res = await apiinvoiceapplyDetail({ id: data.id })
showDtail.value = true
await nextTick()
detailRef.value?.open()
detailRef.value?.setFormData(data)
}
getLists()
</script>

View File

@ -14,7 +14,7 @@ import vueSetupExtend from 'vite-plugin-vue-setup-extend'
export default defineConfig({
base: '/admin/',
server: {
host: '0.0.0.0'
host: '0.0.0.0',
},
plugins: [
vue(),

6975
yarn.lock

File diff suppressed because it is too large Load Diff