zhangdan 4 éve
szülő
commit
d102d009dc

+ 0 - 6
src/views/businessManage/userManage/userManage.vue

@@ -109,12 +109,6 @@ import {
   VSelect
 } from '@/components'
 import userModal from './userModal.vue'
-// import {
-//   resetPSD,
-//   updateEnableStatus,
-//   getPowerUserList,
-//   delectUserPower
-// } from '@/api/power-user.js'
 import { sellerList, resetPSD, updateEnableStatus, getPowerUserList, delectUserPower } from '@/api/userManage.js'
 export default {
   name: 'UserManage',

+ 4 - 5
src/views/businessManage/userManage/userModal.vue

@@ -250,12 +250,11 @@ export default {
 	      if (res.status == 200) {
 			  console.log(res, '-------------返回数据')
 	        this.form.setFieldsValue({ 'formData': res.data })
-          // this.formData.loginFlag = Number(this.formData.loginFlag)
-          // formData.loginFlag = formData.loginFlag + '' === '1'
+	        this.form.setFieldsValue({ 'formData.loginFlag': Number(res.data.loginFlag) })
 	        // this.form.setFieldsValue({ 'formData.name': res.data.name })
-	        // this.form.setFieldsValue({ 'formData.contactName': res.data.contactName })
-	        // this.form.setFieldsValue({ 'formData.simpleName': res.data.simpleName })
-	        // this.form.setFieldsValue({ 'formData.contactPhone': res.data.contactPhone })
+	        // this.form.setFieldsValue({ 'formData.phone': res.data.phone })
+	        // this.form.setFieldsValue({ 'formData.sex': res.data.sex })
+	        // this.form.setFieldsValue({ 'formData.org.name': res.data.org.name })
 	        // this.form.setFieldsValue({ 'formData.remarks': res.data.remarks })
 	      }
 	    })

+ 2 - 17
src/views/userInfo/editLdNumModal.vue

@@ -26,7 +26,7 @@
             :min="0"
             :max="999999"
             :precision="0"
-            v-decorator="[ 'formData.changeNum', { initialValue: formData.changeNum, rules: [{ required: true, message: '请输入商品价格(0~999999)' }] } ]"
+            v-decorator="[ 'formData.changeNum', { initialValue: formData.changeNum, rules: [{ required: true, message: '请输入乐豆变动量(0~999999)' }] } ]"
             placeholder="请输入乐豆变动量(0~999999)"
             allowClear />
           <span class="inp-unit">乐豆</span>
@@ -35,7 +35,7 @@
           <v-select
             v-decorator="[
               'formData.operateType',
-              { initialValue: formData.operateType, rules: [{ required: true, message: '请输入负责人手机号!' },] }
+              { initialValue: formData.operateType, rules: [{ required: true, message: '请输入修改原因!' },] }
             ]"
             id="editLdNumModal-operateType"
             code="GOLD_OPERATE_TYPE"
@@ -80,12 +80,6 @@ export default {
       type: String,
       default: ''
     }
-    //  itemData: {
-	  // type: Object,
-	  // default: function () {
-	  //   return {}
-	  // }
-    //  }
   },
   data () {
     return {
@@ -134,15 +128,6 @@ export default {
    	  this.form.resetFields()
       }
     }
-    // customerNo (newValue, oldValue) {
-    //   console.log(newValue, '----------id')
-    //   if (newValue && this.isShow) {
-    //     this.titleText = '编辑'
-    //     this.getPageInfo(newValue)
-    //   } else {
-   	//   this.titleText = '新增'
-    //   }
-    // }
   }
 }
 </script>

+ 201 - 136
src/views/userInfo/userManageList.vue

@@ -1,7 +1,7 @@
 <template>
   <a-card :bordered="false" class="shopOrder-table-page-search-wrapper">
     <div class="shopOrder-searchForm">
-      <a-form layout="inline" v-bind="formItemLayout" @keyup.enter.native="$refs.table.refresh(true)">
+      <a-form layout="inline" v-bind="formItemLayout" @keyup.enter.native="refresh">
         <a-row :gutter="48">
           <a-col :span="6">
             <a-form-item label="用户手机" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
@@ -11,32 +11,23 @@
           <a-col :span="6">
             <a-form-item label="乐豆余额" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
               <div class="input-number">
