hejianhao
2025-04-16 dab2d210ca06c1faa514c6388fbd5de1ab355360
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
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
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
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
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
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
<template>
  <div class="finance-del">
    <v-header title="预约管理登记"></v-header>
 
    <el-form :inline="true" class="demo-form-inline">
      <el-form-item label="关键字" style="width: 350px">
        <el-input
          style="width: 280px"
          size="small"
          v-model="bar.keyWord"
          placeholder="请输入预约主题关键词进行查找"
        ></el-input>
      </el-form-item>
      <el-form-item label="类型">
        <el-checkbox-group v-model="bar.type">
          <el-checkbox-button
            v-for="type in typeList"
            :label="type.value"
            :key="type.value"
          >{{ type.label }}</el-checkbox-button>
        </el-checkbox-group>
      </el-form-item>
      <el-form-item label="状态">
        <el-select v-model="bar.status" placeholder="请选择">
          <el-option
            v-for="item in statusList"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          ></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="广告">
        <el-select v-model="bar.advertType" placeholder="请选择">
          <el-option
            v-for="item in advertTypeList"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          ></el-option>
        </el-select>
      </el-form-item>
      <el-form-item>
        <div class="block">
          <span class="demonstration">创建时间</span>
          <el-date-picker
            v-model="bar.time"
            type="daterange"
            range-separator="至"
            format="yyyy-MM-dd HH:mm:ss"
            value-format="yyyy-MM-dd HH:mm:ss"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
          ></el-date-picker>
        </div>
      </el-form-item>
      <el-form-item>
        <el-button size="small" type="primary" @click="onSearch">查询</el-button>
        <el-button @click="Reset" size="small">重置</el-button>
      </el-form-item>
    </el-form>
 
    <div class="add">
      <el-button class="add-btn" type="primary" plain @click="add">新 增</el-button>
      <button class="m_btn bgc_primary" @click="exportsregisterall()">导出所有类别登记的统计</button>
      <button class="m_btn bgc_primary" @click="exportsmakerall()">导出所有类别预约的统计</button>
      <button class="m_btn bgc_primary" @click="registerT()">查看所有类别登记的统计</button>
      <button class="m_btn bgc_primary" @click="appointmentT()">查看所有类别预约的统计</button>
    </div>
 
    <div class="tab">
      <v-tool-table :trs="trs" :tds="tds">
        <template v-slot:remark="{ scope }">
          <span class="remark1" v-if="scope.type == '1'">预约类</span>
          <span class="remark2" v-else>登记类</span>
        </template>
        <template v-slot:num="{ scope }">
          <span v-if="!scope.joinAllCount">不限制</span>
          <span v-else>{{ scope.joinAllCount - scope.joinCount }}</span>
        </template>
        <template v-slot:status="{ scope }">
          <span class="remark1" v-if="scope.status == '1'">待发布</span>
          <span class="remark2" v-if="scope.status == '2'">进行中</span>
          <span class="remark3" v-if="scope.status == '3'">已停止</span>
        </template>
        <template v-slot:btn="{ scope }">
          <div class="table_flex">
            <div v-if="scope.status == '2'">
              <span @click="$router.push('act_addregister/' + scope.id + '/c')">复制</span>
              <span v-if="scope.type == '1'" @click="viewDetails(scope.id)">查看预约明细</span>
              <br />
              <span v-if="scope.type == '2'" @click="viewregistrationDetails(scope)">查看登记明细</span>
              <br />
              <span v-if="scope.type == '1'" @click="exports(scope.id)">导出预约明细</span>
              <span v-else @click="exportsRegister(scope.id)">导出登记明细</span>
              <span v-if="scope.type == '1'" @click="release(scope.id, 1)">停止预约</span>
              <span v-else @click="release(scope.id, 1)">停止登记</span>
            </div>
            <div v-if="scope.status == '3'">
              <span @click="$router.push('act_addregister/' + scope.id + '/c')">复制</span>
              <span v-if="scope.type == '2'" @click="viewregistrationDetails(scope)">查看登记明细</span>
              <br />
              <span v-if="scope.type == '1'" @click="viewDetails(scope.id)">查看预约明细</span>
              <br />
              <span v-if="scope.type == '1'" @click="exports(scope.id)">导出预约明细</span>
              <span v-else @click="exportsRegister(scope.id)">导出登记明细</span>
              <span
                @click="
                  $router.push('act_addregister/' + scope.id + '/continue')
                "
              >
                <span v-if="scope.type == '1'">继续预约</span>
                <span v-else>继续登记</span>
              </span>
            </div>
            <div v-if="scope.status == '1'">
              <span @click="$router.push('act_addregister/' + scope.id + '/c')">复制</span>
              <span @click="release(scope.id, 2)">发布</span>
              <br />
              <span @click="edit(scope.id)">编辑</span>
              <span @click="deleteMsg(scope.id)">删除</span>
            </div>
          </div>
        </template>
      </v-tool-table>
    </div>
    <v-tool-page :item="paged" @on-page="onPage"></v-tool-page>
  </div>
