Jeremy 3 years ago
parent
commit
6af8e61cc4

+ 3 - 0
VinnoManagementSystem/src/locales/lang/en.js

@@ -8,6 +8,8 @@ export default {
 	operate: "Operate",
 	pleaseChoose: "Select",
 	pleaseInput: "Please input keywords",
+	audited: "Audited",
+	rejected: "Rejected",
 	login: {
 		slogan: 'High performance / delicate / grace',
 		describe: 'Vue3 + element plus based front-end solutions in the background.',
@@ -108,6 +110,7 @@ export default {
 		ConfirmDelete: "Are You Sure To Del This Organization ?",
 		ConfirmDelete2: "There has users or devices in the current organization. Are you sure to delete this Organization?",
 		FrontOrganization: "Front Organization",
+		ApproveOrgMsg: "Are You Sure To Approve This Organization?",
 	},
 	menu: {		
 		home: "Home Page",

+ 3 - 0
VinnoManagementSystem/src/locales/lang/zh-cn.js

@@ -8,6 +8,8 @@ export default {
 	operate: "操作",
 	pleaseChoose: "请选择",
 	pleaseInput: "请输入关键字",
+	audited: "审核通过",
+	rejected: "审核不通过",
 	login: {
 		slogan: '高性能 / 精致 / 优雅',
 		describe: '基于Vue3 + Element-Plus 的中后台前端解决方案。',
@@ -108,6 +110,7 @@ export default {
 		ConfirmDelete: "确定删除该组织吗?",
 		ConfirmDelete2: "当前机构存在绑定用户或设备,确定删除吗?",
 		FrontOrganization: "上级机构",
+		ApproveOrgMsg: "该机构是否审核通过?",
 	},
 	menu: {
 		home: "首页",

+ 59 - 18
VinnoManagementSystem/src/views/organizationManage/organizationList.vue

@@ -166,18 +166,27 @@
                 >
               </template>
             </el-popconfirm>
-            <!-- 更多 -->            
-						<el-divider direction="vertical"></el-divider>
-						<el-dropdown>
-							<el-button  type="text" size="small">更多<el-icon class="el-icon--right"><el-icon-arrow-down /></el-icon></el-button>
-							<template #dropdown>
-								<el-dropdown-menu>
-									<el-dropdown-item @click="table_audit(scope.row, scope.$index)" :disabled="scope.row.State != 0">{{ $t("audit") }}</el-dropdown-item>
-									<!-- <el-dropdown-item divided>删除</el-dropdown-item> -->
-								</el-dropdown-menu>
-							</template>
-						</el-dropdown>
-            
+            <!-- 审核 -->
+            <el-button
+              type="text"
+              size="small"
+              :disabled="scope.row.State != 0"
+              @click="table_audit(scope.row, scope.$index)"
+              >{{ $t("audit") }}</el-button
+            >
+            <!-- 更多 -->
+            <el-divider direction="vertical"></el-divider>
+            <el-dropdown>
+              <el-button type="text" size="small"
+                >更多<el-icon class="el-icon--right"
+                  ><el-icon-arrow-down /></el-icon
+              ></el-button>
+              <template #dropdown>
+                <el-dropdown-menu>
+                  <el-dropdown-item divided>button</el-dropdown-item>
+                </el-dropdown-menu>
+              </template>
+            </el-dropdown>
           </template>
         </el-table-column>
       </scTable>
@@ -242,16 +251,48 @@ export default {
       });
     },
     //审核
-    table_audit(row){
-      console.log(row)
+    table_audit(row) {
+      this.$confirm(this.$t("organization.ApproveOrgMsg"), this.$t("audit"), {
+        distinguishCancelAndClose: true,
+        confirmButtonText: this.$t("audited"),
+        cancelButtonText: this.$t("rejected"),
+        type: "warning",
+      })
+        .then(() => {
+          this.$API.wing.post(
+            "ModifyOrganizationStateAsync",
+            {
+              OrganizationCode: row.OrganizationCode,
+              State: 1,
+            },
+            this.refresh
+          );
+        })
+        .catch((action) => {
+          if (action === "cancel") {
+            this.$API.wing.post(
+              "ModifyOrganizationStateAsync",
+              {
+                OrganizationCode: row.OrganizationCode,
+                State: 2,
+              },
+              this.refresh
+            );
+          }
+        })
+        .finally(() => {});
     },
     //删除
     async table_del(row) {
-      await this.$API.wing.post("RemoveOrganization", {
-        OrganizationCode: row.OrganizationCode,
-      });
-      this.refresh();
+      await this.$API.wing.post(
+        "RemoveOrganization",
+        {
+          OrganizationCode: row.OrganizationCode,
+        },
+        this.refresh
+      );
     },
+    //删除前验证
     async changeTitle(row) {
       this.confirmDel = this.$t("organization.ConfirmDelete");
       var res = await this.$API.wing.post("OrganizationBindQueryResult", {