zhuangyunsheng 1 år sedan
förälder
incheckning
ae505dcdb6

+ 2 - 2
.env.development

@@ -6,10 +6,10 @@ VUE_APP_TITLE = 城发集团招采管理平台
 
 # 接口地址
 # VUE_APP_API_BASEURL = http://www.qdeasydo.com
-# VUE_APP_API_BASEURL = http://192.168.101.93:8810
+VUE_APP_API_BASEURL = http://192.168.101.93:8810
 
 # VUE_APP_API_BASEURL = http://172.16.1.150:8810
-VUE_APP_API_BASEURL = http://172.16.1.132:8810
+# VUE_APP_API_BASEURL = http://172.16.1.132:8810
 
 # 本地端口
 VUE_APP_PORT = 7800

+ 4 - 0
src/api/model/auth.js

@@ -64,6 +64,10 @@ export default {
 
         getFormId: async function (data = {}) { // 获取审批流 formId
             return await http.post(`${this.url}/getFormId`, data);
+        },
+
+        getUserDeptList: async function (data = {}) {
+            return await http.post(`${this.url}/getUserDeptList`, data);
         }
     }
 }

+ 230 - 217
src/api/model/system.js

@@ -2,221 +2,234 @@ import config from "@/config"
 import http from "@/utils/request"
 
 export default {
-	menu: {
-		url: `${config.API_URL}/zcxt/menus`,
-		name: "获取我的菜单",
-		build: async function (params) {
-			return await http.get(`${this.url}/build`, params);
-		},
-
-		get: async function (params) {
-			return await http.get(this.url, params);
-		},
-
-		add: async function (data = {}) {
-			return await http.post(this.url, data);
-		},
-
-		edit: async function (data = {}) {
-			return await http.put(this.url, data);
-		},
-
-		del: async function (data = {}) {
-			return await http.delete(this.url, data);
-		}
-	},
-
-	role: {
-		url: `${config.API_URL}/zcxt/roles`,
-		name: "角色列表",
-		all: async function () {
-			return await http.get(`${this.url}/all`);
-		},
-
-		get: async function (params) {
-			return await http.get(this.url, params);
-		},
-
-		add: async function (data = {}) {
-			return await http.post(this.url, data);
-		},
-
-		edit: async function (data = {}) {
-			return await http.put(this.url, data);
-		},
-
-		del: async function (data = {}) {
-			return await http.delete(this.url, data);
-		},
-
-		menu: async function (data = {}) {
-			return await http.put(`${this.url}/menu`, data);
-		}
-	},
-
-	job: {
-		url: `${config.API_URL}/zcxt/job`,
-		name: "岗位列表",
-		all: async function (data = {}) {
-			return await http.post(`${this.url}/getList`, data);
-		},
-
-		get: async function (data = {}) {
-			return await http.post(`${this.url}/getPage`, data);
-		},
-
-		add: async function (data = {}) {
-			return await http.post(`${this.url}/save`, data);
-		},
-
-		edit: async function (data = {}) {
-			return await http.post(`${this.url}/update`, data);
-		},
-
-		del: async function (data = {}) {
-			return await http.post(`${this.url}/remove`, data);
-		}
-	},
-
-	dept: {
-		url: `${config.API_URL}/zcxt/dept`,
-		name: "组织列表",
-		get: async function (data = {}) {
-			return await http.post(`${this.url}/getList`, data);
-		},
-
-		add: async function (data = {}) {
-			return await http.post(`${this.url}/save`, data);
-		},
-
-		edit: async function (data = {}) {
-			return await http.post(`${this.url}/update`, data);
-		},
-
-		del: async function (data = {}) {
-			return await http.post(`${this.url}/remove`, data);
-		}
-	},
-
-	user: {
-		url: `${config.API_URL}/zcxt/users`,
-		name: "用户列表",
-		get: async function (params) {
-			return await http.get(this.url, params);
-		},
-
-		add: async function (data = {}) {
-			return await http.post(this.url, data);
-		},
-
-		edit: async function (data = {}) {
-			return await http.put(this.url, data);
-		},
-
-		del: async function (data = {}) {
-			return await http.delete(this.url, data);
-		}
-	},
-
-	dict: {
-		url: `${config.API_URL}/zcxt/dict`,
-		name: "字典列表",
-		all: async function () {
-			return await http.get(`${this.url}/all`);
-		},
-
-		get: async function (params) {
-			return await http.get(this.url, params);
-		},
-
-		add: async function (data = {}) {
-			return await http.post(this.url, data);
-		},
-
-		edit: async function (data = {}) {
-			return await http.put(this.url, data);
-		},
-
-		del: async function (data = {}) {
-			return await http.delete(this.url, data);
-		}
-	},
-
-	dictDetail: {
-		url: `${config.API_URL}/zcxt/dictDetail`,
-		name: "字典列表",
-		get: async function (params) {
-			return await http.get(this.url, params);
-		},
-
-		add: async function (data = {}) {
-			return await http.post(this.url, data);
-		},
-
-		edit: async function (data = {}) {
-			return await http.put(this.url, data);
-		},
-
-		del: async function (id) {
-			return await http.delete(this.url + "/" + id);
-		},
-
-		batchUpdate: async function (data) {
-			return await http.post(`${this.url}/batchUpdate`, data);
-		}
-	},
-
-	approveInfo: {
-		url: `${config.API_URL}/zcxt/approveInfo`,
-		name: "审批流程code",
-
-		get: async function (data = {}) {
-			return await http.post(`${this.url}/getPage`, data);
-		},
-
-		add: async function (data = {}) {
-			return await http.post(`${this.url}/save`, data);
-		},
-
-		edit: async function (data = {}) {
-			return await http.post(`${this.url}/update`, data);
-		},
-
-		del: async function (data = {}) {
-			return await http.post(`${this.url}/remove`, data);
-		}
-	},
-
-	bank: {
-		url: `${config.API_URL}/zcxt/finance`,
-		name: "银行列表",
-		get: async function (data = {}) {
-			return await http.post(`${this.url}/getPage`, data);
-		}
-	},
-
-	project: {
-		url: `${config.API_URL}/zcxt/projectInfo`,
-		name: "项目列表",
-
-		get: async function (data = {}) {
-			return await http.post(`${this.url}/getPage`, data);
-		},
-
-		all: async function (data = {}) {
-			return await http.post(`${this.url}/getList`, data);
-		},
-
-		add: async function (data = {}) {
-			return await http.post(`${this.url}/save`, data);
-		},
-
-		edit: async function (data = {}) {
-			return await http.post(`${this.url}/update`, data);
-		},
-
-		del: async function (data = {}) {
-			return await http.post(`${this.url}/remove`, data);
-		}
-	}
+    menu: {
+        url: `${config.API_URL}/zcxt/menus`,
+        name: "获取我的菜单",
+        build: async function (params) {
+            return await http.get(`${this.url}/build`, params);
+        },
+
+        get: async function (params) {
+            return await http.get(this.url, params);
+        },
+
+        add: async function (data = {}) {
+            return await http.post(this.url, data);
+        },
+
+        edit: async function (data = {}) {
+            return await http.put(this.url, data);
+        },
+
+        del: async function (data = {}) {
+            return await http.delete(this.url, data);
+        }
+    },
+
+    role: {
+        url: `${config.API_URL}/zcxt/roles`,
+        name: "角色列表",
+        all: async function () {
+            return await http.get(`${this.url}/all`);
+        },
+
+        get: async function (params) {
+            return await http.get(this.url, params);
+        },
+
+        add: async function (data = {}) {
+            return await http.post(this.url, data);
+        },
+
+        edit: async function (data = {}) {
+            return await http.put(this.url, data);
+        },
+
+        del: async function (data = {}) {
+            return await http.delete(this.url, data);
+        },
+
+        menu: async function (data = {}) {
+            return await http.put(`${this.url}/menu`, data);
+        }
+    },
+
+    job: {
+        url: `${config.API_URL}/zcxt/job`,
+        name: "岗位列表",
+        all: async function (data = {}) {
+            return await http.post(`${this.url}/getList`, data);
+        },
+
+        get: async function (data = {}) {
+            return await http.post(`${this.url}/getPage`, data);
+        },
+
+        add: async function (data = {}) {
+            return await http.post(`${this.url}/save`, data);
+        },
+
+        edit: async function (data = {}) {
+            return await http.post(`${this.url}/update`, data);
+        },
+
+        del: async function (data = {}) {
+            return await http.post(`${this.url}/remove`, data);
+        }
+    },
+
+    dept: {
+        url: `${config.API_URL}/zcxt/dept`,
+        name: "组织列表",
+        get: async function (data = {}) {
+            return await http.post(`${this.url}/getList`, data);
+        },
+
+        add: async function (data = {}) {
+            return await http.post(`${this.url}/save`, data);
+        },
+
+        edit: async function (data = {}) {
+            return await http.post(`${this.url}/update`, data);
+        },
+
+        del: async function (data = {}) {
+            return await http.post(`${this.url}/remove`, data);
+        }
+    },
+
+    user: {
+        url: `${config.API_URL}/zcxt/users`,
+        name: "用户列表",
+        get: async function (params) {
+            return await http.get(this.url, params);
+        },
+
+        add: async function (data = {}) {
+            return await http.post(this.url, data);
+        },
+
+        edit: async function (data = {}) {
+            return await http.put(this.url, data);
+        },
+
+        del: async function (data = {}) {
+            return await http.delete(this.url, data);
+        }
+    },
+
+    dict: {
+        url: `${config.API_URL}/zcxt/dict`,
+        name: "字典列表",
+        all: async function () {
+            return await http.get(`${this.url}/all`);
+        },
+
+        get: async function (params) {
+            return await http.get(this.url, params);
+        },
+
+        add: async function (data = {}) {
+            return await http.post(this.url, data);
+        },
+
+        edit: async function (data = {}) {
+            return await http.put(this.url, data);
+        },
+
+        del: async function (data = {}) {
+            return await http.delete(this.url, data);
+        }
+    },
+
+    dictDetail: {
+        url: `${config.API_URL}/zcxt/dictDetail`,
+        name: "字典列表",
+        get: async function (params) {
+            return await http.get(this.url, params);
+        },
+
+        add: async function (data = {}) {
+            return await http.post(this.url, data);
+        },
+
+        edit: async function (data = {}) {
+            return await http.put(this.url, data);
+        },
+
+        del: async function (id) {
+            return await http.delete(this.url + "/" + id);
+        },
+
+        batchUpdate: async function (data) {
+            return await http.post(`${this.url}/batchUpdate`, data);
+        }
+    },
+
+    approveInfo: {
+        url: `${config.API_URL}/zcxt/approveInfo`,
+        name: "审批流程code",
+
+        get: async function (data = {}) {
+            return await http.post(`${this.url}/getPage`, data);
+        },
+
+        add: async function (data = {}) {
+            return await http.post(`${this.url}/save`, data);
+        },
+
+        edit: async function (data = {}) {
+            return await http.post(`${this.url}/update`, data);
+        },
+
+        del: async function (data = {}) {
+            return await http.post(`${this.url}/remove`, data);
+        }
+    },
+
+    bank: {
+        url: `${config.API_URL}/zcxt/finance`,
+        name: "银行列表",
+        get: async function (data = {}) {
+            return await http.post(`${this.url}/getPage`, data);
+        }
+    },
+
+    project: {
+        url: `${config.API_URL}/zcxt/projectInfo`,
+        name: "项目列表",
+
+        get: async function (data = {}) {
+            return await http.post(`${this.url}/getPage`, data);
+        },
+
+        all: async function (data = {}) {
+            return await http.post(`${this.url}/getList`, data);
+        },
+
+        add: async function (data = {}) {
+            return await http.post(`${this.url}/save`, data);
+        },
+
+        edit: async function (data = {}) {
+            return await http.post(`${this.url}/update`, data);
+        },
+
+        del: async function (data = {}) {
+            return await http.post(`${this.url}/remove`, data);
+        }
+    },
+
+    userProject: {
+        url: `${config.API_URL}/zcxt/userProjectRef`,
+        name: "项目列表",
+
+        get: async function (data = {}) {
+            return await http.post(`${this.url}/getList`, data);
+        },
+
+        saveBatch: async function (data = {}) {
+            return await http.post(`${this.url}/saveBatch`, data);
+        }
+    }
 }

