zhuangyunsheng 1 سال پیش
والد
کامیت
ca7d394f9a

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

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

+ 21 - 0
src/api/model/system.js

@@ -166,6 +166,27 @@ export default {
 		}
 	},
 
+	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: "银行列表",

+ 6 - 1
src/components/scChengTou/approveIframe.vue

@@ -14,6 +14,7 @@
 			return {
 				visible: false,
 
+				mode: "",
 				host: "",
 				params: {
 					variables: "%5B%5D", // []
@@ -53,7 +54,8 @@
 		
 		methods: {
 			// 显示
-			open() {
+			open(mode = "purchase") {
+				this.mode = mode;
 				this.visible = true;
 				return this;
 			},
@@ -61,6 +63,8 @@
 			async setData() {
 				try {
 					const res = await this.$API.auth.gldMaster.getToken();
+					this.params.formId = await this.$API.auth.gldMaster.getFormId({ busType: this.mode });
+					
 					this.host = res.host;
 					for (const key in this.params) {
 						if (res[key]) this.params[key] = res[key];
@@ -68,6 +72,7 @@
 				} catch (error) {
 					this.visible = false;
 					this.host = "";
+					this.params.formId = "";
 				}
 			}
 		}

+ 1 - 4
src/components/scChengTou/purchase/handler.vue

@@ -270,10 +270,7 @@
 
 			supplierChange(e) {
 				this.form.bidCompanyIds = e && e.join() || null;
-				this.form.bidCompanyName = e && e.map(id => {
-					const { supplierName, contactName, contactPhone } = this.suppliers.find(s => s.id == id);
-					return`${supplierName}(${contactName}:${contactPhone})`;
-				}).join() || null;
+				this.form.bidCompanyName = e && e.map(id => this.suppliers.find(s => s.id == id) && this.suppliers.find(s => s.id == id).supplierName || null).join() || null;
 			}
 		}
 	}

+ 1 - 1
src/views/procurement/plan/detail.vue

@@ -78,7 +78,7 @@
 						if (mode == "saveApprove") {
 							if (!this.form.status) {
 								this.popoverShow = true;
-								this.$nextTick(() => this.$refs.approveIframe.open().setData());
+								this.$nextTick(() => this.$refs.approveIframe.open("purchase_plan").setData());
 							} else this.submit("resubmit");
 						} else this.submit(mode);
 					} else {

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

@@ -89,7 +89,7 @@
 						if (mode == "saveApprove") {
 							if (!this.form.status) {
 								this.popoverShow = true;
-								this.$nextTick(() => this.$refs.approveIframe.open().setData());
+								this.$nextTick(() => this.$refs.approveIframe.open(this.mode).setData());
 							} else {
 								console.log("重新发起");
 							}

+ 103 - 0
src/views/system/dict/components/approveInfo.vue

@@ -0,0 +1,103 @@
+<template>
+	<el-header class="aminui-main-container__query-header">
+		<scTitle border>审批流程Code标识</scTitle>
+	</el-header>
+
+	<el-container class="aminui-main-container__table-main">
+		<el-header>
+			<div class="left-panel">
+				<el-button type="primary" @click="table_add">新增业务类型</el-button>
+			</div>
+		</el-header>
+		<el-main class="nopadding">
+			<scTable class="scTable" ref="table" row-key="id" :apiObj="api" :column="column" tableName="approveInfoTable" pageParams="current">
+				<el-table-column label="操作" fixed="right" align="center" width="120">
+					<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>
+					</template>
+				</el-table-column>
+			</scTable>
+		</el-main>
+	</el-container>
+
+	<approve-info-dialog v-if="dialog" ref="approveInfoDialog" @success="reloadTable" @closed="dialog = false"></approve-info-dialog>
+</template>
+
+<script>
+	import approveInfoDialog from "./approveInfoDialog";
+
+	export default {
+		props: {
+			title: { type: String, default: "" },
+		},
+
+		components: {
+			approveInfoDialog
+		},
+
+		data() {
+			return {
+				api: this.$API.system.approveInfo,
+				column: [
+					{ label: "表单名称", prop: "formName", width: "140", align: "center" },
+					{ label: "业务类型", prop: "busType", width: "200", align: "center" },
+					{ label: "表单id", prop: "formId", width: "350", align: "center" },
+					{ label: "表单编号", prop: "formCode", width: "300", align: "center" }
+				],
+				
+				dialog: false
+			}
+		},
+
+		methods: {
+			// 本地更新数据
+			reloadTable(mode = "add") {
+				const page = mode == "edit" ? this.$refs.table.currentPage : 1;
+				this.$refs.table.reload({}, page);
+			},
+
+			// 添加类别类别
+			table_add() {
+				this.dialog = true;
+				this.$nextTick(() => this.$refs.approveInfoDialog.open());
+			},
+
+			// 编辑类别
+			table_edit(row) {
+				this.dialog = true;
+				this.$nextTick(() => this.$refs.approveInfoDialog.open("edit").setData(row));
+			},
+
+			// 删除类别
+			table_del({ id }) {
+				this.$confirm("确认删除当前业务类型吗?", "提示", {
+					type: "warning",
+					confirmButtonText: "删除"
+				}).then(() => {
+					this.$API.system.approveInfo.del({ id }).then(() => {
+						this.$message.success("操作成功");
+						this.reloadTable();
+					}).catch(() => {});
+				}).catch(() => {});
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+.aminui-main-container__query-header {
+  flex-direction: column;
+  margin-bottom: 0;
+
+  .sc-title {
+    margin-bottom: 0;
+    padding-left: 0;
+
+    &::before {
+      display: none;
+    }
+  }
+}
+</style>

+ 87 - 0
src/views/system/dict/components/approveInfoDialog.vue

@@ -0,0 +1,87 @@
+<template>
+	<sc-dialog v-model="visible" :title="titleMap[mode]" :width="500" @closed="$emit('closed')">
+		<el-form ref="dialogForm" :model="form" :rules="rules" label-width="90px">
+			<el-form-item label="业务类型:" prop="busType">
+				<el-input v-model="form.busType" placeholder="请输入业务类型"></el-input>
+			</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: ["success", "closed"],
+
+		data() {
+			return {
+				mode: "add",
+				titleMap: {
+					add: "新增业务类型",
+					edit: "编辑业务类型"
+				},
+				visible: false,
+				isSaveing: false,
+
+				form: {
+					id: null,
+					busType: null,
+					formId: "flow/STD_Dcm_PROCUREMENT_SYSTEM",
+					formCode: "STD_Dcm_PROCUREMENT_SYSTEM",
+					formName: "第三方招采系统"
+				},
+				rules: {
+					busType: [{ required: true, message: "请输入业务类型" }]
+				}
+			}
+		},
+
+		methods: {
+			// 显示
+			open(mode = "add") {
+				this.mode = mode;
+				this.visible = true;
+				return this;
+			},
+
+			// 表单注入数据
+			setData(data) {
+				this.form.id = data.id;
+				this.form.busType = data.busType;
+			},
+			
+			// 表单提交方法
+			submit() {
+				this.$refs.dialogForm.validate(valid => {
+					if (valid) {
+						this.isSaveing = true;
+						this.$API.system.approveInfo[this.mode](this.form).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>

+ 5 - 1
src/views/system/dict/index.vue

@@ -37,6 +37,8 @@
 			<evaluate-rules v-if="table.dictId == 1" :title="table.dictDesc" ref="evaluateRules"></evaluate-rules>
 			<!-- 供应商类型 -->
 			<supplier-type v-else-if="table.dictId == 15" :title="table.dictDesc" ref="supplierType"></supplier-type>
+			<!-- 业务审批流程code ==> formId -->
+			<approve-info v-else-if="table.dictId == 21" :title="table.dictDesc" ref="approveInfo"></approve-info>
 			
 			<template v-else>
 				<el-header class="aminui-main-container__query-header">
@@ -75,13 +77,15 @@
 	import detailDialog from "./detail";
 	import evaluateRules from "./components/rules";
 	import supplierType from "./components/type";
+	import approveInfo from "./components/approveInfo";
 
 	export default {
 		components: {
 			distDialog,
 			detailDialog,
 			evaluateRules,
-			supplierType
+			supplierType,
+			approveInfo
 		},
 
 		data() {