Blame view

admin-web-master/src/views/detect/map/index.vue 18.6 KB
4373acf5   wesley88   1
1
2
3
4
5
6
7
8
9
  <template>
    <div style="background-color:#f7f7f7;padding:10px 10px;">
      <div class="zhuti" v-if="onaction == '1'">
        <div style="height:58px;line-height:58px;">
          <div style="color:#0006"> <span>招商资源监测</span> <span style="padding:0 5px;">></span> <span
              style="color:#000000e6">广告位基本信息管理</span></div>
        </div>
        <!-- 线上 -->
        <div>
118fc86d   wesley88   1
10
11
12
          <div style="display: flex;font-size: 14px;" >
            <div style="margin-right: 4px;cursor: pointer;" @click="chenge(1)" :class="leixing?'chengeXia greens':''">线上({{xsNum}})</div>
            <div style="margin-left: 20px;margin-right: 4px;cursor: pointer;" @click="chenge(2)" :class="leixing?'':'chengeXia greens'">实体({{xxNum}})</div>
0c5d2ce8   wesley88   1
13
          </div>
4373acf5   wesley88   1
14
15
16
          <!-- 搜索 -->
          <div class="formSearch">
            <el-form :inline="true" :model="pagequery" style="margin-top: 15px;">
118fc86d   wesley88   1
17
18
19
              <el-form-item label="广告位名称" prop="advertisingName">
                <el-input v-model="pagequery.advertisingName" placeholder="请输入" maxlength="50"></el-input>
              </el-form-item>
4373acf5   wesley88   1
20
              <el-form-item label="所属端" prop="affiliation" v-if="leixing">
9b392fc6   wesley88   1
21
                <el-select v-model="pagequery.affiliation" clearable placeholder="请选择" style="width: 168px;margin-right: 15px">
04473319   wesley88   1
22
23
24
25
                  <!-- <el-option label="游客小程序" value="游客小程序" />
                  <el-option label="商家客户端" value="商家客户端" /> -->
                  <el-option v-for="(item,index) in owningEndList"
                    :key="index" :label="item.label" :value="item.value"></el-option>
4373acf5   wesley88   1
26
27
28
                </el-select>
              </el-form-item>
              <el-form-item label="设备类型" prop="deviceType" v-if="leixing == false">
04473319   wesley88   1
29
                <!-- <el-select v-model="pagequery.deviceType" placeholder="请选择" style="width: 168px;margin-right: 15px">
4373acf5   wesley88   1
30
                  <el-option label="灯箱广告牌" value="灯箱广告牌"></el-option>
04473319   wesley88   1
31
32
                </el-select> -->
                <el-input v-model="pagequery.deviceType" placeholder="请输入" maxlength="50"></el-input>
4373acf5   wesley88   1
33
              </el-form-item>
2727043f   wesley88   1
34
35
36
37
38
39
40
41
42
43
              <el-form-item label="状态" prop="publishStatus">
                <el-select v-model="pagequery.publishStatus" clearable placeholder="请选择"
                  style="width: 168px;margin-right: 15px">
                  <el-option label="待发布" value="0"></el-option>
                  <el-option label="待审核" value="1"></el-option>
                  <el-option label="已发布" value="2"></el-option>
                  <el-option label="不通过" value="3"></el-option>
                  <el-option label="已租赁" value="4"></el-option>
                </el-select>
              </el-form-item>
4373acf5   wesley88   1
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
            </el-form>
  
            <div>
              <el-button @click="onSubmit" style="background-color: #3F9B6A;color: #fff">查询
              </el-button>
              <el-button @click="resetting" class="buttonHover"
                style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;">重置
              </el-button>
            </div>
          </div>
          <div style="margin-bottom: 20px;">
            <el-button @click="removeonaction('2')" style="background-color: #3F9B6A;color: #fff;padding:8px 15px;"
              icon="el-icon-circle-plus-outline">新增</el-button>
            <!-- <el-button @click="" style="background-color: #3F9B6A;color: #fff">批量导入</el-button> -->
          </div>
          <!-- 表格 -->
