Blame view

admin-web-master/src/views/detect/information/index.vue 14.7 KB
4373acf5   wesley88   1
1
2
3
4
5
6
7
8
9
10
11
12
  <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>
          <!-- 搜索 -->
          <div class="formSearch">
            <el-form :inline="true" :model="pagequery">
d64cd58f   wesley88   上传验收小程序
13
14
15
              <el-form-item label="商铺名称" prop="shopName">
                <el-input v-model="pagequery.shopName" placeholder="请输入" maxlength="50"></el-input>
              </el-form-item>
4373acf5   wesley88   1
16
              <el-form-item label="所属区域" prop="belongingRegion">
98bc35a2   wesley88   1
17
                <el-select v-model="pagequery.belongingRegion" clearable placeholder="请选择" style="width: 168px;margin-right: 15px">
118fc86d   wesley88   1
18
19
                  <el-option v-for="(item,index) in regionOptions"
                  :key="index" :label="item.label" :value="item.value"></el-option>
4373acf5   wesley88   1
20
21
                </el-select>
              </el-form-item>
d64cd58f   wesley88   上传验收小程序
22
23
24
              <el-form-item label="归属部门" prop="belongingDepartment">
                <el-input v-model="pagequery.belongingDepartment" placeholder="请输入" maxlength="50"></el-input>
              </el-form-item>
4373acf5   wesley88   1
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
            </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>
          <!-- 表格 -->
  
a182f238   wesley88   1
42
43
          <el-table :data="tableData" :header-cell-style="{fontSize: '14px',color:'#0009',fontWeight: 'normal',backgroundColor:'#F2F3F5'}">
            <el-table-column label="序号" width="50">
4373acf5   wesley88   1
44
45
46
47
              <template slot-scope="scope">
                {{scope.$index +1 }}
              </template>
            </el-table-column>
a182f238   wesley88   1
48
49
50
51
52
            <el-table-column label="商铺名称" prop="shopName" show-overflow-tooltip></el-table-column>
            <el-table-column label="商铺类型" prop="publishStatus" show-overflow-tooltip>
              <template slot-scope="scope">
                {{scope.row.shopType=='1'?'移动铺位':scope.row.shopType=='2'?'固定铺位':'无'}}
              </template>
4373acf5   wesley88   1
53
54
55
            </el-table-column>
            <el-table-column label="所属区域" prop="belongingRegion" show-overflow-tooltip>
            </el-table-column>
a182f238   wesley88   1
56
            <el-table-column prop="detailedLocation" width="180" label="详细地址" show-overflow-tooltip>
4373acf5   wesley88   1
57
            </el-table-column>
98bc35a2   wesley88   1
58
59
60
61
            <el-table-column label="归属部门" prop="belongingDepartment" show-overflow-tooltip>  
              <template slot-scope="scope">
                {{scope.row.belongingDepartment || '无'}}
              </template>
4373acf5   wesley88   1
62
63
            </el-table-column>
            <el-table-column label="负责人" prop="head" show-overflow-tooltip>
a182f238   wesley88   1
64
65
66
              <template slot-scope="scope">
                {{scope.row.head || '无'}}
              </template>
4373acf5   wesley88   1
67
            </el-table-column>
3b97e418   wesley88   1
68
            <el-table-column label="提交时间" prop="createDate" > </el-table-column>
4373acf5   wesley88   1
69
70
            <el-table-column label="状态" prop="publishStatus" show-overflow-tooltip>
              <template slot-scope="scope">
2210df30   wesley88   1
71
                {{scope.row.publishStatus=='0'?'待发布':scope.row.publishStatus=='1'?'待审核':scope.row.publishStatus=='2'?'已发布':scope.row.publishStatus=='3'?'不通过':scope.row.publishStatus=='4'?'已租赁':'-'}}
4373acf5   wesley88   1
72
73
              </template>
            </el-table-column>
a182f238   wesley88   1
74
            <el-table-column label="操作" min-width="100" fixed="right">
4373acf5   wesley88   1
75
76
              <template slot-scope="scope">
                <div @click="details(scope.row)" class="tableBtn greens">查看</div>
9b392fc6   wesley88   1
77
                <div class="tableBtn greens" v-if="scope.row.publishStatus=='0' || scope.row.publishStatus=='3'"  @click="removeinfo(scope.row,'编辑')">编辑
4373acf5   wesley88   1
78
                </div>
