This commit is contained in:
jia 2023-11-20 18:26:55 +08:00
parent e955235279
commit 32e23441f3
36 changed files with 10255 additions and 0 deletions

View File

@ -0,0 +1,188 @@
<template>
<div>
<el-card class="!border-none mt-4" shadow="never">
<el-table size="large" v-loading="pager.loading" :data="pager.lists">
<!-- <el-table-column label="ID" prop="id" min-width="100" /> -->
<!-- <el-table-column label="用户编号" prop="sn" min-width="120" /> -->
<el-table-column label="头像" min-width="100">
<template #default="{ row }">
<el-avatar :src="row.avatar" :size="50" />
</template>
</el-table-column>
<el-table-column label="账号" prop="phone" min-width="120" />
<el-table-column label="姓名" prop="nickname" min-width="100" />
<el-table-column label="联系方式" prop="phone" min-width="120" />
<!-- <el-table-column label="隶属公司" prop="company_name" min-width="180" align="center">
<template #default="{ row }">
{{ row.company?.company_name || '/' }}
</template>
</el-table-column> -->
<!-- <el-table-column label="所在乡镇" prop="street_name" min-width="120" /> -->
<!-- <el-table-column label="授权身份" prop="role_name" min-width="120">
<template #default="{ row }">
<span v-if="row.admin_id == row.company?.admin_id" style="color: #67c23a">公司后台管理人员</span>
<span v-else style="color: #fe0000"></span>
</template>
</el-table-column> -->
<!-- <el-table-column label="是否签约" prop="is_contract" align="center" min-width="120">
<template #default="{ row }">
<span v-if="row.is_contract == 1" style="color: #67c23a">已签约</span>
<span v-else style="color: #fe0000">未签约</span>
</template>
</el-table-column> -->
<el-table-column label="操作" min-width="200" align="center" fixed="right">
<template #default="{ row }">
<el-button v-perms="['user.user/detail']" type="primary" link>
<router-link :to="{
path: getRoutePath('company/userdetail'),
query: {
id: row.id
}
}">
详情
</router-link>
</el-button>
<template v-if="row.is_contract == 0">
<el-button v-perms="['user.user/launch']" type="primary" link v-if="!row.contract">
<router-link :to="{
path: getRoutePath('user.user/detail'),
query: {
id: row.id,
mode: 'initiate'
}
}">
生成合同
</router-link>
</el-button>
<el-button v-perms="['user.user/uplode']" type="primary" link v-if="row.contract?.check_status == 1">
<router-link :to="{
path: getRoutePath('user.user/detail'),
query: {
id: row.id,
mode: 'uplode',
mdoeid: row.contract.id
}
}">
上传合同
</router-link>
</el-button>
<el-button v-perms="['user.user/launch']" type="primary" v-if="row.contract?.check_status == 2" link @click="
;(showPop = true),
(showConctactPop = true),
(contractId = row.id)
">发送合同</el-button>
<el-button v-if="row.is_contract == 0 && row.contract?.check_status == 3" v-perms="['user.user/launch']" type="primary" link @click=";(showPop = true), (contractId = row.id)">重新发送短信</el-button>
</template>
</template>
</el-table-column>
</el-table>
<el-dialog v-model="showPop" @close="offPop">
<h1>重要提醒</h1>
<div class="content" v-if="showConctactPop">
请确认信息是否有误,发送合同,请确认信息是否有误,发送电子合同后短时间内将不可再次发送.
</div>
<div class="content" v-else>
确认签约短信将在60秒后发送,请注意查收,并点击短信链接进行线上合同签约
</div>
<p class="btn_menu">
<el-button type="primary" size="large" v-if="showConctactPop" @click="creContct">确认创建</el-button>
<el-button type="primary" size="large" v-else @click="sendMsg">确认</el-button>
<el-button type="info" size="large" @click="offPop">返回</el-button>
</p>
</el-dialog>
<div class="flex justify-end mt-4">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
</div>
</template>
<script lang="ts" setup name="consumerLists">
import { usePaging } from "@/hooks/usePaging";
import { getRoutePath } from "@/router";
import { getUserList, creatContact, sendMsgApi } from "@/api/consumer";
import {companyUserLists}from "@/api/company";
import { ClientMap } from "@/enums/appEnums";
import feedback from "@/utils/feedback";
const route = useRoute();
const queryParams = reactive({
phone: "",
nickname: "",
status: "",
});
if (route.query.company_id) {
queryParams.company_id = route.query.company_id;
}
const contractId = ref(0);
const showPop = ref(false);
const showConctactPop = ref(false);
const offPop = () => {
showPop.value = false;
showConctactPop.value = false;
};
const creContct = () => {
console.log(contractId.value);
// feedback.msgSuccess("");
creatContact({ id: contractId.value }).then(() => {
feedback.msgSuccess("发送成功");
});
offPop();
};
const sendMsg = () => {
sendMsgApi({ id: contractId.value }).then((res) => {
feedback.msgSuccess("发送成功");
});
offPop();
};
// const handleDelete = async (id: number) => {
// await feedback.confirm('')
// await adminDelete({ id })
// getLists()
// }
// const handleAbolition = async (id: number) => {
// await feedback.confirm('')
// await abolition({ id })
// getLists()
// }
const { pager, getLists, resetPage, resetParams } = usePaging({
fetchFun:companyUserLists,
params: queryParams,
});
onActivated(() => {
getLists();
});
getLists();
</script>
<style scoped>
h1 {
text-align: center;
font-weight: bold;
font-size: 30px;
color: red;
margin-bottom: 10px;
}
.content {
font-size: 20px;
}
.info {
color: red;
font-weight: bold;
font-size: 18px;
display: inline-block;
margin: 0 5px;
}
.btn_menu {
margin-top: 10vh;
display: flex;
justify-content: space-around;
}
</style>

View File

@ -0,0 +1,158 @@
<template>
<div class="edit-popup">
<popup
ref="popupRef"
:title="popupTitle"
:async="true"
width="500px"
@confirm="handleSubmit"
@close="handleClose"
>
<el-form
ref="formRef"
:model="formData"
label-width="100px"
:rules="formRules"
>
<el-form-item label="模板" prop="template_id">
<el-select v-model="formData.template_id" clearable placeholder="请输入任务类型" >
<el-option
v-for="item in datalist"
:key="item.label"
:value="item.id"
:label="item.name"
/>
</el-select>
</el-form-item>
<el-form-item label="公司" prop="company_id">
<el-input
@click="openCompany"
v-model="formData.company_name"
clearable
placeholder="请输入公司"
/>
</el-form-item>
<el-form-item label="下发公司类型" prop="type">
<el-input
v-model="formData.type"
clearable
placeholder="请输入下发公司类型"
/>
</el-form-item>
<el-form-item label="状态" prop="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>
</popup>
<el-dialog v-model="isCompany" title="选择签约方" width="60%">
<DialogIndex @customEvent="customEvent" :type="indexType" />
</el-dialog>
</div>
</template>
<script lang="ts" setup name="taskSchedulingEdit">
// <el-input v-model="formData.status" clearable placeholder="" />
import type { FormInstance } from "element-plus";
import Popup from "@/components/popup/index.vue";
import {
apiTaskSchedulingAdd,
apiTaskSchedulingEdit,
apiTaskSchedulingDetail,
} from "@/api/task_scheduling";
import { timeFormat } from "@/utils/util";
import type { PropType } from "vue";
import DialogIndex from "./dialog_index.vue";
import { dictDataLists } from "@/api/setting/dict";
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 isCompany = ref(false);
const datalist=ref([])
//
const popupTitle = computed(() => {
return mode.value == "edit" ? "编辑任务公司排期" : "新增任务公司排期";
});
function openCompany() {
isCompany.value = true;
}
function customEvent(data: any) {
isCompany.value = false;
formData.company_id = data.id;
formData.company_name = data.company_name;
}
dictDataLists({ type_id: 10 }).then((res) => {
datalist.value = res.lists;
});
//
const formData = reactive({
id: "",
template_id: "",
company_id: "",
company_name: "",
type: "",
status: "",
});
//
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 apiTaskSchedulingDetail({
id: row.id,
});
setFormData(data);
};
//
const handleSubmit = async () => {
await formRef.value?.validate();
const data = { ...formData };
mode.value == "edit"
? await apiTaskSchedulingEdit(data)
: await apiTaskSchedulingAdd(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,241 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form
class="mb-[-16px] formtabel"
:model="queryParams"
inline
label-width="100px"
>
<el-form-item label="区域经理" prop="create_user_id">
<el-input
class="w-[280px]"
v-model="queryParams.create_user_id"
clearable
placeholder="请输入区域经理"
/>
</el-form-item>
<el-form-item label="公司" prop="company_id">
<el-input
class="w-[280px]"
v-model="queryParams.company_id"
clearable
placeholder="请输入公司"
/>
</el-form-item>
<el-form-item>
<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_scheduling.task_scheduling/add']"
type="primary"
@click="handleAdd"
>
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button> -->
<!--
<el-button
v-perms="['task_scheduling.task_scheduling/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="admin_name"
show-overflow-tooltip
/>
<el-table-column
label="公司"
prop="company_name"
show-overflow-tooltip
/>
<el-table-column
label="每日最大金额"
prop="money"
show-overflow-tooltip
/>
<el-table-column
label="公司类型"
prop="company_type_name"
show-overflow-tooltip
/>
<el-table-column
label="状态"
min-width="100"
v-perms="['task_scheduling.task_scheduling/edit']"
>
<template #default="{ row }">
<el-switch
v-model="row.status"
:active-value="1"
:inactive-value="0"
@change="changeStatus(row)"
/>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right">
<template #default="{ row }">
<el-button
v-perms="['task.task_calendar']"
@click="moneyAdd(row)"
type="primary"
link
>
金额
</el-button>
<el-button
v-perms="['task_template.task_template/lists']"
type="primary"
link
>
<router-link
:to="{
path: getRoutePath('task_template.task_template/lists'),
query: {
id: row.id,
company_id: row.company_id,
company_type: row.dict_company_type,
},
}"
>任务安排</router-link
>
</el-button>
<el-button v-perms="['task.task_calendar']" type="primary" link>
<router-link
:to="{
path: getRoutePath('task.task_calendar'),
query: {
id: row.id,
company_id: row.company_id,
},
}"
>任务日程</router-link
>
</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div class="flex mt-4 justify-end">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
<edit-popup
v-if="showEdit"
ref="editRef"
:dict-data="dictData"
@success="getLists"
@close="showEdit = false"
/>
<money
ref="moneyRef"
v-if="moneyShow"
@success="getLists"
@close="moneyShow = false"
></money>
</div>
</template>
<script lang="ts" setup name="taskSchedulingLists">
import { usePaging } from "@/hooks/usePaging";
import { useDictData } from "@/hooks/useDictOptions";
import {
apiTaskSchedulingLists,
apiTaskSchedulingEdit,
} from "@/api/task_scheduling";
import { timeFormat } from "@/utils/util";
import feedback from "@/utils/feedback";
import EditPopup from "./edit.vue";
import { dictDataLists } from "@/api/setting/dict";
import { getRoutePath } from "@/router";
import money from "./money.vue";
const datalist = ref([]);
const editRef = shallowRef<InstanceType<typeof EditPopup>>();
const moneyRef = shallowRef<InstanceType<typeof money>>();
//
const showEdit = ref(false);
//
const moneyShow = ref(false);
//
const queryParams = reactive({
create_user_id: "",
template_id: "",
company_id: "",
type: "",
status: "",
});
//
const selectData = ref<any[]>([]);
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id);
};
//
const { dictData } = useDictData("");
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiTaskSchedulingLists,
params: queryParams,
});
//
const handleAdd = async () => {
showEdit.value = true;
await nextTick();
editRef.value?.open("add");
};
//
const moneyAdd = async (obj: any) => {
moneyShow.value = true;
await nextTick();
moneyRef.value?.open(obj.money ? "edit" : "add");
moneyRef.value?.setFormData(obj);
};
const changeStatus = (data: any) => {
apiTaskSchedulingEdit({
id: data.id,
status: data.status,
}).finally(() => {
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: 100px;
}
}
}
</style>

