ソースを参照

Merge branch 'dev' into dev_zyh

Jack Zhou 3 ヶ月 前
コミット
bf10deb050

+ 15 - 1
src/api/module/Delivery.ts

@@ -260,7 +260,6 @@ export const saveDliveryBookingEmail = (params: any, config: any) => {
   )
 }
 
-
 /**
  * 审核delivery_booking
  */
@@ -277,6 +276,21 @@ export const reviewDliveryBooking = (params: any, config: any) => {
 }
 
 /**
+ *  Address List自动补全
+ */
+export const getAddressCountryCityData = (params: any, config: any) => {
+  return HttpAxios.post(
+    `${baseUrl}`,
+    {
+      action: 'destination_delivery_load',
+      operate: 'country_city_load',
+      ...params
+    },
+    config
+  )
+}
+
+/**  
  * 获取delivery date组件中展示数据
  */
 export const getDeliveryDateData = (params: any, config: any) => {

+ 1 - 2
src/auto-imports.d.ts

@@ -3,7 +3,6 @@
 // @ts-nocheck
 // noinspection JSUnusedGlobalSymbols
 // Generated by unplugin-auto-import
-// biome-ignore lint: disable
 export {}
 declare global {
   const $api: typeof import('@/api/index')['default']
@@ -69,6 +68,6 @@ declare global {
 // for type re-export
 declare global {
   // @ts-ignore
-  export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
+  export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue'
   import('vue')
 }

+ 1 - 0
src/styles/theme.scss

@@ -14,6 +14,7 @@
   --color-white: #fff;
   --color-success: #00a870;
   --color-warning: #edb82f;
+  --color-warning-2: #E0A100;
   --color-danger: #c9353f;
   --color-grey: #f4f5f5;
 

+ 20 - 31
src/views/DestinationDelivery/src/components/ConfiguRations/src/components/ConfigurationsTable.vue

@@ -1,24 +1,24 @@
 <script setup lang="ts">
 import { type VxeGridInstance, type VxeGridProps } from 'vxe-table'
 import { useRowClickStyle } from '@/hooks/rowClickStyle'
-import { formatTimezone, formatNumber } from '@/utils/tools'
+import { formatNumber } from '@/utils/tools'
 import { ref, onMounted } from 'vue'
 import { useRouter } from 'vue-router'
-import { useVisitedRowState } from '@/stores/modules/visitedRow'
 import DefaultConfiguration from '../images/default_configuration@2x.png'
 
-const visitedRowState = useVisitedRowState()
 const router = useRouter()
-interface ColumnsListItem {
-  field: String
-  title: String
-  type: String
-  formatter: String
-}
-const props = defineProps({
-  ColumnsList: Array<ColumnsListItem>,
-  height: Number
-})
+
+interface ColumnConfig {
+  field: string
+  title: string
+  type: string
+  width?: number
+  formatter?: string
+}
+const props = defineProps<{
+  ColumnsList: ColumnConfig[]
+  height: number
+}>()
 
 const columnstest = ref(props.ColumnsList)
 
@@ -65,19 +65,18 @@ const getTableColumns = async () => {
   tableData.value.columns = handleColumns(columnstest.value)
   tableData.value.columns?.push({
     title: 'Operation',
-    fixed: 'right',
+    fixed: 'left',
     width: 100,
     slots: { default: 'action' }
   })
 }
 // 获取表格数据
 const getTableData = (isPageChange?: boolean) => {
-  const rc = isPageChange ? pageInfo.value.total : -1
   $api
     .getConfigurationList({
       cp: pageInfo.value.pageNo,
       ps: pageInfo.value.pageSize,
-      rc
+      rc: isPageChange ? pageInfo.value.total : -1
     })
     .then((res: any) => {
       if (res.code === 200) {
@@ -114,25 +113,15 @@ const deleteMoniTable = (row: any) => {
 }
 
 // 编辑表格数据
-const handleedit = ({ row }: any) => {
-  router.push({
-    path: '/destination-delivery/ConfiguRations/CreateNewRule',
-    query: { a: row._serial_no}
-  })
-}
-
-const handleedittow = (row: any) => {
+const handleEdit = (row: any) => {
   router.push({
     path: '/destination-delivery/ConfiguRations/CreateNewRule',
     query: {a: row._serial_no}
   })
 }
-
+// 添加新规则
 const clickAddNewRule = () => {
-  router.push({
-    path: '/destination-delivery/ConfiguRations/CreateNewRule',
-    query: {}
-  })
+  router.push('/destination-delivery/ConfiguRations/CreateNewRule')
 }
 
 onMounted(() => {
@@ -148,7 +137,7 @@ onMounted(() => {
       :style="{ border: 'none'}"
       v-bind="tableData"
       :height="props.height"
-      @cell-dblclick="handleedit"
+      @cell-dblclick="({ row }) => handleEdit(row)"
     >
       <!-- 空数据时的插槽 -->
       <template #empty>
@@ -169,7 +158,7 @@ onMounted(() => {
         </span>
       </template>
       <template #action="{ row }">
-        <el-button class="el-button--blue" style="height: 24px" @click="handleedittow(row)">
+        <el-button class="el-button--blue" style="height: 24px" @click="handleEdit(row)">
           <span class="font_family icon-icon_edit_b"></span>
         </el-button>
         <el-popover trigger="click" :visible="row.visible" placement="left" :width="480">

+ 26 - 51
src/views/DestinationDelivery/src/components/ConfiguRations/src/components/CreateNewRule.vue

@@ -177,34 +177,21 @@ const getKLNList = (): Promise<KLNItem[]> => {
   });
 };
 // 自动查询KLN
-let timeout: ReturnType<typeof setTimeout>
-const isNodata = ref([])
-const querySearchAsync = (queryString: string, cb: (arg: any) => void) => {
-  const results = queryString
-    ? KLNLists.value.filter(createFilter(queryString))
-    : KLNLists.value
-  isNodata.value = results
-  clearTimeout(timeout)
-  timeout = setTimeout(() => {
-    if(results.length == 0) {
-      cb([{ 
-        isNoData: true, 
-        value: '无搜索结果' 
-      }]);
-    } else {
-      cb(results)
-    }
-  }, 1000 * Math.random())
-}
-
-const createFilter = (queryString: string) => {
-  return (restaurant: KLNItem) => {
-    return (
-      restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) != -1
-    )
+const loading = ref(false)
+const options = ref<KLNItem[]>([])
+const querySearchAsync = (query: string) => {
+  if (query) {
+    loading.value = true
+    setTimeout(() => {
+      loading.value = false
+      options.value = KLNLists.value.filter((item) => {
+        return item.label.toLowerCase().includes(query.toLowerCase())
+      })
+    }, 1000)
+  } else {
+    options.value = []
   }
 }
-
 // 保存
 const handleSubmitRule = () => {
   const airlist = recommendCheckedAirList.value.map(item => {
@@ -291,7 +278,6 @@ const handleSubmitRule = () => {
 }
 
 onMounted(() => {
-  getKLNList()
   InitRuleData()
 })
 
@@ -463,21 +449,22 @@ onMounted(() => {
               </div>
             </template>
             <div>
-              <el-autocomplete
+              <el-select
                 v-model="KLNPLCvalue"
-                style="width: 400px;margin-bottom: 5px;"
+                filterable
+                remote
                 placeholder="Select Employee Account"
-                :fetch-suggestions="querySearchAsync"
+                :remote-method="querySearchAsync"
+                :loading="loading"
+                style="width: 400px;margin-bottom: 5px;"
               >
-                <template #default="{ item }">
-                  <div :class="[
-                    'suggestion-item',
-                    { 'no-data-item': item.isNoData }
-                  ]">
-                    {{ item.value }}
-                  </div>
-                </template>
-              </el-autocomplete>
+                <el-option
+                  v-for="item in options"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                />
+              </el-select>
             </div>
           </el-collapse-item>
       </el-collapse>
@@ -567,18 +554,6 @@ onMounted(() => {
   box-shadow: none;
   border: 1px solid var(--color-theme);
 }
-.no-data-item {
-  color: var(--color-neutral-2);
-  text-align: center;
-  padding: 20px;
-  cursor: default;
-  &:hover {
-    background-color: transparent !important;
-  }
-}
-.suggestion-item {
-  padding: 5px 20px;
-}
 .cancel_header {
   font-size: 18px;
   font-weight: 700;

ファイルの差分が大きいため隠しています
+ 582 - 140
src/views/DestinationDelivery/src/components/CreateNewBooking/src/CreateNewbooking.vue


+ 16 - 4
src/views/DestinationDelivery/src/components/CreateNewBooking/src/components/NewbookingTable.vue

@@ -114,18 +114,29 @@ let checkRecommend = []
 let checkShipmentsdata = []
 let checkShipmentsInfo = {}
 let checkShipmentsSubmitInfo = {}
+const checkUniformArray = (arrary: Array<{ consignee_id: any; country: any }>) => {
+  if (arrary.length === 0) return false;
+  const first = arrary[0];
+  for (let i = 1; i < arrary.length; i++) {
+    if (arrary[i].consignee_id !== first.consignee_id) {
+        return false;
+    }
+  }
+  return [first];
+}
 const selectChangeEvent = () => {
   const $grid = tableRef.value
   if ($grid) {
     const records = $grid.getCheckboxRecords()
-    checkShipments = records.map(item => ({ consignee_id: item.consignee_id }))
+    checkShipments = records.map(item => ({ consignee_id: item.consignee_id, country: item.dc_country }))
     checkRecommend = records.map(item => ({ date_range: item.date_range.split('-'), Hbol: item.h_bol  }))
-    if(checkShipments.length != 0) {
-      checkShipmentsdata = Object.keys(checkShipments?.[0])
+    const array = checkUniformArray(checkShipments)
+    if(array != false) {
+      checkShipmentsdata = Object.keys(checkUniformArray(checkShipments)?.[0])
       checkShipmentsSubmit = Object.keys(records?.[0])
       checkShipmentsdata.forEach((item) => {
         Object.assign(checkShipmentsInfo, {
-          [item]: checkShipments.map((row) => row[item] )
+          [item]: array.map((row) => row[item] )
         })
       })
       checkShipmentsSubmit.forEach((item) => {
@@ -141,6 +152,7 @@ const selectChangeEvent = () => {
       })
     } else {
       checkShipmentsSubmitInfo = {}
+      checkShipmentsInfo = {}
     }
     emits('selectChangeEvent',checkShipmentsInfo, checkRecommend,checkShipmentsSubmitInfo)
   }

+ 3 - 2
src/views/DestinationDelivery/src/components/TableView/src/TableView.vue

@@ -296,7 +296,7 @@ const clickEmailBtn = (row: any) => {
 }
 
 // edit
-const handelEdit = (row: any) => {
+const handleEdit = (row: any) => {
   router.push({
     path: '/destination-delivery/CreateNewBooking',
     query: { a: row._serial_no }
@@ -354,6 +354,7 @@ defineExpose({
       ref="tableRef"
       v-vloading="tableLoadingTableData || tableLoadingColumn"
       :height="props.height"
+      @cell-dblclick="({ row }) => handleEdit(row)"
       :style="{ border: 'none' }"
       v-bind="tableData"
     >
@@ -396,7 +397,7 @@ defineExpose({
         </el-button>
         <!-- edit -->
         <el-button
-          @click="handelEdit(row)"
+          @click="handleEdit(row)"
           class="action-btn el-button--blue"
           style="height: 24px; width: 24px"
           v-if="!isEmployeeRole && row.status === 'Pending Approval'"

+ 1 - 1
src/views/SystemSettings/src/components/MonitoringTable/src/MonitoringTable.vue

@@ -91,7 +91,7 @@ const getTableColumns = async () => {
   tableData.value.columns = handleColumns(columnstest.value)
   tableData.value.columns?.push({
     title: 'Operation',
-    fixed: 'right',
+    fixed: 'left',
     width: 100,
     slots: { default: 'action' }
   })

+ 1 - 1
src/views/SystemSettings/src/components/SettingTable/src/SettingTable.vue

@@ -71,7 +71,7 @@ const getTableColumns = async () => {
   if (props.propsType) {
     tableData.value.columns?.push({
       title: 'Action',
-      fixed: 'right',
+      fixed: 'left',
       width: 80,
       slots: { default: 'action' }
     })

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません