Kaynağa Gözat

EHSD样品单 以及 报价单,销售合同调整

lxf 2 yıl önce
ebeveyn
işleme
f6e2ed673e

+ 71 - 24
src/components/process/Contract.vue

@@ -259,18 +259,6 @@
                   <el-option v-for="item in fundsPaymentMethod" :key="item.value" :label="item.label" :value="item.value" />
                 </el-select>
               </el-form-item>
-              <div style="height: 20px"></div>
-              <el-form-item label="Beneficiary Name" prop="beneficiaryName">
-                <el-input v-model="formData.data.beneficiaryName" placeholder="请输入Beneficiary Name" />
-              </el-form-item>
-              <div style="height: 20px"></div>
-              <el-form-item label="Beneficiary Bank" prop="beneficiaryBank">
-                <el-input v-model="formData.data.beneficiaryBank" placeholder="请输入Beneficiary Bank" />
-              </el-form-item>
-              <div style="height: 20px"></div>
-              <el-form-item label="Beneficiary Bank Address" prop="beneficiaryBankAddress">
-                <el-input v-model="formData.data.beneficiaryBankAddress" placeholder="请输入Beneficiary Bank Address" />
-              </el-form-item>
             </el-col>
             <el-col :span="7">
               <el-form-item label="预付比例 (%)" prop="advanceRatio">
@@ -283,18 +271,6 @@
                   :min="0"
                   :max="100" />
               </el-form-item>
-              <div style="height: 20px"></div>
-              <el-form-item label="Beneficiary Account Number" prop="beneficiaryAccountNumber">
-                <el-input v-model="formData.data.beneficiaryAccountNumber" placeholder="请输入Beneficiary Account Number" />
-              </el-form-item>
-              <div style="height: 20px"></div>
-              <el-form-item label="Swift Code" prop="swiftCode">
-                <el-input v-model="formData.data.swiftCode" placeholder="请输入Swift Code" />
-              </el-form-item>
-              <div style="height: 20px"></div>
-              <el-form-item label="Beneficiary Address" prop="beneficiaryAddress">
-                <el-input v-model="formData.data.beneficiaryAddress" placeholder="请输入Beneficiary Address" />
-              </el-form-item>
             </el-col>
             <el-col :span="7">
               <el-form-item label="收款账号" prop="shroffAccountId">
@@ -303,7 +279,49 @@
                 </el-select>
               </el-form-item>
             </el-col>
+            <el-col :span="3">
+              <el-form-item label="  ">
+                <el-button type="primary" @click="changeActiveName" text>
+                  <span v-if="activeName == '1'">收起</span>
+                  <span v-else>展开</span>
+                </el-button>
+              </el-form-item>
+            </el-col>
           </el-row>
+          <div style="width: 100%; margin-top: 34px">
+            <el-collapse v-model="activeName" class="hideCollapse" accordion>
+              <el-collapse-item title="" name="1">
+                <el-row style="width: 100%">
+                  <el-col :span="9">
+                    <el-form-item label="Beneficiary Name" prop="beneficiaryName">
+                      <el-input v-model="formData.data.beneficiaryName" placeholder="请输入Beneficiary Name" />
+                    </el-form-item>
+                    <div style="height: 20px"></div>
+                    <el-form-item label="Beneficiary Bank" prop="beneficiaryBank">
+                      <el-input v-model="formData.data.beneficiaryBank" placeholder="请输入Beneficiary Bank" />
+                    </el-form-item>
+                    <div style="height: 20px"></div>
+                    <el-form-item label="Beneficiary Bank Address" prop="beneficiaryBankAddress">
+                      <el-input v-model="formData.data.beneficiaryBankAddress" placeholder="请输入Beneficiary Bank Address" />
+                    </el-form-item>
+                  </el-col>
+                  <el-col :span="9">
+                    <el-form-item label="Beneficiary Account Number" prop="beneficiaryAccountNumber">
+                      <el-input v-model="formData.data.beneficiaryAccountNumber" placeholder="请输入Beneficiary Account Number" />
+                    </el-form-item>
+                    <div style="height: 20px"></div>
+                    <el-form-item label="Swift Code" prop="swiftCode">
+                      <el-input v-model="formData.data.swiftCode" placeholder="请输入Swift Code" />
+                    </el-form-item>
+                    <div style="height: 20px"></div>
+                    <el-form-item label="Beneficiary Address" prop="beneficiaryAddress">
+                      <el-input v-model="formData.data.beneficiaryAddress" placeholder="请输入Beneficiary Address" />
+                    </el-form-item>
+                  </el-col>
+                </el-row>
+              </el-collapse-item>
+            </el-collapse>
+          </div>
         </div>
       </template>
       <template #delivery>
@@ -448,6 +466,7 @@ const cityData = ref([]);
 const customerUserList = ref([]);
 const accountList = ref([]);
 const openProduct = ref(false);
+const activeName = ref("");
 const formData = reactive({
   data: {
     amount: undefined,
@@ -920,6 +939,13 @@ const handleHandover = (row, index) => {
 const updateContent = (val) => {
   productRow.data.remark = val;
 };
+const changeActiveName = () => {
+  if (activeName.value) {
+    activeName.value = "";
+  } else {
+    activeName.value = "1";
+  }
+};
 const uploadFile = async (file) => {
   const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
   uploadData.value = res.uploadBody;
@@ -1033,6 +1059,11 @@ const handleSubmit = async () => {
       ElMessage("请添加至少一件商品");
     }
     return false;
+  } else {
+    setTimeout(() => {
+      const errorDiv = document.getElementsByClassName("is-error");
+      errorDiv[0].scrollIntoView();
+    }, 0);
   }
   return status;
 };
@@ -1067,4 +1098,20 @@ const changeShroffAccount = (val) => {
   cursor: pointer;
   vertical-align: middle;
 }
+.shrinkPadding {
+  padding-right: 0 !important;
+}
+.hideCollapse {
+  margin-top: -62px;
+  border: 0 !important;
+}
+::v-deep(.el-collapse-item__arrow) {
+  display: none !important;
+}
+::v-deep(.el-collapse-item__wrap) {
+  border: 0 !important;
+}
+::v-deep(.el-collapse-item__header) {
+  border: 0 !important;
+}
 </style>

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

@@ -476,7 +476,7 @@ const cityData = ref([]);
 const customerUserList = ref([]);
 const openProductCompany = ref(false);
 const openProductCustomer = ref(false);
-const activeName = ref("1");
+const activeName = ref("");
 const formData = reactive({
   data: {
     currency: "¥",
@@ -695,14 +695,14 @@ const changeTemplate = (val) => {
         } else {
           formData.data.sellCityId = "";
         }
-        formData.data.companyId = res.corporationId;
+        formData.data.sellCorporationId = res.corporationId;
         formData.data.sellContactName = res.contactName;
         formData.data.sellContactNumber = res.contactNumber;
         formData.data.sellAddress = res.address;
       },
       (err) => {
         console.log(err);
-        formData.data.companyId = "";
+        formData.data.sellCorporationId = "";
         formData.data.sellContactName = "";
         formData.data.sellContactNumber = "";
         formData.data.sellCountryId = "";
@@ -712,7 +712,7 @@ const changeTemplate = (val) => {
       }
     );
   } else {
-    formData.data.companyId = "";
+    formData.data.sellCorporationId = "";
     formData.data.sellContactName = "";
     formData.data.sellContactNumber = "";
     formData.data.sellCountryId = "";
@@ -951,6 +951,11 @@ const handleSubmit = async () => {
       ElMessage("请上传交接单");
     }
     return false;
+  } else {
+    setTimeout(() => {
+      const errorDiv = document.getElementsByClassName("is-error");
+      errorDiv[0].scrollIntoView();
+    }, 0);
   }
   return status;
 };

+ 8 - 3
src/components/process/EHSD/PriceSheet.vue

@@ -566,14 +566,14 @@ const changeTemplate = (val) => {
         } else {
           formData.data.sellCityId = "";
         }
-        formData.data.companyId = res.corporationId;
+        formData.data.sellCorporationId = res.corporationId;
         formData.data.sellContactName = res.contactName;
         formData.data.sellContactNumber = res.contactNumber;
         formData.data.sellAddress = res.address;
       },
       (err) => {
         console.log(err);
-        formData.data.companyId = "";
+        formData.data.sellCorporationId = "";
         formData.data.sellContactName = "";
         formData.data.sellContactNumber = "";
         formData.data.sellCountryId = "";
@@ -583,7 +583,7 @@ const changeTemplate = (val) => {
       }
     );
   } else {
-    formData.data.companyId = "";
+    formData.data.sellCorporationId = "";
     formData.data.sellContactName = "";
     formData.data.sellContactNumber = "";
     formData.data.sellCountryId = "";
@@ -809,6 +809,11 @@ const handleSubmit = async () => {
       ElMessage("请添加至少一件商品");
     }
     return false;
+  } else {
+    setTimeout(() => {
+      const errorDiv = document.getElementsByClassName("is-error");
+      errorDiv[0].scrollIntoView();
+    }, 0);
   }
   return status;
 };

