Browse Source

feat: cargo船货.功能迭代6.代码拆分优化.

peter 1 month ago
parent
commit
d607b16f85

+ 256 - 0
src/pages/cargo-consolidation-request/compTempShip.vue

@@ -0,0 +1,256 @@
+<!-- 中转货船.id固定 -->
+<template>
+  <div>
+    <el-dialog
+      title="候选货物列表"
+      v-model="show"
+      :close-on-click-modal="false"
+      :close-on-press-escape="false"
+      :before-close="close"
+      fullscreen
+      class="comp-temp-ship-dialog"
+    >
+      <el-table
+        class="mt-4"
+        size="small"
+        :data="subList"
+        style="width: 100%"
+        :row-style="calcRowStyle"
+        :header-cell-style="{ backgroundColor: 'rgb(227, 241, 253)' }"
+        :empty-text="'暂无数据'"
+        border
+      >
+        <el-table-column
+          fixed
+          type="index"
+          width="40"
+        ></el-table-column>
+        <el-table-column
+          :sortable="currentTab === 'Arrangement'"
+          :sort-method="batchRecordSort"
+          fixed
+          label="CRM批次记录"
+          width="220"
+        >
+          <template #default="scope">
+            <div class="">{{ scope.row.Batch_Record?.name }}</div>
+          </template>
+        </el-table-column>
+        <el-table-column
+          label="备注"
+          width="110"
+          prop="User_Notes"
+          fixed
+        >
+        </el-table-column>
+        <el-table-column
+          label="箱数"
+          width="50"
+          :sortable="currentTab === 'Arrangement'"
+          :sort-method="customSort1"
+          prop="Carton"
+        >
+        </el-table-column>
+        <el-table-column
+          label="唛头"
+          width="220"
+          prop="Marks_Nos"
+        >
+        </el-table-column>
+        <el-table-column
+          label="货物名称"
+          width="180"
+          prop="Description_of_Goods"
+        >
+        </el-table-column>
+        <el-table-column
+          label="货物材质"
+          width="220"
+        >
+          <template #default="scope">
+            <div>{{ scope.row.Material_of_Goods?.join(',') }}</div>
+          </template>
+        </el-table-column>
+        <el-table-column
+          label="数量"
+          width="100"
+          :sortable="currentTab === 'Arrangement'"
+          :sort-method="customSort2"
+        >
+          <template #default="scope">
+            <div>{{ scope.row.Quantity }}</div>
+          </template>
+        </el-table-column>
+        <el-table-column
+          label="单价(澳币/AUD)"
+          :sortable="currentTab === 'Arrangement'"
+          :sort-method="customSort3"
+          width="145"
+        >
+          <template #default="scope">
+            <div>{{ scope.row.Unit_Price }}</div>
+          </template>
+        </el-table-column>
+        <el-table-column
+          :sortable="currentTab === 'Arrangement'"
+          :sort-method="requesterSort"
+          label="负责人"
+          fixed="right"
+          width="90"
+        >
+          <template #default="scope">
+            <div>{{ scope.row.Requester.name }}</div>
+          </template>
+        </el-table-column>
+        <el-table-column
+          :sortable="currentTab === 'Arrangement'"
+          :sort-method="salesPersonSort"
+          label="申请人"
+          fixed="right"
+          width="90"
+        >
+          <template #default="scope">
+            <div class="">{{ scope.row.Sales_Person }}</div>
+          </template>
+        </el-table-column>
+        <el-table-column
+          label="自动发送"
+          width="80"
+          fixed="right"
+          prop="Force_Send"
+        >
+        </el-table-column>
+        <el-table-column
+          fixed="right"
+          label="重量 (KG)"
+          :sortable="currentTab === 'Arrangement'"
+          :sort-method="customSort4"
+          width="80"
+          prop="Weight"
+        >
+        </el-table-column>
+        <el-table-column
+          :sortable="currentTab === 'Arrangement'"
+          :sort-method="customSort5"
+          fixed="right"
+          label="体积 m&sup3;"
+          width="85"
+          prop="Cube"
+        ></el-table-column>
+        <el-table-column
+          :sortable="currentTab === 'Arrangement'"
+          :sort-method="customSort6"
+          fixed="right"
+          label="总离岸价 (澳币/AUD)"
+          width="145"
+          prop="Total_FOB"
+        ></el-table-column>
+        <el-table-column
+          :sortable="currentTab === 'Arrangement'"
+          :sort-method="refSort"
+          label="Reference"
+          fixed="right"
+          width="90"
+        >
+          <template #default="scope">
+            <div class="">{{ scope.row.Reference || scope.row.PO_Number }}</div>
+          </template>
+        </el-table-column>
+      </el-table>
+    </el-dialog>
+  </div>
+</template>
+<script lang="ts" setup>
+import { defineComponent, ref, watch, computed, nextTick } from 'vue'
+import { ElDialog, ElInput, ElTable, ElTableColumn, ElSelect, ElOption } from 'element-plus'
+import cloneDeep from 'lodash.clonedeep'
+import {
+  customSort1,
+  customSort2,
+  customSort3,
+  customSort4,
+  customSort5,
+  customSort6,
+  refSort,
+  requesterSort,
+  salesPersonSort,
+  batchRecordSort,
+  customMapData,
+  calcSelectAble,
+  calcRowStyle,
+} from './func'
+
+defineComponent({
+  name: 'ComponentTemporaryShip',
+})
+const {
+  visible = false,
+  currentTab = 'all',
+  goodMaterialOption = [],
+  id = '',
+} = defineProps<{
+  goodMaterialOption: string[]
+  visible: boolean
+  currentTab: string
+  id: string
+}>()
+const $emit = defineEmits(['update:visible'])
+let show = ref(false)
+let loading = ref(false)
+let list = ref([] as any[])
+watch(
+  () => visible,
+  () => {
+    show.value = visible
+    if (show.value) getSubList()
+  },
+)
+let close = (done = {} as any) => {
+  $emit('update:visible', false)
+  if (typeof done === 'function') done()
+}
+const zoho = window.ZOHO
+let subList = ref([] as any[])
+// 未经过滤的crm数据
+let subListBackup: any[] = []
+let getSubList = (e: any = {}) => {
+  loading.value = true
+  zoho.CRM.API.searchRecord({
+    Entity: 'Sea_Freight_Details',
+    Type: 'criteria',
+    Query: `Parent_Id:equals:${id}`,
+    delay: false,
+  })
+    .then((res: any) => {
+      if (Array.isArray(res.data) && res.data.length) {
+        subListBackup = cloneDeep(res.data)
+      } else {
+        subListBackup = []
+      }
+      list.value = cloneDeep(subListBackup)
+      subList.value = cloneDeep(
+        subListBackup.map((i: any) => ({
+          ...i,
+          Requester: i.Requester?.id
+            ? {
+                name: i.Requester.name || '',
+                id: i.Requester.id,
+              }
+            : { name: '', id: '' },
+          Sample: i.Sample || false,
+          batchRecord: i.Batch_Record?.id || '',
+          addFlag: false,
+          editFlag: false,
+          deleteFlag: false,
+        })),
+      )
+    })
+    .finally(() => (loading.value = false))
+}
+</script>
+<style lang="scss">
+.comp-temp-ship-dialog {
+  padding-left: 0;
+  padding-right: 0;
+}
+</style>

