Browse Source

增加批量添加测试用户功能

wennn 3 years ago
parent
commit
3269506fba
2 changed files with 26 additions and 0 deletions
  1. 8 0
      src/api/ncs_customer.js
  2. 18 0
      src/views/ncs-orginazition/components/partInfoEdit.vue

+ 8 - 0
src/api/ncs_customer.js

@@ -59,4 +59,12 @@ export function customerListByHospital(params) {
     data: params,
     headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
   })
+}
+
+export function saveListByCustomer(partId) {
+  return request({
+    url: `/ncs/customer/saveListByCustomer/${partId}`,
+    method: 'GET',
+    loading: true
+  })
 }

+ 18 - 0
src/views/ncs-orginazition/components/partInfoEdit.vue

@@ -259,6 +259,7 @@
 
         <el-form-item align="center" class="margin-top-sm">
           <el-button type="success" @click="onSubmit">保存设置</el-button>
+          <el-button type="ss" @click="saveList">批量添加测试用户</el-button>
         </el-form-item>
       </el-form>
     </el-card>
@@ -269,6 +270,8 @@
 // 系统设置
 import * as API_Part from '@/api/ncs_partInfo'
 import * as API_Nurse from '@/api/calling-nurse'
+import { saveListByCustomer } from '@/api/ncs_customer'
+import * as API_ErrorLog from "@/api/ncs_errorlog";
 
 export default {
   name: 'PartInfoEdit',
@@ -383,6 +386,21 @@ export default {
       API_Part.listByType(6).then(res => {
         this.parents = [...res]
       })
+    },
+    saveList() {
+      const _this = this
+      this.$confirm('确定需要批量增加测试用户吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        console.log('开始创建')
+        saveListByCustomer(_this.partId).then(res => {
+          this.$message.success(res.message)
+        })
+      }).catch(() => {
+        console.log('取消')
+      })
     }
   }
 }