View File

@ -0,0 +1,94 @@
<template>
<div class="edit-popup">
<popup
ref="popupRef"
:title="popupTitle"
:async="true"
width="500px"
@confirm="handleSubmit"
@close="handleClose"
>
<el-form ref="formRef" :model="formData" :rules="formRules">
<el-form-item label="金额" prop="money">
<el-input
v-model="formData.money"
type="number"
clearable
placeholder="请输入公司每天最多的金额"
>
<template #append></template>
</el-input>
</el-form-item>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="taskSchedulingEdit">
import type { FormInstance } from "element-plus";
import Popup from "@/components/popup/index.vue";
import {
apiTaskSchedulingAdd,
apiTaskSchedulingEdit,
apiTaskSchedulingEditMoney,
} from "@/api/task_scheduling";
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: "",
money: "",
});
const setFormData = (e) => {
Object.keys(formData).forEach((key) => {
if (e[key] != null && e[key] != undefined) {
formData[key] = e[key];
}
});
};
//
const formRules = reactive<any>({
money: {
required: true,
message: "请输入正确金额",
trigger: "change",
},
});
//
const handleSubmit = async () => {
await formRef.value?.validate();
const data = { ...formData };
await apiTaskSchedulingEditMoney(data);
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,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

@ -0,0 +1,109 @@
<template>
<div>
<!-- <el-card class="!border-none" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="负责人名称" prop="name">
<el-input
class="w-[280px]"
v-model="queryParams.nickname"
clearable
placeholder="请输入负责人名称"
/>
</el-form-item>
<el-form-item label="请选择负责人角色" prop="role_id">
<el-select class="w-[280px]" v-model="queryParams.role_id">
<el-option label="全部" value />
<el-option
v-for="(item, index) in optionsData.role"
:key="index"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button>
</el-form-item>
</el-form>
</el-card> -->
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
<div class="mt-4">
<el-table :data="pager.lists" @cell-click="handleCurrentChange">
<el-table-column label="账号" prop="account" min-width="120" />
<el-table-column label="头像" prop="avatar" min-width="80">
<template #default="{ row }">
<img style="width: 50px; height: 50px" :src="row.avatar" />
</template>
</el-table-column>
<el-table-column label="名称" prop="nickname" min-width="100" />
<el-table-column
label="电话"
prop="mobile"
min-width="140"
show-tooltip-when-overflow
/>
<el-table-column
label="公司"
prop="company.company_name"
min-width="160"
show-tooltip-when-overflow
/>
<!-- <el-table-column
label="最近登录时间"
prop="login_time"
min-width="180"
/>
<el-table-column label="最近登录IP" prop="login_ip" min-width="120" /> -->
</el-table>
</div>
<div class="flex mt-4 justify-end">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
</div>
</template>
<script lang="ts" setup name="companyLists">
import { usePaging } from "@/hooks/usePaging";
import { roleAll } from "@/api/perms/role";
import { useDictData, useDictOptions } from "@/hooks/useDictOptions";
import { adminLists } from "@/api/perms/admin";
import Popup from "@/components/popup/index.vue";
import { defineEmits } from "vue";
import { getUserList } from "@/api/user";
const { optionsData } = useDictOptions<{
role: any[];
}>({
role: {
api: roleAll,
},
});
//
const queryParams = reactive({
company_id: "",
});
const props = defineProps({
company_id: {
type: String || Number,
defaults: 0,
},
});
queryParams.company_id = props.company_id;
//
const emits = defineEmits(["customEvent"]);
//
const handleCurrentChange = (value: any) => {
emits("customEvent", value);
};
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: getUserList,
params: queryParams,
});
getLists();
</script>

View File

@ -0,0 +1,478 @@
<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"
/>
</el-select>
</el-form-item>
<!-- <el-form-item
v-if="formData.type == 32"
label="起点"
@click="changeMap(0)"
prop="extend.origin.address"
>
<el-input
placeholder="请选择起点"
readonly
: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>
<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
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">
<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>
<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"
>
<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"
>
<template #append></template>
</el-input>
<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"
>
<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"
>
<template #append></template>
</el-input>
<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"
>
<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>
<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>
<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>
</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 { number } from "echarts/core";
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 popupTitle = computed(() => {
return mode.value == "edit" ? "编辑任务安排" : "新增任务安排";
});
//
const formData = reactive({
id: "",
task_scheduling: 0,
company_id: "",
title: "",
admin_id: "",
type: "",
status: "",
content: "",
stage_day_one: 0,
money: 0, //
stage_day_two: 0,
money_two: 0, //
money_three: 0, //
types: "", //
task_admin: "", //
task_admin_name: "", //
recharge: "",
extend: {
// origin: {
// address: "",
// lnglat: [],
// }, //
transfer: {
address: "",
lnglat: [],
}, //
terminus: {
address: "",
lnglat: [],
}, //
},
});
if (route.query.id) {
formData.task_scheduling = route.query.id;
}
//
apiTaskTypeList({ type_value: "task_type" }).then((res) => {
datalist.value = res.lists;
});
//
const formRules = reactive<any>({
title: [
{
required: true,
message: "请输入任务名称",
trigger: ["blur"],
},
],
admin_id: [
{
required: true,
message: "请输入创建人",
trigger: ["blur"],
},
],
type: [
{
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.origin.address": [
{
required: true,
message: "请选择中转点",
trigger: ["blur"],
},
],
"extend.transfer.address": [
{
required: true,
message: "请选择中转点",
trigger: ["blur"],
},
],
"extend.terminus.address": [
{
required: true,
message: "请选择终点",
trigger: ["blur"],
},
],
});
//
const setFormData = async (data: Record<any, any>) => {
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
formData[key] = data[key];
}
}
if (formData.type == 32) {
mapShow.value = true;
}
};
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;
});
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;
}
await nextTick();
mapRef.value?.open(map_title);
};
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 };
if (data.type != 32) data.extend = {}; // ,
mode.value == "edit"
? await apiTaskTemplateEdit(data)
: await apiTaskTemplateAdd(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,591 @@
<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="任务类型" prop="type">
<el-select
v-model="formData.type"
clearable
:disabled="mode != 'add'"
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
:disabled="mode != 'add'"
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>
</div>
</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"
>
<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 && 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="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"
>
<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>
<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">
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 dialogCommodity from "./dialog_commodity.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 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(() => {
return mode.value == "edit" ? "编辑任务安排" : "新增任务安排";
});
// ID, 使
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: "",
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: "", //
goods_id: "", //id
store_name: "", //
},
});
if (route.query.id) {
formData.task_scheduling = route.query.id;
}
//
// 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_4",
"town_task_type_marketing_director_3",
"town_task_type_marketing_director_2",
'town_task_type_master_3'
];
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 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"],
},
],
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"],
},
],
"extend.goods_id": [
{
required: true,
message: "请选择商品",
trigger: ["blur"],
},
],
});
//
const setFormData = async (data: Record<any, any>) => {
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
formData[key] = data[key];
}
}
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);
}
};
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;
console.log(item.value,9999)
// console.log(item.id, formData.type_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 == "edit") {
// apiTaskTypeList({ type_value: taskType.value }).then((res) => {
// datalist.value = res.lists;
// });
// }
};
//
const handleClose = () => {
emit("close");
};
defineExpose({
open,
setFormData,
getDetail,
});
</script>

View File

@ -0,0 +1,492 @@
<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="任务类型" prop="type">
<el-select
v-model="formData.type"
clearable
:disabled="mode != 'add'"
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
:disabled="mode != 'add'"
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>
</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";
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: "",
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 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"],
},
],
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>

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 mt-4 justify-end">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
<edit-admin-popup
v-if="showEdit && companyType == 41"
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,apiTaskTypeList
} 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();
};
//
apiTaskTypeList({ 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

@ -0,0 +1,138 @@
<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="">
<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">
<div class="mt-4">
<el-table :data="pager.lists" @cell-click="handleSelectionChange">
<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>
</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="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 { dictDataLists } from "@/api/setting/dict";
const editRef = shallowRef<InstanceType<typeof EditPopup>>();
const datalist = ref([]);
//
const showEdit = ref(false);
//
const queryParams = reactive({
title: "",
admin_id: "",
money: "",
type: "",
status: "",
content: "",
company_id: "",
});
const props = defineProps(["company_id"]);
if (props.company_id) queryParams.company_id = props.company_id;
const statusdata = reactive([
{ id: 1, name: "显示" },
{ id: 2, name: "隐藏" },
]);
//
const selectData = ref<any[]>([]);
const emits = defineEmits(["customEvent"]);
//
const handleSelectionChange = (value: any) => {
emits("customEvent", value);
// selectData.value = val.map(({ id }) => id)
};
//
const { dictData } = useDictData("");
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiTaskTemplateLists,
params: queryParams,
});
//
// 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

