Merge branch 'master' of gitee.com:longyears/jintan-canlian-web

master
刘翔宇-旅管家 3 years ago
commit 1d084d0a48

@ -1,8 +1,8 @@
@font-face {
font-family: "iconfont"; /* Project id 4122597 */
src: url('iconfont.woff2?t=1686734240029') format('woff2'),
url('iconfont.woff?t=1686734240029') format('woff'),
url('iconfont.ttf?t=1686734240029') format('truetype');
src: url('iconfont.woff2?t=1686993328053') format('woff2'),
url('iconfont.woff?t=1686993328053') format('woff'),
url('iconfont.ttf?t=1686993328053') format('truetype');
}
.iconfont {
@ -13,6 +13,26 @@
-moz-osx-font-smoothing: grayscale;
}
.icon-jiaoyu1:before {
content: "\e62a";
}
.icon-caiwu:before {
content: "\e68d";
}
.icon-shenhe:before {
content: "\e715";
}
.icon-kangfuzhongxin-copy:before {
content: "\e630";
}
.icon-minfanggaizao:before {
content: "\e629";
}
.icon-yongyaojihua:before {
content: "\e803";
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -1,5 +1,5 @@
<template>
<router-view />
<router-view/>
</template>
<script>

@ -0,0 +1,9 @@
<template>
<router-view/>
</template>
<script>
</script>
<style>
</style>

@ -0,0 +1,9 @@
<template>
<router-view/>
</template>
<script>
</script>
<style>
</style>

@ -0,0 +1,9 @@
<template>
<router-view/>
</template>
<script>
</script>
<style>
</style>

@ -0,0 +1,9 @@
<template>
<router-view/>
</template>
<script>
</script>
<style>
</style>

@ -0,0 +1,100 @@
<template>
<div>
<xy-dialog ref="dialog" :width='50' :is-show.sync="isShow" type="form" title="业务审核" :form="form" :rules="rules"
@submit="submit">
<template v-slot:work_status>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>审核状态
</div>
<div class="xy-table-item-content">
<el-select v-model="form.work_status" filterable style="width: 300px;" placeholder="请选择审核状态">
<el-option v-for="item in checkstatusList" :key="item.value" :label="item.value" :value="item.value">
</el-option>
</el-select>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
save,
index,
show
} from "@/api/system/baseForm.js"
import {
Message
} from 'element-ui'
export default {
data() {
return {
isShow: false,
id: '',
tableName: 'workflows',
form: {
work_status: ''
},
rules: {},
checkstatusList: [{
label: '待审核',
value: '待审核'
}, {
label: '通过',
value: '通过'
}, {
label: '退回',
value: '退回'
}]
}
},
created() {},
watch: {
isShow(newVal) {
if (newVal) {
this.getViewDetail()
} else {
this.id = ''
this.$refs['dialog'].reset()
}
}
},
methods: {
async getViewDetail() {
const res = await show({
id: this.id,
table_name: this.tableName
})
this.form = {
name: res?.name,
idcard: res?.idcard,
number: res?.number,
mobile: res?.mobile,
work_status: res?.work_status
}
},
submit(val) {
save({
id: this.id,
table_name: this.tableName,
...this.form
}).then(res => {
Message({
type: 'success',
message: '审核成功'
})
this.isShow = false
this.$emit('refresh')
})
}
},
}
</script>
<style>
</style>

