陈龙 3 月之前
父節點
當前提交
7b8f83a10a

+ 83 - 45
src/Auman.PieceWage.UniApp/components/page-dispatch/page-dispatch.vue

@@ -5,10 +5,10 @@
                 @confirm="load"></uni-search-bar>
             <button size="mini" type="primary" @tap="load">搜索</button>
         </view>
-        <view class="flex padding-lr child-gap">
+        <!-- <view class="flex padding-lr child-gap">
             <uni-datetime-picker type="date" placeholder="开始时间"></uni-datetime-picker>
             <uni-datetime-picker type="date" placeholder="结束时间"></uni-datetime-picker>
-        </view>
+        </view> -->
         <view class="grow-1 height-0 scroll padding">
             <view class="dispatch-row" v-for="(item, index) in items" key="number">
                 <view class="grow-1 padding-right">
@@ -17,42 +17,58 @@
                         </view>
                         <view class="dispatch-row-quantity">数量:{{item.quantity}}</view>
                     </view>
-                    <view class="dispatch-row-cells child-gap">
-                        <view class="dispatch-row-cell grow-1">工艺:{{item.processName}}</view>
-                    </view>
-                    <view class="dispatch-row-cells child-gap">
-                        <view class="dispatch-row-cell grow-1">计划号:{{item.planNumber}}</view>
-                    </view>
-                    <view class="dispatch-row-cells child-gap">
-                        <view class="dispatch-row-cell grow-1">料号:{{item.inventoryNumber}}</view>
-                    </view>
-                    <view class="dispatch-row-cells child-gap">
-                        <view class="dispatch-row-cell grow-1">品名:{{item.inventoryName}}</view>
-                    </view>
-                    <view class="dispatch-row-cells child-gap">
-                        <view class="dispatch-row-cell grow-1">规格{{item.spec}}</view>
-                    </view>
+                    <view class="dispatch-row-cells child-gap">订单号:{{item.orderNumber}}</view>
+                    <view class="dispatch-row-cells child-gap">计划号:{{item.planNumber}}</view>
+                    <view class="dispatch-row-cells child-gap">工艺:{{item.processName}}</view>
+                    <view class="dispatch-row-cells child-gap">料号:{{item.inventoryNumber}}</view>
+                    <view class="dispatch-row-cells child-gap">品名:{{item.inventoryName}}</view>
+                    <view class="dispatch-row-cells child-gap">规格:{{item.spec}}</view>
+                    <view class="dispatch-row-cells child-gap">数量:{{item.quantity}}</view>
+                    <view class="dispatch-row-cells child-gap">状态:{{item.statusText}}</view>
                 </view>
                 <view class="shrink-0">
                     <button size="mini" type="orange" @tap="buttonAction(item.dispatchOrderId)">{{buttonText}}</button>
                 </view>
             </view>
         </view>
-        
-        <view v-if="isAction">
-            <view>{{buttonText}}</view>
-        </view>
+
+        <uni-drawer ref="drawer" mode="right" width="280">
+            <scroll-view style="height: 100%;" scroll-y="true">
+                <view class="drawer-title">{{buttonText}}</view>
+                <view class="padding">
+                    <view class="dispatch-row-cells child-gap">订单号:{{currentItem.orderNumber}}</view>
+                    <view class="dispatch-row-cells child-gap">计划号:{{currentItem.planNumber}}</view>
+                    <view class="dispatch-row-cells child-gap">工艺:{{currentItem.processName}}</view>
+                    <view class="dispatch-row-cells child-gap">料号:{{currentItem.inventoryNumber}}</view>
+                    <view class="dispatch-row-cells child-gap">品名:{{currentItem.inventoryName}}</view>
+                    <view class="dispatch-row-cells child-gap">规格:{{currentItem.spec}}</view>
+                    <view class="dispatch-row-cells child-gap">数量:{{currentItem.quantity}}</view>
+                    <view class="dispatch-row-cells child-gap">状态:{{currentItem.statusText}}</view>
+                    <view class="dispatch-row-cells child-gap">
+                        <view class="dispatch-row-cell">工作组:</view>
+                    </view>
+                    <view class="dispatch-row-cells child-gap">
+                        <view class="dispatch-row-cell">备注:</view>
+                        <view class="dispatch-row-cell grow-1">
+                            <textarea class="drawer-textarea" v-model="description"></textarea>
+                        </view>
+                    </view>
+                </view>
+            </scroll-view>
+        </uni-drawer>
     </view>
 </template>
 
 <script>
     import extend from '../../utils/extend';
-import message from '../../utils/message';
+    import message from '../../utils/message';
     import request from '../../utils/request';
     import url from '../../utils/url';
     import user from '../../utils/user';
+    import status from '../../script/status';
 
     let userinfo = user.get();
+    let lineId = 0;
 
     export default {
         name: "page-dispatch",
@@ -82,7 +98,8 @@ import message from '../../utils/message';
             return {
                 searchValue: '',
                 items: [],
-                isAction: false
+                currentItem: {},
+                description: ''
             };
         },
         methods: {
@@ -131,11 +148,13 @@ import message from '../../utils/message';
                 return res;
             },
             buttonAction(id) {
-                this.isAction = true;
+                lineId = id;
+                this.currentItem = this.getRowById(lineId);
+                this.$refs.drawer.open();
             },
 
-            async action(id) {
-                let row = this.getRowById(id);
+            async action() {
+                let row = this.getRowById(lineId);
                 if (extend.isNull(row) && extend.isNonEmptyString(this.buttonUrl)) {
                     return;
                 }
@@ -174,32 +193,51 @@ import message from '../../utils/message';
         display: flex;
         padding: 20upx 0;
         align-items: center;
+    }
 
-        .dispatch-row-title {
-            font-size: 38upx;
-        }
+    .dispatch-row-title {
+        font-size: 36upx;
+    }
 
-        .dispatch-row-quantity {
-            color: #666666;
-        }
+    .dispatch-row-quantity {
+        color: #666666;
+        font-size: 24upx;
+    }
 
-        .dispatch-row-cells {
-            position: relative;
-            display: flex;
-            font-size: 24upx;
-            color: #666666;
-            justify-content: space-between;
-            align-items: center;
-            margin-top: 10upx;
-            flex-wrap: wrap;
-        }
+    .dispatch-row-cells {
+        position: relative;
+        display: flex;
+        color: #666666;
+        justify-content: space-between;
+        align-items: center;
+        margin-top: 10upx;
+        flex-wrap: wrap;
+        font-size: 24upx;
+        box-sizing: border-box;
+    }
 
-        .dispatch-row-cell {
-            flex-shrink: 0;
-        }
+    .dispatch-row-cell {
+        flex-shrink: 0;
+        font-size: 24upx;
+        box-sizing: border-box;
     }
 
     .dispatch-row+.dispatch-row {
         border-top: 1upx solid #dfdfdf;
     }
+
+    .drawer-title {
+        position: relative;
+        width: 100%;
+        display: flex;
+        justify-content: center;
+        padding-top: 20upx;
+        font-size: 36upx;
+    }
+
+    .drawer-textarea {
+        border: 1upx solid #dfdfdf;
+        width: 100%;
+        border-radius: 20upx;
+    }
 </style>

+ 2 - 2
src/Auman.PieceWage.UniApp/manifest.json

@@ -2,8 +2,8 @@
     "name" : "生产流程管理",
     "appid" : "__UNI__930B119",
     "description" : "生产流程管理",
-    "versionName" : "0.0.4",
-    "versionCode" : 4,
+    "versionName" : "0.0.5",
+    "versionCode" : 5,
     "transformPx" : false,
     /* 5+App特有相关 */
     "app-plus" : {

+ 2 - 2
src/Auman.PieceWage.UniApp/pages.json

@@ -62,10 +62,10 @@
             }
         },
         {
-            "path" : "pages/dispatch/produce-dispatch",
+            "path" : "pages/workingTeam/select",
             "style" : 
             {
-                "navigationBarTitleText" : "生产派工"
+                "navigationBarTitleText" : "选择工作组"
             }
         }
     ],

+ 1 - 18
src/Auman.PieceWage.UniApp/pages/dispatch/dispatch.vue

@@ -59,24 +59,7 @@
             },
             
             async getOrders(){
-                let res = await request.sendToken({
-                    url: `${url.apiUrl}dispatching-order/search`,
-                    data: {
-                        name: '',
-                        groupNumber: '',
-                        // workshopSectionId: 0,
-                        opened: true
-                    }
-                });
-                if (res.success) {
-                    this.process = res.data.rows;
-                    console.log('process:', res.data.rows);
-                } else {
-                    uni.showModal({
-                        title: '错误',
-                        content: res.message
-                    });
-                }
+                await this.$refs.child.load();
             }
         }
     }

+ 0 - 29
src/Auman.PieceWage.UniApp/pages/dispatch/produce-dispatch.vue

