潘超林 4 months ago
parent
commit
e2c29d4dc5

+ 91 - 0
src/api/system/user.js

@@ -35,3 +35,94 @@ export function delUser(query) {
     params: query
   })
 }
+
+
+// 用户密码重置
+export function resetUserPwd(userId, password) {
+  const data = {
+    userId,
+    password
+  }
+  return request({
+    url: '/system/user/resetPwd',
+    method: 'put',
+    data: data
+  })
+}
+
+// 用户状态修改
+export function changeUserStatus(userId, status) {
+  const data = {
+    userId,
+    status
+  }
+  return request({
+    url: '/system/user/changeStatus',
+    method: 'put',
+    data: data
+  })
+}
+
+// 查询用户个人信息
+export function getUserProfile() {
+  return request({
+    url: '/system/user/profile',
+    method: 'get'
+  })
+}
+
+// 修改用户个人信息
+export function updateUserProfile(data) {
+  return request({
+    url: '/system/user/profile',
+    method: 'put',
+    data: data
+  })
+}
+
+// 用户密码重置
+export function updateUserPwd(oldPassword, newPassword) {
+  const data = {
+    oldPassword,
+    newPassword
+  }
+  return request({
+    url: '/system/user/profile/updatePwd',
+    method: 'put',
+    params: data
+  })
+}
+
+// 用户头像上传
+export function uploadAvatar(data) {
+  return request({
+    url: '/system/user/profile/avatar',
+    method: 'post',
+    data: data
+  })
+}
+
+// 查询授权角色
+export function getAuthRole(userId) {
+  return request({
+    url: '/system/user/authRole/' + userId,
+    method: 'get'
+  })
+}
+
+// 保存授权角色
+export function updateAuthRole(data) {
+  return request({
+    url: '/system/user/authRole',
+    method: 'put',
+    params: data
+  })
+}
+
+// 查询部门下拉树结构
+export function deptTreeSelect() {
+  return request({
+    url: '/system/user/deptTree',
+    method: 'get'
+  })
+}

+ 3 - 3
src/views/manage/active.vue

@@ -74,7 +74,7 @@ a
         <template slot-scope="scope">
           {{
             scope.row.startTime
-              ? $moment(scope.row.startTime).format("YYYY-MM-DD hh:mm:ss")
+              ? $moment(scope.row.startTime).format("YYYY-MM-DD HH:mm:ss")
               : ""
           }}
         </template>
@@ -84,7 +84,7 @@ a
         <template slot-scope="scope">
           {{
             scope.row.endTime
-              ? $moment(scope.row.endTime).format("YYYY-MM-DD hh:mm:ss")
+              ? $moment(scope.row.endTime).format("YYYY-MM-DD HH:mm:ss")
               : ""
           }}
         </template>
@@ -114,7 +114,7 @@ a
         <template slot-scope="scope">
           {{
             scope.row.createTime
-              ? $moment(scope.row.createTime).format("YYYY-MM-DD hh:mm:ss")
+              ? $moment(scope.row.createTime).format("YYYY-MM-DD HH:mm:ss")
               : ""
           }}
         </template>

+ 33 - 35
src/views/manage/order.vue

@@ -301,41 +301,39 @@
       <el-table-column label="运费(元)" align="center" prop="freightFee" />
       <el-table-column label="订单状态" align="center">
         <template slot-scope="scope">
-          <el-tag>
-            {{
-              scope.row.orderStatus == 0
-                ? "待商家确认修改运费"
-                : scope.row.orderStatus == 10
-                ? "等待买家支付"
-                : scope.row.orderStatus == 20
-                ? "等待商家发布货运信息"
-                : scope.row.orderStatus == 90
-                ? "等待司机接单"
-                : scope.row.orderStatus == 100
-                ? "等待司机支付保证金"
-                : scope.row.orderStatus == 110
-                ? "等待司机装货"
-                : scope.row.orderStatus == 120
-                ? "已装货,运输中"
-                : scope.row.orderStatus == 30
-                ? "司机已到达,等待买家签收"
-                : scope.row.orderStatus == 40
-                ? "买家已收货"
-                : scope.row.orderStatus == 50
-                ? "已取消"
-                : scope.row.orderStatus == 60
-                ? "退款中"
-                : scope.row.orderStatus == 70
-                ? "退款成功"
-                : scope.row.orderStatus == 80
-                ? "退款失败"
-                : scope.row.orderStatus == 130
-                ? "待处理售后"
-                : scope.row.orderStatus == 140
-                ? "已处理售后"
-                : ""
-            }}</el-tag
-          >
+          {{
+            scope.row.orderStatus == 0
+              ? "待商家确认修改运费"
+              : scope.row.orderStatus == 10
+              ? "等待买家支付"
+              : scope.row.orderStatus == 20
+              ? "等待商家发布货运信息"
+              : scope.row.orderStatus == 90
+              ? "等待司机接单"
+              : scope.row.orderStatus == 100
+              ? "等待司机支付保证金"
+              : scope.row.orderStatus == 110
+              ? "等待司机装货"
+              : scope.row.orderStatus == 120
+              ? "已装货,运输中"
+              : scope.row.orderStatus == 30
+              ? "司机已到达,等待买家签收"
+              : scope.row.orderStatus == 40
+              ? "买家已收货"
+              : scope.row.orderStatus == 50
+              ? "已取消"
+              : scope.row.orderStatus == 60
+              ? "退款中"
+              : scope.row.orderStatus == 70
+              ? "退款成功"
+              : scope.row.orderStatus == 80
+              ? "退款失败"
+              : scope.row.orderStatus == 130
+              ? "待处理售后"
+              : scope.row.orderStatus == 140
+              ? "已处理售后"
+              : ""
+          }}
         </template>
       </el-table-column>
       <el-table-column label="售后状态" align="center">

