From a836f03a5d1fbfa81e147d09ffdfa87ba3975c13 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期二, 18 三月 2025 16:45:02 +0800
Subject: [PATCH] 1

---
 admin/src/views/combo/index.vue |  227 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 227 insertions(+), 0 deletions(-)

diff --git a/admin/src/views/combo/index.vue b/admin/src/views/combo/index.vue
new file mode 100644
index 0000000..5951710
--- /dev/null
+++ b/admin/src/views/combo/index.vue
@@ -0,0 +1,227 @@
+<template>
+  <div class="main_app">
+    <QueryForm v-model="filters" :query-form-config="queryFormConfig" @handleQuery="getList(1)" @clear="clear" />
+    <div class="table_btns">
+      <el-button type="primary" @click="handleEdit()">鏂板</el-button>
+    </div>
+    <el-table v-loading="loading" :data="list" stripe border>
+      <el-table-column prop="name" label="濂楅鍚嶇О" align="center" min-width="120" show-overflow-tooltip>
+        <template v-slot="{ row }">
+          <span @click="handleDetail(row)" class="primaryColor pointer">{{ row.name }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column prop="" label="濂楅绫诲瀷" align="center" min-width="100" show-overflow-tooltip>
+        <template v-slot="{ row }">
+          <span v-if="row.type == 0">鏈熼檺鍗�</span>
+        </template>
+      </el-table-column>
+      <!-- <el-table-column prop="" label="娆℃暟" align="center" min-width="100" show-overflow-tooltip /> -->
+      <el-table-column prop="useDays" label="鏈夋晥鏈�" align="center" min-width="90" show-overflow-tooltip>
+        <template v-slot="{ row }">
+          <span>{{ row.useDays }}澶�</span>
+        </template>
+      </el-table-column>
+      <el-table-column prop="price" label="浠锋牸" align="center" min-width="80" show-overflow-tooltip />
+      <el-table-column prop="saleLimit" label="鎬诲彂琛屾暟閲�" align="center" min-width="100" show-overflow-tooltip>
+        <template v-slot="{ row }">
+          <span>{{ row.saleLimit ? row.saleLimit : '涓嶉檺棰�' }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column prop="saleNum" label="宸插敭鍞噺" align="center" min-width="100" show-overflow-tooltip />
+      <el-table-column prop="" label="閿�鍞笭閬�" align="center" min-width="100" show-overflow-tooltip>
+        <template v-slot="{ row }">
+          <span v-if="row.channel == 0">灏忕▼搴�</span>
+        </template>
+      </el-table-column>
+      <el-table-column prop="" label="閿�鍞椂娈�" align="center" min-width="120" show-overflow-tooltip>
+        <template v-slot="{ row }">
+          <div>璧凤細{{ row.startDate }}</div>
+          <div>姝細{{ row.endDate }}</div>
+        </template>
+      </el-table-column>
+      <el-table-column prop="" fixed="right" label="鐘舵��" align="center" min-width="80" show-overflow-tooltip>
+        <template v-slot="{ row }">
+          <el-switch @change="changeStatus(row)" v-model="row.status" :active-value="0" :inactive-value="1" />
+        </template>
+      </el-table-column>
+      <el-table-column label="鎿嶄綔" fixed="right" align="center" min-width="120" show-overflow-tooltip>
+        <template v-slot="{ row }">
+          <div>
+            <span v-if="row.status == 0" @click="handleEdit(row, 'copy')" class="primaryColor pointer">澶嶅埗</span>
+            <span v-if="row.status == 1" @click="handleEdit(row)" class="primaryColor pointer mr10">缂栬緫</span>
+            <span v-if="row.status == 1" @click="handleDel(row)" class="red pointer">鍒犻櫎</span>
+          </div>
+        </template>
+      </el-table-column>
+    </el-table>
+    <div class="table_btns">
+      <Pagination @size-change="handleSizeChange" @current-change="getList" :pagination="pagination" />
+    </div>
+    <!--  -->
+    <Edit v-if="isShowEdit" @close="isShowEdit = false" @success="getList" ref="EditRef" />
+    <ComboDetail v-if="isShowDetail" ref="DetailRef" />
+  </div>
+</template>
+
+<script>
+import BasePageTemp from '@/components/base/BasePageTemp'
+import TableLayout from '@/layouts/TableLayout'
+import Edit from './components/Edit'
+import ComboDetail from './components/ComboDetail.vue'
+import { comboListPost, comboUpdatePost, comboDelPost } from '@/api/business/combo.js'
+import { Message } from 'element-ui'
+export default {
+  extends: BasePageTemp,
+  components: {
+    TableLayout,
+    Edit,
+    ComboDetail
+  },
+  data() {
+    return {
+      loading: false,
+      isShowEdit: false,
+      isShowDetail: false,
+      queryFormConfig: {
+        formItems: [
+          {
+            filed: 'name',
+            type: 'input',
+            label: '濂楅鍚嶇О',
+          },
+          {
+            filed: 'bikeOrElec',
+            type: 'select',
+            label: '閫傜敤椤圭洰',
+            labelCode: 'name',
+            valueCode: 'id',
+            options: [
+              { name: '鑷杞�', id: 1 },
+              { name: '鐢靛姩杞�', id: 2 },
+            ]
+          },
+          {
+            filed: 'status',
+            type: 'select',
+            label: '鐘舵��',
+            labelCode: 'name',
+            valueCode: 'id',
+            options: [
+              { name: '姝e父', id: 0 },
+              { name: '鍋滅敤', id: 1 },
+            ]
+          },
+        ],
+        online: true
+      },
+      list: []
+    }
+  },
+  created() {
+    this.getList()
+    // this.initData()
+  },
+  methods: {
+    handleSub() {
+      this.$refs.ruleForm.validate((valid) => {
+        if (valid) {
+          alert('submit!')
+        }
+      })
+    },
+    changeStatus(row) {
+      comboUpdatePost({ ...row }).then(res => {
+        if (res.code == 200) {
+          return Message.success('鏇存柊鎴愬姛')
+        }
+      })
+    },
+    handleDel(row) {
+      this.$confirm('鎮ㄧ‘璁よ鍒犻櫎褰撳墠濂楅鍚楋紵', '鎻愮ず', {
+        confirmButtonText: '纭畾',
+        cancelButtonText: '鍙栨秷',
+        type: 'warning',
+      }).then(() => {
+        comboDelPost(row.id).then(res => {
+          if (res) {
+            Message.success('鍒犻櫎鎴愬姛')
+            this.getList()
+          }
+        })
+      })
+    },
+    handleEdit(row, type = 'edit') {
+      this.isShowEdit = true
+      this.$nextTick(() => {
+        this.$refs.EditRef.isShowModal = true
+        if (row && row.id) {
+          this.$refs.EditRef.getDetail(row.id, type)
+        }
+      })
+    },
+    handleDetail(row) {
+      this.isShowDetail = true
+      this.$nextTick(() => {
+        this.$refs.DetailRef.isShowModal = true
+        this.$refs.DetailRef.getDetail(row.id)
+      })
+    },
+    handleEx() {
+      this.$dialog.exportConfirm('纭瀵煎嚭鍚楋紵')
+        .then(() => {
+          this.loading = true
+          ywOutinboundEx({
+            page: this.pagination.page,
+            capacity: 1000000,
+            model: this.filters
+          })
+            .then(response => {
+              this.download(response)
+            })
+            .catch(e => {
+              this.$tip.apiFailed(e)
+            })
+            .finally(() => {
+              this.loading = false
+            })
+        })
+        .catch(() => { })
+    },
+    initData() {
+      getStoreList({ capacity: 9999, page: 1, model: {} }).then(res => {
+        this.queryFormConfig.formItems[1].options = res.records || []
+      })
+    },
+    getList(page) {
+      const { pagination, filters } = this
+      this.loading = true
+      if (page) { pagination.page = page }
+      comboListPost({
+        model: {
+          ...filters
+        },
+        capacity: pagination.pageSize,
+        page: page,
+      }).then(res => {
+        this.loading = false
+        this.list = res.records || []
+        this.pagination.total = res.total || 0
+      }, () => {
+        this.loading = false
+      })
+    },
+    clear() {
+      this.filters = { inOut: 0 }
+      this.pagination.pageSize = 10
+      this.pagination.page = 1
+      this.getList()
+    },
+    handleSizeChange(capacity) {
+      this.pagination.pageSize = capacity
+      this.getList()
+    }
+  }
+}
+</script>
+
+<style></style>

--
Gitblit v1.9.3