#1
luxiaotao1123
2022-04-06 a8b76a8b91cc0034aa05b50520ed8dcf74bedb21
static/js/object/StaTask.js
@@ -1,6 +1,4 @@
import {StoreGoods} from './StoreGoods.js';
// 输送线当前运行状态对象
function StaTask(staData, object) {
@@ -8,19 +6,58 @@
    that.no = 0;
    that.run = false;
    that.loaded = 0;
    that.inlet = -1;
    that.outlet = -1;
    let init = function () {
        that.no = staData.no;
        that.inlet = staData.inlet;
        that.outlet = staData.outlet;
    }
    init();
    that.modify = function (staData) {
        if (that.run || that.no === 0) {
            console.error(staData.no + "号输送线更新失败");
            return;
        }
        if (that.loaded === 0 && staData.loaded === 1) {
            // 无货 ===>> 有货
            // 1.入库第一站 【新增】
            if (that.inlet === 1) {
            // 2.来自其他站点的货物 【移动】
            } else {
            }
        }
        if (that.loaded === 1 && staData.loaded === 0) {
            // 有货 ===>> 无货
            // 1.出库最后一站 【移除】
            if (that.outlet === 1) {
            }
        }
        // 实时更新
        that.loaded = staData.loaded;
        that.run = true;
    }
    that.change = function () {
        console.log(1)
    }
}
export {StaTask}