zhangdan 4 years ago
parent
commit
8384e96306

+ 9 - 0
src/api/releaseRecord.js

@@ -21,3 +21,12 @@ export const getDeliveryLogTotal = (params) => {
     method: 'post'
   })
 }
+
+// 网点名称
+export const stationList = params => {
+  return axios.request({
+    url: `/station/queryList`,
+    method: 'post',
+    data: {}
+  })
+}

+ 15 - 0
src/api/userInfo.js

@@ -0,0 +1,15 @@
+import { axios } from '@/utils/request'
+
+/* 商品分类 */
+
+// 列表
+export const customerGoldLogDetail = (params) => {
+  const url = `customerGoldLog/query/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}

+ 39 - 7
src/views/releaseRecord/releaseRecordList.vue

@@ -21,13 +21,18 @@
           </a-col>
           <a-col :span="6">
             <a-form-item label="网点名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-              <v-select
-                v-model="queryParam.orderStatus"
-                ref="orderStatus"
-                id="shopOrder-status"
-                code="SETTLE_STATUS_ALL"
+              <a-select
                 placeholder="请选择"
-                allowClear></v-select>
+                allowClear
+                v-model="queryParam.officialPartnerNo"
+                :showSearch="true"
+                option-filter-prop="children"
+                :filter-option="filterOption"
+                @focus="handleFocus"
+                @blur="handleBlur"
+                @change="handleChange">
+                <a-select-option v-for="item in optionData" :key="item.officialPartnerNo" :value="item.officialPartnerNo">{{ item.name }}</a-select-option>
+              </a-select>
             </a-form-item>
           </a-col>
           <a-col :span="6">
@@ -83,7 +88,7 @@
 
 <script>
 import { STable, VSelect } from '@/components'
-import { getDeliveryLogList, getDeliveryLogTotal } from '@/api/releaseRecord.js'
+import { getDeliveryLogList, getDeliveryLogTotal, stationList } from '@/api/releaseRecord.js'
 import moment from 'moment'
 export default {
   components: { STable, VSelect },
@@ -103,6 +108,7 @@ export default {
         srcDeviceCode: '', //  设备编号
         orderStatus: null // 网点名称
       },
+			 optionData: [],
 	  orderTotal: 0,	// 总单数
 	  amountTotal: 0,	// 总金额
       // 表头
@@ -151,6 +157,7 @@ export default {
   beforeRouteEnter (to, from, next) {
     next(vm => {
       vm.handleReset()
+      vm.getStationList()
     })
   },
   methods: {
@@ -166,6 +173,31 @@ export default {
         this.queryParam.endDate = dateStrings[1]
       }
     },
+
+    handleChange (value) {
+		  console.log(`selected ${value}`)
+    },
+    handleBlur () {
+		  console.log('blur')
+    },
+    handleFocus () {
+		  console.log('focus')
+    },
+    filterOption (input, option) {
+		  return (
+		    option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+		  )
+    },
+    // 获取合作商数据
+    getStationList () {
+		  stationList().then(res => {
+			  console.log(res, '-----合作商')
+			  if (res.status == 200) {
+				  this.optionData = res.data || []
+			  }
+		  })
+    },
+
     // 合计
     getListTotal () {
       const params = {

+ 0 - 2
src/views/shopSetting/goodsClass.vue

@@ -218,8 +218,6 @@ export default {
               if (res.status == 200) {
                 _this.$message.success(res.message)
                 _this.$refs.table.refresh()
-              } else {
-                record.state = !record.state
               }
             })
           }

+ 55 - 52
src/views/userInfo/LdDetails.vue

@@ -6,21 +6,21 @@
           <a-col :span="6">
             <a-form-item label="下单时间" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
               <a-range-picker
-                id="shopOrder-time"
-                v-model="time"
-                :format="dateFormat"
-                :placeholder="['开始时间','结束时间']"
+                style="width:100%"
+                id="PaySettlementRecords-queryOrderDate"
                 :disabledDate="disabledDate"
-                @change="onChange" />
+                v-model="queryOrderDate"
+                format="YYYY-MM-DD"
+                :placeholder="['开始时间', '结束时间']" />
             </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"
+                v-model="queryParam.changeType"
+                ref="changeType"
                 id="shopOrder-status"
-                code="SETTLE_STATUS_ALL"
+                code="GOLD_CHANGE_TYPE"
                 placeholder="请选择订单状态"
                 allowClear></v-select>
             </a-form-item>
@@ -28,11 +28,11 @@
           <a-col :span="6">
             <a-form-item label="原因" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
               <v-select
-                v-model="queryParam.orderStatus"
-                ref="orderStatus"
+                v-model="queryParam.operateType"
+                ref="operateType"
                 id="shopOrder-status"
-                code="SETTLE_STATUS_ALL"
-                placeholder="请选择订单状态"
+                code="GOLD_OPERATE_TYPE"
+                placeholder="请选择"
                 allowClear></v-select>
             </a-form-item>
           </a-col>
@@ -50,6 +50,10 @@
       :columns="columns"
       :data="loadData"
       bordered>
+      <!-- 类型 -->
+      <span slot="changeType" slot-scope="text, record">{{ $refs.changeType.getNameByCode(record.changeType) }}</span>
+      <!-- 原因 -->
+      <span slot="operateType" slot-scope="text, record">{{ $refs.operateType.getNameByCode(record.operateType) }}</span>
     </s-table>
   </a-card>
 
@@ -57,7 +61,7 @@
 
 <script>
 import { STable, VSelect } from '@/components'
-import getDate from '@/libs/getDate.js'
+import { customerGoldLogDetail } from '@/api/userInfo.js'
 import moment from 'moment'
 export default {
   name: 'ShopOrder',
@@ -68,6 +72,7 @@ export default {
         labelCol: { span: 7 },
         wrapperCol: { span: 17 }
       },
+	  queryOrderDate: undefined,
       // 查询参数
       queryParam: {
         beginDate: null, // 开始时间
@@ -80,43 +85,46 @@ export default {
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '下单时间', dataIndex: 'orderDate', width: 200, align: 'center' },
-        { title: '类型', dataIndex: 'userMoblie', width: 200, align: 'center' },
-        { title: '原因', dataIndex: 'orderNo', width: 200, align: 'center' },
-        { title: '乐豆变动', scopedSlots: { customRender: 'orderStatus' }, width: 200, align: 'center' },
-        { title: '详情', scopedSlots: { customRender: 'orderPrice' }, width: 200, align: 'center' }
+        { title: '下单时间', dataIndex: 'createDate', width: 200, align: 'center' },
+        { title: '类型', dataIndex: 'changeType', scopedSlots: { customRender: 'changeType' }, width: 200, align: 'center' },
+        { title: '原因', dataIndex: 'operateType', scopedSlots: { customRender: 'operateType' }, width: 200, align: 'center' },
+        { title: '乐豆变动', dataIndex: 'changeNum', width: 200, align: 'center' },
+        { title: '详情', dataIndex: 'remarks', width: 200, align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
-        // return getTenantsList(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 new Promise((resolve) => {
-          const data = [
-            { no: 1, orderDate: '2020-10-30 09:14', userMoblie: '15709252525', orderNo: 'NO54456798', orderStatus: '1', orderPrice: '155' },
-            { no: 2, orderDate: '2020-10-30 09:14', userMoblie: '15709252525', orderNo: 'NO54456798', orderStatus: '0', orderPrice: '155' },
-            { no: 3, orderDate: '2020-10-30 09:14', userMoblie: '15709252525', orderNo: 'NO54456798', orderStatus: '1', orderPrice: '155' },
-            { no: 4, orderDate: '2020-10-30 09:14', userMoblie: '15709252525', orderNo: 'NO54456798', orderStatus: '1', orderPrice: '155' },
-            { no: 5, orderDate: '2020-10-30 09:14', userMoblie: '15709252525', orderNo: 'NO54456798', orderStatus: '0', orderPrice: '155' },
-            { no: 6, orderDate: '2020-10-30 09:14', userMoblie: '15709252525', orderNo: 'NO54456798', orderStatus: '0', orderPrice: '155' }
-          ]
-          resolve(data)
-        })
-      },
+		  return customerGoldLogDetail({ CUSTOMER_NO: 'zq001', 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
+		    }
+		  })
+		  // const searchData = Object.assign(parameter, this.queryParam)
+		  // if (this.queryOrderDate && this.queryOrderDate.length) {
+		  //   searchData.beginDate = moment(this.queryOrderDate[0]).format('YYYY-MM-DD')
+		  //   searchData.endDate = moment(this.queryOrderDate[1]).format('YYYY-MM-DD')
+		  // } else {
+		  //   searchData.beginDate = ''
+		  //   searchData.endDate = ''
+		  // }
+        //         return getTenantsList(searchData).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
+        //           }
+        //         })
+      }
       // 将默认当天时间日期回显在时间选择框中
-      time: [
-        moment(getDate.getToday().starttime, this.dateFormat),
-        moment(getDate.getToday().endtime, this.dateFormat)
-      ],
-      dateFormat: 'YYYY-MM-DD'
     }
   },
   beforeRouteEnter (to, from, next) {
@@ -143,12 +151,7 @@ export default {
     },
     // 重置
     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.queryOrderDate = undefined
       this.queryParam.contactPhone = ''
       this.queryParam.orderNo = ''
       this.queryParam.orderStatus = null

+ 185 - 0
src/views/userInfo/editLdNumModal.vue

@@ -0,0 +1,185 @@
+<template>
+  <div>
+    <!-- 弹窗 -->
+    <a-modal
+      v-model="isShow"
+      @cancle="isShow=false"
+      :footer="null"
+      :centered="true"
+      title="修改乐豆金额">
+      <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 }">
+          <div class="input-number">
+            <v-select
+              style="width: 100px;"
+              v-decorator="[
+                'formData.orderStatus',
+                { initialValue: formData.orderStatus, rules: [{ required: true, message: '请输入负责人手机号!' },] }
+              ]"
+              ref="orderStatus"
+              id="shopOrder-status"
+              code="GOLD_CHANGE_TYPE"
+              placeholder="请选择"
+              allowClear></v-select>
+            <a-input
+              style="width:200px;"
+              id="addSupplierModal-contactPhone"
+              :maxLength="11"
+              v-decorator="[
+                'formData.contactPhone',
+                { initialValue: formData.contactPhone, rules: [{ required: true, message: '请输入负责人手机号!' },] }
+              ]"
+              placeholder="请输入手机号码"
+              allowClear />
+          </div>
+
+        </a-form-item>
+        <a-form-item label="修改原因" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
+          <v-select
+            v-decorator="[
+              'formData.orderStatus',
+              { initialValue: formData.orderStatus, rules: [{ required: true, message: '请输入负责人手机号!' },] }
+            ]"
+            ref="orderStatus"
+            id="shopOrder-status"
+            code="GOLD_OPERATE_TYPE"
+            placeholder="请选择"
+            allowClear></v-select>
+        </a-form-item>
+        <a-form-item label="详情" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
+          <a-textarea
+            id="user-add-remarks"
+            :maxLength="500"
+            v-decorator="[
+              'formData.remarks',
+              {
+                initialValue: formData.remarks,
+                rules: [] },
+            ]"
+            style="min-height: 50px;"
+            placeholder="请输入详情内容(最多500个字符)"
+            autosize />
+        </a-form-item>
+        <a-form-item :wrapper-col="{ span: 12, offset: 6}" style="text-align: center;">
+          <a-button type="primary" html-type="submit" id="addSupplierModal-submit" style="margin-right: 15px">保存</a-button>
+          <a-button @click="isShow=false" style="margin-left: 15px" id="addSupplierModal-close">取消</a-button>
+        </a-form-item>
+      </a-form>
+    </a-modal>
+  </div>
+</template>
+
+<script>
+import { VSelect } from '@/components'
+// import {
+//   supplierDetails,
+//   saveSupplier
+// } from '@/api/shopSetting.js'
+export default {
+  name: 'EditLdNumModal',
+  components: { VSelect },
+  props: {
+    openLdNumModal: {
+      type: Boolean,
+      default: false
+    },
+    userPhone: {
+      type: String,
+      default: ''
+    },
+    itemData: {
+	  type: Object,
+	  default: function () {
+	    return {}
+	  }
+    }
+  },
+  data () {
+    return {
+      isShow: this.openLdNumModal,
+      form: this.$form.createForm(this, { name: 'editLdNumModal' }),
+      formData: {
+        contactPhone: '', // 手机号码
+        orderStatus: '',
+        remarks: ''
+      }
+    }
+  },
+  methods: {
+    // 查看详情
+    // getPageInfo () {
+    //   supplierDetails({
+    //     id: this.itemId
+    //   }).then(res => {
+    //     if (res.status == 200) {
+    //       // this.form.setFieldsValue({ 'formData': res.data })
+    //       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.remarks': res.data.remarks })
+    //     }
+    //   })
+    // },
+    // 点击保存;
+    handleSubmit (e) {
+      // e.preventDefault()
+      // const _this = this
+      // this.form.validateFields((err, values) => {
+      //   if (!err) {
+      //     const formData = Object.assign({}, this.itemData, this.formData, values.formData)
+      //     formData.id = _this.itemId
+      //     saveSupplier(formData).then(res => {
+      //       console.log(res, 'rrrrrrrrr')
+      //       if (res.status == 200) {
+      //         _this.$message.success(res.message)
+      //         _this.$emit('refresh')
+      //         setTimeout(function () {
+      //           _this.isShow = false
+      //         }, 300)
+      //       }
+      //     })
+      //   }
+      // })
+    }
+  },
+  watch: {
+    openLdNumModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    isShow (val) {
+      if (!val) {
+        this.$emit('close')
+      } else {
+   	  this.form.resetFields()
+      }
+    }
+    // itemId (newValue, oldValue) {
+    //   console.log(newValue, '----------id')
+    //   if (newValue && this.isShow) {
+    //     this.titleText = '编辑'
+    //     this.getPageInfo(newValue)
+    //   } else {
+   	//   this.titleText = '新增'
+    //   }
+    // }
+  }
+}
+</script>
+
+<style lang="less">
+	.input-number{
+		display: flex;
+		width: 100%;
+	}
+	.ant-row{
+		.ant-form-item{
+			.ant-col{
+				.ant-form-item-control-wrapper{
+					width: 70%;
+				}
+			}
+		}
+	}
+
+</style>

+ 126 - 0
src/views/userInfo/editUserPhoneModal.vue

@@ -0,0 +1,126 @@
+<template>
+  <div>
+    <!-- 弹窗 -->
+    <a-modal
+      v-model="isShow"
+      @cancle="isShow=false"
+      :footer="null"
+      :centered="true"
+      title="修改手机号码">
+      <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 }">
+          <a-input
+            id="addSupplierModal-contactPhone"
+            :maxLength="11"
+            v-decorator="[
+              'formData.contactPhone',
+              { initialValue: formData.contactPhone, rules: [{ required: true, message: '请输入负责人手机号!' }, { pattern: /^\d{11}$/, message: '请输入正确的手机号' }] }
+            ]"
+            placeholder="请输入手机号码"
+            allowClear />
+        </a-form-item>
+        <a-form-item :wrapper-col="{ span: 12, offset: 6}" style="text-align: center;">
+          <a-button type="primary" html-type="submit" id="addSupplierModal-submit" style="margin-right: 15px">保存</a-button>
+          <a-button @click="isShow=false" style="margin-left: 15px" id="addSupplierModal-close">取消</a-button>
+        </a-form-item>
+      </a-form>
+    </a-modal>
+  </div>
+</template>
+
+<script>
+// import {
+//   supplierDetails,
+//   saveSupplier
+// } from '@/api/shopSetting.js'
+export default {
+  name: 'EditUserPhoneModal',
+  props: {
+    openUserPhoneMoadl: {
+      type: Boolean,
+      default: false
+    },
+    userPhone: {
+      type: String,
+      default: ''
+    },
+    itemData: {
+	  type: Object,
+	  default: function () {
+	    return {}
+	  }
+    }
+  },
+  data () {
+    return {
+      isShow: this.openUserPhoneMoadl,
+      form: this.$form.createForm(this, { name: 'editUserPhoneModal' }),
+      formData: {
+        contactPhone: '' // 手机号码
+      }
+    }
+  },
+  methods: {
+    // 查看详情
+    // getPageInfo () {
+    //   supplierDetails({
+    //     id: this.itemId
+    //   }).then(res => {
+    //     if (res.status == 200) {
+    //       // this.form.setFieldsValue({ 'formData': res.data })
+    //       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.remarks': res.data.remarks })
+    //     }
+    //   })
+    // },
+    // 点击保存;
+    handleSubmit (e) {
+      // e.preventDefault()
+      // const _this = this
+      // this.form.validateFields((err, values) => {
+      //   if (!err) {
+      //     const formData = Object.assign({}, this.itemData, this.formData, values.formData)
+      //     formData.id = _this.itemId
+      //     saveSupplier(formData).then(res => {
+      //       console.log(res, 'rrrrrrrrr')
+      //       if (res.status == 200) {
+      //         _this.$message.success(res.message)
+      //         _this.$emit('refresh')
+      //         setTimeout(function () {
+      //           _this.isShow = false
+      //         }, 300)
+      //       }
+      //     })
+      //   }
+      // })
+    }
+  },
+  watch: {
+    openUserPhoneMoadl (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    isShow (val) {
+      if (!val) {
+        this.$emit('close')
+      } else {
+   	  this.form.resetFields()
+      }
+    }
+    // itemId (newValue, oldValue) {
+    //   console.log(newValue, '----------id')
+    //   if (newValue && this.isShow) {
+    //     this.titleText = '编辑'
+    //     this.getPageInfo(newValue)
+    //   } else {
+   	//   this.titleText = '新增'
+    //   }
+    // }
+  }
+}
+</script>
+
+<style>
+</style>

+ 18 - 20
src/views/userInfo/userDetails.vue

@@ -47,40 +47,38 @@
     <div class="page-header" style="margin-top: 50px; color: #2D8CF0; text-align: center;">
       <a @click="goBack">返回列表</a>
     </div>
+    <!-- 修改用户手机号码弹窗 -->
+    <edit-user-phone-modal :userPhone="userPhone" :openUserPhoneMoadl="openUserPhoneMoadl" @close="openUserPhoneMoadl=false"></edit-user-phone-modal>
+    <!-- 修改乐豆余额弹窗 -->
+    <edit-ldNum-modal :ldNum="ldNum" :openLdNumModal="openLdNumModal" @close="openLdNumModal=false"></edit-ldNum-modal>
   </a-card>
 </template>
 
 <script>
-
+import editUserPhoneModal from './editUserPhoneModal.vue'
+import editLdNumModal from './editLdNumModal.vue'
 export default {
-
+  name: 'UserDetails',
+  components: {
+    editUserPhoneModal, editLdNumModal
+  },
   data () {
     return {
-      formLayout: {
-        labelCol: {
-          xs: {
-            span: 24
-          },
-          sm: {
-            span: 8
-          }
-        },
-        wrapperCol: {
-          xs: {
-            span: 24
-          },
-          sm: {
-            span: 16
-          }
-        }
-      }
+      userPhone: '', // 用户手机号码
+      openUserPhoneMoadl: false, // 默认关闭手机号码弹窗
+	  ldNum: '', // 乐豆余额
+	  openLdNumModal: false // 默认关闭乐豆余额弹窗
     }
   },
   methods: {
 	  editPhone () {
+		  // this.userPhone = record.userPhone
+		  this.openUserPhoneMoadl = true
 		  console.log('-----------修改手机号码')
 	  },
     editLd () {
+      // this.ldNum = record.ldNum
+      this.openLdNumModal = true
       console.log('-----修改乐豆余额')
     },
     // 返回列表