+ 41 - 9
src/components/scChengTou/approveIframe.vue

@@ -1,21 +1,35 @@
 <template>
 	<sc-dialog class="sc-approve-iframe" v-model="visible" fullscreen :modal="false" @closed="$emit('closed')">
-		<template v-if="host">
+		
+	    <user-dept v-if="dialog" ref="userDept" @closed="hideUserdept"></user-dept>
+
+        <template v-if="!dialog && host">
 			<iframe :src="host + iframeParams" frameborder="0"></iframe>
 		</template>
 	</sc-dialog>
 </template>
 
 <script>
+    import userDept from "./userDept";
+
 	export default {
 		emits: ["success", "closed"],
+        components: {
+            userDept
+        },
 
 		data() {
 			return {
 				visible: false,
+				dialog: false,
 
 				mode: "",
 				host: "",
+				extData: {
+                    dataContext: {
+                        startorOrgName: null
+                    }
+                },
 				params: {
 					variables: "%5B%5D", // []
 					source: "jsf",
@@ -46,7 +60,7 @@
 					if (code == "processStartUp.cancel") this.visible = false; // 取消
 					if (code == "processStartUp.confirm") { // 确定
 						this.visible = false;
-						this.$emit("success", data);
+						this.$emit("success", data, this.extData);
 					}
 				}
 			});
@@ -61,10 +75,17 @@
 			},
 
 			setData() {
-				Promise.all([
+				Promise.all([                    
+                    this.$API.auth.gldMaster.getUserDeptList({ phone: this.$TOOL.data.get("USER_INFO").phone }),
 					this.$API.auth.gldMaster.getToken(),
 					this.$API.auth.gldMaster.getFormId({ busType: this.mode }).catch(() => this.params.formId)
-				]).then(([res, formId]) => {
+				]).then(([dept, res, formId]) => {
+                    if (dept.length == 1) this.extData.dataContext.startorOrgName = dept[0].name;
+                    else {
+                        this.dialog = true;
+                        this.$nextTick(() => this.$refs.userDept.open(dept));
+                    }
+
 					this.host = res.host;
 					
 					this.params.formId = formId;
@@ -73,24 +94,35 @@
 					}
 				}).catch(() => {
 					this.visible = false;
+                    this.extData.dataContext.startorOrgName = null;
 					this.host = "";
 				});
-			}
+			},
+
+            hideUserdept(e) {
+                this.dialog = false;
+                
+                if (e) this.extData.dataContext.startorOrgName = e;
+                else {
+					this.visible = false;
+                    this.extData.dataContext.startorOrgName = null;
+                }
+            }
 		}
 	}
 </script>
 
 <style lang="scss" scoped>