-                <a-input-number
-                  id="releaseRecordList-inputNumber"
-                  v-model="queryParam.value1"
-                  :min="1"
-                  @change="onChange" />-<a-input-number
-                    id="inputNumber"
-                    v-model="queryParam.value2"
-                    :min="1"
-                    @change="onChange"
-                  />
+                <a-input-number id="releaseRecordList-inputNumber" v-model="queryParam.currentGoldMin" :min="1" @change="onChange" />-
+                <a-input-number id="inputNumber" v-model="queryParam.currentGoldMax" :min="1" @change="onChange" />
               </div>
             </a-form-item>
           </a-col>
           <a-col :span="6">
             <a-form-item label="账户状态" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
               <v-select
-                v-model="queryParam.orderStatus"
-                ref="orderStatus"
-                id="releaseRecordList-status"
-                code="SETTLE_STATUS_ALL"
+                v-model="queryParam.state"
+                id="releaseRecordList-state"
+                code="ENABLE_FLAG"
                 placeholder="请选择订单状态"
                 allowClear></v-select>
             </a-form-item>
           </a-col>
           <a-col :span="6">
-            <a-button class="handle-btn serach-btn" id="releaseRecordList-btn-serach" type="primary" @click="$refs.table.refresh(true)">查询</a-button>
+            <a-button class="handle-btn serach-btn" id="releaseRecordList-btn-serach" type="primary" @click="refresh">查询</a-button>
             <a-button class="handle-btn" type="" id="releaseRecordList-btn-reset" @click="handleReset">重置</a-button>
           </a-col>
         </a-row>
@@ -73,74 +64,124 @@
 </template>
 
 <script>