+ 1120 - 0
src/components/process/EHSD/Sample.vue

@@ -0,0 +1,1120 @@
+<template>
+    <div style="width: 100%; padding: 0px 15px">
+      <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit">
+        <template #seller>
+          <div style="width: 100%">
+            <el-form-item prop="sellCorporationId">
+              <el-select v-model="formData.data.sellCorporationId" style="width: 100%" disabled>
+                <el-option v-for="item in corporationList" :key="item.value" :label="item.label" :value="item.value" />
+              </el-select>
+            </el-form-item>
+            <el-row style="margin-top: 20px; width: 100%">
+              <el-col :span="8">
+                <el-form-item label="地址" prop="sellCountryId">
+                  <el-input v-model="formData.data.sellCountryId" placeholder="请输入国家" />
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label=" " prop="sellProvinceId">
+                  <el-input v-model="formData.data.sellProvinceId" placeholder="请输入省/州" />
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label=" " prop="sellCityId">
+                  <el-input v-model="formData.data.sellCityId" placeholder="请输入城市" />
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <el-row style="margin-top: 20px; width: 100%">
+              <el-col :span="24">
+                <el-form-item prop="sellAddress">
+                  <el-input v-model="formData.data.sellAddress" type="textarea"> </el-input>
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <el-row style="margin-top: 20px; width: 100%">
+              <el-col :span="8">
+                <el-form-item label="联系人" prop="sellContactName">
+                  <el-input v-model="formData.data.sellContactName" placeholder="请输入联系人" />
+                </el-form-item>
+              </el-col>
+              <el-col :span="16">
+                <el-form-item label=" " prop="sellContactNumber">
+                  <el-input v-model="formData.data.sellContactNumber" placeholder="请输入联系人电话" />
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </div>
+        </template>
+        <template #buyer>
+          <div style="width: 100%">
+            <div style="width: 100%">
+              <el-form-item prop="buyCorporationId">
+                <el-select v-model="formData.data.buyCorporationId" style="width: 100%" @change="changeCustomer">
+                  <el-option v-for="item in customerList" :key="item.value" :label="item.label" :value="item.value" />
+                </el-select>
+              </el-form-item>
+              <el-row style="margin-top: 20px; width: 100%">
+                <el-col :span="6">
+                  <el-form-item label="地址" prop="buyCountryId">
+                    <el-select v-model="formData.data.buyCountryId" placeholder="国家" @change="(val) => getCityData(val, '20', true)">
+                      <el-option v-for="item in countryData" :label="item.chineseName" :value="item.id"> </el-option>
+                    </el-select>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="6">
+                  <el-form-item label=" " prop="buyProvinceId">
+                    <el-select v-model="formData.data.buyProvinceId" placeholder="省/洲" @change="(val) => getCityData(val, '30', true)">
+                      <el-option v-for="item in provinceData" :label="item.name" :value="item.id"> </el-option>
+                    </el-select>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="6">
+                  <el-form-item label=" " prop="buyCityId">
+                    <el-select v-model="formData.data.buyCityId" placeholder="城市">
+                      <el-option v-for="item in cityData" :label="item.name" :value="item.id"> </el-option>
+                    </el-select>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="6">
+                  <el-form-item label=" " prop="buyPostalCode">
+                    <el-input v-model="formData.data.buyPostalCode" placeholder="请输入邮编" />
+                  </el-form-item>
+                </el-col>
+              </el-row>
+              <el-row style="margin-top: 20px; width: 100%">
+                <el-col :span="24">
+                  <el-form-item prop="buyAddress">
+                    <el-input v-model="formData.data.buyAddress" type="textarea"> </el-input>
+                  </el-form-item>
+                </el-col>
+              </el-row>
+              <el-row style="margin-top: 20px; width: 100%">
+                <el-col :span="8">
+                  <el-form-item label="联系人" prop="buyContactName">
+                    <el-autocomplete
+                      v-model="formData.data.buyContactName"
+                      :fetch-suggestions="querySearchPerson"
+                      clearable
+                      class="inline-input w-50"
+                      placeholder="请输入联系人"
+                      @select="handlePerson">
+                    </el-autocomplete>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="16">
+                  <el-form-item label=" " prop="buyContactNumber">
+                    <el-input v-model="formData.data.buyContactNumber" placeholder="请输入联系人电话" />
+                  </el-form-item>
+                </el-col>
+              </el-row>
+            </div>
+          </div>
+        </template>
+        <template #payment>
+          <div style="width: 100%">
+            <el-row style="margin-top: 20px; width: 100%">
+              <el-col :span="6">
+                <el-form-item label="币种" prop="currency">
+                  <el-select v-model="formData.data.currency" placeholder="请选择币种" style="width: 100%">
+                    <el-option v-for="item in accountCurrency" :key="item.value" :label="item.label" :value="item.value" />
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="付款方式" prop="paymentMethod">
+                  <el-select v-model="formData.data.paymentMethod" placeholder="请选择付款方式" style="width: 100%">
+                    <el-option v-for="item in fundsPaymentMethod" :key="item.value" :label="item.label" :value="item.value" />
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="预付比例 (%)" prop="advanceRatio">
+                  <el-input-number
+                    v-model="formData.data.advanceRatio"
+                    placeholder="请输入预付比例"
+                    style="width: 100%"
+                    :precision="2"
+                    :controls="false"
+                    :min="0"
+                    :max="100" />
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <el-row style="margin-top: 20px; width: 100%">
+              <el-col :span="18">
+                <el-form-item label="付款条件" prop="remark">
+                  <el-input v-model="formData.data.remark" :rows="2" type="textarea" placeholder="请输入付款条件" />
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <el-row style="margin-top: 20px; width: 100%">
+              <el-col :span="9">
+                <el-form-item label="收款账号" prop="shroffAccountId">
+                  <el-select v-model="formData.data.shroffAccountId" placeholder="请选择收款账号" style="width: 100%" @change="changeShroffAccount">
+                    <el-option v-for="item in accountList" :key="item.value" :label="item.label" :value="item.value" />
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :span="9">
+                <el-form-item label="  ">
+                  <el-button type="primary" @click="changeActiveName" text>
+                    <span v-if="activeName == '1'">收起</span>
+                    <span v-else>展开</span>
+                  </el-button>
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <div style="width: 100%; margin-top: 34px">
+              <el-collapse v-model="activeName" class="hideCollapse" accordion>
+                <el-collapse-item title="" name="1">
+                  <el-row style="width: 100%">
+                    <el-col :span="9">
+                      <el-form-item label="Beneficiary Name" prop="beneficiaryName">
+                        <el-input v-model="formData.data.beneficiaryName" placeholder="请输入Beneficiary Name" />
+                      </el-form-item>
+                      <div style="height: 20px"></div>
+                      <el-form-item label="Beneficiary Bank" prop="beneficiaryBank">
+                        <el-input v-model="formData.data.beneficiaryBank" placeholder="请输入Beneficiary Bank" />
+                      </el-form-item>
+                      <div style="height: 20px"></div>
+                      <el-form-item label="Beneficiary Bank Address" prop="beneficiaryBankAddress">
+                        <el-input v-model="formData.data.beneficiaryBankAddress" placeholder="请输入Beneficiary Bank Address" />
+                      </el-form-item>
+                    </el-col>
+                    <el-col :span="9">
+                      <el-form-item label="Beneficiary Account Number" prop="beneficiaryAccountNumber">
+                        <el-input v-model="formData.data.beneficiaryAccountNumber" placeholder="请输入Beneficiary Account Number" />
+                      </el-form-item>
+                      <div style="height: 20px"></div>
+                      <el-form-item label="Swift Code" prop="swiftCode">
+                        <el-input v-model="formData.data.swiftCode" placeholder="请输入Swift Code" />
+                      </el-form-item>
+                      <div style="height: 20px"></div>
+                      <el-form-item label="Beneficiary Address" prop="beneficiaryAddress">
+                        <el-input v-model="formData.data.beneficiaryAddress" placeholder="请输入Beneficiary Address" />
+                      </el-form-item>
+                    </el-col>
+                  </el-row>
+                </el-collapse-item>
+              </el-collapse>
+            </div>
+          </div>
+        </template>
+        <template #delivery>
+          <div style="width: 100%">
+            <el-row style="margin-top: 20px; width: 100%">
+              <el-col :span="6">
+                <el-form-item label="报价有效期 (天)" prop="effective">
+                  <el-input-number v-model="formData.data.effective" placeholder="请输入有效期" style="width: 100%" :precision="0" :controls="false" :min="0" />
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="交货期限" prop="deliveryTime">
+                  <el-date-picker v-model="formData.data.deliveryTime" type="date" placeholder="请选择交货期限" value-format="YYYY-MM-DD" />
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="运输方式" prop="transportMethod">
+                  <el-select v-model="formData.data.transportMethod" placeholder="请选择运输方式" style="width: 100%">
+                    <el-option v-for="item in shippingMethod" :key="item.value" :label="item.label" :value="item.value" />
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="运输说明" prop="transportRemark">
+                  <el-input v-model="formData.data.transportRemark" placeholder="请输入运输说明" />
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </div>
+        </template>
+        <template #commodity>
+          <div style="width: 100%">
+            <el-button type="primary" @click="openProductCompany = true" plain>标准产品库</el-button>
+            <el-button type="primary" @click="clickCustomerProduct()" plain>客户产品库</el-button>
+            <el-table :data="formData.data.quotationProductList" style="width: 100%; margin-top: 16px">
+              <el-table-column label="商品图片" width="80">
+                <template #default="{ row }">
+                  <div v-if="row.productId">
+                    <img :src="row.fileUrl" class="pic" @click="onPicture(row.fileUrl)" />
+                  </div>
+                  <div v-else></div>
+                </template>
+              </el-table-column>
+              <el-table-column label="商品名称" min-width="180">
+                <template #default="{ row, $index }">
+                  <div style="width: 100%">
+                    <el-form-item
+                      :prop="'quotationProductList.' + $index + '.productName'"
+                      :rules="rules.productName"
+                      :inline-message="true"
+                      class="shrinkPadding">
+                      <el-input v-model="row.productName" placeholder="请输入商品名称" />
+                    </el-form-item>
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column label="尺寸 cm*cm*cm" width="140">
+                <template #default="{ row, $index }">
+                  <div style="width: 100%">
+                    <el-form-item
+                      :prop="'quotationProductList.' + $index + '.productModel'"
+                      :rules="rules.productModel"
+                      :inline-message="true"
+                      class="shrinkPadding">
+                      <el-input v-model="row.productModel" placeholder="请输入" />
+                    </el-form-item>
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column label="数量" width="130">
+                <template #default="{ row, $index }">
+                  <div style="width: 100%">
+                    <el-form-item :prop="'quotationProductList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true" class="shrinkPadding">
+                      <el-input-number
+                        v-model="row.quantity"
+                        placeholder="请输入"
+                        style="width: 100%"
+                        :precision="0"
+                        :controls="false"
+                        :min="0"
+                        @change="calculationAmount()" />
+                    </el-form-item>
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column label="单价" width="140">
+                <template #default="{ row, $index }">
+                  <div style="width: 100%">
+                    <el-form-item :prop="'quotationProductList.' + $index + '.price'" :rules="rules.price" :inline-message="true" class="shrinkPadding">
+                      <el-input-number
+                        v-model="row.price"
+                        placeholder="请输入"
+                        style="width: 100%"
+                        :precision="2"
+                        :controls="false"
+                        :min="0"
+                        @change="calculationAmount()" />
+                    </el-form-item>
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column label="贸易方式" width="140">
+                <template #default="{ row, $index }">
+                  <div style="width: 100%">
+                    <el-form-item
+                      :prop="'quotationProductList.' + $index + '.tradeMethods'"
+                      :rules="rules.tradeMethods"
+                      :inline-message="true"
+                      class="shrinkPadding">
+                      <el-select v-model="row.tradeMethods" placeholder="请选择" style="width: 100%">
+                        <el-option v-for="item in tradeMethods" :key="item.value" :label="item.label" :value="item.value" />
+                      </el-select>
+                    </el-form-item>
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column label="包装方式" width="180">
+                <template #default="{ row, $index }">
+                  <div style="width: 100%">
+                    <el-form-item :prop="'quotationProductList.' + $index + '.packMethod'" :rules="rules.packMethod" :inline-message="true" class="shrinkPadding">
+                      <el-input v-model="row.packMethod" placeholder="请输入" />
+                    </el-form-item>
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column prop="amount" :label="'金额 ( ' + formData.data.currency + ' )'" width="130" />
+              <el-table-column label="操作" width="60" align="center" fixed="right">
+                <template #default="{ row, $index }">
+                  <el-button type="primary" link @click="handleRemove($index, row)">删除</el-button>
+                </template>
+              </el-table-column>
+            </el-table>
+          </div>
+        </template>
+        <template #file>
+          <div style="width: 100%">
+            <el-upload
+              v-model:fileList="formData.data.fileList"
+              action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
+              :data="uploadData"
+              multiple
+              :before-upload="uploadFile"
+              :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>
+            <el-table :data="formData.data.quotationPayList" style="width: 100%; margin-top: 16px">
+              <el-table-column label="收费项目" width="220">
+                <template #default="{ row, $index }">
+                  <div style="width: 100%">
+                    <el-form-item :prop="'quotationPayList.' + $index + '.payName'" :rules="rules.payName" :inline-message="true">
+                      <el-autocomplete v-model="row.payName" :fetch-suggestions="querySearch" clearable class="inline-input w-50" placeholder="请输入收费项目" />
+                    </el-form-item>
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column label="备注">
+                <template #default="{ row, $index }">
+                  <div style="width: 100%">
+                    <el-form-item :prop="'quotationPayList.' + $index + '.remark'">
+                      <el-input v-model="row.remark" placeholder="请输入备注" />
+                    </el-form-item>
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column :label="'金额 ( ' + formData.data.currency + ' )'" width="130">
+                <template #default="{ row, $index }">
+                  <div style="width: 100%">
+                    <el-form-item :prop="'quotationPayList.' + $index + '.amount'" :rules="rules.amount" :inline-message="true" class="shrinkPadding">
+                      <el-input-number
+                        v-model="row.amount"
+                        placeholder="请输入金额"
+                        style="width: 100%"
+                        :precision="2"
+                        :controls="false"
+                        :min="0"
+                        @change="totalAmount()" />
+                    </el-form-item>
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column label="操作" width="60" align="center" fixed="right">
+                <template #default="{ $index }">
+                  <el-button type="primary" link @click="handleDelete($index)">删除</el-button>
+                </template>
+              </el-table-column>
+            </el-table>
+          </div>
+        </template>
+        <template #offerMoney>
+          <div style="width: 100%; display: flex">
+            <div style="width: calc(100% - 190px)"></div>
+            <div style="width: 130px; padding: 0 12px">
+              <el-form-item label="合同总金额" prop="amount" class="shrinkPadding">
+                <el-input v-model="formData.data.amount" placeholder="合同总金额" disabled />
+              </el-form-item>
+            </div>
+          </div>
+        </template>
+        <template #shipment>
+          <div style="width: 100%">
+            <el-table :data="formData.data.contractShipmentList" style="width: 100%; margin-top: 16px">
+              <el-table-column prop="code" label="商品编码" width="120" />
+              <el-table-column prop="productName" label="商品名称" />
+              <el-table-column label="出货日期" width="220">
+                <template #default="{ row, $index }">
+                  <div style="width: 100%">
+                    <el-form-item :prop="'contractShipmentList.' + $index + '.shipmentTime'" :rules="rules.shipmentTime" :inline-message="true">
+                      <el-date-picker v-model="row.shipmentTime" type="date" placeholder="请选择出货日期" value-format="YYYY-MM-DD" />
+                    </el-form-item>
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column label="数量" width="160">
+                <template #default="{ row, $index }">
+                  <div style="width: 100%">
+                    <el-form-item :prop="'contractShipmentList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true">
+                      <el-input-number
+                        v-model="row.quantity"
+                        placeholder="请输入数量"
+                        style="width: 100%"
+                        :precision="0"
+                        :controls="false"
+                        :min="0"
+                        @change="calculationAmount()" />
+                    </el-form-item>
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column align="center" label="操作" width="120" fixed="right">
+                <template #default="{ row, $index }">
+                  <el-button type="primary" link @click="clickSplit(row)">拆分</el-button>
+                  <el-button type="primary" link @click="clickDelete($index)">删除</el-button>
+                </template>
+              </el-table-column>
+            </el-table>
+          </div>
+        </template>
+      </byForm>
+  
+      <el-dialog v-if="openProductCompany" v-model="openProductCompany" title="公司产品库" width="90%" append-to-body>
+        <CompanyProduct :selectStatus="true" @selectProduct="selectProduct"></CompanyProduct>
+      </el-dialog>
+  
+      <el-dialog v-if="openProductCustomer" v-model="openProductCustomer" title="客户产品库" width="90%" append-to-body>
+        <CustomerProduct :selectStatus="true" :buyCorporationId="formData.data.buyCorporationId" @selectProduct="selectProduct"></CustomerProduct>
+      </el-dialog>
+    </div>
+  </template>
+  
+  <script setup>
+  import byForm from "@/components/byForm/index";
+  import CompanyProduct from "@/views/EHSD/productLibrary/companyProduct/index";
+  import CustomerProduct from "@/views/EHSD/productLibrary/customerProduct/index";
+  import { ElMessage } from "element-plus";
+  
+  const { proxy } = getCurrentInstance();
+  const innerMethod = ref([]);
+  const outsideMethod = ref([]);
+  const accountCurrency = ref([]);
+  const fundsPaymentMethod = ref([]);
+  const tradeMethods = ref([]);
+  const shippingMethod = ref([]);
+  const submitType = ref([]);
+  const templateList = ref([]);
+  const corporationList = ref([]);
+  const customerList = ref([]);
+  const accountList = ref([]);
+  const countryData = ref([]);
+  const provinceData = ref([]);
+  const cityData = ref([]);
+  const customerUserList = ref([]);
+  const openProductCompany = ref(false);
+  const openProductCustomer = ref(false);
+  const activeName = ref("");
+  const formData = reactive({
+    data: {
+      currency: "¥",
+      submitType: "2",
+      amount: undefined,
+      quotationProductList: [],
+      quotationPayList: [],
+      fileList: [],
+      contractShipmentList: [],
+    },
+  });
+  const submit = ref(null);
+  const formOption = reactive({
+    inline: true,
+    labelWidth: 100,
+    itemWidth: 100,
+    rules: [],
+  });
+  const uploadData = ref({});
+  const formConfig = computed(() => {
+    return [
+      {
+        label: "合同模板",
+      },
+      {
+        type: "select",
+        label: "选择合同模板",
+        prop: "contractTemplateId",
+        data: templateList.value,
+        fn: (val) => {
+          changeTemplate(val);
+        },
+      },
+      {
+        type: "slot",
+        slotName: "seller",
+        label: "卖方信息",
+        itemWidth: 50,
+      },
+      {
+        type: "slot",
+        slotName: "buyer",
+        label: "买方信息",
+        itemWidth: 50,
+      },
+      {
+        type: "slot",
+        slotName: "payment",
+        label: "付款信息",
+      },
+      {
+        type: "slot",
+        slotName: "delivery",
+        label: "交付信息",
+      },
+      {
+        type: "slot",
+        slotName: "commodity",
+        label: "商品信息",
+      },
+      {
+        type: "slot",
+        prop: "file",
+        slotName: "file",
+        label: "交接单",
+      },
+      {
+        type: "slot",
+        slotName: "otherCharge",
+        label: "其他收费项目",
+      },
+      {
+        type: "slot",
+        slotName: "offerMoney",
+      },
+      {
+        type: "slot",
+        slotName: "shipment",
+        label: "出货计划",
+      },
+    {
+      type: "select",
+      label: "提交类型",
+      prop: "submitType",
+      data: submitType.value,
+    },
+    ];
+  });
+  const rules = ref({
+    contractTemplateId: [{ required: true, message: "请选择合同模板", trigger: "change" }],
+    buyCorporationId: [{ required: true, message: "请选择公司", trigger: "change" }],
+    buyCountryId: [{ required: true, message: "请选择国家", trigger: "change" }],
+    buyProvinceId: [{ required: true, message: "请选择省/州", trigger: "change" }],
+    buyCityId: [{ required: true, message: "请选择城市", trigger: "change" }],
+    // buyAddress: [{ required: true, message: "请输入详细地址", trigger: "blur" }],
+    buyContactName: [{ required: true, message: "请输入联系人", trigger: ["change", "blur"] }],
+    buyContactNumber: [{ required: true, message: "请输入联系电话", trigger: "blur" }],
+    productName: [{ required: true, message: "请输入商品名称", trigger: "blur" }],
+    productModel: [{ required: true, message: "请输入尺寸 cm*cm*cm", trigger: "blur" }],
+    quantity: [{ required: true, message: "请输入数量", trigger: "blur" }],
+    price: [{ required: true, message: "请输入单价", trigger: "blur" }],
+    packMethod: [{ required: true, message: "请输入包装方式", trigger: "blur" }],
+    amount: [{ required: true, message: "请输入金额", trigger: "blur" }],
+    payName: [{ required: true, message: "请输入收费项目", trigger: ["change", "blur"] }],
+    currency: [{ required: true, message: "请选择币种", trigger: "change" }],
+    effective: [{ required: true, message: "请输入报价有效期", trigger: "blur" }],
+    deliveryTime: [{ required: true, message: "请选择交货期限", trigger: "change" }],
+    paymentMethod: [{ required: true, message: "请选择付款方式", trigger: "change" }],
+    advanceRatio: [{ required: true, message: "请输入预付比例", trigger: "blur" }],
+    shroffAccountId: [{ required: true, message: "请选择收款账号", trigger: "change" }],
+    tradeMethods: [{ required: true, message: "请选择贸易方式", trigger: "change" }],
+    transportMethod: [{ required: true, message: "请选择运输方式", trigger: "change" }],
+    transportRemark: [{ required: true, message: "请输入运输说明", trigger: "blur" }],
+    remark: [{ required: true, message: "请输入付款条件", trigger: "blur" }],
+    submitType: [{ required: true, message: "请选择提交类型", trigger: "change" }],
+  });
+  const getDict = () => {
+    proxy
+      .getDictOne([
+        "inner_packaging_method_ehsd",
+        "outside_packaging_method_ehsd",
+        "account_currency",
+        "funds_payment_method",
+        "trade_methods",
+        "shipping_method",
+        "submit_type",
+      ])
+      .then((res) => {
+        innerMethod.value = res["inner_packaging_method_ehsd"].map((x) => ({
+          label: x.dictValue,
+          value: x.dictKey,
+        }));
+        outsideMethod.value = res["outside_packaging_method_ehsd"].map((x) => ({
+          label: x.dictValue,
+          value: x.dictKey,
+        }));
+        accountCurrency.value = res["account_currency"].map((x) => ({
+          label: x.dictValue,
+          value: x.dictKey,
+        }));
+        fundsPaymentMethod.value = res["funds_payment_method"].map((x) => ({
+          label: x.dictValue,
+          value: x.dictKey,
+        }));
+        tradeMethods.value = res["trade_methods"].map((x) => ({
+          label: x.dictValue,
+          value: x.dictKey,
+        }));
+        shippingMethod.value = res["shipping_method"].map((x) => ({
+          label: x.dictValue,
+          value: x.dictKey,
+        }));
+        submitType.value = res["submit_type"].map((x) => ({
+          label: x.dictValue,
+          value: x.dictKey,
+        }));
+      });
+    proxy.post("/contractTemplate/page", { pageNum: 1, pageSize: 999 }).then((res) => {
+      templateList.value = res.rows.map((item) => {
+        return {
+          ...item,
+          label: item.templateName,
+          value: item.id,
+        };
+      });
+    });
+    proxy.post("/corporation/page", { pageNum: 1, pageSize: 999 }).then((res) => {
+      corporationList.value = res.rows.map((item) => {
+        return {
+          ...item,
+          label: item.name,
+          value: item.id,
+        };
+      });
+    });
+    proxy.post("/customer/page", { pageNum: 1, pageSize: 999 }).then((res) => {
+      customerList.value = res.rows.map((item) => {
+        return {
+          ...item,
+          label: item.name,
+          value: item.id,
+        };
+      });
+    });
+    proxy.post("/accountManagement/page", { pageNum: 1, pageSize: 999 }).then((res) => {
+      accountList.value = res.rows.map((item) => {
+        return {
+          ...item,
+          label: item.alias,
+          value: item.id,
+        };
+      });
+    });
+  };
+  getDict();
+  const changeTemplate = (val) => {
+    if (val) {
+      proxy.post("/contractTemplate/detail", { id: val }).then(
+        (res) => {
+          proxy.post("/areaInfo/list", { parentId: "0" }).then((resCountry) => {
+            let sellCountryData = resCountry.filter((item) => item.id === res.countryId);
+            if (sellCountryData && sellCountryData.length > 0) {
+              formData.data.sellCountryId = sellCountryData[0].chineseName;
+            } else {
+              formData.data.sellCountryId = "";
+            }
+          });
+          if (res.countryId) {
+            proxy.post("/areaInfo/list", { parentId: res.countryId }).then((resProvince) => {
+              let sellProvinceData = resProvince.filter((item) => item.id === res.provinceId);
+              if (sellProvinceData && sellProvinceData.length > 0) {
+                formData.data.sellProvinceId = sellProvinceData[0].name;
+              } else {
+                formData.data.sellProvinceId = "";
+              }
+            });
+          } else {
+            formData.data.sellProvinceId = "";
+          }
+          if (res.provinceId) {
+            proxy.post("/areaInfo/list", { parentId: res.provinceId }).then((resCity) => {
+              let sellCityData = resCity.filter((item) => item.id === res.cityId);
+              if (sellCityData && sellCityData.length > 0) {
+                formData.data.sellCityId = sellCityData[0].name;
+              } else {
+                formData.data.sellCityId = "";
+              }
+            });
+          } else {
+            formData.data.sellCityId = "";
+          }
+          formData.data.sellCorporationId = res.corporationId;
+          formData.data.sellContactName = res.contactName;
+          formData.data.sellContactNumber = res.contactNumber;
+          formData.data.sellAddress = res.address;
+        },
+        (err) => {
+          console.log(err);
+          formData.data.sellCorporationId = "";
+          formData.data.sellContactName = "";
+          formData.data.sellContactNumber = "";
+          formData.data.sellCountryId = "";
+          formData.data.sellProvinceId = "";
+          formData.data.sellCityId = "";
+          formData.data.sellAddress = "";
+        }
+      );
+    } else {
+      formData.data.sellCorporationId = "";
+      formData.data.sellContactName = "";
+      formData.data.sellContactNumber = "";
+      formData.data.sellCountryId = "";
+      formData.data.sellProvinceId = "";
+      formData.data.sellCityId = "";
+      formData.data.sellAddress = "";
+    }
+  };
+  const getCityData = (id, type, isChange) => {
+    proxy.post("/areaInfo/list", { parentId: id }).then((res) => {
+      if (type === "20") {
+        provinceData.value = res;
+        if (isChange) {
+          formData.data.customerState = "";
+          formData.data.customerCityId = "";
+        }
+      } else if (type === "30") {
+        cityData.value = res;
+        if (isChange) {
+          formData.data.customerCityId = "";
+        }
+      } else {
+        countryData.value = res;
+      }
+    });
+  };
+  getCityData("0");
+  const changeCustomer = (val) => {
+    formData.data.quotationProductList = [];
+    formData.data.customerName = "";
+    formData.data.customerTel = "";
+    if (val) {
+      proxy.post("/customer/detail", { id: val }).then(
+        (res) => {
+          if (res.customerUserList && res.customerUserList.length > 0) {
+            formData.data.buyContactName = res.customerUserList[0].name;
+            formData.data.buyContactNumber = res.customerUserList[0].phone;
+            customerUserList.value = res.customerUserList.map((item) => {
+              return {
+                ...item,
+                value: item.name,
+              };
+            });
+          }
+          formData.data.buyCountryId = res.countryId;
+          formData.data.buyProvinceId = res.provinceId;
+          formData.data.buyCityId = res.cityId;
+          formData.data.buyPostalCode = res.zipCode;
+          formData.data.buyAddress = res.address;
+          getCityData(formData.data.buyCountryId, "20");
+          getCityData(formData.data.buyProvinceId, "30");
+        },
+        (err) => {
+          console.log(err);
+          formData.data.buyCountryId = "";
+          formData.data.buyProvinceId = "";
+          formData.data.buyCityId = "";
+          formData.data.buyPostalCode = "";
+          formData.data.buyAddress = "";
+        }
+      );
+    } else {
+      formData.data.buyCountryId = "";
+      formData.data.buyProvinceId = "";
+      formData.data.buyCityId = "";
+      formData.data.buyPostalCode = "";
+      formData.data.buyAddress = "";
+    }
+  };
+  const createFilter = (queryString) => {
+    return (restaurant) => {
+      return restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0;
+    };
+  };
+  const querySearchPerson = (queryString, callback) => {
+    const results = queryString ? customerUserList.value.filter(createFilter(queryString)) : customerUserList.value;
+    callback(results);
+  };
+  const handlePerson = (item) => {
+    formData.data.customerTel = item.phone;
+  };
+  const selectProduct = (goods) => {
+    if (goods && goods.id) {
+      let data = formData.data.quotationProductList.filter((item) => item.productId === goods.id);
+      if (data && data.length > 0) {
+        return ElMessage("该产品已添加");
+      }
+      let fileUrl = "";
+      if (goods.fileList && goods.fileList.length > 0) {
+        fileUrl = goods.fileList[0].fileUrl;
+      }
+      let packMethod = "";
+      if (goods.innerPackMethod) {
+        let innerPackMethod = goods.innerPackMethod.split(",");
+        innerPackMethod.map((item) => {
+          if (packMethod) {
+            packMethod = packMethod + "," + proxy.dictValueLabel(item, innerMethod.value);
+          } else {
+            packMethod = proxy.dictValueLabel(item, innerMethod.value);
+          }
+        });
+      }
+      if (goods.outerPackMethod) {
+        let outerPackMethod = goods.outerPackMethod.split(",");
+        outerPackMethod.map((item) => {
+          if (packMethod) {
+            packMethod = packMethod + "," + proxy.dictValueLabel(item, outsideMethod.value);
+          } else {
+            packMethod = proxy.dictValueLabel(item, outsideMethod.value);
+          }
+        });
+      }
+      if (formData.data.quotationProductList && formData.data.quotationProductList.length > 0) {
+        formData.data.quotationProductList.push({
+          fileUrl: fileUrl,
+          productId: goods.id,
+          productName: goods.name,
+          productModel: goods.productLong + "*" + goods.productWide + "*" + goods.productHigh,
+          quantity: undefined,
+          price: undefined,
+          amount: "",
+          tradeMethods: "",
+          packMethod: packMethod,
+        });
+      } else {
+        formData.data.quotationProductList = [
+          {
+            fileUrl: fileUrl,
+            productId: goods.id,
+            productName: goods.name,
+            productModel: goods.productLong + "*" + goods.productWide + "*" + goods.productHigh,
+            quantity: undefined,
+            price: undefined,
+            amount: "",
+            tradeMethods: "",
+            packMethod: packMethod,
+          },
+        ];
+      }
+      formData.data.contractShipmentList.push({
+        code: goods.code,
+        productId: goods.id,
+        productName: goods.name,
+        shipmentTime: "",
+        quantity: undefined,
+      });
+      ElMessage({
+        message: "添加成功!",
+        type: "success",
+      });
+    } else {
+      return ElMessage("选择错误");
+    }
+  };
+  const onPicture = (path) => {
+    window.open(path, "_blank");
+  };
+  const handleRemove = (index, row) => {
+    formData.data.quotationProductList.splice(index, 1);
+    formData.data.contractShipmentList = formData.data.contractShipmentList.filter((item) => item.productId !== row.productId);
+  };
+  const calculationAmount = () => {
+    nextTick(() => {
+      if (formData.data.quotationProductList && formData.data.quotationProductList.length > 0) {
+        for (let i = 0; i < formData.data.quotationProductList.length; i++) {
+          let money = 0;
+          if (formData.data.quotationProductList[i].quantity && formData.data.quotationProductList[i].price) {
+            money = parseFloat(Number(formData.data.quotationProductList[i].quantity) * Number(formData.data.quotationProductList[i].price)).toFixed(2);
+          }
+          formData.data.quotationProductList[i].amount = money;
+        }
+      }
+      nextTick(() => {
+        totalAmount();
+      });
+    });
+  };
+  const totalAmount = () => {
+    let money = 0;
+    if (formData.data.quotationProductList && formData.data.quotationProductList.length > 0) {
+      for (let i = 0; i < formData.data.quotationProductList.length; i++) {
+        if (formData.data.quotationProductList[i].amount) {
+          money = parseFloat(Number(money) + Number(formData.data.quotationProductList[i].amount)).toFixed(2);
+        }
+      }
+    }
+    if (formData.data.quotationPayList && formData.data.quotationPayList.length > 0) {
+      for (let i = 0; i < formData.data.quotationPayList.length; i++) {
+        if (formData.data.quotationPayList[i].amount) {
+          money = parseFloat(Number(money) + Number(formData.data.quotationPayList[i].amount)).toFixed(2);
+        }
+      }
+    }
+    formData.data.amount = money;
+  };
+  const clickAdd = () => {
+    if (formData.data.quotationPayList && formData.data.quotationPayList.length > 0) {
+      formData.data.quotationPayList.push({
+        payName: "",
+        amount: undefined,
+        remark: "",
+      });
+    } else {
+      formData.data.quotationPayList = [{ payName: "", amount: undefined, remark: "" }];
+    }
+  };
+  const handleDelete = (index) => {
+    formData.data.quotationPayList.splice(index, 1);
+  };
+  const querySearch = (queryString, callback) => {
+    proxy.post("/quotationPay/page", { payName: queryString }).then((res) => {
+      if (res.rows && res.rows.length > 0) {
+        res.rows = res.rows.map((item) => {
+          return {
+            ...item,
+            value: item.payName,
+          };
+        });
+        callback(res.rows);
+      } else {
+        callback([]);
+      }
+    });
+  };
+  const handleSubmit = async () => {
+    let status = await submit.value.handleSubmit(() => {});
+    if (status) {
+      if (formData.data.quotationProductList && formData.data.quotationProductList.length > 0) {
+        return true;
+      } else {
+        ElMessage("请添加至少一件商品");
+      }
+      if (formData.data.fileList && formData.data.fileList.length > 0) {
+        return true;
+      } else {
+        ElMessage("请上传交接单");
+      }
+      return false;
+    } else {
+      setTimeout(() => {
+        const errorDiv = document.getElementsByClassName("is-error");
+        errorDiv[0].scrollIntoView();
+      }, 0);
+    }
+    return status;
+  };
+  // 接收父组件的传值
+  const props = defineProps({
+    queryData: Object,
+  });
+  onMounted(() => {
+    if (props.queryData.priceSheetId) {
+      proxy.post("/saleQuotation/detail", { id: props.queryData.priceSheetId }).then((res) => {
+        for (var text in res) {
+          formData.data[text] = res[text];
+        }
+        if (formData.data.ehsdJson) {
+          let ehsdJson = JSON.parse(formData.data.ehsdJson);
+          if (ehsdJson.deliveryTime) {
+            formData.data.deliveryTime = ehsdJson.deliveryTime;
+          }
+        }
+        if (formData.data.quotationProductList && formData.data.quotationProductList.length > 0) {
+          for (let i = 0; i < formData.data.quotationProductList.length; i++) {
+            if (formData.data.quotationProductList[i].ehsdJson) {
+              let ehsdJsonProduct = JSON.parse(formData.data.quotationProductList[i].ehsdJson);
+              if (ehsdJsonProduct.packMethod) {
+                formData.data.quotationProductList[i].packMethod = ehsdJsonProduct.packMethod;
+              }
+              if (ehsdJsonProduct.tradeMethods) {
+                formData.data.quotationProductList[i].tradeMethods = ehsdJsonProduct.tradeMethods;
+              }
+            }
+          }
+          let fileIds = formData.data.quotationProductList.map((item) => item.productId);
+          proxy.post("/fileInfo/getList", { businessIdList: fileIds }).then((resFile) => {
+            for (let i = 0; i < formData.data.quotationProductList.length; i++) {
+              if (resFile[formData.data.quotationProductList[i].productId] && resFile[formData.data.quotationProductList[i].productId].length > 0) {
+                formData.data.quotationProductList[i].fileUrl = resFile[formData.data.quotationProductList[i].productId][0].fileUrl;
+              }
+            }
+          });
+        }
+        delete formData.data.id;
+        delete formData.data.code;
+        getCityData(formData.data.customerCountryId, "20");
+        getCityData(formData.data.customerState, "30");
+        if (formData.data.quotationProductList && formData.data.quotationProductList.length > 0) {
+          formData.data.quotationProductList = formData.data.quotationProductList.map((item) => {
+            delete item.id;
+            return {
+              ...item,
+            };
+          });
+        }
+        if (formData.data.quotationPayList && formData.data.quotationPayList.length > 0) {
+          formData.data.quotationPayList = formData.data.quotationPayList.map((item) => {
+            delete item.id;
+            return {
+              ...item,
+            };
+          });
+        }
+      });
+    }
+  });
+  const clickCustomerProduct = () => {
+    if (!formData.data.buyCorporationId) {
+      return ElMessage("请先选择客户");
+    }
+    openProductCustomer.value = true;
+  };
+  // 向父组件暴露
+  defineExpose({
+    submitData: formData.data,
+    handleSubmit,
+  });
+  const changeShroffAccount = (val) => {
+    if (val) {
+      let data = accountList.value.filter((item) => item.value === val);
+      if (data && data.length > 0) {
+        formData.data.beneficiaryName = data[0].beneficiaryName;
+        formData.data.beneficiaryBank = data[0].beneficiaryBank;
+        formData.data.beneficiaryBankAddress = data[0].beneficiaryBankAddress;
+        formData.data.beneficiaryAccountNumber = data[0].beneficiaryAccountNumber;
+        formData.data.swiftCode = data[0].swiftCode;
+        formData.data.beneficiaryAddress = data[0].beneficiaryAddress;
+      }
+    }
+  };
+  const changeActiveName = () => {
+    if (activeName.value) {
+      activeName.value = "";
+    } else {
+      activeName.value = "1";
+    }
+  };
+  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;
+    return true;
+  };
+  const onPreviewFile = (file) => {
+    window.open(file.raw.fileUrl, "_blank");
+  };
+  const clickSplit = (item) => {
+    formData.data.contractShipmentList.push({
+      code: item.code,
+      productId: item.productId,
+      productName: item.productName,
+      shipmentTime: "",
+      quantity: undefined,
+    });
+  };
+  const clickDelete = (index) => {
+    formData.data.contractShipmentList.splice(index, 1);
+  };
+  </script>
+  
+  <style lang="scss" scoped>
+  ::v-deep(.el-input-number .el-input__inner) {
+    text-align: left;
+  }
+  .pic {
+    object-fit: contain;
+    width: 50px;
+    height: 50px;
+    cursor: pointer;
+    vertical-align: middle;
+  }
+  .shrinkPadding {
+    padding-right: 0 !important;
+  }
+  .hideCollapse {
+    margin-top: -62px;
+    border: 0 !important;
+  }
+  ::v-deep(.el-collapse-item__arrow) {
+    display: none !important;
+  }
+  ::v-deep(.el-collapse-item__wrap) {
+    border: 0 !important;
+  }
+  ::v-deep(.el-collapse-item__header) {
+    border: 0 !important;
+  }
+  </style>
+  

