Commit 1a6a58d5 by chenqiang

相关案件、添加案件界面

parent 99e1607b
{
"success": true,
"code": 200,
"message": "成功",
"data": {
"total": 12,
"rows": [
{
"id": "01",
"label": "标识号串并[01]",
"parentId": "",
"children": []
},
{
"id": "03",
"label": "现勘串并[03]",
"parentId": "",
"children": [
{
"id": "0301",
"label": "指纹串并[0301]",
"parentId": "03",
"children": []
},
{
"id": "0302",
"label": "DNA串并[0302]",
"parentId": "03",
"children": []
},
{
"id": "0303",
"label": "足迹串并[0303]",
"parentId": "03",
"children": []
},
{
"id": "0304",
"label": "声纹串并[0304]",
"parentId": "03",
"children": []
},
{
"id": "0305",
"label": "虹膜串并[0305]",
"parentId": "03",
"children": []
}
]
},
{
"id": "0301",
"label": "指纹串并[0301]",
"parentId": "03",
"children": []
},
{
"id": "0302",
"label": "DNA串并[0302]",
"parentId": "03",
"children": []
},
{
"id": "0303",
"label": "足迹串并[0303]",
"parentId": "03",
"children": []
},
{
"id": "0304",
"label": "声纹串并[0304]",
"parentId": "03",
"children": []
},
{
"id": "0305",
"label": "虹膜串并[0305]",
"parentId": "03",
"children": []
},
{
"id": "09",
"label": "人工串并[09]",
"parentId": "",
"children": [
{
"id": "0901",
"label": "手段串并[0901]",
"parentId": "09",
"children": []
},
{
"id": "0902",
"label": "人像串并[0902]",
"parentId": "09",
"children": []
},
{
"id": "0903",
"label": "视频串并[0903]",
"parentId": "09",
"children": []
},
{
"id": "0904",
"label": "综合串并[0904]",
"parentId": "09",
"children": []
}
]
},
{
"id": "0901",
"label": "手段串并[0901]",
"parentId": "09",
"children": []
},
{
"id": "0902",
"label": "人像串并[0902]",
"parentId": "09",
"children": []
},
{
"id": "0903",
"label": "视频串并[0903]",
"parentId": "09",
"children": []
},
{
"id": "0904",
"label": "综合串并[0904]",
"parentId": "09",
"children": []
}
]
}
}
\ No newline at end of file
/*
* @Author: your name
* @Date: 2021-08-25 15:59:14
* @LastEditTime: 2021-08-25 15:59:14
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \founder_vue\src\utils\Bus.js
*/
import Vue from 'vue'
const bus = new Vue()
export default bus
\ No newline at end of file
<!--
* @Author: your name
* @Date: 2021-08-25 09:47:35
* @LastEditTime: 2021-08-25 18:46:37
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \founder_vue\src\views\cba\djwzba.vue
-->
<template>
<div class="djwzba" id="djwzba">
<div class="header">
<i class="el-icon-edit"></i>
<span>填写案件</span>
</div>
<div class="content-search" v-if="$route.path==='/djwzba/xgaj'">
<right-content @saveAj="saveAj" @addmc="createMc" class="input-txt" :cxFormData="cxFormData" :cxQueryField="cxQueryField"></right-content>
</div>
<div class="tabs">
<div :class="{tabItem: true, active: $route.path===item.path}" v-for="(item, index) in routerList" :key="index" @click="switchTab(item.path)">
<span>{{item.title}}</span>
</div>
</div>
<router-view></router-view>
</div>
</template>
<script>
import Bus from '@/utils/Bus'
import rightContent from "@c/bshChildrenQuery_cba.vue";
import { addxszglasj } from "@/api/cbyp.js";
export default {
components: {
rightContent,
},
data () {
return {
xszajbh: this.$route.query.xszajbh,
routerList: [
{ path: '/djwzba/xgaj', title: '相关案件' },
{ path: '/djwzba/tjaj', title: '添加案件' },
// { path: '/djwzba/', title: '我的收藏案件' }
],
cxFormData: {
typeFlag: "all",
unitcode: sessionStorage.getItem("unitcode"),
grade: sessionStorage.getItem("grade"),
typeFlag: "bshcb",
cbmc: '',
cblx: [],
cbxxms: ''
},
cxQueryField: [
{
name: "串并名称",
id: "cbmc",
type: "text-btn",
value: "11",
placeholder: "请输入",
col: "3",
},
{
name: "串并类型",
id: "cblx",
// type: "codeTreeDialog",
type: "lazyCodeTreeDialog",
props: [], //字典弹框需要的字段
value: "",
col: "3",
codeOptions: [],
codeTree: "CODE_CBYP_CBLX",
multiple: true
},
{
name: "串并依据描述",
id: "cbxxms",
type: "textarea",
value: "",
placeholder: "请输入",
col: "3",
},
],
};
},
mounted () {
this.cxQueryField[0]
Bus.$on('addCbmc', (cbmcList) => {
console.log(cbmcList)
let arr = []
cbmcList.forEach(element => {
arr.push(element.ajmc)
});
this.str = arr.join(',')
})
Bus.$on('reset', () => {
this.createMc()
})
},
methods: {
async saveAj() {
let obj = {
cbmc: this.cxFormData.cbmc,
cblx: this.cxFormData.cblx,
cbxxms: this.cxFormData.cbxxms,
glxxXszajbh: this.$route.query.xszajbh
}
let res = await addxszglasj(obj)
console.log(res);
Bus.$emit('updataTable')
this.cxFormData.cbmc = ''
this.cxFormData.cblx = []
this.cxFormData.cbxxms = ''
},
switchTab (path) {
this.$router.push(
{
path: path,
query: {
xszajbh: this.xszajbh
}
}
)
},
createMc() {
this.$set(this.cxFormData, 'cbmc', this.str)
console.log(this.cxQueryField);
}
},
}
</script>
<style lang="scss" scoped>
.djwzba {
.header {
padding: 8px;
border-bottom: 1px dashed #000;
font-weight: 800;
}
.tabs {
height: 40px;
display: flex;
align-items: center;
font-size: 16px;
background: #fff;
border-bottom: 1px dashed #ccc;
padding: 0 8px;
margin-bottom: 5px;
.tabItem {
height: 100%;
line-height: 40px;
padding: 0 10px;
cursor: pointer;
&.active {
border: 1px solid #ccc;
border-top: 2px solid orangered;
border-bottom: none;
}
}
}
}
</style>
\ No newline at end of file
<!--
* @Author: your name
* @Date: 2021-08-25 09:47:52
* @LastEditTime: 2021-08-25 18:03:06
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \founder_vue\src\views\cba\xgaj.vue
-->
<template>
<div class="xgal">
<el-button type="danger" class="btn" @click="delAj">删除案件</el-button>
<el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center">
</el-table-column>
<el-table-column label="案件编号" width="265" align="center">
<template slot-scope="scope">{{ scope.row.asjbh }}</template>
</el-table-column>
<el-table-column label="案件名称" width="160" align="center">
<template slot-scope="scope">{{ scope.row.ajmc }}</template>
</el-table-column>
<el-table-column label="案件类别" width="100" align="center">
<template slot-scope="scope">{{ scope.row.ajlbdmStr }}</template>
</el-table-column>
<el-table-column label="比中号码" width="180" align="center">
<template slot-scope="scope">{{ scope.row.cbxgfwbzh }}</template>
</el-table-column>
<el-table-column label="案件状态" width="160" align="center">
<template slot-scope="scope">{{ scope.row.zcjddmStr }}</template>
</el-table-column>
<el-table-column label="发案时间" width="160" align="center">
<template slot-scope="scope">{{ scope.row.asjfssjKssj }}</template>
</el-table-column>
<el-table-column label="发案地点" width="100" align="center">
<template slot-scope="scope">{{ scope.row.asjfsddXzqhdm }}</template>
</el-table-column>
<el-table-column label="受理单位" width="160" align="center">
<template slot-scope="scope">{{ scope.row.sldw }}</template>
</el-table-column>
<el-table-column label="立案单位" width="160" align="center">
<template slot-scope="scope">{{ scope.row.ladwGajgjgdm }}</template>
</el-table-column>
<el-table-column label="简要案情" width="420" align="center">
<template slot-scope="scope">{{ scope.row.jyaq }}</template>
</el-table-column>
</el-table>
<el-pagination background layout="prev, pager, next" @current-change="changePage" :total="total">
</el-pagination>
</div>
</template>
<script>
import Bus from '@/utils/Bus'
import { queryxszglasj, delxszglasj } from "@/api/cbyp.js";
export default {
data () {
return {
tableData: [],
multipleSelection: [],
total: 10
}
},
mounted () {
console.log(this.$route);
this.getData(1, 10);
Bus.$on('reset', () => {
this.$refs.multipleTable.clearSelection();
})
Bus.$on('updataTable', () => {
this.getData(1, 10);
})
},
methods: {
async delAj() {
let arr = []
this.multipleSelection.forEach(item => {
arr.push(item.asjbh)
})
let str = arr.join(',')
console.log(str);
let sfscxsz = 0
if(this.multipleSelection.length == this.total) {
sfscxsz = 1
} else {
sfscxsz = 0
}
let obj = {
asjbhs: str,
xszajbh: this.$route.query.xszajbh,
sfscxsz: sfscxsz
}
let res = await delxszglasj(obj)
console.log(res);
if(res == 200) {
this.$message.success('删除成功!')
this.getData(1, 10)
} else {
this.$message.error('删除失败!')
}
},
async getData (start, length) {
let fromData = {
start,
length,
xszajbh: this.$route.query.xszajbh
}
let res = await queryxszglasj(fromData)
console.log(res);
if (res.code == 200) {
this.tableData = res.data.data
this.total = res.data.recordsTotal
} else {
this.$message.error('请求数据失败!')
}
},
toggleSelection (rows) {
if (rows) {
rows.forEach(row => {
this.$refs.multipleTable.toggleRowSelection(row);
});
} else {
this.$refs.multipleTable.clearSelection();
}
},
handleSelectionChange (val) {
this.multipleSelection = val;
Bus.$emit('addCbmc', this.multipleSelection)
},
changePage (page) {
console.log(page);
this.getData(page, 10)
}
}
}
</script>
<style lang="scss" scoped>
.xgal {
button {
margin: 5px;
}
}
</style>
\ No newline at end of file
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