123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294 |
- <!-- 设备设施其他事项 -->
- <template>
- <div class='qt-list'>
- <div class='eq-list-top'>
- <el-input
- placeholder='搜索记录事项位置内容'
- style='width:192px;margin-right:12px'
- size='small'
- prefix-icon='el-icon-search'
- v-model='keyword'
- clearable
- @keyup.enter.native='pageChanged(1)'
- @blur='pageChanged(1)'
- ></el-input>
- <div class='picker-box'>
- <span class='picker-span'>选择处理日期:</span>
- <el-date-picker
- style='width:190px'
- v-model='handledate'
- value-format='yyyyMMdd'
- type='daterange'
- @change='pageChanged(1)'
- size='mini'
- range-separator='-'
- start-placeholder
- end-placeholder
- ></el-date-picker>
- </div>
- <Select
- width='180'
- tipPlace='top'
- caption='处置结果:'
- v-model='handleresults'
- :selectdata='handleOption'
- :placeholder='"请选择"'
- @change='pageChanged(1)'
- ></Select>
- </div>
- <div ref='tableBox'>
- <el-table :data='tableData' :border='true' style='width: 100%'>
- <el-table-column type='index' label='序号' width='60' :index='indexMethod'></el-table-column>
- <el-table-column prop='lb' label='其他事项详情' align='center'>
- <el-table-column prop='zlwfwe' label='记录事项' show-overflow-tooltip resizable min-width='320'>
- <template slot-scope='{row}'>{{row.jlsx || '--'}}</template>
- </el-table-column>
- <el-table-column prop label='位置' show-overflow-tooltip resizable width='425'>
- <template slot-scope='{row}'>{{row.description || '--'}}</template>
- </el-table-column>
- <el-table-column prop='content' label='内容' show-overflow-tooltip resizable width='260'>
- <template slot-scope='{row}'>{{row.content || '--'}}</template>
- </el-table-column>
- <el-table-column prop='sl' label='数量' width='80'>
- <template slot-scope='{row}'>{{row.sl>=0?row.sl:'--'}}</template>
- </el-table-column>
- </el-table-column>
- <el-table-column prop='zfje' label='金额(万元)' width='80' align='right'>
- <template slot-scope='{row}'>{{row.zfje || '--'}}</template>
- </el-table-column>
- <el-table-column prop='handledate' label='处理日期' width='130'>
- <template slot-scope='{row}'>{{row.handledate?formatter(row.handledate): '--'}}</template>
- </el-table-column>
- <el-table-column prop='handleresults' label='处置结果' show-overflow-tooltip resizable width='100'>
- <template slot-scope='{row}'>{{row.handleresults || '--'}}</template>
- </el-table-column>
- <el-table-column prop='zlwfwz ' label='资料存放位置' show-overflow-tooltip resizable width='100'>
- <template slot-scope='{row}'>{{row.zlwfwz || '--'}}</template>
- </el-table-column>
- <el-table-column prop='recordtime' label='记录日期' width='140'>
- <template slot-scope='{row}'>{{row.createdate?formatter(row.createdate): '--'}}</template>
- </el-table-column>
- </el-table>
- </div>
- <div class='foot'>
- <el-pagination
- background
- layout='prev, pager, next'
- :total='total'
- :page-size='size'
- :current-page='currentPage'
- @prev-click='pageChanged'
- @next-click='pageChanged'
- @current-change='pageChanged'
- ></el-pagination>
- </div>
- </div>
- </template>
- <script>
- import moment from 'moment'
- import { queryQtsx } from '@/api/equipmentList.js'
- import { mapGetters } from 'vuex'
- import { formatter, number_format } from '@/utils/format.js'
- import { querySelect } from '@/api/public.js'
- import { Select } from 'meri-design'
- export default {
- data() {
- return {
- tableData: [],
- total: 0,
- formatter,
- number_format,
- currentPage: 1,
- size: 10,
- keyword: '',
- handleresults: '1',
- handledate: '',
- handleOption: [],
- }
- },
- props: ['major', 'smsxt', 'tabLabel'],
- computed: {
- ...mapGetters(['floorSelect']),
- },
- methods: {
- //序号的方法
- indexMethod(index) {
- return (this.currentPage - 1) * this.size + index + 1
- },
- pageChanged(page) {
- this.currentPage = page
- this.getList()
- },
- getList() {
- let getParams = {
- data: {
- smsxt: this.smsxt,
- // tab: this.major,
- plazaId: this.$store.state.plazaId,
- page: this.currentPage,
- size: this.size,
- },
- }
- //输入框
- getParams.data.keyword = ''
- if (this.keyword) {
- getParams.data.keyword += `${this.keyword}:jlsx,location,content;`
- }
- if (getParams.data.keyword == '') {
- delete getParams.data.keyword
- }
- //时间
- if (this.handledate) {
- getParams.data.handledateStartDate = this.handledate[0] + '000000'
- // getParams.data.handledateEndDate = this.handledate[1] + '000000'
- getParams.data.handledateEndDate = moment(this.handledate[1]).format('YYYYMMDD235959')
- }
- //下拉
- if (this.handleresults && this.handleresults != 1) {
- getParams.data.handleresults = this.handleresults
- }
- queryQtsx(getParams).then((res) => {
- //console.log(res)
- this.tableData = res.data ? res.data : []
- this.total = res.count
- })
- },
- //下拉框查询
- tabFind() {
- let postParams = [
- {
- columnName: { handleresults: 'handleresults' },
- params: {
- system: this.smsxt,
- },
- tableName: 'sms_qtsx', //视图名称
- },
- ]
- let major
- if (this.major.slice(0, 2) == 'GD') {
- major = '供电'
- } else if (this.major.slice(0, 2) == 'XF') {
- major = '消防'
- } else if (this.major.slice(0, 2) == 'GPS') {
- major = '给排水'
- } else if (this.major.slice(0, 2) == 'DT') {
- major = '电梯'
- } else if (this.major.slice(0, 2) == 'RQ') {
- major = '燃气'
- } else if (this.major.slice(0, 2) == 'RD') {
- major = '弱电'
- } else if (this.major.slice(0, 2) == 'NT') {
- major = '暖通'
- } else if (this.major.slice(0, 2) == 'TJ') {
- major = '土建'
- } else {
- major = this.major
- }
- let data = {
- major: major,
- plazaId: this.$store.state.plazaId,
- }
- if (major != '土建') {
- data.onlyMainAsset = true
- }
- this.handleOption = []
- this.handleOption.push({
- id: '1',
- name: '全部',
- })
- querySelect({ data, postParams }).then((res) => {
- //console.log(res)
- let handleresults = res.data && res.data.data && res.data.data.sms_qtsx ? res.data.data.sms_qtsx.handleresults : []
- handleresults.forEach((el) => {
- this.handleOption.push({
- name: el.value,
- id: el.key,
- })
- })
- })
- },
- },
- watch: {
- smsxt(newV, oldV) {
- if (newV !== oldV) {
- this.tabFind()
- this.getList()
- }
- },
- tabLabel(newV, oldV) {
- if (newV !== oldV) {
- this.tabFind()
- this.getList()
- }
- },
- handleresults() {
- this.getList()
- },
- },
- mounted() {
- this.tabFind()
- //console.log(this.smsxt)
- this.getList()
- },
- }
- </script>
- <style lang="less" scoped>
- .qt-list {
- .eq-list-top {
- display: flex;
- margin-bottom: 12px;
- .picker-box {
- display: flex;
- align-items: center;
- background: #fff;
- padding: 0 6px;
- border: 1px solid #dcdfe6;
- border-radius: 4px;
- height: 32px;
- box-sizing: border-box;
- margin-right: 12px;
- .picker-span {
- margin-right: 6px;
- color: rgba(0, 0, 0, 0.65);
- }
- }
- }
- td {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .foot {
- height: 32px;
- display: flex;
- justify-content: flex-end;
- margin-top: 28px;
- }
- }
- </style>
- <style lang="less" >
- .qt-list {
- .picker-box {
- .el-input__inner {
- border: none;
- }
- .el-range-editor.el-input__inner {
- padding: 3px 0px;
- }
- .el-icon-date {
- display: none;
- }
- .el-range__close-icon {
- position: absolute;
- right: 0px;
- top: 2px;
- }
- .el-range-editor--mini .el-range-input {
- font-size: 14px;
- color: rgb(31, 36, 41);
- }
- }
- }
- </style>
|