4373acf5   wesley88   1
60
          <el-table :data="tableData"
a182f238   wesley88   1
61
            :header-cell-style="{fontSize: '14px',color:'#0009',fontWeight: 'normal',backgroundColor:'#F2F3F5'}">
6d7925d7   wesley88   1
62
  
a182f238   wesley88   1
63
            <el-table-column label="广告位名称"  prop="advertisingName"  show-overflow-tooltip>
4373acf5   wesley88   1
64
            </el-table-column>
a182f238   wesley88   1
65
            <el-table-column label="广告位类型"  prop="advertisingType"  show-overflow-tooltip>
4373acf5   wesley88   1
66
            </el-table-column>
4373acf5   wesley88   1
67
  
4373acf5   wesley88   1
68
  
9b392fc6   wesley88   1
69
70
            <el-table-column label="所属端" prop="affiliation" v-if="leixing" show-overflow-tooltip></el-table-column>
            <el-table-column label="轮播顺序" prop="rotationOrder" v-if="leixing"> </el-table-column>
a182f238   wesley88   1
71
72
73
  
  
            <el-table-column label="详细位置" prop="detailedLocation"  v-if="leixing == false" show-overflow-tooltip></el-table-column>
9b392fc6   wesley88   1
74
75
76
77
78
            <el-table-column label="设备类型" prop="deviceType"  v-if="leixing == false" show-overflow-tooltip>
              <template slot-scope="scope">
                {{scope.row.deviceType || '-'}}
              </template>
            </el-table-column>
a182f238   wesley88   1
79
  
9b392fc6   wesley88   1
80
            <!-- <el-table-column  label="状态" prop="publishStatus" show-overflow-tooltip>
4373acf5   wesley88   1
81
              <template slot-scope="scope">
2210df30   wesley88   1
82
                {{scope.row.publishStatus=='0'?'待发布':scope.row.publishStatus=='1'?'已发布':scope.row.publishStatus=='2'?'待发布':scope.row.publishStatus=='3'?'待审核':scope.row.publishStatus=='4'?'驳回':'-'}}
4373acf5   wesley88   1
83
84
              </template>
            </el-table-column>
a182f238   wesley88   1
85
            <el-table-column prop="leaseExpirationDate" label="租赁到期时间"  show-overflow-tooltip>
4373acf5   wesley88   1
86
            </el-table-column>
a182f238   wesley88   1
87
            <el-table-column label="操作" fixed="right">
4373acf5   wesley88   1
88
89
              <template slot-scope="scope">
                <div @click="details(scope.row)" class="tableBtn greens">查看</div>
0c5d2ce8   wesley88   1
90
91
                <div class="tableBtn greens" v-if="scope.row.publishStatus=='0'" @click="removeinfo(scope.row,'编辑')">编辑
                </div>
d64cd58f   wesley88   上传验收小程序
92
93
                <div class="tableBtn greens" v-if="scope.row.publishStatus=='0' || scope.row.publishStatus=='2'" @click="closemsg(scope.row)">删除</div>
                <div class="tableBtn greens" v-if="scope.row.publishStatus=='0' || scope.row.publishStatus=='2'" @click="opencl(scope.row,'gg')">发布</div>
0c5d2ce8   wesley88   1
94
95
                <div class="tableBtn greens" v-if="scope.row.publishStatus=='1'"
                  @click="removeinfozz(scope.row,'2','下架')">下架</div>
4373acf5   wesley88   1
96
              </template>
9b392fc6   wesley88   1
97
98
            </el-table-column> -->
            <el-table-column label="创建人" prop="createUser" > </el-table-column>
3b97e418   wesley88   1
99
            <el-table-column label="提交时间" prop="createDate" > </el-table-column>
