Browse Source

中心店/配送店用户授权

chenrui 4 years ago
parent
commit
3f7dc93b25

+ 2 - 2
src/views/power/user/userList.vue

@@ -53,14 +53,14 @@
         <a-icon
           type="unlock"
           title="重置密码"
-          v-if="record.loginFlag==1 && $hasPermissions('B_powerMD_user_restPwd')"
+          v-if="record.loginFlag==1 && record.ownerOrgFlag==1 && $hasPermissions('B_powerMD_user_restPwd')"
           :style="{fontSize: '20px',color:' #ffaa00',padding: '0 10px'}"
           @click="resetPassword(record)" />
         <a-icon
           type="delete"
           title="删除"
           :style="{fontSize: '20px',color: '#f00',padding: '0 10px'}"
-          v-if="record.loginFlag==0 && $hasPermissions('B_powerMD_user_del')"
+          v-if="record.loginFlag==0 && record.ownerOrgFlag==1 && $hasPermissions('B_powerMD_user_del')"
           @click="delect(record)"/>
       </span>
     </s-table>

+ 1 - 1
src/views/storeManagement/bind/editModal.vue

@@ -22,7 +22,7 @@
           <orgList ref="orgList" :disabled="itemSn?itemSn:''" @change="orgChange" />
         </a-form-model-item>
         <a-form-model-item label="选择配送店" prop="childSnList">
-          <orgMultipleList ref="orgMultipleList" :disabled="itemSn?'':form.orgSn" @change="orgMultipleChange" />
+          <orgMultipleList ref="orgMultipleList" :disabled="itemSn?itemSn:form.orgSn" @change="orgMultipleChange" />
         </a-form-model-item>
       </a-form-model>
       <div class="btn-cont">

+ 1 - 1
src/views/storeManagement/bind/orgMultipleList.vue

@@ -8,7 +8,7 @@
     :filter-option="false"
     :not-found-content="fetching ? undefined : null"
     mode="multiple"
-    :disabled="disabled?true:false"
+    :disabled="!disabled?true:false"
     @search="fetchUser"
     @change="handleChange"
     allowClear

+ 14 - 19
src/views/storeManagement/userAuthorization/editModal.vue

@@ -24,6 +24,7 @@
             id="productInfoList-ownerOrgSn"
             allowClear
             v-model="form.ownerOrgSn"
+            :disabled="itemSn?true:false"
             :showSearch="true"
             option-filter-prop="children"
             :filter-option="filterOption"
@@ -37,10 +38,11 @@
             id="productInfoList-userSn"
             allowClear
             v-model="form.userSn"
+            :disabled="itemSn?true:false"
             :showSearch="true"
             option-filter-prop="children"
             :filter-option="filterOption">
-            <a-select-option v-for="item in userList" :key="item.sn" :value="item.sn">{{ item.name }}</a-select-option>
+            <a-select-option v-for="item in userList" :key="item.sn" :value="item.sn" :disabled="item.status=='0'">{{ item.name }} - {{ item.loginName }}</a-select-option>
           </a-select>
         </a-form-model-item>
         <a-form-model-item label="选择配送店" prop="orgSnList">
@@ -66,12 +68,10 @@
 </template>
 
 <script>
