| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695 |
- <!-- -->
- <template>
- <div :style="{'height':testHeight1+'px'}">
- <!-- 查询展示 -->
- <div class="search" style="margin-top:10px;height:49vh">
- <el-table
- border
- :height="tableHeight"
- ref="multipleTable"
- :data="searchResult"
- tooltip-effect="dark"
- style="width: 100%"
- >
- <el-table-column align="center" type="index" label="序号" min-width="60" fixed>
- <template slot-scope="scope">{{ (currentPage - 1) * pageSize + (scope.$index + 1) }}</template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="55"
- prop="inspPblmCate"
- label="程度"
- fixed
- >
- <template slot-scope="scope">
- <p style="color:#27C19F;" v-if="scope.row.inspPblmCate == 0">一般</p>
- <p style="color:#E6A23C;" v-if="scope.row.inspPblmCate == 1">较重</p>
- <p style="color:#F56C6C;" v-if="scope.row.inspPblmCate == 2">严重</p>
- <p style="color:#F56C6C;" v-if="scope.row.inspPblmCate == 3">特别严重</p>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="60"
- prop="province"
- label="省" v-if="isXj"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="60"
- prop="city"
- :label="ownAdName"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="60"
- prop="country"
- label="县"
- v-if="isXj"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="120"
- prop="nm"
- label="督查水闸名称"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="140"
- prop="inspPblmsName"
- label="问题类别"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="230"
- prop="checkPoint"
- label="检查项目"
- show-overflow-tooltip
- ></el-table-column>
- <!-- <el-table-column
- header-align="center"
- align="center"
- min-width="60"
- prop="ifCasePblm"
- label="典型"
- >
- <template slot-scope="scope">
- <p v-if="scope.row.ifCasePblm == 1">是</p>
- <p v-if="scope.row.ifCasePblm == 0">否</p>
- </template>
- </el-table-column>-->
- <el-table-column
- header-align="center"
- align="center"
- min-width="80"
- prop="persName"
- label="上报人"
- ></el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="80"
- show-overflow-tooltip
- prop="orgNm"
- label="所在组"
- ></el-table-column>
- <el-table-column
- prop="collTime"
- label="上报时间"
- :formatter="timestampToTime"
- sortable
- align="center"
- min-width="120"
- show-overflow-tooltip
- ></el-table-column>
- </el-table>
- <!-- 分页 -->
- <div class="paginationWarpper">
- <el-pagination
- class="paginationCenter"
- background
- @size-change="handleSizeChange"
- @current-change="search"
- :current-page.sync="currentPage"
- :page-sizes="[10, 20, 50, 100]"
- :page-size="pageSize"
- layout="total, sizes, prev, pager, next, jumper"
- :total="total"
- ></el-pagination>
- </div>
- </div>
- </div>
- </template>
- <script>
- //这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
- //例如:import 《组件名称》 from '《组件路径》';
- import {
- findPageInfoShuiKu,
- getShuiKuWenTi,
- getXSKProblemNewExport,
- findPageInfo,
- getSzwtTable,
- removeSupervise,
- showDetailsXq,
- submitUpload,
- creatSupervise,
- getSupervisdByID,
- deleteFileById,
- updatelist,
- getEngId,
- } from "@api/duChaAPI.js";
- import request from "@util/gw_ajax_request.js";
- import { hostUrl } from "@util/global_variable.js";
- import elaudio from "@widget/elAudioShort.vue";
- import inuptWithDuChaTreeNode from "@widget/inuptWithDuChaTreeNode.vue";
- import inputWidthDuChaNodes from "@widget/inputWithDuChaNodes.vue";
- import inputWidthDuChaShuiKu from "@widget/inputWith_sk.vue";
- export default {
- //import引入的组件需要注入到对象中才能使用
- components: {
- //详情页
- supervisionDetails: resolve => {
- require(["../../../../duChaWenTi/supervisionDetails_shuiku.vue"], resolve);
- },
- },
- props: ["activedName","currentResCode"],
- data() {
- //这里存放数据
- return {
- testHeight1:window.innerHeight * 0.5,
- tableHeight: window.innerHeight - 380,
- supervisionState: [
- {
- value: "0",
- label: "一般"
- },
- {
- value: "1",
- label: "较重"
- },
- {
- value: "2",
- label: "严重"
- },
- {
- value: "3",
- label: "特别严重"
- }
- ],
- supervision: [
- {
- value: "1",
- label: "是"
- },
- {
- value: "0",
- label: "否"
- }
- ],
- updateIdXiuGai: "",
- pblmId: "",
- addPicPanel: false,
- supervisionDetailsVisible:false,
- currentProblemId: "",
- currentPage: 1, // 页码
- pageSize: 20,
- loading: false,
- total: 0, // 总数
- searchResult: [], // 结果
- userId: localStorage.getItem("userid"),
- pictureArray: [],
- audioArray: [],
- videoArray: [],
- fileArray: [],
- audiotabName: "",
- videotabName: "",
- filetabName:"",
- picturetabName: "",
- deleteId: "",
- playerOptions: {
- height: "120",
- autoplay: true,
- muted: true,
- language: "en",
- playbackRates: [0.7, 1.0, 1.5, 2.0],
- sources: [
- {
- type: "video/mp4",
- // mp4
- src: "http://vjs.zencdn.net/v/oceans.mp4"
- // webm
- // src: "https://cdn.theguardian.tv/webM/2015/07/20/150716YesMen_synd_768k_vp8.webm"
- },
- {
- type: "video/mp4",
- // mp4
- src: "http://vjs.zencdn.net/v/oceans.mp4"
- // webm
- // src: "https://cdn.theguardian.tv/webM/2015/07/20/150716YesMen_synd_768k_vp8.webm"
- },
- {
- type: "video/mp4",
- // mp4
- src: "http://vjs.zencdn.net/v/oceans.mp4"
- // webm
- // src: "https://cdn.theguardian.tv/webM/2015/07/20/150716YesMen_synd_768k_vp8.webm"
- },
- {
- type: "video/mp4",
- // mp4
- src: "http://vjs.zencdn.net/v/oceans.mp4"
- // webm
- // src: "https://cdn.theguardian.tv/webM/2015/07/20/150716YesMen_synd_768k_vp8.webm"
- }
- ]
- },
- changeSupervisionVisible: false,
- changeSupervisionLoading: false,
- changeSupervision: {
- nm: "",
- presId: localStorage.getItem("userid"),
- endTime: "",
- pblmId: "",
- objId: "",
- objType: "",
- inspGroupId: "",
- inspPblmName: "",
- inspPblmDesc: "",
- pblmLong: "",
- pblmLat: "",
- pblmStat: "",
- ifCasePblm: "",
- inspPblmOrgName: "",
- pblmPersName: "",
- inspPblmCate: "",
- reviOpin: "",
- reviConc: "",
- reviOrgGuid: "",
- collTime: "",
- recPers: "",
- gwComFiles: [
- {
- id: "",
- filePath: "",
- bizId: ""
- }
- ]
- },
- // 文件弹框
- fileList: [], // 当前文件列表
- flash: false,
- // 督查类型
- supervisionTypeList: [
- {
- value: "1",
- label: "小水库"
- }
- ],
- leibie: [],
- // 查询
- value6: [],
- findParams: {
- hasVedio:"",
- adCode: "",
- pblmStat: "",
- inspPblmCate: "",
- ifCasePblm: "",
- nm: "",
- rsName: "",
- adFullName: "",
- startTime: "",
- endTime: "",
- objType: 1,
- inspPblmName: "",
- persId: localStorage.getItem("userid")
- },
- currentPage: 1, // 页码
- pageSize: 20, // 条数
- loading: false,
- total: 0, // 总数
- searchResult: [], // 结果
- crId: "", // 当前督查id
- // 督查详情
- userid: localStorage.getItem("userid"),
- supervisionDetailsVisible: false,
- problemDeleteVisible: false,
- supervisionDetails: {},
- pblmId: "",
- gwComFiles: [],
- pblscr: "",
- pblscrList: [
- {
- lable: "我的问题",
- value: localStorage.getItem("userid")
- }
- ],
- pblscrGroup: ""
- };
- },
- //监听属性 类似于data概念
- computed: {
- hostUrl(){
- return hostUrl
- }
- },
- //监控data中的数据变化
- watch: {
- activedName() {
- this.search();
- },
- currentResCode(oldValue,newValue){
- this.currentResCode = newValue;
- this.search();
- }
- },
- //方法集合
- methods: {
- handleSizeChange(pageSize) {
- this.pageSize = pageSize;
- this.search();
- },
- // 查询
- search() {
- this.loading = true;
- let _self = this;
- let data = {};
- data["gateName"] = "";
- data["inspPblmName"] = "";
- data["objType"] = 6;
- data["persId"] = _self.userId;
- data["pageNum"] = _self.currentPage;
- data["recPers"] = _self.userId;
- data["pageSize"] = _self.pageSize;
- data["villType"] = "7";
- data["codes"] = _self.currentResCode;
- getSzwtTable(data).then(res => {
- _self.loading = false;
- if (res.success) {
- _self.searchResult = res.data.list;
- _self.total = res.data.total;
- } else {
- }
- });
- },
- timestampToTime(row, column) {
- var date = new Date(row.collTime);
- var Y = date.getFullYear() + "-";
- var M =
- (date.getMonth() + 1 < 10
- ? "0" + (date.getMonth() + 1)
- : date.getMonth() + 1) + "-";
- var D =
- (date.getDate() < 10 ? "0" + date.getDate() : date.getDate()) + " ";
- var h =
- (date.getHours() < 10 ? "0" + date.getHours() : date.getHours()) + ":";
- var m =
- date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
- return Y + M + D + h + m;
- },
- // 详情弹框
- showDetails(id) {
- this.currentProblemId = id;
- this.supervisionDetailsVisible = true;
- },
- // 修改弹窗显示
- changeSup(id) {
- this.pictureArray = [];
- this.audioArray = [];
- this.videoArray = [];
- this.fileArray = [];
- this.updateIdXiuGai = id;
- showDetailsXq(this.updateIdXiuGai).then(res => {
- // if(this.usersId==)
- this.changeSupervision = res.data;
- this.changeSupervisionVisible = true;
- res.data.gwComFiles.forEach(item => {
- if (
- item.fileExt == "mp3" ||
- item.fileExt == "MP3" ||
- item.fileExt == "m4a"
- ) {
- this.audioArray.push(item);
- } else if (
- item.fileExt == "jpg" ||
- item.fileExt == "JPG" ||
- item.fileExt == "png" ||
- item.fileExt == "PNG" ||
- item.fileExt == "JPEG" ||
- item.fileExt == "jpeg"
- ) {
- this.pictureArray.push(item);
- } else if (item.fileExt == "mp4" || item.fileExt == "MP4") {
- this.videoArray.push({
- id: item.id,
- bizId: item.bizId,
- width: "130",
- height: "130",
- autoplay: false,
- muted: true,
- language: "en",
- playbackRates: [0.7, 1.0, 1.5, 2.0],
- sources: [
- {
- type: "video/mp4",
- // mp4
- src: `${this.hostUrl}/${item.filePath}`,
- // webm
- // src: "https://cdn.theguardian.tv/webM/2015/07/20/150716YesMen_synd_768k_vp8.webm"
- }
- ]
- });
- }else{
- this.fileArray.push(item);
- }
- });
- this.picturetabName = "图片资料(" + this.pictureArray.length + ")";
- this.audiotabName = "音频资料(" + this.audioArray.length + ")";
- this.videotabName = "视频资料(" + this.videoArray.length + ")";
- this.filetabName = "其它资料(" + this.fileArray.length + ")";
- });
- },
- // 提交修改信息
- changeSupervisionInfo() {
- this.changeSupervisionVisible = true;
- this.$refs.changeSupFrom.validate(valid => {
- if (valid) {
- this.changeSupervisionLoading = true;
- let data = this.changeSupervision;
- updatelist(data).then(res => {
- this.pblmId = res.data.pblmId;
- this.gwComFiles = res.data.gwComFiles;
- if (res.success) {
- this.removeNewSupervision();
- this.successInfo();
- if (this.$refs.uploadFile.submitUpload(data.pblmId)) {
- this.removeNewSupervision();
- this.successInfo();
- this.addPicPanel = false;
- this.changeSupervisionLoading = false;
- }
- } else {
- this.failInfo();
- }
- });
- }
- });
- },
- removeNewSupervision(arg) {
- if (arg) {
- console.log(arg);
- var args = this.gwComFiles.concat(arg);
- this.updatefilelist(args);
- }
- this.search();
- this.gwComFiles = [];
- this.newSupervisionVisible = false;
- this.changeSupervisionVisible = false;
- this.newSupervision = {
- id: "",
- checkPoint: "",
- presId: localStorage.getItem("userid"),
- dataStat: "",
- nm: "",
- endTime: "",
- pblmId: "",
- objId: "",
- objType: "",
- inspGroupId: "",
- inspPblmCate: "",
- inspPblmName: "",
- inspPblmDesc: "",
- pblmLong: "",
- pblmLat: "",
- pblmStat: "",
- ifCasePblm: "",
- inspPblmOrgName: "",
- pblmPersName: "",
- inspPblmCate: "",
- reviOpin: "",
- reviConc: "",
- reviOrgGuid: "",
- collTime: "",
- recPers: "",
- note: ""
- };
- // this.$refs.uploadFile.init();
- },
- // 删除图片文件
- removeFile(id, index) {
- // this.updateIdXiuGai = this.updateIdXiuGai;
- var _self = this;
- this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "返回",
- type: "warning"
- }).then(
- res => {
- if (res === "confirm") {
- deleteFileById(id, this.userId).then(res => {
- if (res.success) {
- // this.changeSupervision.gwComFiles.splice(index, 1);
- this.changeSupervision.gwComFiles.forEach(item => {
- if (
- item.fileExt == "mp3" ||
- item.fileExt == "MP3" ||
- item.fileExt == "m4a"
- ) {
- this.audiotabName.splice(index, 1);
- } else if (
- item.fileExt == "jpg" ||
- item.fileExt == "JPG" ||
- item.fileExt == "png" ||
- item.fileExt == "PNG" ||
- item.fileExt == "JPEG" ||
- item.fileExt == "jpeg"
- ) {
- this.pictureArray.splice(index, 1);
- } else if (item.fileExt == "mp4" || item.fileExt == "MP4") {
- this.videoArray.splice(index, 1);
- }
- });
- _self.changeSup(this.updateIdXiuGai);
- } else {
- this.failInfo();
- }
- });
- }
- },
- res => {
- console.log("返回");
- }
- );
- },
- // 操作成功反馈
- successInfo() {
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- },
- // 操作失败反馈
- failInfo(val) {
- this.$message.error(val);
- },
- // 清空选择
- toggleSelection(rows) {
- this.$refs.multipleTable.clearSelection();
- },
- // 已选择项
- handleSelectionChange(val) {
- this.multipleSelection = val;
- },
- // 文件上传
- submitUpload() {
- this.$refs.upload.submit();
- },
- handleRemove(file, fileList) {
- console.log(file, fileList);
- },
- handlePreview(file) {
- console.log(file);
- },
- addPic() {
- this.addPicPanel = !this.addPicPanel;
- },
- // 删除弹窗
- removeSuperviseOne(id) {
- this.deleteId = id;
- this.problemDeleteVisible = true;
- },
- deleteSuccess() {
- this.problemDeleteVisible = false;
- this.search();
- },
- changeSupervisionVisiblefalse() {
- this.$nextTick(() => {
- if (this.flash) {
- this.flash = false;
- this.search();
- }
- });
- this.changeSupervisionVisible = false;
- this.changeSupervision = {
- dataStat: "",
- nm: "",
- endTime: "",
- pblmId: "",
- objId: "",
- objType: "",
- inspGroupId: "",
- inspPblmCate: "",
- inspPblmName: "",
- inspPblmDesc: "",
- pblmLong: "",
- pblmLat: "",
- pblmStat: "",
- ifCasePblm: "",
- inspPblmOrgName: "",
- pblmPersName: "",
- inspPblmCate: "",
- reviOpin: "",
- reviConc: "",
- reviOrgGuid: "",
- collTime: "",
- recPers: "",
- note: "",
- gwComFiles: [
- {
- id: "",
- filePath: "",
- bizId: ""
- }
- ]
- };
- this.$refs.uploadFile.init();
- this.addPicPanel = false;
- },
- },
- //生命周期 - 创建完成(可以访问当前this实例)
- created() {
- this.addPicPanel = false;
- if (this.userId) {
- console.log("已经登录");
- this.search();
- } else {
- this.$router.push("/login");
- }
- },
- //生命周期 - 挂载完成(可以访问DOM元素)
- mounted() {
- this.search();
- },
- beforeCreate() {}, //生命周期 - 创建之前
- beforeMount() {}, //生命周期 - 挂载之前
- beforeUpdate() {}, //生命周期 - 更新之前
- updated() {}, //生命周期 - 更新之后
- beforeDestroy() {}, //生命周期 - 销毁之前
- destroyed() {}, //生命周期 - 销毁完成
- activated() {} //如果页面有keep-alive缓存功能,这个函数会触发
- };
- </script>
- <style rel="stylesheet/scss" lang="scss" scoped>
- </style>
|