|
@@ -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">
|
|
|
+ <el-table-column label="单价" width="140">
|
|
|
<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">
|
|
|
- <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,
|
|
|
- })
|
|
|
- .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,
|
|
|
- })
|
|
|
+ .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) {
|
|
|
- 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,7 +814,7 @@ const handleSubmit = async () => {
|
|
|
};
|
|
|
// 接收父组件的传值
|
|
|
const props = defineProps({
|
|
|
- queryData: String,
|
|
|
+ queryData: Object,
|
|
|
});
|
|
|
onMounted(() => {
|
|
|
if (props.queryData.id) {
|
|
@@ -838,6 +845,12 @@ onMounted(() => {
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
+const clickCustomerProduct = () => {
|
|
|
+ if (!formData.data.buyCorporationId) {
|
|
|
+ return ElMessage("请先选择客户");
|
|
|
+ }
|
|
|
+ openProductCustomer.value = true;
|
|
|
+};
|
|
|
// 向父组件暴露
|
|
|
defineExpose({
|
|
|
submitData: formData.data,
|
|
@@ -856,4 +869,7 @@ defineExpose({
|
|
|
cursor: pointer;
|
|
|
vertical-align: middle;
|
|
|
}
|
|
|
+.shrinkPadding {
|
|
|
+ padding-right: 0 !important;
|
|
|
+}
|
|
|
</style>
|