From a2c5def7cf9562312a54216bc195a6ea071a26c5 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期三, 21 一月 2026 17:38:36 +0800
Subject: [PATCH] 2026.1.21

---
 pages/mLedger/behaviors/bUploadLedger.js |  133 +++++++++++++++++++++++++++-----------------
 1 files changed, 82 insertions(+), 51 deletions(-)

diff --git a/pages/mLedger/behaviors/bUploadLedger.js b/pages/mLedger/behaviors/bUploadLedger.js
index 21f2c97..7077420 100644
--- a/pages/mLedger/behaviors/bUploadLedger.js
+++ b/pages/mLedger/behaviors/bUploadLedger.js
@@ -1,9 +1,9 @@
-import bUpload from "../../../base/behaviors/bUpload"
-import ledgerservice from"../../../service/ledgerservice"
-import bLoadingStatus from '../../../base/behaviors/bLoadingStatus'
-import moment from '../../../utils/moment.min'
+import bUpload from '../../../base/behaviors/bUpload';
+import ledgerservice from '../../../service/ledgerservice';
+import bLoadingStatus from '../../../base/behaviors/bLoadingStatus';
+import moment from '../../../utils/moment.min';
 
-const app = getApp()
+const app = getApp();
 
 /**
  * 鍙拌处涓婁紶绠$悊
@@ -11,65 +11,96 @@
 module.exports = Behavior({
   behaviors: [bUpload, bLoadingStatus],
   data: {
+    // 鍙拌处绫诲瀷
     ledger: {},
+    // 鍙拌处璇︽儏
+    detail: undefined,
     remark: '',
   },
   methods: {
     _uploadLedger() {
-      if (this.data.imgFiles.length == 0) return
-      
-      var that = this
-      let path = []
-      this.data.imgFiles.forEach(f => {
-        path.push(f.url)
-      });
-      let ledger = this.data.ledger
-      ledger.remark1 = this.data.remark
+      if (this.data.imgFiles.length == 0) return;
 
-      this.setData({loading: true})
-      ledgerservice.uploadLedger(app.globalData.accessToken.userId, ledger, path, {
-        success (res) {
-          that.setData({loading: false})
-          if (typeof that._success === 'function') {
-            that._success(res)
-          }
+      var that = this;
+      let path = [];
+      this.data.imgFiles.forEach(f => {
+        path.push(f.url);
+      });
+      let ledger = this.data.ledger;
+      ledger.remark1 = this.data.remark;
+      if (this.data.detail) {
+        ledger.id = this.data.detail.id
+      }
+
+      this.setData({ loading: true });
+      ledgerservice.uploadLedger(
+        app.globalData.accessToken.userId,
+        ledger,
+        path,
+        {
+          success(res) {
+            that.setData({ loading: false });
+            if (typeof that._success === 'function') {
+              that._success(res);
+            }
+          },
+          fail(err) {
+            that.setData({ loading: false });
+            // wx.showToast({
+            //   title: '涓婁紶澶辫触',
+            //   duration: 1000,
+            //   icon: 'none',
+            //   mask: true,
+            // })
+          },
+          complete(res) {},
         },
-        fail(err) {
-          that.setData({loading: false})
-          // wx.showToast({
-          //   title: '涓婁紶澶辫触',
-          //   duration: 1000,
-          //   icon: 'none',
-          //   mask: true,
-          // })
-        },
-        complete (res) {
-        }
-      })
+      );
     },
 
     _uploadNoLedger() {
-      var that = this
-      const time = moment().format('YYYY-MM-DD')
-      const idList = [this.data.ledger.ledgerSubTypeId]
-      this.setData({loading: true})
-      ledgerservice.uploadNoLedger(app.globalData.accessToken.userId, time, idList, {
-        success (res) {
-          that.setData({loading: false})
-          if (typeof that._success === 'function') {
-            that._success(res)
+      var that = this;
+      const time = moment().format('YYYY-MM-DD');
+      const idList = [this.data.ledger.ledgerSubTypeId];
+      this.setData({ loading: true });
+      ledgerservice.uploadNoLedger(
+        app.globalData.accessToken.userId,
+        time,
+        this.data.remark,
+        idList,
+        {
+          success(res) {
+            that.setData({ loading: false });
+            if (typeof that._success === 'function') {
+              that._success(res);
+            }
+          },
+          fail(err) {
+            that.setData({ loading: false });
+            // wx.showToast({
+            //   title: '涓婁紶澶辫触',
+            //   duration: 1000,
+            //   icon: 'none',
+            //   mask: true,
+            // })
+          },
+        },
+      );
+    },
+
+    _uploadCopyLedger(copyLedgerList) {
+      const time = moment().format('YYYY-MM');
+      ledgerservice.copyLedger(app.globalData.accessToken.userId, time,copyLedgerList, {
+        success:res=>{
+          this.setData({ loading: false });
+          if (typeof this._success === 'function') {
+            this._success(res);
           }
         },
         fail(err) {
-          that.setData({loading: false})
-          // wx.showToast({
-          //   title: '涓婁紶澶辫触',
-          //   duration: 1000,
-          //   icon: 'none',
-          //   mask: true,
-          // })
+          this.setData({ loading: false });
         },
       })
     }
-  }
-})
\ No newline at end of file
+  },
+});

--
Gitblit v1.9.3