ソースを参照

人员管理修改

2213980799@qq.com 1 年間 前
コミット
1b545c54ac
1 ファイル変更34 行追加25 行削除
  1. 34 25
      src/views/system/organization/components/org-user-list.vue

+ 34 - 25
src/views/system/organization/components/org-user-list.vue

@@ -111,6 +111,23 @@
       ref="importDialogRef"
       ref="importDialogRef"
       @success="reload"
       @success="reload"
     />
     />
+    <el-dialog
+      title="提示"
+      :visible.sync="dialogVisible"
+      :before-close="handleClose"
+      width="400px"
+    >
+      <span>是否绑定已有用户?</span>
+      <el-radio v-model="radio" label="1">是</el-radio>
+      <el-radio v-model="radio" label="2">否</el-radio>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="setUser"
+          >确 定</el-button
+        >
+      </span>
+    </el-dialog>
+
     <ele-modal
     <ele-modal
       width="1000px"
       width="1000px"
       :visible="userShow"
       :visible="userShow"
@@ -126,12 +143,11 @@
         highlight-current-row
         highlight-current-row
         row-key="id"
         row-key="id"
       >
       >
-     
       </ele-pro-table>
       </ele-pro-table>
       <template v-slot:footer>
       <template v-slot:footer>
-          <el-button @click="userShow = false">取消</el-button>
-          <el-button type="primary" @click="getUser"> 确认 </el-button>
-        </template>
+        <el-button @click="userShow = false">取消</el-button>
+        <el-button type="primary" @click="getUser"> 确认 </el-button>
+      </template>
     </ele-modal>
     </ele-modal>
   </div>
   </div>
 </template>
 </template>
@@ -161,9 +177,11 @@ export default {
     return {
     return {
       moudleName: 'mainUser',
       moudleName: 'mainUser',
       showEdit1: false,
       showEdit1: false,
-      userShow:false,
+      userShow: false,
       userRow: null,
       userRow: null,
-      currentRow:null,
+      currentRow: null,
+      dialogVisible: false,
+      radio: '2',
       // 表格列配置
       // 表格列配置
       columns: [
       columns: [
         {
         {
@@ -317,13 +335,16 @@ export default {
   methods: {
   methods: {
     async addUsers(row) {
     async addUsers(row) {
       this.userRow = null;
       this.userRow = null;
-      this.currentRow=row
-      const isBind = await this.isBind();
-      if (isBind) {
+      this.currentRow = row;
+      this.dialogVisible = true;
+    },
+    setUser() {
+      this.dialogVisible = false
+      if (this.radio == 1) {
         this.userShow = true;
         this.userShow = true;
       } else {
       } else {
         this.showEdit1 = true;
         this.showEdit1 = true;
-        this.$refs.userEdit.userBk(row);
+        this.$refs.userEdit.userBk(this.currentRow);
       }
       }
     },
     },
     getUser() {
     getUser() {
@@ -331,23 +352,11 @@ export default {
         this.$message.warning('请选择一条数据!');
         this.$message.warning('请选择一条数据!');
         return;
         return;
       }
       }
-      this.userShow=false
+      this.userShow = false;
       this.showEdit1 = true;
       this.showEdit1 = true;
-      this.$refs.userEdit.getByData(this.userRow,this.currentRow);
-    },
-    async isBind() {
-      return this.$confirm('是否绑定已有用户?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      })
-        .then(() => {
-          return true;
-        })
-        .catch(() => {
-          return false;
-        });
+      this.$refs.userEdit.getByData(this.userRow, this.currentRow);
     },
     },
+
     /* 表格数据源 */
     /* 表格数据源 */
     datasource({ page, limit, where, order }) {
     datasource({ page, limit, where, order }) {
       return getUserPage({
       return getUserPage({