-.sc-approve-iframe :deep(.el-dialog) {
+.sc-approve-iframe:deep(.el-dialog) {
   padding: 0;
   background: transparent;
 
-  .el-dialog__header,
-  .el-dialog__footer {
+  > .el-dialog__header,
+  > .el-dialog__footer {
     display: none;
   }
 
-  .el-dialog__body {
+  > .el-dialog__body {
     height: 100%;
     padding: 0;
 

+ 92 - 0
src/components/scChengTou/approveIframe/userDept.vue

@@ -0,0 +1,92 @@
+<template>
+	<sc-dialog class="user-dept-dialog" v-model="visible" title="选择用户所属组织" :width="500" @closed="$emit('closed')">
+		<el-form ref="dialogForm" :model="form" :rules="rules" label-width="112px">
+			<el-form-item label="用户所属组织:" prop="startorOrgName">
+				 <el-select v-model="form.startorOrgName" placeholder="请选择用户所属组织">
+					<el-option v-for="item in depts" :key="item.id" :label="item.name" :value="item.name"></el-option>
+				</el-select>
+			</el-form-item>
+		</el-form>
+
+		<template #footer>
+			<el-button @click="visible = false">取 消</el-button>
+			<el-button type="primary" :loading="isSaveing" @click="submit">下一步</el-button>
+		</template>
+	</sc-dialog>
+</template>
+
+<script>
+	export default {
+		emits: ["closed"],
+
+		data() {
+			return {
+				visible: false,
+                depts: [],
+
+				form: {
+					startorOrgName: null
+				},
+
+				rules: {
+					startorOrgName: [{ required: true, message: "请选择用户所属组织" }]
+				}
+			}
+		},
+
+		methods: {
+			// 显示
+			open(depts) {
+				this.depts = depts;
+				this.visible = true;
+				return this;
+			},
+
+			// 表单提交方法
+			submit() {
+				this.$refs.dialogForm.validate(valid => {
+					if (valid) {
+                        this.visible = false;
+                        this.$emit("closed", this.form.startorOrgName);
+					} else {
+						return false;
+					}
+				});
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+.user-dept-dialog :deep(.el-dialog) {
+  padding: var(--el-dialog-padding-primary) !important;
+  background: var(--el-dialog-bg-color) !important;
+
+  .el-dialog__header {
+    display: flex !important;
+    padding: calc(var(--el-dialog-padding-primary) / 2) 0 !important;
+
+    &::after {
+      display: block !important;
+    }
+  }
+
+  .el-dialog__footer {
+    display: block !important;
+  }
+
+  .el-dialog__body {
+    padding: calc(var(--el-dialog-padding-primary) + 10px) 0 !important;
+
+    .el-form {
+      padding: 10px 30px;
+    }
+  }
+}
+
+@media (max-width: 992px) {
+  .user-dept-dialog :deep(.el-dialog) .el-dialog__body .el-form {
+    padding: 10px;
+  }
+}
+</style>

+ 1 - 1
src/components/scChengTou/purchase/apply.vue

@@ -29,7 +29,7 @@
 			</el-col>
 			<el-col :lg="lg" :md="12" :xs="24">
 				<el-form-item label="采购计划引入:">
-					<sc-table-select v-model="tableSelect.modelValue" :apiObj="tableSelect.apiObj" apiKey="getSelectPage" :params="tableSelect.params" :table-width="840" :props="tableSelect.props" :disabled="!form.projectId || !form.isInPlan || form.id" clearable placeholder="请选择采购计划" placement="bottom" @change="tableSelectChange">
+					<sc-table-select v-model="tableSelect.modelValue" :apiObj="tableSelect.apiObj" apiKey="getSelectPage" :params="tableSelect.params" :table-width="840" :props="tableSelect.props" applySql :disabled="!form.projectId || !form.isInPlan || form.id" clearable placeholder="请选择采购计划" placement="bottom" @change="tableSelectChange">
 						<template #header="{ queryForm, submit: fetchPlan }">
 							<el-row :gutter="15">
 								<el-col :md="9" :xs="24">

+ 8 - 5
src/components/scTable/index.vue

@@ -98,7 +98,8 @@
 			hideSetting: { type: Boolean, default: false },
 			paginationLayout: { type: String, default: config.paginationLayout },
 			align: { type: String, default: "left" },
-			lazyProps: { type: Object, default: () => {} }
+			lazyProps: { type: Object, default: () => {} },
+            applySql: { type: Boolean, default: false }
 		},
 
 		watch: {
@@ -178,16 +179,18 @@
 			// 获取数据
 			async getData() {
 				try {
-					this.loading = true;
+                    this.loading = true;
 					let reqData = {
-						[config.request[this.pageParams].key]: config.request[this.pageParams].pageStart(this.currentPage),
+                        [config.request[this.pageParams].key]: config.request[this.pageParams].pageStart(this.currentPage),
 						[config.request.pageSize]: this.scPageSize,
 					}
 					if (this.hidePagination) {
-						delete reqData[config.request[this.pageParams].key]
+                        delete reqData[config.request[this.pageParams].key]
 						delete reqData[config.request.pageSize]
 					}
-					Object.assign(reqData, this.tableParams);
+                    if (this.applySql && this.$TOOL.data.get("APPLY_SQL")) reqData["applySql"] = this.$TOOL.data.get("APPLY_SQL");
+					
+                    Object.assign(reqData, this.tableParams);
 					const res = await this.apiObj[this.apiKey](reqData);
 					const response = config.parseData(res);
 					this.tableData = config.lazyData((response.data || []), this.lazyProps);

+ 2 - 0
src/components/scTableSelect/index.vue

@@ -53,6 +53,7 @@
 			hidePagination: { type: Boolean, default: false },
 			pageSizes: { type: Array, default: () => config.pageSizes },
 			paginationLayout: { type: String, default: config.paginationLayout },
+            applySql: { type: Boolean, default: false }
 		},
 		data() {
 			return {
@@ -118,6 +119,7 @@
 						delete reqData[this.defaultProps.page]
 						delete reqData[this.defaultProps.pageSize]
 					}
+                    if (this.applySql && this.$TOOL.data.get("APPLY_SQL")) reqData["applySql"] = this.$TOOL.data.get("APPLY_SQL");
 	
 					Object.assign(reqData, this.params, this.formData)
 					const res = await this.apiObj[this.apiKey](reqData);

+ 1 - 0
src/layout/components/updatePwd.vue

@@ -74,6 +74,7 @@
 								this.$TOOL.cookie.remove("TOKEN");
 								this.$TOOL.data.remove("USER_INFO");
 								this.$TOOL.data.remove("OA_USER_INFO");
+			                    this.$TOOL.data.remove("APPLY_SQL");
 								this.$router.replace({ path: "/login" });
 							}, 1500);
 						}).catch(() => this.isSaveing = false);

+ 1 - 0
src/layout/components/userbar.vue

@@ -44,6 +44,7 @@
 						this.$TOOL.cookie.remove("TOKEN");
 						this.$TOOL.data.remove("USER_INFO");
 						this.$TOOL.data.remove("OA_USER_INFO");
+			            this.$TOOL.data.remove("APPLY_SQL");
 						this.$router.replace({ path: "/login" });
 					}).catch(() => {});
 				}

+ 9 - 0
src/router/index.js

@@ -55,6 +55,14 @@ router.beforeEach(async (to, from, next) => {
                 tool.cookie.set("TOKEN", token);
                 tool.data.set("USER_INFO", user.user);
             } else tool.data.set("OA_USER_INFO", user.user);
+
+            let applySql = null;
+            const { id, projectIds } = user.user;
+            if (id && id != 1) {
+                applySql = `create_id = ${id}`;
+                if (projectIds) applySql += ` or project_id in (${projectIds})`;
+            }
+            applySql && this.$TOOL.data.set("APPLY_SQL", applySql);
         }
 
         next(to.query.path && to.fullPath.replace("/redirect", to.query.path) || (from.fullPath == "/login" && "/" || from.fullPath));
@@ -119,6 +127,7 @@ router.beforeEach(async (to, from, next) => {
                         tool.cookie.remove("TOKEN");
                         tool.data.remove("USER_INFO");
                         tool.data.remove("OA_USER_INFO");
+                        tool.data.remove("APPLY_SQL");
                         location.reload(); // 为了重新实例化vue-router对象 避免bug
                     }).catch(() => { });
                 }

+ 202 - 201
src/utils/request.js

@@ -10,21 +10,21 @@ axios.defaults.timeout = sysConfig.TIMEOUT
 
 // HTTP request 拦截器
 axios.interceptors.request.use(
-	(config) => {
-		let token = tool.cookie.get("TOKEN") || tool.session.get("TOKEN");
-		if (token) {
-			config.headers[sysConfig.TOKEN_NAME] = sysConfig.TOKEN_PREFIX + token
-		}
-		if (!sysConfig.REQUEST_CACHE && config.method == "get") {
-			config.params = config.params || {};
-			config.params["_"] = new Date().getTime();
-		}
-		Object.assign(config.headers, sysConfig.HEADERS)
-		return config;
-	},
-	(error) => {
-		return Promise.reject(error);
-	}
+    (config) => {
+        let token = tool.cookie.get("TOKEN") || tool.session.get("TOKEN");
+        if (token) {
+            config.headers[sysConfig.TOKEN_NAME] = sysConfig.TOKEN_PREFIX + token
+        }
+        if (!sysConfig.REQUEST_CACHE && config.method == "get") {
+            config.params = config.params || {};
+            config.params["_"] = new Date().getTime();
+        }
+        Object.assign(config.headers, sysConfig.HEADERS)
+        return config;
+    },
+    (error) => {
+        return Promise.reject(error);
+    }
 );
 
 //FIX 多个API同时401时疯狂弹窗BUG
@@ -32,199 +32,200 @@ let MessageBox_401_show = false
 
 // HTTP response 拦截器
 axios.interceptors.response.use(
-	(response) => response,
-	(error) => {
-		if (error.response) {
-			if (error.response.status == 404) {
-				ElNotification.error({
-					title: "请求错误",
-					message: "Status:404,正在请求不存在的服务器记录!"
-				});
-			} else if (error.response.status == 500) {
-				ElNotification.error({
-					title: "请求错误",
-					message: error.response.data.message || "Status:500,服务器发生错误!"
-				});
-			} else if (error.response.status == 400) {
-				if (error.response.data == "找不到当前登录的信息") messageBox_401();
-				else {
-					ElNotification.error({
-						title: "请求错误",
-						message: error.response.data || "Code:400,未知错误!"
-					});
-				}
-			} else if (error.response.status == 401) messageBox_401();
-			else {
-				ElNotification.error({
-					title: "请求错误",
-					message: error.response.data.message || `Status:${error.response.status},未知错误!`
-				});
-			}
-
-			return Promise.reject(error.response);
-		} else {
-			ElNotification.error({
-				title: "请求错误",
-				message: "请求服务器无响应!"
-			});
-
-			return Promise.reject(error);
-		}
-	}
+    (response) => response,
+    (error) => {
+        if (error.response) {
+            if (error.response.status == 404) {
+                ElNotification.error({
+                    title: "请求错误",
+                    message: "Status:404,正在请求不存在的服务器记录!"
+                });
+            } else if (error.response.status == 500) {
+                ElNotification.error({
+                    title: "请求错误",
+                    message: error.response.data.message || "Status:500,服务器发生错误!"
+                });
+            } else if (error.response.status == 400) {
+                if (error.response.data == "找不到当前登录的信息") messageBox_401();
+                else {
+                    ElNotification.error({
+                        title: "请求错误",
+                        message: error.response.data || "Code:400,未知错误!"
+                    });
+                }
+            } else if (error.response.status == 401) messageBox_401();
+            else {
+                ElNotification.error({
+                    title: "请求错误",
+                    message: error.response.data.message || `Status:${error.response.status},未知错误!`
+                });
+            }
+
+            return Promise.reject(error.response);
+        } else {
+            ElNotification.error({
+                title: "请求错误",
+                message: "请求服务器无响应!"
+            });
+
+            return Promise.reject(error);
+        }
+    }
 );
 
 var http = {
 
-	/** get 请求
-	 * @param  {string} url 接口地址
-	 * @param  {object} params 请求参数
-	 * @param  {object} config 参数
-	 */
-	get: function (url, params = {}, config = {}) {
-		return new Promise((resolve, reject) => {
-			axios({
-				method: "get",
-				url: url,
-				params: params,
-				...config
-			}).then((response) => {
-				resolve(response.data);
-			}).catch((error) => {
-				reject(error);
-			})
-		})
-	},
-
-	/** post 请求
-	 * @param  {string} url 接口地址
-	 * @param  {object} data 请求参数
-	 * @param  {object} config 参数
-	 * @param  {object} params 路径请求参数
-	 */
-	post: function (url, data = {}, config = {}, params = {}) {
-		return new Promise((resolve, reject) => {
-			axios({
-				method: "post",
-				url: url,
-				data: data,
-				...config,
-				params: params
-			}).then((response) => {
-				if (response.data.code && response.data.code == 30112) messageBox_401();
-				else resolve(response.data);
-			}).catch((error) => {
-				reject(error);
-			})
-		})
-	},
-
-	/** put 请求
-	 * @param  {string} url 接口地址
-	 * @param  {object} data 请求参数
-	 * @param  {object} config 参数
-	 */
-	put: function (url, data = {}, config = {}) {
-		return new Promise((resolve, reject) => {
-			axios({
-				method: "put",
-				url: url,
-				data: data,
-				...config
-			}).then((response) => {
-				resolve(response.data);
-			}).catch((error) => {
-				reject(error);
-			})
-		})
-	},
-
-	/** patch 请求
-	 * @param  {string} url 接口地址
-	 * @param  {object} data 请求参数
-	 * @param  {object} config 参数
-	 */
-	patch: function (url, data = {}, config = {}) {
-		return new Promise((resolve, reject) => {
-			axios({
-				method: "patch",
-				url: url,
-				data: data,
-				...config
-			}).then((response) => {
-				resolve(response.data);
-			}).catch((error) => {
-				reject(error);
-			})
-		})
-	},
-
-	/** delete 请求
-	 * @param  {string} url 接口地址
-	 * @param  {object} data 请求参数
-	 * @param  {object} config 参数
-	 */
-	delete: function (url, data = {}, config = {}) {
-		return new Promise((resolve, reject) => {
-			axios({
-				method: "delete",
-				url: url,
-				data: data,
-				...config
-			}).then((response) => {
-				resolve(response.data);
-			}).catch((error) => {
-				reject(error);
-			})
-		})
-	},
-
-	/** jsonp 请求
-	 * @param  {string} url 接口地址
-	 * @param  {string} name JSONP回调函数名称
-	 */
-	jsonp: function (url, name = "jsonp") {
-		return new Promise((resolve) => {
-			var script = document.createElement("script")
-			var _id = `jsonp${Math.ceil(Math.random() * 1000000)}`
-			script.id = _id
-			script.type = "text/javascript"
-			script.src = url
-			window[name] = (response) => {
-				resolve(response)
-				document.getElementsByTagName("head")[0].removeChild(script)
-				try {
-					delete window[name];
-				} catch (e) {
-					window[name] = undefined;
-				}
-			}
-			document.getElementsByTagName("head")[0].appendChild(script)
-		})
-	}
+    /** get 请求
+     * @param  {string} url 接口地址
+     * @param  {object} params 请求参数
+     * @param  {object} config 参数
+     */
+    get: function (url, params = {}, config = {}) {
+        return new Promise((resolve, reject) => {
+            axios({
+                method: "get",
+                url: url,
+                params: params,
+                ...config
+            }).then((response) => {
+                resolve(response.data);
+            }).catch((error) => {
+                reject(error);
+            })
+        })
+    },
+
+    /** post 请求
+     * @param  {string} url 接口地址
+     * @param  {object} data 请求参数
+     * @param  {object} config 参数
+     * @param  {object} params 路径请求参数
+     */
+    post: function (url, data = {}, config = {}, params = {}) {
+        return new Promise((resolve, reject) => {
+            axios({
+                method: "post",
+                url: url,
+                data: data,
+                ...config,
+                params: params
+            }).then((response) => {
+                if (response.data.code && response.data.code == 30112) messageBox_401();
+                else resolve(response.data);
+            }).catch((error) => {
+                reject(error);
+            })
+        })
+    },
+
+    /** put 请求
+     * @param  {string} url 接口地址
+     * @param  {object} data 请求参数
+     * @param  {object} config 参数
+     */
+    put: function (url, data = {}, config = {}) {
+        return new Promise((resolve, reject) => {
+            axios({
+                method: "put",
+                url: url,
+                data: data,
+                ...config
+            }).then((response) => {
+                resolve(response.data);
+            }).catch((error) => {
+                reject(error);
+            })
+        })
+    },
+
+    /** patch 请求
+     * @param  {string} url 接口地址
+     * @param  {object} data 请求参数
+     * @param  {object} config 参数
+     */
+    patch: function (url, data = {}, config = {}) {
+        return new Promise((resolve, reject) => {
+            axios({
+                method: "patch",
+                url: url,
+                data: data,
+                ...config
+            }).then((response) => {
+                resolve(response.data);
+            }).catch((error) => {
+                reject(error);
+            })
+        })
+    },
+
+    /** delete 请求
+     * @param  {string} url 接口地址
+     * @param  {object} data 请求参数
+     * @param  {object} config 参数
+     */
+    delete: function (url, data = {}, config = {}) {
+        return new Promise((resolve, reject) => {
+            axios({
+                method: "delete",
+                url: url,
+                data: data,
+                ...config
+            }).then((response) => {
+                resolve(response.data);
+            }).catch((error) => {
+                reject(error);
+            })
+        })
+    },
+
+    /** jsonp 请求
+     * @param  {string} url 接口地址
+     * @param  {string} name JSONP回调函数名称
+     */
+    jsonp: function (url, name = "jsonp") {
+        return new Promise((resolve) => {
+            var script = document.createElement("script")
+            var _id = `jsonp${Math.ceil(Math.random() * 1000000)}`
+            script.id = _id
+            script.type = "text/javascript"
+            script.src = url
+            window[name] = (response) => {
+                resolve(response)
+                document.getElementsByTagName("head")[0].removeChild(script)
+                try {
+                    delete window[name];
+                } catch (e) {
+                    window[name] = undefined;
+                }
+            }
+            document.getElementsByTagName("head")[0].appendChild(script)
+        })
+    }
 }
 
 function messageBox_401() {
-	if (!MessageBox_401_show) {
-		MessageBox_401_show = true
-		ElMessageBox.confirm("当前用户已被登出或无权限访问当前资源,请尝试重新登录后再操作。", "无权限访问", {
-			type: "error",
-			showClose: false,
-			closeOnPressEscape: false,
-			closeOnClickModal: false,
-			center: true,
-			confirmButtonText: "重新登录",
-			showCancelButton: false,
-			beforeClose: (action, instance, done) => {
-				MessageBox_401_show = false;
-				done();
-			}
-		}).then(() => {
-			tool.cookie.remove("TOKEN");
-			tool.data.remove("USER_INFO");
-			tool.data.remove("OA_USER_INFO");
-			router.replace({ path: "/login" });
-		}).catch(() => { });
-	}
+    if (!MessageBox_401_show) {
+        MessageBox_401_show = true
+        ElMessageBox.confirm("当前用户已被登出或无权限访问当前资源,请尝试重新登录后再操作。", "无权限访问", {
+            type: "error",
+            showClose: false,
+            closeOnPressEscape: false,
+            closeOnClickModal: false,
+            center: true,
+            confirmButtonText: "重新登录",
+            showCancelButton: false,
+            beforeClose: (action, instance, done) => {
+                MessageBox_401_show = false;
+                done();
+            }
+        }).then(() => {
+            tool.cookie.remove("TOKEN");
+            tool.data.remove("USER_INFO");
+            tool.data.remove("OA_USER_INFO");
+            tool.data.remove("APPLY_SQL");
+            router.replace({ path: "/login" });
+        }).catch(() => { });
+    }
 }
 
 export default http;

+ 9 - 0
src/views/login/index.vue

@@ -62,6 +62,7 @@
 			this.$TOOL.cookie.remove("TOKEN");
 			this.$TOOL.data.remove("USER_INFO");
 			this.$TOOL.data.remove("OA_USER_INFO");
+			this.$TOOL.data.remove("APPLY_SQL");
 			this.$TOOL.data.remove("MENU");
 			this.$TOOL.data.remove("PERMISSIONS")
 			this.$store.commit("clearViewTags");
@@ -94,6 +95,14 @@
 					this.$TOOL.cookie.set("TOKEN", token);
 					this.$TOOL.data.set("USER_INFO", user.user);
 
+                    let applySql = null;
+                    const { id, projectIds } = user.user;
+                    if (id && id != 1) {
+                        applySql = `create_id = ${id}`;
+                        if (projectIds) applySql += ` or project_id in (${projectIds})`;
+                    }
+                    applySql && this.$TOOL.data.set("APPLY_SQL", applySql);
+
 					this.$router.replace({ path: this.$route.redirectedFrom ? this.$route.redirectedFrom.fullPath : "/" });
 					this.$message.success("Login Success 登录成功");
 					this.islogin = false;

+ 4 - 4
src/views/procurement/ledger/index.vue

@@ -97,7 +97,7 @@
             </el-header>
 
             <el-main class="nopadding">
-                <scTable class="scTable" ref="table" row-key="id" :apiObj="api" :params="params" :column="column" tableName="ledgerTable" pageParams="current">
+                <scTable class="scTable" ref="table" row-key="id" :apiObj="api" :params="params" :column="column" tableName="ledgerTable" pageParams="current" applySql>
                     <el-table-column label="序号" type="index" align="center" width="60"></el-table-column>
                     <el-table-column type="expand" width="1">
                         <template #default="scope">
@@ -232,9 +232,9 @@ export default {
         },
 
         async getCensus() {
-            const query = {
-                deptIdIn: this.$TOOL.data.get("USER_INFO").deptIdList
-            }
+            const query = {};
+            if (this.$TOOL.data.get("APPLY_SQL")) query["applySql"] = this.$TOOL.data.get("APPLY_SQL");
+
             const res = await this.$API.procurement.ledger.getTongji(query);
             this.census.contractAmount = res && res.contractAmount || 0;
             this.census.purchaseAmount = res && res.purchaseAmount || 0;

+ 4 - 3
src/views/procurement/plan/detail.vue

@@ -88,7 +88,7 @@
 				});
 			},
 			
