Browse Source

榜三数据可以修改

zhangafei 3 weeks ago
parent
commit
33c7d2017c

+ 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.8: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.8: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
 

+ 7 - 0
src/views/billet/Dashboard/dashboard.api.ts

@@ -62,6 +62,8 @@ enum Api {
   exportOneXlsUrl = '/rollClubOne/exportOneXls', // 棒一
   exportThreeXlsUrl = '/rollClubThreeDetails/exportThreeXls', // 棒三
   exportOutXlsUrl = '/rollOutShippDetails/exportOutXls', // 上若
+  // 撤销
+  backStorageBill = '/storageBillPrint/storageBillPrint/withdrawPrint',
 }
 
 export const exportOneExcel = () => {
@@ -257,3 +259,8 @@ export const confirmRollClubOne = (params: any) => {
 export const getrollClubStatistics = (params: any) => {
   return defHttp.get({ url: Api.rollClubStatistics, params }, { joinParamsToUrl: true });
 };
+
+// 撤销
+export const goBackStorageBill = (params: any) => {
+  return defHttp.put({ url: Api.backStorageBill, params }, { joinParamsToUrl: true });
+};

+ 13 - 4
src/views/billet/Dashboard/rollingOne.vue

@@ -255,12 +255,21 @@
       },
     },
     {
-      label: '',
-      field: 'yuzhanyuan',
-      component: 'Input',
-      slot: 'yuzhanyuan',
+      label: '牌号',
+      field: 'brandNum',
+      component: 'JDictSelectTag',
+      componentProps: {
+        dictCode: 'billet_spec',
+      },
       colProps: { span: 6 },
     },
+    // {
+    //   label: '',
+    //   field: 'yuzhanyuan',
+    //   component: 'Input',
+    //   slot: 'yuzhanyuan',
+    //   colProps: { span: 6 },
+    // },
     {
       label: '班次日期',
       field: 'queryDate',

+ 87 - 10
src/views/billet/Dashboard/rollingThree.vue

@@ -83,8 +83,20 @@
       <template v-if="threeList.length">
         <a-row :gutter="[16, 8]">
           <a-col class="gutter-row" v-for="item in threeList" :key="item.id">
-            <div class="ticket next-ticket" :class="{ disabled: !!item.confirmTime }">
-              <div class="ticket-op-w" v-if="!isAuth">
+            <div class="ticket next-ticket" :class="{ disabled: !!item.confirmTime, 'back-disabled': item.withdrawStatus === 1 }">
+              <div class="ticket-op-w flex" v-if="!isAuth">
+                <div class="ticket-op flex-1">
+                  <a-button
+                    :disabled="!!item.confirmTime || item.withdrawStatus === 1"
+                    size="small"
+                    type="primary"
+                    danger
+                    @click="confirmBackCard(item)"
+                  >
+                    <Icon icon="ant-design:rotate-left-outlined" />
+                    回退
+                  </a-button>
+                </div>
                 <a-button type="primary" :disabled="!!item.confirmTime" size="small" @click="confirmCard(item)">确认装运单</a-button>
                 <a-button
                   type="primary"
@@ -188,10 +200,25 @@
       <a-textarea v-model:value="remark" placeholder="备注" :auto-size="{ minRows: 2, maxRows: 5 }" />
     </div>
   </a-modal>
+
+  <!-- 回退 -->
+  <a-modal v-model:open="backOpen" title="回退装运单" ok-text="确认" cancel-text="取消" @ok="confirmBackSubmit">
+    <div style="margin: 20px">
+      <div style="color: #f50; margin-bottom: 10px">说明:一经确认,装运单信息无法修改。</div>
+      <a-textarea v-model:value="backRemark" placeholder="回退理由" :auto-size="{ minRows: 2, maxRows: 5 }" />
+    </div>
+  </a-modal>
 </template>
 <script setup lang="ts">
   import { onMounted, ref } from 'vue';
-  import { getStorageBillPrintList, saveStorageBillPrint, getrollClubStatistics, exportThreeExcel, exportOutExcel } from './dashboard.api';
+  import {
+    getStorageBillPrintList,
+    saveStorageBillPrint,
+    getrollClubStatistics,
+    exportThreeExcel,
+    exportOutExcel,
+    goBackStorageBill,
+  } from './dashboard.api';
   import dayjs, { Dayjs } from 'dayjs';
   import { useForm, BasicForm, FormSchema } from '/@/components/Form';
   import SegmentedSelect from '/@/components/SegmentedSelect/index.vue';
@@ -208,10 +235,12 @@
   import { list } from '../ShiftPerformance/ShiftPerformance.api';
   import { getTeamShift } from '../Dashboard/dashboard.api';
   import { useMethods } from '/@/hooks/system/useMethods';
+  import { useMessage } from '/@/hooks/web/useMessage';
 
   // 导入导出方法
   const { handleExportXlsx } = useMethods();
   const userStore = useUserStore();
+  const { createMessage } = useMessage();
 
   const isAuth = userStore.userInfo && userStore.userInfo.username === '5';
 
@@ -241,6 +270,15 @@
       colProps: { span: 6 },
       slot: 'ccmNo',
     },
