Selaa lähdekoodia

Merge branch 'dev1.0' of http://192.168.0.200:3000/zhangxj/trade-platform-c-front-end into dev1.0

changjiaming 2 päivää sitten
vanhempi
commit
513060542c

BIN
2024-11-23.7z


+ 2 - 2
src/views/businessManage/tradeRelations/importer/components/BasicInfo.vue

@@ -76,7 +76,7 @@
         <el-input v-model="ruleForm.contactEmail" placeholder="请输入有效的邮箱地址" :disabled="disabled" />
       </el-form-item>
 
-      <cy-info-title style="margin: 0px -15px 10px;"> 核额信息 </cy-info-title>
+      <cy-info-title style="margin: 10px -15px 10px;"> 核额信息 </cy-info-title>
       <el-form-item label="交易品类" prop="businessCategory1">
         <el-select v-model="ruleForm.businessCategory1" placeholder="请选择" multiple :disabled="disabled">
           <el-option
@@ -322,7 +322,7 @@ export default {
             params.periodToBeApplied = `${this.ruleForm.periodToBeApplied1}${this.ruleForm.applyTimeUnit}`
             this.submit(params, submitType)
           } else {
-            this.$message.warning('必填项不能为空')
+            // this.$message.warning('必填项不能为空')
           }
         })
       }

+ 14 - 0
src/views/myTrade/purchaseAndSaleContract/salesContract/components/GoodsInfo.vue

@@ -406,10 +406,24 @@ export default {
             this.$message.warning(`请选择商品信息第${i + 1}行申报计量单位`)
             return false
           }
+          if (!this.tableData[i].i18n.measurementUnit) {
+            this.$message.warning(`请输入商品信息第${i + 1}行申报计量单位(英文)`)
+            return false
+          } else if (/[\u4e00-\u9fa5]/.test(this.tableData[i].i18n.measurementUnit)) {
+            this.$message.warning(`商品信息第${i + 1}行申报计量单位(英文)格式错误`)
+            return false
+          }
           if (!this.tableData[i].declarationName) {
             this.$message.warning(`请输入商品信息第${i + 1}行报关品名`)
             return false
           }
+          if (!this.tableData[i].i18n.declarationName) {
+            this.$message.warning(`请输入商品信息第${i + 1}行报关品名(英文)`)
+            return false
+          } else if (/[\u4e00-\u9fa5]/.test(this.tableData[i].i18n.declarationName)) {
+            this.$message.warning(`商品信息第${i + 1}行报关品名(英文)格式错误`)
+            return false
+          }
           if (!this.tableData[i].packSpec) {
             this.$message.warning(`请选择商品信息第${i + 1}行包装规格`)
             return false

+ 66 - 12
src/views/myTrade/purchaseAndSaleContract/salesContract/components/Terms.vue

@@ -173,6 +173,15 @@ export default {
       }
       callback()
     }
