Commit 75b8885f by zhangquan

开发

1 parent 9fc7d9f2
import { http, http_common } from '@/main'
const defaultPath = 'scrm.api.live.'
const getGoodsList = params => {
params.method = 'scrm.api.shopmall.goods.page.curMerchant'
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
const uploadImg = params => {
params.method = `${defaultPath}wechat.upload.image`
return http({
url: 'rop-scrm-live/router',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file']
})
}
const getMerchantList = params => {
params.method = `${defaultPath}get.merchant.list`
return http({
url: 'rop-scrm-live/router',
method: 'POST',
data: params,
sign: true
})
}
const getZoneList = params => {
params.method = `${defaultPath}get.zone.list`
return http({
url: 'rop-scrm-live/router',
method: 'POST',
data: params,
sign: true
})
}
const pictureUpload = params => {
params.method = 'glsx.accounts.biz.common.pictureUpload'
return http_common({
url: '/router?method=glsx.accounts.biz.common.pictureUpload',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file']
})
}
const uploadFileApi = (params, callback) => {
params.method = 'scrm.api.equity.common.upload.common.multiple'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file'],
returnAll: true,
onUploadProgress: res => {
callback(res)
}
})
}
export default { getGoodsList, uploadImg, getMerchantList, getZoneList, pictureUpload, uploadFileApi }
<template>
<div class="activity-img-box">
<template v-if="imageUrlArr && imageUrlArr.length > 0">
<div v-for="(item, index) in imageUrlArr" :key="index">
<div class="pic-box" :style="{ width: picOptions.width, height: picOptions.height }">
<img class="photo-activity" :src="item" alt="" />
<div class="mask" :style="{ width: picOptions.width, height: picOptions.height }">
<div class="pic-pane-close" @click="handleEnlarge(item)">
<img src="../../assets/images/view.png" alt="" />
</div>
<template v-if="picOptions.isClose">
<div class="pic-pane-close" @click="close('img', index)">
<img src="../../assets/images/dele.png" alt="" />
</div>
</template>
</div>
</div>
</div>
</template>
<template v-if="(imageUrlArr && imageUrlArr.length < 9 && limit > 1) || (imageUrlArr && imageUrlArr.length == 0 && limit == 1)">
<div class="upload-img">
<i class="el-icon-plus avatar-uploader-desc-icon"></i>
<div class="avatar-uploader-desc-word">上传照片</div>
<input type="file" ref="uploadImg" class="upload-img" style="opacity: 0" accept=".jpg, .jpeg, .png" @change="e => handleImgChange(e)" />
</div>
</template>
<el-dialog class="image-dialog" :visible.sync="dialogVisibleImg" width="50%">
<img :src="dialogSrc" width="100%" v-if="dialogType == 'img'" />
<!-- <video width="100%" autoplay controls :src="dialogSrc" v-else></video> -->
</el-dialog>
</div>
</template>
<script>
export default {
props: {
picOptions: {
type: Object,
default: () => {
return {
width: '104px',
height: '104px',
isClose: true
}
}
},
imageUrlArr: {
type: Array,
default: () => []
},
limit: {
type: String,
default: '1'
},
index: {
type: Number,
default: -1
}
},
data() {
return {
dialogVisibleImg: false
}
},
methods: {
// 上传图片
handleImgChange(e) {
this.$notify({
title: '提示',
message: '图片上传中,请稍后'
})
var file = e.srcElement.files[0]
var reader = new FileReader()
// 默认1MB
const limitSize = 10
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
this.$message.error('上传图片大小不能超过' + limitSize + 'MB!')
return true
}
if (this.imageUrlArr.length > 9) {
this.$message.error('最多上传9张图片')
return
}
reader.readAsDataURL(file)
reader.onload = e => {
const imgFile = e.target.result
const arrBase64 = imgFile.split(',')
const splitStr = file.name.split('.')
const fileUrl = splitStr[splitStr.length - 1] + '@' + arrBase64[1]
this.$apis.common.pictureUpload({ file: fileUrl, compress: this.picOptions.compress || 0 }).then(res => {
if (res) {
this.$notify({
title: '提示',
message: '图片上传成功',
type: 'success'
})
this.imageUrlArr.push(res)
this.$emit('change', { arr: this.imageUrlArr, key: this.picOptions.key, index: this.index })
}
e.target.value = ''
this.$refs.uploadImg.value = ''
})
}
},
// 预览图文
handleEnlarge(src, type) {
this.dialogVisibleImg = true
this.dialogSrc = src
this.dialogType = type ? type : 'img'
},
// 删除图片/视频
close(type, index) {
switch (type) {
case 'radio':
this.videoUrl = ''
this.videoImage = ''
break
case 'img':
this.imageUrlArr.splice(index, 1)
this.$emit('change', { arr: this.imageUrlArr, key: this.picOptions.key, id: 1, index: this.index })
break
default:
this.videoUrl = ''
}
}
}
}
</script>
<style scoped lang="scss">
.activity-img-box {
display: flex;
flex-wrap: wrap;
max-width: 600px;
.pic-box {
position: relative;
width: 104px;
height: 104px;
border-radius: 4px;
margin-right: 8px;
margin-bottom: 5px;
&:hover .mask {
opacity: 1;
}
.pic {
position: absolute;
object-fit: fill;
}
.photo-activity {
position: absolute;
width: 100%;
height: 100%;
}
.mask {
display: flex;
align-items: center;
justify-content: center;
position: absolute;
background: rgba(0, 0, 0, 0.5);
color: #ffffff;
opacity: 0;
top: 0;
right: 0;
width: 104px;
height: 104px;
z-index: 999;
.pic-pane-close {
width: 16px;
height: 16px;
cursor: pointer;
margin-left: 24px;
&:first-child {
margin-left: 0;
}
img {
width: 100%;
display: block;
}
}
}
}
.upload-img {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 104px;
height: 104px;
background: rgba(0, 0, 0, 0.04);
border: 1px dashed rgba(0, 0, 0, 0.15);
border-radius: 4px;
input {
position: absolute;
// top: 0;
// left: 0;
width: 104px;
height: 104px;
}
}
.avatar-uploader-desc-word {
font-weight: 400;
font-size: 28rpx;
color: #666666;
margin-top: 8px;
}
.image-dialog {
/deep/ {
.el-dialog__header {
border-bottom: 0px;
padding: 0px;
}
}
}
}
</style>
...@@ -36,6 +36,14 @@ ...@@ -36,6 +36,14 @@
</div> </div>
</glsx-combi-form> </glsx-combi-form>
</GLDialog> </GLDialog>
<GLDialog mode="mid" title="车位照片" :visible.sync="uploadVisible" :before-close="uploadCancel" @onOk="uploadOk" @onCancel="uploadCancel">
<div class="upload-wrap">
<div class="upload-item" v-for="(item, index) in uploadList" :key="index">
<span class="label">{{ item.label }}</span>
<glsx-preview :imageUrlArr="item.url" @change="changeChannelImg"></glsx-preview>
</div>
</div>
</GLDialog>
</div> </div>
</template> </template>
...@@ -44,17 +52,41 @@ const STATUS_ENUM = { 1: '#EB4E4E', 2: '#2CCA74', 3: '#999999' } ...@@ -44,17 +52,41 @@ const STATUS_ENUM = { 1: '#EB4E4E', 2: '#2CCA74', 3: '#999999' }
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
import util from '@/utils/util' import util from '@/utils/util'
import glsxCombiForm from '@/components/glsx-combi-form' import glsxCombiForm from '@/components/glsx-combi-form'
import preview from '@/components/preview'
import { PHONE_MAX_NUM, FOLLOW_STATUS, FOLLOW_RESULT, SN_TYPE } from './constant' import { PHONE_MAX_NUM, FOLLOW_STATUS, FOLLOW_RESULT, SN_TYPE } from './constant'
export default { export default {
name: 'repairList', name: 'repairList',
components: { components: {
glsxCombiForm glsxCombiForm,
glsxPreview: preview
}, },
data() { data() {
return { return {
noticeVisible: false, noticeVisible: false,
collVisible: false, uploadVisible: true,
url: 'url', url: 'url',
uploadList: [
{
label: '停车场入口',
key: 1,
url: []
},
{
label: '车位所在楼层',
key: 2,
url: []
},
{
label: '车位实景',
key: 3,
url: []
},
{
label: '充电桩实景',
key: 4,
url: []
}
],
buttonList: [ buttonList: [
{ {
type: 'el-button', type: 'el-button',
...@@ -271,8 +303,7 @@ export default { ...@@ -271,8 +303,7 @@ export default {
{ {
label: '全部', label: '全部',
value: '' value: ''
}, }
...FOLLOW_STATUS
], ],
placeholder: '请选择' placeholder: '请选择'
} }
...@@ -345,9 +376,11 @@ export default { ...@@ -345,9 +376,11 @@ export default {
created() {}, created() {},
mounted() {}, mounted() {},
methods: { methods: {
reVisitFn(row) { changeChannelImg(e) {
this.curCollId = row.id console.log(e, 'conpl')
this.collVisible = true },
uploadCancel() {
this.uploadVisible = false
}, },
closeDialogFn() { closeDialogFn() {
this.collVisible = false this.collVisible = false
...@@ -357,63 +390,16 @@ export default { ...@@ -357,63 +390,16 @@ export default {
this.$refs.sendNoticeRef.$refs.formRef.validate(valid => { this.$refs.sendNoticeRef.$refs.formRef.validate(valid => {
if (valid) { if (valid) {
console.log(this.basicForm) console.log(this.basicForm)
const { pushFlag, pushPhonesList, sendTime } = this.basicForm
const params = {
pushFlag,
startTime: sendTime[0],
endTime: sendTime[1],
configType: 0,
pushPhones: pushPhonesList?.join(',') || ''
}
this.$apis.sendRepair.setNoticeApi(params).then(res => {
console.log(res)
if (res) {
this.$message.success('设置成功')
this.resetNoticeData()
}
})
} }
}) })
}, },
handleCancel() { handleCancel() {},
this.resetNoticeData()
},
resetNoticeData() {
this.noticeVisible = false
this.basicForm = {
pushFlag: 0,
sendTime: ['09:00', '20:00'],
pushPhonesList: ['']
}
},
addPhoneInputFn() {
if (this.basicForm.pushPhonesList.length >= PHONE_MAX_NUM) return
this.basicForm.pushPhonesList.push('')
},
delPhoneFn(idx) {
this.basicForm.pushPhonesList.splice(idx, 1)
},
setTableFinishFun() { setTableFinishFun() {
this.$refs.infoTableRef.data.length ? (this.$refs.infoTableRef.tableHeightValues = '') : this.$refs.infoTableRef.setTableHeightFun() this.$refs.infoTableRef.data.length ? (this.$refs.infoTableRef.tableHeightValues = '') : this.$refs.infoTableRef.setTableHeightFun()
}, },
setTableHeightEvent() { setTableHeightEvent() {
this.$refs.infoTableRef.setTableHeightFun() this.$refs.infoTableRef.setTableHeightFun()
}, },
openNoticeDialog() {
this.noticeVisible = true
this.$apis.sendRepair.getNoticeDetailApi({}).then(res => {
if (res?.length) {
const { configType, endTime, startTime, id, pushFlag, pushPhones } = res[0]
if (configType == 0) {
this.basicForm = {
pushFlag,
sendTime: [startTime, endTime],
pushPhonesList: pushPhones?.split(',') || []
}
}
}
})
},
// 搜索表格 // 搜索表格
searchTable() { searchTable() {
this.$refs.infoTableRef.refreshTable() this.$refs.infoTableRef.refreshTable()
...@@ -513,11 +499,6 @@ export default { ...@@ -513,11 +499,6 @@ export default {
border-radius: 4px; border-radius: 4px;
vertical-align: middle; vertical-align: middle;
} }
/deep/ .el-tag {
height: 26px;
line-height: 26px;
padding: 0 8px;
}
} }
.blue-text { .blue-text {
color: #5850ff; color: #5850ff;
...@@ -531,4 +512,28 @@ export default { ...@@ -531,4 +512,28 @@ export default {
color: #333333; color: #333333;
margin-bottom: 20px; margin-bottom: 20px;
} }
.upload-wrap {
display: flex;
justify-content: space-around;
.upload-item {
&:first-child {
margin-left: 0;
}
padding: 16px 23px 20px;
background: #f9f9f9;
margin-left: 8px;
display: flex;
align-items: center;
flex-direction: column;
.label {
display: inline-block;
height: 20px;
line-height: 20px;
font-weight: 500;
font-size: 14px;
color: #333333;
margin-bottom: 8px;
}
}
}
</style> </style>
<template>
<div>
<div class="scrm-sub-client-container">
<div class="pageContent">
<GLCombiForm class="search-wrap" :rowNumber="1" :formObj="searchForm" :formData="searchFormList" @handleOk="searchTable" @handleRest="resetTable">
<div class="date-select-wrap" slot="dateSelectSlot" slot-scope="scope">
<div :class="['date-item', { 'seleted-item': searchForm.curDate == item.value }]" v-for="(item, index) in scope.scope.dateList" :key="index">{{ item.name }}</div>
</div>
<div slot="inputSlot">
<el-input placeholder="请输入完整车位编号" v-model.trim="searchForm.sno" :clearable="true" type="text"></el-input>
</div>
</GLCombiForm>
<div class="statusList">
<div>
<span>历史详情</span>
</div>
<div>
<el-button size="small" @click="handleExport">导出</el-button>
</div>
</div>
<GLTable ref="statusTableRef" :beforeSearchFn="beforeSearchFn" :getListApi="getListApi" :noDataImg="url" :searchForm="realSearchForm" :pageConf="pageConf" :tableParams="tableParams">
<div slot="statusSlot" slot-scope="scope">
<span class="status-class"></span>
<span>{{ scope.scope.goodsStatus == 1 ? '上架' : '下架' }}</span>
</div>
</GLTable>
</div>
</div>
</div>
</template>
<script>
const STATUS_ENUM = { 1: '#EB4E4E', 2: '#2CCA74', 3: '#999999' }
import * as dayjs from 'dayjs'
import util from '@/utils/util'
export default {
name: 'repairList',
components: {},
data() {
return {
url: 'url',
searchForm: {
curDate: '',
operate: false,
sn: '',
merchantName: '',
merchantNo: '',
snType: '',
followStatus: '',
followTime: '',
collisionTime: '',
followResult: ''
},
searchFormList: [
{
name: 'sn',
addHtml: 'dateSelectSlot',
dateList: [
{
name: '全部',
value: ''
},
{
name: '昨日',
value: '1'
},
{
name: '本周',
value: '2'
},
{
name: '上周',
value: '3'
},
{
name: '本月',
value: '4'
}
]
},
{
name: 'successDate',
type: 'datePicker',
labelWidth: 95,
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
},
{
name: 'sn',
addHtml: 'inputSlot'
}
],
getListApi: this.$apis.sendRepair.getSendRepairListApi,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
tableParams: {
listName: 'data',
tableColumns: [
{
label: '小区名称',
prop: 'merchantName',
width: 200,
line: 1
},
{
label: '停车场区域',
prop: 'merchantId',
width: 180
},
{
label: '所在楼层',
prop: 'snType',
width: 180
},
{
label: '楼栋',
prop: 'sn',
width: 200
},
{
label: '车位编号',
prop: 'customerPhone',
width: 200
},
{
label: '车位状态',
prop: 'customerPhone',
addHtml: 'statusSlot',
width: 200
},
{
label: '雷达编号',
prop: 'customerName',
width: 140
},
{
label: '开始-结束时间',
prop: 'licensePlate',
width: 140
},
{
label: '状态时长',
prop: 'standNo'
}
]
}
}
},
created() {},
mounted() {},
methods: {
changeChannelImg(e) {
console.log(e, 'conpl')
},
reVisitFn(row) {
this.curCollId = row.id
this.collVisible = true
},
closeDialogFn() {
this.collVisible = false
this.searchTable()
},
handleOk() {
this.$refs.sendNoticeRef.$refs.formRef.validate(valid => {
if (valid) {
console.log(this.basicForm)
const { pushFlag, pushPhonesList, sendTime } = this.basicForm
const params = {
pushFlag,
startTime: sendTime[0],
endTime: sendTime[1],
configType: 0,
pushPhones: pushPhonesList?.join(',') || ''
}
this.$apis.sendRepair.setNoticeApi(params).then(res => {
console.log(res)
if (res) {
this.$message.success('设置成功')
this.resetNoticeData()
}
})
}
})
},
handleCancel() {
this.resetNoticeData()
},
setTableFinishFun() {
this.$refs.statusTableRef.data.length ? (this.$refs.statusTableRef.tableHeightValues = '') : this.$refs.statusTableRef.setTableHeightFun()
},
setTableHeightEvent() {
this.$refs.statusTableRef.setTableHeightFun()
},
// 搜索表格
searchTable() {
this.$refs.statusTableRef.refreshTable()
},
//重置表格
resetTable() {
this.searchForm = {
operate: false,
sn: '',
merchantName: '',
merchantNo: '',
snType: '',
followStatus: '',
followTime: '',
collisionTime: '',
followResult: ''
}
this.searchTable()
},
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchForm.followTime.length) {
params.beginFollowTime = new Date(this.searchForm.followTime[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.endFollowTime = new Date(this.searchForm.followTime[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
if (this.searchForm.collisionTime.length) {
params.beginCollisionTime = new Date(this.searchForm.collisionTime[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.endCollisionTime = new Date(this.searchForm.collisionTime[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
delete params.followTime
delete params.collisionTime
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.realSearchForm = this.getParams()
resolve()
})
},
handleExport() {
const params = this.getParams()
params.pageNum = 1
params.pageSize = 5000
this.$apis.sendRepair.exportSendRepairListApi(params).then(res => {
util.exportFn(res)
})
}
}
}
</script>
<style lang="scss" scoped>
.scrm-sub-client-container {
/deep/ .el-table .cell {
text-overflow: clip;
}
/deep/ .el-table .cell,
.el-table th div {
text-overflow: clip;
}
.pageContent {
padding: 20px 20px 30px;
// min-width: 1300px;
background-color: #fff;
/deep/ .el-icon-user-solid {
color: #75acff;
// margin-right: 3px;
font-size: 14px;
}
.statusList {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 8px;
div {
text-align: center;
span:nth-child(1) {
font-weight: 600;
font-size: 16px;
}
span:nth-child(2) {
font-size: 14px;
margin-left: 8px;
color: #5850ff;
border-bottom: 1px solid #5850ff;
cursor: pointer;
}
}
}
.status-class {
display: inline-block;
margin-right: 8px;
width: 6px;
height: 6px;
background: #eb4e4e;
border-radius: 4px;
vertical-align: middle;
}
}
.blue-text {
color: #5850ff;
}
}
.search-wrap {
/deep/ .search-item {
.name {
display: none;
}
}
.date-select-wrap {
display: flex;
margin-top: 1px;
.date-item {
cursor: pointer;
flex: 1;
height: 32px;
line-height: 32px;
background: #ffffff;
border: 1px solid #e5e5e5;
color: #000000a6;
box-sizing: border-box;
border-radius: 2px 0 0 2px;
text-align: center;
}
.seleted-item {
background: #5850ff;
border: 1px solid #5850ff;
color: #fff;
}
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!