-			submit(mode, templateId, userTaskAssigneePropsList) {
+			submit(mode, templateId, userTaskAssigneePropsList, extData) {
                 const data = {};
 				for (const key in this.$refs.scPlan.form) {
 					if (key == "folders") {
@@ -106,6 +106,7 @@
 
 				if (templateId) data["templateId"] = templateId;
 				if (userTaskAssigneePropsList) data["userTaskAssigneePropsList"] = userTaskAssigneePropsList;
+				if (extData) data["extData"] = extData;
 				if (mode == "resubmit") data["processTaskId"] = this.form.processTaskId;
 
 				this.isSaveing = true;
@@ -117,8 +118,8 @@
 				}).catch(() => this.isSaveing = false);
 			},
 
-			approve({ processDefinitionId, userTaskAssigneeDtos }) {
-				this.submit("saveApprove", processDefinitionId || null, userTaskAssigneeDtos || []);
+			approve({ processDefinitionId, userTaskAssigneeDtos }, extData) {
+				this.submit("saveApprove", processDefinitionId || null, userTaskAssigneeDtos || [], extData);
 			}
 		}
 	}

+ 3 - 1
src/views/procurement/plan/index.vue

@@ -86,7 +86,7 @@
             </el-header>
 
             <el-main class="nopadding">
