Ver código fonte

Finish Hotfix-zh-52

howie 3 anos atrás
pai
commit
eab0e8b000

+ 9 - 0
src/api/setting.js

@@ -483,3 +483,12 @@ export function editSubAccount(params) {
     params,
   });
 }
+
+// 新建经销商子账号
+export function getRoleChecked(params) {
+  return request({
+    url: "/admin/user/user/child/module/checked",
+    method: "get",
+    params,
+  });
+}

+ 23 - 9
src/views/engin_deposit/components/deposit-apply-surrender.vue

@@ -319,14 +319,14 @@
                         class="textColor"
                         @click="downLoadFn(scope.row.fileUrl,scope.row.fileName)"
                       >下载</el-button>
-                      <!--                <el-button-->
-                      <!--                  v-if="checkFileType(scope.row.fileUrl) == 'pdf'"-->
-                      <!--                  type="text"-->
-                      <!--                  class="textColor"-->
-                      <!--                  @click="openPdf(scope.row.fileUrl)"-->
-                      <!--                >-->
-                      <!--                  查看-->
-                      <!--                </el-button>-->
+                      <el-popconfirm
+                        style="margin-left: 10px"
+                        title="这是一段内容确定删除吗?"
+                        @onConfirm="delFile(scope.$index)"
+                      >
+                        <el-button type="text" slot="reference">删除</el-button>
+                      </el-popconfirm>
+
                     </template>
                   </el-table-column>
                 </el-table>
@@ -429,7 +429,17 @@ export default {
         this.$errorMsg('请选择安装时间')
         return
       }
