浏览代码

乐团巡查列表

lex-xin 4 年之前
父节点
当前提交
6dfe42d4dd
共有 4 个文件被更改,包括 344 次插入115 次删除
  1. 31 0
      src/views/musicInspection/api.js
  2. 182 52
      src/views/musicInspection/index.vue
  3. 129 61
      src/views/musicInspection/modals/lookDetail.vue
  4. 2 2
      vue.config.js

+ 31 - 0
src/views/musicInspection/api.js

@@ -0,0 +1,31 @@
+import request2 from '@/utils/request2'
+
+// 巡查任务事项日程列表
+export const inspectionItemPlan = data => request2({
+  url: '/api-web/inspectionItemPlan/queryPage',
+  params: data,
+  method: 'get',
+})
+
+// 获取日程的巡查结果
+export const getPlanConclusion = data => request2({
+  url: '/api-web/inspectionItemPlanConclusion/getPlanConclusion',
+  params: data,
+  method: 'get',
+})
+
+// 修改巡查任务事项日程
+export const inspectionItemPlanUpdate = data => request2({
+    url: '/api-web/inspectionItemPlan/update',
+    method: 'post',
+    requestType: 'form',
+    data,
+})
+
+// 修改巡查任务事项日程
+export const updateMemo = data => request2({
+    url: '/api-web/inspectionItemPlan/updateMemo',
+    method: 'post',
+    requestType: 'form',
+    data,
+})

+ 182 - 52
src/views/musicInspection/index.vue

@@ -11,6 +11,7 @@
                                 v-model.trim="searchForm.organId"
                                 filterable
                                 clearable
+                                @change="onBranchChange"
                                 placeholder="请选择分部">
                         <el-option v-for="(item,index) in selects.branchs"
                                 :key="index"
@@ -18,44 +19,53 @@
                                 :value="item.id"></el-option>
                     </el-select>
                 </el-form-item>
-                <el-form-item prop='organId'>
+                <el-form-item prop='cooperationOrganId'>
                     <el-select class='multiple'
-                                v-model.trim="searchForm.organId"
+                                v-model.trim="searchForm.cooperationOrganId"
                                 filterable
                                 clearable
-                                placeholder="请选择乐团主管">
-                        <el-option v-for="(item,index) in selects.branchs"
+                                placeholder="请选择合作单位">
+                        <el-option v-for="(item,index) in cooperationList"
                                 :key="index"
                                 :label="item.name"
                                 :value="item.id"></el-option>
                     </el-select>
                 </el-form-item>
-                <el-form-item prop='organId'>
+                <el-form-item prop='userId'>
                     <el-select class='multiple'
-                                v-model.trim="searchForm.organId"
+                                v-model.trim="searchForm.userId"
                                 filterable
                                 clearable
-                                placeholder="请选择合作单位">
-                        <el-option v-for="(item,index) in selects.branchs"
+                                placeholder="请选择乐团主管">
+                        <el-option v-for="(item,index) in educationList"
                                 :key="index"
-                                :label="item.name"
-                                :value="item.id"></el-option>
+                                :label="item.userName"
+                                :value="item.userId"></el-option>
                     </el-select>
                 </el-form-item>
-                <el-form-item prop='organId'>
+                <el-form-item prop='musicGroupId'>
                     <el-select class='multiple'
-                                v-model.trim="searchForm.organId"
+                                v-model.trim="searchForm.musicGroupId"
                                 filterable
                                 clearable
                                 placeholder="请选择乐团">
-                        <el-option v-for="(item,index) in selects.branchs"
+                        <el-option v-for="(item,index) in musicGroupList"
                                 :key="index"
                                 :label="item.name"
                                 :value="item.id"></el-option>
                     </el-select>
                 </el-form-item>
