明树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";
export const useUserStore = defineStore("user", {
state: () => ({
userInfo: null,
authToken: "",
// 判断当前用户是不是投管部角色用户
isTgbu: false,
// 判断是否是项目填报角色
isXmtb: false,
}),
state: () => {
const cached = (() => {
try {
const raw = sessionStorage.getItem("userInfo");
return raw ? JSON.parse(raw) : null;
} catch {
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: {
setUseInfo(data) {
this.userInfo = data;
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("userInfo", JSON.stringify(data));
},
......
......@@ -2,7 +2,8 @@
<div class="add-project-container">
<div class="add-project-content" v-loading="loading">
<routerBack
:show-save="!loading && showSave"
:show-save="!loading && (isBulu || showSave)"
:save-text="isBulu ? '补录' : '保存'"
:loading="loading"
:show-process="!!projectId"
:process-info="processInfo"
......@@ -10,7 +11,7 @@
:jc-process-data="jcProcessData"
:flow-type="flowType"
:current-state="currentFlowState"
@save="() => saveClick('save')"
@save="isBulu ? buluClick() : saveClick('save')"
@process="getProcessData"
></routerBack>
......@@ -68,7 +69,10 @@
>发起决策信息填报</el-button
>
</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
......@@ -293,6 +297,7 @@ let jcFormData = reactive({});
let loading = ref(false);
let isPreview = !!(route.query.isPreview || route.query.isProjectView);
let projectId = route.query.projectId;
const isBulu = !!route.query.isBulu;
const lxType = computed(() => formData.projectLzType?.toString());
const jcType = computed(() => jcFormData.projectLzType?.toString());
......@@ -302,6 +307,7 @@ const isDaibanUser = computed(() =>
// 表单禁用状态:基于流程节点 + 待办人判断
const lxFormDisabled = computed(() => {
if (isBulu) return false;
if (isPreview) return true;
if (!lxType.value) return false;
if (lxType.value === "1") return formData.projectCreator !== userInfo?.id;
......@@ -309,6 +315,7 @@ const lxFormDisabled = computed(() => {
return true;
});
const jcFormDisabled = computed(() => {
if (isBulu) return false;
if (isPreview) return true;
if (["5", "7", "8"].includes(jcType.value)) return !isDaibanUser.value;
return true;
......@@ -316,25 +323,34 @@ const jcFormDisabled = computed(() => {
const showSave = computed(
() =>
!isPreview && (!formData.id || formData.projectCreator === userInfo?.id),
isBulu ||
(!isPreview && (!formData.id || formData.projectCreator === userInfo?.id)),
);
const showSubmitLixiang = computed(
() => lxType.value === "1" && formData.projectCreator === userInfo?.id,
() =>
!isBulu &&
lxType.value === "1" &&
formData.projectCreator === userInfo?.id,
);
const showSubmitJuece = computed(
() => jcType.value === "7" && formData.projectCreator === userInfo?.id,
() =>
!isBulu &&
jcType.value === "7" &&
formData.projectCreator === userInfo?.id,
);
const showFirstAudit = computed(
() => isDaibanUser.value && lxType.value === "3",
() => !isBulu && isDaibanUser.value && lxType.value === "3",
);
const showAuditLixiang = computed(
() => isDaibanUser.value && hasApproveRole && lxType.value === "4",
() =>
!isBulu && isDaibanUser.value && hasApproveRole && lxType.value === "4",
);
const showAuditJuece = computed(
() => isDaibanUser.value && jcType.value === "8",
() => !isBulu && isDaibanUser.value && jcType.value === "8",
);
const showApprove = computed(
() => isDaibanUser.value && hasApproveRole && lxType.value === "2",
() =>
!isBulu && isDaibanUser.value && hasApproveRole && lxType.value === "2",
);
// 下载文件
......@@ -402,6 +418,7 @@ const getObjSums = (obj, objkey) => {
provide("lxShared", {
formData,
isPreview,
isBulu,
formDisabled: lxFormDisabled,
activeCollapse,
...lixiang,
......@@ -417,6 +434,7 @@ provide("jcShared", {
jcFormData,
formData,
isPreview,
isBulu,
formDisabled: jcFormDisabled,
activeCollapse,
...juece,
......@@ -577,6 +595,72 @@ const backClick = () => {
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) => {
if (type === "submit") {
......
<template>
<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-item
title="项目投资总额(全口径)"
......@@ -764,6 +764,7 @@ defineExpose({ validate });
const {
jcFormData,
isPreview,
isBulu,
activeCollapse,
jcTzzeqkjData,
jcCwpjzbData,
......
<template>
<div class="project-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">
<!-- 1. 项目基本信息 -->
<el-collapse-item title="项目基本信息" name="项目基本信息">
......@@ -1546,6 +1546,7 @@ const {
jcFormData,
formData,
isPreview,
isBulu,
activeCollapse,
jcSwlzbData,
jcGdxxData,
......
<template>
<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-item title="投决计划" name="投决计划">
<div class="tab-handle">
......@@ -412,6 +412,7 @@ const activeFinanceTab = ref("项目投资资金流量表");
const {
jcFormData,
isBulu,
tpbgjcsbData,
formData,
isPreview,
......
......@@ -8,7 +8,7 @@
:validate-on-rule-change="false"
:label-width="150"
:inline="false"
:disabled="isPreview"
:disabled="!isBulu && isPreview"
>
<el-collapse v-model="activeCollapse">
<el-collapse-item title="一、项目背景" name="一、项目背景">
......@@ -901,6 +901,7 @@ defineExpose({ validate });
const {
jcFormData,
isPreview,
isBulu,
activeCollapse,
bhqkData,
jxjlData,
......
......@@ -7,7 +7,7 @@
:rules="formRules"
:validate-on-rule-change="false"
:label-width="150"
:disabled="isPreview || Number(formData.projectLzType) >= 5"
:disabled="!isBulu && (isPreview || Number(formData.projectLzType) >= 5)"
>
<el-collapse v-model="activeCollapse">
<el-collapse-item
......@@ -314,6 +314,7 @@ defineExpose({ validate });
const {
formData,
isPreview,
isBulu,
formDisabled,
activeCollapse,
tzzeqkjData,
......
......@@ -7,7 +7,7 @@
:rules="formRules"
:validate-on-rule-change="false"
label-width="180px"
:disabled="isPreview || Number(formData.projectLzType) >= 5"
:disabled="!isBulu && (isPreview || Number(formData.projectLzType) >= 5)"
>
<el-collapse v-model="activeCollapse">
<el-collapse-item title="项目基本信息" name="项目基本信息">
......@@ -702,6 +702,7 @@ defineExpose({ validate });
const {
formData,
isPreview,
isBulu,
formDisabled,
activeCollapse,
swlzbData,
......
......@@ -38,6 +38,14 @@
@click="fillProject(row)"
>发起决策审批</el-button
>
<el-button
link
type="warning"
size="small"
v-if="isAdmin"
@click="buluProject(row)"
>补录</el-button
>
</template>
</common-table>
</div>
......@@ -52,6 +60,7 @@ import { ElMessage, ElMessageBox } from "element-plus";
import CommonTable from "@/components/common/commonTable.vue";
import SearchForm from "@/components/common/SearchForm.vue";
import { useProjectInfoStore } from "@/stores/projectInfo";
import { useUserStore } from "@/stores/user.js";
const { projectLzType } = defineProps({
projectLzType: [String, Number],
......@@ -63,6 +72,7 @@ const handleSearch = (formData) => {
};
const router = useRouter();
const { proxy } = getCurrentInstance();
const isAdmin = useUserStore()?.isAdmin;
let tableData = ref([]);
let tableColumns = ref([
......@@ -100,7 +110,7 @@ let tableColumns = ref([
{
prop: "operations",
label: "操作",
width: 200,
width: 260,
slot: "operations",
fixed: "right",
align: "left",
......@@ -158,6 +168,15 @@ const fillProject = (item) => {
},
});
};
const buluProject = (item) => {
router.push({
name: "addProject",
query: {
projectId: item.id,
isBulu: true,
},
});
};
const approvalProject = (item) => {
item.loading = true;
proxy.$post({
......
......@@ -31,6 +31,14 @@
@click="previewProject(row)"
>{{ row.projectLzType == 8 ? "审批" : "查看" }}</el-button
>
<el-button
link
type="warning"
size="small"
v-if="isAdmin"
@click="buluProject(row)"
>补录</el-button
>
</template>
</common-table>
</div>
......@@ -55,6 +63,7 @@ const router = useRouter();
const { proxy } = getCurrentInstance();
// 是否是审核角色
const userStore = useUserStore();
const isAdmin = userStore?.isAdmin;
const userInfo =
userStore.userInfo ||
(sessionStorage.getItem("userInfo") &&
......@@ -97,7 +106,7 @@ let tableColumns = ref([
{
prop: "operations",
label: "操作",
width: 160,
width: 220,
slot: "operations",
fixed: "right",
align: "center",
......@@ -149,6 +158,15 @@ const previewProject = (item) => {
},
});
};
const buluProject = (item) => {
router.push({
name: "addProject",
query: {
projectId: item.id,
isBulu: true,
},
});
};
</script>
<style scoped lang="less"></style>
......@@ -49,6 +49,14 @@
@click="deleteProject(row)"
>删除</el-button
>
<el-button
link
type="warning"
size="small"
v-if="isAdmin"
@click="buluProject(row)"
>补录</el-button
>
</template>
</common-table>
</div>
......@@ -67,7 +75,9 @@ const handleSearch = (formData) => {
currentPage.value = 1;
getProjectData(formData);
};
const isXmtb = useUserStore()?.isXmtb;
const userStore = useUserStore();
const isXmtb = userStore?.isXmtb;
const isAdmin = userStore?.isAdmin;
const router = useRouter();
const { proxy } = getCurrentInstance();
......@@ -109,7 +119,7 @@ let tableColumns = ref([
{
prop: "operations",
label: "操作",
width: 170,
width: 230,
slot: "operations",
fixed: "right",
align: "left",
......@@ -171,6 +181,15 @@ const previewProject = (item) => {
},
});
};
const buluProject = (item) => {
router.push({
name: "addProject",
query: {
projectId: item.id,
isBulu: true,
},
});
};
const deleteProject = (item) => {
ElMessageBox.confirm("确认删除该项?", "提示", {
confirmButtonText: "确认",
......
......@@ -51,6 +51,14 @@
@click="viewDecision(row)"
>{{ "审批" }}</el-button
>
<el-button
link
type="warning"
size="small"
v-if="isAdmin"
@click="buluProject(row)"
>补录</el-button
>
</template>
</common-table>
</div>
......@@ -74,6 +82,7 @@ const router = useRouter();
const { proxy } = getCurrentInstance();
// 是否是审核角色
const userStore = useUserStore();
const isAdmin = userStore?.isAdmin;
const userInfo =
userStore.userInfo ||
(sessionStorage.getItem("userInfo") &&
......@@ -111,7 +120,7 @@ let tableColumns = ref([
{
prop: "operations",
label: "操作",
width: 160,
width: 220,
slot: "operations",
fixed: "right",
align: "left",
......@@ -171,6 +180,15 @@ const fillDecision = (item) => {
},
});
};
const buluProject = (item) => {
router.push({
name: "addProject",
query: {
projectId: item.id,
isBulu: true,
},
});
};
</script>
<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