+ 5 - 0
src/components/process/PriceSheet.vue

@@ -770,6 +770,11 @@ const handleSubmit = async () => {
       ElMessage("请添加至少一件商品");
     }
     return false;
+  } else {
+    setTimeout(() => {
+      const errorDiv = document.getElementsByClassName("is-error");
+      errorDiv[0].scrollIntoView();
+    }, 0);
   }
   return status;
 };

+ 5 - 0
src/components/process/ServiceContract.vue

@@ -830,6 +830,11 @@ const handleSubmit = async () => {
       ElMessage("请添加至少一件商品");
     }
     return false;
+  } else {
+    setTimeout(() => {
+      const errorDiv = document.getElementsByClassName("is-error");
+      errorDiv[0].scrollIntoView();
+    }, 0);
   }
   return status;
 };

+ 48 - 156
src/views/EHSD/saleContract/contractEHSD/index.vue

@@ -10,7 +10,7 @@
         highlight-current-row
         :action-list="[
           {
-            text: '创建合同',
+            text: '新建销售合同',
             action: () => newContract(),
           },
         ]"
@@ -21,12 +21,6 @@
             <span>{{ moneyFormat(item.amount, 2) }}</span>
           </div>
         </template>
-        <template #refundMoney="{ item }">
-          <div>
-            <span style="padding-right: 4px">{{ item.currency }}</span>
-            <span>{{ moneyFormat(item.refundMoney, 2) }}</span>
-          </div>
-        </template>
         <template #advanceRatio="{ item }">
           <div>
             <span>{{ item.advanceRatio }}%</span>