-                <el-form-item prop='organId'>
-                    <el-date-picker v-model.trim="searchForm.creatTimer"
+                <el-form-item prop='conclusionStatus'>
+                    <el-select class='multiple'
+                                v-model.trim="searchForm.conclusionStatus"
+                                clearable
+                                placeholder="巡查项目是否异常">
+                        <el-option label="是" :value="1"></el-option>
+                        <el-option label="否" :value="0"></el-option>
+                    </el-select>
+                </el-form-item>
+                <el-form-item prop='createTimer'>
+                    <el-date-picker v-model.trim="searchForm.createTimer"
                                 type="daterange"
                                 value-format="yyyy-MM-dd"
                                 range-separator="至"
@@ -74,57 +84,76 @@
                         :header-cell-style="{background:'#EDEEF0',color:'#444'}"
                         :data="tableList">
                 <el-table-column align="center"
-                                prop="userId"
+                                prop="id"
+                                width="120px"
+                                label="巡查编号">
+                </el-table-column>
+                <el-table-column align="center"
                                 label="所属分部">
                     <template slot-scope="scope">
-                    <copy-text>{{scope.row.userId}}</copy-text>
+                        {{ scope.row.organName }}(<copy-text>{{scope.row.organId}}</copy-text>)
                     </template>
                 </el-table-column>
                 <el-table-column align="center"
-                                prop="username"
+                                prop="cooperationName"
                                 label="合作单位"></el-table-column>
-                <el-table-column align="center" width="200px"
-                                prop="idCardNo"
-                                label="巡查乐团"></el-table-column>
                 <el-table-column align="center"
-                                prop="age"
+                                prop="musicGroupName"
+                                label="巡查乐团">
+                    <template slot-scope="scope">
+                        {{ scope.row.musicGroupName }}(<copy-text>{{scope.row.musicGroupId}}</copy-text>)
+                    </template>
+                </el-table-column>
+                <el-table-column align="center"
                                 label="乐团主管">
                     <template slot-scope="scope">
-                    {{ scope.row.age }}岁
+                        {{ scope.row.realName }}(<copy-text>{{ scope.row.userId }}</copy-text>)
                     </template>
                 </el-table-column>
                 <el-table-column align="center"
                                 label="巡查项目异常">
                     <template slot-scope="scope">
-                    {{ scope.row.gender ? '男' : '女' }}
+                    {{ scope.row.conclusionStatus ? '异常' : '正常' }}
                     </template>
                 </el-table-column>
                 <el-table-column align="center"
                                 prop="subject"
-                                label="巡查时间"></el-table-column>
+                                label="巡查时间">
+                    <template slot-scope="scope">
+                        {{ dayjs(scope.row.planStart).format('YYYY-MM-DD HH:mm') }}~
+                        {{ dayjs(scope.row.planEnd).format('HH:mm') }}
+                    </template>
+                </el-table-column>
                 <el-table-column align="center"
-                                prop="chapter"
+                                prop="submitedTime"
                                 label="提交时间"></el-table-column>
                 <el-table-column align="center"
-                                prop="score"
-                                label="提交状态"></el-table-column>
+                                prop="status"
+                                label="提交状态">
+                    <template slot-scope="scope">
+                        {{ scope.row.status | statusFormat }}
+                    </template>
+                </el-table-column>
                 <el-table-column align="center"
-                                prop="prizeLevel"
                                 label="处理方式">
+                    <template slot-scope="scope">
+                        <overflow-text width="100%" :text="scope.row.memo"></overflow-text>
+                    </template>
                 </el-table-column>
                 <el-table-column align="center"
+                                width="250px"
                                 label="操作">
                     <template slot-scope="scope">
-                        <auth auths="/musicInspection">
-                            <el-button type="text" @click="tableStatus = true">查看</el-button>
+                        <auth auths="inspectionItemPlanConclusion/getPlanConclusion">
+                            <el-button type="text" @click="onLook(scope.row)">查看</el-button>
                         </auth>
-                        <auth auths="/musicInspection">
-                            <el-button type="text" >GPS定位</el-button>
+                        <auth auths="inspectionItemPlanConclusion/GPS-INFO">
+                            <el-button type="text" @click="onGPS(scope.row)">GPS定位</el-button>
                         </auth>
