Explorar el Código

Finish Hotfix-6

chen hace 3 años
padre
commit
dfea472cf2
Se han modificado 2 ficheros con 34 adiciones y 6 borrados
  1. 9 0
      src/api/setting.js
  2. 25 6
      src/views/setting/account.vue

+ 9 - 0
src/api/setting.js

@@ -449,3 +449,12 @@ export function getApiList(params) {
     params
   })
 }
+
+// 仓库仓位对应关系列表
+export function getStockListStock(params) {
+  return request({
+    url: '/stock/listStock',
+    method: 'get',
+    params
+  })
+}

+ 25 - 6
src/views/setting/account.vue

@@ -131,16 +131,12 @@
         <el-form-item label="用户名" prop="nickName">
           <el-input v-model="AccountForm.nickName" autocomplete="off" placeholder="请输入用户名"></el-input>
         </el-form-item>
+      
         <el-form-item label="角色组" prop="role">
           <el-select v-model="AccountForm.role" placeholder="请选择角色组" style="width: 100%;" filterable>
             <el-option :label="item.name" :value="item.adminRoleId" v-for="(item, index) in roleList" :key="index"></el-option>
           </el-select>
         </el-form-item>
-        <el-form-item label="可用仓库" prop="">
-          <el-select v-model="AccountForm.role" placeholder="请选择可用仓库" style="width: 100%;" filterable>
-            <el-option :label="item.name" :value="item.adminRoleId" v-for="(item, index) in roleList" :key="index"></el-option>
-          </el-select>
-        </el-form-item>
         <el-form-item label="部门" prop="department" v-show="roleObj.type === 0">
           <el-tree
             :data="departmentList"
@@ -179,6 +175,7 @@
             <el-radio :label="false">否</el-radio>
           </el-radio-group>
         </el-form-item>
+       
         <el-form-item label="密码" prop="newPassword">
           <el-input v-model="AccountForm.newPassword" ref="password1" autocomplete="off" placeholder="请输入密码" :type="passwordType1"></el-input>
           <span class="show-pwd" @click="showPwd(1)">
@@ -191,6 +188,12 @@
             <svg-icon :icon-class="passwordType2 === 'password' ? 'eye' : 'eye-open'" />
           </span>
         </el-form-item>
+         <el-form-item  label="可用仓库" prop="correspondIds">
+          <el-select  multiple  v-model="AccountForm.correspondIds" placeholder="请选择可用仓库" style="width: 100%;" filterable>
+            <el-option :label="item.name" :value="item.id" v-for="(item, index) in stockList" :key="index"></el-option>
+          </el-select>
+        
+        </el-form-item>
 
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -225,7 +228,7 @@
 </template>
 
 <script>
-import { getDepartmentList, getAccountList, addAccount, editAccount, deleteAccount, getAccountDetail, getRoleList, getMerchantList, changeAccountStatus, resetPassword } from '@/api/setting'
+import {getStockListStock, getDepartmentList, getAccountList, addAccount, editAccount, deleteAccount, getAccountDetail, getRoleList, getMerchantList, changeAccountStatus, resetPassword } from '@/api/setting'
 import { getDealerList } from '@/api/common'
 import { findElem, downloadFiles, handleImport } from '@/utils/util'
 
@@ -274,6 +277,7 @@ export default {
       }
     };
     return {
+      stockList:[],//仓库列表
       baseURL: process.env.VUE_APP_BASE_API,
       dataList: null, // 列表数据
       moduleList: null, // 模块列表
@@ -295,6 +299,7 @@ export default {
         merchant: '', // 商户
         dealer: '', //经销商
         role: '', // 角色组
+        correspondIds:[],//仓库
         isGroup: false,
         company: '',
         isDiscount: true,
@@ -311,6 +316,9 @@ export default {
         role: [
           { required: true, message: '请选择角色组', trigger: 'change' }
         ],
+        correspondIds: [
+          { required: true, message: '请选择可用仓库', trigger: 'change' }
+        ],
         newPassword: [
           { required: true, validator: validatePass3, trigger: 'blur' }
         ],
@@ -376,8 +384,15 @@ export default {
   async created() {
     this.getTree();
     this.getList();
+    this.getStockList()
   },
   methods: {
+    //获取仓库仓位对应关系列表
+    async getStockList(){
+      let res = await getStockListStock({pageSize:-1,pageNum:1})
+      this.stockList = res.data.records
+
+    },
     // 查询按钮权限
     checkBtnRole(value) {
       // let btnRole = this.$route.meta.roles;
@@ -527,6 +542,7 @@ export default {
       if(type == 'edit') {
         this.editAccountId = id;
         getAccountDetail({adminUserId: id}).then(res => {
+          console.log(res,78787);
           this.AccountForm.account = res.data.userName;
           this.AccountForm.role = res.data.roleId;
           this.AccountForm.nickName = res.data.nickName;
@@ -535,6 +551,7 @@ export default {
           this.AccountForm.isGroup = res.data.isGroupCompany;
           this.AccountForm.company = res.data.parentCustomerId;
           this.AccountForm.isDiscount = res.data.isZr;
+          this.AccountForm.correspondIds = res.data.stockCorrespondList;
           this.$refs.tree.setCheckedKeys(res.data.adminWebsitIds || []);
         })
       }
@@ -550,6 +567,7 @@ export default {
 
     // 提交 账号表单
     submitAccountForm() {
+      console.log(this.AccountForm.correspondIds);
       this.$refs.AccountForm.validate((valid) => {
         if (valid) {
           let params = {
@@ -557,6 +575,7 @@ export default {
             nickName: this.AccountForm.nickName,
             roleId: this.AccountForm.role,
             password: this.AccountForm.newPassword,
+            correspondIds: this.AccountForm.correspondIds,
           }
           if(this.roleObj.type === 0) {
             params.adminWebsitIds = this.$refs.tree.getCheckedKeys();