-                <scTable class="scTable" ref="table" row-key="id" :apiObj="api" :params="params" :column="column" tableName="planTable" pageParams="current">
+                <scTable class="scTable" ref="table" row-key="id" :apiObj="api" :params="params" :column="column" tableName="planTable" pageParams="current" applySql>
                     <el-table-column label="序号" type="index" align="center" width="60"></el-table-column>
                     <template #status="scope">
                         {{ formatStatus(scope.row, "label") }}<sc-status-indicator :type="formatStatus(scope.row, 'type')"></sc-status-indicator>
@@ -199,6 +199,8 @@ export default {
                 monthCreateTimeBegin: moment().startOf("month").format("YYYY-MM-DD HH:mm:ss"),
                 monthCreateTimeEnd: moment().endOf("day").format("YYYY-MM-DD HH:mm:ss")
             }
+            if (this.$TOOL.data.get("APPLY_SQL")) query["applySql"] = this.$TOOL.data.get("APPLY_SQL");
+
             const res = await this.$API.procurement.plan.getTongji(query);
             this.census.yearBudgetAmount = res && res.yearBudgetAmount || 0;
             this.census.monthBudgetAmount = res && res.monthBudgetAmount || 0;

+ 4 - 3
src/views/procurement/process/detail.vue

@@ -86,7 +86,7 @@
                 }).catch(() => false);
 			},
 
