123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476 |
- <!-- -->
- <template>
- <div>
- <!-- <h2> class="m-container"
- <div class="squrt"></div>
- 乐团巡查
- <filter-search
- :keys="['searchType']"
- :moreKeys="['organId', 'start', 'end']"
- @reload="reloadSearch"
- />
- </h2> -->
- <div class="m-core">
- <save-form
- :inline="true"
- ref="searchForm"
- @submit="search"
- @reset="onReSet"
- :model="searchForm"
- :saveKey="`indexErrDataRecord-${searchType}`"
- >
- <el-form-item prop="search">
- <el-input
- type="text"
- placeholder="请输入乐团名称"
- clearable
- v-model="searchForm.search"
- />
- </el-form-item>
- <el-form-item prop="organId">
- <el-select
- class="multiple"
- v-model.trim="searchForm.organId"
- filterable
- clearable
- @change="onBranchChange"
- placeholder="请选择分部"
- >
- <el-option
- v-for="(item, index) in selects.branchs"
- :key="index"
- :label="item.name"
- :value="item.id"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item prop="cooperationOrganId">
- <el-select
- class="multiple"
- :disabled="!searchForm.organId"
- v-model.trim="searchForm.cooperationOrganId"
- filterable
- clearable
- 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="userId">
- <el-select
- class="multiple"
- v-model.trim="searchForm.userId"
- filterable
- clearable
- placeholder="请选择乐团主管"
- >
- <el-option
- v-for="(item, index) in selects.roles.educationId"
- :key="index"
- :label="item.userName"
- :value="item.userId"
- >
- <span style="float: left">{{ item.userName }}</span>
- <span style="float: right; color: #8492a6; font-size: 13px">{{
- item.userId
- }}</span>
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item prop="hasDealTime">
- <el-select
- v-model.trim="searchForm.hasDealTime"
- clearable
- filterable
- 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="至"
- start-placeholder="巡查开始日期"
- end-placeholder="巡查结束日期"
- :picker-options="{ firstDayOfWeek: 1 }"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item>
- <el-button type="danger" native-type="submit">搜索</el-button>
- <el-button native-type="reset" type="primary">重置</el-button>
- </el-form-item>
- </save-form>
- <div class="tableWrap">
- <el-table
- style="width: 100%"
- :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
- :data="tableList"
- >
- <el-table-column
- align="center"
- prop="id"
- width="120px"
- label="巡查编号"
- >
- </el-table-column>
- <el-table-column align="center" label="所属分部">
- <template slot-scope="scope">
- {{ scope.row.organName }}(<copy-text>{{
- scope.row.organId
- }}</copy-text
- >)
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="cooperationName"
- label="合作单位"
- ></el-table-column>
- <el-table-column
- align="center"
- 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.realName }}(<copy-text>{{
- scope.row.userId
- }}</copy-text
- >)
- </template>
- </el-table-column>
- <el-table-column align="center" label="巡查项目是否异常">
- <template slot-scope="scope">
- {{ scope.row.conclusionStatus ?'否':'是'}}
- </template>
- </el-table-column>
- <el-table-column align="center" prop="subject" label="巡查时间" width="103px">
- <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="submitedTime"
- label="提交时间"
- ></el-table-column>
- <el-table-column align="center" prop="status" label="提交状态">
- <template slot-scope="scope">
- {{ scope.row.status | statusFormat }}
- </template>
- </el-table-column>
- <el-table-column align="center" label="处理方式">
- <template slot-scope="scope">
- <overflow-text
- width="100%"
- :text="scope.row.memo"
- ></overflow-text>
- </template>
- </el-table-column>
- <el-table-column align="center" label="异常产生时间">
- <template slot-scope="scope">
- <div>
- {{ scope.row.generateTime | dayjsFormat }}
- </div>
- </template>
- </el-table-column>
- <el-table-column align="center" label="异常处理时间" width="103px">
- <template slot-scope="scope">
- <div>
- {{ scope.row.dealTime }}
- </div>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- width="250px"
- label="操作"
- v-if="searchType == 'MUSIC_PATROL_ITEM'"
- >
- <template slot-scope="scope">
- <auth
- auths="inspectionItemPlanConclusion/getPlanConclusion/4403"
- v-if="scope.row.status != 0"
- >
- <el-button type="text" @click="onLook(scope.row)"
- >查看</el-button
- >
- </auth>
- <auth
- auths="inspectionItemPlanConclusion/GPS-INFO/4404"
- v-if="scope.row.status != 0"
- >
- <el-button type="text" @click="onGPS(scope.row)"
- >GPS定位</el-button
- >
- </auth>
- <auth
- auths="inspectionItemPlanConclusion/exportPlanConclusion/4405"
- v-if="scope.row.status != 0"
- >
- <el-button type="text" @click="onExport(scope.row)"
- >下载</el-button
- >
- </auth>
- <!-- <auth
- auths="inspectionItemPlan/updateMemo"
- v-if="scope.row.conclusionStatus == 1 || scope.row.status == 0"
- >
- <el-button type="text" @click="handleClick(scope.row)"
- >立即处理</el-button
- >
- </auth> -->
- </template>
- </el-table-column>
- </el-table>
- <pagination
- :saveKey="`indexErrDataRecord-${searchType}`"
- :total.sync="pageInfo.total"
- sync
- :page.sync="pageInfo.page"
- :limit.sync="pageInfo.limit"
- :page-sizes="pageInfo.page_size"
- @pagination="getList"
- />
- </div>
- </div>
- <el-dialog title="乐团巡查表" :visible.sync="tableStatus" width="1200px">
- <look-detail v-if="tableStatus" :detail="planDetail" />
- </el-dialog>
- <el-dialog
- title="GPS定位"
- :visible.sync="gpsVisible"
- width="1000px"
- append-to-body
- >
- <gpsLoction v-if="gpsVisible" :activeRow="activeRow" />
- </el-dialog>
- <el-dialog
- title="处理方式"
- :visible.sync="handleStatus"
- @close="handleClose('ruleForm')"
- width="500px"
- >
- <el-form :model="handleForm" label-position="top" ref="ruleForm">
- <el-form-item
- label="处理方式"
- prop="memo"
- :rules="[
- { required: true, message: '请输入处理方式', trigger: 'blur' },
- ]"
- >
- <el-input type="textarea" v-model.trim="handleForm.memo"></el-input>
- </el-form-item>
- </el-form>
- <span slot="footer" class="dialog-footer">
- <el-button @click="handleStatus = false">取 消</el-button>
- <el-button @click="onHandleSubmit('ruleForm')" type="primary"
- >确 定</el-button
- >
- </span>
- </el-dialog>
- </div>
- </template>
- <script>
- import pagination from "@/components/Pagination/index";
- import LookDetail from "@/views/musicInspection/modals/lookDetail";
- import dayjs from "dayjs";
- import { inspectionItemPlan, updateMemo } from "@/views/musicInspection/api";
- import { queryByOrganId } from "@/api/systemManage";
- import { getTeamList } from "@/api/teamServer";
- import { getTimes } from "@/utils";
- import { Export } from "@/utils/downLoadFile";
- import gpsLoction from "@/views/teamDetail/componentCourse/gpsLocation";
- import { getErrInspectionData } from "../api";
- export default {
- props: ["searchType"],
- components: { pagination, LookDetail, gpsLoction },
- data() {
- return {
- cooperationList: [],
- musicGroupList: [],
- activeRow: null,
- planDetail: null,
- searchForm: {
- search: null,
- organId: null,
- userId: null,
- // musicGroupId: null,
- conclusionStatus: null,
- cooperationOrganId: null,
- createTimer: [],
- hasDealTime:null
- },
- tableList: [],
- pageInfo: {
- // 分页规则
- limit: 10, // 限制显示条数
- page: 1, // 当前页
- total: 0, // 总条数
- page_size: [10, 20, 40, 50], // 选择限制显示条数
- },
- handleStatus: false,
- handleForm: {
- id: null,
- memo: null,
- },
- tableStatus: false,
- gpsVisible: false,
- };
- },
- async mounted() {
- const { query } = this.$route;
- if (query.organId) {
- this.searchForm.organId = query.organId;
- }
- if (query.conclusionStatus) {
- this.searchForm.conclusionStatus = Number(query.conclusionStatus);
- }
- if (query.start && query.end) {
- this.searchForm.createTimer = [query.start, query.end];
- }
- this.getList();
- // 分部
- await this.$store.dispatch("setBranchs");
- await this.$store.dispatch("setOrganRole");
- // 乐团列表 {只查询进行中的乐团}
- // await getTeamList({ musicGroupStatus: 'PROGRESS', rows: 9999 }).then(res => {
- // if(res.code == 200) {
- // this.musicGroupList = res.data.rows
- // }
- // })
- },
- methods: {
- dayjs,
- reloadSearch() {
- this.rules.page = 1;
- this.getList();
- },
- async getList() {
- // console.log(this.searchType)
- try {
- let { createTimer, ...rest } = this.searchForm;
- let params = {
- ...rest,
- page: this.pageInfo.page,
- rows: this.pageInfo.limit,
- searchType: this.searchType,
- ...getTimes(createTimer, ["startTime", "endTime"]),
- };
- const res = await getErrInspectionData(params);
- this.tableList = res.data.rows;
- this.pageInfo.total = res.data.total;
- } catch (err) {}
- },
- reloadSearch() {
- this.rules.page = 1;
- this.getList();
- },
- onLook(row) {
- this.planDetail = row;
- this.tableStatus = true;
- },
- onGPS(row) {
- this.activeRow = {
- schoolLongitudeLatitude: row.schoolGps,
- signOutLongitudeLatitude: row.submitedGps,
- };
- this.gpsVisible = true;
- },
- async onExport(row) {
- await Export(
- this,
- {
- url: "/api-web/inspectionItemPlanConclusion/exportPlanConclusion",
- fileName: "巡查结果.xls",
- 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(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>
- <style lang='scss' scoped>
- /deep/.el-dialog__body {
- // padding: 10px 20px;
- }
- /deep/.description-title {
- margin: 0 !important;
- }
- </style>
|