@ -0,0 +1,151 @@
<template>
<div class="edit-popup">
<popup
ref="popupRef"
:title="title"
:async="true"
width="550px"
@confirm="handleSubmit"
@close="handleClose"
>
<el-form>
<el-form-item label="">
<el-input
style="width: 300px; margin-right: 16px"
placeholder="请输入要搜索的地址"
v-model="searchText"
clearable
/>
<el-button type="primary" @click="serach()">搜索</el-button>
<el-button @click="resetMap()">重置</el-button>
</el-form-item>
<el-form-item label-width="80px" label="地图">
<MapContainer ref="mapRef" @changeMaps="changeMaps"></MapContainer>
</el-form-item>
<el-form-item label-width="80px" label="已选地点">
<el-input
style="width: 350px; margin-right: 16px"
placeholder="请点击上方地图选择地点"
readonly
:value="address[0]?.address"
/>
</el-form-item>
<!-- <el-form-item label-width="80px" label="起点">
<el-input
style="width: 350px; margin-right: 16px"
placeholder="请点击上方地图选择地点"
readonly
:value="address[0]?.address"
/>
</el-form-item>
<el-form-item label-width="80px" label="中转点">
<el-input
style="width: 350px; margin-right: 16px"
placeholder="请点击上方地图选择地点"
readonly
:value="address[1]?.address"
/>
</el-form-item>
<el-form-item label-width="80px" label="终点">
<el-input
style="width: 350px; margin-right: 16px"
placeholder="请点击上方地图选择地点"
readonly
:value="address[2]?.address"
/>
</el-form-item> -->
</el-form>
</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,
} from "@/api/task_template";
import { timeFormat } from "@/utils/util";
import type { PropType } from "vue";
import { dictDataLists } from "@/api/setting/dict";
import MapContainer from "@/components/map/MapContainer.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 datalist = ref([]);
const title = ref("");
//
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 apiTaskTemplateDetail({
id: row.id,
});
setFormData(data);
};
//
const mapRef = ref(null);
//
const resetMap = () => {
mapRef.value.resetMap();
};
//
const searchText = ref("");
const serach = () => {
mapRef.value.searchMap(searchText.value);
};
const address = ref([]);
const changeMaps = (e: any) => {
address.value = JSON.parse(JSON.stringify(e));
// console.log("", e);
};
//
const handleSubmit = async () => {
// if (address.value.length < 3) return ElMessage.error("");
if (address.value.length < 1) return ElMessage.error("请先选择地点");
popupRef.value?.close();
emit("success", address.value);
};
//
const open = async (type = "地点") => {
title.value = "选择" + type;
popupRef.value?.open();
await nextTick();
resetMap();
};
//
const handleClose = () => {
emit("close");
};
defineExpose({
open,
setFormData,
getDetail,
});
</script>

View File

@ -0,0 +1,136 @@
<template>
<el-card style="margin-top: 16px">
<el-form
ref="elForm"
:disabled="true"
:model="formData"
size="mini"
label-width="180px"
>
<div class="tit">
寿宴
<span class="time">更新于:{{ update_time }}</span>
</div>
<el-row>
<el-col :span="8">
<el-form-item label="时间" prop="start_date">
<el-input
v-model="datas.datas.start_date"
clearable
type="textarea"
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="地点" prop="address">
<el-input
v-model="datas.datas.address"
clearable
type="textarea"
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="人数" prop="people_count">
<el-input
v-model="datas.datas.people_count"
clearable
type="textarea"
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="请包办" prop="serve">
<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>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无歌舞表演" prop="perform">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无交通工具" prop="vehicle">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无住宿" prop="in_hotel">
<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>
</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>
<script setup lang='ts'>
const props = defineProps({
datas: {
type: Object,
defualt: function () {
return {
start_date: "", //\
address: "", //
people_count: "", //
serve: "", //
perform: "", //
vehicle: "", //
in_hotel: "", //宿
};
},
},
update_time: {
type: String,
defualt: "",
},
});
</script>
<style scoped lang='scss'>
.tit {
font-size: 1.2rem;
translate: 1vw -1vw;
background-color: white;
margin: 2vh 0 0 0;
.time {
display: inline-block;
font-size: 0.8rem;
margin-left: 1vw;
color: #999;
}
}
</style>

View File

@ -0,0 +1,136 @@
<template>
<el-card style="margin-top: 16px">
<el-form
ref="elForm"
:disabled="true"
:model="formData"
size="mini"
label-width="180px"
>
<div class="tit">
满月酒
<span class="time">更新于:{{ update_time }}</span>
</div>
<el-row>
<el-col :span="8">
<el-form-item label="时间" prop="start_date">
<el-input
v-model="datas.datas.start_date"
clearable
type="textarea"
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="地点" prop="address">
<el-input
v-model="datas.datas.address"
clearable
type="textarea"
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="人数" prop="people_count">
<el-input
v-model="datas.datas.people_count"
clearable
type="textarea"
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="请包办" prop="serve">
<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>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无歌舞表演" prop="perform">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无交通工具" prop="vehicle">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无住宿" prop="in_hotel">
<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>
</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>
<script setup lang='ts'>
const props = defineProps({
datas: {
type: Object,
defualt: function () {
return {
start_date: "", //\
address: "", //
people_count: "", //
serve: "", //
perform: "", //
vehicle: "", //
in_hotel: "", //宿
};
},
},
update_time: {
type: String,
defualt: "",
},
});
</script>
<style scoped lang='scss'>
.tit {
font-size: 1.2rem;
translate: 1vw -1vw;
background-color: white;
margin: 2vh 0 0 0;
.time {
display: inline-block;
font-size: 0.8rem;
margin-left: 1vw;
color: #999;
}
}
</style>

View File

@ -0,0 +1,142 @@
<template>
<el-card style="margin-top: 16px">
<el-form
ref="elForm"
:disabled="true"
:model="formData"
size="mini"
label-width="180px"
>
<div class="tit">
白事
<span class="time">更新于:{{ update_time }}</span>
</div>
<el-row>
<el-col :span="8">
<el-form-item label="地点" prop="address">
<el-input
v-model="datas.datas.address"
clearable
type="textarea"
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="人数" prop="people_count">
<el-input
v-model="datas.datas.people_count"
clearable
type="textarea"
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="请包办" prop="serve">
<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>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无歌舞表演" prop="perform">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无主持仪式" prop="host">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无交通工具" prop="vehicle">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无住宿" prop="in_hotel">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无墓地" prop="graveyard">
<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>
</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>
<script setup lang='ts'>
const props = defineProps({
datas: {
type: Object,
defualt: function () {
return {
address: "", //
people_count: "", //
serve: "", //
perform: "", //
host: "", //
vehicle: "", //
in_hotel: "", //宿
graveyard: "", //
};
},
},
update_time: {
type: String,
defualt: "",
},
});
</script>
<style scoped lang='scss'>
.tit {
font-size: 1.2rem;
translate: 1vw -1vw;
background-color: white;
margin: 2vh 0 0 0;
.time {
display: inline-block;
font-size: 0.8rem;
margin-left: 1vw;
color: #999;
}
}
</style>

View File

@ -0,0 +1,145 @@
<template>
<el-card style="margin-top: 16px">
<el-form
ref="elForm"
:disabled="true"
:model="formData"
size="mini"
label-width="180px"
>
<div class="tit">
婚宴
<span class="time">更新于:{{ update_time }}</span>
</div>
<el-row>
<el-col :span="8">
<el-form-item label="时间" prop="start_date">
<el-input
v-model="datas.datas.start_date"
clearable
type="textarea"
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="地点" prop="address">
<el-input
v-model="datas.datas.address"
clearable
type="textarea"
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="人数" prop="people_count">
<el-input
v-model="datas.datas.people_count"
clearable
type="textarea"
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="请包办" prop="serve">
<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>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无歌舞表演" prop="perform">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无主持仪式" prop="host">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无交通工具" prop="vehicle">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无住宿" prop="in_hotel">
<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>
</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>
<script setup lang='ts'>
const props = defineProps({
datas: {
type: Object,
defualt: function () {
return {
start_date: "", //\
address: "", //
people_count: "", //
serve: "", //
perform: "", //
host: "", //
vehicle: "", //
in_hotel: "", //宿
};
},
},
update_time: {
type: String,
defualt: "",
},
});
</script>
<style scoped lang='scss'>
.tit {
font-size: 1.2rem;
translate: 1vw -1vw;
background-color: white;
margin: 2vh 0 0 0;
.time {
display: inline-block;
font-size: 0.8rem;
margin-left: 1vw;
color: #999;
}
}
</style>

View File

@ -0,0 +1,149 @@
<template>
<el-card style="margin-top: 16px">
<el-form
ref="elForm"
:disabled="true"
:model="formData"
size="mini"
label-width="180px"
>
<div class="tit">
其他庆祝宴
<span class="time">更新于:{{ update_time }}</span>
</div>
<el-row>
<el-col :span="8">
<el-form-item label="宴席类型" prop="types">
<el-input
v-model="datas.types"
clearable
type="textarea"
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="时间" prop="start_date">
<el-input
v-model="datas.datas.start_date"
clearable
type="textarea"
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="地点" prop="address">
<el-input
v-model="datas.datas.address"
clearable
type="textarea"
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="人数" prop="people_count">
<el-input
v-model="datas.datas.people_count"
clearable
type="textarea"
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="请包办" prop="serve">
<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>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无歌舞表演" prop="perform">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无交通工具" prop="vehicle">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无住宿" prop="in_hotel">
<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>
</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>
<script setup lang='ts'>
const props = defineProps({
datas: {
type: Object,
defualt: function () {
return {
types: "", //
start_date: "", //\
address: "", //
people_count: "", //
serve: "", //
perform: "", //
vehicle: "", //
in_hotel: "", //宿
};
},
},
update_time: {
type: String,
defualt: "",
},
});
</script>
<style scoped lang='scss'>
.tit {
font-size: 1.2rem;
translate: 1vw -1vw;
background-color: white;
margin: 2vh 0 0 0;
.time {
display: inline-block;
font-size: 0.8rem;
margin-left: 1vw;
color: #999;
}
}
</style>

View File

@ -0,0 +1,276 @@
<template>
<el-card style="margin-top: 16px">
<el-form
ref="elForm"
:disabled="true"
:model="formData"
size="mini"
label-width="180px"
>
<div class="tit">
养殖信息
<span class="time">更新于:{{ update_time }}</span>
</div>
<el-row>
<el-col :span="8">
<el-form-item label="有无养殖培训" prop="breeding_training">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无注册成立养殖公司" prop="breeding_company">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注" prop="notes">
<el-input
v-model="datas.notes"
clearable
autosize
type="textarea"
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="养殖类型" prop="breeding_type">
<el-input
v-model="datas.datas.breeding_type"
clearable
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开始时间" prop="breeding_time">
<el-input
v-model="datas.datas.breeding_time"
clearable
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="上市时间" prop="mature_time">
<el-input
v-model="datas.datas.mature_time"
clearable
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="产量(斤)" prop="yield">
<el-input
v-model="datas.datas.yield"
clearable
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="预计收益(元)" prop="estimated_income">
<el-input
v-model="datas.datas.estimated_income"
clearable
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item
label="农资农具使用情况"
label-width="180px"
prop="farm_tools"
>
<el-input
v-model="datas.datas.farm_tools"
clearable
autosize
type="textarea"
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</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 label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="现代化程度(%)" prop="modernization">
<el-input
v-model="datas.datas.modernization"
clearable
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="预售卖价格(元/500g)" prop="pre_price">
<el-input
v-model="datas.datas.pre_price"
clearable
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="销售方式" prop="method_sales">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无加工仓储" prop="processing_storage">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无宣传推广" prop="promote">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无运输" prop="transportation">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="是否有扩大经营需求" prop="expand_business_needs">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="需求描述" prop="demand">
<el-input
v-model="datas.datas.demand"
clearable
autosize
type="textarea"
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="政策补助" prop="policy_subsidies">
<el-input
v-model="datas.datas.policy_subsidies"
clearable
autosize
type="textarea"
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</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>
<script setup lang='ts'>
const props = defineProps({
datas: {
type: Object,
defualt: function () {
return {
breeding_training: "", //
breeding_company: "", //
notes: "", //
breeding_type: "", //
breeding_time: "", //
mature_time: "", //
yield: "", //
estimated_income: "", //
farm_tools: "", //使
ecological_farming: "", //
modernization: "", //
pre_price: "", //
method_sales: "", //
processing_storage: "", //
promote: "", //广
transportation: "", //
expand_business_needs: "", //
demand: "", //
policy_subsidies: "", //
};
},
},
update_time: {
type: String,
defualt: "",
},
});
</script>
<style scoped lang='scss'>
.tit {
font-size: 1.2rem;
translate: 1vw -1vw;
background-color: white;
margin: 2vh 0 0 0;
.time {
display: inline-block;
font-size: 0.8rem;
margin-left: 1vw;
color: #999;
}
}
</style>

