master
jevononlie 5 months ago
parent 3894e9eb30
commit 40bf1116d6

@ -1,8 +1,8 @@
/* /*
* @Author: 王文杰 * @Author: 王文杰
* @Date: 2024-02-02 14:19:40 * @Date: 2024-02-02 14:19:40
* @LastEditors: 王文杰 * @LastEditors: jevononlie 728254585@qq.com
* @LastEditTime: 2024-02-29 14:40:37 * @LastEditTime: 2024-05-17 17:43:12
* @FilePath: /jnpf-web/src/utils/apiUrl.js * @FilePath: /jnpf-web/src/utils/apiUrl.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
@ -10,5 +10,5 @@ module.exports = {
// 开发环境接口配置 // 开发环境接口配置
// APIURl: 'http://127.0.0.1:30000' // APIURl: 'http://127.0.0.1:30000'
// 测试环境接口配置 // 测试环境接口配置
APIURl: 'http://222.71.165.187:30000' APIURl: 'http://192.168.0.23:30000'
} }

@ -0,0 +1,43 @@
<template>
<el-dialog title="电子围栏" :visible="true" top="20vh" width="50%" append-to-body modal-append-to-body
:before-close="handleClose" class="my-dialog">
<div class="cont">112</div>
</el-dialog>
</template>
<script>
import request from '@/utils/request'
import { mapGetters } from "vuex";
export default {
components: {
},
props: [],
data() {
return {
visible: true,
loading: false,
}
},
computed: {
...mapGetters(['userInfo'])
},
watch: {},
created() {
},
mounted() { },
methods: {
handleClose() {
this.$emit('areaVisibleChange', false)
}
},
}
</script>
<style lang="scss" scoped>
.my-dialog {
.cont {
min-height: 600px;
}
}
</style>

@ -1,100 +1,103 @@
<template> <template>
<el-dialog :title="!dataForm.id ? '新建' :'编辑'" <el-dialog :title="!dataForm.id ? '新建' :'编辑'" modal-append-to-body="false" :close-on-click-modal="false"
:close-on-click-modal="false" append-to-body append-to-body :visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll width="600px">
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll <el-row :gutter="15" class="">
width="600px"> <el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px"
<el-row :gutter="15" class=""> label-position="right">
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px" label-position="right" > <template v-if="!loading">
<template v-if="!loading"> {{ areaVisible }}
<!-- 具体表单 --> <!-- 具体表单 -->
<el-col :span="24" > <el-col :span="24">
<jnpf-form-tip-item <jnpf-form-tip-item label="区域名称" tipLabel="围栏区域名称" prop="areaName">
label="区域名称" tipLabel="围栏区域名称" prop="areaName" > <JnpfInput v-model="dataForm.areaName" @change="changeData('areaName',-1)" placeholder="电子围栏名称" clearable
<JnpfInput v-model="dataForm.areaName" @change="changeData('areaName',-1)" :style='{"width":"100%"}'>
placeholder="电子围栏名称" clearable :style='{"width":"100%"}'> </JnpfInput>
</JnpfInput> </jnpf-form-tip-item>
</jnpf-form-tip-item> </el-col>
</el-col> <el-col :span="24">
<el-col :span="24" > <jnpf-form-tip-item label="区域类型" tipLabel="请选择围栏类型" prop="areaType">
<jnpf-form-tip-item <JnpfSelect v-model="dataForm.areaType" @change="changeData('areaType',-1)" placeholder="请选择围栏类型"
label="区域类型" tipLabel="请选择围栏类型" prop="areaType" > clearable :style='{"width":"100%"}' :options="areaTypeOptions" :props="areaTypeProps">
<JnpfSelect v-model="dataForm.areaType" @change="changeData('areaType',-1)" </JnpfSelect>
placeholder="请选择围栏类型" clearable :style='{"width":"100%"}' :options="areaTypeOptions" :props="areaTypeProps" > </jnpf-form-tip-item>
</JnpfSelect> </el-col>
</jnpf-form-tip-item> <el-col :span="24">
</el-col> <jnpf-form-tip-item label="是否启用" prop="status">
<el-col :span="24" > <JnpfRadio v-model="dataForm.status" @change="changeData('status',-1)" optionType="default"
<jnpf-form-tip-item direction="horizontal" size="small" :options="statusOptions" :props="statusProps">
label="是否启用" prop="status" > </JnpfRadio>
<JnpfRadio v-model="dataForm.status" @change="changeData('status',-1)" </jnpf-form-tip-item>
optionType="default" direction="horizontal" size="small" :options="statusOptions" :props="statusProps" > </el-col>
</JnpfRadio> <el-col :span="24">
</jnpf-form-tip-item> <jnpf-form-tip-item label="所属回收站" prop="stationCode">
</el-col> <JnpfSelect v-model="dataForm.stationCode" @change="changeData('stationCode',-1)"
<el-col :span="24" > placeholder="选择本组织回收站进行绑定" clearable :style='{"width":"100%"}' :options="stationCodeOptions"
<jnpf-form-tip-item :props="stationCodeProps">
label="所属回收站" prop="stationCode" > </JnpfSelect>
<JnpfSelect v-model="dataForm.stationCode" @change="changeData('stationCode',-1)" </jnpf-form-tip-item>
placeholder="选择本组织回收站进行绑定" clearable :style='{"width":"100%"}' :options="stationCodeOptions" :props="stationCodeProps" > </el-col>
</JnpfSelect> <el-col :span="24">
</jnpf-form-tip-item> <jnpf-form-tip-item label="地图信息" tipLabel="在地图上绘制电子围栏" prop="areaMapInfo">
</el-col> <JnpfInput @focus="handLeArea" v-model="dataForm.areaMapInfo" placeholder="绘制电子围栏区域" :maxlength="65539"
<el-col :span="24" > readonly prefix-icon='ym-custom ym-custom-google-maps' :style='{"width":"100%"}'>
<jnpf-form-tip-item </JnpfInput>
label="地图信息" tipLabel="在地图上绘制电子围栏" prop="areaMapInfo" > </jnpf-form-tip-item>
<JnpfInput v-model="dataForm.areaMapInfo" @change="changeData('areaMapInfo',-1)" </el-col>
placeholder="绘制电子围栏区域" disabled :maxlength="65539" clearable prefix-icon='ym-custom ym-custom-google-maps' :style='{"width":"100%"}' show-password > <el-col :span="24">
</JnpfInput> <jnpf-form-tip-item label="区域描述" tipLabel="请输入区域描述" prop="areaDesc">
</jnpf-form-tip-item> <JnpfTextarea v-model="dataForm.areaDesc" @change="changeData('areaDesc',-1)" placeholder="请输入不超过两百字的标题描述"
</el-col> :style='{"width":"100%"}' true type="textarea" :autosize='{"minRows":4,"maxRows":4}'>
<el-col :span="24" > </JnpfTextarea>
<jnpf-form-tip-item </jnpf-form-tip-item>
label="区域描述" tipLabel="请输入区域描述" prop="areaDesc" > </el-col>
<JnpfTextarea v-model="dataForm.areaDesc" @change="changeData('areaDesc',-1)" <!-- <el-dialog title="登录" v-if="areaVisible" :visible="true" top="20vh" width="30%" append-to-body
placeholder="请输入不超过两百字的标题描述" :style='{"width":"100%"}' true type="textarea" :autosize='{"minRows":4,"maxRows":4}' > modal-append-to-body>
</JnpfTextarea> </el-dialog> -->
</jnpf-form-tip-item> <area-dialog v-if="areaVisible" @areaVisibleChange="handleAreaVisibleChange" ref="JNPFForm" />
</el-col> <!-- 表单结束 -->
<!-- 表单结束 --> </template>
</template> </el-form>
</el-form> <SelectDialog v-if="1" :config="currTableConf" :formData="dataForm" ref="selectDialog" @select="addForSelect"
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm" @close="selectDialogVisible=false" />
ref="selectDialog" @select="addForSelect" @close="selectDialogVisible=false"/>
</el-row> </el-row>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<div class="upAndDown-button" v-if="dataForm.id"> <div class="upAndDown-button" v-if="dataForm.id">
<el-button @click="prev" :disabled='prevDis'> <el-button @click="prev" :disabled='prevDis'>
{{'上一条'}} {{'上一条'}}
</el-button> </el-button>
<el-button @click="next" :disabled='nextDis'> <el-button @click="next" :disabled='nextDis'>
{{'下一条'}} {{'下一条'}}
</el-button> </el-button>
</div> </div>
<el-button type="primary" @click="dataFormSubmit(2)" :loading="continueBtnLoading"> <el-button type="primary" @click="dataFormSubmit(2)" :loading="continueBtnLoading">
{{!dataForm.id ?'确定并新增':'确定并继续'}}</el-button> {{!dataForm.id ?'确定并新增':'确定并继续'}}</el-button>
<el-button @click="visible = false"> </el-button> <el-button @click="visible = false"> </el-button>
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading"> </el-button> <el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import request from '@/utils/request' import areaDialog from './areaDialog'
import {mapGetters} from "vuex"; import request from '@/utils/request'
import { getDataInterfaceRes } from '@/api/systemData/dataInterface' import { mapGetters } from "vuex";
import { getDictionaryDataSelector } from '@/api/systemData/dictionary' import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
import { getDefaultCurrentValueUserId } from '@/api/permission/user' import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
import { getDefaultCurrentValueDepartmentId } from '@/api/permission/organize' import { getDefaultCurrentValueUserId } from '@/api/permission/user'
import { getDateDay, getLaterData, getBeforeData, getBeforeTime, getLaterTime } from '@/components/Generator/utils/index.js' import { getDefaultCurrentValueDepartmentId } from '@/api/permission/organize'
import { thousandsFormat } from "@/components/Generator/utils/index" import { getDateDay, getLaterData, getBeforeData, getBeforeTime, getLaterTime } from '@/components/Generator/utils/index.js'
export default { import { thousandsFormat } from "@/components/Generator/utils/index"
components: { },
props: [], export default {
data() { components: {
areaDialog
},
props: [],
data() {
return { return {
dataFormSubmitType: 0, dataFormSubmitType: 0,
continueBtnLoading: false, continueBtnLoading: false,
@ -106,413 +109,405 @@
loading: false, loading: false,
btnLoading: false, btnLoading: false,
formRef: 'formRef', formRef: 'formRef',
setting:{}, setting: {},
eventType: '', eventType: '',
userBoxVisible:false, userBoxVisible: false,
selectDialogVisible: false, selectDialogVisible: false,
currTableConf:{}, currTableConf: {},
dataValueAll:{}, dataValueAll: {},
addTableConf:{ addTableConf: {},
},
// //
ableAll:{ ableAll: {},
}, tableRows: {},
tableRows:{ Vmodel: "",
}, currVmodel: "",
Vmodel:"",
currVmodel:"",
dataForm: { dataForm: {
areaName : undefined, areaName: undefined,
areaType : "1", areaType: "1",
status : "1", status: "1",
stationCode : undefined, stationCode: undefined,
areaMapInfo : undefined, areaMapInfo: undefined,
areaDesc : undefined, areaDesc: undefined,
}, },
tableRequiredData: {}, tableRequiredData: {},
dataRule: dataRule: {
{ areaName: [{
areaName: [ required: true,
{ message: '电子围栏名称',
required: true, trigger: 'blur'
message: '电子围栏名称', }, ],
trigger: 'blur' areaType: [{
}, required: true,
], message: '请至少选择一个',
areaType: [ trigger: 'change'
{ }, ],
required: true, status: [{
message: '请至少选择一个', required: true,
trigger: 'change' message: '请至少选择一个',
}, trigger: 'change'
], }, ],
status: [ stationCode: [{
{ required: true,
required: true, message: '选择本组织回收站进行绑定',
message: '请至少选择一个', trigger: 'change'
trigger: 'change' }, ],
}, areaMapInfo: [{
], required: true,
stationCode: [ message: '绘制电子围栏区域',
{ trigger: 'blur'
required: true, }, ],
message: '选择本组织回收站进行绑定',
trigger: 'change'
},
],
areaMapInfo: [
{
required: true,
message: '绘制电子围栏区域',
trigger: 'blur'
},
],
}, },
areaTypeOptions:[], areaTypeOptions: [],
areaTypeProps:{"label":"fullName","value":"enCode" }, areaTypeProps: { "label": "fullName", "value": "enCode" },
statusOptions:[], statusOptions: [],
statusProps:{"label":"fullName","value":"enCode" }, statusProps: { "label": "fullName", "value": "enCode" },
stationCodeOptions:[], stationCodeOptions: [],
stationCodeProps:{"label":"fullName","value":"id" }, stationCodeProps: { "label": "fullName", "value": "id" },
childIndex:-1, childIndex: -1,
isEdit:false, isEdit: false,
interfaceRes: { interfaceRes: {
areaName:[] , areaName: [],
areaType:[] , areaType: [],
status:[] , status: [],
stationCode:[] , stationCode: [],
areaMapInfo:[] , areaMapInfo: [],
areaDesc:[] , areaDesc: [],
}, },
areaVisible: false
} }
}, },
computed: { computed: {
...mapGetters(['userInfo']) ...mapGetters(['userInfo'])
}, },
watch: {}, watch: {},
created() { created() {
this.dataAll() this.dataAll()
this.initDefaultData() this.initDefaultData()
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm)) this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
}, },
mounted() {}, mounted() {},
methods: { methods: {
prev() { prev() {
this.index-- this.index--
if (this.index === 0) { if (this.index === 0) {
this.prevDis = true this.prevDis = true
} }
this.nextDis = false this.nextDis = false
for (let index = 0; index < this.allList.length; index++) { for (let index = 0; index < this.allList.length; index++) {
const element = this.allList[index]; const element = this.allList[index];
if (this.index == index) { if (this.index == index) {
this.getInfo(element.id) this.getInfo(element.id)
}
} }
}, }
next() { },
this.index++ next() {
this.index++
if (this.index === this.allList.length - 1) { if (this.index === this.allList.length - 1) {
this.nextDis = true this.nextDis = true
} }
this.prevDis = false this.prevDis = false
for (let index = 0; index < this.allList.length; index++) { for (let index = 0; index < this.allList.length; index++) {
const element = this.allList[index]; const element = this.allList[index];
if (this.index == index) { if (this.index == index) {
this.getInfo(element.id) this.getInfo(element.id)
}
}
},
getInfo(id) {
request({
url: '/api/scm/StationArea/'+ id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
});
},
goBack() {
this.visible = false
this.$emit('refreshDataList', true)
},
changeData(model, index) {
this.isEdit = false
this.childIndex = index
let modelAll = model.split("-");
let faceMode = "";
for (let i = 0; i < modelAll.length; i++) {
faceMode += modelAll[i];
} }
for (let key in this.interfaceRes) { }
if (key != faceMode) { },
let faceReList = this.interfaceRes[key] getInfo(id) {
for (let i = 0; i < faceReList.length; i++) { request({
if (faceReList[i].relationField == model) { url: '/api/scm/StationArea/' + id,
let options = 'get' + key + 'Options'; method: 'get'
if(this[options]){ }).then(res => {
this[options]() this.dataInfo(res.data)
} });
this.changeData(key, index) },
goBack() {
this.visible = false
this.$emit('refreshDataList', true)
},
handLeArea() {
this.areaVisible = true
},
changeData(model, index) {
this.isEdit = false
this.childIndex = index
let modelAll = model.split("-");
let faceMode = "";
for (let i = 0; i < modelAll.length; i++) {
faceMode += modelAll[i];
}
for (let key in this.interfaceRes) {
if (key != faceMode) {
let faceReList = this.interfaceRes[key]
for (let i = 0; i < faceReList.length; i++) {
if (faceReList[i].relationField == model) {
let options = 'get' + key + 'Options';
if (this[options]) {
this[options]()
} }
this.changeData(key, index)
} }
} }
} }
}, }
changeDataFormData(type, data, model,index,defaultValue) { },
if(!this.isEdit) { changeDataFormData(type, data, model, index, defaultValue) {
if (type == 2) { if (!this.isEdit) {
for (let i = 0; i < this.dataForm[data].length; i++) { if (type == 2) {
if (index == -1) { for (let i = 0; i < this.dataForm[data].length; i++) {
this.dataForm[data][i][model] = defaultValue if (index == -1) {
} else if (index == i) { this.dataForm[data][i][model] = defaultValue
this.dataForm[data][i][model] = defaultValue } else if (index == i) {
} this.dataForm[data][i][model] = defaultValue
} }
} else {
this.dataForm[data] = defaultValue
} }
} else {
this.dataForm[data] = defaultValue
} }
}, }
dataAll(){ },
this.getareaTypeOptions(); dataAll() {
this.getstatusOptions(); this.getareaTypeOptions();
this.getstationCodeOptions(); this.getstatusOptions();
}, this.getstationCodeOptions();
getareaTypeOptions() { },
getDictionaryDataSelector('560423985691492677').then(res => { getareaTypeOptions() {
this.areaTypeOptions = res.data.list getDictionaryDataSelector('560423985691492677').then(res => {
}) this.areaTypeOptions = res.data.list
}, })
getstatusOptions() { },
getDictionaryDataSelector('519107761586309125').then(res => { getstatusOptions() {
this.statusOptions = res.data.list getDictionaryDataSelector('519107761586309125').then(res => {
}) this.statusOptions = res.data.list
}, })
getstationCodeOptions() { },
const index = this.childIndex getstationCodeOptions() {
let templateJsonList = JSON.parse(JSON.stringify(this.interfaceRes.stationCode)) const index = this.childIndex
for (let i = 0; i < templateJsonList.length; i++) { let templateJsonList = JSON.parse(JSON.stringify(this.interfaceRes.stationCode))
let json = templateJsonList[i]; for (let i = 0; i < templateJsonList.length; i++) {
if(json.relationField){ let json = templateJsonList[i];
let relationFieldAll = json.relationField.split("-"); if (json.relationField) {
let val = json.defaultValue; let relationFieldAll = json.relationField.split("-");
if(relationFieldAll.length>1 && index>-1){ let val = json.defaultValue;
val = this.dataForm[relationFieldAll[0]+'List']&&this.dataForm[relationFieldAll[0]+'List'].length?this.dataForm[relationFieldAll[0]+'List'][index][relationFieldAll[1]]:'' if (relationFieldAll.length > 1 && index > -1) {
}else { val = this.dataForm[relationFieldAll[0] + 'List'] && this.dataForm[relationFieldAll[0] + 'List'].length ? this.dataForm[relationFieldAll[0] + 'List'][index][relationFieldAll[1]] : ''
val = this.dataForm[relationFieldAll] } else {
} val = this.dataForm[relationFieldAll]
json.defaultValue = val
}
}
let template ={
paramList:templateJsonList
}
getDataInterfaceRes('520259300875047493',template).then(res => {
let data = res.data
this.stationCodeOptions = data
this.changeDataFormData(1,'stationCode','stationCode',index,'')
})
},
clearData(){
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
},
init(id,isDetail,allList) {
this.prevDis = false
this.nextDis = false
this.allList = allList || []
if (allList.length) {
this.index = this.allList.findIndex(item => item.id === id)
if (this.index == 0) {
this.prevDis = true
}
if (this.index == this.allList.length - 1) {
this.nextDis = true
} }
} else { json.defaultValue = val
}
}
let template = {
paramList: templateJsonList
}
getDataInterfaceRes('520259300875047493', template).then(res => {
let data = res.data
this.stationCodeOptions = data
this.changeDataFormData(1, 'stationCode', 'stationCode', index, '')
})
},
clearData() {
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
},
init(id, isDetail, allList) {
this.prevDis = false
this.nextDis = false
this.allList = allList || []
if (allList.length) {
this.index = this.allList.findIndex(item => item.id === id)
if (this.index == 0) {
this.prevDis = true this.prevDis = true
}
if (this.index == this.allList.length - 1) {
this.nextDis = true this.nextDis = true
} }
this.dataForm.id = id || 0; } else {
this.visible = true; this.prevDis = true
this.$nextTick(() => { this.nextDis = true
if(this.dataForm.id){ }
this.loading = true this.dataForm.id = id || 0;
request({ this.visible = true;
url: '/api/scm/StationArea/'+this.dataForm.id, this.$nextTick(() => {
method: 'get' if (this.dataForm.id) {
}).then(res => { this.loading = true
this.dataInfo(res.data) request({
this.loading = false url: '/api/scm/StationArea/' + this.dataForm.id,
}); method: 'get'
}else{ }).then(res => {
this.clearData() this.dataInfo(res.data)
this.initDefaultData() this.loading = false
} });
});
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
},
//
initDefaultData() {
},
//
dataFormSubmit(type) {
this.dataFormSubmitType = type ? type : 0
this.$refs['formRef'].validate((valid) => {
if (valid) {
this.request()
}
})
},
request() {
let _data =this.dataList()
if (this.dataFormSubmitType == 2) {
this.continueBtnLoading = true
} else { } else {
this.btnLoading = true this.clearData()
this.initDefaultData()
} }
if (!this.dataForm.id) { });
request({ this.$store.commit('generator/UPDATE_RELATION_DATA', {})
url: '/api/scm/StationArea', },
method: 'post', //
data: _data initDefaultData() {
}).then((res) => {
this.$message({ },
message: res.msg, //
type: 'success', dataFormSubmit(type) {
duration: 1000, this.dataFormSubmitType = type ? type : 0
onClose: () => { this.$refs['formRef'].validate((valid) => {
if (this.dataFormSubmitType == 2) { if (valid) {
this.$nextTick(() => { this.request()
this.clearData() }
this.initDefaultData() })
}) },
this.continueBtnLoading = false request() {
return let _data = this.dataList()
} if (this.dataFormSubmitType == 2) {
this.visible = false this.continueBtnLoading = true
this.btnLoading = false } else {
this.$emit('refresh', true) this.btnLoading = true
}
if (!this.dataForm.id) {
request({
url: '/api/scm/StationArea',
method: 'post',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
if (this.dataFormSubmitType == 2) {
this.$nextTick(() => {
this.clearData()
this.initDefaultData()
})
this.continueBtnLoading = false
return
} }
}) this.visible = false
}).catch(()=>{ this.btnLoading = false
this.btnLoading = false this.$emit('refresh', true)
this.continueBtnLoading = false }
}) })
}else{ }).catch(() => {
request({ this.btnLoading = false
url: '/api/scm/StationArea/'+this.dataForm.id, this.continueBtnLoading = false
method: 'PUT', })
data: _data } else {
}).then((res) => { request({
this.$message({ url: '/api/scm/StationArea/' + this.dataForm.id,
message: res.msg, method: 'PUT',
type: 'success', data: _data
duration: 1000, }).then((res) => {
onClose: () => { this.$message({
if (this.dataFormSubmitType == 2) return this.continueBtnLoading = false message: res.msg,
this.visible = false type: 'success',
this.btnLoading = false duration: 1000,
this.$emit('refresh', true) onClose: () => {
} if (this.dataFormSubmitType == 2) return this.continueBtnLoading = false
}) this.visible = false
}).catch(()=>{ this.btnLoading = false
this.btnLoading = false this.$emit('refresh', true)
this.continueBtnLoading = false }
}) })
} }).catch(() => {
}, this.btnLoading = false
openSelectDialog(key) { this.continueBtnLoading = false
this.currTableConf=this.addTableConf[key]
this.currVmodel=key
this.selectDialogVisible = true
this.$nextTick(() => {
this.$refs.selectDialog.init()
}) })
}, }
addForSelect(data) { },
for (let i = 0; i < data.length; i++) { openSelectDialog(key) {
let t = data[i] this.currTableConf = this.addTableConf[key]
if(this['get'+this.currVmodel]){ this.currVmodel = key
this['get'+this.currVmodel](t) this.selectDialogVisible = true
} this.$nextTick(() => {
this.$refs.selectDialog.init()
})
},
addForSelect(data) {
for (let i = 0; i < data.length; i++) {
let t = data[i]
if (this['get' + this.currVmodel]) {
this['get' + this.currVmodel](t)
} }
}, }
dateTime(timeRule, timeType, timeTarget, timeValueData, dataValue) { },
let timeDataValue = null; dateTime(timeRule, timeType, timeTarget, timeValueData, dataValue) {
let timeValue = Number(timeValueData) let timeDataValue = null;
if (timeRule) { let timeValue = Number(timeValueData)
if (timeType == 1) { if (timeRule) {
timeDataValue = timeValue if (timeType == 1) {
} else if (timeType == 2) { timeDataValue = timeValue
timeDataValue = dataValue } else if (timeType == 2) {
} else if (timeType == 3) { timeDataValue = dataValue
timeDataValue = new Date().getTime() } else if (timeType == 3) {
} else if (timeType == 4) { timeDataValue = new Date().getTime()
let previousDate = ''; } else if (timeType == 4) {
if (timeTarget == 1 || timeTarget == 2) { let previousDate = '';
previousDate = getDateDay(timeTarget, timeType, timeValue) if (timeTarget == 1 || timeTarget == 2) {
timeDataValue = new Date(previousDate).getTime() previousDate = getDateDay(timeTarget, timeType, timeValue)
} else if (timeTarget == 3) { timeDataValue = new Date(previousDate).getTime()
previousDate = getBeforeData(timeValue) } else if (timeTarget == 3) {
timeDataValue = new Date(previousDate).getTime() previousDate = getBeforeData(timeValue)
} else { timeDataValue = new Date(previousDate).getTime()
timeDataValue = getBeforeTime(timeTarget, timeValue).getTime() } else {
} timeDataValue = getBeforeTime(timeTarget, timeValue).getTime()
} else if (timeType == 5) { }
let previousDate = ''; } else if (timeType == 5) {
if (timeTarget == 1 || timeTarget == 2) { let previousDate = '';
previousDate = getDateDay(timeTarget, timeType, timeValue) if (timeTarget == 1 || timeTarget == 2) {
timeDataValue = new Date(previousDate).getTime() previousDate = getDateDay(timeTarget, timeType, timeValue)
} else if (timeTarget == 3) { timeDataValue = new Date(previousDate).getTime()
previousDate = getLaterData(timeValue) } else if (timeTarget == 3) {
timeDataValue = new Date(previousDate).getTime() previousDate = getLaterData(timeValue)
} else { timeDataValue = new Date(previousDate).getTime()
timeDataValue = getLaterTime(timeTarget, timeValue).getTime() } else {
} timeDataValue = getLaterTime(timeTarget, timeValue).getTime()
} }
} }
return timeDataValue; }
}, return timeDataValue;
time(timeRule, timeType, timeTarget, timeValue, formatType, dataValue) { },
let format = formatType == 'HH:mm' ? 'HH:mm:00' : formatType time(timeRule, timeType, timeTarget, timeValue, formatType, dataValue) {
let timeDataValue = null let format = formatType == 'HH:mm' ? 'HH:mm:00' : formatType
if (timeRule) { let timeDataValue = null
if (timeType == 1) { if (timeRule) {
timeDataValue = timeValue || '00:00:00' if (timeType == 1) {
if (timeDataValue.split(':').length == 3) { timeDataValue = timeValue || '00:00:00'
timeDataValue = timeDataValue if (timeDataValue.split(':').length == 3) {
} else { timeDataValue = timeDataValue
timeDataValue = timeDataValue + ':00' } else {
} timeDataValue = timeDataValue + ':00'
} else if (timeType == 2) {
timeDataValue = dataValue
} else if (timeType == 3) {
timeDataValue = this.jnpf.toDate(new Date(), format)
} else if (timeType == 4) {
let previousDate = '';
previousDate = getBeforeTime(timeTarget, timeValue)
timeDataValue = this.jnpf.toDate(previousDate, format)
} else if (timeType == 5) {
let previousDate = '';
previousDate = getLaterTime(timeTarget, timeValue)
timeDataValue = this.jnpf.toDate(previousDate, format)
} }
} else if (timeType == 2) {
timeDataValue = dataValue
} else if (timeType == 3) {
timeDataValue = this.jnpf.toDate(new Date(), format)
} else if (timeType == 4) {
let previousDate = '';
previousDate = getBeforeTime(timeTarget, timeValue)
timeDataValue = this.jnpf.toDate(previousDate, format)
} else if (timeType == 5) {
let previousDate = '';
previousDate = getLaterTime(timeTarget, timeValue)
timeDataValue = this.jnpf.toDate(previousDate, format)
} }
return timeDataValue; }
}, return timeDataValue;
dataList(){
var _data = this.dataForm;
return _data;
},
dataInfo(dataAll){
let _dataAll =dataAll
this.dataForm = _dataAll
this.isEdit = true
this.dataAll()
this.childIndex=-1
},
}, },
} dataList() {
var _data = this.dataForm;
return _data;
},
dataInfo(dataAll) {
let _dataAll = dataAll
this.dataForm = _dataAll
this.isEdit = true
this.dataAll()
this.childIndex = -1
},
handleAreaVisibleChange(flag) {
this.areaVisible = flag
}
},
}
</script> </script>

@ -1,524 +1,488 @@
<template> <template>
<div class="JNPF-common-layout"> <div class="JNPF-common-layout">
<div class="JNPF-common-layout-center"> <div class="JNPF-common-layout-center">
<el-row class="JNPF-common-search-box" :gutter="16"> <el-row class="JNPF-common-search-box" :gutter="16">
<el-form @submit.native.prevent> <el-form @submit.native.prevent>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="所属回收站"> <el-form-item label="所属回收站">
<JnpfSelect v-model="query.stationCode" placeholder="选择本组织回收站进行绑定" clearable <JnpfSelect v-model="query.stationCode" placeholder="选择本组织回收站进行绑定" clearable :options="stationCodeOptions"
:options="stationCodeOptions" :props="stationCodeProps" multiple>
:props="stationCodeProps" multiple > </JnpfSelect>
</JnpfSelect> </el-form-item>
</el-form-item> </el-col>
</el-col> <el-col :span="6">
<el-col :span="6"> <el-form-item label="区域类型">
<el-form-item label="区域类型"> <JnpfSelect v-model="query.areaType" placeholder="请选择围栏类型" clearable :options="areaTypeOptions"
<JnpfSelect v-model="query.areaType" placeholder="请选择围栏类型" clearable :props="areaTypeProps" multiple>
:options="areaTypeOptions" </JnpfSelect>
:props="areaTypeProps" multiple > </el-form-item>
</JnpfSelect> </el-col>
</el-form-item> <el-col :span="6">
</el-col> <el-form-item label="区域名称">
<el-col :span="6"> <el-input v-model="query.areaName" placeholder="请输入" clearable> </el-input>
<el-form-item label="区域名称"> </el-form-item>
<el-input v-model="query.areaName" placeholder="请输入" clearable> </el-input> </el-col>
</el-form-item> <template v-if="showAll">
</el-col> <el-col :span="6">
<template v-if="showAll"> <el-form-item label="是否启用">
<el-col :span="6"> <JnpfSelect v-model="query.status" placeholder="请选择" clearable :options="statusOptions"
<el-form-item label="是否启用"> :props="statusProps">
<JnpfSelect v-model="query.status" placeholder="请选择" clearable </JnpfSelect>
:options="statusOptions" </el-form-item>
:props="statusProps" > </el-col>
</JnpfSelect> </template>
</el-form-item> <el-col :span="6">
</el-col> <el-form-item>
</template> <el-button type="primary" icon="el-icon-search" @click="search()">{{ areaVisible }}</el-button>
<el-col :span="6"> <el-button icon="el-icon-refresh-right" @click="reset()"></el-button>
<el-form-item> <el-button type="text" icon="el-icon-arrow-down" @click="showAll = true" v-if="!showAll">
<el-button type="primary" icon="el-icon-search" @click="search()"></el-button> 展开
<el-button icon="el-icon-refresh-right" @click="reset()"></el-button> </el-button>
<el-button type="text" icon="el-icon-arrow-down" @click="showAll=true" v-if="!showAll"> <el-button type="text" icon="el-icon-arrow-up" @click="showAll = false" v-else>
展开 收起
</el-button> </el-button>
<el-button type="text" icon="el-icon-arrow-up" @click="showAll=false" v-else> </el-form-item>
收起 </el-col>
</el-button> </el-form>
</el-form-item> </el-row>
</el-col> <div class="JNPF-common-layout-main JNPF-flex-main">
</el-form> <div class="JNPF-common-head">
</el-row> <div>
<div class="JNPF-common-layout-main JNPF-flex-main"> <el-button type="primary" icon="icon-ym icon-ym-btn-add" v-has="'btn_add'" @click="addOrUpdateHandle()">
<div class="JNPF-common-head"> </el-button>
<div> </div>
<el-button type="primary" icon="icon-ym icon-ym-btn-add" v-has="'btn_add'" @click="addOrUpdateHandle()"> <div class="JNPF-common-head-right">
</el-button> <el-tooltip content="高级查询" placement="top" v-if="true">
</div> <el-link icon="icon-ym icon-ym-filter JNPF-common-head-icon" :underline="false"
<div class="JNPF-common-head-right"> @click="openSuperQuery()" />
<el-tooltip content="高级查询" placement="top" v-if="true"> </el-tooltip>
<el-link icon="icon-ym icon-ym-filter JNPF-common-head-icon" :underline="false" <el-tooltip effect="dark" :content="$t('common.refresh')" placement="top">
@click="openSuperQuery()" /> <el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false" @click="initData()" />
</el-tooltip> </el-tooltip>
<el-tooltip effect="dark" :content="$t('common.refresh')" placement="top"> </div>
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
@click="initData()" />
</el-tooltip>
</div>
</div>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange'
:span-method="arraySpanMethod"
>
<el-table-column
prop="areaName"
label="区域名称" align="left"
>
</el-table-column>
<el-table-column
prop="areaType"
label="区域类型" align="left"
>
</el-table-column>
<el-table-column
prop="stationCode"
label="所属回收站" align="left"
>
</el-table-column>
<el-table-column
prop="status"
label="是否启用" align="left"
>
</el-table-column>
<el-table-column
prop="areaMapInfo"
label="地图信息" align="left"
>
</el-table-column>
<el-table-column
prop="areaDesc"
label="区域描述" align="left"
>
</el-table-column>
<el-table-column label="操作"
fixed="right" width="150" >
<template slot-scope="scope" >
<el-button type="text"
@click="addOrUpdateHandle(scope.row)" v-has="'btn_edit'" >编辑
</el-button>
<el-button type="text" class="JNPF-table-delBtn" v-has="'btn_remove'" @click="handleDel(scope.row.id)">
</el-button>
<el-button type="text" v-has="'btn_detail'"
@click="goDetail(scope.row.id)">详情
</el-button>
</template>
</el-table-column>
</JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="initData"/>
</div>
</div> </div>
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/> <JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' :span-method="arraySpanMethod">
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/> <el-table-column prop="areaName" label="区域名称" align="left">
</el-table-column>
<el-table-column prop="areaType" label="区域类型" align="left">
</el-table-column>
<el-table-column prop="stationCode" label="所属回收站" align="left">
</el-table-column>
<el-table-column prop="status" label="是否启用" align="left">
</el-table-column>
<el-table-column prop="areaMapInfo" label="地图信息" align="left">
</el-table-column>
<el-table-column prop="areaDesc" label="区域描述" align="left">
</el-table-column>
<el-table-column label="操作" fixed="right" width="150">
<template slot-scope="scope">
<el-button type="text" @click="addOrUpdateHandle(scope.row)" v-has="'btn_edit'">
</el-button>
<el-button type="text" class="JNPF-table-delBtn" v-has="'btn_remove'" @click="handleDel(scope.row.id)">
</el-button>
<el-button type="text" v-has="'btn_detail'" @click="goDetail(scope.row.id)">
</el-button>
</template>
</el-table-column>
</JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
@pagination="initData" />
</div>
</div>
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh" />
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" />
<ImportBox v-if="uploadBoxVisible" ref="UploadBox" @refresh="initData" /> <ImportBox v-if="uploadBoxVisible" ref="UploadBox" @refresh="initData" />
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/> <Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible = false" />
<ToFormDetail v-if="toFormDetailVisible" ref="toFormDetail" @close="toFormDetailVisible = false" /> <ToFormDetail v-if="toFormDetailVisible" ref="toFormDetail" @close="toFormDetailVisible = false" />
<SuperQuery v-if="superQueryVisible" ref="SuperQuery" :columnOptions="superQueryJson" <SuperQuery v-if="superQueryVisible" ref="SuperQuery" :columnOptions="superQueryJson" @superQuery="superQuery" />
@superQuery="superQuery" /> </div>
</div>
</template> </template>
<script> <script>
import request from '@/utils/request' import request from '@/utils/request'
import {mapGetters} from "vuex"; import { mapGetters } from "vuex";
import {getDictionaryDataSelector} from '@/api/systemData/dictionary' import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
import JNPFForm from './form' import JNPFForm from './form'
import Detail from './Detail' import Detail from './Detail'
import ExportBox from '@/components/ExportBox' import ExportBox from '@/components/ExportBox'
import ToFormDetail from '@/views/basic/dynamicModel/list/detail' import ToFormDetail from '@/views/basic/dynamicModel/list/detail'
import {getDataInterfaceRes} from '@/api/systemData/dataInterface' import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
import { getConfigData } from '@/api/onlineDev/visualDev' import { getConfigData } from '@/api/onlineDev/visualDev'
import { getDefaultCurrentValueUserIdAsync } from '@/api/permission/user' import { getDefaultCurrentValueUserIdAsync } from '@/api/permission/user'
import { getDefaultCurrentValueDepartmentIdAsync } from '@/api/permission/organize' import { getDefaultCurrentValueDepartmentIdAsync } from '@/api/permission/organize'
import columnList from './columnList' import columnList from './columnList'
import { thousandsFormat } from "@/components/Generator/utils/index" import { thousandsFormat } from "@/components/Generator/utils/index"
import SuperQuery from '@/components/SuperQuery' import SuperQuery from '@/components/SuperQuery'
import superQueryJson from './superQueryJson' import superQueryJson from './superQueryJson'
export default { export default {
components: { components: {
JNPFForm, JNPFForm,
Detail, Detail,
ExportBox,ToFormDetail , SuperQuery ExportBox, ToFormDetail, SuperQuery
}, },
data() { data() {
return { return {
keyword:'', keyword: '',
expandsTree: true, expandsTree: true,
refreshTree: true, refreshTree: true,
toFormDetailVisible:false, toFormDetailVisible: false,
expandObj:{}, expandObj: {},
columnOptions: [], columnOptions: [],
mergeList: [], mergeList: [],
exportList:[], exportList: [],
columnList, columnList,
showAll: false, showAll: false,
superQueryVisible: false, superQueryVisible: false,
superQueryJson, superQueryJson,
uploadBoxVisible: false, uploadBoxVisible: false,
detailVisible: false, detailVisible: false,
query: { query: {
stationCode:undefined, stationCode: undefined,
areaType:undefined, areaType: undefined,
areaName:undefined, areaName: undefined,
status:undefined, status: undefined,
}, },
treeProps: { treeProps: {
children: 'children', children: 'children',
label: 'fullName', label: 'fullName',
value: 'id', value: 'id',
isLeaf: 'isLeaf' isLeaf: 'isLeaf'
}, },
list: [], list: [],
listLoading: true, listLoading: true,
total: 0, total: 0,
queryData: {}, queryData: {},
listQuery: { listQuery: {
superQueryJson: '', superQueryJson: '',
currentPage: 1, currentPage: 1,
pageSize: 20, pageSize: 20,
sort: "desc", sort: "desc",
sidx: "", sidx: "",
}, },
formVisible: false, formVisible: false,
flowVisible: false, flowVisible: false,
flowListVisible: false, flowListVisible: false,
flowList: [], flowList: [],
exportBoxVisible: false, exportBoxVisible: false,
areaTypeOptions:[], areaTypeOptions: [],
areaTypeProps:{"label":"fullName","value":"enCode" }, areaTypeProps: { "label": "fullName", "value": "enCode" },
statusOptions:[], statusOptions: [],
statusProps:{"label":"fullName","value":"enCode" }, statusProps: { "label": "fullName", "value": "enCode" },
stationCodeOptions:[], stationCodeOptions: [],
stationCodeProps:{"label":"fullName","value":"id" }, stationCodeProps: { "label": "fullName", "value": "id" },
interfaceRes: { interfaceRes: {
}, },
}
},
computed: {
...mapGetters(['userInfo']),
menuId() {
return this.$route.meta.modelId || ''
}
},
created() {
this.getColumnList(),
this.initSearchDataAndListData()
this.getstationCodeOptions();
this.getareaTypeOptions();
this.getstatusOptions();
this.queryData = JSON.parse(JSON.stringify(this.query))
},
methods: {
toDetail(defaultValue, modelId) {
if (!defaultValue) return
getConfigData(modelId).then(res => {
if (!res.data || !res.data.formData) return
let formData = JSON.parse(res.data.formData)
formData.popupType = 'general'
this.toFormDetailVisible = true
this.$nextTick(() => {
this.$refs.toFormDetail.init(formData, modelId, defaultValue)
})
})
},
toggleTreeExpand(expands) {
this.refreshTree = false
this.expandsTree = expands
this.$nextTick(() => {
this.refreshTree = true
this.$nextTick(() => {
this.$refs.treeBox.setCurrentKey(null)
})
})
},
filterNode(value, data) {
if (!value) return true;
return data[this.treeProps.label].indexOf(value) !== -1;
},
loadNode(node, resolve) {
const nodeData = node.data
const config = {
treeInterfaceId: "",
treeTemplateJson: []
}
if (config.treeInterfaceId) {
//
if (config.treeTemplateJson && config.treeTemplateJson.length) {
for (let i = 0; i < config.treeTemplateJson.length; i++) {
const element = config.treeTemplateJson[i];
element.defaultValue = nodeData[element.relationField] || ''
}
}
//
let query = {
paramList: config.treeTemplateJson || [],
}
//
getDataInterfaceRes(config.treeInterfaceId, query).then(res => {
let data = res.data
if (Array.isArray(data)) {
resolve(data);
} else {
resolve([]);
}
})
}
},
getColumnList() {
//
this.columnOptions = this.transformColumnList(this.columnList)
},
transformColumnList(columnList) {
let list = []
for (let i = 0; i < columnList.length; i++) {
const e = columnList[i];
if (!e.prop.includes('-')) {
list.push(e)
} else {
let prop = e.prop.split('-')[0]
let label = e.label.split('-')[0]
let vModel = e.prop.split('-')[1]
let newItem = {
align: "center",
jnpfKey: "table",
prop,
label,
children: []
}
e.vModel = vModel
if (!this.expandObj.hasOwnProperty(`${prop}Expand`)) this.$set(this.expandObj, `${prop}Expand`, false)
if (!list.some(o => o.prop === prop)) list.push(newItem)
for (let i = 0; i < list.length; i++) {
if (list[i].prop === prop) {
list[i].children.push(e)
break
} }
}, }
computed: { }
...mapGetters(['userInfo']), }
menuId() { this.getMergeList(list)
return this.$route.meta.modelId || '' this.getExportList(list)
return list
},
arraySpanMethod({ column }) {
for (let i = 0; i < this.mergeList.length; i++) {
if (column.property == this.mergeList[i].prop) {
return [this.mergeList[i].rowspan, this.mergeList[i].colspan]
}
}
},
getMergeList(list) {
let newList = JSON.parse(JSON.stringify(list))
newList.forEach(item => {
if (item.children && item.children.length) {
let child = {
prop: item.prop + '-child-first'
}
item.children.unshift(child)
}
})
newList.forEach(item => {
if (item.children && item.children.length) {
item.children.forEach((child, index) => {
if (index == 0) {
this.mergeList.push({
prop: child.prop,
rowspan: 1,
colspan: item.children.length
})
} else {
this.mergeList.push({
prop: child.prop,
rowspan: 0,
colspan: 0
})
} }
}, })
created() { } else {
this.getColumnList(), this.mergeList.push({
this.initSearchDataAndListData() prop: item.prop,
this.getstationCodeOptions(); rowspan: 1,
this.getareaTypeOptions(); colspan: 1
this.getstatusOptions(); })
this.queryData = JSON.parse(JSON.stringify(this.query))
},
methods: {
toDetail(defaultValue, modelId) {
if (!defaultValue) return
getConfigData(modelId).then(res => {
if (!res.data || !res.data.formData) return
let formData = JSON.parse(res.data.formData)
formData.popupType = 'general'
this.toFormDetailVisible = true
this.$nextTick(() => {
this.$refs.toFormDetail.init(formData, modelId, defaultValue)
})
})
},
toggleTreeExpand(expands) {
this.refreshTree = false
this.expandsTree = expands
this.$nextTick(() => {
this.refreshTree = true
this.$nextTick(() => {
this.$refs.treeBox.setCurrentKey(null)
})
})
},
filterNode(value, data) {
if (!value) return true;
return data[this.treeProps.label].indexOf(value) !== -1;
},
loadNode(node, resolve) {
const nodeData = node.data
const config ={
treeInterfaceId:"",
treeTemplateJson:[]
}
if (config.treeInterfaceId) {
//
if (config.treeTemplateJson && config.treeTemplateJson.length) {
for (let i = 0; i < config.treeTemplateJson.length; i++) {
const element = config.treeTemplateJson[i];
element.defaultValue = nodeData[element.relationField] || ''
}
}
//
let query = {
paramList: config.treeTemplateJson || [],
}
//
getDataInterfaceRes(config.treeInterfaceId, query).then(res => {
let data = res.data
if (Array.isArray(data)) {
resolve(data);
} else {
resolve([]);
}
})
}
},
getColumnList() {
//
this.columnOptions = this.transformColumnList(this.columnList)
},
transformColumnList(columnList) {
let list = []
for (let i = 0; i < columnList.length; i++) {
const e = columnList[i];
if (!e.prop.includes('-')) {
list.push(e)
} else {
let prop = e.prop.split('-')[0]
let label = e.label.split('-')[0]
let vModel = e.prop.split('-')[1]
let newItem = {
align: "center",
jnpfKey: "table",
prop,
label,
children: []
}
e.vModel = vModel
if (!this.expandObj.hasOwnProperty(`${prop}Expand`)) this.$set(this.expandObj, `${prop}Expand`, false)
if (!list.some(o => o.prop === prop)) list.push(newItem)
for (let i = 0; i < list.length; i++) {
if (list[i].prop === prop) {
list[i].children.push(e)
break
}
}
}
}
this.getMergeList(list)
this.getExportList(list)
return list
},
arraySpanMethod({ column }) {
for (let i = 0; i < this.mergeList.length; i++) {
if (column.property == this.mergeList[i].prop) {
return [this.mergeList[i].rowspan, this.mergeList[i].colspan]
}
}
},
getMergeList(list) {
let newList = JSON.parse(JSON.stringify(list))
newList.forEach(item => {
if (item.children && item.children.length) {
let child = {
prop: item.prop + '-child-first'
}
item.children.unshift(child)
}
})
newList.forEach(item => {
if (item.children && item.children.length ) {
item.children.forEach((child, index) => {
if (index == 0) {
this.mergeList.push({
prop: child.prop,
rowspan: 1,
colspan: item.children.length
})
} else {
this.mergeList.push({
prop: child.prop,
rowspan: 0,
colspan: 0
})
}
})
} else {
this.mergeList.push({
prop: item.prop,
rowspan: 1,
colspan: 1
})
}
})
},
getExportList(list) {
let exportList = []
for (let i = 0; i < list.length; i++) {
if (list[i].jnpfKey === 'table') {
for (let j = 0; j < list[i].children.length; j++) {
exportList.push(list[i].children[j])
}
} else {
exportList.push(list[i])
}
}
this.exportList = exportList
},
getstationCodeOptions() {
getDataInterfaceRes('520259300875047493').then(res => {
let data = res.data
this.stationCodeOptions = data
})
},
getareaTypeOptions() {
getDictionaryDataSelector('560423985691492677').then(res => {
this.areaTypeOptions = res.data.list
})
},
getstatusOptions() {
getDictionaryDataSelector('519107761586309125').then(res => {
this.statusOptions = res.data.list
})
},
goDetail(id){
this.detailVisible = true
this.$nextTick(() => {
this.$refs.Detail.init(id)
})
},
sortChange({column, prop, order}) {
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
this.listQuery.sidx = !order ? '' : prop
this.initData()
},
async initSearchDataAndListData() {
await this.initSearchData()
this.initData()
},
//
async initSearchData() {
},
initData() {
this.listLoading = true;
let _query = {
...this.listQuery,
...this.query,
keyword: this.keyword,
dataType: 0,
menuId:this.menuId,
moduleId:'560427626187981125',
type:1,
};
request({
url: `/api/scm/StationArea/getList`,
method: 'post',
data: _query
}).then(res => {
var _list =res.data.list;
this.list = _list.map(o => ({
...o,
...this.expandObj,
}))
this.total = res.data.pagination.total
this.listLoading = false
})
},
handleDel(id) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/scm/StationArea/${id}`,
method: 'DELETE'
}).then(res => {
this.$message({
type: 'success',
message: res.msg,
onClose: () => {
this.initData()
}
});
})
}).catch(() => {
});
},
handelUpload(){
this.uploadBoxVisible = true
this.$nextTick(() => {
this.$refs.UploadBox.init("","scm/StationArea")
})
},
openSuperQuery() {
this.superQueryVisible = true
this.$nextTick(() => {
this.$refs.SuperQuery.init()
})
},
superQuery(queryJson) {
this.listQuery.superQueryJson = queryJson
this.listQuery.currentPage = 1
this.initData()
},
addOrUpdateHandle(row, isDetail) {
let id = row?row.id:""
this.formVisible = true
this.$nextTick(() => {
this.$refs.JNPFForm.init(id, isDetail,this.list)
})
},
exportData() {
this.exportBoxVisible = true
this.$nextTick(() => {
this.$refs.ExportBox.init(this.exportList)
})
},
download(data) {
let query = {...data, ...this.listQuery, ...this.query,menuId:this.menuId}
request({
url: `/api/scm/StationArea/Actions/Export`,
method: 'post',
data: query
}).then(res => {
if (!res.data.url) return
this.jnpf.downloadFile(res.data.url)
this.$refs.ExportBox.visible = false
this.exportBoxVisible = false
})
},
search() {
this.listQuery.currentPage=1
this.listQuery.pageSize=20
this.listQuery.sort="desc"
this.listQuery.sidx=""
this.initData()
},
refresh(isrRefresh) {
this.formVisible = false
if (isrRefresh) this.reset()
},
reset() {
this.query = JSON.parse(JSON.stringify(this.queryData))
this.search()
},
colseFlow(isrRefresh) {
this.flowVisible = false
if (isrRefresh) this.reset()
},
} }
})
},
getExportList(list) {
let exportList = []
for (let i = 0; i < list.length; i++) {
if (list[i].jnpfKey === 'table') {
for (let j = 0; j < list[i].children.length; j++) {
exportList.push(list[i].children[j])
}
} else {
exportList.push(list[i])
}
}
this.exportList = exportList
},
getstationCodeOptions() {
getDataInterfaceRes('520259300875047493').then(res => {
let data = res.data
this.stationCodeOptions = data
})
},
getareaTypeOptions() {
getDictionaryDataSelector('560423985691492677').then(res => {
this.areaTypeOptions = res.data.list
})
},
getstatusOptions() {
getDictionaryDataSelector('519107761586309125').then(res => {
this.statusOptions = res.data.list
})
},
goDetail(id) {
this.detailVisible = true
this.$nextTick(() => {
this.$refs.Detail.init(id)
})
},
sortChange({ column, prop, order }) {
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
this.listQuery.sidx = !order ? '' : prop
this.initData()
},
async initSearchDataAndListData() {
await this.initSearchData()
this.initData()
},
//
async initSearchData() {
},
initData() {
this.listLoading = true;
let _query = {
...this.listQuery,
...this.query,
keyword: this.keyword,
dataType: 0,
menuId: this.menuId,
moduleId: '560427626187981125',
type: 1,
};
request({
url: `/api/scm/StationArea/getList`,
method: 'post',
data: _query
}).then(res => {
var _list = res.data.list;
this.list = _list.map(o => ({
...o,
...this.expandObj,
}))
this.total = res.data.pagination.total
this.listLoading = false
})
},
handleDel(id) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/scm/StationArea/${id}`,
method: 'DELETE'
}).then(res => {
this.$message({
type: 'success',
message: res.msg,
onClose: () => {
this.initData()
}
});
})
}).catch(() => {
});
},
handelUpload() {
this.uploadBoxVisible = true
this.$nextTick(() => {
this.$refs.UploadBox.init("", "scm/StationArea")
})
},
openSuperQuery() {
this.superQueryVisible = true
this.$nextTick(() => {
this.$refs.SuperQuery.init()
})
},
superQuery(queryJson) {
this.listQuery.superQueryJson = queryJson
this.listQuery.currentPage = 1
this.initData()
},
addOrUpdateHandle(row, isDetail) {
let id = row ? row.id : ""
this.formVisible = true
this.$nextTick(() => {
this.$refs.JNPFForm.init(id, isDetail, this.list)
})
},
exportData() {
this.exportBoxVisible = true
this.$nextTick(() => {
this.$refs.ExportBox.init(this.exportList)
})
},
download(data) {
let query = { ...data, ...this.listQuery, ...this.query, menuId: this.menuId }
request({
url: `/api/scm/StationArea/Actions/Export`,
method: 'post',
data: query
}).then(res => {
if (!res.data.url) return
this.jnpf.downloadFile(res.data.url)
this.$refs.ExportBox.visible = false
this.exportBoxVisible = false
})
},
search() {
this.listQuery.currentPage = 1
this.listQuery.pageSize = 20
this.listQuery.sort = "desc"
this.listQuery.sidx = ""
this.initData()
},
refresh(isrRefresh) {
this.formVisible = false
if (isrRefresh) this.reset()
},
reset() {
this.query = JSON.parse(JSON.stringify(this.queryData))
this.search()
},
colseFlow(isrRefresh) {
this.flowVisible = false
if (isrRefresh) this.reset()
} }
}
}
</script> </script>

Loading…
Cancel
Save