@@ -223,11 +217,11 @@ import useUserStore from "@/store/modules/user";
 import { ElMessage, ElMessageBox } from "element-plus";
 
 const { proxy } = getCurrentInstance();
-const contractType = ref([]);
 const accountCurrency = ref([]);
 const tradeMethods = ref([]);
 const corporationList = ref([]);
 const customerList = ref([]);
+const userList = ref([]);
 const shippingMethod = ref([]);
 const status = ref([
   {
@@ -251,20 +245,6 @@ const status = ref([
     value: 99,
   },
 ]);
-const refundStatus = ref([
-  {
-    label: "未到款",
-    value: 0,
-  },
-  {
-    label: "部分到款",
-    value: 10,
-  },
-  {
-    label: "已到款",
-    value: 20,
-  },
-]);
 const sourceList = ref({
   data: [],
   pagination: {
@@ -285,82 +265,56 @@ const selectConfig = computed(() => {
       data: status.value,
     },
     {
-      label: "到款状态",
-      prop: "refundStatus",
-      data: refundStatus.value,
+      label: "归属公司",
+      prop: "sellCorporationId",
+      data: corporationList.value,
     },
-    // {
-    //   label: "归属公司",
-    //   prop: "sellCorporationId",
-    //   data: corporationList.value,
-    // },
   ];
 });
 const config = computed(() => {
   return [
     {
       attrs: {
+        label: "合同号",
+        prop: "code",
+        width: 180,
+      },
+    },
+    {
+      attrs: {
         label: "归属公司",
         prop: "sellCorporationId",
         "min-width": 220,
       },
       render(type) {
-        let text = "";
-        if (corporationList.value && corporationList.value.length > 0) {
-          let data = corporationList.value.filter((item) => item.value == type);
-          if (data && data.length > 0) {
-            text = data[0].label;
-          }
-        }
-        return text;
+        return proxy.dictValueLabel(type, corporationList.value);
       },
     },
     {
       attrs: {
-        label: "合同类型",
-        prop: "contractType",
-        width: 120,
+        label: "业务员",
+        prop: "createUser",
+        width: 140,
       },
       render(type) {
-        let text = "";
-        if (contractType.value && contractType.value.length > 0) {
-          let data = contractType.value.filter((item) => item.value == type);
-          if (data && data.length > 0) {
-            text = data[0].label;
-          }
-        }
-        return text;
+        return proxy.dictValueLabel(type, userList.value);
       },
     },
     {
       attrs: {
-        label: "合同编码",
-        prop: "code",
-        width: 180,
+        label: "下单时间",
+        prop: "createTime",
+        width: 160,
       },
     },
     {
       attrs: {
-        label: "客户",
+        label: "客户名称",
         prop: "buyCorporationId",
         "min-width": 220,
       },
       render(type) {
-        let text = "";
-        if (customerList.value && customerList.value.length > 0) {
-          let data = customerList.value.filter((item) => item.value == type);
-          if (data && data.length > 0) {
-            text = data[0].label;
-          }
-        }
-        return text;
-      },
-    },
-    {
-      attrs: {
-        label: "版本号",
-        prop: "version",
-        width: 120,
+        return proxy.dictValueLabel(type, customerList.value);
       },
     },
     {
@@ -372,46 +326,25 @@ const config = computed(() => {
     },
     {
       attrs: {
-        label: "已到账金额",
-        slot: "refundMoney",
+        label: "预付比例",
+        slot: "advanceRatio",
         width: 140,
       },
     },
     {
       attrs: {
-        label: "业务员",
-        prop: "userName",
-        width: 140,
-      },
-    },
-    {
-      attrs: {
-        label: "创建时间",
-        prop: "createTime",
-        width: 160,
-      },
-    },
-    {
-      attrs: {
         label: "审批状态",
         prop: "status",
         width: 140,
       },
       render(type) {
-        let text = "";
-        if (status.value && status.value.length > 0) {
-          let data = status.value.filter((item) => item.value == type);
-          if (data && data.length > 0) {
-            text = data[0].label;
-          }
-        }
-        return text;
+        return proxy.dictValueLabel(type, status.value);
       },
     },
     {
       attrs: {
         label: "操作",
-        width: "120",
+        width: 120,
         align: "center",
         fixed: "right",
       },
@@ -462,58 +395,20 @@ const config = computed(() => {
   ];
 });
 const getDict = () => {
-  proxy
-    .post("/dictTenantData/page", {
-      pageNum: 1,
-      pageSize: 999,
-      dictCode: "contract_type",
-      tenantId: useUserStore().user.tenantId,
-    })
-    .then((res) => {
-      if (res.rows && res.rows.length > 0) {
-        contractType.value = res.rows.map((item) => {
-          return {
-            label: item.dictValue,
-            value: item.dictKey,
-          };
-        });
-      }
-    });
-
-  proxy
-    .post("/dictTenantData/page", {
-      pageNum: 1,
-      pageSize: 999,
-      dictCode: "account_currency",
-      tenantId: useUserStore().user.tenantId,
-    })
-    .then((res) => {
-      if (res.rows && res.rows.length > 0) {
-        accountCurrency.value = res.rows.map((item) => {
-          return {
-            label: item.dictValue,
-            value: item.dictKey,
-          };
-        });
-      }
-    });
-  proxy
-    .post("/dictTenantData/page", {
-      pageNum: 1,
-      pageSize: 999,
-      dictCode: "trade_methods",
-      tenantId: useUserStore().user.tenantId,
-    })
-    .then((res) => {
-      if (res.rows && res.rows.length > 0) {
-        tradeMethods.value = res.rows.map((item) => {
-          return {
-            label: item.dictValue,
-            value: item.dictKey,
-          };
-        });
-      }
-    });
+  proxy.getDictOne(["trade_methods", "account_currency", "shipping_method"]).then((res) => {
+    tradeMethods.value = res["trade_methods"].map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
+    accountCurrency.value = res["account_currency"].map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
+    shippingMethod.value = res["shipping_method"].map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
+  });
   proxy.post("/corporation/page", { pageNum: 1, pageSize: 999 }).then((res) => {
     corporationList.value = res.rows.map((item) => {
       return {
@@ -533,21 +428,18 @@ const getDict = () => {
     });
   });
   proxy
-    .post("/dictTenantData/page", {
+    .get("/tenantUser/list", {
       pageNum: 1,
-      pageSize: 999,
-      dictCode: "shipping_method",
+      pageSize: 10000,
       tenantId: useUserStore().user.tenantId,
     })
     .then((res) => {
-      if (res.rows && res.rows.length > 0) {
-        shippingMethod.value = res.rows.map((item) => {
-          return {
-            label: item.dictValue,
-            value: item.dictKey,
-          };
-        });
-      }
+      userList.value = res.rows.map((item) => {
+        return {
+          label: item.nickName,
+          value: item.userId,
+        };
+      });
     });
 };
 const getList = async (req) => {

+ 18 - 77
src/views/EHSD/saleContract/priceSheetEHSD/index.vue

@@ -226,7 +226,6 @@
 import { computed, ref } from "vue";
 import byTable from "@/components/byTable/index";
 import moment from "moment";
-import useUserStore from "@/store/modules/user";
 
 const { proxy } = getCurrentInstance();
 const accountList = ref([]);
@@ -299,14 +298,7 @@ const config = computed(() => {
         "min-width": 220,
       },
       render(type) {
-        let text = "";
-        if (corporationList.value && corporationList.value.length > 0) {
-          let data = corporationList.value.filter((item) => item.value == type);
-          if (data && data.length > 0) {
-            text = data[0].label;
-          }
-        }
-        return text;
+        return proxy.dictValueLabel(type, corporationList.value);
       },
     },
     {
@@ -330,14 +322,7 @@ const config = computed(() => {
         "min-width": 220,
       },
       render(type) {
-        let text = "";
-        if (customerList.value && customerList.value.length > 0) {
-          let data = customerList.value.filter((item) => item.value == type);
-          if (data && data.length > 0) {
-            text = data[0].label;
-          }
-        }
-        return text;
+        return proxy.dictValueLabel(type, customerList.value);
       },
     },
     {
@@ -361,20 +346,13 @@ const config = computed(() => {
         width: 140,
       },
       render(type) {
-        let text = "";
-        if (status.value && status.value.length > 0) {
-          let data = status.value.filter((item) => item.value == type);
-          if (data && data.length > 0) {
-            text = data[0].label;
-          }
-        }
-        return text;
+        return proxy.dictValueLabel(type, status.value);
       },
     },
     {
       attrs: {
         label: "操作",
-        width: "120",
+        width: 120,
         align: "center",
         fixed: "right",
       },
@@ -434,57 +412,20 @@ const getDict = () => {
       };
     });
   });
-  proxy
-    .post("/dictTenantData/page", {
-      pageNum: 1,
-      pageSize: 999,
-      dictCode: "trade_methods",
-      tenantId: useUserStore().user.tenantId,
-    })
-    .then((res) => {
-      if (res.rows && res.rows.length > 0) {
-        tradeMethods.value = res.rows.map((item) => {
-          return {
-            label: item.dictValue,
-            value: item.dictKey,
-          };
-        });
-      }
-    });
-  proxy
-    .post("/dictTenantData/page", {
-      pageNum: 1,
-      pageSize: 999,
-      dictCode: "account_currency",
-      tenantId: useUserStore().user.tenantId,
-    })
-    .then((res) => {
-      if (res.rows && res.rows.length > 0) {
-        accountCurrency.value = res.rows.map((item) => {
-          return {
-            label: item.dictValue,
-            value: item.dictKey,
-          };
-        });
-      }
-    });
-  proxy
-    .post("/dictTenantData/page", {
-      pageNum: 1,
-      pageSize: 999,
-      dictCode: "shipping_method",
-      tenantId: useUserStore().user.tenantId,
-    })
-    .then((res) => {
-      if (res.rows && res.rows.length > 0) {
-        shippingMethod.value = res.rows.map((item) => {
-          return {
-            label: item.dictValue,
-            value: item.dictKey,
-          };
-        });
-      }
-    });
+  proxy.getDictOne(["trade_methods", "account_currency", "shipping_method"]).then((res) => {
+    tradeMethods.value = res["trade_methods"].map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
+    accountCurrency.value = res["account_currency"].map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
+    shippingMethod.value = res["shipping_method"].map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
+  });
 };
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };

+ 296 - 0
src/views/EHSD/saleContract/sampleEHSD/index.vue

@@ -0,0 +1,296 @@
+<template>
+  <div class="tenant">
+    <byTable
+      :source="sourceList.data"
+      :pagination="sourceList.pagination"
+      :config="config"
+      :loading="loading"
+      :selectConfig="selectConfig"
+      highlight-current-row
+      :action-list="[
+        {
+          text: '新建样品单',
+          action: () => newSample(),
+        },
+      ]"
+      @get-list="getList">
+      <template #amount="{ item }">
+        <div>
+          <span style="padding-right: 4px">{{ item.currency }}</span>
+          <span>{{ moneyFormat(item.amount, 2) }}</span>
+        </div>
+      </template>
+      <template #advanceRatio="{ item }">
+        <div>
+          <span>{{ item.advanceRatio }}%</span>
+        </div>
+      </template>
+    </byTable>
+  </div>
+</template>
+
+<script setup>
+import { computed, ref } from "vue";
+import byTable from "@/components/byTable/index";
+import useUserStore from "@/store/modules/user";
+import { ElMessage, ElMessageBox } from "element-plus";
+
+const { proxy } = getCurrentInstance();
+const accountCurrency = ref([]);
+const tradeMethods = ref([]);
+const corporationList = ref([]);
+const customerList = ref([]);
+const userList = ref([]);
+const shippingMethod = ref([]);
+const status = ref([
+  {
+    label: "草稿",
+    value: 0,
+  },
+  {
+    label: "审批中",
+    value: 10,
+  },
+  {
+    label: "驳回",
+    value: 20,
+  },
+  {
+    label: "审批通过",
+    value: 30,
+  },
+  {
+    label: "终止",
+    value: 99,
+  },
+]);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 0,
+    pageNum: 1,
+    pageSize: 10,
+    keyword: "",
+    status: "",
+    sellCorporationId: "",
+  },
+});
+const loading = ref(false);
+const selectConfig = computed(() => {
+  return [
+    {
+      label: "审批状态",
+      prop: "status",
+      data: status.value,
+    },
+    {
+      label: "归属公司",
+      prop: "sellCorporationId",
+      data: corporationList.value,
+    },
+  ];
+});
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "样品单号",
+        prop: "code",
+        width: 180,
+      },
+    },
+    {
+      attrs: {
+        label: "归属公司",
+        prop: "sellCorporationId",
+        "min-width": 220,
+      },
+      render(type) {
+        return proxy.dictValueLabel(type, corporationList.value);
+      },
+    },
+    {
+      attrs: {
+        label: "业务员",
+        prop: "createUser",
+        width: 140,
+      },
+      render(type) {
+        return proxy.dictValueLabel(type, userList.value);
+      },
+    },
+    {
+      attrs: {
+        label: "下单时间",
+        prop: "createTime",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
+        label: "客户名称",
+        prop: "buyCorporationId",
+        "min-width": 220,
+      },
+      render(type) {
+        return proxy.dictValueLabel(type, customerList.value);
+      },
+    },
+    {
+      attrs: {
+        label: "合同金额",
+        slot: "amount",
+        width: 140,
+      },
+    },
+    {
+      attrs: {
+        label: "预付比例",
+        slot: "advanceRatio",
+        width: 140,
+      },
+    },
+    {
+      attrs: {
+        label: "审批状态",
+        prop: "status",
+        width: 140,
+      },
+      render(type) {
+        return proxy.dictValueLabel(type, status.value);
+      },
+    },
+    {
+      attrs: {
+        label: "操作",
+        width: 120,
+        align: "center",
+        fixed: "right",
+      },
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "作废",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              ElMessageBox.confirm("此操作将永久删除该数据, 是否继续?", "提示", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning",
+              }).then(() => {
+                proxy
+                  .post("/sample/edit", {
+                    id: row.id,
+                    status: 88,
+                  })
+                  .then(() => {
+                    ElMessage({
+                      message: "作废成功",
+                      type: "success",
+                    });
+                    getList();
+                  });
+              });
+            },
+          },
+        ];
+      },
+    },
+  ];
+});
+const getDict = () => {
+  proxy.getDictOne(["trade_methods", "account_currency", "shipping_method"]).then((res) => {
+    tradeMethods.value = res["trade_methods"].map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
+    accountCurrency.value = res["account_currency"].map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
+    shippingMethod.value = res["shipping_method"].map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
+  });
+  proxy.post("/corporation/page", { pageNum: 1, pageSize: 999 }).then((res) => {
+    corporationList.value = res.rows.map((item) => {
+      return {
+        ...item,
+        label: item.name,
+        value: item.id,
+      };
+    });
+  });
+  proxy.post("/customer/page", { pageNum: 1, pageSize: 999 }).then((res) => {
+    customerList.value = res.rows.map((item) => {
+      return {
+        ...item,
+        label: item.name,
+        value: item.id,
+      };
+    });
+  });
+  proxy
+    .get("/tenantUser/list", {
+      pageNum: 1,
+      pageSize: 10000,
+      tenantId: useUserStore().user.tenantId,
+    })
+    .then((res) => {
+      userList.value = res.rows.map((item) => {
+        return {
+          label: item.nickName,
+          value: item.userId,
+        };
+      });
+    });
+};
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy.post("/sample/page", sourceList.value.pagination).then((res) => {
+    sourceList.value.data = res.rows;
+    sourceList.value.pagination.total = res.total;
+    setTimeout(() => {
+      loading.value = false;
+    }, 200);
+  });
+};
+getDict();
+getList();
+const newSample = () => {
+  proxy.$router.replace({
+    path: "/platform_manage/process/processApproval",
+    query: {
+      flowKey: "sample_flow",
+      flowName: "样品单审批流程",
+      random: proxy.random(),
+      tenantType: "EHSD",
+    },
+  });
+};
+</script>
+
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+::v-deep(.el-input-number .el-input__inner) {
+  text-align: left;
+}
+.baseRow {
+  min-height: 24px;
+  border-top: 1px solid black;
+  border-left: 1px solid black;
+}
+.contentRow {
+  border-right: 1px solid black;
+  line-height: 24px;
+  padding-left: 4px;
+}
+</style>