View File

@ -0,0 +1,308 @@
<template>
<el-card style="margin-top: 16px">
<el-form
ref="elForm"
:disabled="true"
:model="formData"
size="mini"
label-width="180px"
>
<div class="tit">
深加工
<span class="time">更新于:{{ update_time }}</span>
</div>
<el-row>
<el-col :span="8">
<el-form-item label="是否在经营" prop="is_manage">
<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.datas.is_manage == 1">
<el-col :span="8">
<el-form-item label="有无建设用地" prop="construction_land">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="面积(m²)" prop="land_area">
<el-input
v-model="datas.datas.land_area"
clearable
:disabled="true"
></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="经营地点" prop="manage_place">
<el-input
v-model="datas.datas.manage_place"
clearable
:disabled="true"
></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="材料来源" prop="source_materials">
<el-input
v-model="datas.datas.source_materials"
clearable
:disabled="true"
></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无销售渠道" prop="marketing_channel">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无技术指导" prop="technical_guidance">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无品牌" prop="brand">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无宣传推广" prop="advertising">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无运输" prop="transport">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="经营诉求" prop="business_appeal">
<el-input
v-model="datas.datas.business_appeal"
clearable
autosize
type="textarea"
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
</template>
<template v-else>
<el-col :span="8">
<el-form-item label="有无建设用地" prop="construction_land">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="经营类型" prop="manage_type">
<el-select
v-model="datas.datas.manage_type"
clearable
:style="{ width: '100%' }"
>
<el-option
v-for="(item, index) in storeTypeList"
:key="index"
:label="item"
:value="index + ''"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="经营地点" prop="manage_place">
<el-input
v-model="datas.datas.manage_place"
clearable
:disabled="true"
></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="人数" prop="people_count">
<el-input
v-model="datas.datas.people_count"
clearable
:disabled="true"
></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无食堂" prop="canteen">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="材料来源" prop="source_materials">
<el-input
v-model="datas.datas.source_materials"
clearable
:disabled="true"
></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="自动化办公程度" prop="automation">
<el-input
v-model="datas.datas.automation"
clearable
:disabled="true"
></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无用工需求" prop="employment">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无品牌" prop="brand">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无宣传推广" prop="advertising">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="库存情况" prop="repertory">
<el-input
v-model="datas.datas.repertory"
clearable
:disabled="true"
></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无运输" prop="transport">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="经营诉求" prop="business_appeal">
<el-input
v-model="datas.datas.business_appeal"
clearable
autosize
type="textarea"
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
</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>
<script setup lang='ts'>
const storeTypeList = ref([
"超市",
"生鲜",
"饭店",
"五金",
"杂货",
"服装",
"文具",
"其他",
]);
const props = defineProps({
datas: {
type: Object,
defualt: function () {
return {
is_manage: "", //
construction_land: "", //
land_area: "", //
manage_place: "", //
source_materials: "", //
marketing_channel: "", //
technical_guidance: "", //
brand: "", //
advertising: "", //广
transport: "", //
business_appeal: "", //
manage_type: "", //
people_count: "", //
canteen: "", //
automation: "", //
employment: "", //
repertory: "", //
};
},
},
update_time: {
type: String,
defualt: "",
},
});
</script>
<style scoped lang='scss'>
.tit {
font-size: 1.2rem;
translate: 1vw -1vw;
background-color: white;
margin: 2vh 0 0 0;
.time {
display: inline-block;
font-size: 0.8rem;
margin-left: 1vw;
color: #999;
}
}
</style>

View File

@ -0,0 +1,118 @@
<template>
<el-card style="margin-top: 16px">
<el-form
ref="elForm"
:disabled="true"
:model="formData"
size="mini"
label-width="180px"
>
<div class="tit">
装房1
<span class="time">更新于:{{ update_time }}</span>
</div>
<el-row>
<el-col :span="8">
<el-form-item label="房屋面积(m²)" prop="house_area">
<el-input
v-model="datas.datas.house_area"
clearable
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="装修风格" prop="decoration_style">
<el-input
v-model="datas.datas.decoration_style"
clearable
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="装修地点" prop="decoration_site">
<el-input
v-model="datas.datas.decoration_site"
clearable
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="装修预算" prop="budget">
<el-input
v-model="datas.datas.budget"
clearable
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="装修类型" prop="decoration_type">
<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>
</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>
<script setup lang='ts'>
const props = defineProps({
datas: {
type: Object,
defualt: function () {
return {
house_area: "",
decoration_style: "",
decoration_site: "",
budget: "",
decoration_type: "",
};
},
},
update_time: {
type: String,
defualt: "",
},
});
</script>
<style scoped lang='scss'>
.tit {
font-size: 1.2rem;
translate: 1vw -1vw;
background-color: white;
margin: 2vh 0 0 0;
.time {
display: inline-block;
font-size: 0.8rem;
margin-left: 1vw;
color: #999;
}
}
</style>

View File

@ -0,0 +1,81 @@
<template>
<el-card style="margin-top: 16px">
<el-form
ref="elForm"
:disabled="true"
:model="formData"
size="mini"
label-width="180px"
>
<div class="tit">
翻新房屋
<span class="time">更新于:{{ update_time }}</span>
</div>
<el-row>
<el-col :span="8">
<el-form-item label="维护内容" prop="maintenance_contents">
<el-input
v-model="datas.datas.maintenance_contents"
clearable
type="textarea"
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="维护类型" prop="maintenance_type">
<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>
</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>
<script setup lang='ts'>
const props = defineProps({
datas: {
type: Object,
defualt: function () {
return {
maintenance_contents: "",
maintenance_type: "",
};
},
},
update_time: {
type: String,
defualt: "",
},
});
</script>
<style scoped lang='scss'>
.tit {
font-size: 1.2rem;
translate: 1vw -1vw;
background-color: white;
margin: 2vh 0 0 0;
.time {
display: inline-block;
font-size: 0.8rem;
margin-left: 1vw;
color: #999;
}
}
</style>

View File

@ -0,0 +1,154 @@
<template>
<el-card style="margin-top: 16px">
<el-form
ref="elForm"
:disabled="true"
:model="formData"
size="mini"
label-width="180px"
>
<div class="tit">
修房
<span class="time">更新于:{{ update_time }}</span>
</div>
<el-row>
<el-col :span="8">
<el-form-item label="修房类型" prop="construction_type">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="建设面积(m²)" prop="construction_area">
<el-input
v-model="datas.datas.construction_area"
clearable
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="房屋风格" prop="house_style">
<el-input
v-model="datas.datas.house_style"
clearable
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="修建地址" prop="construction_site">
<el-input
v-model="datas.datas.construction_site"
clearable
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="预算" prop="budget">
<el-input
v-model="datas.datas.budget"
clearable
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无绿化" prop="afforest">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无装修" prop="fitment">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="房屋类型" prop="house_type">
<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>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="修建地照片" prop="construction_site_img">
<el-image
style="width: 500px; height: 320px"
: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>
<script setup lang='ts'>
const props = defineProps({
datas: {
type: Object,
defualt: function () {
return {
construction_type: "",
construction_area: "",
house_style: "",
construction_site: "",
budget: "",
afforest: "",
fitment: "",
house_type: "",
construction_site_img: "",
};
},
},
update_time: {
type: String,
defualt: "",
},
});
</script>
<style scoped lang='scss'>
.tit {
font-size: 1.2rem;
translate: 1vw -1vw;
background-color: white;
margin: 2vh 0 0 0;
.time {
display: inline-block;
font-size: 0.8rem;
margin-left: 1vw;
color: #999;
}
}
</style>

View File

@ -0,0 +1,172 @@
<template>
<el-card style="margin-top: 16px">
<el-form
ref="elForm"
:disabled="true"
:model="formData"
size="mini"
label-width="180px"
>
<div class="tit">
买卖房屋
<span class="time">更新于:{{ update_time }}</span>
</div>
<el-row>
<el-col :span="8">
<el-form-item label="地点" prop="place">
<el-input
v-model="datas.datas.place"
clearable
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="房型" prop="house_type">
<el-input
v-model="datas.datas.house_type"
clearable
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="几房" prop="rooms">
<el-input
v-model="datas.datas.rooms"
clearable
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="面积(m²)" prop="house_area">
<el-input
v-model="datas.datas.house_area"
clearable
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="朝向" prop="orientation">
<el-input
v-model="datas.datas.orientation"
clearable
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="楼层" prop="floor">
<el-input
v-model="datas.datas.floor"
clearable
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="装修类型" prop="fitment">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="预算" prop="budget">
<el-input
v-model="datas.datas.budget"
clearable
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="付款类型" prop="payment_type">
<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>
</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>
<script setup lang='ts'>
const storeTypeList = ref([
"超市",
"生鲜",
"饭店",
"五金",
"杂货",
"服装",
"文具",
"其他",
]);
const props = defineProps({
datas: {
type: Object,
defualt: function () {
return {
place: "",
house_type: "",
rooms: "",
house_area: "",
orientation: "",
floor: "",
fitment: "",
budget: "",
payment_type: "",
};
},
},
update_time: {
type: String,
defualt: "",
},
});
</script>
<style scoped lang='scss'>
.tit {
font-size: 1.2rem;
translate: 1vw -1vw;
background-color: white;
margin: 2vh 0 0 0;
.time {
display: inline-block;
font-size: 0.8rem;
margin-left: 1vw;
color: #999;
}
}
</style>

View File

