From 162eca31378c749b8f70c32ce2ed988b1101e881 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@63.com>
Date: 星期五, 19 八月 2022 09:15:09 +0800
Subject: [PATCH] #
---
static/js/object/StaTask.js | 74 ++++++++++++++++++++-----------------
1 files changed, 40 insertions(+), 34 deletions(-)
diff --git a/static/js/object/StaTask.js b/static/js/object/StaTask.js
index 8361935..4c72efc 100644
--- a/static/js/object/StaTask.js
+++ b/static/js/object/StaTask.js
@@ -1,65 +1,71 @@
-
-
-
+import {InitPallet, InitGoods} from './StoreGoods.js';
// 杈撻�佺嚎褰撳墠杩愯鐘舵�佸璞�
function StaTask(staData, object) {
let that = this;
+ that.object = object;
+
that.no = 0;
+ that.objectType = null;
+ that.isDel = false;
+ that.readyIn = false;
that.run = false;
that.loaded = 0;
+ that.wrkNo = null;
that.inlet = -1;
that.outlet = -1;
+
+ that.position = null;
let init = function () {
that.no = staData.no;
that.inlet = staData.inlet;
that.outlet = staData.outlet;
+
+ let item = getArrVal(conveyObjects.objects, "no", that.no+"");
+ if (!that.position && item) {
+ that.objectType = item.objectType;
+ that.position = item.position;
+ }
+ if (!item) {
+ that.isDel = true;
+ }
}
init();
that.modify = function (staData) {
- if (that.run || that.no === 0) {
- console.error(staData.no + "鍙疯緭閫佺嚎鏇存柊澶辫触");
+ if (that.no === 0) {
return;
}
- if (that.loaded === 0 && staData.loaded === 1) {
- // 鏃犺揣 ===>> 鏈夎揣
+ // 娣诲姞
+ if (staData.loaded === 1 && staData.wrkNo && staData.wrkNo !== '0' && that.wrkNo !== staData.wrkNo) {
+ if (that.outlet !== 1) { // 鐢卞爢鍨涙満鍑哄簱锛屼笉闇�瑕佹坊鍔爉odel
+ if (that.loaded === 1) {
+ console.log("sta_" + that.no + " remove锛�" + that.wrkNo + "-Pallet锛� " + that.wrkNo + "-Goods");
+ that.object.removeObject(that.wrkNo + "-Pallet");
+ that.object.removeObject(that.wrkNo + "-Goods");
+ }
- // 1.鍏ュ簱绗竴绔� 銆愭柊澧炪��
- if (that.inlet === 1) {
-
-
- // 2.鏉ヨ嚜鍏朵粬绔欑偣鐨勮揣鐗� 銆愮Щ鍔ㄣ��
- } else {
-
+ InitPallet(that.object, [{wrkNo: staData.wrkNo}], {position: that.position, objectType: that.objectType}, 2);
+ InitGoods(that.object, [{wrkNo: staData.wrkNo}], {position: that.position, objectType: that.objectType}, 2);
}
-
- }
- if (that.loaded === 1 && staData.loaded === 0) {
- // 鏈夎揣 ===>> 鏃犺揣
-
- // 1.鍑哄簱鏈�鍚庝竴绔� 銆愮Щ闄ゃ��
- if (that.outlet === 1) {
-
- }
-
}
- // 瀹炴椂鏇存柊
+ // 绉婚櫎
+ if (staData.loaded === 0) {
+ if (that.loaded === 1 && that.wrkNo && that.wrkNo !== '0') {
+ if (that.inlet !== 1) { // 鍫嗗灈鏈洪渶瑕佹惉杩愶紝涓嶈兘鐩存帴绉婚櫎
+ that.object.removeObject(that.wrkNo + "-Pallet");
+ that.object.removeObject(that.wrkNo + "-Goods");
+ }
+ }
+ }
+
that.loaded = staData.loaded;
-
- that.run = true;
-
- }
-
- that.change = function () {
-
-
-
+ that.wrkNo = staData.wrkNo;
}
}
--
Gitblit v1.9.1