Browse Source

装运单在修改票据打印前,判断是否有车序号

zhangafei 2 days ago
parent
commit
109637843a

+ 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
 

+ 57 - 2
src/views/billet/operator/components/car.vue

@@ -23,12 +23,24 @@
               type="primary"
               v-if="vehicleInfo['info' + item] && vehicleInfo['info' + item].id"
               @click="
-                () =>
+                async () => {
+                  if (!zjNo.includes(vehicleInfo['info' + item].ccmNo)) {
+                    // 没有铸机号
+                    openUpdateCcmNo = true;
+                    openUpdateCcmNoRecord = vehicleInfo['info' + item];
+                    return;
+                  }
+
+                  if (!vehicleInfo['info' + item].carAllNum) {
+                    await getInfo();
+                  }
+
                   openPrintModal(true, {
                     record: vehicleInfo['info' + item],
                     typeConfigId: !vehicleInfo['info' + item].typeConfigId ? '1024' : vehicleInfo['info' + item].typeConfigId,
                     type: 'offline',
-                  })
+                  });
+                }
               "
               >打印</a-button
             >
@@ -137,6 +149,28 @@
       <JSearchSelect type="list" style="width: 277px" v-model:value="createChargeBillCar" dict="lg_car" placeholder="请选择" allowClear />
     </div>
   </a-modal>
+
+  <!-- 快速创建装运单 -->
+  <a-modal
+    v-model:open="openUpdateCcmNo"
+    title="修改铸机号"
+    centered
+    width="400px"
+    ok-text="确认"
+    :okButtonProps="{ loading: okLoading }"
+    cancel-text="取消"
+    @ok="confirmUpdateCcmNo"
+    @cancel="
+      () => {
+        openUpdateCcmNo = false;
+      }
+    "
+  >
+    <div class="flex justify-center items-center" style="margin: 20px 0">
+      <div>选择铸机:</div>
+      <JSearchSelect type="list" style="width: 277px" v-model:value="updateCcmNo" dict="lg_zj" placeholder="请选择" allowClear />
+    </div>
+  </a-modal>
 </template>
 <script setup lang="ts">
   import { ref, onMounted, onUnmounted, h } from 'vue';
@@ -173,6 +207,7 @@
     '6': [2, 3, 4],
   };
   const commonCarPosition = ['2', '4'];
+  const zjNo = ['5', 6];
   // 车辆信息
   const infoRef1 = ref();
   const infoRef2 = ref();
@@ -524,6 +559,26 @@
     }
   };
 
+  // 修改铸机号
+  const openUpdateCcmNo = ref(false);
+  const updateCcmNo = ref('');
+  const openUpdateCcmNoRecord = ref({});
+  const confirmUpdateCcmNo = async () => {
+    try {
+      if (!zjNo.includes(updateCcmNo.value)) {
+        createMessage.error('请选择铸机号!');
+        return;
+      }
+
+      await edit({ ...openUpdateCcmNoRecord.value, ccmNo: updateCcmNo.value });
+      refresh(1);
+      openUpdateCcmNo.value = false;
+      okLoading.value = false;
+    } catch (error) {
+      okLoading.value = false;
+    }
+  };
+
   // 刷新
   const refresh = (type?: number) => {
     stop();

+ 13 - 6
src/views/billet/shippingBill/index.vue

@@ -93,8 +93,8 @@
         </a-button>
       </template>
       <!--操作栏-->
-      <template #action="{ record }">
-        <TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
+      <template #action="{ record, index }">
+        <TableAction :actions="getTableAction(record, index)" :dropDownActions="getDropDownAction(record)" />
       </template>
       <template #billXuhao="{ record }">{{ record.uniqueCode || '' }}</template>
       <template #licensePlate="{ record }">
@@ -252,7 +252,7 @@
   /**
    * 操作栏
    */
-  function getTableAction(record) {
+  function getTableAction(record, index) {
     let actions: any[] = [];
     if (!!record.outTime || !!record.arrivalTime) {
       actions = [
@@ -299,8 +299,15 @@
 
       {
         label: '票据',
-        onClick: () => {
-          openPrintModal(true, { record, isUpdate: true, type: 'offline' });
+        onClick: async () => {
+          let newRecord = record;
+          if (!record.carAllNum) {
+            await reload();
+
+            const allData = getDataSource();
+            newRecord = allData.find((item) => item.id === record.id);
+          }
+          openPrintModal(true, { record: newRecord, isUpdate: true, type: 'offline' });
         },
         disabled: false,
       },
@@ -452,7 +459,7 @@
     },
   });
 
-  const [registerTable, { reload, setLoading }, { rowSelection, selectedRowKeys }] = tableContext;
+  const [registerTable, { reload, setLoading, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
   /**
    * 成功回调
    */