@ -0,0 +1,319 @@
<template>
<el-card style="margin-top: 16px">
<el-form
ref="elForm"
:disabled="true"
:model="formData"
size="mini"
label-width="180px"
>
<div class="tit">
种植信息
<span class="time">更新于:{{ update_time }}</span>
</div>
<el-row>
<el-col :span="8">
<el-form-item label="土地总面积(亩)" prop="cultivated_area">
<el-input
v-model="datas.datas.cultivated_area"
clearable
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="土地规划" prop="cultivated_area">
<el-select
:disabled="isCheck"
v-model="datas.datas.planning"
clearable
:style="{ width: '100%' }"
>
<el-option
v-for="(item, index) in landPlanList"
:key="index"
:label="item"
:value="index + ''"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无种植培训" prop="breeding_training">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无注册成立种植公司" prop="planting_company">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注" prop="notes">
<el-input
v-model="datas.datas.notes"
clearable
autosize
type="textarea"
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="种植类型" prop="breeding_type">
<el-input
v-model="datas.datas.breeding_type"
clearable
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="种植面积(亩)" prop="area">
<el-input
v-model="datas.datas.area"
clearable
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开始时间" prop="breeding_time">
<el-input
v-model="datas.datas.breeding_time"
clearable
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="上市时间" prop="mature_time">
<el-input
v-model="datas.datas.mature_time"
clearable
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="产量(斤)" prop="yield">
<el-input
v-model="datas.datas.yield"
clearable
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="预计收益(元)" prop="estimated_income">
<el-input
v-model="datas.datas.estimated_income"
clearable
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item
label="农资农具使用情况"
label-width="180px"
prop="farm_tools"
>
<el-input
v-model="datas.datas.farm_tools"
clearable
autosize
type="textarea"
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="是否生态种植" prop="ecological_farming">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="现代化程度(%)" prop="modernization">
<el-input
v-model="datas.datas.modernization"
clearable
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="预售卖价格(元/500g)" prop="pre_price">
<el-input
v-model="datas.datas.pre_price"
clearable
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="销售方式" prop="method_sales">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无加工仓储" prop="processing_storage">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无宣传推广" prop="promote">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无运输" prop="transportation">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="是否有扩大经营需求" prop="expand_business_needs">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="需求描述" prop="demand">
<el-input
v-model="datas.datas.demand"
clearable
autosize
type="textarea"
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="政策补助" prop="policy_subsidies">
<el-input
v-model="datas.datas.policy_subsidies"
clearable
autosize
type="textarea"
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</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>
<script setup lang='ts'>
const landPlanList = ref(["自己种", "出租", "代种", "租更多地扩大种植"]);
const props = defineProps({
datas: {
type: Object,
defualt: function () {
return {
cultivated_area: "", //
planning: "", //
breeding_training: "", //
breeding_company: "", //
notes: "", //
breeding_type: "", //
breeding_time: "", //
mature_time: "", //
yield: "", //
estimated_income: "", //
farm_tools: "", //使
ecological_farming: "", //
modernization: "", //
pre_price: "", //
method_sales: "", //
processing_storage: "", //
promote: "", //广
transportation: "", //
expand_business_needs: "", //
demand: "", //
policy_subsidies: "", //
};
},
},
update_time: {
type: String,
defualt: "",
},
});
</script>
<style scoped lang='scss'>
.tit {
font-size: 1.2rem;
translate: 1vw -1vw;
background-color: white;
margin: 2vh 0 0 0;
.time {
display: inline-block;
font-size: 0.8rem;
margin-left: 1vw;
color: #999;
}
}
</style>

View File

@ -0,0 +1,228 @@
<template>
<el-card style="margin-top: 16px">
<el-form
ref="elForm"
:disabled="true"
:model="formData"
size="mini"
label-width="180px"
>
<div class="tit">
开设店铺
<span class="time">更新于:{{ update_time }}</span>
</div>
<el-row>
<el-col :span="8">
<el-form-item label="有无门面" prop="shop_front">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="门面面积(m²)" prop="area">
<el-input
v-model="datas.datas.area"
clearable
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="经营地点" prop="place">
<el-input
v-model="datas.datas.place"
clearable
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="经营类型" prop="type">
<el-select
:disabled="isCheck"
v-model="datas.datas.type"
clearable
:style="{ width: '100%' }"
>
<el-option
v-for="(item, index) in storeTypeList"
:key="index"
:label="item"
:value="index + ''"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="门面环境" prop="environment">
<el-input
v-model="datas.datas.environment"
clearable
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="服务对象" prop="service">
<el-input
v-model="datas.datas.service"
clearable
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无营业资质" prop="qualification">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无进货渠道" prop="stock">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="店铺规模" prop="scale">
<el-input
v-model="datas.datas.scale"
clearable
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="商品来源" prop="source">
<el-input
v-model="datas.datas.source"
clearable
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无线上展示" prop="brand">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无品牌" prop="field134">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="库存情况" prop="repertory">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="经营诉求" prop="appeal">
<el-input
v-model="datas.datas.appeal"
clearable
autosize
type="textarea"
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</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>
<script setup lang='ts'>
const storeTypeList = ref([
"超市",
"生鲜",
"饭店",
"五金",
"杂货",
"服装",
"文具",
"其他",
]);
const props = defineProps({
datas: {
type: Object,
defualt: function () {
return {
appeal: "",
aea: "",
brand: "",
environment: "",
online_display: "",
place: "",
qualification: "",
repertory: "",
scale: "",
service: "",
shop_front: "",
source: "",
stock: "",
type: "",
};
},
},
update_time: {
type: String,
defualt: "",
},
});
</script>
<style scoped lang='scss'>
.tit {
font-size: 1.2rem;
translate: 1vw -1vw;
background-color: white;
margin: 2vh 0 0 0;
.time {
display: inline-block;
font-size: 0.8rem;
margin-left: 1vw;
color: #999;
}
}
</style>

View File

@ -0,0 +1,308 @@
<template>
<el-card style="margin-top: 16px">
<el-form
ref="elForm"
:disabled="true"
:model="formData"
size="mini"
label-width="180px"
>
<div class="tit">
粗加工
<span class="time">更新于:{{ update_time }}</span>
</div>
<el-row>
<el-col :span="8">
<el-form-item label="是否在经营" prop="is_manage">
<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.datas.is_manage == 1">
<el-col :span="8">
<el-form-item label="有无建设用地" prop="construction_land">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="面积(m²)" prop="land_area">
<el-input
v-model="datas.datas.land_area"
clearable
:disabled="true"
></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="经营地点" prop="manage_place">
<el-input
v-model="datas.datas.manage_place"
clearable
:disabled="true"
></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="材料来源" prop="source_materials">
<el-input
v-model="datas.datas.source_materials"
clearable
:disabled="true"
></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无销售渠道" prop="marketing_channel">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无技术指导" prop="technical_guidance">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无品牌" prop="brand">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无宣传推广" prop="advertising">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无运输" prop="transport">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="经营诉求" prop="business_appeal">
<el-input
v-model="datas.datas.business_appeal"
clearable
autosize
type="textarea"
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
</template>
<template v-else>
<el-col :span="8">
<el-form-item label="有无建设用地" prop="construction_land">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="经营类型" prop="manage_type">
<el-select
v-model="datas.datas.manage_type"
clearable
:style="{ width: '100%' }"
>
<el-option
v-for="(item, index) in storeTypeList"
:key="index"
:label="item"
:value="index + ''"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="经营地点" prop="manage_place">
<el-input
v-model="datas.datas.manage_place"
clearable
:disabled="true"
></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="人数" prop="people_count">
<el-input
v-model="datas.datas.people_count"
clearable
:disabled="true"
></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无食堂" prop="canteen">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="材料来源" prop="source_materials">
<el-input
v-model="datas.datas.source_materials"
clearable
:disabled="true"
></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="自动化办公程度" prop="automation">
<el-input
v-model="datas.datas.automation"
clearable
:disabled="true"
></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无用工需求" prop="employment">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无品牌" prop="brand">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无宣传推广" prop="advertising">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="库存情况" prop="repertory">
<el-input
v-model="datas.datas.repertory"
clearable
:disabled="true"
></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有无运输" prop="transport">
<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>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="经营诉求" prop="business_appeal">
<el-input
v-model="datas.datas.business_appeal"
clearable
autosize
type="textarea"
:disabled="true"
:style="{ width: '100%' }"
>
</el-input>
</el-form-item>
</el-col>
</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>
<script setup lang='ts'>
const storeTypeList = ref([
"超市",
"生鲜",
"饭店",
"五金",
"杂货",
"服装",
"文具",
"其他",
]);
const props = defineProps({
datas: {
type: Object,
defualt: function () {
return {
is_manage: "", //
construction_land: "", //
land_area: "", //
manage_place: "", //
source_materials: "", //
marketing_channel: "", //
technical_guidance: "", //
brand: "", //
advertising: "", //广
transport: "", //
business_appeal: "", //
manage_type: "", //
people_count: "", //
canteen: "", //
automation: "", //
employment: "", //
repertory: "", //
};
},
},
update_time: {
type: String,
defualt: "",
},
});
</script>
<style scoped lang='scss'>
.tit {
font-size: 1.2rem;
translate: 1vw -1vw;
background-color: white;
margin: 2vh 0 0 0;
.time {
display: inline-block;
font-size: 0.8rem;
margin-left: 1vw;
color: #999;
}
}
</style>

View File