+ 31 - 0
src/views/process/processApproval/index.vue

@@ -19,6 +19,9 @@
           <ContractEHSD ref="makeDom" v-if="flowForm.tenantType === 'EHSD'" :queryData="queryData.data"></ContractEHSD>
           <Contract ref="makeDom" v-else :queryData="queryData.data"></Contract>
         </template>
+        <template v-else-if="flowForm.flowKey == 'sample_flow'">
+          <SampleEHSD ref="makeDom" :queryData="queryData.data"></SampleEHSD>
+        </template>
         <ServiceContract ref="makeDom" v-else-if="flowForm.flowKey == 'service_contract_flow'" :queryData="queryData.data"></ServiceContract>
         <!-- 维多利亚 -->
         <SendSubscribeWDLY ref="makeDom" v-else-if="flowForm.flowKey == 'wdly_apply_purchase'"></SendSubscribeWDLY>
@@ -115,6 +118,8 @@ import PriceSheetEHSD from "@/components/process/EHSD/PriceSheet";
 import Contract from "@/components/process/Contract";
 // 销售合同-EHSD
 import ContractEHSD from "@/components/process/EHSD/Contract";
+// 样品单-EHSD
+import SampleEHSD from "@/components/process/EHSD/Sample";
 // 服务合同
 import ServiceContract from "@/components/process/ServiceContract";
 // /``````````````````````````````维多利亚专属 /
