|
@@ -114,10 +114,12 @@
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
|
|
|
- <span>
|
|
|
-{{scope.row.name}}{{scope.row.newtrend_order}}
|
|
|
+ <span v-if="scope.row.newtrend_order.length>0">
|
|
|
+{{scope.row.name}}[{{scope.row.newtrend_order}}]
|
|
|
+ </span>
|
|
|
+ <span v-else="scope.row.newtrend_order.length>0">
|
|
|
+{{scope.row.name}}
|
|
|
</span>
|
|
|
-
|
|
|
|
|
|
</template>
|
|
|
|
|
@@ -329,14 +331,14 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import {
|
|
|
- consumablesList,
|
|
|
- deleteConsumable,
|
|
|
- resetConsumable,
|
|
|
- consumableDetail,
|
|
|
- consumptionAlgorithmTypeList,
|
|
|
- toWorkOrder
|
|
|
-} from "@/api/consumble";
|
|
|
+ import {
|
|
|
+ consumablesList,
|
|
|
+ deleteConsumable,
|
|
|
+ resetConsumable,
|
|
|
+ consumableDetail,
|
|
|
+ consumptionAlgorithmTypeList,
|
|
|
+ toWorkOrder, syncRunTime
|
|
|
+ } from "@/api/consumble";
|
|
|
import { currentUserName } from "@/utils/trace";
|
|
|
import { getBoxDetail, getProjectList } from "@/api/box";
|
|
|
import OperateConsumble from "./operate-consumble";
|
|
@@ -567,19 +569,27 @@ export default {
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning"
|
|
|
}).then(async () => {
|
|
|
- const res = await sendCtrlMessage(
|
|
|
- row.box_id,
|
|
|
- row.newtrend_order,
|
|
|
- "newtrend",
|
|
|
- [{ key: 'consumables', value: row.utilization_rate }]
|
|
|
- );
|
|
|
- if (res.code === 200) {
|
|
|
+ const r = await syncRunTime({
|
|
|
+ box_id: row.box_id,
|
|
|
+ });
|
|
|
+ if (r.code === 200) {
|
|
|
+ console.log('////////////r is:',r)
|
|
|
+ const res = await sendCtrlMessage(
|
|
|
+ row.box_id,
|
|
|
+ row.newtrend_order,
|
|
|
+ "newtrend",
|
|
|
+ [{ key: 'consumables', value: r.result[0].count }]
|
|
|
+ );
|
|
|
+ if (res.code === 200) {
|
|
|
this.$notify({
|
|
|
message: "恢复耗材使用率成功",
|
|
|
type: "success"
|
|
|
});
|
|
|
await this.consumablesListFunc();
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
//下发mqtt,value=!0给盒子
|
|
|
// const req = {
|
|
|
// box_id:row.box_id,
|