+    {
+      label: '日期',
+      field: 'arrivalTime',
+      component: 'RangePicker',
+      componentProps: {
+        showTime: true,
+        valueFormat: 'YYYY-MM-DD HH:mm:ss',
+      },
+    },
     {
       label: '炉号',
       field: 'heatNo',
@@ -257,7 +295,7 @@
       component: 'Input',
     },
     {
-      label: '类型',
+      label: '钢坯类型',
       field: 'btype',
       component: 'JDictSelectTag',
       componentProps: {
@@ -266,19 +304,19 @@
       colProps: { span: 6 },
     },
     {
-      label: '日期',
-      field: 'arrivalTime',
-      component: 'RangePicker',
+      label: '牌号',
+      field: 'brandNum',
+      component: 'JDictSelectTag',
       componentProps: {
-        showTime: true,
-        valueFormat: 'YYYY-MM-DD HH:mm:ss',
+        dictCode: 'billet_spec',
       },
+      colProps: { span: 6 },
     },
     {
       label: '',
       field: 'zidingyi',
       component: 'Input',
-      colProps: { span: 12 },
+      colProps: { span: 6 },
       slot: 'zidingyi',
     },
     {
@@ -471,6 +509,34 @@
     });
   };
 
+  // 回退装运单
+  const backOpen = ref(false);
+  const confirmBackInfo = ref({});
+  const backRemark = ref('');
+  const confirmBackCard = (record) => {
+    backOpen.value = true;
+    confirmBackInfo.value = record;
+    backRemark.value = '';
+  };
+  const confirmBackSubmit = () => {
+    const info: any = confirmBackInfo.value;
+    if (!backRemark.value.trim()) {
+      createMessage.error('请填写回退原因');
+      return;
+    }
+
+    goBackStorageBill({
+      id: info.recordId,
+      withdrawStatus: 1,
+      remark: remark.value,
+      storageBillId: info.id,
+      btype: info.btype,
+    }).then(() => {
+      backOpen.value = false;
+      getList();
+    });
+  };
+
   // 明细展示
   const defaultDtl = [
     {
@@ -706,10 +772,21 @@
           background: #e9e9e9;
         }
 
+        &.back-disabled {
+          background: #ffc6a9;
+        }
+
         .ticket-op-w {
           margin-bottom: 10px;
           text-align: right;
 
+          .ticket-op {
+            text-align: left;
+            .ant-btn {
+              margin-left: 0;
+            }
+          }
+
           .ant-btn {
             margin-left: 20px;
           }

+ 23 - 6
src/views/billet/operator/components/printCarInfo.vue

@@ -25,7 +25,13 @@
           >
             发车
           </a-button>
-          <a-button style="margin-left: 20px" v-if="carPositon == 2 && !info.outTime && info.id" type="primary" :loading="btnLoading" @click="updateCcmNo">
+          <a-button
+            style="margin-left: 20px"
+            v-if="carPositon == 2 && !info.outTime && info.id"
+            type="primary"
+            :loading="btnLoading"
+            @click="updateCcmNo"
+          >
             修改#{{ info.ccmNo }}
           </a-button>
         </div>
@@ -68,7 +74,7 @@
           </span>
         </a-descriptions-item>
         <a-descriptions-item style="position: relative; text-align: left" label="炉号">
-          <div v-for="item in headDtl" :key="item.id">{{ item.heatNo }} - {{ item.billetNos.length }}</div>
+          <div v-for="item in headDtl" :key="item.heatNo">{{ item.heatNo }} - {{ item.nums }}</div>
           <div class="correct" v-if="!info.outTime && info.id && headDtl.length > 0">
             <a-button
               size="small"
@@ -102,9 +108,9 @@
         <a-descriptions-item label="支数">
           {{ info.amountTotal }}
         </a-descriptions-item>
-        <a-descriptions-item label="重量(t)">
+        <!-- <a-descriptions-item label="重量(t)">
           {{ weight > 0 ? weight.toFixed(3) : 0 }}
-        </a-descriptions-item>
+        </a-descriptions-item> -->
       </a-descriptions>
     </div>
   </section>
@@ -113,7 +119,7 @@
 </template>
 
 <script lang="ts" setup>
-  import { ref, h } from 'vue';
+  import { ref, h, computed } from 'vue';
   import dayjs from 'dayjs';
   import { listShippingBill, startCar, edit } from '../../shippingBill/shippingBill.api';
   import { destinationOptions } from '../../hotDelivery/common.data';
@@ -150,7 +156,7 @@
   });
 
   const destinationRef = ref<any>(null);