9b392fc6   wesley88   1
100
101
            <el-table-column label="状态" prop="publishStatus" show-overflow-tooltip>
              <template slot-scope="scope">
2210df30   wesley88   1
102
                {{scope.row.publishStatus=='0'?'待发布':scope.row.publishStatus=='1'?'待审核':scope.row.publishStatus=='2'?'已发布':scope.row.publishStatus=='3'?'不通过':scope.row.publishStatus=='4'?'已租赁':'-'}}
9b392fc6   wesley88   1
103
104
105
106
107
108
109
110
111
112
113
114
115
              </template>
            </el-table-column>
            <el-table-column label="操作" min-width="100" fixed="right">
              <template slot-scope="scope">
                <div @click="details(scope.row)" class="tableBtn greens">查看</div>
                <div class="tableBtn greens" v-if="scope.row.publishStatus=='0' || scope.row.publishStatus=='3'"  @click="removeinfo(scope.row,'编辑')">编辑
                </div>
                <div class="tableBtn greens" v-if="scope.row.publishStatus=='0' || scope.row.publishStatus=='3'" @click="closemsg(scope.row)">删除</div>
                <div class="tableBtn greens" v-if="scope.row.publishStatus=='0' || scope.row.publishStatus=='3'"
                @click="opencl(scope.row,'gg')">发布</div>
                <div class="tableBtn greens" v-if="scope.row.publishStatus=='2'"
                  @click="removeinfozz(scope.row,'0','下架')">下架</div>
              </template>
4373acf5   wesley88   1
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
            </el-table-column>
          </el-table>
          <div style="display: flex;justify-content: space-between;" class="bom">
            <div style="font-size: 14px;">共 <span style="color: #3F9B6A;">{{total}}</span> 项数据</div>
            <el-pagination :current-page="pagequery.pageNumber+1" :page-sizes="[10, 20, 50, 100]" :page-size="10"
              background small layout="prev, pager, next" :total="total" @size-change="handleSizeChange"
              @current-change="handleCurrentChange">
            </el-pagination>
          </div>
  
        </div>
  
      </div>
  
  
  
  
  
  
      <div class="zhuti" v-if="onaction == '2'">
        <div style="height:58px;line-height:58px;">
          <div style="color:#0006"> <span>广告位基本信息管理</span> <span style="padding:0 5px;">></span> <span
              style="color:#000000e6">新增</span></div>
        </div>
  
        <div style="padding: 20px 20px 20px 0;">
          <add :info="{}" @removeonaction="removeonaction" :leixing="leixing"></add>
        </div>
      </div>
      <div class="zhuti" v-if="onaction == '3'">
        <div style="height:58px;line-height:58px;">
          <div style="color:#0006"> <span>广告位基本信息管理</span> <span style="padding:0 5px;">></span> <span
              style="color:#000000e6">查看</span></div>
        </div>
        <div>
0c5d2ce8   wesley88   1
151
152
          <resourceCommodity :editbgid="detailsinfo" @removeonaction="removeonaction" :leixing="leixing">
          </resourceCommodity>
4373acf5   wesley88   1
153
154
155
156
157
158
159
160
161
162
163
        </div>
      </div>
      <div class="zhuti" v-if="onaction == '4'">
        <div style="height:58px;line-height:58px;">
          <div style="color:#0006"> <span>广告位基本信息管理</span> <span style="padding:0 5px;">></span> <span
              style="color:#000000e6">{{contractChangeReason}}</span></div>
        </div>
        <div style="padding: 20px 20px 20px 0;">
          <add :info="detailsinfo" @removeonaction="removeonaction" :leixing="leixing"></add>
        </div>
      </div>
0c5d2ce8   wesley88   1
164
165
      <el-dialog :visible.sync="addcl" title="选择策略" width="65%" append-to-body center :close-on-click-modal="false"
        :close-on-press-escape="false" :show-close="false">
