Commit 838d965c by zhangquan

车位信息代码上传

1 parent c7e0c84b
import { http } from '@/main'
// http 对应的域名http://ismv.branch.glsx.com.cn
const URL = '/rop-scrm-clue/router'
// 送修列表
const getSendRepairListApi = params => {
params.method = 'clue.api.collision.info.listCollisionInfoByPage'
return http({
url: URL,
method: 'post',
data: params,
sign: true
})
}
const exportSendRepairListApi = params => {
params.method = 'clue.api.collision.info.exportCollisionInfo'
return http({
url: URL,
method: 'post',
data: params,
sign: true
})
}
const setNoticeApi = params => {
params.method = 'clue.api.collision.config.addOrUpdatePushConfig'
return http({
url: URL,
method: 'post',
data: params,
sign: true
})
}
const getNoticeDetailApi = params => {
params.method = 'clue.api.collision.config.getDetail'
return http({
url: URL,
method: 'post',
data: params,
sign: true
})
}
const getCollisionDetailApi = params => {
params.method = 'clue.api.collision.info.getDetail'
return http({
url: URL,
method: 'post',
data: params,
sign: true
})
}
const setFollowInfoApi = params => {
params.method = 'clue.api.collision.info.follow'
return http({
url: URL,
method: 'post',
data: params,
sign: true
})
}
const getDeviceListApi = params => {
params.method = 'clue.api.collision.customer.device.list'
return http({
url: URL,
method: 'post',
data: params,
sign: true
})
}
const exportDeviceListApi = params => {
params.method = 'clue.api.collision.customer.device.list.export'
return http({
url: URL,
method: 'post',
data: params,
sign: true
})
}
const importDeviceInfoApi = params => {
params.method = 'clue.api.collision.device.import'
return http({
url: URL,
method: 'post',
data: params,
sign: true
})
}
const editDeviceInfoApi = params => {
params.method = 'clue.api.collision.customer.device.edit'
return http({
url: URL,
method: 'post',
data: params,
sign: true
})
}
const getDeviceDetailApi = params => {
params.method = 'clue.api.collision.customer.device.detail'
return http({
url: URL,
method: 'post',
data: params,
sign: true
})
}
const uploadFileApi = params => {
params.method = `scrm.api.equity.service.claims.code.batchGenerateCodeByExcel`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file']
})
}
const getCarBrandListApi = params => {
params.method = 'scrm.api.carlife.common.getOnlyCarBrandList'
return http({
url: '/rop-scrm-carlife/router',
method: 'post',
data: params,
sign: true
})
}
const getVehicleSeriesListApi = params => {
params.method = 'scrm.api.carlife.common.getCarSeriesList'
return http({
url: '/rop-scrm-carlife/router',
method: 'post',
data: params,
sign: true
})
}
const getCarTypeListApi = params => {
params.method = 'scrm.api.carlife.common.getCarTypeList'
return http({
url: '/rop-scrm-carlife/router',
method: 'post',
data: params,
sign: true
})
}
export default {
getSendRepairListApi,
exportSendRepairListApi,
setNoticeApi,
getNoticeDetailApi,
getCollisionDetailApi,
setFollowInfoApi,
getDeviceListApi,
exportDeviceListApi,
importDeviceInfoApi,
editDeviceInfoApi,
getDeviceDetailApi,
uploadFileApi,
getCarBrandListApi,
getVehicleSeriesListApi,
getCarTypeListApi
}
......@@ -3,10 +3,7 @@
<div :class="['glsx-combi-form', isEdit ? 'gl-form-page' : '']">
<el-form :ref="formRef" :inline="true" :model="formObj" :rules="formRules" size="small" class="glsx-combi-form-block">
<template v-for="(item, index) in formData">
<el-form-item v-if="!item.isHide" :key="index" :id="item.name" :label-width="isEdit ? '154px' : labelWidth"
:class="[{ 'no-label': !item.label, isBlock: isBlock }, { 'textBox': item.type == 'textBox' }]"
:style="{ 'margin-bottom': isEdit ? '24px' : '', 'margin-right': isEdit ? '0px' : '30px', ...item.style }"
:label="item.label" :prop="item.name">
<el-form-item v-if="!item.isHide && !item.itemSlot" :key="index" :id="item.name" :label-width="isEdit ? '154px' : labelWidth" :class="[{ 'no-label': !item.label, isBlock: isBlock }, { textBox: item.type == 'textBox' }]" :style="{ 'margin-bottom': isEdit ? '24px' : '', 'margin-right': isEdit ? '0px' : '30px', ...item.style }" :label="item.label" :prop="item.name">
<span v-if="!item.isHide && item.tips" class="tips-block" slot="label">
<span class="tips-label">{{ item.label }}</span>
<el-popover placement="top" width="200" trigger="hover" :content="item.tips">
......@@ -20,12 +17,7 @@
<slot v-if="item.addHtml" :name="item.addHtml" :scope="item"></slot>
<span v-else-if="item.type === 'showTxt'">{{ formObj[item.name] }}</span>
<div v-else-if="item.type === 'input'">
<el-input :placeholder="item.placeholder || '请输入' + item.label" v-bind="item.attrs ? item.attrs : {}"
v-on="item.listeners ? item.listeners : {}" :prefix-icon="item.prefixIcon" v-model.trim="formObj[item.name]"
:disabled="item.isDisabled" :maxlength="item.maxlength" :clearable="item.isClear || false"
:type="item.inputType || 'text'" :autosize="item.inputType == 'textarea'" :rows="item.rows || 2"
:style="{ width: item.width || defaultWidth }" :show-word-limit="item.showLimit || false"
:show-password="item.showPass || false" @keydown.native="e => handleInputDown(e, item)">
<el-input :placeholder="item.placeholder || '请输入' + item.label" v-bind="item.attrs ? item.attrs : {}" v-on="item.listeners ? item.listeners : {}" :prefix-icon="item.prefixIcon" v-model.trim="formObj[item.name]" :disabled="item.isDisabled" :maxlength="item.maxlength" :clearable="item.isClear || false" :type="item.inputType || 'text'" :autosize="item.inputType == 'textarea'" :rows="item.rows || 2" :style="{ width: item.width || defaultWidth }" :show-word-limit="item.showLimit || false" :show-password="item.showPass || false" @keydown.native="e => handleInputDown(e, item)">
<span v-if="item.prepend" slot="prepend">{{ item.prepend }}</span>
<span v-if="item.append" slot="suffix">{{ item.append }}</span>
</el-input>
......@@ -33,92 +25,54 @@
</div>
<!-- 选择框 -->
<div v-else-if="item.type === 'select'">
<el-select :style="{ width: item.width || defaultWidth }" v-model="formObj[item.name]"
v-bind="item.attrs ? item.attrs : {}" v-on="item.listeners ? item.listeners : {}"
:clearable="item.isClear || false" :placeholder="item.placeholder || '请选择' + item.label"
:filterable="!item.noFilter" :disabled="item.isDisabled" :no-data-text="item.noDataText || '无数据'"
:multiple="item.multiple || false" :collapse-tags="item.collapseTags || true"
@change="selectAddAttr($event, item)">
<el-option v-for="subItem in item.optionList" :key="subItem[item.optionId]"
:label="subItem[item.optionLabel]" :value="subItem[item.optionId]"
:disabled="subItem.isDisabled || false"></el-option>
<el-select :style="{ width: item.width || defaultWidth }" v-model="formObj[item.name]" v-bind="item.attrs ? item.attrs : {}" v-on="item.listeners ? item.listeners : {}" :clearable="item.isClear || false" :placeholder="item.placeholder || '请选择' + item.label" :filterable="!item.noFilter" :disabled="item.isDisabled" :no-data-text="item.noDataText || '无数据'" :multiple="item.multiple || false" :collapse-tags="item.collapseTags || true" @change="selectAddAttr($event, item)">
<el-option v-for="subItem in item.optionList" :key="subItem[item.optionId]" :label="subItem[item.optionLabel]" :value="subItem[item.optionId]" :disabled="subItem.isDisabled || false"></el-option>
</el-select>
<slot :name="item.suffixSlot" :scope="item"></slot>
</div>
<!-- radio -->
<div v-else-if="item.type === 'radio'">
<el-radio-group v-model="formObj[item.name]" v-bind="item.attrs ? item.attrs : {}"
v-on="item.listeners ? item.listeners : {}" :disabled="item.isDisabled" @change="item.handleRadioChange">
<el-radio v-for="subItem in item.optionList" :key="subItem[item.optionId]" :disabled="subItem.isDisabled"
:label="subItem[item.optionId]">
<el-radio-group v-model="formObj[item.name]" v-bind="item.attrs ? item.attrs : {}" v-on="item.listeners ? item.listeners : {}" :disabled="item.isDisabled" @change="item.handleRadioChange">
<el-radio v-for="subItem in item.optionList" :key="subItem[item.optionId]" :disabled="subItem.isDisabled" :label="subItem[item.optionId]">
{{ subItem[item.optionLabel] }}
<slot :name="subItem.suffixSonSlot" :scope="subItem"></slot>
</el-radio>
</el-radio-group>
<slot :name="item.suffixSlot" :scope="item"></slot>
</div>
<el-date-picker v-else-if="item.type === 'datePicker'" v-model="formObj[item.name]"
v-bind="item.attrs ? item.attrs : {}" v-on="item.listeners ? item.listeners : {}"
:type="item.dateType || 'daterange'" :disabled="item.isDisabled" :value-format="item.valueFormat"
:style="{ width: item.width || defaultWidth }" :clearable="item.isClear || false" range-separator="至"
start-placeholder="开始日期" end-placeholder="结束日期"
:picker-options="item.customPickerOptions || pickerOption[item.pickerOptions]">
</el-date-picker>
<el-date-picker v-else-if="item.type === 'datePicker'" v-model="formObj[item.name]" v-bind="item.attrs ? item.attrs : {}" v-on="item.listeners ? item.listeners : {}" :type="item.dateType || 'daterange'" :disabled="item.isDisabled" :value-format="item.valueFormat" :style="{ width: item.width || defaultWidth }" :clearable="item.isClear || false" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="item.customPickerOptions || pickerOption[item.pickerOptions]"></el-date-picker>
<template v-else-if="item.type === 'upload'">
<p class="photo-top-tips">{{ item.topTips }}</p>
<slot :name="item.prefixSlot" :scope="item"></slot>
<div v-if="!item.isDisabled" :style="{ width: item.width || defaultWidth }">
<div
v-if="Array.isArray(formObj[item.name]) ? formObj[item.name].length < item.maxPhotoNum : !formObj[item.name]"
class="activity-img img-w-h"
:style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''">
<div class="add"
:style="item.uploadStyle && item.uploadStyle.hasOwnProperty('addStyle') ? item.uploadStyle.addStyle : ''">
+</div>
<div v-if="Array.isArray(formObj[item.name]) ? formObj[item.name].length < item.maxPhotoNum : !formObj[item.name]" class="activity-img img-w-h" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''">
<div class="add" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('addStyle') ? item.uploadStyle.addStyle : ''">
+
</div>
<!-- <span v-if="item.maxPhotoNum > 1" class="number">{{ formObj[item.name].length }}/{{ item.maxPhotoNum }}</span> -->
<span class="number"
:style="item.uploadStyle && item.uploadStyle.hasOwnProperty('fontSize') ? item.uploadStyle.fontSize : ''">上传{{
item.uploadType == 'video' ? '视频' : '图片' }}</span>
<input v-if="item.uploadType == 'video'" type="file" style="opacity: 0" :id="item.name + 'file'"
ref="file" class="activity-img img-w-h"
:style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''"
accept="video/mp4" @change="e => handleUploadChange(e, item)" />
<input v-else type="file" style="opacity: 0" :id="item.name + 'file'" ref="file"
class="activity-img img-w-h"
:style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''"
accept="image/png, image/jpeg, image/gif, image/jpg" @change="e => handleUploadChange(e, item)" />
<span class="number" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('fontSize') ? item.uploadStyle.fontSize : ''">上传{{ item.uploadType == 'video' ? '视频' : '图片' }}</span>
<input v-if="item.uploadType == 'video'" type="file" style="opacity: 0" :id="item.name + 'file'" ref="file" class="activity-img img-w-h" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''" accept="video/mp4" @change="e => handleUploadChange(e, item)" />
<input v-else type="file" style="opacity: 0" :id="item.name + 'file'" ref="file" class="activity-img img-w-h" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''" accept="image/png, image/jpeg, image/gif, image/jpg" @change="e => handleUploadChange(e, item)" />
</div>
</div>
<template>
<div v-if="Array.isArray(formObj[item.name]) ? formObj[item.name].length : formObj[item.name]">
<span v-if="Array.isArray(formObj[item.name])">
<span v-for="(subItem, subIndex) in formObj[item.name]" :key="subIndex" class="muti-imgs img-w-h"
:style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''">
<video v-if="item.uploadType == 'video'" class="img-w-h activity-img"
:style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''"
:src="typeof subItem == 'object' ? subItem.content : subItem"></video>
<img v-else class="img-w-h"
:style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''"
:src="typeof subItem == 'object' ? subItem.content : subItem" />
<span class="img-btns"
:style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''">
<span v-for="(subItem, subIndex) in formObj[item.name]" :key="subIndex" class="muti-imgs img-w-h" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''">
<video v-if="item.uploadType == 'video'" class="img-w-h activity-img" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''" :src="typeof subItem == 'object' ? subItem.content : subItem"></video>
<img v-else class="img-w-h" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''" :src="typeof subItem == 'object' ? subItem.content : subItem" />
<span class="img-btns" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''">
<span class="btn-item">
<i v-show="!item.isDisabled" class="el-icon-delete" @click="handleImgDelete(item, subIndex)"></i>
<i class="el-icon-zoom-in"
@click="handleImgLook(typeof subItem == 'object' ? subItem.content : subItem, item)"></i>
<i class="el-icon-zoom-in" @click="handleImgLook(typeof subItem == 'object' ? subItem.content : subItem, item)"></i>
</span>
</span>
</span>
</span>
<span v-else class="muti-imgs">
<video v-if="item.uploadType == 'video'" class="img-w-h activity-img"
:style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''"
:src="formObj[item.name]"></video>
<img v-else class="img-w-h"
:style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''"
:src="formObj[item.name]" />
<span class="img-btns"
:style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''">
<video v-if="item.uploadType == 'video'" class="img-w-h activity-img" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''" :src="formObj[item.name]"></video>
<img v-else class="img-w-h" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''" :src="formObj[item.name]" />
<span class="img-btns" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''">
<span class="btn-item">
<i v-show="!item.isDisabled" class="el-icon-delete" @click="handleImgDelete(item)"></i>
<i class="el-icon-zoom-in" @click="handleImgLook(formObj[item.name], item)"></i>
......@@ -133,20 +87,16 @@
<!-- <textBox v-else-if="item.type === 'textBox'" :ref="item.name + 'TextBox'" :excludeMenus="item.excludeMenus || ['code']" @change="e => handleTextBoxChange(e, item)" @focus="handleTextBoxFocus(item)" :boxHeight="item.boxHeight"></textBox> -->
<!-- 地图 -->
<div v-else-if="item.type === 'map'" class="flex">
<Province ref="provinceForm" :subdistrict="subdistrict" :is-disabled="item.isDisabled"
@selectProvince="e => handleSelectProvince(e, item)" @selectCity="e => handleSelectCity(e, item)"
:province-view="item.provinceView"></Province>
<el-input style="flex: 1;" v-model="formObj[item.name]" placeholder="请选择商户地址"
:readonly="item.isReadonly"></el-input>
<el-button class="m-l-10" v-show="!item.isDisabled" @click="handleSelectMap(item)"
type="primary">选择地址</el-button>
<Province ref="provinceForm" :subdistrict="subdistrict" :is-disabled="item.isDisabled" @selectProvince="e => handleSelectProvince(e, item)" @selectCity="e => handleSelectCity(e, item)" :province-view="item.provinceView"></Province>
<el-input style="flex: 1;" v-model="formObj[item.name]" placeholder="请选择商户地址" :readonly="item.isReadonly"></el-input>
<el-button class="m-l-10" v-show="!item.isDisabled" @click="handleSelectMap(item)" type="primary">选择地址</el-button>
</div>
</el-form-item>
<slot v-if="item.itemSlot" :name="item.itemSlot" :scope="item"></slot>
</template>
<slot name="footer"></slot>
</el-form>
<GLDialog v-if="isImgVisible" big-title="查看" mode="big" :visible.sync="isImgVisible" :close-on-click-modal="false"
@onOk="isImgVisible = false" @onCancel="isImgVisible = false">
<GLDialog v-if="isImgVisible" big-title="查看" mode="big" :visible.sync="isImgVisible" :close-on-click-modal="false" @onOk="isImgVisible = false" @onCancel="isImgVisible = false">
<div class="dialog-look">
<video v-if="dialogObj.uploadType == 'video'" class="dialog-video" controls>
<source :src="dialogObj.url" type="video/mp4" />
......@@ -154,10 +104,9 @@
<img v-else class="dialog-img" width="100%" :src="dialogObj.url" alt="" />
</div>
</GLDialog>
<GLDialog big-title="选择地址" mode="big" :visible.sync="dialogMapVisible" @onOk="getAddress"
@onCancel="dialogMapVisible = false">
<GLDialog big-title="选择地址" mode="big" :visible.sync="dialogMapVisible" @onOk="getAddress" @onCancel="dialogMapVisible = false">
<map-view v-if="dialogMapVisible" ref="mapForm"></map-view>
<!-- <span slot="footer" class="dialog-footer">
<!-- <span slot="footer" class="dialog-footer">
<el-button @click="">取 消</el-button>
<el-button type="primary" @click="getAddress">确 定</el-button>
</span> -->
......@@ -224,7 +173,7 @@ export default {
},
formObj: {
type: Object,
default: () => { }
default: () => {}
},
hasTitle: {
type: Boolean,
......@@ -232,16 +181,16 @@ export default {
},
formRules: {
type: Object,
default: () => { }
default: () => {}
},
// 搜索+输入框/搜索组合组件,搜索栏绑值
searchSelectObj: {
type: Object,
default: () => { }
default: () => {}
}
},
mounted() { },
mounted() {},
methods: {
// 选择框-添加其他属性
......@@ -462,7 +411,7 @@ export default {
-webkit-appearance: none !important;
}
.glsx-combi-form input[type="number"] {
.glsx-combi-form input[type='number'] {
-moz-appearance: textfield !important;
}
......
const PHONE_MAX_NUM = 5
const FOLLOW_STATUS = [
{
label: '未回访',
value: 0
},
{
label: '已回访',
value: 1
}
]
const FOLLOW_RESULT = [
{
label: '真实事故',
value: 0
},
{
label: '非真实事故',
value: 1
},
{
label: '无法处理',
value: 2
}
]
const SN_TYPE = [
{
label: 'OBD',
value: 1
},
{
label: '记录仪',
value: 6
},
{
label: '云导航',
value: 2
},
{
label: 'GPS',
value: 8
},
{
label: '智能蓝牙耳机车充',
value: 12501
}
]
const CHANGE_DEVICE = [
{
label: '保修更换-免费更换',
value: 0
},
{
label: '维修更换',
value: 1
},
{
label: '购买',
value: 2
}
]
export {PHONE_MAX_NUM, FOLLOW_STATUS, FOLLOW_RESULT, SN_TYPE, CHANGE_DEVICE}
\ No newline at end of file
<template>
<div>
<div class="scrm-sub-client-container">
<div class="pageContent">
<GLCombiForm :rowNumber="2" :formObj="searchForm" :formData="searchFormList" @handleOk="searchTable" @handleRest="resetTable"></GLCombiForm>
<div class="infoList">
<div>
<span>车位详情</span>
</div>
<div>
<el-button type="primary" plain size="small" @click="openNoticeDialog">批量导入</el-button>
<el-button size="small" @click="handleExport">导出</el-button>
</div>
</div>
<GLTable ref="infoTableRef" :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>
<div class="table-btns" slot="operateSlot" slot-scope="scope">
<GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="3"></GLTableButton>
</div>
</GLTable>
</div>
</div>
<GLDialog mode="mid" title="新增" :visible.sync="noticeVisible" :before-close="handleCancel" @onOk="handleOk" @onCancel="handleCancel">
<glsx-combi-form class="form" ref="sendNoticeRef" :formRules="basicRule" labelWidth="154px" defaultWidth="432px" :formObj="basicForm" :formData="basicFormData">
<div class="base-title" slot="firstTitleSlot" slot-scope="scope">
{{ scope.scope.title }}
</div>
<div class="base-title" slot="secondTitleSlot" slot-scope="scope">
{{ scope.scope.title }}
</div>
<div class="base-title" slot="thirdTitleSlot" slot-scope="scope">
{{ scope.scope.title }}
</div>
</glsx-combi-form>
</GLDialog>
</div>
</template>
<script>
const STATUS_ENUM = { 1: '#EB4E4E', 2: '#2CCA74', 3: '#999999' }
import * as dayjs from 'dayjs'
import util from '@/utils/util'
import glsxCombiForm from '@/components/glsx-combi-form'
import { PHONE_MAX_NUM, FOLLOW_STATUS, FOLLOW_RESULT, SN_TYPE } from './constant'
export default {
name: 'repairList',
components: {
glsxCombiForm
},
data() {
return {
noticeVisible: false,
collVisible: false,
url: 'url',
buttonList: [
{
type: 'el-button',
name: row => {
return '修改'
},
attrs: {
type: 'text'
},
listeners: {
click: row => this.showDialog(row.scope)
}
},
{
type: 'el-button',
name: row => {
return '删除'
},
attrs: {
type: 'text'
},
listeners: {
click: row => this.del(row.scope)
}
},
{
type: 'el-button',
name: row => {
return '图片上传'
},
attrs: {
type: 'text'
},
listeners: {
click: row => this.del(row.scope)
}
},
{
type: 'el-button',
name: row => {
return '修改标记'
},
attrs: {
type: 'text'
},
listeners: {
click: row => this.del(row.scope)
}
},
{
type: 'el-button',
name: row => {
return '关联雷达'
},
attrs: {
type: 'text'
},
listeners: {
click: row => this.del(row.scope)
}
}
],
basicRule: {
sendTime: [{ required: true, message: '请选择推送时间', trigger: 'change' }],
pushPhonesList: [
{
required: true,
validator: (rule, value, callback) => {
const list = this.basicForm.pushPhonesList || []
const emptyValIdx = this.basicForm.pushPhonesList?.findIndex(item => !item)
const copylist = [...new Set(JSON.parse(JSON.stringify(list)))]
if (list?.length < 1 || emptyValIdx > -1) {
callback(new Error('请填写手机号'))
} else if (list?.length > 5) {
callback(new Error('手机号最多填写5个'))
} else if (copylist.length !== list.length) {
callback(new Error('手机号不能重复'))
} else {
callback()
}
},
trigger: 'change'
}
]
},
basicForm: {
pushFlag: 0,
sendTime: ['09:00', '20:00'],
pushPhonesList: ['']
},
basicFormData: [
{
itemSlot: 'firstTitleSlot',
title: '小区信息'
},
{
label: '小区名称',
name: 'pushFlag',
type: 'select',
optionLabel: 'label',
optionId: 'value',
optionList: [
{
label: '开',
value: 1
},
{
label: '关',
value: 0
}
]
},
{
label: '停车场区域',
name: 'sendTime',
type: 'input'
},
{
label: '所在楼层',
name: 'sendTime',
type: 'input'
},
{
label: '楼栋',
name: 'sendTime',
type: 'input'
},
{
itemSlot: 'secondTitleSlot',
title: '车位信息'
},
{
label: '车位编号',
name: 'sendTime',
type: 'input'
},
{
label: '车位备注',
name: 'sendTime',
type: 'input'
},
{
itemSlot: 'thirdTitleSlot',
title: '关联雷达'
},
{
label: '雷达编号',
name: 'pushFlag',
type: 'select',
optionLabel: 'label',
optionId: 'value',
optionList: [
{
label: '开',
value: 1
},
{
label: '关',
value: 0
}
]
}
],
realSearchForm: {},
searchForm: {
operate: false,
sn: '',
merchantName: '',
merchantNo: '',
snType: '',
followStatus: '',
followTime: '',
collisionTime: '',
followResult: ''
},
searchFormList: [
{
type: 'input',
name: 'sn',
label: '小区名称'
},
{
type: 'input',
name: 'sn',
label: '车位编号'
},
{
type: 'input',
name: 'sn',
label: '雷达编号'
},
{
type: 'select',
name: 'snType',
label: '车位状态',
optionLabel: 'label',
optionId: 'value',
optionList: [
{
label: '全部',
value: ''
},
...SN_TYPE
],
placeholder: '请选择'
},
{
type: 'select',
name: 'followStatus',
label: '雷达状态',
optionLabel: 'label',
optionId: 'value',
optionList: [
{
label: '全部',
value: ''
},
...FOLLOW_STATUS
],
placeholder: '请选择'
}
],
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,
formatter: cell => {
const _target = SN_TYPE.find(item => item.value == cell.snType)
return _target ? _target.label : '--'
}
},
{
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'
},
{
label: '操作',
fixed: 'right',
addHtml: 'operateSlot',
width: 150
}
]
}
}
},
created() {},
mounted() {},
methods: {
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()
},
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() {
this.$refs.infoTableRef.data.length ? (this.$refs.infoTableRef.tableHeightValues = '') : this.$refs.infoTableRef.setTableHeightFun()
},
setTableHeightEvent() {
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() {
this.$refs.infoTableRef.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;
}
.infoList {
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;
}
/deep/ .el-tag {
height: 26px;
line-height: 26px;
padding: 0 8px;
}
}
.blue-text {
color: #5850ff;
}
}
.base-title {
height: 20px;
line-height: 20px;
font-weight: 600;
font-size: 14px;
color: #333333;
margin-bottom: 20px;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!