-			submit(mode, templateId, userTaskAssigneePropsList) {
+			submit(mode, templateId, userTaskAssigneePropsList, extData) {
 				const data = {};
 				for (const key in this.$refs.scApply.form) {
 					if (key == "folders") {
@@ -103,6 +103,7 @@
 				}
 				if (templateId) data["templateId"] = templateId;
 				if (userTaskAssigneePropsList) data["userTaskAssigneePropsList"] = userTaskAssigneePropsList;
+				if (extData) data["extData"] = extData;
 				if (mode == "resubmit") data["processTaskId"] = this.form.processTaskId;
 
 				this.isSaveing = true;
@@ -114,8 +115,8 @@
 				}).catch(() => this.isSaveing = false);
 			},
 
-			approve({ processDefinitionId, userTaskAssigneeDtos }) {
-				this.submit("saveApprove", processDefinitionId || null, userTaskAssigneeDtos || []);
+			approve({ processDefinitionId, userTaskAssigneeDtos }, extData) {
+				this.submit("saveApprove", processDefinitionId || null, userTaskAssigneeDtos || [], extData);
 			}
 		}
 	}

+ 4 - 3
src/views/procurement/process/handle.vue

@@ -100,7 +100,7 @@
 				});
 			},
 
-			submit(mode, templateId, userTaskAssigneePropsList) {
+			submit(mode, templateId, userTaskAssigneePropsList, extData) {
 				const data = {};
 				for (const key in this.$refs.scHandler.form) {
 					if (key == "folders") {
@@ -117,6 +117,7 @@
 				}
 				if (templateId) data["templateId"] = templateId;
 				if (userTaskAssigneePropsList) data["userTaskAssigneePropsList"] = userTaskAssigneePropsList;
+				if (extData) data["extData"] = extData;
 				if (this.mode == "purchase_bid_notice") data["projectId"] = this.$refs.scHandler.apply.projectId || null;
 				if (mode == "resubmit") data["processTaskId"] = this.form.processTaskId;
 				
@@ -129,8 +130,8 @@
 				}).catch(() => this.isSaveing = false);
 			},
 
