明树Git Lab

Commit 72109642 authored by zhanghan's avatar zhanghan

1

parent 3258f80d
Pipeline #111940 passed with stage
in 18 seconds
import { defineStore } from "pinia"; import { defineStore } from "pinia";
export const useUserStore = defineStore("user", { export const useUserStore = defineStore("user", {
state: () => ({ state: () => {
userInfo: null, const cached = (() => {
authToken: "", try {
// 判断当前用户是不是投管部角色用户 const raw = sessionStorage.getItem("userInfo");
isTgbu: false, return raw ? JSON.parse(raw) : null;
// 判断是否是项目填报角色 } catch {
isXmtb: false, return null;
}), }
})();
return {
userInfo: cached || null,
authToken: cached?.token || sessionStorage.getItem("authToken") || "",
};
},
getters: {
isTgbu: (state) =>
state.userInfo?.departs?.some(
(r) => r.parentIds?.includes("41") || r.id == "41",
) ?? false,
isXmtb: (state) =>
state.userInfo?.roles?.some((r) => r.key?.includes("company_dep")) ??
false,
isAdmin: (state) =>
state.userInfo?.roles?.some((r) => r.key === "admin") ?? false,
},
actions: { actions: {
setUseInfo(data) { setUseInfo(data) {
this.userInfo = data; this.userInfo = data;
this.authToken = data.token; this.authToken = data.token;
this.isTgbu = data.departs.some(
(recoed) => recoed.parentIds?.includes("41") || recoed.id == "41",
);
this.isXmtb = data.roles.some((record) =>
record.key?.includes("company_dep"),
);
console.log("this.isXmtb", this.isXmtb);
console.log("this.isTgbu", this.isTgbu);
sessionStorage.setItem("authToken", data.token); sessionStorage.setItem("authToken", data.token);
sessionStorage.setItem("userInfo", JSON.stringify(data)); sessionStorage.setItem("userInfo", JSON.stringify(data));
}, },
......
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
<div class="add-project-container"> <div class="add-project-container">
<div class="add-project-content" v-loading="loading"> <div class="add-project-content" v-loading="loading">
<routerBack <routerBack
:show-save="!loading && showSave" :show-save="!loading && (isBulu || showSave)"
:save-text="isBulu ? '补录' : '保存'"
:loading="loading" :loading="loading"
:show-process="!!projectId" :show-process="!!projectId"
:process-info="processInfo" :process-info="processInfo"
...@@ -10,7 +11,7 @@ ...@@ -10,7 +11,7 @@
:jc-process-data="jcProcessData" :jc-process-data="jcProcessData"
:flow-type="flowType" :flow-type="flowType"
:current-state="currentFlowState" :current-state="currentFlowState"
@save="() => saveClick('save')" @save="isBulu ? buluClick() : saveClick('save')"
@process="getProcessData" @process="getProcessData"
></routerBack> ></routerBack>
...@@ -68,7 +69,10 @@ ...@@ -68,7 +69,10 @@
>发起决策信息填报</el-button >发起决策信息填报</el-button
> >
</template> </template>
<el-button type="primary" v-if="showSave" @click="saveClick('save')" <el-button type="primary" v-if="isBulu" @click="buluClick"
>补录</el-button
>
<el-button type="primary" v-if="!isBulu && showSave" @click="saveClick('save')"
>保存</el-button >保存</el-button
> >
<el-button <el-button
...@@ -293,6 +297,7 @@ let jcFormData = reactive({}); ...@@ -293,6 +297,7 @@ let jcFormData = reactive({});
let loading = ref(false); let loading = ref(false);
let isPreview = !!(route.query.isPreview || route.query.isProjectView); let isPreview = !!(route.query.isPreview || route.query.isProjectView);
let projectId = route.query.projectId; let projectId = route.query.projectId;
const isBulu = !!route.query.isBulu;
const lxType = computed(() => formData.projectLzType?.toString()); const lxType = computed(() => formData.projectLzType?.toString());
const jcType = computed(() => jcFormData.projectLzType?.toString()); const jcType = computed(() => jcFormData.projectLzType?.toString());
...@@ -302,6 +307,7 @@ const isDaibanUser = computed(() => ...@@ -302,6 +307,7 @@ const isDaibanUser = computed(() =>
// 表单禁用状态:基于流程节点 + 待办人判断 // 表单禁用状态:基于流程节点 + 待办人判断
const lxFormDisabled = computed(() => { const lxFormDisabled = computed(() => {
if (isBulu) return false;
if (isPreview) return true; if (isPreview) return true;
if (!lxType.value) return false; if (!lxType.value) return false;
if (lxType.value === "1") return formData.projectCreator !== userInfo?.id; if (lxType.value === "1") return formData.projectCreator !== userInfo?.id;
...@@ -309,6 +315,7 @@ const lxFormDisabled = computed(() => { ...@@ -309,6 +315,7 @@ const lxFormDisabled = computed(() => {
return true; return true;
}); });
const jcFormDisabled = computed(() => { const jcFormDisabled = computed(() => {
if (isBulu) return false;
if (isPreview) return true; if (isPreview) return true;
if (["5", "7", "8"].includes(jcType.value)) return !isDaibanUser.value; if (["5", "7", "8"].includes(jcType.value)) return !isDaibanUser.value;
return true; return true;
...@@ -316,25 +323,34 @@ const jcFormDisabled = computed(() => { ...@@ -316,25 +323,34 @@ const jcFormDisabled = computed(() => {
const showSave = computed( const showSave = computed(
() => () =>
!isPreview && (!formData.id || formData.projectCreator === userInfo?.id), isBulu ||
(!isPreview && (!formData.id || formData.projectCreator === userInfo?.id)),
); );
const showSubmitLixiang = computed( const showSubmitLixiang = computed(
() => lxType.value === "1" && formData.projectCreator === userInfo?.id, () =>
!isBulu &&
lxType.value === "1" &&
formData.projectCreator === userInfo?.id,
); );
const showSubmitJuece = computed( const showSubmitJuece = computed(
() => jcType.value === "7" && formData.projectCreator === userInfo?.id, () =>
!isBulu &&
jcType.value === "7" &&
formData.projectCreator === userInfo?.id,
); );
const showFirstAudit = computed( const showFirstAudit = computed(
() => isDaibanUser.value && lxType.value === "3", () => !isBulu && isDaibanUser.value && lxType.value === "3",
); );
const showAuditLixiang = computed( const showAuditLixiang = computed(
() => isDaibanUser.value && hasApproveRole && lxType.value === "4", () =>
!isBulu && isDaibanUser.value && hasApproveRole && lxType.value === "4",
); );
const showAuditJuece = computed( const showAuditJuece = computed(
() => isDaibanUser.value && jcType.value === "8", () => !isBulu && isDaibanUser.value && jcType.value === "8",
); );
const showApprove = computed( const showApprove = computed(
() => isDaibanUser.value && hasApproveRole && lxType.value === "2", () =>
!isBulu && isDaibanUser.value && hasApproveRole && lxType.value === "2",
); );
// 下载文件 // 下载文件
...@@ -402,6 +418,7 @@ const getObjSums = (obj, objkey) => { ...@@ -402,6 +418,7 @@ const getObjSums = (obj, objkey) => {
provide("lxShared", { provide("lxShared", {
formData, formData,
isPreview, isPreview,
isBulu,
formDisabled: lxFormDisabled, formDisabled: lxFormDisabled,
activeCollapse, activeCollapse,
...lixiang, ...lixiang,
...@@ -417,6 +434,7 @@ provide("jcShared", { ...@@ -417,6 +434,7 @@ provide("jcShared", {
jcFormData, jcFormData,
formData, formData,
isPreview, isPreview,
isBulu,
formDisabled: jcFormDisabled, formDisabled: jcFormDisabled,
activeCollapse, activeCollapse,
...juece, ...juece,
...@@ -577,6 +595,72 @@ const backClick = () => { ...@@ -577,6 +595,72 @@ const backClick = () => {
router.back(-1); router.back(-1);
}; };
// 补录
const buluClick = () => {
if (!formData.projectLzType || Number(formData.projectLzType) <= 4) {
let gdxxNewArr = JSON.parse(JSON.stringify(lixiang.gdxxData));
gdxxNewArr.splice(-1);
let params = {
...formData,
projectJsgms: lixiang.swlzbData,
projectGdxxs: gdxxNewArr,
lxzl: lixiang.zcclData.value,
projectXmtzzes: lixiang.tzzeqkjData,
projectCwpjzbs: lixiang.cwpjzbData,
projectBjtjs: lixiang.hxbjtjData,
lxpfwj: lixiang.lxpfwjData.value,
projectSpyjs: lixiang.spyjTableData,
xgshcl: lixiang.shclData.value,
};
proxy.$post({
url: "/api/project/updateSnap",
data: { lixiang: params },
callback: () => ElMessage.success("补录成功"),
});
} else {
let gdxxNewArr = JSON.parse(JSON.stringify(juece.jcGdxxData));
gdxxNewArr.splice(-1);
let params = {
...jcFormData,
projectJsgms: juece.jcSwlzbData,
projectZqrzs: juece.dbzqData,
projectFxgls: juece.fxglData,
projectGdxxs: gdxxNewArr,
projectLcbjds: juece.lcbjdData,
lcbjhspb: juece.lcbspData.value,
kycl: juece.kyclData.value,
jjzbcbcscl: juece.jjzbcsData.value,
qtxgzccl: juece.tpzcclData.value,
bcxgzccl: juece.tpbczcclData.value,
shya: juece.shyaData.value,
projectXmtzzes: juece.jcTzzeqkjData,
projectCwpjzbs: juece.jcCwpjzbData,
projectBjtjs: juece.jcHxbjtjData,
projectJczts: juece.jcztshqkData,
projectTzzts: juece.tzztshqkData,
projectSpyjs: juece.jcspyjData,
bhqk: juece.bhqkData,
jxjlList: juece.jxjlData,
jlrList: juece.jlrData,
};
let tjjhArr = finance.getTjjhData();
if (tjjhArr.length) params.tjjh = tjjhArr;
let xmtzzjllArr = finance.getXmtzzjllData();
if (xmtzzjllArr.length) params.xmtzzjll = xmtzzjllArr;
let xmzbjxjllArr = finance.getXmzbjxjllData();
if (xmzbjxjllArr.length) params.xmzbjxjll = xmzbjxjllArr;
let njfxjllArr = finance.getNjfxjllData();
if (njfxjllArr.length) params.njfxjll = njfxjllArr;
let lrbArr = finance.getLrbData();
if (lrbArr.length) params.lrb = lrbArr;
proxy.$post({
url: "/api/project/updateSnap",
data: { juece: params },
callback: () => ElMessage.success("补录成功"),
});
}
};
// 保存数据 // 保存数据
const saveClick = async (type) => { const saveClick = async (type) => {
if (type === "submit") { if (type === "submit") {
......
<template> <template>
<div class="tab-content"> <div class="tab-content">
<div class="tab-content"> <div class="tab-content">
<el-form ref="jcApprovalFormRef" :model="jcFormData" :rules="formRules" :validate-on-rule-change="false" :label-width="150" :disabled="isPreview"> <el-form ref="jcApprovalFormRef" :model="jcFormData" :rules="formRules" :validate-on-rule-change="false" :label-width="150" :disabled="!isBulu && isPreview">
<el-collapse v-model="activeCollapse"> <el-collapse v-model="activeCollapse">
<el-collapse-item <el-collapse-item
title="项目投资总额(全口径)" title="项目投资总额(全口径)"
...@@ -764,6 +764,7 @@ defineExpose({ validate }); ...@@ -764,6 +764,7 @@ defineExpose({ validate });
const { const {
jcFormData, jcFormData,
isPreview, isPreview,
isBulu,
activeCollapse, activeCollapse,
jcTzzeqkjData, jcTzzeqkjData,
jcCwpjzbData, jcCwpjzbData,
......
<template> <template>
<div class="project-tab-content"> <div class="project-tab-content">
<div class="tab-content"> <div class="tab-content">
<el-form ref="jcBasicFormRef" :model="jcFormData" :rules="formRules" :validate-on-rule-change="false" label-width="200px" :disabled="isPreview"> <el-form ref="jcBasicFormRef" :model="jcFormData" :rules="formRules" :validate-on-rule-change="false" label-width="200px" :disabled="!isBulu && isPreview">
<el-collapse v-model="activeCollapse"> <el-collapse v-model="activeCollapse">
<!-- 1. 项目基本信息 --> <!-- 1. 项目基本信息 -->
<el-collapse-item title="项目基本信息" name="项目基本信息"> <el-collapse-item title="项目基本信息" name="项目基本信息">
...@@ -1546,6 +1546,7 @@ const { ...@@ -1546,6 +1546,7 @@ const {
jcFormData, jcFormData,
formData, formData,
isPreview, isPreview,
isBulu,
activeCollapse, activeCollapse,
jcSwlzbData, jcSwlzbData,
jcGdxxData, jcGdxxData,
......
<template> <template>
<div class="tab-content"> <div class="tab-content">
<div class="tab-content"> <div class="tab-content">
<el-form :model="jcFormData" :label-width="150" :disabled="isPreview"> <el-form :model="jcFormData" :label-width="150" :disabled="!isBulu && isPreview">
<el-collapse v-model="activeCollapse"> <el-collapse v-model="activeCollapse">
<el-collapse-item title="投决计划" name="投决计划"> <el-collapse-item title="投决计划" name="投决计划">
<div class="tab-handle"> <div class="tab-handle">
...@@ -412,6 +412,7 @@ const activeFinanceTab = ref("项目投资资金流量表"); ...@@ -412,6 +412,7 @@ const activeFinanceTab = ref("项目投资资金流量表");
const { const {
jcFormData, jcFormData,
isBulu,
tpbgjcsbData, tpbgjcsbData,
formData, formData,
isPreview, isPreview,
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
:validate-on-rule-change="false" :validate-on-rule-change="false"
:label-width="150" :label-width="150"
:inline="false" :inline="false"
:disabled="isPreview" :disabled="!isBulu && isPreview"
> >
<el-collapse v-model="activeCollapse"> <el-collapse v-model="activeCollapse">
<el-collapse-item title="一、项目背景" name="一、项目背景"> <el-collapse-item title="一、项目背景" name="一、项目背景">
...@@ -901,6 +901,7 @@ defineExpose({ validate }); ...@@ -901,6 +901,7 @@ defineExpose({ validate });
const { const {
jcFormData, jcFormData,
isPreview, isPreview,
isBulu,
activeCollapse, activeCollapse,
bhqkData, bhqkData,
jxjlData, jxjlData,
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
:rules="formRules" :rules="formRules"
:validate-on-rule-change="false" :validate-on-rule-change="false"
:label-width="150" :label-width="150"
:disabled="isPreview || Number(formData.projectLzType) >= 5" :disabled="!isBulu && (isPreview || Number(formData.projectLzType) >= 5)"
> >
<el-collapse v-model="activeCollapse"> <el-collapse v-model="activeCollapse">
<el-collapse-item <el-collapse-item
...@@ -314,6 +314,7 @@ defineExpose({ validate }); ...@@ -314,6 +314,7 @@ defineExpose({ validate });
const { const {
formData, formData,
isPreview, isPreview,
isBulu,
formDisabled, formDisabled,
activeCollapse, activeCollapse,
tzzeqkjData, tzzeqkjData,
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
:rules="formRules" :rules="formRules"
:validate-on-rule-change="false" :validate-on-rule-change="false"
label-width="180px" label-width="180px"
:disabled="isPreview || Number(formData.projectLzType) >= 5" :disabled="!isBulu && (isPreview || Number(formData.projectLzType) >= 5)"
> >
<el-collapse v-model="activeCollapse"> <el-collapse v-model="activeCollapse">
<el-collapse-item title="项目基本信息" name="项目基本信息"> <el-collapse-item title="项目基本信息" name="项目基本信息">
...@@ -702,6 +702,7 @@ defineExpose({ validate }); ...@@ -702,6 +702,7 @@ defineExpose({ validate });
const { const {
formData, formData,
isPreview, isPreview,
isBulu,
formDisabled, formDisabled,
activeCollapse, activeCollapse,
swlzbData, swlzbData,
......
...@@ -38,6 +38,14 @@ ...@@ -38,6 +38,14 @@
@click="fillProject(row)" @click="fillProject(row)"
>发起决策审批</el-button >发起决策审批</el-button
> >
<el-button
link
type="warning"
size="small"
v-if="isAdmin"
@click="buluProject(row)"
>补录</el-button
>
</template> </template>
</common-table> </common-table>
</div> </div>
...@@ -52,6 +60,7 @@ import { ElMessage, ElMessageBox } from "element-plus"; ...@@ -52,6 +60,7 @@ import { ElMessage, ElMessageBox } from "element-plus";
import CommonTable from "@/components/common/commonTable.vue"; import CommonTable from "@/components/common/commonTable.vue";
import SearchForm from "@/components/common/SearchForm.vue"; import SearchForm from "@/components/common/SearchForm.vue";
import { useProjectInfoStore } from "@/stores/projectInfo"; import { useProjectInfoStore } from "@/stores/projectInfo";
import { useUserStore } from "@/stores/user.js";
const { projectLzType } = defineProps({ const { projectLzType } = defineProps({
projectLzType: [String, Number], projectLzType: [String, Number],
...@@ -63,6 +72,7 @@ const handleSearch = (formData) => { ...@@ -63,6 +72,7 @@ const handleSearch = (formData) => {
}; };
const router = useRouter(); const router = useRouter();
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const isAdmin = useUserStore()?.isAdmin;
let tableData = ref([]); let tableData = ref([]);
let tableColumns = ref([ let tableColumns = ref([
...@@ -100,7 +110,7 @@ let tableColumns = ref([ ...@@ -100,7 +110,7 @@ let tableColumns = ref([
{ {
prop: "operations", prop: "operations",
label: "操作", label: "操作",
width: 200, width: 260,
slot: "operations", slot: "operations",
fixed: "right", fixed: "right",
align: "left", align: "left",
...@@ -158,6 +168,15 @@ const fillProject = (item) => { ...@@ -158,6 +168,15 @@ const fillProject = (item) => {
}, },
}); });
}; };
const buluProject = (item) => {
router.push({
name: "addProject",
query: {
projectId: item.id,
isBulu: true,
},
});
};
const approvalProject = (item) => { const approvalProject = (item) => {
item.loading = true; item.loading = true;
proxy.$post({ proxy.$post({
......
...@@ -31,6 +31,14 @@ ...@@ -31,6 +31,14 @@
@click="previewProject(row)" @click="previewProject(row)"
>{{ row.projectLzType == 8 ? "审批" : "查看" }}</el-button >{{ row.projectLzType == 8 ? "审批" : "查看" }}</el-button
> >
<el-button
link
type="warning"
size="small"
v-if="isAdmin"
@click="buluProject(row)"
>补录</el-button
>
</template> </template>
</common-table> </common-table>
</div> </div>
...@@ -55,6 +63,7 @@ const router = useRouter(); ...@@ -55,6 +63,7 @@ const router = useRouter();
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
// 是否是审核角色 // 是否是审核角色
const userStore = useUserStore(); const userStore = useUserStore();
const isAdmin = userStore?.isAdmin;
const userInfo = const userInfo =
userStore.userInfo || userStore.userInfo ||
(sessionStorage.getItem("userInfo") && (sessionStorage.getItem("userInfo") &&
...@@ -97,7 +106,7 @@ let tableColumns = ref([ ...@@ -97,7 +106,7 @@ let tableColumns = ref([
{ {
prop: "operations", prop: "operations",
label: "操作", label: "操作",
width: 160, width: 220,
slot: "operations", slot: "operations",
fixed: "right", fixed: "right",
align: "center", align: "center",
...@@ -149,6 +158,15 @@ const previewProject = (item) => { ...@@ -149,6 +158,15 @@ const previewProject = (item) => {
}, },
}); });
}; };
const buluProject = (item) => {
router.push({
name: "addProject",
query: {
projectId: item.id,
isBulu: true,
},
});
};
</script> </script>
<style scoped lang="less"></style> <style scoped lang="less"></style>
...@@ -49,6 +49,14 @@ ...@@ -49,6 +49,14 @@
@click="deleteProject(row)" @click="deleteProject(row)"
>删除</el-button >删除</el-button
> >
<el-button
link
type="warning"
size="small"
v-if="isAdmin"
@click="buluProject(row)"
>补录</el-button
>
</template> </template>
</common-table> </common-table>
</div> </div>
...@@ -67,7 +75,9 @@ const handleSearch = (formData) => { ...@@ -67,7 +75,9 @@ const handleSearch = (formData) => {
currentPage.value = 1; currentPage.value = 1;
getProjectData(formData); getProjectData(formData);
}; };
const isXmtb = useUserStore()?.isXmtb; const userStore = useUserStore();
const isXmtb = userStore?.isXmtb;
const isAdmin = userStore?.isAdmin;
const router = useRouter(); const router = useRouter();
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
...@@ -109,7 +119,7 @@ let tableColumns = ref([ ...@@ -109,7 +119,7 @@ let tableColumns = ref([
{ {
prop: "operations", prop: "operations",
label: "操作", label: "操作",
width: 170, width: 230,
slot: "operations", slot: "operations",
fixed: "right", fixed: "right",
align: "left", align: "left",
...@@ -171,6 +181,15 @@ const previewProject = (item) => { ...@@ -171,6 +181,15 @@ const previewProject = (item) => {
}, },
}); });
}; };
const buluProject = (item) => {
router.push({
name: "addProject",
query: {
projectId: item.id,
isBulu: true,
},
});
};
const deleteProject = (item) => { const deleteProject = (item) => {
ElMessageBox.confirm("确认删除该项?", "提示", { ElMessageBox.confirm("确认删除该项?", "提示", {
confirmButtonText: "确认", confirmButtonText: "确认",
......
...@@ -51,6 +51,14 @@ ...@@ -51,6 +51,14 @@
@click="viewDecision(row)" @click="viewDecision(row)"
>{{ "审批" }}</el-button >{{ "审批" }}</el-button
> >
<el-button
link
type="warning"
size="small"
v-if="isAdmin"
@click="buluProject(row)"
>补录</el-button
>
</template> </template>
</common-table> </common-table>
</div> </div>
...@@ -74,6 +82,7 @@ const router = useRouter(); ...@@ -74,6 +82,7 @@ const router = useRouter();
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
// 是否是审核角色 // 是否是审核角色
const userStore = useUserStore(); const userStore = useUserStore();
const isAdmin = userStore?.isAdmin;
const userInfo = const userInfo =
userStore.userInfo || userStore.userInfo ||
(sessionStorage.getItem("userInfo") && (sessionStorage.getItem("userInfo") &&
...@@ -111,7 +120,7 @@ let tableColumns = ref([ ...@@ -111,7 +120,7 @@ let tableColumns = ref([
{ {
prop: "operations", prop: "operations",
label: "操作", label: "操作",
width: 160, width: 220,
slot: "operations", slot: "operations",
fixed: "right", fixed: "right",
align: "left", align: "left",
...@@ -171,6 +180,15 @@ const fillDecision = (item) => { ...@@ -171,6 +180,15 @@ const fillDecision = (item) => {
}, },
}); });
}; };
const buluProject = (item) => {
router.push({
name: "addProject",
query: {
projectId: item.id,
isBulu: true,
},
});
};
</script> </script>
<style scoped lang="less"></style> <style scoped lang="less"></style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment