4 changed files with 794 additions and 622 deletions
@ -1,428 +0,0 @@ |
|||||
<template> |
|
||||
<div class="m-record"> |
|
||||
<h3>检查记录</h3> |
|
||||
<div> |
|
||||
<div class="u-table-btn1 mt10" v-if="formType == 'edit'"> |
|
||||
<el-button size="small" class="diy-button--blue" :disabled="btnDisabled || disabled" @click="handleAdd">新增</el-button> |
|
||||
</div> |
|
||||
<div class="m-table-item"> |
|
||||
<el-table :data="tableData" class="resi-table" row-key="id" border style="width: 100%"> |
|
||||
<el-table-column label="序号" type="index" align="center" width="50"></el-table-column> |
|
||||
|
|
||||
<el-table-column prop="inspectTime" label="检查时间" align="center" width="200px"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-date-picker |
|
||||
v-if="scope.row.isEdit" |
|
||||
v-model="scope.row.inspectTime" |
|
||||
type="date" |
|
||||
class="input-width" |
|
||||
value-format="yyyy-MM-dd" |
|
||||
placeholder="选择日期" |
|
||||
></el-date-picker> |
|
||||
<div v-else class="div-content">{{ scope.row.inspectTime }}</div> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
|
|
||||
<el-table-column prop="inspectStaffId" label="检查人员" align="center" width="200px"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-select |
|
||||
v-if="scope.row.isEdit" |
|
||||
v-model="scope.row.inspectStaffId" |
|
||||
placeholder="请选择" |
|
||||
class="input-width" |
|
||||
@change="handleChangeStaff(scope.row)" |
|
||||
clearable |
|
||||
> |
|
||||
<el-option v-for="subItem in optionStaff" :key="subItem.value" :label="subItem.label" :value="subItem.value"></el-option> |
|
||||
</el-select> |
|
||||
<div v-else class="div-content">{{ scope.row.inspectStaffName }}</div> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
|
|
||||
<el-table-column prop="inspectStaffMobile" label="联系电话" align="center" width="200px"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-input |
|
||||
v-if="scope.row.isEdit" |
|
||||
type="number" |
|
||||
v-model="scope.row.inspectStaffMobile" |
|
||||
placeholder="请输入" |
|
||||
class="input-width" |
|
||||
clearable |
|
||||
disabled |
|
||||
></el-input> |
|
||||
<div v-else class="div-content">{{ scope.row.inspectStaffMobile }}</div> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
|
|
||||
<el-table-column prop="inspectResult" label="检查结果" align="center" width="200px"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-select v-if="scope.row.isEdit" v-model="scope.row.inspectResult" placeholder="请选择" class="input-width" size="small" clearable> |
|
||||
<el-option v-for="subItem in optionResult" :key="subItem.value" :label="subItem.label" :value="subItem.value"></el-option> |
|
||||
</el-select> |
|
||||
<div v-else class="div-content">{{ scope.row.inspectResult == 1 ? '正常' : '异常' }}</div> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
|
|
||||
<!-- <el-table-column |
|
||||
prop="detailed" |
|
||||
label="隐患明细" |
|
||||
align="center" |
|
||||
width="200px" |
|
||||
> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-input |
|
||||
v-if="scope.row.isEdit" |
|
||||
type="text" |
|
||||
v-model="scope.row.detailed" |
|
||||
placeholder="请输入" |
|
||||
class="input-width" |
|
||||
maxlength="500" |
|
||||
clearable |
|
||||
></el-input> |
|
||||
<div v-else class="div-content"> |
|
||||
{{ scope.row.detailed }} |
|
||||
</div> |
|
||||
</template> |
|
||||
</el-table-column> --> |
|
||||
|
|
||||
<el-table-column prop="imgList" label="图片列表" align="center" width="150px"> |
|
||||
<template slot-scope="scope"> |
|
||||
<div v-if="scope.row.isEdit"> |
|
||||
<el-upload |
|
||||
:headers="$getElUploadHeaders()" |
|
||||
class="avatar-uploader" |
|
||||
:action="uploadUrl" |
|
||||
:data="{ customerId: customerId }" |
|
||||
:show-file-list="true" |
|
||||
:limit="3" |
|
||||
:file-list="scope.row.imgShowList" |
|
||||
:on-success="res => handleImgSuccess(res, scope.row)" |
|
||||
:on-remove="res => handleImgRemove(res, scope.row)" |
|
||||
list-type="picture" |
|
||||
:before-upload="beforeImgUpload" |
|
||||
> |
|
||||
<i class="el-icon-plus avatar-uploader-icon"></i> |
|
||||
最多三张图片 |
|
||||
</el-upload> |
|
||||
</div> |
|
||||
|
|
||||
<div v-else class="div-content"> |
|
||||
<el-image |
|
||||
v-if="scope.row.imgList.length > 0" |
|
||||
style="width: 100px; height: 50px" |
|
||||
:src="scope.row.imgList[0]" |
|
||||
fit="cover" |
|
||||
:preview-src-list="scope.row.imgList" |
|
||||
></el-image> |
|
||||
</div> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
|
|
||||
<el-table-column prop="nextInspectTime" label="拟复查时间" align="center" width="200px"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-date-picker |
|
||||
v-if="scope.row.isEdit" |
|
||||
v-model="scope.row.nextInspectTime" |
|
||||
type="date" |
|
||||
class="input-width" |
|
||||
value-format="yyyy-MM-dd" |
|
||||
placeholder="选择日期" |
|
||||
></el-date-picker> |
|
||||
<div v-else class="div-content">{{ scope.row.nextInspectTime }}</div> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
|
|
||||
<el-table-column v-if="!disabled" fixed="right" label="操作" align="center" width="120"> |
|
||||
<template slot-scope="scope"> |
|
||||
<template v-if="scope.row.isEdit"> |
|
||||
<el-button @click="handleEdit(scope.row)" type="text" size="small" class="btn-color-edit">保存</el-button> |
|
||||
<el-button @click="handleChange(scope.row, 'cancle')" type="text" size="small" class="btn-color-edit">取消</el-button> |
|
||||
</template> |
|
||||
<template v-else> |
|
||||
<el-button v-if="formType == 'edit'" @click="handleChange(scope.row, 'edit')" type="text" size="small" :disabled="disabled" class="btn-color-edit"> |
|
||||
修改 |
|
||||
</el-button> |
|
||||
<el-popconfirm v-if="formType == 'edit'" title="删除之后无法恢复,确认删除?" @onConfirm="del(scope.row)" @confirm="del(scope.row)"> |
|
||||
<el-button slot="reference" type="text" size="small" class="btn-color-del" style="margin-left: 10px">删除</el-button> |
|
||||
</el-popconfirm> |
|
||||
</template> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
import { requestPost, requestGet } from '@/js/dai/request'; |
|
||||
export default { |
|
||||
props: { |
|
||||
id: { |
|
||||
type: String, |
|
||||
default: '' |
|
||||
}, |
|
||||
info: { |
|
||||
type: Object, |
|
||||
default: () => ({}) |
|
||||
}, |
|
||||
disabled: { |
|
||||
type: Boolean, |
|
||||
default: false |
|
||||
}, |
|
||||
formType: { |
|
||||
type: String, |
|
||||
default: '' |
|
||||
}, |
|
||||
source: { |
|
||||
//展示来源:manage 管理平台 visiual 可视化平台 |
|
||||
type: String, |
|
||||
default: 'manage' |
|
||||
} |
|
||||
}, |
|
||||
data() { |
|
||||
return { |
|
||||
uploadUrl: window.SITE_CONFIG['apiURL'] + '/oss/file/uploadqrcodeV2', |
|
||||
customerId: localStorage.getItem('customerId'), |
|
||||
|
|
||||
btnDisabled: false, |
|
||||
btnType: 'cancle', |
|
||||
isEdit: false, |
|
||||
tableData: [], |
|
||||
tempRow: {}, |
|
||||
|
|
||||
optionResult: [ |
|
||||
{ |
|
||||
label: '合格', |
|
||||
value: '0' |
|
||||
}, |
|
||||
{ |
|
||||
label: '不合格', |
|
||||
value: '1' |
|
||||
} |
|
||||
], |
|
||||
optionStaff: [ |
|
||||
// { |
|
||||
// label: "人名", |
|
||||
// value: "inspectStaffId", |
|
||||
// }, |
|
||||
] |
|
||||
}; |
|
||||
}, |
|
||||
|
|
||||
computed: { |
|
||||
allowOperate() { |
|
||||
const { |
|
||||
info: { agencyId } |
|
||||
} = this; |
|
||||
return agencyId && agencyId == this.$store.state.user.agencyId; |
|
||||
} |
|
||||
}, |
|
||||
watch: { |
|
||||
id: { |
|
||||
handler(val) { |
|
||||
console.log('val------points', val); |
|
||||
if (val.length > 0) { |
|
||||
this.btnDisabled = false; |
|
||||
this.getList(); |
|
||||
} else this.btnDisabled = true; |
|
||||
}, |
|
||||
immediate: true |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
created() { |
|
||||
console.log("id",this.id) |
|
||||
this.getOptionStaff(); |
|
||||
}, |
|
||||
|
|
||||
methods: { |
|
||||
beforeImgUpload(file) { |
|
||||
console.log(file); |
|
||||
const isLt1M = file.size / 1024 / 1024 < 10; |
|
||||
const srcType = file.type; |
|
||||
const format = file.name.split('.').pop(); |
|
||||
|
|
||||
if (!isLt1M) { |
|
||||
this.$message.error('上传文件大小不能超过 10MB!'); |
|
||||
return false; |
|
||||
} |
|
||||
if (srcType.indexOf('image') == -1) { |
|
||||
this.$message.error('仅限图片格式'); |
|
||||
return false; |
|
||||
} |
|
||||
return true; |
|
||||
}, |
|
||||
|
|
||||
handleImgSuccess(res, row) { |
|
||||
console.log('handleImgSuccess', res); |
|
||||
if (res.code === 0 && res.msg === 'success') { |
|
||||
row.imgList.push(res.data.url); |
|
||||
this.computeImgShowList(row); |
|
||||
} else { |
|
||||
this.$message.error(res.msg); |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
computeImgShowList(row) { |
|
||||
row.imgShowList = row.imgList.map(url => { |
|
||||
return { name: '', url }; |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
handleImgRemove(file, row) { |
|
||||
console.log('handleImgRemove', file); |
|
||||
let url = file.url || file.response.data.url; |
|
||||
if (url) { |
|
||||
row.imgList = row.imgList.filter(item => item !== url); |
|
||||
this.computeImgShowList(row); |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
getRowClass({ rowIndex, columnIndex }) { |
|
||||
if (rowIndex === 0) { |
|
||||
return 'background: #2195fe; color: #fff;'; |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
handleChange(row, type) { |
|
||||
console.log('type----', type); |
|
||||
if (type == 'cancle') { |
|
||||
row = { ...this.tempRow }; |
|
||||
row.isEdit = false; |
|
||||
if (this.btnType == 'add') this.tableData.pop(); |
|
||||
this.getList(); |
|
||||
console.log('row----', row); |
|
||||
} else { |
|
||||
this.tempRow = { ...row }; |
|
||||
row.isEdit = true; |
|
||||
} |
|
||||
this.btnType = type; |
|
||||
this.isEdit = !this.isEdit; |
|
||||
}, |
|
||||
|
|
||||
handleChangeStaff(row) { |
|
||||
const { inspectStaffId } = row; |
|
||||
const { optionStaff } = this; |
|
||||
let item = optionStaff.find(item => item.value == inspectStaffId); |
|
||||
if (item) { |
|
||||
row.inspectStaffName = item.name; |
|
||||
row.inspectStaffMobile = item.mobile; |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
async getOptionStaff() { |
|
||||
let url = `/data/aggregator/org/staff-select-list/${this.$store.state.user.agencyId}`; |
|
||||
const { data, code, msg } = await requestPost(url, {}); |
|
||||
|
|
||||
if (code === 0) { |
|
||||
this.optionStaff = data || []; |
|
||||
} else { |
|
||||
this.$message.error('请求工作人员数据失败!'); |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
async handleEdit(row) { |
|
||||
if (this.btnType == 'add') this.save(row); |
|
||||
else this.edit(row); |
|
||||
}, |
|
||||
|
|
||||
handleAdd() { |
|
||||
this.btnType = 'add'; |
|
||||
this.isEdit = true; |
|
||||
|
|
||||
const item = { |
|
||||
isEdit: true, |
|
||||
id: this.id, |
|
||||
inspectTime: '', |
|
||||
inspectStaffId: '', |
|
||||
inspectStaffName: '', |
|
||||
inspectStaffMobile: '', |
|
||||
inspectResult: '', |
|
||||
imgList: [], |
|
||||
nextInspectTime: '' |
|
||||
}; |
|
||||
this.computeImgShowList(item); |
|
||||
this.tableData.push(item); |
|
||||
}, |
|
||||
|
|
||||
async save(row) { |
|
||||
const params = { |
|
||||
equipmentId: this.id, |
|
||||
...row |
|
||||
}; |
|
||||
const url = `/actual/base/safetyEquipmentInspectRecord/save`; |
|
||||
const { data, code, msg } = await requestPost(url, params); |
|
||||
if (code === 0) { |
|
||||
return this.$message.error(res.msg); |
|
||||
} else { |
|
||||
this.$message.success('保存成功'); |
|
||||
row.isEdit = false; |
|
||||
this.isEdit = false; |
|
||||
this.btnType = 'cancle'; |
|
||||
this.getList(); |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
async edit(row) { |
|
||||
const params = { |
|
||||
...row |
|
||||
}; |
|
||||
const url = `/actual/base/safetyEquipmentInspectRecord/update`; |
|
||||
const { data, code, msg } = await requestPost(url, params); |
|
||||
if (code === 0) { |
|
||||
return this.$message.error(res.msg); |
|
||||
} else { |
|
||||
this.$message.success('保存成功'); |
|
||||
row.isEdit = false; |
|
||||
this.isEdit = false; |
|
||||
this.getList(); |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
async del(row) { |
|
||||
const url = `/actual/base/safetyEquipmentInspectRecord/delete/${this.id}`; |
|
||||
const { data, code, msg } = await requestPost(url); |
|
||||
|
|
||||
if (code === 0) { |
|
||||
return this.$message.error(res.msg); |
|
||||
} else { |
|
||||
this.$message.success('删除成功'); |
|
||||
this.getList(); |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
async getList() { |
|
||||
const params = { |
|
||||
equipmentId: this.id |
|
||||
}; |
|
||||
const url = `/actual/base/safetyEquipmentInspectRecord/page`; |
|
||||
const { data, code, msg } = await requestPost(url, params); |
|
||||
|
|
||||
if (code === 0) { |
|
||||
return this.$message.error(res.msg); |
|
||||
} else { |
|
||||
this.tableData = res.data.list.map(item => { |
|
||||
this.computeImgShowList(item); |
|
||||
return { |
|
||||
...item, |
|
||||
isEdit: false |
|
||||
}; |
|
||||
}); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
}; |
|
||||
</script> |
|
||||
|
|
||||
<style lang="scss" scoped> |
|
||||
@import '@/assets/scss/buttonstyle.scss'; |
|
||||
@import '@/assets/scss/modules/management/list-main.scss'; |
|
||||
|
|
||||
.mt10 { |
|
||||
margin-bottom: 10px; |
|
||||
} |
|
||||
.input-width { |
|
||||
width: 170px; |
|
||||
} |
|
||||
</style> |
|
@ -0,0 +1,351 @@ |
|||||
|
<template> |
||||
|
<div class="g-main"> |
||||
|
|
||||
|
<el-form :inline="true" |
||||
|
:model="formData" |
||||
|
ref="ref_searchform" |
||||
|
:label-width="'100px'"> |
||||
|
|
||||
|
<el-form-item label="查询时间" |
||||
|
prop="startTime"> |
||||
|
<el-date-picker v-model="timeRange" |
||||
|
type="daterange" |
||||
|
:clearable="false" |
||||
|
:picker-options="pickerOptions" |
||||
|
range-separator="至" |
||||
|
start-placeholder="开始日期" |
||||
|
end-placeholder="结束日期" |
||||
|
prefix-icon="el-icon-caret-bottom" |
||||
|
value-format="yyyy-MM-dd" |
||||
|
@change="handleTimeChange"> |
||||
|
</el-date-picker> |
||||
|
|
||||
|
</el-form-item> |
||||
|
|
||||
|
<div> |
||||
|
<el-form-item label="总计:" |
||||
|
prop="startTime"> |
||||
|
<span>{{totalPoint}}</span> |
||||
|
</el-form-item> |
||||
|
</div> |
||||
|
|
||||
|
</el-form> |
||||
|
|
||||
|
<el-table class="table" |
||||
|
:data="tableData" |
||||
|
border |
||||
|
:height="tableHeight" |
||||
|
v-loading="tableLoading" |
||||
|
:header-cell-style="{background:'#2195FE',color:'#FFFFFF'}" |
||||
|
style="width: 100%"> |
||||
|
|
||||
|
<el-table-column label="序号" |
||||
|
header-align="center" |
||||
|
align="center" |
||||
|
type="index" |
||||
|
width="50"></el-table-column> |
||||
|
<el-table-column prop="categoryName" |
||||
|
header-align="center" |
||||
|
align="center" |
||||
|
label="需求类型" |
||||
|
width="180"> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="demandUserName" |
||||
|
header-align="center" |
||||
|
align="center" |
||||
|
label="需求人" |
||||
|
width="120"> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="content" |
||||
|
header-align="center" |
||||
|
align="center" |
||||
|
label="需求内容" |
||||
|
:show-overflow-tooltip="true" |
||||
|
min-width="230"> |
||||
|
</el-table-column> |
||||
|
|
||||
|
<el-table-column prop="pointTime" |
||||
|
header-align="center" |
||||
|
align="center" |
||||
|
label="时间" |
||||
|
width="150"> |
||||
|
</el-table-column> |
||||
|
|
||||
|
<el-table-column prop="score" |
||||
|
header-align="center" |
||||
|
align="center" |
||||
|
label="评价" |
||||
|
width="120"> |
||||
|
</el-table-column> |
||||
|
|
||||
|
<el-table-column prop="point" |
||||
|
header-align="center" |
||||
|
align="center" |
||||
|
label="积分" |
||||
|
width="100"> |
||||
|
</el-table-column> |
||||
|
|
||||
|
</el-table> |
||||
|
<div> |
||||
|
<el-pagination @size-change="handleSizeChange" |
||||
|
@current-change="handleCurrentChange" |
||||
|
:current-page.sync="pageNo" |
||||
|
:page-sizes="[10, 20, 50]" |
||||
|
:page-size="pageSize" |
||||
|
layout="sizes, prev, pager, next, total" |
||||
|
:total="total"> |
||||
|
</el-pagination> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
|
||||
|
|
||||
|
import util from '@js/util.js'; |
||||
|
import { requestPost } from "@/js/dai/request"; |
||||
|
import { mapGetters } from 'vuex' |
||||
|
import { Loading } from 'element-ui' // 引入Loading服务 |
||||
|
|
||||
|
let loading // 加载动画 |
||||
|
export default { |
||||
|
data () { |
||||
|
return { |
||||
|
loading: false, |
||||
|
totalPoint: 100, |
||||
|
total: 0, |
||||
|
pageSize: 10, |
||||
|
pageNo: 0, |
||||
|
tableLoading: false, |
||||
|
serviceId: '', |
||||
|
|
||||
|
pickerOptions: { //控制时间范围 |
||||
|
disabledDate (time) { |
||||
|
return time.getTime() > (Date.now()) |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
timeRange: [], |
||||
|
unitId: '', |
||||
|
formData: { |
||||
|
|
||||
|
startTime: '', |
||||
|
endTime: '' |
||||
|
}, |
||||
|
|
||||
|
tableData: [], |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
components: { |
||||
|
|
||||
|
}, |
||||
|
async created () { |
||||
|
|
||||
|
}, |
||||
|
async mounted () { |
||||
|
|
||||
|
|
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
async initForm (serviceId) { |
||||
|
this.initDate() |
||||
|
|
||||
|
this.serviceId = serviceId |
||||
|
|
||||
|
//获取数据 |
||||
|
await this.loadTable() |
||||
|
}, |
||||
|
|
||||
|
handleSearch () { |
||||
|
this.loadTable() |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
async loadTable () { |
||||
|
this.tableLoading = true |
||||
|
|
||||
|
const url = "/governance/userdemand/recordList" |
||||
|
// const url = "http://yapi.elinkservice.cn/mock/245/governance/userdemand/recordList" |
||||
|
let params = { |
||||
|
serviceType: this.serviceType, |
||||
|
serviceId: this.serviceId, |
||||
|
pageSize: this.pageSize, |
||||
|
pageNo: this.pageNo, |
||||
|
...this.formData |
||||
|
} |
||||
|
|
||||
|
const { data, code, msg } = await requestPost(url, params) |
||||
|
|
||||
|
if (code === 0) { |
||||
|
this.totalPoint = data.totalPoint |
||||
|
this.total = data.page.total |
||||
|
this.tableData = data.page.list |
||||
|
} else { |
||||
|
this.$message.error(msg) |
||||
|
} |
||||
|
this.tableLoading = false |
||||
|
}, |
||||
|
|
||||
|
//初始化时间 |
||||
|
initDate () { |
||||
|
let today = new Date((new Date).getTime()) |
||||
|
|
||||
|
let year = today.getFullYear() |
||||
|
let month = today.getMonth() + 1 //月 |
||||
|
let day = today.getDate() //日 |
||||
|
|
||||
|
let days = new Date(year, month, 0); |
||||
|
days = days.getDate(); //获取当前月的天数 |
||||
|
let year2 = year; |
||||
|
let month2 = parseInt(month) - 1; |
||||
|
if (month2 == 0) { |
||||
|
year2 = parseInt(year2) - 1; |
||||
|
month2 = 12; |
||||
|
} |
||||
|
let day2 = day; |
||||
|
let days2 = new Date(year2, month2, 0); |
||||
|
days2 = days2.getDate(); |
||||
|
if (day2 > days2) { |
||||
|
day2 = days2; |
||||
|
} |
||||
|
if (month2 < 10) { |
||||
|
month2 = '0' + month2; |
||||
|
} |
||||
|
if (month < 10) { |
||||
|
month = '0' + month; |
||||
|
} |
||||
|
if (day < 10) { |
||||
|
day = '0' + day; |
||||
|
} |
||||
|
if (day2 < 10) { |
||||
|
day2 = '0' + day2; |
||||
|
} |
||||
|
let t2 = year2 + '-' + month2 + '-' + day2; |
||||
|
let t1 = year + '-' + month + '-' + day; |
||||
|
// let t3 = formate(t2, style); |
||||
|
this.formData.startTime = t2 + ' 00:00:00' |
||||
|
this.formData.endTime = t1 + ' 23:59:59' |
||||
|
|
||||
|
this.timeRange = [t2, t1] |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
handleTimeChange (time) { |
||||
|
if (time) { |
||||
|
const startTimeArray = util.dateFormatter(time[0], 'date').split('-') |
||||
|
const endTimeArray = util.dateFormatter(time[1], 'date').split('-') |
||||
|
|
||||
|
this.formData.startTime = startTimeArray[0] + '-' + startTimeArray[1] + '-' + startTimeArray[2] + ' 00:00:00' |
||||
|
this.formData.endTime = endTimeArray[0] + '-' + endTimeArray[1] + '-' + endTimeArray[2] + ' 23:59:59' |
||||
|
|
||||
|
// this.startTimeShow = startTimeArray[0] + '年' + startTimeArray[1] + '月' + startTimeArray[2] + '日' |
||||
|
// this.endTimeShow = endTimeArray[0] + '年' + endTimeArray[1] + '月' + endTimeArray[2] + '日' |
||||
|
} else { |
||||
|
this.formData.startTime = '' |
||||
|
this.formData.endTime = '' |
||||
|
// this.startTimeShow = '' |
||||
|
// this.endTimeShow = '' |
||||
|
} |
||||
|
|
||||
|
this.loadTable() |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
handleSizeChange (val) { |
||||
|
this.pageSize = val |
||||
|
this.pageNo = 1 |
||||
|
this.loadTable() |
||||
|
}, |
||||
|
handleCurrentChange (val) { |
||||
|
this.pageNo = val |
||||
|
this.loadTable() |
||||
|
}, |
||||
|
|
||||
|
// 开启加载动画 |
||||
|
startLoading () { |
||||
|
loading = Loading.service({ |
||||
|
lock: true, // 是否锁定 |
||||
|
text: '正在加载……', // 加载中需要显示的文字 |
||||
|
background: 'rgba(0,0,0,.7)' // 背景颜色 |
||||
|
}) |
||||
|
}, |
||||
|
// 结束加载动画 |
||||
|
endLoading () { |
||||
|
// clearTimeout(timer); |
||||
|
if (loading) { |
||||
|
loading.close() |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
computed: { |
||||
|
tableHeight () { |
||||
|
|
||||
|
return (this.clientHeight - 460) |
||||
|
|
||||
|
}, |
||||
|
rowHeight () { |
||||
|
return (this.clientHeight - 200) + 'px' |
||||
|
}, |
||||
|
...mapGetters(['clientHeight']) |
||||
|
}, |
||||
|
watch: { |
||||
|
|
||||
|
}, |
||||
|
props: { |
||||
|
serviceType: { |
||||
|
type: String, |
||||
|
default: '' |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style lang="scss" scoped > |
||||
|
@import "@/assets/scss/buttonstyle.scss"; |
||||
|
|
||||
|
.g-main { |
||||
|
background: #ffffff; |
||||
|
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.1); |
||||
|
border-radius: 4px; |
||||
|
margin-top: 15px; |
||||
|
padding: 23px 30px 10px; |
||||
|
} |
||||
|
|
||||
|
.m-search { |
||||
|
background: #ffffff; |
||||
|
border-radius: 4px; |
||||
|
padding: 30px 20px 5px; |
||||
|
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.1); |
||||
|
} |
||||
|
|
||||
|
.item_width_1 { |
||||
|
width: 260px; |
||||
|
} |
||||
|
.item_width_2 { |
||||
|
width: 495px; |
||||
|
} |
||||
|
|
||||
|
.m-table { |
||||
|
background: #ffffff; |
||||
|
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.1); |
||||
|
border-radius: 4px; |
||||
|
margin-top: 15px; |
||||
|
padding: 23px 30px 10px; |
||||
|
|
||||
|
.table { |
||||
|
margin-top: 20px; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.el-row { |
||||
|
/* margin-bottom: 20px; */ |
||||
|
display: flex; |
||||
|
flex-wrap: wrap; |
||||
|
margin-top: 10px; |
||||
|
margin-right: 50px; |
||||
|
} |
||||
|
</style> |
Loading…
Reference in new issue