zhengjinyi 5 vuotta sitten
vanhempi
commit
2bde682b08

+ 2 - 2
.env.development

@@ -3,8 +3,8 @@ ENV = 'development'
 
 # base api
 # VUE_APP_BASE_API = '/dev-api'
-# VUE_APP_BASE_API = 'http://192.168.1.22:8108'
-VUE_APP_BASE_API = 'http://127.0.0.1:8108'
+ VUE_APP_BASE_API = 'http://192.168.1.22:8108'
+#VUE_APP_BASE_API = 'http://127.0.0.1:8108'
 
 # vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
 # to control whether the babel-plugin-dynamic-import-node plugin is enabled.

+ 10 - 0
src/api/other.js

@@ -7,6 +7,7 @@ export function getOrganizeInfo(query) {
     params: query
   })
 }
+
 export function updateOrganizeInfo(data) {
   return request({
     url: '/user/update',
@@ -14,3 +15,12 @@ export function updateOrganizeInfo(data) {
     data
   })
 }
+
+export function changePassword(data) {
+  return request({
+    url: '/user/changePassword',
+    method: 'post',
+    data
+  })
+}
+

+ 2 - 0
src/main.js

@@ -20,6 +20,7 @@ import './utils/error-log' // error log
 import * as filters from './filters' // global filters
 
 const organizeID = 1 // 组织ID
+const simplePwd = '123456' // 简单密码
 /**
  * If you don't want to use mock-server
  * you want to use MockJs for mock api
@@ -43,6 +44,7 @@ Object.keys(filters).forEach(key => {
 })
 
 Vue.prototype.organizeID = organizeID
+Vue.prototype.simplePwd = simplePwd
 Vue.config.productionTip = false
 
 new Vue({

+ 1 - 1
src/views/club/list.vue

@@ -78,7 +78,7 @@
           <router-link :to="{path:'/club/editForm',query:{ clubID:row.clubID, userID: row.userID}}">
             <el-button type="primary" size="small">编辑</el-button>
           </router-link>
-          <router-link :to="{path:'/club/operateList',query:{clubID:row.clubID,userID:row.userID}}">
+          <router-link :to="{path:'/club/operateList',query:{name:row.name,clubID:row.clubID,userID:row.userID}}">
             <el-button type="primary" size="small" style="margin:5px 0 0 0;">查看运营人员</el-button>
           </router-link>
           <el-button type="primary" size="small" style="margin:5px 0 0 0;" @click="handleEdit(row)">添加运营人员</el-button>

+ 3 - 1
src/views/club/operateList.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <div class="app-title">当前会所:<span class="span">商城测试演示会所</span> </div>
+    <div class="app-title">当前会所:<span class="span">{{ clubTitle }}</span> </div>
     <el-table
       v-loading="listLoading"
       :data="list"
@@ -113,6 +113,7 @@ export default {
   data() {
     return {
       list: null,
+      clubTitle: this.$route.query.name,
       listLoading: true,
       total: 100,
       dialogVisible: false,
@@ -303,5 +304,6 @@ export default {
   }
   .app-title .span{
       color: #417DE6;
+      margin-left: 15px;
   }
 </style>

+ 15 - 2
src/views/dashboard/admin/components/HotGoods.vue

@@ -1,7 +1,7 @@
 <template>
   <div :class="className" :style="{height:height,width:width}">
     <el-table
-      :data="goodslistData"
+      :data="list"
       element-loading-text="Loading"
       border
       fit
@@ -50,9 +50,22 @@ export default {
       list: null
     }
   },
-  mounted() {
+  watch: {
+    goodslistData: {
+      handler: function(el) { // 监听对象的变换使用 function,箭头函数容易出现this指向不正确
+        console.log(el)
+        this.initGoodList(el)
+      },
+      deep: true
+    }
+  },
+  created() {
+    this.initGoodList(this.goodslistData)
   },
   methods: {
+    initGoodList(data) {
+      this.list = data
+    }
   }
 }
 </script>

+ 11 - 3
src/views/dashboard/admin/components/PieChart.vue

@@ -34,9 +34,17 @@ export default {
       chart: null
     }
   },
+  watch: {
+    orderData: {
+      handler: function(el) { // 监听对象的变换使用 function,箭头函数容易出现this指向不正确
+        this.initChart(el)
+      },
+      deep: true
+    }
+  },
   created() {
     this.$nextTick(() => {
-      this.initChart()
+      this.initChart(this.orderData)
     })
   },
   beforeDestroy() {
@@ -47,7 +55,7 @@ export default {
     this.chart = null
   },
   methods: {
-    initChart() {
+    initChart(data) {
       this.chart = echarts.init(this.$el, 'macarons')
       this.chart.setOption({
         tooltip: {
@@ -70,7 +78,7 @@ export default {
           center: ['50%', '50%'],
           selectedMode: 'single',
           roseType: false,
-          data: this.orderData,
+          data: data,
           label: {
             fontSize: 14,
             color: '#7C8894',

+ 11 - 3
src/views/dashboard/admin/components/RaddarChart.vue

@@ -35,9 +35,17 @@ export default {
       chart: null
     }
   },
+  watch: {
+    receivab: {
+      handler: function(el) { // 监听对象的变换使用 function,箭头函数容易出现this指向不正确
+        this.initChart(el)
+      },
+      deep: true
+    }
+  },
   created() {
     this.$nextTick(() => {
-      this.initChart()
+      this.initChart(this.receivab)
     })
   },
   beforeDestroy() {
@@ -48,7 +56,7 @@ export default {
     this.chart = null
   },
   methods: {
-    initChart() {
+    initChart(data) {
       this.chart = echarts.init(this.$el, 'macarons')
       this.chart.setOption({
         tooltip: {
@@ -71,7 +79,7 @@ export default {
           center: ['50%', '50%'],
           selectedMode: 'single',
           roseType: false,
-          data: this.receivab,
+          data: data,
           label: {
             fontSize: 14,
             color: '#545454',

+ 1 - 0
src/views/dashboard/admin/index.vue

@@ -148,6 +148,7 @@ export default {
         const receob = { name: '已收金额', value: response.data.amountReceived }
         const receob1 = { name: '未收金额', value: response.data.uncollected }
         this.ReceivableData = [receob, receob1]
+        console.log(this.ReceivableData)
       })
     },
     handleGetHomepageOrder() {

+ 117 - 0
src/views/order/logistics.vue

@@ -0,0 +1,117 @@
+<template>
+  <div class="app-container">
+    <div class="app-header-top" style="width: 100%;float: right;margin-bottom: 10px;">
+      <div class="app-title">发货记录</div>
+      <router-link :to="'/order/list/'">
+        <el-button type="primary" icon="el-icon-back" style="float: right;">返回</el-button>
+      </router-link>
+    </div>
+    <el-card class="box-card">
+      <div v-for="(itemData,index) in logisticsInfoVos" :key="index" class="order-item">
+        <el-row :gutter="24" class="box-row">
+          <el-col :span="24"><b>发货时间:</b> 2020-01-01:02:20:00</el-col>
+        </el-row>
+        <el-row v-for="Record in itemData.logisticsRecordList" :key="Record.id" :gutter="22" class="product-row">
+          <el-col :span="2"><img :src="Record.image" width="75" height="75" alt=""></el-col>
+          <el-col :span="22">
+            <el-row style="margin-bottom: 10px;"><b>{{ Record.productName }}</b></el-row>
+            <el-row> 
+              <el-col><div class="op-item"><b>购买数量:</b>{{ Record.buyNum }}</div></el-col>
+              <el-col><div class="op-item"><b>发货数量:</b>{{ Record.num }}</div></el-col>
+            </el-row>
+          </el-col>
+        </el-row>
+        <el-row :gutter="24" class="box-row"><el-col :span="24" style="color:#417DE6;font-weight: bold;">物流详情</el-col></el-row>
+        <div v-for="logistics in itemData.logisticsInformationList" :key="logistics.orderID" :gutter="22" class="product-row" style="padding: 0 12px;background: #fff;">
+          <el-collapse v-model="activeName" accordion>
+            <el-collapse-item :title="'快递公司:'+logistics.logisticsCompanyName+'        物流单号:'+logistics.nu" name="1" style="color: #E68341;">
+              <div></div>
+            </el-collapse-item>
+          </el-collapse>
+        </div>
+      </div>
+    </el-card>
+  </div>
+</template>
+
+<script>
+import { getLogistics } from '@/api/order'
+export default {
+  data() {
+    return {
+      activeName: '1',
+      logisticsInfoVos: [],
+    }
+  },
+  computed: {
+    orderID: function() {
+      return window.location.href.split('/').reverse()[0] * 1
+    }
+  },
+  created() {
+    this.fetchData()
+  },
+  methods: {
+    fetchData() {
+      this.listLoading = true
+      getLogistics({ orderID: this.orderID }).then(response => {
+        this.order = response.data.order
+        this.logisticsInfoVos = response.data
+        this.listLoading = false
+      }).catch(() => {
+        this.listLoading = false
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+  .el-collapse-item__header{
+    color: #E68341 !important;
+    font-size: 16px !important;
+  }
+  .app-title{
+    float: left;
+    line-height: 36px;
+    font-size: 18px;
+    font-weight: bold;
+    color: #999999;
+  }
+  h1{
+    color: #409EFF;
+    font-size: 24px;
+    text-align: center;
+  }
+  h3{
+    color: #409EFF;
+    font-size: 16px;
+    margin: 0;
+  }
+  .box-card{
+    margin-top: 20px;
+    font-size: 14px;
+  }
+  .box-row{
+    padding: 10px 0;
+  }
+  .order-item{
+    border-bottom: 1px solid #DCDFE6;
+    background:#F2F6FC;
+    margin-top: 20px;
+    padding: 5px 15px 15px 15px;
+    border-radius: 5px;
+    &:first-child{
+      margin-top: 0;
+    }
+  }
+  .product-row{
+    padding: 10px 0;
+    background: #EBEEF5;
+    border-top: 1px dashed #DCDFE6;
+  }
+  .op-item{
+    padding: 5px 0;
+  }
+</style>
+

+ 38 - 13
src/views/other/password.vue

@@ -1,43 +1,68 @@
 <template>
   <div class="app-container" style=" width: 400px;margin: 0 auto;padding-top:13%;">
-    <el-form ref="dataForm" :rules="rules" :model="password" label-position="left" label-width="130px">
+    <el-form ref="dataForm" :rules="rules" :model="from" label-position="left" label-width="130px">
       <el-form-item label="旧密码:" prop="oldPassword" style="width: 380px;text-align: right;">
-        <el-input v-model="password.oldPassword" placeholder="请输入旧密码" maxlength="50" />
+        <el-input v-model="from.oldPassword" placeholder="请输入旧密码" maxlength="50" />
       </el-form-item>
-      <el-form-item label="新密码:" prop="newPassword" style="width: 380px; text-align: right;">
-        <el-input v-model="password.newPassword" placeholder="请输入8-16位数字和字母的组合" maxlength="10" />
+      <el-form-item label="新密码:" prop="password" style="width: 380px; text-align: right;">
+        <el-input v-model="from.password" placeholder="请输入8-16位数字和字母的组合" maxlength="10" />
       </el-form-item>
       <el-form-item label="确认新密码:" prop="checkPassword" style="width: 380px; text-align: right;">
-        <el-input v-model="password.checkPassword" placeholder="请输入8-16位数字和字母的组合" maxlength="11" />
+        <el-input v-model="from.checkPassword" placeholder="请输入8-16位数字和字母的组合" maxlength="11" />
       </el-form-item>
     </el-form>
     <div slot="footer" class="dialog-footer" style="width:1px;margin:0 auto;padding:40px 0 80px 0;">
-      <el-button type="primary" style="width: 100px;" @click="onSubmite('dataForm')">保存</el-button>
+      <el-button type="primary" style="width: 100px;" :loading="loadingbut" @click="onSubmite('dataForm')">{{ loadingbuttext }}</el-button>
     </div>
   </div>
 </template>
 
 <script>
+import { changePassword } from '@/api/other'
 export default {
   data() {
     return {
-      password: {
+      loadingbut: false,
+      loadingbuttext: '保存',
+      from: {
         oldPassword: '',
-        newPassword: '',
+        password: '',
         checkPassword: ''
       },
       rules: {
         oldPassword: [{ required: true, message: '请输入旧密码', trigger: 'blur' }],
-        newPassword: [{ required: true, message: '请输入新的密码', trigger: 'blur' }],
+        password: [{ required: true, message: '请输入新的密码', trigger: 'blur' }],
         checkPassword: [{ required: true, message: '请确认新的密码', trigger: 'blur' }]
       }
     }
   },
   methods: {
-    onSubmite(formData) {
-      this.$refs[formData].validate((valid) => {
-        if (!valid) {
-          console.log(this.form)
+    onSubmite() {
+      this.$refs['dataForm'].validate((valid) => {
+        if (valid) {
+          if (this.from.password === this.simplePwd) {
+            this.$message({
+              message: '警告,密码太过简单哦!',
+              type: 'warning'
+            })
+            return
+          }
+          if (this.from.checkPassword !== this.from.password) {
+            this.$message({
+              message: '警告,新密码输入不一致哦!',
+              type: 'warning'
+            })
+            return
+          }
+          const Formobj = { organizeID: this.organizeID }
+          const params = Object.assign(Formobj, this.from)
+          this.loadingbut = true
+          this.loadingbuttext = '保存中...'
+          changePassword(params).then(response => {
+            this.$message({ message: response.msg, type: 'success', center: true })
+            this.loadingbut = false
+            this.loadingbuttext = '保存'
+          })
         }
       })
     }