-                        <auth auths="/musicInspection">
-                            <el-button type="text" >下载</el-button>
+                        <auth auths="inspectionItemPlanConclusion/exportPlanConclusion">
+                            <el-button type="text" @click="onExport(scope.row)">下载</el-button>
                         </auth>
-                        <auth auths="/musicInspection">
+                        <auth auths="inspectionItemPlan/updateMemo" v-if="scope.row.status != 1">
                             <el-button type="text" @click="handleClick(scope.row)">处理方式</el-button>
                         </auth>
                     </template>
@@ -140,7 +169,12 @@
         </div>
 
         <el-dialog title="乐团巡查表" :visible.sync="tableStatus" width="1200px">
-            <look-detail v-if="tableStatus" />
+            <look-detail v-if="tableStatus" :detail="planDetail" />
+        </el-dialog>
+
+        <el-dialog :visible.sync="gpsVisible" width="1000px" append-to-body>
+            <gpsLoction v-if="gpsVisible"
+                  :activeRow='activeRow' />
         </el-dialog>
 
         <el-dialog title="处理方式" :visible.sync="handleStatus"
@@ -150,10 +184,10 @@
                     label-position="top"
                     ref="ruleForm">
                 <el-form-item label="处理方式"
-                            prop="comment"
+                            prop="memo"
                             :rules="[{ required: true, message: '请输入处理方式', trigger: 'blur' }]">
                     <el-input type="textarea"
-                            v-model.trim="handleForm.comment"></el-input>
+                            v-model.trim="handleForm.memo"></el-input>
                 </el-form-item>
             </el-form>
             <span slot="footer" class="dialog-footer">
@@ -169,17 +203,32 @@
 import pagination from "@/components/Pagination/index";
 import cleanDeep from 'clean-deep'
 import LookDetail from './modals/lookDetail'
