shmily1213 1 месяц назад
Родитель
Сommit
e100173e1f

+ 0 - 24
back-ui/src/assets/styles/ruoyi.scss

@@ -232,30 +232,6 @@
   color: #1ab394;
 }
 
-.text-primary {
-  color: inherit;
-}
-
-.text-success {
-  color: #1c84c6;
-}
-
-.text-info {
-  color: #23c6c8;
-}
-
-.text-warning {
-  color: #f8ac59;
-}
-
-.text-danger {
-  color: #ed5565;
-}
-
-.text-muted {
-  color: #888888;
-}
-
 /* image */
 .img-circle {
   border-radius: 50%;

+ 11 - 1
back-ui/src/common/enum.js

@@ -7,4 +7,14 @@ export const CARD_STATUS = [
     label: '已激活',
     value: 30,
   },
-];
+];
+
+/**
+ * 卡类型枚举
+ */
+export const EnumCardType = {
+  EXPERIENCE: 9,
+  VIP: 1,
+  VIP_PLATFORM: 6,
+  VIP_INSTITUTION: 2,
+}

+ 1 - 1
back-ui/src/views/dz/cards/components/MajorTable.vue

@@ -69,7 +69,7 @@ const getList = () => {
     nextTick(() => {
       // 恢复选中状态:根据 props.selection 中的 id 找到对应的 row 并选中
       props.selection.forEach(selectedItem => {
-        const row = data.value.find(dataItem => dataItem.id === selectedItem.majorId);
+        const row = data.value.find(dataItem => String(dataItem.id) === String(selectedItem.majorId));
         if (row) {
           tableRef.value.toggleRowSelection(row, true);
         }

+ 25 - 7
back-ui/src/views/dz/cards/index.vue

@@ -42,8 +42,8 @@
         </div>
       </el-form-item>
       <el-form-item label="卡分配日期" prop="assignTimeRange">
-        <el-date-picker v-model="queryParams.assignTimeRange" type="daterange" range-separator="至" start-placeholder="开始日期"
-          end-placeholder="结束日期" value-format="YYYY-MM-DD" class="w-[282px]!" />
+        <el-date-picker v-model="queryParams.assignTimeRange" type="daterange" range-separator="至"
+          start-placeholder="开始日期" end-placeholder="结束日期" value-format="YYYY-MM-DD" class="w-[282px]!" />
       </el-form-item>
       <el-form-item label="平台机构" prop="deptId">
         <ie-institution-select v-model="queryParams.deptId" class="w-[180px]!" clearable />
@@ -115,10 +115,10 @@
         <svg-icon icon-class="chart" class="mr-1" style="font-size: 12px" />
         结算
       </CustomButton>
-      <CustomButton color="#009688" :disabled="batchDisabled" @click="handleRenew">
+      <!-- <CustomButton color="#009688" :disabled="batchDisabled" @click="handleRenew">
         <svg-icon icon-class="time" class="mr-1" style="font-size: 14px" />
         续期
-      </CustomButton>
+      </CustomButton> -->
       <CustomButton color="#673AB7" :disabled="editDisabled" @click="handleEdit">
         <svg-icon icon-class="edit" class="mr-1" style="font-size: 12px" />
         修改
@@ -129,7 +129,8 @@
       </CustomButton>
       <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
-    <card-table :data="cardList" :loading="loading" :hide-actions="true" @selectionChange="handleSelectionChange" @delete="handleDelete" />
+    <card-table :data="cardList" :loading="loading" :hide-actions="true" @selectionChange="handleSelectionChange"
+      @delete="handleDelete" />
     <div class="flex justify-end">
       <Pagination :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
         @pagination="getList" />
@@ -156,7 +157,7 @@ import AssignDialog from './components/AssignDialog.vue';
 import EditDialog from './components/EditDialog.vue';
 import RelateDialog from './components/RelateDialog.vue';
 import { listCards, delCards, payCard, closeCard, reopenCard, refundCard, settleCard, renewCard } from '@/api/dz/cards';
-import { CARD_STATUS } from '@/common/enum';
+import { CARD_STATUS, EnumCardType } from '@/common/enum';
 import { getCurrentInstance, nextTick } from 'vue';
 
 const { proxy } = getCurrentInstance();
@@ -237,7 +238,6 @@ const getList = () => {
     assignTimeEnd: queryParams.value.assignTimeRange?.[1],
   };
   delete params.assignTimeRange;
-  console.log(params)
   listCards(params).then(res => {
     cardList.value = res.rows;
     total.value = res.total;
@@ -284,6 +284,12 @@ const handleOpenCard = () => {
 }
 
 const handlePay = () => {
+  // 体验卡禁止缴费
+  const isExperienceCard = selectedRows.value.some(item => item.type === EnumCardType.EXPERIENCE);
+  if (isExperienceCard) {
+    proxy.$modal.msgError('体验卡禁止缴费');
+    return;
+  }
   proxy.$modal.confirm(`是否确认缴费所选数据 (${ids.value.length}项) ?`).then(() => {
     payCard(ids.value).then(() => {
       proxy.$modal.msgSuccess('缴费成功')
@@ -311,6 +317,12 @@ const handleReopen = () => {
 }
 
 const handleRefund = () => {
+  // 体验卡禁止退费
+  const isExperienceCard = selectedRows.value.some(item => item.type === EnumCardType.EXPERIENCE);
+  if (isExperienceCard) {
+    proxy.$modal.msgError('体验卡禁止退费');
+    return;
+  }
   proxy.$modal.confirm(`是否确认退费所选数据 (${ids.value.length}项) ?`).then(() => {
     refundCard(ids.value).then(() => {
       proxy.$modal.msgSuccess('退费成功')
@@ -320,6 +332,12 @@ const handleRefund = () => {
 }
 
 const handleSettle = () => {
+  // 体验卡禁止结算
+  const isExperienceCard = selectedRows.value.some(item => item.type === EnumCardType.EXPERIENCE);
+  if (isExperienceCard) {
+    proxy.$modal.msgError('体验卡禁止结算');
+    return;
+  }
   proxy.$modal.confirm(`是否确认结算所选数据 (${ids.value.length}项) ?`).then(() => {
     settleCard(ids.value).then(() => {
       proxy.$modal.msgSuccess('结算成功')