@ -0,0 +1,630 @@
<template>
<el-card>
<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> -->
<p class="tit">个人信息</p>
<el-col>
<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>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="性别" prop="sex">
<el-radio-group v-model="formData.sex" size="medium">
<el-radio :label="1"></el-radio>
<el-radio :label="2"></el-radio>
</el-radio-group>
</el-form-item>
</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>
</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>
</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>
</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>
</el-form-item>
</el-col>
</el-row>
</el-col>
<p class="tit">地区信息</p>
<el-col>
<el-row>
<el-col :span="6">
<el-form-item label="地址">
<el-input :value="
formData.area_name +
formData.street_name +
formData.village_name
" 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>
</el-form-item>
</el-col>
<el-col :span="12">
<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>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="6">
<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>
</el-radio-group>
</el-form-item>
</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>
</el-form-item>
</el-col>
</el-row>
</el-col>
<p class="tit">常住人口</p>
<el-col>
<div v-for="(item, index) in formData.family" :key="index">
<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>
</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-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>
</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>
</el-form-item>
</el-col>
</el-row>
</div>
<el-form-item label="是否存在学生, 婴幼儿" labelWidth="200px">
<el-radio-group v-model="formData.child" size="medium">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<div v-for="(item, index) in formData.child_arr" v-if="formData.child">
<el-col v-if="formData.child_arr[index].age <= 3">
<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>
</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-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>
</el-form-item>
</el-col>
</el-row>
</el-col>
<el-col v-else>
<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>
</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>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="是否补课" prop="is_lesson">
<el-radio-group v-model="item.is_lesson" size="medium">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
</el-form-item>
</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>
</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>
</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>
</template>
<script lang="ts" setup name="test">
import { ref, reactive } from "vue";
import store from "./component/store.vue";
import breeding from "./component/breeding.vue";
import plant from "./component/plant.vue";
import houseTransaction from "./component/houseTransaction.vue";
import houseRenovate from "./component/houseRenovate.vue";
import houseDecoration from "./component/houseDecoration.vue";
import houseRepair from "./component/houseRepair.vue";
import banquetMarry from "./component/banquetMarry.vue";
import banquetOther from "./component/banquetOther.vue";
import banquetFuneral from "./component/banquetFuneral.vue";
import banquetFullMoon from "./component/banquetFullMoon.vue";
import banquetBirthday from "./component/banquetBirthday.vue";
import thickProcessing from "./component/thickProcessing.vue";
import deepProcessing from "./component/deepProcessing.vue";
import { fileManagelist, fileManageDetil } from "@/api/informationg";
const route = useRoute();
const componentList = reactive(new Map());
componentList.set(7, plant);
componentList.set(8, store);
componentList.set(32, breeding);
componentList.set(15, houseTransaction);
componentList.set(14, houseRenovate);
componentList.set(13, houseDecoration);
componentList.set(12, houseRepair);
componentList.set(17, banquetMarry);
componentList.set(20, banquetOther);
componentList.set(21, banquetFuneral);
componentList.set(19, banquetFullMoon);
componentList.set(18, banquetBirthday);
componentList.set(10, thickProcessing);
componentList.set(9, deepProcessing);
const isComponent = (id: any) => {
return componentList.get(id);
};
const formData = reactive({
name: "",
phone: "",
age: "",
sex: "",
id_card: "",
area_name: "",
street_name: "",
village_name: "",
brigade_name: "",
addressa: "",
address: "",
//
family: [
{
name: "",
birth_time: "",
situation: "",
work: "",
phone: "",
skills: "",
},
],
child: undefined,
child_arr: [
{
name: "",
birth: "",
age: 0,
class: "",
lessons: "",
notes: "",
feeding: "",
},
],
highway: undefined,
smart_phone: undefined,
wechat: "",
datas: [],
});
const workLists = reactive([
{ name: "做工地的", id: "0" },
{ name: "厂里打工", id: "1" },
{ name: "公司职员", id: "2" },
{ name: "政府上班", id: "3" },
{ name: "种地", id: "4" },
{ name: "在家赋闲", id: "5" },
{ name: "其他", id: "6" },
]);
const isCheck = ref(false);
const datas = reactive({
subjs: [
{
label: "语文",
value: 1,
},
{
label: "数学",
value: 2,
},
{
label: "英语",
value: 3,
},
{
label: "艺术类",
value: 4,
},
{
label: "其他",
value: 5,
},
],
feedsList: [
{
label: "母乳",
value: "0",
},
{
label: "奶粉",
value: "1",
},
],
plantList: [
{
label: "自己种养",
value: "0",
},
{
label: "出租",
value: "1",
},
{
label: "代种养",
value: "2",
},
{
label: "租更多地扩大种植",
value: "3",
},
],
//
houseStyle: [
{
label: "中式",
value: 1,
},
{
label: "美式",
value: 2,
},
{
label: "欧式",
value: 3,
},
{
label: "简约",
value: 4,
},
{
label: "奢华",
value: 5,
},
{
label: "别墅/四合院",
value: 6,
},
{
label: "其他",
value: 7,
},
],
//
weihu: [
{
label: "房顶",
value: 1,
},
{
label: "厕所",
value: 2,
},
{
label: "管线",
value: 3,
},
{
label: "电器",
value: 4,
},
],
field102Options: [
{
label: "别墅",
value: 1,
},
{
label: "洋房",
value: 2,
},
{
label: "高层",
value: 3,
},
{
label: "楼梯房",
value: 4,
},
],
//
ecologyPlant: [
{
label: "非生态种植",
value: 1,
},
],
sellType: [
{
label: "自销",
value: "1",
},
{
label: "定点销售",
value: "2",
},
],
//
publicize: [
{
label: "有无宣传推广",
value: 1,
},
],
//
field106Options: [
{
label: "超市",
value: 1,
},
{
label: "生鲜",
value: 2,
},
{
label: "饭店",
value: 3,
},
{
label: "五金",
value: 4,
},
{
label: "杂货",
value: 5,
},
{
label: "服装",
value: 6,
},
{
label: "文具",
value: 7,
},
{
label: "其他",
value: 8,
},
],
//
field109Options: [
{
label: "学生",
value: 1,
},
{
label: "家庭客户",
value: 2,
},
{
label: "青年客户",
value: 3,
},
{
label: "老年人",
value: 4,
},
{
label: "游客",
value: 5,
},
],
//
banquetList: [
{
label: "婚宴",
value: 1,
},
{
label: "寿宴",
value: 2,
},
{
label: "满月酒",
value: 3,
},
{
label: "其它庆功宴",
value: 4,
},
{
label: "白事",
value: 5,
},
],
//
field106aOptions: [
{
label: "酒店",
value: 1,
},
{
label: "一条龙",
value: 2,
},
{
label: "只请厨师",
value: 3,
},
],
//
field104Options: [
{
label: "电瓶车",
value: 1,
},
{
label: "摩托车",
value: 2,
},
{
label: "小汽车",
value: 3,
},
],
provinceOptions: [],
cityOptions: [],
areaOptions: [],
streetOptions: [],
});
const test = () => {
console.log(formData.banquetList);
};
const field181Options = reactive([
{
label: "有加工仓储",
value: 1,
},
]);
const field183Options = reactive([
{
label: "有运输",
value: 1,
},
]);
const field188Options = reactive([
{
label: "是否想要扩大经营",
value: 1,
},
]);
//
const analyse = ref(true);
const addDecoration = () => {};
fileManageDetil({ id: route.query.id }).then(async (res) => {
// console.log(res);
for (const key in formData) {
if (res[key] != null && res[key] != undefined) {
//@ts-ignore
formData[key] = res[key];
}
}
// "area_name": "",
// "street_name": "",
// "village_name": "",
// "brigade_name": "10",
formData.addressa =
formData.area_name +
formData.street_name +
formData.village_name +
formData.brigade_name +
formData.address;
// console.log(formData);
// await getCityList();
// await getAreaList();
// await getStreetList();
});
</script>
<style lang="scss" scoped>
.content {
background-color: #fff;
}
.tit {
font-size: 1.2rem;
translate: 1vw -1vw;
background-color: white;
margin: 2vh 0 0vh;
}
// .tit {
// font-size: 1.2rem;
// margin: 10px 0;
// background-color: #f6f6f6;
// }
.dates {
.el-input__inner {
width: 14vw;
}
}
</style>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,112 @@
<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="84px">
<el-col class="pt-6 !border-none">
<el-row>
<el-col>
<el-form-item label="名称" prop="title">
<el-input v-model="formData.title" placeholder="请输入名称" clearable></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col>
<el-form-item label="标识" prop="name">
<el-input v-model="formData.name" placeholder="请输入审批类型标识" clearable></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col>
<el-form-item label="图标" prop="icon">
<el-input v-model="formData.icon" placeholder="请输入审批类型图标" clearable></el-input>
</el-form-item>
</el-col>
</el-row>
</el-col>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="flowTypeEdit">
import type { FormInstance } from "element-plus";
import Popup from "@/components/popup/index.vue";
import { apiCateCreat } from "@/api/examined";
import { timeFormat } from "@/utils/util";
import type { PropType } from "vue";
import { fileManagelist, fileManageDetil } from "@/api/informationg";
import { getUserList } from "@/api/consumer";
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: "",
type: "",
title: "",
name: "",
icon: "",
department_ids: "",
status: "",
});
//
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 apiFlowTypeDetail({
// id: row.id,
// });
// setFormData(data);
// };
//
const handleSubmit = async () => {
const data = { ...formData };
mode.value == "edit" ? await apiCateCreat(data) : await apiCateCreat(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,224 @@
<template>
<div>
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
<el-form class="mb-[-16px]" inline>
<el-form-item label="公司名称" prop="company_id">
<el-input
class="w-[280px]"
v-model="queryParams.company_name"
clearable
placeholder="请输入公司"
/>
</el-form-item>
<el-form-item label="队长姓名" prop="company_id">
<el-input
class="w-[280px]"
v-model="queryParams.nickname"
clearable
placeholder="请输入队长姓名"
/>
</el-form-item>
<el-form-item label="档案名称" prop="company_id">
<el-input
class="w-[280px]"
v-model="queryParams.name"
clearable
placeholder="请输入档案姓名"
/>
</el-form-item>
<el-form-item label="小队" prop="company_id">
<ElSelect
v-model="queryParams.brigade"
placeholder="请选择小队"
clearable
:style="{ width: '100%' }"
>
<el-option
v-for="(item, index) in [
{ brigade_name: '1队', id: '1' },
{ brigade_name: '2队', id: '2' },
]"
:key="index"
:label="item.brigade_name"
:value="item.id"
></el-option>
</ElSelect>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button>
</el-form-item>
</el-form>
<div class="mt-4">
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
<el-table-column label="编号" prop="id" show-overflow-tooltip />
<el-table-column label="镇公司" show-overflow-tooltip>
<template #default="{ row }">
{{ row.extend?.company_name }}
</template>
</el-table-column>
<el-table-column width="260px" 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 }}
<text v-for="(item, index) in row.brigade_name" :key="index">{{
item.brigade_name
}}</text>
</template>
</el-table-column>
<el-table-column label="队长姓名" prop="phone" show-overflow-tooltip>
<template #default="{ row }">
{{ row.extend?.nickname }}
</template>
</el-table-column>
<el-table-column label="档案名称" prop="name" show-overflow-tooltip />
<el-table-column
label="联系电话"
prop="phone"
show-overflow-tooltip
/>
<el-table-column
label="更新时间"
prop="update_time"
show-overflow-tooltip
/>
<el-table-column
label="建档时间"
prop="create_time"
show-overflow-tooltip
/>
<!-- <el-table-column label="所属生产队队长" prop="type_name" show-overflow-tooltip />
<el-table-column label="所属镇管理" prop="type_name" show-overflow-tooltip />
<el-table-column label="所属区域经理" prop="type_name" show-overflow-tooltip />
<el-table-column label="最近更新时间" prop="type_name" show-overflow-tooltip /> -->
<el-table-column
label="操作"
align="center"
width="auto"
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"
link
>
<router-link
:to="{
path: 'user_informationg/details',
query: {
id: row.id,
},
}"
>
详情
</router-link>
</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div class="flex mt-4 justify-end">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
<edit-popup
v-if="showEdit"
ref="editRef"
:dict-data="dictData"
@success="getLists"
@close="showEdit = false"
/>
</div>
</template>
<script lang="ts" setup name="flowTypeLists">
import { usePaging } from "@/hooks/usePaging";
import { useDictData } from "@/hooks/useDictOptions";
// import { apiCateLists, apiCateStatus } from "@/api/examined";
import { fileManagelist, fileManageDetil } from "@/api/informationg";
import { getRoutePath } from "@/router";
// import { timeFormat } from "@/utils/util";
// import feedback from "@/utils/feedback";
// import { getRoutePath } from "router";
import EditPopup from "./editCate.vue";
console.log(getRoutePath);
const editRef = shallowRef<InstanceType<typeof EditPopup>>();
//
const showEdit = ref(false);
//
const queryParams = reactive({
name: "",
company_name: "",
nickname: "",
brigade: "",
});
//
const selectData = ref<any[]>([]);
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id);
};
//
const { dictData } = useDictData("");
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: fileManagelist,
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 apiFlowTypeDelete({ id });
// getLists();
// };
//
// const changeStatus = (row: any) => {
// apiCateStatus({ id: row.id, status: row.status });
// };
getLists();
</script>

