Parcourir la source

修改用户身份接口对接

zhangdan il y a 4 ans
Parent
commit
3ee78be6de

+ 9 - 0
src/api/userInfo.js

@@ -71,3 +71,12 @@ export const updateMobile = (params) => {
     method: 'post'
   })
 }
+
+// 修改用户身份
+export const updateRole = (params) => {
+  return axios({
+    url: `customer/updateRole`,
+    data: params,
+    method: 'post'
+  })
+}

+ 11 - 8
src/views/releaseRecord/releaseRecordList.vue

@@ -20,8 +20,8 @@
             </a-form-item>
           </a-col>
           <a-col :span="5">
-            <a-form-item label="投类型" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-              <v-select code="RUBBISH_TYPE" v-model="queryParam.rubbishType" allowClear placeholder="请选择投类型" id="releaseRecordList-rubbishType"></v-select>
+            <a-form-item label="投类型" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
+              <v-select code="RUBBISH_TYPE" v-model="queryParam.rubbishType" allowClear placeholder="请选择投类型" id="releaseRecordList-rubbishType"></v-select>
             </a-form-item>
           </a-col>
           <a-col :span="5">
@@ -61,8 +61,8 @@
             </a-form-item>
           </a-col>
           <a-col :span="5">
-            <a-form-item label="投方式" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-              <v-select code="ENABLE_FLAG" v-model="queryParam.loginFlag" allowClear placeholder="请选择投递方式" id="releaseRecordList-loginFlag"></v-select>
+            <a-form-item label="投方式" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
+              <v-select code="DELIVERY_WAY" v-model="queryParam.deliveryWay" allowClear placeholder="请选择投放方式" id="releaseRecordList-deliveryWay"></v-select>
             </a-form-item>
           </a-col>
           <a-col :span="5">
