Browse Source

1.1 盒子添加修改增加uuid耗材关联

64060764@qq.com 1 year ago
parent
commit
e7190e8f27

+ 2 - 0
src/views/equip-management/box-debug-rebuild/public-method/index.js

@@ -9,6 +9,7 @@ export async function sendCtrlMessage(
     newtrend_order,
   box_id,
   order = 0,
+    uuid,
   ctrl,
   body
 ) {
@@ -17,6 +18,7 @@ export async function sendCtrlMessage(
     content: JSON.stringify({
       newtrend_order,
       order,
+      uuid,
       ctrl,
       content: body
     }),

+ 14 - 1
src/views/equip-management/box-manage/index.vue

@@ -207,7 +207,7 @@
 						type="text"
 						style="color: #FF4949;"
 						@click="deleteSelected(scope.row)"
-				>
+				>
 				</el-button>
 
 			</template>
@@ -308,6 +308,19 @@ export default {
 	methods: {
 		deleteSelected(row){
 			console.log('deleteSelected row is:',row)
+			if (this.checkedList.length == 0) { return }
+			this.checkedList = this.checkedList.filter(item => item.box_auto_id != row.box_auto_id)
+			//this.deleteRows([row])
+			if (this.checkedList && this.checkedList.find(item => item && (item.box_auto_id == row.box_auto_id))) {
+				this.addRows([row])
+			} else {
+				this.deleteRows([row])
+			}
+			// rows.forEach(row => {
+			// 	this.checkedList = this.checkedList.filter(item => item.box_auto_id != row.box_auto_id)
+			// })
+			console.log('delete then count is:',this.checkedList.length)
+			console.log('delete this.checkedList is',this.checkedList)
 		},
 		addRows (rows) {
 			console.log('rows is',rows)

+ 3 - 0
src/views/oa-management/consumble-watch/index.vue

@@ -535,6 +535,7 @@ export default {
 			}).then(async () => {
 				//下发mqtt,value=0给盒子
 				const res = await sendCtrlMessage(
+						row.uuid,
 						row.box_id,
 						row.newtrend_order,
 						"newtrend",
@@ -572,6 +573,7 @@ export default {
 				const r = await syncRunTime({
 					box_id: row.box_id,
 					newtrend_order: row.newtrend_order,
+					uuid: row.uuid,
 				});
 				if (r.code === 200) {
 					console.log('////////////r is:',r)
@@ -579,6 +581,7 @@ export default {
 							row.newtrend_order,
 							row.box_id,
 							r.result[0].order,
+							r.result[0].uuid,
 							"newtrend",
 							[{ key: 'consumables', value: r.result[0].count }]
 					);