From 9251f709dc2a0d278ef2c0cdd76a244bfefc5784 Mon Sep 17 00:00:00 2001 From: quanyawei <401863037@qq.com> Date: Thu, 12 Sep 2024 13:15:53 +0800 Subject: [PATCH] fix: 责任单位修改 --- src/views/toCarryOutLegislativeReforms/reform/index.vue | 824 +++++++++++++++++++++++++++++++++++++++++++++------------- 1 files changed, 633 insertions(+), 191 deletions(-) diff --git a/src/views/toCarryOutLegislativeReforms/reform/index.vue b/src/views/toCarryOutLegislativeReforms/reform/index.vue index ec3b62b..2c2257c 100644 --- a/src/views/toCarryOutLegislativeReforms/reform/index.vue +++ b/src/views/toCarryOutLegislativeReforms/reform/index.vue @@ -1,215 +1,505 @@ <template> - <div class="main" v-loading="loading"> + <div + v-loading="loading" + class="main" + > <div> - <searchBar v-if="searchType" :search-type="'reform'" @handleSearch="handleSearchBut" @handleAdd="handleOpenDialog(null, 'add')" /> - <newWorkOrder v-if="centerDialogVisible" ref="newWorkOrder" :parent-form-data="parentFormData" :title="title" :page-state="pageState" :visible.sync="centerDialogVisible" @handleSubmit="newHandleSubmit" /> + <searchBar + v-if="searchType" + :search-type="'reform'" + :initialization-data="initializationData" + @handleSearch="handleSearchBut" + @handleAdd="handleOpenDialog(null, 'add')" + /> + <newWorkOrder + v-if="centerDialogVisible" + ref="newWorkOrder" + :is-to-map.sync="isToMap" + :parent-form-data="parentFormData" + :title="title" + :page-state="pageState" + :visible.sync="centerDialogVisible" + @handleSubmit="newHandleSubmit" + /> <!-- <el-divider></el-divider> --> <div class="tab"> <div class="exportBox"> <div>������������</div> <div> - <el-button type="primary" size="mini" @click="handleOpenDialog(null, 'add')">������</el-button> - <el-button :disabled="!(selectionRows.length>0)" type="info" size="mini" @click="exportData">������</el-button> + <el-button + type="primary" + size="mini" + @click="handleOpenDialog(null, 'add')" + > + ������ + </el-button> + <el-button + :disabled="!(selectionRows.length>0)" + type="info" + size="mini" + @click="isNowDonw" + > + ������ + </el-button> </div> </div> - <el-table size="mini" :data="tableData" border max-height="680" style="width: 100%" @selection-change="handleSelectionChange" :header-cell-style="{ - color: '#101111', - fontSize: '16px' - }"> - <el-table-column type="selection" width="40" align="center"> - </el-table-column> - <el-table-column type="index" label="������" width="60px" align="center" /> - <el-table-column align="center"> - <template slot="header"> - <div>������</div> - <div>������������</div> - </template> - <template slot-scope="scope"> - <div>{{ scope.row.allocationNum }}</div> - <div>{{ scope.row.escalationTime }}</div> - </template> - </el-table-column> - <el-table-column align="center" prop="unitId" label="������������" width="150px" :formatter="unitIdFormatter" /> - <el-table-column align="center" prop="polluteType" label="������������" width="120px" :formatter="polluteTypeFormatter" /> - <el-table-column align="center"> - <template slot="header"> - <div>������������</div> - <div>������������</div> - </template> - <template slot-scope="scope"> - <div>{{ dictObj.changeEnum[scope.row.changeType] }}</div> - <div v-show="scope.row.changeType && scope.row.changeType === 2" :class="[Number(scope.row.residueDay) < 0 ? errorClass : '']"> - <span v-if="Number(scope.row.residueDay) < 0"> - ������ {{ Math.abs(scope.row.residueDay) }}��� - </span> - <span v-else> {{ scope.row.residueDay }}��� </span> - </div> - </template> - </el-table-column> - <el-table-column align="center" prop="investigationType" label="������������" width="100px" :formatter="investigationTypeFormatter" /> - <el-table-column align="center" prop="state" width="100px" label="������������"> - <template slot-scope="scope"> - <el-tag v-if="scope.row.state === 40" type="success"> - {{ stateFormatter(scope.row) }} - </el-tag> - <el-tag v-if="scope.row.state === 50" type="danger"> - {{ stateFormatter(scope.row) }} - </el-tag> - <el-tag v-if="scope.row.state === 9" type="info"> - {{ stateFormatter(scope.row) }} - </el-tag> - <el-tag v-if="scope.row.state === 20" type="warning"> - {{ stateFormatter(scope.row) }} - </el-tag> - <el-tag v-if="scope.row.state === 10" type="warning"> - {{ stateFormatter(scope.row) }} - </el-tag> - <el-tag v-if="scope.row.state === 30" type="warning"> - {{ stateFormatter(scope.row) }} - </el-tag> - </template> - </el-table-column> - <el-table-column align="center" prop="isInvalid" label="������������" width="60px" :formatter="isInvalidFormatter" /> - <el-table-column align="center" width="150px"> - <template slot="header"> - <div>������������</div> - <div>���������</div> - </template> - <template slot-scope="scope"> - <div>{{ scope.row.escalationName }}</div> - <div>{{ updatUnitIdFormatter(scope.row) }}</div> - </template> - </el-table-column> - <el-table-column align="center" width="150px"> - <template slot="header"> - <div>���������</div> - <div>������������</div> - </template> - <template slot-scope="scope"> - <div>{{ scope.row.updateName }}</div> - <div>{{ scope.row.updateTime }}</div> - </template> - </el-table-column> - <el-table-column align="center" prop="createTime" min-width="100px" label="������"> - <template slot-scope="scope"> - <el-button type="text" size="medium" @click="openWorkOrdinDialog(scope.row, 'detail')"> - ������ - </el-button> - <el-button type="text" v-if="scope.row.isCode==='1'" size="medium" @click="openEditDialog(scope.row)"> - ������������ - </el-button> - <el-button v-if="scope.row.state === 9" type="text" size="medium" @click="handleOpenDialog(scope.row, 'edit')"> - ������ - </el-button> - <el-button v-if="scope.row.state > 30 && scope.row.isInvalid === 0" type="text" size="medium" @click="handleCancel(scope.row)"> - ������ - </el-button> - <el-button v-if="scope.row.state === 20" type="text" size="medium" @click="openWorkOrdinDialog(scope.row, 'work')"> - ������ - </el-button> - <el-button v-if="scope.row.state === 30 && scope.row.isApprove === 1" type="text" size="medium" @click="openWorkOrdinDialog(scope.row, 'approve')"> - ������ - </el-button> - <el-button v-if=" - scope.row.state === 20 && - scope.row.changeType === 2 && - scope.row.applyState === 0 - " type="text" size="medium" @click="openWorkOrdinDialog(scope.row, 'delay')"> - ������������ - </el-button> - </template> - </el-table-column> - </el-table> + <div style="position: relative;"> + <div> + <div v-if="sealList.length>0"> + <div + v-for="(item,index) in sealList" + :key="index" + :style="{'height':item.styleHeight}" + > + <div + v-if="item.isInvalid===1" + class="yingzhang" + > + <div class="seal-red"> + ��������� + </div> + </div> + </div> + </div> + </div> + <div style="position: absolute;top:0;width: 100%;"> + <el-table + size="mini" + :data="tableData" + border + style="width: 100%" + :header-cell-style="{ + color: '#101111', + fontSize: '16px' + }" + @selection-change="handleSelectionChange" + > + <el-table-column + type="selection" + width="40" + align="center" + /> + <el-table-column + type="index" + label="������" + width="60px" + align="center" + /> + <el-table-column align="center"> + <template slot="header"> + <div>������</div> + <div>������������</div> + </template> + <template slot-scope="scope"> + <div>{{ scope.row.allocationNum }}</div> + <div>{{ scope.row.escalationTime }}</div> + </template> + </el-table-column> + <el-table-column + align="center" + prop="unitId" + label="������������" + width="150px" + :formatter="unitIdFormatter" + /> + <el-table-column + align="center" + prop="polluteType" + label="������������" + width="120px" + :formatter="polluteTypeFormatter" + /> + <el-table-column align="center"> + <template slot="header"> + <div>������������</div> + <div>������������</div> + </template> + <template slot-scope="scope"> + <div>{{ dictObj.changeEnum[scope.row.changeType] }}</div> + <div + v-show="scope.row.changeType && scope.row.changeType === 2" + :class="[Number(scope.row.residueDay) < 0 ? errorClass : '']" + > + <span v-if="Number(scope.row.residueDay) < 0"> + ������ {{ Math.abs(scope.row.residueDay) }}��� + </span> + <span v-else> {{ scope.row.residueDay }}��� </span> + </div> + </template> + </el-table-column> + <el-table-column + align="center" + prop="investigationType" + label="������������" + width="100px" + :formatter="investigationTypeFormatter" + /> + <el-table-column + align="center" + prop="state" + width="100px" + label="������������" + > + <template slot-scope="scope"> + <el-tag + v-if="scope.row.state === 40" + type="success" + > + {{ stateFormatter(scope.row) }} + </el-tag> + <el-tag + v-if="scope.row.state === 50" + type="danger" + > + {{ stateFormatter(scope.row) }} + </el-tag> + <el-tag + v-if="scope.row.state === 9" + type="info" + > + {{ stateFormatter(scope.row) }} + </el-tag> + <el-tag + v-if="scope.row.state === 20" + type="warning" + > + {{ stateFormatter(scope.row) }} + </el-tag> + <el-tag + v-if="scope.row.state === 10" + type="warning" + > + {{ stateFormatter(scope.row) }} + </el-tag> + <el-tag + v-if="scope.row.state === 30" + type="warning" + > + {{ stateFormatter(scope.row) }} + </el-tag> + </template> + </el-table-column> + <!-- <el-table-column align="center" prop="isInvalid" label="������������" width="60px" :formatter="isInvalidFormatter" /> --> + <el-table-column + align="center" + width="150px" + > + <template slot="header"> + <div>������������</div> + <div>���������</div> + </template> + <template slot-scope="scope"> + <div>{{ scope.row.escalationName }}</div> + <div>{{ updatUnitIdFormatter(scope.row) }}</div> + </template> + </el-table-column> + <el-table-column align="center"> + <template slot="header"> + <div>���������</div> + <div>������������</div> + </template> + <template slot-scope="scope"> + <div>{{ scope.row.updateName }}</div> + <div>{{ scope.row.updateTime }}</div> + </template> + </el-table-column> + <el-table-column + align="center" + prop="createTime" + min-width="100px" + label="������" + > + <template slot-scope="scope"> + <el-button + type="text" + size="medium" + @click="openWorkOrdinDialog(scope.row, 'detail')" + > + ������ + </el-button> + <el-button + v-if="scope.row.isCode==='1'" + type="text" + size="medium" + @click="openEditDialog(scope.row)" + > + ������������ + </el-button> + <el-button + v-if="scope.row.state === 9" + type="text" + size="medium" + @click="handleOpenDialog(scope.row, 'edit')" + > + ������ + </el-button> + <el-button + v-if="scope.row.state > 30 && scope.row.isInvalid === 0" + type="text" + size="medium" + @click="handleCancel(scope.row)" + > + ������ + </el-button> + <el-button + v-if="scope.row.state === 20" + type="text" + size="medium" + @click="openWorkOrdinDialog(scope.row, 'work')" + > + ������ + </el-button> + <el-button + v-if="scope.row.state === 30 && scope.row.isApprove === 1" + type="text" + size="medium" + @click="openWorkOrdinDialog(scope.row, 'approve')" + > + ������ + </el-button> + <el-button + v-if="scope.row.state === 20 && scope.row.changeType === 2 &&scope.row.applyState === 0" + type="text" + size="medium" + @click="openWorkOrdinDialog(scope.row, 'delay')" + > + ������������ + </el-button> + </template> + </el-table-column> + </el-table> + </div> + </div> </div> <div class="pagina"> - <el-pagination background :current-page="pagination.currentPage" :page-sizes="pagination.pageSizes" :page-size="pagination.pageSize" :total="pagination.totalCount" layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange" @current-change="handleCurrentChange" /> + <el-pagination + background + :current-page="pagination.currentPage" + :page-sizes="pagination.pageSizes" + :page-size="pagination.pageSize" + :total="pagination.totalCount" + layout="total, sizes, prev, pager, next, jumper" + @size-change="handleSizeChange" + @current-change="handleCurrentChange" + /> </div> </div> - <workOrderInformation v-if="workOrdinDialogVisible" :dialog-data="dialogData" :visible.sync="workOrdinDialogVisible" @handeleSumit="handeleSumit" /> - <el-dialog title="������" :visible.sync="dialogVisible" width="600px" :before-close="handleClose" center> + <workOrderInformation + v-if="workOrdinDialogVisible" + :dialog-data="dialogData" + :is-to-map.sync="isToMap" + :visible.sync="workOrdinDialogVisible" + @handeleSumit="handeleSumit" + /> + <el-dialog + title="������" + :visible.sync="dialogVisible" + width="600px" + :before-close="handleClose" + center + > <div> <el-form label-width="100px"> - <el-form-item label="���������������" style="margin-right: 30px"> - <el-input v-model="invalidReason" type="textarea" :autosize="{ minRows: 2, maxRows: 10 }" placeholder="���������������" /> + <el-form-item + label="���������������" + style="margin-right: 30px" + > + <el-input + v-model="invalidReason" + type="textarea" + :autosize="{ minRows: 2, maxRows: 10 }" + placeholder="���������������" + /> </el-form-item> </el-form> </div> - <span slot="footer" class="dialog-footer"> + <span + slot="footer" + class="dialog-footer" + > <el-button @click="handleClose">��� ���</el-button> - <el-button type="primary" @click="handleInvalid">��� ���</el-button> + <el-button + type="primary" + @click="handleInvalid" + >��� ���</el-button> </span> </el-dialog> - <el-dialog title="������" v-if="dialogEditVisible" :visible.sync="dialogEditVisible" width="800px" top='5vh' :before-close="handleClose" center> + <el-dialog + v-if="dialogEditVisible" + title="������" + :visible.sync="dialogEditVisible" + width="800px" + top="5vh" + :before-close="handleClose" + center + > <el-descriptions title="������������"> <template slot="extra"> <div> - {{ editEscalationUnitData.allocationNum}} + {{ editEscalationUnitData.allocationNum }} </div> </template> - <el-descriptions-item label="������������" label-class-name="itemSpan">{{ editEscalationUnitData.escalationTime }}</el-descriptions-item> - <el-descriptions-item label="������������" label-class-name="itemSpan">{{ updataUnitIdFormatter }}</el-descriptions-item> - <el-descriptions-item label="������������" label-class-name="itemSpan">{{ polluteTypeeDITFormatter }}</el-descriptions-item> - <el-descriptions-item label="������������" label-class-name="itemSpan">{{ dictObj.changeEnum[editEscalationUnitData.changeType] }}</el-descriptions-item> - <el-descriptions-item label="������������" label-class-name="itemSpan">{{ editEscalationUnitData.changeDay || 0}} ���</el-descriptions-item> - <el-descriptions-item label="������������" label-class-name="itemSpan">{{ updataEscalationUnitIdFormatter }}</el-descriptions-item> - <el-descriptions-item label="���������" label-class-name="itemSpan">{{ editEscalationUnitData.escalationName }}</el-descriptions-item> - <el-descriptions-item label="������������" label-class-name="itemSpan">{{ editEscalationUnitData.pollutePosition }}</el-descriptions-item> + <el-descriptions-item + label="������������" + label-class-name="itemSpan" + > + {{ editEscalationUnitData.escalationTime }} + </el-descriptions-item> + <el-descriptions-item + label="������������" + label-class-name="itemSpan" + > + {{ updataUnitIdFormatter }} + </el-descriptions-item> + <el-descriptions-item + label="������������" + label-class-name="itemSpan" + > + {{ polluteTypeeDITFormatter }} + </el-descriptions-item> + <el-descriptions-item + label="������������" + label-class-name="itemSpan" + > + {{ dictObj.changeEnum[editEscalationUnitData.changeType] }} + </el-descriptions-item> + <el-descriptions-item + label="������������" + label-class-name="itemSpan" + > + {{ editEscalationUnitData.changeDay || 0 }} ��� + </el-descriptions-item> + <el-descriptions-item + label="������������" + label-class-name="itemSpan" + > + {{ updataEscalationUnitIdFormatter }} + </el-descriptions-item> + <el-descriptions-item + label="���������" + label-class-name="itemSpan" + > + {{ editEscalationUnitData.escalationName }} + </el-descriptions-item> + <el-descriptions-item + label="������������" + label-class-name="itemSpan" + > + {{ editEscalationUnitData.pollutePosition }} + </el-descriptions-item> </el-descriptions> - <el-divider></el-divider> + <el-divider /> <div> - <p class="editTile">������������</p> - <el-form :inline="true" class="demo-form-inline"> + <p class="editTile"> + ������������ + </p> + <el-form + :inline="true" + class="demo-form-inline" + > <el-form-item label="������������:"> - <el-select v-model="formInEdit.unitId" size="small" clearable placeholder="���������"> - <el-option v-for="item in unitList" :key="item.unitId" :label="item.unitName" :value="item.unitId" /> + <el-select + v-model="formInEdit.unitId" + size="small" + clearable + placeholder="���������" + > + <el-option + v-for="item in unitList" + :key="item.unitId" + :label="item.unitName" + :value="item.unitId" + /> </el-select> </el-form-item> <el-form-item label="������������:"> - <el-select v-model="formInEdit.polluteType" size="small" clearable placeholder="���������"> - <el-option v-for="item in polluteList" :key="item.dataKey" :label="item.dataValue" :value="item.dataKey" /> + <el-select + v-model="formInEdit.polluteType" + size="small" + clearable + placeholder="���������" + > + <el-option + v-for="item in polluteList" + :key="item.dataKey" + :label="item.dataValue" + :value="item.dataKey" + /> </el-select> </el-form-item> </el-form> </div> <el-collapse> - <el-collapse-item title="������������" name="1"> + <el-collapse-item + title="������������" + name="1" + > <div class="block"> <el-timeline> - <el-timeline-item v-for="(activity, index) in operatingLog" :key="index" :color="'#0bbd87'" :timestamp="activity.createTime"> - <div v-if="activity.content"> ���������: {{activity.userName}}</div> - <div v-if="activity.content"> ������������: {{activity.content}}</div> - <div v-if="activity.polluteType"> ������������: {{activity.polluteType}}</div> + <el-timeline-item + v-for="(activity, index) in operatingLog" + :key="index" + :color="'#0bbd87'" + :timestamp="activity.createTime" + > + <div v-if="activity.content"> + ���������: {{ activity.userName }} + </div> + <div v-if="activity.content"> + ������������: {{ activity.content }} + </div> + <div v-if="activity.polluteType"> + ������������: {{ activity.polluteType }} + </div> </el-timeline-item> </el-timeline> </div> </el-collapse-item> </el-collapse> - <span slot="footer" class="dialog-footer"> + <span + slot="footer" + class="dialog-footer" + > <el-button @click="handleClose">��� ���</el-button> - <el-button type="primary" @click="handleEditChange">��� ���</el-button> + <el-button + type="primary" + @click="handleEditChange" + >��� ���</el-button> </span> </el-dialog> + <mapContainer + v-if="isToMap" + :visible.sync="isToMap" + @addressAndLnt="getaddressAndLnt" + /> </div> </template> <script> +// import { mixins } from './downLoadNotice' import axios from 'axios' +import _ from 'lodash' import qs from 'qs' import searchBar from '@/views/toCarryOutLegislativeReforms/components/queryForm' +import mapContainer from '@/views/toCarryOutLegislativeReforms/components/locationMap' import newWorkOrder from '@/views/toCarryOutLegislativeReforms/components/newWorkOrder' import workOrderInformation from '@/views/toCarryOutLegislativeReforms/components/workOrderInformation' export default { components: { searchBar, newWorkOrder, + mapContainer, workOrderInformation }, - data() { + // mixins: [mixins], + data () { return { loading: false, + isToMap: false, selectionRows: [], + position: [], errorClass: 'errorClass', searchType: 'reform', pagination: { @@ -217,7 +507,7 @@ // ������������������������������������������(���������������������������) totalCount: 0, // ������������������������������ - pageSizes: [10, 30, 60, 100], + pageSizes: [10, 50, 100, 200], // ������������������������������������������ pageSize: 10 }, @@ -239,7 +529,9 @@ dictObj: JSON.parse(localStorage.getItem('dictObj')), parentFormData: {}, pageState: 'add', + mapType: 'edit', invalidReason: '', + address: '', slectRow: {}, title: '', searchData: { @@ -250,7 +542,8 @@ polluteType: '', unitId: '' }, - operatingLog: [] + operatingLog: [], + sealList: [] } }, computed: { @@ -274,27 +567,91 @@ parseInt(item.dataKey) === this.editEscalationUnitData.polluteType ) return data ? data.dataValue : '' + }, + initializationData () { + return this.$route.query } }, - created() { - this.handleSearch({ isInvalid: 0, state: [9, 20, 30] }) + watch: { + isToMap (newVal, oldVal) { + this.isToMap = newVal + } + }, + created () { + if (Object.entries(this.$route.query).length === 0) { + this.handleSearch({ isInvalid: 0, state: [9, 20, 30] }) + } else { + let state = [] + let changeType = null + let startTime = this.initializationData.startTime + let endTime = this.initializationData.endTime + if (this.initializationData.type === 'total') { + state = [] + } else if (this.initializationData.type === 'unComplete') { + state = [9, 20, 30] + } else if (this.initializationData.type === 'complete') { + state = [40] + } else if (this.initializationData.type === 'overdue') { + state = [] + changeType = 2 + } + this.handleSearch({ isInvalid: 0, state: state, changeType: changeType, startTime: startTime, endTime: endTime }) + } this.getUnitList() this.getContaminateList() }, + // mounted () { + // console.log('this.$route.query', this.$route.query) + // this.initializationData = this.$route.query + // }, methods: { - handleSelectionChange(rows) { + getaddressAndLnt (position, address) { + if (this.mapType === 'edit') { + this.$refs.newWorkOrder.formData.pollutePosition = address + this.position = position + } + }, + handleSelectionChange (rows) { console.log(rows) this.selectionRows = rows }, - exportData() { + isNowDonw () { + this.$confirm('������������������������������?', '������', { + confirmButtonText: '������������', + cancelButtonText: '������������', + distinguishCancelAndClose: true, + type: 'warning' + }) + .then(() => { + this.loading = true + this.exportData() + }) + .catch(action => { + if (action === 'cancel') { + this.loading = false + this.exportData() + } else { + this.loading = false + } + }) + }, + exportData () { + // this.dowOrgFile('���������������.xlsx') + let that = this const CancelToken = axios.CancelToken let cancel - let timer = setTimeout(() => { - cancel() - this.loading = false - this.$message.error('���������������������������������������������') - }, 30000) - this.loading = true + let timer + const totalSize = this.selectionRows.length * 1024 * 1024 + const uniSign = new Date().getTime() + '' // ��������������������������������������������������������������������������������������������� + if (this.loading) { + timer = setTimeout(() => { + cancel() + this.loading = false + this.$message.error('���������������������������������������������') + }, 300000) + } + + // this.loading = true this.$request({ url: '/allocation/listExcel', method: 'get', @@ -302,9 +659,23 @@ params: { id: this.selectionRows.map(item => item.allocationId) }, - cancelToken: new CancelToken(function executor(c) { + cancelToken: new CancelToken(function executor (c) { cancel = c }), + onDownloadProgress (progress) { + console.log('onDownloadProgress', progress) + const loaded = progress.loaded + // progress������������loaded������������������������������total������������������������������������������ + let downProgress = Math.round((loaded / totalSize) * 100) + console.log('downProgress', downProgress) + // ������������������������������������������������������������vuex������������ + if (!that.loading) { + that.$store.commit('downLoadProgress/SET_PROGRESS', { + path: uniSign, + progress: downProgress + }) + } + }, paramsSerializer: params => { return qs.stringify(params, { indices: false @@ -317,36 +688,49 @@ if (res.code === -1) { this.$message.error(res.message) } else { + if (!that.loading) { + that.$store.commit('downLoadProgress/SET_PROGRESS', { + path: uniSign, + progress: 100 + }) + } this.getOutExcel('���������������.xlsx', res) } }) .catch(err => { clearTimeout(timer) + console.log('������������', err) this.loading = false }) }, - getOutExcel(fileName, res) { - let blob = new Blob([res], { type: 'application/x-xls' }) + getOutExcel (fileName, res) { + const blob = new Blob([res], { type: 'application/x-xls' }) if (window.navigator.msSaveOrOpenBlob) { - //������ IE & EDGE + // ������ IE & EDGE this.loading = false navigator.msSaveBlob(blob, fileName) } else { - var link = document.createElement('a') + const link = document.createElement('a') // ������������������������URL������ const url = window.URL || window.webkitURL || window.moxURL // ������������������ link.href = url.createObjectURL(blob) - //������������������ + // ������������������ link.download = fileName - //������������������ + // ������������������ link.click() - //������������������������ + // ������������������������ url.revokeObjectURL(link.href) + this.$message({ + showClose: true, + duration: 0, + message: '���������������', + type: 'success' + }) this.loading = false } }, - openEditDialog(row) { + openEditDialog (row) { this.editEscalationUnitData = row this.dialogEditVisible = true this.$request({ @@ -360,20 +744,20 @@ this.operatingLog = res.data }) .catch(err => { - this.$message.error(res.message) + this.$message.error(err.message) console.log('������Region������') console.log(err) }) }, - handleCancel(row) { + handleCancel (row) { this.dialogVisible = true this.slectRow = row }, - handleClose() { + handleClose () { this.dialogVisible = false this.dialogEditVisible = false }, - handleEditChange() { + handleEditChange () { if (this.formInEdit.polluteType === '' && this.formInEdit.unitId === '') { this.$message({ message: '���������������������', @@ -404,12 +788,12 @@ } }) .catch(err => { - this.$message.error(res.message) + this.$message.error(err.message) console.log('������Region������') console.log(err) }) }, - handleInvalid() { + handleInvalid () { this.$request({ url: '/allocation/invalid', method: 'get', @@ -430,12 +814,13 @@ }) }, // ������ - handleOpenDialog(row, type) { + handleOpenDialog (row, type) { this.pageState = type this.parentFormData = {} if (type === 'add') { this.title = '���������������' this.centerDialogVisible = true + this.mapType = 'edit' } else { this.title = '���������������' this.$request({ @@ -451,35 +836,35 @@ }) } }, - updatUnitIdFormatter(val) { + updatUnitIdFormatter (val) { const data = this.unitList.find( item => item && item.unitId === val.escalationUnitId ) return data ? data.unitName : '' }, - unitIdFormatter(val) { + unitIdFormatter (val) { const data = this.unitList.find( item => item && item.unitId === val.unitId ) return data ? data.unitName : '' }, - polluteTypeFormatter(val) { + polluteTypeFormatter (val) { const data = this.polluteList.find( item => item && parseInt(item.dataKey) === val.polluteType ) return data ? data.dataValue : '' }, - investigationTypeFormatter(val) { + investigationTypeFormatter (val) { return this.dictObj.investigationEnum[val.investigationType] }, - stateFormatter(val) { + stateFormatter (val) { return this.dictObj.allocationApproveEnum[val.state] }, - isInvalidFormatter(val) { + isInvalidFormatter (val) { return this.dictObj.yesOrNo[val.isInvalid] }, // ������������������list - getUnitList() { + getUnitList () { this.$request({ url: '/allocation/unit', method: 'get' @@ -491,7 +876,7 @@ } }) }, - getContaminateList() { + getContaminateList () { this.$request({ url: '/allocation/contaminate', method: 'get' @@ -503,11 +888,11 @@ } }) }, - handeleSumit() { + handeleSumit () { this.handleSearch() }, // ������ - newHandleSubmit(obj) { + newHandleSubmit (obj) { console.log(obj) console.log(this.parentFormData) let api = '/allocation/insert' @@ -515,10 +900,18 @@ api = '/allocation/update' // obj.fileBaseList = [...this.parentFormData.fileBaseList, ... obj.fileBaseList] } + let latitude = '' + let longitude = '' + if (this.position.length > 0) { + latitude = this.position[1] + longitude = this.position[0] + } this.$request({ url: api, method: 'post', data: { + 'latitude': latitude, + 'longitude': longitude, ...obj } }).then(res => { @@ -531,19 +924,20 @@ } }) }, - handleSearchBut(obj) { + handleSearchBut (obj) { + const pageSize = this.pagination.pageSize this.pagination = { currentPage: 1, // ������������������������������������������(���������������������������) totalCount: 0, // ������������������������������ - pageSizes: [10, 30, 60, 100], + pageSizes: [10, 50, 100, 200], // ������������������������������������������ - pageSize: 10 + pageSize: pageSize } this.handleSearch(obj) }, - handleSearch(obj) { + handleSearch (obj) { this.selectionRows = [] if (obj) { this.searchData = obj @@ -558,7 +952,21 @@ }).then(res => { if (res.code === 0) { this.tableData = res.data.list + this.sealList = _.cloneDeep(res.data.list) || [] + this.sealList.unshift({ isInvalid: 0 }) + this.sealList.forEach(item => { + item.styleHeight = null + }) this.pagination.totalCount = res.data.page.totalNum + this.$nextTick(() => { + const rows = this.$el.querySelectorAll('table tr') + for (let i = 0; i < rows.length; i++) { + const row = rows[i] + const height = row.getBoundingClientRect().height + this.sealList[i]['styleHeight'] = height + 'px' + } + this.$forceUpdate() + }) } else { this.$message.error(res.message) } @@ -566,7 +974,7 @@ }, // ������ // ��������������������� - handleSizeChange(val) { + handleSizeChange (val) { // ��������������������������� console.log('345') this.pagination.pageSize = val @@ -575,14 +983,14 @@ this.handleSearch() }, // ��������������� - handleCurrentChange(val) { + handleCurrentChange (val) { // ��������������������� console.log('123') this.pagination.currentPage = val this.handleSearch() // console.log(val) }, - openWorkOrdinDialog(row, type) { + openWorkOrdinDialog (row, type) { this.$request({ url: '/allocation/detail', method: 'get', @@ -609,8 +1017,11 @@ sysCode: '1010203' } } else if (type === 'detail') { + this.mapType = 'view' + this.position = [res.data.longitude, res.data.latitude] + this.address = res.data.pollutePosition this.dialogData = { - title: '���������', + title: '���������������', parentFormData: res.data, pageType: 'detail' } @@ -637,6 +1048,7 @@ overflow: overlay; } .tab { + min-height: 160px; margin-top: 0px; /deep/ .el-tag { font-size: 16px; @@ -683,4 +1095,34 @@ align-items: center; margin-bottom: 10px; } +.yingzhang { + position: relative; + + .seal-red { + position: absolute; + left: 85px; + top: 18px; + z-index: 999; + // top: -85px; + display: inline-block; + border: solid 2px #e93e00; + border-radius: 0.2em; + color: #e24c06; + font-size: 19px; + line-height: 1; + opacity: 0; + padding: 0.1em 0.5em; + text-transform: uppercase; + opacity: 0; + transform: rotate(-2deg) scale(5); + animation: seal 0.3s cubic-bezier(0.6, 0.04, 0.98, 0.335) forwards; + } + + @keyframes seal { + 100% { + opacity: 0.75; + transform: rotate(-15deg) scale(1); + } + } +} </style> -- Gitblit v1.8.0