-import { STable, VSelect } from '@/components'
-import { customerList, changeStatus, customeExport } from '@/api/userInfo.js'
+import {
+  STable,
+  VSelect
+} from '@/components'
+import {
+  customerList,
+  changeStatus,
+  customeExport
+} from '@/api/userInfo.js'
 export default {
   name: 'UserManageList',
-  components: { STable, VSelect },
+  components: {
+    STable,
+    VSelect
+  },
   data () {
     return {
       formItemLayout: {
-        labelCol: { span: 7 },
-        wrapperCol: { span: 17 }
+        labelCol: {
+          span: 7
+        },
+        wrapperCol: {
+          span: 17
+        }
       },
       // 查询参数
       queryParam: {
         mobile: '', //  用户手机
-        orderStatus: null, // 订单状态
-        value1: '',
-        value2: ''
+        state: '', // 账户状态
+        currentGoldMin: '', // 乐豆余额最小值
+        currentGoldMax: '' // 乐豆余额最大值
       },
       loading: false, // 导出loading
       // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '用户手机', dataIndex: 'mobile', width: 100, align: 'center' },
-        { title: '乐豆余额', dataIndex: 'currentGold', width: 100, align: 'center' },
-        { title: '累计乐豆', dataIndex: 'totalCarbon', width: 100, align: 'center' },
-        { title: '注册时间', dataIndex: 'registerTime', width: 200, align: 'center' },
-        { title: '最后登录时间', dataIndex: 'lastLoginTime', width: 200, align: 'center' },
-        { title: '最后投递时间', dataIndex: 'lastDeliveryTime', width: 200, align: 'center' },
-        { title: '状态', width: 100, dataIndex: 'state', align: 'center', scopedSlots: { customRender: 'state' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center' }
+      columns: [{
+        title: '序号',
+        dataIndex: 'no',
+        width: 80,
+        align: 'center'
+      },
+      {
+        title: '用户手机',
+        dataIndex: 'mobile',
+        width: 100,
+        align: 'center'
+      },
+      {
+        title: '乐豆余额',
+        dataIndex: 'currentGold',
+        width: 100,
+        align: 'center'
+      },
+      {
+        title: '累计乐豆',
+        dataIndex: 'totalCarbon',
+        width: 100,
+        align: 'center'
+      },
+      {
+        title: '注册时间',
+        dataIndex: 'registerTime',
+        width: 200,
+        align: 'center'
+      },
+      {
+        title: '最后登录时间',
+        dataIndex: 'lastLoginTime',
+        width: 200,
+        align: 'center'
+      },
+      {
+        title: '最后投递时间',
+        dataIndex: 'lastDeliveryTime',
+        width: 200,
+        align: 'center'
+      },
+      {
+        title: '状态',
+        width: 100,
+        dataIndex: 'state',
+        align: 'center',
+        scopedSlots: {
+          customRender: 'state'
+        }
+      },
+      {
+        title: '操作',
+        scopedSlots: {
+          customRender: 'action'
+        },
+        width: 100,
+        align: 'center'
+      }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
-        //     if ((this.queryParam.value1 && this.queryParam.value2) && (this.queryParam.value1 >= this.queryParam.value2)) {
-        //       this.$message.error('请输入正确的查询范围!')
-		  // return
-        //     } else if (!this.queryParam.value1 || !this.queryParam.value2) {
-        //       this.$message.error('请输入正确的查询范围!')
-		  // return
-        //     }
-        //     if (this.queryParam.value1 && this.queryParam.value2) {
-        //       if (this.queryParam.value1 >= this.queryParam.value2) {
-        //         this.$message.error('请输入正确的查询范围!')
-        //       }
-		  // return
-        //     }
-        // return customerList(Object.assign(parameter, this.queryParam)).then(res => {
-        //   if (res.status == 200) {
-        //     const no = (res.data.pageNo - 1) * res.data.pageSize
-        //     for (let i = 0; i < res.data.list.length; i++) {
-        //       const _item = res.data.list[i]
-        //       _item.no = no + i + 1
-        //       _item.status = _item.status + '' === '1'
-        //     }
-        //     return res.data
-        //   }
-        // })
-        return customerList({ pageNo: '1', pageSize: '10' }).then(res => {
-		  if (res.status == 200) {
-		    const no = (res.data.pageNo - 1) * res.data.pageSize
-		    for (let i = 0; i < res.data.list.length; i++) {
-		      const _item = res.data.list[i]
-		      _item.no = no + i + 1
-		      _item.status = _item.status + '' === '1'
-		    }
-		    return res.data
-		  }
+        return customerList(Object.assign(parameter, this.queryParam)).then(res => {
+          if (res.status == 200) {
+            const no = (res.data.pageNo - 1) * res.data.pageSize
+            for (let i = 0; i < res.data.list.length; i++) {
+              const _item = res.data.list[i]
+              _item.no = no + i + 1
+              _item.status = _item.status + '' === '1'
+            }
+            return res.data
+          }
         })
+        //     return customerList({ pageNo: '1', pageSize: '10' }).then(res => {
+        // if (res.status == 200) {
+        //   const no = (res.data.pageNo - 1) * res.data.pageSize
+        //   for (let i = 0; i < res.data.list.length; i++) {
+        //     const _item = res.data.list[i]
+        //     _item.no = no + i + 1
+        //     _item.status = _item.status + '' === '1'
+        //   }
+        //   return res.data
+        // }
+        //     })
       }
     }
   },
@@ -150,46 +191,58 @@ export default {
     })
   },
   methods: {
-	  // 查询条件change
-	  onChange () {},
+    // 查询条件change
+    onChange () {
+
+    },
+    refresh () {
+      if ((this.queryParam.currentGoldMin && this.queryParam.currentGoldMax) && (this.queryParam.currentGoldMin >= this.queryParam
+        .currentGoldMax)) {
+        this.$message.error('请输入正确的查询范围!')
+        return
+      }
+	  if (!this.queryParam.currentGoldMin || !this.queryParam.currentGoldMax) {
+        this.$message.error('请输入正确的查询范围!')
+        return
+	  }
+      this.$refs.table.refresh()
+    },
     // 查看用户详情
     handleUser (row) {
-      this.$router.push({ path: `/userInfo/userManageList_user/detail/${row.id}` })
+      this.$router.push({
+        path: `/userInfo/userManageList_user/detail/${row.id}`
+      })
     },
     // 查看乐豆详情
     handleLd (row) {
-      this.$router.push({ path: `/userInfo/userManageList_Ld/detail/${row.customerNo}` })
+      this.$router.push({
+        path: `/userInfo/userManageList_Ld/detail/${row.customerNo}`
+      })
     },
     // 启用禁用
     // 更改启用禁用状态
     changeFlagHandle (text, record) {
-	  console.log(text)
-	  const _this = this
-	  const _data = {
-		  id: record.id,
-		  state: record.state == 1 ? '0' : '1'
-	  }
-	    changeStatus(_data).then(res => {
-		  if (res.status == 200) {
-	        _this.$message.success(res.message)
-	        _this.$refs.table.refresh()
-		  } else {
-	        record.state = !record.state
-		  }
-	    })
+      console.log(text)
+      const _this = this
+      const _data = {
+        id: record.id,
+        state: record.state == 1 ? '0' : '1'
+      }
+      changeStatus(_data).then(res => {
+        if (res.status == 200) {
+          _this.$message.success(res.message)
+          _this.$refs.table.refresh()
+        } else {
+          record.state = !record.state
+        }
+      })
     },
     // 重置
     handleReset () {
-      // this.queryParam.beginDate = getDate.getToday().starttime
-      // this.queryParam.endDate = getDate.getToday().endtime
-      // this.time = [
-      //   moment(getDate.getToday().starttime, this.dateFormat),
-      //   moment(getDate.getToday().endtime, this.dateFormat)
-      // ]
       this.queryParam.contactPhone = ''
-      this.queryParam.value1 = ''
-	  this.queryParam.value2 = ''
-      this.queryParam.orderStatus = null
+      this.queryParam.currentGoldMin = ''
+      this.queryParam.currentGoldMax = ''
+      this.queryParam.state = ''
       this.$refs.table.refresh(true)
     },
     // 导出
@@ -199,14 +252,16 @@ export default {
         orderNo: this.queryParam.orderNo,
         orderStatus: this.queryParam.orderStatus
       }
-	  this.loading = true
+      this.loading = true
       customeExport(params).then(res => {
         this.loading = false
         this.download(res)
       })
     },
     download (data) {
-      if (!data) { return }
+      if (!data) {
+        return
+      }
       const url = window.URL.createObjectURL(new Blob([data]))
       const link = document.createElement('a')
       link.style.display = 'none'
@@ -221,43 +276,53 @@ export default {
 }
 </script>
 <style lang="less" scoped>
-  .shopOrder-table-page-search-wrapper{
-    .shopOrder-searchForm{
-      .ant-form-inline .ant-form-item{
-        width: 100%;
-      }
-      // 搜索框的下间距
-      .ant-form-item {
-      	margin-bottom: 10px;
-      }
-	  .input-number{
-		  display: flex;
-		  margin-top:3px;
-	  }
-      .handle-btn{
-        margin-top: 4px;
-      }
-      .serach-btn{
-        margin-right: 10px;
-      }
-    }
-    .export-btn{
-      background-color: #ff9900;
-      border-color: #ff9900;
-      color: #fff;
-    }
-    .export-btn.ant-btn:focus:not(.ant-btn-primary):not(.ant-btn-danger), .export-btn.ant-btn:hover:not(.ant-btn-primary):not(.ant-btn-danger){
-      color: #fff;
-      border-color: #ff9900;
-    }
-    .blue {
-    	color: #1890FF;
-    }
-    .green {
-    	color: #16b50e;
-    }
-    .red {
-    	color: red;
-    }
-  }
+	.shopOrder-table-page-search-wrapper {
+		.shopOrder-searchForm {
+			.ant-form-inline .ant-form-item {
+				width: 100%;
+			}
+
+			// 搜索框的下间距
+			.ant-form-item {
+				margin-bottom: 10px;
+			}
+
+			.input-number {
+				display: flex;
+				margin-top: 3px;
+			}
+
+			.handle-btn {
+				margin-top: 4px;
+			}
+
+			.serach-btn {
+				margin-right: 10px;
+			}
+		}
+
+		.export-btn {
+			background-color: #ff9900;
+			border-color: #ff9900;
+			color: #fff;
+		}
+
+		.export-btn.ant-btn:focus:not(.ant-btn-primary):not(.ant-btn-danger),
+		.export-btn.ant-btn:hover:not(.ant-btn-primary):not(.ant-btn-danger) {
+			color: #fff;
+			border-color: #ff9900;
+		}
+
+		.blue {
+			color: #1890FF;
+		}
+
+		.green {
+			color: #16b50e;
+		}
+
+		.red {
+			color: red;
+		}
+	}
 </style>