@ -0,0 +1,257 @@
<template>
<div style="padding: 0 20px">
<div ref="lxHeader">
<lx-header icon="md-apps" text="访视管理" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<slot>
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;">
<Input v-model="select.keyword" style="width: 200px;margin-right: 10px;" placeholder="搜索" />
<Button type="primary" @click="getindex"></Button>
<Button icon="ios-add" type="primary" style="margin-left: 10px;"
@click="exportExcel(new Date().getTime().toString())">导出</Button>
<!-- <Button icon="ios-add" type="primary" style="margin-left: 10px;"
@click="$refs['check'].isShow = true,$refs['check'].type = 'add'">添加</Button> -->
<!-- <Button icon="ios-add" type="primary" style="margin-left: 10px;"
@click="$refs['imports'].show()">导入</Button> -->
</div>
</slot>
</lx-header>
</div>
<xy-table :list="list" :total="total" @pageSizeChange="e => select.pageSize = e" @pageIndexChange="pageChange"
:table-item="table">
<template v-slot:btns>
<el-table-column fixed="right" label="操作" width="260" header-align="center">
<template slot-scope="scope">
<Button v-if="scope.row.work_status=='待审核'" style="margin-left: 10px;" type="primary" size="small" @click="checkRecord(scope.row.id)"></Button>
<Poptip transfer confirm title="确认要删除吗?" @on-ok="deleteRecord(scope.row)">
<Button type="primary" style="margin-left: 10px;" size="small" ghost>删除</Button>
</Poptip>
</template>
</el-table-column>
</template>
</xy-table>
<check ref="check" @refresh="getindex"></check>
</div>
</template>
<script>
import {
index,
destroy
} from "@/api/system/baseForm.js"
import check from "@/views/checks/components/check.vue"
import {
Message
} from 'element-ui'
import * as XLSX from "xlsx";
import { saveAs } from "file-saver";
import {
index as fieldIndex
} from "@/api/system/customFormField";
import {
getparameter
} from "@/api/system/dictionary";
export default {
components: {
check
},
data() {
return {
select: {
pageSize: 10,
pageIndex: 1,
keyword: ""
},
rukuType: '',
customForm: {
customFormId: 21,
tableName: "workflows"
},
form: [],
total: 0,
list: [],
table: [{
label: '序号',
type: 'index',
fixed: 'left',
width: 80
},
{
label: "申请日期",
width: 120,
prop: 'work_date',
align: 'center',
fixed: 'left'
},
{
label: "申请状态",
width: 120,
prop: 'work_status',
align: 'center',
},
{
label: "申请业务",
width: 120,
prop: 'guanlianbiaoming',
align: 'center'
},
{
label: "申请人",
width: 120,
prop: 'name',
align: 'center'
},
{
label: "身份证",
width: 120,
prop: 'idcard',
align: 'center'
},
{
label: "残疾证",
width: 120,
prop: 'number',
align: 'center'
},
{
label: "联系电话",
width: 120,
prop: 'mobile',
align: 'center'
},
{
label: "居住地",
width: 240,
prop: 'reside',
align: 'left'
}
]
}
},
methods: {
async getindex() {
const res = await index({
page_size: this.select.pageSize,
page: this.select.pageIndex,
table_name: this.customForm.tableName,
filter: [{
"key": "name",
"op": "like",
"value": this.select.keyword
}],
})
this.list = res.data
this.total = res.total
},
pageChange(e) {
this.select.pageIndex = e
},
checkRecord(id, personid) {
this.$refs['check'].id = id
this.$refs['check'].person_id = personid
this.$refs['check'].isShow = true
},
editorRecord(id, type) {
this.$refs['addViewRecord'].id = id
this.$refs['addViewRecord'].type = type
this.$refs['addViewRecord'].isShow = true
},
deleteRecord(row) {
destroy({
id: row.id,
table_name: this.customForm.tableName
}).then(res => {
Message({
type: 'success',
message: '删除成功'
})
this.getindex()
})
},
//
async getField() {
// console.log(this.$route.meta.params, "---", this.$route)
// return
// if (this.$route.meta.params?.custom_form) {
// let decode = decodeURIComponent(this.$route.meta.params?.custom_form)
// try {
// let custom_form = JSON.parse(decode)
// this.customForm.customFormId = custom_form.custom_form_id
// this.customForm.tableName = custom_form.table_name
// console.log("123", this.customForm)
// // this.select.table_name = custom_form.table_name
// } catch (err) {
// console.warn(err)
// }
// }
const res = await fieldIndex({
page: 1,
page_size: 999,
custom_form_id: this.customForm.customFormId,
sort_name: 'sort',
sort_type: 'asc',
})
if (res.data && res.data instanceof Array) {
res.data.forEach(i => {
if (i.field) {
if (
(i.edit_input === "checkbox" || i.edit_input === "radio" || i.edit_input === "select") &&
i.parameter_id
) {
getparameter({
id: i.parameter_id
}).then((res) => {
i._paramters = res.detail ?? [];
});
}
if (
(i.edit_input === "checkbox" || i.edit_input === "radio" || i.edit_input === "select") &&
i.link_table_name
) {
index({
page: 1,
page_size: 999,
table_name: i.link_table_name,
}).then((res) => {
i._paramters = res.data ?? [];
});
}
}
})
}
this.form = res.data
},
async exportExcel(sheetName) {
const res = await index(Object.assign(this.select,{ page: 1,page_size: 99999,table_name: this.customForm.tableName}))
if(res.data){
let headers = this.form.map(i => {
return {
key: i.field,
title: i.name
}
})
const data = res.data.map(row => headers.map(header => row[header.key]));
data.unshift(headers.map(header => header.title));
const wb = XLSX.utils.book_new();
const ws = XLSX.utils.aoa_to_sheet(data);
XLSX.utils.book_append_sheet(wb, ws, sheetName);
const wbout = XLSX.write(wb, { bookType: 'xlsx', bookSST: true, type: 'array' });
saveAs(new Blob([wbout], { type: 'application/octet-stream' }), `${sheetName}.xlsx`);
}
},
},
mounted() {
this.getindex()
this.getField()
}
}
</script>
<style scoped lang="scss">
</style>

