Browse Source

feat: 费用模块字段修改

LAPTOP-2ACP37JG\shark 4 years ago
parent
commit
6e02445547

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

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

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

@@ -156,7 +156,7 @@
 
       async function handleEdit(record: EditRecordRow) {
         popupData.title = '编辑';
-        getBill({ id: record['bill.id'] }).then((res) => {
+        getBill({ id: record.id }).then((res) => {
           const data = res.row;
           console.log(`edit data`, data);
           openPopup(true, data);

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

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

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

@@ -164,7 +164,7 @@
 
       async function handleEdit(record: EditRecordRow) {
         popupData.title = '编辑';
-        getDues({ id: record['dues.id'] }).then((res) => {
+        getDues({ id: record.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['dues.id'] }).then((res) => {
+        await deleteDues({ id: record.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['dues.id'] }).then((res) => {
+        await copyDues({ id: record.id }).then((res) => {
           console.log(res);
           getTableAction().reload();
           success('复制成功!');