Ver código fonte

【修改】商户和部门

莫绍宝 3 anos atrás
pai
commit
9e68360c56

+ 1 - 10
src/api/merchant.js

@@ -104,19 +104,10 @@ export function deleteDepartment(params) {
   })
 }
 
-// 获取区域列表
-export function getAreaList(params) {
-  return request({
-    url: '/admin/websit/zone/list',
-    method: 'get',
-    params
-  })
-}
-
 // 获取成员列表
 export function getMemberList(params) {
   return request({
-    url: '/wechat/enterprise/list',
+    url: '/admin/user/list',
     method: 'get',
     params
   })

+ 4 - 1
src/views/merchant/create_account.vue

@@ -251,7 +251,10 @@ export default {
       addAccount(params).then(res => {
         this.$successMsg('开通成功');
         setTimeout(() => {
-          this.$refs.mainForm.resetFields();
+          this.$router.push({
+            path: '/merchant/merchant_list',
+            query: {}
+          })
         }, 1500)
       }).finally(res => {
         this.formLoading = false;

+ 30 - 34
src/views/merchant/department.vue

@@ -19,7 +19,7 @@
         :filter-node-method="filterNode"
         @node-click="handleNodeClick"
         node-key="id"
-        ref="tree">
+        ref="listTree">
         <div class="custom-tree-node" slot-scope="{ node, data }">
           <i :class="data.children && data.children.length > 0 ? 'el-icon-folder-opened':'el-icon-document-remove'"></i><span>{{ node.label }}</span>
         </div>
@@ -90,32 +90,36 @@
       <div class="table">
         <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe @selection-change="handleTableSelection">
           <el-table-column align="center" type="selection" width="55" fixed></el-table-column>
-          <el-table-column align="center" label="操作" min-width="110" fixed>
-            <template slot-scope="scope">
-              <el-button type="text" @click="openMemberForm('edit', scope.row.id)" v-if="checkBtnRole('edit')">编辑</el-button>
-              <el-popconfirm style="margin-left: 10px;" title="确定删除吗?" @onConfirm="deleteMember(scope.row.id)" v-if="checkBtnRole('del')">
-                <el-button slot="reference" type="text">删除</el-button>
-              </el-popconfirm>
-            </template>
-          </el-table-column>
-          <el-table-column align="center" label="姓名" prop="name" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="性别" prop="gender" min-width="100">
+          <el-table-column align="center" label="账号" prop="userName" min-width="120"></el-table-column>
+          <el-table-column align="center" label="用户名" prop="nickName" min-width="120"></el-table-column>
+          <el-table-column align="center" label="角色" prop="roleName" min-width="100"></el-table-column>
+          <el-table-column align="center" label="创建时间" prop="createTime" min-width="160"></el-table-column>
+          <el-table-column align="center" label="最后登录时间" prop="lastLoginTime" min-width="160"></el-table-column>
+          <el-table-column align="center" label="状态" class-name="status-col">
             <template slot-scope="scope">
-              <span v-if="scope.row.gender == 1">男</span>
-              <span v-else-if="scope.row.gender == 2">女</span>
-              <span v-else>未知</span>
+              <el-tag :type="scope.row.status ? 'success':'danger'">{{ scope.row.status ? '正常':'冻结' }}</el-tag>
             </template>
           </el-table-column>
-          <el-table-column align="center" label="账号" prop="wechatUserId" min-width="140" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="部门" prop="departmentName" min-width="180" show-overflow-tooltip>
+          <el-table-column align="center" label="操作" min-width="200">
             <template slot-scope="scope">
-              {{ scope.row.departmentName }}
+              <template v-if="checkBtnRole('status')">
+                <el-popconfirm v-if="scope.row.status" style="margin-right: 10px;" title="确定冻结吗?" @onConfirm="changeStatus(scope.row.adminUserId, 0)" >
+                  <el-button slot="reference" type="text">冻结</el-button>
+                </el-popconfirm>
+                <el-popconfirm v-else style="margin-right: 10px;" title="确定恢复吗?" @onConfirm="changeStatus(scope.row.adminUserId, 1)" >
+                  <el-button slot="reference" type="text">恢复</el-button>
+                </el-popconfirm>
+              </template>
+
+              <el-button type="text" @click="addOrEdit('edit', scope.row.adminUserId)" v-if="checkBtnRole('edit')">编辑</el-button>
+              <el-button type="text" @click="handleReset(scope.row.adminUserId)" v-if="checkBtnRole('reset')">重置密码</el-button>
+
+              <el-popconfirm style="margin-left: 10px;" title="确定删除吗?" @onConfirm="deleteMember(scope.row.id)" v-if="checkBtnRole('del')">
+                <el-button slot="reference" type="text">删除</el-button>
+              </el-popconfirm>
             </template>
           </el-table-column>
-          <el-table-column align="center" label="职务" prop="position" min-width="140" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="手机号码" prop="mobile" min-width="140"></el-table-column>
-          <el-table-column align="center" label="邮箱" prop="email" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="创建时间" prop="createTime" min-width="160"></el-table-column>
+          
         </el-table>
       </div>
       
@@ -215,7 +219,7 @@
 
 <script>
 import { 
-  getDepartmentList, addDepartment, editDepartment, deleteDepartment, getAreaList,
+  getDepartmentList, addDepartment, editDepartment, deleteDepartment,
   getMemberList, addMember, editMember, deleteMember, getMemberDetail
   } from '@/api/merchant'
 import { findElem, downloadFiles, handleImport } from '@/utils/util'
@@ -329,13 +333,12 @@ export default {
   },
   watch: {
     filterText(val) {
-      this.$refs.tree.filter(val);
+      this.$refs.listTree.filter(val);
     }
   },
   created() {
     this.getTree();
     this.getList();
-    this.getAreaList();
   },
   methods: {
     // 查询按钮权限
@@ -360,7 +363,7 @@ export default {
       this.listLoading = true;
 
       let params = {
-        pageNo: this.currentPage,
+        pageNum: this.currentPage,
         pageSize: this.pageSize,
         adminWebsitId: this.selectDepartment ? this.selectDepartment.id : '',
         websitId: this.selectDepartment ? this.selectDepartment.websitId : '',
@@ -374,13 +377,6 @@ export default {
       })
     },
 
-    // 获取区域列表
-    getAreaList() {
-      getAreaList().then(res => {
-        this.areaList = res.data;
-      })
-    },
-
     // 更改每页数量
     handleSizeChange(val) {
       this.pageSize = val;
@@ -417,7 +413,7 @@ export default {
     handleNodeClick(data) {
       console.log(data);
       if(this.selectDepartment && data.websitId === this.selectDepartment.websitId) {
-        this.$refs.tree.setCurrentKey(null);
+        this.$refs.listTree.setCurrentKey(null);
         this.selectDepartment = null;
       }else {
         this.selectDepartment = data;
@@ -427,7 +423,7 @@ export default {
 
     // 刷新部门
     refreshDepartment() {
-      this.$refs.tree.setCurrentKey(null);
+      this.$refs.listTree.setCurrentKey(null);
       this.selectDepartment = null;
       this.getTree();
       this.getList();

+ 11 - 6
src/views/merchant/merchant_detail.vue

@@ -8,15 +8,18 @@
         <el-form-item label="账户昵称" prop="nickName">
           <el-input v-model="mainForm.nickName" disabled></el-input>
         </el-form-item>
-        <el-form-item label="小程序名称" prop="appName">
-          <el-input v-model="mainForm.appName" disabled></el-input>
-        </el-form-item>
         <el-form-item label="负责人" prop="chargePerson">
           <el-input v-model="mainForm.chargePerson" disabled></el-input>
         </el-form-item>
         <el-form-item label="联系电话" prop="phone">
           <el-input v-model="mainForm.phone" disabled></el-input>
         </el-form-item>
+        <el-form-item label="金蝶主体账号" prop="kingdeeId">
+          <el-input v-model="mainForm.kingdeeId" disabled></el-input>
+        </el-form-item>
+        <el-form-item label="金蝶主体名称" prop="kingdeeName">
+          <el-input v-model="mainForm.kingdeeName" disabled></el-input>
+        </el-form-item>
         <el-form-item label="电子邮箱" prop="email">
           <el-input v-model="mainForm.email" disabled></el-input>
         </el-form-item>
@@ -35,7 +38,7 @@
 
     <div class="page-footer">
       <div class="footer" :class="classObj">
-        <el-button type="primary" @click="submitMainForm" :loading="formLoading">{{ formLoading ? '保存中 ...' : '保 存' }}</el-button>
+        <!-- <el-button type="primary" @click="submitMainForm" :loading="formLoading">{{ formLoading ? '保存中 ...' : '保 存' }}</el-button> -->
         <el-popconfirm
           title="确定关闭吗?"
           @onConfirm="goBack"
@@ -109,9 +112,10 @@ export default {
       mainForm: {
         account: '', // 账号
         nickName: '', // 用户名
-        appName: '', // 小程序名称
         chargePerson: '', // 负责人
         phone: '', // 联系电话
+        kingdeeId: '',
+        kingdeeName: '',
         email: '', // 电子邮箱
         address: '', // 地址
         newPassword: '', // 新密码
@@ -165,9 +169,10 @@ export default {
       getDetail({adminUserId: this.id}).then(res => {
         this.mainForm.account = res.data.userName;
         this.mainForm.nickName = res.data.nickName;
-        this.mainForm.appName = res.data.minAppName;
         this.mainForm.chargePerson = res.data.linkName;
         this.mainForm.phone = res.data.linkPhone;
+        this.mainForm.kingdeeId = res.data.useOrgNumber;
+        this.mainForm.kingdeeName = res.data.useOrgName;
         this.mainForm.email = res.data.email;
         this.mainForm.address = res.data.address;
         this.mainForm.password = '************';

+ 4 - 4
src/views/merchant/merchant_list.vue

@@ -59,12 +59,12 @@
         <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
           <el-table-column align="center" label="操作" width="120" fixed="right">
             <template slot-scope="scope">
-              <el-button type="text" @click="toDetail(scope.row.adminCompanyId)">详情</el-button>
+              <el-button type="text" @click="toDetail(scope.row.adminUserId)">详情</el-button>
               <template v-if="checkBtnRole('status')">
-                <el-popconfirm v-if="scope.row.status" style="margin-left: 10px;" title="确定冻结吗?" @onConfirm="changeStatus(scope.row.adminCompanyId, 0)" >
+                <el-popconfirm v-if="scope.row.status" style="margin-left: 10px;" title="确定冻结吗?" @onConfirm="changeStatus(scope.row.adminUserId, 0)" >
                   <el-button slot="reference" type="text">冻结</el-button>
                 </el-popconfirm>
-                <el-popconfirm v-else style="margin-left: 10px;" title="确定恢复吗?" @onConfirm="changeStatus(scope.row.adminCompanyId, 1)" >
+                <el-popconfirm v-else style="margin-left: 10px;" title="确定恢复吗?" @onConfirm="changeStatus(scope.row.adminUserId, 1)" >
                   <el-button slot="reference" type="text">恢复</el-button>
                 </el-popconfirm>
               </template>
@@ -218,7 +218,7 @@ export default {
     // 操作 - 更改状态(type: 禁用0,启用1)
     changeStatus(id, type) {
       type = type ? true : false
-      changeAccountStatus({adminCompanyId: id, status: type}).then(res => {
+      changeAccountStatus({adminUserId: id, status: type}).then(res => {
         this.getList();
         this.$successMsg();
       })