+import dayjs from 'dayjs'
+import { inspectionItemPlan, inspectionItemPlanUpdate, updateMemo } from './api'
+import { findEducationUsers } from '@/api/buildTeam'
+import { queryByOrganId } from '@/api/systemManage'
+import { getTeamList } from '@/api/teamServer'
+import { getTimes } from "@/utils";
+import { Export } from '@/utils/downLoadFile'
+import gpsLoction from "../teamDetail/componentCourse/gpsLocation";
 export default {
-    components: { pagination, LookDetail },
+    components: { pagination, LookDetail, gpsLoction },
     data () {
         return {
+            educationList: [],
+            cooperationList: [],
+            musicGroupList: [],
+            activeRow: null,
+            planDetail: null,
             searchForm: {
                 organId: null,
-                creatTimer: []
+                userId: null,
+                musicGroupId: null,
+                conclusionStatus: null,
+                cooperationOrganId: null,
+                createTimer: []
             },
-            tableList: [{
-                id: 0
-            }],
+            tableList: [],
             pageInfo: {
                 // 分页规则
                 limit: 10, // 限制显示条数
@@ -190,38 +239,119 @@ export default {
             handleStatus: false,
             handleForm: {
                 id: null,
-                comment: null,
+                memo: null,
             },
-            tableStatus: false
+            tableStatus: false,
+            gpsVisible: false,
         };
     },
     async mounted () {
         this.getList()
+        // 分部
         await this.$store.dispatch('setBranchs')
+
+        //  获取乐团主管
+        await findEducationUsers().then(res => {
+            if (res.code == 200) {
+                this.educationList = res.data
+            }
+        });
+
+        // 乐团列表 {只查询进行中的乐团}
+        await getTeamList({ musicGroupStatus: 'PROGRESS', rows: 9999 }).then(res => {
+            if(res.code == 200) {
+                this.musicGroupList = res.data.rows
+            }
+        })
     },
     methods: {
-        getList() {
-
+        dayjs,
+        async getList() {
+            try {
+                let { createTimer, ...rest } = this.searchForm
+                let params = {
+                    ...rest,
+                    page: this.pageInfo.page,
+                    rows: this.pageInfo.limit,
+                    ...getTimes(createTimer, ["startTime", "endTime"]),
+                }
+                const res = await inspectionItemPlan(params)
+                console.log(res)
+                this.tableList = res.data.rows
+                this.pageInfo.total = res.data.total
+            } catch(err) {}
+        },
+        onLook(row) {
+            this.planDetail = row
+            this.tableStatus = true
+        },
+        onGPS(row) {
+            console.log(row)
+            this.activeRow = {
+                schoolLongitudeLatitude: row.schoolGps,
+                signOutLongitudeLatitude: row.submitedGps,
+            }
+            this.gpsVisible = true
+        },
+        async onExport(row) {
+            await Export(this, {
+                url: '/api-web/inspectionItemPlanConclusion/exportPlanConclusion',
+                fileName: '巡查结果.xlsx',
+                method: 'get',
+                params: {
+                    planId: row.id
+                }
+            }, '您确定导出巡查结果?')
+        },
+        async onBranchChange(value) {
+            if(!value) {
+                this.cooperationList = []
+                this.searchForm.cooperationOrganId = null
+                return
+            }
+            // 合作单位
+            await queryByOrganId({ organId: value }).then(res => {
+                if(res.code == 200) {
+                    this.cooperationList = res.data
+                }
+            })
         },
         search() {
-
+            this.pageInfo.page = 1
+            this.getList()
         },
         onReSet() {
-
+            this.$refs['searchForm'].resetFields()
+            this.pageInfo.page = 1
+            this.getList()
         },
         handleClick(row) {
+            this.handleForm.id = row.id
+            this.handleForm.memo =  row.memo
             this.handleStatus = true
         },
         onHandleSubmit(formName) {
-            this.$refs[formName].validate(valid => {
+            this.$refs[formName].validate(async (valid) => {
                 if(valid) {
-
+                    console.log(this.handleForm)
+                    try {
+                        await updateMemo(this.handleForm)
+                        this.$message.success('处理成功')
+                        this.getList()
+                        this.handleStatus = false
+                    } catch(err) {}
                 }
             })
         },
         handleClose(formName) {
             this.$refs[formName].resetFields()
         }
+    },
+    filters: {
+        statusFormat(value) {
+            let template = ['未提交', '正常', '异常']
+            return template[value]
+        }
     }
 };
 </script>

+ 129 - 61
src/views/musicInspection/modals/lookDetail.vue

@@ -2,117 +2,166 @@
   <div>
     <descriptions :column="3">
       <descriptions-item label="所属分部:">
-          11
+        {{ detail.organName }}
       </descriptions-item>
       <descriptions-item label="合作单位:">
-        aa
+        {{ detail.cooperationName }}
       </descriptions-item>
       <descriptions-item label="巡查乐团:">
-        aa
+        {{ detail.musicGroupName }}
       </descriptions-item>
       <descriptions-item label="乐团主管:">
-        aa
+        {{ detail.realName }}
       </descriptions-item>
       <descriptions-item label="巡查时间:">
-          fe
+        {{ dayjs(detail.planStart).format('YYYY-MM-DD HH:mm') }}~
+        {{ dayjs(detail.planEnd).format('HH:mm') }}
       </descriptions-item>
       <descriptions-item label="提交时间:">
-          g4g45
+        {{ detail.submitedTime }}
       </descriptions-item>
       <descriptions-item label="处理方式:">
-          g4g45
+        {{ detail.memo }}
       </descriptions-item>
     </descriptions>
 
-    <el-table
-      style="margin-top: 15px;"
-      :data="tableData">
+    <el-table style="margin-top: 15px;" :data="tableData">
       <el-table-column
-        prop="date"
+        prop="name"
         fixed="left"
         label="巡查项目"
         align="center"
-        width="150">
+        width="150"
+      >
       </el-table-column>
-      <el-table-column label="课前管理" align="center">
+      <el-table-column label="课前管理">
         <el-table-column
-          prop="name"
           width="200px"
-          label="老师是否提前准备板书(本课内容、作业)">
+          align="center"
+          label="老师是否提前准备板书(本课内容、作业)"
+        >
+          <template slot-scope="scope">
+            <i :class="scope.row[1] == 1 ? 'el-icon-check' : 'el-icon-close'"></i>
+          </template>
         </el-table-column>
-        <el-table-column
-          prop="name"
-          width="160px"
-          label="老师是否佩戴工牌">
+        <el-table-column prop="2" width="160px" label="老师是否佩戴工牌" align="center">
+          <template slot-scope="scope">
+            <i :class="scope.row[2] == 1 ? 'el-icon-check' : 'el-icon-close'"></i>
+          </template>
         </el-table-column>
-        <el-table-column
-          prop="name"
-          width="180px"
-          label="老师是否仪容仪表整洁">
+        <el-table-column prop="3" width="180px" label="老师是否仪容仪表整洁" align="center">
+          <template slot-scope="scope">
+            <i :class="scope.row[3] == 1 ? 'el-icon-check' : 'el-icon-close'"></i>
+          </template>
         </el-table-column>
-        <el-table-column
-          prop="name"
-          width="160px"
-          label="老师是否携带乐器">
+        <el-table-column prop="4" width="160px" label="老师是否携带乐器" align="center">
+          <template slot-scope="scope">
+            <i :class="scope.row[4] == 1 ? 'el-icon-check' : 'el-icon-close'"></i>
+          </template>
         </el-table-column>
         <el-table-column
-          prop="name"
+          prop="5"
           width="160px"
-          label="老师是否携带教学资料、设备">
+          align="center"
+          label="老师是否携带教学资料、设备"
+        >
+          <template slot-scope="scope">
+            <i :class="scope.row[5] == 1 ? 'el-icon-check' : 'el-icon-close'"></i>
+          </template>
         </el-table-column>
       </el-table-column>
       <el-table-column label="课中管理" align="center">
         <el-table-column
-          prop="name"
+          prop="6"
           width="160px"
-          label="老师是否合理安排学员座位">
+          align="center"
+          label="老师是否合理安排学员座位"
+        >
+          <template slot-scope="scope">
+            <i :class="scope.row[6] == 1 ? 'el-icon-check' : 'el-icon-close'"></i>
+          </template>
         </el-table-column>
         <el-table-column
-          prop="name"
+          prop="7"
           width="160px"
-          label="乐器箱包、书包是否摆放整齐">
+          align="center"
+          label="乐器箱包、书包是否摆放整齐"
+        >
+          <template slot-scope="scope">
+            <i :class="scope.row[7] == 1 ? 'el-icon-check' : 'el-icon-close'"></i>
+          </template>
         </el-table-column>
-        <el-table-column
-          prop="name"
-          width="180px"
-          label="课堂纪律是否保持良好">
+        <el-table-column prop="8" width="180px" align="center" label="课堂纪律是否保持良好">
+          <template slot-scope="scope">
+            <i :class="scope.row[8] == 1 ? 'el-icon-check' : 'el-icon-close'"></i>
+          </template>
         </el-table-column>
-        <el-table-column
-          prop="name"
-          width="180px"
-          label="老师是否全程站立教学">
+        <el-table-column prop="9" width="180px" align="center" label="老师是否全程站立教学">
+          <template slot-scope="scope">
+            <i :class="scope.row[9] == 1 ? 'el-icon-check' : 'el-icon-close'"></i>
+          </template>
         </el-table-column>
         <el-table-column
-          prop="name"
+          prop="10"
           width="160px"
-          label="老师是否全程使用节拍器或教学音频">
+          align="center"
+          label="老师是否全程使用节拍器或教学音频"
+        >
+          <template slot-scope="scope">
+            <i :class="scope.row[10] == 1 ? 'el-icon-check' : 'el-icon-close'"></i>
+          </template>
         </el-table-column>
         <el-table-column
-          prop="name"
+          prop="11"
           width="160px"
-          label="是否发现学员需要更换新乐器">
+          align="center"
+          label="是否发现学员需要更换新乐器"
+        >
+          <template slot-scope="scope">
+            <i :class="scope.row[11] == 1 ? 'el-icon-check' : 'el-icon-close'"></i>
+          </template>
         </el-table-column>
         <el-table-column
-          prop="name"
+          prop="12"
           width="160px"
-          label="老师是否将上课照片/视频发送到声部群">
+          align="center"
+          label="老师是否将上课照片/视频发送到声部群"
+        >
+          <template slot-scope="scope">
+            <i :class="scope.row[12] == 1 ? 'el-icon-check' : 'el-icon-close'"></i>
+          </template>
         </el-table-column>
       </el-table-column>
       <el-table-column label="课后管理" align="center">
         <el-table-column
-          prop="name"
+          prop="13"
           width="160px"
-          label="老师是否保持教室环境卫生">
+          align="center"
+          label="老师是否保持教室环境卫生"
+        >
+          <template slot-scope="scope">
+            <i :class="scope.row[13] == 1 ? 'el-icon-check' : 'el-icon-close'"></i>
+          </template>
         </el-table-column>
         <el-table-column
-          prop="name"
+          prop="14"
           width="160px"
-          label="老师是否关好所有电源、门窗">
+          align="center"
+          label="老师是否关好所有电源、门窗"
+        >
+          <template slot-scope="scope">
+            <i :class="scope.row[14] == 1 ? 'el-icon-check' : 'el-icon-close'"></i>
+          </template>
         </el-table-column>
         <el-table-column
-          prop="name"
+          prop="15"
           width="160px"
-          label="老师是否有序组织学员放学">
+          align="center"
+          label="老师是否有序组织学员放学"
+        >
+          <template slot-scope="scope">
+            <i :class="scope.row[15] == 1 ? 'el-icon-check' : 'el-icon-close'"></i>
+          </template>
         </el-table-column>
       </el-table-column>
       <template #empty>
@@ -122,25 +171,34 @@
   </div>
 </template>
 <script>
-import Vue from "vue";
-import numeral from 'numeral'
+import numeral from "numeral";
+import dayjs from "dayjs";
 import descriptions from "@/components/Descriptions";
+import { getPlanConclusion } from '../api'
 export default {
   props: ["detail"],
   components: { descriptions },
-  data () {
+  data() {
     return {
-        tableData: []
+      tableData: []
     };
   },
-  mounted () {
+  mounted() {
     this.init();
   },
   methods: {
+    dayjs,
     numeral,
-    async init () {
-      
-    },
+    async init() {
+      try {
+        let detail = this.detail
+        // if(!detail) {
+        //   return
+        // }
+        const res = await getPlanConclusion({ planId: detail.id })
+        this.tableData = res.data
+      } catch(err){}
+    }
   }
 };
 </script>
@@ -148,4 +206,14 @@ export default {
 .alert {
   margin: 10px 0;
 }
+/deep/.el-icon-close, /deep/.el-icon-check {
+  font-size: 18px;
+  font-weight: bold;
+}
+/deep/.el-icon-close {
+  color: red;
+}
+/deep/.el-icon-check {
+  color: #14928a;
+}
 </style>

+ 2 - 2
vue.config.js

@@ -18,10 +18,10 @@ const name = defaultSettings.title || '管乐迷后台管理系统' // page titl
 // //  https://online.dayaedu.com
 // let target = 'https://online.dayaedu.com' //线上
 // let target = 'http://dyme.utools.club' //test环境
-let target = 'http://192.168.3.139:8000' // 箭河
+// let target = 'http://192.168.3.139:8000' // 箭河
 // let target = 'http://192.168.3.38:8000' //邹璇
 // let target = 'http://192.168.3.57:8000' //勇哥
-// let target = 'http://dev.dayaedu.com' // 测试服
+let target = 'http://dev.dayaedu.com' // 测试服
 // let target = 'http://192.168.3.196' // 乔
 // All configuration item explanations can be find in https://cli.vuejs.org/config/
 module.exports = {