e75fe4fe   wesley88   2
166
        <cl :type="'广告位'" :resourcesId="oncetype+oninfo.id" v-if="addcl" @minSev="minSev" @mingClose="mingClose"></cl>
0c5d2ce8   wesley88   1
167
      </el-dialog>
4373acf5   wesley88   1
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
    </div>
  
  
  </template>
  
  <script>
    import {
      getAlls,
      addList,
      delList,
      likeGet,
      editList
    } from '../../../api/map1'
    import add from '../../../components/add/addmap'
    import resourceCommodity from '../../../components/chakan/map'
0c5d2ce8   wesley88   1
183
184
    import {
      cereResourceStrategy,
bdbe3660   wesley88   1
185
186
      editStatus,
      cereBusinessOperationadd
0c5d2ce8   wesley88   1
187
188
    } from '@/api/newly.js'
     import cl from '@/components/change/cl.vue'
4373acf5   wesley88   1
189
190
191
    export default {
      data() {
        return {
9b392fc6   wesley88   1
192
          oncetype: 'gg',
0c5d2ce8   wesley88   1
193
194
195
196
          addcl: false,
          oninfo: {},
          multipleSelection: [],
  
4373acf5   wesley88   1
197
198
          xsNum: 0,
          xxNum: 0,
0c5d2ce8   wesley88   1
199
          leixing: true,
4373acf5   wesley88   1
200
201
202
203
204
205
          contractChangeReason: '',
          detailsinfo: {},
          pagequery: {
            advertisingType: '线上广告位',
            pageNumber: 0,
            pageSize: 10,
2727043f   wesley88   1
206
207
            advertisingName:'',
            publishStatus:''
4373acf5   wesley88   1
208
209
210
211
          },
          tableData: [],
          total: 0,
          onaction: '1',
0c5d2ce8   wesley88   1
212
          formInline: {},
4373acf5   wesley88   1
213
214
215
        }
      },
      components: {
0c5d2ce8   wesley88   1
216
        cl,
4373acf5   wesley88   1
217
218
219
        add,
        resourceCommodity,
      },
04473319   wesley88   1
220
221
222
223
224
      computed: {
        owningEndList() {
          return this.$store.state.cent.owningEndList;
        }
      },
4373acf5   wesley88   1
225
226
227
228
      created() {
        this.getAll()
      },
      methods: {
0c5d2ce8   wesley88   1
229
230
231
232
233
234
235
236
237
238
239
240
        minSev(e) {
          this.multipleSelection = e
          console.error(this.multipleSelection)
          let ids = []
          for (let index = 0; index < this.multipleSelection.length; index++) {
            ids.push(this.multipleSelection[index].id)
          }
          console.error(this.oninfo)
          let c1 = {
            resourcesId: this.oncetype + this.oninfo.id,
            rentalPoliciesIds: ids,
          }
a4aeeb1e   杨鑫   '最新'
241
242
243
244
245
246
247
  		if(c1.rentalPoliciesIds.length==0){
  			this.$message({
  			  message: '请选择策略进行绑定',
  			  type: 'warning'
  			})
  			return
  		}
0c5d2ce8   wesley88   1
248
249
250
251
252
253
254
255
256
257
          console.error(c1)
          cereResourceStrategy(c1).then(res => {
            if (res.code == 200) {
              this.addcl = false
              this.$message({
                message: '绑定成功',
                type: 'success'
              })
              editStatus({
                resourcesId: this.oncetype + this.oninfo.id,
9b392fc6   wesley88   1
258
                publishStatus: '1'
0c5d2ce8   wesley88   1
259
260
261
              }).then(res => {
                this.onSubmit()
              })
bdbe3660   wesley88   1
262
263
264
265
266
267
268
269
              cereBusinessOperationadd({
                type:'发布',
                resourceId: this.oncetype+this.oninfo.id,
                operator: localStorage.getItem('roleName'),
                operationTime: this.gettime()
              }).then(res => {
                console.error(res)
              })
0c5d2ce8   wesley88   1
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
            } else {
              this.$message({
                message: '绑定失败',
                type: 'error'
              })
            }
          })
        },
        mingClose() {
          this.multipleSelection = []
          this.addcl = false
        },
        async opencl(row, e) {
          this.oncetype = e
          this.oninfo = row
          this.multipleSelection = []
          this.addcl = true
        },
4373acf5   wesley88   1
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
        chenge(val) {
          if (val == 1) {
            this.leixing = true
            this.pagequery.advertisingType = '线上广告位'
            this.getAll((this.pagequery))
          } else {
            this.leixing = false
            this.pagequery.advertisingType = '实体广告位'
            this.getAll((this.pagequery))
          }
        },
        gettime() {
          // 获取当前时间
          let currentTime = new Date();
  
          // 获取年份
          let year = currentTime.getFullYear();
  
          // 获取月份(注意月份是从0开始计数的,所以需要加1)
          let month = currentTime.getMonth() + 1;
  
          // 获取日期
          let day = currentTime.getDate();
  
          // 获取小时
          let hours = currentTime.getHours();
  
          // 获取分钟
          let minutes = currentTime.getMinutes();
  
          // 获取秒数
          let seconds = currentTime.getSeconds();
  
          // 获取毫秒数
          let milliseconds = currentTime.getMilliseconds();
  
          // 格式化时间为 YYYY-MM-DD
          let formattedDate = `${year}-${month.toString().padStart(2, '0')}-${day.toString().padStart(2, '0')}`;
  
          // 格式化时间为 HH:MM:SS
          let formattedTime =
            `${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
  
          // 格式化时间为 YYYY-MM-DD HH:MM:SS
          let formattedDateTime = `${formattedDate} ${formattedTime}`;
          return formattedDateTime
  
        },
0c5d2ce8   wesley88   1
336
        removeinfozz(row, e, tit) {
4373acf5   wesley88   1
337
          let that = this
0c5d2ce8   wesley88   1
338
          this.$confirm('确定要' + tit + '吗?', '提示', {
4373acf5   wesley88   1
339
340
341
342
343
344
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }).then(() => {
            editList({
              ...row,
0c5d2ce8   wesley88   1
345
              publishStatus: e
4373acf5   wesley88   1
346
347
348
349
            }).then(res => {
              console.error(res)
              if (res.code == 200) {
                this.$message({
0c5d2ce8   wesley88   1
350
                  message: tit + '成功',
4373acf5   wesley88   1
351
352
                  type: 'success'
                })
bdbe3660   wesley88   1
353
354
                cereBusinessOperationadd({
                  type:tit,
98bc35a2   wesley88   1
355
                  resourceId: 'gg'+row.id,
bdbe3660   wesley88   1
356
357
358
359
360
                  operator: localStorage.getItem('roleName'),
                  operationTime: that.gettime()
                }).then(res => {
                  console.error(res)
                })
4373acf5   wesley88   1
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
                this.removeonaction('1')
              } else {
                this.$message({
                  message: res.msg,
                  type: 'error'
                })
              }
  
            })
          })
        },
        details(row) {
          this.detailsinfo = row
          this.onaction = '3'
        },
        removeinfo(row, e) {
          this.contractChangeReason = e
          let dimensions_parts = row.dimensions.split(" ")
          let dimensions = row.equipmentSize.split(" ")
  
          dimensions_parts.forEach(part => {
            if (part.startsWith("长")) {
              row.dimensionsH = part.split(":")[1];
            } else if (part.startsWith("宽")) {
              row.dimensionsK = part.split(":")[1];
            }
          })
          dimensions.forEach(part => {
            if (part.startsWith("长")) {
              row.equipmentSizeH = part.split(":")[1];
            } else if (part.startsWith("宽")) {
              row.equipmentSizeK = part.split(":")[1];
            } else if (part.startsWith("高")) {
              row.equipmentSizeG = part.split(":")[1];
            }
          })
          this.detailsinfo = row
          this.onaction = '4'
        },
        async getAll() {
          const res = await likeGet(this.pagequery)
          this.tableData = res.data.content
          this.total = res.data.totalElements
          let obj1 = {
0c5d2ce8   wesley88   1
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
            pageNumber: 1,
            pageSize: 10,
            advertisingType: '线上广告位'
          }
          likeGet(obj1).then(res1 => {
            this.xsNum = res1.data.totalElements
          })
          let obj2 = {
            pageNumber: 1,
            pageSize: 10,
            advertisingType: '实体广告位'
          }
          likeGet(obj2).then(res2 => {
            this.xxNum = res2.data.totalElements
          })
4373acf5   wesley88   1
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
        },
        removeonaction(e) {
          console.error(e)
          this.onaction = e
          this.pagequery.pageNumber = 0
          this.getAll()
        },
        handleCurrentChange(val) {
          this.pagequery.pageNumber = val - 1
          this.getAll()
        },
        handleSizeChange(val) {
          this.pagequery.pageSize = val
        },
        // 查询按钮
        async onSubmit() {
          this.pagequery.pageNumber = 0
          this.getAll()
        },
        //重置按钮
        resetting() {
          this.pagequery = {
              pageNumber: 0,
              pageSize: 10,
4dac8c0b   wesley88   1
444
445
              advertisingName:'',
              advertisingType: this.pagequery.advertisingType,
2727043f   wesley88   1
446
              publishStatus:''
4373acf5   wesley88   1
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
            },
            this.getAll()
        },
        //删除
        closemsg(item) {
          const h = this.$createElement;
          this.$msgbox({
            title: '消息',
            message: h('p', null, [
              h('span', null, '是否删除 '),
            ]),
            showCancelButton: true,
            showClose: false,
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            customClass: 'oe-dialog-btn',
            beforeClose: (action, instance, done) => {
              if (action === 'confirm') {
                delList({
                  id: item.id
                }).then(res => {
                  this.$message({
                    message: '删除成功',
                    type: 'success'
                  })
                  this.getAll()
                  done();
                })
              } else {
                done();
              }
            }
          })
        },
      }
  
    }
  </script>
  
  <style scoped>
4373acf5   wesley88   1
487
488
489
490
491
492
    .zhuti {
      padding: 0 20px 20px 20px;
      min-height: calc(100vh - 50px - 20px);
      background-color: #Fff;
  
    }
4373acf5   wesley88   1
493
494
495
496
497
498
    .chengeXia {
      border-bottom: 6px solid #3F9B6A;
      padding-bottom: 4px;
      color: #3F9B6A;
    }
  
4373acf5   wesley88   1
499
500
501
502
503
504
505
  
    .formSearch {
      display: flex;
      width: 100%;
      font-size: 14px;
      justify-content: space-between;
    }
118fc86d   wesley88   1
506
  
4373acf5   wesley88   1
507
508
509
510
511
512
513
514
515
516
517
    .bg-purple-dark {
      background: #99a9bf;
    }
  
    .bg-purple {
      background: #d3dce6;
    }
  
    .bg-purple-light {
      background: #e5e9f2;
    }
4373acf5   wesley88   1
518
519
520
521
522
    .grid-content {
      border-radius: 4px;
      min-height: 36px;
    }
  
4373acf5   wesley88   1
523
  
4373acf5   wesley88   1
524
525
526
527
528
529
  </style>
  <style lang="scss" scoped>
    ::v-deep .el-dialog__body {
      padding: 0 0 !important;
    }
  
d64cd58f   wesley88   上传验收小程序
530
531
532
533
  
    .el-dialog__header{
      padding: 0;
      display: none;
4373acf5   wesley88   1
534
    }
d64cd58f   wesley88   上传验收小程序
535
  </style>