Parcourir la source

feat: 费用模块

LAPTOP-2ACP37JG\shark il y a 3 ans
Parent
commit
f9885d3446

+ 12 - 12
src/views/money/bill/data.ts

@@ -13,7 +13,7 @@ const adaptWidth = adapt();
 export const columns: BasicColumn[] = [
   {
     title: 'ID',
-    dataIndex: 'id',
+    dataIndex: 'bill.id',
     editComponentProps: {
       prefix: '$',
     },
@@ -22,60 +22,60 @@ export const columns: BasicColumn[] = [
   },
   {
     title: '交易类型',
-    dataIndex: 'type',
+    dataIndex: 'type.in_out',
     width: 130,
     customRender({ record }) {
       const options = ['会费', '收入', '支出', '内部转账'];
-      return options[record.type];
+      return options[record['type.in_out']];
     },
     sorter: true,
   },
   {
     title: '交易名称',
-    dataIndex: 'typename',
+    dataIndex: 'type.name',
     width: 160,
     sorter: true,
   },
   {
     title: '交易账户',
-    dataIndex: 'account',
+    dataIndex: 'account.name',
     width: 160,
     sorter: true,
   },
   {
     title: '金额',
-    dataIndex: 'money',
+    dataIndex: 'bill.money',
     width: 160,
     sorter: true,
   },
   {
     title: '相关会员',
-    dataIndex: 'member',
+    dataIndex: 'name',
     width: 160,
     sorter: true,
   },
   {
     title: '是否开票',
-    dataIndex: 'isCode',
+    dataIndex: 'bill.is_code',
     width: 130,
     customRender({ record }) {
       const options = ['否', '是'];
-      return options[record.isCode];
+      return options[record['bill.is_code']];
     },
     sorter: true,
   },
   {
     title: '备注',
-    dataIndex: 'remark',
+    dataIndex: 'bill.remark',
     width: 160,
     sorter: true,
   },
   {
     title: '交易日期',
-    dataIndex: 'tradetime',
+    dataIndex: 'bill.tradetime',
     width: 200,
     customRender({ record }) {
-      return moment(record.tradetime).format('YYYY-MM-DD');
+      return moment(record['bill.tradetime']).format('YYYY-MM-DD');
     },
     sorter: true,
   },

+ 3 - 1
src/views/money/bill/index.vue

@@ -156,7 +156,7 @@
 
       async function handleEdit(record: EditRecordRow) {
         popupData.title = '编辑';
-        getBill({ id: record.id }).then((res) => {
+        getBill({ id: record['bill.id'] }).then((res) => {
           const data = res.row;
           console.log(`edit data`, data);
           openPopup(true, data);
@@ -303,9 +303,11 @@
   .vben-basic-table-header__toolbar {
     justify-content: space-between;
   }
+
   .tool-btn-wrap {
     flex: 1;
   }
+
   .tool-btn-wrap button {
     margin-right: 5px;
   }

+ 9 - 9
src/views/money/dues/data.ts

@@ -8,7 +8,7 @@ const adaptWidth = adapt();
 export const columns: BasicColumn[] = [
   {
     title: 'ID',
-    dataIndex: 'id',
+    dataIndex: 'dues.id',
     editComponentProps: {
       prefix: '$',
     },
@@ -17,44 +17,44 @@ export const columns: BasicColumn[] = [
   },
   {
     title: '会费年份',
-    dataIndex: 'year',
+    dataIndex: 'dues.year',
     width: 90,
     sorter: true,
   },
   {
     title: '会员职务',
-    dataIndex: 'duty',
+    dataIndex: 'dues.duty',
     width: 130,
     customRender({ record }) {
       const options = ['会长', '副会长', '秘书长', '副秘书长', '理事', '会员'];
-      return options[record.duty];
+      return options[record['dues.duty']];
     },
     sorter: true,
   },
   {
     title: '金额',
-    dataIndex: 'money',
+    dataIndex: 'dues.money',
     width: 160,
     sorter: true,
   },
   {
     title: '操作员',
-    dataIndex: 'manager',
+    dataIndex: 'admin.nickname',
     width: 150,
     sorter: true,
   },
   {
     title: '备注',
-    dataIndex: 'remark',
+    dataIndex: 'dues.remark',
     width: 160,
     sorter: true,
   },
   {
     title: '创建日期',
-    dataIndex: 'createtime',
+    dataIndex: 'dues.createtime',
     width: 160,
     customRender({ record }) {
-      return moment(record.createtime * 1000).format('YYYY-MM-DD HH:mm:ss');
+      return moment(record['dues.createtime'] * 1000).format('YYYY-MM-DD HH:mm:ss');
     },
     sorter: true,
   },

+ 5 - 3
src/views/money/dues/index.vue

@@ -164,7 +164,7 @@
 
       async function handleEdit(record: EditRecordRow) {
         popupData.title = '编辑';
-        getDues({ id: record.id }).then((res) => {
+        getDues({ id: record['dues.id'] }).then((res) => {
           const data = res.row;
           console.log(`data`, data);
           openPopup(true, data);
@@ -173,7 +173,7 @@
 
       async function handleDelete(record: Recordable) {
         console.log(record);
-        await deleteDues({ id: record.id }).then((res) => {
+        await deleteDues({ id: record['dues.id'] }).then((res) => {
           console.log(res);
           getTableAction().reload();
           success('删除成功!');
@@ -182,7 +182,7 @@
 
       async function handleCopy(record: Recordable) {
         console.log(record);
-        await copyDues({ id: record.id }).then((res) => {
+        await copyDues({ id: record['dues.id'] }).then((res) => {
           console.log(res);
           getTableAction().reload();
           success('复制成功!');
@@ -372,9 +372,11 @@
   .vben-basic-table-header__toolbar {
     justify-content: space-between;
   }
+
   .tool-btn-wrap {
     flex: 1;
   }
+
   .tool-btn-wrap button {
     margin-right: 5px;
   }