zhuangyunsheng пре 1 година
родитељ
комит
5bb935dfec

+ 38 - 13
src/components/scChengTou/purchase/apply.vue

@@ -9,9 +9,17 @@
 					</el-select>
 				</el-form-item>
 			</el-col>
+            <el-col :lg="lg" :md="12" :xs="24">
+				<el-form-item label="是否计划内采购:">
+					<el-radio-group v-model="form.isInPlan" @change="radioChange">
+						<el-radio label="是" :value="true"></el-radio>
+						<el-radio label="否" :value="false"></el-radio>
+					</el-radio-group>
+				</el-form-item>
+			</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.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" :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">
@@ -53,7 +61,12 @@
 			</el-col>
 			<el-col :lg="lg" :md="12" :xs="24">
 				<el-form-item label="采购类别:" prop="type">
-					<dict-select ref="dictSelect" v-model="form.type" dic="procurement_category" filterable placeholder="请选择采购类别"></dict-select>
+					<dict-select ref="dictSelect" v-model="form.type" dic="procurement_category" filterable placeholder="请选择采购类别" @change="typeChange"></dict-select>
+				</el-form-item>
+			</el-col>
+            <el-col v-if="isEngineering" :lg="lg" :md="12" :xs="24">
+				<el-form-item label="专项费用类型:" prop="specialFeeType">
+					<dict-select v-model="form.specialFeeType" dic="special_expenses_type" filterable placeholder="请选择专项费用类型"></dict-select>
 				</el-form-item>
 			</el-col>
 			<el-col :lg="lg" :md="12" :xs="24">
@@ -68,7 +81,7 @@
 			</el-col>
 			<el-col :lg="lg" :md="12" :xs="24">
 				<el-form-item label="业务所属公司:" prop="belongDeptId">
-					<tree-select v-model="form.belongDeptId" :apiObj="$API.system.dept" isDept check-strictly placeholder="请选择业务所属公司"></tree-select>
+					<tree-select v-model="form.belongDeptId" :apiObj="$API.system.dept" isDept isAllDept check-strictly placeholder="请选择业务所属公司"></tree-select>
 				</el-form-item>
 			</el-col>
 			<el-col :lg="lg" :md="12" :xs="24">
@@ -76,14 +89,6 @@
 					<el-input v-model="form.createName" disabled></el-input>
 				</el-form-item>
 			</el-col>
-			<el-col :lg="lg" :md="12" :xs="24">
-				<el-form-item label="是否计划内采购:">
-					<el-radio-group v-model="form.isInPlan">
-						<el-radio label="是" :value="true"></el-radio>
-						<el-radio label="否" :value="false"></el-radio>
-					</el-radio-group>
-				</el-form-item>
-			</el-col>
 			<el-col :lg="lg" :md="12" :xs="24">
 				<el-form-item label="资金来源:">
 					<el-input v-model="form.fundSource" clearable placeholder="请输入资金来源"></el-input>
@@ -147,6 +152,7 @@
 					deptId: this.$TOOL.data.get("USER_INFO").deptId,
 					belongDeptId: this.$TOOL.data.get("USER_INFO").deptId,
 					type: null,
+                    specialFeeType: null,
 					purchaseType: null,
 					isInPlan: true,
 					createId: this.$TOOL.data.get("USER_INFO").id,
@@ -168,12 +174,19 @@
 					name: [{ required: true, message: "请输入采购申请名称" }],
 					belongDeptId: [{ required: true, message: "请选择业务所属公司" }],
 					type: [{ required: true, message: "请选择采购类别" }],
+                    specialFeeType: [{ required: true, message: "请选择专项费用类型" }],
 					purchaseType: [{ required: true, message: "请选择招采类型" }],
 					budgetAmount: [{ required: true, message: "请输入预算金额" }]
 				}
 			}
 		},
 
+        computed: {
+			isEngineering() {
+				return this.formatType(this.form.type) == "工程类";
+            }
+        },
+
 		mounted() {
 			this.getProjects();
 			if (this.id) this.setData();
@@ -199,7 +212,7 @@
 			},
 
 			async getProjects() {
-				this.projects = await this.$API.system.project.all({ orderBy: "id_desc", projectStatus: "active", deptId: this.$TOOL.data.get("USER_INFO").deptId });
+				this.projects = await this.$API.system.project.all({ orderBy: "id_desc", projectStatus: "active" });
 			},
 
 			// 表单注入数据