9b392fc6   wesley88   1
79
80
                <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'"
2506ad54   wesley88   2
81
                @click="opencl(scope.row,'sp')">发布</div>
9b392fc6   wesley88   1
82
83
                <div class="tableBtn greens" v-if="scope.row.publishStatus=='2'"
                  @click="removeinfozz(scope.row,'0','下架')">下架</div>
4373acf5   wesley88   1
84
85
86
87
88
              </template>
            </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>
90d96766   wesley88   1
89
            <el-pagination :current-page="pagequery.pageNumber+1" :page-sizes="[10, 20, 50, 100]" :page-size="pagequery.pageSize"
4373acf5   wesley88   1
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
              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 @removeonaction="removeonaction"></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>
          <resourceCommodity :editbgid="detailsinfo" @removeonaction="removeonaction"></resourceCommodity>
        </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"></add>
        </div>
      </div>
0c5d2ce8   wesley88   1
132
      <el-dialog :visible.sync="addcl" title="选择策略" width="65%" append-to-body center
2506ad54   wesley88   2
133
        :close-on-click-modal="false" :close-on-press-escape="false" :show-close="false">
e75fe4fe   wesley88   2
134
        <cl :type="'商铺'" :resourcesId="oncetype+oninfo.id" v-if="addcl" @minSev="minSev" @mingClose="mingClose"></cl>
2506ad54   wesley88   2
135
      </el-dialog>
4373acf5   wesley88   1
136
137
138
139
140
141
142
143
    </div>
  
  
  </template>
  
  <script>
    import {
      delList,
d64cd58f   wesley88   上传验收小程序
144
      editList,
40a0b33d   杨鑫   '最新'
145
146
      getAlls,
  	parkTrails
d64cd58f   wesley88   上传验收小程序
147
148
149
    } from '@/api/information';
    import add from '@/components/add/addinformation'
    import resourceCommodity from '@/components/resourceCommodity/index'
2506ad54   wesley88   2
150
      import cl from '@/components/change/cl.vue'
2506ad54   wesley88   2
151
      import {
0c5d2ce8   wesley88   1
152
      cereResourceStrategy,
ad921312   wesley88   1
153
154
      editStatus,
      cereBusinessOperationadd,
2506ad54   wesley88   2
155
    } from '@/api/newly.js'
4373acf5   wesley88   1
156
157
158
    export default {
      data() {
        return {
d64cd58f   wesley88   上传验收小程序
159
          lvdaoList:[],
2506ad54   wesley88   2
160
161
162
163
          oncetype:'',
          addcl:false,
          oninfo:{},
          multipleSelection:[],
4373acf5   wesley88   1
164
165
166
          contractChangeReason: '',
          detailsinfo: {},
          pagequery: {
d64cd58f   wesley88   上传验收小程序
167
168
            belongingRegion:'',
            shopName:'',
4373acf5   wesley88   1
169
170
            pageNumber: 0,
            pageSize: 10,
d64cd58f   wesley88   上传验收小程序
171
172
            belongingGreenwaySection:'',
            belongingDepartment:''
4373acf5   wesley88   1
173
174
175
          },
          tableData: [],
          total: 0,
118fc86d   wesley88   1
176
          onaction: '1',
4373acf5   wesley88   1
177
          formInline: {
4373acf5   wesley88   1
178
179
180
          },
        }
      },
118fc86d   wesley88   1
181
182
183
184
185
      computed: {
        regionOptions() {
          return this.$store.state.app.regionOptions;
        }
      },
4373acf5   wesley88   1
186
      components: {
2506ad54   wesley88   2
187
        cl,
4373acf5   wesley88   1
188
189
190
        add,
        resourceCommodity,
      },
d64cd58f   wesley88   上传验收小程序
191
      async created() {
4373acf5   wesley88   1
192
        this.getAll()
40a0b33d   杨鑫   '最新'
193
   
4373acf5   wesley88   1
194
195
      },
      methods: {
2506ad54   wesley88   2
196
197
198
199
200
201
202
        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)
          }
ad921312   wesley88   1
203
          console.error(ids)
2506ad54   wesley88   2
204
205
206
207
          let c1 = {
            resourcesId: this.oncetype+this.oninfo.id,
            rentalPoliciesIds: ids,
          }