@ -18,7 +18,7 @@ export default {
props: {
title: "新增",
visible: this.dialogVisible,
width: "600px",
width: "60%",
},
on: {
"update:visible": (val) => {

@ -54,7 +54,7 @@ export default {
},
data() {
return {
action: `${process.env.VUE_APP_BASE_API}/api/admin/base-form/excel-show`,
action: `${process.env.VUE_APP_BASE_API}api/admin/base-form/excel-show`,
dialogVisible: false,
headers: [],

@ -444,7 +444,6 @@ export default {
}
});
this.form = fields.sort(this.handle('sort'));
console.log(111, this.form);
// if(res.fields && res.fields instanceof Array) {
// res.fields.forEach(i => {
// if (i.field) {
@ -472,19 +471,18 @@ export default {
// })
// }
// this.form = res.fields
this.table = this.form.sort(this.handle('sort'))
this.table = this.form
?.filter((i) => i.list_show)
.map((i) => {
let linkOb = {};
if (i.select_item && typeof i.select_item === 'object') {
if (i.select_item && typeof i.select_item === 'object' && (toString.call(i.select_item) !== "[object Array]")) {
let keys = Object.keys(i.select_item)
linkOb.customFn = row => {
let paramMap = new Map()
keys.forEach(key => {
paramMap.set(i.select_item[key],key)
})
return (
<span>
{ paramMap.get(row[i.field].toString()) }
@ -539,6 +537,7 @@ export default {
linkOb
);
});
console.log(this.table)
this.table.unshift({
type: "index",
width: 60,

@ -8,6 +8,20 @@
个人信息
</div>
</div>
</template>
<template v-slot:street>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>所属街道
</div>
<div class="xy-table-item-content">
<el-select v-model="form.street" filterable style="width: 300px;" placeholder="请选择所属街道">
<el-option v-for="item in lists.streetList" :key="item.value" :label="item.value"
:value="item.value">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:name>
<div class="xy-table-item">
@ -136,8 +150,8 @@
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>现居住地
</div>
<div class="xy-table-item-content">
<!-- <avue-input-map :params="mapparams" style="width: 300px;" placeholder="请选择地图" v-model="mapform"></avue-input-map> -->
<el-input v-model="form.reside" placeholder="请输入现居住地" clearable style="width: 300px;"></el-input>
<avue-input-map :params="mapparams" style="width: 300px;" placeholder="请选择地图" v-model="mapform"></avue-input-map>
<!-- <el-input v-model="form.reside" placeholder="请输入现居住地" clearable style="width: 300px;"></el-input> -->
</div>
</div>
</template>
@ -339,7 +353,8 @@
},
mapform: [],
form: {
infotext: '',
infotext: '',
street:'',
name: '',
nation: '',
sex: "",
@ -377,7 +392,8 @@
disabilitytypeList: [],
disabilitylevelList: [],
educationList: [],
relationList: []
relationList: [],
streetList:[]
}
}
@ -399,7 +415,6 @@
},
mapform(newVal){
if(newVal){
console.log(newVal)
this.form.longitude = newVal[0]
this.form.latitude = newVal[1]
this.form.reside = newVal[2]
@ -409,11 +424,10 @@
methods: {
async getLabel() {
let numbers = {
number:['sexList','marryList','disabilitylevelList','disabilitytypeList','educationList','relationList']
number:['streetList','sexList','marryList','disabilitylevelList','disabilitytypeList','educationList','relationList']
}
const res = await getparameter(numbers);
for(var k of res){
console.log(k)
for(var m in this.lists){
if(m==k.number){
this.lists[m] = k.detail
@ -427,7 +441,8 @@
table_name: this.tableName
})
this.form = {
infotext: '',
infotext: '',
street:res?.street,
name: res?.name,
nation: res?.nation,
sex: res?.sex,
@ -464,7 +479,6 @@
submit(val) {
console.log(this.form)
// return
if (this.type === 'add') {
save({

@ -9,9 +9,10 @@
<Button type="primary" @click="getindex"></Button>
<Button icon="ios-add" type="primary" style="margin-left: 10px;"
@click="$refs['addRecord'].isShow = true,$refs['addRecord'].type = 'add'">添加</Button>
<!-- <Button icon="ios-add" type="primary" style="margin-left: 10px;"
@click="$refs['imports'].show()">导入</Button> -->
<Button icon="ios-add" type="primary" style="margin-left: 10px;"
@click="$refs['imports'].show()">导入</Button>
<Button icon="ios-add" type="primary" style="margin-left: 10px;"
@click="exportExcel(new Date().getTime().toString())">导出</Button>
</div>
</slot>
</lx-header>
@ -24,7 +25,9 @@
<template slot-scope="scope">
<Button type="primary" size="small" @click="editorRecord(scope.row.id,'editor')"></Button>
<Button type="primary" size="small" style="margin-left: 10px;"
@click="editorView(scope.row.id,'add')">访视</Button>
@click="editorView(scope.row.id,'add')">访视</Button>
<Button type="primary" size="small" style="margin-left: 10px;"
@click="showInfo(scope.row.id)">视图</Button>
<Poptip transfer confirm title="确认要删除吗?" @on-ok="deleteRecord(scope.row)">
<Button type="primary" style="margin-left: 10px;" size="small" ghost>删除</Button>
</Poptip>
@ -50,7 +53,8 @@
Message
} from 'element-ui'
import imports from "@/views/component/imports.vue"
import * as XLSX from "xlsx";
import { saveAs } from "file-saver";
import {
index as fieldIndex
} from "@/api/system/customFormField";
@ -72,7 +76,7 @@
},
rukuType: '',
customForm: {
customFormId: "",
customFormId: 1,
tableName: "records"
},
form: [],
@ -83,6 +87,12 @@
type: 'index',
fixed: 'left',
width: 80
},
{
label: "所属街道",
width: 120,
prop: 'street',
align: 'center'
},
{
label: "姓名",
@ -154,7 +164,10 @@
]
}
},
methods: {
methods: {
showInfo(id) {
this.$router.push({path:"/record/personinfo",query:{id:id}})
},
async getindex() {
const res = await index({
page_size: this.select.pageSize,
@ -199,20 +212,20 @@
},
//
async getField() {
console.log(this.$route.meta.params, "---", this.$route)
return
if (this.$route.meta.params?.custom_form) {
let decode = decodeURIComponent(this.$route.meta.params?.custom_form)
try {
let custom_form = JSON.parse(decode)
this.customForm.customFormId = custom_form.custom_form_id
this.customForm.tableName = custom_form.table_name
console.log("123", this.customForm)
// this.select.table_name = custom_form.table_name
} catch (err) {
console.warn(err)
}
}
// console.log(this.$route.meta.params, "---", this.$route)
// return
// if (this.$route.meta.params?.custom_form) {
// let decode = decodeURIComponent(this.$route.meta.params?.custom_form)
// try {
// let custom_form = JSON.parse(decode)
// this.customForm.customFormId = custom_form.custom_form_id
// this.customForm.tableName = custom_form.table_name
// console.log("123", this.customForm)
// // this.select.table_name = custom_form.table_name
// } catch (err) {
// console.warn(err)
// }
// }
const res = await fieldIndex({
page: 1,
page_size: 999,
@ -249,10 +262,29 @@
})
}
this.form = res.data
},
async exportExcel(sheetName) {
const res = await index(Object.assign(this.select,{ page: 1,page_size: 99999,table_name: this.customForm.tableName}))
if(res.data){
let headers = this.form.map(i => {
return {
key: i.field,
title: i.name
}
})
const data = res.data.map(row => headers.map(header => row[header.key]));
data.unshift(headers.map(header => header.title));
const wb = XLSX.utils.book_new();
const ws = XLSX.utils.aoa_to_sheet(data);
XLSX.utils.book_append_sheet(wb, ws, sheetName);
const wbout = XLSX.write(wb, { bookType: 'xlsx', bookSST: true, type: 'array' });
saveAs(new Blob([wbout], { type: 'application/octet-stream' }), `${sheetName}.xlsx`);
}
},
},
mounted() {
this.getindex()
this.getindex()
this.getField()
}
}

@ -1,36 +1,37 @@
<template>
<div>
<div v-loading='fullscreenLoading'>
<div class="map" id="map" :style="{'height':mapHeight+'px'}"></div>
<div ref='infoWindow' id="infoWindow">
<i @click='closeWin' class="el-icon-close"></i>
<div v-for="item in openData">
<p>姓名<span>{{item.name}}</span></p>
<p>现居住地<span>{{item.reside}}</span></p>
<p class="showInfo" @click="showInfo(item.id)"></p>
<p class="showInfo" @click="showInfo(item.id)"></p>
</div>
</div>
</div>
</template>
<script>
// zoom,center便
import {
index
// zoom,center便
import {
index
} from "@/api/system/baseForm.js"
export default {
data() {
return {
zoom: 11,
center: [119.597897,31.723247],
center: [119.597897, 31.723247],
mapHeight: 0,
map: null,
infoWindow: null,
openData: [],
// markerList: [],
mapList: []
mapList: [],
fullscreenLoading: false
}
},
mounted() {
mounted() {
this.initHeight()
this.$nextTick(function() {
this.mapInit()
@ -38,12 +39,18 @@
this.getindex()
},
methods: {
// openFullScreen() {
// this.fullscreenLoading = true;
// setTimeout(() => {
// this.fullscreenLoading = false;
// }, 2000);
// },
async initHeight() {
let winHeight = document.body.clientHeight
this.mapHeight = winHeight - 50 - 20
},
//
async mapInit() {
async mapInit() {
this.map = new AMap.Map("map", {
center: this.center,
mapStyle: "amap://styles/bfb1bb3feb0db7082367abca96b8d214", //
@ -97,9 +104,7 @@
});
},
//
setMapMarker() {
console.log("mapList",this.mapList)
setMapMarker() {
let makerList = []
this.mapList.forEach((item) => {
//
@ -108,7 +113,7 @@
text: item.name,
zIndex: 9999999,
offset: new AMap.Pixel(-13, -30),
position: [item.longitude,item.latitude],
position: [item.longitude, item.latitude],
clickable: true,
extData: item.id,
style: {
@ -132,59 +137,61 @@
this.infoWindow.close()
},
showInfo(id) {
this.$router.push({path:"/record/personinfo",query:{id:id}})
},
this.$router.push({
path: "/record/personinfo",
query: {
id: id
}
})
},
async getindex() {
this.fullscreenLoading = true;
let res = await index({
page_size: 99999,
page: 1,
table_name: 'records',
})
let _data = []
for(var k of res.data){
if(k.longitude&&k.latitude){
_data.push(k)
}
})
let _data = []
let _nolng = [] //
for (var k of res.data) {
if (k.longitude && k.latitude) {
_data.push(k)
} else {
if (k.reside == null || k.reside == '') {
// return
}else{
_nolng.push(k)
}
}
}
this.mapList = _data
this.setMapMarker()
var geocoder = null
let that = this
// AMap.plugin("AMap.Geocoder",function(){
// geocoder = new AMap.Geocoder({
// city: '' // city adcode citycode
// })
// let _data = []
// for(var k of res.data){
// if(k.longitude==null||k.latitude==null){
// console.log(k.name)
// let m = k
// let _reside = k.reside
// console.log(_reside)
// geocoder.getLocation(_reside, function(status, result) {
// console.log(_reside)
// if (status === 'complete' && result.info === 'OK') {
// // result
// m.longitude = result.geocodes[0].location.lng
// m.latitude = result.geocodes[0].location.lat
// console.log("m",m)
// _data.push(m)
// console.log("_data",_data)
// return
// }
// })
// }else{
// console.log("---",k.name)
// _data.push(k)
// }
// }
// that.mapList = _data
// // that.setMapMarker()
// })
console.log(_nolng)
// return
this.mapList = _data
var geocoder = null
let that = this
AMap.plugin("AMap.Geocoder", function() {
geocoder = new AMap.Geocoder({
city: '常州市' // city adcode citycode
})
for (let k of _nolng) {
geocoder.getLocation(k.reside, function(status, result) {
if (status === 'complete' && result.info === 'OK') {
// result
k.longitude = result.geocodes[0].location.lng
k.latitude = result.geocodes[0].location.lat
}
})
}
})
setTimeout(function() {
that.mapList.push(..._nolng)
that.setMapMarker()
that.fullscreenLoading = false;
}, 1000);
},
@ -217,6 +224,5 @@
text-align: center;
cursor: pointer;
color: #147d38;
}
}
</style>

@ -15,7 +15,13 @@
</div>
</template>
<script>
<script>
import {
show
} from "@/api/system/baseForm.js"
import {
Message
} from 'element-ui'
export default {
data() {
return {
@ -23,20 +29,20 @@
form: '',
mapHeight: 0,
option: {
"name": "流程A",
"name": "视图",
"nodeList": [{
"id": "all",
"name": "人员",
"left": 550,
"top": 320,
"content":'<div class="persons">张三</div>'
"content":''
},
{
"id": "person",
"name": "个人信息",
"left": 200,
"top": 160,
"content":'<p>姓名:张三</p><p>性别:男</p><p>残疾类别:视力残疾</p><p>残疾等级:残疾一级</p><p>先居住地:常州市金坛区</p>'
"content":''
},
{
"id": "business",
@ -48,7 +54,8 @@
"id": "view",
"name": "访视信息",
"left": 900,
"top": 480,
"top": 480,
"content":''
}
],
"lineList": [{
@ -70,14 +77,46 @@
mounted() {
this.initHeight()
// this.form = this.nodeList[this.count].id;
this.getPerson()
},
methods: {
initHeight() {
let winHeight = document.body.clientHeight
this.mapHeight = winHeight - 50 - 20
console.log(winHeight)
},
},
getPerson(){
if (this.$route.query?.id) {
let id = this.$route.query.id
this.showPersonInfo(id)
}else{
Message({
type:'warning',
message:'请先选择人员档案'
})
}
},
async showPersonInfo(id){
const res = await show({
id: id,
table_name: 'records'
})
let names = `<div class="persons">${res.name}</div>`
let contents = `<p>姓名:${res.name}</p><p>性别:${res.sex}</p><p>残疾类别:${res.disabilitytype}</p><p>残疾等级:${res?.disabilitylevel}</p><p>现居住地:${res.reside}</p>`
let views = ''
if(res.idcard_viewrecords_idcard_relation.length>0){
for(var k of res.idcard_viewrecords_idcard_relation){
if(k.checkstatus=='通过'){
views+=`<p>${k.viewtime}/${k.viewscene}<p>`
}
}
}
this.option['nodeList'][0]['content'] = names
this.option['nodeList'][1]['content'] = contents
this.option['nodeList'][3]['content'] = views
}
}

@ -54,6 +54,20 @@
个人信息
</div>
</div>
</template>
<template v-slot:street>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>所属街道
</div>
<div class="xy-table-item-content">
<el-select v-model="form.street" filterable style="width: 300px;" placeholder="请选择所属街道">
<el-option v-for="item in lists.streetList" :key="item.value" :label="item.value"
:value="item.value">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:name>
<div class="xy-table-item">
@ -380,7 +394,8 @@
viewtime: "",
viewscene: "",
viewstatus: '',
infotext: '',
infotext: '',
street:'',
name: '',
nation: '',
sex: "",
@ -418,7 +433,8 @@
educationList: [],
relationList: [],
viewstatusList: [],
viewsceneList: []
viewsceneList: [],
streetList:[]
}
}
@ -445,11 +461,10 @@
methods: {
async getLabel() {
let numbers = {
number:['sexList','marryList','disabilitylevelList','disabilitytypeList','educationList','relationList','viewsceneList','viewstatusList']
number:['streetList','sexList','marryList','disabilitylevelList','disabilitytypeList','educationList','relationList','viewsceneList','viewstatusList']
}
const res = await getparameter(numbers);
for(var k of res){
console.log(k)
for(var m in this.lists){
if(m==k.number){
this.lists[m] = k.detail
@ -468,7 +483,8 @@
viewtime: "",
viewscene: "",
viewstatus: '',
infotext: '',
infotext: '',
street:res?.street,
name: res?.name,
nation: res?.nation,
sex: res?.sex,
@ -511,7 +527,7 @@
person_id: res?.person_id,
checkstatus: res?.checkstatus,
infotext: res?.infotext,
street:res?.street,
name: res?.name,
nation: res?.nation,
sex: res?.sex,

@ -6,7 +6,9 @@
<slot>
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;">
<Input v-model="select.keyword" style="width: 200px;margin-right: 10px;" placeholder="搜索" />
<Button type="primary" @click="getindex"></Button>
<Button type="primary" @click="getindex"></Button>
<Button icon="ios-add" type="primary" style="margin-left: 10px;"
@click="exportExcel(new Date().getTime().toString())">导出</Button>
<!-- <Button icon="ios-add" type="primary" style="margin-left: 10px;"
@click="$refs['check'].isShow = true,$refs['check'].type = 'add'">添加</Button> -->
<!-- <Button icon="ios-add" type="primary" style="margin-left: 10px;"
@ -49,7 +51,8 @@
Message
} from 'element-ui'
import imports from "@/views/component/imports.vue"
import * as XLSX from "xlsx";
import { saveAs } from "file-saver";
import {
index as fieldIndex
} from "@/api/system/customFormField";
@ -71,7 +74,7 @@
},
rukuType: '',
customForm: {
customFormId: "",
customFormId: 2,
tableName: "viewrecords"
},
form: [],
@ -107,6 +110,12 @@
width: 120,
prop: 'checkstatus',
align: 'center'
},
{
label: "所属街道",
width: 120,
prop: 'street',
align: 'center'
},
{
label: "姓名",
@ -219,61 +228,80 @@
})
},
//
async getField() {
console.log(this.$route.meta.params, "---", this.$route)
return
if (this.$route.meta.params?.custom_form) {
let decode = decodeURIComponent(this.$route.meta.params?.custom_form)
try {
let custom_form = JSON.parse(decode)
this.customForm.customFormId = custom_form.custom_form_id
this.customForm.tableName = custom_form.table_name
console.log("123", this.customForm)
// this.select.table_name = custom_form.table_name
} catch (err) {
console.warn(err)
}
}
const res = await fieldIndex({
page: 1,
page_size: 999,
custom_form_id: this.customForm.customFormId,
sort_name: 'sort',
sort_type: 'asc',
})
if (res.data && res.data instanceof Array) {
res.data.forEach(i => {
if (i.field) {
if (
(i.edit_input === "checkbox" || i.edit_input === "radio" || i.edit_input === "select") &&
i.parameter_id
) {
getparameter({
id: i.parameter_id
}).then((res) => {
i._paramters = res.detail ?? [];
});
}
if (
(i.edit_input === "checkbox" || i.edit_input === "radio" || i.edit_input === "select") &&
i.link_table_name
) {
index({
page: 1,
page_size: 999,
table_name: i.link_table_name,
}).then((res) => {
i._paramters = res.data ?? [];
});
}
}
})
}
this.form = res.data
async getField() {
// console.log(this.$route.meta.params, "---", this.$route)
// return
// if (this.$route.meta.params?.custom_form) {
// let decode = decodeURIComponent(this.$route.meta.params?.custom_form)
// try {
// let custom_form = JSON.parse(decode)
// this.customForm.customFormId = custom_form.custom_form_id
// this.customForm.tableName = custom_form.table_name
// console.log("123", this.customForm)
// // this.select.table_name = custom_form.table_name
// } catch (err) {
// console.warn(err)
// }
// }
const res = await fieldIndex({
page: 1,
page_size: 999,
custom_form_id: this.customForm.customFormId,
sort_name: 'sort',
sort_type: 'asc',
})
if (res.data && res.data instanceof Array) {
res.data.forEach(i => {
if (i.field) {
if (
(i.edit_input === "checkbox" || i.edit_input === "radio" || i.edit_input === "select") &&
i.parameter_id
) {
getparameter({
id: i.parameter_id
}).then((res) => {
i._paramters = res.detail ?? [];
});
}
if (
(i.edit_input === "checkbox" || i.edit_input === "radio" || i.edit_input === "select") &&
i.link_table_name
) {
index({
page: 1,
page_size: 999,
table_name: i.link_table_name,
}).then((res) => {
i._paramters = res.data ?? [];
});
}
}
})
}
this.form = res.data
},
async exportExcel(sheetName) {
const res = await index(Object.assign(this.select,{ page: 1,page_size: 99999,table_name: this.customForm.tableName}))
if(res.data){
let headers = this.form.map(i => {
return {
key: i.field,
title: i.name
}
})
const data = res.data.map(row => headers.map(header => row[header.key]));
data.unshift(headers.map(header => header.title));
const wb = XLSX.utils.book_new();
const ws = XLSX.utils.aoa_to_sheet(data);
XLSX.utils.book_append_sheet(wb, ws, sheetName);
const wbout = XLSX.write(wb, { bookType: 'xlsx', bookSST: true, type: 'array' });
saveAs(new Blob([wbout], { type: 'application/octet-stream' }), `${sheetName}.xlsx`);
}
},
},
mounted() {
this.getindex()
this.getindex()
this.getField()
}
}

Loading…
Cancel
Save