+ 129 - 10
src/pages/cargo-consolidation-request/func.ts

@@ -1,22 +1,22 @@
-export const customSort1 = function(a: any, b: any) {
+export const customSort1 = function (a: any, b: any) {
   return parseFloat(a.Carton || 0) - parseFloat(b.Carton || 0)
 }
-export const customSort2 = function(a: any, b: any) {
+export const customSort2 = function (a: any, b: any) {
   return parseFloat(a.Quantity || 0) - parseFloat(b.Quantity || 0)
 }
-export const customSort3 = function(a: any, b: any) {
+export const customSort3 = function (a: any, b: any) {
   return parseFloat(a.Unit_Price || 0) - parseFloat(b.Unit_Price || 0)
 }
-export const customSort4 = function(a: any, b: any) {
+export const customSort4 = function (a: any, b: any) {
   return parseFloat(a.Weight || 0) - parseFloat(b.Weight || 0)
 }
-export const customSort5 = function(a: any, b: any) {
+export const customSort5 = function (a: any, b: any) {
   return parseFloat(a.Cube || 0) - parseFloat(b.Cube || 0)
 }
-export const customSort6 = function(a: any, b: any) {
+export const customSort6 = function (a: any, b: any) {
   return parseFloat(a.Total_FOB || 0) - parseFloat(b.Total_FOB || 0)
 }
-export const refSort = function(a: any, b: any) {
+export const refSort = function (a: any, b: any) {
   if (a.Reference && b.Reference) {
     return a.Reference.localeCompare(b.Reference)
   } else if (a.Reference) {
@@ -27,7 +27,7 @@ export const refSort = function(a: any, b: any) {
   return 0
 }
 // 申请人/负责人 点击按 首字符A-Z排序
-export const requesterSort = function(a: any, b: any) {
+export const requesterSort = function (a: any, b: any) {
   if (a.Requester && b.Requester) {
     return a.Requester.name.localeCompare(b.Requester.name)
   } else if (a.Requester) {
@@ -37,7 +37,7 @@ export const requesterSort = function(a: any, b: any) {
   }
   return 0
 }
-export const salesPersonSort = function(a: any, b: any) {
+export const salesPersonSort = function (a: any, b: any) {
   if (a.Sales_Person && b.Sales_Person) {
     return a.Sales_Person.localeCompare(b.Sales_Person)
   } else if (a.Sales_Person) {
@@ -48,7 +48,7 @@ export const salesPersonSort = function(a: any, b: any) {
   return 0
 }
 // 批次记录batchRecord排序, 按 有值 无值 排序即可
-export const batchRecordSort = function(a: any, b: any) {
+export const batchRecordSort = function (a: any, b: any) {
   if (a.Batch_Record && b.Batch_Record) {
     return a.Batch_Record.name.localeCompare(b.Batch_Record.name)
   } else if (a.Batch_Record) {
@@ -58,3 +58,122 @@ export const batchRecordSort = function(a: any, b: any) {
   }
   return 0
 }
+
+// 组装 sea freight data, 逻辑有可以复用的地方, 干脆单独抽出来了.
+export const customMapData = (array: any[]) =>
+  array.map((i) => ({
+    id: i.id,
+    Sample: i.Sample || false,
+    Batch_Record: i.batchRecord
+      ? {
+          name: i.Batch_Record.name,
+          id: i.Batch_Record.id,
+        }
+      : '',
+    Parent_Id: {
+      name: i.Parent_Id.name,
+      id: i.Parent_Id.id || '',
+    },
+    Material_of_Goods: i.Material_of_Goods,
+    Requester: i.Requester.name
+      ? {
+          name: i.Requester.name,
+          id: i.Requester.id || '',
+        }
+      : '',
+    Sales_Person: i.Sales_Person || '',
+    Carton: i.Carton || '',
+    Marks_Nos: i.Marks_Nos || '',
+    Description_of_Goods: i.Description_of_Goods || '',
+    Quantity: i.Quantity || '',
+    Unit_Price: i.Unit_Price || '',
+    Weight: i.Weight || '',
+    Cube: i.Cube || '',
+    Total_FOB: i.Total_FOB || '',
+    User_Notes: i.User_Notes || '',
+    Sales_Order: i.Sales_Order || '',
+    Purchase_Order: i.Purchase_Order || '',
+    Reference: i.Reference || '',
+    PO_Number: i.PO_Number || '',
+    Force_Send: i.Force_Send || false,
+  })) as any[]
+
+export const calcSelectAble = (row: any) => !row.addFlag && !row.deleteFlag && !row.editFlag
+
+// 给子表格加红绿背景. 颜色用的tailwind的 red green
+export const calcRowStyle = ($e: any) => {
+  const result = {} as any
+  if ($e.row.addFlag) result['background-color'] = 'rgb(187, 247, 208)'
+  if ($e.row.editFlag) result['background-color'] = 'rgb(187, 247, 208)'
+  if ($e.row.deleteFlag) result['background-color'] = 'rgb(254, 202, 202)'
+  return result
+}
+
+import * as XLSX from 'xlsx'
+export const exportSubTable = (list: any[], nameStr: string) => {
+  const headers = [
+    '箱数 Carton',
+    '唛头 Marks & Nos',
+    '货物名称 Description of Goods',
+    '货物材质 Material goods',
+    '数量 QTY',
+    '单价 澳币/AUD Unit Price',
+    '重量KG Weight',
+    '体积m³ Cube',
+    '总离岸价 澳币/AUD Total FOB',
+    '负责人 Owner',
+    'Reference',
+  ]
+  const data: any[] = list.map((i) => {
+    return {
+      '箱数 Carton': i.Carton || '',
+      '唛头 Marks & Nos': i.Marks_Nos || '',
+      '货物名称 Description of Goods': i.Description_of_Goods || '',
+      '货物材质 Material goods': i.Material_of_Goods,
+      '数量 QTY': i.Quantity || '',
+      '单价 澳币/AUD Unit Price': i.Unit_Price || '',
+      '重量KG Weight': i.Weight || '',
+      '体积m³ Cube': i.Cube || '',
+      '总离岸价 澳币/AUD Total FOB': i.Total_FOB || '',
+      '负责人 Owner': i.Requester.name || '',
+      Reference: i.Reference || i.PO_Number || '',
+    }
+  })
+  if (data.length === 0) {
+    throw new Error('Invalid data: Data array is empty.')
+  }
+
+  const worksheetData = []
+  worksheetData.push(['发票/装箱单/INVOICE/PACKING LIST'])
+  if (headers && headers.length > 0) {
+    worksheetData.push(headers)
+  } else {
+    worksheetData.push(Object.keys(data[0]))
+  }
+  data.forEach((row) => {
+    worksheetData.push(Object.values(row))
+  })
+  const wb = XLSX.utils.book_new()
+  let ws = XLSX.utils.aoa_to_sheet(worksheetData)
+  ws['!merges'] = [
+    { s: { r: 0, c: 0 }, e: { r: 0, c: 10 } }, // 合并列作为标题
+  ]
+
+  ws['!cols'] = [
+    { wpx: 80 },
+    { wpx: 200 },
+    { wpx: 180 },
+    { wpx: 120 },
+    { wpx: 90 },
+    { wpx: 120 },
+    { wpx: 100 },
+    { wpx: 100 },
+    { wpx: 120 },
+    { wpx: 120 },
+    { wpx: 100 },
+  ]
+
+  XLSX.utils.book_append_sheet(wb, ws, 'Sheet1')
+  const name = encodeURIComponent(nameStr) + '.xlsx'
+  XLSX.writeFile(wb, name)
+}

+ 137 - 153
src/pages/cargo-consolidation-request/index.vue

@@ -34,6 +34,12 @@
               Search
             </el-button>
           </el-tooltip>
+          <el-button
+            @click="openTempShip"
+            size="small"
+          >
+            候选货物列表
+          </el-button>
         </el-form-item>
       </el-form>
 
@@ -229,7 +235,7 @@
               class="custom-button"
               size="small"
               :disabled="subList.length < 1"
-              @click="exportSubTable"
+              @click="exportSubTable(subList, currentRow.Name)"
             >
               导出Excel文档
             </el-button>
@@ -479,6 +485,29 @@
             </el-button>
           </template>
         </el-table-column>
+        <el-table-column
+          label="自动发送"
+          width="75"
+          fixed="right"
+        >
+          <template #default="scope">
+            <el-tooltip
+              content="配合'删除'操作可转移到候选货物列表中, 下次新建航次CRM会自动将其加入"
+            >
+              <el-checkbox
+                :disabled="!['Arrangement'].includes(currentTab)"
+                @change="
+                  () => {
+                    if (scope.row.Force_Send) {
+                      scope.row.editFlag = true
+                    }
+                  }
+                "
+                v-model="scope.row.Force_Send"
+              ></el-checkbox>
+            </el-tooltip>
+          </template>
+        </el-table-column>
         <el-table-column
           fixed="right"
           label="重量 (KG)"
@@ -630,6 +659,12 @@
         </el-form-item>
       </el-form>
     </el-dialog>
+    <comp-temp-ship
+      v-model:visible="tempShipVisible"
+      :id="tempShipID"
+      :current-tab="currentTab"
+      :good-material-option="goodMaterialOption"
+    ></comp-temp-ship>
   </div>
 </template>
 
@@ -653,10 +688,10 @@ import {
   ElNotification,
   ElDrawer,
   ElDialog,
+  ElCheckbox,
 } from 'element-plus'
 import cloneDeep from 'lodash.clonedeep'
 import dayjs from 'dayjs'
-import * as XLSX from 'xlsx'
 import debounce from 'lodash.debounce'
 import compPrint from '@/components/print.vue'
 import request from '@/utils/axios'
@@ -671,7 +706,12 @@ import {
   requesterSort,
   salesPersonSort,
   batchRecordSort,
+  customMapData,
+  calcSelectAble,
+  calcRowStyle,
+  exportSubTable,
 } from './func'
+import compTempShip from './compTempShip.vue'
 
 defineComponent({
   name: 'ComponentCargoConsolidationRequest',
@@ -988,59 +1028,13 @@ const onBatchRecordChange = ($e: string, line = -1) => {
     }
   }
 }
-// 给子表格加红绿背景. 颜色用的tailwind的 red green
-const calcRowStyle = ($e: any) => {
-  const result = {} as any
-  if ($e.row.addFlag) result['background-color'] = 'rgb(187, 247, 208)'
-  if ($e.row.editFlag) result['background-color'] = 'rgb(187, 247, 208)'
-  if ($e.row.deleteFlag) result['background-color'] = 'rgb(254, 202, 202)'
-  return result
-}
-
-const commit = () => {
+const tempShipID = '4791186000388831863'
+const commit = async () => {
   let temp = cloneDeep(subList.value)
-  let result = temp
-    .filter((i) => !i.deleteFlag)
-    .map((i) => {
-      return {
-        id: i.id,
-        Sample: i.Sample || false,
-        Batch_Record: i.batchRecord
-          ? {
-              name: i.Batch_Record.name,
-              id: i.Batch_Record.id,
-            }
-          : '',
-        Parent_Id: {
-          name: i.Parent_Id.name,
-          id: i.Parent_Id.id || '',
-        },
-        Material_of_Goods: i.Material_of_Goods,
-        Requester: i.Requester.name
-          ? {
-              name: i.Requester.name,
-              id: i.Requester.id || '',
-            }
-          : '',
-        Sales_Person: i.Sales_Person || '',
-        Carton: i.Carton || '',
-        Marks_Nos: i.Marks_Nos || '',
-        Description_of_Goods: i.Description_of_Goods || '',
-        Quantity: i.Quantity || '',
-        Unit_Price: i.Unit_Price || '',
-        Weight: i.Weight || '',
-        Cube: i.Cube || '',
-        Total_FOB: i.Total_FOB || '',
-        User_Notes: i.User_Notes || '',
-        Sales_Order: i.Sales_Order || '',
-        Purchase_Order: i.Purchase_Order || '',
-        Reference: i.Reference || '',
-        PO_Number: i.PO_Number || '',
-      }
-    }) as any[]
+  let formData = customMapData(temp.filter((i) => !i.deleteFlag))
 
   const emptyUserNotesList: number[] = []
-  result.forEach((i, index) => {
+  formData.forEach((i, index) => {
     if (!i.User_Notes) {
       emptyUserNotesList.push(index)
     }
@@ -1055,48 +1049,103 @@ const commit = () => {
     return
   }
 
-  result = result.concat(
+  formData = formData.concat(
     temp
       .filter((i) => i.deleteFlag)
       .map((i) => ({ id: i.id, _delete: null, Material_of_Goods: null })),
   )
-  console.log(result, 'submit result')
+  let params = {
+    id: currentRow.value.id,
+    Sea_Freight_array: formData,
+    Sales_Person: currentUserName.value,
+    Sales_Person_Obj: {
+      id: currentUser.value,
+      name: currentUserName.value,
+    },
+  }
+
+  console.log(params, '保存 无转移的数据')
+  let formData2 = customMapData(temp.filter((i) => i.deleteFlag && i.Force_Send)).map((i) => {
+    // 转移之前覆盖 Parent_Id, 否则按照customMapData的逻辑会被存成原航次的id
+    let t = {
+      ...i,
+      Parent_Id: { id: tempShipID },
+    }
+    try {
+      delete t.id // 相当于在新建记录.不删除原id的话, 不一点能转移成功(crm限制), 并且后面原航次的保存会把这个id对应的记录删除
+    } catch {
+      console.log(t, '组装转移数据时删除id出错')
+    }
+    return t
+  })
+
+  let params2 = {
+    id: tempShipID,
+    Sea_Freight_array: formData2,
+    Sales_Person: currentUserName.value,
+    Sales_Person_Obj: {
+      id: currentUser.value,
+      name: currentUserName.value,
+    },
+  }
+  console.log(params2, '保存 要转移的数据')
   loading.value = true
+  let sendToTempShipFlag = true // (转移到临时航次) 的状态
+  if (formData2.length) {
+    let response2 = await request.post('/sea_freight/updateSeaFreightDataV2', params2)
+    if (response2.data.code !== 1) {
+      sendToTempShipFlag = false
+      ElMessage.error('转移到临时航次失败, 请稍后再试或者联系管理员')
+      loading.value = false
+      return
+    }
+    let result2 = response2.data.result || { data: [] }
+    if (
+      !(
+        Array.isArray(result2.data) &&
+        result2.data.length &&
+        result2.data.every((i: any) => i.status === 'success')
+      )
+    ) {
+      sendToTempShipFlag = false
+      ElNotification({
+        title: '部份内容转移失败',
+        message: '建议刷新再试或者联系管理员',
+        duration: 10000,
+      })
+    }
+  }
+  if (sendToTempShipFlag === false) {
+    loading.value = false
+    return
+  }
   request
-    .post('/sea_freight/updateSeaFreightDataV2', {
-      id: newLineTemplate.Parent_Id.id,
-      Sea_Freight_array: result,
-      Sales_Person: currentUserName.value,
-      Sales_Person_Obj: {
-        id: currentUser.value,
-        name: currentUserName.value,
-      },
-    })
+    .post('/sea_freight/updateSeaFreightDataV2', params)
     .then((res) => {
-      if (res.data.code === 1) {
-        let result = res.data.result || { data: [] }
-        if (
-          Array.isArray(result.data) &&
-          result.data.length &&
-          result.data.every((i: any) => i.status === 'success')
-        ) {
-          ElNotification({
-            title: '保存成功',
-            message: '正在刷新数据',
-            duration: 3000,
-          })
-        } else {
-          ElNotification({
-            title: '部份内容保存失败',
-            message: '建议刷新再试或者联系管理员',
-            duration: 10000,
-          })
-        }
-        getSubList(currentRow.value)
-      } else {
+      if (res.data.code !== 1) {
         ElMessage.error('保存出错')
         loading.value = false
+        return
       }
+      let result = res.data.result || { data: [] }
+      if (
+        Array.isArray(result.data) &&
+        result.data.length &&
+        result.data.every((i: any) => i.status === 'success')
+      ) {
+        ElNotification({
+          title: '保存成功',
+          message: '正在刷新数据',
+          duration: 3000,
+        })
+      } else {
+        ElNotification({
+          title: '部份内容保存失败',
+          message: '建议刷新再试或者联系管理员',
+          duration: 10000,
+        })
+      }
+      getSubList(currentRow.value)
     })
     .catch((e) => {
       console.log(e, 'commit error')
@@ -1109,74 +1158,6 @@ const print = (row: any) => {
   currentPrintRow.value = row
   printDrawerVisible.value = true
 }
-const exportSubTable = () => {
-  const headers = [
-    '箱数 Carton',
-    '唛头 Marks & Nos',
-    '货物名称 Description of Goods',
-    '货物材质 Material goods',
-    '数量 QTY',
-    '单价 澳币/AUD Unit Price',
-    '重量KG Weight',
-    '体积m³ Cube',
-    '总离岸价 澳币/AUD Total FOB',
-    '负责人 Owner',
-    'Reference',
-  ]
-
-  const data: any[] = subList.value.map((i) => {
-    return {
-      '箱数 Carton': i.Carton || '',
-      '唛头 Marks & Nos': i.Marks_Nos || '',
-      '货物名称 Description of Goods': i.Description_of_Goods || '',
-      '货物材质 Material goods': i.Material_of_Goods,
-      '数量 QTY': i.Quantity || '',
-      '单价 澳币/AUD Unit Price': i.Unit_Price || '',
-      '重量KG Weight': i.Weight || '',
-      '体积m³ Cube': i.Cube || '',
-      '总离岸价 澳币/AUD Total FOB': i.Total_FOB || '',
-      '负责人 Owner': i.Requester.name || '',
-      Reference: i.Reference || i.PO_Number || '',
-    }
-  })
-  if (data.length === 0) {
-    throw new Error('Invalid data: Data array is empty.')
-  }
-
-  const worksheetData = []
-  worksheetData.push(['发票/装箱单/INVOICE/PACKING LIST'])
-  if (headers && headers.length > 0) {
-    worksheetData.push(headers)
-  } else {
-    worksheetData.push(Object.keys(data[0]))
-  }
-  data.forEach((row) => {
-    worksheetData.push(Object.values(row))
-  })
-  const wb = XLSX.utils.book_new()
-  let ws = XLSX.utils.aoa_to_sheet(worksheetData)
-  ws['!merges'] = [
-    { s: { r: 0, c: 0 }, e: { r: 0, c: 9 } }, // 合并列作为标题
-  ]
-
-  ws['!cols'] = [
-    { wpx: 80 },
-    { wpx: 200 },
-    { wpx: 180 },
-    { wpx: 120 },
-    { wpx: 90 },
-    { wpx: 120 },
-    { wpx: 100 },
-    { wpx: 100 },
-    { wpx: 120 },
-    { wpx: 120 },
-    { wpx: 100 },
-  ]
-
-  XLSX.utils.book_append_sheet(wb, ws, 'Sheet1')
-  const name = encodeURIComponent(currentRow.value.Name || 'test') + '.xlsx'
-  XLSX.writeFile(wb, name)
-}
 
 let qcList = ref([] as any[])
 let loading2 = ref(false)
@@ -1461,7 +1442,10 @@ let selectedRow = ref([] as any[])
 const handleSelectionChange = (val: any[]) => {
   selectedRow.value = val
 }
-let calcSelectAble = (row: any) => !row.addFlag && !row.deleteFlag && !row.editFlag
+let tempShipVisible = ref(false)
+const openTempShip = () => {
+  tempShipVisible.value = true
+}
 
 // 别说代码行数太长搞屎山, 这个页面的功能上线之后改了6个版本, 每次都往上堆功能, 能不长嘛
 </script>