chenrui 4 лет назад
Родитель
Сommit
b55bfdc13f

+ 10 - 42
src/views/power/user/userList.vue

@@ -34,6 +34,7 @@
       rowKey="id"
       :columns="columns"
       :data="loadData"
+      :scroll="{ x: 1360 }"
       style="word-break: break-all;"
       bordered
     >
@@ -88,48 +89,15 @@ export default {
       itemData: {}, // 编辑行数据
       // 表头
       columns: [
-        {
-          title: '序号',
-          dataIndex: 'no',
-          width: 60,
-          align: 'center'
-        },
-        {
-		  title: '创建时间',
-          dataIndex: 'createDate',
-          width: 150,
-          align: 'center'
-        },
-        {
-          title: '用户名称',
-          dataIndex: 'name',
-          width: 150,
-          align: 'center'
-        },
-        {
-          title: '手机号码',
-          dataIndex: 'phone',
-          width: 150,
-          align: 'center'
-        },
-        {
-          title: '角色',
-          width: 200,
-          align: 'center',
-          dataIndex: 'roleNames'
-        },
-        {
-          title: '状态',
-          width: 150,
-          align: 'center',
-          scopedSlots: { customRender: 'status' }
-        },
-        {
-          title: '操作',
-          width: 150,
-          align: 'center',
-          scopedSlots: { customRender: 'action' }
-        }
+        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '来源', dataIndex: 'org.name', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '用户名称', dataIndex: 'name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '手机号码', dataIndex: 'phone', width: 150, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '用户账号', dataIndex: 'loginName', width: 150, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '角色', width: 200, align: 'center', dataIndex: 'roleNames', customRender: function (text) { return text || '--' } },
+        { title: '状态', width: 100, align: 'center', scopedSlots: { customRender: 'status' }, fixed: 'right' },
+        { title: '操作', width: 120, align: 'center', scopedSlots: { customRender: 'action' }, fixed: 'right' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {

+ 2 - 3
src/views/power/user/userModal.vue

@@ -63,7 +63,6 @@
                     rules: [{ required: true, message: '请选择性别!' }] },
                 ]"
                 allowClear ></v-select>
-
             </a-form-item>
           </a-col>
           <!-- 状态 -->
@@ -175,7 +174,7 @@ export default {
         loginFlag: '', // 活动状态
         phone: '',
         loginName: '',
-        sex: '',
+        sex: undefined,
         remarks: ''
       }
     }
@@ -212,7 +211,7 @@ export default {
       this.formData.loginFlag = ''
       this.formData.phone = ''
       this.formData.loginName = ''
-      this.formData.sex = ''
+      this.formData.sex = undefined
       this.formData.remarks = ''
     },
     // 获取角色列表接口

+ 20 - 20
src/views/storeManagement/userAuthorization/editModal.vue

@@ -118,26 +118,26 @@ export default {
     //  详情
     getDetail () {
       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.childSnList = childSnList
-      //     _this.$refs.orgMultipleList.setData(childSnList)
-      //     _this.$refs.orgMultipleList.dealerName = childSnList
-      //   }
-      // })
+      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.childSnList = childSnList
+          _this.$refs.orgMultipleList.setData(childSnList)
+          _this.$refs.orgMultipleList.dealerName = childSnList
+        }
+      })
     },
     //  保存
     handleSave () {

+ 10 - 6
src/views/storeManagement/userAuthorization/list.vue

@@ -40,6 +40,10 @@
       :data="loadData"
       :scroll="{ y: tableHeight }"
       bordered>
+      <!-- 授权账号 -->
+      <template slot="loginName" slot-scope="text, record">
+        <span>{{ record.user.name || '' }} - {{ record.user.loginName || '' }}</span>
+      </template>
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
         <a-button
@@ -77,10 +81,10 @@ export default {
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '中心店名称', dataIndex: 'orgName', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '中心店授权账号', dataIndex: 'allChildsName', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '已绑配送店', dataIndex: 'allChildName', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, 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: 'userAllOrgName', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 150, align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -112,7 +116,7 @@ export default {
     },
     //  新增/编辑
     handleEdit (row) {
-      this.itemSn = row ? row.orgSn : null
+      this.itemSn = row ? row.userSn : null
       this.nowData = row || null
       this.openModal = true
     },
@@ -130,7 +134,7 @@ export default {
         centered: true,
         onOk () {
           userOrgDel({
-            sn: row.orgSn
+            sn: row.userSn
           }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)