Browse Source

原始记录可删除炉;
棒线可编辑为0

zhangafei 1 week ago
parent
commit
93f9f8bd23

+ 4 - 4
.env.development

@@ -5,15 +5,15 @@ VITE_USE_MOCK = false
 VITE_PUBLIC_PATH = /
 
 # 跨域代理,您可以配置多个 ,请注意,没有换行符
-VITE_PROXY = [["/jeecgboot","http://192.168.1.53:9999"],["/upload","http://localhost:3300/upload"]]
-# VITE_PROXY = [["/jeecgboot","http://192.168.1.6:9999"],["/upload","http://localhost:3300/upload"]]
+# VITE_PROXY = [["/jeecgboot","http://192.168.1.53:9999"],["/upload","http://localhost:3300/upload"]]
+VITE_PROXY = [["/jeecgboot","http://192.168.1.6:9999"],["/upload","http://localhost:3300/upload"]]
 # VITE_PROXY = [["/jeecgboot","http://192.168.0.119:9999"],["/upload","http://localhost:3300/upload"]]
 # VITE_PROXY = [["/jeecgboot","http://123.57.213.14:9898"],["/upload","http://localhost:3300/upload"]]
 
 #后台接口全路径地址(必填)
 # VITE_GLOB_DOMAIN_URL=http://localhost:9999
-# VITE_GLOB_DOMAIN_URL=http://192.168.1.6:9999
-VITE_GLOB_DOMAIN_URL=http://192.168.1.53:9999
+VITE_GLOB_DOMAIN_URL=http://192.168.1.6:9999
+# VITE_GLOB_DOMAIN_URL=http://192.168.1.53:9999
 # VITE_GLOB_DOMAIN_URL=http://192.168.0.119:9999
 # VITE_GLOB_DOMAIN_URL=http://123.57.213.14:9898
 

+ 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);

+ 97 - 6
src/views/billet/operator/components/orgData.vue

@@ -22,7 +22,7 @@
         </div>
         <div class="flex-1" style="text-align: right"> lg/R05 </div>
       </div>
-      <a-table :columns="columns" size="small" :data-source="dataSource" bordered :pagination="false">
+      <a-table :columns="columns" size="small" :data-source="dataSource" rowKey="id" bordered :pagination="false">
         <template #summary>
           <a-table-summary-row>
             <a-table-summary-cell :col-span="remakeColSpan" style="text-align: center">备注</a-table-summary-cell>
@@ -171,7 +171,7 @@
   import { ref, computed, h, onMounted } from 'vue';
   import dayjs from 'dayjs';
   import type { TableColumnsType } from 'ant-design-vue';
-  import { queryBilletRecordByCcmNo, editBilletRecord, addBilletNo, editOriginalProductRecord } from '../operator.api';
+  import { queryBilletRecordByCcmNo, editBilletRecord, addBilletNo, editOriginalProductRecord, deleteBilletRecord } from '../operator.api';
   import { render } from '/@/utils/common/renderUtils';
   import { isArray, isNumber } from '/@/utils/is';
   import Icon from '/@/components/Icon';
@@ -200,7 +200,6 @@
     return render.renderDict(value, dictCode);
   };
 