a4aeeb1e   杨鑫   '最新'
208
209
210
211
212
213
214
  		if(c1.rentalPoliciesIds.length==0){
  			this.$message({
  			  message: '请选择策略进行绑定',
  			  type: 'warning'
  			})
  			return
  		}
2506ad54   wesley88   2
215
216
217
218
219
220
221
222
          console.error(c1)
          cereResourceStrategy(c1).then(res => {
            if (res.code == 200) {
              this.addcl = false
              this.$message({
                message: '绑定成功',
                type: 'success'
              })
0c5d2ce8   wesley88   1
223
224
              editStatus({
                resourcesId: this.oncetype+this.oninfo.id,
9b392fc6   wesley88   1
225
                publishStatus: '1'
0c5d2ce8   wesley88   1
226
227
228
              }).then(res => {
                this.onSubmit()
              })
90d96766   wesley88   1
229
230
231
232
233
234
235
236
              cereBusinessOperationadd({
                type:'发布',
                resourceId: this.oncetype+this.oninfo.id,
                operator: localStorage.getItem('roleName'),
                operationTime: this.gettime()
              }).then(res => {
                console.error(res)
              })
2506ad54   wesley88   2
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
            } 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
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
        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
  
        },
        removeinfozz(row, e, tit) {
          let that = this
          this.$confirm('确定要' + tit + '吗?', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }).then(() => {
            editList({
              ...row,
              publishStatus: e
            }).then(res => {
              console.error(res)
              if (res.code == 200) {
                this.$message({
                  message: tit + '成功',
                  type: 'success'
                })
ad921312   wesley88   1
309
310
311
312
313
314
315
316
317
                cereBusinessOperationadd({
                  type:tit,
                  resourceId: 'sp'+row.id,
                  operator: localStorage.getItem('roleName'),
                  operationTime: that.gettime()
                }).then(res => {
                  console.error(res)
                })
              
4373acf5   wesley88   1
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
                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
          this.detailsinfo = row
          this.onaction = '4'
        },
        async getAll() {
          const res = await getAlls(this.pagequery)
          this.tableData = res.data.content
          this.total = res.data.totalElements
        },
        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
90d96766   wesley88   1
355
356
          this.pagequery.pageNumber = 0
          this.getAll()
4373acf5   wesley88   1
357
358
359
360
361
362
363
364
365
        },
        // 查询按钮
        async onSubmit() {
          this.pagequery.pageNumber = 0
          this.getAll()
        },
        //重置按钮
        resetting() {
          this.pagequery = {
d64cd58f   wesley88   上传验收小程序
366
367
              belongingRegion:'',
              shopName:'',
4373acf5   wesley88   1
368
369
              pageNumber: 0,
              pageSize: 10,
d64cd58f   wesley88   上传验收小程序
370
371
              belongingGreenwaySection:'',
              belongingDepartment:''
4373acf5   wesley88   1
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
405
406
407
408
409
410
411
            },
            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
412
413
414
415
416
417
    .zhuti {
      padding: 0 20px 20px 20px;
      min-height: calc(100vh - 50px - 20px);
      background-color: #Fff;
  
    }
4373acf5   wesley88   1
418
419
420
421
422
423
    .chengeXia {
      border-bottom: 6px solid #3F9B6A;
      padding-bottom: 4px;
      color: #3F9B6A;
    }
  
4373acf5   wesley88   1
424
425
426
427
428
429
430
  
    .formSearch {
      display: flex;
      width: 100%;
      font-size: 14px;
      justify-content: space-between;
    }
4373acf5   wesley88   1
431
432
433
    .greens {
      color: #3F9B6A;
    }
4373acf5   wesley88   1
434
435
436
437
438
439
440
441
442
443
444
    .bg-purple-dark {
      background: #99a9bf;
    }
  
    .bg-purple {
      background: #d3dce6;
    }
  
    .bg-purple-light {
      background: #e5e9f2;
    }
4373acf5   wesley88   1
445
446
447
448
449
    .grid-content {
      border-radius: 4px;
      min-height: 36px;
    }
  
4373acf5   wesley88   1
450
451
452
453
454
  </style>
  <style lang="scss" scoped>
    ::v-deep .el-dialog__body {
      padding: 0 0 !important;
    }
2506ad54   wesley88   2
455
    .el-dialog__header{
0c5d2ce8   wesley88   1
456
457
      padding: 0;
      display: none;
2506ad54   wesley88   2
458
    }
4373acf5   wesley88   1
459
  </style>