@@ -241,7 +254,19 @@
 			projectChange(e) {
 				this.form.projectNo = this.projects.find(p => p.id == e) && this.projects.find(p => p.id == e).projectNo || null;
 				this.tableSelect.params.projectId = e;
-			}
+			},
+
+            radioChange(e) {
+                if (!e) {
+                    this.tableSelect.modelValue = null;
+                    this.form.planId = null;
+                    this.form.planName = null;
+                }
+            },
+
+            typeChange() {
+                if (!this.isEngineering) this.form.specialFeeType = null;
+            }
 		}
 	}
 </script>

+ 2 - 2
src/components/scChengTou/purchase/handler.vue

@@ -38,7 +38,7 @@
 			</el-col>
 			<el-col :lg="lg" :md="12" :xs="24">
 				<el-form-item label="业务所属公司:">
-					<tree-select v-model="apply.belongDeptId" :apiObj="$API.system.dept" isDept disabled placeholder="自动带出"></tree-select>
+					<tree-select v-model="apply.belongDeptId" :apiObj="$API.system.dept" isDept isAllDept disabled placeholder="自动带出"></tree-select>
 				</el-form-item>
 			</el-col>
 			<el-col :lg="lg" :md="12" :xs="24">
@@ -221,7 +221,7 @@
 			},
 
 			async getProjects() {
-				this.projects = await this.$API.system.project.all({ orderBy: "id_desc", projectStatus: "active", deptId: this.$TOOL.data.get("USER_INFO").deptId });
+				this.projects = await this.$API.system.project.all({ orderBy: "id_desc", projectStatus: "active" });
 			},
 
 			async getSupplier() {

+ 4 - 16
src/components/scChengTou/purchase/plan.vue

@@ -73,7 +73,7 @@
 			</el-col>
 			<el-col :lg="lg" :md="12" :xs="24">
 				<el-form-item label="业务所属公司:" prop="belongDeptId">
-					<tree-select v-model="form.belongDeptId" :apiObj="$API.system.dept" isDept check-strictly placeholder="请选择业务所属公司"></tree-select>
+					<tree-select v-model="form.belongDeptId" :apiObj="$API.system.dept" isDept isAllDept check-strictly placeholder="请选择业务所属公司"></tree-select>
 				</el-form-item>
 			</el-col>
 			<el-col :lg="lg" :md="12" :xs="24">
@@ -81,14 +81,6 @@
 					<dict-select v-model="form.type" dic="procurement_category" filterable placeholder="请选择采购类别"></dict-select>
 				</el-form-item>
 			</el-col>
-			<el-col :lg="lg" :md="12" :xs="24">
-				<el-form-item label="是否计划内采购:">
-					<el-radio-group v-model="form.isInPlan">
-						<el-radio label="是" :value="true"></el-radio>
-						<el-radio label="否" :value="false"></el-radio>
-					</el-radio-group>
-				</el-form-item>
-			</el-col>
 			<el-col :lg="lg" :md="12" :xs="24">
 				<el-form-item label="创建人:">
 					<el-input v-model="form.createName" disabled></el-input>
@@ -168,7 +160,6 @@
 					deptId: this.$TOOL.data.get("USER_INFO").deptId,
 					belongDeptId: this.$TOOL.data.get("USER_INFO").deptId,
 					type: null,
-					isInPlan: true,
 					createId: this.$TOOL.data.get("USER_INFO").id,
 					createName: this.$TOOL.data.get("USER_INFO").nickName,
 					budgetAmount: null,
@@ -203,7 +194,7 @@
 
 			async getProjects() {
 				try {
-					const res = await this.$API.system.project.all({ orderBy: "id_desc", projectStatus: "active", deptId: this.$TOOL.data.get("USER_INFO").deptId });
+					const res = await this.$API.system.project.all({ orderBy: "id_desc", projectStatus: "active" });
 					this.hygh.projects = res || [];
 				} catch (error) {
 					this.hygh.projects = [];
@@ -217,11 +208,8 @@
 					const { plan } = await this.$API.procurement.plan.detail({ id: this.id });
 					this.loading = false;
 					for (const key in this.form) {
-						if (key == "isInPlan") this.form[key] = plan[key];
-						else {
-							this.form[key] = plan[key] || null;
-							if (key == "contractPlanId" && plan[key]) this.hygh.modelValue = { contractPlanId: plan[key], name: plan["contractPlanName"], code: plan["contractPlanCode"] }
-						}
+                        this.form[key] = plan[key] || null;
+                        if (key == "contractPlanId" && plan[key]) this.hygh.modelValue = { contractPlanId: plan[key], name: plan["contractPlanName"], code: plan["contractPlanCode"] }
 					}
 				} catch (error) {
 					this.loading = false;

+ 2 - 1
src/components/scChengTou/treeSelect.vue

@@ -23,6 +23,7 @@
 			apiObj: { type: Object, default: () => {} },
 			apiKey: { type: String, default: "get" },
 			isDept: { type: Boolean, default: false },
+			isAllDept: { type: Boolean, default: false },
 			parentTop: null
 		},
 
@@ -59,7 +60,7 @@
 						const res = await this.apiObj[this.apiKey]();
 						this.treeList = config.parseData(res) || [];
 						this.cacheData = this.treeList.filter(t => t[this.defaultProps.value] == this.modelValue);
-						if (this.isDept) resolve(this.treeList.filter(t => t.deptId == this.$TOOL.data.get("USER_INFO").deptId));
+						if (this.isDept && this.isAllDept) resolve(this.treeList.filter(t => t.deptId == this.$TOOL.data.get("USER_INFO").deptId));
 						else resolve(this.treeList.filter(t => t.pid == 0));
 						this.$emit("finished");
 					} else resolve(this.treeList.filter(t => t.pid == data[this.defaultProps.value]));

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

@@ -41,7 +41,7 @@
                         <template v-if="paramsIsCollapse">
                             <el-col :lg="8" :md="12" :xs="24">
                                 <el-form-item label="业务所属公司:">
-                                    <tree-select v-model="params.belongDeptId" :apiObj="$API.system.dept" isDept check-strictly clearable placeholder="请选择业务所属公司"></tree-select>
+                                    <tree-select v-model="params.belongDeptId" :apiObj="$API.system.dept" isDept isAllDept check-strictly clearable placeholder="请选择业务所属公司"></tree-select>
                                 </el-form-item>
                             </el-col>
                             <el-col :lg="8" :md="12" :xs="24">
@@ -219,7 +219,7 @@ export default {
         },
 
         async getProjects() {
-            this.projects = await this.$API.system.project.all({ orderBy: "id_desc", projectStatus: "active", deptId: this.$TOOL.data.get("USER_INFO").deptId });
+            this.projects = await this.$API.system.project.all({ orderBy: "id_desc", projectStatus: "active" });
         },
         
         async getDicts() {

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

@@ -63,7 +63,6 @@
                         {{ formatStatus(scope.row, "label") }}<sc-status-indicator :type="formatStatus(scope.row, 'type')"></sc-status-indicator>
                     </template>
                     <template #type="scope">{{ formatType(scope.row.type) }}</template>
-                    <template #isInPlan="scope">{{ formatBoolean(scope.row.isInPlan) }}</template>
                     <template #deptName="scope">{{ formatDeptName(scope.row.deptId) }}</template>
                     <template #belongDeptName="scope">{{ formatDeptName(scope.row.belongDeptId) }}</template>
                     <template #projectName="scope">{{ formatProjectName(scope.row.projectId) }}</template>
@@ -153,10 +152,6 @@ export default {
             return this.dicts.find(d => d.value == value) && this.dicts.find(d => d.value == value).label || "";
         },
 
-        formatBoolean(value) {
-            return value && "是" || "否";
-        },
-
         formatDeptName(value) {
             return this.depts && this.depts.find(d => d.deptId == value) && this.depts.find(d => d.deptId == value).name || "";
         },
@@ -166,7 +161,7 @@ export default {
         },
 
         async getProjects() {
-            this.projects = await this.$API.system.project.all({ orderBy: "id_desc", projectStatus: "active", deptId: this.$TOOL.data.get("USER_INFO").deptId });
+            this.projects = await this.$API.system.project.all({ orderBy: "id_desc", projectStatus: "active" });
         },
 
         async getCensus() {

+ 0 - 1
src/views/procurement/plan/main.js

@@ -4,7 +4,6 @@ export const column = [
     { label: "采购名称", prop: "planName", width: "200", align: "center", showOverflowTooltip: true },
     { label: "流水编号", prop: "businessNo", width: "200", align: "center", hide: true },
     { label: "采购类别", prop: "type", width: "120", align: "center" },
-    { label: "计划内采购", prop: "isInPlan", width: "120", align: "center" },
     { label: "合约规划", prop: "contractPlanName", width: "200", align: "center", showOverflowTooltip: true },
     { label: "预算金额 (元)", prop: "budgetAmount", width: "140", align: "center" },
     { label: "计划开始日期", prop: "beginDate", width: "140", align: "center" },

+ 14 - 3
src/views/procurement/process/index.vue

@@ -59,6 +59,7 @@
                     </template>
                     <template #planName="scope">{{ scope.row.plan.planName }}</template>
                     <template #type="scope">{{ formatType(scope.row.type) }}</template>
+                    <template #specialFeeType="scope">{{ formatSpecialType(scope.row.specialFeeType) }}</template>
                     <template #purchaseType="scope">{{ formatPurchaseType(scope.row.purchaseType) }}</template>
                     <template #isInPlan="scope">{{ formatBoolean(scope.row.isInPlan) }}</template>
                     <template #createTime="scope"><span v-time="scope.row.createTime" format="YYYY-MM-DD"></span></template>
@@ -123,6 +124,7 @@ export default {
             api: this.$API.procurement.ledger,
             projects: [],
             purchaseTypes: [],
+            specialTypes: [],
 
             createDate: [],
             params: {
@@ -164,6 +166,7 @@ export default {
     mounted() {
         this.getProjects();
         this.getPurchaseTypes();
+        this.getSpecialTypes();
     },
 
     methods: {
@@ -192,6 +195,10 @@ export default {
             return this.dicts.find(d => d.value == value) && this.dicts.find(d => d.value == value).label || "";
         },
 
+        formatSpecialType(value) {
+            return this.specialTypes.find(p => p.value == value) && this.specialTypes.find(p => p.value == value).label || "";
+        },
+
         formatPurchaseType(value) {
             return this.purchaseTypes.find(p => p.value == value) && this.purchaseTypes.find(p => p.value == value).label || "";
         },
@@ -218,13 +225,18 @@ export default {
         },
 
         async getProjects() {
-            this.projects = await this.$API.system.project.all({ orderBy: "id_desc", projectStatus: "active", deptId: this.$TOOL.data.get("USER_INFO").deptId });
+            this.projects = await this.$API.system.project.all({ orderBy: "id_desc", projectStatus: "active" });
         },
 
         async getPurchaseTypes() {
             const res = await this.$API.system.dictDetail.get({ page: 0, size: 999, dictName: "procurement_type" });
             this.purchaseTypes = res.content;
         },
+
+        async getSpecialTypes() {
+            const res = await this.$API.system.dictDetail.get({ page: 0, size: 999, dictName: "special_expenses_type" });
+            this.specialTypes = res.content;
+        },
         
         // 本地更新数据
         reloadTable(mode = "add") {
@@ -291,8 +303,7 @@ export default {
 
         // oa 情况通知-是否开启
         openChange(status, { id, oaStatus }) {
-            if (status === 1 && oaStatus === undefined) return;
-            if (status === 1 && oaStatus === null) return;
+            if (status === 1 && (oaStatus === undefined || oaStatus === null)) return;
 
             this.loading = true;
             this.$API.auth.oa.updateStatus({ id, status }).then(() => {

+ 1 - 0
src/views/procurement/process/main.js

@@ -4,6 +4,7 @@ export const column = [
     { label: "采购名称", prop: "planName", width: "200", align: "center", hide: true, showOverflowTooltip: true },
     { label: "采购申请名称", prop: "name", width: "200", align: "center", showOverflowTooltip: true },
     { label: "采购类别", prop: "type", width: "120", align: "center" },
+    { label: "专项费用类型", prop: "specialFeeType", width: "140", align: "center", hide: true },
     { label: "招采类型", prop: "purchaseType", width: "140", align: "center", hide: true },
     { label: "计划内采购", prop: "isInPlan", width: "120", align: "center" },
     { label: "预算金额 (元)", prop: "budgetAmount", width: "140", align: "center" },