View File

@ -0,0 +1,313 @@
<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="type">
<el-radio-group v-model="formData.type">
<el-radio :label="MenuEnum.CATALOGUE">目录</el-radio>
<el-radio :label="MenuEnum.MENU">菜单</el-radio>
</el-radio-group>
</el-form-item> -->
<el-form-item label="上级菜单" prop="pid">
<el-tree-select
class="flex-1"
v-model="formData.pid"
:data="previousMenuList"
clearable
node-key="id"
:props="{
label: 'name',
}"
:default-expand-all="true"
placeholder="请选择父级菜单"
check-strictly
/>
</el-form-item>
<el-form-item label="菜单名称" prop="name">
<el-input
v-model="formData.name"
clearable
placeholder="请输入菜单名称"
/>
</el-form-item>
<el-form-item label="菜单图标" prop="icon">
<el-upload
class="avatar-uploader"
style="
border: 1px dashed var(--el-border-color);
border-radius: 6px;
overflow: hidden;
"
v-model="formData.icon"
:headers="{ Token: userStore.token }"
:action="base_url + '/upload/taskImage'"
:show-file-list="false"
:data="{ cid: 1 }"
:on-success="handleMenuIcon"
>
<img v-if="formData.icon" :src="formData.icon" class="avatar" />
<el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
</el-upload>
</el-form-item>
<el-form-item label="菜单备注" prop="notes">
<el-input
v-model="formData.notes"
clearable
maxlength="20"
placeholder="请输入菜单备注(20字以内)"
/>
</el-form-item>
<el-form-item label="菜单排序" prop="sort">
<el-input
v-model="formData.sort"
clearable
placeholder="请输入菜单排序"
type="number"
/>
</el-form-item>
<el-form-item label="路由地址" prop="paths">
<el-input
v-model="formData.paths"
clearable
placeholder="请输入路由地址"
/>
</el-form-item>
<el-form-item label="路由参数" prop="params">
<el-input
v-model="formData.params"
clearable
placeholder="请输入路由参数"
/>
</el-form-item>
<el-form-item label="是否显示:" prop="is_show">
<el-radio-group v-model="formData.is_show">
<el-radio :label="1">显示</el-radio>
<el-radio :label="0">隐藏</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="是否禁用:" prop="is_disable">
<el-radio-group v-model="formData.is_disable">
<el-radio :label="0">正常</el-radio>
<el-radio :label="1">停用</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="userMenuEdit">
import type { FormInstance } from "element-plus";
import Popup from "@/components/popup/index.vue";
import {
apiUserMenuAdd,
apiUserMenuEdit,
apiUserMenuDetail,
} from "@/api/user_menu";
import { timeFormat } from "@/utils/util";
import type { PropType } from "vue";
import { MenuEnum } from "@/enums/appEnums";
import { inject } from "vue";
import useUserStore from "@/stores/modules/user";
const userStore = useUserStore();
const base_url: any = inject("base_url");
const props = defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
default: () => ({}),
},
menuList: {
type: Array,
default: () => [],
},
});
const emit = defineEmits(["success", "close"]);
const formRef = shallowRef<FormInstance>();
const popupRef = shallowRef<InstanceType<typeof Popup>>();
const mode = ref("add");
const isDisabled = ref(false);
const handleMenuIcon = (res: any) => {
formData.icon = res.data.uri;
};
const previousMenuList = ref([{ id: 0, name: "顶级", children: [] }]);
const initMenu = () => {
props.menuList.forEach((item: any) => {
previousMenuList.value[0].children.push(item);
});
};
initMenu();
//
const popupTitle = computed(() => {
return mode.value == "edit" ? "编辑系统菜单表" : "新增系统菜单表";
});
//
const formData = reactive({
id: "",
pid: "",
type: MenuEnum.MENU,
name: "",
icon: "",
sort: 0,
notes: "",
paths: "",
params: "",
is_show: 1,
is_disable: 0,
});
//
const formRules = reactive<any>({
pid: [
{
required: true,
message: "请输入上级菜单",
trigger: ["blur"],
},
],
type: [
{
required: true,
message: "请输入权限类型: M=目录C=菜单A=按钮",
trigger: ["blur"],
},
],
name: [
{
required: true,
message: "请输入菜单名称",
trigger: ["blur"],
},
],
icon: [
{
required: true,
message: "请输入菜单图标",
trigger: ["blur"],
},
],
sort: [
{
required: true,
message: "请输入菜单排序",
trigger: ["blur"],
},
],
paths: [
{
required: true,
message: "请输入路由地址",
trigger: ["blur"],
},
],
params: [
{
required: false,
message: "请输入路由参数",
trigger: ["blur"],
},
],
is_show: [
{
required: true,
message: "请输入是否显示",
trigger: ["blur"],
},
],
is_disable: [
{
required: true,
message: "请输入是否禁用",
trigger: ["blur"],
},
],
});
//
const setFormData = async (data: Record<any, any>) => {
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
formData[key] = data[key];
}
}
};
const getDetail = async (row: Record<string, any>) => {
const data = await apiUserMenuDetail({
id: row.id,
});
setFormData(data);
};
//
const handleSubmit = async () => {
await formRef.value?.validate();
const data = { ...formData };
mode.value == "edit"
? await apiUserMenuEdit(data)
: await apiUserMenuAdd(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>
<style lang="scss" scoped>
.avatar-uploader .avatar {
width: 80px;
height: 80px;
display: block;
}
.avatar-uploader .el-upload {
border: 1px dashed var(--el-border-color) !important;
border-radius: 6px;
cursor: pointer;
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: 80px;
height: 80px;
text-align: center;
}
</style>

View File

@ -0,0 +1,229 @@
<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="is_show">
<el-select
v-model="queryParams.is_show"
placeholder="是否显示"
clearable
class="w-[240px]"
>
<el-option label="显示" value="1"></el-option>
<el-option label="隐藏" value="0"></el-option>
</el-select>
</el-form-item>
<el-form-item label="是否禁用:" prop="is_disable">
<el-select
v-model="queryParams.is_disable"
placeholder="是否禁用"
clearable
class="w-[240px]"
>
<el-option label="正常" value="0"></el-option>
<el-option label="禁用" value="1"></el-option>
</el-select>
</el-form-item> -->
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button>
</el-form-item>
</el-form>
</el-card>
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
<el-button
v-perms="['user.user_menu/add']"
type="primary"
@click="handleAdd"
>
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<!-- <el-button
v-perms="['user.user_menu/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 type="selection" width="55" /> -->
<!-- <el-table-column label="上级菜单" prop="pid" show-overflow-tooltip>
<template #default="{ row }">
<span v-if="row.pid == 0">顶级</span>
<span v-else>{{ row.parentName }}</span>
</template>
</el-table-column> -->
<el-table-column label="菜单名称" prop="name" show-overflow-tooltip />
<el-table-column label="菜单图标" prop="icon" show-overflow-tooltip>
<template #default="{ row }">
<img :src="row.icon" style="width: 50px; height: 50px" />
</template>
</el-table-column>
<el-table-column
label="菜单备注"
prop="notes"
show-overflow-tooltip
/>
<el-table-column label="菜单排序" prop="sort" show-overflow-tooltip />
<el-table-column
label="路由地址"
prop="paths"
show-overflow-tooltip
width="320px"
/>
<el-table-column
label="路由参数"
prop="params"
show-overflow-tooltip
/>
<el-table-column
label="是否显示"
prop="is_show"
show-overflow-tooltip
>
<template #default="{ row }">
<el-tag v-if="row.is_show == 1">显示</el-tag>
<el-tag v-else type="danger">隐藏</el-tag>
</template>
</el-table-column>
<el-table-column
label="是否禁用"
prop="is_disable"
show-overflow-tooltip
>
<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="操作" width="120" fixed="right">
<template #default="{ row }">
<el-button
v-perms="['user.user_menu/edit']"
type="primary"
link
@click="handleEdit(row)"
>
编辑
</el-button>
<el-button
v-perms="['user.user_menu/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"
:menuList="pager.lists"
@success="getLists"
@close="showEdit = false"
/>
</div>
</template>
<script lang="ts" setup name="userMenuLists">
import { usePaging } from "@/hooks/usePaging";
import { useDictData } from "@/hooks/useDictOptions";
import { apiUserMenuLists, apiUserMenuDelete } from "@/api/user_menu";
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({
pid: "",
type: "",
name: "",
icon: "",
sort: "",
paths: "",
params: "",
is_show: "",
is_disable: "",
});
//
const selectData = ref<any[]>([]);
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id);
};
//
const { dictData } = useDictData("");
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiUserMenuLists,
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 apiUserMenuDelete({ id });
getLists();
};
getLists();
watch(
() => pager.lists,
(newValue, oldValue) => {
newValue?.forEach((item: any) => {
item?.children?.forEach((t: any) => {
t.parentName = item.name;
});
});
}
);
</script>

View File

