Selaa lähdekoodia

添加用户扩展页面

尹帮元 2 vuotta sitten
vanhempi
commit
79efb3b16c
3 muutettua tiedostoa jossa 685 lisäystä ja 1 poistoa
  1. 14 0
      src/router/index.js
  2. 658 0
      src/views/system/user/extend.vue
  3. 13 1
      src/views/system/user/index.vue

+ 14 - 0
src/router/index.js

@@ -113,6 +113,20 @@ export const constantRoutes = [
 // 动态路由,基于用户权限动态去加载
 export const dynamicRoutes = [
   {
+    path: '/system/user-extend',
+    component: Layout,
+    hidden: true,
+    permissions: ['system:user:extend'],
+    children: [
+      {
+        path: 'extend/:userId(\\d+)',
+        component: () => import('@/views/system/user/extend'),
+        name: 'UserExtend',
+        meta: { title: '用户信息扩展', activeMenu: '/system/user' }
+      }
+    ]
+  },
+  {
     path: '/system/user-auth',
     component: Layout,
     hidden: true,

+ 658 - 0
src/views/system/user/extend.vue

@@ -0,0 +1,658 @@
+<template>
+  <div class="app-container">
+    <h3 class="title">编辑管理人员信息</h3>
+    <div class="info-box">
+      <el-descriptions >
+        <el-descriptions-item v-for="v in dataInfo" :label="v.label" :key="v.key">{{ v.value }}</el-descriptions-item>
+        <!-- <el-descriptions-item label="机构类型">一级机构</el-descriptions-item> -->
+      </el-descriptions>
+    </div>
+    <div class="info-box">
+      <el-form inline class="demo-form-inline" label-position="left" label-width="140px">
+        <el-row>
+          <el-col :xs="24" :sm="12" :md="8" :lg="6" >
+            <el-form-item label="是否专职">
+              <el-switch
+                v-model="ownership"
+                active-text
+                inactive-text
+                :active-value="1"
+                :inactive-value="0"
+              ></el-switch>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :md="8" :lg="6" >
+            <el-form-item label="是否持证上岗">
+              <el-switch
+                v-model="ownership"
+                active-text
+                inactive-text
+                :active-value="1"
+                :inactive-value="0"
+              ></el-switch>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row  >
+          <el-col :xs="24" :sm="12" :md="8" :lg="6" >
+            <el-form-item label="所属部门">
+              <el-select v-model="orgType" placeholder="所属部门">
+                <el-option
+                  v-for="(orgTyp, key) in orgTypes"
+                  :key="key"
+                  :label="orgTyp.label"
+                  :value="orgTyp.value"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :md="8" :lg="6" >
+            <el-form-item label="责任职务">
+              <el-select v-model="orgType" placeholder="请选择">
+                <el-option
+                  v-for="(orgTyp, key) in orgTypes"
+                  :key="key"
+                  :label="orgTyp.label"
+                  :value="orgTyp.value"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :md="8" :lg="6" >
+            <el-form-item label="用工形式">
+              <el-select v-model="orgType" placeholder="请选择">
+                <el-option
+                  v-for="(orgTyp, key) in orgTypes"
+                  :key="key"
+                  :label="orgTyp.label"
+                  :value="orgTyp.value"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :md="8" :lg="6" >
+            <el-form-item label="最高学历">
+                <el-select v-model="orgType" placeholder="请选择">
+                  <el-option
+                    v-for="(orgTyp, key) in orgTypes"
+                    :key="key"
+                    :label="orgTyp.label"
+                    :value="orgTyp.value"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :md="8" :lg="6" >
+            <el-form-item label="学历取得方式">
+              <el-select v-model="orgType" placeholder="请选择">
+                <el-option
+                  v-for="(orgTyp, key) in orgTypes"
+                  :key="key"
+                  :label="orgTyp.label"
+                  :value="orgTyp.value"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :xs="24" :sm="12" :md="8" :lg="6" >
+            <el-form-item  label="初级以上相关专业技术职业资格">
+              <el-select v-model="orgType" placeholder="请选择">
+                <el-option
+                  v-for="(orgTyp, key) in orgTypes"
+                  :key="key"
+                  :label="orgTyp.label"
+                  :value="orgTyp.value"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :md="8" :lg="6" >
+            <el-form-item label="持证上岗未通过原因">
+              <el-select v-model="orgType" placeholder="请选择">
+                <el-option
+                  v-for="(orgTyp, key) in orgTypes"
+                  :key="key"
+                  :label="orgTyp.label"
+                  :value="orgTyp.value"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :md="8" :lg="6" >
+            <el-form-item label="参加工作时间"
+              prop="constructionTime">
+              <el-date-picker
+                clearable
+                v-model="constructionTime"
+                type="date"
+                value-format="yyyy-MM-dd HH:mm:ss"
+                placeholder="请选择时间">
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :md="8" :lg="6" >
+            <el-form-item label="现任职时间"
+              prop="constructionTime">
+              <el-date-picker
+                clearable
+                v-model="constructionTime"
+                type="date"
+                value-format="yyyy-MM-dd HH:mm:ss"
+                placeholder="请选择时间">
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :md="8" :lg="6" >
+            <el-form-item label="出生日期"
+              prop="constructionTime">
+              <el-date-picker
+                clearable
+                v-model="constructionTime"
+                type="date"
+                value-format="yyyy-MM-dd HH:mm:ss"
+                placeholder="请选择时间">
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :md="8" :lg="6" >
+            <el-form-item label="分管领导姓名">
+              <el-input v-model="platformBrand" placeholder="请输入">
+              </el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :md="8" :lg="6" >
+            <el-form-item label="分管领导职务">
+              <el-select v-model="platformBrand" placeholder="请选择">
+                <el-option
+                  v-for="(platformB, key) in platformBrands"
+                  :key="key"
+                  :label="platformB.label"
+                  :value="platformB.value"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :xs="24" :sm="12" :md="8" :lg="6" >
+            <el-form-item label="上传相关证书">
+              <image-upload :limit="5" :fileSize="2"></image-upload>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :md="8" :lg="6" >
+            <el-form-item label="示例图">
+              <div style="width: 280px;">
+                <el-image :src="uplp"></el-image>
+              </div>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+    </div>
+    <div style="margin-top: 50px; margin-left: 42%">
+      <el-button type="primary" @click="saveExtend" size="small">提交</el-button>
+      <el-button type="primary" @click="nosaveExtend" size="small">取消</el-button>
+    </div>
+
+  </div>
+</template>
+
+<script>
+import uploadpng from "@/assets/images/upload.png";
+import uplpng from "@/assets/images/upl.png";
+import {getUser} from "@/api/system/user";
+
+export default {
+  props: [],
+  components: {},
+  data() {
+    return {
+      //基础信息key
+      infoKeys:[
+        {label:'机构名称',key:'name'},
+        {label:'机构组织类型',key:'type'},
+        {label:'部门机构电话',key:'phone'},
+        {label:'部门机构地址',key:'address'},
+        {label:'排序号',key:'sort'},
+        {label:'是否可用',key:'isLock'},
+        {label:'更新时间',key:'updateTime'},
+        {label:'同步时间',key:'createTime'},
+      ],
+      dataInfo:[],
+      //机构补充信息
+      extendId: null,
+      orgType: 1,
+      weatherAreaCode: null,
+      premisesArea: null,
+      ownership: null,
+      outsideArea: null,
+      askari: 1,
+      businessLibraryType: 1,
+      dutyMode: 0,
+      remoteControl: null,
+      selfServiceBank: null,
+      lobbyEquipment: 1,
+      wallPenetratingEquipment: 2,
+      platformBrand: null,
+      platformSupplierBrand: null,
+      constructionTime: null,
+      lastUpdateTime: null,
+      //机构建设数据
+
+      // 遮罩层
+      orgloading: true,
+      // 选中数组
+      orgids: [],
+      // 选中数组
+      Bankids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 机构物防建设表格数据
+      constructionList: [],
+      // 银行物防建设表格数据
+      BankPhysicalDefenseConstructionList: [],
+      // 弹出层标题
+      orgtitle: "",
+      // 弹出层标题
+      Banktitle: "",
+      // 是否显示弹出层
+      Bankopen: false,
+      // 表单参数
+      Bankform: {},
+      // 是否显示弹出层
+      orgopen: false,
+      // 表单参数
+      orgform: {},
+      //2个图片信息
+      uploadp: uploadpng,
+      uplp: uplpng,
+      //下拉框生成信息
+      orgTypes: {
+        orgTyp1: { label: "营业网点", value: 0 },
+        orgTyp2: { label: "监控中心", value: 1 },
+      },
+      businessLibraryTypes: {
+        businessLibraryTyp1: { label: "1类业务库", value: 1 },
+        businessLibraryTyp2: { label: "2类业务库", value: 2 },
+        businessLibraryTyp3: { label: "3类业务库", value: 3 },
+      },
+      platformBrands: {
+        platformBrand1: { label: "品牌1", value: 0 },
+        platformBrand2: { label: "品牌2", value: 1 },
+      },
+      platformSupplierBrands: {
+        platformSupplierBrand1: { label: "品牌1", value: 0 },
+        platformSupplierBrand2: { label: "品牌2", value: 1 },
+      },
+      prop: "",
+      propItem: "",
+
+      row: "",
+    };
+  },
+  watch: {},
+  computed: {
+    switchModel: {
+      get() {
+        return this.switchValue === 1; // 将0转换为false,1转换为true
+      },
+      set(value) {
+        this.switchValue = value ? 1 : 0; // 将false转换为0,true转换为1
+      },
+    },
+  },
+  created() {
+    this.getInfo();
+    // this.getExtendInfo();
+    // this.getOrgPhysicalDefenseConstructionInfo();
+    // this.getBankPhysicalDefenseConstructionInfo();
+  },
+  mounted() {},
+  methods: {
+    request() {},
+    handleChange(value) {},
+    getInfo() {
+      getUser(this.$route.params.userId).then((data) => {
+        console.log(this.$route.params.userId,'id');
+        if (!data.data ) return;
+        let res = data.data;
+        this.dataInfo = this.infoKeys.map((v,i)=> {
+          console.log(v, res[v.key], 'vvvvv')
+          v.value =  res[v.key];
+          return v
+        })
+        console.log(this.dataInfo, 'info')
+      });
+    },
+
+    getExtendInfo() {
+      getExtendByOrgId(this.$route.params.id).then((data) => {
+        console.log(data.data);
+        if (data.data != null) {
+          this.orgType = data.data.orgType;
+          this.weatherAreaCode = data.data.weatherAreaCode;
+          this.premisesArea = data.data.premisesArea;
+          this.ownership = data.data.ownership;
+          this.outsideArea = data.data.outsideArea;
+          this.askari = data.data.askari;
+          this.remoteControl = data.data.remoteControl;
+          this.selfServiceBank = data.data.selfServiceBank;
+          this.lobbyEquipment = data.data.lobbyEquipment;
+          this.wallPenetratingEquipment = data.data.wallPenetratingEquipment;
+          this.extendId = data.data.id;
+        }
+      });
+    },
+    getOrgPhysicalDefenseConstructionInfo() {
+      this.orgloading = true;
+      let dat = { orgId: this.$route.params.id };
+      listOrgPhysicalDefenseConstruction(dat).then((data) => {
+        // console.log(data);
+        this.constructionList = data.rows;
+        this.orgloading = false;
+      });
+    },
+    getBankPhysicalDefenseConstructionInfo() {
+      this.bankloading = true;
+      let dat = { orgId: this.$route.params.id };
+      listBankPhysicalDefenseConstruction(dat).then((data) => {
+        // console.log(data);
+        this.BankPhysicalDefenseConstructionList = data.rows;
+        this.bankloading = false;
+      });
+    },
+    // 取消按钮
+    Bankcancel() {
+      this.Bankopen = false;
+      this.Bankreset();
+    },
+    // 表单重置
+    Bankreset() {
+      this.Bankform = {
+        id: null,
+        standard: null,
+        dateOfCompliance: null,
+        certificateEvidence: null,
+        certificate: null,
+        evidence: null,
+        createTime: null,
+        updateTime: null,
+        createBy: null,
+        updateBy: null,
+        orgId: null,
+      };
+      this.resetForm("Bankform");
+    },
+    // 多选框选中数据
+    handleBankSelectionChange(selection) {
+      this.Bankids = selection.map((item) => item.id);
+      this.single = selection.length !== 1;
+      this.multiple = !selection.length;
+    },
+    /** 新增按钮操作 */
+    handleBankAdd() {
+      this.Bankreset();
+      this.Bankopen = true;
+      this.Banktitle = "添加银行物防建设";
+    },
+    /** 修改按钮操作 */
+    handleBankUpdate(row) {
+      this.Bankreset();
+      const id = row.id || this.Bankids;
+      getBankPhysicalDefenseConstruction(id).then((response) => {
+        this.Bankform = response.data;
+        this.Bankopen = true;
+        this.Banktitle = "修改银行物防建设";
+      });
+    },
+    /** 提交按钮 */
+    submitBankForm() {
+      this.Bankform.orgId = this.$route.params.id;
+      this.$refs["Bankform"].validate((valid) => {
+        if (valid) {
+          if (this.Bankform.id != null) {
+            updateBankPhysicalDefenseConstruction(this.Bankform).then(
+              (response) => {
+                this.$modal.msgSuccess("修改成功");
+                this.Bankopen = false;
+                this.getBankPhysicalDefenseConstructionInfo();
+              }
+            );
+          } else {
+            addBankPhysicalDefenseConstruction(this.Bankform).then(
+              (response) => {
+                this.$modal.msgSuccess("新增成功");
+                this.Bankopen = false;
+                this.getBankPhysicalDefenseConstructionInfo();
+              }
+            );
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleBankDelete(row) {
+      const Bankids = row.id || this.Bankids;
+      this.$modal
+        .confirm('是否确认删除银行物防建设编号为"' + Bankids + '"的数据项?')
+        .then(function () {
+          return delBankPhysicalDefenseConstruction(Bankids);
+        })
+        .then(() => {
+          this.getBankPhysicalDefenseConstructionInfo();
+          this.$modal.msgSuccess("删除成功");
+        })
+        .catch(() => {});
+    },
+    // 表单重置
+    orgreset() {
+      this.orgform = {
+        id: null,
+        standard: null,
+        dateOfCompliance: null,
+        certificateEvidence: null,
+        certificate: null,
+        evidence: null,
+        createTime: null,
+        updateTime: null,
+        createBy: null,
+        updateBy: null,
+        orgId: null,
+      };
+      this.resetForm("orgform");
+    },
+    // 取消按钮
+    orgcancel() {
+      this.orgopen = false;
+      this.orgreset();
+    },
+    // 多选框选中数据
+    handleOrgSelectionChange(selection) {
+      this.orgids = selection.map((item) => item.id);
+      this.single = selection.length !== 1;
+      this.multiple = !selection.length;
+    },
+    /** 新增按钮操作 */
+    handleOrgAdd() {
+      this.orgreset();
+      this.orgopen = true;
+      this.orgtitle = "添加机构物防建设";
+    },
+    /** 修改按钮操作 */
+    handleOrgUpdate(row) {
+      this.orgreset();
+      const id = row.id || this.orgids;
+      getOrgPhysicalDefenseConstruction(id).then((response) => {
+        // console.log(response)
+        this.orgform = response.data;
+        this.orgopen = true;
+        this.orgtitle = "修改机构物防建设";
+      });
+    },
+    /** 提交按钮 */
+    submitOrgForm() {
+      this.orgform.orgId = this.$route.params.id;
+      this.$refs["orgform"].validate((valid) => {
+        if (valid) {
+          if (this.orgform.id != null) {
+            updateOrgPhysicalDefenseConstruction(this.orgform).then(
+              (response) => {
+                this.$modal.msgSuccess("修改成功");
+                this.orgopen = false;
+                this.getOrgPhysicalDefenseConstructionInfo();
+              }
+            );
+          } else {
+            addOrgPhysicalDefenseConstruction(this.orgform).then((response) => {
+              this.$modal.msgSuccess("新增成功");
+              this.orgopen = false;
+              this.getOrgPhysicalDefenseConstructionInfo();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleOrgDelete(row) {
+      const orgids = row.id || this.orgids;
+      this.$modal
+        .confirm('是否确认删除机构物防建设编号为"' + orgids + '"的数据项?')
+        .then(function () {
+          return delOrgPhysicalDefenseConstruction(orgids);
+        })
+        .then(() => {
+          this.getOrgPhysicalDefenseConstructionInfo();
+          this.$modal.msgSuccess("删除成功");
+        })
+        .catch(() => {});
+    },
+    saveExtend() {
+      let dat = {
+        orgType: this.orgType,
+        weatherAreaCode: this.weatherAreaCode,
+        premisesArea: this.premisesArea,
+        ownership: this.ownership ? 1 : 0,
+        outsideArea: this.outsideArea ? 1 : 0,
+        askari: this.askari ? 1 : 0,
+        businessLibraryType: this.businessLibraryType,
+        dutyMode: this.dutyMode,
+        remoteControl: this.remoteControl ? 1 : 0,
+        selfServiceBank: this.selfServiceBank ? 1 : 0,
+        lobbyEquipment: this.lobbyEquipment,
+        wallPenetratingEquipment: this.wallPenetratingEquipment,
+        platformBrand: this.platformBrand,
+        platformSupplierBrand: this.platformSupplierBrand,
+        constructionTime: this.constructionTime,
+        lastUpdateTime: this.lastUpdateTime,
+        orgId: this.$route.params.id,
+        id: this.extendId,
+      };
+      if(this.extendId){
+        updateExtend(dat).then((res) => {
+          this.$modal.msgSuccess("保存成功");
+          this.$router.go(-1);
+        });
+      }else{
+        addExtend(dat).then((res) => {
+          this.$modal.msgSuccess("保存成功");
+          this.$router.go(-1);
+        });
+      }
+
+    },
+    nosaveExtend() {
+      this.$router.go(-1);
+    },
+    triggerFileInput() {
+      this.$refs.fileInput.click();
+    },
+    async handleFileChange(event) {
+      const file = event.target.files[0];
+      if (!file) return;
+
+      // 创建 FormData 对象并添加文件
+      const formData = new FormData();
+      formData.append('file', file);
+
+      // // 发送文件到您的文件上传 API
+      try {
+        uploadFile(formData).then((res) => {
+          console.log(res);
+          // this.orgform.certificateEvidence = res.data;
+        });
+        // 处理上传成功的逻辑
+        console.log('上传成功');
+      } catch (error) {
+        // 处理上传失败的逻辑
+        console.log('上传失败');
+      }
+      // try {
+      //   const response = await request.post('http://localhost:9527/dev-api/file/file/upload', formData, {
+      //     headers: {
+      //       'Content-Type': 'multipart/form-data',
+      //     },
+      //   });
+      //   // 处理上传成功的逻辑
+      //   console.log('上传成功', response);
+      // } catch (error) {
+      //   // 处理上传失败的逻辑
+      //   console.log('上传失败', error);
+      // }
+      // 重置 input 元素,以便下次选择相同文件时仍能触发 change 事件
+      event.target.value = '';
+    },
+  },
+  fillter: {},
+};
+</script>
+
+<style scoped lang="scss">
+
+.title{
+  font-size: 18px;
+  text-align: left;
+  background: #4f9baabd;
+  color:#fff;
+  height: 36px;
+  line-height: 36px;
+  padding-left: 8px;
+  margin: 0;
+}
+.info-box{
+  margin: 30px;
+}
+.demo-form-inline {
+}
+.dialog-footer {
+}
+.container {
+}
+.image-container {
+  display: inline-block;
+  width: 200px;
+  margin-right: 20px; /* 设置与下一个div的水平间距 */
+}
+.zoom-image {
+  transition: transform 0.3s ease;
+}
+
+.zoom-image:hover {
+  transform: scale(1.02);
+}
+.border-color-change {
+  border: 1px solid #ccc;
+  transition: border-color 0.3s ease;
+}
+
+.border-color-change:hover {
+  border-color: #1ea8e9; /* 您可以将此颜色更改为所需的颜色 */
+}
+</style>

+ 13 - 1
src/views/system/user/index.vue

@@ -93,7 +93,7 @@
               plain
               icon="el-icon-plus"
               size="mini"
-              @click="handleAdd"
+              @click="handleAdd()"
               v-hasPermi="['system:user:add']"
             >新增</el-button>
           </el-col>
@@ -180,6 +180,13 @@
                 size="mini"
                 type="text"
                 icon="el-icon-edit"
+                @click="handleExtend(scope.row)"
+                v-hasPermi="['system:user:extend']"
+              >扩展</el-button>
+              <el-button
+                size="mini"
+                type="text"
+                icon="el-icon-edit"
                 @click="handleUpdate(scope.row)"
                 v-hasPermi="['system:user:edit']"
               >修改</el-button>
@@ -494,6 +501,11 @@ export default {
     });
   },
   methods: {
+    /** 分配角色操作 */
+    handleExtend(row) {
+      const userId = row.id;
+      this.$router.push("/system/user-extend/extend/" + userId);
+    },
     //自定义数据
     tenantIdnormalizer(node, instanceId) {
       if (node.children && !node.children.length) {