2023-07-09 18:55:06 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<div class="warning-page">
|
|
|
|
|
|
<LeftMenu
|
|
|
|
|
|
v-model="active"
|
|
|
|
|
|
:tabs="['项目名称', '工程名称']"
|
|
|
|
|
|
:records="records"
|
|
|
|
|
|
@change-page="onCurChange"
|
|
|
|
|
|
@search="onSearchInput"
|
|
|
|
|
|
:pageable="pages"
|
|
|
|
|
|
class="leftMenu"
|
|
|
|
|
|
>
|
|
|
|
|
|
<template #default="{ data }">
|
|
|
|
|
|
<div class="leftProject" @click="onSearch(data)">
|
|
|
|
|
|
<span class="projectName">{{ data.projectName || data.engineeringName }}</span>
|
|
|
|
|
|
<div class="leftMenu_item">
|
|
|
|
|
|
<div class="leftMenu_item flx-justify-between">
|
|
|
|
|
|
<div style="margin-top: 5px" class="flx-justify-between">
|
|
|
|
|
|
<img style="margin-right: 5px" src="@/assets/images/AIwaring/dustMap.png" alt="" />
|
|
|
|
|
|
<span class="middleSize">{{ data.projectAddress || data.address }}</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</LeftMenu>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="table-box">
|
|
|
|
|
|
<div class="table">
|
|
|
|
|
|
<ProTable
|
|
|
|
|
|
ref="proTable"
|
|
|
|
|
|
title="计划完成情况"
|
|
|
|
|
|
:columns="columns"
|
|
|
|
|
|
:requestApi="getTableList"
|
|
|
|
|
|
:dataCallback="dataCallback"
|
|
|
|
|
|
:tool-button="false"
|
|
|
|
|
|
:pagination="true"
|
|
|
|
|
|
background
|
|
|
|
|
|
:isShowSearch="false"
|
|
|
|
|
|
:onReset="true"
|
|
|
|
|
|
>
|
2023-07-31 17:04:53 +08:00
|
|
|
|
<template #formButton="scope">
|
2023-08-01 15:07:16 +08:00
|
|
|
|
<el-button v-auth="'investment_apply_add'" class="btnStyle" @click="handleAddItem">新增</el-button>
|
2023-07-31 17:04:53 +08:00
|
|
|
|
</template>
|
2023-07-09 18:55:06 +08:00
|
|
|
|
<template #investmentPaymentId="scope">
|
2023-07-28 19:27:18 +08:00
|
|
|
|
<span :style="{ color: scope.row.investmentPaymentId ? 'var(--el-menu-text-color)' : '#F80840' }">{{
|
|
|
|
|
|
scope.row.investmentPaymentId ? "已支付" : "未支付"
|
|
|
|
|
|
}}</span>
|
2023-07-09 18:55:06 +08:00
|
|
|
|
</template>
|
2023-07-26 11:28:47 +08:00
|
|
|
|
<template #applyStartTime="{ row }">
|
2023-07-27 14:04:36 +08:00
|
|
|
|
<span v-if="row.applyStartTime">{{ row.applyStartTime + "~" + row.applyEndTime }}</span>
|
2023-07-26 11:28:47 +08:00
|
|
|
|
</template>
|
2023-07-09 18:55:06 +08:00
|
|
|
|
<template #operation="{ row }">
|
|
|
|
|
|
<el-button type="primary" link @click="handleItemDetail(2, row)">
|
|
|
|
|
|
<img src="@/assets/images/tableIcon/updateIcon.png" alt="" class="configureIcon" />
|
|
|
|
|
|
<span>查看</span>
|
|
|
|
|
|
</el-button>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</ProTable>
|
|
|
|
|
|
<!-- 新增 -->
|
|
|
|
|
|
<DialogForm
|
|
|
|
|
|
title="新增"
|
|
|
|
|
|
:formConfig="formConfig"
|
|
|
|
|
|
:formData="formData"
|
|
|
|
|
|
v-model:visible="openVisible"
|
|
|
|
|
|
append-to-body
|
|
|
|
|
|
width="700px"
|
|
|
|
|
|
@confirm="saveItem"
|
|
|
|
|
|
>
|
|
|
|
|
|
</DialogForm>
|
|
|
|
|
|
<!-- 投资支付详情 -->
|
2023-08-01 19:15:43 +08:00
|
|
|
|
<transformInfo1 v-model:detailsDialog="detailsDialog" :relativeId="relativeId" :searchSn="searchSn"></transformInfo1>
|
2023-07-09 18:55:06 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script setup lang="tsx" name="ProjectSupervisionRecord">
|
2023-08-02 19:29:39 +08:00
|
|
|
|
import { ref, onMounted, onBeforeMount, reactive, watch } from "vue";
|
2023-07-31 15:10:52 +08:00
|
|
|
|
import { ElMessage } from "element-plus";
|
2023-07-09 18:55:06 +08:00
|
|
|
|
import { ColumnProps } from "@/components/ProTable/interface";
|
|
|
|
|
|
import ProTable from "@/components/ProTable/index.vue";
|
|
|
|
|
|
import { applyTimeGovermentList, applyTimeAdd, payGovermentEngList, payGovermentProList } from "@/api/modules/huizhou";
|
|
|
|
|
|
import { GlobalStore } from "@/stores";
|
|
|
|
|
|
import DialogForm from "@/components/DialogForm/index.vue";
|
|
|
|
|
|
import transformInfo1 from "./components/transformInfo1.vue";
|
|
|
|
|
|
import LeftMenu from "@/components/LeftMenu/LeftMenu.vue";
|
2023-08-02 19:29:39 +08:00
|
|
|
|
import { useRoute } from "vue-router";
|
|
|
|
|
|
const route = useRoute();
|
2023-07-09 18:55:06 +08:00
|
|
|
|
const relativeId = ref("");
|
|
|
|
|
|
const detailsDialog = ref(false);
|
|
|
|
|
|
const globalStore = GlobalStore();
|
|
|
|
|
|
const openVisible = ref(false);
|
2023-07-31 14:26:28 +08:00
|
|
|
|
const active = ref(1);
|
2023-07-09 18:55:06 +08:00
|
|
|
|
const records = ref([]);
|
|
|
|
|
|
// 弹窗中的配置
|
|
|
|
|
|
const formConfig = {
|
|
|
|
|
|
formItemConfig: [
|
|
|
|
|
|
{
|
|
|
|
|
|
label: "申报名称",
|
|
|
|
|
|
prop: "name",
|
|
|
|
|
|
type: "input"
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
2023-07-26 11:28:47 +08:00
|
|
|
|
label: "申报日期",
|
2023-07-09 18:55:06 +08:00
|
|
|
|
prop: "applyTime",
|
|
|
|
|
|
type: "date",
|
|
|
|
|
|
format: "YYYY-MM-DD",
|
|
|
|
|
|
valueFormat: "YYYY-MM-DD"
|
2023-08-01 19:15:43 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
label: "申报时段开始时间",
|
|
|
|
|
|
prop: "applyStartTime",
|
|
|
|
|
|
type: "date",
|
|
|
|
|
|
format: "YYYY-MM-DD",
|
|
|
|
|
|
valueFormat: "YYYY-MM-DD"
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
label: "申报时段结束时间",
|
|
|
|
|
|
prop: "applyEndTime",
|
|
|
|
|
|
type: "date",
|
|
|
|
|
|
format: "YYYY-MM-DD",
|
|
|
|
|
|
valueFormat: "YYYY-MM-DD"
|
2023-07-09 18:55:06 +08:00
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
rules: {
|
|
|
|
|
|
name: [
|
|
|
|
|
|
{
|
|
|
|
|
|
required: true,
|
|
|
|
|
|
message: "请输入",
|
|
|
|
|
|
trigger: "blur"
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
applyTime: [
|
|
|
|
|
|
{
|
|
|
|
|
|
required: true,
|
|
|
|
|
|
message: "请选择",
|
|
|
|
|
|
trigger: "change"
|
|
|
|
|
|
}
|
2023-08-01 19:15:43 +08:00
|
|
|
|
],
|
|
|
|
|
|
applyStartTime: [
|
|
|
|
|
|
{
|
|
|
|
|
|
required: true,
|
|
|
|
|
|
message: "请选择",
|
|
|
|
|
|
trigger: "change"
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
applyEndTime: [
|
|
|
|
|
|
{
|
|
|
|
|
|
required: true,
|
|
|
|
|
|
message: "请选择",
|
|
|
|
|
|
trigger: "change"
|
|
|
|
|
|
}
|
2023-08-02 19:29:39 +08:00
|
|
|
|
]
|
2023-07-09 18:55:06 +08:00
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
const formData = ref({
|
|
|
|
|
|
name: "",
|
|
|
|
|
|
applyTime: ""
|
|
|
|
|
|
});
|
|
|
|
|
|
const pages = ref({
|
|
|
|
|
|
pageNo: 1,
|
|
|
|
|
|
pageSize: 7,
|
|
|
|
|
|
total: 0
|
|
|
|
|
|
});
|
|
|
|
|
|
// 获取 ProTable 元素,调用其获取刷新数据方法(还能获取到当前查询参数,方便导出携带参数)
|
|
|
|
|
|
const proTable = ref();
|
|
|
|
|
|
// 搜索用的项目sn或者工程sn
|
|
|
|
|
|
const searchSn = ref("");
|
|
|
|
|
|
const searchName = ref("");
|
|
|
|
|
|
|
|
|
|
|
|
const getId = ref<number | undefined>(undefined);
|
|
|
|
|
|
|
|
|
|
|
|
// 表格配置项
|
|
|
|
|
|
const columns: ColumnProps[] = [
|
|
|
|
|
|
{ type: "index", label: "序号", width: 80 },
|
|
|
|
|
|
// 多级 prop
|
|
|
|
|
|
{ prop: "projectName", label: "项目名称" },
|
|
|
|
|
|
{ prop: "name", label: "申报时段名称", search: { el: "input" } },
|
2023-07-26 11:28:47 +08:00
|
|
|
|
{ prop: "applyTime", label: "申报日期" },
|
|
|
|
|
|
{
|
|
|
|
|
|
label: "申报时段",
|
2023-07-27 14:04:36 +08:00
|
|
|
|
prop: "applyStartTime",
|
|
|
|
|
|
width: 260
|
2023-07-26 11:28:47 +08:00
|
|
|
|
},
|
2023-07-09 18:55:06 +08:00
|
|
|
|
{ prop: "investmentPaymentId", label: "支付状态" },
|
|
|
|
|
|
{ prop: "operation", label: "操作", fixed: "right", width: 120 }
|
|
|
|
|
|
];
|
2023-07-31 17:04:53 +08:00
|
|
|
|
const handleAddItem = () => {
|
|
|
|
|
|
formData.value = reactive({
|
|
|
|
|
|
name: "",
|
|
|
|
|
|
applyTime: ""
|
|
|
|
|
|
});
|
|
|
|
|
|
openVisible.value = true;
|
|
|
|
|
|
};
|
2023-07-09 18:55:06 +08:00
|
|
|
|
// 页面的项目名称和工程名称的div点击事件
|
|
|
|
|
|
const onSearch = async (params: any) => {
|
|
|
|
|
|
console.log(params);
|
|
|
|
|
|
if (active.value === 0) {
|
|
|
|
|
|
searchSn.value = params.projectSn;
|
|
|
|
|
|
searchName.value = params.projectName;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
searchSn.value = params.engineeringSn;
|
|
|
|
|
|
searchName.value = params.engineeringName;
|
|
|
|
|
|
}
|
|
|
|
|
|
proTable.value.getTableList();
|
|
|
|
|
|
};
|
|
|
|
|
|
// leftMenu页面的搜索按钮
|
|
|
|
|
|
const onSearchInput = async (params: string) => {
|
|
|
|
|
|
console.log(params);
|
|
|
|
|
|
if (active.value === 0) {
|
|
|
|
|
|
const { result } = await payGovermentProList({ projectName: params, ...pages.value });
|
|
|
|
|
|
records.value = result.records;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
const { result } = await payGovermentEngList({ engineeringName: params, ...pages.value });
|
|
|
|
|
|
records.value = result.records;
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
// leftMenu页面的分页
|
|
|
|
|
|
const onCurChange = async (params: number) => {
|
|
|
|
|
|
if (active.value === 0) {
|
|
|
|
|
|
const { result } = await payGovermentProList({ ...pages.value, pageNo: params });
|
|
|
|
|
|
records.value = result.records;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
const { result } = await payGovermentEngList({ ...pages.value, pageNo: params });
|
|
|
|
|
|
records.value = result.records;
|
|
|
|
|
|
pages.value.total = +result.total;
|
|
|
|
|
|
}
|
|
|
|
|
|
pages.value.total = +res.result.total;
|
|
|
|
|
|
};
|
|
|
|
|
|
const saveItem = async (form: any) => {
|
2023-08-01 19:15:43 +08:00
|
|
|
|
form.engineeringSn = searchSn.value;
|
2023-07-09 18:55:06 +08:00
|
|
|
|
if (form.id) {
|
|
|
|
|
|
const res = await applyTimeAdd(form);
|
|
|
|
|
|
proTable.value.getTableList();
|
|
|
|
|
|
ElMessage.success("编辑成功");
|
|
|
|
|
|
} else {
|
|
|
|
|
|
const res = await applyTimeAdd(form);
|
|
|
|
|
|
ElMessage.success("新增成功");
|
|
|
|
|
|
proTable.value.getTableList();
|
|
|
|
|
|
}
|
|
|
|
|
|
openVisible.value = false;
|
|
|
|
|
|
};
|
|
|
|
|
|
// dataCallback 是对于返回的表格数据做处理,如果你后台返回的数据不是 list && total && pageNum && pageSize 这些字段,那么你可以在这里进行处理成这些字段
|
|
|
|
|
|
// 或者直接去 hooks/useTable.ts 文件中把字段改为你后端对应的就行
|
|
|
|
|
|
const dataCallback = (data: any) => {
|
|
|
|
|
|
// console.log(data);
|
|
|
|
|
|
return {
|
|
|
|
|
|
list: data.records,
|
|
|
|
|
|
total: Number(data.total),
|
|
|
|
|
|
pageNo: Number(data.current),
|
|
|
|
|
|
pageSize: Number(data.size)
|
|
|
|
|
|
};
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const transfrom = (arr: Array<any>) => {
|
|
|
|
|
|
const result = [];
|
|
|
|
|
|
return arr
|
|
|
|
|
|
.map(item => {
|
|
|
|
|
|
if (arr.children && Array.isArray(arr.children)) {
|
|
|
|
|
|
result.concat(transfrom(arr.children));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
|
authorityId: item.name,
|
|
|
|
|
|
roleId: getId.value,
|
|
|
|
|
|
type: item.type
|
|
|
|
|
|
};
|
|
|
|
|
|
})
|
|
|
|
|
|
.concat(result);
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 如果你想在请求之前对当前请求参数做一些操作,可以自定义如下函数:params 为当前所有的请求参数(包括分页),最后返回请求列表接口
|
|
|
|
|
|
// 默认不做操作就直接在 ProTable 组件上绑定 :requestApi="getUserList"
|
|
|
|
|
|
const getTableList = (params: any) => {
|
|
|
|
|
|
let newParams = JSON.parse(JSON.stringify(params));
|
|
|
|
|
|
if (newParams.contractTime) {
|
|
|
|
|
|
newParams.contractTime_begin = newParams.contractTime[0];
|
|
|
|
|
|
newParams.contractTime_end = newParams.contractTime[1];
|
|
|
|
|
|
delete newParams.contractTime;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (active.value === 0) {
|
|
|
|
|
|
newParams.projectSn = searchSn.value;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
newParams.engineeringSn = searchSn.value;
|
|
|
|
|
|
}
|
2023-07-31 17:55:37 +08:00
|
|
|
|
if (!(newParams.projectSn || newParams.engineeringSn)) {
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2023-07-09 18:55:06 +08:00
|
|
|
|
return applyTimeGovermentList(newParams);
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const handleItemDetail = (index: number, row: any) => {
|
|
|
|
|
|
console.log(row);
|
|
|
|
|
|
relativeId.value = row.id;
|
|
|
|
|
|
detailsDialog.value = true;
|
|
|
|
|
|
};
|
|
|
|
|
|
// 获取项目名称分页
|
|
|
|
|
|
const getProPage = async () => {
|
|
|
|
|
|
const { result } = await payGovermentProList(pages.value);
|
|
|
|
|
|
records.value = result.records;
|
|
|
|
|
|
records.value.map(item => {
|
|
|
|
|
|
let showGif = false;
|
|
|
|
|
|
item.showGif = showGif;
|
|
|
|
|
|
});
|
|
|
|
|
|
pages.value.total = Number(result.total);
|
|
|
|
|
|
};
|
|
|
|
|
|
// 获取工程名称分页
|
|
|
|
|
|
const getEngPage = async () => {
|
|
|
|
|
|
const { result } = await payGovermentEngList(pages.value);
|
|
|
|
|
|
records.value = result.records;
|
|
|
|
|
|
records.value.map(item => {
|
|
|
|
|
|
let showGif = false;
|
|
|
|
|
|
item.showGif = showGif;
|
|
|
|
|
|
});
|
|
|
|
|
|
pages.value.total = +result.total;
|
|
|
|
|
|
};
|
|
|
|
|
|
watch(
|
|
|
|
|
|
() => active.value,
|
|
|
|
|
|
async (value: number) => {
|
|
|
|
|
|
pages.value.pageNo = 1;
|
|
|
|
|
|
pages.value.total = 0;
|
|
|
|
|
|
// console.log(value);
|
|
|
|
|
|
|
|
|
|
|
|
if (value === 0) {
|
|
|
|
|
|
await getProPage();
|
|
|
|
|
|
onSearch(records.value[0]);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
await getEngPage();
|
|
|
|
|
|
onSearch(records.value[0]);
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
deep: true
|
|
|
|
|
|
}
|
|
|
|
|
|
);
|
|
|
|
|
|
onMounted(async () => {
|
2023-07-31 14:26:28 +08:00
|
|
|
|
await getEngPage();
|
2023-07-09 18:55:06 +08:00
|
|
|
|
searchSn.value = records.value[0].projectSn;
|
|
|
|
|
|
searchName.value = records.value[0].projectName;
|
2023-08-01 19:15:43 +08:00
|
|
|
|
onSearch(records.value[0]);
|
2023-07-09 18:55:06 +08:00
|
|
|
|
});
|
|
|
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
|
@import "./index.scss";
|
|
|
|
|
|
</style>
|