@@ -1,29 +0,0 @@
-<template>
-    <view>
-        
-    </view>
-</template>
-
-<script>
-    import extend from '../../utils/extend';
-    import request from '../../utils/request';
-    export default {
-        data() {
-            return {
-                dispatchingOrderId: 0
-            }
-        },
-        onLoad(opt) {
-            if (extend.isNonEmptyString(opt.dispatchingOrderId)) {
-                this.dispatchingOrderId = opt.dispatchingOrderId;
-            }
-        },
-        methods: {
-            async load(){}
-        }
-    }
-</script>
-
-<style>
-
-</style>

+ 33 - 0
src/Auman.PieceWage.UniApp/pages/workingTeam/select.vue

@@ -0,0 +1,33 @@
+<template>
+    <view class="uni-container">
+        <easy-table>
+            <easy-table-thead>
+                <easy-table-tr>
+                    <easy-table-th></easy-table-th>
+                </easy-table-tr>
+            </easy-table-thead>
+            <easy-table-tbody></easy-table-tbody>
+        </easy-table>
+    </view>
+</template>
+
+<script>
+    import extend from '../../utils/extend';
+    import request from '../../utils/request';
+    import message from '../../utils/message';
+    
+    export default {
+        data() {
+            return {
+                
+            };
+        },
+        methods: {
+            async load() {}
+        }
+    }
+</script>
+
+<style lang="scss">
+
+</style>

+ 0 - 339
src/Auman.PieceWage.UniApp/script/completionOrder.js

