Browse Source

增加原始记录切换按钮

zhangafei 1 week ago
parent
commit
686b18d172

+ 1 - 1
src/views/billet/operator/components/car.vue

@@ -265,7 +265,7 @@
     }
   };
 
-  const { start, stop } = useTimeoutFn(getInfo, 10000, true);
+  const { start, stop } = useTimeoutFn(getInfo, 10000);
 
   // 获取堆垛机堆垛信息
   // 获取当前堆垛信息

+ 1 - 1
src/views/billet/operator/components/headTop.vue

@@ -289,7 +289,7 @@
     }
   };
 
-  const { start, stop } = useTimeoutFn(getInfo, 5000, true);
+  const { start, stop } = useTimeoutFn(getInfo, 5000);
 
   // 换炉
   const changeHeatLoading = ref(false);

+ 23 - 4
src/views/billet/operator/components/printOriginalRecords.vue

@@ -38,6 +38,10 @@
               "
               >送样卡</a-button
             >
+
+            <a-button style="margin-left: 12px" v-if="isShowSwitchBtn" type="primary" @click="switchOrgRecord">{{
+              !isOrg ? '原始记录' : '送样卡记录'
+            }}</a-button>
           </div>
           <p style="font-size: 24px; font-weight: 800; display: inline-block; margin-bottom: 16px; line-height: 30px">
             <span class="ccmno">{{ hostNumber }}</span> #机推钢室生产原始记录
@@ -759,11 +763,11 @@
   const mainSize = ref('');
   const mainOrgRemark = ref('');
   const mainRemark = ref('');
-  const getHeatList = async (params) => {
+  const isShowSwitchBtn = ref(false);
+  const getHeatList = async (params, isSwitch = false) => {
     try {
       changeLoading(true);
-      console.log('11111111111111111111', lastOrgDataStatus.value);
-      const fetchFunc = Number(lastOrgDataStatus.value) >= 2 ? getSampleCardList : queryBilletRecordByCcmNo;
+      const fetchFunc = isSwitch ? queryBilletRecordByCcmNo : Number(lastOrgDataStatus.value) >= 2 ? getSampleCardList : queryBilletRecordByCcmNo;
       const { billetOriginalProductRecordList, content, sizeInfo, confirmStatus } = await fetchFunc(params);
       let newArr: any[] = [];
       mainOrgSize.value = sizeInfo || '';
@@ -771,7 +775,8 @@
       mainRemark.value = content || '';
       mainOrgRemark.value = content || '';
       isEditAbled.value = confirmStatus === 3;
-      console.log('1111111111111111', isEditAbled.value);
+      // 是否显示原始记录切换按钮
+      isShowSwitchBtn.value = confirmStatus >= 2;
       if (billetOriginalProductRecordList && Array.isArray(billetOriginalProductRecordList)) {
         // 根据时间排序
         newArr = billetOriginalProductRecordList.sort((a, b) => {
@@ -1939,6 +1944,20 @@
     }
   };
 
+  // 切换原始记录和二次确认的记录
+  const isOrg = ref(false);
+  const switchOrgRecord = throttle(() => {
+    isOrg.value = !isOrg.value;
+    getHeatList(
+      {
+        ccmNo: hostNumber.value,
+        queryType: fetchQueryType.value,
+        changeShiftId: fetchChangeShiftId.value,
+      },
+      isOrg.value
+    );
+  }, 500);
+
   function onPrint() {
     changeOkLoading(true);
     printJS({