@ -0,0 +1,167 @@
<template>
<div class="edit-popup">
<popup
ref="popupRef"
title="分配权限"
:async="true"
width="550px"
@confirm="handleSubmit"
@close="handleClose"
>
<el-form
class="ls-form"
ref="formRef"
:rules="rules"
:model="formData"
label-width="60px"
v-loading="loading"
>
<el-scrollbar class="h-[400px] sm:h-[600px]">
<el-form-item label="权限" prop="menu_arr">
<div>
<el-checkbox label="展开/折叠" @change="handleExpand" />
<el-checkbox label="全选/不全选" @change="handleSelectAll" />
<el-checkbox v-model="checkStrictly" label="父子联动" />
<div>
<el-tree
ref="treeRef"
:data="menuTree"
:props="{
label: 'nameAndNotes',
children: 'children',
}"
:check-strictly="!checkStrictly"
node-key="id"
:default-expand-all="isExpand"
show-checkbox
/>
</div>
</div>
</el-form-item>
</el-scrollbar>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup>
import type { CheckboxValueType, ElTree, FormInstance } from "element-plus";
import { roleEdit } from "@/api/perms/role";
import Popup from "@/components/popup/index.vue";
import { treeToArray } from "@/utils/util";
// import { menuAll } from "@/api/perms/menu";
import { apiUserMenuLists } from "@/api/user_menu";
import { apiUserRoleEdit } from "@/api/user_role";
const emit = defineEmits(["success", "close"]);
const treeRef = shallowRef<InstanceType<typeof ElTree>>();
const formRef = shallowRef<FormInstance>();
const popupRef = shallowRef<InstanceType<typeof Popup>>();
const isExpand = ref(false);
const checkStrictly = ref(true);
const loading = ref(false);
const menuArray = ref<any[]>([]);
const menuTree = ref<any[]>([]);
const formData = reactive({
id: "",
name: "",
desc: "",
sort: 0,
menu_arr: [] as any[],
});
const rules = {
name: [
{
required: true,
message: "请输入名称",
trigger: ["blur"],
},
],
};
const getOptions = () => {
loading.value = true;
apiUserMenuLists().then((res: any) => {
for (let p of res.lists) {
p.notes
? (p["nameAndNotes"] = p.name + " (" + p.notes + ")")
: (p["nameAndNotes"] = p.name);
if (p.children) {
for (let i of p.children) {
i.notes
? (i["nameAndNotes"] = i.name + " (" + i.notes + ")")
: (i["nameAndNotes"] = i.name);
}
}
}
menuTree.value = res.lists;
nextTick(() => {
setDeptAllCheckedKeys();
});
loading.value = false;
});
};
//
const getDeptAllCheckedKeys = () => {
const checkedKeys = treeRef.value?.getCheckedKeys();
const halfCheckedKeys = treeRef.value?.getHalfCheckedKeys()!;
checkedKeys?.unshift.apply(checkedKeys, halfCheckedKeys);
return checkedKeys;
};
const setDeptAllCheckedKeys = () => {
formData.menu_arr.forEach((v) => {
nextTick(() => {
treeRef.value?.setChecked(v, true, false);
});
});
};
const handleExpand = (check: CheckboxValueType) => {
const treeList = menuTree.value;
for (let i = 0; i < treeList.length; i++) {
//@ts-ignore
treeRef.value.store.nodesMap[treeList[i].id].expanded = check;
}
};
const handleSelectAll = (check: CheckboxValueType) => {
if (check) {
treeRef.value?.setCheckedKeys(menuArray.value.map((item) => item.id));
} else {
treeRef.value?.setCheckedKeys([]);
}
};
const handleSubmit = async () => {
await formRef.value?.validate();
formData.menu_arr = getDeptAllCheckedKeys()!;
await apiUserRoleEdit(formData);
popupRef.value?.close();
emit("success");
};
const handleClose = () => {
emit("close");
};
const open = () => {
popupRef.value?.open();
};
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];
}
}
};
getOptions();
defineExpose({
open,
setFormData,
});
</script>

View File

@ -0,0 +1,126 @@
<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="name">
<el-input v-model="formData.name" clearable placeholder="请输入名称" />
</el-form-item>
<el-form-item label="描述" prop="desc">
<el-input v-model="formData.desc" clearable placeholder="请输入描述" />
</el-form-item>
<el-form-item label="权限id" prop="menu_arr">
<el-input v-model="formData.menu_arr" clearable placeholder="请输入权限id" />
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input v-model="formData.sort" clearable placeholder="请输入排序" />
</el-form-item>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="userRoleEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiUserRoleAdd, apiUserRoleEdit, apiUserRoleDetail } from '@/api/user_role'
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: '',
name: '',
desc: '',
menu_arr: '',
sort: '',
})
//
const formRules = reactive<any>({
name: [{
required: true,
message: '请输入名称',
trigger: ['blur']
}],
desc: [{
required: true,
message: '请输入描述',
trigger: ['blur']
}]
})
//
const setFormData = async (data: Record<any, any>) => {
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
formData[key] = data[key]
}
}
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiUserRoleDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
await formRef.value?.validate()
const data = { ...formData, }
mode.value == 'edit'
? await apiUserRoleEdit(data)
: await apiUserRoleAdd(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,195 @@
<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="desc">
<el-input
class="w-[280px]"
v-model="queryParams.desc"
clearable
placeholder="请输入描述"
/>
</el-form-item>
<!-- <el-form-item label="权限" prop="menu_arr">
<el-input
class="w-[280px]"
v-model="queryParams.menu_arr"
clearable
placeholder="请输入权限id"
/>
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input
class="w-[280px]"
v-model="queryParams.sort"
clearable
placeholder="请输入排序"
/>
</el-form-item> -->
<el-form-item>
<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.user_role/add']"
type="primary"
@click="handleAdd"
>
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button
v-perms="['user.user_role/delete']"
:disabled="!selectData.length"
@click="handleDelete(selectData)"
>
删除
</el-button>
<div class="mt-4">
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" />
<el-table-column label="ID" prop="id" show-overflow-tooltip />
<el-table-column label="名称" prop="name" show-overflow-tooltip />
<el-table-column label="描述" prop="desc" show-overflow-tooltip />
<el-table-column
label="权限id"
prop="menu_arr"
show-overflow-tooltip
/>
<el-table-column label="排序" prop="sort" show-overflow-tooltip />
<el-table-column label="操作" width="210" fixed="right">
<template #default="{ row }">
<el-button
v-perms="['user.user_role/edit']"
type="primary"
link
@click="handleEdit(row)"
>
编辑
</el-button>
<el-button
link
type="primary"
v-perms="['auth.role/edit']"
@click="handleAuth(row)"
>
分配权限
</el-button>
<el-button
v-perms="['user.user_role/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"
/>
<auth-popup
v-if="showAuth"
ref="authRef"
@success="getLists"
@close="showAuth = false"
/>
</div>
</template>
<script lang="ts" setup name="userRoleLists">
import { usePaging } from "@/hooks/usePaging";
import { useDictData } from "@/hooks/useDictOptions";
import { apiUserRoleLists, apiUserRoleDelete } from "@/api/user_role";
import { timeFormat } from "@/utils/util";
import feedback from "@/utils/feedback";
import EditPopup from "./edit.vue";
import AuthPopup from "./auth.vue";
const editRef = shallowRef<InstanceType<typeof EditPopup>>();
//
const showEdit = ref(false);
//
const queryParams = reactive({
name: "",
desc: "",
menu_arr: "",
sort: "",
});
//
const selectData = ref<any[]>([]);
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id);
};
//
const { dictData } = useDictData("");
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiUserRoleLists,
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 authRef = shallowRef<InstanceType<typeof AuthPopup>>();
const showAuth = ref(false);
//
const handleAuth = async (data: any) => {
showAuth.value = true;
await nextTick();
authRef.value?.open();
authRef.value?.setFormData(data);
};
//
const handleDelete = async (id: number | any[]) => {
await feedback.confirm("确定要删除?");
await apiUserRoleDelete({ id });
getLists();
};
getLists();
</script>

View File

@ -0,0 +1,105 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>后台管理系统</title>
<style>
* {
margin: 0;
padding: 0;
}
.preload {
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
width: 100vw;
}
.circular {
height: 42px;
width: 42px;
animation: loading-rotate 2s linear infinite;
}
.circular .path {
animation: loading-dash 1.5s ease-in-out infinite;
stroke-dasharray: 90, 150;
stroke-dashoffset: 0;
stroke-width: 2;
stroke: #4073fa;
stroke-linecap: round;
}
@keyframes loading-rotate {
100% {
transform: rotate(1turn);
}
}
@keyframes loading-dash {
0% {
stroke-dasharray: 90, 150;
stroke-dashoffset: -40px;
}
100% {
stroke-dasharray: 90, 150;
stroke-dashoffset: -120px;
}
}
</style>
<script type="module" crossorigin src="/admin/assets/index.e04d201b.js"></script>
<link rel="modulepreload" crossorigin href="/admin/assets/@vue.53f8d7c3.js">
<link rel="modulepreload" crossorigin href="/admin/assets/@vueuse.038954e7.js">
<link rel="modulepreload" crossorigin href="/admin/assets/@element-plus.37f92579.js">
<link rel="modulepreload" crossorigin href="/admin/assets/lodash-es.29c53eac.js">
<link rel="modulepreload" crossorigin href="/admin/assets/@amap.8a62addd.js">
<link rel="modulepreload" crossorigin href="/admin/assets/dayjs.e873ead7.js">
<link rel="modulepreload" crossorigin href="/admin/assets/async-validator.fb49d0f5.js">
<link rel="modulepreload" crossorigin href="/admin/assets/@ctrl.82a509e0.js">
<link rel="modulepreload" crossorigin href="/admin/assets/@popperjs.36402333.js">
<link rel="modulepreload" crossorigin href="/admin/assets/escape-html.e5dfadb9.js">
<link rel="modulepreload" crossorigin href="/admin/assets/normalize-wheel-es.8aeb3683.js">
<link rel="modulepreload" crossorigin href="/admin/assets/element-plus.9c2fdfa8.js">
<link rel="modulepreload" crossorigin href="/admin/assets/lodash.47b8af7d.js">
<link rel="modulepreload" crossorigin href="/admin/assets/axios.96be3cef.js">
<link rel="modulepreload" crossorigin href="/admin/assets/vue-router.e2f4a118.js">
<link rel="modulepreload" crossorigin href="/admin/assets/vue-demi.ebc8116b.js">
<link rel="modulepreload" crossorigin href="/admin/assets/pinia.bd103f5d.js">
<link rel="modulepreload" crossorigin href="/admin/assets/clone.fb54e01d.js">
<link rel="modulepreload" crossorigin href="/admin/assets/color-name.e7a4e1d3.js">
<link rel="modulepreload" crossorigin href="/admin/assets/color-convert.755d189f.js">
<link rel="modulepreload" crossorigin href="/admin/assets/color-string.e356f5de.js">
<link rel="modulepreload" crossorigin href="/admin/assets/color.e83714e9.js">
<link rel="modulepreload" crossorigin href="/admin/assets/balanced-match.d2a36341.js">
<link rel="modulepreload" crossorigin href="/admin/assets/ms.a9ae1d6d.js">
<link rel="modulepreload" crossorigin href="/admin/assets/debug.b4b577c6.js">
<link rel="modulepreload" crossorigin href="/admin/assets/css-color-function.efc99072.js">
<link rel="modulepreload" crossorigin href="/admin/assets/nprogress.f73355d0.js">
<link rel="modulepreload" crossorigin href="/admin/assets/clipboard.16e4491b.js">
<link rel="modulepreload" crossorigin href="/admin/assets/vue-clipboard3.dca5bca3.js">
<link rel="modulepreload" crossorigin href="/admin/assets/tslib.60310f1a.js">
<link rel="modulepreload" crossorigin href="/admin/assets/zrender.1084fa23.js">
<link rel="modulepreload" crossorigin href="/admin/assets/echarts.8d7a50ae.js">
<link rel="modulepreload" crossorigin href="/admin/assets/highlight.js.4ebdf9a4.js">
<link rel="modulepreload" crossorigin href="/admin/assets/@highlightjs.9cf3e967.js">
<link rel="stylesheet" href="/admin/assets/element-plus.e9573def.css">
<link rel="stylesheet" href="/admin/assets/nprogress.f5128a35.css">
<link rel="stylesheet" href="/admin/assets/highlight.5f5db245.css">
<link rel="stylesheet" href="/admin/assets/index.a70f6b42.css">
</head>
<body>
<div id="app">
<div class="preload">
<svg viewBox="25 25 50 50" class="circular">
<circle cx="50" cy="50" r="20" fill="none" class="path"></circle>
</svg>
</div>
</div>
</body>
</html>