This commit is contained in:
parent
32e23441f3
commit
ccc0c587bd
|
@ -0,0 +1,297 @@
|
|||
<template>
|
||||
<div class="edit-popup">
|
||||
|
||||
|
||||
|
||||
|
||||
<popup
|
||||
ref="popupRef"
|
||||
:title="popupTitle"
|
||||
:async="true"
|
||||
width="800px"
|
||||
@confirm="handleSubmit"
|
||||
@close="handleClose"
|
||||
:button="mode == 'edit'"
|
||||
:clickModalClose="mode == 'details'"
|
||||
>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="120px"
|
||||
>
|
||||
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="ID" prop="id">
|
||||
<el-input readonly v-model="formData.id" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="任务名称" prop="task.title">
|
||||
<el-input readonly v-model="formData.task.title" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="任务金额" prop="task.money">
|
||||
<el-input readonly v-model="formData.task.money" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所属公司" prop="company_name">
|
||||
<el-input readonly v-model="formData.company_name" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="任务描述" prop="task.content">
|
||||
<el-input
|
||||
readonly
|
||||
v-model="formData.task.content"
|
||||
clearable
|
||||
type="textarea"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="任务提交时间" prop="id">
|
||||
<el-input readonly v-model="formData.task.update_time" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="片区经理" prop="flow_cate">
|
||||
<el-input readonly v-model="formData.area_manager" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-divider />
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="详情描述" prop="remark">
|
||||
<el-input
|
||||
readonly
|
||||
:value="formData.task?.extend?.other?.note"
|
||||
clearable
|
||||
type="textarea"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="图片附件">
|
||||
<el-image
|
||||
class="attachment"
|
||||
v-for="(item, index) in formData.task?.extend?.other?.annex"
|
||||
:key="index"
|
||||
:src="item"
|
||||
:preview-src-list="formData.task?.extend?.other?.annex"
|
||||
:initial-index="index"
|
||||
fit="cover"
|
||||
></el-image>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="视频附件">
|
||||
<video
|
||||
class="video"
|
||||
:src="item"
|
||||
v-for="(item, index) in formData.task?.extend?.other
|
||||
?.video_annex"
|
||||
:key="index"
|
||||
controls
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-divider />
|
||||
<!-- <el-col :span="24">
|
||||
<el-form-item label="">
|
||||
<el-timeline>
|
||||
<el-timeline-item
|
||||
v-for="(activity, index) in activities"
|
||||
:key="index"
|
||||
:type="activity.type"
|
||||
:hollow="activity.hollow"
|
||||
:timestamp="activity.timestamp"
|
||||
>
|
||||
{{ activity.content }}
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="审核"
|
||||
prop="check_status"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
>
|
||||
<el-radio-group
|
||||
:disabled="mode == 'details'"
|
||||
v-model="formData.check_status"
|
||||
>
|
||||
<el-radio :label="2">通过</el-radio>
|
||||
<el-radio :label="3">驳回</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
:readonly="mode == 'details'"
|
||||
v-model="formData.remark"
|
||||
clearable
|
||||
type="textarea"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="flowEdit">
|
||||
import type { FormInstance } from "element-plus";
|
||||
import Popup from "@/components/popup/index.vue";
|
||||
import { apiApproveAudit } from "@/api/examined";
|
||||
import { timeFormat } from "@/utils/util";
|
||||
import type { PropType } from "vue";
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({}),
|
||||
},
|
||||
});
|
||||
const isCompany = ref(false);
|
||||
const emit = defineEmits(["success", "close"]);
|
||||
const formRef = shallowRef<FormInstance>();
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>();
|
||||
const mode = ref("add");
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == "edit" ? "审核" : "详情";
|
||||
});
|
||||
|
||||
const activities = ref([
|
||||
{
|
||||
content: "任务完成",
|
||||
timestamp: "2023-8-28 13:30:00",
|
||||
},
|
||||
{
|
||||
content: "张三三审核",
|
||||
timestamp: "2023-8-28 13:30:00",
|
||||
},
|
||||
{
|
||||
content: "李思思审核",
|
||||
timestamp: "2023-8-28 13:30:00",
|
||||
type: "primary",
|
||||
hollow: true,
|
||||
},
|
||||
]);
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: "",
|
||||
task: {},
|
||||
company_name: "",
|
||||
area_manager: "",
|
||||
check_status: 1,
|
||||
remark: "",
|
||||
});
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
check_status: [
|
||||
{
|
||||
required: true,
|
||||
validator: (rules: any, value: any, callback: any) => {
|
||||
if (value != 2 && value != 3) callback("请选择审核状态");
|
||||
else callback();
|
||||
},
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
// remark: [
|
||||
// {
|
||||
// required: false,
|
||||
// validator: (rules: any, value: any, callback: any) => {
|
||||
// if (formData.check_status == 3) callback("请填写备注");
|
||||
// else callback();
|
||||
// },
|
||||
// trigger: ["blur"],
|
||||
// },
|
||||
// ],
|
||||
});
|
||||
function customEvent(data: any) {
|
||||
isCompany.value = false;
|
||||
}
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
// let res = await apiFlowDetil(data.id);
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
// const data = await apiFlowDetail({
|
||||
// id: row.id,
|
||||
// });
|
||||
// setFormData(data);
|
||||
};
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate();
|
||||
if (formData.check_status == 3 && formData.remark == "")
|
||||
return ElMessage.error("驳回必须填写备注");
|
||||
await apiApproveAudit({
|
||||
id: formData.id,
|
||||
check_status: formData.check_status,
|
||||
remark: formData.remark,
|
||||
});
|
||||
popupRef.value?.close();
|
||||
emit("success");
|
||||
};
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = "add") => {
|
||||
mode.value = type;
|
||||
popupRef.value?.open();
|
||||
};
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit("close");
|
||||
};
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
:deep(.el-timeline-item__wrapper) {
|
||||
top: -8px !important;
|
||||
}
|
||||
.attachment {
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
/* background-color: red; */
|
||||
margin-right: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.video {
|
||||
width: 300px;
|
||||
height: 150px;
|
||||
/* background-color: red; */
|
||||
margin-right: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,311 @@
|
|||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup
|
||||
ref="popupRef"
|
||||
:title="popupTitle"
|
||||
:async="true"
|
||||
width="800px"
|
||||
@confirm="handleSubmit"
|
||||
@close="handleClose"
|
||||
:button="mode == 'edit'"
|
||||
:clickModalClose="mode == 'details'"
|
||||
>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="120px"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="ID" prop="id">
|
||||
<el-input readonly v-model="formData.id" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="任务名称" prop="task.title">
|
||||
<el-input readonly v-model="formData.task.title" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="任务金额" prop="task.money">
|
||||
<el-input readonly v-model="formData.task.money" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所属公司" prop="company_name">
|
||||
<el-input readonly v-model="formData.company_name" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="任务描述" prop="task.content">
|
||||
<el-input
|
||||
readonly
|
||||
v-model="formData.task.content"
|
||||
clearable
|
||||
type="textarea"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="任务提交时间" prop="id">
|
||||
<el-input readonly v-model="formData.task.update_time" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="片区经理" prop="flow_cate">
|
||||
<el-input readonly v-model="formData.area_manager" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-divider />
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="补充说明" prop="remark">
|
||||
<el-input
|
||||
readonly
|
||||
:value="taskExtend.remark"
|
||||
clearable
|
||||
type="textarea"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="完成证明">
|
||||
<el-image
|
||||
class="attachment"
|
||||
v-for="(item, index) in taskExtend.file"
|
||||
:key="index"
|
||||
:src="item"
|
||||
:preview-src-list="taskExtend.file"
|
||||
:initial-index="index"
|
||||
fit="cover"
|
||||
></el-image>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-divider />
|
||||
<!-- <el-col :span="24">
|
||||
<el-form-item label="">
|
||||
<el-timeline>
|
||||
<el-timeline-item
|
||||
v-for="(activity, index) in activities"
|
||||
:key="index"
|
||||
:type="activity.type"
|
||||
:hollow="activity.hollow"
|
||||
:timestamp="activity.timestamp"
|
||||
>
|
||||
{{ activity.content }}
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="审核"
|
||||
prop="check_status"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
>
|
||||
<el-radio-group
|
||||
:disabled="mode == 'details'"
|
||||
v-model="formData.check_status"
|
||||
>
|
||||
<el-radio :label="2">通过</el-radio>
|
||||
<el-radio :label="3">驳回</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
:readonly="mode == 'details'"
|
||||
v-model="formData.remark"
|
||||
clearable
|
||||
type="textarea"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="flowEdit">
|
||||
import type { FormInstance } from "element-plus";
|
||||
import Popup from "@/components/popup/index.vue";
|
||||
import { apiApproveAudit } from "@/api/examined";
|
||||
import { timeFormat } from "@/utils/util";
|
||||
import type { PropType } from "vue";
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({}),
|
||||
},
|
||||
});
|
||||
const isCompany = ref(false);
|
||||
const emit = defineEmits(["success", "close"]);
|
||||
const formRef = shallowRef<FormInstance>();
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>();
|
||||
const mode = ref("add");
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == "edit" ? "审核" : "详情";
|
||||
});
|
||||
|
||||
const activities = ref([
|
||||
{
|
||||
content: "任务完成",
|
||||
timestamp: "2023-8-28 13:30:00",
|
||||
},
|
||||
{
|
||||
content: "张三三审核",
|
||||
timestamp: "2023-8-28 13:30:00",
|
||||
},
|
||||
{
|
||||
content: "李思思审核",
|
||||
timestamp: "2023-8-28 13:30:00",
|
||||
type: "primary",
|
||||
hollow: true,
|
||||
},
|
||||
]);
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: "",
|
||||
task: {
|
||||
extend: [],
|
||||
},
|
||||
company_name: "",
|
||||
area_manager: "",
|
||||
check_status: 1,
|
||||
remark: "",
|
||||
});
|
||||
|
||||
const taskExtend = reactive({
|
||||
remark: "",
|
||||
file: [],
|
||||
});
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
check_status: [
|
||||
{
|
||||
required: true,
|
||||
validator: (rules: any, value: any, callback: any) => {
|
||||
if (value != 2 && value != 3) callback("请选择审核状态");
|
||||
else callback();
|
||||
},
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
// remark: [
|
||||
// {
|
||||
// required: false,
|
||||
// validator: (rules: any, value: any, callback: any) => {
|
||||
// if (formData.check_status == 3) callback("请填写备注");
|
||||
// else callback();
|
||||
// },
|
||||
// trigger: ["blur"],
|
||||
// },
|
||||
// ],
|
||||
});
|
||||
function customEvent(data: any) {
|
||||
isCompany.value = false;
|
||||
}
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
// let res = await apiFlowDetil(data.id);
|
||||
if (typeof data.extend == "string") data.extend = JSON.parse(data.extend);
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key];
|
||||
}
|
||||
}
|
||||
if (formData.task?.extend?.stage) {
|
||||
switch (+formData.task.extend.stage) {
|
||||
case 1:
|
||||
setTaskExtend(formData.task.extend.stage1);
|
||||
break;
|
||||
case 2:
|
||||
setTaskExtend(formData.task.extend.stage2);
|
||||
break;
|
||||
case 3:
|
||||
setTaskExtend(formData.task.extend.stage3);
|
||||
break;
|
||||
case 4:
|
||||
setTaskExtend(formData.task.extend.stage4);
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const setTaskExtend = (data: any) => {
|
||||
Object.keys(taskExtend).forEach((key: string) => {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
taskExtend[key] = data[key];
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
// const data = await apiFlowDetail({
|
||||
// id: row.id,
|
||||
// });
|
||||
// setFormData(data);
|
||||
};
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate();
|
||||
if (formData.check_status == 3 && formData.remark == "")
|
||||
return ElMessage.error("驳回必须填写备注");
|
||||
await apiApproveAudit({
|
||||
id: formData.id,
|
||||
check_status: formData.check_status,
|
||||
remark: formData.remark,
|
||||
});
|
||||
popupRef.value?.close();
|
||||
emit("success");
|
||||
};
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = "add") => {
|
||||
mode.value = type;
|
||||
popupRef.value?.open();
|
||||
};
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit("close");
|
||||
};
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
:deep(.el-timeline-item__wrapper) {
|
||||
top: -8px !important;
|
||||
}
|
||||
.attachment {
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
/* background-color: red; */
|
||||
margin-right: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.video {
|
||||
width: 300px;
|
||||
height: 150px;
|
||||
/* background-color: red; */
|
||||
margin-right: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,139 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="公司名称" prop="company_name">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.company_name"
|
||||
clearable
|
||||
placeholder="请输入公司名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="公司类型" prop="company_type">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.company_type"
|
||||
clearable
|
||||
placeholder="请输入公司类型"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<div class="mt-4">
|
||||
<el-table
|
||||
:data="pager.lists"
|
||||
size="large"
|
||||
@cell-click="handleCurrentChange"
|
||||
>
|
||||
<el-table-column label="ID" prop="id" min-width="60" />>
|
||||
<el-table-column label="头像" min-width="100">
|
||||
<template #default="{ row }">
|
||||
<el-avatar :size="50" :src="row.avatar"></el-avatar>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="姓名" prop="name" min-width="100" />
|
||||
<el-table-column label="联系方式" prop="account" min-width="130" />
|
||||
<el-table-column
|
||||
label="隶属公司"
|
||||
prop="company.company_name"
|
||||
min-width="120"
|
||||
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" />
|
||||
<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="最近登录时间"
|
||||
prop="login_time"
|
||||
min-width="180"
|
||||
/>
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
prop="create_time"
|
||||
min-width="180"
|
||||
align="center"
|
||||
/>
|
||||
<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 { useDictData } from "@/hooks/useDictOptions";
|
||||
import { apiCompanyLists, apiCompanyDelete } from "@/api/company";
|
||||
import { defineEmits } from "vue";
|
||||
import { adminLists } from "@/api/perms/admin";
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
level_two: "",
|
||||
level_one: "",
|
||||
company_name: "",
|
||||
organization_code: "",
|
||||
city: "",
|
||||
area: "",
|
||||
street: "",
|
||||
company_type: "",
|
||||
master_name: "",
|
||||
master_position: "",
|
||||
master_phone: "",
|
||||
master_email: "",
|
||||
other_contacts: "",
|
||||
area_manager: "",
|
||||
is_contract: "",
|
||||
account: "",
|
||||
password: "",
|
||||
deposit: "",
|
||||
deposit_time: "",
|
||||
qualification: "",
|
||||
status: "",
|
||||
});
|
||||
|
||||
// 选中数据
|
||||
const emits = defineEmits(["customEvent"]);
|
||||
|
||||
// 选中数据子父传递
|
||||
const handleCurrentChange = (value: any) => {
|
||||
emits("customEvent", value);
|
||||
};
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: adminLists,
|
||||
params: queryParams,
|
||||
});
|
||||
|
||||
getLists();
|
||||
</script>
|
|
@ -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="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";
|
||||
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>
|
|
@ -0,0 +1,378 @@
|
|||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup
|
||||
ref="popupRef"
|
||||
:title="popupTitle"
|
||||
:async="true"
|
||||
width="80vw"
|
||||
@confirm="handleSubmit"
|
||||
@close="handleClose"
|
||||
>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="120px"
|
||||
>
|
||||
<el-col>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="审批流名称" prop="name">
|
||||
<el-input
|
||||
v-model="formData.name"
|
||||
clearable
|
||||
placeholder="请输入审批流名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="应用模块" prop="type">
|
||||
<el-select
|
||||
v-model="formData.type"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
>
|
||||
<el-option label="假勤" :value="1"></el-option>
|
||||
<el-option label="行政" :value="2"></el-option>
|
||||
<el-option label="财务" :value="3"></el-option>
|
||||
<el-option label="人事" :value="4"></el-option>
|
||||
<el-option label="其他" :value="5"></el-option>
|
||||
<el-option label="报销" :value="6"></el-option>
|
||||
<el-option label="发票" :value="7"></el-option>
|
||||
<el-option label="合同" :value="8"></el-option>
|
||||
</el-select> </el-form-item
|
||||
></el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="审批类型" prop="flow_cate">
|
||||
<el-select
|
||||
v-model="formData.flow_cate"
|
||||
placeholder="审批类型"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
>
|
||||
<el-option label="日常审批" :value="1"></el-option>
|
||||
<el-option label="报销审批" :value="2"></el-option>
|
||||
<el-option label="发票审批" :value="3"></el-option>
|
||||
<el-option label="合同审批" :value="4"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-form-item label="流程说明" prop="remark">
|
||||
<el-input
|
||||
v-model="formData.remark"
|
||||
clearable
|
||||
type="textarea"
|
||||
placeholder="请输入流程说明"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item
|
||||
label="流程类型"
|
||||
prop="flow_detail.check_type"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
>
|
||||
<el-radio-group
|
||||
v-model="formData.flow_detail.type"
|
||||
@change="checkTypeFn"
|
||||
>
|
||||
<el-radio :label="1">固定审批</el-radio>
|
||||
<el-radio :label="2">授权审批人</el-radio>
|
||||
<el-radio :label="3">可回退审批 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<p v-if="formData.flow_detail.type == 1">
|
||||
<el-row v-for="(item, index) in formData.flow_detail.step">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审批流程">
|
||||
<el-select
|
||||
v-model="formData.flow_detail.step[index].type"
|
||||
placeholder="审批类型"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
>
|
||||
<el-option label="当前部门负责人" value="1"></el-option>
|
||||
<el-option label="上一级部门负责人" value="2"></el-option>
|
||||
<el-option label="指定用户(任意一人)" value="3"></el-option>
|
||||
<el-option label="指定用户(多人会签)" value="4"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="item.type == '3' || item.type == '4'">
|
||||
<el-form-item label="指定人员">
|
||||
<el-input
|
||||
clearable
|
||||
v-model="item.user[0].name"
|
||||
placeholder="指定人员"
|
||||
@click="test(index)"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item prop="field126">
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="
|
||||
formData.flow_detail.step.push({
|
||||
type: '',
|
||||
user: [{ id: '', name: '' }],
|
||||
})
|
||||
"
|
||||
>其他联系人</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</p>
|
||||
<el-row v-if="formData.flow_detail.type == 2">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="">
|
||||
<span>无需审批</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<p v-if="formData.flow_detail.type == 3">
|
||||
<el-row v-for="(item, index) in formData.flow_detail.step">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审批流程" prop="copy_uids">
|
||||
<el-input
|
||||
v-model="item.type"
|
||||
clearable
|
||||
placeholder="请输入流程名称"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="指定人员">
|
||||
<el-input
|
||||
v-model="item.user[0].name"
|
||||
@click="test(index)"
|
||||
clearable
|
||||
placeholder="指定人员"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item prop="field126">
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="
|
||||
formData.flow_detail.step.push({
|
||||
type: '',
|
||||
user: [{ id: '', name: '' }],
|
||||
})
|
||||
"
|
||||
>其他联系人</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</p>
|
||||
|
||||
<el-form-item label="抄送人ID" prop="copy_unames">
|
||||
<el-input
|
||||
v-model="formData.copy_to[0].name"
|
||||
clearable
|
||||
@click="isCompany = true"
|
||||
placeholder="请输入抄送人"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<!-- <el-form-item label="创建人ID" prop="admin_id">
|
||||
<el-input
|
||||
v-model="formData.admin_id"
|
||||
clearable
|
||||
placeholder="请输入创建人ID"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="状态 1启用,0禁用" prop="status">
|
||||
<el-select v-model="formData.status">
|
||||
<el-option label="启用" value="1"></el-option>
|
||||
<el-option label="禁用" value="2"></el-option>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="删除人ID" prop="delete_user_id">
|
||||
<el-input
|
||||
v-model="formData.delete_user_id"
|
||||
clearable
|
||||
placeholder="请输入删除人ID"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
</el-form>
|
||||
</popup>
|
||||
<el-dialog v-model="isCompany" title="选择人员" width="60%">
|
||||
<DialogIndex @customEvent="customEvent" />
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="flowEdit">
|
||||
import type { FormInstance } from "element-plus";
|
||||
import Popup from "@/components/popup/index.vue";
|
||||
import { apiFlowCreat, apiFlowDetil } from "@/api/examined";
|
||||
import { timeFormat } from "@/utils/util";
|
||||
import DialogIndex from "./dialog_index.vue";
|
||||
import type { PropType } from "vue";
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({}),
|
||||
},
|
||||
});
|
||||
const isCompany = ref(false);
|
||||
const emit = defineEmits(["success", "close"]);
|
||||
const formRef = shallowRef<FormInstance>();
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>();
|
||||
const mode = ref("add");
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == "edit" ? "编辑审批流程表" : "新增审批流程表";
|
||||
});
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
// flow_detail: {
|
||||
// type: 1,
|
||||
// layer: [
|
||||
// { type: 1 },
|
||||
// { type: 3, user: [{ id: 1, name: "sdf" }] },
|
||||
// { name: "看见对方" },
|
||||
// ],
|
||||
// },
|
||||
|
||||
id: "",
|
||||
name: "",
|
||||
check_type: "",
|
||||
type: "",
|
||||
flow_cate: "",
|
||||
remark: "",
|
||||
// admin_id: "",
|
||||
flow_detail: {
|
||||
type: 1,
|
||||
step: [{ type: "", user: [{ id: "", name: "" }] }],
|
||||
},
|
||||
// flowType: [""],
|
||||
// flowUnamesA: [""],
|
||||
// flowUidsA: [],
|
||||
// flowName: [""],
|
||||
// flowUnamesB: [""],
|
||||
// flowUidsB: [],
|
||||
copy_to: [{ id: "", name: "" }],
|
||||
});
|
||||
//单选框改变时清空单选下的表单数据
|
||||
const checkTypeFn = () => {
|
||||
formData.flow_detail.step = [{ type: "", user: [{ id: "", name: "" }] }];
|
||||
};
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
name: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入审批流名称",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
check_type: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入1固定审批,2授权审批人",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
type: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入应用模块,1假勤,2行政,3财务,4人事,5其他,6报销,7发票,8合同",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
flow_cate: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入应用审批类型id",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
|
||||
remark: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入流程说明",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
});
|
||||
// dialog弹出框选择时i=-1代表抄送人,其余为flow_detail的step下标
|
||||
let i = -1;
|
||||
const test = (index: number) => {
|
||||
isCompany.value = true;
|
||||
i = index;
|
||||
};
|
||||
function customEvent(data: any) {
|
||||
isCompany.value = false;
|
||||
if (i == -1) {
|
||||
formData.copy_to[0].id = data.id;
|
||||
formData.copy_to[0].name = data.name;
|
||||
} else {
|
||||
formData.flow_detail.step[i].user[0].id = data.id;
|
||||
formData.flow_detail.step[i].user[0].name = data.name;
|
||||
}
|
||||
i = -1;
|
||||
}
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
let res = await apiFlowDetil(data.id);
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = res[key];
|
||||
}
|
||||
}
|
||||
formData.flow_detail.type = Number(formData.flow_detail.type);
|
||||
};
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
// const data = await apiFlowDetail({
|
||||
// id: row.id,
|
||||
// });
|
||||
// setFormData(data);
|
||||
};
|
||||
const a = {};
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate();
|
||||
mode.value == "edit"
|
||||
? await apiFlowCreat(formData)
|
||||
: await apiFlowCreat(formData);
|
||||
popupRef.value?.close();
|
||||
emit("success");
|
||||
};
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = "add") => {
|
||||
mode.value = type;
|
||||
popupRef.value?.open();
|
||||
};
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit("close");
|
||||
};
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail,
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,166 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<el-button v-perms="['flow_type/add']" type="primary" @click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<!-- <el-button
|
||||
v-perms="['flow_type/delete']"
|
||||
:disabled="!selectData.length"
|
||||
@click="handleDelete(selectData)"
|
||||
>
|
||||
删除
|
||||
</el-button> -->
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
{{ pager }}
|
||||
<el-table-column
|
||||
label="id"
|
||||
prop="id"
|
||||
show-overflow-tooltip
|
||||
width="60"
|
||||
/>
|
||||
<el-table-column label="名称" prop="title" show-overflow-tooltip />
|
||||
<el-table-column
|
||||
label="应用部门"
|
||||
prop="department"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column label="标识" prop="name" show-overflow-tooltip />
|
||||
<el-table-column label="图标" prop="icon" show-overflow-tooltip />
|
||||
<el-table-column
|
||||
label="所属分类"
|
||||
prop="type_name"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<!-- <el-table-column label="状态" prop="status" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.status == 1" style="color: #67c23a">正常</span>
|
||||
<span v-else style="color: #fe0000">禁用</span>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column
|
||||
label="账号状态"
|
||||
min-width="100"
|
||||
v-perms="['auth.admin/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="操作"
|
||||
align="center"
|
||||
width="auto"
|
||||
fixed="right"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
v-perms="['flow/edit']"
|
||||
type="primary"
|
||||
link
|
||||
@click="handleEdit(row)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['flow/delete']"
|
||||
type="danger"
|
||||
link
|
||||
@click="handleDelete(row.id)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<edit-popup
|
||||
v-if="showEdit"
|
||||
ref="editRef"
|
||||
:dict-data="dictData"
|
||||
@success="getLists"
|
||||
@close="showEdit = false"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="flowTypeLists">
|
||||
import { usePaging } from "@/hooks/usePaging";
|
||||
import { useDictData } from "@/hooks/useDictOptions";
|
||||
import { apiCateLists, apiCateStatus } from "@/api/examined";
|
||||
import { timeFormat } from "@/utils/util";
|
||||
import feedback from "@/utils/feedback";
|
||||
// import { getRoutePath } from "router";
|
||||
import EditPopup from "./editCate.vue";
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>();
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false);
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
type: "",
|
||||
title: "",
|
||||
name: "",
|
||||
icon: "",
|
||||
department_ids: "",
|
||||
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: apiCateLists,
|
||||
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>
|
|
@ -0,0 +1,248 @@
|
|||
<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="1固定审批,2授权审批人" prop="check_type">
|
||||
<el-input class="w-[280px]" v-model="queryParams.check_type" clearable placeholder="请输入1固定审批,2授权审批人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="应用模块,1假勤,2行政,3财务,4人事,5其他,6报销,7发票,8合同" prop="type">
|
||||
<el-input class="w-[280px]" v-model="queryParams.type" clearable placeholder="请输入应用模块,1假勤,2行政,3财务,4人事,5其他,6报销,7发票,8合同" />
|
||||
</el-form-item>
|
||||
<el-form-item label="应用审批类型id" prop="flow_cate">
|
||||
<el-input class="w-[280px]" v-model="queryParams.flow_cate" clearable placeholder="请输入应用审批类型id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="应用部门ID(0为全部)1,2,3" prop="department_ids">
|
||||
<el-input class="w-[280px]" v-model="queryParams.department_ids" clearable placeholder="请输入应用部门ID(0为全部)1,2,3" />
|
||||
</el-form-item>
|
||||
<el-form-item label="抄送人ID" prop="copy_uids">
|
||||
<el-input class="w-[280px]" v-model="queryParams.copy_uids" clearable placeholder="请输入抄送人ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="流程说明" prop="remark">
|
||||
<el-input class="w-[280px]" v-model="queryParams.remark" clearable placeholder="请输入流程说明" />
|
||||
</el-form-item>
|
||||
<el-form-item label="流程数据序列化" prop="flow_list">
|
||||
<el-input class="w-[280px]" v-model="queryParams.flow_list" clearable placeholder="请输入流程数据序列化" />
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人ID" prop="admin_id">
|
||||
<el-input class="w-[280px]" v-model="queryParams.admin_id" clearable placeholder="请输入创建人ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态 1启用,0禁用" prop="status">
|
||||
<el-input class="w-[280px]" v-model="queryParams.status" clearable placeholder="请输入状态 1启用,0禁用" />
|
||||
</el-form-item>
|
||||
<el-form-item label="删除人ID" prop="delete_user_id">
|
||||
<el-input class="w-[280px]" v-model="queryParams.delete_user_id" clearable placeholder="请输入删除人ID" />
|
||||
</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="['flow/add']" type="primary" @click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<!-- <el-button
|
||||
v-perms="['flow/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="name"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<!-- <el-table-column label="1固定审批,2授权审批人" prop="check_type" show-overflow-tooltip /> -->
|
||||
<el-table-column label="应用模块" prop="type" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.type == 1">假勤</span>
|
||||
<span v-if="row.type == 2">行政</span>
|
||||
<span v-if="row.type == 3">财务</span>
|
||||
<span v-if="row.type == 4">人事</span>
|
||||
<span v-if="row.type == 5">其他</span>
|
||||
<span v-if="row.type == 6">报销</span>
|
||||
<span v-if="row.type == 7">发票</span>
|
||||
<span v-if="row.type == 8">合同</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="应用审批类型id"
|
||||
prop="flow_cate"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="应用部门"
|
||||
prop="department"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="抄送人ID"
|
||||
prop="copy_uids"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="流程说明"
|
||||
prop="remark"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="流程数据序列化"
|
||||
prop="flow_list"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="创建人ID"
|
||||
prop="admin_id"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<!-- <el-table-column label="状态" prop="status" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.status == 1">启用</span>
|
||||
<span v-if="row.status == 0">禁用</span>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column
|
||||
label="账号状态"
|
||||
min-width="100"
|
||||
v-perms="['auth.admin/edit']"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-switch
|
||||
v-if="row.root != 1"
|
||||
v-model="row.status"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
@change="changeStatus(row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="删除人ID"
|
||||
prop="delete_user_id"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
v-perms="['flow/edit']"
|
||||
type="primary"
|
||||
link
|
||||
@click="handleEdit(row)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['flow/delete']"
|
||||
type="danger"
|
||||
link
|
||||
@click="handleDelete(row.id)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<edit-popup
|
||||
v-if="showEdit"
|
||||
ref="editRef"
|
||||
:dict-data="dictData"
|
||||
@success="getLists"
|
||||
@close="showEdit = false"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="flowLists">
|
||||
import { usePaging } from "@/hooks/usePaging";
|
||||
import { useDictData } from "@/hooks/useDictOptions";
|
||||
import { apiFlowLists, apiFlowDetil, apiFlowStatus } from "@/api/examined";
|
||||
import { timeFormat } from "@/utils/util";
|
||||
import feedback from "@/utils/feedback";
|
||||
import EditPopup from "./editFlow.vue";
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>();
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false);
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
name: "",
|
||||
check_type: "",
|
||||
type: "",
|
||||
flow_cate: "",
|
||||
department_ids: "",
|
||||
copy_uids: "",
|
||||
remark: "",
|
||||
flow_list: "",
|
||||
admin_id: "",
|
||||
status: "",
|
||||
delete_user_id: "",
|
||||
});
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([]);
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id);
|
||||
};
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData("");
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiFlowLists,
|
||||
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 changeStatus = (row: any) => {
|
||||
console.log(row.status);
|
||||
apiFlowStatus({ id: row.id, status: row.status });
|
||||
};
|
||||
|
||||
// 删除
|
||||
// const handleDelete = async (id: number | any[]) => {
|
||||
// await feedback.confirm("确定要删除?");
|
||||
// await apiFlowDelete({ id });
|
||||
// getLists();
|
||||
// };
|
||||
|
||||
getLists();
|
||||
</script>
|
|
@ -0,0 +1,233 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="任务名称" prop="name">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.name"
|
||||
clearable
|
||||
placeholder="请输入任务名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="审核状态" prop="name">
|
||||
<el-select
|
||||
v-model="queryParams.check_status"
|
||||
placeholder="请选择审核状态"
|
||||
clearable
|
||||
class="w-[280px]"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in checkStatusList"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column label="ID" prop="id" />
|
||||
<el-table-column
|
||||
label="任务名称"
|
||||
prop="task.title"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="任务描述"
|
||||
prop="task.content"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="任务金额"
|
||||
prop="task.money"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="任务提交时间"
|
||||
prop="task.update_time"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="公司名称"
|
||||
prop="company_name"
|
||||
show-overflow-tooltip
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="片区经理"
|
||||
prop="area_manager"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="审核状态"
|
||||
prop="check_status"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.check_status == 3" style="color: #f56c6c"
|
||||
>未通过</span
|
||||
>
|
||||
<span v-if="row.check_status == 2" style="color: #67c23a"
|
||||
>已通过</span
|
||||
>
|
||||
<span v-if="row.check_status == 1" style="color: #e6a23c"
|
||||
>待审核</span
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" prop="remark" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
v-if="row.check_status <= 1"
|
||||
v-perms="['flow/edit']"
|
||||
type="primary"
|
||||
link
|
||||
@click="handleEdit(row, 'edit')"
|
||||
>
|
||||
审核
|
||||
</el-button>
|
||||
<el-button
|
||||
v-else
|
||||
type="primary"
|
||||
link
|
||||
@click="handleEdit(row, 'details')"
|
||||
>
|
||||
详情
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex justify-end mt-4">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<audit-other-popup
|
||||
v-if="showEdit && showAuditOther"
|
||||
ref="auditOtherRef"
|
||||
:dict-data="dictData"
|
||||
@success="getLists"
|
||||
@close="showEdit = false"
|
||||
/>
|
||||
<audit-town-market-popup
|
||||
v-else-if="showEdit && openType == 4"
|
||||
ref="auditTownMarketRef"
|
||||
:dict-data="dictData"
|
||||
@success="getLists"
|
||||
@close="showEdit = false"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="flowLists">
|
||||
import { usePaging } from "@/hooks/usePaging";
|
||||
import { useDictData } from "@/hooks/useDictOptions";
|
||||
import { apiApproveList } from "@/api/examined";
|
||||
import { timeFormat } from "@/utils/util";
|
||||
import feedback from "@/utils/feedback";
|
||||
import auditOtherPopup from "./components/audit_other.vue";
|
||||
import auditTownMarketPopup from "./components/audit_town_market.vue";
|
||||
import { getTaskApproveTypeList } from "@/api/setting/dict";
|
||||
import { show } from "dom7";
|
||||
|
||||
const auditOtherRef = shallowRef<InstanceType<typeof auditOtherPopup>>();
|
||||
const auditTownMarketRef =
|
||||
shallowRef<InstanceType<typeof auditTownMarketPopup>>();
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false);
|
||||
const openType = ref(1);
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
name: "",
|
||||
check_status: "",
|
||||
type: "1,4",
|
||||
});
|
||||
|
||||
const checkStatusList = ref([
|
||||
{
|
||||
id: 1,
|
||||
name: "待审核",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: "已通过",
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: "未通过",
|
||||
},
|
||||
]);
|
||||
|
||||
// 显示默认审批界面的类型
|
||||
const showAuditTypeList = ref([1, 5, 6]);
|
||||
const showAuditOther = computed(() => {
|
||||
return showAuditTypeList.value.includes(openType.value);
|
||||
});
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([]);
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id);
|
||||
};
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData("");
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiApproveList,
|
||||
params: queryParams,
|
||||
});
|
||||
|
||||
|
||||
// 添加
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true;
|
||||
await nextTick();
|
||||
auditOtherRef.value?.open("add");
|
||||
};
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (data: any, type = "edit") => {
|
||||
openType.value = data.type;
|
||||
showEdit.value = true;
|
||||
await nextTick();
|
||||
if (showAuditOther.value) {
|
||||
auditOtherRef.value?.open(type);
|
||||
auditOtherRef.value?.setFormData(data);
|
||||
} else if (data.type == 4) {
|
||||
auditTownMarketRef.value?.open(type);
|
||||
auditTownMarketRef.value?.setFormData(data);
|
||||
}
|
||||
};
|
||||
|
||||
// 删除
|
||||
// const handleDelete = async (id: number | any[]) => {
|
||||
// await feedback.confirm("确定要删除?");
|
||||
// await apiFlowDelete({ id });
|
||||
// getLists();
|
||||
// };
|
||||
|
||||
getTaskApproveTypeList().then((res) => {
|
||||
queryParams.type = res.join(",");
|
||||
getLists();
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,291 @@
|
|||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup
|
||||
ref="popupRef"
|
||||
:title="popupTitle"
|
||||
:async="true"
|
||||
width="800px"
|
||||
@confirm="handleSubmit"
|
||||
@close="handleClose"
|
||||
:button="mode == 'edit'"
|
||||
:clickModalClose="mode == 'details'"
|
||||
>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="120px"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="ID" prop="id">
|
||||
<el-input readonly v-model="formData.id" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="任务名称" prop="task.title">
|
||||
<el-input readonly v-model="formData.task.title" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="任务金额" prop="task.money">
|
||||
<el-input readonly v-model="formData.task.money" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所属公司" prop="company_name">
|
||||
<el-input readonly v-model="formData.company_name" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="任务描述" prop="task.content">
|
||||
<el-input
|
||||
readonly
|
||||
v-model="formData.task.content"
|
||||
clearable
|
||||
type="textarea"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="任务提交时间" prop="id">
|
||||
<el-input readonly v-model="formData.task.update_time" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="片区经理" prop="flow_cate">
|
||||
<el-input readonly v-model="formData.area_manager" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-divider />
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="详情描述" prop="remark">
|
||||
<el-input
|
||||
readonly
|
||||
:value="formData.task?.extend?.other?.note"
|
||||
clearable
|
||||
type="textarea"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="图片附件">
|
||||
<el-image
|
||||
class="attachment"
|
||||
v-for="(item, index) in formData.task?.extend?.other?.annex"
|
||||
:key="index"
|
||||
:src="item"
|
||||
:preview-src-list="formData.task?.extend?.other?.annex"
|
||||
:initial-index="index"
|
||||
fit="cover"
|
||||
></el-image>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="视频附件">
|
||||
<video
|
||||
class="video"
|
||||
:src="item"
|
||||
v-for="(item, index) in formData.task?.extend?.other
|
||||
?.video_annex"
|
||||
:key="index"
|
||||
controls
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-divider />
|
||||
<!-- <el-col :span="24">
|
||||
<el-form-item label="">
|
||||
<el-timeline>
|
||||
<el-timeline-item
|
||||
v-for="(activity, index) in activities"
|
||||
:key="index"
|
||||
:type="activity.type"
|
||||
:hollow="activity.hollow"
|
||||
:timestamp="activity.timestamp"
|
||||
>
|
||||
{{ activity.content }}
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="审核"
|
||||
prop="check_status"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
|
||||
>
|
||||
<el-radio-group
|
||||
:disabled="mode == 'details'"
|
||||
v-model="formData.check_status"
|
||||
>
|
||||
<el-radio :label="2">通过</el-radio>
|
||||
<el-radio :label="3">驳回</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
:readonly="mode == 'details'"
|
||||
v-model="formData.remark"
|
||||
clearable
|
||||
type="textarea"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="flowEdit">
|
||||
import type { FormInstance } from "element-plus";
|
||||
import Popup from "@/components/popup/index.vue";
|
||||
import { apiApproveAudit } from "@/api/examined";
|
||||
import { timeFormat } from "@/utils/util";
|
||||
import type { PropType } from "vue";
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({}),
|
||||
},
|
||||
});
|
||||
const isCompany = ref(false);
|
||||
const emit = defineEmits(["success", "close"]);
|
||||
const formRef = shallowRef<FormInstance>();
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>();
|
||||
const mode = ref("add");
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == "edit" ? "审核" : "详情";
|
||||
});
|
||||
|
||||
const activities = ref([
|
||||
{
|
||||
content: "任务完成",
|
||||
timestamp: "2023-8-28 13:30:00",
|
||||
},
|
||||
{
|
||||
content: "张三三审核",
|
||||
timestamp: "2023-8-28 13:30:00",
|
||||
},
|
||||
{
|
||||
content: "李思思审核",
|
||||
timestamp: "2023-8-28 13:30:00",
|
||||
type: "primary",
|
||||
hollow: true,
|
||||
},
|
||||
]);
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: "",
|
||||
task: {},
|
||||
company_name: "",
|
||||
area_manager: "",
|
||||
check_status: 1,
|
||||
remark: "",
|
||||
});
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
check_status: [
|
||||
{
|
||||
required: true,
|
||||
validator: (rules: any, value: any, callback: any) => {
|
||||
if (value != 2 && value != 3) callback("请选择审核状态");
|
||||
else callback();
|
||||
},
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
// remark: [
|
||||
// {
|
||||
// required: false,
|
||||
// validator: (rules: any, value: any, callback: any) => {
|
||||
// if (formData.check_status == 3) callback("请填写备注");
|
||||
// else callback();
|
||||
// },
|
||||
// trigger: ["blur"],
|
||||
// },
|
||||
// ],
|
||||
});
|
||||
function customEvent(data: any) {
|
||||
isCompany.value = false;
|
||||
}
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
// let res = await apiFlowDetil(data.id);
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
// const data = await apiFlowDetail({
|
||||
// id: row.id,
|
||||
// });
|
||||
// setFormData(data);
|
||||
};
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate();
|
||||
if (formData.check_status == 3 && formData.remark == "")
|
||||
return ElMessage.error("驳回必须填写备注");
|
||||
await apiApproveAudit({
|
||||
id: formData.id,
|
||||
check_status: formData.check_status,
|
||||
remark: formData.remark,
|
||||
});
|
||||
popupRef.value?.close();
|
||||
emit("success");
|
||||
};
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = "add") => {
|
||||
mode.value = type;
|
||||
popupRef.value?.open();
|
||||
};
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit("close");
|
||||
};
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
:deep(.el-timeline-item__wrapper) {
|
||||
top: -8px !important;
|
||||
}
|
||||
.attachment {
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
/* background-color: red; */
|
||||
margin-right: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.video {
|
||||
width: 300px;
|
||||
height: 150px;
|
||||
/* background-color: red; */
|
||||
margin-right: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,141 @@
|
|||
<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-select v-model="queryParams.type" placeholder="请选择审批类型" clearable class="w-[280px]">
|
||||
<el-option v-for="(item, index) in checkStatusList1" :key="index" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="审核状态" prop="name">
|
||||
<el-select v-model="queryParams.check_status" placeholder="请选择审核状态" clearable class="w-[280px]">
|
||||
<el-option v-for="(item, index) in checkStatusList" :key="index" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column label="任务名称" prop="task.title" show-overflow-tooltip />
|
||||
<el-table-column label="任务描述" prop="task.content" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
<el-table-column label="任务金额" prop="task.money" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
<el-table-column label="任务提交时间" prop="task.update_time" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
<el-table-column label="公司名称" prop="company_name" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="片区经理" prop="area_manager" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
<el-table-column label="审核状态" prop="check_status" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.check_status == 3" style="color: #f56c6c">未通过</span>
|
||||
<span v-if="row.check_status == 2" style="color: #67c23a">已通过</span>
|
||||
<span v-if="row.check_status == 1" style="color: #e6a23c">待审核</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" prop="remark" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button v-if="row.check_status <= 1" v-perms="['flow/edit']" type="primary" link @click="handleEdit(row, 'edit')">
|
||||
审核
|
||||
</el-button>
|
||||
<el-button v-else type="primary" link @click="handleEdit(row, 'details')">
|
||||
详情
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="flowLists">
|
||||
import { usePaging } from "@/hooks/usePaging";
|
||||
import { useDictData } from "@/hooks/useDictOptions";
|
||||
// import { merchantApplyLists } from "@/api/examined";
|
||||
import { timeFormat } from "@/utils/util";
|
||||
import feedback from "@/utils/feedback";
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
check_status: "",
|
||||
type: "",
|
||||
});
|
||||
|
||||
const checkStatusList = ref([
|
||||
{
|
||||
id: 1,
|
||||
name: "待审核",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: "已通过",
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: "未通过",
|
||||
},
|
||||
]);
|
||||
const checkStatusList1 = ref([
|
||||
{
|
||||
id: 2,
|
||||
name: "商户入驻审批",
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
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: merchantApplyLists,
|
||||
params: queryParams,
|
||||
});
|
||||
|
||||
// 添加
|
||||
// const handleAdd = async () => {
|
||||
// showEdit.value = true;
|
||||
// await nextTick();
|
||||
// editRef.value?.open("add");
|
||||
// };
|
||||
|
||||
// // 编辑
|
||||
// const handleEdit = async (data: any, type = "edit") => {
|
||||
// showEdit.value = true;
|
||||
// await nextTick();
|
||||
// editRef.value?.open(type);
|
||||
// editRef.value?.setFormData(data);
|
||||
// };
|
||||
|
||||
// 删除
|
||||
// const handleDelete = async (id: number | any[]) => {
|
||||
// await feedback.confirm("确定要删除?");
|
||||
// await apiFlowDelete({ id });
|
||||
// getLists();
|
||||
// };
|
||||
|
||||
getLists();
|
||||
</script>
|
|
@ -0,0 +1,214 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<!-- <el-form-item label="店铺名称" prop="name">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.name"
|
||||
clearable
|
||||
placeholder="请输入店铺名称"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="审批类型" prop="name">
|
||||
<el-select v-model="queryParams.type" placeholder="请选择审批类型" clearable class="w-[280px]" @select="getLists">
|
||||
<el-option v-for="(item, index) in typeList" :key="index" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="审核状态" prop="name">
|
||||
<el-select v-model="queryParams.check_status" placeholder="请选择审核状态" clearable class="w-[280px]" @select="getLists">
|
||||
<el-option v-for="(item, index) in checkStatusList" :key="index" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column label="ID" prop="id" />
|
||||
<el-table-column label="店铺名称" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
{{JSON.parse(row.extend).company_name}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="店铺类型" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
{{JSON.parse(row.extend).type_name}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商户分类" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
{{JSON.parse(row.extend).category_name}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="类型" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.type == 2" style="color: #4a5dff">{{ row.name }}</span>
|
||||
<span v-else-if="row.type == 3" style="color: #67c23a">{{
|
||||
row.name
|
||||
}}</span>
|
||||
<span v-else>{{ row.name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="申请时间" prop="create_time" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
<el-table-column label="公司名称" prop="company_name" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="片区经理" prop="area_manager" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
<el-table-column label="审核状态" prop="check_status" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.check_status == 3" style="color: #f56c6c">未通过</span>
|
||||
<span v-if="row.check_status == 2" style="color: #67c23a">已通过</span>
|
||||
<span v-if="row.check_status == 1" style="color: #e6a23c">待审核</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" prop="remark" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
v-if="row.check_status <= 1"
|
||||
v-perms="['flow/edit']"
|
||||
type="primary"
|
||||
link
|
||||
@click="handleEdit(row, 'edit')"
|
||||
>
|
||||
审核
|
||||
</el-button>
|
||||
<el-button
|
||||
v-else
|
||||
type="primary"
|
||||
link
|
||||
@click="handleEdit(row, 'details')"
|
||||
>
|
||||
详情
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<audit-other-popup v-if="showEdit && showAuditOther" ref="auditOtherRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
|
||||
<audit-town-market-popup v-else-if="showEdit && openType == 4" ref="auditTownMarketRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="flowLists">
|
||||
import { usePaging } from "@/hooks/usePaging";
|
||||
import { useDictData } from "@/hooks/useDictOptions";
|
||||
import { apiApproveList2 } from "@/api/examined";
|
||||
import { timeFormat } from "@/utils/util";
|
||||
import feedback from "@/utils/feedback";
|
||||
|
||||
import auditOtherPopup from "./components/audit_other.vue";
|
||||
import auditTownMarketPopup from "./components/audit_town_market.vue";
|
||||
import { watch } from "vue";
|
||||
import { extend } from "lodash-es";
|
||||
|
||||
const auditOtherRef = shallowRef<InstanceType<typeof auditOtherPopup>>();
|
||||
const auditTownMarketRef =
|
||||
shallowRef<InstanceType<typeof auditTownMarketPopup>>();
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false);
|
||||
const openType = ref(1);
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
name: "",
|
||||
check_status: "",
|
||||
type: "2,3",
|
||||
});
|
||||
|
||||
const typeList = ref([
|
||||
{
|
||||
id: "2,3",
|
||||
name: "全部",
|
||||
},
|
||||
{
|
||||
id: "2",
|
||||
name: "商户入驻审批",
|
||||
},
|
||||
{
|
||||
id: "3",
|
||||
name: "开通交易审批",
|
||||
},
|
||||
]);
|
||||
|
||||
const checkStatusList = ref([
|
||||
{
|
||||
id: 1,
|
||||
name: "待审核",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: "已通过",
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: "未通过",
|
||||
},
|
||||
]);
|
||||
|
||||
// 显示默认审批界面的类型
|
||||
const showAuditTypeList = ref([1, 5, 6]);
|
||||
const showAuditOther = computed(() => {
|
||||
return showAuditTypeList.value.includes(openType.value);
|
||||
});
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([]);
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id);
|
||||
};
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData("");
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiApproveList2,
|
||||
params: queryParams,
|
||||
json: "extend",
|
||||
});
|
||||
|
||||
// 添加
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true;
|
||||
await nextTick();
|
||||
auditOtherRef.value?.open("add");
|
||||
};
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (data: any, type = "edit") => {
|
||||
openType.value = data.type;
|
||||
showEdit.value = true;
|
||||
await nextTick();
|
||||
if (showAuditOther) {
|
||||
auditOtherRef.value?.open(type);
|
||||
auditOtherRef.value?.setFormData(data);
|
||||
} else if (data.type == 4) {
|
||||
auditTownMarketRef.value?.open(type);
|
||||
auditTownMarketRef.value?.setFormData(data);
|
||||
}
|
||||
};
|
||||
|
||||
// 删除
|
||||
// const handleDelete = async (id: number | any[]) => {
|
||||
// await feedback.confirm("确定要删除?");
|
||||
// await apiFlowDelete({ id });
|
||||
// getLists();
|
||||
// };
|
||||
|
||||
getLists();
|
||||
</script>
|
|
@ -0,0 +1,258 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="订单编号" prop="order_sn">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.order_sn"
|
||||
clearable
|
||||
placeholder="请输入订单编号"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户" prop="nickname">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.nickname"
|
||||
clearable
|
||||
placeholder="请输入"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="提现金额" prop="amount">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.amount"
|
||||
clearable
|
||||
placeholder="请输入提现金额"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态:" prop="status">
|
||||
<el-select
|
||||
v-model="queryParams.status"
|
||||
clearable
|
||||
placeholder="请选择状态"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in statusList"
|
||||
:key="item.label"
|
||||
:value="item.id"
|
||||
:label="item.name"
|
||||
/>
|
||||
</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="['withdraw/add']" type="primary" @click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['withdraw/delete']"
|
||||
:disabled="!selectData.length"
|
||||
@click="handleDelete(selectData)"
|
||||
>
|
||||
删除
|
||||
</el-button> -->
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<!-- <el-table-column type="selection" width="55" /> -->
|
||||
<el-table-column label="ID" prop="id" width="110" />
|
||||
<el-table-column
|
||||
label="订单编号"
|
||||
prop="order_sn"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="公司"
|
||||
prop="company_name"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column label="用户" prop="nickname" show-overflow-tooltip />
|
||||
<el-table-column
|
||||
label="提现金额"
|
||||
prop="amount"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column label="状态" prop="status" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.status == 0" style="color: #e6a23c">待审核</span>
|
||||
<span v-if="row.status == 1" style="color: #409eff">通过</span>
|
||||
<span v-if="row.status == 2" style="color: #f56c6c">拒绝</span>
|
||||
<span v-if="row.status == 3" style="color: #67c23a">已转账</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="提现时间"
|
||||
prop="create_time"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="备注"
|
||||
prop="deny_desc"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<!-- <el-button
|
||||
v-perms="['withdraw/edit']"
|
||||
type="primary"
|
||||
link
|
||||
@click="handleEdit(row)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['withdraw/delete']"
|
||||
type="danger"
|
||||
link
|
||||
@click="handleDelete(row.id)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
-->
|
||||
<el-button
|
||||
v-perms="['withdraw/audit']"
|
||||
type="primary"
|
||||
link
|
||||
v-if="row.status == 0"
|
||||
@click="handleAudit(row, true)"
|
||||
>
|
||||
审核
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['withdraw/audit']"
|
||||
type="primary"
|
||||
link
|
||||
v-else
|
||||
@click="handleAudit(row, false)"
|
||||
>
|
||||
详情
|
||||
</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"
|
||||
/>
|
||||
<audit-popup
|
||||
v-if="showAudit"
|
||||
ref="auditRef"
|
||||
:dict-data="dictData"
|
||||
@success="getLists"
|
||||
@close="showAudit = false"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="withdrawLists">
|
||||
import { usePaging } from "@/hooks/usePaging";
|
||||
import { useDictData } from "@/hooks/useDictOptions";
|
||||
import { apiWithdrawLists, apiWithdrawDelete } from "@/api/withdraw";
|
||||
import { timeFormat } from "@/utils/util";
|
||||
import feedback from "@/utils/feedback";
|
||||
import EditPopup from "./edit.vue";
|
||||
import AuditPopup from "./audit.vue";
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>();
|
||||
const auditRef = shallowRef<InstanceType<typeof AuditPopup>>();
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false);
|
||||
const showAudit = ref(false);
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
order_sn: "",
|
||||
user_id: "",
|
||||
nickname: "",
|
||||
company_name: "",
|
||||
admin_id: "",
|
||||
amount: "",
|
||||
status: "",
|
||||
});
|
||||
|
||||
// 状态:0待审核,1通过,2拒绝,3已转账
|
||||
const statusList = ref([
|
||||
{
|
||||
id: 0,
|
||||
name: "待审核",
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
name: "通过",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: "拒绝",
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
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: apiWithdrawLists,
|
||||
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 handleAudit = async (data: any, type: boolean) => {
|
||||
showAudit.value = true;
|
||||
await nextTick();
|
||||
auditRef.value?.open(type ? "audit" : "detail");
|
||||
auditRef.value?.setFormData(data);
|
||||
};
|
||||
|
||||
// 删除
|
||||
const handleDelete = async (id: number | any[]) => {
|
||||
await feedback.confirm("确定要删除?");
|
||||
await apiWithdrawDelete({ id });
|
||||
getLists();
|
||||
};
|
||||
|
||||
getLists();
|
||||
</script>
|
|
@ -0,0 +1,287 @@
|
|||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup
|
||||
ref="popupRef"
|
||||
:title="popupTitle"
|
||||
:async="true"
|
||||
width="550px"
|
||||
@confirm="handleSubmit"
|
||||
@close="handleClose"
|
||||
:button="mode == 'audit'"
|
||||
>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
label-width="90px"
|
||||
:rules="formRules"
|
||||
>
|
||||
<el-form-item label="订单编号" prop="order_sn">
|
||||
<el-input
|
||||
readonly
|
||||
v-model="formData.order_sn"
|
||||
clearable
|
||||
placeholder="请输入订单编号"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="提现金额" prop="amount">
|
||||
<el-input
|
||||
readonly
|
||||
v-model="formData.amount"
|
||||
clearable
|
||||
placeholder="请输入提现金额"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="电子发票" prop="invoice">
|
||||
<el-button
|
||||
v-if="formData.invoice"
|
||||
type="primary"
|
||||
link
|
||||
@click="openTransfer(formData.invoice)"
|
||||
>查看发票</el-button
|
||||
>
|
||||
<el-button v-else link>暂无发票</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="余额详情" prop="amount">
|
||||
<el-button type="primary" link>
|
||||
<router-link
|
||||
:to="{
|
||||
path: getRoutePath('finance.account_log/lists'),
|
||||
query: {
|
||||
company_id: formData.company_id,
|
||||
s_date: formData.s_date,
|
||||
e_date: formData.e_date,
|
||||
},
|
||||
}"
|
||||
>查看明细</router-link
|
||||
>
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="审核" prop="status">
|
||||
<el-radio-group v-model="formData.status" :disabled="mode != 'audit'">
|
||||
<el-radio :label="1">通过</el-radio>
|
||||
<el-radio :label="2">拒绝</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="formData.status == 2"
|
||||
label="备注"
|
||||
prop="deny_desc"
|
||||
:readonly="mode != 'audit'"
|
||||
>
|
||||
<el-input
|
||||
v-model="formData.deny_desc"
|
||||
clearable
|
||||
type="textarea"
|
||||
placeholder="请输入备注"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-else label="转账凭证" prop="transfer_voucher">
|
||||
<el-upload
|
||||
v-if="mode == 'audit'"
|
||||
class="upload-demo"
|
||||
style="width: 100%"
|
||||
drag
|
||||
:accept="fileTypeList.join(', ')"
|
||||
:headers="{ Token: userStore.token }"
|
||||
:action="actionUrl"
|
||||
:limit="1"
|
||||
:on-success="handleFile"
|
||||
:on-exceed="handleExceed"
|
||||
:before-upload="beforeUpload"
|
||||
ref="upload"
|
||||
>
|
||||
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
||||
<div class="el-upload__text">文件拖入或点击上传</div>
|
||||
<template #tip>
|
||||
<div class="el-upload__tip">请上传JPG/JPEG/PNG/GIF/PDF文件</div>
|
||||
</template>
|
||||
</el-upload>
|
||||
<el-button
|
||||
v-else
|
||||
type="primary"
|
||||
link
|
||||
@click="openTransfer(formData.transfer_voucher)"
|
||||
>
|
||||
查看凭证
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="withdrawEdit">
|
||||
import type { FormInstance, UploadRawFile } from "element-plus";
|
||||
import Popup from "@/components/popup/index.vue";
|
||||
import {
|
||||
apiWithdrawAdd,
|
||||
apiWithdrawEdit,
|
||||
apiWithdrawDetail,
|
||||
withdrawAudit,
|
||||
} from "@/api/withdraw";
|
||||
import { timeFormat } from "@/utils/util";
|
||||
import type { PropType } from "vue";
|
||||
import { getRoutePath } from "@/router";
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
import { genFileId } from "element-plus";
|
||||
import { inject } from "vue";
|
||||
const userStore = useUserStore();
|
||||
const base_url: any = inject("base_url");
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({}),
|
||||
},
|
||||
});
|
||||
const emit = defineEmits(["success", "close"]);
|
||||
const formRef = shallowRef<FormInstance>();
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>();
|
||||
const mode = ref("audit");
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == "audit" ? "审核提现申请" : "提现申请详情";
|
||||
});
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: "",
|
||||
order_sn: "",
|
||||
user_id: "",
|
||||
admin_id: "",
|
||||
amount: "",
|
||||
status: "",
|
||||
transfer_voucher: "",
|
||||
deny_desc: "",
|
||||
company_id: "",
|
||||
company_name: "",
|
||||
s_date: "",
|
||||
e_date: "",
|
||||
invoice: "",
|
||||
});
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
status: [
|
||||
{
|
||||
required: true,
|
||||
// message: "请选择审核是否通过",
|
||||
validator: (rule: any, value: any, callback: any) => {
|
||||
if (value == 1 || value == 2) {
|
||||
callback();
|
||||
} else {
|
||||
callback(new Error("请选择审核是否通过!"));
|
||||
}
|
||||
},
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
transfer_voucher: [
|
||||
{
|
||||
required: true,
|
||||
message: "请先上传凭证",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
deny_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];
|
||||
}
|
||||
}
|
||||
formData.invoice =
|
||||
"https://ceshi-worker-task.lihaink.cn/uploads/files/20230918/20230918093829d92260738.pdf";
|
||||
};
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiWithdrawDetail({
|
||||
id: row.id,
|
||||
});
|
||||
setFormData(data);
|
||||
};
|
||||
|
||||
// 文件选择
|
||||
const upload = ref(null);
|
||||
// 文件上传地址
|
||||
const actionUrl = ref("");
|
||||
const fileTypeList = [
|
||||
"application/pdf",
|
||||
"image/jpeg",
|
||||
"image/gif",
|
||||
"image/png",
|
||||
];
|
||||
// 限制上传类型
|
||||
const beforeUpload = (rawFile: UploadRawFile) => {
|
||||
if (!fileTypeList.includes(rawFile.type)) {
|
||||
ElMessage.error("请上传JPG/JPEG/PNG/GIF/PDF文件");
|
||||
return false;
|
||||
}
|
||||
if (rawFile.type != "application/pdf") {
|
||||
actionUrl.value = base_url + "/upload/taskImage";
|
||||
} else {
|
||||
actionUrl.value = base_url + "/upload/taskFile";
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
const handleExceed = (files: any) => {
|
||||
upload.value!.clearFiles();
|
||||
const file = files[0] as UploadRawFile;
|
||||
file.uid = genFileId();
|
||||
upload.value!.handleStart(file);
|
||||
upload.value!.submit();
|
||||
};
|
||||
|
||||
// 上传文件
|
||||
const handleFile = (e: any) => {
|
||||
if (e.code == 0 && e.show == 1) {
|
||||
formData.transfer_voucher = "";
|
||||
upload.value!.clearFiles();
|
||||
return ElMessage.error(e.msg || "上传失败");
|
||||
}
|
||||
formData.transfer_voucher = e.data.uri;
|
||||
};
|
||||
|
||||
// 查看凭证
|
||||
const openTransfer = (uri: any) => {
|
||||
window.open(uri);
|
||||
};
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate();
|
||||
const data = { ...formData };
|
||||
mode.value == (await withdrawAudit(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>
|
||||
|
|
@ -1,106 +1,157 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none" shadow="never">
|
||||
<el-alert
|
||||
type="warning"
|
||||
title="温馨提示:用户账户变动记录"
|
||||
:closable="false"
|
||||
show-icon
|
||||
></el-alert>
|
||||
<el-form ref="formRef" class="mb-[-16px] mt-[16px]" :model="queryParams" :inline="true">
|
||||
<el-form-item label="用户信息">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.user_info"
|
||||
placeholder="请输入用户编号/昵称/手机号"
|
||||
clearable
|
||||
@keyup.enter="resetPage"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="变动类型">
|
||||
<el-select class="w-[280px]" v-model="queryParams.change_type">
|
||||
<el-option label="全部" value />
|
||||
<el-option
|
||||
v-for="(value, key) in optionsData.change_type"
|
||||
:key="key"
|
||||
:label="value"
|
||||
:value="key"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="记录时间">
|
||||
<daterange-picker
|
||||
v-model:startTime="queryParams.start_time"
|
||||
v-model:endTime="queryParams.end_time"
|
||||
/>
|
||||
</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 mt-4" shadow="never">
|
||||
<el-table size="large" v-loading="pager.loading" :data="pager.lists">
|
||||
<el-table-column label="用户编号" prop="sn" min-width="100" />
|
||||
<el-table-column label="用户昵称" min-width="160">
|
||||
<template #default="{ row }">
|
||||
<div class="flex items-center">
|
||||
<image-contain
|
||||
class="flex-none mr-2"
|
||||
:src="row.avatar"
|
||||
:width="40"
|
||||
:height="40"
|
||||
preview-teleported
|
||||
fit="contain"
|
||||
/>
|
||||
{{ row.nickname }}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="手机号码" prop="mobile" min-width="100" />
|
||||
<el-table-column label="变动金额" prop="change_amount" min-width="100">
|
||||
<template #default="{ row }">
|
||||
<span :class="{ 'text-error': row.action == 2 }">
|
||||
{{ row.change_amount }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="剩余金额" prop="left_amount" min-width="100" />
|
||||
<el-table-column label="变动类型" prop="change_type_desc" min-width="120" />
|
||||
<div>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="8" v-for="item in userList" :key="item.id">
|
||||
<people :datas="item" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table-column label="来源单号" prop="source_sn" min-width="100" />
|
||||
<el-table-column label="记录时间" prop="create_time" min-width="120" />
|
||||
</el-table>
|
||||
<div class="flex justify-end mt-4">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
<el-card class="!border-none mt-4" shadow="never">
|
||||
<el-alert type="warning" title="温馨提示:用户账户变动记录" :closable="false" show-icon></el-alert>
|
||||
<el-form ref="formRef" class="mb-[-16px] mt-[16px]" :model="queryParams" :inline="true">
|
||||
<!-- <el-form-item label="用户信息">
|
||||
<el-input class="w-[280px]" v-model="queryParams.user_info" placeholder="请输入用户编号/昵称/手机号" clearable @keyup.enter="resetPage" />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="变动类型">
|
||||
<el-select class="w-[280px]" v-model="queryParams.change_type">
|
||||
<el-option label="全部" value />
|
||||
<el-option v-for="(value, key) in optionsData.change_type" :key="key" :label="value" :value="key" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="记录时间">
|
||||
<daterange-picker v-model:startTime="queryParams.start_time" v-model:endTime="queryParams.end_time" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
<export-data class="ml-2.5" :fetch-fun="accountLog" :params="queryParams" :page-size="pager.size" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none mt-4" shadow="never">
|
||||
<el-table size="large" v-loading="pager.loading" :data="pager.lists">
|
||||
<el-table-column label="ID" prop="id" min-width="80" />
|
||||
<el-table-column label="用户编号" prop="user_info.sn" min-width="100" />
|
||||
<el-table-column label="归属公司" prop="company_info.company_name" min-width="160" />
|
||||
<el-table-column label="用户昵称" min-width="100">
|
||||
<template #default="{ row }">
|
||||
<div class="flex items-center">
|
||||
<image-contain class="flex-none mr-2" :src="row.user_info?.avatar" :width="40" :height="40" preview-teleported fit="contain" />
|
||||
{{ row.user_info?.nickname }}
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="角色名称" prop="user_info.group_name" min-width="160" />
|
||||
<el-table-column label="手机号码" prop="user_info.mobile" min-width="100" />
|
||||
<el-table-column label="变动金额" prop="change_amount" min-width="100">
|
||||
<template #default="{ row }">
|
||||
<span class="text-warning" :class="{ 'text-error': row.action == 2 }">
|
||||
{{ row.change_amount }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="剩余金额" prop="left_amount" min-width="100">
|
||||
<template #default="{ row }">
|
||||
<span class="text-success">
|
||||
{{ row.left_amount }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="变动类型" prop="change_type_desc" min-width="120">
|
||||
<template #default="{ row }">
|
||||
<span :style="{ color: getTypeColor(row.change_type) }">{{
|
||||
row.change_type_desc
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="来源单号" prop="source_sn" min-width="100" />
|
||||
<el-table-column label="记录时间" prop="create_time" min-width="140" />
|
||||
</el-table>
|
||||
<div class="flex justify-end mt-4">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup name="articleLists">
|
||||
import { getUmChangeType, accountLog } from '@/api/finance'
|
||||
import { useDictOptions } from '@/hooks/useDictOptions'
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { getUmChangeType, accountLog, getCompanyUserList } from "@/api/finance";
|
||||
import { useDictOptions } from "@/hooks/useDictOptions";
|
||||
import { usePaging } from "@/hooks/usePaging";
|
||||
import { useRoute } from "vue-router";
|
||||
import people from "@/views/finance/component/people.vue";
|
||||
import { apiUserRoleLists } from "@/api/user_role";
|
||||
|
||||
const route = useRoute();
|
||||
// console.log("company_id", route.query?.company_id);
|
||||
|
||||
const queryParams = reactive({
|
||||
user_info: '',
|
||||
change_type: '',
|
||||
start_time: '',
|
||||
end_time: ''
|
||||
})
|
||||
change_type: "",
|
||||
start_time: "",
|
||||
end_time: "",
|
||||
company_id: "",
|
||||
});
|
||||
if (route.query?.company_id) queryParams.company_id = route.query?.company_id;
|
||||
if (route.query?.s_date) queryParams.start_time = route.query?.s_date;
|
||||
if (route.query?.e_date) queryParams.end_time = route.query?.e_date;
|
||||
|
||||
const userList = ref([]);
|
||||
const initUserList = async () => {
|
||||
let res = await getCompanyUserList({
|
||||
company_id: queryParams.company_id,
|
||||
});
|
||||
|
||||
// let role = await apiUserRoleLists({});
|
||||
// res = res.map((item: any) => {
|
||||
// let p = role.lists.find((e: any) => e.id == item.group_id);
|
||||
// p.name ? (item.group_name = p.name) : (item.group_name = "暂无角色");
|
||||
// return item;
|
||||
// });
|
||||
userList.value = res;
|
||||
};
|
||||
initUserList();
|
||||
|
||||
const { pager, getLists, resetPage, resetParams } = usePaging({
|
||||
fetchFun: accountLog,
|
||||
params: queryParams
|
||||
})
|
||||
fetchFun: accountLog,
|
||||
params: queryParams,
|
||||
});
|
||||
|
||||
const { optionsData } = useDictOptions<{
|
||||
change_type: Record<number, string>
|
||||
change_type: Record<number, string>;
|
||||
}>({
|
||||
change_type: {
|
||||
api: getUmChangeType
|
||||
}
|
||||
})
|
||||
change_type: {
|
||||
api: getUmChangeType,
|
||||
},
|
||||
});
|
||||
|
||||
getLists()
|
||||
const getTypeColor = (type: number) => {
|
||||
let color = "#333";
|
||||
switch (type) {
|
||||
case 100:
|
||||
color = "#f56c6c";
|
||||
break;
|
||||
case 101:
|
||||
color = "#f56c6c";
|
||||
break;
|
||||
case 200:
|
||||
color = "#409eff";
|
||||
break;
|
||||
case 201:
|
||||
color = "#409eff";
|
||||
break;
|
||||
case 202:
|
||||
color = "#67c23a";
|
||||
break;
|
||||
case 203:
|
||||
color = "#e6a23c";
|
||||
break;
|
||||
}
|
||||
return color;
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getLists();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,233 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px] formdata" :model="queryParams" inline>
|
||||
<el-form-item label="公司名称" prop="company_name">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.company_name"
|
||||
clearable
|
||||
placeholder="请输入公司名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="区" prop="area" v-show="company_type_show">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.area"
|
||||
clearable
|
||||
placeholder="请输入区"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="镇" prop="street" v-show="company_type_show">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.street"
|
||||
clearable
|
||||
placeholder="请输入镇"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="公司类型"
|
||||
prop="company_type"
|
||||
v-show="company_type_show"
|
||||
>
|
||||
<el-select
|
||||
v-model="queryParams.company_type"
|
||||
placeholder="请选择公司类型"
|
||||
clearable
|
||||
class="w-[280px]"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in datas.dictTypeLists"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="片区经理" prop="area_manager">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.area_manager"
|
||||
clearable
|
||||
placeholder="请输入片区经理"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column
|
||||
label="ID"
|
||||
prop="id"
|
||||
show-overflow-tooltip
|
||||
width="80"
|
||||
/>
|
||||
<el-table-column
|
||||
label="公司名称"
|
||||
prop="company_name"
|
||||
width="300"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="公司类型"
|
||||
prop="company_type"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="公司收益"
|
||||
prop="deposit"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<span class="text-success">{{ row.deposit }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="区县" prop="area" show-overflow-tooltip />
|
||||
<el-table-column label="乡镇" prop="street" show-overflow-tooltip />
|
||||
<el-table-column
|
||||
label="主联系人"
|
||||
prop="master_name"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="联系方式"
|
||||
prop="master_phone"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="片区经理"
|
||||
prop="area_manager"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
width="150"
|
||||
fixed="right"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<div style="display: flex">
|
||||
<el-button type="primary" link>
|
||||
<router-link
|
||||
:to="{
|
||||
path: getRoutePath('finance.account_log/lists'),
|
||||
query: {
|
||||
company_id: row.id,
|
||||
},
|
||||
}"
|
||||
>查看成员</router-link
|
||||
>
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="financeCompanyLists">
|
||||
import { usePaging } from "@/hooks/usePaging";
|
||||
import { useDictData } from "@/hooks/useDictOptions";
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
import { apiCompanyLists } from "@/api/company";
|
||||
import { timeFormat } from "@/utils/util";
|
||||
import { dictDataLists } from "@/api/setting/dict";
|
||||
import { getRoutePath } from "@/router";
|
||||
import { dictContractTypeList } from "@/utils/dict.ts";
|
||||
|
||||
const userStore = useUserStore();
|
||||
// console.log(userStore.userInfo.company_id);
|
||||
const route = useRoute();
|
||||
const company_type_show = ref(true);
|
||||
|
||||
// 创建合同与发送短信结束
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
company_name: "",
|
||||
area: "",
|
||||
street: "",
|
||||
company_type: "",
|
||||
area_manager: "",
|
||||
// 是否签约
|
||||
is_contract: "",
|
||||
});
|
||||
|
||||
if (route.query.company_type) {
|
||||
company_type_show.value = false;
|
||||
queryParams["company_type"] = route.query.company_type?.toString() || "";
|
||||
}
|
||||
|
||||
const datas = reactive({
|
||||
dictTypeLists: [],
|
||||
});
|
||||
const getdictTypeLists = async () => {
|
||||
const data = await dictDataLists({ type_id: 6 });
|
||||
datas["dictTypeLists"] = data["lists"];
|
||||
};
|
||||
getdictTypeLists();
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([]);
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id);
|
||||
};
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData("");
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiCompanyLists,
|
||||
params: queryParams,
|
||||
});
|
||||
|
||||
getLists();
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.btn {
|
||||
position: absolute;
|
||||
}
|
||||
h1 {
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
font-size: 30px;
|
||||
color: red;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.content {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.info {
|
||||
color: red;
|
||||
font-weight: bold;
|
||||
font-size: 18px;
|
||||
display: inline-block;
|
||||
margin: 0 5px;
|
||||
}
|
||||
|
||||
.btn_menu {
|
||||
margin-top: 10vh;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
}
|
||||
.formdata {
|
||||
.el-form-item {
|
||||
width: 20%;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,41 @@
|
|||
<template>
|
||||
<el-card class="!border-none" shadow="never">
|
||||
<div style="display: flex; align-items: center">
|
||||
|
||||
<el-avatar :size="80" :src="datas.avatar" style="margin-right: 16px" />
|
||||
<el-row>
|
||||
<el-col :span="12">姓名: {{ datas.nickname }}</el-col>
|
||||
<el-col :span="12">电话: {{ datas.mobile }}</el-col>
|
||||
<el-col :span="24">角色: {{ datas.group_name }}</el-col>
|
||||
<el-col :span="12"
|
||||
>押金:
|
||||
<span style="color: #e6a23c; font-weight: bold">{{
|
||||
datas.deposit
|
||||
}}</span
|
||||
>元
|
||||
</el-col>
|
||||
<el-col :span="12"
|
||||
>收益:
|
||||
<span style="color: #67c23a; font-weight: bold">{{
|
||||
datas.income
|
||||
}}</span
|
||||
>元
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="peopleMoney">
|
||||
defineProps({
|
||||
datas: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
||||
|
|
@ -0,0 +1,294 @@
|
|||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup
|
||||
ref="popupRef"
|
||||
:title="popupTitle"
|
||||
:async="true"
|
||||
width="580px"
|
||||
@confirm="handleSubmit"
|
||||
@close="handleClose"
|
||||
>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
label-width="120px"
|
||||
:rules="formRules"
|
||||
>
|
||||
<el-form-item label="甲方公司名称">
|
||||
<el-input
|
||||
readonly
|
||||
v-model="partyA.company_name"
|
||||
clearable
|
||||
placeholder=""
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="甲方对公账号">
|
||||
<el-input
|
||||
readonly
|
||||
v-model="partyA.qualification.corporate_account"
|
||||
clearable
|
||||
placeholder=""
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="公司名称" prop="company_name">
|
||||
<el-input
|
||||
readonly
|
||||
v-model="formData.company_name"
|
||||
clearable
|
||||
placeholder=""
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="主要联系人" prop="master_name">
|
||||
<el-input
|
||||
readonly
|
||||
v-model="formData.master_name"
|
||||
clearable
|
||||
placeholder=""
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="联系电话" prop="master_phone">
|
||||
<el-input
|
||||
readonly
|
||||
v-model="formData.master_phone"
|
||||
clearable
|
||||
placeholder=""
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="押金金额" prop="deposit">
|
||||
|
||||
<el-input
|
||||
v-model="formData.deposit"
|
||||
type="number"
|
||||
:maxlength="10"
|
||||
clearable
|
||||
placeholder="请输入押金金额"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="上传凭证" prop="voucher">
|
||||
<el-upload
|
||||
class="upload-demo"
|
||||
style="width: 100%"
|
||||
drag
|
||||
:accept="fileTypeList.join(', ')"
|
||||
:headers="{ Token: userStore.token }"
|
||||
:action="actionUrl"
|
||||
:limit="1"
|
||||
:on-success="handleFile"
|
||||
:on-exceed="handleExceed"
|
||||
:before-upload="beforeUpload"
|
||||
:before-remove="removeFile"
|
||||
:on-preview="onPreview"
|
||||
ref="upload"
|
||||
>
|
||||
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
||||
<div class="el-upload__text">文件拖入或点击上传</div>
|
||||
<template #tip>
|
||||
<div class="el-upload__tip">请上传JPG/JPEG/PNG/GIF/PDF文件</div>
|
||||
</template>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="withdrawEdit">
|
||||
import type {
|
||||
FormInstance,
|
||||
UploadRawFile,
|
||||
UploadFile,
|
||||
UploadFiles,
|
||||
} from "element-plus";
|
||||
import { genFileId } from "element-plus";
|
||||
import Popup from "@/components/popup/index.vue";
|
||||
import { getPartyAbyCompanyId } from "@/api/company";
|
||||
import { timeFormat } from "@/utils/util";
|
||||
import type { PropType } from "vue";
|
||||
import { depositRechargeTransferVoucher } from "@/api/company.ts";
|
||||
import { inject } from "vue";
|
||||
const base_url: any = inject("base_url");
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
import { rules } from "@/views/channel/wx_oa/menu_com/useMenuOa";
|
||||
const userStore = useUserStore();
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({}),
|
||||
},
|
||||
});
|
||||
const emit = defineEmits(["success", "close"]);
|
||||
const formRef = shallowRef<FormInstance>();
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>();
|
||||
const mode = ref("add");
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return "凭证录入";
|
||||
});
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: "",
|
||||
company_name: "",
|
||||
master_name: "",
|
||||
master_phone: "",
|
||||
deposit: "", // 钱
|
||||
voucher: "", // 凭证
|
||||
});
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
deposit: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入押金金额",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
voucher: [
|
||||
{
|
||||
required: true,
|
||||
message: "请上传凭证",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
// 文件选择
|
||||
const upload = ref(null);
|
||||
// 文件上传地址
|
||||
const actionUrl = ref("");
|
||||
const fileTypeList = [
|
||||
"application/pdf",
|
||||
"image/jpeg",
|
||||
"image/gif",
|
||||
"image/png",
|
||||
];
|
||||
// 限制上传类型
|
||||
const beforeUpload = (rawFile: UploadRawFile) => {
|
||||
if (!fileTypeList.includes(rawFile.type)) {
|
||||
ElMessage.error("请上传JPG/JPEG/PNG/GIF/PDF文件");
|
||||
return false;
|
||||
}
|
||||
if (rawFile.type != "application/pdf") {
|
||||
actionUrl.value = base_url + "/upload/taskImage";
|
||||
} else {
|
||||
actionUrl.value = base_url + "/upload/taskFile";
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
const handleExceed = (files: any) => {
|
||||
upload.value!.clearFiles();
|
||||
const file = files[0] as UploadRawFile;
|
||||
file.uid = genFileId();
|
||||
upload.value!.handleStart(file);
|
||||
upload.value!.submit();
|
||||
};
|
||||
|
||||
const removeFile = (uploadFile: UploadFile, uploadFiles: UploadFiles) => {
|
||||
formData.voucher = "";
|
||||
return true;
|
||||
};
|
||||
|
||||
const onPreview = (event: any) => {
|
||||
if (event?.response?.data?.uri) openTransfer(event?.response?.data?.uri);
|
||||
else ElMessage("文件错误");
|
||||
};
|
||||
|
||||
// 查看凭证
|
||||
const openTransfer = (uri: any) => {
|
||||
window.open(uri);
|
||||
};
|
||||
|
||||
// 上传文件
|
||||
const handleFile = (e: any) => {
|
||||
if (e.code == 0 && e.show == 1) {
|
||||
formData.voucher = "";
|
||||
upload.value!.clearFiles();
|
||||
return ElMessage.error(e.msg || "上传失败");
|
||||
}
|
||||
formData.voucher = e.data.uri;
|
||||
};
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
let obj = {
|
||||
id: "",
|
||||
company_name: "",
|
||||
master_name: "",
|
||||
master_phone: "",
|
||||
};
|
||||
for (const key in obj) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key];
|
||||
}
|
||||
}
|
||||
formData.deposit=Number(data.deposit)
|
||||
|
||||
getDetail();
|
||||
};
|
||||
|
||||
// 甲方公司信息
|
||||
const partyA = reactive({
|
||||
company_name: "",
|
||||
qualification: {
|
||||
corporate_account: "",
|
||||
},
|
||||
});
|
||||
const getDetail = async () => {
|
||||
getPartyAbyCompanyId({
|
||||
company_id: formData.id,
|
||||
}).then((data) => {
|
||||
partyA["company_name"] = data["company_name"];
|
||||
if (typeof data.qualification == "string") {
|
||||
data.qualification = JSON.parse(data.qualification);
|
||||
partyA.qualification.corporate_account =
|
||||
data.qualification.corporate_account;
|
||||
|
||||
} else {
|
||||
partyA.qualification.corporate_account =
|
||||
data.qualification.corporate_account;
|
||||
}
|
||||
if (!partyA.qualification.corporate_account) {
|
||||
ElMessage.error("甲方公司没有对公账号,请补充账号后再试");
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
if (!partyA.company_name) return ElMessage.error("甲方公司不可为空");
|
||||
if (!partyA.qualification.corporate_account)
|
||||
return ElMessage.error("甲方公司对公账户不可为空");
|
||||
if (!formData.id) return ElMessage.error("请先选择公司");
|
||||
await formRef.value?.validate();
|
||||
const data = { ...formData };
|
||||
await depositRechargeTransferVoucher({
|
||||
company_id: data.id,
|
||||
deposit: data.deposit,
|
||||
voucher: data.voucher,
|
||||
});
|
||||
ElMessage.success("录入成功");
|
||||
popupRef.value?.close();
|
||||
emit("success");
|
||||
};
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = "add") => {
|
||||
mode.value = type;
|
||||
popupRef.value?.open();
|
||||
};
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit("close");
|
||||
};
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,177 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px] formdata" :model="queryParams" inline>
|
||||
<el-form-item label="公司名称" prop="company_name">
|
||||
<el-input class="w-[280px]" v-model="queryParams.company_name" clearable placeholder="请输入公司名称" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="区" prop="area" v-show="company_type_show">
|
||||
<el-input class="w-[280px]" v-model="queryParams.area" clearable placeholder="请输入区" />
|
||||
</el-form-item>
|
||||
<el-form-item label="镇" prop="street" v-show="company_type_show">
|
||||
<el-input class="w-[280px]" v-model="queryParams.street" clearable placeholder="请输入镇" />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="公司类型" prop="company_type" v-show="company_type_show">
|
||||
<el-select v-model="queryParams.company_type" placeholder="请选择公司类型" clearable class="w-[280px]">
|
||||
<el-option v-for="(item, index) in datas.dictTypeLists" :key="index" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="片区经理" prop="area_manager">
|
||||
<el-input class="w-[280px]" v-model="queryParams.area_manager" clearable placeholder="请输入片区经理" />
|
||||
</el-form-item> -->
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column label="ID" prop="id" show-overflow-tooltip width="80" />
|
||||
<el-table-column label="公司名称" prop="company_name" width="300" show-overflow-tooltip />
|
||||
<el-table-column label="公司类型" prop="company_type" show-overflow-tooltip />
|
||||
<el-table-column label="押金" prop="deposit" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<span class="text-success">{{ row.deposit }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="区县" prop="area" show-overflow-tooltip />
|
||||
<el-table-column label="乡镇" prop="street" show-overflow-tooltip />
|
||||
<el-table-column label="主联系人" prop="master_name" show-overflow-tooltip />
|
||||
<el-table-column label="联系方式" prop="master_phone" show-overflow-tooltip />
|
||||
<el-table-column label="片区经理" prop="area_manager" show-overflow-tooltip />
|
||||
<el-table-column label="操作" align="center" width="200" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<div style="display: flex">
|
||||
<el-button type="primary" link @click="handleEdit(row)">
|
||||
凭证录入
|
||||
</el-button>
|
||||
<el-button type="primary" link>
|
||||
<router-link :to="{
|
||||
path: getRoutePath('finance.depositList'),
|
||||
query: {
|
||||
company_id: row.id,
|
||||
},
|
||||
}">凭证列表</router-link>
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="financeCompanyLists">
|
||||
import { usePaging } from "@/hooks/usePaging";
|
||||
import { useDictData } from "@/hooks/useDictOptions";
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
import { apiCompanyLists1,companyType } from "@/api/company";
|
||||
import { timeFormat } from "@/utils/util";
|
||||
import { dictDataLists } from "@/api/setting/dict";
|
||||
import { getRoutePath } from "@/router";
|
||||
import { dictContractTypeList } from "@/utils/dict.ts";
|
||||
import EditPopup from "./component/voucher.vue";
|
||||
|
||||
const userStore = useUserStore();
|
||||
// console.log(userStore.userInfo.company_id);
|
||||
const route = useRoute();
|
||||
const company_type_show = ref(true);
|
||||
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false);
|
||||
const editRef = ref(null);
|
||||
// 编辑
|
||||
const handleEdit = async (data: any) => {
|
||||
showEdit.value = true;
|
||||
await nextTick();
|
||||
editRef.value?.open("edit");
|
||||
editRef.value?.setFormData(data);
|
||||
};
|
||||
|
||||
// 创建合同与发送短信结束
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
company_name: "",
|
||||
|
||||
company_type: "",
|
||||
|
||||
|
||||
});
|
||||
|
||||
if (route.query.company_type) {
|
||||
company_type_show.value = false;
|
||||
queryParams["company_type"] = route.query.company_type?.toString() || "";
|
||||
}
|
||||
|
||||
const datas = reactive({
|
||||
dictTypeLists: [],
|
||||
});
|
||||
const getdictTypeLists = async () => {
|
||||
const data = await companyType();
|
||||
datas["dictTypeLists"] = data;
|
||||
};
|
||||
getdictTypeLists();
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([]);
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id);
|
||||
};
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData("");
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiCompanyLists1,
|
||||
params: queryParams,
|
||||
});
|
||||
|
||||
getLists();
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.btn {
|
||||
position: absolute;
|
||||
}
|
||||
h1 {
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
font-size: 30px;
|
||||
color: red;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.content {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.info {
|
||||
color: red;
|
||||
font-weight: bold;
|
||||
font-size: 18px;
|
||||
display: inline-block;
|
||||
margin: 0 5px;
|
||||
}
|
||||
|
||||
.btn_menu {
|
||||
margin-top: 10vh;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
}
|
||||
.formdata {
|
||||
.el-form-item {
|
||||
width: 20%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,215 @@
|
|||
<template>
|
||||
<div>
|
||||
<!-- <el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px] formdata" :model="queryParams" inline>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card> -->
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<el-button type="primary" @click="handleEdit(company_info)"
|
||||
>添加凭证</el-button
|
||||
>
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column
|
||||
label="ID"
|
||||
prop="id"
|
||||
show-overflow-tooltip
|
||||
width="80"
|
||||
/>
|
||||
<el-table-column
|
||||
label="公司名称"
|
||||
prop="company_name"
|
||||
width="300"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<span>{{ company_info.company_name }}</span>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="充值金额"
|
||||
prop="deposit"
|
||||
width="180"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="凭证地址"
|
||||
prop="voucher"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
prop="create_time"
|
||||
width="200"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="更新时间"
|
||||
prop="update_time"
|
||||
width="200"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
width="100"
|
||||
fixed="right"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<div style="display: flex">
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
@click="openTransfer(row.voucher)"
|
||||
>
|
||||
查看凭证
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<edit-popup
|
||||
v-if="showEdit"
|
||||
ref="editRef"
|
||||
:dict-data="dictData"
|
||||
@success="getLists"
|
||||
@close="showEdit = false"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="financeCompanyLists">
|
||||
import { usePaging } from "@/hooks/usePaging";
|
||||
import { useDictData } from "@/hooks/useDictOptions";
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
import {
|
||||
apiCompanyLists,
|
||||
apiCompanyDetail,
|
||||
getDepositRechargeTransferVoucherList,
|
||||
} from "@/api/company";
|
||||
import { timeFormat } from "@/utils/util";
|
||||
import { dictDataLists } from "@/api/setting/dict";
|
||||
import { getRoutePath } from "@/router";
|
||||
import { dictContractTypeList } from "@/utils/dict.ts";
|
||||
import EditPopup from "./component/voucher.vue";
|
||||
|
||||
const userStore = useUserStore();
|
||||
// console.log(userStore.userInfo.company_id);
|
||||
const route = useRoute();
|
||||
|
||||
// 是否显示添加框
|
||||
const showEdit = ref(false);
|
||||
const editRef = ref(null);
|
||||
// 添加
|
||||
const handleEdit = async (data: any) => {
|
||||
showEdit.value = true;
|
||||
await nextTick();
|
||||
editRef.value?.open("edit");
|
||||
editRef.value?.setFormData(data);
|
||||
};
|
||||
|
||||
const company_info = reactive({
|
||||
id: "",
|
||||
company_name: "",
|
||||
master_name: "",
|
||||
master_phone: "",
|
||||
});
|
||||
|
||||
const getCompanyInfo = () => {
|
||||
apiCompanyDetail({ id: queryParams.company_id }).then((data) => {
|
||||
for (const key in company_info) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
company_info[key] = data[key];
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 查看凭证
|
||||
const openTransfer = (uri: any) => {
|
||||
window.open(uri);
|
||||
};
|
||||
|
||||
// 创建合同与发送短信结束
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
company_id: "",
|
||||
});
|
||||
|
||||
if (route.query.company_id) {
|
||||
queryParams["company_id"] = route.query.company_id;
|
||||
getCompanyInfo();
|
||||
}
|
||||
|
||||
const datas = reactive({
|
||||
dictTypeLists: [],
|
||||
});
|
||||
const getdictTypeLists = async () => {
|
||||
const data = await dictDataLists({ type_id: 6 });
|
||||
datas["dictTypeLists"] = data["lists"];
|
||||
};
|
||||
getdictTypeLists();
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([]);
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id);
|
||||
};
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData("");
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: getDepositRechargeTransferVoucherList,
|
||||
params: queryParams,
|
||||
});
|
||||
|
||||
getLists();
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.btn {
|
||||
position: absolute;
|
||||
}
|
||||
h1 {
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
font-size: 30px;
|
||||
color: red;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.content {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.info {
|
||||
color: red;
|
||||
font-weight: bold;
|
||||
font-size: 18px;
|
||||
display: inline-block;
|
||||
margin: 0 5px;
|
||||
}
|
||||
|
||||
.btn_menu {
|
||||
margin-top: 10vh;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
}
|
||||
.formdata {
|
||||
.el-form-item {
|
||||
width: 20%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,175 @@
|
|||
<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="order_sn">
|
||||
<el-input
|
||||
v-model="formData.order_sn"
|
||||
clearable
|
||||
placeholder="请输入订单编号"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="" prop="user_id">
|
||||
<el-input v-model="formData.user_id" clearable placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<el-form-item label="" prop="admin_id">
|
||||
<el-input
|
||||
v-model="formData.admin_id"
|
||||
clearable
|
||||
placeholder="请输入"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="提现金额" prop="amount">
|
||||
<el-input
|
||||
v-model="formData.amount"
|
||||
clearable
|
||||
placeholder="请输入提现金额"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="状态:0待审核,1通过,2拒绝,3已转账"
|
||||
prop="status"
|
||||
>
|
||||
<el-input
|
||||
v-model="formData.status"
|
||||
clearable
|
||||
placeholder="请输入状态:0待审核,1通过,2拒绝,3已转账"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="withdrawEdit">
|
||||
import type { FormInstance } from "element-plus";
|
||||
import Popup from "@/components/popup/index.vue";
|
||||
import {
|
||||
apiWithdrawAdd,
|
||||
apiWithdrawEdit,
|
||||
apiWithdrawDetail,
|
||||
} from "@/api/withdraw";
|
||||
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: "",
|
||||
order_sn: "",
|
||||
user_id: "",
|
||||
admin_id: "",
|
||||
amount: "",
|
||||
status: "",
|
||||
});
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
order_sn: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入订单编号",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
user_id: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
admin_id: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
amount: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入提现金额",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
status: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入状态:0待审核,1通过,2拒绝,3已转账",
|
||||
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 apiWithdrawDetail({
|
||||
id: row.id,
|
||||
});
|
||||
setFormData(data);
|
||||
};
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate();
|
||||
const data = { ...formData };
|
||||
mode.value == "edit"
|
||||
? await apiWithdrawEdit(data)
|
||||
: await apiWithdrawAdd(data);
|
||||
popupRef.value?.close();
|
||||
emit("success");
|
||||
};
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = "add") => {
|
||||
mode.value = type;
|
||||
popupRef.value?.open();
|
||||
};
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit("close");
|
||||
};
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail,
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,93 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="公司名称" prop="company_name">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.company_name"
|
||||
clearable
|
||||
placeholder="请输入公司名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="公司类型" prop="company_type">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.company_type"
|
||||
clearable
|
||||
placeholder="请输入公司类型"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @cell-click="handleCurrentChange">
|
||||
<el-table-column label="签约公司" property="company_name" />
|
||||
<el-table-column label="公司类型" property="company_type" />
|
||||
<el-table-column label="区县" property="area" />
|
||||
<el-table-column label="乡镇" property="street" />
|
||||
<el-table-column label="主联系人" property="master_name" />
|
||||
<el-table-column label="联系方式" property="master_phone" />
|
||||
<el-table-column label="片区经理" property="area_manager" />
|
||||
<el-table-column label="是否签约" property="is_contract" />
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="companyLists">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiCompanyLists, apiCompanyDelete } from '@/api/company'
|
||||
import { defineEmits } from 'vue'
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
level_two: '',
|
||||
level_one: '',
|
||||
company_name: '',
|
||||
organization_code: '',
|
||||
city: '',
|
||||
area: '',
|
||||
street: '',
|
||||
company_type: '',
|
||||
master_name: '',
|
||||
master_position: '',
|
||||
master_phone: '',
|
||||
master_email: '',
|
||||
other_contacts: '',
|
||||
area_manager: '',
|
||||
is_contract: '',
|
||||
account: '',
|
||||
password: '',
|
||||
deposit: '',
|
||||
deposit_time: '',
|
||||
qualification: '',
|
||||
status: ''
|
||||
})
|
||||
|
||||
// 选中数据
|
||||
const emits = defineEmits(['customEvent'])
|
||||
|
||||
// 选中数据子父传递
|
||||
const handleCurrentChange = (value: any) => {
|
||||
emits('customEvent', value)
|
||||
}
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiCompanyLists,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
getLists()
|
||||
</script>
|
|
@ -0,0 +1,365 @@
|
|||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup
|
||||
ref="popupRef"
|
||||
:title="popupTitle"
|
||||
:async="true"
|
||||
width="80%"
|
||||
@confirm="handleSubmit"
|
||||
@close="handleClose"
|
||||
>
|
||||
<el-form ref="formRef" :model="formData" label-width="84px" :rules="formRules">
|
||||
<div style="font-size: 1.2rem; margin: 10px 0">基本信息创建</div>
|
||||
<el-col :span="24" class="pt-6 !border-none">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<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="12">
|
||||
<el-form-item label="性别" prop="sex">
|
||||
<el-input
|
||||
v-model="formData.sex"
|
||||
placeholder="请输入性别"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="身份证号" prop="id_card">
|
||||
<el-input
|
||||
v-model="formData.id_card"
|
||||
placeholder="请输入身份证号"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<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="3">
|
||||
<el-form-item label="省" prop="province">
|
||||
<el-select
|
||||
v-model="formData.province"
|
||||
placeholder="请选择省"
|
||||
clearable
|
||||
@change="province_change"
|
||||
:style="{ width: '100%' }"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in datas.provinceOptions"
|
||||
:key="index"
|
||||
:label="item.province_name"
|
||||
:value="item.province_code"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-form-item label="市" prop="city">
|
||||
<el-select
|
||||
v-model="formData.city"
|
||||
placeholder="请选择市"
|
||||
clearable
|
||||
@change="city_change"
|
||||
:style="{ width: '100%' }"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in datas.cityOptions"
|
||||
:key="index"
|
||||
:label="item.city_name"
|
||||
:value="item.city_code"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-form-item label="区" prop="area">
|
||||
<el-select
|
||||
v-model="formData.area"
|
||||
placeholder="请选择区"
|
||||
clearable
|
||||
@change="area_change"
|
||||
:style="{ width: '100%' }"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in datas.areaOptions"
|
||||
:key="index"
|
||||
:label="item.area_name"
|
||||
:value="item.area_code"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-form-item label="镇" prop="street">
|
||||
<el-select
|
||||
v-model="formData.street"
|
||||
placeholder="请选择镇"
|
||||
clearable
|
||||
@change="street_change"
|
||||
:style="{ width: '100%' }"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in datas.streetOptions"
|
||||
:key="index"
|
||||
:label="item.street_name"
|
||||
:value="item.street_code"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<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-row>
|
||||
</el-col>
|
||||
|
||||
<!-- 管理员状态 -->
|
||||
<el-form-item label="管理员状态" v-if="formData.root != 1">
|
||||
<el-switch v-model="formData.disable" :active-value="0" :inactive-value="1" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import type { FormInstance, UploadProps } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { useDictOptions } from '@/hooks/useDictOptions'
|
||||
import { adminAdd, adminDetail, adminEdit } from '@/api/perms/admin'
|
||||
import { roleAll } from '@/api/perms/role'
|
||||
import { jobsAll } from '@/api/org/post'
|
||||
import { deptAll } from '@/api/org/department'
|
||||
import { apiCityList, apiAreaList, apiStreetList, apiProvinceList } from '@/api/common'
|
||||
|
||||
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: '',
|
||||
account: '',
|
||||
sex: 1,
|
||||
id_card: '',
|
||||
name: '',
|
||||
province: '',
|
||||
city: '',
|
||||
area: '',
|
||||
street: '',
|
||||
address: '',
|
||||
phone: '',
|
||||
qualification: {
|
||||
id_card: '',
|
||||
car_card: '',
|
||||
bank_account: ''
|
||||
},
|
||||
is_contract: 0,
|
||||
dept_id: [],
|
||||
jobs_id: [],
|
||||
role_id: [],
|
||||
avatar: '',
|
||||
password: '',
|
||||
password_confirm: '',
|
||||
disable: 0,
|
||||
multipoint_login: 1,
|
||||
root: 0
|
||||
})
|
||||
const datas = reactive({
|
||||
provinceOptions: [],
|
||||
cityOptions: [],
|
||||
areaOptions: [],
|
||||
streetOptions: [],
|
||||
dictTypeLists: [],
|
||||
contract_type: []
|
||||
})
|
||||
const passwordConfirmValidator = (rule: object, value: string, callback: any) => {
|
||||
if (formData.password) {
|
||||
if (!value) callback(new Error('请再次输入密码'))
|
||||
if (value !== formData.password) callback(new Error('两次输入密码不一致!'))
|
||||
}
|
||||
callback()
|
||||
}
|
||||
const formRules = reactive({
|
||||
account: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入账号',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
name: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入名称',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
role_id: [
|
||||
{
|
||||
type: 'array',
|
||||
required: true,
|
||||
message: '请选择角色',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
password: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入密码',
|
||||
trigger: ['blur']
|
||||
}
|
||||
] as any[],
|
||||
password_confirm: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入确认密码',
|
||||
trigger: ['blur']
|
||||
},
|
||||
{
|
||||
validator: passwordConfirmValidator,
|
||||
trigger: 'blur'
|
||||
}
|
||||
] as any[]
|
||||
})
|
||||
const { optionsData } = useDictOptions<{
|
||||
role: any[]
|
||||
jobs: any[]
|
||||
dept: any[]
|
||||
}>({
|
||||
role: {
|
||||
api: roleAll
|
||||
},
|
||||
jobs: {
|
||||
api: jobsAll
|
||||
},
|
||||
dept: {
|
||||
api: deptAll
|
||||
}
|
||||
})
|
||||
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
mode.value == 'edit' ? await adminEdit(formData) : await adminAdd(formData)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
}
|
||||
//获取省份
|
||||
function province_change(value: string) {
|
||||
formData.province = value
|
||||
getCityList(value)
|
||||
}
|
||||
function city_change(value: string) {
|
||||
formData.city = value
|
||||
getAreaList(value)
|
||||
}
|
||||
function area_change(value: string) {
|
||||
formData.area = value
|
||||
getStreetList(value)
|
||||
}
|
||||
function street_change(value: string) {
|
||||
formData.street = value
|
||||
}
|
||||
|
||||
const getProvinceList = async () => {
|
||||
const data = await apiProvinceList({})
|
||||
datas['provinceOptions'] = data
|
||||
}
|
||||
const getCityList = async (id: any) => {
|
||||
const data = await apiCityList({ city: id })
|
||||
datas['cityOptions'] = data
|
||||
}
|
||||
const getAreaList = async (id: any) => {
|
||||
const data = await apiAreaList({ area: id })
|
||||
datas['areaOptions'] = data
|
||||
}
|
||||
const getStreetList = async (id: any) => {
|
||||
const data = await apiStreetList({ street: id })
|
||||
datas['streetOptions'] = data
|
||||
}
|
||||
const handleAvatarSuccess: UploadProps['onSuccess'] = (response, uploadFile) => {
|
||||
formData.qualification.id_card = response.data.uri
|
||||
}
|
||||
|
||||
const beforeAvatarUpload: UploadProps['beforeUpload'] = (rawFile) => {
|
||||
return true
|
||||
}
|
||||
const handleAvatarSuccess_two: UploadProps['onSuccess'] = (response, uploadFile) => {
|
||||
formData.qualification.car_card = response.data.uri
|
||||
}
|
||||
|
||||
const beforeAvatarUpload_two: UploadProps['beforeUpload'] = (rawFile) => {
|
||||
return true
|
||||
}
|
||||
const handleAvatarSuccess_three: UploadProps['onSuccess'] = (response, uploadFile) => {
|
||||
formData.qualification.bank_account = response.data.uri
|
||||
}
|
||||
|
||||
const beforeAvatarUpload_three: UploadProps['beforeUpload'] = (rawFile) => {
|
||||
return true
|
||||
}
|
||||
|
||||
const setFormData = async (row: any) => {
|
||||
formRules.password = []
|
||||
formRules.password_confirm = [
|
||||
{
|
||||
validator: passwordConfirmValidator,
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
const data = await adminDetail({
|
||||
id: row.id
|
||||
})
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData
|
||||
})
|
||||
</script>
|
|
@ -0,0 +1,265 @@
|
|||
<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" :rules="formRules">
|
||||
<!-- 账号输入框 -->
|
||||
<el-form-item label="账号" prop="account">
|
||||
<el-input
|
||||
v-model="formData.account"
|
||||
:disabled="formData.root == 1"
|
||||
placeholder="请输入账号"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- 管理员头像 -->
|
||||
<el-form-item label="头像">
|
||||
<div>
|
||||
<div>
|
||||
<material-picker v-model="formData.avatar" :limit="1" />
|
||||
</div>
|
||||
<div class="form-tips">建议尺寸:100*100px,支持jpg,jpeg,png格式</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 名称输入框 -->
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model="formData.name" placeholder="请输入名称" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="归属部门" prop="dept_id">
|
||||
<el-tree-select
|
||||
class="flex-1"
|
||||
v-model="formData.dept_id"
|
||||
:data="optionsData.dept"
|
||||
clearable
|
||||
multiple
|
||||
node-key="id"
|
||||
:props="{
|
||||
value: 'id',
|
||||
label: 'name',
|
||||
disabled(data: any) {
|
||||
return data.status !== 1
|
||||
}
|
||||
}"
|
||||
check-strictly
|
||||
:default-expand-all="true"
|
||||
placeholder="请选择上级部门"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="岗位" prop="jobs_id">
|
||||
<el-select
|
||||
class="flex-1"
|
||||
v-model="formData.jobs_id"
|
||||
clearable
|
||||
multiple
|
||||
placeholder="请选择岗位"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in optionsData.jobs"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 角色选择框 -->
|
||||
<el-form-item label="角色" prop="role_id">
|
||||
<el-select
|
||||
v-model="formData.role_id"
|
||||
:disabled="formData.root == 1"
|
||||
class="flex-1"
|
||||
multiple
|
||||
placeholder="请选择角色"
|
||||
clearable
|
||||
>
|
||||
<el-option v-if="formData.root == 1" label="系统管理员" :value="0" />
|
||||
<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 label="密码" prop="password">
|
||||
<el-input
|
||||
v-model="formData.password"
|
||||
show-password
|
||||
clearable
|
||||
placeholder="请输入密码"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 确认密码输入框 -->
|
||||
<el-form-item label="确认密码" prop="password_confirm">
|
||||
<el-input
|
||||
v-model="formData.password_confirm"
|
||||
show-password
|
||||
clearable
|
||||
placeholder="请输入确认密码"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 管理员状态 -->
|
||||
<el-form-item label="管理员状态" v-if="formData.root != 1">
|
||||
<el-switch v-model="formData.disable" :active-value="0" :inactive-value="1" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 多处登录 -->
|
||||
<el-form-item label="多处登录">
|
||||
<div>
|
||||
<el-switch
|
||||
v-model="formData.multipoint_login"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
/>
|
||||
<div class="form-tips">允许多人同时在线登录</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { useDictOptions } from '@/hooks/useDictOptions'
|
||||
import { adminAdd, adminDetail, adminEdit } from '@/api/perms/admin'
|
||||
import { roleAll } from '@/api/perms/role'
|
||||
import { jobsAll } from '@/api/org/post'
|
||||
import { deptAll } from '@/api/org/department'
|
||||
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: '',
|
||||
account: '',
|
||||
name: '',
|
||||
dept_id: [],
|
||||
jobs_id: [],
|
||||
role_id: [],
|
||||
avatar: '',
|
||||
password: '',
|
||||
password_confirm: '',
|
||||
disable: 0,
|
||||
multipoint_login: 1,
|
||||
root: 0
|
||||
})
|
||||
const passwordConfirmValidator = (rule: object, value: string, callback: any) => {
|
||||
if (formData.password) {
|
||||
if (!value) callback(new Error('请再次输入密码'))
|
||||
if (value !== formData.password) callback(new Error('两次输入密码不一致!'))
|
||||
}
|
||||
callback()
|
||||
}
|
||||
const formRules = reactive({
|
||||
account: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入账号',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
name: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入名称',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
role_id: [
|
||||
{
|
||||
type: 'array',
|
||||
required: true,
|
||||
message: '请选择角色',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
password: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入密码',
|
||||
trigger: ['blur']
|
||||
}
|
||||
] as any[],
|
||||
password_confirm: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入确认密码',
|
||||
trigger: ['blur']
|
||||
},
|
||||
{
|
||||
validator: passwordConfirmValidator,
|
||||
trigger: 'blur'
|
||||
}
|
||||
] as any[]
|
||||
})
|
||||
const { optionsData } = useDictOptions<{
|
||||
role: any[]
|
||||
jobs: any[]
|
||||
dept: any[]
|
||||
}>({
|
||||
role: {
|
||||
api: roleAll
|
||||
},
|
||||
jobs: {
|
||||
api: jobsAll
|
||||
},
|
||||
dept: {
|
||||
api: deptAll
|
||||
}
|
||||
})
|
||||
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
mode.value == 'edit' ? await adminEdit(formData) : await adminAdd(formData)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
const setFormData = async (row: any) => {
|
||||
formRules.password = []
|
||||
formRules.password_confirm = [
|
||||
{
|
||||
validator: passwordConfirmValidator,
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
const data = await adminDetail({
|
||||
id: row.id
|
||||
})
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData
|
||||
})
|
||||
</script>
|
|
@ -0,0 +1,656 @@
|
|||
<template>
|
||||
<el-card class="box-card">
|
||||
<template #header>
|
||||
<span>甲方基本信息</span>
|
||||
</template>
|
||||
<el-form
|
||||
:inline="true"
|
||||
ref="formRef"
|
||||
:model="compeny"
|
||||
label-width="91.5px"
|
||||
:rules="formRules"
|
||||
class="select"
|
||||
>
|
||||
<el-form-item label="公司名称" prop="company_name" required>
|
||||
<el-input readonly v-model="compeny.company_name" />
|
||||
</el-form-item>
|
||||
<el-form-item label="社会代码" prop="organization_code" required>
|
||||
<el-input readonly v-model="compeny.organization_code" />
|
||||
</el-form-item>
|
||||
<el-form-item label="主要联系人" prop="company_name" required>
|
||||
<el-input readonly v-model="compeny.master_name" />
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号" prop="master_phone" required>
|
||||
<el-input readonly v-model="compeny.master_phone" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="公司类型" prop="compeny">
|
||||
<el-select
|
||||
readonly
|
||||
v-model="compeny.company_type_name"
|
||||
>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="省" prop="province">
|
||||
<el-select
|
||||
readonly
|
||||
v-model="compeny.province_name"
|
||||
>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="市" prop="city">
|
||||
<!-- <el-select readonly v-model="compeny.city_name">
|
||||
</el-select> -->
|
||||
<el-input readonly v-model="compeny.city_name" />
|
||||
</el-form-item>
|
||||
<el-form-item label="区" prop="area">
|
||||
<!-- <el-select readonly v-model="compeny.area_name">
|
||||
</el-select> -->
|
||||
<el-input readonly v-model="compeny.area_name" />
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="镇"
|
||||
v-if="compeny.company_type != 30"
|
||||
prop="company_type_name"
|
||||
>
|
||||
<!-- <el-select
|
||||
readonly
|
||||
v-model="compeny.street_name"
|
||||
>
|
||||
</el-select> -->
|
||||
<el-input readonly v-model="compeny.street_name" />
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="compeny.company_type != 30"
|
||||
label="地址"
|
||||
prop="address"
|
||||
>
|
||||
<el-input
|
||||
readonly
|
||||
v-model="compeny.address"
|
||||
:style="{ width: '32rem' }"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card v-if="false">
|
||||
<template #header>
|
||||
<span>甲方资质信息</span>
|
||||
</template>
|
||||
<el-form
|
||||
:inline="true"
|
||||
ref="formRef"
|
||||
:model="compeny"
|
||||
label-width="90px"
|
||||
:rules="formRules"
|
||||
class="company_z"
|
||||
>
|
||||
<el-form-item label="公司资质" prop="contract_type" required>
|
||||
<div class="company">
|
||||
<img :src="compenyimg?.business_license" />
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label-width="120px"
|
||||
label="开户许可证"
|
||||
prop="contract_no"
|
||||
required
|
||||
>
|
||||
<div class="company">
|
||||
<img :src="compenyimg?.business_licenseB" />
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="compenyimg?.other_qualifications?.length > 0"
|
||||
class="other"
|
||||
label="其他资质"
|
||||
prop="contract_no"
|
||||
required
|
||||
>
|
||||
<div
|
||||
class="company"
|
||||
v-for="(v, i) in compenyimg?.other_qualifications"
|
||||
:key="i"
|
||||
>
|
||||
<img :src="v" />
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card v-if="show">
|
||||
<template #header>
|
||||
<span>乙方基本信息</span>
|
||||
</template>
|
||||
<el-form
|
||||
:inline="true"
|
||||
ref="formRef"
|
||||
:model="compenyB"
|
||||
label-width="91.5px"
|
||||
:rules="formRules"
|
||||
class="select"
|
||||
>
|
||||
<el-form-item label="商户名称" prop="company_name" required>
|
||||
<el-input readonly v-model="compenyB.company_name" />
|
||||
</el-form-item>
|
||||
<el-form-item label="社会代码" prop="organization_code" required>
|
||||
<el-input readonly v-model="compenyB.organization_code" />
|
||||
</el-form-item>
|
||||
<el-form-item label="主要联系人" prop="master_name" required>
|
||||
<el-input readonly v-model="compenyB.master_name" />
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号" prop="master_phone" required>
|
||||
<el-input readonly v-model="compenyB.master_phone" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="公司类型" prop="company_type">
|
||||
<el-select
|
||||
readonly
|
||||
v-model="compenyB.company_type_name"
|
||||
>
|
||||
<el-option></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="省" prop="province">
|
||||
<el-select
|
||||
readonly
|
||||
v-model="compenyB.province_name"
|
||||
>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="市" prop="city">
|
||||
<!-- <el-select readonly v-model="compenyB.city_name">
|
||||
</el-select> -->
|
||||
<el-input readonly v-model="compeny.city_name" />
|
||||
</el-form-item>
|
||||
<el-form-item label="区" prop="area">
|
||||
<!-- <el-select readonly v-model="compenyB.area_name">
|
||||
</el-select> -->
|
||||
<el-input readonly v-model="compeny.area_name" />
|
||||
</el-form-item>
|
||||
<el-form-item label="镇" prop="street">
|
||||
<!-- <el-select
|
||||
readonly
|
||||
v-model="compenyB.street_name"
|
||||
>
|
||||
<el-option></el-option>
|
||||
</el-select> -->
|
||||
<el-input readonly v-model="compeny.street_name" />
|
||||
</el-form-item>
|
||||
<el-form-item label="地址" prop="street">
|
||||
<el-input
|
||||
readonly
|
||||
v-model="compenyB.address"
|
||||
:style="{ width: '31.5rem' }"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card v-if="show">
|
||||
<template #header>
|
||||
<span>乙方资质信息</span>
|
||||
</template>
|
||||
<el-form
|
||||
:inline="true"
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
label-width="90px"
|
||||
:rules="formRules"
|
||||
class="company_z"
|
||||
>
|
||||
<el-form-item class="other" label="资质信息" prop="contract_no" required>
|
||||
<div class="company" v-for="(v, i) in compenyBimg" :key="i">
|
||||
<el-image
|
||||
:src="v"
|
||||
:preview-src-list="compenyBimg"
|
||||
:initial-index="i"
|
||||
fit="cover"
|
||||
/>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="公司资质" prop="contract_type" required>
|
||||
<div class="company">
|
||||
<img :src="compenyBimg?.business_license" />
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label-width="120px"
|
||||
label="开户许可证"
|
||||
prop="contract_no"
|
||||
required
|
||||
>
|
||||
<div class="company">
|
||||
<img :src="compenyBimg?.business_licenseB" />
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="compenyBimg?.other_qualifications?.length > 0"
|
||||
class="other"
|
||||
label="其他资质"
|
||||
prop="contract_no"
|
||||
required
|
||||
>
|
||||
<div
|
||||
class="company"
|
||||
v-for="(v, i) in compenyBimg?.other_qualifications"
|
||||
:key="i"
|
||||
>
|
||||
<img :src="v" />
|
||||
</div>
|
||||
</el-form-item> -->
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card v-if="flag">
|
||||
<template #header>
|
||||
<span>个人基本信息</span>
|
||||
</template>
|
||||
<div class="persenal">
|
||||
<img :src="persen.avatar" />
|
||||
<el-form
|
||||
:inline="true"
|
||||
ref="formRef"
|
||||
:model="persen"
|
||||
label-width="90px"
|
||||
:rules="formRules"
|
||||
class="person_select"
|
||||
>
|
||||
<el-form-item label="姓名">
|
||||
<el-input
|
||||
readonly
|
||||
v-model="persen.nickname"
|
||||
placeholder="请输入姓名"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="性别">
|
||||
<el-input readonly v-model="persen.sex" placeholder="请输入性别" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系电话">
|
||||
<el-input
|
||||
readonly
|
||||
v-model="persen.mobile"
|
||||
placeholder="请输入联系电话"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="身份证号">
|
||||
<el-input
|
||||
v-model="persen.id_card"
|
||||
placeholder="请输入身份证号"
|
||||
readonly
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="省" prop="province">
|
||||
<el-select
|
||||
readonly
|
||||
v-model="persen.province_name"
|
||||
placeholder="请选择省"
|
||||
>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="市" prop="city">
|
||||
<el-select readonly v-model="persen.city_name" placeholder="请选择市">
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="区" prop="area">
|
||||
<el-select readonly v-model="persen.area_name" placeholder="请选择区">
|
||||
<el-option></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="镇" prop="street">
|
||||
<el-select
|
||||
readonly
|
||||
v-model="persen.street_name"
|
||||
placeholder="请选择镇"
|
||||
>
|
||||
<el-option></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card v-if="flag">
|
||||
<template #header>
|
||||
<span>个人资质信息</span>
|
||||
</template>
|
||||
<el-form class="idcard" :model="persenimg" :inline="true">
|
||||
<el-form-item label="身份证">
|
||||
<img :src="persenimg.id_card" />
|
||||
<img :src="persenimg.id_card_b" />
|
||||
</el-form-item>
|
||||
<el-form-item label="银行卡">
|
||||
<img :src="persenimg.bank_account" />
|
||||
<img :src="persenimg.bank_account_b" />
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="persenimg.car_card || persenimg.car_card_b"
|
||||
label="行驶证"
|
||||
>
|
||||
<img v-if="persenimg.car_card" :src="persenimg.car_card" />
|
||||
<img v-if="persenimg.car_card_b" :src="persenimg.car_card_b" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<template #header>
|
||||
<span>电子合同</span>
|
||||
</template>
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="frame"
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
label-width="90px"
|
||||
:rules="formRules"
|
||||
>
|
||||
<el-form-item label="甲方" prop="contract_type">
|
||||
<el-input
|
||||
v-model="compeny.company_name"
|
||||
:readonly="true"
|
||||
placeholder="暂无甲方方"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="乙方" prop="contract_no">
|
||||
<el-input
|
||||
v-model="compenyB.company_name"
|
||||
:readonly="true"
|
||||
placeholder="暂无乙方"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="合同类型" prop="contract_no">
|
||||
<el-input
|
||||
v-model="basicdata.contract_type_name"
|
||||
:readonly="true"
|
||||
placeholder="暂无合同"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="合同类型">
|
||||
<el-input
|
||||
value="商户入驻合同"
|
||||
:readonly="true"
|
||||
placeholder="商户入驻合同"
|
||||
/>
|
||||
</el-form-item>
|
||||
<br />
|
||||
<el-form-item v-if="formData.notes" label="备注">
|
||||
<el-input v-model="formData.notes" :readonly="true" type="textarea" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="合同编号" prop="contract_no">
|
||||
<el-input
|
||||
v-model="formData.party_b_name"
|
||||
:readonly="true"
|
||||
placeholder="暂无签约方"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<el-form label-width="100px">
|
||||
<el-form-item
|
||||
v-if="isshow || formData?.status == 0"
|
||||
label="合同上传"
|
||||
prop="field127"
|
||||
>
|
||||
<el-upload
|
||||
accept=".pdf"
|
||||
:headers="{ Token: userStore.token }"
|
||||
class="upload-demo"
|
||||
:action="base_url + '/upload/taskFile'"
|
||||
:on-success="handleAvatarSuccess_four"
|
||||
:before-upload="handleBeforeUpload"
|
||||
:limit="1"
|
||||
v-if="formData?.status == 0"
|
||||
:on-exceed="handleExceed"
|
||||
ref="upload"
|
||||
v-perms="['shop_contract/upload']"
|
||||
>
|
||||
<el-button type="primary">{{
|
||||
formData.file ? "重新上传" : "上传"
|
||||
}}</el-button>
|
||||
</el-upload>
|
||||
<a
|
||||
v-perms="['shop_contract/file']"
|
||||
v-if="formData.file"
|
||||
style="margin-left: 10px; color: #4a5dff; align-self: flex-start"
|
||||
:href="formData.file"
|
||||
target="_blank"
|
||||
>合同已上传,点击查看</a
|
||||
>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="isshow || formData.status == 0">
|
||||
<el-button
|
||||
v-perms="['shop_contract/upload']"
|
||||
type="primary"
|
||||
@click="submitContract"
|
||||
>确定</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
<el-form-item v-else-if="formData.file && formData.status">
|
||||
<a
|
||||
v-perms="['shop_contract/file']"
|
||||
v-if="formData.file"
|
||||
style="margin-left: 10px; color: #4a5dff"
|
||||
:href="
|
||||
formData.signed_contract_url
|
||||
? formData.signed_contract_url
|
||||
: formData.file
|
||||
"
|
||||
target="_blank"
|
||||
>查看合同</a
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {
|
||||
type FormInstance,
|
||||
type UploadProps,
|
||||
ElMessage,
|
||||
type UploadUserFile,
|
||||
} from "element-plus";
|
||||
import { apiShopContractDetail, apiShopWindControl } from "@/api/shop_contract";
|
||||
import { ref, reactive, defineExpose, computed, inject } from "vue";
|
||||
import { useRoute } from "vue-router";
|
||||
import { dictDataLists } from "@/api/setting/dict";
|
||||
// import { upContact } from "@/api/consumer";
|
||||
import { genFileId } from "element-plus";
|
||||
const { query } = useRoute();
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
import useMultipleTabs from "@/hooks/useMultipleTabs";
|
||||
const { removeTab } = useMultipleTabs();
|
||||
const base_url: any = inject("base_url");
|
||||
|
||||
const formData = reactive({
|
||||
id: "",
|
||||
company_id: "",
|
||||
contract_type: "",
|
||||
contract_type_name: "",
|
||||
contract_no: "",
|
||||
file: "",
|
||||
status: "",
|
||||
check_status: "",
|
||||
party_a: "",
|
||||
party_a_name: "",
|
||||
party_b: "",
|
||||
party_b_name: "",
|
||||
area_manager: "",
|
||||
area_manager_name: "",
|
||||
type_name: "",
|
||||
url: "",
|
||||
status_name: "",
|
||||
signed_contract_url: "",
|
||||
notes: "",
|
||||
});
|
||||
const fileList = ref<UploadUserFile[]>([]);
|
||||
const basicdata = ref({});
|
||||
const compeny = ref({});
|
||||
const compenyimg = ref([]);
|
||||
const compenyB = ref([]);
|
||||
const compenyBimg = ref([]);
|
||||
const persen = ref([]);
|
||||
const persenimg = ref([]);
|
||||
const show = ref(true);
|
||||
const flag = ref(false);
|
||||
const isshow = ref(true);
|
||||
const route = useRoute();
|
||||
const userStore = useUserStore();
|
||||
|
||||
async function render() {
|
||||
// 传值赋值
|
||||
const res = await apiShopContractDetail({ id: query.id });
|
||||
Object.keys(formData).forEach((key: any) => {
|
||||
if (res[key] != null && res[key] != undefined) formData[key] = res[key];
|
||||
});
|
||||
compeny.value = res.party_a_info;
|
||||
basicdata.value = res;
|
||||
if (basicdata.value.status == 1 || res.check_status == 3 || res.status == 1) {
|
||||
isshow.value = false;
|
||||
}
|
||||
try {
|
||||
if (res.party_a_info.qualification.bank_account) {
|
||||
res.party_a_info.qualification.bank_account = JSON.parse(
|
||||
res.party_a_info.qualification.bank_account
|
||||
);
|
||||
compenyimg.value = res.party_a_info.qualification;
|
||||
}
|
||||
if (res.party_b_info.qualification.other_qualifications) {
|
||||
res.party_b_info.qualification.other_qualifications = JSON.parse(
|
||||
res.party_b_info.qualification.other_qualifications
|
||||
);
|
||||
compenyBimg.value = res.party_b_info.qualification;
|
||||
}
|
||||
} catch (error) {}
|
||||
compenyimg.value = res.party_a_info.qualification;
|
||||
compenyB.value = res.party_b_info;
|
||||
compenyBimg.value = res.party_b_info.qualification;
|
||||
flag.value = false;
|
||||
// if (res.type == 2) {
|
||||
// show.value = false;
|
||||
// res.party_b_info.sex == 1
|
||||
// ? (res.party_b_info.sex = "男")
|
||||
// : (res.party_b_info.sex = "女");
|
||||
// persen.value = res.party_b_info;
|
||||
// persenimg.value = res.party_b_info.qualification;
|
||||
// }
|
||||
// if (res.type == 1) {
|
||||
// compenyB.value = res.party_b_info;
|
||||
// compenyBimg.value = res.party_b_info.qualification;
|
||||
// flag.value = false;
|
||||
// } else {
|
||||
// compenyB.value.company_name = res.party_b_info.nickname;
|
||||
// }
|
||||
}
|
||||
|
||||
const handleBeforeUpload = (e: any) => {
|
||||
if (e?.name?.substring(e.name.length - 4, e.name.length) != ".pdf") {
|
||||
ElMessage.error("仅支持上传.pdf文件");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
const upload = ref(null);
|
||||
const handleExceed = (files: any) => {
|
||||
upload.value!.clearFiles();
|
||||
const file = files[0] as UploadRawFile;
|
||||
file.uid = genFileId();
|
||||
upload.value!.handleStart(file);
|
||||
upload.value!.submit();
|
||||
};
|
||||
|
||||
const handleAvatarSuccess_four: UploadProps["onSuccess"] = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
}
|
||||
formData.file = response.data.uri;
|
||||
};
|
||||
|
||||
const router = useRouter();
|
||||
const submitContract = () => {
|
||||
if (!formData.file) return ElMessage.error("请先上传合同!");
|
||||
apiShopWindControl({ file: formData.file, id: route.query.id });
|
||||
removeTab();
|
||||
router.back();
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
await render();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.frame {
|
||||
.el-form-item {
|
||||
width: 40%;
|
||||
.el-input {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
.select {
|
||||
.el-form-item {
|
||||
.el-select {
|
||||
width: 12rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
.person_select {
|
||||
.el-form-item {
|
||||
width: 30%;
|
||||
.el-select {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
.company {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
img {
|
||||
width: 10vw;
|
||||
height: 6.3vw;
|
||||
margin-right: 10px;
|
||||
}
|
||||
.el-image {
|
||||
width: 10vw;
|
||||
height: 6.3vw;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
.persenal {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
img {
|
||||
width: 10vw;
|
||||
height: 6.3vw;
|
||||
}
|
||||
}
|
||||
.idcard {
|
||||
img {
|
||||
width: 10vw;
|
||||
height: 6.3vw;
|
||||
margin-right: 12px;
|
||||
}
|
||||
}
|
||||
.company_z {
|
||||
.el-form-item {
|
||||
width: 40%;
|
||||
}
|
||||
.other {
|
||||
width: 100% !important;
|
||||
}
|
||||
}
|
||||
.el-card {
|
||||
margin-top: 10px;
|
||||
pointer-event: none;
|
||||
}
|
||||
|
||||
.el-upload-list .el-upload-list__item-thumbnail {
|
||||
width: 500px; /* 设置文件缩略图的宽度 */
|
||||
}
|
||||
|
||||
.el-upload-list .el-upload-list__item-name {
|
||||
max-width: 450px; /* 设置文件名的最大宽度 */
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,125 @@
|
|||
<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="contract_no">
|
||||
<el-input v-model="formData.contract_no" clearable placeholder="请输入合同编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="1公司2个人" prop="type">
|
||||
<el-input v-model="formData.type" clearable placeholder="请输入1公司2个人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="签约后的合同" prop="contract_url">
|
||||
<el-input v-model="formData.contract_url" clearable placeholder="请输入签约后的合同" />
|
||||
</el-form-item>
|
||||
<el-form-item label="证据包" prop="evidence_url">
|
||||
<el-input v-model="formData.evidence_url" clearable placeholder="请输入证据包" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合同多方链接" prop="url">
|
||||
<el-input v-model="formData.url" clearable placeholder="请输入合同多方链接" />
|
||||
</el-form-item>
|
||||
<el-form-item label="签约计时器" prop="signing_timer">
|
||||
<el-input v-model="formData.signing_timer" clearable placeholder="请输入签约计时器" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="shopContractEdit">
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiShopContractAdd, apiShopContractEdit, apiShopContractDetail } from '@/api/shop_contract'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import type { PropType } from 'vue'
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑商户合同' : '新增商户合同'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
contract_no: '',
|
||||
type: '',
|
||||
contract_url: '',
|
||||
evidence_url: '',
|
||||
url: '',
|
||||
signing_timer: '',
|
||||
})
|
||||
|
||||
|
||||
// 表单验证
|
||||
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 apiShopContractDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiShopContractEdit(data)
|
||||
: await apiShopContractAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
|
@ -0,0 +1,338 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="合同编号" prop="contract_no">
|
||||
<el-input class="w-[280px]" v-model="queryParams.contract_no" clearable placeholder="请输入合同编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="甲方" prop="party_a">
|
||||
<el-input class="w-[280px]" v-model="queryParams.party_a" clearable placeholder="请输入甲方" />
|
||||
</el-form-item>
|
||||
<el-form-item label="乙方" prop="party_b">
|
||||
<el-input class="w-[280px]" v-model="queryParams.party_b" clearable placeholder="请输入乙方" />
|
||||
</el-form-item>
|
||||
<el-form-item 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>
|
||||
<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="['shop_contract/add']"
|
||||
type="primary"
|
||||
@click="handleAdd"
|
||||
>
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['shop_contract/delete']"
|
||||
:disabled="!selectData.length"
|
||||
@click="handleDelete(selectData)"
|
||||
>
|
||||
删除
|
||||
</el-button> -->
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<!-- <el-table-column type="selection" width="55" /> -->
|
||||
<el-table-column label="id" width="100" prop="id" show-overflow-tooltip />
|
||||
<el-table-column label="合同编号" prop="contract_no" show-overflow-tooltip />
|
||||
<el-table-column label="甲方" prop="party_a_name" show-overflow-tooltip />
|
||||
<el-table-column label="乙方" prop="party_b_name" show-overflow-tooltip />
|
||||
<!-- <el-table-column
|
||||
label="片区经理"
|
||||
prop="area_manager_name"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="合同类型"
|
||||
prop="type_name"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="证据包"
|
||||
prop="evidence_url"
|
||||
show-overflow-tooltip
|
||||
/> -->
|
||||
<el-table-column label="签约状态" prop="status" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.status" style="color: #67c23a">已签约</span>
|
||||
<span v-else style="color: #fe0000">未签约</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" prop="notes" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" width="280" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" v-perms="['shop_contract/details']" link>
|
||||
<router-link :to="{
|
||||
path: '/contract/shop_contract_detail',
|
||||
query: { id: row.id },
|
||||
}">{{ row.status ? "详情" : "审核" }}</router-link>
|
||||
</el-button>
|
||||
<el-button type="primary" v-perms="['shop_contract/details']" link @click="addNotes(row)">
|
||||
设置备注
|
||||
</el-button>
|
||||
<template v-if="row.status == 0">
|
||||
<el-button v-perms="['shop_contract/details']" v-if="row.check_status == 1" type="warning" link>
|
||||
<router-link :to="{
|
||||
path: '/contract/shop_contract_detail',
|
||||
query: { id: row.id },
|
||||
}">待审核</router-link>
|
||||
</el-button>
|
||||
<el-button v-else-if="row.check_status == 2" v-perms="['shop_contract/contract_send']" type="primary" link @click="showCreateConctPop(row)">发送合同</el-button>
|
||||
<el-button v-else-if="row.check_status == 3" v-perms="['shop_contract/contract_send_again']" type="primary" link @click="(showPop = true), (contractId = row.party_b)">发送短信</el-button>
|
||||
</template>
|
||||
<el-button v-else type="primary" v-perms="['shop_contract/evidence']" link @click="loadContractZip(row)">
|
||||
下载证据包
|
||||
</el-button>
|
||||
<!-- <el-button
|
||||
v-perms="['shop_contract/edit']"
|
||||
type="primary"
|
||||
link
|
||||
@click="handleEdit(row)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['shop_contract/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" />
|
||||
<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>
|
||||
<popup ref="notesRef" title="设置备注" :async="true" width="550px" @confirm="handleSubmit">
|
||||
<el-form :model="formData" :rules="noteRules">
|
||||
<el-form-item label="备注" prop="notes">
|
||||
<el-input v-model="formData.notes" type="textarea" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="shopContractLists">
|
||||
import { usePaging } from "@/hooks/usePaging";
|
||||
import { useDictData } from "@/hooks/useDictOptions";
|
||||
import {
|
||||
apiShopContractLists,
|
||||
apiShopContractDelete,
|
||||
apiShopDraftingcontracts,
|
||||
apiShopSendMsgApi,
|
||||
contractEvidence,
|
||||
apiShopContractAddNotes,
|
||||
} from "@/api/shop_contract";
|
||||
import { timeFormat } from "@/utils/util";
|
||||
import feedback from "@/utils/feedback";
|
||||
import EditPopup from "./edit.vue";
|
||||
import Popup from "@/components/popup/index.vue";
|
||||
|
||||
const statusdata = reactive([
|
||||
{ id: "1", name: "已签约" },
|
||||
{ id: "0", name: "未签约" },
|
||||
]);
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>();
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false);
|
||||
|
||||
// 设置备注
|
||||
const formData = ref({
|
||||
id: "",
|
||||
notes: "",
|
||||
});
|
||||
const noteRules = reactive({
|
||||
notes: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入备注",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
});
|
||||
const notesRef = shallowRef();
|
||||
const addNotes = (row: any) => {
|
||||
let arr = Object.keys(formData.value);
|
||||
arr.forEach((key: any) => {
|
||||
formData.value[key] = row[key];
|
||||
});
|
||||
notesRef.value.open();
|
||||
};
|
||||
const handleSubmit = async () => {
|
||||
await apiShopContractAddNotes({ ...formData.value });
|
||||
getLists();
|
||||
notesRef.value.close();
|
||||
};
|
||||
const handleClose = () => {
|
||||
notesRef.value.close();
|
||||
};
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
contract_no: "",
|
||||
party_a: "",
|
||||
party_b: "",
|
||||
check_status: "",
|
||||
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: apiShopContractLists,
|
||||
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 apiShopContractDelete({ id });
|
||||
getLists();
|
||||
};
|
||||
// 下载证据包
|
||||
const loadContractZip = (row: any) => {
|
||||
contractEvidence({ id: row.id }).then((res) => {
|
||||
downloadFile(res.url, "");
|
||||
});
|
||||
};
|
||||
const downloadFile = (url: string, fileName: string) => {
|
||||
let link = document.createElement("a");
|
||||
link.href = url;
|
||||
link.download = fileName;
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
};
|
||||
|
||||
//弹窗
|
||||
const showPop = ref(false);
|
||||
const showConctactPop = ref(false);
|
||||
// 发送合同的id
|
||||
const contractId = ref("");
|
||||
const ctype = ref("");
|
||||
const contractparty = ref("");
|
||||
// 发送合同
|
||||
const showCreateConctPop = (row) => {
|
||||
(showPop.value = true),
|
||||
(showConctactPop.value = true),
|
||||
(contractId.value = row.id);
|
||||
contractparty.value = row.party_b;
|
||||
ctype.value = row.type;
|
||||
};
|
||||
const offPop = () => {
|
||||
showPop.value = false;
|
||||
showConctactPop.value = false;
|
||||
};
|
||||
|
||||
// 发送合同
|
||||
const creContct = async () => {
|
||||
// await generateGontract({ id: contractId.value });
|
||||
await apiShopDraftingcontracts({
|
||||
id: contractId.value,
|
||||
part_b: contractparty.value,
|
||||
type: ctype.value,
|
||||
});
|
||||
getLists();
|
||||
offPop();
|
||||
};
|
||||
|
||||
// 发送短信
|
||||
const sendMsg = async () => {
|
||||
// await sendMsgApi({ id: contractId.value });
|
||||
await apiShopSendMsgApi({ id: contractId.value });
|
||||
getLists();
|
||||
offPop();
|
||||
};
|
||||
|
||||
getLists();
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.btn {
|
||||
position: absolute;
|
||||
}
|
||||
h1 {
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
font-size: 30px;
|
||||
color: red;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.content {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.info {
|
||||
color: red;
|
||||
font-weight: bold;
|
||||
font-size: 18px;
|
||||
display: inline-block;
|
||||
margin: 0 5px;
|
||||
}
|
||||
|
||||
.btn_menu {
|
||||
margin-top: 10vh;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,103 @@
|
|||
<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>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="shopMerchantEdit">
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiShopMerchantAdd, apiShopMerchantEdit, apiShopMerchantDetail } from '@/api/shop_merchant'
|
||||
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: '',
|
||||
|
||||
})
|
||||
|
||||
|
||||
// 表单验证
|
||||
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 apiShopMerchantDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiShopMerchantEdit(data)
|
||||
: await apiShopMerchantAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
|
@ -0,0 +1,141 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="商户名称" prop="merchant_name">
|
||||
<el-input class="w-[280px]" v-model="queryParams.merchant_name" clearable placeholder="请输入商户名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="主联系人姓名" prop="master_name">
|
||||
<el-input class="w-[280px]" v-model="queryParams.master_name" clearable placeholder="请输入主联系人姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="主联系人手机" prop="master_phone">
|
||||
<el-input class="w-[280px]" v-model="queryParams.master_phone" 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="['shop_merchant/add']"
|
||||
type="primary"
|
||||
@click="handleAdd"
|
||||
>
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['shop_merchant/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="100" prop="id" show-overflow-tooltip />
|
||||
<el-table-column label="商户名称" prop="company_name" show-overflow-tooltip />
|
||||
<el-table-column label="社会代码" prop="organization_code" show-overflow-tooltip />
|
||||
<el-table-column label="主联系人姓名" prop="master_name" show-overflow-tooltip />
|
||||
<el-table-column label="主联系人手机" prop="master_phone" show-overflow-tooltip />
|
||||
<el-table-column label="认证反馈" prop="notes" show-overflow-tooltip />
|
||||
|
||||
<!-- <el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
v-perms="['shop_merchant/edit']"
|
||||
type="primary"
|
||||
link
|
||||
@click="handleEdit(row)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['shop_merchant/delete']"
|
||||
type="danger"
|
||||
link
|
||||
@click="handleDelete(row.id)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="shopMerchantLists">
|
||||
import { usePaging } from "@/hooks/usePaging";
|
||||
import { useDictData } from "@/hooks/useDictOptions";
|
||||
import {
|
||||
apiShopMerchantLists,
|
||||
apiShopMerchantDelete,
|
||||
} from "@/api/shop_merchant";
|
||||
import { timeFormat } from "@/utils/util";
|
||||
import feedback from "@/utils/feedback";
|
||||
import EditPopup from "./edit.vue";
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>();
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false);
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
merchant_name: "",
|
||||
master_name: "",
|
||||
master_phone: "",
|
||||
});
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([]);
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id);
|
||||
};
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData("");
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiShopMerchantLists,
|
||||
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 apiShopMerchantDelete({ id });
|
||||
getLists();
|
||||
};
|
||||
|
||||
getLists();
|
||||
</script>
|
|
@ -0,0 +1,149 @@
|
|||
<template>
|
||||
<div id="example-simple">
|
||||
<calendar-view
|
||||
:show-date="showDate"
|
||||
class="holiday-us-traditional holiday-us-official holiday-ue theme-gcal"
|
||||
:enable-drag-drop="false"
|
||||
:item-top="themeOptions.top"
|
||||
:item-content-height="themeOptions.height"
|
||||
:item-border-height="themeOptions.border"
|
||||
@click-item="clickItems"
|
||||
@click-date="clickDate"
|
||||
:items="taskList"
|
||||
:current-period-label="'今日'"
|
||||
>
|
||||
<template #header="{ headerProps }">
|
||||
<calendar-view-header
|
||||
:header-props="headerProps"
|
||||
:previous-year-label="themeOptions.previousYearLabel"
|
||||
:previous-period-label="themeOptions.previousPeriodLabel"
|
||||
:next-period-label="themeOptions.nextPeriodLabel"
|
||||
:next-year-label="themeOptions.nextYearLabel"
|
||||
@input="setShowDate"
|
||||
/>
|
||||
</template>
|
||||
</calendar-view>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="task">
|
||||
// 日历组件
|
||||
import { CalendarView, CalendarViewHeader } from "vue-simple-calendar";
|
||||
|
||||
const showDate = ref(new Date());
|
||||
const setShowDate = (d) => {
|
||||
showDate.value = d;
|
||||
emits("initShowDate", d);
|
||||
};
|
||||
|
||||
const props = defineProps({
|
||||
list: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return [];
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const taskList = computed(() => {
|
||||
let arr: any = [];
|
||||
props.list.forEach((item: any) => {
|
||||
arr.push({
|
||||
id: item.id,
|
||||
title: item.template_name,
|
||||
startDate: new Date(item.start_time),
|
||||
endDate: new Date(item.end_time),
|
||||
});
|
||||
});
|
||||
return arr;
|
||||
});
|
||||
|
||||
const emits = defineEmits(["clickItem", "initShowDate"]);
|
||||
|
||||
const clickItems = (e) => {
|
||||
emits("clickItem", e.id);
|
||||
};
|
||||
|
||||
const clickDate = (e) => {
|
||||
console.log(e);
|
||||
};
|
||||
|
||||
const themeOptions = computed((): any => {
|
||||
return {
|
||||
top: "2.6em",
|
||||
height: "2.1em",
|
||||
border: "0px",
|
||||
previousYearLabel: "<<",
|
||||
previousPeriodLabel: "<",
|
||||
nextPeriodLabel: ">",
|
||||
nextYearLabel: ">>",
|
||||
currentPeriodLabel: "今天",
|
||||
};
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "../../../node_modules/vue-simple-calendar/dist/style.css";
|
||||
@import "../../../node_modules/vue-simple-calendar/dist/css/default.css";
|
||||
@import "../../../node_modules/vue-simple-calendar/dist/css/holidays-us.css";
|
||||
/* @import "../../../node_modules/vue-simple-calendar/dist/css/holidays-ue.css"; */
|
||||
@import "../../../node_modules/vue-simple-calendar/dist/css/gcal.css";
|
||||
|
||||
#example-simple {
|
||||
font-family: Avenir, Arial, Helvetica, sans-serif;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 85vh !important;
|
||||
width: 100% !important;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
.theme-gcal .cv-day.today .cv-day-number {
|
||||
background-color: #4a5dff;
|
||||
}
|
||||
|
||||
#example-simple .cv-item {
|
||||
/* background-color: #f56c6c; */
|
||||
background-color: rgba($color: #4a5dff, $alpha: 0.8) !important;
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
}
|
||||
/* #example-simple .cv-day {
|
||||
&:hover {
|
||||
background-color: rgba($color: #000000, $alpha: 0.1);
|
||||
}
|
||||
} */
|
||||
|
||||
#example-simple .cv-item.custom-date-class-red {
|
||||
background-color: #f66;
|
||||
color: #fff;
|
||||
}
|
||||
.cv-wrapper.holiday-us-traditional .cv-day-number::before {
|
||||
content: none !important;
|
||||
}
|
||||
|
||||
.theme-gcal .periodLabel {
|
||||
font-size: 16px !important;
|
||||
}
|
||||
.theme-gcal .cv-header button.previousYear,
|
||||
.theme-gcal .cv-header button.previousPeriod,
|
||||
.theme-gcal .cv-header button.nextPeriod,
|
||||
.theme-gcal .cv-header button.nextYear {
|
||||
width: 2em;
|
||||
border: 1px solid #ccc;
|
||||
text-align: center !important;
|
||||
margin-left: 10px;
|
||||
border-radius: 5px;
|
||||
padding-right: 0 !important;
|
||||
font-size: 1.8em;
|
||||
}
|
||||
.theme-gcal .cv-header button.previousYear,
|
||||
.theme-gcal .cv-header button.previousPeriod,
|
||||
.theme-gcal .cv-header button.nextPeriod,
|
||||
.theme-gcal .cv-header button.nextYear {
|
||||
letter-spacing: 0;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,354 @@
|
|||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup
|
||||
ref="popupRef"
|
||||
:title="title"
|
||||
:async="true"
|
||||
width="800px"
|
||||
@confirm="handleSubmit"
|
||||
@close="handleClose"
|
||||
:clickModalClose="mode == 'show'"
|
||||
:button="mode != 'show'"
|
||||
>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:rules="rules"
|
||||
class="formdata"
|
||||
:model="formData"
|
||||
label-width="120px"
|
||||
>
|
||||
<el-form-item v-if="formData.id" label="任务ID" prop="id">
|
||||
<el-input
|
||||
:disabled="true"
|
||||
v-model="formData.id"
|
||||
clearable
|
||||
placeholder="请输入任务ID"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="任务日期" prop="datetime">
|
||||
<el-date-picker
|
||||
:disabled="isDisabled"
|
||||
v-model="formData.datetime"
|
||||
name="datetime"
|
||||
type="daterange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始时间"
|
||||
end-placeholder="结束时间"
|
||||
@change="changeDateTime"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="任务安排" prop="template_id">
|
||||
<el-input
|
||||
:disabled="isDisabled"
|
||||
v-model="formData.template_name"
|
||||
@click="isShow = true"
|
||||
name="template_id"
|
||||
clearable
|
||||
placeholder="请输入任务安排"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="任务描述" v-if="formData.template_name">
|
||||
<el-input
|
||||
disabled
|
||||
v-model="formData.templateInfo.content"
|
||||
placeholder="没有任务描述"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="一阶段天数">
|
||||
<el-input
|
||||
disabled
|
||||
v-model="formData.templateInfo.stage_day_one"
|
||||
clearable
|
||||
placeholder="请输入天数"
|
||||
type="number"
|
||||
>
|
||||
<template #append>天</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="一阶段金额">
|
||||
<el-input
|
||||
disabled
|
||||
v-model="formData.templateInfo.money"
|
||||
clearable
|
||||
placeholder="请输入金额"
|
||||
type="number"
|
||||
>
|
||||
<template #append>元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="二阶段天数">
|
||||
<el-input
|
||||
disabled
|
||||
v-model="formData.templateInfo.stage_day_two"
|
||||
clearable
|
||||
placeholder="请输入天数"
|
||||
type="number"
|
||||
>
|
||||
<template #append>天</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="二阶段金额">
|
||||
<el-input
|
||||
disabled
|
||||
v-model="formData.templateInfo.money_two"
|
||||
clearable
|
||||
placeholder="请输入金额"
|
||||
type="number"
|
||||
>
|
||||
<template #append>元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="noThreefilter(+formData.templateInfo.type)"
|
||||
label="三阶段天数"
|
||||
>
|
||||
<el-input
|
||||
disabled
|
||||
v-model="formData.templateInfo.stage_day_three"
|
||||
clearable
|
||||
placeholder="请输入天数"
|
||||
type="number"
|
||||
>
|
||||
<template #append>天</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="noThreefilter(+formData.templateInfo.type)"
|
||||
label="三阶段金额"
|
||||
>
|
||||
<el-input
|
||||
disabled
|
||||
v-model="formData.templateInfo.new_money_three"
|
||||
clearable
|
||||
placeholder="请输入金额"
|
||||
type="number"
|
||||
>
|
||||
<template #append>元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="长期金额" v-if="+formData.templateInfo.types == 2">
|
||||
<el-input
|
||||
disabled
|
||||
v-model="formData.templateInfo.money_three"
|
||||
clearable
|
||||
placeholder="请输入金额"
|
||||
type="number"
|
||||
>
|
||||
<template #append>元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="formData.templateInfo.type == 32" label="中转点">
|
||||
<el-input
|
||||
disabled
|
||||
placeholder="请选择中转点"
|
||||
:value="formData.templateInfo?.extend?.transfer?.address"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="formData.templateInfo.type == 32" label="终点">
|
||||
<el-input
|
||||
disabled
|
||||
placeholder="请选择终点"
|
||||
:value="formData.templateInfo?.extend?.terminus?.address"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item
|
||||
v-if="formData.templateInfo.type == 35"
|
||||
label="负责人"
|
||||
prop="task_admin"
|
||||
@click="clickTaskAdmin"
|
||||
>
|
||||
<el-input
|
||||
placeholder="请选择负责人"
|
||||
readonly
|
||||
v-model="formData.task_admin_name"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<el-form-item
|
||||
v-if="formData.templateInfo.type == 35"
|
||||
label="充值金额(元)"
|
||||
prop="recharge"
|
||||
>
|
||||
<el-input
|
||||
disabled
|
||||
placeholder="请输入充值金额(元)"
|
||||
v-model="formData.templateInfo.recharge"
|
||||
type="number"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item v-if="mode == 'show'" label="">
|
||||
<el-button type="primary" @click="clickUpdate"> 修改 </el-button>
|
||||
<el-button type="danger" @click="clickDelete"> 删除 </el-button>
|
||||
</el-form-item> -->
|
||||
</el-form>
|
||||
</popup>
|
||||
<el-dialog v-model="isShow" title="选择任务安排" width="60%">
|
||||
<DialogIndex @customEvent="customEvent" :company_id="props.company_id" />
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="taskEidt">
|
||||
import type { FormInstance, FormRules } from "element-plus";
|
||||
import Popup from "@/components/popup/index.vue";
|
||||
import { apiTaskAdd, apiTaskEdit, apiTaskDelete } from "@/api/task";
|
||||
import { reactive, onUpdated, type PropType } from "vue";
|
||||
import DialogIndex from "@/views/task_template/list_two.vue";
|
||||
import { timeFormat } from "@/utils/util";
|
||||
import feedback from "@/utils/feedback";
|
||||
const route = useRoute();
|
||||
|
||||
const emit = defineEmits(["success", "close"]);
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>();
|
||||
const mode = ref("add");
|
||||
const detailsdt = ref({});
|
||||
const isShow = ref(false);
|
||||
const title = ref("创建日程安排");
|
||||
|
||||
const changeDateTime = (e: any) => {
|
||||
formData.start_time = timeFormat(e[0]).split(" ")[0];
|
||||
formData.end_time = timeFormat(e[1]).split(" ")[0];
|
||||
};
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: "",
|
||||
create_user_id: "",
|
||||
status: "",
|
||||
template_id: "",
|
||||
scheduling_id: "",
|
||||
template_name: "",
|
||||
start_time: "",
|
||||
end_time: "",
|
||||
datetime: "",
|
||||
content: "",
|
||||
templateInfo: {},
|
||||
});
|
||||
|
||||
interface RuleForm {
|
||||
datetime: Date | string;
|
||||
template_id: string;
|
||||
}
|
||||
|
||||
const rules = reactive<FormRules<RuleForm>>({
|
||||
datetime: { required: true, message: "请选择时间范围", trigger: "blur" },
|
||||
template_id: {
|
||||
required: true,
|
||||
message: "请选择任务安排",
|
||||
trigger: "change",
|
||||
},
|
||||
});
|
||||
|
||||
// 没有三阶段的任务类型ID, 使用以下方法过滤
|
||||
const noThreeList = reactive([31, 32, 33, 34, 35, 45, 48, 49]);
|
||||
const noThreefilter = (id: number) => {
|
||||
if (noThreeList.includes(id)) return false;
|
||||
else return true;
|
||||
};
|
||||
|
||||
function customEvent(data: any) {
|
||||
isShow.value = false;
|
||||
formData.template_id = data.id;
|
||||
formData.template_name = data.title;
|
||||
}
|
||||
|
||||
const formRef = ref(null);
|
||||
|
||||
const props = defineProps({
|
||||
task: {
|
||||
type: Object,
|
||||
defualt: () => {
|
||||
null;
|
||||
},
|
||||
},
|
||||
company_id: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
});
|
||||
const isDisabled = ref(false);
|
||||
|
||||
const updatedForm = async (task: any = null) => {
|
||||
try {
|
||||
formRef.value.clearValidate && formRef.value?.clearValidate();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
if (mode.value == "show") {
|
||||
title.value = "查看日程安排";
|
||||
isDisabled.value = true;
|
||||
Object.keys(formData).forEach((key: any) => {
|
||||
if (task[key] != null && task[key] != undefined)
|
||||
formData[key] = task[key];
|
||||
});
|
||||
formData.datetime = [
|
||||
formData.start_time.split(" ")[0],
|
||||
formData.end_time.split(" ")[0],
|
||||
];
|
||||
} else {
|
||||
isDisabled.value = false;
|
||||
Object.keys(formData).forEach((key: any) => {
|
||||
formData[key] = "";
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const clickUpdate = () => {
|
||||
mode.value = "edit";
|
||||
isDisabled.value = false;
|
||||
};
|
||||
|
||||
// 删除
|
||||
const clickDelete = () => {
|
||||
feedback.confirm("确定要删除吗?").then(async (e) => {
|
||||
if (e == "confirm") {
|
||||
await apiTaskDelete({ id: formData.id });
|
||||
popupRef.value?.close();
|
||||
emit("success");
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = () => {
|
||||
if (mode.value == "show") return popupRef.value?.close();
|
||||
else {
|
||||
formRef.value.validate(async (e: boolean) => {
|
||||
if (e) {
|
||||
const data = { ...formData };
|
||||
if (route.query.id) {
|
||||
data.scheduling_id = route.query.id.toString();
|
||||
}
|
||||
data.start_time = data.start_time.split(" ")[0];
|
||||
data.end_time = data.end_time.split(" ")[0];
|
||||
mode.value == "edit" ? await apiTaskEdit(data) : await apiTaskAdd(data);
|
||||
popupRef.value?.close();
|
||||
emit("success");
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
//打开弹窗
|
||||
const open = (type = "add") => {
|
||||
mode.value = type;
|
||||
popupRef.value?.open();
|
||||
};
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit("close");
|
||||
};
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
updatedForm,
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.formdata {
|
||||
.el-form-item {
|
||||
.el-date-picker {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,231 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none" v-loading="loading" shadow="never">
|
||||
<!-- <div style="display: flex; justify-content: space-between">
|
||||
<el-button
|
||||
v-perms="['task.taskCalendar/add']"
|
||||
type="primary"
|
||||
@click="handleAdd"
|
||||
>
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
</div> -->
|
||||
<calendar
|
||||
:list="taskList"
|
||||
@clickItem="clickTask"
|
||||
@initShowDate="initShowDate"
|
||||
></calendar>
|
||||
<!-- <div class="mt-4">
|
||||
<el-calendar v-model="dateValue">
|
||||
<template #dateCell="{ data }">
|
||||
<div style="width: 100%; height: 100%">
|
||||
<p
|
||||
:class="data.isSelected ? 'is-selected' : ''"
|
||||
style="padding: 8px 8px 0 8px"
|
||||
>
|
||||
{{ data.day.split("-").slice(1).join("-") }}
|
||||
</p>
|
||||
<div
|
||||
class="task"
|
||||
@click="clickTask(item)"
|
||||
v-for="(item, index) in taskListFilter(data.day)"
|
||||
:key="index"
|
||||
>
|
||||
{{ item.template_name }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-calendar>
|
||||
</div>-->
|
||||
</el-card>
|
||||
|
||||
<EditTowPopup
|
||||
ref="editTowRef"
|
||||
:task="task"
|
||||
:type="popupType"
|
||||
:company_id="company_id"
|
||||
@success="loadTask"
|
||||
@close="showEditTow = false"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="task">
|
||||
import { timeFormat } from "@/utils/util";
|
||||
import feedback from "@/utils/feedback";
|
||||
// import { getRoutePath } from "router";
|
||||
import EditTowPopup from "./editTow.vue";
|
||||
import { reactive, watch } from "vue";
|
||||
import { apiTaskList, apiTaskDetails } from "@/api/task";
|
||||
import calendar from "./calendar.vue";
|
||||
|
||||
const route = useRoute();
|
||||
|
||||
const dateValue = ref(new Date());
|
||||
|
||||
// 当前点击的任务
|
||||
const task = ref({
|
||||
create_user_id: 0,
|
||||
end_time: "",
|
||||
id: 0,
|
||||
scheduling_id: 0,
|
||||
start_time: "",
|
||||
status: 0,
|
||||
template_id: 0,
|
||||
template_name: "",
|
||||
});
|
||||
const popupType = ref("add");
|
||||
const clickTask = (e: any) => {
|
||||
popupType.value = "show";
|
||||
// task.value = e;
|
||||
task.value = taskList.value.find((item: any) => item.id == e) || null;
|
||||
handleSelect();
|
||||
};
|
||||
|
||||
// 加载
|
||||
const loading = ref(true);
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>();
|
||||
const editTowRef = shallowRef<InstanceType<typeof EditPopup>>();
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false);
|
||||
const showEditTow = ref(false);
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
scheduling_id: "",
|
||||
start_time: "",
|
||||
end_time: "",
|
||||
page_no: 1,
|
||||
page_size: 300,
|
||||
});
|
||||
if (route.query.id) {
|
||||
queryParams.scheduling_id = route.query.id.toString();
|
||||
}
|
||||
const company_id = ref("");
|
||||
if (route.query.company_id) company_id.value = route.query.company_id;
|
||||
const taskList = ref<any>([]);
|
||||
|
||||
// 查询
|
||||
const loadTask = async () => {
|
||||
apiTaskList(queryParams).then((res) => {
|
||||
taskList.value = res.lists;
|
||||
loading.value = false;
|
||||
});
|
||||
};
|
||||
|
||||
const start_date = ref("");
|
||||
const end_date = ref("");
|
||||
// 计算当前显示的第一天和最后一天
|
||||
const initShowDate = (dateStr = "") => {
|
||||
const currentDate = dateStr ? new Date(dateStr) : new Date();
|
||||
const currentYear = currentDate.getFullYear();
|
||||
const currentMonth = currentDate.getMonth();
|
||||
const lastDay = new Date(currentYear, currentMonth + 1, 0).getDay(); //获取第一天星期
|
||||
const startDay = new Date(currentYear, currentMonth, 1).getDay(); //获取最后一天星期
|
||||
// console.log(new Date(currentYear, currentMonth, 1-startDay).getDate());
|
||||
// console.log(new Date(currentYear, currentMonth + 1, 6-lastDay).getDate());
|
||||
start_date.value = timeFormat(
|
||||
new Date(currentYear, currentMonth, 1 - startDay).getTime()
|
||||
); //获取第一天时间
|
||||
end_date.value = timeFormat(
|
||||
new Date(currentYear, currentMonth + 1, 6 - lastDay).getTime()
|
||||
); //获取最后一天时间
|
||||
if (queryParams.start_time != start_date.value) {
|
||||
queryParams.start_time = start_date.value;
|
||||
queryParams.end_time = end_date.value;
|
||||
loading.value = true;
|
||||
loadTask();
|
||||
}
|
||||
};
|
||||
initShowDate();
|
||||
|
||||
// 过滤的任务列表
|
||||
const taskListFilter = (e: any) => {
|
||||
return taskList.value
|
||||
.filter((item: any) => {
|
||||
const now = new Date(e).getTime() / 1000;
|
||||
const start = new Date(item.start_time).getTime() / 1000;
|
||||
const end = new Date(item.end_time).getTime() / 1000;
|
||||
return now - start >= 0 && now - end <= 0;
|
||||
})
|
||||
.slice(0, 5);
|
||||
};
|
||||
|
||||
// 添加
|
||||
const handleAdd = async () => {
|
||||
popupType.value = "add";
|
||||
showEditTow.value = true;
|
||||
await nextTick();
|
||||
editTowRef.value?.open("add");
|
||||
editTowRef.value?.updatedForm();
|
||||
};
|
||||
// 查询
|
||||
const handleSelect = async () => {
|
||||
popupType.value = "show";
|
||||
showEditTow.value = true;
|
||||
await nextTick();
|
||||
editTowRef.value?.open("show");
|
||||
editTowRef.value?.updatedForm(task.value);
|
||||
};
|
||||
|
||||
// 当前选择类型
|
||||
const nowType = ref(0);
|
||||
const handleTypeClick = (e) => {
|
||||
console.log(e);
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.is-selected {
|
||||
color: #1989fa;
|
||||
}
|
||||
.el-calendar-table .el-calendar-day {
|
||||
min-height: 8.2rem;
|
||||
padding: 0;
|
||||
}
|
||||
.task {
|
||||
font-size: 0.8rem;
|
||||
/* color: #f7ba2a; */
|
||||
color: #1989fa;
|
||||
padding: 0 8px;
|
||||
white-space: nowrap; /* 设置文本不换行 */
|
||||
overflow: hidden; /* 隐藏溢出的部分 */
|
||||
text-overflow: ellipsis; /* 在溢出的部分显示省略号 */
|
||||
&:hover {
|
||||
background-color: rgba($color: #f38200, $alpha: 0.7);
|
||||
border-radius: 4px;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
.the {
|
||||
color: #ff5100;
|
||||
}
|
||||
.tow {
|
||||
color: #f38200;
|
||||
}
|
||||
.fou {
|
||||
color: red;
|
||||
}
|
||||
.btn {
|
||||
height: 30px;
|
||||
width: 150px;
|
||||
border: 1px solid #4a5dff;
|
||||
border-radius: 5px;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
cursor: pointer;
|
||||
div {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
line-height: 30px;
|
||||
}
|
||||
.active {
|
||||
background-color: #4a5dff;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,101 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="公司名称" prop="company_name">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.company_name"
|
||||
clearable
|
||||
placeholder="请输入公司名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="公司类型" prop="company_type">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.company_type"
|
||||
clearable
|
||||
placeholder="请输入公司类型"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @cell-click="handleCurrentChange">
|
||||
<el-table-column label="公司名称" property="company_name" />
|
||||
<el-table-column label="公司类型" property="company_type" />
|
||||
<el-table-column label="区县" property="area" />
|
||||
<el-table-column label="乡镇" property="street" />
|
||||
<el-table-column label="主联系人" property="master_name" />
|
||||
<el-table-column label="联系方式" property="master_phone" />
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="companyLists">
|
||||
import { usePaging } from "@/hooks/usePaging";
|
||||
import { useDictData } from "@/hooks/useDictOptions";
|
||||
import { apiCompanyLists, apiCompanyDelete } from "@/api/company";
|
||||
import { defineEmits } from "vue";
|
||||
|
||||
// 当前类型
|
||||
const props = defineProps({
|
||||
type: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
});
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
level_two: "",
|
||||
level_one: "",
|
||||
company_name: "",
|
||||
organization_code: "",
|
||||
city: "",
|
||||
area: "",
|
||||
street: "",
|
||||
company_type: "",
|
||||
master_name: "",
|
||||
master_position: "",
|
||||
master_phone: "",
|
||||
master_email: "",
|
||||
other_contacts: "",
|
||||
area_manager: "",
|
||||
is_contract: "",
|
||||
account: "",
|
||||
password: "",
|
||||
deposit: "",
|
||||
deposit_time: "",
|
||||
qualification: "",
|
||||
status: "",
|
||||
});
|
||||
|
||||
if (props.type) queryParams.company_type = props.type;
|
||||
|
||||
// 选中数据
|
||||
const emits = defineEmits(["customEvent"]);
|
||||
|
||||
// 选中数据子父传递
|
||||
const handleCurrentChange = (value: any) => {
|
||||
emits("customEvent", value);
|
||||
};
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiCompanyLists,
|
||||
params: queryParams,
|
||||
});
|
||||
|
||||
getLists();
|
||||
</script>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue