fix
pyt
2025-04-15 e26ca456b7203794e4ef86a2fee763245d5ab2ec
fix
2个文件已修改
109 ■■■■ 已修改文件
src/view/Home.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/view/addOrder.vue 97 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/view/Home.vue
@@ -115,7 +115,7 @@
            <div class="flex a-center p-3">
                <el-button type="primary" class="search" @click="exportExcel(false)">导出 | Export</el-button>
                <el-button type="primary" class="search" @click="importExcel">导入 | Import</el-button>
                <a type="primary" class="Download" @click="downloadTemplate">下载模板 | Download Template</a>
                <el-button type="link" class="Download" @click="downloadTemplate">下载模板 | Download Template</el-button>
            </div>
            <el-table :data="tableData" style="width: 100%" border>
                <el-table-column width="200" prop="orderId" align="center">
@@ -187,6 +187,13 @@
                        <div class="custom-header">
                            <div>柜型</div>
                            <div class="header-en">Container Type</div>
                        </div>
                    </template>
                </el-table-column>
                <el-table-column width="200" prop="SOC" align="center">
                    <template #header>
                        <div class="custom-header">
                            <div>SOC</div>
                        </div>
                    </template>
                </el-table-column>
@@ -593,6 +600,8 @@
                        });
                        // 获取表头并打印日志
                        const headers = jsonData[2];
                        console.log(jsonData);
                        // 验证模板格式
                        const requiredFields = [
                            '集装箱号 | Container No.',
@@ -716,6 +725,7 @@
    margin-left: 20px;
    font-weight: bold;
    cursor: pointer;
    border: none !important;
}
.search {
src/view/addOrder.vue
@@ -414,7 +414,7 @@
                        </div>
                        <div class="box_text2">Tel</div>
                      </div>
                      <el-input type="number" :disabled="type != 'add'" v-model="form.tel" placeholder="请输入"></el-input>
                      <el-input :disabled="type != 'add'" v-model="form.tel" placeholder="请输入"></el-input>
                    </div>
                  </el-form-item>
@@ -440,7 +440,7 @@
                  <div class="tip flex">
                    <img class="tip-img" src="@/assets/addOrder/img1@2x.png" alt="" />
                    <div>联系电话和邮箱至少填写其中一项
                      <div>多个邮箱请填写到“其他联系⽅式”</div>
                      <div>多个邮箱请填写到"其他联系⽅式"</div>
                    </div>
                  </div>
                </div>
@@ -598,10 +598,8 @@
          <div slot="header" class="clearfix">
            <span class="clearfix_text">附件 | Attachment</span>
          </div>
          <div class="box-carde">
            <div class="flex">
              <el-form-item label="Do:" class="w-316" prop="DOFileUrls" label-width="88px">
          <div class="flex wrap">
              <el-form-item label="DO:" class="w-316" prop="DOFileUrls" label-width="88px">
                <el-upload :disabled="type == 'detail'" class="upload-demo" :on-preview="handlePreview"
                  :http-request="handleUpload1" action="#" :on-remove="handleRemove1" :on-exceed="handleExceed"
                  :file-list="fileList1">
@@ -615,12 +613,10 @@
                  <div class="upload_btn">+上传附件</div>
                </el-upload>
              </el-form-item>
              <el-form-item label="PU说明:" class="" prop="PUExplain" label-width="80px">
              <el-form-item label="PU说明:" class="w-316" prop="PUExplain" label-width="88px">
                <el-input :disabled="type == 'detail'" v-model="form.PUExplain" placeholder="请输入"></el-input>
              </el-form-item>
            </div>
            <div class="flex">
              <el-form-item label="POD:" class=" w-316" prop="PODFileUrls" label-width="88px">
              <el-form-item label="POD:" class="w-316" prop="PODFileUrls" label-width="88px">
                <el-upload :disabled="type == 'detail'" class="upload-demo" :on-preview="handlePreview"
                  :on-remove="handleRemove3" :http-request="handleUpload3" action="#" :on-exceed="handleExceed"
                  :file-list="fileList3">
@@ -634,7 +630,13 @@
                  <div class="upload_btn">+上传附件</div>
                </el-upload>
              </el-form-item>
            </div>
              <el-form-item v-if="form.SOC === '是'" label="EIR:" class="w-316" prop="EIRFileUrls" label-width="88px">
                <el-upload :disabled="type == 'detail'" class="upload-demo" :on-preview="handlePreview"
                  :on-remove="handleRemove5" :http-request="handleUpload5" action="#" :on-exceed="handleExceed"
                  :file-list="fileList5">
                  <div class="upload_btn">+上传附件</div>
                </el-upload>
              </el-form-item>
          </div>
        </el-card>
      </div>
@@ -735,6 +737,14 @@
      fileList2: [],
      fileList3: [],
      fileList4: [],
      fileList5: [],
      originalFiles: {
        DOFileUrls: [],
        PUFileUrls: [],
        PODFileUrls: [],
        otherFileUrls: [],
        EIRFileUrls: []
      },
      options: [
        {
          value: "20GP",
@@ -897,33 +907,35 @@
      }).then(resp => {
        this.form = resp.data
        this.detailInfo = resp.data
        // if (resp.data.poundWeight) {
        //   resp.data.poundWeight = resp.data.poundWeight.toFixed(2) * 1
        // }
        if (resp.data.DOFileUrls) {
          resp.data.DOFileUrls.map(item => {
            this.fileList1.push({ url: item.url, name: item.url.split('ownload/')[1] })
          })
          this.originalFiles.DOFileUrls = [...resp.data.DOFileUrls]
        }
        if (resp.data.PUFileUrls) {
          resp.data.PUFileUrls.map(item => {
            this.fileList2.push({ url: item.url, name: item.url.split('ownload/')[1] })
          })
          this.originalFiles.PUFileUrls = [...resp.data.PUFileUrls]
        }
        if (resp.data.PODFileUrls) {
          resp.data.PODFileUrls.map(item => {
            this.fileList3.push({ url: item.url, name: item.url.split('ownload/')[1] })
          })
          this.originalFiles.PODFileUrls = [...resp.data.PODFileUrls]
        }
        console.log(resp.data.otherFileUrls,'resp.data.otherFileUrls');
        if (resp.data.otherFileUrls) {
          console.log(this.fileList4);
          resp.data.otherFileUrls.map(item => {
            this.fileList4.push({ url: item.url, name: item.url.split('ownload/')[1] })
          })
          this.originalFiles.otherFileUrls = [...resp.data.otherFileUrls]
        }
        if (resp.data.EIRFileUrls) {
          resp.data.EIRFileUrls.map(item => {
            this.fileList5.push({ url: item.url, name: item.url.split('ownload/')[1] })
          })
          this.originalFiles.EIRFileUrls = [...resp.data.EIRFileUrls]
        }
      })
    }