-  const headDtl = ref<any[]>([]);
+  // const headDtl = ref<any[]>([]);
   const weight = ref<number>(0);
   const sizeInfo = ref<string[]>([]);
   // 渲染字典标签
@@ -158,7 +164,18 @@
     return render.renderDict(value, dictCode);
   };
 
+  // 获取炉号
+  //  headDtl.value = newArr;
+  //     weight.value = allWeight;
+  //     sizeInfo.value = sizeArr;
+  const headDtl = computed(() => {
+    return Object.keys(props.info.heatNoCountMap).map((item) => {
+      return { heatNo: item, nums: props.info.heatNoCountMap[item] };
+    });
+  });
+
   const getTableList = async () => {
+    return;
     try {
       const { id, ccmNo, heatNo, typeConfigId } = props.info;
       const data = await props.api({

+ 97 - 9
src/views/billet/operator/components/printOriginalRecords.vue

@@ -139,6 +139,32 @@
       </a-input-group>
     </div>
   </a-modal>
+  <!-- 设置定尺数量的modal -->
+  <a-modal v-model:open="openSetSizeNumModal" title="设置定尺数量" centered width="500px" :zIndex="1100" @ok="confirmSetSizeNum">
+    <div style="padding: 60px 30px 30px; font-size: 16px" v-if="editSizeNumRecord && editSizeNumRecord.hotChargeLengthArr">
+      <div style="margin-bottom: 30px" v-for="(item, index) in editSizeNumRecord.hotChargeLengthArr" :key="index">
+        <a-input-number
+          size="large"
+          v-model:value="item.totalCount"
+          :addon-before="headText[item.hotChargeDestination] + ' ' + Number(item.hotChargeLength) / 1000 + 'm'"
+          :min="0"
+          :step="4"
+          @change="
+            (value) => {
+              if (!value) {
+                item.totalCount = 0;
+              }
+              if (value % 4 !== 0) {
+                item.totalCount = value - (value % 4);
+              }
+            }
+          "
+          :controls="false"
+        ></a-input-number>
+      </div>
+      <div style="font-size: 16px; color: #f50">注:请输入4或4的倍数.</div>
+    </div>
+  </a-modal>
 </template>
 <script lang="ts" setup>
   import { ref, computed, h } from 'vue';
@@ -193,56 +219,56 @@
       width: 570,
       children: [
         {
-          title: 'I',
+          title: 'I',
           dataIndex: 'oneFlow',
           key: 'oneFlow',
           align: 'center',
           width: 40,
         },
         {
-          title: 'II',
+          title: 'II',
           dataIndex: 'twoFlow',
           key: 'twoFlow',
           align: 'center',
           width: 40,
         },
         {
-          title: 'III',
+          title: 'III',
           dataIndex: 'threeFlow',
           key: 'threeFlow',
           align: 'center',
           width: 40,
         },
         {
-          title: 'IV',
+          title: 'IV',
           dataIndex: 'fourFlow',
           key: 'fourFlow',
           align: 'center',
           width: 40,
         },
         {
-          title: 'V',
+          title: 'V',
           dataIndex: 'fiveFlow',
           key: 'fiveFlow',
           align: 'center',
           width: 40,
         },
         {
-          title: 'VI',
+          title: 'VI',
           dataIndex: 'sixFlow',
           key: 'sixFlow',
           align: 'center',
           width: 40,
         },
         {
-          title: 'VII',
+          title: 'VII',
           dataIndex: 'sevenFlow',
           key: 'sevenFlow',
           align: 'center',
           width: 40,
         },
         {
-          title: 'VIII',
+          title: 'VIII',
           dataIndex: 'eightFlow',
           key: 'eightFlow',
           align: 'center',
@@ -391,6 +417,9 @@
     rollClubTwoCount: '二',
     rollClubThreeCount: '三',
     rollClubShippCount: '上',
+    roll_club_two: '棒二',
+    roll_club_three: '棒三',
+    roll_out_shipp: '上若',
   };
 
   // 备注
@@ -742,7 +771,25 @@
                 const subHead = Object.keys(headText)
                   .filter((key) => sizeHeadContent[item].includes(key))
                   .map((key) => record[item + 'Arr'][key] || '~');
-                return h('div', { class: 'size-st-num' }, subHead.join('/'));
+                return h(
+                  'div',
+                  {
+                    class: 'size-st-num',
+                    onClick: () => {
+                      if (subHead.length === 0) return;
+                      const { orgData } = record;
+                      if (!orgData || !orgData.hotChargeLength) return;
+
+                      const { hotChargeLength } = orgData;
+                      editSizeNumRecord.value = {
+                        ...orgData,
+                        hotChargeLengthArr: JSON.parse(hotChargeLength),
+                      };
+                      openSetSizeNumModal.value = true;
+                    },
+                  },
+                  subHead.join('/')
+                );
               }
               return '';
             },
@@ -1103,6 +1150,46 @@
     }
   };
 
+  // 编辑目的地定尺数量
+  const openSetSizeNumModal = ref(false);
+  const editSizeNumRecord = ref<any>({});
+
+  const confirmSetSizeNum = async () => {
+    try {
+      changeLoading(true);
+      const { hotChargeLengthArr } = editSizeNumRecord.value;
+      if (!hotChargeLengthArr.length) {
+        return;
+      }
+
+      const arr = hotChargeLengthArr
+        .filter((ele) => ele.totalCount)
+        .map((k) => {
+          return {
+            ...k,
+            totalWeight: (k.totalCount * (Number(k.hotChargeLength) / 1000) * 0.2265).toFixed(4),
+          };
+        });
+
+      editSizeNumRecord.value.hotChargeLength = arr.length ? JSON.stringify(arr) : null;
+
+      await editBilletRecord({
+        ...editSizeNumRecord.value,
+      });
+      openSetSizeNumModal.value = false;
+
+      await getHeatList({
+        ccmNo: hostNumber.value,
+        queryType: fetchQueryType.value,
+        changeShiftId: fetchChangeShiftId.value,
+      });
+      changeLoading(false);
+    } catch (e) {
+      changeLoading(false);
+      console.log(e);
+    }
+  };
+
   function onPrint() {
     changeOkLoading(true);
     printJS({
@@ -1253,6 +1340,7 @@
           }
           .size-st-num {
             color: #f50;
+            cursor: pointer;
           }
 
           // 自定义啊

+ 15 - 6
src/views/billet/shippingBill/components/printModal.vue

@@ -185,7 +185,7 @@
   import dayjs from 'dayjs';
   // import { render } from '/@/utils/common/renderUtils';
   import { printJS } from '/@/hooks/web/usePrintJS';
-  import { listShippingBill, saveBeforePrint, getByStorageBillId, edit } from '../shippingBill.api';
+  import { listShippingBill, saveBeforePrint, getByStorageBillId, list } from '../shippingBill.api';
   import JSearchSelect from '/@/components/Form/src/jeecg/components/JSearchSelect.vue';
   // import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
   import { useMessage } from '/@/hooks/web/useMessage';
@@ -215,8 +215,17 @@
       // 如果是单纯的编辑,就只能编辑部分,棒三,二,上若 可以部分编辑
       isEditCard.value = isEdit === true;
 
+      let newRecord = record;
+      // 重新获取数据
+      const res = await list({
+        id: record.id,
+      });
+      if (res.records && res.records.length > 0) {
+        newRecord = res.records[0];
+      }
+
       info.value = {
-        ...record,
+        ...newRecord,
         arrivalTimeDay: dayjs(record.arrivalTime),
         number: record.carAllNum || record.number,
         classes:
@@ -232,10 +241,10 @@
       };
 
       // 如果只是纯纯的编辑
-      if (isEdit === true) {
-      } else {
-        await getTableList();
-      }
+      // if (isEdit === true) {
+      // } else {
+      //   await getTableList();
+      // }
 
       if (type === 'offline') {
         getOfflineBill();