-  const paiHao = ref('5');
   // 主机号
   const hostNumber = ref('5');
   const defaultColumns: TableColumnsType = [
@@ -210,6 +209,44 @@
       dataIndex: 'SerialNumber',
       align: 'center',
       key: 'SerialNumber',
+      customRender: ({ text, record }) => {
+        if (!record.heatNo) return text;
+        const { orgData } = record;
+        return h(
+          'div',
+          {
+            style: { position: 'relative' },
+          },
+          [
+            h('span', {}, text),
+            h(
+              'div',
+              {
+                class: 'noprint delete-heat',
+                onClick: () => {
+                  console.log('record', orgData);
+                  createConfirm({
+                    iconType: 'warning',
+                    title: '删除确认',
+                    content: `确定删除【${record.heatNo}】吗?删除后无法恢复!`,
+                    onOk: () => {
+                      return deleteBilletRecord({
+                        id: orgData.id,
+                      }).then(() => {
+                        getHeatList({
+                          ...props.openData,
+                          hostNumber: hostNumber.value,
+                        });
+                      });
+                    },
+                  });
+                },
+              },
+              h(Icon, { icon: 'ant-design:delete-outlined', size: '20' }, '')
+            ),
+          ]
+        );
+      },
     },
     {
       title: '炉号',
@@ -217,6 +254,50 @@
       width: 100,
       align: 'center',
       key: 'heatNo',
+      customRender: ({ text, record }) => {
+        if (!record.heatNo) return '';
+        const { orgData } = record;
+        return h(Input, {
+          key: orgData.heatNo + record.keyDate,
+          bordered: false,
+          value: text,
+          onBlur: throttle(
+            (e) => {
+              const v = e.target.value.trim();
+              if (!v || orgData.heatNo === v) return;
+              createConfirm({
+                iconType: 'warning',
+                title: '交班确认',
+                content: `确定修改【${record.heatNo}】吗?`,
+                onOk: () => {
+                  return editBilletRecord({
+                    ...orgData,
+                    heatNo: v,
+                  }).then(() => {
+                    getHeatList({
+                      ccmNo: hostNumber.value,
+                      queryType: fetchQueryType.value,
+                      changeShiftId: fetchChangeShiftId.value,
+                    });
+                  });
+                },
+                onCancel: () => {
+                  getHeatList({
+                    ccmNo: hostNumber.value,
+                    queryType: fetchQueryType.value,
+                    changeShiftId: fetchChangeShiftId.value,
+                  });
+                },
+              });
+            },
+            500,
+            {
+              leading: true,
+              trailing: false,
+            }
+          ),
+        });
+      },
     },
     {
       title: '钢种',
@@ -224,7 +305,7 @@
       align: 'center',
       dataIndex: 'brandNum',
       key: 'brandNum',
-      customRender: ({ text, index, record }) => {
+      customRender: ({ text, record }) => {
         if (!record.heatNo) return '';
         const { orgData } = record;
         return h(
@@ -850,10 +931,13 @@
             });
           }
 
+          const curTime = new Date().getTime();
+
           return {
             ...item,
+            id: newArr[index].id || curTime,
             heatNo: newArr[index].heatNo,
-            keyDate: new Date().getTime(),
+            keyDate: curTime,
             brandNum: newArr[index].grade,
             oneFlow: newArr[index].oneStrandSum || '',
             twoFlow: newArr[index].twoStrandSum || '',
@@ -1428,7 +1512,7 @@
           };
         });
 
-      editSizeNumRecord.value.hotChargeLength = arr.length ? JSON.stringify(arr) : null;
+      editSizeNumRecord.value.hotChargeLength = JSON.stringify(arr);
 
       await editBilletRecord({
         ...editSizeNumRecord.value,
@@ -1763,6 +1847,13 @@
             color: rgba(255, 255, 255, 0.8);
           }
 
+          .delete-heat {
+            position: absolute;
+            top: 0;
+            color: #f50;
+            cursor: pointer;
+          }
+
           .size-st-wrapper {
             position: absolute;
             top: 1px;

+ 6 - 0
src/views/billet/operator/operator.api.ts

@@ -32,6 +32,8 @@ enum Api {
   queryBilletRecordByCcmNo = '/billet/billetOriginalProductRecord/queryBilletRecordByCcmNo',
   // 编辑
   billetRecordEdit = '/billet/billetOriginalProductRecord/edit',
+  // 删除原始数据
+  billetRecordDelete = '/billet/billetOriginalProductRecord/delete',
   // 送样卡
   sampleCardDelivery = '/billet/billetOriginalProductRecord/lengthDetailsTable',
   // 添加炉号
@@ -122,6 +124,10 @@ export const editBilletRecord = (params: any) => {
   return defHttp.post({ url: Api.billetRecordEdit, params });
 };
 
+// 删除原始数据
+export const deleteBilletRecord = (params: any) => {
+  return defHttp.delete({ url: Api.billetRecordDelete, params }, { joinParamsToUrl: true });
+};
 // 送样卡雷彪
 export const querySampleCard = (params: any) => {
   return defHttp.get({ url: Api.sampleCardDelivery, params });