@@ -1,339 +0,0 @@
-/**
- * 完工单解析
- */
-import extend from '../utils/extend.js';
-import analyze from '../utils/analyzeScannedContent.js';
-
-/**
- * 完工送货单
- */
-export default class {
-    /**
-     * 订单
-     */
-    order = null;
-
-    /**
-     * 行集合
-     */
-    lines = new Map();
-
-    /**
-     * 条码集合
-     */
-    barcodes = new Map();
-
-    /**
-     * 订单编码
-     */
-    orderNumber = '';
-
-    constructor(order) {
-        this.order = order;
-        this.init();
-    }
-
-    /**
-     * 初始化
-     */
-    init(order) {
-        this.order = order;
-        this.lines.clear();
-        this.barcodes.clear();
-
-        if (extend.isNull(order)) {
-            return;
-        }
-
-        if (extend.isArray(this.order.Lines)) {
-            for (let i in this.order.Lines) {
-                const key = this.order.Lines[i].InventoryNumber.trim() + this.order.Lines[i].BatchNumber.trim();
-                this.lines.set(key, this.order.Lines[i]);
-
-                if (extend.isArray(this.order.Lines[i].Codes)) {
-                    for (let j in this.order.Lines[i].Codes) {
-                        this.barcodes.set(this.order.Lines[i].Codes[j].Barcode, this.order.Lines[i].Codes[j]);
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * 送货单数量
-     */
-    get quantity() {
-        let res = 0;
-        if (extend.isObject(this.order) && extend.isArray(this.order.Lines)) {
-            for (let i in this.order.Lines) {
-                res += this.order.Lines[i].Quantity;
-            }
-        }
-        return res;
-    }
-
-    /**
-     * 送货扫描确认数量
-     */
-    get completionConfirmedQty() {
-        let res = 0;
-        for (let [key, value] of this.barcodes) {
-            res += value.CompletionConfirmed > 0 ? 1 : 0;
-        }
-        return res;
-    }
-
-    /**
-     * 入库扫描确认数量
-     */
-    get warehouseConfirmedQty() {
-        let res = 0;
-        for (let [key, value] of this.barcodes) {
-            res += value.WarehouseConfirmed > 0 ? 1 : 0;
-        }
-        return res;
-    }
-
-    /**
-     * 获取行
-     * @param {string} inventoryNumber 料号
-     * @param {string} batchNumber 批次
-     */
-    getLine(inventoryNumber, batchNumber) {
-        let res = null;
-        if (extend.isNonEmptyString(inventoryNumber) && extend.isNonEmptyString(batchNumber)) {
-            const key = inventoryNumber.trim() + batchNumber.trim();
-            res = this.lines.get(key) || null;
-        }
-        return res;
-    }
-
-    /**
-     * 设置送货单行条码值集合
-     */
-    setLineBarcodes() {
-        if (extend.isObject(this.order) && extend.isArray(this.order.Lines)) {
-            for (let i in this.order.Lines) {
-                let rows = [];
-                for (let [key, value] of this.barcodes) {
-                    if (value.CompletionOrderLineId === this.order.Lines[i].CompletionOrderLineId) {
-                        if (!extend.isArray(this.order.Lines[i].Codes)) {
-                            this.order.Lines[i].Codes = [];
-                        }
-                        rows.push(value);
-                    }
-                }
-                this.order.Lines[i].Codes = rows;
-            }
-        }
-    }
-
-    /**
-     * 按流水码排序
-     * @param {array} list 列表
-     * @param {array} list[].SerialNumber 流水码
-     * 
-     */
-    sortBySerialNumber(list) {
-        for (let i in list) {
-            for (let j in list) {
-                if (parseInt(list[i].SerialNumber) < parseInt(list[j].SerialNumber)) {
-                    let temp = list[i];
-                    list[i] = list[j];
-                    list[j] = temp;
-                    temp = null;
-                }
-            }
-        }
-        return list;
-    }
-
-    /**
-     * 获取二维码对象
-     */
-    getCode(code) {
-        if (extend.isObject(this.order) && extend.isArray(this.order.Lines)) {
-            for (let i in this.order.Lines) {
-                if (extend.isArray(this.order.Lines[i].Codes)) {
-                    for (let j in this.order.Lines[i].Codes) {
-                        if (this.order.Lines[i].Codes[j].Barcode === code) {
-                            return this.order.Lines[i].Codes[j];
-                        }
-                    }
-                }
-            }
-        }
-        return null;
-    }
-
-    /**
-     * 获取二维码对象
-     */
-    getCodes() {
-        let list = [];
-        if (extend.isObject(this.order) && extend.isArray(this.order.Lines)) {
-            for (let i in this.order.Lines) {
-                if (extend.isArray(this.order.Lines[i].Codes)) {
-                    list = list.concat(this.order.Lines[i].Codes);
-                }
-            }
-        }
-        return list;
-    }
-
-    /**
-     * 获取二维码列表
-     */
-    getBarcodes() {
-        let list = [];
-        if (extend.isObject(this.order) && extend.isArray(this.order.Lines)) {
-            for (let i in this.order.Lines) {
-                if (extend.isArray(this.order.Lines[i].Codes)) {
-                    for (let j in this.order.Lines[i].Codes) {
-                        if (extend.isNonEmptyString(this.order.Lines[i].Codes[j].Barcode)) {
-                            list.push(this.order.Lines[i].Codes[j].Barcode);
-                        }
-                    }
-                }
-            }
-        }
-        return list;
-    }
-
-    /**
-     * 获取已解析二维码列表
-     */
-    getBarcodeRows() {
-        let rows = [];
-        let list = this.getBarcodes();
-        for (let i in list) {
-            rows.push(analyze.parse(list[i]));
-        }
-        return this.sortBySerialNumber(rows);
-    }
-
-    /**
-     * 获取二维码Map
-     */
-    getBarcodesMap() {
-        let map = new Map();
-        let list = this.getBarcodes();
-        for (let i in list) {
-            map.set(list[i], i);
-        }
-        return map;
-    }
-
-    /**
-     * 获取行二维码解析对象列表
-     * @param {string} inventoryNumber 料号
-     * @param {string} batchNumber 批次
-     */
-    getLineBarcodeRows(inventoryNumber, batchNumber) {
-        let rows = [];
-        let line = this.getLine(inventoryNumber, batchNumber);
-        if (extend.isObject(line) && extend.isArray(line.Codes)) {
-            for (let i in line.Codes) {
-                let row = analyze.parse(line.Codes[i].Barcode);
-                if (extend.isObject(row)) {
-                    rows.push(row);
-                }
-            }
-        }
-        return this.sortBySerialNumber(rows);
-    }
-
-    /**
-     * 获取已入库确认二维码列表
-     */
-    getWarehouseConfirmedBarcodes() {
-        let rows = [];
-        let codes = this.getCodes();
-        for (let i in codes) {
-            if (codes[i].WarehouseConfirmed > 0) {
-                rows.push(codes[i]);
-            }
-        }
-        return rows;
-    }
-
-    /**
-     * 获取已入库二维码解析对象列表
-     */
-    getWarehouseConfirmedBarcodeRows() {
-        let rows = [];
-        let barcodes = this.getWarehouseConfirmedBarcodes();
-        for (let i in barcodes) {
-            rows.push(analyze.parse(barcodes[i].Barcode));
-        }
-        for (let i = 0; i < rows.length; i++) {
-            for (let j = 0; j < rows.length; j++) {
-                if (rows[i].SerialNumber < rows[j].SerialNumber) {
-                    let temp = rows[i];
-                    rows[i] = rows[j];
-                    rows[j] = temp;
-                    temp = null;
-                }
-            }
-        }
-        return rows;
-    }
-
-    /**
-     * 获取已未入库确认二维码列表
-     */
-    getUnWarehouseConfirmedBarcodes() {
-        let rows = [];
-        let codes = this.getCodes();
-        for (let i in codes) {
-            if (codes[i].WarehouseConfirmed === 0) {
-                rows.push(codes[i]);
-            }
-        }
-        return rows;
-    }
-
-    /**
-     * 获取已未入库二维码解析对象列表
-     */
-    getUnWarehouseConfirmedBarcodeRows() {
-        let rows = [];
-        let barcodes = this.getUnWarehouseConfirmedBarcodes();
-        for (let i in barcodes) {
-            rows.push(analyze.parse(barcodes[i].Barcode));
-        }
-        for (let i = 0; i < rows.length; i++) {
-            for (let j = 0; j < rows.length; j++) {
-                if (rows[i].SerialNumber < rows[j].SerialNumber) {
-                    let temp = rows[i];
-                    rows[i] = rows[j];
-                    rows[j] = temp;
-                    temp = null;
-                }
-            }
-        }
-        return rows;
-    }
-
-    /**
-     * 确认所有二维码
-     */
-    confirmAllBarcodes() {
-        let codes = this.getCodes();
-        for(let i in codes) {
-            if (!codes[i].WarehouseConfirmed) {
-                codes[i].WarehouseConfirmed = 1;
-                codes[i].WarehouseConfirmedOn = new Date();
-            }
-        }
-    }
-}
-
-class CompletionOrderLineBarcode {
-    Barcode = '';
-    CompletionConfirmed = 0;
-    CompletionConfirmedOn = null;
-    CompletionOrderLineId = 0;
-    WarehouseConfirmed = 0;
-    WarehouseConfirmedOn = null;
-}

+ 0 - 158
src/Auman.PieceWage.UniApp/script/deliveryOrder.js

@@ -1,158 +0,0 @@
-/**
- * 送货单解析
- */
-import extend from '../utils/extend.js';
-import analyze from '../utils/analyzeScannedContent.js';
-
-/**
- * 完工送货单
- */
-export default class {
-    /**
-     * 订单
-     */
-    order = null;
-
-    /**
-     * 条码集合
-     */
-    barcodes = new Map();
-
-    /**
-     * 订单编码
-     */
-    orderNumber = '';
-
-    constructor(order) {
-        this.order = order;
-        this.init();
-    }
-
-    /**
-     * 初始化
-     */
-    init(order) {
-        if (!(extend.isObject(order) || extend.isObject(this.order) || order === null)) {
-            return;
-        }
-        this.order = order;
-        this.barcodes.clear();
-
-        if (extend.isNull(order)) {
-            return;
-        }
-
-        if (extend.isArray(this.order.Barcodes)) {
-            for (let i in this.order.Barcodes) {
-                this.barcodes.set(this.order.Barcodes[i].Text, this.order.Barcodes[i]);
-            }
-        }
-    }
-
-    /**
-     * 送货单数量
-     */
-    get quantity() {
-        let res = 0;
-        res = this.barcodes.size;
-        return res;
-    }
-
-    /**
-     * 送货扫描确认数量
-     */
-    get scanedQty() {
-        let res = 0;
-        for (let [key, value] of this.barcodes) {
-            res += value.Scaned ? 1 : 0;
-        }
-        return res;
-    }
-
-    /**
-     * 剩余扫描数量
-     */
-    get remainQty() {
-        let res = 0;
-        res = this.quantity - this.scanedQty;
-        return res;
-    }
-
-    /**
-     * 获取已解析二维码数据列表
-     */
-    getBarcodeRows() {
-        let res = [];
-        if (extend.isArray(this.order.Barcodes)) {
-            for (let i in this.order.Barcodes) {
-                let row = analyze.parse(this.order.Barcodes[i].Text);
-                res.push(row);
-            }
-        }
-        this.sortBySerialNumber(res);
-        return res;
-    }
-
-    /**
-     * 获取已解析二维码数据列表
-     */
-    getScanedBarcodeRows() {
-        let res = [];
-        if (extend.isArray(this.order.Barcodes)) {
-            for (let i in this.order.Barcodes) {
-                if (this.order.Barcodes[i].Scaned) {
-                    let row = analyze.parse(this.order.Barcodes[i].Text);
-                    res.push(row);
-                }
-            }
-        }
-        this.sortBySerialNumber(res);
-        return res;
-    }
-
-    /**
-     * 获取剩余二维码列表数据
-     */
-    getRemainBarcodeRows() {
-        let res = [];
-        if (extend.isArray(this.order.Barcodes)) {
-            for (let i in this.order.Barcodes) {
-                if (!this.order.Barcodes[i].Scaned) {
-                    let row = analyze.parse(this.order.Barcodes[i].Text);
-                    res.push(row);
-                }
-            }
-        }
-        this.sortBySerialNumber(res);
-        return res;
-    }
-
-    /**
-     * 根据流水码排序
-     */
-    sortBySerialNumber(rows) {
-        if (!extend.isArray(rows)) {
-            rows = [];
-        }
-        for (let i in rows) {
-            for (let j in rows) {
-                if (rows[i].SerialNumber < rows[j].SerialNumber) {
-                    let temp = rows[i];
-                    rows[i] = rows[j];
-                    rows[j] = temp;
-                    temp = null;
-                }
-            }
-        }
-        return rows;
-    }
-}
-
-class CompletionOrderLineBarcode {
-    Barcode = '';
-    CompletionConfirmed = 0;
-    CompletionConfirmedOn = null;
-    CompletionOrderLineId = 0;
-    WarehouseConfirmed = 0;
-    WarehouseConfirmedOn = null;
-}

+ 0 - 601
src/Auman.PieceWage.UniApp/script/multiCustomizeDeliveryOrder.js

@@ -1,601 +0,0 @@
-/**
- * OEM单总编号多仓位送货单
- */
-import extend from '../utils/extend.js';
-import analyze from '../utils/analyzeScannedContent.js';
-import user from '../utils/user.js';
-import request from '../utils/request.js';
-import token from '../utils/token.js';
-import shipPlanEnum from '../utils/shipPlanEnum.js';
-import message from '../utils/message.js';
-
-/**
- * 订单存储键
- */
-const orderStorageKey = 'multiCustomizeDeliveryOrder';
-
-/**
- * 仓位存储键
- */
-const kwcwKey = 'CM_D_KWCW';
-
-/**
- * 是否错误
- */
-let isError = false;
-
-/**
- * OEM单总编号多仓位送货单
- */
-export default class {
-    /**
-     * 订单
-     */
-    order = null;
-
-    /**
-     * 用户信息
-     */
-    user = null;
-
-    /**
-     * 仓位
-     */
-    kwcw = {
-        /**
-         * 当前仓位内码
-         */
-        CWID: null,
-
-        /**
-         * 当前仓位编码
-         */
-        CWBM: null,
-
-        /**
-         * 当前仓位名称
-         */
-        CWMC: null,
-
-        /**
-         * 仓位状态;CM_C_MB,LX='KWCWZT';=0 空闲,=1 占用
-         */
-        ZTID: 0,
-
-        /**
-         * 仓位列表
-         */
-        list: [],
-
-        moveAction: false,
-
-        isMove: false
-    };
-
-    constructor(order) {
-        this.order = order || null;
-        this.user = user.get() || {};
-        this.init();
-    }
-
-    /**
-     * 初始化
-     */
-    init(order) {
-        this.order = order;
-
-        if (extend.isNull(order)) {
-            extend.removeStorage(orderStorageKey);
-            extend.removeStorage(kwcwKey)
-            return;
-        }
-    }
-
-    /**
-     * 订单编码
-     */
-    get orderNumber() {
-        let res = ';'
-        if (extend.isObject(this.order)) {
-            res = this.order.OrderNumber;
-        } else {
-            res = this.getNewOrderNumber();
-        }
-        return res;
-    }
-
-    /**
-     * 获取总数量
-     * @returns {number}
-     */
-    get quantity() {
-        let res = 0;
-        let lines = this.lines;
-        for (let i in lines) {
-            if (extend.isArray(lines[i].Codes)) {
-                res += lines[i].Codes.length;
-            }
-        }
-        return res;
-    }
-
-    /**
-     * 获取已扫总数量
-     * @returns {number}
-     */
-    get scanedQty() {
-        let res = 0;
-        let lines = this.lines;
-        for (let i in lines) {
-            if (!extend.isNumber(lines[i].ScanedQty)) {
-                lines[i].ScanedQty = 0;
-            }
-            res += lines[i].ScanedQty;
-        }
-        return res;
-    }
-
-    /**
-     * 剩余未扫码数量
-     */
-    get remainQty() {
-        let res = 0;
-        res = this.quantity - this.scanedQty;
-        return res;
-    }
-
-    /**
-     * 所有行
-     */
-    get lines() {
-        let lines = [];
-        if (!extend.isObject(this.order) || !extend.isArray(this.order.Lines)) {
-            return lines;
-        }
-        lines = this.order.Lines;
-        for (let i in lines) {
-            if (!extend.isArray(lines[i].Codes)) {
-                continue;
-            }
-            lines[i].ScanedQty = 0;
-            for (let j in lines[i].Codes) {
-                if (lines[i].Codes[j].WarehouseConfirmed) {
-                    lines[i].ScanedQty++;
-                }
-            }
-        }
-        return lines;
-    }
-
-    /**
-     * 所有二维码
-     */
-    get codes() {
-        let list = [];
-        let lines = this.lines;
-        for (let i in lines) {
-            if (!extend.isArray(lines[i].Codes)) {
-                continue;
-            }
-            list = list.concat(lines[i].Codes);
-        }
-        return list;
-    }
-
-    /**
-     * 仓位列表
-     */
-    get kwcwList() {
-        if (!extend.isArray(this.kwcw.list)) {
-            this.kwcw.list = [];
-        }
-        let codes = this.codes;
-        for (let i in this.kwcw.list) {
-            this.kwcw.list[i].Quantity = 0;
-            for (let j in codes) {
-                if (this.kwcw.list[i].CWID === codes[j].CWID) {
-                    this.kwcw.list[i].Quantity++;
-                }
-            }
-        }
-        return this.kwcw.list;
-    }
-
-    /**
-     * 仓位列表
-     */
-    get barcodes() {
-        let list = [];
-        let codes = this.codes;
-        for (let i in codes) {
-            list.push(codes[i].Barcode);
-        }
-        return list;
-    }
-
-    /**
-     * 获取行
-     * @param {number} customCompletionOrderLineId 送货单行内码
-     */
-    getLine(customCompletionOrderLineId) {
-        let line = null;
-        if (!extend.isObject(this.order) || !extend.isArray(this.order.Lines)) {
-            return line;
-        }
-        for (let i in this.order.Lines) {
-            this.order.Lines[i].Quantity = 0;
-            this.order.Lines[i].ScanedQty = 0;
-            if (!extend.isArray(this.order.Lines[i].Codes)) {
-                continue;
-            }
-            this.order.Lines[i].Quantity = this.order.Lines[i].Codes.length;
-            if (this.order.Lines[i].CustomCompletionOrderLineId === customCompletionOrderLineId) {
-                line = this.order.Lines[i];
-                for (let j in line.Codes) {
-                    if (line.Codes[j].WarehouseConfirmed) {
-                        line.ScanedQty++;
-                    }
-                }
-                break;
-            }
-        }
-        return line;
-    }
-
-    /**
-     * 获取行中的二维码列表
-     * @param {number} cwid 库位内码
-     * @param {number} customCompletionOrderLineId 送货单行内码
-     */
-    getLineCodes(cwid, customCompletionOrderLineId) {
-        let codes = [];
-        if (!extend.isNumber(cwid) || !extend.isNumber(customCompletionOrderLineId)) {
-            return codes;
-        }
-        let line = this.getLine(customCompletionOrderLineId);
-        if (!extend.isObject(line) || !extend.isArray(line.Codes)) {
-            return codes;
-        }
-        for (let i in line.Codes) {
-            if (!(line.Codes[i].WarehouseConfirmed && line.Codes[i].CWID === cwid)) {
-                continue;
-            }
-            codes.push(line.Codes[i]);
-        }
-        return codes;
-    }
-
-    /**
-     * 获取行中已解析的二维码列表
-     * @param {number} cwid 库位内码
-     * @param {number} customCompletionOrderLineId 送货单行内码
-     */
-    getLineParseBarcodes(cwid, customCompletionOrderLineId) {
-        let codes = [];
-        if (!extend.isNumber(cwid) || !extend.isNumber(customCompletionOrderLineId)) {
-            return codes;
-        }
-        let line = this.getLine(customCompletionOrderLineId);
-        if (!extend.isObject(line) || !extend.isArray(line.Codes)) {
-            return codes;
-        }
-        for (let i in line.Codes) {
-            if (!(line.Codes[i].WarehouseConfirmed && line.Codes[i].CWID === cwid)) {
-                continue;
-            }
-            let code = analyze.parse(line.Codes[i].Barcode);
-            if (extend.isObject(code)) {
-                codes.push(code);
-            }
-        }
-        return codes;
-    }
-
-    /**
-     * 获取新订单号
-     */
-    getNewOrderNumber() {
-        return 'OSHD' + extend.dateFormatter(new Date(), 'yyMMdd');
-    }
-
-    /**
-     * 获取新订单号
-     */
-    getKwcw(cwid) {
-        let res = null;
-        for (let i in this.kwcw.list) {
-            if (this.kwcw.list[i].CWID === cwid) {
-                res = this.kwcw.list[i];
-                break;
-            }
-        }
-        return res;
-    }
-
-    /**
-     * 更新二维码仓位内码
-     * @param {Array} list 要更改的二维码列表
-     */
-    updateCodesCwid(list) {
-        this.kwcw.moveAction = false;
-        this.kwcw.isMove = false;
-        if (!extend.isArray(list) || extend.isNull(this.order)) {
-            return;
-        }
-        let codes = this.codes;
-        for (let i in list) {
-            for (let j in codes) {
-                if (list[i].Barcode === codes[j].Barcode) {
-                    codes[j].CWID = this.kwcw.CWID;
-                    codes[j].CWBM = this.kwcw.CWBM;
-                    codes[j].CWMC = this.kwcw.CWMC;
-                    codes[j].CodeStatus = shipPlanEnum.CodeStatus.Edit;
-                    continue;
-                }
-            }
-        }
-        this.localSaveKwcw();
-        this.localSaveOrder();
-    }
-
-    /**
-     * 本地存储订单
-     */
-    localSaveOrder() {
-        extend.addStorage(orderStorageKey, this.order);
-    }
-
-    /**
-     * 本地读取订单
-     */
-    localReadOrder() {
-        let order = extend.readStorage(orderStorageKey);
-        if (extend.isObject(order)) {
-            this.init(order);
-        }
-    }
-
-    /**
-     * 本地存储仓位
-     */
-    localSaveKwcw() {
-        if (!extend.isNumber(this.kwcw.ZTID)) {
-            this.kwcw.ZTID = 0;
-        }
-        if (!extend.isArray(this.kwcw.list)) {
-            this.kwcw.list = [];
-        }
-        if (!extend.isBool(this.kwcw.moveAction)) {
-            this.kwcw.moveAction = false;
-        }
-        if (!extend.isBool(this.kwcw.isMove)) {
-            this.kwcw.isMove = false;
-        }
-        extend.addStorage(kwcwKey, this.kwcw);
-    }
-
-    /**
-     * 本地读取仓位
-     */
-    localReadKwcw() {
-        let res = extend.readStorage(kwcwKey);
-        if (extend.isObject(res)) {
-            this.kwcw = res;
-            if (!extend.isNumber(this.kwcw.ZTID)) {
-                this.kwcw.ZTID = 0;
-            }
-            if (!extend.isArray(this.kwcw.list)) {
-                this.kwcw.list = [];
-            }
-            if (!extend.isBool(this.kwcw.moveAction)) {
-                this.kwcw.moveAction = false;
-            }
-            if (!extend.isBool(this.kwcw.isMove)) {
-                this.kwcw.isMove = false;
-            }
-        }
-    }
-
-    /**
-     * 重置当前仓位信息
-     */
-    resetKwcw() {
-        this.kwcw.CWID = null;
-        this.kwcw.CWBM = null;
-        this.kwcw.CWMC = null;
-        this.kwcw.ZTID = 0;
-        this.kwcw.moveAction = false;
-        this.kwcw.isMove = false;
-        this.localSaveKwcw();
-    }
-
-    /**
-     * 设置二维码
-     * @param {string} barcode 条码
-     * @param {object} data 参数
-     * @param {string} data.barcode 二维码
-     * @param {number} data.customCompletionOrderLineId 总编号
-     * @param {number} data.cwid 仓位内码
-     * @param {number} data.cwbm 仓位编码
-     */
-    async setBarcode(data) {
-        if (isError) {
-            return message.playDing();
-        }
-
-        if (extend.isNull(this.order) || extend.isNull(data)) {
-            return;
-        }
-        let line = this.getLine(data.customCompletionOrderLineId);
-        if (!extend.isObject(line) || !extend.isArray(line.Codes)) {
-            return;
-        }
-        let code = analyze.parse(data.barcode);
-        if (extend.isNull(code)) {
-            isError = true;
-            await message.error({
-                content: '无效条码'
-            });
-            isError = false;
-            return;
-        }
-        if (line.Quantity === line.ScanedQty) {
-            isError = true;
-            await message.error({
-                content: '数量已购'
-            });
-            isError = false;
-            return;
-        }
-        let isConfirmed = false;
-        for (let i in line.Codes) {
-            if (line.Codes[i].Barcode === data.barcode) {
-                isConfirmed = true;
-                if (line.Codes[i].WarehouseConfirmed) {
-                    isError = true;
-                    await message.error({
-                        content: '已扫描'
-                    });
-                    isError = true;
-                    return;
-                }
-                line.Codes[i].WarehouseConfirmed = 1;
-                line.Codes[i].CWID = this.kwcw.CWID;
-                line.Codes[i].CWBM = this.kwcw.CWBM;
-                line.Codes[i].CWMC = this.kwcw.CWMC;
-                line.Codes[i].CodeStatus = shipPlanEnum.CodeStatus.Add;
-                this.localSaveOrder();
-                break;
-            }
-        }
-        if (!isConfirmed) {
-            isError = true;
-            await message.error({
-                content: '不属于当前产品'
-            });
-            isError = false;
-            return;
-        }
-    }
-
-    /**
-     * 获取用户信息
-     */
-    async getUser() {
-        this.user = user.get();
-        if (extend.isNull(this.user)) {
-            let tok = await token.getByServer();
-            if (!tok.success) {
-                message.error({
-                    title: '提示',
-                    content: '请登录后再试!'
-                });
-                return null;
-            }
-        }
-        return this.user;
-    }
-
-    /**
-     * 加载送货单
-     * @param {string} orderNumber 送货单编号
-     */
-    async loadOrder(orderNumber) {
-        if (isError) {
-            return message.playDing();
-        }
-
-        uni.showLoading({
-            title: '加载中'
-        });
-        await this.getUser();
-        if (extend.isNull(this.user)) {
-            return;
-        }
-        let res = await request.sendToken({
-            url: `api/SmartDevice/MultiCustomizeDeliveryOrder/LoadCustomCompletionOrder`,
-            method: 'get',
-            data: {
-                orderNumber: orderNumber,
-                systemUserId: this.user.SystemUserId
-            }
-        });
-        uni.hideLoading();
-        if (res.success) {
-            if (extend.isObject(res.data)) {
-                this.init(res.data);
-                this.resetKwcw();
-                this.localSaveOrder();
-            } else {
-                isError = true;
-                await message.alert({
-                    title: '错误',
-                    content: '接收的数据错误!',
-                    showCancel: false
-                });
-                isError = false;
-                return;
-            }
-        } else {
-            isError = true;
-            await message.alert({
-                title: '错误',
-                content: res.message,
-                showCancel: false
-            });
-            isError = false;
-            return;
-        }
-    }
-
-    /**
-     * 加载仓位列表
-     */
-    async loadKwcwList() {
-        if (isError) {
-            return message.playDing();
-        }
-        
-        if (extend.isNull(this.order)) {
-            return;
-        }
-        await this.getUser();
-        if (extend.isNull(this.user)) {
-            return;
-        }
-        let res = await request.sendToken({
-            url: `api/SmartDevice/MultiCustomizeDeliveryOrder/ListKWCW`,
-            method: 'get',
-            data: {
-                locationId: this.order.LocationId
-            }
-        });
-        if (res.success) {
-            if (extend.isArray(res.data)) {
-                this.kwcw.moveAction = false;
-                this.kwcw.isMove = false;
-                this.kwcw.list = res.data;
-                console.log(this.kwcw);
-                this.localSaveKwcw();
-            } else {
-                isError = true;
-                await message.alert({
-                    title: '错误',
-                    content: '接收的数据错误!',
-                    showCancel: false
-                });
-                isError = false;
-                return;
-            }
-        } else {
-            isError = true;
-            message.alert({
-                title: '错误',
-                content: res.message,
-                showCancel: false
-            });
-            isError = false;
-            return;
-        }
-    }
-}

+ 0 - 135
src/Auman.PieceWage.UniApp/script/outsourcedDelivery.js

@@ -1,135 +0,0 @@
-/**
- * OEM单总编号多仓位送货单
- */
-import extend from '../utils/extend.js';
-import analyze from '../utils/analyzeScannedContent.js';
-import user from '../utils/user.js';
-import request from '../utils/request.js';
-import token from '../utils/token.js';
-import shipPlanEnum from '../utils/shipPlanEnum.js';
-import message from '../utils/message.js';
-
-/**
- * OEM单总编号多仓位送货单
- */
-export default class {
-    /**
-     * 订单
-     */
-    order = {
-        SystemUserId: 0,
-        LocationId: 0,
-        Order: {
-            Barcodes: [],
-        }
-    };
-
-    /**
-     * 用户信息
-     */
-    user = null;
-
-    constructor() {
-        this.init();
-    }
-
-    /**
-     * 初始化
-     */
-    async init() {
-        this.user = await this.getUser();
-        this.order.SystemUserId = this.user.SystemUserId;
-        this.order.LocationId = 0;
-        this.order.Order.Barcodes = [];
-    }
-
-    /**
-     * 获取总数量
-     * @returns {number}
-     */
-    get quantity() {
-        let res = this.order.Order.Barcodes.length;
-        return res;
-    }
-
-    /**
-     * 所有行
-     */
-    get lines() {
-        let lines = [];
-        for (let i in this.order.Order.Barcodes) {
-            let row = analyze.parse(this.order.Order.Barcodes[i].Text);
-            if (extend.isNull(row)) {
-                continue;
-            }
-            lines.push(row);
-        }
-        analyze.sortASC(lines);
-        return lines;
-    }
-
-    /**
-     * 查找行
-     * @param {string} barcode 二维码
-     */
-    findBarcode(barcode) {
-        let res = null;
-        if (!extend.isString(barcode)) {
-            return res;
-        }
-        for (let i in this.order.Order.Barcodes) {
-            if (this.order.Order.Barcodes[i].Text === barcode) {
-                res = this.order.Order.Barcodes[i];
-                break;
-            }
-        }
-        return res;
-    }
-
-    /**
-     * 设置二维码
-     * @param {string} barcode 二维码
-     */
-    async setBarcode(barcode) {
-        let res = false;
-        let code = analyze.parse(barcode);
-        if (extend.isNull(code)) {
-            message.showError({
-                title: '无效条码'
-            });
-            return res;
-        }
-        let row = this.findBarcode(barcode);
-        if (extend.isObject(row)) {
-            message.showError({
-                title: '已经扫描过!'
-            });
-            return res;
-        }
-        res = true;
-        this.order.Order.Barcodes.push({
-            Text: barcode,
-            Scaned: true
-        });
-        return res;
-    }
-
-    /**
-     * 获取用户信息
-     */
-    async getUser() {
-        this.user = user.get();
-        if (extend.isNull(this.user)) {
-            let tok = await token.getByServer();
-            if (!tok.success) {
-                message.alert({
-                    title: '提示',
-                    content: '请登录后再试!',
-                    showCancel: false
-                });
-                return null;
-            }
-        }
-        return this.user;
-    }
-}

+ 0 - 497
src/Auman.PieceWage.UniApp/script/pickupOrder.js

@@ -1,497 +0,0 @@
-/**
- * 送货单解析
- */
-import extend from '../utils/extend.js';
-import analyze from '../utils/analyzeScannedContent.js';
-
-/**
- * 叉板类
- */
-class Fork {
-    /**
-     * 确认标记
-     */
-    Confirmed = false;
-
-    /**
-     * 叉板号
-     */
-    ForkNumber = 0;
-
-    /**
-     * 叉板数量
-     */
-    ForkQty = 0;
-
-    /**
-     * 条码集合
-     */
-    Barcodes = new Map();
-}
-
-/**
- * 完工送货单
- */
-class Order {
-    /**
-     * 订单
-     */
-    order = null;
-
-    /**
-     * 条码集合
-     */
-    barcodes = new Map();
-
-    /**
-     * 提货单号集合
-     */
-    orderNumbers = new Map();
-
-    /**
-     * 叉板数据集合
-     */
-    forks = new Map();
-
-    /**
-     * 叉板数据集合
-     */
-    currentFork = new Fork();
-
-    /**
-     * 提货单行列表
-     */
-    orderLines = [];
-
-    constructor(order) {
-        this.order = order;
-        this.init();
-    }
-
-    /**
-     * 初始化
-     */
-    init(order) {
-        this.order = order;
-        this.currentFork = new Fork();
-        this.barcodes.clear();
-        this.orderNumbers.clear();
-        this.forks.clear();
-        this.orderLines = [];
-
-        if (extend.isNull(this.order)) {
-            return;
-        }
-        this.orderLines = this.getAllLines();
-        this.initBarcodes();
-        this.initForks();
-    }
-
-    /**
-     * 设置二维码
-     */
-    initBarcodes() {
-        if (extend.isNull(this.order)) {
-            return;
-        }
-
-        this.barcodes.clear();
-        this.orderNumbers.clear();
-
-        if (extend.isArray(this.order.Orders)) {
-            for (let i in this.order.Orders) {
-                this.orderNumbers.set(this.order.Orders[i].OrderNumber, this.order.Orders[i].OrderNumber);
-                if (extend.isArray(this.order.Orders[i].Lines)) {
-                    for (let j in this.order.Orders[i].Lines) {
-                        if (extend.isArray(this.order.Orders[i].Lines[j].Barcodes)) {
-                            for (let k in this.order.Orders[i].Lines[j].Barcodes) {
-                                this.barcodes.set(this.order.Orders[i].Lines[j].Barcodes[k].Barcode, this.order
-                                    .Orders[i].Lines[
-                                        j].Barcodes[k]);
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * 设置叉板
-     */
-    initForks() {
-        if (extend.isNull(this.order)) {
-            return;
-        }
-        this.forks.clear();
-
-        for (let barcode of this.barcodes) {
-            let forkNumber = barcode.ForkNumber;
-
-            if (this.forks.has(forkNumber)) {
-                let fork = this.forks.get(forkNumber);
-                fork.Barcodes.set(barcode.Barcode, barcode);
-            } else {
-                let fork = new Fork();
-                fork.ForkNumber = forkNumber;
-                this.forks.set(forkNumber, fork);
-                fork.Barcodes.set(barcode.Barcode, barcode);
-            }
-        }
-
-        // 设置当前叉板
-        this.currentFork.Barcodes.clear();
-        this.currentFork.Confirmed = this.order.CurrentFork.Confirmed;
-        this.currentFork.ForkNumber = this.order.CurrentFork.ForkNumber;
-        this.currentFork.ForkQty = this.order.CurrentFork.ForkQty;
-    }
-
-    /**
-     * 同步数据
-     */
-    async () {
-        this.asyncBarcodes();
-        this.asyncOrderNumbers();
-    }
-
-    /**
-     * 同步二维码
-     */
-    asyncBarcodes() {
-        if (extend.isNull(this.order)) {
-            return;
-        }
-        if (extend.isArray(this.order.Orders)) {
-            for (let i in this.order.Orders) {
-                if (extend.isArray((this.order.Orders[i].Lines))) {
-                    for (let j in this.order.Orders[i].Lines) {
-                        let barcodes = [];
-                        for (let [key, value] of this.barcodes) {
-                            if (value.PickupOrderLineId === this.order.Orders[i].Lines[j].PickupOrderLineId) {
-                                barcodes.push(value);
-                            }
-                        }
-                        this.order.Orders[i].Lines[j].Barcodes = barcodes;
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * 同步提货单号列表
-     */
-    asyncOrderNumbers() {
-        if (extend.isNull(this.order)) {
-            return;
-        }
-        if (extend.isArray(this.order.Orders)) {
-            for (let i in this.order.Orders) {
-                this.order.OrderNumbers.push(this.order.Orders[i].OrderNumber);
-            }
-        }
-    }
-
-    /**
-     * 设置当前叉数
-     */
-    setCurrentFork() {
-        if (extend.isNull(this.order)) {
-            return;
-        }
-        this.order.CurrentFork.Confirmed = this.currentFork.Confirmed;
-        this.order.CurrentFork.ForkNumber = this.currentFork.ForkNumber;
-        this.order.CurrentFork.ForkQty = this.currentFork.ForkQty;
-    }
-
-    /**
-     * 当前叉数
-     */
-    get currentForkQty() {
-        let qty = 0;
-        if (extend.isObject(this.order) && extend.isObject(this.order.CurrentFork)) {
-            qty = this.order.CurrentFork.ForkQty || 0;
-        }
-        return qty;
-    }
-
-    /**
-     * 当前叉数
-     */
-    set currentForkQty(value) {
-        if (extend.isNumber(value) && extend.isObject(this.order)) {
-            this.order.CurrentFork.ForkQty = value;
-        }
-    }
-
-    /**
-     * 叉板数
-     */
-    get forkQty() {
-        let qty = 0;
-        if (extend.isObject(this.order)) {
-            qty = this.order.PickupedForkQty || 0;
-        }
-        return qty;
-    }
-
-    /**
-     * 当前叉数
-     */
-    set forkQty(value) {
-        if (extend.isNumber(value) && extend.isObject(this.order)) {
-            this.order.PickupedForkQty = value;
-        }
-    }
-
-    /**
-     * 送货单总数量
-     */
-    get quantity() {
-        let qty = 0;
-        for (let i in this.orderLines) {
-            qty += this.orderLines[i].Quantity;
-        }
-        return qty;
-    }
-
-    /**
-     * 送货扫描确认数量
-     */
-    get scanedQty() {
-        let qty = 0;
-        for (let i in this.orderLines) {
-            qty += this.orderLines[i].YSMSL;
-        }
-        return qty;
-    }
-
-    /**
-     * 剩余扫描数量
-     */
-    get remainQty() {
-        let qty = 0;
-        qty = this.quantity - this.scanedQty;
-        return qty;
-    }
-
-    /**
-     * 获取当前叉
-     */
-    getCurrentFork() {
-        let max = 0;
-        let fork = null;
-        if (this.forks.size > 0) {
-            for (let [key, value] of this.forks) {
-                if (key > max) {
-                    max = key;
-                }
-            }
-        }
-        if (max > 0) {
-            fork = this.forks.get(max);
-        }
-        return fork;
-    }
-
-    /**
-     * 获取已解析二维码数据列表
-     */
-    getBarcodeRows() {
-        let res = [];
-        let lines = this.orderLines;
-        for (let i in lines) {
-            for (let j in lines[i].Barcodes) {
-                let row = analyze.parse(lines[i].Barcodes[j].Barcode);
-                res.push(row);
-            }
-        }
-        this.sortBySerialNumber(res);
-        return res;
-    }
-
-    /**
-     * 根据流水码排序
-     */
-    sortBySerialNumber(rows) {
-        if (!extend.isArray(rows)) {
-            rows = [];
-        }
-        for (let i in rows) {
-            for (let j in rows) {
-                if (rows[i].SerialNumber < rows[j].SerialNumber) {
-                    let temp = rows[i];
-                    rows[i] = rows[j];
-                    rows[j] = temp;
-                    temp = null;
-                }
-            }
-        }
-        return rows;
-    }
-
-    /**
-     * 获取提货单列表
-     */
-    getOrderNumbers() {
-        return extend.mapValuesToArray(this.orderNumbers);
-    }
-
-    /**
-     * 获取全部提货单列表
-     */
-    getAllLines() {
-        let lines = [];
-        if (extend.isObject(this.order) && extend.isArray(this.order.Orders)) {
-            for (let i in this.order.Orders) {
-                if (extend.isArray(this.order.Orders[i].Lines)) {
-                    for (let j in this.order.Orders[i].Lines) {
-                        if (this.order.Orders[i].Lines[j].PickupOrderId === this.order.Orders[i].PickupOrderId) {
-                            lines.push(this.order.Orders[i].Lines[j]);
-                        }
-                    }
-                }
-            }
-        }
-        return lines;
-    }
-
-    /**
-     * 获取板式产品行
-     * @param {string} inventoryNumber 料号
-     * @returns {Array} 行列表
-     */
-    get1Lines(inventoryNumber) {
-        let res = [];
-        let lines = this.orderLines;
-        for (let i in lines) {
-            if (lines[i].InventoryNumber === inventoryNumber) {
-                res.push(lines[i]);
-            }
-        }
-        return res;
-    }
-
-    /**
-     * 获取定制产品行
-     * @param {string} inventoryNumber 料号
-     * @param {string} batchNumber 批次号
-     * @returns {Array} 行列表
-     */
-    get2Lines(inventoryNumber, batchNumber) {
-        let res = [];
-        let lines = this.orderLines;
-        for (let i in lines) {
-            if (lines[i].InventoryNumber === inventoryNumber && lines[i].OrderTotalNumber === batchNumber) {
-                res.push(lines[i]);
-            }
-        }
-        return res;
-    }
-
-    /**
-     * 获取板式产品总数
-     * @param {string} inventoryNumber 料号
-     * @returns {number} 板式产品总数
-     */
-    get1InventoryQty(inventoryNumber) {
-        let res = 0;
-        let lines = this.get1Lines(inventoryNumber);
-        for (let i in lines) {
-            res += lines[i].Quantity;
-        }
-        return res;
-    }
-
-    /**
-     * 获取定制产品总数
-     * @param {string} inventoryNumber 料号
-     * @param {string} batchNumber 批次号
-     * @returns {number} 定制产品总数
-     */
-    get2InventoryQty(inventoryNumber, batchNumber) {
-        let res = 0;
-        let lines = this.orderLines;
-        for (let i in lines) {
-            if (lines[i].InventoryNumber === inventoryNumber && lines[i].OrderTotalNumber === batchNumber) {
-                res += lines[i].Quantity;
-            }
-        }
-        return res;
-    }
-
-    /**
-     * 获取板式产品已扫描数
-     * @param {string} inventoryNumber 料号
-     */
-    get1InventoryScanedQty(inventoryNumber) {
-        let res = 0;
-        let lines = this.get1Lines(inventoryNumber);
-        for (let i in lines) {
-            res += lines[i].YSMSL;
-        }
-        return res;
-    }
-
-    /**
-     * 获取定制产品总数
-     * @param {string} inventoryNumber 料号
-     * @param {string} batchNumber 批次号
-     */
-    get2InventoryScanedQty(inventoryNumber, batchNumber) {
-        let res = 0;
-        let lines = this.orderLines;
-        for (let i in lines) {
-            if (lines[i].InventoryNumber === inventoryNumber && lines[i].OrderTotalNumber === batchNumber) {
-                res += lines[i].YSMSL;
-            }
-        }
-        return res;
-    }
-
-    /**
-     * 获取板式产品列表
-     * @param {string} inventoryNumber 料号
-     */
-    get1Inventorys(inventoryNumber) {
-        let res = [];
-        let lines = this.orderLines;
-        for (let i in lines) {
-            if (lines[i].InventoryNumber === inventoryNumber && lines[i].Quantity > lines[i].YSMSL) {
-                res.push(lines[i]);
-            }
-        }
-        return res;
-    }
-
-    /**
-     * 获取定制产品列表
-     * @param {string} inventoryNumber 料号
-     * @param {string} batchNumber 批次号
-     */
-    get2Inventorys(inventoryNumber, batchNumber) {
-        let res = [];
-        let lines = this.orderLines;
-        for (let i in lines) {
-            if (lines[i].InventoryNumber === inventoryNumber && lines[i].OrderTotalNumber === batchNumber) {
-                res.push(lines[i]);
-            }
-        }
-        return res;
-    }
-
-    /**
-     * 获取未扫描列表
-     */
-    getUnScanedLines() {
-        let res = [];
-        for (let i in this.orderLines) {
-            if (this.orderLines[i].YSMSL < this.orderLines[i].Quantity) {
-                res.push(this.orderLines[i]);
-            }
-        }
-        return res;
-    }
-}
-
-export default Order;

+ 0 - 531
src/Auman.PieceWage.UniApp/script/shipPlanOrder.js

@@ -1,531 +0,0 @@
-/**
- * 完工单解析
- */
-import extend from '../utils/extend.js';
-import analyze from '../utils/analyzeScannedContent.js';
-import shipPlanEnum from '../utils/shipPlanEnum.js';
-import user from '../utils/user.js';
-import message from '../utils/message.js';
-
-/**
- * 完工送货单
- */
-export default class {
-    /**
-     * 订单
-     */
-    order = null;
-
-    /**
-     * 订单编码
-     */
-    orderNumber = '';
-
-    id = -100;
-
-    user = null;
-
-    constructor(order) {
-        this.order = order || null;
-        this.user = user.get() || {};
-        this.init();
-    }
-
-    /**
-     * 初始化
-     */
-    init(order) {
-        if (!(extend.isObject(order) || extend.isObject(this.order) || order === null)) {
-            return;
-        }
-        this.order = order;
-
-        if (order === null) {
-            return;
-        }
-    }
-
-    /**
-     * 计划扫码状态
-     */
-    get planScanStatus() {
-        let res = 0;
-        if (extend.isObject(this.order) && extend.isNumber(this.order.PlanScanStatus)) {
-            res = this.order.PlanScanStatus;
-        }
-        return res;
-    }
-
-    /**
-     * 装车计划号
-     */
-    get shipPlanId() {
-        let res = 0;
-        if (extend.isObject(this.order) && extend.isNumber(this.order.ShipPlanId)) {
-            res = this.order.ShipPlanId;
-        }
-        return res;
-    }
-
-    /**
-     * 装车计划号
-     */
-    get planNumber() {
-        let res = '';
-        if (extend.isObject(this.order) && extend.isString(this.order.PlanNumber)) {
-            res = this.order.PlanNumber;
-        }
-        return res;
-    }
-
-    /**
-     * 装车计划总件数
-     */
-    get totalPackeagQty() {
-        let res = 0;
-        if (extend.isObject(this.order) && extend.isNumber(this.order.TotalPackeagQty)) {
-            res = this.order.TotalPackeagQty;
-        }
-        return res;
-    }
-
-    /**
-     * 已扫描总件数
-     */
-    get totalScanedQty() {
-        let res = 0;
-        if (extend.isObject(this.order) && extend.isNumber(this.order.TotalScanedQty)) {
-            res = this.order.TotalScanedQty;
-        }
-        return res;
-    }
-
-    /**
-     * 剩余未扫码数量
-     */
-    get totalUnScanedQty() {
-        let res = 0;
-        if (extend.isObject(this.order) && extend.isNumber(this.order.TotalUnScanedQty)) {
-            res = this.order.TotalUnScanedQty;
-        }
-        return res;
-    }
-
-    /**
-     * 欠货件数
-     */
-    get totalOweQty() {
-        let res = 0;
-        if (extend.isObject(this.order) && extend.isNumber(this.order.TotalOweQty)) {
-            res = this.order.TotalOweQty;
-        }
-        return res;
-    }
-
-    /**
-     * 剩货件数
-     */
-    get totalRemainQty() {
-        let res = 0;
-        if (extend.isObject(this.order) && extend.isNumber(this.order.TotalRemainQty)) {
-            res = this.order.TotalRemainQty;
-        }
-        return res;
-    }
-
-    /**
-     * 剩货件数
-     */
-    get totalAddedQty() {
-        let res = 0;
-        if (extend.isObject(this.order) && extend.isNumber(this.order.TotalAddedQty)) {
-            res = this.order.TotalAddedQty;
-        }
-        return res;
-    }
-
-    /**
-     * 所有行
-     */
-    get lines() {
-        let lines = [];
-        if (extend.isObject(this.order) && extend.isArray(this.order.Lines)) {
-            this.countLinesQty(this.order.Lines);
-            lines = this.order.Lines;
-        }
-        return lines;
-    }
-
-    /**
-     * 欠货列表
-     */
-    get oweLines() {
-        let lines = [];
-        if (extend.isObject(this.order) && extend.isArray(this.order.Lines)) {
-            for (let i = 0; i < this.order.Lines.length; i++) {
-                if (extend.isNumber(this.order.Lines[i].OweQty) && this.order.Lines[i].OweQty > 0) {
-                    lines.push(this.order.Lines[i]);
-                }
-            }
-        }
-        return lines;
-    }
-
-    /**
-     * 剩货列表
-     */
-    get remainLines() {
-        let lines = [];
-        if (extend.isObject(this.order) && extend.isArray(this.order.Lines)) {
-            for (let i = 0; i < this.order.Lines.length; i++) {
-                if (extend.isNumber(this.order.Lines[i].RemainQty) && this.order.Lines[i].RemainQty > 0) {
-                    lines.push(this.order.Lines[i]);
-                }
-            }
-        }
-        return lines;
-    }
-
-    /**
-     * 加货列表
-     */
-    get addLines() {
-        let lines = [];
-        if (extend.isObject(this.order) && extend.isArray(this.order.Lines)) {
-            for (let i = 0; i < this.order.Lines.length; i++) {
-                if (this.order.Lines[i].Type === shipPlanEnum.ShipPlanPackageInfoType.PDAScan) {
-                    lines.push(this.order.Lines[i]);
-                }
-            }
-        }
-        return lines;
-    }
-
-    /**
-     * 叉板列表
-     */
-    get forks() {}
-
-    /**
-     * 计算行数量
-     */
-    countLinesQty(lines) {
-        if (!extend.isArray(lines)) {
-            lines = [];
-        }
-        for (let i in lines) {
-            lines[i].ScanQty = 0;
-            lines[i].RemainQty = 0;
-            lines[i].AddedQty = 0;
-            if (extend.isArray(lines[i].Barcodes)) {
-                for (let j in lines[i].Barcodes) {
-                    if (lines[i].Barcodes[j].Status === shipPlanEnum.ShipPlanPackageBarcodeStatus.Scaned) {
-                        lines[i].ScanQty++;
-                    } else if (lines[i].Barcodes[j].Status === shipPlanEnum
-                        .ShipPlanPackageBarcodeStatus.Remain) {
-                        lines[i].Remain++;
-                    } else if (lines[i].Barcodes[j].Status === shipPlanEnum
-                        .ShipPlanPackageBarcodeStatus.Added) {
-                        lines[i].Added++;
-                    }
-                }
-            }
-        }
-        return lines;
-    }
-
-    /**
-     * 通过条码查找产品列表
-     */
-    searchLinesByBarcode(barcode) {
-        let lines = [];
-        if (extend.isNull(this.order)) {
-            return lines;
-        }
-        if (!extend.isArray(this.order.Lines)) {
-            this.order.Lines = [];
-        }
-        for (let i = 0; i < this.order.Lines.length; i++) {
-            if (!extend.isArray(this.order.Lines[i].Barcodes)) {
-                this.order.Lines[i].Barcodes = [];
-            }
-            for (let j = 0; j < this.order.Lines[i].Barcodes.length; j++) {
-                if (barcode === this.order.Lines[i].Barcodes[j].Barcode) {
-                    if ((this.order.PlanScanStatus === shipPlanEnum.ScanStatus.Adding || this.order
-                            .PlanScanStatus === shipPlanEnum.ScanStatus.UnAdd) && this.order.Lines[i].Barcodes[j]
-                        .Barcode.Type != 1) {
-                        continue;
-                    }
-                    lines.push(this.order.Lines[i]);
-                    break;
-                }
-            }
-        }
-        return lines;
-    }
-
-    /**
-     * 通过料号查找不存在条码的产品列表
-     * @param {string} barcode 条码
-     */
-    searchNonBarcodeInLinesByInventoryNumber(barcode) {
-        let lines = [];
-        if (extend.isNull(this.order)) {
-            return lines;
-        }
-        if (!extend.isArray(this.order.Lines)) {
-            this.order.Lines = [];
-        }
-        if (!extend.isString(barcode) || barcode.length != 36) {
-            return message.showError({
-                title: '无效条码',
-            });
-        }
-        let isFind = false;
-        let code = analyze.parse(barcode);
-        for (let i in this.order.Lines.length) {
-            isFind = false;
-            if (barcode !== code.InventoryNumber) {
-                continue;
-            }
-            if (barcode === this.order.Lines[i].Barcode) {
-                for (let j in this.order.Lines[i].Barcodes) {
-                    if (barcode === this.order.Lines[i].Barcodes[j].Barcode) {
-                        isFind = true;
-                        break;
-                    }
-                }
-
-                if (!isFind) {
-                    lines.push(this.order.Lines[i]);
-                }
-            }
-        }
-        return lines;
-    }
-
-    /**
-     * 设置二维码
-     * @param {string} barcode 条码
-     */
-    async setBarcode(barcode) {
-        if (extend.isNull(this.order)) {
-            return;
-        }
-        let isAdd = false;
-        let lines = this.searchLinesByBarcode(barcode);
-
-        // 如果有就该状态,没有就新增
-        if (lines.length > 0) {} else {
-            if (order.order.PlanScanStatus === shipPlanEnum.ScanStatus.Adding || order.order.planScanStatus ===
-                shipPlanEnum.ScanStatus.UnAdd) {
-                isAdd = true;
-                // 获取加货产品行
-                let line = await this.getAddLinesByInventoryNumber(barcode);
-
-                if (extend.isObject(line)) {
-                    lines.push(line);
-                }
-            } else {
-                // 通过条码和产品编码获取产品列表
-                let line = 1;
-                lines = this.searchNonBarcodeInLinesByInventoryNumber(barcode);
-
-                // 插入产品行
-                this.insertLines(lines);
-            }
-        }
-
-        if (lines.length === 0 && !isAdd) {
-            return message.showError({
-                title: '无效条码',
-            });
-        }
-
-        // 更新产品行
-        this.insertLines(lines);
-    }
-
-    /**
-     * 插入产品行
-     */
-    insertLines(lines) {
-        if (!extend.isArray(lines)) {
-            return;
-        }
-        for (let i in lines) {
-            if (this.order.PlanScanStatus === shipPlanEnum.ScanStatus.Default) {
-                // 正常
-                if (lines[i].ScanQty === lines[i].Quantity) {
-                    return message.error({
-                        title: '提示',
-                        content: '已达数量上限'
-                    });
-                }
-                lines[i].Barcodes.push({
-                    ShipPlanPackageId: lines.Id,
-                    Barcode: barcode,
-                    Status: shipPlanEnum.ShipPlanPackageBarcodeStatus.Scaned,
-                    ScanBy: this.user.UserName,
-                    ForkNumber: this.order.CurrentFork.ForkNumber
-                });
-            } else if (this.order.planScanStatus === shipPlanEnum.ScanStatus.Adding) {
-                // 加货
-                if (!extend.isNumber(lines[i].Quantity)) {
-                    lines[i].Quantity = 0;
-                }
-                lines[i].Quantity++;
-                lines[i].Barcodes.push({
-                    ShipPlanPackageId: lines.Id,
-                    Barcode: barcode,
-                    Status: shipPlanEnum.ShipPlanPackageBarcodeStatus.Added,
-                    ScanBy: this.user.UserName,
-                    ForkNumber: this.order.CurrentFork.ForkNumber
-                });
-            }
-        }
-    }
-
-    /**
-     * 更新产品行
-     */
-    updateLines(lines) {
-        if (!extend.isArray(lines)) {
-            return;
-        }
-        for (let i in lines) {
-            if (this.order.PlanScanStatus === shipPlanEnum.ScanStatus.Default) {
-                // 正常
-                if (lines[i].Status === shipPlanEnum.ShipPlanPackageBarcodeStatus.Scaned) {
-                    if (extend.isNull(lines[i].ForkNumber)) {
-                        lines[i].ForkNumber = this.order.CurrentFork.ForkNumber;
-                    }
-                } else if(lines[i].Status === shipPlanEnum.ShipPlanPackageBarcodeStatus.Added) {
-                    return message.showError({
-                        title: '已扫描'
-                    });
-                } else {
-                    lines[i].Status = shipPlanEnum.ShipPlanPackageBarcodeStatus.Scaned;
-                    lines[i].ForkNumber = this.order.CurrentFork.ForkNumber;
-                }
-            } else if (this.order.PlanScanStatus === shipPlanEnum.ScanStatus.Remain) {
-                // 剩货
-                if (lines[i].Status === shipPlanEnum.ShipPlanPackageBarcodeStatus.Scaned) {
-                    lines[i].Status = shipPlanEnum.ShipPlanPackageBarcodeStatus.Remain;
-                } else if (lines[i].Status === shipPlanEnum.ShipPlanPackageBarcodeStatus.Remain) {
-                    return message.showError({
-                        title: '已扫描'
-                    });
-                } else if (lines[i].Status === shipPlanEnum.ShipPlanPackageBarcodeStatus.Added) {
-                    return message.error({
-                        title: '提示',
-                        content: '此为加货'
-                    });
-                } else {
-                    return message.error({
-                        title: '提示',
-                        content: '不是本车已扫描的条码!'
-                    });
-                }
-            } else if (this.order.PlanScanStatus === shipPlanEnum.ScanStatus.Adding) {
-                // 加货
-                if (lines[i].Status === shipPlanEnum.ShipPlanPackageBarcodeStatus.Added) {
-                    return message.showError({
-                        title: '已扫描'
-                    });
-                } else if (lines[i].Status === shipPlanEnum.ShipPlanPackageBarcodeStatus.UnAdded) {
-                    lines[i].Status = shipPlanEnum.ShipPlanPackageBarcodeStatus.Added;
-                    lines[i].ForkNumber = this.order.CurrentFork.ForkNumber;
-                } else {
-                    return message.error({
-                        title: '提示',
-                        content: '不是加货条码'
-                    });
-                }
-            } else if (this.order.PlanScanStatus === shipPlanEnum.ShipPlanPackageBarcodeStatus.UnAdded) {
-                if (lines[i].Status === shipPlanEnum.ShipPlanPackageBarcodeStatus.Added) {
-                    lines[i].Status = shipPlanEnum.ShipPlanPackageBarcodeStatus.UnAdded;
-                } else if (lines[i].Status === shipPlanEnum.ShipPlanPackageBarcodeStatus.UnAdded) {
-                    return message.showError({
-                        title: '已扫描',
-                        icon: 'error'
-                    });
-                } else {
-                    return message.showError({
-                        title: '提示',
-                        content: '不是加货条码'
-                    });
-                }
-            }
-        }
-    }
-
-    /**
-     * 获取装车计划
-     * @param {string} orderNumber 装车计划号
-     */
-    async getShipPlan(orderNumber) {
-        let res = await request.sendToken({
-            url: `api/PDAScan/GetShipPlanLineByOrderNumber?shipOrderNumber=${this.orderNumber}`,
-            method: 'post'
-        });
-        if (res.success) {
-            if (extend.isObject(res.data.Result)) {
-                this.init(res.data.Result);
-            }
-        } else {
-            message.alert({
-                title: '错误',
-                content: res.message,
-                showCancel: false
-            });
-        }
-    }
-
-    /**
-     * 获取单行
-     * @param {string} barcode 条码
-     */
-    async getAddLinesByInventoryNumber(barcode) {
-        let coder = analyze.parse(barcode);
-        if (coder === null) {
-            return;
-        }
-        let line = null;
-        let res = await request.sendToken({
-            url: `api/PDAScan/GetShipPlanPackageInfByInventoryNumer?inventoryNumer=${coder.InventoryNumber}`,
-            method: 'get'
-        });
-        if (res.success) {
-            if (extend.isObject(res.data.Result)) {
-                line = res.data.Result;
-                line.Type = shipPlanEnum.ShipPlanPackageInfoType.PDAScan;
-                id--;
-                line.Id = id;
-                line.ShipPlanId = this.order.ShipPlanId;
-                this.order.Lines.push(line);
-            } else {
-                message.error({
-                    title: '错误',
-                    content: '未获取到数据!'
-                });
-            }
-        } else {
-            message.alert({
-                title: '错误',
-                content: res.message,
-                showCancel: false
-            });
-        }
-        return line;
-    }
-}
-
-class ShipPlanPackageInfo {
-    Barcode = '';
-    CompletionConfirmed = 0;
-    CompletionConfirmedOn = null;
-    CompletionOrderLineId = 0;
-    WarehouseConfirmed = 0;
-    WarehouseConfirmedOn = null;
-}

+ 15 - 0
src/Auman.PieceWage.UniApp/script/status.js

@@ -0,0 +1,15 @@
+/**
+ * 状态
+ */
+
+export default {
+    /**
+     * 生产订单
+     */
+    dispatchOrder {
+        /**
+         * 待派工
+         */
+        dispatching: 1
+    }
+};

+ 8 - 0
src/Auman.PieceWage.UniApp/styles/main.css

@@ -15,6 +15,14 @@ text {
     position: fixed;
 }
 
+.box-content {
+    box-sizing: content-box;
+}
+
+.box-border {
+    box-sizing: border-box;
+}
+
 .width-0 {
     width: 0;
 }