|
@@ -53,7 +53,23 @@
|
|
|
</a-select>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
- <a-col :span="10">
|
|
|
+ <a-col :span="6">
|
|
|
+ <a-form-model-item label="网点标签" prop="stationNo" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
|
|
|
+ <a-select
|
|
|
+ id="rubbishTotal-labelNo"
|
|
|
+ placeholder="请选择网点标签"
|
|
|
+ mode="multiple"
|
|
|
+ allowClear
|
|
|
+ v-model="queryParam.labelNoList"
|
|
|
+ :showSearch="true"
|
|
|
+ option-filter-prop="children"
|
|
|
+ :filter-option="filterOption"
|
|
|
+ >
|
|
|
+ <a-select-option v-for="item in lableData" :key="item.labelNo" :value="item.labelNo">{{ item.labelName }}</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="5">
|
|
|
<a-button class="handle-btn serach-btn" id="rubbishTotal-btn-serach" type="primary" @click="$refs.table.refresh(true)">查询</a-button>
|
|
|
<a-button class="handle-btn serach-btn" type="" id="rubbishTotal-btn-reset" @click="handleReset">重置</a-button>
|
|
|
<a-button class="export-btn" id="rubbishTotal-export" v-hasPermission="'M_rubbishTotal_export'" :loading="loading" @click="handleExport">导出</a-button>
|
|
@@ -78,30 +94,15 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import {
|
|
|
- STable,
|
|
|
- VSelect
|
|
|
-} from '@/components'
|
|
|
-import {
|
|
|
- stationList
|
|
|
-} from '@/api/releaseRecord.js'
|
|
|
-import {
|
|
|
- getProvince,
|
|
|
- getCityByPro,
|
|
|
- getDistrictByCity
|
|
|
-} from '@/api/station'
|
|
|
-import {
|
|
|
- getSumList,
|
|
|
- exportSumForm,
|
|
|
- getSumTotal
|
|
|
-} from '@/api/reportForm.js'
|
|
|
+import { STable, VSelect } from '@/components'
|
|
|
+import { stationList } from '@/api/releaseRecord.js'
|
|
|
+import { lableSeleteList } from '@/api/labelSetting.js'
|
|
|
+import { getProvince, getCityByPro, getDistrictByCity } from '@/api/station'
|
|
|
+import { getSumList, exportSumForm, getSumTotal } from '@/api/reportForm.js'
|
|
|
import moment from 'moment'
|
|
|
import getDate from '@/libs/getDate.js'
|
|
|
export default {
|
|
|
- components: {
|
|
|
- STable,
|
|
|
- VSelect
|
|
|
- },
|
|
|
+ components: { STable, VSelect },
|
|
|
data () {
|
|
|
return {
|
|
|
loading: false,
|
|
@@ -131,108 +132,30 @@ export default {
|
|
|
cityCode: undefined, // 市
|
|
|
cityName: '', // 市名称
|
|
|
districtCode: undefined, // 区
|
|
|
- districtName: '' // 区名称
|
|
|
+ districtName: '', // 区名称
|
|
|
+ labelNoList: []
|
|
|
},
|
|
|
addrProvinceList: [], // 省下拉
|
|
|
addrCityList: [], // 市下拉
|
|
|
addrDistrictList: [], // 区下拉
|
|
|
optionData: [],
|
|
|
+ lableData: [],
|
|
|
totalNum: 0, // 总条数
|
|
|
recyclTotal: 0, // 可回收总计
|
|
|
harmTotal: 0, // 有害垃圾总计
|
|
|
// 表头
|
|
|
- columns: [{
|
|
|
- title: '序号',
|
|
|
- dataIndex: 'no',
|
|
|
- width: 60,
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
- {
|
|
|
- title: '网点名称',
|
|
|
- dataIndex: 'stationName',
|
|
|
- width: 100,
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
- {
|
|
|
- title: '可回收垃圾投递量(kg)',
|
|
|
- children: [{
|
|
|
- title: '废旧衣物',
|
|
|
- width: 100,
|
|
|
- align: 'center',
|
|
|
- dataIndex: 'clothesWeight',
|
|
|
- customRender: (text) => {
|
|
|
- return text || 0
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- title: '废旧纸张',
|
|
|
- width: 100,
|
|
|
- align: 'center',
|
|
|
- dataIndex: 'paperWeight',
|
|
|
- customRender: (text) => {
|
|
|
- return text || 0
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- title: '废旧塑料',
|
|
|
- width: 100,
|
|
|
- align: 'center',
|
|
|
- dataIndex: 'plasticWeight',
|
|
|
- customRender: (text) => {
|
|
|
- return text || 0
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- title: '废旧金属',
|
|
|
- width: 100,
|
|
|
- align: 'center',
|
|
|
- dataIndex: 'metalWeight',
|
|
|
- customRender: (text) => {
|
|
|
- return text || 0
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- title: '废旧金属/塑料',
|
|
|
- width: 100,
|
|
|
- align: 'center',
|
|
|
- dataIndex: 'plasticOrMetalWeight',
|
|
|
- customRender: (text) => {
|
|
|
- return text || 0
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- title: '废旧玻璃',
|
|
|
- width: 100,
|
|
|
- align: 'center',
|
|
|
- dataIndex: 'glassWeight',
|
|
|
- customRender: (text) => {
|
|
|
- return text || 0
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- title: '可回收物',
|
|
|
- width: 100,
|
|
|
- align: 'center',
|
|
|
- dataIndex: 'recyclingWeight',
|
|
|
- customRender: (text) => {
|
|
|
- return text || 0
|
|
|
- }
|
|
|
- }
|
|
|
- ]
|
|
|
- },
|
|
|
- {
|
|
|
- title: '可回收垃圾小计(kg)',
|
|
|
- dataIndex: 'recyclTotalWeight',
|
|
|
- width: 100,
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
- {
|
|
|
- title: '有害垃圾(kg)',
|
|
|
- dataIndex: 'harmWeight',
|
|
|
- width: 100,
|
|
|
- align: 'center'
|
|
|
- }
|
|
|
- ],
|
|
|
+ columns: [{ title: '序号', dataIndex: 'no', width: 60, align: 'center' },
|
|
|
+ { title: '网点名称', dataIndex: 'stationName', width: 100, align: 'center' },
|
|
|
+ { title: '可回收垃圾投递量(kg)',
|
|
|
+ children: [{ title: '废旧衣物', width: 100, align: 'center', dataIndex: 'clothesWeight', customRender: (text) => { return text || 0 } },
|
|
|
+ { title: '废旧纸张', width: 100, align: 'center', dataIndex: 'paperWeight', customRender: (text) => { return text || 0 } },
|
|
|
+ { title: '废旧塑料', width: 100, align: 'center', dataIndex: 'plasticWeight', customRender: (text) => { return text || 0 } },
|
|
|
+ { title: '废旧金属', width: 100, align: 'center', dataIndex: 'metalWeight', customRender: (text) => { return text || 0 } },
|
|
|
+ { title: '废旧金属/塑料', width: 100, align: 'center', dataIndex: 'plasticOrMetalWeight', customRender: (text) => { return text || 0 } },
|
|
|
+ { title: '废旧玻璃', width: 100, align: 'center', dataIndex: 'glassWeight', customRender: (text) => { return text || 0 } },
|
|
|
+ { title: '可回收物', width: 100, align: 'center', dataIndex: 'recyclingWeight', customRender: (text) => { return text || 0 } }] },
|
|
|
+ { title: '可回收垃圾小计(kg)', dataIndex: 'recyclTotalWeight', width: 100, align: 'center' },
|
|
|
+ { title: '有害垃圾(kg)', dataIndex: 'harmWeight', width: 100, align: 'center' }],
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
|
const searchData = Object.assign(parameter, this.queryParam)
|
|
@@ -254,8 +177,8 @@ export default {
|
|
|
this.getListTotal()
|
|
|
return res.data
|
|
|
} else {
|
|
|
- this.totalNum = 0
|
|
|
- }
|
|
|
+ this.totalNum = 0
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
}
|
|
@@ -263,12 +186,13 @@ export default {
|
|
|
beforeRouteEnter (to, from, next) {
|
|
|
next(vm => {
|
|
|
vm.time = [
|
|
|
- moment(getDate.getRecentday().starttime, 'YYYY-MM-DD HH'),
|
|
|
- moment(getDate.getRecentday().endtime, 'YYYY-MM-DD HH')
|
|
|
+ moment(getDate.getRecentday().starttime, 'YYYY-MM-DD HH'),
|
|
|
+ moment(getDate.getRecentday().endtime, 'YYYY-MM-DD HH')
|
|
|
]
|
|
|
vm.$refs.queryForm.resetFields()
|
|
|
vm.getStationList()
|
|
|
vm.getProvinceList()
|
|
|
+ vm.getlableSeleteList()
|
|
|
})
|
|
|
},
|
|
|
methods: {
|
|
@@ -288,6 +212,14 @@ export default {
|
|
|
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
|
)
|
|
|
},
|
|
|
+ // 获取标签数据
|
|
|
+ getlableSeleteList () {
|
|
|
+ lableSeleteList().then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.lableData = res.data || []
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 获取省列表'
|
|
|
getProvinceList () {
|
|
|
getProvince().then(res => {
|
|
@@ -302,7 +234,7 @@ export default {
|
|
|
getCityList (val) {
|
|
|
this.addrCityList = []
|
|
|
this.addrDistrictList = []
|
|
|
- this.queryParam.provinceName = val ? this.addrProvinceList.find(item => item.code == this.queryParam.provinceCode).name : ''
|
|
|
+ this.queryParam.provinceName = val ? this.addrProvinceList.find(item => item.code == this.queryParam.provinceCode).name : ''
|
|
|
this.queryParam.cityCode = undefined
|
|
|
this.queryParam.cityName = ''
|
|
|
this.queryParam.districtCode = undefined
|
|
@@ -323,9 +255,9 @@ export default {
|
|
|
// 获取区县列表
|
|
|
getAreaList (val) {
|
|
|
this.addrDistrictList = []
|
|
|
- this.queryParam.cityName = val ? this.addrCityList.find(item => item.code == this.queryParam.cityCode).name : ''
|
|
|
+ this.queryParam.cityName = val ? this.addrCityList.find(item => item.code == this.queryParam.cityCode).name : ''
|
|
|
this.queryParam.districtCode = undefined
|
|
|
- this.queryParam.districtName = ''
|
|
|
+ this.queryParam.districtName = ''
|
|
|
this.getAreaListRequest(val)
|
|
|
},
|
|
|
getAreaListRequest (val) {
|
|
@@ -367,18 +299,18 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
this.$confirm({
|
|
|
- title: '提示',
|
|
|
- content: '导出过程可能需要一些时间,且导出期间不能进行其它操作,确定要导出吗?',
|
|
|
- onOk: () => {
|
|
|
- this.loading = true
|
|
|
- exportSumForm(params).then(res => {
|
|
|
- this.loading = false
|
|
|
- this.download(res)
|
|
|
- })
|
|
|
- },
|
|
|
- onCancel () {
|
|
|
+ title: '提示',
|
|
|
+ content: '导出过程可能需要一些时间,且导出期间不能进行其它操作,确定要导出吗?',
|
|
|
+ onOk: () => {
|
|
|
+ this.loading = true
|
|
|
+ exportSumForm(params).then(res => {
|
|
|
+ this.loading = false
|
|
|
+ this.download(res)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onCancel () {
|
|
|
console.log('Cancel')
|
|
|
- }
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
download (data) {
|
|
@@ -391,8 +323,8 @@ export default {
|
|
|
link.href = url
|
|
|
const a = moment(this.queryParam.beginDate).format('LL') + '-' + moment(this.queryParam.endDate).format('LL')
|
|
|
const address = this.queryParam.provinceCode ? this.addrProvinceList.find(item => item.id == this.queryParam.provinceCode).name +
|
|
|
- (this.queryParam.cityCode ? this.addrCityList.find(item => item.id == this.queryParam.cityCode).name : '') +
|
|
|
- (this.queryParam.districtCode ? this.addrDistrictList.find(item => item.id == this.queryParam.districtCode).name : '') : ''
|
|
|
+ (this.queryParam.cityCode ? this.addrCityList.find(item => item.id == this.queryParam.cityCode).name : '') +
|
|
|
+ (this.queryParam.districtCode ? this.addrDistrictList.find(item => item.id == this.queryParam.districtCode).name : '') : ''
|
|
|
const fname = a + '垃圾分类投递量统计表' + (address ? '(' + address + ')' : '')
|
|
|
link.setAttribute('download', fname + '.xlsx')
|
|
|
document.body.appendChild(link)
|
|
@@ -435,9 +367,10 @@ export default {
|
|
|
// 重置
|
|
|
handleReset () {
|
|
|
this.time = [
|
|
|
- moment(getDate.getRecentday().starttime, 'YYYY-MM-DD HH'),
|
|
|
- moment(getDate.getRecentday().endtime, 'YYYY-MM-DD HH')
|
|
|
- ]
|
|
|
+ moment(getDate.getRecentday().starttime, 'YYYY-MM-DD HH'),
|
|
|
+ moment(getDate.getRecentday().endtime, 'YYYY-MM-DD HH')
|
|
|
+ ]
|
|
|
+ this.queryParam.labelNoList = []
|
|
|
this.$refs.queryForm.resetFields()
|
|
|
this.$refs.table.refresh(true)
|
|
|
}
|