Jelajahi Sumber

销售合同 - 样品单_ehsd、销售合同_ehsd 功能优化

lxf 2 tahun lalu
induk
melakukan
527a525d1c

+ 6 - 1
src/components/process/Contract.vue

@@ -721,7 +721,12 @@ const changeCustomer = (val) => {
       (res) => {
         if (res.customerUserList && res.customerUserList.length > 0) {
           formData.data.buyContactName = res.customerUserList[0].name;
-          formData.data.buyContactNumber = res.customerUserList[0].phone;
+          if (res.customerUserList[0].contactJson) {
+            let contactJson = JSON.parse(res.customerUserList[0].contactJson);
+            if (contactJson && contactJson.length > 0) {
+              formData.data.buyContactNumber = contactJson[0].contactNo;
+            }
+          }
           customerUserList.value = res.customerUserList.map((item) => {
             return {
               ...item,

+ 49 - 9
src/components/process/EHSD/Contract.vue

@@ -347,6 +347,20 @@
           </el-upload>
         </div>
       </template>
+      <template #indication>
+        <div style="width: 100%">
+          <el-upload
+            v-model:fileList="formData.data.packageFileList"
+            action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
+            :data="indicationUploadData"
+            multiple
+            :before-upload="indicationUploadFile"
+            :on-success="handleSuccess"
+            :on-preview="onPreviewFile">
+            <el-button type="primary" plain>选择</el-button>
+          </el-upload>
+        </div>
+      </template>
       <template #otherCharge>
         <div style="width: 100%">
           <el-button type="primary" @click="clickAdd()">添加行</el-button>
@@ -485,6 +499,7 @@ const formData = reactive({
     contractProductList: [],
     contractProjectList: [],
     fileList: [],
+    packageFileList: [],
     contractShipmentList: [],
   },
 });
@@ -496,6 +511,7 @@ const formOption = reactive({
   rules: [],
 });
 const uploadData = ref({});
+const indicationUploadData = ref({});
 const formConfig = computed(() => {
   return [
     {
@@ -539,12 +555,16 @@ const formConfig = computed(() => {
     },
     {
       type: "slot",
-      prop: "file",
       slotName: "file",
       label: "交接单",
     },
     {
       type: "slot",
+      slotName: "indication",
+      label: "包装指示",
+    },
+    {
+      type: "slot",
       slotName: "otherCharge",
       label: "其他收费项目",
     },
@@ -750,7 +770,12 @@ const changeCustomer = (val) => {
       (res) => {
         if (res.customerUserList && res.customerUserList.length > 0) {
           formData.data.buyContactName = res.customerUserList[0].name;
-          formData.data.buyContactNumber = res.customerUserList[0].phone;
+          if (res.customerUserList[0].contactJson) {
+            let contactJson = JSON.parse(res.customerUserList[0].contactJson);
+            if (contactJson && contactJson.length > 0) {
+              formData.data.buyContactNumber = contactJson[0].contactNo;
+            }
+          }
           customerUserList.value = res.customerUserList.map((item) => {
             return {
               ...item,
@@ -947,14 +972,20 @@ const handleSubmit = async () => {
       ElMessage("请添加至少一件商品");
       return false;
     }
-    if (!(formData.data.fileList && formData.data.fileList.length > 0)) {
-      ElMessage("请上传交接单");
-      return false;
+    if (formData.data.fileList && formData.data.fileList.length > 0) {
+      for (let i = 0; i < formData.data.fileList.length; i++) {
+        if (formData.data.fileList[i].raw.uploadState) {
+          ElMessage("文件上传中,请稍后提交");
+          return false;
+        }
+      }
     }
-    for (let i = 0; i < formData.data.fileList.length; i++) {
-      if (formData.data.fileList[i].raw.uploadState) {
-        ElMessage("文件上传中,请稍后提交");
-        return false;
+    if (formData.data.packageFileList && formData.data.packageFileList.length > 0) {
+      for (let i = 0; i < formData.data.packageFileList.length; i++) {
+        if (formData.data.packageFileList[i].raw.uploadState) {
+          ElMessage("文件上传中,请稍后提交");
+          return false;
+        }
       }
     }
     if (formData.data.contractShipmentList && formData.data.contractShipmentList.length > 0) {
@@ -1025,6 +1056,15 @@ const uploadFile = async (file) => {
   file.uploadState = true;
   return true;
 };
+const indicationUploadFile = async (file) => {
+  const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
+  indicationUploadData.value = res.uploadBody;
+  file.id = res.id;
+  file.fileName = res.fileName;
+  file.fileUrl = res.fileUrl;
+  file.uploadState = true;
+  return true;
+};
 const handleSuccess = (any, UploadFile) => {
   UploadFile.raw.uploadState = false;
 };

+ 6 - 1
src/components/process/EHSD/PriceSheet.vue

@@ -620,7 +620,12 @@ const changeCustomer = (val) => {
       (res) => {
         if (res.customerUserList && res.customerUserList.length > 0) {
           formData.data.buyContactName = res.customerUserList[0].name;
-          formData.data.buyContactNumber = res.customerUserList[0].phone;
+          if (res.customerUserList[0].contactJson) {
+            let contactJson = JSON.parse(res.customerUserList[0].contactJson);
+            if (contactJson && contactJson.length > 0) {
+              formData.data.buyContactNumber = contactJson[0].contactNo;
+            }
+          }
           customerUserList.value = res.customerUserList.map((item) => {
             return {
               ...item,

+ 49 - 9
src/components/process/EHSD/Sample.vue

@@ -343,6 +343,20 @@
           </el-upload>
         </div>
       </template>
+      <template #indication>
+        <div style="width: 100%">
+          <el-upload
+            v-model:fileList="formData.data.packageFileList"
+            action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
+            :data="indicationUploadData"
+            multiple
+            :before-upload="indicationUploadFile"
+            :on-success="handleSuccess"
+            :on-preview="onPreviewFile">
+            <el-button type="primary" plain>选择</el-button>
+          </el-upload>
+        </div>
+      </template>
       <template #otherCharge>
         <div style="width: 100%">
           <el-button type="primary" @click="clickAdd()">添加行</el-button>
@@ -483,6 +497,7 @@ const formData = reactive({
     sampleProductList: [],
     sampleProjectList: [],
     fileList: [],
+    packageFileList: [],
     sampleShipmentList: [],
   },
 });
@@ -494,6 +509,7 @@ const formOption = reactive({
   rules: [],
 });
 const uploadData = ref({});
+const indicationUploadData = ref({});
 const formConfig = computed(() => {
   return [
     {
@@ -537,12 +553,16 @@ const formConfig = computed(() => {
     },
     {
       type: "slot",
-      prop: "file",
       slotName: "file",
       label: "交接单",
     },
     {
       type: "slot",
+      slotName: "indication",
+      label: "包装指示",
+    },
+    {
+      type: "slot",
       slotName: "otherCharge",
       label: "其他收费项目",
     },
@@ -760,7 +780,12 @@ const changeCustomer = (val) => {
       (res) => {
         if (res.customerUserList && res.customerUserList.length > 0) {
           formData.data.buyContactName = res.customerUserList[0].name;
-          formData.data.buyContactNumber = res.customerUserList[0].phone;
+          if (res.customerUserList[0].contactJson) {
+            let contactJson = JSON.parse(res.customerUserList[0].contactJson);
+            if (contactJson && contactJson.length > 0) {
+              formData.data.buyContactNumber = contactJson[0].contactNo;
+            }
+          }
           customerUserList.value = res.customerUserList.map((item) => {
             return {
               ...item,
@@ -957,14 +982,20 @@ const handleSubmit = async () => {
       ElMessage("请添加至少一件商品");
       return false;
     }
-    if (!(formData.data.fileList && formData.data.fileList.length > 0)) {
-      ElMessage("请上传交接单");
-      return false;
+    if (formData.data.fileList && formData.data.fileList.length > 0) {
+      for (let i = 0; i < formData.data.fileList.length; i++) {
+        if (formData.data.fileList[i].raw.uploadState) {
+          ElMessage("文件上传中,请稍后提交");
+          return false;
+        }
+      }
     }
-    for (let i = 0; i < formData.data.fileList.length; i++) {
-      if (formData.data.fileList[i].raw.uploadState) {
-        ElMessage("文件上传中,请稍后提交");
-        return false;
+    if (formData.data.packageFileList && formData.data.packageFileList.length > 0) {
+      for (let i = 0; i < formData.data.packageFileList.length; i++) {
+        if (formData.data.packageFileList[i].raw.uploadState) {
+          ElMessage("文件上传中,请稍后提交");
+          return false;
+        }
       }
     }
     if (formData.data.sampleShipmentList && formData.data.sampleShipmentList.length > 0) {
@@ -1035,6 +1066,15 @@ const uploadFile = async (file) => {
   file.uploadState = true;
   return true;
 };
+const indicationUploadFile = async (file) => {
+  const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
+  indicationUploadData.value = res.uploadBody;
+  file.id = res.id;
+  file.fileName = res.fileName;
+  file.fileUrl = res.fileUrl;
+  file.uploadState = true;
+  return true;
+};
 const handleSuccess = (any, UploadFile) => {
   UploadFile.raw.uploadState = false;
 };

+ 6 - 1
src/components/process/PriceSheet.vue

@@ -565,7 +565,12 @@ const changeCustomer = (val) => {
       (res) => {
         if (res.customerUserList && res.customerUserList.length > 0) {
           formData.data.buyContactName = res.customerUserList[0].name;
-          formData.data.buyContactNumber = res.customerUserList[0].phone;
+          if (res.customerUserList[0].contactJson) {
+            let contactJson = JSON.parse(res.customerUserList[0].contactJson);
+            if (contactJson && contactJson.length > 0) {
+              formData.data.buyContactNumber = contactJson[0].contactNo;
+            }
+          }
           customerUserList.value = res.customerUserList.map((item) => {
             return {
               ...item,

+ 6 - 1
src/components/process/ServiceContract.vue

@@ -556,7 +556,12 @@ const changeCustomer = (val) => {
       (res) => {
         if (res.customerUserList && res.customerUserList.length > 0) {
           formData.data.buyContactName = res.customerUserList[0].name;
-          formData.data.buyContactNumber = res.customerUserList[0].phone;
+          if (res.customerUserList[0].contactJson) {
+            let contactJson = JSON.parse(res.customerUserList[0].contactJson);
+            if (contactJson && contactJson.length > 0) {
+              formData.data.buyContactNumber = contactJson[0].contactNo;
+            }
+          }
           customerUserList.value = res.customerUserList.map((item) => {
             return {
               ...item,

+ 193 - 1
src/views/EHSD/saleContract/contractEHSD/index.vue

@@ -211,12 +211,50 @@
         <el-button type="primary" @click="clickDownload()" size="large">下载PDF</el-button>
       </template>
     </el-dialog>
+
+    <el-dialog title="交接单" v-if="openHandoverSlip" v-model="openHandoverSlip" width="600">
+      <byForm :formConfig="formConfig" :formOption="formOption" v-model="handoverSlipForm">
+        <template #file>
+          <div style="width: 100%">
+            <el-upload
+              v-model:fileList="handoverSlipForm.fileList"
+              action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
+              :data="uploadData"
+              multiple
+              :before-upload="uploadFile"
+              :on-success="handleSuccess"
+              :on-preview="onPreviewFile">
+              <el-button type="primary" plain>选择</el-button>
+            </el-upload>
+          </div>
+        </template>
+        <template #indication>
+          <div style="width: 100%">
+            <el-upload
+              v-model:fileList="handoverSlipForm.packageFileList"
+              action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
+              :data="indicationUploadData"
+              multiple
+              :before-upload="indicationUploadFile"
+              :on-success="handleSuccess"
+              :on-preview="onPreviewFile">
+              <el-button type="primary" plain>选择</el-button>
+            </el-upload>
+          </div>
+        </template>
+      </byForm>
+      <template #footer>
+        <el-button @click="openHandoverSlip = false" size="large">关 闭</el-button>
+        <el-button type="primary" @click="submitHandoverSlip()" size="large">确 定</el-button>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
 <script setup>
 import { computed, ref } from "vue";
 import byTable from "@/components/byTable/index";
+import byForm from "@/components/byForm/index";
 import useUserStore from "@/store/modules/user";
 import { ElMessage, ElMessageBox } from "element-plus";
 
@@ -348,7 +386,7 @@ const config = computed(() => {
     {
       attrs: {
         label: "操作",
-        width: 120,
+        width: 160,
         align: "center",
         fixed: "right",
       },
@@ -356,6 +394,17 @@ const config = computed(() => {
         return [
           {
             attrs: {
+              label: "交接单",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              clickHandoverSlip(row);
+            },
+          },
+          {
+            attrs: {
               label: "打印",
               type: "primary",
               text: true,
@@ -493,6 +542,149 @@ const statistics = (label, index) => {
   }
   return num;
 };
+const openHandoverSlip = ref(false);
+const handoverSlipForm = ref({
+  id: "",
+  code: "",
+  buyCorporationName: "",
+  fileList: [],
+  packageFileList: [],
+});
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const formConfig = computed(() => {
+  return [
+    {
+      type: "input",
+      prop: "code",
+      label: "样品单编号",
+      itemType: "text",
+      disabled: true,
+    },
+    {
+      type: "input",
+      prop: "buyCorporationName",
+      label: "客户名称",
+      itemType: "text",
+      disabled: true,
+    },
+    {
+      type: "slot",
+      slotName: "file",
+      label: "交接单",
+    },
+    {
+      type: "slot",
+      slotName: "indication",
+      label: "包装指示",
+    },
+  ];
+});
+const uploadData = ref({});
+const indicationUploadData = ref({});
+const clickHandoverSlip = (item) => {
+  handoverSlipForm.value.id = item.id;
+  handoverSlipForm.value.code = item.code;
+  handoverSlipForm.value.buyCorporationName = item.buyCorporationName;
+  if (item.fileInfoVos && item.fileInfoVos.length > 0) {
+    handoverSlipForm.value.fileList = item.fileInfoVos.map((item) => {
+      return {
+        raw: item,
+        name: item.fileName,
+        url: item.fileUrl,
+      };
+    });
+  } else {
+    handoverSlipForm.value.fileList = [];
+  }
+  if (item.packageFileInfoVOList && item.packageFileInfoVOList.length > 0) {
+    handoverSlipForm.value.packageFileList = item.packageFileInfoVOList.map((item) => {
+      return {
+        raw: item,
+        name: item.fileName,
+        url: item.fileUrl,
+      };
+    });
+  } else {
+    handoverSlipForm.value.packageFileList = [];
+  }
+  openHandoverSlip.value = true;
+};
+const uploadFile = async (file) => {
+  const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
+  uploadData.value = res.uploadBody;
+  file.id = res.id;
+  file.fileName = res.fileName;
+  file.fileUrl = res.fileUrl;
+  file.uploadState = true;
+  return true;
+};
+const indicationUploadFile = async (file) => {
+  const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
+  indicationUploadData.value = res.uploadBody;
+  file.id = res.id;
+  file.fileName = res.fileName;
+  file.fileUrl = res.fileUrl;
+  file.uploadState = true;
+  return true;
+};
+const handleSuccess = (any, UploadFile) => {
+  UploadFile.raw.uploadState = false;
+};
+const onPreviewFile = (file) => {
+  window.open(file.raw.fileUrl, "_blank");
+};
+const submitHandoverSlip = () => {
+  if (handoverSlipForm.value.fileList && handoverSlipForm.value.fileList.length > 0) {
+    for (let i = 0; i < handoverSlipForm.value.fileList.length; i++) {
+      if (handoverSlipForm.value.fileList[i].raw.uploadState) {
+        return ElMessage("文件上传中,请稍后提交");
+      }
+    }
+  }
+  if (handoverSlipForm.value.packageFileList && handoverSlipForm.value.packageFileList.length > 0) {
+    for (let i = 0; i < handoverSlipForm.value.packageFileList.length; i++) {
+      if (handoverSlipForm.value.packageFileList[i].raw.uploadState) {
+        return ElMessage("文件上传中,请稍后提交");
+      }
+    }
+  }
+  let data = proxy.deepClone(handoverSlipForm.value);
+  if (data.fileList && data.fileList.length > 0) {
+    data.fileList = data.fileList.map((item) => {
+      return {
+        id: item.raw.id,
+        fileName: item.raw.fileName,
+        fileUrl: item.raw.fileUrl,
+      };
+    });
+  } else {
+    data.fileList = [];
+  }
+  if (data.packageFileList && data.packageFileList.length > 0) {
+    data.packageFileList = data.packageFileList.map((item) => {
+      return {
+        id: item.raw.id,
+        fileName: item.raw.fileName,
+        fileUrl: item.raw.fileUrl,
+      };
+    });
+  } else {
+    data.packageFileList = [];
+  }
+  proxy.post("/contract/contractHandover", data).then(() => {
+    ElMessage({
+      message: "操作成功!",
+      type: "success",
+    });
+    openHandoverSlip.value = false;
+    getList();
+  });
+};
 </script>
 
 <style lang="scss" scoped>

+ 193 - 1
src/views/EHSD/saleContract/sampleEHSD/index.vue

@@ -26,12 +26,50 @@
         </div>
       </template>
     </byTable>
+
+    <el-dialog title="交接单" v-if="openHandoverSlip" v-model="openHandoverSlip" width="600">
+      <byForm :formConfig="formConfig" :formOption="formOption" v-model="handoverSlipForm">
+        <template #file>
+          <div style="width: 100%">
+            <el-upload
+              v-model:fileList="handoverSlipForm.fileList"
+              action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
+              :data="uploadData"
+              multiple
+              :before-upload="uploadFile"
+              :on-success="handleSuccess"
+              :on-preview="onPreviewFile">
+              <el-button type="primary" plain>选择</el-button>
+            </el-upload>
+          </div>
+        </template>
+        <template #indication>
+          <div style="width: 100%">
+            <el-upload
+              v-model:fileList="handoverSlipForm.packageFileList"
+              action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
+              :data="indicationUploadData"
+              multiple
+              :before-upload="indicationUploadFile"
+              :on-success="handleSuccess"
+              :on-preview="onPreviewFile">
+              <el-button type="primary" plain>选择</el-button>
+            </el-upload>
+          </div>
+        </template>
+      </byForm>
+      <template #footer>
+        <el-button @click="openHandoverSlip = false" size="large">关 闭</el-button>
+        <el-button type="primary" @click="submitHandoverSlip()" size="large">确 定</el-button>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
 <script setup>
 import { computed, ref } from "vue";
 import byTable from "@/components/byTable/index";
+import byForm from "@/components/byForm/index";
 import useUserStore from "@/store/modules/user";
 import { ElMessage, ElMessageBox } from "element-plus";
 
@@ -163,7 +201,7 @@ const config = computed(() => {
     {
       attrs: {
         label: "操作",
-        width: 120,
+        width: 140,
         align: "center",
         fixed: "right",
       },
@@ -171,6 +209,17 @@ const config = computed(() => {
         return [
           {
             attrs: {
+              label: "交接单",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              clickHandoverSlip(row);
+            },
+          },
+          {
+            attrs: {
               label: "作废",
               type: "primary",
               text: true,
@@ -274,6 +323,149 @@ const newSample = () => {
     },
   });
 };
+const openHandoverSlip = ref(false);
+const handoverSlipForm = ref({
+  id: "",
+  code: "",
+  buyCorporationName: "",
+  fileList: [],
+  packageFileList: [],
+});
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const formConfig = computed(() => {
+  return [
+    {
+      type: "input",
+      prop: "code",
+      label: "样品单编号",
+      itemType: "text",
+      disabled: true,
+    },
+    {
+      type: "input",
+      prop: "buyCorporationName",
+      label: "客户名称",
+      itemType: "text",
+      disabled: true,
+    },
+    {
+      type: "slot",
+      slotName: "file",
+      label: "交接单",
+    },
+    {
+      type: "slot",
+      slotName: "indication",
+      label: "包装指示",
+    },
+  ];
+});
+const uploadData = ref({});
+const indicationUploadData = ref({});
+const clickHandoverSlip = (item) => {
+  handoverSlipForm.value.id = item.id;
+  handoverSlipForm.value.code = item.code;
+  handoverSlipForm.value.buyCorporationName = item.buyCorporationName;
+  if (item.fileInfoVos && item.fileInfoVos.length > 0) {
+    handoverSlipForm.value.fileList = item.fileInfoVos.map((item) => {
+      return {
+        raw: item,
+        name: item.fileName,
+        url: item.fileUrl,
+      };
+    });
+  } else {
+    handoverSlipForm.value.fileList = [];
+  }
+  if (item.packageFileInfoVOList && item.packageFileInfoVOList.length > 0) {
+    handoverSlipForm.value.packageFileList = item.packageFileInfoVOList.map((item) => {
+      return {
+        raw: item,
+        name: item.fileName,
+        url: item.fileUrl,
+      };
+    });
+  } else {
+    handoverSlipForm.value.packageFileList = [];
+  }
+  openHandoverSlip.value = true;
+};
+const uploadFile = async (file) => {
+  const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
+  uploadData.value = res.uploadBody;
+  file.id = res.id;
+  file.fileName = res.fileName;
+  file.fileUrl = res.fileUrl;
+  file.uploadState = true;
+  return true;
+};
+const indicationUploadFile = async (file) => {
+  const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
+  indicationUploadData.value = res.uploadBody;
+  file.id = res.id;
+  file.fileName = res.fileName;
+  file.fileUrl = res.fileUrl;
+  file.uploadState = true;
+  return true;
+};
+const handleSuccess = (any, UploadFile) => {
+  UploadFile.raw.uploadState = false;
+};
+const onPreviewFile = (file) => {
+  window.open(file.raw.fileUrl, "_blank");
+};
+const submitHandoverSlip = () => {
+  if (handoverSlipForm.value.fileList && handoverSlipForm.value.fileList.length > 0) {
+    for (let i = 0; i < handoverSlipForm.value.fileList.length; i++) {
+      if (handoverSlipForm.value.fileList[i].raw.uploadState) {
+        return ElMessage("文件上传中,请稍后提交");
+      }
+    }
+  }
+  if (handoverSlipForm.value.packageFileList && handoverSlipForm.value.packageFileList.length > 0) {
+    for (let i = 0; i < handoverSlipForm.value.packageFileList.length; i++) {
+      if (handoverSlipForm.value.packageFileList[i].raw.uploadState) {
+        return ElMessage("文件上传中,请稍后提交");
+      }
+    }
+  }
+  let data = proxy.deepClone(handoverSlipForm.value);
+  if (data.fileList && data.fileList.length > 0) {
+    data.fileList = data.fileList.map((item) => {
+      return {
+        id: item.raw.id,
+        fileName: item.raw.fileName,
+        fileUrl: item.raw.fileUrl,
+      };
+    });
+  } else {
+    data.fileList = [];
+  }
+  if (data.packageFileList && data.packageFileList.length > 0) {
+    data.packageFileList = data.packageFileList.map((item) => {
+      return {
+        id: item.raw.id,
+        fileName: item.raw.fileName,
+        fileUrl: item.raw.fileUrl,
+      };
+    });
+  } else {
+    data.packageFileList = [];
+  }
+  proxy.post("/sample/sampleHandover", data).then(() => {
+    ElMessage({
+      message: "操作成功!",
+      type: "success",
+    });
+    openHandoverSlip.value = false;
+    getList();
+  });
+};
 </script>
 
 <style lang="scss" scoped>

+ 44 - 14
src/views/process/processApproval/index.vue

@@ -240,13 +240,28 @@ const handleSubmit = async (_type) => {
             }
           } else if (flowForm.flowKey == "contract_flow") {
             if (flowForm.tenantType === "EHSD") {
-              data.fileList = data.fileList.map((item) => {
-                return {
-                  id: item.raw.id,
-                  fileName: item.raw.fileName,
-                  fileUrl: item.raw.fileUrl,
-                };
-              });
+              if (data.fileList && data.fileList.length > 0) {
+                data.fileList = data.fileList.map((item) => {
+                  return {
+                    id: item.raw.id,
+                    fileName: item.raw.fileName,
+                    fileUrl: item.raw.fileUrl,
+                  };
+                });
+              } else {
+                data.fileList = [];
+              }
+              if (data.packageFileList && data.packageFileList.length > 0) {
+                data.packageFileList = data.packageFileList.map((item) => {
+                  return {
+                    id: item.raw.id,
+                    fileName: item.raw.fileName,
+                    fileUrl: item.raw.fileUrl,
+                  };
+                });
+              } else {
+                data.packageFileList = [];
+              }
               data.ehsdJson = JSON.stringify({
                 deliveryTime: data.deliveryTime,
               });
@@ -262,13 +277,28 @@ const handleSubmit = async (_type) => {
               });
             }
           } else if (flowForm.flowKey == "sample_flow") {
-            data.fileList = data.fileList.map((item) => {
-              return {
-                id: item.raw.id,
-                fileName: item.raw.fileName,
-                fileUrl: item.raw.fileUrl,
-              };
-            });
+            if (data.fileList && data.fileList.length > 0) {
+              data.fileList = data.fileList.map((item) => {
+                return {
+                  id: item.raw.id,
+                  fileName: item.raw.fileName,
+                  fileUrl: item.raw.fileUrl,
+                };
+              });
+            } else {
+              data.fileList = [];
+            }
+            if (data.packageFileList && data.packageFileList.length > 0) {
+              data.packageFileList = data.packageFileList.map((item) => {
+                return {
+                  id: item.raw.id,
+                  fileName: item.raw.fileName,
+                  fileUrl: item.raw.fileUrl,
+                };
+              });
+            } else {
+              data.packageFileList = [];
+            }
             data.ehsdJson = JSON.stringify({
               deliveryTime: data.deliveryTime,
             });