Browse Source

1.1 超级管理员修改项目所属运营商经销商默认显示全部经销商bug修正

64060764@qq.com 1 year ago
parent
commit
6a64c32013

+ 3 - 0
src/api/consumble.js

@@ -79,6 +79,9 @@ export async function updateConsumptionAlgorithmType(data) {
 export async function deleteConsumptionAlgorithmType(data) {
   return post(base + "consumables_management/type/delete", data);
 }
+export async function forceReset(data) {
+  return post(base + "consumables_management/force_reset", data);
+}
 
 export async function syncRunTime(data) {
   return post('http://linksee-box-api.linkseeiot.com/api/transport/syncRuntime', data);

+ 3 - 3
src/permission.js

@@ -17,9 +17,9 @@ router.beforeEach(async (to, from, next) => {
   // start progress bar
   NProgress.start();
   console.log(to);
-  // if (to.path) {
-  //   window._hmt.push(['_trackPageview', '/#' + to.fullPath]);
-  // }
+  if (to.path) {
+    window._hmt.push(['_trackPageview', '/#' + to.fullPath]);
+  }
   // set page title
   document.title = getPageTitle(to.meta.title);
 

+ 5 - 1
src/views/eng-management/eng-pro-list/add.vue

@@ -958,9 +958,12 @@ export default {
       }
     },
     async distributorListFnc () {
+      console.log('this.distributorOptionChange(this.operateSubjectForm.operator_id)',this.operateSubjectForm.operator_id)
+      // await this.distributorOptionChange(this.operateSubjectForm.operator_id)
       const res = await distributorList({
         page_index: 0,
-        page_size: 100
+        page_size: 100,
+        operator_id: this.operateSubjectForm.operator_id
       });
       if (res.code === 200) {
         this.distributorOption = res.result.data;
@@ -971,6 +974,7 @@ export default {
       }
     },
     async distributorOptionChange (val) {
+      console.log('///////distributorOptionChange');
       const res = await getDistributorFromOperator({
         operator_id: this.operateSubjectForm.operator_id
       });

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

@@ -3,6 +3,7 @@ import {
   publishAdvanceConf,
   pulishIoUnit
 } from '@/api/box-debug-mqtt'
+import {forceReset} from "@/api/consumble";
 // JSON转义并请求
 // 控制器命令
 export async function sendConsumablesMessage(
@@ -112,3 +113,27 @@ export async function addIoUnitMessage(
   const res = await pulishIoUnit(req)
   return res
 }
+export async function sendForceResetMessage(
+    newtrend_order,
+    box_id,
+    order = 0,
+    uuid,
+    ctrl,
+    body
+) {
+  const req = {
+    box_id,
+    content: JSON.stringify({
+      newtrend_order,
+      order,
+      uuid,
+      ctrl,
+      content: body
+    }),
+    client: 'vue-' + +new Date()
+  }
+  console.log({ box_id, order, ctrl, body })
+
+  const res = await forceReset(req)
+  return res
+}

+ 17 - 2
src/views/oa-management/consumble-watch/index.vue

@@ -337,7 +337,7 @@
 		resetConsumable,
 		consumableDetail,
 		consumptionAlgorithmTypeList,
-		toWorkOrder, syncRunTime
+		toWorkOrder, syncRunTime, forceReset
 	} from "@/api/consumble";
 import { currentUserName } from "@/utils/trace";
 import { getBoxDetail, getProjectList } from "@/api/box";
@@ -346,7 +346,11 @@ import DeleteIcon from "@/assets/consumable/Delete.png";
 import EditIcon from "@/assets/consumable/edit-button.png";
 import RefreshIcon from "@/assets/consumable/refresh.png";
 import {pulishRunStat} from "@/api/box-debug-mqtt";
-	import {sendConsumablesMessage, sendCtrlMessage} from "@/views/equip-management/box-debug-rebuild/public-method";
+	import {
+		sendConsumablesMessage,
+		sendCtrlMessage,
+		sendForceResetMessage
+	} from "@/views/equip-management/box-debug-rebuild/public-method";
 export default {
 	components: {
 		OperateConsumble
@@ -533,6 +537,17 @@ export default {
 				cancelButtonText: "取消",
 				type: "warning"
 			}).then(async () => {
+				const res0 = await sendForceResetMessage(
+						row.newtrend_order,
+						row.box_id,
+						row.order,
+						row.uuid,
+						"newtrend",
+						[{ key: 'consumables', value: 0 }]
+				);
+				if (res0.code === 200){
+					console.log('force_reset')
+				}
 				//下发mqtt,value=0给盒子
 				const res = await sendConsumablesMessage(
 						row.newtrend_order,