Selaa lähdekoodia

Merge branch 'dev_v1.0.0' of http://git.qmth.com.cn/sop/web into dev_v1.0.0

zhangjie 1 vuosi sitten
vanhempi
commit
de33554c0b

+ 7 - 1
src/api/user.js

@@ -91,6 +91,12 @@ export const updateUserPassword = (data) =>
     data,
     loading: true,
   });
+export const initUserPassword = (data) =>
+  request({
+    url: '/api/admin/user/init_password',
+    data,
+    loading: true,
+  });
 export const getVerifyCode = (data) =>
   request({
     url: '/api/admin/common/get_verify_code',
@@ -101,7 +107,7 @@ export const forgetPassword = (data) =>
   request({
     url: '/api/admin/common/forget_password',
     data,
-    loading,
+    loading: true,
     noAuth: true,
   });
 export const getMenus = () =>

+ 1 - 0
src/views/system/config-manage/customer-manage/index.vue

@@ -173,6 +173,7 @@ const params = reactive({
 const columns = [
   { colKey: 'id', title: '客户ID', width: 200 },
   { colKey: 'name', title: '客户名称', width: 120 },
+  { colKey: 'code', title: '客户编号', width: 100 },
   { colKey: 'type', title: '客户类型', cell: 'type', width: 120 },
   { colKey: 'province', title: '省份', width: 100 },
   { colKey: 'city', title: '城市', width: 100 },

+ 19 - 6
src/views/user/auth-manage/user-manage/index.vue

@@ -32,12 +32,12 @@
         <template #operate="{ row }">
           <div class="table-operations">
             <t-link
-              v-if="perm.LINK_UpdatePwd"
+              v-if="perm.LINK_InitPwd"
               theme="primary"
               hover="color"
               @click="handleModifyPwd(row)"
             >
-              修改密码
+              初始化密码
             </t-link>
 
             <t-link
@@ -69,7 +69,6 @@
     ></AddUserDialog>
 
     <UpdateUserPwdDialog
-      v-if="perm.LINK_UpdatePwd"
       v-model:visible="showUpdateUserPwdDialog"
       :curRow="curRow"
       @success="updatePwdSuccess"
@@ -80,7 +79,7 @@
 
 <script setup name="User">
 import { ref } from 'vue';
-import { getUserList } from '@/api/user';
+import { getUserList, initUserPassword } from '@/api/user';
 import useFetchTable from '@/hooks/useFetchTable';
 import AddUserDialog from './add-user-dialog.vue';
 import UpdateUserPwdDialog from './update-user-pwd-dialog.vue';
@@ -151,7 +150,21 @@ const handleEnable = (row) => {
 
 const handleModifyPwd = (row) => {
   curRow.value = row;
-  showUpdateUserPwdDialog.value = true;
+  const confirmDia = DialogPlugin({
+    header: `提示`,
+    body: `初始密码为手机后6位,是否初始化用户 [ ${row.realName} ] 的密码?`,
+    confirmBtn: '确定',
+    cancelBtn: '取消',
+    onConfirm: async () => {
+      confirmDia.hide();
+      const res = await initUserPassword({
+        id: row.id,
+      }).catch(() => {});
+      if (!res) return;
+      MessagePlugin.success('操作成功');
+    },
+  });
+  // showUpdateUserPwdDialog.value = true;
 };
 
 const addSuccess = () => {
@@ -160,7 +173,7 @@ const addSuccess = () => {
   search();
 };
 const updatePwdSuccess = () => {
-  showUpdateUserPwdDialog.value = false;
+  // showUpdateUserPwdDialog.value = false;
   MessagePlugin.success('操作成功');
 };
 </script>