Sfoglia il codice sorgente

feat: debug worker list

wangyuan 2 anni fa
parent
commit
2292062218

+ 14 - 0
ittpc/src/request/request.js

@@ -11,6 +11,12 @@ const getUserListURL = BASE_API + '/get/user/list/v1'
 // 管理人员列表
 const getOperatorListURl = BASE_API + '/get/operator/list/v1'
 
+// 工作人员列表
+const getWorkerListURL = BASE_API + '/get/worker/list/v1'
+
+// 工作人员服务记录
+const getWorkerServiceURL = BASE_API + '/get/worker/service/v1'
+
 export const pwdLogin = (data) => {
   return request.post(pwdLoginURL, data)
 }
@@ -21,4 +27,12 @@ export const getUserList = (data) => {
 
 export const getOperatorList = (data) => {
   return request.post(getOperatorListURl, data)
+}
+
+export const getWorkerList = (data) => {
+  return request.post(getWorkerListURL, data)
+}
+
+export const getWorkerService = (data) => {
+  return request.post(getWorkerServiceURL, data)
 }

+ 10 - 1
ittpc/src/store/store.js

@@ -5,11 +5,20 @@ Vue.use(Vuex)
 
 export default new Vuex.Store({
   state: { // 存放数据 和data类似
-    userModulesView: 0 // 0 -- 查询;1 -- 记录
+    userModulesView: 0, // 0 -- 查询;1 -- 记录
+    workerId: '', // 获取服务记录的Id
+    wokerName: ''
   },
   mutations: { // 用来修改state和getters里面的数据
     setUserModulesView(state, data) {
       state.userModulesView = data
+    },
+    setWorkerId (state, data) {
+      state.workerId = data
+    },
+    setWokerName (state, data) {
+      console.log(data,'data');
+      state.wokerName = data
     }
   }
 })

+ 1 - 1
ittpc/src/views/modules/main.vue

@@ -25,7 +25,7 @@
             </el-menu-item> 
             <el-menu-item index="/main/staff">
               <i class="el-icon-s-platform"></i>
-              <span slot="title">工作人员管理</span>
+              <span slot="title">工作人员列表</span>
             </el-menu-item>
             <el-menu-item index="/main/appointment">
               <i class="el-icon-message-solid"></i>

+ 5 - 4
ittpc/src/views/modules/manager/manager.vue

@@ -25,15 +25,15 @@
     </el-row>
     <el-row>
       <el-col :span="24" class="padding20">
-        <el-table :data="tableData" border stripe style="width: 100%" size="small" height="700" v-loading="loading" element-loading-text="加载中" element-loading-spinner="el-icon-loading">
+        <el-table :data="tableData" border stripe style="width: 100%" size="small" max-height="700" v-loading="loading" element-loading-text="加载中" element-loading-spinner="el-icon-loading">
           <el-table-column type="index" align="center" label="序号"></el-table-column>
           <el-table-column prop="operatorId" align="center" label="管理人员ID"></el-table-column>
           <el-table-column prop="userName" align="center" label="用户账户"></el-table-column>
           <el-table-column prop="realName" align="center" label="真实姓名"></el-table-column>
           <el-table-column prop="status" align="center" label="状态">
             <template slot-scope="scope">
-              <span v-if="scope.row.status">正常</span>
-              <span v-else>禁用</span>
+              <span v-if="scope.row.status" style="color:#45A6B5">启用</span>
+              <span v-else style="color:#F56C6C">禁用</span>
             </template>
           </el-table-column>
           <el-table-column prop="addTime" align="center" label="创建时间"></el-table-column>
@@ -78,7 +78,7 @@ export default {
     };
   },
   mounted() {
-
+    this.handleQuery()
   },
   methods: {
     handleReset () {
@@ -100,6 +100,7 @@ export default {
     },
     getOperatorListFn () {
       let data = {
+        currentPage: this.currentPage,
         realName: this.searchForm.realName,
         minLastLoginTime: this.searchForm.minLastLoginTime,
         maxLastLoginTime: this.searchForm.maxLastLoginTime

+ 68 - 46
ittpc/src/views/modules/staff/query.vue

@@ -3,37 +3,46 @@
     <el-row>
       <el-col :span="24" class="padding20">
         <el-form :inline="true" :model="searchForm" class="demo-form-inline" size="small">
-          <el-form-item label="用户昵称">
-            <el-input v-model="searchForm.user" placeholder="模糊搜索"></el-input>
-          </el-form-item>
-          <el-form-item label="手机号">
-            <el-input v-model="searchForm.phone" placeholder="精确搜索"></el-input>
-          </el-form-item>
-          <el-form-item label="管理员">
-            <el-select v-model="searchForm.admin" placeholder="请选择">
-              <el-option label="是" value="1"></el-option>
-              <el-option label="否" value="0"></el-option>
-            </el-select>
+          <el-form-item label="真实姓名">
+            <el-input v-model="searchForm.realName" placeholder="请输入真实姓名"></el-input>
           </el-form-item>
           <el-form-item>
-            <el-button type="primary">查询</el-button>
-            <el-button>重置</el-button>
+            <el-button type="primary" @click="handleQuery">查询</el-button>
+            <el-button @click="handleReset">重置</el-button>
           </el-form-item>
         </el-form>
       </el-col>
     </el-row>
     <el-row>
       <el-col :span="24" class="padding20">
-        <el-table :data="tableData" border stripe style="width: 100%" size="small" max-height="700">
-          <el-table-column prop="name" label="用户昵称"></el-table-column>
-          <el-table-column prop="phone" label="用户手机号"></el-table-column>
-          <el-table-column prop="time" label="创建时间"></el-table-column>
-          <el-table-column prop="times" label="用户建档次数"></el-table-column>
-          <el-table-column prop="count" label="检测次数"></el-table-column>
-          <el-table-column prop="admin" label="是否为管理员"></el-table-column>
-          <el-table-column label="操作">
+        <el-table :data="tableData" border stripe style="width: 100%" size="small" max-height="700" v-loading="loading" element-loading-text="加载中" element-loading-spinner="el-icon-loading">
+          <el-table-column type="index" align="center" label="序号"></el-table-column>
+          <el-table-column prop="workerId" label="工作人员ID" align="center"></el-table-column>
+          <el-table-column prop="workerName" label="工作人员姓名" align="center"></el-table-column>
+          <el-table-column prop="status" label="状态" align="center">
+            <template slot-scope="scope">
+              <span v-if="scope.row.status" style="color:#45A6B5">启用</span>
+              <span v-else style="color:#F56C6C">禁用</span>
+            </template>
+          </el-table-column>
+          <el-table-column prop="headImg" align="center" label="头像">
+            <template slot-scope="scope">
+              <el-avatar :size="40" :src="scope.row.headImg">
+                <img src="https://cube.elemecdn.com/e/fd/0fc7d20532fdaf769a25683617711png.png"/>
+              </el-avatar>
+            </template>
+          </el-table-column>
+          <el-table-column prop="addTime" label="注册时间" align="center"></el-table-column>
+          <el-table-column prop="isBindWechat" label="是否绑定微信" align="center">
+            <template slot-scope="scope">
+              <span v-if="scope.row.isBindWechat" style="color:#45A6B5">是</span>
+              <span v-else style="color:#F56C6C">否</span>
+            </template>
+          </el-table-column>
+          <!-- <el-table-column prop="admin" label="是否为管理员" align="center"></el-table-column> -->
+          <el-table-column label="操作" align="center">
             <template slot-scope="scope">
-              <el-button type="text" size="small" @click="handleCancelAdmin(scope.row)">取消管理员</el-button>
+              <!-- <el-button type="text" size="small" @click="handleCancelAdmin(scope.row)">取消管理员</el-button> -->
               <el-button type="text" size="small" @click="handleServeRecord(scope.row)">服务记录</el-button>
             </template>
           </el-table-column>
@@ -43,13 +52,11 @@
     <el-row>
       <el-col :span="24" class="padding20 flexend" >
         <el-pagination
-          @size-change="handleSizeChange"
           @current-change="handleCurrentChange"
           :current-page="currentPage"
-          :page-sizes="[100, 200, 300, 400]"
-          :page-size="100"
-          layout="total, sizes, prev, pager, next, jumper"
-          :total="400"
+          :page-size="pageSize"
+          layout="total, prev, pager, next"
+          :total="total"
           size="small"
           >
         </el-pagination>
@@ -59,37 +66,50 @@
 </template>
 
 <script>
+import { getWorkerList } from '@/request/request'
 export default {
   data() {
     return {
       loading: false,
       searchForm: {
-        phone: '',
-        user: '',
-        admin: ''
+        realName: ''
       },
-      tableData: [
-        {
-          name: '范一岚',
-          phone: '18626576880',
-          time: '1995-12-27',
-          times: 100,
-          count: 227,
-          admin: '是'
-        }
-      ],
-      currentPage: 1
+      tableData: [],
+      currentPage: 1,
+      pageSize: 20,
+      total: 0
     };
   },
   mounted() {
-    console.log('query mounted');
+    this.handleQuery()
   },
   methods: {
-    handleSizeChange () {
-
+    handleReset () {
+      this.searchForm.realName = ''
+    },
+    handleQuery () {
+      this.currentPage = 1
+      this.getWorkerListFn()
+    },
+    getWorkerListFn () {
+      let data = {
+        currentPage: this.currentPage,
+        realName: this.searchForm.realName
+      }
+      this.loading = true
+      getWorkerList(data).then(res => {
+        this.loading = false
+        this.total = res.data.total
+        this.pageSize = res.data.pageSize
+        this.tableData = res.data.vos || []
+      }).catch(e => {
+        console.log(e)
+        this.loading = false
+      })
     },
-    handleCurrentChange () {
-      
+    handleCurrentChange (currentPage) {
+      this.currentPage = currentPage
+      this.getWorkerListFn()
     },
     handleCancelAdmin () {
       this.$confirm('确定取消管理员吗?').then( _=> {
@@ -98,6 +118,8 @@ export default {
     },
     handleServeRecord (row) {
       this.$store.commit('setUserModulesView', 1)
+      this.$store.commit('setWorkerId', row.workerId)
+      sessionStorage.setItem("workerName", row.workerName)
     }
   }
 };

+ 77 - 51
ittpc/src/views/modules/staff/recoed.vue

@@ -2,53 +2,59 @@
   <div class="user-page-record" v-loading="loading" element-loading-text="加载中" element-loading-spinner="el-icon-loading">
     <el-row>
       <el-col :span="24" class="padding20">
-        <el-page-header @back="goback" content="范一岚的服务记录"></el-page-header>
+        <el-page-header @back="goback">
+          <span slot="content">{{content}}</span>
+        </el-page-header>
       </el-col>
     </el-row>
     <el-row>
-      <el-col :span="24" class="padding20">
-        <el-form :inline="true" :model="searchForm" class="demo-form-inline" size="small">
-          <el-form-item label="服务时间">
-             <el-date-picker
-                v-model="date"
-                type="daterange"
-                range-separator="至"
-                start-placeholder="开始日期"
-                end-placeholder="结束日期">
-            </el-date-picker>
-          </el-form-item>
-          <el-form-item label="预约来源">
-            <el-input v-model="searchForm.origin" placeholder="请输入预约来源"></el-input>
-          </el-form-item>
-          <el-form-item>
-            <el-button type="primary">查询</el-button>
-            <el-button>重置</el-button>
-          </el-form-item>
-        </el-form>
+      <el-col :span="24" class="padding10">
+        <el-button type="primary" size="mini" @click="handleRefresh">刷新</el-button>
       </el-col>
     </el-row>
     <el-row>
       <el-col :span="24" class="padding20">
         <el-table :data="tableData" border stripe style="width: 100%" size="small" max-height="700">
-          <el-table-column prop="name" label="服务时间"></el-table-column>
-          <el-table-column prop="phone" label="检测车/检测设备"></el-table-column>
-          <el-table-column prop="time" label="服务账号昵称"></el-table-column>
-          <el-table-column prop="times" label="服务账号手机号"></el-table-column>
-          <el-table-column prop="count" label="建档人姓名"></el-table-column>
-          <el-table-column prop="admin" label="预约来源"></el-table-column>
+          <el-table-column type="index" align="center" label="序号"></el-table-column>
+          <el-table-column prop="addTime" label="服务时间" align="center"></el-table-column>
+          <el-table-column prop="deviceCode" label="设备编码" align="center"></el-table-column>
+          <el-table-column prop="userId" label="用户ID" align="center"></el-table-column>
+          <el-table-column prop="userNickname" label="用户昵称" align="center"></el-table-column>
+          <el-table-column prop="userPhone" label="用户手机号" align="center"></el-table-column>
+          <el-table-column prop="userImg" align="center" label="头像">
+            <template slot-scope="scope">
+              <el-avatar :size="40" :src="scope.row.userImg">
+                <img src="https://cube.elemecdn.com/e/fd/0fc7d20532fdaf769a25683617711png.png"/>
+              </el-avatar>
+            </template>
+          </el-table-column>
+          <el-table-column prop="documentId" label="档案ID" align="center"></el-table-column>
+          <el-table-column prop="documentName" label="档案名称" align="center"></el-table-column>
+          <el-table-column prop="status" label="状态" align="center">
+            <!-- 状态 【0:已核销 1:待体检(输入核销码)  2:体检完成 (体检报告检出)】 -->
+            <template slot-scope="scope">
+              <span v-if="scope.row.status == 0">已核销</span>
+              <span v-if="scope.row.status == 1">待体检</span>
+              <span v-if="scope.row.status == 2">体检完成</span>
+            </template>
+          </el-table-column>
+          <el-table-column prop="finishTime" label="完成时间" align="center" width="140"></el-table-column>
+          <el-table-column prop="resource" label="来源" align="center">
+            <template slot-scope="scope">
+              <span v-if="scope.row.resource == 1">小程序</span>
+              <span v-else>--</span>
+            </template>
+          </el-table-column>
         </el-table>
       </el-col>
     </el-row>
     <el-row>
       <el-col :span="24" class="padding20 flexend" >
         <el-pagination
-          @size-change="handleSizeChange"
           @current-change="handleCurrentChange"
-          :current-page="currentPage"
-          :page-sizes="[100, 200, 300, 400]"
-          :page-size="100"
-          layout="total, sizes, prev, pager, next, jumper"
-          :total="400"
+          :page-size="pageSize"
+          layout="total, prev, pager, next"
+          :total="total"
           size="small"
           >
         </el-pagination>
@@ -58,39 +64,56 @@
 </template>
 
 <script>
+import { mapState } from 'vuex'
+import { getWorkerService } from '@/request/request'
 export default {
   data() {
     return {
       loading: false,
       date: '',
-      searchForm: {
-        origin: ''
-      },
-      tableData: [
-        {
-          name: '范一岚',
-          phone: '18626576880',
-          time: '1995-12-27',
-          times: 100,
-          count: 227,
-          admin: '是'
-        }
-      ],
-      currentPage: 1
+      content: '',
+      tableData: [],
+      currentPage: 1,
+      pageSize: 20,
+      total: 0
     };
   },
-  mounted() {
-    console.log('record mounted');
+  computed: {
+    ...mapState({
+      workerId: s => s.workerId
+    })
+  },
+  watch: {
+    workerId (nVal,oVal) {
+      this.content = sessionStorage.getItem("workerName") + '的服务记录'
+      this.getWorkerServiceFn(nVal)
+    }
   },
   methods: {
     goback () {
       this.$store.commit('setUserModulesView', 0)
     },
-    handleSizeChange () {
-
+    handleRefresh () {
+      this.getWorkerServiceFn(this.workerId)
+    },
+    getWorkerServiceFn (workerId) {
+      let data = {
+        workerId: workerId
+      }
+      this.loading = true
+      getWorkerService(data).then(res => {
+        this.loading = false
+        this.total = res.data.total
+        this.pageSize = res.data.pageSize
+        this.tableData = res.data.vos || []
+      }).catch(e => {
+        this.loading = false
+        this.tableData = []
+        console.log(e)
+      })
     },
     handleCurrentChange () {
-      
+      this.getWorkerServiceFn(this.workerId)
     }
   }
 };
@@ -103,6 +126,9 @@ export default {
   .padding20 {
     padding: 20px;
   }
+  .padding10 {
+    padding: 1px 20px;
+  }
   .flexend {
     display: flex;
     justify-content: flex-end;

+ 1 - 1
ittpc/src/views/modules/user/user.vue

@@ -18,7 +18,7 @@
     </el-row>
     <el-row>
       <el-col :span="24" class="padding20">
-        <el-table :data="tableData" border stripe style="width: 100%" size="small" height="700" v-loading="loading" element-loading-text="加载中" element-loading-spinner="el-icon-loading">
+        <el-table :data="tableData" border stripe style="width: 100%" size="small" max-height="700" v-loading="loading" element-loading-text="加载中" element-loading-spinner="el-icon-loading">
           <el-table-column type="index" align="center" label="序号"></el-table-column>
           <el-table-column prop="userId" align="center" label="用户ID"></el-table-column>
           <el-table-column prop="headImg" align="center" label="头像">