+    const validateCharacter = (rule, value, callback) => {
+      if (value === '') {
+        callback()
+      } else if (/[\u4e00-\u9fa5]/.test(value)) {
+        callback(new Error('请输入英文'))
+      } else {
+        callback()
+      }
+    }
     return {
       ruleForm: {
         paymentWay: '',
@@ -218,13 +227,13 @@ export default {
         ],
 
         'i18n.accountName': [
-          { required: true, message: `请输入账户名称`, trigger: 'blur' }
+          { required: true, message: `请输入账户名称`, trigger: 'blur' }, { validator: validateCharacter, trigger: 'blur' }
         ],
         'i18n.openingBank': [
-          { required: true, message: `请输入开户行`, trigger: 'blur' }
+          { required: true, message: `请输入开户行`, trigger: 'blur' }, { validator: validateCharacter, trigger: 'blur' }
         ],
         'i18n.bankName': [
-          { required: true, message: `请输入银行名称`, trigger: 'blur' }
+          { required: true, message: `请输入银行名称`, trigger: 'blur' }, { validator: validateCharacter, trigger: 'blur' }
         ]
       },
       paymentInfo: [
@@ -628,15 +637,24 @@ export default {
         obj.paymentRatio = Number(item.paymentRatio)
         obj.paymentTerm = Number(item.paymentTerm)
         paymentInfo.push(obj)
+
+        item.paymentRatio = Number(item.paymentRatio)
+        item.paymentTerm = Number(item.paymentTerm)
       })
       params.paymentInfo = paymentInfo.length ? paymentInfo : null
 
       const titleInfo = []
       this.titleInfo.map(item => {
         const obj = {}
+        for (const k in item) {
+          if (k !== 'i18n') {
+            obj[k] = item[k]
+          }
+        }
+        const i18n = {}
         for (const key in item.i18n) {
           if (item.i18n[key] !== '') {
-            obj.i18n[key] = [
+            i18n[key] = [
               {
                 language: 'cn',
                 value: item[key]
@@ -648,11 +666,7 @@ export default {
             ]
           }
         }
-        for (const k in item) {
-          if (k !== 'i18n') {
-            obj[k] = item[k]
-          }
-        }
+        obj.i18n = Object.keys(i18n).length ? i18n : null
         titleInfo.push(obj)
       })
       params.titleInfo = titleInfo.length ? titleInfo : null
@@ -663,6 +677,12 @@ export default {
             return
           }
 
+          if (this.titleInfo && this.titleInfo.length) {
+            if (!this.validateTitleInfo()) {
+              return
+            }
+          }
+
           // 付款款项表格的款项比例之和必须为100,且表格最大值的付款期限必须等于结算账期
           if (this.paymentInfo.length > 0) {
             const paymentRatioSum = this.paymentInfo.reduce((acc, cur) => acc + cur.paymentRatio, 0)
@@ -715,7 +735,6 @@ export default {
       this.titleInfo.splice(index, 1)
     },
     validatePayInfo() {
-      console.log(this.paymentInfo)
       let i = 0
       while (i < this.paymentInfo.length) {
         if (!this.paymentInfo[i].paymentRatio) {
@@ -726,8 +745,22 @@ export default {
           this.$message.warning(`请输入付款条件列表第${i + 1}行付款时点`)
           return false
         }
-        if (!this.paymentInfo[i].paymentRatio) {
-          this.$message.warning(`请输入付款条件列表第${i + 1}行款项比例`)
+        if (!this.paymentInfo[i].i18n.paymentTime) {
+          this.$message.warning(`请输入付款条件列表第${i + 1}行付款时点(英文)`)
+          return false
+        } else if (/[\u4e00-\u9fa5]/.test(this.paymentInfo[i].i18n.paymentTime)) {
+          this.$message.warning(`付款条件列表第${i + 1}行付款时点(英文)格式有误`)
+          return false
+        }
+        if (!this.paymentInfo[i].paymentName) {
+          this.$message.warning(`请输入付款条件列表第${i + 1}行款项名称`)
+          return false
+        }
+        if (!this.paymentInfo[i].i18n.paymentName) {
+          this.$message.warning(`请输入付款条件列表第${i + 1}行款项名称(英文)`)
+          return false
+        } else if (/[\u4e00-\u9fa5]/.test(this.paymentInfo[i].i18n.paymentName)) {
+          this.$message.warning(`付款条件列表第${i + 1}行款项名称(英文)格式有误`)
           return false
         }
         if (this.paymentInfo[i].paymentTerm === '') {
@@ -743,6 +776,27 @@ export default {
       }
       return true
     },
+    validateTitleInfo() {
+      let i = 0
+      while (i < this.titleInfo.length) {
+        if (!this.titleInfo[i].i18n.termTitle) {
+          this.$message.warning(`请输入特殊约定列表第${i + 1}行条款标题(英文)`)
+          return false
+        } else if (/[\u4e00-\u9fa5]/.test(this.titleInfo[i].i18n.termTitle)) {
+          this.$message.warning(`特殊约定列表第${i + 1}行条款标题(英文)格式有误`)
+          return false
+        }
+        if (!this.titleInfo[i].i18n.content) {
+          this.$message.warning(`请输入特殊约定列表第${i + 1}行条款内容(英文)`)
+          return false
+        } else if (/[\u4e00-\u9fa5]/.test(this.titleInfo[i].i18n.content)) {
+          this.$message.warning(`特殊约定列表第${i + 1}行条款内容(英文)格式有误`)
+          return false
+        }
+        i++
+      }
+      return true
+    },
     handleAddTitleInfo() {
       this.titleInfo.push(
         {

+ 2 - 2
src/views/myTrade/salesBill/salesInvoices/view.vue

@@ -146,8 +146,8 @@ export default {
                 }
               })
             }
-            if (item.i18n.measurementUnit) {
-              item.i18n.measurementUnit.map(ele => {
+            if (item.i18n.unit) {
+              item.i18n.unit.map(ele => {
                 if (ele.language === 'en') {
                   measurementUnitEn = ele.value
                 }

+ 11 - 1
src/views/myTrade/salesBill/salesOrder/components/BasicInfo.vue

@@ -408,6 +408,16 @@ export default {
       await this.validate(type)
       const goodsList = []
       this.selectedGoods.map(item => {
+        const i18nObj = {}
+        if (item.i18n) {
+          for (const k in item.i18n) {
+            if (k === 'measurementUnit') {
+              i18nObj['unit'] = item.i18n[k]
+            } else {
+              i18nObj[k] = item.i18n[k]
+            }
+          }
+        }
         goodsList.push({
           // id: item.id,
           salesCommodityId: item.id,
@@ -423,7 +433,7 @@ export default {
           taxRefundRate: item.addedTaxRate,
           count: item.number,
           vendorEntityNo: item.entityNo,
-          i18n: item.i18n
+          i18n: i18nObj
         })
       })
       const data = {

+ 2 - 2
src/views/myTrade/salesBill/salesOrder/view.vue

@@ -374,8 +374,8 @@ export default {
           prop: 'measurementUnit',
           render: (h, row) => {
             let name = ''
-            if (row.i18n && row.i18n.measurementUnit) {
-              row.i18n.measurementUnit.map(ele => {
+            if (row.i18n && row.i18n.unit) {
+              row.i18n.unit.map(ele => {
                 if (ele.language === 'en') {
                   name = ele.value
                 }

BIN
test1.7z