|
@@ -0,0 +1,1277 @@
|
|
|
+<template>
|
|
|
+ <div style="width: 100%; padding: 0px 15px">
|
|
|
+ <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="formDom">
|
|
|
+ <template #btn>
|
|
|
+ <div>
|
|
|
+ <el-button type="primary" v-if="
|
|
|
+ [30].includes(route.query.processType) || !route.query.processType
|
|
|
+ " @click="clickCopy(1)">复制合同</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template #seller>
|
|
|
+ <div style="width: 100%">
|
|
|
+ <el-form-item prop="sellCorporationId" label="卖方信息" class="wid100">
|
|
|
+ <el-select v-model="formData.data.sellCorporationId" placeholder="请选择卖方公司" style="width: 100%" @change="sellCorporationIdChange"
|
|
|
+ filterable>
|
|
|
+ <el-option v-for="item in corporationList" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="地址" class="wid100">
|
|
|
+ <el-row style="width:100%">
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="" prop="sellCountryName" label-width="0px" class="margin-b-0 wid100">
|
|
|
+ <el-input v-model="formData.data.sellCountryName" placeholder="请输入国家" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="" prop="sellProvinceName" label-width="0px" class="margin-b-0 wid100">
|
|
|
+ <el-input v-model="formData.data.sellProvinceName" placeholder="请输入省/州" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="" prop="sellCityName" label-width="0px" class="margin-b-0 wid100">
|
|
|
+ <el-input v-model="formData.data.sellCityName" placeholder="请输入城市" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="详细地址" prop="sellAddress" class="wid100">
|
|
|
+ <el-input v-model="formData.data.sellAddress" type="textarea">
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="联系人" class="wid100">
|
|
|
+ <el-row style="width:100%">
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="" prop="sellContactName" label-width="0px" class="margin-b-0 wid100">
|
|
|
+ <el-input v-model="formData.data.sellContactName" placeholder="请输入联系人" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="16">
|
|
|
+ <el-form-item label="" prop="sellContactNumber" label-width="0px" class="margin-b-0 wid100">
|
|
|
+ <el-input v-model="formData.data.sellContactNumber" placeholder="请输入联系人电话" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template #buyer>
|
|
|
+ <div style="width: 100%">
|
|
|
+ <el-form-item label="买方信息" prop="buyCorporationId" class="wid100">
|
|
|
+ <el-select v-model="formData.data.buyCorporationId" filterable remote reserve-keyword placeholder="请输入关键字" remote-show-suffix
|
|
|
+ :remote-method="remoteMethod" :loading="loadingSearch" @input="remoteMethod" style="width: 100%" @change="changeCustomer" v-if="
|
|
|
+ [30].includes(route.query.processType) ||
|
|
|
+ !route.query.processType
|
|
|
+ ">
|
|
|
+ <el-option v-for="item in customerList" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
+ </el-select>
|
|
|
+ <el-select v-model="formData.data.buyCorporationName" disabled v-else style="width: 100%">
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="地址" class="wid100" required>
|
|
|
+ <el-row style="width: 100%">
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="" prop="countryId" class="margin-b-0">
|
|
|
+ <el-select v-model="formData.data.countryId" placeholder="国家" filterable @change="(val) => getCityData(val, '20', true)">
|
|
|
+ <el-option v-for="item in countryData" :label="item.name" :value="item.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="" prop="provinceName" class="margin-b-0">
|
|
|
+ <selectCity placeholder="省/洲" @change="(val) => getCityData(val, '30', true)" addressId="provinceId" addressName="provinceName"
|
|
|
+ v-model="formData.data" :data="provinceData">
|
|
|
+ </selectCity>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="" prop="cityName" class="margin-b-0">
|
|
|
+ <selectCity placeholder="城市" addressId="cityId" addressName="cityName" v-model="formData.data" :data="cityData">
|
|
|
+ </selectCity>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="" prop="buyPostalCode" class="margin-b-0">
|
|
|
+ <el-input v-model="formData.data.buyPostalCode" placeholder="请输入邮编" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="详细地址" prop="buyAddress" class="wid100">
|
|
|
+ <el-input v-model="formData.data.buyAddress" type="textarea">
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="联系人" class="wid100" required>
|
|
|
+ <el-row style="width: 100%">
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="" prop="buyContactName" label-width="0px" class="margin-b-0 wid100">
|
|
|
+ <el-autocomplete v-model="formData.data.buyContactName" :fetch-suggestions="querySearchPerson" style="width:100%" 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" label-width="0px" class="margin-b-0 wid100">
|
|
|
+ <el-input v-model="formData.data.buyContactNumber" placeholder="请输入联系人电话" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template #commodity>
|
|
|
+ <div style="width: 100%">
|
|
|
+ <el-button type="primary" @click="openProductCompany = true" plain style="margin-bottom: 16px" v-if="!judgeStatus()">标准产品库</el-button>
|
|
|
+ <el-table :data="formData.data.quotationProductList" style="width: 100%; ">
|
|
|
+ <el-table-column label="商品图片" width="80">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <div v-if="row.fileUrl">
|
|
|
+ <img :src="row.fileUrl" class="pic" @click="onPicture(row.fileUrl)" />
|
|
|
+ </div>
|
|
|
+ <div v-else></div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="productCnName" label="商品名称" min-width="130" />
|
|
|
+ <el-table-column prop="productCode" label="商品编码" width="130" />
|
|
|
+ <el-table-column label="尺寸 cm*cm*cm" width="180">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <div style="width: 100%">
|
|
|
+ {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="设计图稿" width="80">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <div style="width: 100%">
|
|
|
+ <el-upload action="https://winfaster.obs.cn-south-1.myhuaweicloud.com" accept=".gif, .jpeg, .jpg, .png" :show-file-list="false"
|
|
|
+ :data="uploadData" :before-upload="(file)=>handleBeforeUpload(file,$index)" :on-success="()=>handleSuccess($index)">
|
|
|
+ <img v-if="row.imageUrl" :src="row.imageUrl" class="pic" />
|
|
|
+ <el-icon v-else class="avatar-uploader-icon">
|
|
|
+ <Plus />
|
|
|
+ </el-icon>
|
|
|
+ </el-upload>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="生产源文件" width="140">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <!-- <span class="el-click" v-if="!row.prodFilePath" @click="handleClickUpload('prodFilePath',false)">点击</span> -->
|
|
|
+ <span class="el-click" v-if="row.prodFilePath" @click="handleClickUpload('prodFilePath',false,$index)">点击上传 (查看)</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="数量" width="150">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <div style="width: 100%">
|
|
|
+ <el-form-item :prop="'quotationProductList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true"
|
|
|
+ class="margin-b-0 wid100">
|
|
|
+ <el-input-number onmousewheel="return false;" v-model="row.quantity" placeholder="请输入" style="width: 100%" :precision="0"
|
|
|
+ :controls="false" :min="0" @change="calculationAmount('quantity')" />
|
|
|
+ </el-form-item>
|
|
|
+ </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 + '.price'" :rules="rules.price" :inline-message="true"
|
|
|
+ class="margin-b-0 wid100">
|
|
|
+ <div style="display:flex;">
|
|
|
+ <el-input-number onmousewheel="return false;" v-model="row.price" placeholder="请输入" style="width: 100%" :precision="2"
|
|
|
+ :controls="false" :min="0" @change="calculationAmount()" />
|
|
|
+ <!-- <el-popover placement="top-start" :width="400" trigger="hover" @show="showEcharts(row,$index)">
|
|
|
+ <template #default>
|
|
|
+ <div>
|
|
|
+ <div>
|
|
|
+ <img src="@/assets/images/money1.png" alt="" class="img" /> <span
|
|
|
+ style="font-size:14px;font-weight:700;color:#000">销售指导价:</span>
|
|
|
+ <div style="padding:5px 0px 0px 20px">
|
|
|
+ {{row.currency}} {{moneyFormat(row.salePrice,2)}}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div style="margin-top:15px">
|
|
|
+ <img src="@/assets/images/money2.png" alt="" class="img" /> <span
|
|
|
+ style="font-size:14px;font-weight:700;color:#000">客户近期购买价格:</span>
|
|
|
+ <div style="padding:5px 0px 0px 20px">
|
|
|
+ <div v-for="item in row.customerContractProductList">
|
|
|
+ <span>{{item.createTime.slice(0,10)}} </span>
|
|
|
+ <span style="margin-left:40px">{{item.code}} </span>
|
|
|
+ <span style="margin-left:40px"> {{item.currency}} {{moneyFormat(item.price,2)}} </span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div style="margin-top:15px">
|
|
|
+ <img src="@/assets/images/money3.png" alt="" class="img" /> <span
|
|
|
+ style="font-size:14px;font-weight:700;color:#000">产品近期销售价格:</span>
|
|
|
+ <div style="padding:5px 0px 0px 20px">
|
|
|
+ <div v-for="item in row.quotationProductList">
|
|
|
+ <span>{{item.createTime.slice(0,10)}} </span>
|
|
|
+ <span style="margin-left:40px">{{item.code}} </span>
|
|
|
+ <span style="margin-left:40px">{{item.currency}} {{moneyFormat(item.price,2)}} </span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div :ref="row.productId+$index" style="height:180px">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template #reference>
|
|
|
+ <div style="margin-left:10px;cursor:pointer;position:relative;top:4px">
|
|
|
+ <el-icon :size="20" color="#85c1a6">
|
|
|
+ <WarningFilled />
|
|
|
+ </el-icon>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-popover> -->
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="amount" label="小计" width="120" />
|
|
|
+ <el-table-column label="操作" width="120" align="center" fixed="right" v-if="!judgeStatus()">
|
|
|
+ <template #default="{ $index }">
|
|
|
+ <el-button type="primary" link @click="handleClickUpload('prodFilePath',true,$index)">重置</el-button>
|
|
|
+ <el-button type="primary" link @click="handleRemove($index)">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template #otherCharge>
|
|
|
+ <div style="width: 100%">
|
|
|
+ <el-button type="primary" @click="clickAdd()" plain style="margin-bottom: 16px" v-if="!judgeStatus()">添加行</el-button>
|
|
|
+ <el-table :data="formData.data.quotationPayList" style="width: 100%;">
|
|
|
+ <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"
|
|
|
+ class="margin-b-0 wid100">
|
|
|
+ <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'" class="margin-b-0 wid100">
|
|
|
+ <el-input v-model="row.remark" 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="'quotationPayList.' + $index + '.amount'" :rules="rules.amount" :inline-message="true"
|
|
|
+ class="margin-b-0 wid100">
|
|
|
+ <el-input-number onmousewheel="return false;" 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" v-if="!judgeStatus()">
|
|
|
+ <template #default="{ $index }">
|
|
|
+ <el-button type="primary" link @click="handleDelete($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>
|
|
|
+ <!-- <SelectCompanyProduct @selectProduct="selectProduct" :alreadySelectData="formData.data.quotationProductList"></SelectCompanyProduct> -->
|
|
|
+ <SelectProduct @selectProduct="selectProduct"></SelectProduct>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!-- <el-dialog v-if="copyContract" v-model="copyContract" :title="copyType === 1 ? '合同选择' : '样品单选择'" width="90%" append-to-body>
|
|
|
+ <SelectContract @select="selectContract" v-if="copyType === 1"></SelectContract>
|
|
|
+ <SelectSample @select="selectContract" v-if="copyType === 2"></SelectSample>
|
|
|
+ </el-dialog> -->
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+import byForm from "@/components/byForm/index";
|
|
|
+import SelectCompanyProduct from "@/components/product/SelectCompanyProduct.vue";
|
|
|
+import SelectProduct from "@/components/product/SelectProduct.vue";
|
|
|
+
|
|
|
+// import SelectCustomerProduct from "@/components/product/SelectCustomerProduct.vue";
|
|
|
+import selectCity from "@/components/selectCity/index.vue";
|
|
|
+import { useRoute } from "vue-router";
|
|
|
+import SelectContract from "@/components/contractCom/selectContract.vue";
|
|
|
+import SelectSample from "@/components/contractCom/selectSample.vue";
|
|
|
+// import * as echarts from "echarts";
|
|
|
+// import $bus from "@/bus/index.js";
|
|
|
+const route = useRoute();
|
|
|
+const { proxy } = getCurrentInstance();
|
|
|
+// 接收父组件的传值
|
|
|
+const props = defineProps({
|
|
|
+ queryData: Object,
|
|
|
+});
|
|
|
+const currencyData = computed(
|
|
|
+ () => proxy.useUserStore().allDict["account_currency"]
|
|
|
+);
|
|
|
+const fundsPaymentMethod = computed(
|
|
|
+ () => proxy.useUserStore().allDict["funds_payment_method"]
|
|
|
+);
|
|
|
+const shippingMethod = computed(
|
|
|
+ () => proxy.useUserStore().allDict["shipping_method"]
|
|
|
+);
|
|
|
+const accountList = ref([]);
|
|
|
+const customerList = ref([]);
|
|
|
+const corporationList = ref([]);
|
|
|
+const customerUserList = ref([]);
|
|
|
+const countryData = ref([]);
|
|
|
+const provinceData = ref([]);
|
|
|
+const cityData = ref([]);
|
|
|
+const openProductCompany = ref(false);
|
|
|
+const copyType = ref(1);
|
|
|
+const copyContract = ref(false);
|
|
|
+const formData = reactive({
|
|
|
+ data: {
|
|
|
+ contractType: "2",
|
|
|
+ rate: 1,
|
|
|
+ quotationProductList: [],
|
|
|
+ },
|
|
|
+});
|
|
|
+const uploadData = ref({});
|
|
|
+const formDom = ref(null);
|
|
|
+const judgeStatus = () => {
|
|
|
+ if (route.query.processType == 20 || route.query.processType == 10) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ if (props.queryData.recordList && props.queryData.recordList.length > 0) {
|
|
|
+ let data = props.queryData.recordList.filter(
|
|
|
+ (item) => item.status === 2 && item.nodeType !== 1
|
|
|
+ );
|
|
|
+ if (data && data.length > 0) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+};
|
|
|
+const formOption = reactive({
|
|
|
+ inline: true,
|
|
|
+ labelWidth: 100,
|
|
|
+ itemWidth: 100,
|
|
|
+ disabled: false,
|
|
|
+});
|
|
|
+const formConfig = computed(() => {
|
|
|
+ return [
|
|
|
+ // {
|
|
|
+ // type: "slot",
|
|
|
+ // slotName: "btn",
|
|
|
+ // label: "",
|
|
|
+ // itemWidth: 50,
|
|
|
+ // },
|
|
|
+ {
|
|
|
+ type: "title",
|
|
|
+ title: "合同类型",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "select",
|
|
|
+ prop: "contractType",
|
|
|
+ label: "合同类型",
|
|
|
+ data: [
|
|
|
+ {
|
|
|
+ dictKey: "2",
|
|
|
+ dictValue: "内销",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dictKey: "1",
|
|
|
+ dictValue: "外销",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ fn: (val) => {
|
|
|
+ if (val == "2") {
|
|
|
+ formData.data.currency = currencyData.value[0].dictKey;
|
|
|
+ formData.data.rate = 1;
|
|
|
+ }
|
|
|
+ if (formData.data.sellCorporationId) {
|
|
|
+ sellCorporationIdChange(formData.data.sellCorporationId);
|
|
|
+ }
|
|
|
+ if (formData.data.shroffAccountId) {
|
|
|
+ changeShroffAccount(formData.data.shroffAccountId);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "title",
|
|
|
+ title: "贸易信息",
|
|
|
+ haveLine: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "slot",
|
|
|
+ slotName: "seller",
|
|
|
+ label: "",
|
|
|
+ itemWidth: 50,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "slot",
|
|
|
+ slotName: "buyer",
|
|
|
+ label: "",
|
|
|
+ itemWidth: 50,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "title",
|
|
|
+ title: "付款信息",
|
|
|
+ haveLine: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "select",
|
|
|
+ prop: "currency",
|
|
|
+ label: "币种",
|
|
|
+ data: currencyData.value,
|
|
|
+ itemWidth: 25,
|
|
|
+ disabled: formData.data.contractType == "2",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "number",
|
|
|
+ prop: "rate",
|
|
|
+ label: "汇率",
|
|
|
+ precision: 2,
|
|
|
+ min: 0,
|
|
|
+ controls: false,
|
|
|
+ itemWidth: 25,
|
|
|
+ disabled: formData.data.contractType == "2",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "select",
|
|
|
+ prop: "paymentMethod",
|
|
|
+ label: "付款方式",
|
|
|
+ data: fundsPaymentMethod.value,
|
|
|
+ itemWidth: 25,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "number",
|
|
|
+ prop: "advanceRatio",
|
|
|
+ label: "预付款比列(%)",
|
|
|
+ precision: 2,
|
|
|
+ min: 0,
|
|
|
+ controls: false,
|
|
|
+ itemWidth: 25,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "remark",
|
|
|
+ label: "付款条件",
|
|
|
+ itemType: "textarea",
|
|
|
+ itemWidth: 50,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "select",
|
|
|
+ prop: "shroffAccountId",
|
|
|
+ label: "收款账号",
|
|
|
+ data: accountList.value,
|
|
|
+ itemWidth: 100,
|
|
|
+ fn: (val) => {
|
|
|
+ changeShroffAccount(val);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "beneficiaryName",
|
|
|
+ label: " ",
|
|
|
+ placeholder: "请输入Beneficiary Name",
|
|
|
+ itemWidth: 50,
|
|
|
+ isShow: formData.data.contractType == "1",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "beneficiaryAccountNumber",
|
|
|
+ label: " ",
|
|
|
+ placeholder: "请输入Beneficiary Account Number",
|
|
|
+ itemWidth: 50,
|
|
|
+ isShow: formData.data.contractType == "1",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "beneficiaryBank",
|
|
|
+ label: " ",
|
|
|
+ placeholder: "请输入Beneficiary Bank",
|
|
|
+ itemWidth: 50,
|
|
|
+ isShow: formData.data.contractType == "1",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "swiftCode",
|
|
|
+ label: " ",
|
|
|
+ placeholder: "请输入Swift Code",
|
|
|
+ itemWidth: 50,
|
|
|
+ isShow: formData.data.contractType == "1",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "beneficiaryBankAddress",
|
|
|
+ label: " ",
|
|
|
+ placeholder: "请输入Beneficiary Bank Address",
|
|
|
+ itemWidth: 50,
|
|
|
+ isShow: formData.data.contractType == "1",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "beneficiaryAddress",
|
|
|
+ label: " ",
|
|
|
+ placeholder: "请输入Beneficiary Address",
|
|
|
+ itemWidth: 50,
|
|
|
+ isShow: formData.data.contractType == "1",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "accountName",
|
|
|
+ label: "户名",
|
|
|
+ placeholder: "请输入户名",
|
|
|
+ itemWidth: 50,
|
|
|
+ isShow: formData.data.contractType == "2",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "openingBank",
|
|
|
+ label: "开户行",
|
|
|
+ placeholder: "请输入开户行",
|
|
|
+ itemWidth: 50,
|
|
|
+ isShow: formData.data.contractType == "2",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "accountOpening",
|
|
|
+ label: "账号",
|
|
|
+ placeholder: "请输入账号",
|
|
|
+ itemWidth: 50,
|
|
|
+ isShow: formData.data.contractType == "2",
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // type: "slot",
|
|
|
+ // slotName: "payment",
|
|
|
+ // label: "",
|
|
|
+ // },
|
|
|
+ {
|
|
|
+ type: "title",
|
|
|
+ title: "交付信息",
|
|
|
+ haveLine: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "date",
|
|
|
+ prop: "deliveryTime",
|
|
|
+ label: "交货期限",
|
|
|
+ itemWidth: 50,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "select",
|
|
|
+ prop: "transportMethod",
|
|
|
+ label: "运输方式",
|
|
|
+ data: shippingMethod.value,
|
|
|
+ itemWidth: 50,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "transportRemark",
|
|
|
+ label: "运输说明",
|
|
|
+ itemWidth: 50,
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // type: "slot",
|
|
|
+ // slotName: "delivery",
|
|
|
+ // label: "",
|
|
|
+ // },
|
|
|
+ {
|
|
|
+ type: "title",
|
|
|
+ title: "商品信息",
|
|
|
+ haveLine: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "slot",
|
|
|
+ slotName: "commodity",
|
|
|
+ label: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "title",
|
|
|
+ title: "其他收费项目",
|
|
|
+ haveLine: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "slot",
|
|
|
+ slotName: "otherCharge",
|
|
|
+ label: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "title",
|
|
|
+ title: "合同总金额",
|
|
|
+ haveLine: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "amount",
|
|
|
+ label: "合同总金额",
|
|
|
+ itemWidth: 25,
|
|
|
+ disabled: true,
|
|
|
+ },
|
|
|
+ ];
|
|
|
+});
|
|
|
+const rules = ref({
|
|
|
+ contractType: [
|
|
|
+ { required: true, message: "请选择合同类型", trigger: "change" },
|
|
|
+ ],
|
|
|
+ sellCorporationId: [
|
|
|
+ { required: true, message: "请选择卖方公司", trigger: "change" },
|
|
|
+ ],
|
|
|
+ buyCorporationId: [
|
|
|
+ { required: true, message: "请选择买方公司", trigger: "change" },
|
|
|
+ ],
|
|
|
+ countryId: [{ required: true, message: "请选择国家", trigger: "change" }],
|
|
|
+ sellAddress: [{ required: true, message: "请输入详细地址", trigger: "blur" }],
|
|
|
+ buyAddress: [{ required: true, message: "请输入详细地址", trigger: "blur" }],
|
|
|
+ buyContactName: [
|
|
|
+ { required: true, message: "请输入联系人", trigger: ["change", "blur"] },
|
|
|
+ ],
|
|
|
+ buyContactNumber: [
|
|
|
+ { required: true, message: "请输入联系电话", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ quantity: [{ required: true, message: "请输入数量", trigger: "blur" }],
|
|
|
+ price: [{ required: true, message: "请输入单价", trigger: "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" },
|
|
|
+ ],
|
|
|
+ transportMethod: [
|
|
|
+ { required: true, message: "请选择运输方式", trigger: "change" },
|
|
|
+ ],
|
|
|
+ remark: [{ required: true, message: "请输入付款条件", trigger: "blur" }],
|
|
|
+ rate: [{ required: true, message: "请输入汇率", trigger: "blur" }],
|
|
|
+ shroffAccountId: [
|
|
|
+ { required: true, message: "请选择收款账号", trigger: "change" },
|
|
|
+ ],
|
|
|
+});
|
|
|
+const getDict = () => {
|
|
|
+ proxy
|
|
|
+ .post("/customer/selPage", {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 50,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ customerList.value = res.rows.map((x) => ({
|
|
|
+ ...x,
|
|
|
+ label: x.name,
|
|
|
+ value: x.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("/accountManagement/page", { pageNum: 1, pageSize: 999 })
|
|
|
+ .then((res) => {
|
|
|
+ accountList.value = res.rows.map((item) => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ label: item.alias,
|
|
|
+ value: item.id,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ });
|
|
|
+};
|
|
|
+const getCityData = (id, type, isChange) => {
|
|
|
+ proxy.post("/customizeArea/list", { parentId: id }).then((res) => {
|
|
|
+ if (type === "20") {
|
|
|
+ provinceData.value = res;
|
|
|
+ if (isChange) {
|
|
|
+ formData.data.provinceId = "";
|
|
|
+ formData.data.provinceName = "";
|
|
|
+ formData.data.cityId = "";
|
|
|
+ formData.data.cityName = "";
|
|
|
+ }
|
|
|
+ } else if (type === "30") {
|
|
|
+ cityData.value = res;
|
|
|
+ if (isChange) {
|
|
|
+ formData.data.cityId = "";
|
|
|
+ formData.data.cityName = "";
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ countryData.value = res;
|
|
|
+ }
|
|
|
+ });
|
|
|
+};
|
|
|
+getDict();
|
|
|
+getCityData("0");
|
|
|
+
|
|
|
+const sellCorporationIdChange = (val) => {
|
|
|
+ if (val) {
|
|
|
+ proxy.post("/corporation/detail", { id: val }).then((res) => {
|
|
|
+ if (formData.data.contractType == "2") {
|
|
|
+ formData.data.sellCountryName = res.countryName;
|
|
|
+ formData.data.sellProvinceName = res.provinceName;
|
|
|
+ formData.data.sellCityName = res.cityName;
|
|
|
+ formData.data.sellAddress = res.address;
|
|
|
+ } else {
|
|
|
+ formData.data.sellCountryName = res.countryEnStr;
|
|
|
+ formData.data.sellProvinceName = res.provinceEnStr;
|
|
|
+ formData.data.sellCityName = res.cityEnStr;
|
|
|
+ formData.data.sellAddress = res.addressEn;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const changeCustomer = (val) => {
|
|
|
+ formData.data.quotationProductList = [];
|
|
|
+ if (val) {
|
|
|
+ proxy.post("/customer/detail", { id: val }).then(
|
|
|
+ (res) => {
|
|
|
+ formData.data.buyCorporationName = res.name;
|
|
|
+ if (res.customerUserList && res.customerUserList.length > 0) {
|
|
|
+ formData.data.buyContactName = res.customerUserList[0].name;
|
|
|
+ if (res.customerUserList[0].contactJson) {
|
|
|
+ let contactJson = JSON.parse(res.customerUserList[0].contactJson);
|
|
|
+ if (contactJson && contactJson.length > 0) {
|
|
|
+ formData.data.buyContactNumber = contactJson[0].contactNo;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ customerUserList.value = res.customerUserList.map((item) => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ value: item.name,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ }
|
|
|
+ // 回填客户的账户信息
|
|
|
+ // formData.data.beneficiaryName = res.beneficiaryName;
|
|
|
+ // formData.data.beneficiaryBank = res.beneficiaryBank;
|
|
|
+ // formData.data.beneficiaryBankAddress = res.beneficiaryBankAddress;
|
|
|
+ // formData.data.beneficiaryAccountNumber = res.beneficiaryAccountNumber;
|
|
|
+ // formData.data.swiftCode = res.swiftCode;
|
|
|
+ // formData.data.beneficiaryAddress = res.beneficiaryAddress;
|
|
|
+
|
|
|
+ formData.data.countryId = res.countryId;
|
|
|
+ formData.data.provinceId = res.provinceId;
|
|
|
+ formData.data.cityId = res.cityId;
|
|
|
+ formData.data.buyPostalCode = res.zipCode;
|
|
|
+ formData.data.buyAddress = res.address;
|
|
|
+ getCityData(formData.data.countryId, "20");
|
|
|
+ if (formData.data.provinceId) {
|
|
|
+ getCityData(formData.data.provinceId, "30");
|
|
|
+ }
|
|
|
+ },
|
|
|
+ (err) => {
|
|
|
+ formData.data.countryId = "";
|
|
|
+ formData.data.provinceId = "";
|
|
|
+ formData.data.cityId = "";
|
|
|
+ formData.data.buyPostalCode = "";
|
|
|
+ formData.data.buyAddress = "";
|
|
|
+ }
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ formData.data.countryId = "";
|
|
|
+ formData.data.provinceId = "";
|
|
|
+ formData.data.cityId = "";
|
|
|
+ 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) => {
|
|
|
+ if (item.contactJson) {
|
|
|
+ let data = JSON.parse(item.contactJson);
|
|
|
+ formData.data.buyContactNumber = data[0].contactNo;
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const selectProduct = (goods) => {
|
|
|
+ if (goods && goods.id) {
|
|
|
+ let fileUrl = "";
|
|
|
+ if (goods.fileList && goods.fileList.length > 0) {
|
|
|
+ fileUrl = goods.fileList[0].fileUrl;
|
|
|
+ }
|
|
|
+ formData.data.quotationProductList.push({
|
|
|
+ fileUrl: fileUrl,
|
|
|
+ productId: goods.id,
|
|
|
+ productCnName: goods.name,
|
|
|
+ productCode: goods.customCode,
|
|
|
+ productLength: goods["length"],
|
|
|
+ productWidth: goods.width,
|
|
|
+ productHeight: goods.height,
|
|
|
+ prodFilePath: goods.prodFilePath,
|
|
|
+ quantity: null,
|
|
|
+ price: null,
|
|
|
+ amount: "",
|
|
|
+ fileList: [],
|
|
|
+ });
|
|
|
+ proxy.msgTip("添加成功", 1);
|
|
|
+ } else {
|
|
|
+ return proxy.msgTip("选择错误", 2);
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const changeProductPrice = () => {
|
|
|
+ let productIds = formData.data.quotationProductList.map((x) => x.productId);
|
|
|
+ if (productIds && productIds.length > 0) {
|
|
|
+ proxy
|
|
|
+ .post("/contract/getProductPriceInfo", {
|
|
|
+ productIds: productIds,
|
|
|
+ customerId: formData.data.buyCorporationId
|
|
|
+ ? formData.data.buyCorporationId
|
|
|
+ : "",
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ for (let i = 0; i < formData.data.quotationProductList.length; i++) {
|
|
|
+ const iele = formData.data.quotationProductList[i];
|
|
|
+ for (const key in res) {
|
|
|
+ if (key == iele.productId) {
|
|
|
+ iele.salePrice = res[key].price;
|
|
|
+ iele.currency = res[key].currency;
|
|
|
+ iele.saleCostPrice = res[key].costPrice;
|
|
|
+ iele.quotationProductList = res[key].quotationProductList
|
|
|
+ .map((x) => ({
|
|
|
+ createTime: x.createTime,
|
|
|
+ price: x.price,
|
|
|
+ currency: x.currency,
|
|
|
+ }))
|
|
|
+ .filter((y, index) => index < 3);
|
|
|
+ iele.contractProductListOne = res[key].quotationProductList.map(
|
|
|
+ (x) => ({
|
|
|
+ createTime: x.createTime,
|
|
|
+ price: x.price,
|
|
|
+ currency: x.currency,
|
|
|
+ })
|
|
|
+ );
|
|
|
+ iele.customerContractProductList = res[
|
|
|
+ key
|
|
|
+ ].customerContractProductList.map((x) => ({
|
|
|
+ createTime: x.createTime,
|
|
|
+ price: x.price,
|
|
|
+ currency: x.currency,
|
|
|
+ }));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+};
|
|
|
+const onPicture = (path) => {
|
|
|
+ window.open(path, "_blank");
|
|
|
+};
|
|
|
+const handleRemove = (index) => {
|
|
|
+ formData.data.quotationProductList.splice(index, 1);
|
|
|
+ totalAmount();
|
|
|
+};
|
|
|
+const calculationAmount = (att = "") => {
|
|
|
+ nextTick(() => {
|
|
|
+ if (
|
|
|
+ formData.data.quotationProductList &&
|
|
|
+ formData.data.quotationProductList.length > 0
|
|
|
+ ) {
|
|
|
+ for (let i = 0; i < formData.data.quotationProductList.length; i++) {
|
|
|
+ let money = 0;
|
|
|
+ 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: null,
|
|
|
+ remark: "",
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ formData.data.quotationPayList = [
|
|
|
+ { payName: "", amount: null, remark: "" },
|
|
|
+ ];
|
|
|
+ }
|
|
|
+};
|
|
|
+const handleDelete = (index) => {
|
|
|
+ formData.data.quotationPayList.splice(index, 1);
|
|
|
+ totalAmount();
|
|
|
+};
|
|
|
+
|
|
|
+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 handleBeforeUpload = async (file, index) => {
|
|
|
+ const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
|
|
|
+ uploadData.value = res.uploadBody;
|
|
|
+ formData.data.quotationProductList[index].fileList = [
|
|
|
+ {
|
|
|
+ id: res.id,
|
|
|
+ fileName: res.fileName,
|
|
|
+ fileUrl: res.fileUrl,
|
|
|
+ uploadState: false,
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ formData.data.quotationProductList[index].imageUrl = res.fileUrl;
|
|
|
+ return true;
|
|
|
+};
|
|
|
+
|
|
|
+const handleSuccess = (index) => {
|
|
|
+ formData.data.quotationProductList[index].uploadState = true;
|
|
|
+};
|
|
|
+
|
|
|
+const loadingSearch = ref(false);
|
|
|
+const remoteMethod = (keyword) => {
|
|
|
+ if (keyword && typeof keyword === "string") {
|
|
|
+ loadingSearch.value = true;
|
|
|
+ proxy.post("/customer/selPage", { keyword }).then((res) => {
|
|
|
+ customerList.value = res.rows.map((x) => ({
|
|
|
+ ...x,
|
|
|
+ label: x.name,
|
|
|
+ value: x.id,
|
|
|
+ }));
|
|
|
+ loadingSearch.value = false;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return;
|
|
|
+};
|
|
|
+
|
|
|
+const handleSubmit = async () => {
|
|
|
+ let flag = await formDom.value.handleSubmit(() => {});
|
|
|
+ if (flag) {
|
|
|
+ if (
|
|
|
+ formData.data.quotationProductList &&
|
|
|
+ formData.data.quotationProductList.length > 0
|
|
|
+ ) {
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ proxy.msgTip("请添加至少一件商品", 2);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ setTimeout(() => {
|
|
|
+ const errorDiv = document.getElementsByClassName("is-error");
|
|
|
+ errorDiv[0].scrollIntoView();
|
|
|
+ }, 0);
|
|
|
+ }
|
|
|
+ return flag;
|
|
|
+};
|
|
|
+
|
|
|
+const getFormData = () => {
|
|
|
+ return proxy.deepClone(formData.data);
|
|
|
+};
|
|
|
+// 向父组件暴露
|
|
|
+defineExpose({
|
|
|
+ getFormData,
|
|
|
+ handleSubmit,
|
|
|
+});
|
|
|
+
|
|
|
+const changeShroffAccount = (val) => {
|
|
|
+ if (val) {
|
|
|
+ let data = accountList.value.find((item) => item.value == val);
|
|
|
+ if (formData.data.contractType == "2") {
|
|
|
+ if (data) {
|
|
|
+ formData.data.beneficiaryName = "";
|
|
|
+ formData.data.beneficiaryBank = "";
|
|
|
+ formData.data.beneficiaryBankAddress = "";
|
|
|
+ formData.data.beneficiaryAccountNumber = "";
|
|
|
+ formData.data.swiftCode = "";
|
|
|
+ formData.data.beneficiaryAddress = "";
|
|
|
+ formData.data.accountName = data.name;
|
|
|
+ formData.data.openingBank = data.openingBank;
|
|
|
+ formData.data.accountOpening = data.accountOpening;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (data) {
|
|
|
+ formData.data.accountName = "";
|
|
|
+ formData.data.openingBank = "";
|
|
|
+ formData.data.accountOpening = "";
|
|
|
+ formData.data.beneficiaryName = data.beneficiaryName;
|
|
|
+ formData.data.beneficiaryBank = data.beneficiaryBank;
|
|
|
+ formData.data.beneficiaryBankAddress = data.beneficiaryBankAddress;
|
|
|
+ formData.data.beneficiaryAccountNumber = data.beneficiaryAccountNumber;
|
|
|
+ formData.data.swiftCode = data.swiftCode;
|
|
|
+ formData.data.beneficiaryAddress = data.beneficiaryAddress;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const handleClickUpload = async (att, flag, index) => {
|
|
|
+ let res = null;
|
|
|
+ let path = "";
|
|
|
+ if (flag) {
|
|
|
+ proxy.msgTip("请稍后", 2);
|
|
|
+ res = await proxy.post("/fileService/createTempFolder");
|
|
|
+ if (res && res.path) {
|
|
|
+ formData.data.quotationProductList[index][att] = res.path;
|
|
|
+ path = res.path;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ path = formData.data.quotationProductList[index][att];
|
|
|
+ }
|
|
|
+ let a = document.createElement("a");
|
|
|
+ a.href = "printer://" + "ftp://192.168.1.13/" + path + "/";
|
|
|
+ a.style.display = "none";
|
|
|
+ document.body.appendChild(a);
|
|
|
+ a.click();
|
|
|
+ document.body.removeChild(a);
|
|
|
+};
|
|
|
+
|
|
|
+const getAllData = (businessId) => {
|
|
|
+ proxy.post("/saleQuotation/detail", { id: businessId }).then((res) => {
|
|
|
+ res.countryId = res.buyCountryId;
|
|
|
+ res.provinceId = res.buyProvinceId;
|
|
|
+ res.cityId = res.buyCityId;
|
|
|
+ for (const key in res) {
|
|
|
+ formData.data[key] = res[key];
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ formData.data.quotationProductList &&
|
|
|
+ formData.data.quotationProductList.length > 0
|
|
|
+ ) {
|
|
|
+ let productIds = formData.data.quotationProductList.map(
|
|
|
+ (x) => x.productId
|
|
|
+ );
|
|
|
+ proxy
|
|
|
+ .post("/fileInfo/getList", {
|
|
|
+ businessIdList: productIds,
|
|
|
+ })
|
|
|
+ .then((fileObj) => {
|
|
|
+ for (let i = 0; i < formData.data.quotationProductList.length; i++) {
|
|
|
+ const e = formData.data.quotationProductList[i];
|
|
|
+ for (const key in fileObj) {
|
|
|
+ if (e.productId === key) {
|
|
|
+ if (fileObj[key] && fileObj[key].length > 0) {
|
|
|
+ e.fileUrl = fileObj[key][0].fileUrl;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ let ids = formData.data.quotationProductList.map((x) => x.id);
|
|
|
+ proxy
|
|
|
+ .post("/fileInfo/getList", {
|
|
|
+ businessIdList: ids,
|
|
|
+ })
|
|
|
+ .then((fileObj) => {
|
|
|
+ for (let i = 0; i < formData.data.quotationProductList.length; i++) {
|
|
|
+ const e = formData.data.quotationProductList[i];
|
|
|
+ for (const key in fileObj) {
|
|
|
+ if (e.id === key) {
|
|
|
+ if (fileObj[key] && fileObj[key].length > 0) {
|
|
|
+ e.fileList = fileObj[key];
|
|
|
+ e.imageUrl = fileObj[key][0].fileUrl;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (formData.data.countryId) {
|
|
|
+ getCityData(formData.data.countryId, "20");
|
|
|
+ }
|
|
|
+ if (formData.data.provinceId) {
|
|
|
+ getCityData(formData.data.provinceId, "30");
|
|
|
+ }
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ if (currencyData.value && currencyData.value.length > 0) {
|
|
|
+ formData.data.currency = currencyData.value[0].dictKey;
|
|
|
+ }
|
|
|
+ formOption.disabled = judgeStatus();
|
|
|
+ if (route.query && route.query.businessId && route.query.processType) {
|
|
|
+ let businessId = route.query.businessId;
|
|
|
+ getAllData(businessId);
|
|
|
+ }
|
|
|
+});
|
|
|
+
|
|
|
+watch(
|
|
|
+ () => props.queryData,
|
|
|
+ (val) => {
|
|
|
+ nextTick(() => {
|
|
|
+ formOption.disabled = judgeStatus();
|
|
|
+ });
|
|
|
+ if (val.businessId && val.processType) {
|
|
|
+ getAllData(val.businessId);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ deep: true,
|
|
|
+ immediate: true,
|
|
|
+ }
|
|
|
+);
|
|
|
+const showPriceInfo = () => {
|
|
|
+ if (props.queryData.processType) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (route.query.processType) {
|
|
|
+ return false;
|
|
|
+ } else {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+};
|
|
|
+const optionTwo = reactive({
|
|
|
+ data: {
|
|
|
+ tooltip: {
|
|
|
+ trigger: "axis",
|
|
|
+ },
|
|
|
+ // legend: {
|
|
|
+ // data: ["价格"],
|
|
|
+ // },
|
|
|
+ grid: {
|
|
|
+ left: "3%",
|
|
|
+ right: "4%",
|
|
|
+ top: "10%",
|
|
|
+ bottom: "3%",
|
|
|
+ containLabel: true,
|
|
|
+ },
|
|
|
+ // toolbox: {
|
|
|
+ // feature: {
|
|
|
+ // saveAsImage: {},
|
|
|
+ // },
|
|
|
+ // },
|
|
|
+ xAxis: {
|
|
|
+ type: "category",
|
|
|
+ boundaryGap: false,
|
|
|
+ data: [],
|
|
|
+ },
|
|
|
+ yAxis: {
|
|
|
+ type: "value",
|
|
|
+ },
|
|
|
+ series: [
|
|
|
+ {
|
|
|
+ name: "价格",
|
|
|
+ type: "line",
|
|
|
+ data: [],
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+});
|
|
|
+const showEcharts = (row, index) => {
|
|
|
+ let myChart = null;
|
|
|
+ myChart = echarts.init(proxy.$refs[row.productId + index]);
|
|
|
+ window.addEventListener("resize", () => {
|
|
|
+ myChart.resize();
|
|
|
+ });
|
|
|
+ if (row.contractProductListOne && row.contractProductListOne.length > 0) {
|
|
|
+ optionTwo.data.xAxis.data = row.contractProductListOne.map((item) => {
|
|
|
+ return item.createTime.slice(0, 10);
|
|
|
+ });
|
|
|
+ optionTwo.data.series[0].data = row.contractProductListOne.map((item) => {
|
|
|
+ return item.price;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ optionTwo.data.xAxis.data = [];
|
|
|
+ optionTwo.data.series[0].data = [];
|
|
|
+ }
|
|
|
+ myChart.setOption(optionTwo.data);
|
|
|
+ myChart.resize();
|
|
|
+};
|
|
|
+
|
|
|
+const clickCopy = (type) => {
|
|
|
+ copyType.value = type;
|
|
|
+ copyContract.value = true;
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.img {
|
|
|
+ object-fit: contain;
|
|
|
+ width: 16px;
|
|
|
+ height: 16px;
|
|
|
+ vertical-align: middle;
|
|
|
+}
|
|
|
+.pic {
|
|
|
+ object-fit: contain;
|
|
|
+ width: 50px;
|
|
|
+ height: 50px;
|
|
|
+ cursor: pointer;
|
|
|
+ vertical-align: middle;
|
|
|
+}
|
|
|
+.el-icon.avatar-uploader-icon {
|
|
|
+ font-size: 20px;
|
|
|
+ color: #8c939d;
|
|
|
+ width: 50px;
|
|
|
+ height: 50px;
|
|
|
+ text-align: center;
|
|
|
+ border: 1px dashed var(--el-border-color);
|
|
|
+}
|
|
|
+</style>
|