Commit ed98a465 by 西瓜

类案串并新增

parent 79960f92
......@@ -212,6 +212,14 @@
<el-button size="small" @click="clearData" style="width: 100px"
>清空
</el-button>
<el-button
v-if="pageBszfc == 'rgcb'"
type="success"
size="small"
@click="goNew"
style="width: 100px"
>新增
</el-button>
</div>
</div>
</div>
......@@ -297,7 +305,7 @@
id="open"
v-show="
scope.row[columnTitle.prop] != '' &&
scope.row[columnTitle.prop] != null
scope.row[columnTitle.prop] != null
"
>展开</a
>
......@@ -314,7 +322,7 @@
id="stop"
v-show="
scope.row[columnTitle.prop] != '' &&
scope.row[columnTitle.prop] != null
scope.row[columnTitle.prop] != null
"
>收起</a
>
......@@ -365,7 +373,7 @@
id="open"
v-show="
scope.row[columnTitle.prop] != '' &&
scope.row[columnTitle.prop] != null
scope.row[columnTitle.prop] != null
"
>展开</a
>
......@@ -382,7 +390,7 @@
id="stop"
v-show="
scope.row[columnTitle.prop] != '' &&
scope.row[columnTitle.prop] != null
scope.row[columnTitle.prop] != null
"
>收起</a
>
......@@ -434,7 +442,7 @@
"
@click="goDetail(scope.row, 'xsz')"
v-if="scope.row['cbzjczqs']"
>{{ scope.row["cbzjczqs"] }}</span
>{{ scope.row['cbzjczqs'] }}</span
>
</div>
<div v-else v-html="scope.row[columnTitle.prop]"></div>
......@@ -480,48 +488,48 @@
</template>
<script>
import SelectTree from "@c/tree_components.vue";
import SelectTreeDialog from "@c/treeCode_components.vue";
import LazySelectTreeDialog from "@c/lazy_treeCode_components.vue";
import Http from "@/utils/http.js";
import axios from "axios";
import { esAsjQuery } from "@/api/queryAj.js";
import { toQueryXszxx, updateCbxsz } from "@/api/cbyp.js";
import { get, post, postform } from "@/utils/http.js";
import SelectTree from '@c/tree_components.vue'
import SelectTreeDialog from '@c/treeCode_components.vue'
import LazySelectTreeDialog from '@c/lazy_treeCode_components.vue'
import Http from '@/utils/http.js'
import axios from 'axios'
import { esAsjQuery } from '@/api/queryAj.js'
import { toQueryXszxx, updateCbxsz } from '@/api/cbyp.js'
import { get, post, postform } from '@/utils/http.js'
export default {
name: "ptCxForm",
name: 'ptCxForm',
components: {
SelectTree,
SelectTreeDialog,
LazySelectTreeDialog,
LazySelectTreeDialog
},
props: {
pageBs: String,
cxQueryField: {
type: Array,
default: () => [],
default: () => []
},
cxDefaultFormThead: {
type: Array,
default: () => [],
default: () => []
},
cxDefaultFormTheads: {
type: Array,
default: () => [],
default: () => []
},
cxFormData: Object,
cxUrl: String,
childrenUrl:String,
childrenUrl: String,
header: String,
pageFlag: String,
pageFlag: String
},
data() {
data () {
return {
tPage: null,
checkResult: true,
asjbh: "",
spType: "",
asjbh: '',
spType: '',
pageBszfc: this.pageBs,
tableLoading: true, //loading
currentPage1: 1, //表格页码
......@@ -531,335 +539,337 @@ export default {
propQueryField: this.cxQueryField, //查询条件
key: 1, //table得key
tableDataLength: 0, //表格总数
talbeBhgCount: "", // 不合格
talbehgCount: "", // 合格
talbeBhgCount: '', // 不合格
talbehgCount: '', // 合格
tableData: [], //表格数据
propdefaultFormThead: this.cxDefaultFormThead, //表格表头
propdefaultFormTheads: this.cxDefaultFormTheads, //子表格表头
excelHeader: "案件标注",
cz: this.pageFlag,
};
excelHeader: '案件标注',
cz: this.pageFlag
}
},
methods: {
turnToEdit(val, type) {
if (type == "delete") {
this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
// 新增按钮
goNew () {
this.$router.pushToTab({
path: 'xzrgcb'
})
},
turnToEdit (val, type) {
if (type == 'delete') {
this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
updateCbxsz({
cbxszbhs: val.xszajbh,
}).then((res) => {
cbxszbhs: val.xszajbh
}).then(res => {
if (res.code == 200) {
this.doQuery("yes");
this.doQuery('yes')
} else {
this.$message({
type: "error",
message: "删除失败",
});
type: 'error',
message: '删除失败'
})
}
this.$options.methods.doQuery();
});
this.$options.methods.doQuery()
})
this.$message({
type: "success",
message: "删除成功!",
});
type: 'success',
message: '删除成功!'
})
})
.catch(() => {
this.$message({
type: "info",
message: "已取消删除",
});
});
} else if (type == "add") {
debugger;
type: 'info',
message: '已取消删除'
})
})
} else if (type == 'add') {
debugger
this.$router.pushToTab({
path: "cbaAdd",
path: 'cbaAdd',
query: {
xszajbh: row.xszajbh,
cbxgfwbzh: row.xszajbh,
},
});
cbxgfwbzh: row.xszajbh
}
})
}
},
rowClick(row, column, event) {
var self = this;
self.showLoading();
let formData = {};
(formData.xszajbh = row.xszajbh),
rowClick (row, column, event) {
var self = this
self.showLoading()
let formData = {}
;(formData.xszajbh = row.xszajbh),
(formData.start = 1),
(formData.length = 10);
var index = self.tableData.findIndex(
(item) => item.xszajbh == row.xszajbh
);
post(this.childrenUrl, formData).then((response) => {
(formData.length = 10)
var index = self.tableData.findIndex(item => item.xszajbh == row.xszajbh)
post(this.childrenUrl, formData).then(response => {
if (response.code == 200) {
self.tableData[index].children = response.data.data;
self.closeLoading();
self.tableData[index].children = response.data.data
self.closeLoading()
} else {
/*self.$message({
type: "error",
message: response.data.message
});*/
self.closeLoading();
self.closeLoading()
}
});
})
},
goDetail(scope, type) {
if (type == "detail") {
goDetail (scope, type) {
if (type == 'detail') {
this.$router.pushToTab({
path: "ajbzDetail",
path: 'ajbzDetail',
query: {
asjbh: scope.asjbh,
},
});
}else if(type == "qg"){
asjbh: scope.asjbh
}
})
} else if (type == 'qg') {
this.$router.pushToTab({
path: "qgxxxx",
path: 'qgxxxx',
query: {
xszajbh: scope.xszajbh,
cbxgfwbzh: scope.cbxgfwbzh,
},
});
}else if(type == "xsz"){
cbxgfwbzh: scope.cbxgfwbzh
}
})
} else if (type == 'xsz') {
this.$router.pushToTab({
path: "hbxsz",
path: 'hbxsz',
query: {
xszajbh: scope.xszajbh,
hbxszType: scope.hbxszType,
},
});
hbxszType: scope.hbxszType
}
})
}
},
export2Excel() {
export2Excel () {
/*导出*/
let self = this,
tHeader = [],
filterVal = [];
filterVal = []
if (self.tableDataLength > 5000) {
self.$message({
type: "error",
message: "最多只能导出5000条",
});
type: 'error',
message: '最多只能导出5000条'
})
} else {
const loading = this.$loading({
lock: true,
text: "正在导出...",
spinner: "el-icon-loading",
background: "rgba(255, 255, 255, 0.7)",
});
let formDatas = {};
text: '正在导出...',
spinner: 'el-icon-loading',
background: 'rgba(255, 255, 255, 0.7)'
})
let formDatas = {}
for (let i in self.formData) {
if (i != "cxSj") {
formDatas[i] = self.formData[i];
if (i != 'cxSj') {
formDatas[i] = self.formData[i]
} else {
formDatas[i] =
self.formData[i] != "" && self.formData[i] != null
? self.formData[i].join(" - ")
: "";
self.formData[i] != '' && self.formData[i] != null
? self.formData[i].join(' - ')
: ''
}
}
formDatas.page = 1;
formDatas.rows = 5000;
tHeader = [];
filterVal = [];
self.propdefaultFormThead.forEach((val) => {
tHeader.push(val.label);
filterVal.push(val.prop);
});
post(this.cxUrl, formDatas).then((res) => {
formDatas.page = 1
formDatas.rows = 5000
tHeader = []
filterVal = []
self.propdefaultFormThead.forEach(val => {
tHeader.push(val.label)
filterVal.push(val.prop)
})
post(this.cxUrl, formDatas).then(res => {
if (res.code === 200) {
require.ensure([], () => {
const { export_json_to_excel } = require("../utils/Export2Excel");
const list = res.data;
const data = self.formatJson(filterVal, list);
export_json_to_excel(tHeader, data, self.excelHeader);
});
const { export_json_to_excel } = require('../utils/Export2Excel')
const list = res.data
const data = self.formatJson(filterVal, list)
export_json_to_excel(tHeader, data, self.excelHeader)
})
// loading.close();
} else {
// loading.close();
self.$message({
type: "error",
message: "查询失败",
});
type: 'error',
message: '查询失败'
})
}
self.tableLoadingEmit = false;
});
self.tableLoadingEmit = false
})
}
},
delectByAjbh(asjbh) {
var self = this;
this.$confirm("删除后不可恢复,是否删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
message: "删除成功!",
delectByAjbh (asjbh) {
var self = this
this.$confirm('删除后不可恢复,是否删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
message: '删除成功!'
})
.then(() => {})
.catch(() => {
this.$message({
type: "info",
message: "已取消删除",
});
});
type: 'info',
message: '已取消删除'
})
})
},
toXg(item, type) {
toXg (item, type) {
let routeData = this.$router.resolve({
path: "/malamodify",
query: { asjbh: item.asjbh, type: type },
});
window.open(routeData.href, "_blank");
path: '/malamodify',
query: { asjbh: item.asjbh, type: type }
})
window.open(routeData.href, '_blank')
},
toLasxxg(asjbh, type, type2) {
toLasxxg (asjbh, type, type2) {
let routeData = this.$router.resolve({
path: "/malasxmodify",
query: { asjbh: asjbh, type: type, type2 },
});
window.open(routeData.href, "_blank");
path: '/malasxmodify',
query: { asjbh: asjbh, type: type, type2 }
})
window.open(routeData.href, '_blank')
},
closeLoading() {
this.tableLoading = false;
closeLoading () {
this.tableLoading = false
},
showLoading() {
this.tableLoading = true;
showLoading () {
this.tableLoading = true
},
handleSizeChange(val) {
this.page_size = val;
this.formData.rows = val;
this.doQuery("yes");
handleSizeChange (val) {
this.page_size = val
this.formData.rows = val
this.doQuery('yes')
},
clearData() {
let self = this;
clearData () {
let self = this
for (let i in self.formData) {
if (
i != "rows" &&
i != "page" &&
i != "typeFlag" &&
i != "unitcode" &&
i != "grade" &&
i != "flwssfhgpdbz"
i != 'rows' &&
i != 'page' &&
i != 'typeFlag' &&
i != 'unitcode' &&
i != 'grade' &&
i != 'flwssfhgpdbz'
) {
self.formData[i] = "";
self.formData[i] = ''
}
}
self.formData["rows"] = 10;
self.formData["page"] = 1;
self.formData['rows'] = 10
self.formData['page'] = 1
},
formatJson(filterVal, jsonData) {
let arr = [];
jsonData.map((v) => {
let arr1 = [];
filterVal.map((j) => {
if (j.indexOf(",") != -1) {
let arr = j.split(",");
let data = "";
formatJson (filterVal, jsonData) {
let arr = []
jsonData.map(v => {
let arr1 = []
filterVal.map(j => {
if (j.indexOf(',') != -1) {
let arr = j.split(',')
let data = ''
for (let i = 0; i <= arr.length - 1; i++) {
data += arr[i].split(":")[0] + ":" + v[arr[i].split(":")[1]];
data += arr[i].split(':')[0] + ':' + v[arr[i].split(':')[1]]
}
arr1.push(data);
arr1.push(data)
} else {
arr1.push(v[j]);
arr1.push(v[j])
}
});
arr.push(arr1);
});
return arr;
})
arr.push(arr1)
})
return arr
},
handleCurrentChange(val) {
this.currentPage1 = val;
this.formData.page = val;
this.doQuery("yes");
handleCurrentChange (val) {
this.currentPage1 = val
this.formData.page = val
this.doQuery('yes')
},
tableRowClassName({ rowIndex }) {
tableRowClassName ({ rowIndex }) {
if (rowIndex % 2 == 0) {
return "";
return ''
} else {
return "success-row";
return 'success-row'
}
},
doQueryBtn(val) {
doQueryBtn (val) {
if (val) {
this.formData.sfhgpdbz = "";
this.formData.sfhgpdbz = ''
}
this.formData.page = 1;
this.doQuery("yes");
this.formData.page = 1
this.doQuery('yes')
},
doQuery(flag) {
this.showLoading();
doQuery (flag) {
this.showLoading()
let self = this,
formDatas = {};
formDatas = {}
for (let i in self.formData) {
if (i != "cxSj") {
formDatas[i] = self.formData[i];
if (i != 'cxSj') {
formDatas[i] = self.formData[i]
} else {
formDatas[i] =
self.formData[i] != "" && self.formData[i] != null
? self.formData[i].join(" - ")
: "";
self.formData[i] != '' && self.formData[i] != null
? self.formData[i].join(' - ')
: ''
}
}
if (flag) {
post(this.cxUrl, formDatas).then((response) => {
post(this.cxUrl, formDatas).then(response => {
if (response.code == 200) {
response.data.data.forEach((item) => {
item.children = [];
item.xszmc = `${item.cbajAjmc}(组号:${item.xszajbh})`;
item.cbajAjmc = `${item.cbajAjmc}(组号:${item.xszajbh})`;
});
self.tableData = response.data.data;
self.tableDataLength = response.data.iTotalRecords;
self.tPage = Math.ceil(
response.data.iTotalRecords / self.page_size
);
self.closeLoading();
response.data.data.forEach(item => {
item.children = []
item.xszmc = `${item.cbajAjmc}(组号:${item.xszajbh})`
item.cbajAjmc = `${item.cbajAjmc}(组号:${item.xszajbh})`
})
self.tableData = response.data.data
self.tableDataLength = response.data.iTotalRecords
self.tPage = Math.ceil(response.data.iTotalRecords / self.page_size)
self.closeLoading()
} else {
/*self.$message({
type: "error",
message: response.data.message
});*/
self.closeLoading();
self.closeLoading()
}
});
})
}
},
}
},
mounted() {
let self = this;
mounted () {
let self = this
/*获取字典*/
self.propQueryField.forEach((val) => {
if (val.type == "code" || val.type == "codeTreeDialog") {
self.propQueryField.forEach(val => {
if (val.type == 'code' || val.type == 'codeTreeDialog') {
if (val.codeOptions.length == 0) {
axios
.get(`JsonData/${val.codeTree}.json`)
.then((res) => {
self.$set(val, "codeOptions", res.data.data.rows);
.then(res => {
self.$set(val, 'codeOptions', res.data.data.rows)
})
.catch(err => {
console.log(err)
})
.catch((err) => {
console.log(err);
});
}
}
});
self.doQuery("yes");
})
self.doQuery('yes')
},
computed: {
//过滤掉重大伤亡重复人员等的操作列
ifShowOperation() {
ifShowOperation () {
return (
this.pageBszfc != "zczjcfry" &&
this.pageBszfc != "zdswxxgl" &&
this.pageBszfc != "cfryIndex" &&
this.pageBszfc != "jsbhgl"
);
},
},
};
this.pageBszfc != 'zczjcfry' &&
this.pageBszfc != 'zdswxxgl' &&
this.pageBszfc != 'cfryIndex' &&
this.pageBszfc != 'jsbhgl'
)
}
}
}
</script>
<style>
@import url("../assets/styles/iconfont.css");
@import url('../assets/styles/iconfont.css');
.el-dialog__body {
padding: 10px 15px !important;
......@@ -919,5 +929,5 @@ export default {
</style>
<style scoped lang="scss">
@import "@/assets/styles/rightContent.scss";
@import '@/assets/styles/rightContent.scss';
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment