瀏覽代碼

Merge branch 'master' of http://36.137.93.232:3000/hf/byte-sailing-new

asd26269546 1 年之前
父節點
當前提交
7b9db2e16e

二進制
public/img/isTop.png


二進制
public/img/noTop.png


文件差異過大導致無法顯示
+ 182 - 475
src/components/process/Contract.vue


+ 1100 - 0
src/components/process/EHSD/Contract.vue

@@ -0,0 +1,1100 @@
+<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 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("1");
+const formData = reactive({
+  data: {
+    currency: "¥",
+    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: "出货计划",
+    },
+  ];
+});
+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" }],
+});
+const getDict = () => {
+  proxy
+    .getDictOne([
+      "inner_packaging_method_ehsd",
+      "outside_packaging_method_ehsd",
+      "account_currency",
+      "funds_payment_method",
+      "trade_methods",
+      "shipping_method",
+    ])
+    .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,
+      }));
+    });
+  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.companyId = 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.sellContactName = "";
+        formData.data.sellContactNumber = "";
+        formData.data.sellCountryId = "";
+        formData.data.sellProvinceId = "";
+        formData.data.sellCityId = "";
+        formData.data.sellAddress = "";
+      }
+    );
+  } else {
+    formData.data.companyId = "";
+    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;
+  }
+  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>

+ 341 - 298
src/components/process/EHSD/PriceSheet.vue

@@ -3,8 +3,8 @@
     <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit">
       <template #seller>
         <div style="width: 100%">
-          <el-form-item prop="companyId">
-            <el-select v-model="formData.data.companyId" style="width: 100%" disabled>
+          <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>
@@ -49,51 +49,51 @@
       <template #buyer>
         <div style="width: 100%">
           <div style="width: 100%">
-            <el-form-item prop="customerId">
-              <el-select v-model="formData.data.customerId" style="width: 100%" @change="changeCustomer">
+            <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="customerCountryId">
-                  <el-select v-model="formData.data.customerCountryId" placeholder="国家" @change="(val) => getCityData(val, '20', true)">
+                <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="customerState">
-                  <el-select v-model="formData.data.customerState" placeholder="省/洲" @change="(val) => getCityData(val, '30', true)">
+                <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="customerCityId">
-                  <el-select v-model="formData.data.customerCityId" placeholder="城市">
+                <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="customerZipCode">
-                  <el-input v-model="formData.data.customerZipCode" placeholder="请输入邮编" />
+                <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="customerAddr">
-                  <el-input v-model="formData.data.customerAddr" type="textarea"> </el-input>
+                <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="customerName">
+                <el-form-item label="联系人" prop="buyContactName">
                   <el-autocomplete
-                    v-model="formData.data.customerName"
+                    v-model="formData.data.buyContactName"
                     :fetch-suggestions="querySearchPerson"
                     clearable
                     class="inline-input w-50"
@@ -103,18 +103,85 @@
                 </el-form-item>
               </el-col>
               <el-col :span="16">
-                <el-form-item label=" " prop="customerTel">
-                  <el-input v-model="formData.data.customerTel" placeholder="请输入联系人电话" />
+                <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>
+        </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 @click="openProduct = true">标准产品库</el-button>
-          <el-button @click="openProduct = true">客户产品库</el-button>
+          <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 }">
@@ -124,33 +191,39 @@
                 <div v-else></div>
               </template>
             </el-table-column>
-            <el-table-column prop="code" label="商品编码" width="120" />
-            <el-table-column label="商品名称" min-width="200">
+            <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">
+                  <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="规格型号" width="180">
+            <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">
-                    <el-input v-model="row.productModel" placeholder="请输入规格型号" />
+                  <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 prop="unit" label="单位" width="100" /> -->
-            <el-table-column label="订购量" width="150">
+            <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">
+                  <el-form-item :prop="'quotationProductList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true" class="shrinkPadding">
                     <el-input-number
                       v-model="row.quantity"
-                      placeholder="请输入订购量"
+                      placeholder="请输入"
                       style="width: 100%"
                       :precision="0"
                       :controls="false"
@@ -160,43 +233,49 @@
                 </div>
               </template>
             </el-table-column>
-            <el-table-column label="每箱数量" width="150">
-              <template #default="{ row, $index }">
-                <div style="width: 100%">
-                  <el-form-item :prop="'quotationProductList.' + $index + '.packagQuantity'" :rules="rules.packagQuantity" :inline-message="true">
-                    <el-input-number v-model="row.packagQuantity" placeholder="请输入每箱数量" style="width: 100%" :precision="0" :controls="false" :min="0" />
-                  </el-form-item>
-                </div>
-              </template>
-            </el-table-column>
-            <el-table-column label="单价" width="160">
+            <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">
+                  <el-form-item :prop="'quotationProductList.' + $index + '.price'" :rules="rules.price" :inline-message="true" class="shrinkPadding">
                     <el-input-number
                       v-model="row.price"
-                      placeholder="请输入单价"
+                      placeholder="请输入"
                       style="width: 100%"
                       :precision="2"
                       :controls="false"
                       :min="0"
                       @change="calculationAmount()" />
-                    </el-form-item>
-                  </div>
+                  </el-form-item>
+                </div>
               </template>
             </el-table-column>
-            <el-table-column prop="sumPrice" label="小计" width="140" />
-            <el-table-column label="大货样" width="150">
+            <el-table-column label="贸易方式" width="140">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
-                  <el-form-item :prop="'quotationProductList.' + $index + '.sendSampleCount'" :rules="rules.sendSampleCount" :inline-message="true">
-                    <el-input-number v-model="row.sendSampleCount" placeholder="请输入大货样" style="width: 100%" :precision="0" :controls="false" :min="0" />
+                  <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="80" fixed="right">
+            <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="{ $index }">
                 <el-button type="primary" link @click="handleRemove($index)">删除</el-button>
               </template>
             </el-table-column>
@@ -216,10 +295,19 @@
                 </div>
               </template>
             </el-table-column>
-            <el-table-column label="金额" width="180">
+            <el-table-column label="备注">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
-                  <el-form-item :prop="'quotationPayList.' + $index + '.amount'" :rules="rules.amount" :inline-message="true">
+                  <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="请输入金额"
@@ -232,17 +320,8 @@
                 </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="操作" width="80" fixed="right">
-              <template #default="{ row, $index }">
+            <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>
@@ -250,115 +329,36 @@
         </div>
       </template>
       <template #offerMoney>
-        <div style="width: 100%">
-          <el-row style="margin-top: 20px; width: 100%">
-            <el-col :span="4">
-              <el-form-item label="币种" prop="currencyType">
-                <el-select v-model="formData.data.currencyType" 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="contractPrice">
-                <el-input v-model="formData.data.contractPrice" placeholder="合同总金额" disabled />
-              </el-form-item>
-            </el-col>
-            <el-col :span="4">
-              <el-form-item label="汇率" prop="taxRate">
-                <el-input-number v-model="formData.data.taxRate" placeholder="请输入汇率" style="width: 100%" :precision="2" :controls="false" :min="0" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="4">
-              <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-row>
-          <el-row style="margin-top: 20px; width: 100%">
-            <el-col :span="7">
-              <el-form-item label="付款方式" prop="payWay">
-                <el-select v-model="formData.data.payWay" 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="7">
-              <el-form-item label="预付比例 (%)" prop="prePayRatio">
-                <el-input-number
-                  v-model="formData.data.prePayRatio"
-                  placeholder="请输入预付比例"
-                  style="width: 100%"
-                  :precision="2"
-                  :controls="false"
-                  :min="0"
-                  :max="100" />
-              </el-form-item>
-            </el-col>
-          </el-row>
-        </div>
-      </template>
-      <template #delivery>
-        <div style="width: 100%">
-          <el-row style="margin-top: 20px; width: 100%">
-            <el-col :span="7">
-              <el-form-item label="贸易方式" prop="tradeModeId">
-                <el-select v-model="formData.data.tradeModeId" 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>
-            </el-col>
-          </el-row>
-          <el-row style="margin-top: 20px; width: 100%">
-            <el-col :span="7">
-              <el-form-item label="运输方式" prop="shippingType">
-                <el-select v-model="formData.data.shippingType" 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="7">
-              <el-form-item label="运输说明" prop="wharf">
-                <el-input v-model="formData.data.wharf" placeholder="请输入运输说明" />
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row style="margin-top: 20px; width: 100%">
-            <el-col :span="14">
-              <el-form-item label="付款条件" prop="paymentRemark">
-                <el-input v-model="formData.data.paymentRemark" :rows="2" type="textarea" placeholder="请输入付款条件" />
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row style="margin-top: 20px; width: 100%">
-            <el-col :span="7">
-              <el-form-item label="交货时间 (天)" prop="deliveryDay">
-                <el-input-number v-model="formData.data.deliveryDay" placeholder="请输入交货时间" style="width: 100%" :precision="0" :controls="false" :min="0" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="7">
-              <el-form-item label="质保期 (天)" prop="warrantyDay">
-                <el-input-number v-model="formData.data.warrantyDay" placeholder="请输入质保期" style="width: 100%" :precision="0" :controls="false" :min="0" />
-              </el-form-item>
-            </el-col>
-          </el-row>
+        <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>
     </byForm>
 
-    <el-dialog v-model="openProduct" title="选择商品" width="70%" append-to-body>
-      <SelectGoods @cancel="openProduct = false" @pushGoods="pushGoods"></SelectGoods>
+    <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 useUserStore from "@/store/modules/user";
-import SelectGoods from "@/components/product/SelectGoods";
+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([]);
@@ -370,10 +370,12 @@ const countryData = ref([]);
 const provinceData = ref([]);
 const cityData = ref([]);
 const customerUserList = ref([]);
-const openProduct = ref(false);
+const openProductCompany = ref(false);
+const openProductCustomer = ref(false);
 const formData = reactive({
   data: {
-    contractPrice: undefined,
+    currency: "¥",
+    amount: undefined,
     quotationProductList: [],
     quotationPayList: [],
   },
@@ -413,6 +415,16 @@ const formConfig = computed(() => {
     },
     {
       type: "slot",
+      slotName: "payment",
+      label: "付款信息",
+    },
+    {
+      type: "slot",
+      slotName: "delivery",
+      label: "交付信息",
+    },
+    {
+      type: "slot",
       slotName: "commodity",
       label: "商品信息",
     },
@@ -424,109 +436,70 @@ const formConfig = computed(() => {
     {
       type: "slot",
       slotName: "offerMoney",
-      label: "报价金额",
-    },
-    {
-      type: "slot",
-      slotName: "delivery",
-      label: "交付信息",
     },
   ];
 });
 const rules = ref({
   contractTemplateId: [{ required: true, message: "请选择合同模板", trigger: "change" }],
-  customerId: [{ required: true, message: "请选择公司", trigger: "change" }],
-  customerCountryId: [{ required: true, message: "请选择国家", trigger: "change" }],
-  customerState: [{ required: true, message: "请选择省/州", trigger: "change" }],
-  customerCityId: [{ required: true, message: "请选择城市", trigger: "change" }],
-  // customerAddr: [{ required: true, message: "请输入详细地址", trigger: "blur" }],
-  customerName: [{ required: true, message: "请输入联系人", trigger: ["change", "blur"] }],
-  customerTel: [{ required: true, message: "请输入联系电话", trigger: "blur" }],
+  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: "请输入规格型号", trigger: "blur" }],
-  quantity: [{ required: true, message: "请输入订购量", trigger: "blur" }],
-  packagQuantity: [{ required: true, message: "请输入每箱数量", trigger: "blur" }],
-  sendSampleCount: [{ 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"] }],
-  currencyType: [{ required: true, message: "请选择币种", trigger: "change" }],
-  taxRate: [{ required: true, message: "请输入汇率", trigger: "blur" }],
+  currency: [{ required: true, message: "请选择币种", trigger: "change" }],
   effective: [{ required: true, message: "请输入报价有效期", trigger: "blur" }],
-  payWay: [{ required: true, message: "请选择付款方式", trigger: "change" }],
-  prePayRatio: [{ required: true, message: "请输入预付比例", trigger: "blur" }],
-  tradeModeId: [{ required: true, message: "请选择贸易方式", trigger: "change" }],
-  shippingType: [{ required: true, message: "请选择运输方式", trigger: "change" }],
-  wharf: [{ required: true, message: "请输入运输说明", trigger: "blur" }],
-  paymentRemark: [{ required: true, message: "请输入付款条件", trigger: "blur" }],
+  deliveryTime: [{ required: true, message: "请选择交货期限", trigger: "change" }],
+  paymentMethod: [{ required: true, message: "请选择付款方式", trigger: "change" }],
+  advanceRatio: [{ required: true, message: "请输入预付比例", trigger: "blur" }],
+  tradeMethods: [{ required: true, message: "请选择贸易方式", trigger: "change" }],
+  transportMethod: [{ required: true, message: "请选择运输方式", trigger: "change" }],
+  transportRemark: [{ required: true, message: "请输入运输说明", trigger: "blur" }],
+  remark: [{ required: true, message: "请输入付款条件", trigger: "blur" }],
 });
 const getDict = () => {
   proxy
-    .post("/dictTenantData/page", {
-      pageNum: 1,
-      pageSize: 999,
-      dictCode: "account_currency",
-      tenantId: useUserStore().user.tenantId,
-    })
+    .getDictOne([
+      "inner_packaging_method_ehsd",
+      "outside_packaging_method_ehsd",
+      "account_currency",
+      "funds_payment_method",
+      "trade_methods",
+      "shipping_method",
+    ])
     .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: "funds_payment_method",
-      tenantId: useUserStore().user.tenantId,
-    })
-    .then((res) => {
-      if (res.rows && res.rows.length > 0) {
-        fundsPaymentMethod.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
-    .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,
-          };
-        });
-      }
+      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,
+      }));
     });
   proxy.post("/contractTemplate/page", { pageNum: 1, pageSize: 999 }).then((res) => {
     templateList.value = res.rows.map((item) => {
@@ -639,14 +612,15 @@ const getCityData = (id, type, isChange) => {
 };
 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.customerName = res.customerUserList[0].name;
-          formData.data.customerTel = res.customerUserList[0].phone;
+          formData.data.buyContactName = res.customerUserList[0].name;
+          formData.data.buyContactNumber = res.customerUserList[0].phone;
           customerUserList.value = res.customerUserList.map((item) => {
             return {
               ...item,
@@ -654,29 +628,29 @@ const changeCustomer = (val) => {
             };
           });
         }
-        formData.data.customerCountryId = res.countryId;
-        formData.data.customerState = res.provinceId;
-        formData.data.customerCityId = res.cityId;
-        formData.data.customerZipCode = res.zipCode;
-        formData.data.customerAddr = res.address;
-        getCityData(formData.data.customerCountryId, "20");
-        getCityData(formData.data.customerState, "30");
+        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.customerCountryId = "";
-        formData.data.customerState = "";
-        formData.data.customerCityId = "";
-        formData.data.customerZipCode = "";
-        formData.data.customerAddr = "";
+        formData.data.buyCountryId = "";
+        formData.data.buyProvinceId = "";
+        formData.data.buyCityId = "";
+        formData.data.buyPostalCode = "";
+        formData.data.buyAddress = "";
       }
     );
   } else {
-    formData.data.customerCountryId = "";
-    formData.data.customerState = "";
-    formData.data.customerCityId = "";
-    formData.data.customerZipCode = "";
-    formData.data.customerAddr = "";
+    formData.data.buyCountryId = "";
+    formData.data.buyProvinceId = "";
+    formData.data.buyCityId = "";
+    formData.data.buyPostalCode = "";
+    formData.data.buyAddress = "";
   }
 };
 const createFilter = (queryString) => {
@@ -691,37 +665,70 @@ const querySearchPerson = (queryString, callback) => {
 const handlePerson = (item) => {
   formData.data.customerTel = item.phone;
 };
-const pushGoods = (goods) => {
-  if (goods && goods.length > 0) {
-    formData.data.quotationProductList = formData.data.quotationProductList.concat(
-      goods.map((item) => {
-        let fileUrl = "";
-        if (item.fileList && item.fileList.length > 0) {
-          fileUrl = item.fileList[0].fileUrl;
+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);
         }
-        return {
+      });
+    }
+    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,
-          code: item.code,
-          productId: item.id,
-          productName: item.name,
-          productModel: item.spec,
-          unit: item.unit,
+          productId: goods.id,
+          productName: goods.name,
+          productModel: goods.productLong + "*" + goods.productWide + "*" + goods.productHigh,
           quantity: undefined,
-          packagQuantity: undefined,
-          sendSampleCount: undefined,
           price: undefined,
-          sumPrice: "",
-          remark: item.remark,
-        };
-      })
-    );
+          amount: "",
+          tradeMethods: "",
+          packMethod: packMethod,
+        },
+      ];
+    }
     ElMessage({
       message: "添加成功!",
       type: "success",
     });
-    openProduct.value = false;
   } else {
-    ElMessage("请选择至少一件商品");
+    return ElMessage("选择错误");
   }
 };
 const onPicture = (path) => {
@@ -738,7 +745,7 @@ const calculationAmount = () => {
         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].sumPrice = money;
+        formData.data.quotationProductList[i].amount = money;
       }
     }
     nextTick(() => {
@@ -750,8 +757,8 @@ 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].sumPrice) {
-        money = parseFloat(Number(money) + Number(formData.data.quotationProductList[i].sumPrice)).toFixed(2);
+      if (formData.data.quotationProductList[i].amount) {
+        money = parseFloat(Number(money) + Number(formData.data.quotationProductList[i].amount)).toFixed(2);
       }
     }
   }
@@ -762,7 +769,7 @@ const totalAmount = () => {
       }
     }
   }
-  formData.data.contractPrice = money;
+  formData.data.amount = money;
 };
 const clickAdd = () => {
   if (formData.data.quotationPayList && formData.data.quotationPayList.length > 0) {
@@ -807,14 +814,41 @@ const handleSubmit = async () => {
 };
 // 接收父组件的传值
 const props = defineProps({
-  queryData: String,
+  queryData: Object,
 });
 onMounted(() => {
-  if (props.queryData.id) {
-    proxy.post("/saleQuotation/detail", { id: props.queryData.id }).then((res) => {
+  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");
@@ -838,6 +872,12 @@ onMounted(() => {
     });
   }
 });
+const clickCustomerProduct = () => {
+  if (!formData.data.buyCorporationId) {
+    return ElMessage("请先选择客户");
+  }
+  openProductCustomer.value = true;
+};
 // 向父组件暴露
 defineExpose({
   submitData: formData.data,
@@ -856,4 +896,7 @@ defineExpose({
   cursor: pointer;
   vertical-align: middle;
 }
+.shrinkPadding {
+  padding-right: 0 !important;
+}
 </style>

+ 0 - 36
src/components/process/EHSD/index.vue

@@ -1,36 +0,0 @@
-<template>
-    <div>
-        <!-- companyId  买方公司 -->
-        <!-- customerId  卖方公司 -->
-        <!-- customerCountryId  卖方国家 -->
-        <!-- customerState  卖方省/州 -->
-        <!-- customerCityId  卖方城市 -->
-        <!-- customerZipCode  卖方邮编 -->
-        <!-- customerAddr  卖方详细地址 -->
-        <!-- customerName  卖方联系人 -->
-        <!-- customerTel  卖方联系电话 -->
-
-
-        <!-- packagQuantity  每箱数量 -->
-        <!-- sumPrice  小计 -->
-        <!-- sendSampleCount  大货样 -->
-
-
-        <!-- contractPrice  合同金额 -->
-        <!-- tradeModeId  贸易方式 -->
-        <!-- currencyType  货币类型 -->
-        <!-- payWay  付款方式 -->
-        <!-- shippingType  运输方式 -->
-        <!-- wharf  运输说明/起运港 -->
-        <!-- taxRate  汇率 -->
-        <!-- prePayRatio  预付比例 -->
-        <!-- deliveryDay  交货时间 -->
-        <!-- warrantyDay  质保期 -->
-        <!-- paymentRemark  付款条件 -->
-        
-        <!-- customerState  卖方国家 -->
-        <!-- customerState  卖方国家 -->
-        <!-- customerState  卖方国家 -->
-        <!-- customerState  卖方国家 -->
-    </div>
-</template>

+ 166 - 428
src/components/process/PriceSheet.vue

@@ -1,77 +1,46 @@
 <template>
   <div style="width: 100%; padding: 0px 15px">
-    <byForm
-      :formConfig="formConfig"
-      :formOption="formOption"
-      v-model="formData.data"
-      :rules="rules"
-      ref="submit"
-    >
+    <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 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-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-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-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-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-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-input v-model="formData.data.sellContactNumber" placeholder="请输入联系人电话" />
               </el-form-item>
             </el-col>
           </el-row>
@@ -81,81 +50,42 @@
         <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 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 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 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 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-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-input v-model="formData.data.buyAddress" type="textarea"> </el-input>
                 </el-form-item>
               </el-col>
             </el-row>
@@ -168,17 +98,13 @@
                     clearable
                     class="inline-input w-50"
                     placeholder="请输入联系人"
-                    @select="handlePerson"
-                  >
+                    @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-input v-model="formData.data.buyContactNumber" placeholder="请输入联系人电话" />
                 </el-form-item>
               </el-col>
             </el-row>
@@ -188,18 +114,11 @@
       <template #commodity>
         <div style="width: 100%">
           <el-button @click="openProduct = true">添加商品</el-button>
-          <el-table
-            :data="formData.data.quotationProductList"
-            style="width: 100%; margin-top: 16px"
-          >
+          <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)"
-                  />
+                  <img :src="row.fileUrl" class="pic" @click="onPicture(row.fileUrl)" />
                 </div>
                 <div v-else></div>
               </template>
@@ -208,15 +127,8 @@
             <el-table-column label="商品名称" min-width="200">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
-                  <el-form-item
-                    :prop="'quotationProductList.' + $index + '.productName'"
-                    :rules="rules.productName"
-                    :inline-message="true"
-                  >
-                    <el-input
-                      v-model="row.productName"
-                      placeholder="请输入商品名称"
-                    />
+                  <el-form-item :prop="'quotationProductList.' + $index + '.productName'" :rules="rules.productName" :inline-message="true">
+                    <el-input v-model="row.productName" placeholder="请输入商品名称" />
                   </el-form-item>
                 </div>
               </template>
@@ -224,15 +136,8 @@
             <el-table-column label="规格型号" width="180">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
-                  <el-form-item
-                    :prop="'quotationProductList.' + $index + '.productModel'"
-                    :rules="rules.productModel"
-                    :inline-message="true"
-                  >
-                    <el-input
-                      v-model="row.productModel"
-                      placeholder="请输入规格型号"
-                    />
+                  <el-form-item :prop="'quotationProductList.' + $index + '.productModel'" :rules="rules.productModel" :inline-message="true">
+                    <el-input v-model="row.productModel" placeholder="请输入规格型号" />
                   </el-form-item>
                 </div>
               </template>
@@ -241,11 +146,7 @@
             <el-table-column label="数量" width="160">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
-                  <el-form-item
-                    :prop="'quotationProductList.' + $index + '.quantity'"
-                    :rules="rules.quantity"
-                    :inline-message="true"
-                  >
+                  <el-form-item :prop="'quotationProductList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true">
                     <el-input-number
                       v-model="row.quantity"
                       placeholder="请输入数量"
@@ -253,8 +154,7 @@
                       :precision="0"
                       :controls="false"
                       :min="0"
-                      @change="calculationAmount()"
-                    />
+                      @change="calculationAmount()" />
                   </el-form-item>
                 </div>
               </template>
@@ -262,11 +162,7 @@
             <el-table-column label="单价" width="160">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
-                  <el-form-item
-                    :prop="'quotationProductList.' + $index + '.price'"
-                    :rules="rules.price"
-                    :inline-message="true"
-                  >
+                  <el-form-item :prop="'quotationProductList.' + $index + '.price'" :rules="rules.price" :inline-message="true">
                     <el-input-number
                       v-model="row.price"
                       placeholder="请输入单价"
@@ -274,8 +170,7 @@
                       :precision="2"
                       :controls="false"
                       :min="0"
-                      @change="calculationAmount()"
-                    />
+                      @change="calculationAmount()" />
                   </el-form-item>
                 </div>
               </template>
@@ -283,9 +178,7 @@
             <el-table-column prop="amount" label="金额" width="140" />
             <el-table-column label="操作" width="80" fixed="right">
               <template #default="{ row, $index }">
-                <el-button type="primary" link @click="handleRemove($index)"
-                  >删除</el-button
-                >
+                <el-button type="primary" link @click="handleRemove($index)">删除</el-button>
               </template>
             </el-table-column>
           </el-table>
@@ -294,25 +187,12 @@
       <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 :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 :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>
@@ -320,11 +200,7 @@
             <el-table-column label="金额" width="180">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
-                  <el-form-item
-                    :prop="'quotationPayList.' + $index + '.amount'"
-                    :rules="rules.amount"
-                    :inline-message="true"
-                  >
+                  <el-form-item :prop="'quotationPayList.' + $index + '.amount'" :rules="rules.amount" :inline-message="true">
                     <el-input-number
                       v-model="row.amount"
                       placeholder="请输入金额"
@@ -332,8 +208,7 @@
                       :precision="2"
                       :controls="false"
                       :min="0"
-                      @change="totalAmount()"
-                    />
+                      @change="totalAmount()" />
                   </el-form-item>
                 </div>
               </template>
@@ -341,9 +216,7 @@
             <el-table-column label="备注">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
-                  <el-form-item
-                    :prop="'quotationPayList.' + $index + '.remark'"
-                  >
+                  <el-form-item :prop="'quotationPayList.' + $index + '.remark'">
                     <el-input v-model="row.remark" placeholder="请输入备注" />
                   </el-form-item>
                 </div>
@@ -351,9 +224,7 @@
             </el-table-column>
             <el-table-column label="操作" width="80" fixed="right">
               <template #default="{ row, $index }">
-                <el-button type="primary" link @click="handleDelete($index)"
-                  >删除</el-button
-                >
+                <el-button type="primary" link @click="handleDelete($index)">删除</el-button>
               </template>
             </el-table-column>
           </el-table>
@@ -364,56 +235,27 @@
           <el-row style="margin-top: 20px; width: 100%">
             <el-col :span="4">
               <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 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="amount">
-                <el-input
-                  v-model="formData.data.amount"
-                  placeholder="合同总金额"
-                  disabled
-                />
+                <el-input v-model="formData.data.amount" placeholder="合同总金额" disabled />
               </el-form-item>
             </el-col>
             <el-col :span="4">
               <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-input-number v-model="formData.data.effective" placeholder="请输入有效期" style="width: 100%" :precision="0" :controls="false" :min="0" />
               </el-form-item>
             </el-col>
           </el-row>
           <el-row style="margin-top: 20px; width: 100%">
             <el-col :span="7">
               <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 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>
@@ -426,8 +268,7 @@
                   :precision="2"
                   :controls="false"
                   :min="0"
-                  :max="100"
-                />
+                  :max="100" />
               </el-form-item>
             </el-col>
           </el-row>
@@ -438,17 +279,8 @@
           <el-row style="margin-top: 20px; width: 100%">
             <el-col :span="7">
               <el-form-item label="贸易方式" prop="tradeMethods">
-                <el-select
-                  v-model="formData.data.tradeMethods"
-                  placeholder="请选择贸易方式"
-                  style="width: 100%"
-                >
-                  <el-option
-                    v-for="item in tradeMethods"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value"
-                  />
+                <el-select v-model="formData.data.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>
             </el-col>
@@ -456,52 +288,28 @@
           <el-row style="margin-top: 20px; width: 100%">
             <el-col :span="7">
               <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 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="7">
               <el-form-item label="运输说明" prop="transportRemark">
-                <el-input
-                  v-model="formData.data.transportRemark"
-                  placeholder="请输入运输说明"
-                />
+                <el-input v-model="formData.data.transportRemark" placeholder="请输入运输说明" />
               </el-form-item>
             </el-col>
           </el-row>
           <el-row style="margin-top: 20px; width: 100%">
             <el-col :span="14">
               <el-form-item label="付款条件" prop="remark">
-                <el-input
-                  v-model="formData.data.remark"
-                  :rows="2"
-                  type="textarea"
-                  placeholder="请输入付款条件"
-                />
+                <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="7">
               <el-form-item label="质保期 (天)" prop="warranty">
-                <el-input-number
-                  v-model="formData.data.warranty"
-                  placeholder="请输入质保期"
-                  style="width: 100%"
-                  :precision="0"
-                  :controls="false"
-                  :min="0"
-                />
+                <el-input-number v-model="formData.data.warranty" placeholder="请输入质保期" style="width: 100%" :precision="0" :controls="false" :min="0" />
               </el-form-item>
             </el-col>
           </el-row>
@@ -509,16 +317,8 @@
       </template>
     </byForm>
 
-    <el-dialog
-      v-model="openProduct"
-      title="选择商品"
-      width="70%"
-      append-to-body
-    >
-      <SelectGoods
-        @cancel="openProduct = false"
-        @pushGoods="pushGoods"
-      ></SelectGoods>
+    <el-dialog v-model="openProduct" title="选择商品" width="70%" append-to-body>
+      <SelectGoods @cancel="openProduct = false" @pushGoods="pushGoods"></SelectGoods>
     </el-dialog>
   </div>
 </template>
@@ -605,50 +405,28 @@ const formConfig = computed(() => {
   ];
 });
 const rules = ref({
-  contractTemplateId: [
-    { required: true, message: "请选择合同模板", trigger: "change" },
-  ],
-  buyCorporationId: [
-    { required: true, message: "请选择公司", trigger: "change" },
-  ],
+  contractTemplateId: [{ required: true, message: "请选择合同模板", trigger: "change" }],
+  buyCorporationId: [{ required: true, message: "请选择公司", trigger: "change" }],
   buyCountryId: [{ required: true, message: "请选择国家", trigger: "change" }],
-  buyProvinceId: [
-    { 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" },
-  ],
+  buyContactName: [{ required: true, message: "请输入联系人", trigger: ["change", "blur"] }],
+  buyContactNumber: [{ required: true, message: "请输入联系电话", trigger: "blur" }],
   productName: [{ required: true, message: "请输入商品名称", trigger: "blur" }],
-  productModel: [
-    { required: true, message: "请输入规格型号", trigger: "blur" },
-  ],
+  productModel: [{ required: true, message: "请输入规格型号", trigger: "blur" }],
   quantity: [{ required: true, message: "请输入数量", trigger: "blur" }],
+  price: [{ required: true, message: "请输入单价", trigger: "blur" }],
   amount: [{ required: true, message: "请输入金额", trigger: "blur" }],
-  payName: [
-    { required: true, message: "请输入收费项目", trigger: ["change", "blur"] },
-  ],
+  payName: [{ required: true, message: "请输入收费项目", trigger: ["change", "blur"] }],
   currency: [{ required: true, message: "请选择币种", trigger: "change" }],
   effective: [{ required: true, message: "请输入报价有效期", trigger: "blur" }],
-  paymentMethod: [
-    { required: true, message: "请选择付款方式", trigger: "change" },
-  ],
-  advanceRatio: [
-    { required: true, message: "请输入预付比例", trigger: "blur" },
-  ],
-  tradeMethods: [
-    { required: true, message: "请选择贸易方式", trigger: "change" },
-  ],
-  transportMethod: [
-    { required: true, message: "请选择运输方式", trigger: "change" },
-  ],
-  transportRemark: [
-    { required: true, message: "请输入运输说明", trigger: "blur" },
-  ],
+  deliveryTime: [{ required: true, message: "请选择交货期限", trigger: "change" }],
+  paymentMethod: [{ required: true, message: "请选择付款方式", trigger: "change" }],
+  advanceRatio: [{ required: true, message: "请输入预付比例", trigger: "blur" }],
+  tradeMethods: [{ required: true, message: "请选择贸易方式", trigger: "change" }],
+  transportMethod: [{ required: true, message: "请选择运输方式", trigger: "change" }],
+  transportRemark: [{ required: true, message: "请输入运输说明", trigger: "blur" }],
   remark: [{ required: true, message: "请输入付款条件", trigger: "blur" }],
 });
 const getDict = () => {
@@ -720,17 +498,15 @@ const getDict = () => {
         });
       }
     });
-  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("/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 {
@@ -756,9 +532,7 @@ const changeTemplate = (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
-          );
+          let sellCountryData = resCountry.filter((item) => item.id === res.countryId);
           if (sellCountryData && sellCountryData.length > 0) {
             formData.data.sellCountryId = sellCountryData[0].chineseName;
           } else {
@@ -766,34 +540,26 @@ const changeTemplate = (val) => {
           }
         });
         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 = "";
-              }
-            });
+          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 = "";
-              }
-            });
+          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 = "";
         }
