Browse Source

feature: 全球速汇

ljc 5 months ago
parent
commit
30d5c12551

+ 4 - 0
src/i18n/index.ts

@@ -31,6 +31,10 @@ const i18n = createI18n({
   fallbackLocale: import.meta.env.VITE_APP_I18N_FALLBACK_LOCALE || 'cn',
   globalInjection: true,
   legacy: false,
+  silentTranslationWarn: true,
+  missingWarn: false,
+  silentFallbackWarn: true,
+  fallbackWarn: false,
   messages: {
     en,
     cn,

+ 4 - 0
src/service/ucard.ts

@@ -311,6 +311,10 @@ class UCardService extends Service {
   async globalOrdersList(params = {}) {
     return await this.post('/wasabi/global/order/page/list', params)
   }
+  //创建订单
+  async globalOrdersCreate(params = {}) {
+    return await this.post('/wasabi/global/create/order', params)
+  }
 }
 
 export default new UCardService()

+ 4 - 0
src/views/card/CardGlobalOrder/components/DynamicForm.vue

@@ -242,6 +242,10 @@
       deep: true,
     }
   )
+  // 第二部:暴露方法
+  defineExpose({
+    globalFormRef: globalFormRef,
+  })
 </script>
 
 <style scoped lang="scss">

+ 7 - 6
src/views/card/CardGlobalOrder/components/GlobalOrderDialog.vue

@@ -69,7 +69,7 @@
       <el-tabs v-model="activeName" class="tabs" @tab-click="tabsClick">
         <el-tab-pane :label="t('Ucard.GlobalOrder.sender')" name="1">
           <div class="tab-item">
-            <el-row justify="space-between">
+            <el-row>
               <el-col v-for="(item, index) in list.sender" :key="index" :span="6">
                 <div class="item-tit">
                   {{ item.name }}
@@ -83,7 +83,7 @@
         </el-tab-pane>
         <el-tab-pane :label="t('Ucard.GlobalOrder.receiver')" name="2">
           <div class="tab-item">
-            <el-row justify="">
+            <el-row>
               <el-col v-for="(item, index) in list.receiver" :key="index" :span="6">
                 <div class="item-tit">
                   {{ item.name }}
@@ -146,7 +146,7 @@
         v-if="complianceStatus"
         ref="complianceFormRef"
         :model="complianceForm"
-        label-width="135px"
+        label-width="200"
       >
         <div v-if="complianceItems.senderItems.length" class="title">
           {{ t('Ucard.GlobalOrder.SenderComSubmit') }}
@@ -184,7 +184,7 @@
               v-model="complianceForm[field.fieldName]"
               :disabled="field.disabled"
               type="date"
-              class="form-w300"
+              style="width: 300px !important"
               value-format="YYYY-MM-DD"
               :start-placeholder="t('Placeholder.Start')"
               :end-placeholder="t('Placeholder.End')"
@@ -232,7 +232,7 @@
                 </a>
                 <el-image
                   v-else
-                  style="width: 200px; height: 200px"
+                  style="width: 100px; height: 100px"
                   :lazy="false"
                   :src="complianceForm[field.fieldName]"
                   :preview-src-list="[complianceForm[field.fieldName]]"
@@ -327,7 +327,7 @@
                 </a>
                 <el-image
                   v-else
-                  style="width: 200px; height: 200px"
+                  style="width: 100px; height: 100px"
                   :lazy="false"
                   :src="complianceForm[field.fieldName]"
                   :preview-src-list="[complianceForm[field.fieldName]]"
@@ -566,6 +566,7 @@
   }
 
   const getFieldName = (url) => {
+    console.log('getFieldName', url)
     try {
       const urlObj = new URL(url)
       const pathname = urlObj.pathname

+ 1 - 1
src/views/card/CardGlobalOrder/components/dialog.scss

@@ -110,7 +110,7 @@
 }
 
 .form-w300 {
-  width: 300px;
+  width: 300px!important;
 }
 
 .tabs {

+ 16 - 9
src/views/card/CardGlobalOrder/index.vue

@@ -7,7 +7,7 @@
     element-loading-spinner="el-icon-loading"
   >
     <div class="crm_search">
-      <el-form ref="formRef" label-position="" :model="search" label-width="">
+      <el-form ref="formRef" :model="search" label-width="">
         <el-row>
           <el-col :span="24" :md="24" :lg="24">
             <el-form-item>
@@ -141,7 +141,7 @@
             </el-form-item>
           </el-col>
         </el-row>
-        <el-form-item>
+        <el-form-item style="align-items: baseline">
           <el-button
             v-if="display['R-GlobalOrder-Export'] && display['R-GlobalOrder-Export'].show"
             type="primary"
@@ -150,7 +150,7 @@
             >{{ $t('Btn.Export') }}</el-button
           >
         </el-form-item>
-        <el-form-item>
+        <el-form-item style="align-items: baseline">
           <div class="search_action_btn">
             <span
               v-if="display['R-GlobalOrder-Add'] && display['R-GlobalOrder-Add'].show"
@@ -322,7 +322,12 @@
       width="1000px"
       :close-on-click-modal="false"
     >
-      <DynamicForm ref="dynamicFormRef" :fields="globalCurrenciesField" :global-form="globalForm">
+      <DynamicForm
+        ref="dynamicFormRef"
+        :fields="globalCurrenciesField"
+        :global-form="globalForm"
+        @update:global-form="changeGlobalForm"
+      >
         <el-col v-if="isAdd" :span="8">
           <el-form-item prop="cId" :label="$t('global.t1')">
             <el-select
@@ -648,6 +653,10 @@
   }))
 
   // 方法
+  const changeGlobalForm = (data) => {
+    console.log(data)
+    Object.assign(globalForm, data)
+  }
   const getStatusColor = (type, status) => {
     let color = 'crm_state_blue'
     if (type == 'status') {
@@ -1167,7 +1176,9 @@
   }
 
   const saveBusiness = async () => {
-    const valid = await dynamicFormRef.value.$refs.globalForm.validate()
+    console.log(dynamicFormRef.value.globalFormRef, 'value1')
+    console.log(dynamicFormRef.value.globalFormRef, 'value')
+    const valid = await dynamicFormRef.value.globalFormRef.validate()
     const [cardNumber, deductionAccountType] = globalForm.deductionAccount.split(',')
 
     if (valid) {
@@ -1211,10 +1222,6 @@
     }
   }
 
-  const accountOpen = (cId) => {
-    router.push({ name: 'R-CustomerDetail', params: { cId: cId } })
-  }
-
   const isBusinessFormValid = () => {
     const requiredFields = ['areaCode', 'mobile', 'email', 'lastName', 'firstName', 'address']
     return requiredFields.every((field) => !!businessForm[field])