-			approve({ processDefinitionId, userTaskAssigneeDtos }) {
-				this.submit("saveApprove", processDefinitionId || null, userTaskAssigneeDtos || []);
+			approve({ processDefinitionId, userTaskAssigneeDtos }, extData) {
+				this.submit("saveApprove", processDefinitionId || null, userTaskAssigneeDtos || [], extData);
 			}
 		}
 	}

+ 1 - 1
src/views/procurement/process/index.vue

@@ -89,7 +89,7 @@
             </el-header>
 
             <el-main class="nopadding">
-                <scTable class="scTable" ref="table" row-key="id" :apiObj="api" :params="params" :column="column" tableName="applyTable" pageParams="current" @select="select">
+                <scTable class="scTable" ref="table" row-key="id" :apiObj="api" :params="params" :column="column" tableName="applyTable" pageParams="current" applySql @select="select">
                     <el-table-column type="selection" align="center" width="55" :selectable="selectable"></el-table-column>
                     <el-table-column label="序号" type="index" align="center" width="80"></el-table-column>
                     <template #stepStatus="scope">

+ 1 - 1
src/views/supplier/evaluation/components/add.vue

@@ -2,7 +2,7 @@
 	<sc-dialog v-model="visible" title="考核评价信息" :width="500" @closed="$emit('closed')">
 		<el-form ref="dialogForm" :model="form" :rules="rules" label-width="112px">
 			<el-form-item label="考核评价类型:" prop="evaluateType">