+ 1 - 1
src/views/manage/sales.vue

@@ -182,7 +182,7 @@
     <pagination
       v-show="total > 0"
       :total="total"
-      :page.sync="queryParams.pageNum"
+      :page.sync="queryParams.pageNo"
       :limit.sync="queryParams.pageSize"
       @pagination="getList"
     />

+ 4 - 9
src/views/manage/voucher/index.vue

@@ -36,7 +36,7 @@
       </el-row>
     </el-form>
     <h3>规则配置</h3>
-    <el-radio-group v-model="queryParams.useVoucherType" @change="radioChang  ">
+    <el-radio-group v-model="queryParams.useVoucherType" @change="radioChang">
       <el-radio :label="0" value="0">普通满减卷</el-radio>
       <el-radio :label="1" value="1">折扣卷</el-radio>
     </el-radio-group>
@@ -263,16 +263,11 @@ export default {
       } else {
         params = this.person;
       }
-
-      // for (let index = 0; index < params.length; index++) {
-      //   if (params[index].hasOwnProperty("id")) {
       voucherEdit(params).then((res) => {});
-      //   } else {
-      //     voucherCreate([params[index]]).then((res) => {});
-      //   }
-      // }
       this.$modal.msgSuccess("保存成功!");
-      this.getvoucherList();
+      setTimeout(() => {
+        this.getvoucherList();
+      }, 500);
     },
     personSubmit() {
       if (this.person.id) {

+ 34 - 15
src/views/system/user/profile/resetPwd.vue

@@ -1,13 +1,28 @@
 <template>
   <el-form ref="form" :model="user" :rules="rules" label-width="80px">
     <el-form-item label="旧密码" prop="oldPassword">
-      <el-input v-model="user.oldPassword" placeholder="请输入旧密码" type="password" show-password/>
+      <el-input
+        v-model="user.oldPassword"
+        placeholder="请输入旧密码"
+        type="password"
+        show-password
+      />
     </el-form-item>
     <el-form-item label="新密码" prop="newPassword">
-      <el-input v-model="user.newPassword" placeholder="请输入新密码" type="password" show-password/>
+      <el-input
+        v-model="user.newPassword"
+        placeholder="请输入新密码"
+        type="password"
+        show-password
+      />
     </el-form-item>
     <el-form-item label="确认密码" prop="confirmPassword">
-      <el-input v-model="user.confirmPassword" placeholder="请确认新密码" type="password" show-password/>
+      <el-input
+        v-model="user.confirmPassword"
+        placeholder="请确认新密码"
+        type="password"
+        show-password
+      />
     </el-form-item>
     <el-form-item>
       <el-button type="primary" size="mini" @click="submit">保存</el-button>
@@ -32,30 +47,34 @@ export default {
       user: {
         oldPassword: undefined,
         newPassword: undefined,
-        confirmPassword: undefined
+        confirmPassword: undefined,
       },
       // 表单校验
       rules: {
-        oldPassword: [
-          { required: true, message: "旧密码不能为空", trigger: "blur" }
-        ],
+        oldPassword: [{ required: true, message: "旧密码不能为空", trigger: "blur" }],
         newPassword: [
           { required: true, message: "新密码不能为空", trigger: "blur" },
           { min: 6, max: 20, message: "长度在 6 到 20 个字符", trigger: "blur" },
-          { pattern: /^[^<>"'|\\]+$/, message: "不能包含非法字符:< > \" ' \\\ |", trigger: "blur" }
+          {
+            pattern: /^[^<>"'|\\]+$/,
+            message: "不能包含非法字符:< > \" ' \\\ |",
+            trigger: "blur",
+          },
         ],
         confirmPassword: [
           { required: true, message: "确认密码不能为空", trigger: "blur" },
-          { required: true, validator: equalToPassword, trigger: "blur" }
-        ]
-      }
+          { required: true, validator: equalToPassword, trigger: "blur" },
+        ],
+      },
     };
   },
   methods: {
     submit() {
-      this.$refs["form"].validate(valid => {
+      console.log(this.user);
+
+      this.$refs["form"].validate((valid) => {
         if (valid) {
-          updateUserPwd(this.user.oldPassword, this.user.newPassword).then(response => {
+          updateUserPwd(this.user.oldPassword, this.user.newPassword).then((response) => {
             this.$modal.msgSuccess("修改成功");
           });
         }
@@ -63,7 +82,7 @@ export default {
     },
     close() {
       this.$tab.closePage();
-    }
-  }
+    },
+  },
 };
 </script>