Explorar el Código

Merge branch 'master' of http://47.92.161.104:10080/shuzhan/enterprise-portal

jz.kai hace 4 años
padre
commit
2b530fef54

+ 5 - 1
src/api/base/personInfo.js

@@ -41,6 +41,10 @@ function batchRemove(idList){
   });
 }
 
+function resetPassword(formData){
+  return request.post(constant.serverUrl + "/base/personInfo/resetPassword", formData);
+}
+
 export default {
-  pageList,create,edit,add,update,remove,batchRemove
+  pageList,create,edit,add,update,remove,batchRemove,resetPassword
 }

+ 36 - 5
src/views/base/personInfo-detail.vue

@@ -28,7 +28,8 @@
                 v-model="formModel.companyId"
                 filterable
                 placeholder="请选择"
-                style="width: 200px"
+                style="width: 250px"
+                :filter-method="filterMethod"
               >
                 <el-option
                   v-for="result in companyInfoResult"
@@ -233,10 +234,10 @@ export default {
         this.registerTypeResult = jsonData.data;
       });
 
-    companyInfoApi.list().then((response) => {
-      var jsonData = response.data;
-      this.companyInfoResult = jsonData.data;
-    });
+    // companyInfoApi.list().then((response) => {
+    //   var jsonData = response.data;
+    //   this.companyInfoResult = jsonData.data;
+    // });
   },
   methods: {
     closeDialog() {
@@ -315,6 +316,19 @@ export default {
       }
       return isLt2M;
     },
+    filterMethod(query, item) {
+      var self = this;
+      var formData = new FormData();
+      formData.append("pageSize", 5);
+      formData.append("companyName", query);
+
+      companyInfoApi.list(formData).then(function (response) {
+        var jsonData = response.data;
+        if (jsonData.result) {
+          self.companyInfoResult = jsonData.data;
+        }
+      });
+    },
   },
   mounted: function () {
     var self = this;
@@ -345,6 +359,23 @@ export default {
               idCardUrl +
               "?x-oss-process=image/resize,m_lfit,h_200";
           }
+
+          let companyId = self.formModel.companyId;
+          if (companyId != null) {
+            var formData = new FormData();
+            formData.append("pageSize", 5);
+            formData.append("companyId", companyId);
+
+            companyInfoApi.list(formData).then(function (response) {
+              var jsonData = response.data;
+              if (jsonData.result) {
+                self.companyInfoResult = jsonData.data;
+              }
+            });
+          }
+
+
+
         } else {
           self.$message.error(jsonData.message + "");
         }

+ 42 - 9
src/views/base/personInfo-list.vue

@@ -138,7 +138,8 @@
       <el-table-column
         prop="companyName"
         label="企业"
-        width="150"
+        width="200"
+        show-overflow-tooltip
       ></el-table-column>
       <el-table-column
         prop="registerTypeName"
@@ -206,12 +207,19 @@
       ></el-table-column>
       <el-table-column label="操作" width="180" fixed="right">
         <template slot-scope="{ row }">
-          <el-button size="mini" type="warning" @click="handleEdit(row)"
-            >编辑</el-button
-          >
-          <el-button size="mini" type="danger" @click="handleDelete(row)"
-            >删除</el-button
-          >
+          <el-row
+            ><el-col :span="7">
+              <el-link type="primary" @click="handleEdit(row)" gutter>编辑</el-link>
+            </el-col>
+            <el-col :span="7">
+              <el-link type="danger" @click="handleDelete(row)">删除</el-link>
+            </el-col>
+            <el-col :span="10">
+              <el-link type="warning" @click="resetPassword(row)"
+                >密码重置</el-link
+              >
+            </el-col>
+          </el-row>
         </template>
       </el-table-column>
     </el-table>
@@ -300,7 +308,7 @@ export default {
 
     return {
       queryModel: {
-        companyId:"",
+        companyId: "",
         companyName: "",
         registerType: "",
         personName: "",
@@ -334,7 +342,7 @@ export default {
       },
       xlsLoading: false,
       //导入E
-      companyInfoList:[],
+      companyInfoList: [],
     };
   },
   created() {
@@ -547,6 +555,31 @@ export default {
         }
       });
     },
+    resetPassword(record) {
+      var self = this;
+      var formData = new FormData();
+      formData.append("id", record.id);
+      self
+        .$confirm("是否确认重置密码?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        })
+        .then(() => {
+          personInfoApi.resetPassword(formData).then(function (response) {
+            var jsonData = response.data;
+
+            if (jsonData.result) {
+              self.changePage(self.pageIndex);
+
+              self.$message({
+                type: "success",
+                message: "重置成功!",
+              });
+            }
+          });
+        });
+    },
   },
   mounted: function () {
     this.changePage(1);