-				 <el-select v-model="form.evaluateType" placeholder="请选择考核评价类型">
+                <el-select v-model="form.evaluateType" placeholder="请选择考核评价类型">
 					<el-option v-for="(label, key) in evaluateTypeDic" :key="key" :label="`${label}考核评价`" :value="key"></el-option>
 				</el-select>
 			</el-form-item>

+ 15 - 3
src/views/system/orgPerson/index.vue

@@ -76,11 +76,13 @@
 						<el-table-column label="序号" type="index" align="center" width="60"></el-table-column>
 						<template #deptName="scope">{{ scope.row.dept && scope.row.dept.name }}</template>
 						<template #jobNames="scope">{{ formatJobs(scope.row.jobs) }}</template>
-						<el-table-column label="操作" fixed="right" align="center" width="120">
+						<el-table-column label="操作" fixed="right" align="center" width="180">
 							<template #default="scope">
 								<el-button text @click="table_edit(scope.row)">编辑</el-button>
 								<el-divider direction="vertical" />
 								<el-button text @click="table_del(scope.row)">删除</el-button>
+								<el-divider direction="vertical" />
+								<el-button text @click="table_project(scope.row)">授权项目</el-button>
 							</template>
 						</el-table-column>
 					</scTable>
@@ -91,17 +93,20 @@
 
     <dept-dialog v-if="dialog.dept" ref="deptDialog" @success="getAsideNode" @closed="dialog.dept = false"></dept-dialog>
     <user-dialog v-if="dialog.user" ref="userDialog" @success="reloadTable" @closed="dialog.user = false"></user-dialog>
+    <user-project v-if="dialog.project" ref="userProject" @success="reloadTable" @closed="dialog.project = false"></user-project>
 </template>
 
 <script>
 	import config from "@/config/treeSelect";
 	import deptDialog from "./dept";
 	import userDialog from "./user";
+	import userProject from "./userPro";
 
 	export default {
 		components: {
 			deptDialog,
-			userDialog
+			userDialog,
+            userProject
 		},
 
 		data() {
@@ -137,7 +142,8 @@
 
 				dialog: {
 					dept: false,
-					user: false
+					user: false,
+                    project: false
 				}
 			}
 		},
@@ -255,6 +261,12 @@
 				this.$nextTick(() => this.$refs.userDialog.open("edit").setData(row));
 			},
 
+            // 配置用户项目
+            table_project(row) {
+				this.dialog.project = true;
+				this.$nextTick(() => this.$refs.userProject.open().setData(row));
+			},
+
 			// 删除成员
 			table_del({ id }) {
 				this.$confirm("确认删除此成员吗?", "提示", {

+ 98 - 0
src/views/system/orgPerson/userPro.vue

@@ -0,0 +1,98 @@
+<template>
+	<sc-dialog v-model="visible" title="选择用户授权项目" :width="500" @closed="$emit('closed')">
+		<el-form ref="dialogForm" :model="form" label-width="112px">
+			<el-row :gutter="15">
+				<el-col :xs="24">
+					<el-form-item label="用户授权项目:">
+                        <el-select v-model="form.projectId" multiple filterable clearable collapse-tags collapse-tags-tooltip placeholder="请选择用户授权项目">
+                            <el-option v-for="item in projects" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
+                        </el-select>
+                    </el-form-item>
+				</el-col>
+			</el-row>
+		</el-form>
+
+		<template #footer>
+			<el-button @click="visible = false">取 消</el-button>
+			<el-button type="primary" :loading="isSaveing" @click="submit">确 定</el-button>
+		</template>
+	</sc-dialog>
+</template>
+
+<script>
+	export default {
+		emits: ["success", "closed"],
+
+		data() {
+			return {
+				visible: false,
+				isSaveing: false,
+                projects: [],
+
+				form: {
+					userId: null,
+					projectId: [],
+					projectIds: ""
+				}
+			}
+		},
+
+        mounted() {
+            this.getProjects();
+        },
+
+		methods: {
+			// 显示
+			open() {
+				this.visible = true;
+				return this;
+			},
+
+            async getProjects() {
+                this.projects = await this.$API.system.project.all({ orderBy: "id_desc", projectStatus: "active" });
+            },
+
+			// 表单注入数据
+			async setData(data) {
+                this.form.userId = data.id;
+                const userPro = await this.$API.system.userProject.get({ userId: data.id });
+                this.form.projectId = userPro.map(p => p.projectId);
+                this.form.projectIds = this.form.projectId.join();
+            },
+
+			// 表单提交方法
+			submit() {
+				this.$refs.dialogForm.validate(valid => {
+					if (valid) {
+                        const data = {
+                            userId: this.form.userId,
+                            projectIds: this.form.projectId.join()
+                        }
+
+						this.isSaveing = true;
+						this.$API.system.userProject.saveBatch(data).then(() => {
+							this.isSaveing = false;
+							this.$message.success("操作成功");
+							this.visible = false;
+							this.$emit("success", this.mode);
+						}).catch(() => this.isSaveing = false);
+					} else {
+						return false;
+					}
+				});
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+.el-form {
+  padding: 10px 30px;
+}
+
+@media (max-width: 992px) {
+  .el-form {
+    padding: 10px;
+  }
+}
+</style>