linwenxin před 1 rokem
rodič
revize
9acf8281e4
2 změnil soubory, kde provedl 91 přidání a 7 odebrání
  1. 19 1
      src/api/setting.js
  2. 72 6
      src/views/setting/account.vue

+ 19 - 1
src/api/setting.js

@@ -558,7 +558,7 @@ export function getDetailGongCheng(params) {
 // 删除程经销商子账号
 export function delUserGongCheng(params) {
   return request({
-    url: '/admin//user/user/child/delGongCheng',
+    url: '/admin/user/child/delGongCheng',
     method: 'post',
     params
   })
@@ -572,3 +572,21 @@ export function exportListGongCheng(data, name) {
     name
   })
 }
+
+// 仓库品类选择列表
+export function stockForceUserList(params) {
+  return request({
+    url: '/stock/forceUser/list',
+    method: 'get',
+    params
+  })
+}
+
+// 添加账号强制仓
+export function stockForceUserAdd(data) {
+  return request({
+    url: '/stock/forceUser/add',
+    method: 'post',
+    data
+  })
+}

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

@@ -160,12 +160,16 @@
               }}</el-tag>
             </template>
           </el-table-column>
-          <el-table-column align="center" label="操作" min-width="160">
+          <el-table-column align="center" label="操作" min-width="230">
             <template slot-scope="scope">
+              <el-button
+                type="text"
+                @click="setForcedHold(scope.row)"
+                >设置强制仓</el-button>
               <template v-if="checkBtnRole('status')">
                 <el-popconfirm
                   v-if="scope.row.status"
-                  style="margin-right: 10px"
+                  style="margin: 0px 10px"
                   title="确定冻结吗?"
                   @confirm="changeStatus(scope.row.adminUserId, 0)"
                 >
@@ -173,7 +177,7 @@
                 </el-popconfirm>
                 <el-popconfirm
                   v-else
-                  style="margin-right: 10px"
+                  style="margin: 0px 10px"
                   title="确定恢复吗?"
                   @confirm="changeStatus(scope.row.adminUserId, 1)"
                 >
@@ -404,6 +408,32 @@
         <el-button type="primary" @click="submitResetForm">确 定</el-button>
       </div>
     </el-dialog>
+
+    <!-- 设置强制仓 -->
+    <el-dialog
+      title="设置强制仓"
+      :visible.sync="resetForcedHold"
+      :show-close="false"
+      width="800px"
+      :close-on-click-modal="false"
+    >
+      <el-form ref="resetForm" label-position="left" label-width="100px" size="mini">
+        <template v-for="(item,index) in resetForcedHoldList">
+          <div :key="index">
+            <el-form-item label="" prop="newPassword" label-width="0px" style="margin: 0 !important;">
+              <div>{{item.name}}</div>
+            </el-form-item>
+            <el-form-item label="强制品类" prop="confirmPassword">
+              <el-checkbox v-for="(val,i) in item.kingDeeCategories" :key="i" v-model="val.isChecked">{{val.name}}</el-checkbox>
+            </el-form-item>
+          </div>
+        </template>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="resetForcedHold=false">取 消</el-button>
+        <el-button type="primary" @click="subForcedHold">确 定</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -419,11 +449,13 @@ import {
   getRoleList,
   getMerchantList,
   changeAccountStatus,
-  resetPassword
+  resetPassword,
+  stockForceUserList,
+  stockForceUserAdd
 } from '@/api/setting'
 import { getDealerList, getCategoryList } from '@/api/common'
 import { findElem, downloadFiles, handleImportTwo } from '@/utils/util'
-
+// /stock/forceUser/list
 export default {
   data() {
     var validatePass = (rule, value, callback) => {
@@ -557,7 +589,9 @@ export default {
       groupList: [],
       myID: '',
       passwordType1: 'password',
-      passwordType2: 'password'
+      passwordType2: 'password',
+      resetForcedHold:false,
+      resetForcedHoldList:[]
     }
   },
   computed: {
@@ -587,6 +621,38 @@ export default {
     await this.getRoleList()
   },
   methods: {
+    subForcedHold(){
+      var pams = []
+      this.resetForcedHoldList.map(item=>{
+        item.kingDeeCategories.filter(val=>val.isChecked).map(data=>{
+          pams.push({
+            categoryId:data.id,
+            correspondId:item.id,
+            correspondName:item.name,
+            adminUserId:this.adminUserId_jl
+          })
+        })
+      })
+      this.adminUserId_jl = null
+      stockForceUserAdd({
+        adminUserForceStocks:pams
+      }).then(res=>{
+        this.resetForcedHold = false
+        console.log(res)
+        this.$successMsg('设置成功')
+      })
+    },
+    getForcedHoldList(){
+      this.resetForcedHoldList = []
+      stockForceUserList().then(res=>{
+        this.resetForcedHoldList = res.data
+        this.resetForcedHold = true
+      })
+    },
+    setForcedHold(row){
+      this.adminUserId_jl=row.adminUserId
+      this.getForcedHoldList()
+    },
     // 获取仓库仓位对应关系列表
     async getStockList() {
       const res = await getStockListStock({ pageSize: -1, pageNum: 1 })