From f511c392b0ee495502e7a107e4d8de081af6f2d2 Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期日, 04 一月 2026 10:18:28 +0800
Subject: [PATCH] Merge branch 'Dev' of http://101.37.171.70:10101/r/~jhz/STUWMS into Dev

---
 manifest.json                                   |    3 
 pages.json                                      |    7 
 main.js                                         |   79 ++-
 utils/i18n.js                                   |   72 +++
 pages/index/login.vue                           |    6 
 .hbuilderx/launch.json                          |    4 
 pages/ZLGL/zaikujianyandan/InStockCheckBill.vue |  904 ++++++++++++++++++++++++++++++++++++++++++++++++++
 7 files changed, 1,030 insertions(+), 45 deletions(-)

diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json
index 4dd14cd..a7d9080 100644
--- a/.hbuilderx/launch.json
+++ b/.hbuilderx/launch.json
@@ -21,11 +21,11 @@
             "type" : "uni-app:app-ios"
         },
         {
-            "customPlaygroundType" : "device",
+            "customPlaygroundType" : "local",
             "localRepoPath" : "D:/WorkBench/ZY_APP_Dev/STUWMS/unpackage/debug",
             "openVueDevtools" : true,
             "packageName" : "com.shebeiguanli.www",
-            "playground" : "standard",
+            "playground" : "custom",
             "type" : "uni-app:app-android"
         }
     ]
diff --git a/main.js b/main.js
index 6bd543f..aade6d2 100644
--- a/main.js
+++ b/main.js
@@ -1,32 +1,37 @@
 // 瀵煎叆i18n鏂囦欢
 import en from "./locale/en.json"
 import ZhCN from "./locale/zh-Hans.json"
+import {
+    addMissingKeyToMap
+} from "@/utils/i18n.js"
 
 // 鍔犺浇鏈湴璇█鍖�
 const messages = {
-	"zh-Hans":ZhCN,
-	en,
+    "zh-Hans": ZhCN,
+    en,
 }
 
 let i18nConfig = {
-  locale: uni.getLocale(),// 鑾峰彇宸茶缃殑璇█
-  messages,
-  silentTranslationWarn: true,
-  missing: function(locale, key, vm, values){
-    // 椤甸潰涓惈鏈夎瑷�鍖呬腑涓嶅瓨鍦ㄧ殑瀛楁锛岄渶鍚屾鍒版暟鎹簱涓�
-      console.log("[i18n]: 椤甸潰涓璳ey涓�: ", key ,"鐨勫瓧娈靛湪缈昏瘧鏂囦欢涓笉瀛樺湪锛屽悓姝ュ埌鏁版嵁搴�...")
-  
-    // 涓洪檷浣庡悓姝ョ殑闅惧害锛孉PP涓� 瀵圭炕璇戞ā鍧楃殑key 涓嶉噰鐢ㄦ暟缁勭殑鍐欐硶锛岀粺涓�浣跨敤 妯″潡鍚�.瀛楁鍚嶇殑鍐欐硶
-  }
+    locale: uni.getLocale(), // 鑾峰彇宸茶缃殑璇█
+    messages,
+    silentTranslationWarn: true,
+    
+    // missing: function(locale, key, vm, values){
+    //   // 椤甸潰涓惈鏈夎瑷�鍖呬腑涓嶅瓨鍦ㄧ殑瀛楁锛岄渶鍚屾鍒版暟鎹簱涓�
+    //     console.log("[i18n]: 椤甸潰涓璳ey涓�: ", key ,"鐨勫瓧娈靛湪缈昏瘧鏂囦欢涓笉瀛樺湪锛屽悓姝ュ埌鏁版嵁搴�...")
+    // 
+    //   // 涓洪檷浣庡悓姝ョ殑闅惧害锛孉PP涓� 瀵圭炕璇戞ā鍧楃殑key 涓嶉噰鐢ㄦ暟缁勭殑鍐欐硶锛岀粺涓�浣跨敤 妯″潡鍚�.瀛楁鍚嶇殑鍐欐硶
+    //   let [HMouldName, HFieldKey] = key.split('.')
+    //   
+    //   
+    // }
 }
-
-
 
 import App from './App'
 import Printer from './plugins/printer'
 Vue.use(Printer);
 // 鐢熶骇鐜
- // Vue.prototype.serverUrl = "https://qqyapi.xinlinsoft.cn/qqy-api";
+// Vue.prototype.serverUrl = "https://qqyapi.xinlinsoft.cn/qqy-api";
 // 寮�鍙戠幆澧�
 // Vue.prototype.serverUrl = "http://47.96.97.237/API";
 
@@ -41,9 +46,23 @@
 // #ifndef VUE3
 import Vue from 'vue'
 import VueI18n from 'vue-i18n'
-
 Vue.use(VueI18n)
 const i18n = new VueI18n(i18nConfig)