@@ -885,15 +651,11 @@ const changeCustomer = (val) => {
 };
 const createFilter = (queryString) => {
   return (restaurant) => {
-    return (
-      restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0
-    );
+    return restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0;
   };
 };
 const querySearchPerson = (queryString, callback) => {
-  const results = queryString
-    ? customerUserList.value.filter(createFilter(queryString))
-    : customerUserList.value;
+  const results = queryString ? customerUserList.value.filter(createFilter(queryString)) : customerUserList.value;
   callback(results);
 };
 const handlePerson = (item) => {
@@ -901,27 +663,26 @@ const handlePerson = (item) => {
 };
 const pushGoods = (goods) => {
   if (goods && goods.length > 0) {
-    formData.data.quotationProductList =
-      formData.data.quotationProductList.concat(
-        goods.map((item) => {
-          let fileUrl = "";
-          if (item.fileList && item.fileList.length > 0) {
-            fileUrl = item.fileList[0].fileUrl;
-          }
-          return {
-            fileUrl: fileUrl,
-            code: item.code,
-            productId: item.id,
-            productName: item.name,
-            productModel: item.spec,
-            unit: item.unit,
-            quantity: undefined,
-            price: undefined,
-            amount: "",
-            remark: item.remark,
-          };
-        })
-      );
+    formData.data.quotationProductList = formData.data.quotationProductList.concat(
+      goods.map((item) => {
+        let fileUrl = "";
+        if (item.fileList && item.fileList.length > 0) {
+          fileUrl = item.fileList[0].fileUrl;
+        }
+        return {
+          fileUrl: fileUrl,
+          code: item.code,
+          productId: item.id,
+          productName: item.name,
+          productModel: item.spec,
+          unit: item.unit,
+          quantity: undefined,
+          price: undefined,
+          amount: "",
+          remark: item.remark,
+        };
+      })
+    );
     ElMessage({
       message: "添加成功!",
       type: "success",
@@ -939,20 +700,11 @@ const handleRemove = (index) => {
 };
 const calculationAmount = () => {
   nextTick(() => {
-    if (
-      formData.data.quotationProductList &&
-      formData.data.quotationProductList.length > 0
-    ) {
+    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);
+        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;
       }
@@ -964,46 +716,31 @@ const calculationAmount = () => {
 };
 const totalAmount = () => {
   let money = 0;
-  if (
-    formData.data.quotationProductList &&
-    formData.data.quotationProductList.length > 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);
+        money = parseFloat(Number(money) + Number(formData.data.quotationProductList[i].amount)).toFixed(2);
       }
     }
   }
-  if (
-    formData.data.quotationPayList &&
-    formData.data.quotationPayList.length > 0
-  ) {
+  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);
+        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
-  ) {
+  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: "" },
-    ];
+    formData.data.quotationPayList = [{ payName: "", amount: undefined, remark: "" }];
   }
 };
 const handleDelete = (index) => {
@@ -1027,10 +764,7 @@ const querySearch = (queryString, callback) => {
 const handleSubmit = async () => {
   let status = await submit.value.handleSubmit(() => {});
   if (status) {
-    if (
-      formData.data.quotationProductList &&
-      formData.data.quotationProductList.length > 0
-    ) {
+    if (formData.data.quotationProductList && formData.data.quotationProductList.length > 0) {
       return true;
     } else {
       ElMessage("请添加至少一件商品");
@@ -1041,46 +775,50 @@ const handleSubmit = async () => {
 };
 // 接收父组件的传值
 const props = defineProps({
-  queryData: String,
+  queryData: Object,
 });
 onMounted(() => {
-  if (props.queryData.id) {
-    proxy
-      .post("/saleQuotation/detail", { id: props.queryData.id })
-      .then((res) => {
-        for (var text in res) {
-          formData.data[text] = res[text];
-        }
-        delete formData.data.id;
-        delete formData.data.code;
-        getCityData(formData.data.buyCountryId, "20");
-        getCityData(formData.data.buyProvinceId, "30");
-        if (
-          formData.data.quotationProductList &&
-          formData.data.quotationProductList.length > 0
-        ) {
-          formData.data.quotationProductList =
-            formData.data.quotationProductList.map((item) => {
-              delete item.id;
-              return {
-                ...item,
-              };
-            });
+  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.quotationProductList && formData.data.quotationProductList.length > 0) {
+        for (let i = 0; i < formData.data.quotationProductList.length; i++) {
+          proxy.post("/productInfo/detail", { id: formData.data.quotationProductList[i].productId }).then((resProduct) => {
+            formData.data.quotationProductList[i].code = resProduct.code;
+          });
         }
-        if (
-          formData.data.quotationPayList &&
-          formData.data.quotationPayList.length > 0
-        ) {
-          formData.data.quotationPayList = formData.data.quotationPayList.map(
-            (item) => {
-              delete item.id;
-              return {
-                ...item,
-              };
+        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.buyCountryId, "20");
+      getCityData(formData.data.buyProvinceId, "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,
+          };
+        });
+      }
+    });
   }
 });
 // 向父组件暴露

+ 158 - 441
src/components/process/ServiceContract.vue

@@ -1,77 +1,46 @@
 <template>
   <div style="width: 100%; padding: 0px 15px">
-    <byForm
-      :formConfig="formConfig"
-      :formOption="formOption"
-      v-model="formData.data"
-      :rules="rules"
-      ref="submit"
-    >
+    <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 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-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-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-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-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-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-input v-model="formData.data.sellContactNumber" placeholder="请输入联系人电话" />
               </el-form-item>
             </el-col>
           </el-row>
@@ -81,81 +50,42 @@
         <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 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 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 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 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-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-input v-model="formData.data.buyAddress" type="textarea"> </el-input>
                 </el-form-item>
               </el-col>
             </el-row>
@@ -168,17 +98,13 @@
                     clearable
                     class="inline-input w-50"
                     placeholder="请输入联系人"
-                    @select="handlePerson"
-                  >
+                    @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-input v-model="formData.data.buyContactNumber" placeholder="请输入联系人电话" />
                 </el-form-item>
               </el-col>
             </el-row>
@@ -187,27 +113,17 @@
       </template>
       <template #sellerOther>
         <div style="width: 100%">
-          <Editor
-            :value="formData.data.remark"
-            @updateValue="updateContentSeller"
-          />
+          <Editor :value="formData.data.remark" @updateValue="updateContentSeller" />
         </div>
       </template>
       <template #commodity>
         <div style="width: 100%">
           <el-button @click="openProduct = true">添加商品</el-button>
-          <el-table
-            :data="formData.data.serviceContractProductList"
-            style="width: 100%; margin-top: 16px"
-          >
+          <el-table :data="formData.data.serviceContractProductList" 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)"
-                  />
+                  <img :src="row.fileUrl" class="pic" @click="onPicture(row.fileUrl)" />
                 </div>
                 <div v-else></div>
               </template>
@@ -216,17 +132,8 @@
             <el-table-column label="商品名称" min-width="200">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
-                  <el-form-item
-                    :prop="
-                      'serviceContractProductList.' + $index + '.productName'
-                    "
-                    :rules="rules.productName"
-                    :inline-message="true"
-                  >
-                    <el-input
-                      v-model="row.productName"
-                      placeholder="请输入商品名称"
-                    />
+                  <el-form-item :prop="'serviceContractProductList.' + $index + '.productName'" :rules="rules.productName" :inline-message="true">
+                    <el-input v-model="row.productName" placeholder="请输入商品名称" />
                   </el-form-item>
                 </div>
               </template>
@@ -234,17 +141,8 @@
             <el-table-column label="规格型号" width="180">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
-                  <el-form-item
-                    :prop="
-                      'serviceContractProductList.' + $index + '.productModel'
-                    "
-                    :rules="rules.productModel"
-                    :inline-message="true"
-                  >
-                    <el-input
-                      v-model="row.productModel"
-                      placeholder="请输入规格型号"
-                    />
+                  <el-form-item :prop="'serviceContractProductList.' + $index + '.productModel'" :rules="rules.productModel" :inline-message="true">
+                    <el-input v-model="row.productModel" placeholder="请输入规格型号" />
                   </el-form-item>
                 </div>
               </template>
@@ -253,11 +151,7 @@
             <el-table-column label="数量" width="160">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
-                  <el-form-item
-                    :prop="'serviceContractProductList.' + $index + '.quantity'"
-                    :rules="rules.quantity"
-                    :inline-message="true"
-                  >
+                  <el-form-item :prop="'serviceContractProductList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true">
                     <el-input-number
                       v-model="row.quantity"
                       placeholder="请输入数量"
@@ -265,8 +159,7 @@
                       :precision="0"
                       :controls="false"
                       :min="0"
-                      @change="calculationAmount()"
-                    />
+                      @change="calculationAmount()" />
                   </el-form-item>
                 </div>
               </template>
@@ -274,11 +167,7 @@
             <el-table-column label="单价" width="160">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
-                  <el-form-item
-                    :prop="'serviceContractProductList.' + $index + '.price'"
-                    :rules="rules.price"
-                    :inline-message="true"
-                  >
+                  <el-form-item :prop="'serviceContractProductList.' + $index + '.price'" :rules="rules.price" :inline-message="true">
                     <el-input-number
                       v-model="row.price"
                       placeholder="请输入单价"
@@ -286,29 +175,16 @@
                       :precision="2"
                       :controls="false"
                       :min="0"
-                      @change="calculationAmount()"
-                    />
+                      @change="calculationAmount()" />
                   </el-form-item>
                 </div>
               </template>
             </el-table-column>
             <el-table-column prop="amount" label="金额" width="140" />
-            <el-table-column
-              align="center"
-              label="操作"
-              width="120"
-              fixed="right"
-            >
+            <el-table-column align="center" label="操作" width="120" fixed="right">
               <template #default="{ row, $index }">
-                <el-button
-                  type="primary"
-                  link
-                  @click="handleHandover(row, $index)"
-                  >交接单</el-button
-                >
-                <el-button type="primary" link @click="handleRemove($index)"
-                  >删除</el-button
-                >
+                <el-button type="primary" link @click="handleHandover(row, $index)">交接单</el-button>
+                <el-button type="primary" link @click="handleRemove($index)">删除</el-button>
               </template>
             </el-table-column>
           </el-table>
@@ -317,25 +193,12 @@
       <template #otherCharge>
         <div style="width: 100%">
           <el-button type="primary" @click="clickAdd()">添加行</el-button>
-          <el-table
-            :data="formData.data.serviceContractPayList"
-            style="width: 100%; margin-top: 16px"
-          >
+          <el-table :data="formData.data.serviceContractPayList" style="width: 100%; margin-top: 16px">
             <el-table-column label="收费项目" width="220">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
-                  <el-form-item
-                    :prop="'serviceContractPayList.' + $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 :prop="'serviceContractPayList.' + $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>
@@ -343,11 +206,7 @@
             <el-table-column label="金额" width="180">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
-                  <el-form-item
-                    :prop="'serviceContractPayList.' + $index + '.amount'"
-                    :rules="rules.amount"
-                    :inline-message="true"
-                  >
+                  <el-form-item :prop="'serviceContractPayList.' + $index + '.amount'" :rules="rules.amount" :inline-message="true">
                     <el-input-number
                       v-model="row.amount"
                       placeholder="请输入金额"
@@ -355,8 +214,7 @@
                       :precision="2"
                       :controls="false"
                       :min="0"
-                      @change="totalAmount()"
-                    />
+                      @change="totalAmount()" />
                   </el-form-item>
                 </div>
               </template>
@@ -364,24 +222,15 @@
             <el-table-column label="备注">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
-                  <el-form-item
-                    :prop="'serviceContractPayList.' + $index + '.remark'"
-                  >
+                  <el-form-item :prop="'serviceContractPayList.' + $index + '.remark'">
                     <el-input v-model="row.remark" placeholder="请输入备注" />
                   </el-form-item>
                 </div>
               </template>
             </el-table-column>
-            <el-table-column
-              align="center"
-              label="操作"
-              width="80"
-              fixed="right"
-            >
+            <el-table-column align="center" label="操作" width="80" fixed="right">
               <template #default="{ row, $index }">
-                <el-button type="primary" link @click="handleDelete($index)"
-                  >删除</el-button
-                >
+                <el-button type="primary" link @click="handleDelete($index)">删除</el-button>
               </template>
             </el-table-column>
           </el-table>
@@ -392,44 +241,22 @@
           <el-row style="margin-top: 20px; width: 100%">
             <el-col :span="4">
               <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 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="amount">
-                <el-input
-                  v-model="formData.data.amount"
-                  placeholder="合同总金额"
-                  disabled
-                />
+                <el-input v-model="formData.data.amount" placeholder="合同总金额" disabled />
               </el-form-item>
             </el-col>
           </el-row>
           <el-row style="margin-top: 20px; width: 100%">
             <el-col :span="7">
               <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 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>
@@ -442,23 +269,13 @@
                   :precision="2"
                   :controls="false"
                   :min="0"
-                  :max="100"
-                />
+                  :max="100" />
               </el-form-item>
             </el-col>
             <el-col :span="7">
               <el-form-item label="收款账号" prop="shroffAccountId">
-                <el-select
-                  v-model="formData.data.shroffAccountId"
-                  placeholder="请选择收款账号"
-                  style="width: 100%"
-                >
-                  <el-option
-                    v-for="item in accountList"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value"
-                  />
+                <el-select v-model="formData.data.shroffAccountId" placeholder="请选择收款账号" style="width: 100%">
+                  <el-option v-for="item in accountList" :key="item.value" :label="item.label" :value="item.value" />
                 </el-select>
               </el-form-item>
             </el-col>
@@ -467,35 +284,15 @@
       </template>
     </byForm>
 
-    <el-dialog
-      v-model="openProduct"
-      title="选择商品"
-      width="70%"
-      append-to-body
-    >
-      <SelectGoods
-        @cancel="openProduct = false"
-        @pushGoods="pushGoods"
-      ></SelectGoods>
+    <el-dialog v-model="openProduct" title="选择商品" width="70%" append-to-body>
+      <SelectGoods @cancel="openProduct = false" @pushGoods="pushGoods"></SelectGoods>
     </el-dialog>
 
-    <el-dialog
-      title="交接单"
-      v-if="openHandover"
-      v-model="openHandover"
-      width="800"
-    >
-      <byForm
-        :formConfig="formHandoverConfig"
-        :formOption="formOption"
-        v-model="productRow.data"
-      >
+    <el-dialog title="交接单" v-if="openHandover" v-model="openHandover" width="800">
+      <byForm :formConfig="formHandoverConfig" :formOption="formOption" v-model="productRow.data">
         <template #remark>
           <div style="width: 100%">
-            <Editor
-              :value="productRow.data.remark"
-              @updateValue="updateContent"
-            />
+            <Editor :value="productRow.data.remark" @updateValue="updateContent" />
           </div>
         </template>
         <template #file>
@@ -506,8 +303,7 @@
               :data="uploadData"
               multiple
               :before-upload="uploadFile"
-              :on-preview="onPreviewFile"
-            >
+              :on-preview="onPreviewFile">
               <el-button>选择</el-button>
             </el-upload>
           </div>
@@ -515,9 +311,7 @@
       </byForm>
       <template #footer>
         <el-button @click="openHandover = false" size="large">取 消</el-button>
-        <el-button type="primary" @click="submitHandoverForm()" size="large"
-          >确 定</el-button
-        >
+        <el-button type="primary" @click="submitHandoverForm()" size="large">确 定</el-button>
       </template>
     </el-dialog>
   </div>
@@ -606,43 +400,24 @@ const formConfig = computed(() => {
   ];
 });
 const rules = ref({
-  contractTemplateId: [
-    { required: true, message: "请选择合同模板", trigger: "change" },
-  ],
-  buyCorporationId: [
-    { required: true, message: "请选择公司", trigger: "change" },
-  ],
+  contractTemplateId: [{ required: true, message: "请选择合同模板", trigger: "change" }],
+  buyCorporationId: [{ required: true, message: "请选择公司", trigger: "change" }],
   buyCountryId: [{ required: true, message: "请选择国家", trigger: "change" }],
-  buyProvinceId: [
-    { 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" },
-  ],
+  buyContactName: [{ required: true, message: "请输入联系人", trigger: ["change", "blur"] }],
+  buyContactNumber: [{ required: true, message: "请输入联系电话", trigger: "blur" }],
   productName: [{ required: true, message: "请输入商品名称", trigger: "blur" }],
-  productModel: [
-    { required: true, message: "请输入规格型号", trigger: "blur" },
-  ],
+  productModel: [{ required: true, message: "请输入规格型号", trigger: "blur" }],
   quantity: [{ required: true, message: "请输入数量", trigger: "blur" }],
+  price: [{ required: true, message: "请输入单价", trigger: "blur" }],
   amount: [{ required: true, message: "请输入金额", trigger: "blur" }],
-  payName: [
-    { required: true, message: "请输入收费项目", trigger: ["change", "blur"] },
-  ],
+  payName: [{ required: true, message: "请输入收费项目", trigger: ["change", "blur"] }],
   currency: [{ required: true, message: "请选择币种", trigger: "change" }],
-  paymentMethod: [
-    { required: true, message: "请选择付款方式", trigger: "change" },
-  ],
-  advanceRatio: [
-    { required: true, message: "请输入预付比例", trigger: "blur" },
-  ],
-  shroffAccountId: [
-    { required: true, message: "请选择收款账号", trigger: "change" },
-  ],
+  paymentMethod: [{ required: true, message: "请选择付款方式", trigger: "change" }],
+  advanceRatio: [{ required: true, message: "请输入预付比例", trigger: "blur" }],
+  shroffAccountId: [{ required: true, message: "请选择收款账号", trigger: "change" }],
 });
 const getDict = () => {
   proxy
@@ -679,17 +454,15 @@ const getDict = () => {
         });
       }
     });
-  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("/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 {
@@ -708,16 +481,14 @@ const getDict = () => {
       };
     });
   });
-  proxy
-    .post("/accountManagement/page", { pageNum: 1, pageSize: 999 })
-    .then((res) => {
-      accountList.value = res.rows.map((item) => {
-        return {
-          label: item.alias,
-          value: item.id,
-        };
-      });
+  proxy.post("/accountManagement/page", { pageNum: 1, pageSize: 999 }).then((res) => {
+    accountList.value = res.rows.map((item) => {
+      return {
+        label: item.alias,
+        value: item.id,
+      };
     });
+  });
 };
 getDict();
 const changeTemplate = (val) => {
@@ -725,9 +496,7 @@ const changeTemplate = (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
-          );
+          let sellCountryData = resCountry.filter((item) => item.id === res.countryId);
           if (sellCountryData && sellCountryData.length > 0) {
             formData.data.sellCountryId = sellCountryData[0].chineseName;
           } else {
@@ -735,34 +504,26 @@ const changeTemplate = (val) => {
           }
         });
         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 = "";
-              }
-            });
+          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 = "";
-              }
-            });
+          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 = "";
         }