</template>
 
<script>
export default {
  props: [],
  components: {},
 
  data() {
    return {
      bar: {
        keyWord: "",
        status: "",
        type: [],
        advertType: "",
        time: "",
      },
      statusList: [
        {
          label: "待发布",
          value: 1,
        },
        {
          label: "进行中",
          value: 2,
        },
        {
          label: "已停止",
          value: 3,
        },
      ],
      advertTypeList: [
        {
          label: "无",
          value: 1,
        },
        {
          label: "首页顶部",
          value: 2,
        },
        {
          label: "首页应用",
          value: 3,
        },
      ],
      typeList: [
        {
          label: "预约类",
          value: 1,
        },
        {
          label: "登记类",
          value: 2,
        },
      ],
      os: {},
      trs: [
        { text: "序号", val: "index" },
        { text: "ID", val: "id" },
        { text: "预约登记主题", val: "title" },
        { text: "类型", val: "btn", slot: "remark" },
        { text: "浏览量", val: "viewNum" },
        { text: "提交量", val: "joinCount" },
        { text: "内容显示位置设置", val: "advertPosition", width: "120px" },
        { text: "剩余预约数量", val: "btn", slot: "num" },
        { text: "发布时间", val: "publishTime", width: "80px" },
        { text: "结束时间", val: "endTime", width: "80px" },
        { text: "创建时间", val: "createAt", width: "80px" },
        { text: "状态", val: "btn", slot: "status" },
        { text: "操作", val: "btn", width: "200px" },
      ],
      tds: [],
      paged: { page: 0, total: 0, r: 0, limit: 10 },
    };
  },
 
  mounted() { },
 
  methods: {
    /**
     * 新增预约登记
     * type 2:登记类  1 预约类
     */
    add() {
      this.$router.push("/act_addregister/");
    },
 
    edit(id) {
      this.$router.push("/act_addregister/" + id);
    },
 
    deleteMsg(id) {
      this.$confirm("确定要进行删除吗?", "温馨提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          var url = `reserve/delete?reserveId=${id}`;
          this.$api.post(url, {}, (e) => {
            demo.toast("删除成功");
            this.init();
          });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消发布",
          });
        });
    },
 
    //预约明细导出
    exports(id) {
      this.$api.post("reserve/make/list/export", { reserveId: id }, (e) => {
        window.location.href = e;
      });
    },
    //登记明细导出
    exportsRegister(id) {
      const loading = this.$loading({
        lock: true,
        text: "正在导出中,请耐心等待....",
        spinner: "el-icon-loading",
        background: "rgba(0, 0, 0, 0.7)",
      });
      this.$api.post(
        "reserve/register/list/export",
        {
          reserveId: id,
          beginTime: "",
          endTime: "",
          keyword: "",
          startTime: "",
          stopTime: "",
        },
        (e) => {
          window.location.href = e;
          loading.close();
        },
        (err) => {
          loading.close();
        }
      );
    },
 
    //导出登记统计
    exportsregisterall() {
      let params = {
        endTime: "",
        pageNum: 1,
        pageSize: 10,
        startTime: "",
      };
      this.$api.post("reserve/register/statistics/export", params, (e) => {
        window.location.href = e;
      });
    },
 
    //导出预约统计
    exportsmakerall() {
      let params = {
        endTime: "",
        startTime: "",
      };
      this.$api.post("reserve/make/statistics/export", params, (e) => {
        window.location.href = e;
      });
    },
 
    release(id, type) {
      let params = {
        id: id,
        type: type,
      };
      if (type == 2) {
        this.$confirm("确认要发布吗?发布后将无法进行修改?", "温馨提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        })
          .then(() => {
            this.$api.post("reserve/edit/status", params, (e) => {
              demo.toast("发布成功");
              this.init();
            });
          })
          .catch(() => {
            this.$message({
              type: "info",
              message: "已取消发布",
            });
          });
      } else {
        this.$api.post("reserve/edit/status", params, (e) => {
          if (type === 1) {
            demo.toast("停止成功");
          }
          this.init();
        });
      }
    },
 
    viewDetails(id) {
      this.$router.push("/act_detailed/" + id);
    },
 
    viewregistrationDetails(row) {
      this.$router.push("/act_registrationDetails/" + JSON.stringify(row));
    },
 
    onSearch(v) {
      this.paged.page = 1;
      this.init();
    },
 
    registerT() {
      this.$router.push("/act_registrationStatistics");
    },
 
    appointmentT() {
      this.$router.push("/act_appointmentStatistics");
    },
 
    Reset() {
      (this.bar.communityId = ""),
        (this.bar.keyWord = ""),
        (this.bar.status = ""),
        (this.bar.type = []),
        (this.bar.advertType = ""),
        (this.bar.time = "");
      this.paged.page = 1;
      this.paged.limit = 10;
      this.init();
    },
 
    // 分页点击
    onPage(v) {
      if (v.page === this.paged.page && v.page && !v.reset) {
        return 0;
      }
      this.paged.page = v.page;
      this.paged.limit = v.limit;
      this.init();
    },
 
    init() {
      let params = {
        keyWord: this.bar.keyWord,
        status: this.bar.status,
        type: this.bar.type,
        advertType: this.bar.advertType,
        startTime: this.bar.time[0] || "",
        endTime: this.bar.time[1] || "",
        pageNum: this.paged.page,
        pageSize: this.paged.limit,
        reserveId: "",
      };
      this.$api.post("reserve/page", params, (e) => {
        this.paged.total = e.total;
        this.paged.r++;
        this.tds = e.records || [];
        this.tds.map((item, index) => {
          item.index = (this.paged.page - 1) * this.paged.limit + index + 1;
        });
        // this.tds = (e.records || []).map((v) => {
        //    this.$set(v, 'che', false)
        //   return v;
        // });
      });
    },
    //导出
    // exports(v) {
    // if(!v) {
    //   if(!this.ids.length) {
    //     demo.toast("请勾选需要下载的内容");
    //     return
    //   }
    // }
    // let t = this
    // let params = {
    //   tradeIds:t.ids,
    //   keyWord:this.bar.keyWord,
    //   sort:this.bar.sort,
    //   endTime:this.bar.time[1],
    //   startTime:this.bar.time[0],
    //   changeType:"1"
 
    // }
    // this.$api.post("user/wallet/trade/export", params, (e) => {
    //   window.location.href = e;
    // });
    // },
  },
};
</script>
<style scoped lang="less">
.finance-del {
  overflow: scroll;
}
.add {
  text-align: right;
}
.add-btn {
  position: relative;
  top: 2px;
}
.remark1 {
  color: #2593fc;
}
.remark2 {
  color: #67c23a;
}
.remark3 {
  color: #f56c6c;
}
.bgc_primary {
  margin-bottom: 15px;
}
</style>