@@ -257,6 +262,28 @@ const handleSubmit = async (_type) => {
                 };
               });
             }
+          } else if (flowForm.flowKey == "sample_flow") {
+            let fileList = data.fileList.map((item) => {
+              return {
+                id: item.raw.id,
+                fileName: item.raw.fileName,
+                fileUrl: item.raw.fileUrl,
+              };
+            });
+            data.ehsdJson = JSON.stringify({
+              deliveryTime: data.deliveryTime,
+              fileList: fileList,
+            });
+            data.quotationProductList = data.quotationProductList.map((item) => {
+              let ehsdJson = JSON.stringify({
+                packMethod: item.packMethod,
+                tradeMethods: item.tradeMethods,
+              });
+              return {
+                ...item,
+                ehsdJson: ehsdJson,
+              };
+            });
           }
           if (route.query.processType == 10) {
             proxy
@@ -342,6 +369,10 @@ const skipPage = () => {
         path: "/salesMange/saleContract/contract",
       });
     }
+  } else if (flowForm.flowKey == "sample_flow") {
+    router.replace({
+      path: "/EHSD/saleContract/sampleEHSD",
+    });
   } else if (flowForm.flowKey == "service_contract_flow") {
     router.replace({
       path: "/salesMange/saleContract/serviceContract",