john hai 8 meses
pai
achega
54768054fb

+ 12 - 1
DB/cashbook.sql

@@ -79,4 +79,15 @@ CREATE TABLE `record_files` (
   `create_time` timestamp NOT NULL,
   `update_time` timestamp NOT NULL,
   PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
+-- ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
+
+-- cashbook.record definition
+CREATE TABLE `more_record` (
+  `id` int NOT NULL AUTO_INCREMENT,
+  `book_id` varchar(100) NOT NULL,
+  `create_time` timestamp NOT NULL COMMENT '创建流程',
+  `update_time` timestamp NOT NULL COMMENT '更新时间',
+  `author_id` varchar(300) NOT NULL,
+  `name` varchar(300) DEFAULT NULL,
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='更多账本记录';

+ 2 - 2
frontEndMobile/src/api/http.ts

@@ -10,8 +10,8 @@ import 'nprogress/nprogress.css'
 // 创建一个 Axios 实例
 const http: AxiosInstance = axios.create({
   // baseURL: window.origin, // 替换为你的 API 基础 URL
-  // baseURL: 'http://192.168.2.101:6833', // 替换为你的 API 基础 URL
-  baseURL: 'http://127.0.0.1:3000', // 替换为你的 API 基础 URL
+  baseURL: 'http://192.168.2.101:6833', // 替换为你的 API 基础 URL
+  // baseURL: 'http://127.0.0.1:3000', // 替换为你的 API 基础 URL
   timeout: 10000, // 请求超时时间
   headers: {
     'Content-Type': 'application/json'

+ 24 - 0
frontEndMobile/src/router/routes/modules/common.ts

@@ -35,6 +35,30 @@ const routes: RouteRecordRaw[] = [
     },
     component: () => import('@/views/AddAccountLogPage.vue')
   },
+  {
+    path: '/add_more_log',
+    name: 'add_more_log',
+    meta: {
+      title: '添加批量记录'
+    },
+    component: () => import('@/views/AddMoreLogPage.vue')
+  },
+  {
+    path: '/more_log_list',
+    name: 'more_log_list',
+    meta: {
+      title: '批量记录列表'
+    },
+    component: () => import('@/views/MoreLogListPage.vue')
+  },
+  {
+    path: '/edit_more_log',
+    name: 'edit_more_log',
+    meta: {
+      title: '编辑批量记录'
+    },
+    component: () => import('@/views/AddMoreLogPage.vue')
+  },
   {
     path: '/edit_accountLog/:id',
     name: 'edit_accountLog',

+ 5 - 0
frontEndMobile/src/views/AddMoreLogPage.vue

@@ -0,0 +1,5 @@
+<template>
+  <div>
+iii
+  </div>
+</template>

+ 3 - 0
frontEndMobile/src/views/MePage.vue

@@ -25,6 +25,9 @@ const toPage = (item) => {
     case '账本管理':
       router.push('/books')
       break
+    case '批量记录':
+      router.push('/more_log_list')
+      break
   }
 }
 </script>

+ 34 - 0
frontEndMobile/src/views/MoreLogListPage.vue

@@ -0,0 +1,34 @@
+<template>
+  <div>list</div>
+  <div :offset-bottom="10" position="bottom" class="add-box">
+    <div class="add-bg" @click="toAdd">
+      <van-icon name="add-o" size="45" />
+    </div>
+  </div>
+</template>
+
+<script setup>
+const toAdd = () => {
+  console.log(15)
+}
+</script>
+
+
+<style lang="scss" scoped>
+.add-box {
+  text-align: right;
+  padding-right: 12px;
+  position: fixed;
+  bottom: 30px;
+  right: 12px;
+  .add-bg {
+    border-radius: 50%;
+    background-color: aqua;
+    display: inline-block;
+    // padding: 5px;
+    color: #000;
+    text-align: center;
+    line-height: 1;
+  }
+}
+</style>

+ 1 - 0
node_expores/db/index.js

@@ -1,5 +1,6 @@
 export * from './files.js';
 export * from './auth.js';
 export * from './record.js';
+export * from './more_record.js';
 export * from './type.js';
 export * from './book.js';

+ 25 - 0
node_expores/db/more_record.js

@@ -0,0 +1,25 @@
+import connection from "./base.js";
+
+export async function addMoreRecord({
+  name = '',
+  book_id = '',
+  author_id = '',
+  create_time = '',
+  update_time = '',
+}) {
+  return new Promise(async (resolve, reject) => {
+    try {
+      const sql = `
+        INSERT INTO more_record (name, book_id, author_id, create_time, update_time)
+        VALUES (?, ?, ?, ?, ?)
+      `;
+      const values = [name, book_id, author_id, create_time, update_time];
+      // 直接接收 execute 返回的内容
+      connection.execute(sql, values, (result, fields) => {
+        return resolve(fields.insertId);
+      });
+    } catch (err) {
+      return resolve(false);
+    }
+  })
+}

+ 2 - 0
node_expores/db/update.sql

@@ -5,3 +5,5 @@ ALTER TABLE cashbook.authors DROP COLUMN mobile;
 ALTER TABLE cashbook.authors CHANGE email account varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL;
 ALTER TABLE cashbook.authors DROP COLUMN login_type;
 
+
+ALTER TABLE cashbook.record ADD source_id varchar(100) NULL;

+ 18 - 0
node_expores/router/record/more.js

@@ -0,0 +1,18 @@
+import express from "express";
+const router = express.Router();
+import { shanghaiTime, shanghaiTimeFormat } from "#utils";
+import { addMoreRecord } from "#db";
+
+
+// 添加单个账单记录
+router.post("/", async function (req, res) {
+  const {
+    book_id = "",
+    total_fee = 0,
+    type = "",
+    time = "",
+    remark = "",
+    files = [],
+    userInfo = {},
+  } = req.body;
+})