Jelajahi Sumber

fix: 修复没有领取优惠劵,也可以选中优惠劵的问题

laiqi 1 tahun lalu
induk
melakukan
68e4f6d366
3 mengubah file dengan 114 tambahan dan 3 penghapusan
  1. 4 3
      src/pages/form/formStep3.vue
  2. 51 0
      src/service/file/index.ts
  3. 59 0
      src/types/file.ts

+ 4 - 3
src/pages/form/formStep3.vue

@@ -92,6 +92,7 @@
                 :value="coupon.couponid"
                 v-for="coupon in couponsShow"
                 :key="coupon.couponid"
+                :disabled="coupon.canReceive"
               >
                 <view class="flex items-center justify-between">
                   <view class="text-gray-800">{{ coupon.couponmc }}</view>
@@ -289,9 +290,9 @@ function getCouponsShow() {
 
       return {
         ...coupon,
-        canReceive: !receivedCoupon,
-        coupon2sid: receivedCoupon?.coupon2sid,
-        coupon2code: receivedCoupon?.coupon2code,
+        canReceive: !receivedCoupon, // 是否可以领取
+        coupon2sid: receivedCoupon?.coupon2sid, // 优惠券id
+        coupon2code: receivedCoupon?.coupon2code, // 优惠券码
       }
     })
   })

+ 51 - 0
src/service/file/index.ts

@@ -0,0 +1,51 @@
+import { http } from '@/utils/http'
+import type { AttachmentEntity } from '@/types/file'
+import type { ListType, ListResponseType } from '@/types/list'
+import { parseQueryValues } from '@/utils'
+
+/** 附件信息_列表 */
+export const getAttachmentListApi = (
+  params: Partial<AttachmentEntity>,
+  page: Partial<ListType>,
+) => {
+  return http.get<ListResponseType<AttachmentEntity>>('/api/query/list?pagevalue=97', {
+    ...page,
+    ...parseQueryValues(params),
+  })
+}
+
+/**
+ * 新增图片并返回id
+ */
+export const addImageApi = (data: { file: File }) => {
+  return http.post<any>('/api/attachment/addimg?pagevalue=93', {
+    ...data,
+  })
+}
+
+/**
+ * 添加附件记录并返回路径
+ */
+export const addAttachmentApi = (data: { id: number }) => {
+  return http.post<any>('/api/attachment/addtopath?pagevalue=94', {
+    ...data,
+  })
+}
+
+/**
+ * 删除附件记录
+ */
+export const deleteAttachmentApi = (data: { id: number }) => {
+  return http.post<any>('/api/attachment/del?pagevalue=95', {
+    ...data,
+  })
+}
+
+/**
+ * 更新附件记录
+ */
+export const updateAttachmentApi = (data: { id: number }) => {
+  return http.post<any>('/api/attachment/up?pagevalue=96', {
+    ...data,
+  })
+}

+ 59 - 0
src/types/file.ts

@@ -0,0 +1,59 @@
+// CREATE TABLE `attachment` (
+//   `attid` varchar(32) NOT NULL COMMENT '附件ID(查询条件)',
+//   `attname` varchar(32) NOT NULL COMMENT '文件名',
+//   `attpath` varchar(200) NOT NULL COMMENT '路径',
+//   `atttype` varchar(10) NOT NULL COMMENT '扩展名',
+//   `attsize` varchar(20) NOT NULL COMMENT '文件大小',
+//   `attmodel` varchar(20) NOT NULL COMMENT '关联模块(查询条件)',
+//   `attlsh` varchar(32) DEFAULT NULL COMMENT '关联表单流水号(查询条件)',
+//   `attcreate` datetime NOT NULL COMMENT '创建时间#不可编辑(禁止前端编辑)(查询条件)',
+//   `attcreateuser` varchar(30) DEFAULT NULL COMMENT '上传者#不可编辑(禁止前端编辑)',
+//   `attdelcode` tinyint(4) DEFAULT NULL COMMENT '删除标记(禁止前端编辑)(禁止插入)',
+//   `attother1` varchar(50) DEFAULT NULL COMMENT '附加参数1',
+//   `attother2` varchar(50) DEFAULT NULL COMMENT '附加参数2',
+//   `attother3` varchar(50) DEFAULT NULL COMMENT '附加参数3',
+//   `attorginname` varchar(255) DEFAULT NULL COMMENT '文件原始名称',
+//   `attfileSHA1` varchar(100) DEFAULT NULL COMMENT '文件SHA1值',
+//   `attfileSHA256` varchar(100) DEFAULT NULL COMMENT '文件SHA256值',
+//   `attfileMD5` varchar(100) DEFAULT NULL COMMENT '文件MD5值',
+//   PRIMARY KEY (`attid`)
+// ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='附件';
+
+interface AttachmentEntity {
+  /** 附件ID(查询条件) */
+  attid: string
+  /** 文件名 */
+  attname: string
+  /** 路径 */
+  attpath: string
+  /** 扩展名 */
+  atttype: string
+  /** 文件大小 */
+  attsize: string
+  /** 关联模块(查询条件) */
+  attmodel: string
+  /** 关联表单流水号(查询条件) */
+  attlsh: string
+  /** 创建时间#不可编辑(禁止前端编辑)(查询条件) */
+  attcreate: string
+  /** 上传者#不可编辑(禁止前端编辑) */
+  attcreateuser: string
+  /** 删除标记(禁止前端编辑)(禁止插入) */
+  attdelcode: number
+  /** 附加参数1 */
+  attother1: string
+  /** 附加参数2 */
+  attother2: string
+  /** 附加参数3 */
+  attother3: string
+  /** 文件原始名称 */
+  attorginname: string
+  /** 文件SHA1值 */
+  attfileSHA1: string
+  /** 文件SHA256值 */
+  attfileSHA256: string
+  /** 文件MD5值 */
+  attfileMD5: string
+}
+
+export type { AttachmentEntity }