@@ -854,15 +615,11 @@ const changeCustomer = (val) => {
 };
 const createFilter = (queryString) => {
   return (restaurant) => {
-    return (
-      restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0
-    );
+    return restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0;
   };
 };
 const querySearchPerson = (queryString, callback) => {
-  const results = queryString
-    ? customerUserList.value.filter(createFilter(queryString))
-    : customerUserList.value;
+  const results = queryString ? customerUserList.value.filter(createFilter(queryString)) : customerUserList.value;
   callback(results);
 };
 const handlePerson = (item) => {
@@ -870,28 +627,27 @@ const handlePerson = (item) => {
 };
 const pushGoods = (goods) => {
   if (goods && goods.length > 0) {
-    formData.data.serviceContractProductList =
-      formData.data.serviceContractProductList.concat(
-        goods.map((item) => {
-          let fileUrl = "";
-          if (item.fileList && item.fileList.length > 0) {
-            fileUrl = item.fileList[0].fileUrl;
-          }
-          return {
-            fileUrl: fileUrl,
-            code: item.code,
-            productId: item.id,
-            productName: item.name,
-            productModel: item.spec,
-            unit: item.unit,
-            quantity: undefined,
-            price: undefined,
-            amount: "",
-            remark: "",
-            fileList: [],
-          };
-        })
-      );
+    formData.data.serviceContractProductList = formData.data.serviceContractProductList.concat(
+      goods.map((item) => {
+        let fileUrl = "";
+        if (item.fileList && item.fileList.length > 0) {
+          fileUrl = item.fileList[0].fileUrl;
+        }
+        return {
+          fileUrl: fileUrl,
+          code: item.code,
+          productId: item.id,
+          productName: item.name,
+          productModel: item.spec,
+          unit: item.unit,
+          quantity: undefined,
+          price: undefined,
+          amount: "",
+          remark: "",
+          fileList: [],
+        };
+      })
+    );
     ElMessage({
       message: "添加成功!",
       type: "success",
@@ -983,17 +739,15 @@ const onPreviewFile = (file) => {
   window.open(file.raw.fileUrl, "_blank");
 };
 const submitHandoverForm = () => {
-  formData.data.serviceContractProductList[productIndex.value].remark =
-    productRow.data.remark;
+  formData.data.serviceContractProductList[productIndex.value].remark = productRow.data.remark;
   if (fileList.value && fileList.value.length > 0) {
-    formData.data.serviceContractProductList[productIndex.value].fileList =
-      fileList.value.map((item) => {
-        return {
-          id: item.raw.id,
-          fileName: item.raw.fileName,
-          fileUrl: item.raw.fileUrl,
-        };
-      });
+    formData.data.serviceContractProductList[productIndex.value].fileList = fileList.value.map((item) => {
+      return {
+        id: item.raw.id,
+        fileName: item.raw.fileName,
+        fileUrl: item.raw.fileUrl,
+      };
+    });
   } else {
     formData.data.serviceContractProductList[productIndex.value].fileList = [];
   }
@@ -1004,24 +758,13 @@ const handleRemove = (index) => {
 };
 const calculationAmount = () => {
   nextTick(() => {
-    if (
-      formData.data.serviceContractProductList &&
-      formData.data.serviceContractProductList.length > 0
-    ) {
-      for (
-        let i = 0;
-        i < formData.data.serviceContractProductList.length;
-        i++
-      ) {
+    if (formData.data.serviceContractProductList && formData.data.serviceContractProductList.length > 0) {
+      for (let i = 0; i < formData.data.serviceContractProductList.length; i++) {
         let money = 0;
-        if (
-          formData.data.serviceContractProductList[i].quantity &&
-          formData.data.serviceContractProductList[i].price
-        ) {
-          money = parseFloat(
-            Number(formData.data.serviceContractProductList[i].quantity) *
-              Number(formData.data.serviceContractProductList[i].price)
-          ).toFixed(2);
+        if (formData.data.serviceContractProductList[i].quantity && formData.data.serviceContractProductList[i].price) {
+          money = parseFloat(Number(formData.data.serviceContractProductList[i].quantity) * Number(formData.data.serviceContractProductList[i].price)).toFixed(
+            2
+          );
         }
         formData.data.serviceContractProductList[i].amount = money;
       }
@@ -1033,76 +776,55 @@ const calculationAmount = () => {
 };
 const totalAmount = () => {
   let money = 0;
-  if (
-    formData.data.serviceContractProductList &&
-    formData.data.serviceContractProductList.length > 0
-  ) {
+  if (formData.data.serviceContractProductList && formData.data.serviceContractProductList.length > 0) {
     for (let i = 0; i < formData.data.serviceContractProductList.length; i++) {
       if (formData.data.serviceContractProductList[i].amount) {
-        money = parseFloat(
-          Number(money) +
-            Number(formData.data.serviceContractProductList[i].amount)
-        ).toFixed(2);
+        money = parseFloat(Number(money) + Number(formData.data.serviceContractProductList[i].amount)).toFixed(2);
       }
     }
   }
-  if (
-    formData.data.serviceContractPayList &&
-    formData.data.serviceContractPayList.length > 0
-  ) {
+  if (formData.data.serviceContractPayList && formData.data.serviceContractPayList.length > 0) {
     for (let i = 0; i < formData.data.serviceContractPayList.length; i++) {
       if (formData.data.serviceContractPayList[i].amount) {
-        money = parseFloat(
-          Number(money) + Number(formData.data.serviceContractPayList[i].amount)
-        ).toFixed(2);
+        money = parseFloat(Number(money) + Number(formData.data.serviceContractPayList[i].amount)).toFixed(2);
       }
     }
   }
   formData.data.amount = money;
 };
 const clickAdd = () => {
-  if (
-    formData.data.serviceContractPayList &&
-    formData.data.serviceContractPayList.length > 0
-  ) {
+  if (formData.data.serviceContractPayList && formData.data.serviceContractPayList.length > 0) {
     formData.data.serviceContractPayList.push({
       payName: "",
       amount: undefined,
       remark: "",
     });
   } else {
-    formData.data.serviceContractPayList = [
-      { payName: "", amount: undefined, remark: "" },
-    ];
+    formData.data.serviceContractPayList = [{ payName: "", amount: undefined, remark: "" }];
   }
 };
 const handleDelete = (index) => {
   formData.data.serviceContractPayList.splice(index, 1);
 };
 const querySearch = (queryString, callback) => {
-  proxy
-    .post("/serviceContractPay/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([]);
-      }
-    });
+  proxy.post("/serviceContractPay/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.serviceContractProductList &&
-      formData.data.serviceContractProductList.length > 0
-    ) {
+    if (formData.data.serviceContractProductList && formData.data.serviceContractProductList.length > 0) {
       return true;
     } else {
       ElMessage("请添加至少一件商品");
@@ -1111,11 +833,6 @@ const handleSubmit = async () => {
   }
   return status;
 };
-// 接收父组件的传值
-const props = defineProps({
-  queryData: String,
-});
-onMounted(() => {});
 // 向父组件暴露
 defineExpose({
   submitData: formData.data,

+ 297 - 0
src/views/EHSD/addressBook/freightForwarding/index.vue

@@ -0,0 +1,297 @@
+<template>
+  <div class="tenant">
+    <div class="content">
+      <byTable
+        :source="sourceList.data"
+        :pagination="sourceList.pagination"
+        :config="config"
+        :loading="loading"
+        highlight-current-row
+        :action-list="[
+          {
+            text: '添加货代公司',
+            action: () => openModal(),
+          },
+        ]"
+        @get-list="getList">
+        <template #address="{ item }">
+          <div style="width: 100%">
+            <span v-if="item.province">{{ item.province }},</span>
+            <span v-if="item.city">{{ item.city }},</span>
+            <span v-if="item.address">{{ item.address }}</span>
+          </div>
+        </template>
+      </byTable>
+    </div>
+
+    <el-dialog :title="modalType == 'add' ? '添加货代公司' : '编辑货代公司'" v-if="dialogVisible" v-model="dialogVisible" width="700" v-loading="loadingDialog">
+      <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit"> </byForm>
+      <template #footer>
+        <el-button @click="dialogVisible = false" size="large">取 消</el-button>
+        <el-button type="primary" @click="submitForm()" 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 { ElMessage, ElMessageBox } from "element-plus";
+
+const { proxy } = getCurrentInstance();
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 0,
+    pageNum: 1,
+    pageSize: 10,
+    keyword: "",
+  },
+});
+const loading = ref(false);
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "公司名称",
+        prop: "companyName",
+      },
+    },
+    {
+      attrs: {
+        label: "地址",
+        slot: "address",
+      },
+    },
+    {
+      attrs: {
+        label: "公司电话",
+        prop: "companyTel",
+      },
+    },
+    {
+      attrs: {
+        label: "联系人",
+        prop: "personName",
+      },
+    },
+    {
+      attrs: {
+        label: "联系人电话",
+        prop: "personTel",
+      },
+    },
+    {
+      attrs: {
+        label: "操作",
+        width: 120,
+        align: "center",
+      },
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "修改",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              update(row);
+            },
+          },
+          {
+            attrs: {
+              label: "删除",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              ElMessageBox.confirm("此操作将永久删除该数据, 是否继续?", "提示", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning",
+              }).then(() => {
+                proxy
+                  .post("/freightForwarder/delete", {
+                    id: row.id,
+                  })
+                  .then(() => {
+                    ElMessage({
+                      message: "删除成功",
+                      type: "success",
+                    });
+                    getList();
+                  });
+              });
+            },
+          },
+        ];
+      },
+    },
+  ];
+});
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy.post("/freightForwarder/page", sourceList.value.pagination).then((res) => {
+    sourceList.value.data = res.rows;
+    sourceList.value.pagination.total = res.total;
+    setTimeout(() => {
+      loading.value = false;
+    }, 200);
+  });
+};
+getList();
+const modalType = ref("add");
+const dialogVisible = ref(false);
+const loadingDialog = ref(false);
+const submit = ref(null);
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const formConfig = computed(() => {
+  return [
+    {
+      label: "基本信息",
+    },
+    {
+      type: "input",
+      prop: "companyName",
+      label: "公司名称",
+      itemWidth: 50,
+      itemType: "text",
+    },
+    {
+      type: "input",
+      prop: "companyTel",
+      label: "公司电话",
+      itemWidth: 50,
+      itemType: "text",
+    },
+    {
+      type: "input",
+      prop: "province",
+      label: "省会",
+      itemWidth: 50,
+      itemType: "text",
+    },
+    {
+      type: "input",
+      prop: "city",
+      label: "城市",
+      itemWidth: 50,
+      itemType: "text",
+    },
+    {
+      type: "input",
+      prop: "address",
+      label: "地址",
+      itemType: "text",
+    },
+    {
+      label: "联系人信息",
+    },
+    {
+      type: "input",
+      prop: "personName",
+      label: "姓名",
+      itemWidth: 33,
+      itemType: "text",
+    },
+    {
+      type: "input",
+      prop: "personTel",
+      label: "电话",
+      itemWidth: 33,
+      itemType: "text",
+    },
+    {
+      type: "input",
+      prop: "personMail",
+      label: "邮箱",
+      itemWidth: 34,
+      itemType: "text",
+    },
+    {
+      label: "银行账户信息",
+    },
+    {
+      type: "input",
+      prop: "bankName",
+      label: "银行",
+      itemWidth: 50,
+      itemType: "text",
+    },
+    {
+      type: "input",
+      prop: "bankAccountName",
+      label: "账户名",
+      itemWidth: 50,
+      itemType: "text",
+    },
+    {
+      type: "input",
+      prop: "bankAccount",
+      label: "账号",
+      itemWidth: 50,
+      itemType: "text",
+    },
+  ];
+});
+const rules = ref({
+  companyName: [{ required: true, message: "请输入公司名称", trigger: "blur" }],
+});
+const formData = reactive({
+  data: {},
+});
+const openModal = () => {
+  modalType.value = "add";
+  formData.data = {};
+  loadingDialog.value = false;
+  dialogVisible.value = true;
+};
+const submitForm = () => {
+  submit.value.handleSubmit(() => {
+    loadingDialog.value = true;
+    proxy.post("/freightForwarder/" + modalType.value, formData.data).then(
+      () => {
+        ElMessage({
+          message: modalType.value == "add" ? "添加成功" : "编辑成功",
+          type: "success",
+        });
+        dialogVisible.value = false;
+        getList();
+      },
+      (err) => {
+        console.log(err);
+        loadingDialog.value = false;
+      }
+    );
+  });
+};
+const update = (row) => {
+  modalType.value = "edit";
+  loadingDialog.value = true;
+  proxy.post("/freightForwarder/detail", { id: row.id }).then((res) => {
+    formData.data = res;
+    loadingDialog.value = false;
+  });
+  dialogVisible.value = true;
+};
+</script>
+
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+::v-deep(.el-input-number .el-input__inner) {
+  text-align: left;
+}
+</style>

+ 73 - 49
src/views/EHSD/productLibrary/companyProduct/index.vue

@@ -23,16 +23,20 @@
           select: select,
         }"
         :action-list="[
-          {
-            text: 'Excel导入',
-            action: () => openExcel(),
-            disabled: false,
-          },
-          {
-            text: '添加',
-            action: () => openModal('add'),
-            disabled: false,
-          },
+          props.selectStatus
+            ? {}
+            : {
+                text: 'Excel导入',
+                action: () => openExcel(),
+                disabled: false,
+              },
+          props.selectStatus
+            ? {}
+            : {
+                text: '添加',
+                action: () => openModal('add'),
+                disabled: false,
+              },
         ]"
         @get-list="getList">
         <template #pic="{ item }">
@@ -136,6 +140,9 @@ let rules = ref({
   outerPackMethod: [{ required: true, message: "请选择外包装方式", trigger: "change" }],
 });
 const { proxy } = getCurrentInstance();
+const props = defineProps({
+  selectStatus: Boolean,
+});
 const selectConfig = reactive([
   // {
   //   label: "产品类型",
@@ -208,46 +215,60 @@ const config = computed(() => {
       // 渲染 el-button,一般用在最后一列。
       renderHTML(row) {
         return [
-          {
-            attrs: {
-              label: "修改",
-              type: "primary",
-              text: true,
-            },
-            el: "button",
-            click() {
-              getDtl(row);
-            },
-          },
-          {
-            attrs: {
-              label: "删除",
-              type: "danger",
-              text: true,
-            },
-            el: "button",
-            click() {
-              // 弹窗提示是否删除
-              ElMessageBox.confirm("此操作将永久删除该数据, 是否继续?", "提示", {
-                confirmButtonText: "确定",
-                cancelButtonText: "取消",
-                type: "warning",
-              }).then(() => {
-                // 删除
-                proxy
-                  .post("/productInfo/delete", {
-                    id: row.id,
-                  })
-                  .then((res) => {
-                    ElMessage({
-                      message: "删除成功",
-                      type: "success",
-                    });
-                    getList();
+          props.selectStatus
+            ? {
+                attrs: {
+                  label: "选择",
+                  type: "primary",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  clickSelect(row);
+                },
+              }
+            : {
+                attrs: {
+                  label: "修改",
+                  type: "primary",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  getDtl(row);
+                },
+              },
+          props.selectStatus
+            ? {}
+            : {
+                attrs: {
+                  label: "删除",
+                  type: "danger",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  // 弹窗提示是否删除
+                  ElMessageBox.confirm("此操作将永久删除该数据, 是否继续?", "提示", {
+                    confirmButtonText: "确定",
+                    cancelButtonText: "取消",
+                    type: "warning",
+                  }).then(() => {
+                    // 删除
+                    proxy
+                      .post("/productInfo/delete", {
+                        id: row.id,
+                      })
+                      .then((res) => {
+                        ElMessage({
+                          message: "删除成功",
+                          type: "success",
+                        });
+                        getList();
+                      });
                   });
-              });
-            },
-          },
+                },
+              },
         ];
       },
     },
@@ -670,6 +691,9 @@ const getDict = () => {
 getDict();
 getTreeList();
 getList();
+const clickSelect = (item) => {
+  proxy.$emit("selectProduct", item);
+};
 </script>
 
 <style lang="scss" scoped>

+ 78 - 49
src/views/EHSD/productLibrary/customerProduct/index.vue

@@ -23,16 +23,20 @@
           select: select,
         }"
         :action-list="[
-          {
-            text: 'Excel导入',
-            action: () => openExcel(),
-            disabled: false,
-          },
-          {
-            text: '添加',
-            action: () => openModal('add'),
-            disabled: false,
-          },
+          props.selectStatus
+            ? {}
+            : {
+                text: 'Excel导入',
+                action: () => openExcel(),
+                disabled: false,
+              },
+          props.selectStatus
+            ? {}
+            : {
+                text: '添加',
+                action: () => openModal('add'),
+                disabled: false,
+              },
         ]"
         @get-list="getList">
         <template #pic="{ item }">
@@ -116,6 +120,7 @@ const sourceList = ref({
     productClassifyId: "",
     keyword: "",
     definition: "1",
+    customerId: "",
   },
 });
 let dialogVisible = ref(false);
@@ -134,6 +139,10 @@ let rules = ref({
   outerPackMethod: [{ required: true, message: "请选择外包装方式", trigger: "change" }],
 });
 const { proxy } = getCurrentInstance();
+const props = defineProps({
+  selectStatus: Boolean,
+  buyCorporationId: String,
+});
 const selectConfig = reactive([
   // {
   //   label: "产品类型",
@@ -206,46 +215,60 @@ const config = computed(() => {
       // 渲染 el-button,一般用在最后一列。
       renderHTML(row) {
         return [
-          {
-            attrs: {
-              label: "修改",
-              type: "primary",
-              text: true,
-            },
-            el: "button",
-            click() {
-              getDtl(row);
-            },
-          },
-          {
-            attrs: {
-              label: "删除",
-              type: "danger",
-              text: true,
-            },
-            el: "button",
-            click() {
-              // 弹窗提示是否删除
-              ElMessageBox.confirm("此操作将永久删除该数据, 是否继续?", "提示", {
-                confirmButtonText: "确定",
-                cancelButtonText: "取消",
-                type: "warning",
-              }).then(() => {
-                // 删除
-                proxy
-                  .post("/productInfo/delete", {
-                    id: row.id,
-                  })
-                  .then((res) => {
-                    ElMessage({
-                      message: "删除成功",
-                      type: "success",
-                    });
-                    getList();
+          props.selectStatus
+            ? {
+                attrs: {
+                  label: "选择",
+                  type: "primary",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  clickSelect(row);
+                },
+              }
+            : {
+                attrs: {
+                  label: "修改",
+                  type: "primary",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  getDtl(row);
+                },
+              },
+          props.selectStatus
+            ? {}
+            : {
+                attrs: {
+                  label: "删除",
+                  type: "danger",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  // 弹窗提示是否删除
+                  ElMessageBox.confirm("此操作将永久删除该数据, 是否继续?", "提示", {
+                    confirmButtonText: "确定",
+                    cancelButtonText: "取消",
+                    type: "warning",
+                  }).then(() => {
+                    // 删除
+                    proxy
+                      .post("/productInfo/delete", {
+                        id: row.id,
+                      })
+                      .then((res) => {
+                        ElMessage({
+                          message: "删除成功",
+                          type: "success",
+                        });
+                        getList();
+                      });
                   });
-              });
-            },
-          },
+                },
+              },
         ];
       },
     },
@@ -452,6 +475,9 @@ const formConfig = computed(() => {
 
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  if (props.buyCorporationId) {
+    sourceList.value.pagination.customerId = props.buyCorporationId;
+  }
   loading.value = true;
   proxy.post("/productInfo/getCustomerProductList", sourceList.value.pagination).then(
     (message) => {
@@ -706,6 +732,9 @@ const getDict = () => {
 getDict();
 getTreeList();
 getList();
+const clickSelect = (item) => {
+  proxy.$emit("selectProduct", item);
+};
 </script>
 
 <style lang="scss" scoped>

+ 17 - 7
src/views/EHSD/saleContract/contractEHSD/index.vue

@@ -178,12 +178,22 @@
         </div>
         <div class="baseRow" style="border-bottom: 1px solid black">
           <div class="contentRow" style="width: 100%">
-            <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">Beneficiary Name: {{}}</div>
-            <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">Beneficiary Bank: {{}}</div>
-            <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">Beneficiary Bank Address: {{}}</div>
-            <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">Beneficiary Account Number: {{}}</div>
-            <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">Swift Code: {{}}</div>
-            <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">Beneficiary Address: {{}}</div>
+            <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">
+              Beneficiary Name: {{ printDetails.beneficiaryName }}
+            </div>
+            <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">
+              Beneficiary Bank: {{ printDetails.beneficiaryBank }}
+            </div>
+            <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">
+              Beneficiary Bank Address: {{ printDetails.beneficiaryBankAddress }}
+            </div>
+            <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">
+              Beneficiary Account Number: {{ printDetails.beneficiaryAccountNumber }}
+            </div>
+            <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">Swift Code: {{ printDetails.swiftCode }}</div>
+            <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">
+              Beneficiary Address: {{ printDetails.beneficiaryAddress }}
+            </div>
           </div>
         </div>
         <div style="height: 32px"></div>
@@ -560,6 +570,7 @@ const newContract = () => {
       flowKey: "contract_flow",
       flowName: "销售合同审批流程",
       random: proxy.random(),
+      tenantType: "EHSD",
     },
   });
 };
@@ -579,7 +590,6 @@ const statistics = (label, index) => {
   let num = 0;
   if (printDetails.value.productInfoList && printDetails.value.productInfoList.length > 0) {
     printDetails.value.productInfoList.map((item) => {
-      console.log(item, label, item[label]);
       if (item[label]) {
         num = parseFloat(Number(num) + Number(item[label])).toFixed(index);
       }

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

@@ -180,12 +180,22 @@
         </div>
         <div class="baseRow" style="border-bottom: 1px solid black">
           <div class="contentRow" style="width: 100%">
-            <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">Beneficiary Name: {{}}</div>
-            <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">Beneficiary Bank: {{}}</div>
-            <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">Beneficiary Bank Address: {{}}</div>
-            <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">Beneficiary Account Number: {{}}</div>
-            <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">Swift Code: {{}}</div>
-            <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">Beneficiary Address: {{}}</div>
+            <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">
+              Beneficiary Name: {{ printDetails.beneficiaryName }}
+            </div>
+            <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">
+              Beneficiary Bank: {{ printDetails.beneficiaryBank }}
+            </div>
+            <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">
+              Beneficiary Bank Address: {{ printDetails.beneficiaryBankAddress }}
+            </div>
+            <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">
+              Beneficiary Account Number: {{ printDetails.beneficiaryAccountNumber }}
+            </div>
+            <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">Swift Code: {{ printDetails.swiftCode }}</div>
+            <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">
+              Beneficiary Address: {{ printDetails.beneficiaryAddress }}
+            </div>
           </div>
         </div> -->
         <div style="height: 32px"></div>
@@ -303,7 +313,7 @@ const config = computed(() => {
       attrs: {
         label: "报价人",
         prop: "userName",
-        width: 120,
+        width: 160,
       },
     },
     {
@@ -506,7 +516,7 @@ const clickCopy = (item) => {
     query: {
       flowKey: "sale_quotation_flow",
       flowName: "报价审批流程",
-      id: item.id,
+      priceSheetId: item.id,
       random: proxy.random(),
       tenantType: "EHSD",
     },

+ 25 - 0
src/views/customer/file/index.vue

@@ -15,6 +15,12 @@
           },
         ]"
         @get-list="getList">
+        <template #isTop="{ item }">
+          <div>
+            <img style="cursor: pointer; width: 20px; transform: translateY(5px)" :src="'/img/isTop.png'" @click="deleteTop(item)" v-if="item.isTop === 1" />
+            <img style="cursor: pointer; width: 20px; transform: translateY(5px)" :src="'/img/noTop.png'" @click="addTop(item)" v-else />
+          </div>
+        </template>
         <template #address="{ item }">
           <span>{{ item.countryName }}</span>
           <span v-if="item.provinceName"> ,{{ item.provinceName }}</span>
@@ -342,6 +348,15 @@ const config = computed(() => {
   return [
     {
       attrs: {
+        label: "",
+        slot: "isTop",
+        fixed: "left",
+        width: 60,
+        align: "center",
+      },
+    },
+    {
+      attrs: {
         label: "客户名称",
         prop: "name",
         slot: "name",
@@ -1031,6 +1046,16 @@ const submitPerson = () => {
     }
   });
 };
+const deleteTop = (item) => {
+  proxy.post("/customerTop/delete", { customerId: item.id }).then(() => {
+    item.isTop = 0;
+  });
+};
+const addTop = (item) => {
+  proxy.post("/customerTop/add", { customerId: item.id }).then(() => {
+    item.isTop = 1;
+  });
+};
 </script>
 
 <style lang="scss" scoped>

+ 25 - 0
src/views/customer/highseas/index.vue

@@ -15,6 +15,12 @@
           },
         ]"
         @get-list="getList">
+        <template #isTop="{ item }">
+          <div>
+            <img style="cursor: pointer; width: 20px; transform: translateY(5px)" :src="'/img/isTop.png'" @click="deleteTop(item)" v-if="item.isTop === 1" />
+            <img style="cursor: pointer; width: 20px; transform: translateY(5px)" :src="'/img/noTop.png'" @click="addTop(item)" v-else />
+          </div>
+        </template>
         <template #address="{ item }">
           <span>{{ item.countryName }}</span>
           <span v-if="item.provinceName"> ,{{ item.provinceName }}</span>
@@ -342,6 +348,15 @@ const config = computed(() => {
   return [
     {
       attrs: {
+        label: "",
+        slot: "isTop",
+        fixed: "left",
+        width: 60,
+        align: "center",
+      },
+    },
+    {
+      attrs: {
         label: "客户名称",
         prop: "name",
         slot: "name",
@@ -1006,6 +1021,16 @@ const submitPerson = () => {
     }
   });
 };
+const deleteTop = (item) => {
+  proxy.post("/customerTop/delete", { customerId: item.id }).then(() => {
+    item.isTop = 0;
+  });
+};
+const addTop = (item) => {
+  proxy.post("/customerTop/add", { customerId: item.id }).then(() => {
+    item.isTop = 1;
+  });
+};
 </script>
 
 <style lang="scss" scoped>

+ 25 - 0
src/views/customer/privatesea/index.vue

@@ -15,6 +15,12 @@
           },
         ]"
         @get-list="getList">
+        <template #isTop="{ item }">
+          <div>
+            <img style="cursor: pointer; width: 20px; transform: translateY(5px)" :src="'/img/isTop.png'" @click="deleteTop(item)" v-if="item.isTop === 1" />
+            <img style="cursor: pointer; width: 20px; transform: translateY(5px)" :src="'/img/noTop.png'" @click="addTop(item)" v-else />
+          </div>
+        </template>
         <template #address="{ item }">
           <span>{{ item.countryName }}</span>
           <span v-if="item.provinceName"> ,{{ item.provinceName }}</span>
@@ -333,6 +339,15 @@ const config = computed(() => {
   return [
     {
       attrs: {
+        label: "",
+        slot: "isTop",
+        fixed: "left",
+        width: 60,
+        align: "center",
+      },
+    },
+    {
+      attrs: {
         label: "客户名称",
         prop: "name",
         slot: "name",
@@ -940,6 +955,16 @@ const submitPerson = () => {
     }
   });
 };
+const deleteTop = (item) => {
+  proxy.post("/customerTop/delete", { customerId: item.id }).then(() => {
+    item.isTop = 0;
+  });
+};
+const addTop = (item) => {
+  proxy.post("/customerTop/add", { customerId: item.id }).then(() => {
+    item.isTop = 1;
+  });
+};
 </script>
 
 <style lang="scss" scoped>

+ 133 - 87
src/views/process/processApproval/index.vue

@@ -11,15 +11,14 @@
         <ReturnGood ref="makeDom" v-else-if="flowForm.flowKey == 'sales_return_flow'" :queryData="queryData.data"></ReturnGood>
         <PurchaseRefund ref="makeDom" v-else-if="flowForm.flowKey == 'refund_flow'" :queryData="queryData.data"></PurchaseRefund>
         <PurchasePayment ref="makeDom" v-else-if="flowForm.flowKey == 'pay_flow'" :queryData="queryData.data"></PurchasePayment>
-        <PriceSheet
-          ref="makeDom"
-          v-else-if="flowForm.flowKey == 'sale_quotation_flow' && flowForm.tenantType !== 'EHSD'"
-          :queryData="queryData.data"></PriceSheet>
-        <PriceSheetEHSD
-          ref="makeDom"
-          v-else-if="flowForm.flowKey == 'sale_quotation_flow' && flowForm.tenantType === 'EHSD'"
-          :queryData="queryData.data"></PriceSheetEHSD>
-        <Contract ref="makeDom" v-else-if="flowForm.flowKey == 'contract_flow'" :queryData="queryData.data"></Contract>
+        <template v-else-if="flowForm.flowKey == 'sale_quotation_flow'">
+          <PriceSheetEHSD ref="makeDom" v-if="flowForm.tenantType === 'EHSD'" :queryData="queryData.data"></PriceSheetEHSD>
+          <PriceSheet ref="makeDom" v-else :queryData="queryData.data"></PriceSheet>
+        </template>
+        <template v-else-if="flowForm.flowKey == 'contract_flow'">
+          <ContractEHSD ref="makeDom" v-if="flowForm.tenantType === 'EHSD'" :queryData="queryData.data"></ContractEHSD>
+          <Contract ref="makeDom" v-else :queryData="queryData.data"></Contract>
+        </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>
@@ -33,7 +32,7 @@
           </el-form-item>
           <el-form-item>
             <el-button type="primary" v-if="approvalRecordData.buttonInfoList.length == 0" @click="handleSubmit">提交</el-button>
-            <el-button type="primary" v-else  v-for="i in approvalRecordData.buttonInfoList" :key='i.type' @click="handleSubmit(i.type)">{{i.name}}</el-button>
+            <el-button type="primary" v-else v-for="i in approvalRecordData.buttonInfoList" :key="i.type" @click="handleSubmit(i.type)">{{ i.name }}</el-button>
           </el-form-item>
         </el-form>
       </div>
@@ -42,10 +41,12 @@
       <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
         <el-tab-pane label="审批记录" name="first">
           <ul class="flow-chart">
-            <li 
-              v-for="item in recordList" 
-              :key="item.id" 
-              :class="item.status == 2? 'flow-orange' : item.status == 3 && !route.query.id? 'flow-orange' : item.status == 3 && route.query.id ? 'flow-grey' : ''">
+            <li
+              v-for="item in recordList"
+              :key="item.id"
+              :class="
+                item.status == 2 ? 'flow-orange' : item.status == 3 && !route.query.id ? 'flow-orange' : item.status == 3 && route.query.id ? 'flow-grey' : ''
+              ">
               <div class="left-icon">
                 <i class="iconfont icon-iconm_daick"></i>
                 <i class="iconfont icon-icomx_quertj1 right-btm-status"></i>
@@ -53,7 +54,9 @@
               <div class="right-conetnt">
                 <div class="name">{{ item.nodeName }}</div>
                 <div class="remark">
-                  <div class="label"><span v-if="item.status != 3">办理人:</span>{{ item.processedUser }}<span class="time">{{item.processedDate}}</span></div>
+                  <div class="label">
+                    <span v-if="item.status != 3">办理人:</span>{{ item.processedUser }}<span class="time">{{ item.processedDate }}</span>
+                  </div>
                   {{ item.remark }}
                 </div>
               </div>
@@ -78,7 +81,6 @@
         <el-form-item>
           <div style="width: 100%; text-align: center">
             <el-button type="primary" @click="handleSelectUser">提交</el-button>
-            
           </div>
         </el-form-item>
       </el-form>
@@ -111,6 +113,8 @@ import PriceSheet from "@/components/process/PriceSheet";
 import PriceSheetEHSD from "@/components/process/EHSD/PriceSheet";
 // 销售合同
 import Contract from "@/components/process/Contract";
+// 销售合同-EHSD
+import ContractEHSD from "@/components/process/EHSD/Contract";
 // 服务合同
 import ServiceContract from "@/components/process/ServiceContract";
 // /``````````````````````````````维多利亚专属 /
@@ -163,7 +167,6 @@ const handleResult = (res) => {
 };
 // 提交逻辑
 const handleSubmit = async (_type) => {
-  
   try {
     // 调用发起组件的提交事件
     const flag = await makeDom.value.handleSubmit();
@@ -214,21 +217,61 @@ const handleSubmit = async (_type) => {
               contractCode: data.contractCode,
             };
             data.victoriatouristJson = JSON.stringify(victoriatouristJson);
+          } else if (flowForm.flowKey == "sale_quotation_flow") {
+            if (flowForm.tenantType === "EHSD") {
+              data.ehsdJson = JSON.stringify({
+                deliveryTime: data.deliveryTime,
+              });
+              data.quotationProductList = data.quotationProductList.map((item) => {
+                let ehsdJson = JSON.stringify({
+                  packMethod: item.packMethod,
+                  tradeMethods: item.tradeMethods,
+                });
+                return {
+                  ...item,
+                  ehsdJson: ehsdJson,
+                };
+              });
+            }
+          } else if (flowForm.flowKey == "contract_flow") {
+            if (flowForm.tenantType === "EHSD") {
+              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) {
+          if (route.query.processType == 10) {
             proxy
               .post("/flowProcess/jump", {
                 ...flowForm,
                 data,
-                handleType:_type,
-                version:route.query.version,
-                flowId:route.query.id
+                handleType: _type,
+                version: route.query.version,
+                flowId: route.query.id,
               })
               .then((res) => {
                 handleResult(res);
               });
-            return
-          }else{
+            return;
+          } else {
             proxy
               .post("/flowProcess/initiate", {
                 ...flowForm,
@@ -238,7 +281,6 @@ const handleSubmit = async (_type) => {
                 handleResult(res);
               });
           }
-          
         }
       });
     }
@@ -249,7 +291,7 @@ const handleSubmit = async (_type) => {
 // 页面跳转
 const skipPage = () => {
   const useTagsStore = useTagsViewStore();
-  console.log(useTagsStore)
+  console.log(useTagsStore);
   useTagsStore.delVisitedView(router.currentRoute.value);
   ElMessage({
     message: "操作成功!",
@@ -280,18 +322,26 @@ const skipPage = () => {
     router.replace({
       path: "/purchaseManage/purchasePayment/payment",
     });
-  } else if (flowForm.flowKey == "sale_quotation_flow" && flowForm.tenantType !== "EHSD") {
-    router.replace({
-      path: "/salesMange/saleContract/priceSheet",
-    });
-  } else if (flowForm.flowKey == "sale_quotation_flow" && flowForm.tenantType === "EHSD") {
-    router.replace({
-      path: "/EHSD/saleContract/priceSheet",
-    });
+  } else if (flowForm.flowKey == "sale_quotation_flow") {
+    if (flowForm.tenantType === "EHSD") {
+      router.replace({
+        path: "/EHSD/saleContract/priceSheetEHSD",
+      });
+    } else {
+      router.replace({
+        path: "/salesMange/saleContract/priceSheet",
+      });
+    }
   } else if (flowForm.flowKey == "contract_flow") {
-    router.replace({
-      path: "/salesMange/saleContract/contract",
-    });
+    if (flowForm.tenantType === "EHSD") {
+      router.replace({
+        path: "/EHSD/saleContract/contractEHSD",
+      });
+    } else {
+      router.replace({
+        path: "/salesMange/saleContract/contract",
+      });
+    }
   } else if (flowForm.flowKey == "service_contract_flow") {
     router.replace({
       path: "/salesMange/saleContract/serviceContract",
@@ -312,44 +362,41 @@ let queryData = reactive({
 // 记录
 const recordList = ref([]);
 const approvalRecordData = ref({
-  buttonInfoList:[],
+  buttonInfoList: [],
 });
 const getRecords = (_id) => {
-  if(_id) {
+  if (_id) {
     proxy
-    .post("/flowExample/getApprovalRecord", {
-      id: _id,
-    })
-    .then((res) => {
-      console.log(res, "ass");
-      recordList.value = res.recordList;
-      approvalRecordData.value = res
-    });
-  }else{
+      .post("/flowExample/getApprovalRecord", {
+        id: _id,
+      })
+      .then((res) => {
+        console.log(res, "ass");
+        recordList.value = res.recordList;
+        approvalRecordData.value = res;
+      });
+  } else {
     proxy
-    .post("/flowExample/getFlowNode", {
-      flowKey: flowForm.flowKey,
-    })
-    .then((res) => {
-      console.log(res, "ass");
-      recordList.value = res;
-    });
+      .post("/flowExample/getFlowNode", {
+        flowKey: flowForm.flowKey,
+      })
+      .then((res) => {
+        console.log(res, "ass");
+        recordList.value = res;
+      });
   }
-  
-  
 };
 onMounted(() => {
   //processType 10 为修改 20为查看
-  if(route.query.processType == 10 || route.query.processType == 20) {
-    proxy.post('/flowProcess/getStartData',{flowId:route.query.id}).then(res=>{
-      console.log(res)
+  if (route.query.processType == 10 || route.query.processType == 20) {
+    proxy.post("/flowProcess/getStartData", { flowId: route.query.id }).then((res) => {
+      console.log(res);
       queryData.data = { ...res };
-    })
-  }else{
+    });
+  } else {
     queryData.data = { ...route.query };
   }
-  
-  
+
   flowForm.flowKey = route.query.flowKey;
   flowForm.tenantType = route.query.tenantType;
   getRecords(route.query.id);
@@ -405,15 +452,14 @@ onMounted(() => {
           flex: 1;
           .name {
             font-size: 12px;
-            
+
             color: #39c55a;
             margin-bottom: 10px;
             span {
               color: #999;
-              
             }
           }
-          .time{
+          .time {
             float: right;
           }
           .remark {
@@ -468,37 +514,37 @@ onMounted(() => {
       li:last-child::before {
         display: none;
       }
-      .flow-orange{
-        .right-btm-status{
-          background: #ff9a00!important;
+      .flow-orange {
+        .right-btm-status {
+          background: #ff9a00 !important;
         }
-        .name{
-          color: #ff9a00!important;
+        .name {
+          color: #ff9a00 !important;
         }
-        .left-icon{
-          background: #ff9a00!important;
+        .left-icon {
+          background: #ff9a00 !important;
         }
       }
-      .flow-grey{
-        .right-btm-status{
-          background: #999!important;
+      .flow-grey {
+        .right-btm-status {
+          background: #999 !important;
         }
-        .name{
-          color: #999!important;
+        .name {
+          color: #999 !important;
         }
-        .left-icon{
-          background: #999!important;
+        .left-icon {
+          background: #999 !important;
         }
       }
-      .flow-red{
-        .right-btm-status{
-          background: #ff4d4f!important;
+      .flow-red {
+        .right-btm-status {
+          background: #ff4d4f !important;
         }
-        .name{
-          color: #ff4d4f!important;
+        .name {
+          color: #ff4d4f !important;
         }
-        .left-icon{
-          background: #ff4d4f!important;
+        .left-icon {
+          background: #ff4d4f !important;
         }
       }
     }

+ 127 - 200
src/views/purchaseManage/supplier/supplier/index.vue

@@ -1,6 +1,5 @@
 <template>
   <div class="tenant">
-    <!-- <Banner /> -->
     <div class="content">
       <byTable
         :source="sourceList.data"
@@ -10,7 +9,6 @@
         highlight-current-row
         :selectConfig="selectConfig"
         :table-events="{
-          //element talbe事件都能传
           select: select,
         }"
         :action-list="[
@@ -19,73 +17,34 @@
             action: () => openModal('add'),
           },
         ]"
-        @get-list="getList"
-      >
+        @get-list="getList">
         <template #address="{ item }">
-          <div>
-            {{ item.countryName }}, {{ item.provinceName }} ,
-            {{ item.cityName }}, {{ item.areaDetail }}
-          </div>
+          <div>{{ item.countryName }}, {{ item.provinceName }} , {{ item.cityName }}, {{ item.areaDetail }}</div>
         </template>
       </byTable>
     </div>
-    <el-dialog
-      :title="modalType == 'add' ? '添加供应商' : '编辑供应商'"
-      v-model="dialogVisible"
-      width="800"
-      v-loading="loading"
-      destroy-on-close
-    >
-      <byForm
-        :formConfig="formConfig"
-        :formOption="formOption"
-        v-model="formData.data"
-        :rules="rules"
-        ref="byform"
-      >
+    <el-dialog :title="modalType == 'add' ? '添加供应商' : '编辑供应商'" v-model="dialogVisible" width="600" v-loading="loading" destroy-on-close>
+      <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="byform">
         <template #address>
           <el-row :gutter="10" style="width: 100%">
             <el-col :span="8">
               <el-form-item prop="countryId">
-                <el-select
-                  v-model="formData.data.countryId"
-                  placeholder="国家"
-                  @change="(val) => getCityData(val, '20', true)"
-                >
-                  <el-option
-                    v-for="item in countryData"
-                    :label="item.chineseName"
-                    :value="item.id"
-                  >
-                  </el-option>
+                <el-select v-model="formData.data.countryId" 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="8">
               <el-form-item prop="provinceId">
-                <el-select
-                  v-model="formData.data.provinceId"
-                  placeholder="省/洲"
-                  @change="(val) => getCityData(val, '30', true)"
-                >
-                  <el-option
-                    v-for="item in provinceData"
-                    :label="item.name"
-                    :value="item.id"
-                  >
-                  </el-option>
+                <el-select v-model="formData.data.provinceId" 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="8">
               <el-form-item prop="cityId">
                 <el-select v-model="formData.data.cityId" placeholder="城市">
-                  <el-option
-                    v-for="item in cityData"
-                    :label="item.name"
-                    :value="item.id"
-                  >
-                  </el-option>
+                  <el-option v-for="item in cityData" :label="item.name" :value="item.id"> </el-option>
                 </el-select>
               </el-form-item>
             </el-col>
@@ -93,22 +52,16 @@
           <el-row style="margin-top: 20px; width: 100%">
             <el-col :span="24">
               <el-form-item prop="areaDetail">
-                <el-input v-model="formData.data.areaDetail" type="textarea">
-                </el-input>
+                <el-input v-model="formData.data.areaDetail" type="textarea"> </el-input>
               </el-form-item>
             </el-col>
           </el-row>
         </template>
-
         <template #contact>
           <el-row :gutter="10" style="width: 100%">
             <el-col :span="8">
               <el-form-item prop="contactPerson">
-                <el-input
-                  v-model="formData.data.contactPerson"
-                  placeholder="联系人"
-                >
-                </el-input>
+                <el-input v-model="formData.data.contactPerson" placeholder="联系人"> </el-input>
               </el-form-item>
             </el-col>
             <el-col :span="16">
@@ -117,73 +70,55 @@
                   v-model="formData.data.contactNumber"
                   placeholder="联系电话"
                   :formatter="(val) => val.replace(/[^\d\-]/g, '')"
-                  :parser="(val) => val.replace(/[^\d\-]/g, '')"
-                >
+                  :parser="(val) => val.replace(/[^\d\-]/g, '')">
                 </el-input>
               </el-form-item>
             </el-col>
           </el-row>
         </template>
-
+        <template #paymentDays>
+          <el-row :gutter="10" style="width: 100%">
+            <el-col :span="8">
+              <el-form-item prop="accountPeriod">
+                <el-input-number v-model="formData.data.accountPeriod" placeholder="请输入账期 (天)" style="width: 100%" :precision="0" :controls="false" :min="0" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="16">
+              <el-form-item prop="accountPeriodRemark">
+                <el-input v-model="formData.data.accountPeriodRemark" placeholder="请输入账期说明" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </template>
         <template #fileSlot>
-          <div>
+          <div style="width: 100%">
             <el-upload
               v-model:fileList="fileList"
-              :show-file-list="false"
-              class="upload-demo"
               action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
               :data="uploadData"
-              :on-preview="handlePreview"
-              :on-remove="handleRemove"
-              :on-success="handleSuccess"
-              :before-upload="handleBeforeUpload"
-            >
-              <el-button type="primary">选择</el-button>
+              multiple
+              :before-upload="uploadFile"
+              :on-preview="onPreviewFile">
+              <el-button>选择</el-button>
             </el-upload>
-            <div>
-              <div style="margin-top: 15px">
-                <el-tag
-                  style="margin-right: 10px"
-                  class="ml-2"
-                  type="info"
-                  v-for="(item, index) in fileListCopy"
-                  :key="index"
-                  closable
-                  @close="handleClose(index)"
-                  >{{ item.fileName }}</el-tag
-                >
-              </div>
-            </div>
           </div>
         </template>
       </byForm>
       <template #footer>
         <el-button @click="dialogVisible = false" size="large">取 消</el-button>
-        <el-button
-          type="primary"
-          @click="submitForm('byform')"
-          size="large"
-          :loading="submitLoading"
-        >
-          确 定
-        </el-button>
+        <el-button type="primary" @click="submitForm()" size="large" :loading="submitLoading"> 确 定 </el-button>
       </template>
     </el-dialog>
   </div>
 </template>
-  
+
 <script setup>
 /* eslint-disable vue/no-unused-components */
 import { ElMessage, ElMessageBox } from "element-plus";
 import byTable from "@/components/byTable/index";
 import byForm from "@/components/byForm/index";
-import FileUpload from "@/components/FileUpload/index";
-import { computed, defineComponent, ref } from "vue";
-import { getToken } from "@/utils/auth";
+import { computed, ref } from "vue";
 
-const uploadFileUrl = ref(import.meta.env.VITE_APP_BASE_API + "/common/upload"); // 上传文件服务器地址
-const headers = ref({ Authorization: "Bearer " + getToken() });
-const uploadData = ref({});
 const loading = ref(false);
 const submitLoading = ref(false);
 const sourceList = ref({
@@ -198,18 +133,8 @@ const sourceList = ref({
 });
 let dialogVisible = ref(false);
 let modalType = ref("add");
-let fileList = ref([]);
-let fileListCopy = ref([]);
-
-const checkContactNumber = (rule, val, callback) => {
-  if (val === "") {
-    callback(new Error("请输入联系电话"));
-  } else {
-    val = "aaa";
-  }
-  console.log(rule, val, callback, "213");
-  // @input="(val) => val.replace(/[^\d]/g, '')"
-};
+const fileList = ref([]);
+const uploadData = ref({});
 let rules = ref({
   name: [{ required: true, message: "请输入供应商名称", trigger: "blur" }],
   type: [{ required: true, message: "请选择供应商类型", trigger: "change" }],
@@ -218,10 +143,7 @@ let rules = ref({
   cityId: [{ required: true, message: "请选择城市", trigger: "change" }],
   areaDetail: [{ required: true, message: "请输入详细地址", trigger: "blur" }],
   contactPerson: [{ required: true, message: "请输入联系人", trigger: "blur" }],
-  // contactNumber: [{ validator: checkContactNumber, trigger: "blur" }],
-  contactNumber: [
-    { required: true, message: "请输入联系电话", trigger: "blur" },
-  ],
+  contactNumber: [{ required: true, message: "请输入联系电话", trigger: "blur" }],
 });
 const { proxy } = getCurrentInstance();
 const selectConfig = reactive([
@@ -279,14 +201,12 @@ const config = computed(() => {
         prop: "remark",
       },
     },
-
     {
       attrs: {
         label: "操作",
         width: "200",
         align: "right",
       },
-      // 渲染 el-button,一般用在最后一列。
       renderHTML(row) {
         return [
           {
@@ -308,17 +228,11 @@ const config = computed(() => {
             },
             el: "button",
             click() {
-              // 弹窗提示是否删除
-              ElMessageBox.confirm(
-                "此操作将永久删除该数据, 是否继续?",
-                "提示",
-                {
-                  confirmButtonText: "确定",
-                  cancelButtonText: "取消",
-                  type: "warning",
-                }
-              ).then(() => {
-                // 删除
+              ElMessageBox.confirm("此操作将永久删除该数据, 是否继续?", "提示", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning",
+              }).then(() => {
                 proxy
                   .post("/supplierInfo/delete", {
                     id: row.id,
@@ -338,7 +252,6 @@ const config = computed(() => {
     },
   ];
 });
-
 let formData = reactive({
   data: {
     type: "1",
@@ -386,6 +299,11 @@ const formConfig = computed(() => {
     },
     {
       type: "slot",
+      slotName: "paymentDays",
+      label: "账期信息",
+    },
+    {
+      type: "slot",
       slotName: "fileSlot",
       label: "上传附件",
     },
@@ -395,116 +313,122 @@ const formConfig = computed(() => {
       prop: "remark",
       itemType: "textarea",
     },
+    {
+      label: "银行信息",
+    },
+    {
+      type: "input",
+      prop: "openingName",
+      label: "账户名称",
+      itemType: "text",
+    },
+    {
+      type: "input",
+      prop: "openingBank",
+      label: "开户银行",
+      itemType: "text",
+    },
+    {
+      type: "input",
+      prop: "accountOpening",
+      label: "银行账号",
+      itemType: "text",
+    },
+    {
+      type: "input",
+      prop: "interbankNumber",
+      label: "联行号",
+      itemType: "text",
+    },
   ];
 });
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
-  proxy
-    .post("/supplierInfo/page", sourceList.value.pagination)
-    .then((message) => {
-      console.log(message);
-      sourceList.value.data = message.rows;
-      sourceList.value.pagination.total = message.total;
-      setTimeout(() => {
-        loading.value = false;
-      }, 200);
-    });
+  proxy.post("/supplierInfo/page", sourceList.value.pagination).then((message) => {
+    console.log(message);
+    sourceList.value.data = message.rows;
+    sourceList.value.pagination.total = message.total;
+    setTimeout(() => {
+      loading.value = false;
+    }, 200);
+  });
 };
 const openModal = () => {
   dialogVisible.value = true;
   modalType.value = "add";
   fileList.value = [];
-  fileListCopy.value = [];
   formData.data = {
     type: "1",
     countryId: "China",
   };
   getCityData(formData.data.countryId, "20");
 };
-
+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 submitForm = () => {
-  byform.value.handleSubmit((valid) => {
-    formData.data.fileList =
-      fileListCopy.value.map((x) => ({
-        id: x.id,
-        fileName: x.fileName,
-      })) || [];
+  byform.value.handleSubmit(() => {
+    if (fileList.value && fileList.value.length > 0) {
+      formData.data.fileList = fileList.value.map((item) => {
+        return {
+          id: item.raw.id,
+          fileName: item.raw.fileName,
+          fileUrl: item.raw.fileUrl,
+        };
+      });
+    }
     submitLoading.value = true;
     proxy.post("/supplierInfo/" + modalType.value, formData.data).then(
-      (res) => {
+      () => {
         ElMessage({
           message: modalType.value == "add" ? "添加成功" : "编辑成功",
           type: "success",
         });
-        fileList.value = [];
         dialogVisible.value = false;
         submitLoading.value = false;
         getList();
       },
       (err) => {
+        console.log(err);
         submitLoading.value = false;
       }
     );
   });
 };
-
 const getDtl = (row) => {
+  fileList.value = [];
   modalType.value = "edit";
   proxy.post("/supplierInfo/detail", { id: row.id }).then((res) => {
-    proxy
-      .post("/fileInfo/getList", { businessIdList: [row.id] })
-      .then((fileObj) => {
-        fileList.value = fileObj[row.id] || [];
-        fileListCopy.value = [...fileList.value];
-        getCityData(res.countryId, "20");
-        getCityData(res.provinceId, "30");
-        res.type = res.type + "";
-        formData.data = res;
-        dialogVisible.value = true;
-      });
-  });
-};
-
-const handleBeforeUpload = async (file) => {
-  const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
-  uploadData.value = res.uploadBody;
-  fileListCopy.value.push({
-    id: res.id,
-    fileName: res.fileName,
-    path: res.fileUrl,
-    url: res.fileUrl,
-    uid: file.uid,
-  });
-};
-
-const handleClickFile = (row) => {
-  ElMessage({
-    message: "数据请求中,请稍后!",
-    type: "success",
-  });
-  let id = row.id;
-  proxy.post("/fileInfo/getList", { businessIdList: [id] }).then((res) => {
-    const file = res[id][0];
-    window.open(file.fileUrl, "_blank");
+    proxy.post("/fileInfo/getList", { businessIdList: [row.id] }).then((fileObj) => {
+      if (fileObj[row.id] && fileObj[row.id].length > 0) {
+        fileList.value = fileObj[row.id].map((item) => {
+          return {
+            raw: item,
+            name: item.fileName,
+            url: item.fileUrl,
+          };
+        });
+      }
+      getCityData(res.countryId, "20");
+      getCityData(res.provinceId, "30");
+      res.type = res.type + "";
+      formData.data = res;
+      dialogVisible.value = true;
+    });
   });
 };
-
-const handleClose = (index) => {
-  // if (fileListCopy.value.length === 1) {
-  //   return ElMessage({
-  //     message: "最后一个附件啦!",
-  //     type: "info",
-  //   });
-  // }
-  fileList.value.splice(index, 1);
-  fileListCopy.value.splice(index, 1);
-};
-
 const countryData = ref([]);
 const provinceData = ref([]);
 const cityData = ref([]);
-
 const getCityData = (id, type, isChange) => {
   proxy.post("/areaInfo/list", { parentId: id }).then((res) => {
     if (type === "20") {
@@ -537,9 +461,12 @@ getDict();
 getCityData("0");
 getList();
 </script>
-  
+
 <style lang="scss" scoped>
 .tenant {
   padding: 20px;
 }
-</style>
+::v-deep(.el-input-number .el-input__inner) {
+  text-align: left;
+}
+</style>

+ 46 - 211
src/views/salesMange/saleContract/contract/index.vue

@@ -14,8 +14,7 @@
             action: () => newContract(),
           },
         ]"
-        @get-list="getList"
-      >
+        @get-list="getList">
         <template #amount="{ item }">
           <div>
             <span style="padding-right: 4px">{{ item.currency }}</span>
@@ -37,30 +36,14 @@
     </div>
 
     <el-dialog title="打印" v-if="openPrint" v-model="openPrint" width="860">
-      <div
-        id="pdfDom"
-        style="width: 800px; padding: 16px; font-size: 12px !important"
-      >
+      <div id="pdfDom" style="width: 800px; padding: 16px; font-size: 12px !important">
         <div style="font-size: 18px; text-align: center">
           {{ printDetails.sellCorporationNameEn }}
         </div>
         <div style="text-align: center">
-          {{ printDetails.sellCountryName }},{{
-            printDetails.sellProvinceName
-          }},{{ printDetails.sellCityName }},{{
-            printDetails.sellDetailedAddress
-          }}
-        </div>
-        <div
-          style="
-            font-size: 14px;
-            color: #409eff;
-            text-align: center;
-            padding-top: 16px;
-          "
-        >
-          PROFORMA INVOICE
+          {{ printDetails.sellCountryName }},{{ printDetails.sellProvinceName }},{{ printDetails.sellCityName }},{{ printDetails.sellDetailedAddress }}
         </div>
+        <div style="font-size: 14px; color: #409eff; text-align: center; padding-top: 16px">PROFORMA INVOICE</div>
         <div style="padding-top: 8px">
           <div>PI NO. : {{ printDetails.contractCode }}</div>
           <div>PI DATE: {{ printDetails.createTimeEn }}</div>
@@ -70,55 +53,27 @@
             <div style="color: #409eff">VENDOR:</div>
             <div>{{ printDetails.sellCorporationNameEn }}</div>
             <div style="padding: 16px 0">
-              {{ printDetails.sellCountryName }},{{
-                printDetails.sellProvinceName
-              }},{{ printDetails.sellCityName }},{{
-                printDetails.sellDetailedAddress
-              }}
-            </div>
-            <div>
-              {{ printDetails.sellContactName }},{{
-                printDetails.sellContactNumber
-              }}
+              {{ printDetails.sellCountryName }},{{ printDetails.sellProvinceName }},{{ printDetails.sellCityName }},{{ printDetails.sellDetailedAddress }}
             </div>
+            <div>{{ printDetails.sellContactName }},{{ printDetails.sellContactNumber }}</div>
           </div>
           <div style="width: 50%">
             <div style="color: #409eff">BUYER:</div>
             <div>{{ printDetails.buyCorporationName }}</div>
             <div style="padding: 16px 0">
-              {{ printDetails.buyCountryName }},{{
-                printDetails.buyProvinceName
-              }},{{ printDetails.buyCityName }},{{
-                printDetails.buyDetailedAddress
-              }}
-            </div>
-            <div>
-              {{ printDetails.buyContactName }},{{
-                printDetails.buyContactNumber
-              }}
+              {{ printDetails.buyCountryName }},{{ printDetails.buyProvinceName }},{{ printDetails.buyCityName }},{{ printDetails.buyDetailedAddress }}
             </div>
+            <div>{{ printDetails.buyContactName }},{{ printDetails.buyContactNumber }}</div>
           </div>
         </div>
         <div style="height: 16px"></div>
         <div style="border: 1px solid black">
           <div style="display: flex; width: 100%">
-            <div
-              style="
-                width: 33%;
-                border-bottom: 1px solid black;
-                border-right: 1px solid black;
-              "
-            >
+            <div style="width: 33%; border-bottom: 1px solid black; border-right: 1px solid black">
               <div style="color: #409eff">COUNTRY OF ORIGIN:</div>
               <div>{{ printDetails.sellCountryName }}</div>
             </div>
-            <div
-              style="
-                width: 34%;
-                border-bottom: 1px solid black;
-                border-right: 1px solid black;
-              "
-            >
+            <div style="width: 34%; border-bottom: 1px solid black; border-right: 1px solid black">
               <div style="color: #409eff">COUNTRY OF DESTINATION:</div>
               <div>{{ printDetails.buyCountryName }}</div>
             </div>
@@ -128,25 +83,13 @@
             </div>
           </div>
           <div style="display: flex; width: 100%">
-            <div
-              style="
-                width: 33%;
-                border-bottom: 1px solid black;
-                border-right: 1px solid black;
-              "
-            >
+            <div style="width: 33%; border-bottom: 1px solid black; border-right: 1px solid black">
               <div style="color: #409eff">TERMS OF DELIVERY:</div>
               <div>
                 {{ dictValueLabel(printDetails.tradeMethods, tradeMethods) }}
               </div>
             </div>
-            <div
-              style="
-                width: 34%;
-                border-bottom: 1px solid black;
-                border-right: 1px solid black;
-              "
-            >
+            <div style="width: 34%; border-bottom: 1px solid black; border-right: 1px solid black">
               <div style="color: #409eff">CURRENCY:</div>
               <div>
                 {{ dictValueLabel(printDetails.currency, accountCurrency) }}
@@ -155,9 +98,7 @@
             <div style="width: 33%; border-bottom: 1px solid black">
               <div style="color: #409eff">EXPORT BY/VIA:</div>
               <div>
-                {{
-                  dictValueLabel(printDetails.transportMethod, shippingMethod)
-                }}
+                {{ dictValueLabel(printDetails.transportMethod, shippingMethod) }}
               </div>
             </div>
           </div>
@@ -174,47 +115,19 @@
         </div>
         <div style="height: 16px"></div>
         <div class="baseRow" style="display: flex; color: #409eff">
-          <div class="contentRow" style="width: 50px; text-align: center">
-            NO.
-          </div>
-          <div
-            class="contentRow"
-            style="width: calc(100% - 450px); text-align: center"
-          >
-            COMMODITY, SPECIFICATION
-          </div>
-          <div class="contentRow" style="width: 100px; text-align: center">
-            UNIT
-          </div>
-          <div class="contentRow" style="width: 100px; text-align: center">
-            QUANTITY
-          </div>
-          <div class="contentRow" style="width: 100px; text-align: center">
-            UNIT PRICE
-          </div>
-          <div class="contentRow" style="width: 100px; text-align: center">
-            TOTAL PRICE
-          </div>
+          <div class="contentRow" style="width: 50px; text-align: center">NO.</div>
+          <div class="contentRow" style="width: calc(100% - 450px); text-align: center">COMMODITY, SPECIFICATION</div>
+          <div class="contentRow" style="width: 100px; text-align: center">UNIT</div>
+          <div class="contentRow" style="width: 100px; text-align: center">QUANTITY</div>
+          <div class="contentRow" style="width: 100px; text-align: center">UNIT PRICE</div>
+          <div class="contentRow" style="width: 100px; text-align: center">TOTAL PRICE</div>
         </div>
-        <div
-          v-if="
-            printDetails.productInfoList &&
-            printDetails.productInfoList.length > 0
-          "
-        >
-          <div
-            class="baseRow"
-            style="display: flex"
-            v-for="(item, index) in printDetails.productInfoList"
-            :key="item.productId"
-          >
+        <div v-if="printDetails.productInfoList && printDetails.productInfoList.length > 0">
+          <div class="baseRow" style="display: flex" v-for="(item, index) in printDetails.productInfoList" :key="item.productId">
             <div class="contentRow" style="width: 50px; text-align: center">
               {{ index + 1 }}
             </div>
-            <div
-              class="contentRow"
-              style="width: calc(100% - 450px); text-align: center"
-            >
+            <div class="contentRow" style="width: calc(100% - 450px); text-align: center">
               {{ item.productName }}
             </div>
             <div class="contentRow" style="width: 100px; text-align: center">
@@ -232,23 +145,12 @@
           </div>
         </div>
         <div class="baseRow" style="display: flex; color: #409eff">
-          <div
-            class="contentRow"
-            style="width: calc(100% - 400px); text-align: center"
-          >
-            SUBTOTAL:
-          </div>
-          <div
-            class="contentRow"
-            style="width: 100px; text-align: center"
-          ></div>
+          <div class="contentRow" style="width: calc(100% - 400px); text-align: center">SUBTOTAL:</div>
+          <div class="contentRow" style="width: 100px; text-align: center"></div>
           <div class="contentRow" style="width: 100px; text-align: center">
             {{ statistics("productQuantity", 0) }}
           </div>
-          <div
-            class="contentRow"
-            style="width: 100px; text-align: center"
-          ></div>
+          <div class="contentRow" style="width: 100px; text-align: center"></div>
           <div class="contentRow" style="width: 100px; text-align: center">
             {{ statistics("amount", 2) }}
           </div>
@@ -260,27 +162,14 @@
           </div>
         </div> -->
         <div class="baseRow" style="display: flex">
-          <div
-            class="contentRow"
-            style="width: calc(100% - 100px); text-align: right; color: #409eff"
-          >
-            TOTAL PRICE:
-          </div>
+          <div class="contentRow" style="width: calc(100% - 100px); text-align: right; color: #409eff">TOTAL PRICE:</div>
           <div class="contentRow" style="width: 100px; text-align: center">
             {{ statistics("amount", 2) }}
           </div>
         </div>
-        <div
-          class="baseRow"
-          style="display: flex; border-bottom: 1px solid black"
-        >
+        <div class="baseRow" style="display: flex; border-bottom: 1px solid black">
           <div class="contentRow" style="width: 100%">
-            {{
-              translateIntoEnglish(
-                printDetails.totalAmount,
-                printDetails.currency
-              )
-            }}
+            {{ translateIntoEnglish(printDetails.totalAmount, printDetails.currency) }}
           </div>
         </div>
         <div style="height: 16px"></div>
@@ -289,65 +178,21 @@
         </div>
         <div class="baseRow" style="border-bottom: 1px solid black">
           <div class="contentRow" style="width: 100%">
-            <div
-              style="
-                line-height: 24px;
-                padding-left: 4px;
-                word-break: break-all;
-                word-wrap: break-word;
-              "
-            >
-              Beneficiary Name: {{}}
-            </div>
-            <div
-              style="
-                line-height: 24px;
-                padding-left: 4px;
-                word-break: break-all;
-                word-wrap: break-word;
-              "
-            >
-              Beneficiary Bank: {{}}
+            <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">
+              Beneficiary Name: {{ printDetails.beneficiaryName }}
             </div>
-            <div
-              style="
-                line-height: 24px;
-                padding-left: 4px;
-                word-break: break-all;
-                word-wrap: break-word;
-              "
-            >
-              Beneficiary Bank Address: {{}}
+            <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">
+              Beneficiary Bank: {{ printDetails.beneficiaryBank }}
             </div>
-            <div
-              style="
-                line-height: 24px;
-                padding-left: 4px;
-                word-break: break-all;
-                word-wrap: break-word;
-              "
-            >
-              Beneficiary Account Number: {{}}
+            <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">
+              Beneficiary Bank Address: {{ printDetails.beneficiaryBankAddress }}
             </div>
-            <div
-              style="
-                line-height: 24px;
-                padding-left: 4px;
-                word-break: break-all;
-                word-wrap: break-word;
-              "
-            >
-              Swift Code: {{}}
+            <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">
+              Beneficiary Account Number: {{ printDetails.beneficiaryAccountNumber }}
             </div>
-            <div
-              style="
-                line-height: 24px;
-                padding-left: 4px;
-                word-break: break-all;
-                word-wrap: break-word;
-              "
-            >
-              Beneficiary Address: {{}}
+            <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">Swift Code: {{ printDetails.swiftCode }}</div>
+            <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">
+              Beneficiary Address: {{ printDetails.beneficiaryAddress }}
             </div>
           </div>
         </div>
@@ -365,9 +210,7 @@
       </div>
       <template #footer>
         <el-button @click="openPrint = false" size="large">取消</el-button>
-        <el-button type="primary" @click="clickDownload()" size="large"
-          >下载PDF</el-button
-        >
+        <el-button type="primary" @click="clickDownload()" size="large">下载PDF</el-button>
       </template>
     </el-dialog>
   </div>
@@ -593,15 +436,11 @@ const config = computed(() => {
             },
             el: "button",
             click() {
-              ElMessageBox.confirm(
-                "此操作将永久删除该数据, 是否继续?",
-                "提示",
-                {
-                  confirmButtonText: "确定",
-                  cancelButtonText: "取消",
-                  type: "warning",
-                }
-              ).then(() => {
+              ElMessageBox.confirm("此操作将永久删除该数据, 是否继续?", "提示", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning",
+              }).then(() => {
                 proxy
                   .post("/contract/edit", {
                     id: row.id,
@@ -748,12 +587,8 @@ const clickDownload = () => {
 };
 const statistics = (label, index) => {
   let num = 0;
-  if (
-    printDetails.value.productInfoList &&
-    printDetails.value.productInfoList.length > 0
-  ) {
+  if (printDetails.value.productInfoList && printDetails.value.productInfoList.length > 0) {
     printDetails.value.productInfoList.map((item) => {
-      console.log(item, label, item[label]);
       if (item[label]) {
         num = parseFloat(Number(num) + Number(item[label])).toFixed(index);
       }

+ 65 - 206
src/views/salesMange/saleContract/priceSheet/index.vue

@@ -14,8 +14,7 @@
             action: () => newPriceSheet(),
           },
         ]"
-        @get-list="getList"
-      >
+        @get-list="getList">
         <template #amount="{ item }">
           <div>
             <span style="padding-right: 4px">{{ item.currency }}</span>
@@ -31,36 +30,18 @@
     </div>
 
     <el-dialog title="打印" v-if="openPrint" v-model="openPrint" width="860">
-      <div
-        id="pdfDom"
-        style="width: 800px; padding: 16px; font-size: 12px !important"
-      >
+      <div id="pdfDom" style="width: 800px; padding: 16px; font-size: 12px !important">
         <div style="font-size: 18px; text-align: center">
-          {{
-            getLabel(printDetails.sellCorporationId, corporationList, "nameEn")
-          }}
+          {{ getLabel(printDetails.sellCorporationId, corporationList, "nameEn") }}
         </div>
         <div style="text-align: center">
-          {{ printDetails.sellCountryId }},{{ printDetails.sellProvinceId }},{{
-            printDetails.sellCityId
-          }},{{ printDetails.sellAddress }}
-        </div>
-        <div
-          style="
-            font-size: 14px;
-            color: #409eff;
-            text-align: center;
-            padding-top: 16px;
-          "
-        >
-          QUOTATION
+          {{ printDetails.sellCountryId }},{{ printDetails.sellProvinceId }},{{ printDetails.sellCityId }},{{ printDetails.sellAddress }}
         </div>
+        <div style="font-size: 14px; color: #409eff; text-align: center; padding-top: 16px">QUOTATION</div>
         <div style="padding-top: 8px">
           <div>Reference NO. : {{ printDetails.code }}</div>
           <div style="display: flex">
-            <div style="width: 50%">
-              DATE: {{ moment(printDetails.createTime).format("DD/MMM/yyyy") }}
-            </div>
+            <div style="width: 50%">DATE: {{ moment(printDetails.createTime).format("DD/MMM/yyyy") }}</div>
             <div style="width: 50%">Valid Date:</div>
           </div>
         </div>
@@ -68,64 +49,32 @@
           <div style="width: 50%; border-right: 1px solid black">
             <div style="color: #409eff">VENDOR:</div>
             <div>
-              {{
-                getLabel(
-                  printDetails.sellCorporationId,
-                  corporationList,
-                  "nameEn"
-                )
-              }}
+              {{ getLabel(printDetails.sellCorporationId, corporationList, "nameEn") }}
             </div>
             <div style="padding: 16px 0">
-              {{ printDetails.sellCountryId }},{{
-                printDetails.sellProvinceId
-              }},{{ printDetails.sellCityId }},{{ printDetails.sellAddress }}
-            </div>
-            <div>
-              {{ printDetails.sellContactName }},{{
-                printDetails.sellContactNumber
-              }}
+              {{ printDetails.sellCountryId }},{{ printDetails.sellProvinceId }},{{ printDetails.sellCityId }},{{ printDetails.sellAddress }}
             </div>
+            <div>{{ printDetails.sellContactName }},{{ printDetails.sellContactNumber }}</div>
           </div>
           <div style="width: 50%">
             <div style="color: #409eff">BUYER:</div>
             <div>
-              {{
-                getLabel(printDetails.buyCorporationId, customerList, "name")
-              }}
+              {{ getLabel(printDetails.buyCorporationId, customerList, "name") }}
             </div>
             <div style="padding: 16px 0">
-              {{ printDetails.buyCountryName }},{{
-                printDetails.buyProvinceName
-              }},{{ printDetails.buyCityName }},{{ printDetails.buyAddress }}
-            </div>
-            <div>
-              {{ printDetails.buyContactName }},{{
-                printDetails.buyContactNumber
-              }}
+              {{ printDetails.buyCountryName }},{{ printDetails.buyProvinceName }},{{ printDetails.buyCityName }},{{ printDetails.buyAddress }}
             </div>
+            <div>{{ printDetails.buyContactName }},{{ printDetails.buyContactNumber }}</div>
           </div>
         </div>
         <div style="height: 16px"></div>
         <div style="border: 1px solid black">
           <div style="display: flex; width: 100%">
-            <div
-              style="
-                width: 33%;
-                border-bottom: 1px solid black;
-                border-right: 1px solid black;
-              "
-            >
+            <div style="width: 33%; border-bottom: 1px solid black; border-right: 1px solid black">
               <div style="color: #409eff">COUNTRY OF ORIGIN:</div>
               <div>{{ printDetails.sellCountryId }}</div>
             </div>
-            <div
-              style="
-                width: 34%;
-                border-bottom: 1px solid black;
-                border-right: 1px solid black;
-              "
-            >
+            <div style="width: 34%; border-bottom: 1px solid black; border-right: 1px solid black">
               <div style="color: #409eff">COUNTRY OF DESTINATION:</div>
               <div>{{ printDetails.buyCountryName }}</div>
             </div>
@@ -135,25 +84,13 @@
             </div>
           </div>
           <div style="display: flex; width: 100%">
-            <div
-              style="
-                width: 33%;
-                border-bottom: 1px solid black;
-                border-right: 1px solid black;
-              "
-            >
+            <div style="width: 33%; border-bottom: 1px solid black; border-right: 1px solid black">
               <div style="color: #409eff">TERMS OF DELIVERY:</div>
               <div>
                 {{ dictValueLabel(printDetails.tradeMethods, tradeMethods) }}
               </div>
             </div>
-            <div
-              style="
-                width: 34%;
-                border-bottom: 1px solid black;
-                border-right: 1px solid black;
-              "
-            >
+            <div style="width: 34%; border-bottom: 1px solid black; border-right: 1px solid black">
               <div style="color: #409eff">CURRENCY:</div>
               <div>
                 {{ dictValueLabel(printDetails.currency, accountCurrency) }}
@@ -162,9 +99,7 @@
             <div style="width: 33%; border-bottom: 1px solid black">
               <div style="color: #409eff">EXPORT BY/VIA:</div>
               <div>
-                {{
-                  dictValueLabel(printDetails.transportMethod, shippingMethod)
-                }}
+                {{ dictValueLabel(printDetails.transportMethod, shippingMethod) }}
               </div>
             </div>
           </div>
@@ -180,47 +115,19 @@
         </div>
         <div style="height: 16px"></div>
         <div class="baseRow" style="display: flex; color: #409eff">
-          <div class="contentRow" style="width: 50px; text-align: center">
-            NO.
-          </div>
-          <div
-            class="contentRow"
-            style="width: calc(100% - 450px); text-align: center"
-          >
-            COMMODITY, SPECIFICATION
-          </div>
-          <div class="contentRow" style="width: 100px; text-align: center">
-            UNIT
-          </div>
-          <div class="contentRow" style="width: 100px; text-align: center">
-            QUANTITY
-          </div>
-          <div class="contentRow" style="width: 100px; text-align: center">
-            UNIT PRICE
-          </div>
-          <div class="contentRow" style="width: 100px; text-align: center">
-            TOTAL PRICE
-          </div>
+          <div class="contentRow" style="width: 50px; text-align: center">NO.</div>
+          <div class="contentRow" style="width: calc(100% - 450px); text-align: center">COMMODITY, SPECIFICATION</div>
+          <div class="contentRow" style="width: 100px; text-align: center">UNIT</div>
+          <div class="contentRow" style="width: 100px; text-align: center">QUANTITY</div>
+          <div class="contentRow" style="width: 100px; text-align: center">UNIT PRICE</div>
+          <div class="contentRow" style="width: 100px; text-align: center">TOTAL PRICE</div>
         </div>
-        <div
-          v-if="
-            printDetails.quotationProductList &&
-            printDetails.quotationProductList.length > 0
-          "
-        >
-          <div
-            class="baseRow"
-            style="display: flex"
-            v-for="(item, index) in printDetails.quotationProductList"
-            :key="item.productId"
-          >
+        <div v-if="printDetails.quotationProductList && printDetails.quotationProductList.length > 0">
+          <div class="baseRow" style="display: flex" v-for="(item, index) in printDetails.quotationProductList" :key="item.productId">
             <div class="contentRow" style="width: 50px; text-align: center">
               {{ index + 1 }}
             </div>
-            <div
-              class="contentRow"
-              style="width: calc(100% - 450px); text-align: center"
-            >
+            <div class="contentRow" style="width: calc(100% - 450px); text-align: center">
               {{ item.productName }}
             </div>
             <div class="contentRow" style="width: 100px; text-align: center">
@@ -238,73 +145,33 @@
           </div>
         </div>
         <div class="baseRow" style="display: flex; color: #409eff">
-          <div
-            class="contentRow"
-            style="width: calc(100% - 400px); text-align: center"
-          >
-            SUBTOTAL:
-          </div>
-          <div
-            class="contentRow"
-            style="width: 100px; text-align: center"
-          ></div>
+          <div class="contentRow" style="width: calc(100% - 400px); text-align: center">SUBTOTAL:</div>
+          <div class="contentRow" style="width: 100px; text-align: center"></div>
           <div class="contentRow" style="width: 100px; text-align: center">
             {{ statistics("quantity", 0) }}
           </div>
-          <div
-            class="contentRow"
-            style="width: 100px; text-align: center"
-          ></div>
+          <div class="contentRow" style="width: 100px; text-align: center"></div>
           <div class="contentRow" style="width: 100px; text-align: center">
             {{ statistics("amount", 2) }}
           </div>
         </div>
-        <div
-          v-if="
-            printDetails.quotationPayList &&
-            printDetails.quotationPayList.length > 0
-          "
-        >
-          <div
-            class="baseRow"
-            style="display: flex"
-            v-for="(item, index) in printDetails.quotationPayList"
-            :key="index"
-          >
-            <div
-              class="contentRow"
-              style="
-                width: calc(100% - 100px);
-                text-align: right;
-                color: #409eff;
-              "
-            >
-              {{ item.payName }}:
-            </div>
+        <div v-if="printDetails.quotationPayList && printDetails.quotationPayList.length > 0">
+          <div class="baseRow" style="display: flex" v-for="(item, index) in printDetails.quotationPayList" :key="index">
+            <div class="contentRow" style="width: calc(100% - 100px); text-align: right; color: #409eff">{{ item.payName }}:</div>
             <div class="contentRow" style="width: 100px; text-align: center">
               {{ item.amount }}
             </div>
           </div>
         </div>
         <div class="baseRow" style="display: flex">
-          <div
-            class="contentRow"
-            style="width: calc(100% - 100px); text-align: right; color: #409eff"
-          >
-            TOTAL PRICE:
-          </div>
+          <div class="contentRow" style="width: calc(100% - 100px); text-align: right; color: #409eff">TOTAL PRICE:</div>
           <div class="contentRow" style="width: 100px; text-align: center">
             {{ getAllMoney(statistics("amount", 2)) }}
           </div>
         </div>
-        <div
-          class="baseRow"
-          style="display: flex; border-bottom: 1px solid black"
-        >
+        <div class="baseRow" style="display: flex; border-bottom: 1px solid black">
           <div class="contentRow" style="width: 100%">
-            {{
-              translateIntoEnglish(printDetails.amount, printDetails.currency)
-            }}
+            {{ translateIntoEnglish(printDetails.amount, printDetails.currency) }}
           </div>
         </div>
         <!-- <div style="height: 16px"></div>
@@ -313,12 +180,22 @@
         </div>
         <div class="baseRow" style="border-bottom: 1px solid black">
           <div class="contentRow" style="width: 100%">
-            <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">Beneficiary Name: {{}}</div>
-            <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">Beneficiary Bank: {{}}</div>
-            <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">Beneficiary Bank Address: {{}}</div>
-            <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">Beneficiary Account Number: {{}}</div>
-            <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">Swift Code: {{}}</div>
-            <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">Beneficiary Address: {{}}</div>
+            <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">
+              Beneficiary Name: {{ printDetails.beneficiaryName }}
+            </div>
+            <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">
+              Beneficiary Bank: {{ printDetails.beneficiaryBank }}
+            </div>
+            <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">
+              Beneficiary Bank Address: {{ printDetails.beneficiaryBankAddress }}
+            </div>
+            <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">
+              Beneficiary Account Number: {{ printDetails.beneficiaryAccountNumber }}
+            </div>
+            <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">Swift Code: {{ printDetails.swiftCode }}</div>
+            <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">
+              Beneficiary Address: {{ printDetails.beneficiaryAddress }}
+            </div>
           </div>
         </div> -->
         <div style="height: 32px"></div>
@@ -326,30 +203,20 @@
           <div style="width: 50%">
             <div style="color: #409eff">CONFIRMED BY VENDOR:</div>
             <div>
-              {{
-                getLabel(
-                  printDetails.sellCorporationId,
-                  corporationList,
-                  "nameEn"
-                )
-              }}
+              {{ getLabel(printDetails.sellCorporationId, corporationList, "nameEn") }}
             </div>
           </div>
           <div style="width: 50%">
             <div style="color: #409eff">CONFIRMED BY BUYER:</div>
             <div>
-              {{
-                getLabel(printDetails.buyCorporationId, customerList, "name")
-              }}
+              {{ getLabel(printDetails.buyCorporationId, customerList, "name") }}
             </div>
           </div>
         </div>
       </div>
       <template #footer>
         <el-button @click="openPrint = false" size="large">取消</el-button>
-        <el-button type="primary" @click="clickDownload()" size="large"
-          >下载PDF</el-button
-        >
+        <el-button type="primary" @click="clickDownload()" size="large">下载PDF</el-button>
       </template>
     </el-dialog>
   </div>
@@ -446,7 +313,7 @@ const config = computed(() => {
       attrs: {
         label: "报价人",
         prop: "userName",
-        width: 120,
+        width: 160,
       },
     },
     {
@@ -541,16 +408,14 @@ const config = computed(() => {
   ];
 });
 const getDict = () => {
-  proxy
-    .post("/saleQuotation/page", { pageNum: 1, pageSize: 999 })
-    .then((res) => {
-      accountList.value = res.rows.map((item) => {
-        return {
-          label: item.alias,
-          value: item.id,
-        };
-      });
+  proxy.post("/saleQuotation/page", { pageNum: 1, pageSize: 999 }).then((res) => {
+    accountList.value = res.rows.map((item) => {
+      return {
+        label: item.alias,
+        value: item.id,
+      };
     });
+  });
   proxy.post("/corporation/page", { pageNum: 1, pageSize: 999 }).then((res) => {
     corporationList.value = res.rows.map((item) => {
       return {
@@ -650,7 +515,7 @@ const clickCopy = (item) => {
     query: {
       flowKey: "sale_quotation_flow",
       flowName: "报价审批流程",
-      id: item.id,
+      priceSheetId: item.id,
       random: proxy.random(),
     },
   });
@@ -669,10 +534,7 @@ const clickDownload = () => {
 };
 const statistics = (label, index) => {
   let num = 0;
-  if (
-    printDetails.value.quotationProductList &&
-    printDetails.value.quotationProductList.length > 0
-  ) {
+  if (printDetails.value.quotationProductList && printDetails.value.quotationProductList.length > 0) {
     printDetails.value.quotationProductList.map((item) => {
       if (item[label]) {
         num = parseFloat(Number(num) + Number(item[label])).toFixed(index);
@@ -693,10 +555,7 @@ const getLabel = (key, list, label) => {
 };
 const getAllMoney = (num) => {
   let money = num;
-  if (
-    printDetails.value.quotationPayList &&
-    printDetails.value.quotationPayList.length > 0
-  ) {
+  if (printDetails.value.quotationPayList && printDetails.value.quotationPayList.length > 0) {
     printDetails.value.quotationPayList.map((item) => {
       if (item.amount) {
         money = parseFloat(Number(money) + Number(item.amount)).toFixed(2);

+ 21 - 9
src/views/salesMange/shipmentMange/document/index.vue

@@ -468,12 +468,24 @@
           </div>
           <div class="baseRow" style="border-bottom: 1px solid black">
             <div class="contentRow" style="width: 100%">
-              <div style="line-height: 20px; padding-left: 4px; word-break: break-all; word-wrap: break-word">Beneficiary Name: {{}}</div>
-              <div style="line-height: 20px; padding-left: 4px; word-break: break-all; word-wrap: break-word">Beneficiary Bank: {{}}</div>
-              <div style="line-height: 20px; padding-left: 4px; word-break: break-all; word-wrap: break-word">Beneficiary Bank Address: {{}}</div>
-              <div style="line-height: 20px; padding-left: 4px; word-break: break-all; word-wrap: break-word">Beneficiary Account Number: {{}}</div>
-              <div style="line-height: 20px; padding-left: 4px; word-break: break-all; word-wrap: break-word">Swift Code: {{}}</div>
-              <div style="line-height: 20px; padding-left: 4px; word-break: break-all; word-wrap: break-word">Beneficiary Address: {{}}</div>
+              <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">
+                Beneficiary Name: {{ printDetails.contract.beneficiaryName }}
+              </div>
+              <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">
+                Beneficiary Bank: {{ printDetails.contract.beneficiaryBank }}
+              </div>
+              <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">
+                Beneficiary Bank Address: {{ printDetails.contract.beneficiaryBankAddress }}
+              </div>
+              <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">
+                Beneficiary Account Number: {{ printDetails.contract.beneficiaryAccountNumber }}
+              </div>
+              <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">
+                Swift Code: {{ printDetails.contract.swiftCode }}
+              </div>
+              <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">
+                Beneficiary Address: {{ printDetails.contract.beneficiaryAddress }}
+              </div>
             </div>
           </div>
           <div style="height: 32px"></div>
@@ -1393,9 +1405,9 @@ const clickDownload = () => {
     proxy.getPdf("销售确认书PDF文件");
   } else if (openStatus.value === 4) {
     textShow.value = true;
-    let data = JSON.parse(JSON.stringify(printCustomsDeclaration.value))
-    data.content = JSON.stringify(data.content)
-    proxy.post('/documentsPdf/add', data).then();
+    let data = JSON.parse(JSON.stringify(printCustomsDeclaration.value));
+    data.content = JSON.stringify(data.content);
+    proxy.post("/documentsPdf/add", data).then();
     setTimeout(() => {
       proxy.getPdfTransverseA4("报关单PDF文件");
       nextTick(() => {

部分文件因文件數量過多而無法顯示