-import { STable } from '@/components'
-import { jxsorgRelationSave, jxsorgRelationDetail, jxsorgRelationQueryList } from '@/api/jxsorg'
+import { jxsorgRelationDetail, jxsorgRelationQueryList } from '@/api/jxsorg'
 import { userOrgUserList, userOrgDetail, userOrgSave } from '@/api/userOrg'
 export default {
-  name: 'BindEditModal',
-  components: { STable },
+  name: 'UserAuthEditModal',
   props: {
     openModal: { //  弹框显示状态
       type: Boolean,
@@ -120,22 +120,16 @@ export default {
       const _this = this
       userOrgDetail({ sn: this.itemSn }).then(res => {
         if (res.status == 200) {
-          if (res.data.orgName) {
-            _this.$refs.orgList.fetchUser(res.data.orgName)
-            setTimeout(() => {
-              _this.$refs.orgList.dealerName = res.data.orgSn
-            }, 1000)
-          }
-          _this.form.orgSn = res.data.orgSn || undefined
-          const childSnList = []
-          if (res.data.childList) {
-            res.data.childList.map(item => {
-              childSnList.push(item.sn)
+          _this.form.ownerOrgSn = res.data.ownerOrgSn
+          _this.getUserList()
+          _this.getChildList()
+          _this.form.userSn = res.data.userSn
+          _this.form.orgSnList = []
+          if (res.data.orgList) {
+            res.data.orgList.map(item => {
+              _this.form.orgSnList.push(item.sn)
             })
           }
-          _this.form.childSnList = childSnList
-          _this.$refs.orgMultipleList.setData(childSnList)
-          _this.$refs.orgMultipleList.dealerName = childSnList
         }
       })
     },
@@ -204,6 +198,7 @@ export default {
       if (!newValue) {
         this.$emit('close')
         this.$refs.ruleForm.resetFields()
+        this.form.orgSnList = []
         this.orgList = []
         this.userList = []
         this.childList = []

+ 13 - 13
src/views/storeManagement/userAuthorization/list.vue

@@ -6,17 +6,17 @@
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
             <a-form-item label="中心店名称">
-              <a-input id="userAuthList-orgName" v-model.trim="queryParam.orgName" allowClear placeholder="请输入中心店名称"/>
+              <a-input id="userAuthList-ownerOrgName" v-model.trim="queryParam.ownerOrgName" allowClear placeholder="请输入中心店名称"/>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="中心店授权账号">
-              <a-input id="userAuthList-orgName" v-model.trim="queryParam.orgName" allowClear placeholder="请输入中心店授权账号"/>
+              <a-input id="userAuthList-userQueryWord" v-model.trim="queryParam.userQueryWord" allowClear placeholder="请输入中心店授权账号"/>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="配送店名称">
-              <a-input id="userAuthList-childName" v-model.trim="queryParam.childName" allowClear placeholder="请输入配送店名称"/>
+              <a-input id="userAuthList-orgName" v-model.trim="queryParam.orgName" allowClear placeholder="请输入配送店名称"/>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -35,7 +35,7 @@
       class="sTable"
       ref="table"
       size="default"
-      :rowKey="(record) => record.orgSn"
+      :rowKey="(record) => record.userSn"
       :columns="columns"
       :data="loadData"
       :scroll="{ y: tableHeight }"
@@ -61,7 +61,7 @@
       </template>
     </s-table>
     <!-- 新增/编辑 -->
-    <storeManagement-user-auth-edit-modal :openModal="openModal" :nowData="nowData" :itemSn="itemSn" @ok="$refs.table.refresh(true)" @close="closeModal" />
+    <storeManagement-user-auth-edit-modal :openModal="openModal" :itemSn="itemSn" @ok="$refs.table.refresh(true)" @close="closeModal" />
   </a-card>
 </template>
 
@@ -74,15 +74,16 @@ export default {
   data () {
     return {
       queryParam: { //  查询条件
-        orgName: '',
-        childName: ''
+        ownerOrgName: '',
+        userQueryWord: '',
+        orgName: ''
       },
       tableHeight: 0,
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '中心店名称', dataIndex: 'user.name', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '中心店授权账号', dataIndex: 'user.loginName', scopedSlots: { customRender: 'loginName' }, width: 200, align: 'center' },
+        { title: '中心店名称', dataIndex: 'ownerOrgName', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '中心店授权账号', scopedSlots: { customRender: 'loginName' }, width: 200, align: 'center' },
         { title: '已绑配送店', dataIndex: 'userAllOrgName', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 150, align: 'center' }
       ],
@@ -103,21 +104,20 @@ export default {
         })
       },
       openModal: false, //  新增编辑  弹框
-      itemSn: '', //  当前sn
-      nowData: null //  当前记录数据
+      itemSn: '' //  当前sn
     }
   },
   methods: {
     //  重置
     resetSearchForm () {
+      this.queryParam.ownerOrgName = ''
+      this.queryParam.userQueryWord = ''
       this.queryParam.orgName = ''
-      this.queryParam.childName = ''
       this.$refs.table.refresh(true)
     },
     //  新增/编辑
     handleEdit (row) {
       this.itemSn = row ? row.userSn : null
-      this.nowData = row || null
       this.openModal = true
     },
     //  关闭弹框