From c784b1b2e8384fe2696e88e48e1494bda3b2c024 Mon Sep 17 00:00:00 2001
From: zengh <123456>
Date: Tue, 20 Jul 2021 11:46:49 +0800
Subject: [PATCH] 事件上报—任务下发流程完善
---
src/views/feedbackReport/feedbackReport.vue | 766 ++++++++++++++++++++++++++++++----------------------------
1 files changed, 402 insertions(+), 364 deletions(-)
diff --git a/src/views/feedbackReport/feedbackReport.vue b/src/views/feedbackReport/feedbackReport.vue
index 4ba911d..7aeadaa 100644
--- a/src/views/feedbackReport/feedbackReport.vue
+++ b/src/views/feedbackReport/feedbackReport.vue
@@ -28,386 +28,424 @@
plain
v-if="permission.feedback_delete"
@click="handleDelete"
- >删 除
+ >删 除
</el-button>
</template>
+
+ <template slot-scope="scope" slot="menuLeft">
+ <el-button type="danger" icon="el-icon-plus" size="small" plain @click.stop="$refs.crud.rowAdd()">新增</el-button>
+ </template>
+
+ <template slot-scope="{type,size, row}" slot="menu">
+ <el-button icon="el-icon-check" :size="size" :type="type" @click="setReal(row)">接收</el-button>
+ </template>
+
</avue-crud>
</basic-container>
</template>
<script>
-import {
- getListReport,
- getDetails,
- adds,
- updates,
- remove,
-} from "@/api/feedback/feedback";
-import { getBaTree } from "@/api/client/client";
-import { mapGetters } from "vuex";
+ import {
+ getListReport,
+ getDetails,
+ adds,
+ updates,
+ remove,
+ } from "@/api/feedback/feedback";
+ import {getBaTree} from "@/api/client/client";
+ import {mapGetters} from "vuex";
-export default {
- data() {
- return {
- form: {},
- query: {},
- loading: true,
- page: {
- pageSize: 10,
- currentPage: 1,
- total: 0,
+ export default {
+ data() {
+ return {
+ form: {},
+ query: {},
+ loading: true,
+ page: {
+ pageSize: 10,
+ currentPage: 1,
+ total: 0,
+ },
+ selectionList: [],
+ option: {
+ height: "auto",
+ calcHeight: 54,
+ menuWidth: 330,
+ tip: false,
+ searchShow: true,
+ searchMenuSpan: 6,
+ labelWidth: "125",
+ dialogWidth: 1150,
+ border: false,
+ //stripe:true,
+ index: true,
+ viewBtn: true,
+ selection: true,
+ dialogClickModal: false,
+ images: [],
+ videos: [],
+ column: [
+ {
+ label: "上报人姓名",
+ prop: "sname",
+ search: true,
+ searchLabelWidth: 100,
+ searchSpan: 5,
+ addDisplay: false,
+ editDisplay: false,
+ },
+ {
+ label: "上报人姓名",
+ prop: "snumber",
+ type: "tree",
+ dicUrl: "/api/catalogs/catalogs/getBigTree",
+ props: {
+ label: "title",
+ },
+ width: 72,
+ hide: true,
+ addDisplay: true,
+ editDisplay: true,
+ viewDisplay: false,
+ rules: [
+ {
+ required: true,
+ message: "请选择上报人",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "上报地址",
+ prop: "place",
+ rules: [
+ {
+ required: true,
+ message: "请输入事发地址",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "经度",
+ prop: "jd",
+ },
+ {
+ label: "纬度",
+ prop: "wd",
+ },
+ {
+ label: "备注",
+ prop: "result",
+ rules: [
+ {
+ required: true,
+ message: "请输入处理结果",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "上报时间",
+ prop: "stime",
+ type: "datetime",
+ format: "yyyy-MM-dd HH:mm:ss",
+ valueFormat: "yyyy-MM-dd HH:mm:ss",
+ },
+ {
+ label: "上报时间",
+ prop: "dateTime",
+ type: "datetime",
+ format: "yyyy-MM-dd HH:mm:ss",
+ valueFormat: "yyyy-MM-dd HH:mm:ss",
+ searchRange: true,
+ search: true,
+ searchLabelWidth: 100,
+ searchSpan: 6,
+ addDisplay: false,
+ viewDisplay: false,
+ editDisplay: false,
+ hide: true,
+ rules: [
+ {
+ required: true,
+ message: "请选择上报时间",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "图片",
+ prop: "images",
+ dataType: "array",
+ type: "upload",
+ span: 24,
+ hide: true,
+ viewDisplay: true,
+ listType: "picture-card",
+ action: "/api/blade-resource/oss/endpoint/put-file",
+ propsHttp: {
+ res: "data",
+ url: "link",
+ },
+ },
+ {
+ label: "视频",
+ prop: "videos",
+ dataType: "array",
+ type: "upload",
+ accept: "video/mp4",
+ hide: true,
+ viewDisplay: true,
+ editDisabled: true,
+ listType: "picture",
+ span: 24,
+ action: "http://web.byisf.com:82/blade-jfpts/depl/put-depl",
+ propsHttp: {
+ res: "data",
+ url: "link",
+ },
+ },
+ ],
+ },
+ data: [],
+ };
+ },
+ watch: {
+ handler(val) {
+ var that = this;
+ if (val != null && val != "") {
+ getBaTree(val).then((res) => {
+ if (res) {
+ that.form.sname = res.data.data.records[0].name;
+ }
+ });
+ }
},
- selectionList: [],
- option: {
- height: "auto",
- calcHeight: 54,
- tip: false,
- searchShow: true,
- searchMenuSpan: 6,
- labelWidth: "125",
- dialogWidth: 1150,
- border: false,
- //stripe:true,
- index: true,
- viewBtn: true,
- selection: true,
- dialogClickModal: false,
- images: [],
- videos: [],
- column: [
- {
- label: "上报人姓名",
- prop: "sname",
- search: true,
- searchLabelWidth: 100,
- searchSpan: 5,
- addDisplay: false,
- editDisplay: false,
- },
- {
- label: "上报人姓名",
- prop: "snumber",
- type: "tree",
- dicUrl: "/api/catalogs/catalogs/getBigTree",
- props: {
- label: "title",
- },
- width: 72,
- hide: true,
- addDisplay: true,
- editDisplay: true,
- viewDisplay: false,
- rules: [
- {
- required: true,
- message: "请选择上报人",
- trigger: "blur",
- },
- ],
- },
- {
- label: "上报地址",
- prop: "place",
- rules: [
- {
- required: true,
- message: "请输入事发地址",
- trigger: "blur",
- },
- ],
- },
- {
- label: "备注",
- prop: "result",
- rules: [
- {
- required: true,
- message: "请输入处理结果",
- trigger: "blur",
- },
- ],
- },
- {
- label: "上报时间",
- prop: "stime",
- type: "datetime",
- format: "yyyy-MM-dd HH:mm:ss",
- valueFormat: "yyyy-MM-dd HH:mm:ss",
- },
- {
- label: "上报时间",
- prop: "dateTime",
- type: "datetime",
- format: "yyyy-MM-dd HH:mm:ss",
- valueFormat: "yyyy-MM-dd HH:mm:ss",
- searchRange: true,
- search: true,
- searchLabelWidth: 100,
- searchSpan: 6,
- addDisplay: false,
- viewDisplay: false,
- editDisplay: false,
- hide: true,
- rules: [
- {
- required: true,
- message: "请选择上报时间",
- trigger: "blur",
- },
- ],
- },
- {
- label: "图片",
- prop: "images",
- dataType: "array",
- type: "upload",
- span: 24,
- hide: true,
- viewDisplay: true,
- listType: "picture-card",
- action: "/api/blade-resource/oss/endpoint/put-file",
- propsHttp: {
- res: "data",
- url: "link",
- },
- },
- {
- label: "视频",
- prop: "videos",
- dataType: "array",
- type: "upload",
- accept: "video/mp4",
- hide: true,
- viewDisplay: true,
- editDisabled: true,
- listType: "picture",
- span: 24,
- action: "http://web.byisf.com:82/blade-jfpts/depl/put-depl",
- propsHttp: {
- res: "data",
- url: "link",
- },
- },
- ],
+ },
+ computed: {
+ ...mapGetters(["permission"]),
+ permissionList() {
+ return {
+ addBtn: this.vaildData(this.permission.feedback_add, true),
+ viewBtn: this.vaildData(this.permission.feedback_view, true),
+ delBtn: this.vaildData(this.permission.feedback_delete, true),
+ editBtn: this.vaildData(this.permission.feedback_edit, true),
+ };
},
- data: [],
- };
- },
- watch: {
- handler(val) {
- var that = this;
- if (val != null && val != "") {
- getBaTree(val).then((res) => {
- if (res) {
- that.form.sname = res.data.data.records[0].name;
+ ids() {
+ let ids = [];
+ this.selectionList.forEach((ele) => {
+ ids.push(ele.id);
+ });
+ return ids.join(",");
+ },
+ },
+ methods: {
+ rowSave(row, done, loading) {
+ var data = {
+ status: 1,
+ tpaddress: "",
+ spaddress: "",
+ sname: row.$snumber,
+ snumber: row.snumber,
+ stime: row.stime,
+ result: row.result,
+ place: row.place,
+ };
+ if (row.images.length > 0) {
+ var imageArr = row.images;
+ imageArr.forEach((image) => {
+ data.tpaddress += image + ",";
+ });
+ data.tpaddress = data.tpaddress.substring(0, data.tpaddress.length - 1);
+ }
+ if (row.videos.length > 0) {
+ //var videoArr = row.videos;
+ //videoArr.forEach( video =>{
+ //data.spaddress += video + ",";
+ //})
+ //data.spaddress = data.spaddress.substring(0,data.spaddress.length-1);
+ data.spaddress = row.videos;
+ }
+ adds(data).then(
+ () => {
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ done();
+ },
+ (error) => {
+ loading();
+ window.console.log(error);
+ }
+ );
+ },
+ rowUpdate(row, index, done, loading) {
+ var data = {
+ id: row.id,
+ status: 1,
+ tpaddress: "",
+ spaddress: "",
+ sname: row.$snumber,
+ snumber: row.snumber,
+ stime: row.stime,
+ result: row.result,
+ place: row.place,
+ };
+ if (row.images.length > 0) {
+ var imageArr = row.images;
+ imageArr.forEach((image) => {
+ data.tpaddress += image + ",";
+ });
+ data.tpaddress = data.tpaddress.substring(0, data.tpaddress.length - 1);
+ }
+ if (row.videos.length > 0) {
+ //var videoArr = row.videos;
+ //videoArr.forEach( video =>{
+ //data.spaddress += video + ",";
+ //})
+ //data.spaddress = data.spaddress.substring(0,data.spaddress.length-1);
+ data.spaddress = row.videos;
+ }
+ updates(data).then(
+ () => {
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ done();
+ },
+ (error) => {
+ loading();
+ console.log(error);
+ }
+ );
+ },
+ rowDel(row) {
+ this.$confirm("确定将选择数据删除?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ })
+ .then(() => {
+ return remove(row.id);
+ })
+ .then(() => {
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ });
+ },
+ handleDelete() {
+ if (this.selectionList.length === 0) {
+ this.$message.warning("请选择至少一条数据");
+ return;
+ }
+ this.$confirm("确定将选择数据删除?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ })
+ .then(() => {
+ return remove(this.ids);
+ })
+ .then(() => {
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ this.$refs.crud.toggleSelection();
+ });
+ },
+ beforeOpen(done, type) {
+ if (["edit", "view"].includes(type)) {
+ getDetails(this.form.id).then((res) => {
+ this.form = res.data.data;
+ this.images = res.data.data.images;
+ this.videos = res.data.data.videos;
+ });
+ }
+ done();
+ },
+ searchReset() {
+ this.query = {};
+ this.onLoad(this.page);
+ },
+ //派遣任务
+ setReal(row) {
+ var arr = [];
+ this.$store.state.tags.tagList.forEach((item) => {
+ if (item.label != "任务下发") {
+ arr.push(item);
}
});
- }
- },
- },
- computed: {
- ...mapGetters(["permission"]),
- permissionList() {
- return {
- addBtn: this.vaildData(this.permission.feedback_add, false),
- viewBtn: this.vaildData(this.permission.feedback_view, true),
- delBtn: this.vaildData(this.permission.feedback_delete, true),
- editBtn: this.vaildData(this.permission.feedback_edit, true),
- };
- },
- ids() {
- let ids = [];
- this.selectionList.forEach((ele) => {
- ids.push(ele.id);
- });
- return ids.join(",");
- },
- },
- methods: {
- rowSave(row, done, loading) {
- var data = {
- status: 1,
- tpaddress: "",
- spaddress: "",
- sname: row.$snumber,
- snumber: row.snumber,
- stime: row.stime,
- result: row.result,
- place: row.place,
- };
- if (row.images.length > 0) {
- var imageArr = row.images;
- imageArr.forEach((image) => {
- data.tpaddress += image + ",";
+ this.$store.state.tags.tagList = arr;
+
+ row.bz = row.result;
+ row.sjsb = 1;
+
+ window.sessionStorage.setItem('sjsb', 1)
+
+ this.$router.push({
+ path: `/realTimePolice/index`,
+ query: row
});
- data.tpaddress = data.tpaddress.substring(0, data.tpaddress.length - 1);
- }
- if (row.videos.length > 0) {
- //var videoArr = row.videos;
- //videoArr.forEach( video =>{
- //data.spaddress += video + ",";
- //})
- //data.spaddress = data.spaddress.substring(0,data.spaddress.length-1);
- data.spaddress = row.videos;
- }
- adds(data).then(
- () => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!",
- });
- done();
- },
- (error) => {
- loading();
- window.console.log(error);
- }
- );
- },
- rowUpdate(row, index, done, loading) {
- var data = {
- id: row.id,
- status: 1,
- tpaddress: "",
- spaddress: "",
- sname: row.$snumber,
- snumber: row.snumber,
- stime: row.stime,
- result: row.result,
- place: row.place,
- };
- if (row.images.length > 0) {
- var imageArr = row.images;
- imageArr.forEach((image) => {
- data.tpaddress += image + ",";
- });
- data.tpaddress = data.tpaddress.substring(0, data.tpaddress.length - 1);
- }
- if (row.videos.length > 0) {
- //var videoArr = row.videos;
- //videoArr.forEach( video =>{
- //data.spaddress += video + ",";
- //})
- //data.spaddress = data.spaddress.substring(0,data.spaddress.length-1);
- data.spaddress = row.videos;
- }
- updates(data).then(
- () => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!",
- });
- done();
- },
- (error) => {
- loading();
- console.log(error);
- }
- );
- },
- rowDel(row) {
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(() => {
- return remove(row.id);
- })
- .then(() => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!",
- });
- });
- },
- handleDelete() {
- if (this.selectionList.length === 0) {
- this.$message.warning("请选择至少一条数据");
- return;
- }
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(() => {
- return remove(this.ids);
- })
- .then(() => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!",
- });
- this.$refs.crud.toggleSelection();
- });
- },
- beforeOpen(done, type) {
- if (["edit", "view"].includes(type)) {
- getDetails(this.form.id).then((res) => {
- this.form = res.data.data;
- this.images = res.data.data.images;
- this.videos = res.data.data.videos;
- });
- }
- done();
- },
- searchReset() {
- this.query = {};
- this.onLoad(this.page);
- },
- searchChange(params, done) {
- this.query = params;
- this.page.currentPage = 1;
- this.onLoad(this.page, params);
- done();
- },
- selectionChange(list) {
- this.selectionList = list;
- },
- selectionClear() {
- this.selectionList = [];
- this.$refs.crud.toggleSelection();
- },
- currentChange(currentPage) {
- this.page.currentPage = currentPage;
- },
- sizeChange(pageSize) {
- this.page.pageSize = pageSize;
- },
- refreshChange() {
- this.onLoad(this.page, this.query);
- },
- onLoad(page, params = { status: 1 }) {
- const { dateTime } = this.query;
- let values = {
- ...params,
- status: 1,
- };
- if (dateTime) {
- values = {
+ },
+ searchChange(params, done) {
+ this.query = params;
+ this.page.currentPage = 1;
+ this.onLoad(this.page, params);
+ done();
+ },
+ selectionChange(list) {
+ this.selectionList = list;
+ },
+ selectionClear() {
+ this.selectionList = [];
+ this.$refs.crud.toggleSelection();
+ },
+ currentChange(currentPage) {
+ this.page.currentPage = currentPage;
+ },
+ sizeChange(pageSize) {
+ this.page.pageSize = pageSize;
+ },
+ refreshChange() {
+ this.onLoad(this.page, this.query);
+ },
+ onLoad(page, params = {status: 1}) {
+ const {dateTime} = this.query;
+ let values = {
...params,
- begTime: dateTime[0],
- endTime: dateTime[1],
- ...this.query,
+ status: 1,
};
- values.dateTime = null;
- }
- this.loading = true;
- getListReport(page.currentPage, page.pageSize, values).then((res) => {
- const data = res.data.data;
- this.page.total = data.total;
- this.data = data.records;
- this.loading = false;
- this.selectionClear();
- });
+ if (dateTime) {
+ values = {
+ ...params,
+ begTime: dateTime[0],
+ endTime: dateTime[1],
+ ...this.query,
+ };
+ values.dateTime = null;
+ }
+ this.loading = true;
+ getListReport(page.currentPage, page.pageSize, values).then((res) => {
+ const data = res.data.data;
+ this.page.total = data.total;
+ this.data = data.records;
+ this.loading = false;
+ this.selectionClear();
+ });
+ },
},
- },
-};
+ };
</script>
<style>
--
Gitblit v1.9.3