页面修改

This commit is contained in:
嗜血龙帅 2023-08-01 21:33:30 +08:00
parent e551ac611a
commit 301aded17b
12 changed files with 2453 additions and 2059 deletions

View File

@ -1,21 +1,36 @@
import request from '@/utils/request' import request from "@/utils/request";
// 用户列表 // 用户列表
export function getUserList(params: any) { export function getUserList(params: any) {
return request.get({ url: '/user.user/lists', params }, { ignoreCancelToken: true }) return request.get(
{ url: "/user.user/lists", params },
{ ignoreCancelToken: true }
);
} }
// 用户详情 // 用户详情
export function getUserDetail(params: any) { export function getUserDetail(params: any) {
return request.get({ url: '/user.user/detail', params }) return request.get({ url: "/user.user/detail", params });
} }
// 用户编辑 // 用户编辑
export function userEdit(params: any) { export function userEdit(params: any) {
return request.post({ url: '/user.user/edit', params }) return request.post({ url: "/user.user/edit", params });
} }
// 用户编辑 // 用户编辑
export function adjustMoney(params: any) { export function adjustMoney(params: any) {
return request.post({ url: '/user.user/adjustMoney', params }) return request.post({ url: "/user.user/adjustMoney", params });
}
// 发起合同
export function initiateContact(params: any) {
return request.post({ url: "/user.user/initiate_contract", params });
}
// 上传合同
export function upContact(params: any) {
return request.post({ url: "/contract.contract/wind_control", params });
}
//生产个人合同
export function creatContact(params: any) {
return request.post({ url: "/user.user/Draftingcontracts", params });
} }

12
src/api/informationg.ts Normal file
View File

@ -0,0 +1,12 @@
import request from "@/utils/request";
// 档案列表
export function fileManagelist(params: any) {
return request.get({ url: "/informationg.user_informationg/lists", params });
}
// 档案详情
export function fileManageDetil(params: any) {
return request.get({ url: "/informationg.user_informationg/detail", params });
}

View File

@ -45,7 +45,23 @@ export const constantRoutes: Array<RouteRecordRaw> = [
meta: { meta: {
title: "个人设置", title: "个人设置",
}, },
} },
{
path: "b",
component: () => import("@/views/fileManagement/index.vue"),
name: Symbol(),
meta: {
title: "个人设置",
},
},
{
path: "a",
component: () => import("@/views/fileManagement/detil.vue"),
name: Symbol(),
meta: {
title: "个人设置",
},
},
], ],
}, },
// { // {

View File

