123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354 |
- <!-- 维修-->
- <template>
- <div class='wx-list'>
- <div class='eq-list-top'>
- <el-input
- placeholder='搜索设备名称编号'
- size='small'
- @keyup.enter.native='getList'
- @blur='getList'
- clearable
- prefix-icon='el-icon-search'
- v-model='sbjc'
- style='width:192px;margin-right:12px'
- ></el-input>
- <el-input
- placeholder='搜索事项类型事项描述'
- size='small'
- clearable
- @keyup.enter.native='getList'
- @blur='getList'
- prefix-icon='el-icon-search'
- v-model='matters'
- style='width:192px;margin-right:12px'
- ></el-input>
- <Select
- @change='getList'
- style='margin-right:12px;'
- v-model='ischange'
- width='220'
- tipPlace='top'
- caption='是否更换:'
- :selectdata='changeOption'
- ></Select>
- <!-- placeholder='选择填报时间' -->
- <div class='picker-box'>
- <span class='picker-span'>填报日期:</span>
- <el-date-picker
- style='width:190px'
- v-model='reportdate'
- value-format='yyyyMMdd'
- type='daterange'
- @change='getList'
- size='mini'
- range-separator='-'
- start-placeholder
- end-placeholder
- ></el-date-picker>
- </div>
- <!-- placeholder='选择验收时间' -->
- <div class='picker-box'>
- <span class='picker-span'>验收日期:</span>
- <el-date-picker
- style='width:190px'
- v-model='sjjssj'
- value-format='yyyyMMdd'
- type='daterange'
- @change='getList'
- size='mini'
- range-separator='-'
- start-placeholder
- end-placeholder
- ></el-date-picker>
- </div>
- <input-dialog :type='3' @confirm='confirm'></input-dialog>
- </div>
- <div ref='tableBox'>
- <el-table :data='tableData' :border='true' style='width: 100%' @row-click='innerTable'>
- <el-table-column type='index' label='序号' width='60' :index='indexMethod'></el-table-column>
- <el-table-column prop='sbmc' label='设备名称' show-overflow-tooltip resizable min-width='460'>
- <template slot-scope='{row}'>{{row.sbmc || '--'}}</template>
- </el-table-column>
- <el-table-column prop='assetnum' label='设备内码' show-overflow-tooltip resizable width='80'>
- <template slot-scope='{row}'>{{row.assetnum || '--'}}</template>
- </el-table-column>
- <el-table-column prop='matters' label='事项类型' width='180' show-overflow-tooltip resizable>
- <template slot-scope='{row}'>{{row.matters || '--'}}</template>
- </el-table-column>
- <el-table-column prop='description' label='事项描述' show-overflow-tooltip resizable min-width='340'>
- <template slot-scope='{row}'>{{row.description || '--'}}</template>
- </el-table-column>
- <el-table-column label='更换配件信息' align='center'>
- <el-table-column prop='ischangepj' label='是/否更换' width='80'>
- <template slot-scope='{row}'>{{row.ismodel==1?'是':(row.ismodel==0?"否" :'--')}}</template>
- </el-table-column>
- <el-table-column prop='model' label='配件名称型号' width='140' show-overflow-tooltip resizable>
- <template slot-scope='{row}'>{{row.model || '--'}}</template>
- </el-table-column>
- <el-table-column prop='sl' label='数量' width='80' show-overflow-tooltip resizable>
- <template slot-scope='{row}'>{{row.sl>=0?row.sl:'--'}}</template>
- </el-table-column>
- <el-table-column prop='cost' label='费用(万元)' width='80' align='right' show-overflow-tooltip resizable>
- <template slot-scope='{row}'>{{number_format(row.cost,2) || '--'}}</template>
- </el-table-column>
- <el-table-column prop='source' label='费用出处' show-overflow-tooltip resizable width='100'>
- <template slot-scope='{row}'>{{row.source || '--'}}</template>
- </el-table-column>
- </el-table-column>
- <el-table-column prop='brand' label='现场照片' width='80'>
- <template slot-scope='{row}'>
- <div
- v-if='row.glsmsImage'
- style='cursor:pointer;color: #0091ff;'
- @click.stop='clickPic(row.glsmsImage)'
- >{{row.glsmsImage.length+'张'}}</div>
- <div v-else>{{'--'}}</div>
- </template>
- </el-table-column>
- <el-table-column prop='reportdate' label='填报时间' width='140'>
- <template slot-scope='{row}'>{{row.reportdate?formatterTime(row.reportdate): '--'}}</template>
- </el-table-column>
- <el-table-column prop='sjjssj' label='验收时间' width='140'>
- <template slot-scope='{row}'>{{row.sjjssj?formatterTime(row.sjjssj): '--'}}</template>
- </el-table-column>
- <el-table-column prop='wonum' label='工单编号' show-overflow-tooltip resizable width='80'>
- <template slot-scope='{row}'>
- <div v-if='row.wonum' @click.stop='staff(row)' style='cursor:pointer;color: #0091ff;'>{{row.wonum}}</div>
- <div v-else>{{'--'}}</div>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <div class='foot'>
- <el-pagination
- background
- layout='prev, pager, next'
- :total='total'
- :page-size='size'
- @prev-click='pageChanged'
- @next-click='pageChanged'
- @current-change='pageChanged'
- ></el-pagination>
- <pic-large :imgUrl='imgUrl' ref='picLargeOpen'></pic-large>
- </div>
- </div>
- </template>
- <script>
- import { queryWx } from '@/api/equipmentList.js'
- import { mapGetters } from 'vuex'
- import inputDialog from './inputDIalog'
- import { Select } from 'meri-design'
- import { formatterTime, number_format } from '@/utils/format.js'
- export default {
- components: { Select, inputDialog },
- data() {
- return {
- tableData: [],
- total: 0,
- currentPage: 1,
- reportdate: '',
- sjjssj: '',
- ischange: '2',
- sbjc: '',
- matters: '',
- wonum: '',
- formatterTime,
- number_format,
- imgUrl: [],
- changeOption: [
- {
- id: '2',
- name: '全部',
- },
- {
- id: '1',
- name: '是',
- },
- {
- id: '0',
- name: '否',
- },
- ],
- keyword: '',
- }
- },
- computed: {
- ...mapGetters(['floorSelect']),
- },
- props: ['smsxt', 'diff', 'tabLabel', 'size', 'assetnum'],
- methods: {
- //序号的方法
- indexMethod(index) {
- return (this.currentPage - 1) * this.size + index + 1
- },
- innerTable(row) {
- if (row.workorderid) {
- window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=JXWO&uniqueid=${row.workorderid}`)
- }
- },
- //跳转工单编号
- staff(row) {
- if (row.wonum) {
- window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=JXWO&uniqueid=${row.wonum}`)
- }
- },
- //多余输入框监听
- confirm(wonum) {
- this.wonum = wonum
- this.getList()
- },
- pageChanged(page) {
- this.currentPage = page
- this.getList()
- },
- getList() {
- let getParams = {
- data: {
- smsxt: this.smsxt,
- plazaId: this.$store.state.plazaId,
- page: this.currentPage,
- size: this.size,
- },
- }
- //区分主要设备
- if(this.smsxt != '1008'){
- getParams.data.onlyMainAsset = true
- }
- if (this.diff) {
- getParams.data.diff = this.diff
- }
- if (this.assetnum) {
- getParams.data.assetnum = this.assetnum
- }
- //下拉
- if (this.ischange && this.ischange != 2) {
- getParams.data.ismodel = this.ischange
- // getParams.data.ischangepj = this.ischange
- }
- if (this.sjjssj) {
- getParams.data.sjjssjStartDate = this.sjjssj[0] + '000000'
- getParams.data.sjjssjEndDate = this.sjjssj[1] + '000000'
- }
- if (this.reportdate) {
- getParams.data.reportdateStartDate = this.reportdate[0] + '000000'
- getParams.data.reportdateEndDate = this.reportdate[1] + '000000'
- }
- //输入框搜索
- getParams.data.keyword = ''
- if (this.sbjc) {
- getParams.data.keyword += `${this.sbjc}:sbmc,assetnum;`
- }
- if (this.matters) {
- getParams.data.keyword += `${this.matters}:description,matters;`
- }
- if (this.wonum) {
- getParams.data.keyword += `${this.wonum}:wonum`
- }
- if (getParams.data.keyword == '') {
- delete getParams.data.keyword
- }
- queryWx(getParams).then((res) => {
- this.tableData = res.data || []
- this.total = res.count
- })
- },
- clickPic(row) {
- this.imgUrl = []
- if (row) {
- row.forEach((el) => {
- let obj = {
- name: el.description,
- url: el.url,
- }
- this.imgUrl.push(obj)
- })
- }
- this.$refs.picLargeOpen.open(this.imgUrl)
- },
- startMethods() {
- this.getList()
- },
- },
- watch: {
- diff(newV, oldV) {
- if (newV !== oldV) {
- this.getList()
- }
- },
- tabLabel(newV, oldV) {
- if (newV !== oldV) {
- // this.tabFind()
- this.getList()
- }
- },
- ischange() {
- this.getList()
- },
- },
- mounted() {
- this.startMethods()
- },
- }
- </script>
- <style lang="less" scoped>
- .wx-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" >
- .wx-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);
- }
- }
- /deep/.el-table td {
- cursor: pointer;
- }
- }
- </style>
|