Commit 02a78e5c by zhangquan

雷达修改

1 parent 51819eae
...@@ -14,7 +14,7 @@ const getRadarList = params => { ...@@ -14,7 +14,7 @@ const getRadarList = params => {
} }
// 导出雷达信息列表 // 导出雷达信息列表
const exportRadarList= (params)=> { const exportRadarList = params => {
params.method = 'marketing.api.charge.radar.page.export' params.method = 'marketing.api.charge.radar.page.export'
return http({ return http({
url, url,
...@@ -22,11 +22,13 @@ const exportRadarList= (params)=> { ...@@ -22,11 +22,13 @@ const exportRadarList= (params)=> {
}) })
} }
// 导入雷达信息列表 // 导入雷达信息列表
const createMessageInfo=(params)=> { const createMessageInfo = params => {
params.method = 'marketing.api.charge.radar.import' params.method = 'marketing.api.charge.radar.import'
return http({ return http({
url, url,
data: params data: params,
sign: true,
returnAll: true
}) })
} }
// 删除雷达信息 // 删除雷达信息
...@@ -37,7 +39,7 @@ const deleteRadar = params => { ...@@ -37,7 +39,7 @@ const deleteRadar = params => {
method: 'post', method: 'post',
data: params, data: params,
sign: true, sign: true,
returnAll:true returnAll: true
}) })
} }
export default { getRadarList,exportRadarList,createMessageInfo,deleteRadar}
\ No newline at end of file \ No newline at end of file
export default { getRadarList, exportRadarList, createMessageInfo, deleteRadar }
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
</GLTable> </GLTable>
<!-- 表格区域 end --> <!-- 表格区域 end -->
</div> </div>
<GLDialog title="批量操作" :visible.sync="isBatch" mode="mid"> <GLDialog title="批量操作" :visible.sync="isBatch" mode="mid" :before-close="cancelImport" @onCancel="cancelImport">
<template v-if="!batchForm.isUpload"> <template v-if="!batchForm.isUpload">
<el-form :model="batchForm" label-width="154px"> <el-form :model="batchForm" label-width="154px">
<el-form-item label="导入文件:"> <el-form-item label="导入文件:">
...@@ -39,16 +39,17 @@ ...@@ -39,16 +39,17 @@
</template> </template>
<div v-else class="file-info"> <div v-else class="file-info">
<div class="success"> <div class="success">
{{ successCount }} {{ batchForm.successCount }}
<div>成功记录</div> <div>成功记录</div>
</div> </div>
<div class="line"></div>
<div class="error"> <div class="error">
{{ failCount }} {{ batchForm.failCount }}
<div>失败记录</div> <div>失败记录</div>
</div> </div>
</div> </div>
<span slot="footer"> <span slot="footer">
<el-button size="small" @click="isBatch = false">{{ batchForm.isUpload ? '确定' : '取消' }}</el-button> <el-button size="small" @click="cancelImport">{{ batchForm.isUpload ? '确定' : '取消' }}</el-button>
<el-button size="small" type="primary" @click="handleSaveImport">{{ batchForm.isUpload ? '导出失败记录' : '确认' }}</el-button> <el-button size="small" type="primary" @click="handleSaveImport">{{ batchForm.isUpload ? '导出失败记录' : '确认' }}</el-button>
</span> </span>
</GLDialog> </GLDialog>
...@@ -68,7 +69,9 @@ export default { ...@@ -68,7 +69,9 @@ export default {
batchForm: { batchForm: {
isUpload: false, isUpload: false,
successCount: 0, successCount: 0,
failCount: 0 failCount: 0,
exportUrl: '',
exportName: ''
}, },
searchForm: { searchForm: {
radarNumber: '', radarNumber: '',
...@@ -232,12 +235,15 @@ export default { ...@@ -232,12 +235,15 @@ export default {
if (this.batchForm.isUpload) { if (this.batchForm.isUpload) {
this.handleImport() this.handleImport()
return return
} else if (!this.batchForm.exportUrl) {
this.$message.error('请上传文件')
return
} }
let params = { let params = {
exportUrl: this.batchForm.exportUrl, exportUrl: this.batchForm.exportUrl,
exportName: this.batchForm.exportName exportName: this.batchForm.exportName
} }
this.$apis.marketing this.$apis.radar
.createMessageInfo(params) .createMessageInfo(params)
.then(res => { .then(res => {
this.$message({ this.$message({
...@@ -246,11 +252,9 @@ export default { ...@@ -246,11 +252,9 @@ export default {
}) })
if (res.code == 0) { if (res.code == 0) {
this.batchForm.isUpload = true this.batchForm.isUpload = true
this.batchForm.successCount = res.successCount this.batchForm.successCount = res?.data?.successCount
this.batchForm.failCount = res.failCount this.batchForm.failCount = res?.data?.failCount
this.batchForm.errorUrl = res.errorUrl this.batchForm.errorUrl = res?.data?.errorUrl
this.handleSearch()
} else { } else {
this.$message({ this.$message({
message: res.message, message: res.message,
...@@ -286,6 +290,7 @@ export default { ...@@ -286,6 +290,7 @@ export default {
if (res) { if (res) {
this.batchForm.exportName = file.name this.batchForm.exportName = file.name
this.batchForm.exportUrl = res this.batchForm.exportUrl = res
this.handleSaveImport()
} }
this.$refs.file.value = '' this.$refs.file.value = ''
}) })
...@@ -301,6 +306,19 @@ export default { ...@@ -301,6 +306,19 @@ export default {
}) })
} }
}, },
cancelImport() {
this.isBatch = false
if (this.batchForm.successCount) {
this.handleSearch()
}
this.batchForm = {
isUpload: false,
successCount: 0,
failCount: 0,
exportUrl: '',
exportName: ''
}
},
batchExport() { batchExport() {
this.isBatch = true this.isBatch = true
this.batchForm.isUpload = false this.batchForm.isUpload = false
...@@ -456,6 +474,11 @@ export default { ...@@ -456,6 +474,11 @@ export default {
color: #2cca74; color: #2cca74;
text-align: center; text-align: center;
} }
.line {
width: 1px;
height: 56px;
background: #e8e8ea;
}
.error { .error {
font-weight: 700; font-weight: 700;
font-size: 26px; font-size: 26px;
......
...@@ -436,7 +436,7 @@ export default { ...@@ -436,7 +436,7 @@ export default {
this.handleExportError() this.handleExportError()
return return
} else if (!this.batchForm.exportUrl) { } else if (!this.batchForm.exportUrl) {
this.$message.error('请上传文件') return this.$message.error('请上传文件')
} }
let params = { let params = {
exportUrl: this.batchForm.exportUrl, exportUrl: this.batchForm.exportUrl,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!