@ -1,168 +1,177 @@
<template> <template>
<div> <div>
<el-card class="!border-none mb-4" shadow="never"> <el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline> <el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="名称" prop="name"> <el-form-item label="名称" prop="name">
<el-input <el-input
class="w-[280px]" class="w-[280px]"
v-model="queryParams.name" v-model="queryParams.name"
clearable clearable
placeholder="请输入名称" placeholder="请输入名称"
/> />
</el-form-item> </el-form-item>
<el-form-item label="排序" prop="sort"> <el-form-item label="排序" prop="sort">
<el-input <el-input
class="w-[280px]" class="w-[280px]"
v-model="queryParams.sort" v-model="queryParams.sort"
clearable clearable
placeholder="请输入排序" placeholder="请输入排序"
/> />
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="status"> <el-form-item label="状态" prop="status">
<el-select <el-select
class="w-[280px]" class="w-[280px]"
v-model="queryParams.status" v-model="queryParams.status"
clearable clearable
placeholder="请选择状态" placeholder="请选择状态"
> >
<el-option label="全部" value=""></el-option> <el-option label="全部" value=""></el-option>
<el-option <el-option
v-for="(item, index) in dictData.show_status" v-for="(item, index) in dictData.show_status"
:key="index" :key="index"
:label="item.name" :label="item.name"
:value="item.value" :value="item.value"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button> <el-button type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button> <el-button @click="resetParams">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-card> </el-card>
<el-card class="!border-none" v-loading="pager.loading" shadow="never"> <el-card class="!border-none" v-loading="pager.loading" shadow="never">
<el-button <el-button
v-perms="['category_business.category_business/add']" v-perms="['category_business.category_business/add']"
type="primary"
@click="handleAdd"
>
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button
v-perms="['category_business.category_business/delete']"
:disabled="!selectData.length"
@click="handleDelete(selectData)"
>
删除
</el-button>
<div class="mt-4">
<el-table
:data="pager.lists"
@selection-change="handleSelectionChange"
row-key="id"
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
>
<el-table-column label="id" prop="id" show-overflow-tooltip />
<el-table-column label="名称" prop="name" show-overflow-tooltip />
<el-table-column label="上级id" prop="pid" show-overflow-tooltip />
<el-table-column label="排序" prop="sort" show-overflow-tooltip />
<el-table-column label="状态" prop="status">
<template #default="{ row }">
<dict-value :options="dictData.show_status" :value="row.status" />
</template>
</el-table-column>
<el-table-column label="操作" width="120" fixed="right">
<template #default="{ row }">
<el-button
v-perms="['category_business.category_business/edit']"
type="primary" type="primary"
@click="handleAdd" link
> @click="handleEdit(row)"
<template #icon> >
<icon name="el-icon-Plus" /> 编辑
</template> </el-button>
新增 <el-button
</el-button>
<el-button
v-perms="['category_business.category_business/delete']" v-perms="['category_business.category_business/delete']"
:disabled="!selectData.length" type="danger"
@click="handleDelete(selectData)" link
> @click="handleDelete(row.id)"
>
删除 删除
</el-button> </el-button>
<div class="mt-4"> </template>
<el-table :data="pager.lists" @selection-change="handleSelectionChange"> </el-table-column>
<el-table-column type="selection" width="55" /> </el-table>
<el-table-column label="id" prop="id" show-overflow-tooltip /> </div>
<el-table-column label="名称" prop="name" show-overflow-tooltip /> <div class="flex mt-4 justify-end">
<el-table-column label="上级id" prop="pid" show-overflow-tooltip /> <pagination v-model="pager" @change="getLists" />
<el-table-column label="排序" prop="sort" show-overflow-tooltip /> </div>
<el-table-column label="状态" prop="status"> </el-card>
<template #default="{ row }"> <edit-popup
<dict-value :options="dictData.show_status" :value="row.status" /> v-if="showEdit"
</template> ref="editRef"
</el-table-column> :dict-data="dictData"
<el-table-column label="操作" width="120" fixed="right"> @success="getLists"
<template #default="{ row }"> @close="showEdit = false"
<el-button />
v-perms="['category_business.category_business/edit']" </div>
type="primary"
link
@click="handleEdit(row)"
>
编辑
</el-button>
<el-button
v-perms="['category_business.category_business/delete']"
type="danger"
link
@click="handleDelete(row.id)"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div class="flex mt-4 justify-end">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
<edit-popup
v-if="showEdit"
ref="editRef"
:dict-data="dictData"
@success="getLists"
@close="showEdit = false"
/>
</div>
</template> </template>
<script lang="ts" setup name="categoryBusinessLists"> <script lang="ts" setup name="categoryBusinessLists">
import { usePaging } from '@/hooks/usePaging' import { usePaging } from "@/hooks/usePaging";
import { useDictData } from '@/hooks/useDictOptions' import { useDictData } from "@/hooks/useDictOptions";
import { apiCategoryBusinessLists, apiCategoryBusinessDelete } from '@/api/category_business' import {
import { timeFormat } from '@/utils/util' apiCategoryBusinessLists,
import feedback from '@/utils/feedback' apiCategoryBusinessDelete,
import EditPopup from './edit.vue' } from "@/api/category_business";
import { timeFormat } from "@/utils/util";
import feedback from "@/utils/feedback";
import EditPopup from "./edit.vue";
const editRef = shallowRef<InstanceType<typeof EditPopup>>() const editRef = shallowRef<InstanceType<typeof EditPopup>>();
// //
const showEdit = ref(false) const showEdit = ref(false);
// //
const queryParams = reactive({ const queryParams = reactive({
name: '', name: "",
sort: '', sort: "",
status: '' status: "",
}) });
// //
const selectData = ref<any[]>([]) const selectData = ref<any[]>([]);
// //
const handleSelectionChange = (val: any[]) => { const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id) selectData.value = val.map(({ id }) => id);
} };
// //
const { dictData } = useDictData('show_status') const { dictData } = useDictData("show_status");
// //
const { pager, getLists, resetParams, resetPage } = usePaging({ const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiCategoryBusinessLists, fetchFun: apiCategoryBusinessLists,
params: queryParams params: queryParams,
}) });
// //
const handleAdd = async () => { const handleAdd = async () => {
showEdit.value = true showEdit.value = true;
await nextTick() await nextTick();
editRef.value?.open('add') editRef.value?.open("add");
} };
// //
const handleEdit = async (data: any) => { const handleEdit = async (data: any) => {
showEdit.value = true showEdit.value = true;
await nextTick() await nextTick();
editRef.value?.open('edit') editRef.value?.open("edit");
editRef.value?.setFormData(data) editRef.value?.setFormData(data);
} };
// //
const handleDelete = async (id: number | any[]) => { const handleDelete = async (id: number | any[]) => {
await feedback.confirm('确定要删除?') await feedback.confirm("确定要删除?");
await apiCategoryBusinessDelete({ id }) await apiCategoryBusinessDelete({ id });
getLists() getLists();
} };
getLists() getLists().then((res) => {
console.log(res);
});
</script> </script>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,79 +1,148 @@
<template> <template>
<div> <div>
<el-card class="!border-none" shadow="never"> <el-card class="!border-none" shadow="never">
<el-form ref="formRef" class="mb-[-16px]" :model="queryParams" :inline="true"> <el-form
<el-form-item label="用户信息"> ref="formRef"
<el-input class="mb-[-16px]"
class="w-[280px]" :model="queryParams"
v-model="queryParams.keyword" :inline="true"
placeholder="用户编号/昵称/手机号码" >
clearable <el-form-item label="用户信息">
@keyup.enter="resetPage" <el-input
/> class="w-[280px]"
</el-form-item> v-model="queryParams.keyword"
<el-form-item> placeholder="用户编号/昵称/手机号码"
<el-button type="primary" @click="resetPage">查询</el-button> clearable
<el-button @click="resetParams">重置</el-button> @keyup.enter="resetPage"
<export-data />
class="ml-2.5" </el-form-item>
:fetch-fun="getUserList" <el-form-item>
:params="queryParams" <el-button type="primary" @click="resetPage">查询</el-button>
:page-size="pager.size" <el-button @click="resetParams">重置</el-button>
/> <export-data
</el-form-item> class="ml-2.5"
</el-form> :fetch-fun="getUserList"
</el-card> :params="queryParams"
<el-card class="!border-none mt-4" shadow="never"> :page-size="pager.size"
<el-table size="large" v-loading="pager.loading" :data="pager.lists"> />
<el-table-column label="用户编号" prop="sn" min-width="120" /> </el-form-item>
<el-table-column label="头像" min-width="100"> </el-form>
<template #default="{ row }"> </el-card>
<el-avatar :src="row.avatar" :size="50" /> <el-card class="!border-none mt-4" shadow="never">
</template> <el-table size="large" v-loading="pager.loading" :data="pager.lists">
</el-table-column> <el-table-column label="用户编号" prop="sn" min-width="120" />
<el-table-column label="账号" prop="account" min-width="120" /> <el-table-column label="头像" min-width="100">
<el-table-column label="姓名" prop="nickname" min-width="100" /> <template #default="{ row }">
<el-table-column label="联系方式" prop="mobile" min-width="100" /> <el-avatar :src="row.avatar" :size="50" />
<el-table-column </template>
label="隶属公司" </el-table-column>
prop="company_name" <el-table-column label="账号" prop="account" min-width="120" />
min-width="180" <el-table-column label="姓名" prop="nickname" min-width="100" />
align="center" <el-table-column label="联系方式" prop="mobile" min-width="100" />
<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="操作" width="400" 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>
</el-button>
<template v-if="row.company_id != 0 && row.is_contract == 0">
<el-button
v-perms="['auth.admin/Draftingcontracts']"
type="primary"
link
>
<router-link
:to="{
path: getRoutePath('user.user/detail'),
query: {
id: row.id,
mode: 'initiate',
},
}"
> >
<template #default="{ row }"> 发起合同
{{ row.company?.company_name || '/' }} </router-link>
</template> </el-button>
</el-table-column>
<el-table-column label="所在乡镇" prop="street_name" min-width="120" /> <el-button
<el-table-column label="授权身份" prop="role_name" min-width="120"> v-perms="['auth.admin/Draftingcontracts']"
<template #default="{ row }"> type="primary"
<span v-if="row.admin_id == row.company?.admin_id" style="color: #67c23a" link
>公司后台管理人员</span >
> <router-link
<span v-else style="color: #fe0000"></span> :to="{
</template> path: getRoutePath('user.user/detail'),
</el-table-column> query: {
<el-table-column label="是否签约" prop="is_contract" align="center" min-width="120"> id: row.id,
<template #default="{ row }"> mode: 'uplode',
<span v-if="row.is_contract == 1" style="color: #67c23a">已签约</span> },
<span v-else style="color: #fe0000">未签约</span> }"
</template> >
</el-table-column> 上传合同
<el-table-column label="操作" width="120" fixed="right"> </router-link>
<template #default="{ row }"> </el-button>
<el-button v-perms="['user.user/detail']" type="primary" link> <el-button
<router-link v-perms="['auth.admin/Draftingcontracts']"
:to="{ type="primary"
path: getRoutePath('user.user/detail'), link
query: { @click="
id: row.id (showPop = true),
} (showConctactPop = true),
}" (contractId = row.id)
> "
详情 >生成个人合同</el-button
</router-link> >
</el-button> <el-button
<!-- <el-button v-perms="['auth.admin/postsms']"
type="primary"
link
@click="(showPop = true), (contractId = row.id)"
>重新短信</el-button
>
</template>
<!-- <el-button
v-if="row.root != 1" v-if="row.root != 1"
v-perms="['auth.admin/delete']" v-perms="['auth.admin/delete']"
type="danger" type="danger"
@ -109,28 +178,76 @@
>重新短信</el-button >重新短信</el-button
> >
</template> --> </template> -->
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="flex justify-end mt-4">
<pagination v-model="pager" @change="getLists" /> <el-dialog v-model="showPop" @close="offPop">
</div> <h1>重要提醒</h1>
</el-card> <div class="content" v-if="showConctactPop">
</div> 请确认信息是否有误,发送合同,请确认信息是否有误,发送电子合同后短时间内将不可再次发送.
</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>
</el-card>
</div>
</template> </template>
<script lang="ts" setup name="consumerLists"> <script lang="ts" setup name="consumerLists">
import { usePaging } from '@/hooks/usePaging' import { usePaging } from "@/hooks/usePaging";
import { getRoutePath } from '@/router' import { getRoutePath } from "@/router";
import { getUserList } from '@/api/consumer' import {
import { ClientMap } from '@/enums/appEnums' getUserList,
import feedback from '@/utils/feedback' creatContact,
initiateContact,
upContact,
} from "@/api/consumer";
import { ClientMap } from "@/enums/appEnums";
import feedback from "@/utils/feedback";
const queryParams = reactive({ const queryParams = reactive({
keyword: '', keyword: "",
channel: '', channel: "",
create_time_start: '', create_time_start: "",
create_time_end: '' create_time_end: "",
}) });
const contractId = ref(0);
const showPop = ref(false);
const showConctactPop = ref(false);
const offPop = () => {
showPop.value = false;
showConctactPop.value = false;
};
const creContct = () => {
// feedback.msgSuccess("");
creatContact({ id: contractId.value }).then(() => {
feedback.msgSuccess("发送成功");
});
offPop();
};
const sendMsg = () => {
// sendMsgApi({ id: contractId.value }).then((res) => {
// feedback.msgSuccess("");
// });
offPop();
};
// const handleDelete = async (id: number) => { // const handleDelete = async (id: number) => {
// await feedback.confirm('') // await feedback.confirm('')
// await adminDelete({ id }) // await adminDelete({ id })
@ -142,12 +259,39 @@ const queryParams = reactive({
// getLists() // getLists()
// } // }
const { pager, getLists, resetPage, resetParams } = usePaging({ const { pager, getLists, resetPage, resetParams } = usePaging({
fetchFun: getUserList, fetchFun: getUserList,
params: queryParams params: queryParams,
}) });
onActivated(() => { onActivated(() => {
getLists() getLists();
}) });
getLists() getLists();
</script> </script>
<style>
h1 {
text-align: center;
font-weight: bold;
font-size: 30px;
color: red;
margin-bottom: 10px;
}
.content {
font-size: 20px;
}
.info {
color: red;
font-weight: bold;
font-size: 18px;
display: inline-block;
margin: 0 5px;
}
.btn_menu {
margin-top: 10vh;
display: flex;
justify-content: space-around;
}
</style>

View File

@ -205,9 +205,11 @@
</div> </div>
<el-form-item label-width="150px" label="是否有婴幼儿"> <el-form-item label-width="150px" label="是否有婴幼儿">
<el-switch v-model="formData.child"></el-switch> <el-radio-group v-model="formData.child" size="medium">
<el-radio :label="1">是否有婴幼儿</el-radio>
</el-radio-group>
</el-form-item> </el-form-item>
<p style="padding: 0 0 20px 10px"> <!-- <p style="padding: 0 0 20px 10px">
<el-button type="primary" size="medium" @click="addFamilyMember"> <el-button type="primary" size="medium" @click="addFamilyMember">
添加家庭成员 添加家庭成员
</el-button> </el-button>
@ -220,7 +222,7 @@
> >
添加婴幼儿 添加婴幼儿
</el-button> </el-button>
</p> </p> -->
</el-col> </el-col>
<div v-for="(item, index) in formData.child_arr" v-if="formData.child"> <div v-for="(item, index) in formData.child_arr" v-if="formData.child">
<el-col> <el-col>
@ -333,21 +335,19 @@
<el-col> <el-col>
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item <el-form-item prop="field162" label-width="200px">
label="汽车是否能到家" <el-radio-group v-model="formData.highway" size="medium">
prop="field162" <el-radio :label="1">汽车是否能到家</el-radio>
label-width="200px" </el-radio-group>
> <!-- <el-switch v-model="formData.highway"></el-switch> -->
<el-switch v-model="formData.highway"></el-switch>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item <el-form-item prop="smart_phone" label-width="200px">
label="是否使用智能手机" <!-- <el-switch v-model="formData.smart_phone"></el-switch> -->
prop="smart_phone" <el-radio-group v-model="formData.smart_phone" size="medium">
label-width="200px" <el-radio :label="1">是否使用智能手机</el-radio>
> </el-radio-group>
<el-switch v-model="formData.smart_phone"></el-switch>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8" v-if="formData.smart_phone"> <el-col :span="8" v-if="formData.smart_phone">
@ -366,46 +366,7 @@
</el-col> </el-col>
</el-row> </el-row>
</el-col> </el-col>
<p class="tit">养殖信息</p> <!--
<el-col>
<el-row>
<el-col :span="8">
<el-form-item label="耕地总面积" prop="field166">
<el-input
v-model="formData.cultivated_area"
placeholder="请输入耕地总面积"
clearable
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item label="土地规划" prop="field167">
<el-checkbox-group v-model="formData.planning" size="medium">
<el-checkbox
v-for="(item, index) in datas.plantList"
:key="index"
:label="item.value"
>{{ item.label }}</el-checkbox
>
</el-checkbox-group>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item
label="有无种培训/注册成立公司经历"
prop="field168"
label-width="230px"
>
<el-switch v-model="formData.breeding_training"></el-switch>
</el-form-item>
</el-col>
</el-row>
</el-col>
<el-col :span="24" v-if="formData.breeding_training"> <el-col :span="24" v-if="formData.breeding_training">
<el-form-item label="备注" prop="field169"> <el-form-item label="备注" prop="field169">
<el-input <el-input
@ -416,16 +377,16 @@
> >
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col> -->
<p class="tit">土地具体信息</p> <p class="tit">土地具体信息</p>
<div v-for="(item, index) in formData.farmland"> <div v-for="(item, index) in formData.datas">
<el-col> <el-col>
<el-row> <el-row>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="种养殖类别" prop="field171"> <el-form-item label="种养殖类别" prop="field171">
<el-input <el-input
v-model="item.breeding_time" v-model="item.datas.breeding_type"
placeholder="如 土豆" placeholder="如 土豆"
clearable clearable
:style="{ width: '100%' }" :style="{ width: '100%' }"
@ -436,7 +397,7 @@
<el-col :span="6"> <el-col :span="6">
<el-form-item label="种养殖面积" prop="field172"> <el-form-item label="种养殖面积" prop="field172">
<el-input <el-input
v-model="item.area" v-model="item.datas.area"
placeholder="请输入面积" placeholder="请输入面积"
clearable clearable
:style="{ width: '100%' }" :style="{ width: '100%' }"
@ -447,7 +408,7 @@
<el-col :span="6"> <el-col :span="6">
<el-form-item label="种植开始时" prop="field173" class="dates"> <el-form-item label="种植开始时" prop="field173" class="dates">
<el-date-picker <el-date-picker
v-model="item.breeding_time" v-model="item.datas.breeding_time"
:style="{ width: '100%' }" :style="{ width: '100%' }"
placeholder="请选择种植开始时" placeholder="请选择种植开始时"
clearable clearable
@ -457,7 +418,7 @@
<el-col :span="6"> <el-col :span="6">
<el-form-item label="上市时间" prop="field174" class="dates"> <el-form-item label="上市时间" prop="field174" class="dates">
<el-date-picker <el-date-picker
v-model="item.mature_time" v-model="item.datas.mature_time"
:style="{ width: '100%' }" :style="{ width: '100%' }"
placeholder="请选择上市时间" placeholder="请选择上市时间"
clearable clearable
@ -466,10 +427,10 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row <el-row
><el-col :span="8"> ><el-col :span="6">
<el-form-item label="产量" prop="field175"> <el-form-item label="产量" prop="field175">
<el-input <el-input
v-model="item.yield" v-model="item.datas.yield"
placeholder="请输入产量" placeholder="请输入产量"
clearable clearable
:style="{ width: '100%' }" :style="{ width: '100%' }"
@ -477,50 +438,111 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="6">
<el-form-item <el-form-item
label="农资农具使用情况" label="农资农具使用情况"
label-width="150px" label-width="150px"
prop="field176" prop="field176"
> >
<el-input <el-input
v-model="item.farm_tools" v-model="item.datas.farm_tools"
placeholder="请输入农资农具使用情况" placeholder="请输入农资农具使用情况"
clearable clearable
:style="{ width: '100%' }" :style="{ width: '100%' }"
></el-input> ></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="6">
<el-form-item label="预售卖价格" prop="field177"> <el-form-item label="预售卖价格" prop="field177">
<el-input <el-input
v-model="item.pre_price" v-model="item.datas.pre_price"
placeholder="请输入预售卖价格" placeholder="请输入预售卖价格"
clearable clearable
:style="{ width: '100%' }" :style="{ width: '100%' }"
> >
</el-input> </el-input>
</el-form-item> </el-col </el-form-item>
></el-row> </el-col>
<el-col :span="6">
<el-form-item label="耕地总面积" prop="field166">
<el-input
v-model="item.datas.cultivated_area"
placeholder="请输入耕地总面积"
clearable
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
</el-row>
</el-col> </el-col>
<el-row>
<el-col :span="10">
<el-form-item label="土地规划" prop="field167">
<el-radio-group v-model="item.datas.planning" size="medium">
<el-radio
v-for="(item, index) in datas.plantList"
:key="index"
:label="item.value"
>{{ item.label }}</el-radio
>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item>
<el-radio-group
v-model="item.datas.breeding_training"
size="medium"
>
<el-radio label="1">有无种植培训</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item>
<el-radio-group
v-model="item.datas.planting_company"
size="medium"
>
<el-radio label="1">注册成立公司经历</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="备注" prop="field138">
<el-input
v-model="item.datas.notes"
placeholder="请输入备注"
clearable
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-col> <el-col>
<el-row> <el-row>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="销售方式" prop="field180"> <el-form-item label="销售方式" prop="field180">
<el-checkbox-group v-model="item.method_sales" size="medium"> <el-radio-group v-model="item.datas.method_sales" size="medium">
<el-checkbox <el-radio
v-for="(items, indexs) in datas.sellType" v-for="(items, indexs) in datas.sellType"
:key="indexs" :key="indexs"
:label="items.value" :label="items.value"
>{{ items.label }}</el-checkbox >{{ items.label }}</el-radio
> >
</el-checkbox-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label-width="100px" prop="field179"> <el-form-item label-width="100px" prop="field179">
<el-radio-group v-model="item.ecological_farming" size="medium"> <el-radio-group
v-model="item.datas.ecological_farming"
size="medium"
>
<el-radio label="1">是否生态种植</el-radio> <el-radio label="1">是否生态种植</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
@ -528,7 +550,7 @@
<el-col :span="4"> <el-col :span="4">
<el-form-item label-width="100px" prop="field182"> <el-form-item label-width="100px" prop="field182">
<el-radio-group v-model="item.promote" size="medium"> <el-radio-group v-model="item.datas.promote" size="medium">
<el-radio label="1">有无宣传推广</el-radio> <el-radio label="1">有无宣传推广</el-radio>
> >
@ -538,67 +560,76 @@
<el-col :span="4"> <el-col :span="4">
<el-form-item label-width="100px" prop="field181"> <el-form-item label-width="100px" prop="field181">
<el-radio-group v-model="item.processing_storage" size="medium"> <el-radio-group
v-model="item.datas.processing_storage"
size="medium"
>
<el-radio label="1">有无加工仓储</el-radio> <el-radio label="1">有无加工仓储</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label-width="100px" prop="field183"> <el-form-item label-width="100px" prop="field183">
<el-radio-group v-model="item.transportation" size="medium"> <el-radio-group
v-model="item.datas.transportation"
size="medium"
>
<el-radio label="1">有无运输</el-radio> <el-radio label="1">有无运输</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-col> <el-row>
</div> <el-col :span="8">
<p style="padding: 0 0 20px 10px"> <el-form-item label="种植诉求" prop="field189">
<el-button type="primary" size="medium" @click="addLand"> <el-input
添加土地信息 v-model="item.datas.demand"
</el-button> placeholder="请输入种植诉求"
</p> clearable
<el-col> :style="{ width: '100%' }"
<el-row>
<el-col :span="8">
<el-form-item label="种植诉求" prop="field189">
<el-input
v-model="formData.demand"
placeholder="请输入种植诉求"
clearable
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="政策补助" prop="field190">
<el-input
v-model="formData.policy_subsidies"
placeholder="请输入政策补助"
clearable
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label-width="4vw" prop="field188">
<el-radio-group
v-model="formData.expand_business_needs"
size="medium"
>
<el-radio
v-for="(item, index) in field188Options"
:key="index"
:label="item.value"
>{{ item.label }}</el-radio
> >
</el-radio-group> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> <el-col :span="8">
</el-col> <el-form-item label="政策补助" prop="field190">
<el-input
v-model="item.datas.policy_subsidies"
placeholder="请输入政策补助"
clearable
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label-width="4vw" prop="field188">
<el-radio-group
v-model="formData.expand_business_needs"
size="medium"
>
<el-radio
v-for="(item, index) in field188Options"
:key="index"
:label="item.value"
>{{ item.label }}</el-radio
>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
</el-col>
<div style="box-sizing: border-box; padding: 0 2vw">
<p
style="
border: 1px solid #bfbfbf;
margin-bottom: 6px;
text-align: center;
"
></p>
</div>
</div>
<p class="tit"> <p class="tit">
更新时间 <span style="font-size: 14px">2022年12月30日</span> 更新时间 <span style="font-size: 14px">2022年12月30日</span>
</p> </p>
@ -1823,6 +1854,8 @@ import {
apiStreetList, apiStreetList,
apiProvinceList, apiProvinceList,
} from "@/api/common"; } from "@/api/common";
import { fileManagelist, fileManageDetil } from "@/api/informationg";
const formData = reactive({ const formData = reactive({
name: undefined, name: undefined,
phone: "", phone: "",
@ -1854,11 +1887,40 @@ const formData = reactive({
highway: undefined, highway: undefined,
smart_phone: undefined, smart_phone: undefined,
wechat: "", wechat: "",
//
datas: [
{
datas: {
cultivated_area: "20", //
planning: 66, //
breeding_training: 1, //
planting_company: 0, //
notes: "试试备注", //
breeding_type: 22, //
area: 20, //
breeding_time: "2022-07-22", //
mature_time: "2022-07-22", //
yield: 600, //
estimated_income: 1500, //
farm_tools: "收割机一台,打米机一台", //使
ecological_farming: 1, //
modernization: 30, //
pre_price: "30.00", //
method_sales: 1, //
processing_storage: 0, //
promote: 0, //广
transportation: 0, //
expand_business_needs: 0, //
demand: "没有述求", //
policy_subsidies: "无补助", //
},
},
],
cultivated_area: "", cultivated_area: "",
planning: "", planning: "",
planting_company: "", planting_company: "",
notes: "", notes: "",
breeding_training: undefined,
farmland: [ farmland: [
{ {
breeding_type: "", breeding_type: "",
@ -1879,6 +1941,7 @@ const formData = reactive({
], ],
expand_business_needs: "", expand_business_needs: "",
demand: "", demand: "",
// sadsadas // sadsadas
// //
housingDecoration: [ housingDecoration: [
@ -2031,19 +2094,19 @@ const datas = reactive({
plantList: [ plantList: [
{ {
label: "自己种", label: "自己种",
value: 1, value: "1",
}, },
{ {
label: "出租", label: "出租",
value: 2, value: "2",
}, },
{ {
label: "代种养", label: "代种养",
value: "", value: "3",
}, },
{ {
label: "租更多地扩大种植", label: "租更多地扩大种植",
value: "", value: "4",
}, },
], ],
// //
@ -2124,11 +2187,11 @@ const datas = reactive({
sellType: [ sellType: [
{ {
label: "自销", label: "自销",
value: 1, value: "1",
}, },
{ {
label: "定点销售", label: "定点销售",
value: 2, value: "2",
}, },
], ],
// //
@ -2295,23 +2358,7 @@ const addKids = () => {
feeding: "", feeding: "",
}); });
}; };
const addLand = () => {
formData.farmland.push({
breeding_type: "",
cultivated_area: "",
breeding_time: "",
mature_time: "",
yield: "",
ecological_farming: "",
farm_tools: "",
pre_price: "",
method_sales: [],
processing_storage: "",
promote: "",
transportation: "",
notes: "",
});
};
// const addDecoration = () => { // const addDecoration = () => {
// formData.housingDecoration.push({ // formData.housingDecoration.push({
// field102: [], // field102: [],
@ -2387,6 +2434,20 @@ const getStreetList = async () => {
const data = await apiStreetList({ street: formData.area }); const data = await apiStreetList({ street: formData.area });
datas["streetOptions"] = data; datas["streetOptions"] = data;
}; };
fileManageDetil({ id: 25 }).then(async (res) => {
// console.log(res);
for (const key in formData) {
if (res[key] != null && res[key] != undefined) {
//@ts-ignore
formData[key] = res[key];
}
}
console.log(formData.datas);
// await getCityList();
// await getAreaList();
// await getStreetList();
});
getProvinceList(); getProvinceList();
</script> </script>
<style lang="scss"> <style lang="scss">

View File

@ -55,6 +55,8 @@ import Popup from "@/components/popup/index.vue";
import { apiCateCreat } from "@/api/examined"; import { apiCateCreat } from "@/api/examined";
import { timeFormat } from "@/utils/util"; import { timeFormat } from "@/utils/util";
import type { PropType } from "vue"; import type { PropType } from "vue";
import { fileManagelist, fileManageDetil } from "@/api/informationg";
defineProps({ defineProps({
dictData: { dictData: {
type: Object as PropType<Record<string, any[]>>, type: Object as PropType<Record<string, any[]>>,
@ -118,6 +120,7 @@ const handleClose = () => {
emit("close"); emit("close");
}; };
defineExpose({ defineExpose({
open, open,
setFormData, setFormData,

View File

@ -21,26 +21,25 @@
</el-button> </el-button>
<div class="mt-4"> <div class="mt-4">
<el-table :data="pager.lists" @selection-change="handleSelectionChange"> <el-table :data="pager.lists" @selection-change="handleSelectionChange">
<el-table-column <el-table-column label="用户编号" prop="id" show-overflow-tooltip />
label="用户编号" <el-table-column label="用户名" prop="name" show-overflow-tooltip />
prop="title"
show-overflow-tooltip
/>
<el-table-column
label="用户名"
prop="department"
show-overflow-tooltip
/>
<el-table-column <el-table-column
label="联系方式" label="联系方式"
prop="type_name" prop="phone"
show-overflow-tooltip
/>
<el-table-column
label="地址"
prop="type_name"
show-overflow-tooltip show-overflow-tooltip
/> />
<el-table-column label="地址" show-overflow-tooltip>
<template #default="{ row }">
<!-- <dict-value :options="dictData.show_status" :value="row.status" /> -->
{{
row.area_name +
row.street_name +
row.village_name +
row.brigade_name
}}
</template>
</el-table-column>
<el-table-column <el-table-column
label="所属生产队队长" label="所属生产队队长"
prop="type_name" prop="type_name"
@ -68,21 +67,17 @@
fixed="right" fixed="right"
> >
<template #default="{ row }"> <template #default="{ row }">
<el-button <el-button v-perms="['flow/edit']" type="primary" link>
v-perms="['flow/edit']" <router-link
type="primary" :to="{
link path: '/user/a',
@click="handleEdit(row)" query: {
> id: row.id,
编辑 },
</el-button> }"
<el-button >
v-perms="['flow/delete']" 详情
type="danger" </router-link>
link
@click="handleDelete(row.id)"
>
删除
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -106,6 +101,9 @@
import { usePaging } from "@/hooks/usePaging"; import { usePaging } from "@/hooks/usePaging";
import { useDictData } from "@/hooks/useDictOptions"; import { useDictData } from "@/hooks/useDictOptions";
import { apiCateLists, apiCateStatus } from "@/api/examined"; import { apiCateLists, apiCateStatus } from "@/api/examined";
import { fileManagelist, fileManageDetil } from "@/api/informationg";
import { getRoutePath } from "@/router";
import { timeFormat } from "@/utils/util"; import { timeFormat } from "@/utils/util";
import feedback from "@/utils/feedback"; import feedback from "@/utils/feedback";
// import { getRoutePath } from "router"; // import { getRoutePath } from "router";
@ -138,7 +136,7 @@ const { dictData } = useDictData("");
// //
const { pager, getLists, resetParams, resetPage } = usePaging({ const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiCateLists, fetchFun: fileManagelist,
params: queryParams, params: queryParams,
}); });
@ -158,11 +156,11 @@ const handleEdit = async (data: any) => {
}; };
// //
const handleDelete = async (id: number | any[]) => { // const handleDelete = async (id: number | any[]) => {
await feedback.confirm("确定要删除?"); // await feedback.confirm("");
await apiFlowTypeDelete({ id }); // await apiFlowTypeDelete({ id });
getLists(); // getLists();
}; // };
// //
const changeStatus = (row: any) => { const changeStatus = (row: any) => {
apiCateStatus({ id: row.id, status: row.status }); apiCateStatus({ id: row.id, status: row.status });

View File

@ -1,151 +1,163 @@
<template> <template>
<div class="menu-lists"> <div class="menu-lists">
<el-card class="!border-none" shadow="never"> <el-card class="!border-none" shadow="never">
<div> <div>
<el-button v-perms="['auth.menu/add']" type="primary" @click="handleAdd()"> <el-button
<template #icon> v-perms="['auth.menu/add']"
<icon name="el-icon-Plus" /> type="primary"
</template> @click="handleAdd()"
新增 >
</el-button> <template #icon>
<el-button @click="handleExpand"> 展开/折叠 </el-button> <icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button @click="handleExpand"> 展开/折叠 </el-button>
</div>
<el-table
ref="tableRef"
class="mt-4"
size="large"
v-loading="pager.loading"
:data="pager.lists"
row-key="id"
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
>
<el-table-column
label="菜单名称"
prop="name"
min-width="150"
show-overflow-tooltip
/>
<el-table-column label="类型" prop="type" min-width="80">
<template #default="{ row }">
<div v-if="row.type == MenuEnum.CATALOGUE">目录</div>
<div v-else-if="row.type == MenuEnum.MENU">菜单</div>
<div v-else-if="row.type == MenuEnum.BUTTON">按钮</div>
</template>
</el-table-column>
<el-table-column label="图标" prop="icon" min-width="80">
<template #default="{ row }">
<div class="flex">
<icon :name="row.icon" :size="20" />
</div> </div>
<el-table </template>
ref="tableRef" </el-table-column>
class="mt-4" <el-table-column
size="large" label="权限标识"
v-loading="pager.loading" prop="perms"
:data="pager.lists" min-width="150"
row-key="id" show-overflow-tooltip
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }" />
<el-table-column label="状态" prop="is_disable" min-width="100">
<template #default="{ row }">
<el-tag v-if="row.is_disable == 0">正常</el-tag>
<el-tag v-else type="danger">停用</el-tag>
</template>
</el-table-column>
<el-table-column label="排序" prop="sort" min-width="100" />
<el-table-column
label="更新时间"
prop="update_time"
min-width="180"
></el-table-column>
<el-table-column label="操作" width="160" fixed="right">
<template #default="{ row }">
<el-button
v-if="row.type !== MenuEnum.BUTTON"
v-perms="['auth.menu/add']"
type="primary"
link
@click="handleAdd(row.id)"
> >
<el-table-column 新增
label="菜单名称" </el-button>
prop="name" <el-button
min-width="150" v-perms="['auth.menu/edit']"
show-overflow-tooltip type="primary"
/> link
<el-table-column label="类型" prop="type" min-width="80"> @click="handleEdit(row)"
<template #default="{ row }"> >
<div v-if="row.type == MenuEnum.CATALOGUE">目录</div> 编辑
<div v-else-if="row.type == MenuEnum.MENU">菜单</div> </el-button>
<div v-else-if="row.type == MenuEnum.BUTTON">按钮</div> <el-button
</template> v-perms="['auth.menu/delete']"
</el-table-column> type="danger"
<el-table-column label="图标" prop="icon" min-width="80"> link
<template #default="{ row }"> @click="handleDelete(row.id)"
<div class="flex"> >
<icon :name="row.icon" :size="20" /> 删除
</div> </el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column </el-table>
label="权限标识" </el-card>
prop="perms" <edit-popup
min-width="150" v-if="showEdit"
show-overflow-tooltip ref="editRef"
/> @success="getLists"
<el-table-column label="状态" prop="is_disable" min-width="100"> @close="showEdit = false"
<template #default="{ row }"> />
<el-tag v-if="row.is_disable == 0">正常</el-tag> </div>
<el-tag v-else type="danger">停用</el-tag>
</template>
</el-table-column>
<el-table-column label="排序" prop="sort" min-width="100" />
<el-table-column
label="更新时间"
prop="update_time"
min-width="180"
></el-table-column>
<el-table-column label="操作" width="160" fixed="right">
<template #default="{ row }">
<el-button
v-if="row.type !== MenuEnum.BUTTON"
v-perms="['auth.menu/add']"
type="primary"
link
@click="handleAdd(row.id)"
>
新增
</el-button>
<el-button
v-perms="['auth.menu/edit']"
type="primary"
link
@click="handleEdit(row)"
>
编辑
</el-button>
<el-button
v-perms="['auth.menu/delete']"
type="danger"
link
@click="handleDelete(row.id)"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<edit-popup v-if="showEdit" ref="editRef" @success="getLists" @close="showEdit = false" />
</div>
</template> </template>
<script lang="ts" setup name="menu"> <script lang="ts" setup name="menu">
import { menuDelete, menuLists } from '@/api/perms/menu' import { menuDelete, menuLists } from "@/api/perms/menu";
import type { ElTable } from 'element-plus' import type { ElTable } from "element-plus";
import { usePaging } from '@/hooks/usePaging' import { usePaging } from "@/hooks/usePaging";
import { MenuEnum } from '@/enums/appEnums' import { MenuEnum } from "@/enums/appEnums";
import EditPopup from './edit.vue' import EditPopup from "./edit.vue";
import feedback from '@/utils/feedback' import feedback from "@/utils/feedback";
const tableRef = shallowRef<InstanceType<typeof ElTable>>() const tableRef = shallowRef<InstanceType<typeof ElTable>>();
const editRef = shallowRef<InstanceType<typeof EditPopup>>() const editRef = shallowRef<InstanceType<typeof EditPopup>>();
let isExpand = false let isExpand = false;
const showEdit = ref(false) const showEdit = ref(false);
const { pager, getLists } = usePaging({ const { pager, getLists } = usePaging({
fetchFun: menuLists, fetchFun: menuLists,
params: { params: {
page_type: 0 page_type: 0,
} },
}) });
const handleAdd = async (id?: number) => { const handleAdd = async (id?: number) => {
showEdit.value = true showEdit.value = true;
await nextTick() await nextTick();
if (id) { if (id) {
editRef.value?.setFormData({ editRef.value?.setFormData({
pid: id pid: id,
}) });
} }
editRef.value?.open('add') editRef.value?.open("add");
} };
const handleEdit = async (data: any) => { const handleEdit = async (data: any) => {
showEdit.value = true showEdit.value = true;
await nextTick() await nextTick();
editRef.value?.open('edit') editRef.value?.open("edit");
editRef.value?.getDetail(data) editRef.value?.getDetail(data);
} };
const handleDelete = async (id: number) => { const handleDelete = async (id: number) => {
await feedback.confirm('确定要删除?') await feedback.confirm("确定要删除?");
await menuDelete({ id }) await menuDelete({ id });
getLists() getLists();
} };
const handleExpand = () => { const handleExpand = () => {
isExpand = !isExpand isExpand = !isExpand;
toggleExpand(pager.lists, isExpand) toggleExpand(pager.lists, isExpand);
} };
const toggleExpand = (children: any[], unfold = true) => { const toggleExpand = (children: any[], unfold = true) => {
for (const key in children) { for (const key in children) {
tableRef.value?.toggleRowExpansion(children[key], unfold) tableRef.value?.toggleRowExpansion(children[key], unfold);
if (children[key].children) { if (children[key].children) {
toggleExpand(children[key].children!, unfold) toggleExpand(children[key].children!, unfold);
}
} }
} }
};
getLists() getLists().then((res) => {
console.log(res);
});
console.log(556666666666665);
</script> </script>

View File

@ -1,36 +1,49 @@
<template> <template>
<div> <div>
<el-card class="!border-none" v-loading="loading" shadow="never"> <el-card class="!border-none" v-loading="loading" shadow="never">
<el-button v-perms="['flow_type/add']" type="primary" @click="handleAdd"> <el-button v-perms="['flow_type/add']" type="primary" @click="handleAdd">
<template #icon> <template #icon>
<icon name="el-icon-Plus" /> <icon name="el-icon-Plus" />
</template> </template>
新增 新增
</el-button> </el-button>
<div class="mt-4"> <div class="mt-4">
<el-calendar v-model="dateValue" > <el-calendar v-model="dateValue">
<template #dateCell="{ data }"> <template #dateCell="{ data }">
<div style="width: 100%;height: 100%;" @click="test(data)"> <div style="width: 100%; height: 100%" @click="test(data)">
<p :class="data.isSelected ? 'is-selected' : ''"> <p :class="data.isSelected ? 'is-selected' : ''">
{{ data.day.split('-').slice(1).join('-') }} {{ data.day.split("-").slice(1).join("-") }}
<!-- {{ data.isSelected ? '✔️' : '' }} --> <!-- {{ data.isSelected ? '✔️' : '' }} -->
</p> </p>
<div class="task" :class="{'fou': item.priority==4,'tow':item.priority==2,'the':item.priority==3}" <div
v-if="taskList[data.day]" class="task"
v-for="(item, index) in taskList[data.day]" :class="{
:key="index" fou: item.priority == 4,
> tow: item.priority == 2,
{{ item.title }} the: item.priority == 3,
</div> }"
</div> v-if="taskList[data.day]"
<!-- <div class="task" style="color: var(--el-color-primary);">完成BUG测试</div> v-for="(item, index) in taskList[data.day]"
<div class="task" style="color: var(--el-color-danger);">完成BUG测试</div> --> :key="index"
</template> >
</el-calendar> {{ item.title }}
</div>
</div> </div>
</el-card> <!-- <div class="task" style="color: var(--el-color-primary);">完成BUG测试</div>
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" :dateValue="dateValue" @success="loadTask" @close="showEdit = false" /> <div class="task" style="color: var(--el-color-danger);">完成BUG测试</div> -->
</div> </template>
</el-calendar>
</div>
</el-card>
<edit-popup
v-if="showEdit"
ref="editRef"
:dict-data="dictData"
:dateValue="dateValue"
@success="loadTask"
@close="showEdit = false"
/>
</div>
</template> </template>
<script lang="ts" setup name="task"> <script lang="ts" setup name="task">
@ -45,17 +58,16 @@ import { reactive, watch } from "vue";
const dateValue = ref(new Date()); const dateValue = ref(new Date());
watch( watch(
() => dateValue, () => dateValue,
(newValue, oldValue) => { (newValue, oldValue) => {
initShowDate(timeFormat(newValue.value.getTime())) initShowDate(timeFormat(newValue.value.getTime()));
},{deep: true} },
{ deep: true }
); );
const test = (e: any) => {
const test = (e:any)=>{ console.log(e);
console.log(e); };
}
// //
const loading = ref(true); const loading = ref(true);
@ -66,70 +78,72 @@ const showEdit = ref(false);
// //
const queryParams = reactive({ const queryParams = reactive({
start_time: "", start_time: "",
end_time: "", end_time: "",
day: 1, day: 1,
page_no: 1, page_no: 1,
pageSize: 150 pageSize: 150,
}); });
const taskList = ref<any>([]) const taskList = ref<any>([]);
// //
const loadTask = async ()=>{ const loadTask = async () => {
let res:any = await apiTaskIndex(queryParams); let res: any = await apiTaskIndex(queryParams);
taskList.value = res.lists; taskList.value = res.lists;
// console.log(taskList.value); // console.log(taskList.value);
loading.value = false; loading.value = false;
} };
const start_date = ref("");
const end_date = ref("");
const start_date = ref('');
const end_date = ref('');
// //
const initShowDate = (dateStr='')=>{ const initShowDate = (dateStr = "") => {
const currentDate = dateStr ? new Date(dateStr): new Date(); const currentDate = dateStr ? new Date(dateStr) : new Date();
const currentYear = currentDate.getFullYear(); const currentYear = currentDate.getFullYear();
const currentMonth = currentDate.getMonth(); const currentMonth = currentDate.getMonth();
const lastDay = new Date(currentYear, currentMonth + 1, 0).getDay();// const lastDay = new Date(currentYear, currentMonth + 1, 0).getDay(); //
const startDay = new Date(currentYear, currentMonth, 1).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-startDay).getDate());
// console.log(new Date(currentYear, currentMonth + 1, 6-lastDay).getDate()); // console.log(new Date(currentYear, currentMonth + 1, 6-lastDay).getDate());
start_date.value = timeFormat(new Date(currentYear, currentMonth, 1-startDay).getTime());// start_date.value = timeFormat(
end_date.value = timeFormat(new Date(currentYear, currentMonth + 1, 6-lastDay).getTime());// new Date(currentYear, currentMonth, 1 - startDay).getTime()
if(queryParams.start_time!=start_date.value){ ); //
queryParams.start_time = start_date.value; end_date.value = timeFormat(
queryParams.end_time = end_date.value; new Date(currentYear, currentMonth + 1, 6 - lastDay).getTime()
loading.value = true; ); //
loadTask(); if (queryParams.start_time != start_date.value) {
} queryParams.start_time = start_date.value;
} queryParams.end_time = end_date.value;
initShowDate() loading.value = true;
loadTask();
}
};
initShowDate();
// //
const { dictData } = useDictData(""); const { dictData } = useDictData("");
// //
const handleAdd = async () => { const handleAdd = async () => {
showEdit.value = true; showEdit.value = true;
await nextTick(); await nextTick();
editRef.value?.open("add"); editRef.value?.open("add");
}; };
// //
const handleEdit = async (data: any) => { const handleEdit = async (data: any) => {
showEdit.value = true; showEdit.value = true;
await nextTick(); await nextTick();
editRef.value?.open("edit"); editRef.value?.open("edit");
editRef.value?.setFormData(data); editRef.value?.setFormData(data);
}; };
// //
const handleDelete = async (id: number | any[]) => { const handleDelete = async (id: number | any[]) => {
await feedback.confirm("确定要删除?"); await feedback.confirm("确定要删除?");
await apiFlowTypeDelete({ id }); await apiFlowTypeDelete({ id });
getLists(); getLists();
}; };
// getLists(); // getLists();
@ -137,25 +151,25 @@ const handleDelete = async (id: number | any[]) => {
<style lang="scss"> <style lang="scss">
.is-selected { .is-selected {
color: #1989fa; color: #1989fa;
} }
.el-calendar-table .el-calendar-day{ .el-calendar-table .el-calendar-day {
height: 6.2rem; height: 6.2rem;
} }
.task{ .task {
font-size: 0.8rem; font-size: 0.8rem;
color: #F7BA2A; color: #f7ba2a;
white-space: nowrap; /* 设置文本不换行 */ white-space: nowrap; /* 设置文本不换行 */
overflow: hidden; /* 隐藏溢出的部分 */ overflow: hidden; /* 隐藏溢出的部分 */
text-overflow: ellipsis; /* 在溢出的部分显示省略号 */ text-overflow: ellipsis; /* 在溢出的部分显示省略号 */
} }
.the{ .the {
color: #ff5100; color: #ff5100;
} }
.tow{ .tow {
color: #f38200; color: #f38200;
} }
.fou{ .fou {
color: red; color: red;
} }
</style> </style>