+// TODO missing鍥炶皟鏃犳硶婊¤冻 鍔犺浇绾夸笂鍖� 鍚庣殑妫�楠屽姛鑳斤紝闇�閲嶅啓$t鍑芥暟
+const originalT = Vue.prototype.$t
+Vue.prototype.$t = function(key, ...args) {
+    // 璋冪敤鍘熷 $t 鎵ц缈昏瘧
+    const translated = originalT.call(this, key, args);
+    
+    // console.log(i18n.getLocaleMessage(i18n.locale))
+    if (translated == key) {
+        // 缈昏瘧鍚庣殑鏂囨湰涓庝紶鍏ョ殑key鐩稿悓锛屽垯琛ㄧず缈昏瘧鏂囨湰缂哄け 璁板綍缂哄け鐨勭炕璇戞枃鏈�
+        let [moduleName, fieldCode] = key.split(".")
+        addMissingKeyToMap(moduleName, fieldCode)
+    }
+
+    return translated
+}
 Vue.config.productionTip = false
 App.mpType = 'app'
 const app = new Vue({
@@ -55,25 +74,29 @@
 // #endif
 
 // #ifdef VUE3
-import { createSSRApp } from 'vue'
-import { createI18n } from 'vue-i18n'// v9.x
+import {
+    createSSRApp
+} from 'vue'
+import {
+    createI18n
+} from 'vue-i18n' // v9.x
 const i18n = createI18n(i18nConfig)
 export function createApp() {
-  const app = createSSRApp(App)
-  app.use(i18n)
-  return {
-    app
-  }
+    const app = createSSRApp(App)
+    app.use(i18n)
+    return {
+        app
+    }
 }
 export default i18n
 // #endif
 // main.js uni.showToast 瀹炵幇鍏ㄥ眬鎷︽埅璁剧疆榛樿鎻愮ず鏃堕棿涓�3.5绉�
 const originalShowToast = uni.showToast;
 uni.showToast = (options) => {
-  originalShowToast({
-    duration: options.duration || 3500, // 榛樿2绉�
-    icon: options.icon || 'none',
-	title: options.title || 'none',
-    ...options
-  });
+    originalShowToast({
+        duration: options.duration || 3500, // 榛樿2绉�
+        icon: options.icon || 'none',
+        title: options.title || 'none',
+        ...options
+    });
 };
\ No newline at end of file
diff --git a/manifest.json b/manifest.json
index 0a8c7d8..2a13fb6 100644
--- a/manifest.json
+++ b/manifest.json
@@ -163,5 +163,6 @@
         //鑷劧鏂瑰悜
         "default"
     ],
-    "locale" : "zh-Hans"
+    "locale" : "zh-Hans",
+    "fallbackLocale" : "zh-Hans"
 }
diff --git a/pages.json b/pages.json
index cda6fea..c13608c 100644
--- a/pages.json
+++ b/pages.json
@@ -1403,6 +1403,13 @@
                 "navigationBarTitleText": "杞﹂棿鑷鍗曞垪琛�",
 				"enablePullDownRefresh": true            
             }
+        },
+        {
+            "path" : "pages/ZLGL/zaikujianyandan/InStockCheckBill",
+            "style" : 
+            {
+                "navigationBarTitleText" : "鍦ㄥ簱妫�楠屽崟"
+            }
         }
         
     ],