@@ -156,6 +156,7 @@ export default {
         srcDeviceCode: '', //  设备编号
         stationNo: undefined, // 网点名称
         rubbishType: '', // 投放类型
+        deliveryWay: '', // 投放方式
         goldNumStart: null, // 兑换最小值
         goldNumEnd: null, // 兑换最大值
         rubbishWeightStart: null, // 投放重量最小值
@@ -171,7 +172,7 @@ export default {
         { title: '网点名称', dataIndex: 'stationName', width: 200, align: 'center' },
         { title: '设备编号', dataIndex: 'srcDeviceCode', width: 200, align: 'center' },
         { title: '用户账号', dataIndex: 'customerMobile', width: 200, align: 'center' },
-        { title: '投递方式', dataIndex: '', width: 200, align: 'center' },
+        { title: '投放方式', dataIndex: 'deliveryWayDictValue', width: 200, align: 'center' },
         { title: '本次兑换乐豆(个)', dataIndex: 'goldNum', width: 100, align: 'center' },
         { title: '内置各箱体投放重量(g)',
           children: [
@@ -293,7 +294,8 @@ export default {
         goldNumEnd: this.queryParam.goldNumEnd, // 兑换最大值
         rubbishWeightStart: this.queryParam.rubbishWeightStart, // 投放重量最小值
         rubbishWeightEnd: this.queryParam.rubbishWeightEnd,
-        rubbishType: this.queryParam.rubbishType
+        rubbishType: this.queryParam.rubbishType, // 投放类型
+        deliveryWay: this.queryParam.deliveryWay // 投放方式
       }
       if (this.queryOrderDate && this.queryOrderDate.length) {
         params.beginDate = moment(this.queryOrderDate[0]).format('YYYY-MM-DD')
@@ -324,11 +326,12 @@ export default {
       this.queryParam.customerMobile = ''
       this.queryParam.srcDeviceCode = ''
       this.queryParam.stationNo = undefined
-	  this.queryParam.rubbishType = ''
+	  this.queryParam.rubbishType = '' // 投放类型
 	  this.queryParam.goldNumStart = '' // 兑换最小值
 	  this.queryParam.goldNumEnd = '' // 兑换最大值
       this.queryParam.rubbishWeightStart = ''// 投放重量最小值
-	  this.queryParam.rubbishWeightEnd = ''
+	  this.queryParam.rubbishWeightEnd = '' // 投放重量最大值
+	  this.queryParam.deliveryWay = '' // 投放方式
       this.$refs.table.refresh(true)
     }
   }

+ 8 - 8
src/views/userInfo/editUseridentityModal.vue

@@ -10,13 +10,13 @@
       <a-form id="components-form-demo-validate-other" ref="form" :form="form" @submit="handleSubmit">
         <a-form-item label="用户身份" :label-col="{ span: 7 }" :wrapper-col="{ span: 12 }">
           <v-select
-            code="RUBBISH_TYPE"
+            code="CUSTOMER_ROLE"
             allowClear
             placeholder="请选择用户身份"
-            id="releaseRecordList-rubbishType"
+            id="releaseRecordList-customerRole"
             v-decorator="[
-              'formData.rubbishType',
-              { initialValue: formData.rubbishType, rules: [{ required: true, message: '请选择用户身份!' }] }
+              'formData.customerRole',
+              { initialValue: formData.customerRole, rules: [{ required: true, message: '请选择用户身份!' }] }
             ]"></v-select>
         </a-form-item>
         <a-form-item :wrapper-col="{ span: 12, offset: 6}" style="text-align: center;">
@@ -29,7 +29,7 @@
 </template>
 
 <script>
-import { updateMobile } from '@/api/userInfo.js'
+import { updateRole } from '@/api/userInfo.js'
 import { VSelect } from '@/components'
 export default {
   name: 'EditUseridentityModal',
@@ -50,7 +50,7 @@ export default {
       isShow: this.openUseridentityMoadl,
       form: this.$form.createForm(this, { name: 'editUseridentityModal' }),
       formData: {
-        rubbishType: '' // 手机号码
+        customerRole: '' // 用户身份
       }
     }
   },
@@ -62,12 +62,12 @@ export default {
       this.form.validateFields((err, values) => {
         if (!err) {
           const formData = Object.assign({}, { id: this.userId }, this.formData, values.formData)
-          updateMobile(formData).then(res => {
+          updateRole(formData).then(res => {
             console.log(res, 'rrrrrrrrr')
             if (res.status == 200) {
               _this.$message.success(res.message)
               // _this.$emit('refresh')
-   		  _this.$router.push({ path: `/userInfo/userManageList/list` })
+              _this.$router.push({ path: `/userInfo/userManageList/list` })
               setTimeout(function () {
                 _this.isShow = false
               }, 300)

+ 3 - 2
src/views/userInfo/userDetails.vue

@@ -18,7 +18,7 @@
       </a-col>
       <a-col :span="24" class="item-cont">
         <p class="item-label">用户身份:</p>
-        <p class="item-main">{{ page.mobile ? page.mobile : '--' }}</p>
+        <p class="item-main">{{ page.customerRoleDictValue ? page.customerRoleDictValue : '--' }}</p>
         <a-icon
           type="edit"
           title="修改用户身份"
@@ -69,7 +69,7 @@
     <!-- 修改乐豆余额弹窗 -->
     <edit-ldNum-modal :customerNo="customerNo" :openLdNumModal="openLdNumModal" @close="openLdNumModal=false"></edit-ldNum-modal>
     <!-- 修改用户身份 -->
-    <edit-useridentity-modal :openUseridentityMoadl="openUseridentityMoadl" @close="openUseridentityMoadl=false"></edit-useridentity-modal>
+    <edit-useridentity-modal :userId="userId" :openUseridentityMoadl="openUseridentityMoadl" @close="openUseridentityMoadl=false"></edit-useridentity-modal>
   </a-card>
 </template>
 
@@ -111,6 +111,7 @@ export default {
     },
     // 修改用户身份
     editUseridentity (page) {
+      this.userId = this.page.id
       this.openUseridentityMoadl = true
     },
     // 返回列表

+ 9 - 7
src/views/userInfo/userManageList.vue

@@ -29,9 +29,9 @@
           <a-col :span="5">
             <a-form-item label="用户身份" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
               <v-select
-                v-model="queryParam.state"
-                id="releaseRecordList-state"
-                code="ENABLE_FLAG"
+                v-model="queryParam.customerRole"
+                id="releaseRecordList-customerRole"
+                code="CUSTOMER_ROLE"
                 placeholder="请选择用户身份"
                 allowClear></v-select>
             </a-form-item>
@@ -108,6 +108,7 @@ export default {
       queryParam: {
         mobile: '', //  用户手机
         state: '', // 账户状态
+        customerRole: '', // 用户身份
         currentGoldMin: '', // 乐豆余额最小值
         currentGoldMax: '' // 乐豆余额最大值
       },
@@ -127,7 +128,7 @@ export default {
       },
 	  {
 	    title: '用户身份',
-	    dataIndex: 'mobile',
+	    dataIndex: 'customerRoleDictValue',
 	    width: 100,
 	    align: 'center'
 	  },
@@ -216,10 +217,9 @@ export default {
     })
   },
   methods: {
-    // 查询条件change
-    onChange () {
+	  onChange () {
 
-    },
+	  },
     refresh () {
       const isONull = this.queryParam.currentGoldMin === null
       const isOEmpty = this.queryParam.currentGoldMin === ''
@@ -288,12 +288,14 @@ export default {
       this.queryParam.currentGoldMin = ''
       this.queryParam.currentGoldMax = ''
       this.queryParam.state = ''
+      this.queryParam.customerRole = ''
       this.$refs.table.refresh(true)
     },
     // 导出
     handleExport () {
       const params = {
         mobile: this.queryParam.mobile,
+        customerRole: this.queryParam.customerRole,
         currentGoldMin: this.queryParam.currentGoldMin,
         currentGoldMax: this.queryParam.currentGoldMax,
         state: this.queryParam.state = ''