-      this.fileList.forEach(el => {
+      this.fileList.forEach((el) => {
+         console.log(this.details.dataList.length)
+        if (this.details.dataList.length){
+          this.details.dataList.forEach((i,e)=>{
+            console.log(i.fileName==el.name)
+            if (el.name === i.fileName){
+              this.details.dataList.splice(e,1)
+            }
+          })
+        }
+
         this.details.dataList.push({
           dataDescribe: el.name,
           enginOrderNo: this.details.refProjectNo,
@@ -444,6 +454,10 @@ export default {
         this.$parent.getList()
       })
     },
+    delFile(index){
+      this.details.dataList.splice(index,1)
+      this.$successMsg('删除成功')
+    },
     handleReset() {
       this.$refs.form.resetFields()
     },

+ 1 - 1
src/views/engin_deposit/deposit_list.vue

@@ -136,7 +136,7 @@
             <el-table-column
               align="center"
               label="经销商编码"
-              prop="customerId"
+              prop="customerNumber"
               min-width="160"
               show-overflow-tooltip
             />

+ 33 - 30
src/views/setting/sub_account.vue

@@ -8,9 +8,9 @@
         <div class="fl">
           <el-button v-if="checkBtnRole('add')" size="small" type="primary" icon="el-icon-plus" @click="addOrEdit('add')">新增账号</el-button>
         </div>
-        <div class="fr">
-          <ImportButton :im-url="'stock/importToll'" @importSuccess="getList" />
-        </div>
+        <!--        <div class="fr">-->
+        <!--          <ImportButton :im-url="'stock/importToll'" @importSuccess="getList" />-->
+        <!--        </div>-->
       </div>
 
       <div class="table">
@@ -19,9 +19,16 @@
           <el-table-column align="center" label="账号" prop="userName" />
           <el-table-column align="center" label="创建时间" prop="createTime" />
           <el-table-column align="center" label="最后登录时间" prop="lastLoginTime" />
+          <el-table-column align="center" label="主帐号" prop="isMaster">
+            <template slot-scope="scope">
+
+              <el-tag v-if="scope.row.isMaster" type="success">是</el-tag>
+              <el-tag v-else type="danger">否</el-tag>
+            </template>
+          </el-table-column>
           <el-table-column align="center" label="操作" width="180">
             <template slot-scope="scope">
-              <el-button type="text" @click="addOrEdit('edit',scope.row)">编辑</el-button>
+              <el-button type="text" @click="addOrEdit('edit',scope.row)">修改</el-button>
               <el-button v-if="checkBtnRole('detail')" type="text" @click="setMenuRole(scope.row.adminUserId,'role')">设置权限</el-button>
 
             </template>
@@ -74,11 +81,11 @@
       :visible.sync="dialogVisible"
       :close-on-click-modal="false"
       width="45%"
-      :title="'add'===addFormType?'新增':'编辑'"
+      :title="'add'===addFormType?'新增':'修改'"
       @close="cancelAddForm"
     >
       <el-form ref="ruleForm" :model="ruleForm" :rules="rules" label-width="100px" class="demo-ruleForm">
-        <el-form-item label="账号" prop="account">
+        <el-form-item v-if="addFormType!=='edit'" label="账号" prop="account">
           <el-input v-model="ruleForm.account" type="text" autocomplete="off" />
         </el-form-item>
         <el-form-item label="密码" prop="password">
@@ -87,7 +94,7 @@
       </el-form>
 
       <span slot="footer" class="dialog-footer">
-        <el-button type="primary" style="float: left;" @click="setMenuRole">设置权限</el-button>
+        <!--        <el-button type="primary" style="float: left;" @click="setMenuRole">设置权限</el-button>-->
         <el-button @click="cancelAddForm">取 消</el-button>
         <el-button type="primary" @click="submitAddForm">确 定</el-button>
       </span>
@@ -104,7 +111,8 @@ import {
   editSubAccount,
   getAccountList,
   getMenuList,
-  getMenuRoleIds
+  getRoleChecked,
+  setMenuRole
 } from '@/api/setting'
 
 export default {
@@ -173,13 +181,11 @@ export default {
 
     getList() {
       this.listLoading = true
-
       const params = {
         pageNum: this.currentPage,
         pageSize: this.pageSize,
         customerId: this.customerId
       }
-
       getAccountList(params).then(res => {
         this.dataList = res.data.records
         this.listTotal = res.data.total
@@ -216,7 +222,8 @@ export default {
         this.$nextTick(() => {
           this.ruleForm = {
             account: row.userName,
-            password: row.password
+            password: '',
+            adminUserId: row.adminUserId
           }
         })
       }
@@ -237,11 +244,12 @@ export default {
         const params = {
           userName: this.ruleForm.account,
           password: this.ruleForm.password,
-          adminModuleIds: this.$refs.tree ? this.$refs.tree.getCheckedKeys().join(',') : ''
+          adminModuleIds: ''
+          // adminModuleIds:this.$refs.tree ? this.$refs.tree.getCheckedKeys().join(',') :
         }
         if (valid) {
           if (this.addFormType === 'edit') {
-            params.adminRoleId = this.editId
+            params.adminUserId = this.ruleForm.adminUserId
             editSubAccount(params).then(res => {
               this.cancelAddForm()
               this.getList()
@@ -265,27 +273,22 @@ export default {
       getMenuList({ adminUserId: this.userid }).then(res => {
         this.menuRoleList = res.data
       })
-      if (type === 'role') {
-
-        getMenuRoleIds({ adminRoleId: id }).then(res => {
-          console.log(78888,res.data)
-          this.$refs.tree.setCheckedKeys(res.data)
-        })
-      }
+      getRoleChecked({ adminUserId: id }).then(res => {
+        this.$refs.tree.setCheckedKeys(res.data)
+      })
     },
 
     // 设置权限 - 提交数据
     submitRoleForm(type) {
-      // if (type === 'role') {
-      //   const params = {
-      //     adminModuleIds: this.$refs.tree.getCheckedKeys().join(','),
-      //     adminRoleId: this.editId
-      //   }
-      //   setMenuRole(params).then(res => {
-      //     this.getList()
-      //     this.$successMsg()
-      //   })
-      // }
+      const params = {
+        adminModuleIds: this.$refs.tree.getCheckedKeys().join(','),
+        adminRoleId: this.editId
+      }
+      setMenuRole(params).then(res => {
+        this.getList()
+        this.$successMsg()
+      })
+
       this.roleFormVisible = false
     },