diff --git a/pages/ZLGL/zaikujianyandan/InStockCheckBill.vue b/pages/ZLGL/zaikujianyandan/InStockCheckBill.vue
new file mode 100644
index 0000000..af59c42
--- /dev/null
+++ b/pages/ZLGL/zaikujianyandan/InStockCheckBill.vue
@@ -0,0 +1,904 @@
+<template>
+    <view>
+        <!-- 鍩虹淇℃伅濉啓 -->
+        <view class="bill-main-area">
+            <view class="bill-main-content">
+                <!-- 鍩烘湰淇℃伅 -->
+                <view class="form-item">
+                    <view class="title">鏉$爜:</view>
+                    <view class="right">
+                        <input :focus="barCodeFocus" v-model="hform.HBarCode" placeholder="璇锋壂鎻�(鎴栬緭鍏�)鏉$爜"
+                            @confirm="getCode(hform.HBarCode)" />
+                    </view>
+                    <uni-icons type="scan"
+                        style="margin-left: 10rpx;background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;"
+                        size="20" @click="toScanCode"></uni-icons>
+                </view>
+                <view class="form-item">
+                    <view class="title">鏁伴噺:</view>
+                    <view class="right">
+                        <input v-model="hform.HQty" />
+                    </view>
+                </view>
+                <view class="form-item">
+                    <view class="title">妫�楠岀粨鏋�:</view>
+                    <view>
+                        <radio-group name="QualityCheck" @change="HCheckResuleChangeHandler">
+                            <label>
+                                <radio value="姝e父" :checked="hform.HCheckResult == '姝e父'" /><text>鍚堟牸</text>
+                            </label>
+                            <view style="width: 1em;display: inline-block;"></view>
+                            <label>
+                                <radio value="寮傚父" :checked="hform.HCheckResult == '寮傚父'" /><text>涓嶅悎鏍�</text>
+                            </label>
+                        </radio-group>
+                    </view>
+                </view>
+                <view class="form-item">
+                    <view class="title">鍗曟嵁鏃ユ湡:</view>
+                    <view class="right disabled">
+                        <input v-model="hform.HDate" disabled />
+                    </view>
+                </view>
+                <view class="form-item">
+                    <view class="title">鍗曟嵁鍙�:</view>
+                    <view class="right disabled">
+                        <input v-model="hform.HBillNo" disabled />
+                    </view>
+                </view>
+                <view class="form-item">
+                    <view class="title">鐗╂枡浠g爜:</view>
+                    <view class="right disabled">
+                        <input v-model="hform.HMaterNumber" disabled />
+                    </view>
+                </view>
+                <view class="form-item">
+                    <view class="title">鐗╂枡鍚嶇О:</view>
+                    <view class="right disabled">
+                        <input v-model="hform.HMaterName" disabled />
+                    </view>
+                </view>
+                <view class="form-item">
+                    <view class="title">瑙勬牸鍨嬪彿:</view>
+                    <view class="right disabled">
+                        <input v-model="hform.HModel" disabled />
+                    </view>
+                </view>
+                <view class="form-item">
+                    <view class="title">璁¢噺鍗曚綅:</view>
+                    <view class="right disabled">
+                        <input v-model="hform.HUnitName" disabled />
+                    </view>
+                </view>
+            </view>
+        </view>
+
+        <view class="bill-sub-area">
+            <view class="bill-sub-tabs">
+                <view :class="tabs == 1 ? 'selected':''" @tap="tabs = 1">鐗╂枡淇℃伅</view>
+                <view :class="tabs == 2 ? 'selected':''" @tap="tabs = 2">鏉$爜淇℃伅</view>
+            </view>
+            <view class="bill-main-contents">
+                <!-- 鏉$爜缂撳瓨 -->
+                <view v-if="tabs == 2">
+                    <view class="over" v-if="BarCodeList.length == 0">
+                        鏆傛棤鏁版嵁
+                    </view>
+                    <view v-else class="list" v-for="(item,index) in BarCodeList" :key="index">
+                        <uni-card style="margin: 10px;" @tap="dalBarCodeCache(item , index)">
+                            <view class="card-detail">
+                                <view class="detail">
+                                    <text>鏉$爜缂栧彿锛�</text>{{item.HBarCode}}
+                                </view>
+                                <view class="detail">
+                                    <text>婧愬崟鍗曞彿锛�</text>{{item.HSourceBillNo}}
+                                </view>
+                                <view class="detail">
+                                    <text>鏁伴噺锛�</text>{{item.HQty}}
+                                </view>
+                                <view class="detail">
+                                    <text>鐗╂枡浠g爜锛�</text>{{item.HMaterNumber}}
+                                </view>
+                                <view class="detail">
+                                    <text>鐗╂枡鍚嶇О锛�</text>{{item.HMaterName}}
+                                </view>
+                                <view class="detail">
+                                    <text>瑙勬牸鍨嬪彿锛�</text>{{item.HModel}}
+                                </view>
+                                <view class="detail">
+                                    <text>璁¢噺鍗曚綅锛�</text>{{item.HUnitName}}
+                                </view>
+                                <view class="detail">
+                                    <text>鏉$爜鐘舵�侊細</text>{{item.HBarCodeState}}
+                                </view>
+                            </view>
+                        </uni-card>
+                    </view>
+                </view>
+                <!-- 鐗╂枡缂撳瓨 -->
+                <view v-if="tabs == 1">
+                    <view class="over" v-if="Object.keys(Materlist).length == 0">
+                        鏆傛棤鏁版嵁
+                    </view>
+                    <view v-else class="list" v-for="(item,index) in Materlist" :key="index">
+                        <uni-card :title="item.HMaterName" :extra="item.HMaterNumber" style="margin: 10px;"
+                            @tap="showBarCodeCache(item.HMaterNumber)">
+                            <view class="card-detail">
+                                <view class="detail">
+                                    <text>婧愬崟鍗曞彿锛�</text>{{item.HSourceBillNo}}
+                                </view>
+                                <view class="detail">
+                                    <text>鍚堟牸鏁伴噺锛�</text>{{item.HRightQty}}
+                                </view>
+                                <view class="detail">
+                                    <text>涓嶅悎鏍兼暟閲忥細</text>{{item.HBadQty}}
+                                </view>
+                            </view>
+                        </uni-card>
+                    </view>
+                </view>
+            </view>
+        </view>
+        <view style="height: 120rpx;"></view>
+        <view class="bottom-btn">
+            <button class="btn-a" size="mini" @tap="submit">鎻愪氦</button>
+            <view style="flex: 1;"></view>
+            <button class="btn-a" size="mini" @tap="addNew">鏂板</button>
+            <button class="btn-c" size="mini" @tap="goBack">閫�鍑�</button>
+        </view>
+    </view>
+</template>
+
+<script>
+    import dayjs from "dayjs";
+    import {
+        getUserInfo
+    } from "../../../utils/auth";
+    import {
+        CommonUtils
+    } from "../../../utils/common";
+    import {
+        MpaasScan
+    } from "@/utils/mpaasScan.js"
+    export default {
+        name: "InStockCheckBill",
+        components: {},
+        data() {
+            return {
+                tabs: 1,
+                barCodeFocus: false,
+                HModName: "QC_InStockChechBill",
+                HBillType: "7526",
+                hform: {
+                    HInterID: 0,
+                    HBarCode: "",
+                    HQty: 0,
+                    HBillType: "7526",
+                    HCheckResult: '姝e父',
+                    HDate: dayjs(new Date()).format("YYYY-MM-DD"),
+                    HBillNo: "",
+                    HMaterNumber: "",
+                    HMaterName: "",
+                    HMaterModel: "",
+                    HUnitName: "",
+                    HUser: uni.getStorageSync("HEmpID")
+                },
+                Materlist: {}, // 鐗╂枡缂撳瓨锛岀敤鐗╂枡浠g爜浣滀负key锛屽叾涓繚瀛樼殑鍚堟牸鏁伴噺鍜屼笉鍚堟牸鏁伴噺鐩稿姞涓�0鍒欎粠缂撳瓨涓垹鍘�
+                BarCodeList: [], // 鏉$爜缂撳瓨
+            };
+        },
+        onLoad() {
+            this.getMaxBillNo()
+        },
+        methods: {
+            addNew() {
+                uni.redirectTo({
+                    url: "/pages/ZLGL/zaikujianyandan/InStockCheckBill?OperationType=1"
+                })
+            },
+            async submit() {
+                if (this.hform.HInterID == 0 || !this.hform.HInterID) {
+                    uni.showToast({
+                        title: '鍗曟嵁鍐呯爜鑾峰彇澶辫触锛岄敊璇殑鍗曟嵁鍐呯爜锛�',
+                        icon: 'none'
+                    })
+                } else if (!this.hform.HBillNo) {
+                    uni.showToast({
+                        title: '鍗曟嵁鍙疯幏鍙栧け璐ワ紝閿欒鐨勫崟鎹彿锛�',
+                        icon: 'none'
+                    })
+                } else if (!this.Materlist || this.Materlist.length == 0) {
+                    uni.showToast({
+                        title: '娌℃湁鎵爜淇℃伅锛岃鍏堟壂鎻忔潯鐮侊紝纭鏃犺鍚庡啀鎻愪氦锛�',
+                        icon: 'none'
+                    })
+                } else {
+
+                    this.hform.HYear = dayjs(this.hform.HDate).year()
+                    this.hform.HPeriod = dayjs(this.hform.HDate).month()
+                    let sMainSub = {
+                        sMain: this.hform,
+                        sSub: this.Materlist
+                    }
+
+                    try {
+                        let res = await CommonUtils.doRequest2Sync({
+                            url: '/QC_InStockCheckBill/saveBill',
+                            method: 'POST',
+                            data: sMainSub
+                        })
+
+                        if (!res) {
+                            return
+                        }
+
+                        console.log(1, res);
+                        uni.hideLoading()
+                        if (res.data.count == 1) {
+                            uni.showModal({
+                                title: '鎻愮ず',
+                                content: res.data.Message + '銆傛槸鍚︾户缁柊澧烇紵',
+                                success: (res) => {
+                                    if (res.confirm) {
+                                        console.log('鐢ㄦ埛鐐瑰嚮纭畾');
+                                        uni.redirectTo({
+                                            url: '/pages/ZLGL/zaikujianyandan/InStockCheckBill?OperationType=1'
+                                        })
+                                    } else if (res.cancel) {
+                                        console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
+
+                                    }
+                                }
+                            });
+                        } else {
+                            uni.showToast({
+                                title: res.data.Message,
+                                icon: 'none'
+                            })
+                        }
+                    } catch (err) {
+                        console.warn(err);
+                        uni.showToast({
+                            title: '鎺ュ彛璇锋眰澶辫触:' + err,
+                            icon: 'none'
+                        })
+                    }
+
+                }
+            },
+
+            goBack() {
+                uni.showModal({
+                    title: '鎻愮ず',
+                    content: '纭瑕侀��鍑哄綋鍓嶉〉闈㈠悧锛�',
+                    success: (res) => {
+                        if (res.confirm) {
+                            console.log('鐢ㄦ埛鐐瑰嚮纭畾');
+                            uni.navigateBack()
+                        } else if (res.cancel) {
+                            console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
+                        }
+                    }
+                });
+            },
+            async getMaxBillNo() {
+                try {
+                    let res = await CommonUtils.doRequest2Sync({
+                        url: "/Web/GetMAXNum",
+                        data: {
+                            HBillType: this.HBillType,
+                        },
+                    });
+
+                    if (!res) {
+                        return;
+                    }
+
+                    let {
+                        data,
+                        Message,
+                        count
+                    } = res.data;
+                    if (count == 1) {
+                        this.hform.HInterID = data[0].HInterID;
+                        this.hform.HBillNo = data[0].HBillNo;
+                    } else {
+                        throw Message;
+                    }
+                } catch (err) {
+                    CommonUtils.showTips({
+                        title: "娓╅Θ鎻愮ず",
+                        message: "鑾峰彇鍗曟嵁鍙峰紓甯�: " + err,
+                    });
+                }
+            },
+            dalBarCodeCache(item, index) {
+                console.log('item: ',item);
+                let Qty = this.BarCodeList[index]["HQty"]
+                let quit = false
+                let HBarCodeState = this.BarCodeList[index]["HBarCodeState"]
+                uni.showModal({
+                    title: "鎻愮ず",
+                    content: "鏄惁鍒犻櫎 鏉$爜 " + this.BarCodeList[index]["HBarCode"],
+                    success: async (res) => {
+                        if (res.confirm) {
+                            // if (HBarCodeState == '姝e父') {
+                            //     this.Materlist[HMaterNumber]["HRightQty"] -= Qty
+                            // } else if (HBarCodeState == '寮傚父') {
+                            //     this.Materlist[HMaterNumber]["HBadQty"] -= Qty
+                            // }
+
+                            // // 灏嗘潯鐮佽褰曚粠缂撳瓨涓垹闄�
+                            // this.Materlist[HMaterNumber]["HBarCodeCache"].splice(index, 1)
+                            // this.BarCodeList.splice(index, 1)
+                            // if (this.Materlist[HMaterNumber]["HBarCodeCache"].length == 0) {
+                            //     // 鐗╂枡璁板綍涓棤鏉$爜锛屽垯鍒犻櫎鐗╂枡璁板綍
+                            //     this.$delete(this.Materlist, HMaterNumber)
+                            // }
+                            let delRes = await CommonUtils.doRequest2Async({
+                                url: '/QC_InStockCheckBillController/set_DelPonderationBillMain_Temp_InterIDAndSource_Json',
+                                data: {
+                                    HItemID: item.HItemID,
+                                    HInterID: this.hform.HInterID,
+                                    HMaterID: item.HMaterID,
+                                    HAuxPropID: item.HAuxPropID || 0,
+                                    HMTONo: item.HMTONo || "",
+                                    HSourceInterID: item.HSourceInterID,
+                                    HSourceEntryID: item.HSourceEntryID,
+                                    HBillType: this.hform.HBillType
+                                },
+                            })
+                            console.log('delRes: ',delRes);
+                            if(delRes.data.count == 1) {
+                                this.Materlist = {}
+                                this.BarCodeList = []
+                                this.DisBillEntryList()
+                            }
+                        } else if (res.cancel) {
+                            quit = true
+                        }
+                    }
+                })
+
+                if (quit) {
+                    return
+                }
+            },
+            showBarCodeCache(key) {
+                this.BarCodeList = this.Materlist[key]["HBarCodeCache"]
+                this.tabs = 2
+            },
+            HCheckResuleChangeHandler({
+                detail
+            }) {
+                console.log('value: ', detail.value);
+                this.hform.HCheckResult = detail.value
+            },
+            async DisBillEntryList() {
+                try {
+                    let res = await CommonUtils.doRequest2Sync({
+                        url: "/QC_InStockCheckBillController/GetBillEntryTmpList_Json",
+                        data: {
+                            HInterID: this.hform.HInterID,
+                            HBillNo: this.hform.HBillNo,
+                            HBillType: this.hform.HBillType,
+                            HStockOrgID: uni.getStorageSync('OrganizationID')
+                        }
+                    })
+
+                    if (!res) {
+                        return
+                    }
+
+                    let {
+                        count,
+                        data,
+                        Message
+                    } = res.data
+                    if (count == 1) {
+                        console.log('data: ', data);
+                        
+                        this.BillEntryListPreProcess(data)
+                    } else {
+                        CommonUtils.showTips({
+                            title: "娓╅Θ鎻愮ず",
+                            message: `鑾峰彇鏉$爜鏄庣粏閿欒: ${Message}`
+                        })
+                    }
+                } catch (err) {
+                    CommonUtils.showTips({
+                        title: "娓╅Θ鎻愮ず",
+                        message: `鑾峰彇鏉$爜鏄庣粏閿欒: ${err}`
+                    })
+                }
+            },
+            BillEntryListPreProcess(data) {
+                // 璋冩暣鍥炰紶鐨勫崟鎹鍚� 鍓嶇鏄剧ず鐨勬牸寮�
+                let [
+                    materList,
+                    barCodeList
+                ] = data
+                let barCodeObj = {}
+                // 璋冩暣鏉$爜鍒楄〃
+                for (let i = 0; i < barCodeList.length; i++) {
+                    if (!barCodeObj[barCodeList[i]["HMaterNumber"]]) {
+                        barCodeObj[barCodeList[i]["HMaterNumber"]] = []
+                    }
+
+                    barCodeObj[barCodeList[i]["HMaterNumber"]].push({
+                        HBarCode: barCodeList[i]["HBarCode"],
+                        HSourceBillNo: barCodeList[i]["婧愬崟鍗曞彿"],
+                        HMaterID: barCodeList[i]["HMaterID"],
+                        HMaterNumber: barCodeList[i]["鐗╂枡浠g爜"],
+                        HMaterName: barCodeList[i]["鐗╂枡鍚嶇О"],
+                        HMaterModel: barCodeList[i]["瑙勬牸鍨嬪彿"],
+                        HQty: barCodeList[i]["鏁伴噺"],
+                        HAuxPropID: barCodeList[i]["HAuxPropID"],
+                        HMTONo:  barCodeList[i]["HMTONo"],
+                        HBarCodeState: barCodeList[i]["鏉$爜鐘舵��"],
+                        HItemID: barCodeList[i]["HItemID"],
+                        HSourceInterID: barCodeList[i]["HSourceInterID"],
+                        HSourceEntryID: barCodeList[i]["HSourceEntryID"]
+                    })
+
+                    // 璋冩暣鐗╂枡鍒楄〃
+                    for (let i = 0; i < materList.length; i++) {
+                        this.$set(this.Materlist, `${materList[i]["鐗╂枡浠g爜"]}`, {
+                            HSourceBillNo: materList[i]["婧愬崟鍗曞彿"],
+                            HMaterID: materList[i]["HMaterID"],
+                            HMaterNumber: materList[i]["鐗╂枡浠g爜"],
+                            HMaterName: materList[i]["鐗╂枡鍚嶇О"],
+                            HMaterModel: materList[i]["瑙勬牸鍨嬪彿"],
+                            HUnitName: materList[i]["璁¢噺鍗曚綅"],
+                            HInterID: materList[i]["HInterID"],
+                            HItemID: materList[i]["HItemID"],
+                            HRightQty: materList[i]["鍚堟牸鏁伴噺"],
+                            HBadQty: materList[i]["涓嶅悎鏍兼暟閲�"],
+                            HBarCodeCache: barCodeObj[materList[i]["鐗╂枡浠g爜"]]
+                        })
+                    }
+                }
+                
+                this.tabs = 1
+            },
+            toScanCode() {
+                MpaasScan.scanCode((code) => {
+                    if (code) {
+                        this.getCode(code);
+                    }
+                })
+            },
+            async getCode(HBarCode) {
+                // 甯﹀嚭鏉$爜淇℃伅
+                console.log('HBarCode: ', HBarCode);
+                try {
+
+                    // let res = await CommonUtils.doRequest2Sync({
+                    //     url: "/Gy_BarCodeBillList/page",
+                    //     data: {
+                    //         sWhere: ` and 鏉$爜缂栧彿=''${HBarCode}''`,
+                    //         user: getUserInfo()["Czymc"],
+                    //         page: 1,
+                    //         size: 50
+                    //     }
+                    // })
+
+                    let res = await CommonUtils.doRequest2Sync({
+                        url: "/QC_InStockCheckBill/getBarCode",
+                        data: {
+                            sBarCode: HBarCode,
+                            "HInterID": this.hform.HInterID,
+                            "HBillType": this.hform.HBillType,
+                            "HBillNo": this.hform.HBillNo,
+                            "HMaker": getUserInfo()["Czymc"],
+                            "HWhID": 0,
+                            "HSPID": 0,
+                            "HQty": 0,
+                            "HRedBlueFlag": false,
+                            "SourceFlag": true,
+                            "HSourceBillNo": "",
+                            "HSourceBillType": "",
+                            "HStockOrgID": uni.getStorageSync("OrganizationID"),
+                            "HScanStyle": "",
+                            "HCustom1": "",
+                            "HCustom2": "",
+                            sBarCodeStatus: this.hform.HCheckResult
+                        }
+                    })
+
+                    if (!res) {
+                        return
+                    }
+
+                    let {
+                        data,
+                        count,
+                        Message
+                    } = res.data
+
+                    if (count == 1) {
+                        console.log('data: ', data);
+                        let barCodeInfo = data[0]
+                        // 灞曠ず鏉$爜淇℃伅
+                        Object.assign(this.hform, {
+                            HBarCode: "",
+                            HQty: barCodeInfo["鏁伴噺"],
+                            HSourceBillNo: barCodeInfo["HSourceBillNo"],
+                            HMaterNumber: barCodeInfo["鐗╂枡浠g爜"],
+                            HMaterName: barCodeInfo["鐗╂枡鍚嶇О"],
+                            HMaterModel: barCodeInfo["瑙勬牸鍨嬪彿"],
+                        })
+
+                        this.DisBillEntryList()
+
+                        // 鏉$爜鏍规嵁褰撳墠鏄惁鍚堟牸 褰曞叆 鐗╂枡缂撳瓨
+                        // if (!this.Materlist[`${barCodeInfo["鐗╂枡浠g爜"]}`]) {
+                        //     this.$set(this.Materlist, `${barCodeInfo["鐗╂枡浠g爜"]}`, {
+                        //         HSourceBillNo: barCodeInfo["婧愬崟鍗曞彿"],
+                        //         HMaterID: barCodeInfo["HMaterID"],
+                        //         HMaterNumber: barCodeInfo["鐗╂枡浠g爜"],
+                        //         HMaterName: barCodeInfo["鐗╂枡鍚嶇О"],
+                        //         HMaterModel: barCodeInfo["瑙勬牸鍨嬪彿"],
+                        //         HUnitName: barCodeInfo["璁¢噺鍗曚綅"],
+                        //         HRightQty: 0,
+                        //         HBadQty: 0,
+                        //         HBarCodeCache: []
+                        //     })
+                        // }
+                        // 
+                        // if (this.hform.HCheckResult == '姝e父') {
+                        //     this.Materlist[`${barCodeInfo["鐗╂枡浠g爜"]}`]["HRightQty"] += barCodeInfo["鏁伴噺"]
+                        //     // 瀛樺叆鏉$爜缂撳瓨
+                        //     this.Materlist[`${barCodeInfo["鐗╂枡浠g爜"]}`]["HBarCodeCache"].push({
+                        //         HBarCode: HBarCode,
+                        //         HSourceBillNo: barCodeInfo["婧愬崟鍗曞彿"],
+                        //         HMaterNumber: barCodeInfo["鐗╂枡浠g爜"],
+                        //         HMaterName: barCodeInfo["鐗╂枡鍚嶇О"],
+                        //         HMaterModel: barCodeInfo["瑙勬牸鍨嬪彿"],
+                        //         HUnitName: barCodeInfo["璁¢噺鍗曚綅"],
+                        //         HQty: barCodeInfo["鏁伴噺"],
+                        //         HBarCodeState: '姝e父'
+                        //     })
+                        // } else {
+                        //     this.Materlist[`${barCodeInfo["鐗╂枡浠g爜"]}`]["HBadQty"] += barCodeInfo["鏁伴噺"]
+                        //     this.Materlist[`${barCodeInfo["鐗╂枡浠g爜"]}`]["HBarCodeCache"].push({
+                        //         HBarCode: HBarCode,
+                        //         HSourceBillNo: barCodeInfo["婧愬崟鍗曞彿"],
+                        //         HMaterNumber: barCodeInfo["鐗╂枡浠g爜"],
+                        //         HMaterName: barCodeInfo["鐗╂枡鍚嶇О"],
+                        //         HMaterModel: barCodeInfo["瑙勬牸鍨嬪彿"],
+                        //         HUnitName: barCodeInfo["璁¢噺鍗曚綅"],
+                        //         HQty: barCodeInfo["鏁伴噺"],
+                        //         HBarCodeState: '寮傚父'
+                        //     })
+                        // }
+                    } else {
+                        CommonUtils.showTips({
+                            titie: '娓╅Θ鎻愮ず',
+                            message: `鑾峰彇鏉$爜淇℃伅澶辫触: ${Message}`
+                        })
+                    }
+                } catch (err) {
+                    CommonUtils.showTips({
+                        titie: '娓╅Θ鎻愮ず',
+                        message: `鑾峰彇鏉$爜淇℃伅澶辫触: ${err}`
+                    })
+                }
+            }
+        }
+    }
+</script>
+
+<style lang="scss">
+    input {
+        width: inherit;
+        font-size: 26rpx;
+    }
+
+    .uni-input {
+        padding: 0;
+    }
+
+    .bill-main-tabs,
+    .bill-sub-tabs {
+        box-sizing: border-box;
+        width: 730rpx;
+        display: flex;
+        flex-direction: row;
+        flex-wrap: nowrap;
+        gap: 20rpx;
+        flex-shrink: 0;
+        overflow-x: auto;
+        border-bottom: 1px solid #ddd;
+        padding: 20rpx 10rpx;
+        white-space: nowrap;
+
+        view {
+            width: auto;
+            font-size: 26rpx;
+            color: #555;
+            text-align: center;
+            padding: 16rpx 0;
+        }
+
+        .selected {
+            color: #3a78ff;
+            font-weight: bold;
+            border-bottom: 3px solid #3a78ff;
+        }
+    }
+
+    .bill-main-content,
+    .bill-sub-content {
+        box-sizing: border-box;
+        padding: 0 30rpx 0 30rpx;
+        display: flex;
+        flex-direction: column;
+
+        .form-item {
+            width: 100%;
+            display: flex;
+            align-items: center;
+            font-size: 26rpx;
+            padding: 6rpx 0;
+
+            .title {
+                width: 5em;
+
+                text {
+                    color: red;
+                    font-weight: bold;
+                }
+            }
+
+            .right {
+                // width: 450rpx;
+                padding: 8rpx 20rpx;
+                font-size: 26rpx;
+                flex: 1;
+                border-radius: 22rpx;
+                border: 1px solid #acacac;
+
+                .uni-combox {
+                    padding: 0;
+                    height: auto;
+
+                    .uni-input-placeholder,
+                    .uni-input-input {
+                        font-size: 26rpx;
+                    }
+                }
+
+                .uni-combox::v-deep input {
+                    height: inherit;
+                    font-size: 26rpx;
+                }
+            }
+
+            .disabled {
+                border: 1px solid #e4e4e4;
+                background-color: #e4e4e4;
+            }
+
+            .none-border {
+                border: none;
+            }
+        }
+    }
+
+    .bottom-btn {
+        box-sizing: border-box;
+        width: 100%;
+        height: 120rpx;
+        position: fixed;
+        bottom: 0;
+        left: 0;
+        background-color: #fff;
+        box-shadow: 0 2rpx 10rpx 2rpx rgba(0, 0, 0, 0.4);
+        padding: 30rpx 40rpx 40rpx 40rpx;
+        display: flex;
+        flex-direction: row;
+        gap: 10rpx;
+
+        button {
+            border-radius: 50rpx;
+            width: 180rpx;
+            height: 66rpx;
+            line-height: 66rpx;
+            font-size: 28rpx;
+        }
+
+        .btn-a {
+            background-color: #3a78ff;
+            color: #fff;
+        }
+
+        .btn-b {
+            background-color: #41a863;
+            color: #fff;
+        }
+
+        .btn-c {
+            background-color: #acacac;
+            color: #fff;
+            // position: absolute;
+            // right: 120rpx;
+        }
+
+        .btn-d {
+            background-color: #ff8901;
+            color: #fff;
+        }
+    }
+
+    .buttons {
+        box-sizing: border-box;
+        width: 100%;
+        display: flex;
+        justify-content: center;
+        padding: 10rpx 0;
+
+        button {
+            border-radius: 50rpx;
+            width: 180rpx;
+            height: 66rpx;
+            line-height: 66rpx;
+            font-size: 26rpx;
+        }
+
+        .btn-a {
+            background-color: #acacac;
+            color: #fff;
+        }
+
+        .btn-b {
+            background-color: #41a863;
+            color: #fff;
+        }
+
+        .btn-c {
+            background-color: #3a78ff;
+            color: #fff;
+        }
+    }
+
+    .list {
+        width: 100%;
+
+        .card-detail {
+            width: 100%;
+            display: flex;
+            flex-wrap: wrap;
+            justify-content: space-between;
+            align-items: center;
+            line-height: 120%;
+            gap: 10rpx 0;
+
+            input {
+                font-size: 26rpx;
+            }
+
+            .detail {
+                // width: 50%;
+                box-sizing: border-box;
+                font-size: 26rpx;
+                color: #555;
+                padding-right: 20rpx;
+
+                text {
+                    color: #999;
+                    font-size: 26rpx;
+                }
+            }
+
+            .editable {
+                width: 50%;
+                display: inline-flex;
+                flex-direction: row;
+                align-items: center;
+
+                text {
+                    flex-shrink: 0;
+                }
+
+                .sampleDestory {
+                    border: 1px solid #acacac;
+                    border-radius: 5rpx;
+                    padding: 0 12rpx;
+                }
+            }
+        }
+    }
+
+    .icon-wrapper {
+        background-color: #3a78ff;
+        border-radius: 100%;
+        width: 40rpx;
+        height: 40rpx;
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        flex-shrink: 0;
+
+        .uni-icons {
+            color: #fff !important;
+        }
+    }
+
+    .icon-wrapper-big {
+        background-color: #3a78ff;
+        border-radius: 100%;
+        width: 50rpx;
+        height: 50rpx;
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        flex-shrink: 0;
+        margin-left: 20rpx;
+
+        .uni-icons {
+            color: #fff !important;
+        }
+    }
+
+    .more {
+        color: #888;
+        font-size: 22rpx;
+        display: flex;
+        border-top: 1px solid #eee;
+        padding-top: 10rpx;
+
+        .part {
+            width: 100%;
+            text-align: center;
+        }
+    }
+
+    .pass-background {
+        background-color: #cee3f2;
+        border: none;
+    }
+
+    .unpass-background {
+        background-color: #f0d6e3;
+        border: none;
+    }
+
+    .list {
+        width: 100%;
+
+        .card-detail {
+            width: 100%;
+            display: flex;
+            flex-wrap: wrap;
+            justify-content: space-between;
+            line-height: 120%;
+
+            .detail {
+                // width: 50%;
+                font-size: 26rpx;
+                margin-bottom: 12rpx;
+                color: #555;
+                margin-right: 20rpx;
+
+                text {
+                    color: #999;
+                    font-size: 26rpx;
+                }
+            }
+        }
+
+        .more {
+            color: #888;
+            font-size: 24rpx;
+            display: flex;
+            border-top: 1px solid #eee;
+            padding-top: 20rpx;
+
+            .part {
+                width: 50%;
+                text-align: center;
+            }
+        }
+    }
+</style>
\ No newline at end of file
diff --git a/pages/index/login.vue b/pages/index/login.vue
index a1b464c..b923ab7 100644
--- a/pages/index/login.vue
+++ b/pages/index/login.vue
@@ -151,12 +151,12 @@
         methods: {
             async ApplyLanguagePack(lang, forceUpdate = false) {
                 // 璇诲彇璇█鍖呭苟鍔犺浇
-                let languagePack = await getLanguagePackJson(lang)
-                // this.$i18n.setLocaleMessage(lang, JSON.parse(languagePack))
+                // let languagePack = await getLanguagePackJson(lang)
+                // this.$i18n.setLocaleMessage(lang, languagePack)
                 this.$i18n.locale = lang
             },
             onLanguageChangeHandler(e) {
-                //TODO: 鍔ㄦ�佽幏鍙栧悗绔殑璇█鍖呮枃浠讹紝骞跺皢璇█鍖呭簲鐢ㄥ埌鍏ㄥ眬
+                //鍔ㄦ�佽幏鍙栧悗绔殑璇█鍖呮枃浠讹紝骞跺皢璇█鍖呭簲鐢ㄥ埌鍏ㄥ眬
                 console.log('e: ', e.detail.value);
                 if (e.detail.value == 0) {
                     this.Language = '涓枃'
diff --git a/utils/i18n.js b/utils/i18n.js
index b097a7e..04133e2 100644
--- a/utils/i18n.js
+++ b/utils/i18n.js
@@ -3,10 +3,14 @@
 import {
     CommonUtils
 } from "./common.js"
-const MissingKeysMap = new Map()
+let MissingKeysMap = {}
+let enableCollectMissingKey = false
+let clockID = null
 
 // 杩滅▼鑾峰彇璇█鍖�
 export async function getLanguagePackJson(language, forceUpdate = false) {
+    // TODO 鑾峰彇璇█鍖呮椂锛屾坊鍔犱竴涓増鏈瓧娈碉紝瀵规瘮娴忚鍣ㄧ紦瀛樹腑鐨勭増鏈瓧娈靛拰鍚庣鏂囦欢鐨勬槸鍚﹀搴�
+    // 濡傛灉瀵瑰簲锛屽垯涓嶈繑鍥炰换浣曟枃浠讹紝浣跨敤缂撳瓨鏂囦欢鍗冲彲銆�
     try {
         const res = await CommonUtils.doRequest2Async({
             url: '/Xt_grdAlignment_WMES/SelectMESLanguage_JSON',
@@ -15,17 +19,24 @@
                 forceUpdate: forceUpdate
             }
         })
-        let {data, Message, count} = res.data
-        if(count == 1) {   
+        let {
+            data,
+            Message,
+            count
+        } = res.data
+        if (count == 1) {
+            enableCollectMissingKey = true
             return data
-        }else {
+        } else {
+            enableCollectMissingKey = false
             CommonUtils.showTips({
                 title: "娓╅Θ鎻愮ず",
                 message: "[i18n]鑾峰彇璇█鍖呭け璐�: " + Message
             })
             return
         }
-    }catch(err) {
+    } catch (err) {
+        enableCollectMissingKey = false
         CommonUtils.showTips({
             title: "娓╅Θ鎻愮ず",
             message: "[i18n]鑾峰彇璇█鍖呭け璐�: " + err.message
@@ -34,13 +45,52 @@
     }
 }
 
-export function addMissingKeyToMap(key) {
-    MissingKeysMap.set(key, key)
+export function addMissingKeyToMap(key, HFieldCode) {
+    if (enableCollectMissingKey) {
+        if (!MissingKeysMap[key]) {
+            MissingKeysMap[key] = new Set()
+        }
+        // 闃叉椤甸潰鍒濇鍔犺浇鏃讹紝浣跨敤鏈湴缈昏瘧妯″潡瀵艰嚧鐨� 鍋囩己澶辩幇璞�
+        MissingKeysMap[key].add(HFieldCode)
+        console.log('MissingKeysMap: ', MissingKeysMap);
+        if (!clockID) {
+            clockID = setTimeout(() => {
+                syncMissingKeyToDB()
+            }, 1000)
+        } else {
+            clearTimeout(clockID)
+            clockID = setTimeout(() => {
+                syncMissingKeyToDB()
+            }, 1000)
+        }
+    }
 }
 
 // 娣诲姞缂哄け瀛楁鍒拌繙绋嬫暟鎹簱
-export async function syncMissingKeyToDB(){
-    
+export async function syncMissingKeyToDB() {
+    console.log('MissingKeysMap: ', MissingKeysMap);
+    for (let key in MissingKeysMap) {
+        if (MissingKeysMap.hasOwnProperty(key)) {
+            MissingKeysMap[key] = Array.from(MissingKeysMap[key])
+        }
+    }
+    CommonUtils.doRequest2Sync({
+        url: "/Xt_grdAlignment_WMES/syncMissingKeyToDB",
+        data: {
+            missingObj: JSON.stringify(MissingKeysMap)
+        }
+    })
     // 娓呴櫎缂哄け瀛楁缂撳瓨
-    MissingKeysMap.clear()
-}
+    MissingKeysMap = {}
+    // 閲嶅惎搴旂敤
+    const systemInfo = uni.getSystemInfoSync();
+    const platform = systemInfo.platform;
+
+    if (platform === 'ios' || platform === 'android') {
+        // App 绔細瀹屽叏閲嶅惎
+        plus.runtime.restart();
+    } else if (platform === 'h5') {
+        // H5 绔細鍒锋柊椤甸潰
+        window.location.reload();
+    }
+}
\ No newline at end of file

--
Gitblit v1.9.1