更新了待审批列表相关功能
This commit is contained in:
parent
796677d8e6
commit
7a1ec737d1
@ -30,7 +30,12 @@ export function apiFlowDetil(params: any) {
|
||||
}
|
||||
|
||||
// 任务
|
||||
// 任务审批(待审批列表)
|
||||
// 任务审批列表(待审批列表)
|
||||
export function apiApproveList(params: any) {
|
||||
return request.get({ url: "/approve.approve/lists", params });
|
||||
}
|
||||
}
|
||||
|
||||
// 任务审批(待审批列表)
|
||||
export function apiApproveAudit(params: any) {
|
||||
return request.get({ url: "/approve.approve/audit", params });
|
||||
}
|
||||
|
@ -10,6 +10,21 @@
|
||||
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>
|
||||
@ -21,42 +36,67 @@
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column label="ID" prop="id" />
|
||||
<el-table-column label="任务名称" prop="name" show-overflow-tooltip />
|
||||
<el-table-column label="任务描述" prop="remark" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
<el-table-column label="任务金额" prop="remark" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="任务完成时间"
|
||||
prop="remark"
|
||||
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="remark" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
<el-table-column label="片区经理" prop="remark" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="当前审核人"
|
||||
prop="department"
|
||||
label="任务金额"
|
||||
prop="task.money"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column label="审核状态" prop="status" show-overflow-tooltip>
|
||||
<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.status == 2" style="color: #f56c6c">未通过</span>
|
||||
<span v-if="row.status == 1" style="color: #67c23a">已通过</span>
|
||||
<span v-if="row.status == 0" style="color: #e6a23c">未审核</span>
|
||||
<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-perms="['flow/edit']"
|
||||
type="primary"
|
||||
link
|
||||
v-if="row.status == 0"
|
||||
@click="handleEdit(row)"
|
||||
v-if="row.type == 1"
|
||||
@click="handleEdit(row, 'edit')"
|
||||
>
|
||||
审核
|
||||
</el-button>
|
||||
@ -92,7 +132,7 @@ import { useDictData } from "@/hooks/useDictOptions";
|
||||
import { apiApproveList } from "@/api/examined";
|
||||
import { timeFormat } from "@/utils/util";
|
||||
import feedback from "@/utils/feedback";
|
||||
import EditPopup from "./examined_popup.vue";
|
||||
import EditPopup from "./index_list_popup.vue";
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>();
|
||||
// 是否显示编辑框
|
||||
@ -101,18 +141,24 @@ 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: "",
|
||||
check_status: "",
|
||||
});
|
||||
|
||||
const checkStatusList = ref([
|
||||
{
|
||||
id: 1,
|
||||
name: "待审核",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: "已通过",
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: "未通过",
|
||||
},
|
||||
]);
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([]);
|
||||
|
||||
|
@ -23,38 +23,38 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="任务名称" prop="name">
|
||||
<el-input readonly v-model="formData.name" />
|
||||
<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="flow_cate">
|
||||
<el-input readonly v-model="formData.flow_cate" />
|
||||
<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="name">
|
||||
<el-input readonly v-model="formData.name" />
|
||||
<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="remark">
|
||||
<el-form-item label="任务描述" prop="task.content">
|
||||
<el-input
|
||||
readonly
|
||||
v-model="formData.remark"
|
||||
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.id" />
|
||||
<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.flow_cate" />
|
||||
<el-input readonly v-model="formData.area_manager" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -64,7 +64,7 @@
|
||||
<el-form-item label="详情描述" prop="remark">
|
||||
<el-input
|
||||
readonly
|
||||
v-model="formData.remark"
|
||||
:value="formData.task?.extend.other.note"
|
||||
clearable
|
||||
type="textarea"
|
||||
/>
|
||||
@ -74,10 +74,10 @@
|
||||
<el-form-item label="附件" prop="flow_cate">
|
||||
<el-image
|
||||
class="attachment"
|
||||
v-for="(item, index) in 5"
|
||||
v-for="(item, index) in formData.task.extend.other.annex"
|
||||
:key="index"
|
||||
src=""
|
||||
:preview-src-list="[]"
|
||||
:src="item"
|
||||
:preview-src-list="formData.task.extend.other.annex"
|
||||
:initial-index="index"
|
||||
fit="cover"
|
||||
></el-image>
|
||||
@ -85,7 +85,7 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-divider />
|
||||
<el-col :span="24">
|
||||
<!-- <el-col :span="24">
|
||||
<el-form-item label="">
|
||||
<el-timeline>
|
||||
<el-timeline-item
|
||||
@ -99,20 +99,20 @@
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="审核"
|
||||
prop="flow_detail.check_type"
|
||||
prop="check_status"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
>
|
||||
<el-radio-group
|
||||
:disabled="mode == 'details'"
|
||||
v-model="formData.flow_detail.type"
|
||||
v-model="formData.check_status"
|
||||
>
|
||||
<el-radio :label="1">通过</el-radio>
|
||||
<el-radio :label="2">驳回</el-radio>
|
||||
<el-radio :label="2">通过</el-radio>
|
||||
<el-radio :label="3">驳回</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -136,7 +136,7 @@
|
||||
<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 { apiApproveAudit } from "@/api/examined";
|
||||
import { timeFormat } from "@/utils/util";
|
||||
import type { PropType } from "vue";
|
||||
defineProps({
|
||||
@ -176,32 +176,47 @@ const activities = ref([
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: "",
|
||||
name: "",
|
||||
check_type: "",
|
||||
type: "",
|
||||
flow_cate: "",
|
||||
task: {},
|
||||
company_name: "",
|
||||
area_manager: "",
|
||||
check_status: 1,
|
||||
remark: "",
|
||||
flow_detail: {
|
||||
type: 1,
|
||||
step: [{ type: "", user: [{ id: "", name: "" }] }],
|
||||
},
|
||||
copy_to: [{ id: "", name: "" }],
|
||||
});
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({});
|
||||
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);
|
||||
// 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[key] = data[key];
|
||||
}
|
||||
}
|
||||
formData.flow_detail.type = Number(formData.flow_detail.type);
|
||||
};
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
@ -213,9 +228,13 @@ const getDetail = async (row: Record<string, any>) => {
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate();
|
||||
mode.value == "edit"
|
||||
? await apiFlowCreat(formData)
|
||||
: await apiFlowCreat(formData);
|
||||
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");
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user