@@ -1004,6 +1016,7 @@
            this.form.PUFileUrls = this.fileList2.map(item => { return { url: item.url } })
            this.form.PODFileUrls = this.fileList3.map(item => { return { url: item.url } })
            this.form.otherFileUrls = this.fileList4.map(item => { return { url: item.url } })
            this.form.EIRFileUrls = this.fileList5.map(item => { return { url: item.url } })
            // 添加订单
            if (this.type === 'add') {
              if (this.isSave) {
@@ -1060,6 +1073,7 @@
                  this.fileList2 = []
                  this.fileList3 = []
                  this.fileList4 = []
                  this.fileList5 = []
                  this.$router.go(-1)
                }
@@ -1076,8 +1090,10 @@
                  remark: this.form.remark,
                })
              }
              const fileChanges = this.checkFileChanges();
              edit({
                ...this.form,
                ...fileChanges,
                extra: JSON.parse(localStorage.getItem('userInfo')).extra,
                orderId: this.orderId
              }).then(resp => {
@@ -1121,6 +1137,7 @@
                  this.fileList2 = []
                  this.fileList3 = []
                  this.fileList4 = []
                  this.fileList5 = []
                  this.$router.go(-1)
                }
@@ -1151,6 +1168,9 @@
    },
    handleRemove4(e) {
      this.fileList4 = this.fileList4.filter(item => item.uid !== e.uid);
    },
    handleRemove5(e) {
      this.fileList5 = this.fileList5.filter(item => item.uid !== e.uid);
    },
    handleExceed(e) {
@@ -1278,6 +1298,43 @@
      this.uploadFile(e, obj, 4)
    },
    handleUpload5(e) {
      let obj = {
        orgId: JSON.parse(localStorage.getItem('userInfo')).extra,
        fileSize: e.file.size,
        fileSuffix: e.file.type.split('/')[1],
        originalName: e.file.name,
        fileSource: {
          appId: 'zj0FFk5wx4S05X',
          formId: 'zj1OvwgwIam0Ge',
          isDevelop: true,
        },
        uploadPath: 'file',
        uploadTargetType: 'FORM_ROW',
      }
      this.uploadFile(e, obj, 5)
    },
    checkFileChanges() {
      const currentDOFiles = this.fileList1.map(f => f.url);
      const currentPUFiles = this.fileList2.map(f => f.url);
      const currentPODFiles = this.fileList3.map(f => f.url);
      const currentOtherFiles = this.fileList4.map(f => f.url);
      const currentEIRFiles = this.fileList5.map(f => f.url);
      const originalDOFiles = this.originalFiles.DOFileUrls.map(f => f.url);
      const originalPUFiles = this.originalFiles.PUFileUrls.map(f => f.url);
      const originalPODFiles = this.originalFiles.PODFileUrls.map(f => f.url);
      const originalOtherFiles = this.originalFiles.otherFileUrls.map(f => f.url);
      const originalEIRFiles = this.originalFiles.EIRFileUrls.map(f => f.url);
      return {
        DOFileChange: JSON.stringify(currentDOFiles) !== JSON.stringify(originalDOFiles) ? 1 : 0,
        PUFileChange: JSON.stringify(currentPUFiles) !== JSON.stringify(originalPUFiles) ? 1 : 0,
        PODFileChange: JSON.stringify(currentPODFiles) !== JSON.stringify(originalPODFiles) ? 1 : 0,
        OtherFileChange: JSON.stringify(currentOtherFiles) !== JSON.stringify(originalOtherFiles) ? 1 : 0,
        EIRFileChange: JSON.stringify(currentEIRFiles) !== JSON.stringify(originalEIRFiles) ? 1 : 0
      };
    },
  },
};
</script>
@@ -1295,7 +1352,7 @@
}
.w-316 {
  width: 400px;
  width: 550px;
}
::v-deep .el-icon-close-tip {