Commit 24852c90 authored by zhoutong's avatar zhoutong

供应商1.6

parent 172c8b4f
...@@ -26,6 +26,15 @@ export function deleteSupplier(id) { ...@@ -26,6 +26,15 @@ export function deleteSupplier(id) {
}) })
} }
// 获得供应商列表
export function getSupplierList(query) {
return request({
url: '/ecw/supplier/list',
method: 'get',
params: query
})
}
// 获得供应商 // 获得供应商
export function getSupplier(id) { export function getSupplier(id) {
return request({ return request({
...@@ -52,3 +61,21 @@ export function exportSupplierExcel(query) { ...@@ -52,3 +61,21 @@ export function exportSupplierExcel(query) {
responseType: 'blob' responseType: 'blob'
}) })
} }
// 创建清关文件号码
export function createFileNo(data) {
return request({
url: '/ecw/clearance-file-no/create',
method: 'post',
data: data
})
}
// 获得清关文件号码
export function getFileNoPage(query) {
return request({
url: '/ecw/clearance-file-no/page',
method: 'get',
params: query
})
}
\ No newline at end of file
<template>
<el-select
v-model="valueSync"
multiple
filterable
clearable
remote
reserve-keyword
:disabled="disabled"
placeholder="请输入关键词"
@focus="remoteMethod('')"
:remote-method="remoteMethod"
:loading="loading">
<el-option
v-for="(item) in list"
:key="item.id"
:label="$l(item, 'company') + '('+item.companyCode+')'"
:value="item.id">
</el-option>
</el-select>
</template>
<script>
import {getSupplierList, getSupplierPage} from '@/api/ecw/supplier'
export default {
props:{
companyType: [String, Number],
value: [Array],
disabled: {
type: Boolean,
default: false
}
},
data(){
return {
valueSync: [],
list:[],
loading: false
}
},
computed:{
},
watch:{
valueSync(val){
this.$emit('input', val)
},
value(val){
this.valueSync = this.value
this.init(val)
}
},
created(){
this.valueSync = this.value
this.init(this.value)
},
methods:{
init(val){
if(val === null || val == undefined || val == '') return
let params = {
ids: val.toString()
}
getSupplierList(params).then(res => {
this.list = res.data
})
},
remoteMethod(keyword){
let params = {
pageSize: 500,
companyType: this.companyType
}
params.keyword = keyword
this.loading = true
getSupplierPage(params)
.then(res => this.list = res.data.list)
.finally(() => this.loading = false)
}
}
}
</script>
\ No newline at end of file
<template>
<div class="app-container">
<el-form ref="elForm" :model="formData" :rules="rules" inline size="small" label-width="100px"
label-position="left">
<div>
<el-form-item>
<el-radio v-model="formData.areaType" :label="0" disabled>{{$t('国内')}}</el-radio>
<el-radio v-model="formData.areaType" :label="1" disabled>{{$t('国外')}}</el-radio>
</el-form-item>
</div>
<div>
<el-form-item :label="$t('公司全称')" prop="companyZh">
<el-input v-model="formData.companyZh" :placeholder="$t('请输入公司全称')" show-word-limit clearable readonly></el-input>
</el-form-item>
<el-form-item :label="$t('英文名称')" prop="companyEn">
<el-input v-model="formData.companyEn" :placeholder="$t('请输入公司英文名')" show-word-limit clearable readonly></el-input>
</el-form-item>
</div>
<div>
<el-form-item :label="$t('合作开始时间')" prop="cooperationDateStart">
<el-date-picker v-model="formData.cooperationDateStart" value-format="timestamp" clearable disabled></el-date-picker>
</el-form-item>
<el-form-item :label="$t('合作结束时间')" prop="cooperationDateEnd">
<el-date-picker v-model="formData.cooperationDateEnd" value-format="timestamp" clearable disabled></el-date-picker>
</el-form-item>
</div>
<div v-if="formData.areaType==0">
<el-form-item :label="$t('公司电话')" prop="tell">
<el-input v-model="formData.tell" :placeholder="$t('请输入公司电话')" clearable readonly></el-input>
</el-form-item>
<el-form-item :label="$t('邮件地址')" prop="email">
<el-input v-model="formData.email" :placeholder="$t('请输入邮箱地址')" clearable readonly></el-input>
</el-form-item>
</div>
<div v-if="formData.areaType==0">
<el-form-item :label="$t('公司地址')" prop="address">
<area-selector
:country="formData.country"
:province="formData.province"
:city="formData.city"
disabled
@countryChange="onAreaChange('country', $event)"
@provinceChange="onAreaChange('province', $event)"
@cityChange="onAreaChange('city', $event)"
/>
<el-input v-model="formData.address" :placeholder="$t('请输入详细地址')" class="mt-10" readonly></el-input>
</el-form-item>
</div>
<div v-if="formData.areaType==0">
<el-form-item :label="$t('备注')" prop="remark">
<el-input v-model="formData.remark" type="textarea" :placeholder="$t('请输入备注')"
:autosize="{minRows: 4, maxRows: 4}" class="w-500" readonly></el-input>
</el-form-item>
</div>
<div v-if="formData.areaType==0">
<el-form-item :label="$t('供应商类别')" prop="companyType">
<dict-selector v-model="formData.companyTypeArr" type="company_type" multiple disabled />
</el-form-item>
</div>
<div>
<el-form-item :label="$t('合作类型')" prop="cooperationType">
<dict-selector v-model="formData.cooperationType" type="cooperation_type" disabled />
</el-form-item>
</div>
<div v-if="formData.areaType==0">
<el-form-item :label="$t('营业执照')" prop="license">
<upload v-model="formData.license" />
</el-form-item>
<el-form-item :label="$t('合同')" prop="contract">
<upload v-model="formData.contract" />
</el-form-item>
</div>
<div v-if="formData.areaType==0">
<el-form-item :label="$t('统一信用代码')" prop="licenseNumber">
<el-input v-model="formData.licenseNumber" :placeholder="$t('请输入统一社会信用代码')" clearable readonly
:style="{width: '100%'}"></el-input>
</el-form-item>
</div>
<div v-if="formData.areaType==0">
<el-form-item :label="$t('结算周期')" prop="settlementPeriod">
<dict-selector v-model="formData.settlementPeriod" type="settlement_period" disabled />
</el-form-item>
</div>
<div>
<el-form-item :label="$t('价格优势')" prop="priceAdvantage">
<dict-selector v-model="formData.priceAdvantage" type="price_advantage" disabled />
</el-form-item>
</div>
<div v-if="formData.areaType==0">
<el-card class="mt-10">
<div class="card-header" slot="header">
<div class="title">{{$t('联系人')}}</div>
</div>
<el-table :data="formData.contactList" border class="data-list">
<el-table-column :label="$t('序号')" width="80px">
<template slot-scope="scope">{{scope.$index + 1}}</template>
</el-table-column>
<el-table-column :label="$t('部门')" prop="priceAdvantage">
<template slot-scope="scope">
<el-input v-model="scope.row.department" placeholder="" readonly></el-input>
</template>
</el-table-column>
<el-table-column :label="$t('职位')" prop="position">
</el-table-column>
<el-table-column :label="$t('名称')" prop="name">
</el-table-column>
<el-table-column :label="$t('电话')" prop="phone">
</el-table-column>
</el-table>
</el-card>
<el-card class="mt-10">
<div class="card-header" slot="header">
<div class="title">{{$t('银行信息')}}</div>
</div>
<el-table :data="formData.bankList" border class="data-list">
<el-table-column :label="$t('序号')" width="80px">
<template slot-scope="scope">{{scope.$index + 1}}</template>
</el-table-column>
<el-table-column :label="$t('账户名称')" prop="accountName">
</el-table-column>
<el-table-column :label="$t('币别')">
<template slot="header">
{{$t('币别')}}<span class="red">*</span>
</template>
<template slot-scope="scope">
<el-form-item
class="mb-0 mr-0"
:prop="`bankList.${scope.$index}.currency`"
:rules="{required: true, message: $t('币别不能为空'), trigger: 'blur'}"
>
<selector :options="currencyList" v-model="scope.row.currency" value-field="id" :label-field="'title' + $l()" disabled></selector>
</el-form-item>
</template>
</el-table-column>
<el-table-column :label="$t('银行名称')" prop="bankName">
</el-table-column>
<el-table-column :label="$t('银行账户')" prop="bankAccount">
</el-table-column>
<el-table-column :label="$t('银行代码')" prop="bankCode">
</el-table-column>
<el-table-column :label="$t('账户类型')" prop="accountType">
</el-table-column>
<el-table-column :label="$t('状态')" prop="status">
<template slot-scope="scope">
<dict-selector :type="DICT_TYPE.COMMON_STATUS" v-model="scope.row.status" defaultable />
</template>
</el-table-column>
<el-table-column :label="$t('银行地址')" prop="bankAddress">
</el-table-column>
</el-table>
</el-card>
<el-card class="mt-10">
<div class="card-header" slot="header">
<div class="title">{{$t('海运优质资源条件')}}</div>
</div>
<div>
<el-form-item :label="$t('供应商优势船公司')" prop="shipCompany" label-width="250">
<suppliers-selector v-model="formData.resourceVO.shipCompany" company-type="9" disabled />
</el-form-item>
</div>
<div>
<el-form-item :label="$t('海运船公司优势港口')" prop="ports" label-width="250">
<el-select v-model="formData.resourceVO.ports" filterable multiple clearable disabled>
<el-option v-for="(item) in seaPort" :key="item.id" :label="$l(item, 'title')" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('港口优势条件')" prop="portConditions" label-width="250">
<dict-selector v-model="formData.resourceVO.portConditions" type="port_conditions" disabled />
</el-form-item>
</div>
<div>
<el-form-item :label="$t('订舱公司')" prop="bookCompany" label-width="250">
<suppliers-selector v-model="formData.resourceVO.bookCompany" company-type="1" disabled />
</el-form-item>
<el-form-item :label="$t('订舱优势条件')" prop="bookConditions" label-width="250">
<dict-selector v-model="formData.resourceVO.bookConditions" type="book_conditions" disabled />
</el-form-item>
</div>
<div>
<el-form-item :label="$t('拖车公司')" prop="trailerCompany" label-width="250">
<suppliers-selector v-model="formData.resourceVO.trailerCompany" company-type="4" disabled />
</el-form-item>
<el-form-item :label="$t('拖车优势条件')" prop="trailerConditions" label-width="250">
<dict-selector v-model="formData.resourceVO.trailerConditions" type="trailer_conditions" disabled />
</el-form-item>
</div>
<div>
<el-form-item :label="$t('报关公司')" prop="customsCompany" label-width="250">
<suppliers-selector v-model="formData.resourceVO.customsCompany" company-type="2" disabled />
</el-form-item>
<el-form-item :label="$t('报关优势条件')" prop="customsConditions" label-width="250">
<dict-selector v-model="formData.resourceVO.customsConditions" type="customs_conditions" disabled />
</el-form-item>
</div>
<div>
<el-form-item :label="$t('证书公司')" prop="certificateCompany" label-width="250">
<suppliers-selector v-model="formData.resourceVO.certificateCompany" company-type="3" disabled />
</el-form-item>
<el-form-item :label="$t('证书优势条件')" prop="certificateConditions" label-width="250">
<dict-selector v-model="formData.resourceVO.certificateConditions" type="certificate_conditions" disabled />
</el-form-item>
</div>
<div>
<el-form-item :label="$t('合作不良记录登记')" prop="badCooperationRecord" label-width="250">
<el-input v-model="formData.resourceVO.badCooperationRecord" :placeholder="$t('请输入合作不良记录登记')" show-word-limit clearable readonly></el-input>
</el-form-item>
</div>
</el-card>
<el-card class="mt-10">
<div class="card-header" slot="header">
<div class="title">{{$t('空运优质资源条件')}}</div>
</div>
<div>
<el-form-item :label="$t('空运优势机场')" prop="airdrome" label-width="250">
<el-select v-model="formData.resourceVO.airdrome" filterable multiple clearable disabled>
<el-option v-for="(item) in airPort" :key="item.id" :label="$l(item, 'title')" :value="item.id"></el-option>
</el-select>
</el-form-item>
</div>
<div>
<el-form-item :label="$t('空运优势航空公司')" prop="airCompany" label-width="250">
<suppliers-selector v-model="formData.resourceVO.airCompany" company-type="10" disabled />
</el-form-item>
<el-form-item :label="$t('航空公司优势条件')" prop="airConditions" label-width="250">
<dict-selector v-model="formData.resourceVO.airConditions" type="port_conditions" disabled />
</el-form-item>
</div>
<div>
<el-form-item :label="$t('订舱公司')" prop="bookCompanyAir" label-width="250">
<suppliers-selector v-model="formData.resourceVO.bookCompanyAir" company-type="5" disabled />
</el-form-item>
<el-form-item :label="$t('订舱优势条件')" prop="bookConditionsAir" label-width="250">
<dict-selector v-model="formData.resourceVO.bookConditionsAir" type="book_conditions" disabled />
</el-form-item>
</div>
<div>
<el-form-item :label="$t('报关公司')" prop="customsCompanyAir" label-width="250">
<suppliers-selector v-model="formData.resourceVO.customsCompanyAir" company-type="7" disabled />
</el-form-item>
<el-form-item :label="$t('报关优势条件')" prop="customsConditionsAir" label-width="250">
<dict-selector v-model="formData.resourceVO.customsConditionsAir" type="customs_conditions" disabled />
</el-form-item>
</div>
<div>
<el-form-item :label="$t('证书公司')" prop="certificateCompanyAir" label-width="250">
<suppliers-selector v-model="formData.resourceVO.certificateCompanyAir" company-type="3" disabled />
</el-form-item>
<el-form-item :label="$t('证书优势条件')" prop="certificateConditionsAir" label-width="250">
<dict-selector v-model="formData.resourceVO.certificateConditionsAir" type="certificate_conditions" disabled />
</el-form-item>
</div>
<div>
<el-form-item :label="$t('合作不良记录登记')" prop="badCooperationRecordAir" label-width="250">
<el-input v-model="formData.resourceVO.badCooperationRecordAir" :placeholder="$t('请输入合作不良记录登记')" show-word-limit clearable readonly></el-input>
</el-form-item>
</div>
</el-card>
</div>
<div v-if="formData.areaType==1">
<h1>代理商</h1>
<h2>收货人</h2>
<div class="supplier-item">
<el-form-item :label="$t('公司名称')" prop="receiveCompanyName">
<el-input v-model="formData.externalVO.receiveCompanyName" :placeholder="$t('请输入公司名称')" show-word-limit clearable readonly></el-input>
</el-form-item>
<el-form-item :label="$t('地址')" prop="receiveAddress">
<el-input v-model="formData.externalVO.receiveAddress" :placeholder="$t('请输入地址')" show-word-limit clearable readonly></el-input>
</el-form-item>
</div>
<div class="supplier-item">
<el-form-item :label="$t('电话')" prop="receiveTel">
<el-input v-model="formData.externalVO.receiveTel" :placeholder="$t('请输入电话')" show-word-limit clearable readonly></el-input>
</el-form-item>
<el-form-item :label="$t('邮箱')" prop="receiveEmail">
<el-input v-model="formData.externalVO.receiveEmail" :placeholder="$t('请输入邮箱')" show-word-limit clearable readonly></el-input>
</el-form-item>
</div>
<div style="display: flex;align-items: flex-end;">
<h2>通知方</h2>
</div>
<div class="supplier-item">
<el-form-item :label="$t('公司名称')" prop="notifyCompanyName">
<el-input v-model="formData.externalVO.notifyCompanyName" :placeholder="$t('请输入公司名称')" show-word-limit clearable readonly></el-input>
</el-form-item>
<el-form-item :label="$t('地址')" prop="notifyAddress">
<el-input v-model="formData.externalVO.notifyAddress" :placeholder="$t('请输入地址')" show-word-limit clearable readonly></el-input>
</el-form-item>
</div>
<div class="supplier-item">
<el-form-item :label="$t('电话')" prop="notifyTel">
<el-input v-model="formData.externalVO.notifyTel" :placeholder="$t('请输入电话')" show-word-limit clearable readonly></el-input>
</el-form-item>
<el-form-item :label="$t('邮箱')" prop="notifyEmail">
<el-input v-model="formData.externalVO.notifyEmail" :placeholder="$t('请输入邮箱')" show-word-limit clearable readonly></el-input>
</el-form-item>
</div>
<h2>货物描述</h2>
<div class="supplier-item">
<el-form-item :label="$t('品名')" prop="goodName">
<el-input v-model="formData.externalVO.goodName" :placeholder="$t('请输入品名')" show-word-limit clearable readonly></el-input>
</el-form-item>
<el-form-item :label="$t('清关国家')" prop="clearanceFileId">
<el-select v-model="formData.clearanceFileId" @change="changeFile" disabled>
<el-option v-for="(item) in fileList" :value="item.id" :label="getCountry(item.country,item.district)" :key="item.id" />
</el-select>
</el-form-item>
</div>
<div class="supplier-item">
<el-form-item :label="$t('From M No')" prop="fromNo">
<el-input v-model="formData.externalVO.fromNo" :placeholder="$t('请输入From M No')" show-word-limit clearable readonly></el-input>
</el-form-item>
<el-form-item :label="$t('BA NO')" prop="baNo">
<el-input v-model="formData.externalVO.baNo" :placeholder="$t('请输入BA NO')" show-word-limit clearable readonly></el-input>
</el-form-item>
</div>
<div class="supplier-item">
<el-form-item :label="$t('包装数量')" prop="packNum">
<el-input v-model="formData.externalVO.packNum" :placeholder="$t('请输入包装数量')" show-word-limit clearable readonly></el-input>
</el-form-item>
<el-form-item :label="$t('包装单位')" prop="packUnit">
<el-input v-model="formData.externalVO.packUnit" :placeholder="$t('请输入包装单位')" show-word-limit clearable readonly></el-input>
</el-form-item>
</div>
<div>
<el-form-item :label="$t('清关要求')" prop="clearanceRequireData">
<el-select v-model="formData.externalVO.clearanceRequireData" @change="changeRequire" disabled>
<el-option v-for="(item) in requireData" :value="item" :label="item" :key="item" />
</el-select>
</el-form-item>
<el-form-item v-if="formData.externalVO.clearanceRequireData=='自定义'" :label="$t('自定义要求')" prop="clearanceRequire">
<el-input v-model="formData.externalVO.clearanceRequire" :placeholder="$t('请输入自定义要求')" show-word-limit clearable readonly></el-input>
</el-form-item>
</div>
<div>
<el-form-item :label="$t('是否提供')" prop="provide">
<el-radio v-model="formData.externalVO.provide" :label="1" disabled>{{$t('提供')}}</el-radio>
<el-radio v-model="formData.externalVO.provide" :label="2" disabled>{{$t('不提供')}}</el-radio>
</el-form-item>
</div>
<div>
<el-form-item :label="$t('合作不良记录登记')" prop="badCooperationRecord" label-width="250">
<el-input v-model="formData.externalVO.badCooperationRecord" :placeholder="$t('请输入合作不良记录登记')" show-word-limit clearable readonly></el-input>
</el-form-item>
</div>
</div>
</el-form>
</div>
</template>
<script>
import { createSupplier, updateSupplier, getSupplier, createFileNo, getFileNoPage} from "@/api/ecw/supplier";
import upload from '@/components/ImageUpload'
import { getListTree } from "@/api/ecw/region";
import AreaSelector from '@/components/AreaSelector'
import {getCurrencyList} from '@/api/ecw/currency'
import Selector from '@/components/Selector'
import {validatePwd} from '@/api/ecw/busiPwd'
import SuppliersSelector from '@/components/SuppliersSelector'
import { getDockPage } from "@/api/ecw/dock";
export default {
components: {upload, AreaSelector, Selector, SuppliersSelector},
props: [],
data() {
return {
disabled: true,
formData: {
areaType: 0,
companyZh: undefined,
agentName: undefined,
tell: "",
address: "",
remark: undefined,
field110: undefined,
companyTypeArr: [],
cooperationType: undefined,
settlementPeriod: undefined,
priceAdvantage: undefined,
license: null,
contract: null,
licenseNumber: undefined,
contactList:[],
bankList: [],
resourceVO: {},
externalVO: {}
},
rules: {
companyZh: [{
required: true,
message: this.$t('请输入公司全称'),
trigger: 'blur'
}],
agentName: [],
tell: [],
address: [],
remark: [],
companyType: [{
required: true,
type: 'string',
message: this.$t('请至少选择一个供应商类别'),
trigger: 'change'
}],
cooperationType: [{
required: true,
message: this.$t('请选择合作类型'),
trigger: 'change'
}],
licenseNumber: [],
},
treeList:[],
provinceList:[],
cityList:[],
// 码头
allDocks: [],
currencyList:[],
requireData: [
'COO证书','CXX证书','ABC证书','QWE证书','自定义'
],
fileList: [],
fileNoForm: {},
fileNoRules: {
country: [{required: true,message: this.$t('请输入国家'),trigger: 'blur'}],
district: [{required: true,message: this.$t('请输入地区'),trigger: 'blur'}],
fromNo: [{required: true,message: this.$t('请输入From M No'),trigger: 'blur'}],
baNo: [{required: true,message: this.$t('请输入BA NO'),trigger: 'blur'}],
},
showFileNoDialog: false
}
},
computed: {
airPort(){
return this.allDocks.filter(item => item.portType == 1)
},
seaPort(){
return this.allDocks.filter(item => item.portType == 2)
},
districtList(){
if(!this.fileNoForm.country) return []
let country = this.treeList.find(item => item.id == this.fileNoForm.country)
return country && country.children || []
},
},
watch: {
'formData.country'(country){
this.treeList.forEach(item => {
if(item.id == country){
this.provinceList = item.children || []
}
})
},
'formData.province'(province){
this.provinceList.forEach(item => {
if(item.id == province){
this.cityList = item.children || []
}
})
},
'formData.companyTypeArr'(val){
this.$set(this.formData, 'companyType', val.join(","))
}
},
created() {
getCurrencyList().then(res => {
this.currencyList = res.data
})
// 码头
getDockPage({ pageNo: "1", pageSize: "10000" }).then((res) => {
this.allDocks = res.data.list;
});
this.getFile()
// 回显数据需要在加载了地区数据之后,否则无法正常回显
getListTree({treeType: 1}).then(response => {
this.treeList = response.data
if(this.$route.query.id){
this.disabled = true
getSupplier(this.$route.query.id).then(response => {
/* response.data.companyType = response.data.companyType.split(",") || [] */
this.formData = response.data
this.$set(this.formData, 'companyTypeArr', this.strToArray(response.data.companyType))
this.$set(this.formData, 'settlementPeriod', response.data.settlementPeriod==0?null:response.data.settlementPeriod)
this.formData.bankList.forEach(item => {
item.currency = +item.currency
})
if(response.data.resourceBackVO){
this.formData.resourceVO = response.data.resourceBackVO
this.formData.externalVO = response.data.externalBackVO??{}
this.$set(this.formData.resourceVO,'shipCompany',this.strToArray(response.data.resourceBackVO.shipCompany))
this.$set(this.formData.resourceVO,'ports',this.strToArray(response.data.resourceBackVO.ports))
this.$set(this.formData.resourceVO,'bookCompany',this.strToArray(response.data.resourceBackVO.bookCompany))
this.$set(this.formData.resourceVO,'trailerCompany',this.strToArray(response.data.resourceBackVO.trailerCompany))
this.$set(this.formData.resourceVO,'customsCompany',this.strToArray(response.data.resourceBackVO.customsCompany))
this.$set(this.formData.resourceVO,'certificateCompany',this.strToArray(response.data.resourceBackVO.certificateCompany))
this.$set(this.formData.resourceVO,'airdrome',this.strToArray(response.data.resourceBackVO.airdrome))
this.$set(this.formData.resourceVO,'airCompany',this.strToArray(response.data.resourceBackVO.airCompany))
this.$set(this.formData.resourceVO,'bookCompanyAir',this.strToArray(response.data.resourceBackVO.bookCompanyAir))
this.$set(this.formData.resourceVO,'customsCompanyAir',this.strToArray(response.data.resourceBackVO.customsCompanyAir))
this.$set(this.formData.resourceVO,'certificateCompanyAir',this.strToArray(response.data.resourceBackVO.certificateCompanyAir))
}
if(response.data.externalBackVO){
this.formData.externalVO = response.data.externalBackVO
this.formData.resourceVO = response.data.resourceBackVO??{}
this.$set(this.formData.externalVO,'receiveCompanyName',response.data.externalBackVO.receiveCompanyName)
this.$set(this.formData.externalVO,'receiveAddress',response.data.externalBackVO.receiveAddress)
this.$set(this.formData.externalVO,'receiveTel',response.data.externalBackVO.receiveTel)
this.$set(this.formData.externalVO,'receiveEmail',response.data.externalBackVO.receiveEmail)
this.$set(this.formData.externalVO,'notifyCompanyName',response.data.externalBackVO.notifyCompanyName)
this.$set(this.formData.externalVO,'notifyAddress',response.data.externalBackVO.notifyAddress)
this.$set(this.formData.externalVO,'notifyTel',response.data.externalBackVO.notifyTel)
this.$set(this.formData.externalVO,'notifyEmail',response.data.externalBackVO.notifyEmail)
this.$set(this.formData.externalVO,'goodName',response.data.externalBackVO.goodName)
this.$set(this.formData.externalVO,'clearanceFileId',response.data.externalBackVO.clearanceFileId)
this.$set(this.formData.externalVO,'fromNo',response.data.externalBackVO.fromNo)
this.$set(this.formData.externalVO,'baNo',response.data.externalBackVO.baNo)
this.$set(this.formData.externalVO,'packNum',response.data.externalBackVO.packNum)
this.$set(this.formData.externalVO,'packUnit',response.data.externalBackVO.packUnit)
this.$set(this.formData.externalVO,'clearanceRequireData',['COO证书','CXX证书','ABC证书','QWE证书'].includes(response.data.externalBackVO.clearanceRequire)?response.data.externalBackVO.clearanceRequire:'自定义')
this.$set(this.formData.externalVO,'clearanceRequire',response.data.externalBackVO.clearanceRequire)
this.$set(this.formData.externalVO,'provide',response.data.externalBackVO.provide)
this.$set(this.formData.externalVO,'badCooperationRecord',response.data.externalBackVO.badCooperationRecord)
}
});
}
})
},
mounted() {},
methods: {
strToArray(val) {
if(!val || val == '') {
return []
}else{
let data = val.split(",")
return data.map(item=>Number(item))
}
},
sameReceive() {
this.$set(this.formData.externalVO,'notifyCompanyName',this.formData.externalVO.receiveCompanyName)
this.$set(this.formData.externalVO,'notifyAddress',this.formData.externalVO.receiveAddress)
this.$set(this.formData.externalVO,'notifyTel',this.formData.externalVO.receiveTel)
this.$set(this.formData.externalVO,'notifyEmail',this.formData.externalVO.receiveEmail)
},
addFileNo() {
this.showFileNoDialog = true
this.$refs.fileNoForm.resetFields()
},
getFile() {
getFileNoPage().then(res => {
this.fileList = res.data.list
})
},
addfile() {
this.$refs.fileNoForm.validate(vaild=>{
if(vaild){
createFileNo(this.fileNoForm).then(()=>{
this.showFileNoDialog = false
this.getFile()
})
}else{
this.$message.error(this.$t('请完整填写表单'))
}
})
},
changeFile(val) {
let file = this.fileList.find(item=>item.id == val)
this.$set(this.formData.externalVO,'fromNo',file.fromNo)
this.$set(this.formData.externalVO,'baNo',file.baNo)
},
changeRequire(val) {
if(val != '自定义'){
this.$set(this.formData.externalVO,'clearanceRequire',val)
}else{
this.$set(this.formData.externalVO,'clearanceRequire','')
}
},
getCountry(countryId, districtId) {
let country = this.treeList.find(item=>item.id == countryId)
let district = country.children.find(item=>item.id == districtId)
return this.$l(country, 'title')+' '+this.$l(district, 'title')
},
delContact(index){
this.$confirm(this.$t('确定删除此联系人么?')).then(() => {
this.formData.contactList.splice(index, 1)
})
},
delBank(index){
if(this.formData.bankList[index].id){
this.$prompt(this.$t("请输入密码"), {
inputType: 'password'
})
.then(({value}) => {
if(value && value != ''){
return validatePwd({
busiType: 5,
pwd: value
})
}
this.$message.error(this.$t('密码不能为空'))
})
.then(res => {
if(!res.data){
return this.$message.error(this.$t('密码错误'))
}
this.formData.bankList.splice(index, 1)
})
return
}
this.$confirm(this.$t('确定删除此银行信息么?')).then(() => {
this.formData.bankList.splice(index, 1)
})
},
onAreaChange(type, val){
this.$set(this.formData, type, val)
},
}
}
</script>
<style lang="scss" scoped>
.el-upload__tip {
line-height: 1.2;
}
.card-header{
display: flex;
align-items: center;
justify-content: space-between;
.title{
font-size: 18px;
}
}
::v-deep .data-list .el-form-item__error{
position: static;
}
.red{
color: red;
}
.supplier-item{
margin-left: 30px;
}
</style>
...@@ -2,6 +2,12 @@ ...@@ -2,6 +2,12 @@
<div class="app-container"> <div class="app-container">
<el-form ref="elForm" :model="formData" :rules="rules" inline size="small" label-width="100px" <el-form ref="elForm" :model="formData" :rules="rules" inline size="small" label-width="100px"
label-position="left"> label-position="left">
<div>
<el-form-item>
<el-radio v-model="formData.areaType" :label="0" :disabled="disabled">{{$t('国内')}}</el-radio>
<el-radio v-model="formData.areaType" :label="1" :disabled="disabled">{{$t('国外')}}</el-radio>
</el-form-item>
</div>
<div> <div>
<el-form-item :label="$t('公司全称')" prop="companyZh"> <el-form-item :label="$t('公司全称')" prop="companyZh">
<el-input v-model="formData.companyZh" :placeholder="$t('请输入公司全称')" show-word-limit clearable></el-input> <el-input v-model="formData.companyZh" :placeholder="$t('请输入公司全称')" show-word-limit clearable></el-input>
...@@ -12,13 +18,13 @@ ...@@ -12,13 +18,13 @@
</div> </div>
<div> <div>
<el-form-item :label="$t('合作开始时间')" prop="cooperationDateStart"> <el-form-item :label="$t('合作开始时间')" prop="cooperationDateStart">
<el-date-picker v-model="formData.cooperationDateStart" value-format="yyyy-MM-dd HH:mm:ss" clearable></el-date-picker> <el-date-picker v-model="formData.cooperationDateStart" value-format="timestamp" clearable></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item :label="$t('合作结束时间')" prop="cooperationDateEnd"> <el-form-item :label="$t('合作结束时间')" prop="cooperationDateEnd">
<el-date-picker v-model="formData.cooperationDateEnd" value-format="yyyy-MM-dd HH:mm:ss" clearable></el-date-picker> <el-date-picker v-model="formData.cooperationDateEnd" value-format="timestamp" clearable></el-date-picker>
</el-form-item> </el-form-item>
</div> </div>
<div> <div v-if="formData.areaType==0">
<el-form-item :label="$t('公司电话')" prop="tell"> <el-form-item :label="$t('公司电话')" prop="tell">
<el-input v-model="formData.tell" :placeholder="$t('请输入公司电话')" clearable></el-input> <el-input v-model="formData.tell" :placeholder="$t('请输入公司电话')" clearable></el-input>
</el-form-item> </el-form-item>
...@@ -26,7 +32,7 @@ ...@@ -26,7 +32,7 @@
<el-input v-model="formData.email" :placeholder="$t('请输入邮箱地址')" clearable></el-input> <el-input v-model="formData.email" :placeholder="$t('请输入邮箱地址')" clearable></el-input>
</el-form-item> </el-form-item>
</div> </div>
<div> <div v-if="formData.areaType==0">
<el-form-item :label="$t('公司地址')" prop="address"> <el-form-item :label="$t('公司地址')" prop="address">
<area-selector <area-selector
:country="formData.country" :country="formData.country"
...@@ -39,23 +45,26 @@ ...@@ -39,23 +45,26 @@
<el-input v-model="formData.address" :placeholder="$t('请输入详细地址')" class="mt-10"></el-input> <el-input v-model="formData.address" :placeholder="$t('请输入详细地址')" class="mt-10"></el-input>
</el-form-item> </el-form-item>
</div> </div>
<div> <div v-if="formData.areaType==0">
<el-form-item :label="$t('备注')" prop="remark"> <el-form-item :label="$t('备注')" prop="remark">
<el-input v-model="formData.remark" type="textarea" :placeholder="$t('请输入备注')" <el-input v-model="formData.remark" type="textarea" :placeholder="$t('请输入备注')"
:autosize="{minRows: 4, maxRows: 4}" class="w-500"></el-input> :autosize="{minRows: 4, maxRows: 4}" class="w-500"></el-input>
</el-form-item> </el-form-item>
</div> </div>
<div> <div v-if="formData.areaType==0">
<el-form-item :label="$t('供应商类别')" prop="companyType"> <el-form-item :label="$t('供应商类别')" prop="companyType">
<dict-selector v-model="formData.companyTypeArr" type="company_type" multiple /> <dict-selector v-model="formData.companyTypeArr" type="company_type" multiple :disabled="disabled" />
</el-form-item> </el-form-item>
</div>
<div>
<el-form-item :label="$t('合作类型')" prop="cooperationType"> <el-form-item :label="$t('合作类型')" prop="cooperationType">
<dict-selector v-model="formData.cooperationType" type="cooperation_type" /> <dict-selector v-model="formData.cooperationType" type="cooperation_type" />
</el-form-item> </el-form-item>
</div> </div>
<div> <div v-if="formData.areaType==0">
<el-form-item :label="$t('营业执照')" prop="license"> <el-form-item :label="$t('营业执照')" prop="license">
<upload v-model="formData.license" /> <upload v-model="formData.license" />
</el-form-item> </el-form-item>
...@@ -63,13 +72,24 @@ ...@@ -63,13 +72,24 @@
<upload v-model="formData.contract" /> <upload v-model="formData.contract" />
</el-form-item> </el-form-item>
</div> </div>
<div> <div v-if="formData.areaType==0">
<el-form-item :label="$t('统一信用代码')" prop="licenseNumber"> <el-form-item :label="$t('统一信用代码')" prop="licenseNumber">
<el-input v-model="formData.licenseNumber" :placeholder="$t('请输入统一社会信用代码')" clearable <el-input v-model="formData.licenseNumber" :placeholder="$t('请输入统一社会信用代码')" clearable
:style="{width: '100%'}"></el-input> :style="{width: '100%'}"></el-input>
</el-form-item> </el-form-item>
</div> </div>
<el-card> <div v-if="formData.areaType==0">
<el-form-item :label="$t('结算周期')" prop="settlementPeriod">
<dict-selector v-model="formData.settlementPeriod" type="settlement_period" />
</el-form-item>
</div>
<div>
<el-form-item :label="$t('价格优势')" prop="priceAdvantage">
<dict-selector v-model="formData.priceAdvantage" type="price_advantage" />
</el-form-item>
</div>
<div v-if="formData.areaType==0">
<el-card class="mt-10">
<div class="card-header" slot="header"> <div class="card-header" slot="header">
<div class="title">{{$t('联系人')}}</div> <div class="title">{{$t('联系人')}}</div>
<el-button type="primary" icon="el-icon-plus" size="mini" @click="formData.contactList.push({})"></el-button> <el-button type="primary" icon="el-icon-plus" size="mini" @click="formData.contactList.push({})"></el-button>
...@@ -216,28 +236,257 @@ ...@@ -216,28 +236,257 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-card> </el-card>
<el-card class="mt-10">
<div class="card-header" slot="header">
<div class="title">{{$t('海运优质资源条件')}}</div>
</div>
<div>
<el-form-item :label="$t('供应商优势船公司')" prop="shipCompany" label-width="250">
<suppliers-selector v-model="formData.resourceVO.shipCompany" company-type="9" :disabled="false" />
</el-form-item>
</div>
<div>
<el-form-item :label="$t('海运船公司优势港口')" prop="ports" label-width="250">
<el-select v-model="formData.resourceVO.ports" filterable multiple clearable>
<el-option v-for="(item) in seaPort" :key="item.id" :label="$l(item, 'title')" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('港口优势条件')" prop="portConditions" label-width="250">
<dict-selector v-model="formData.resourceVO.portConditions" type="port_conditions" />
</el-form-item>
</div>
<div>
<el-form-item :label="$t('订舱公司')" prop="bookCompany" label-width="250">
<suppliers-selector v-model="formData.resourceVO.bookCompany" company-type="1" :disabled="false" />
</el-form-item>
<el-form-item :label="$t('订舱优势条件')" prop="bookConditions" label-width="250">
<dict-selector v-model="formData.resourceVO.bookConditions" type="book_conditions" />
</el-form-item>
</div>
<div>
<el-form-item :label="$t('拖车公司')" prop="trailerCompany" label-width="250">
<suppliers-selector v-model="formData.resourceVO.trailerCompany" company-type="4" :disabled="false" />
</el-form-item>
<el-form-item :label="$t('拖车优势条件')" prop="trailerConditions" label-width="250">
<dict-selector v-model="formData.resourceVO.trailerConditions" type="trailer_conditions" />
</el-form-item>
</div>
<div>
<el-form-item :label="$t('报关公司')" prop="customsCompany" label-width="250">
<suppliers-selector v-model="formData.resourceVO.customsCompany" company-type="2" :disabled="false" />
</el-form-item>
<el-form-item :label="$t('报关优势条件')" prop="customsConditions" label-width="250">
<dict-selector v-model="formData.resourceVO.customsConditions" type="customs_conditions" />
</el-form-item>
</div>
<div>
<el-form-item :label="$t('证书公司')" prop="certificateCompany" label-width="250">
<suppliers-selector v-model="formData.resourceVO.certificateCompany" company-type="3" :disabled="false" />
</el-form-item>
<el-form-item :label="$t('证书优势条件')" prop="certificateConditions" label-width="250">
<dict-selector v-model="formData.resourceVO.certificateConditions" type="certificate_conditions" />
</el-form-item>
</div>
<div>
<el-form-item :label="$t('合作不良记录登记')" prop="badCooperationRecord" label-width="250">
<el-input v-model="formData.resourceVO.badCooperationRecord" :placeholder="$t('请输入合作不良记录登记')" show-word-limit clearable></el-input>
</el-form-item>
</div>
</el-card>
<el-card class="mt-10">
<div class="card-header" slot="header">
<div class="title">{{$t('空运优质资源条件')}}</div>
</div>
<div>
<el-form-item :label="$t('空运优势机场')" prop="airdrome" label-width="250">
<el-select v-model="formData.resourceVO.airdrome" filterable multiple clearable>
<el-option v-for="(item) in airPort" :key="item.id" :label="$l(item, 'title')" :value="item.id"></el-option>
</el-select>
</el-form-item>
</div>
<div>
<el-form-item :label="$t('空运优势航空公司')" prop="airCompany" label-width="250">
<suppliers-selector v-model="formData.resourceVO.airCompany" company-type="10" :disabled="false" />
</el-form-item>
<el-form-item :label="$t('航空公司优势条件')" prop="airConditions" label-width="250">
<dict-selector v-model="formData.resourceVO.airConditions" type="port_conditions" />
</el-form-item>
</div>
<div>
<el-form-item :label="$t('订舱公司')" prop="bookCompanyAir" label-width="250">
<suppliers-selector v-model="formData.resourceVO.bookCompanyAir" company-type="5" :disabled="false" />
</el-form-item>
<el-form-item :label="$t('订舱优势条件')" prop="bookConditionsAir" label-width="250">
<dict-selector v-model="formData.resourceVO.bookConditionsAir" type="book_conditions" />
</el-form-item>
</div>
<div>
<el-form-item :label="$t('报关公司')" prop="customsCompanyAir" label-width="250">
<suppliers-selector v-model="formData.resourceVO.customsCompanyAir" company-type="7" :disabled="false" />
</el-form-item>
<el-form-item :label="$t('报关优势条件')" prop="customsConditionsAir" label-width="250">
<dict-selector v-model="formData.resourceVO.customsConditionsAir" type="customs_conditions" />
</el-form-item>
</div>
<div>
<el-form-item :label="$t('证书公司')" prop="certificateCompanyAir" label-width="250">
<suppliers-selector v-model="formData.resourceVO.certificateCompanyAir" company-type="3" :disabled="false" />
</el-form-item>
<el-form-item :label="$t('证书优势条件')" prop="certificateConditionsAir" label-width="250">
<dict-selector v-model="formData.resourceVO.certificateConditionsAir" type="certificate_conditions" />
</el-form-item>
</div>
<div>
<el-form-item :label="$t('合作不良记录登记')" prop="badCooperationRecordAir" label-width="250">
<el-input v-model="formData.resourceVO.badCooperationRecordAir" :placeholder="$t('请输入合作不良记录登记')" show-word-limit clearable></el-input>
</el-form-item>
</div>
</el-card>
</div>
<div v-if="formData.areaType==1">
<h1>代理商</h1>
<h2>收货人</h2>
<div class="supplier-item">
<el-form-item :label="$t('公司名称')" prop="receiveCompanyName">
<el-input v-model="formData.externalVO.receiveCompanyName" :placeholder="$t('请输入公司名称')" show-word-limit clearable></el-input>
</el-form-item>
<el-form-item :label="$t('地址')" prop="receiveAddress">
<el-input v-model="formData.externalVO.receiveAddress" :placeholder="$t('请输入地址')" show-word-limit clearable></el-input>
</el-form-item>
</div>
<div class="supplier-item">
<el-form-item :label="$t('电话')" prop="receiveTel">
<el-input v-model="formData.externalVO.receiveTel" :placeholder="$t('请输入电话')" show-word-limit clearable></el-input>
</el-form-item>
<el-form-item :label="$t('邮箱')" prop="receiveEmail">
<el-input v-model="formData.externalVO.receiveEmail" :placeholder="$t('请输入邮箱')" show-word-limit clearable></el-input>
</el-form-item>
</div>
<div style="display: flex;align-items: flex-end;">
<h2>通知方</h2>
<el-button style="margin-left: 30px;" type="text" @click="sameReceive">{{$t('与收货人相同')}}</el-button>
</div>
<div class="supplier-item">
<el-form-item :label="$t('公司名称')" prop="notifyCompanyName">
<el-input v-model="formData.externalVO.notifyCompanyName" :placeholder="$t('请输入公司名称')" show-word-limit clearable></el-input>
</el-form-item>
<el-form-item :label="$t('地址')" prop="notifyAddress">
<el-input v-model="formData.externalVO.notifyAddress" :placeholder="$t('请输入地址')" show-word-limit clearable></el-input>
</el-form-item>
</div>
<div class="supplier-item">
<el-form-item :label="$t('电话')" prop="notifyTel">
<el-input v-model="formData.externalVO.notifyTel" :placeholder="$t('请输入电话')" show-word-limit clearable></el-input>
</el-form-item>
<el-form-item :label="$t('邮箱')" prop="notifyEmail">
<el-input v-model="formData.externalVO.notifyEmail" :placeholder="$t('请输入邮箱')" show-word-limit clearable></el-input>
</el-form-item>
</div>
<h2>货物描述</h2>
<div class="supplier-item">
<el-form-item :label="$t('品名')" prop="goodName">
<el-input v-model="formData.externalVO.goodName" :placeholder="$t('请输入品名')" show-word-limit clearable></el-input>
</el-form-item>
<el-form-item :label="$t('清关国家')" prop="clearanceFileId">
<el-select v-model="formData.externalVO.clearanceFileId" @change="changeFile">
<el-option v-for="(item) in fileList" :value="item.id" :label="getCountry(item.country,item.district)" :key="item.id" />
</el-select>
</el-form-item>
<el-button type="text" @click="addFileNo" v-hasPermi="['ecw:supplier:addno']">{{$t('新增清关文件号码')}}</el-button>
</div>
<div class="supplier-item">
<el-form-item :label="$t('From M No')" prop="fromNo">
<el-input v-model="formData.externalVO.fromNo" :placeholder="$t('请输入From M No')" show-word-limit clearable></el-input>
</el-form-item>
<el-form-item :label="$t('BA NO')" prop="baNo">
<el-input v-model="formData.externalVO.baNo" :placeholder="$t('请输入BA NO')" show-word-limit clearable></el-input>
</el-form-item>
</div>
<div class="supplier-item">
<el-form-item :label="$t('包装数量')" prop="packNum">
<el-input v-model="formData.externalVO.packNum" :placeholder="$t('请输入包装数量')" show-word-limit clearable></el-input>
</el-form-item>
<el-form-item :label="$t('包装单位')" prop="packUnit">
<el-input v-model="formData.externalVO.packUnit" :placeholder="$t('请输入包装单位')" show-word-limit clearable></el-input>
</el-form-item>
</div>
<div>
<el-form-item :label="$t('清关要求')" prop="clearanceRequireData">
<el-select v-model="formData.externalVO.clearanceRequireData" @change="changeRequire">
<el-option v-for="(item) in requireData" :value="item" :label="item" :key="item" />
</el-select>
</el-form-item>
<el-form-item v-if="formData.externalVO.clearanceRequireData=='自定义'" :label="$t('自定义要求')" prop="clearanceRequire">
<el-input v-model="formData.externalVO.clearanceRequire" :placeholder="$t('请输入自定义要求')" show-word-limit clearable></el-input>
</el-form-item>
</div>
<div>
<el-form-item :label="$t('是否提供')" prop="provide">
<el-radio v-model="formData.externalVO.provide" :label="1">{{$t('提供')}}</el-radio>
<el-radio v-model="formData.externalVO.provide" :label="2">{{$t('不提供')}}</el-radio>
</el-form-item>
</div>
<div>
<el-form-item :label="$t('合作不良记录登记')" prop="badCooperationRecord" label-width="250">
<el-input v-model="formData.externalVO.badCooperationRecord" :placeholder="$t('请输入合作不良记录登记')" show-word-limit clearable></el-input>
</el-form-item>
</div>
</div>
<el-form-item size="large" class="mt-20"> <el-form-item size="large" class="mt-20">
<el-button type="primary" @click="submitForm">{{$t('提交')}}</el-button> <el-button type="primary" @click="submitForm">{{$t('提交')}}</el-button>
<el-button @click="resetForm">{{$t('重置')}}</el-button> <el-button @click="resetForm">{{$t('重置')}}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-dialog :title="$t('新增清关号码')" :visible.sync="showFileNoDialog" width="400px" :close-on-click-modal="false">
<el-form ref="fileNoForm" :model="fileNoForm" :rules="fileNoRules">
<el-form-item :label="$t('国家')" prop="country">
<el-select v-model="fileNoForm.country">
<el-option v-for="(item) in treeList" :value="item.id" :label="$l(item, 'title')" :key="item.id" />
</el-select>
</el-form-item>
<el-form-item :label="$t('地区')" prop="district">
<el-select v-model="fileNoForm.district">
<el-option v-for="dict in districtList" :key="dict.id" :label="$l(dict, 'title')" :value="dict.id" />
</el-select>
</el-form-item>
<el-form-item :label="$t('From M No')" prop="fromNo">
<el-input v-model="fileNoForm.fromNo" :placeholder="$t('请输入From M No')" show-word-limit clearable></el-input>
</el-form-item>
<el-form-item :label="$t('BA NO')" prop="baNo">
<el-input v-model="fileNoForm.baNo" :placeholder="$t('请输入BA NO')" show-word-limit clearable></el-input>
</el-form-item>
<div class="mt-10 center">
<el-button type="primary" @click="addfile">{{$t('新增')}}</el-button>
<el-button type="default" @click="showFileNoDialog=false">{{$t('取消')}}</el-button>
</div>
</el-form>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { createSupplier, updateSupplier, getSupplier} from "@/api/ecw/supplier"; import { createSupplier, updateSupplier, getSupplier, createFileNo, getFileNoPage} from "@/api/ecw/supplier";
import upload from '@/components/ImageUpload' import upload from '@/components/ImageUpload'
import { getListTree } from "@/api/ecw/region"; import { getListTree } from "@/api/ecw/region";
import AreaSelector from '@/components/AreaSelector' import AreaSelector from '@/components/AreaSelector'
import {getCurrencyList} from '@/api/ecw/currency' import {getCurrencyList} from '@/api/ecw/currency'
import Selector from '@/components/Selector' import Selector from '@/components/Selector'
import {validatePwd} from '@/api/ecw/busiPwd' import {validatePwd} from '@/api/ecw/busiPwd'
import SuppliersSelector from '@/components/SuppliersSelector'
import { getDockPage } from "@/api/ecw/dock";
export default { export default {
components: {upload, AreaSelector, Selector}, components: {upload, AreaSelector, Selector, SuppliersSelector},
props: [], props: [],
data() { data() {
return { return {
disabled: false,
formData: { formData: {
areaType: 0,
companyZh: undefined, companyZh: undefined,
agentName: undefined, agentName: undefined,
tell: "", tell: "",
...@@ -246,11 +495,15 @@ export default { ...@@ -246,11 +495,15 @@ export default {
field110: undefined, field110: undefined,
companyTypeArr: [], companyTypeArr: [],
cooperationType: undefined, cooperationType: undefined,
settlementPeriod: undefined,
priceAdvantage: undefined,
license: null, license: null,
contract: null, contract: null,
licenseNumber: undefined, licenseNumber: undefined,
contactList:[], contactList:[],
bankList: [] bankList: [],
resourceVO: {},
externalVO: {}
}, },
rules: { rules: {
companyZh: [{ companyZh: [{
...@@ -278,11 +531,35 @@ export default { ...@@ -278,11 +531,35 @@ export default {
treeList:[], treeList:[],
provinceList:[], provinceList:[],
cityList:[], cityList:[],
currencyList:[] // 码头
allDocks: [],
currencyList:[],
requireData: [
'COO证书','CXX证书','ABC证书','QWE证书','自定义'
],
fileList: [],
fileNoForm: {},
fileNoRules: {
country: [{required: true,message: this.$t('请输入国家'),trigger: 'blur'}],
district: [{required: true,message: this.$t('请输入地区'),trigger: 'blur'}],
fromNo: [{required: true,message: this.$t('请输入From M No'),trigger: 'blur'}],
baNo: [{required: true,message: this.$t('请输入BA NO'),trigger: 'blur'}],
},
showFileNoDialog: false
} }
}, },
computed: { computed: {
airPort(){
return this.allDocks.filter(item => item.portType == 1)
},
seaPort(){
return this.allDocks.filter(item => item.portType == 2)
},
districtList(){
if(!this.fileNoForm.country) return []
let country = this.treeList.find(item => item.id == this.fileNoForm.country)
return country && country.children || []
},
}, },
watch: { watch: {
'formData.country'(country){ 'formData.country'(country){
...@@ -307,19 +584,64 @@ export default { ...@@ -307,19 +584,64 @@ export default {
getCurrencyList().then(res => { getCurrencyList().then(res => {
this.currencyList = res.data this.currencyList = res.data
}) })
// 码头
getDockPage({ pageNo: "1", pageSize: "10000" }).then((res) => {
this.allDocks = res.data.list;
});
this.getFile()
// 回显数据需要在加载了地区数据之后,否则无法正常回显 // 回显数据需要在加载了地区数据之后,否则无法正常回显
getListTree({treeType: 1}).then(response => { getListTree({treeType: 1}).then(response => {
this.treeList = response.data this.treeList = response.data
if(this.$route.query.id){ if(this.$route.query.id){
this.disabled = true
getSupplier(this.$route.query.id).then(response => { getSupplier(this.$route.query.id).then(response => {
/* response.data.companyType = response.data.companyType.split(",") || [] */ /* response.data.companyType = response.data.companyType.split(",") || [] */
this.formData = response.data this.formData = response.data
this.$set(this.formData, 'companyTypeArr', response.data.companyType?.split(",") || [])
this.$set(this.formData, 'companyTypeArr', this.strToArray(response.data.companyType))
this.$set(this.formData, 'settlementPeriod', response.data.settlementPeriod==0?null:response.data.settlementPeriod)
this.formData.bankList.forEach(item => { this.formData.bankList.forEach(item => {
item.currency = +item.currency item.currency = +item.currency
}) })
if(response.data.resourceBackVO){
this.formData.resourceVO = response.data.resourceBackVO
this.formData.externalVO = response.data.externalBackVO??{}
this.$set(this.formData.resourceVO,'shipCompany',this.strToArray(response.data.resourceBackVO.shipCompany))
this.$set(this.formData.resourceVO,'ports',this.strToArray(response.data.resourceBackVO.ports))
this.$set(this.formData.resourceVO,'bookCompany',this.strToArray(response.data.resourceBackVO.bookCompany))
this.$set(this.formData.resourceVO,'trailerCompany',this.strToArray(response.data.resourceBackVO.trailerCompany))
this.$set(this.formData.resourceVO,'customsCompany',this.strToArray(response.data.resourceBackVO.customsCompany))
this.$set(this.formData.resourceVO,'certificateCompany',this.strToArray(response.data.resourceBackVO.certificateCompany))
this.$set(this.formData.resourceVO,'airdrome',this.strToArray(response.data.resourceBackVO.airdrome))
this.$set(this.formData.resourceVO,'airCompany',this.strToArray(response.data.resourceBackVO.airCompany))
this.$set(this.formData.resourceVO,'bookCompanyAir',this.strToArray(response.data.resourceBackVO.bookCompanyAir))
this.$set(this.formData.resourceVO,'customsCompanyAir',this.strToArray(response.data.resourceBackVO.customsCompanyAir))
this.$set(this.formData.resourceVO,'certificateCompanyAir',this.strToArray(response.data.resourceBackVO.certificateCompanyAir))
}
if(response.data.externalBackVO){
this.formData.externalVO = response.data.externalBackVO
this.formData.resourceVO = response.data.resourceBackVO??{}
this.$set(this.formData.externalVO,'receiveCompanyName',response.data.externalBackVO.receiveCompanyName)
this.$set(this.formData.externalVO,'receiveAddress',response.data.externalBackVO.receiveAddress)
this.$set(this.formData.externalVO,'receiveTel',response.data.externalBackVO.receiveTel)
this.$set(this.formData.externalVO,'receiveEmail',response.data.externalBackVO.receiveEmail)
this.$set(this.formData.externalVO,'notifyCompanyName',response.data.externalBackVO.notifyCompanyName)
this.$set(this.formData.externalVO,'notifyAddress',response.data.externalBackVO.notifyAddress)
this.$set(this.formData.externalVO,'notifyTel',response.data.externalBackVO.notifyTel)
this.$set(this.formData.externalVO,'notifyEmail',response.data.externalBackVO.notifyEmail)
this.$set(this.formData.externalVO,'goodName',response.data.externalBackVO.goodName)
this.$set(this.formData.externalVO,'clearanceFileId',response.data.externalBackVO.clearanceFileId)
this.$set(this.formData.externalVO,'fromNo',response.data.externalBackVO.fromNo)
this.$set(this.formData.externalVO,'baNo',response.data.externalBackVO.baNo)
this.$set(this.formData.externalVO,'packNum',response.data.externalBackVO.packNum)
this.$set(this.formData.externalVO,'packUnit',response.data.externalBackVO.packUnit)
this.$set(this.formData.externalVO,'clearanceRequireData',['COO证书','CXX证书','ABC证书','QWE证书'].includes(response.data.externalBackVO.clearanceRequire)?response.data.externalBackVO.clearanceRequire:'自定义')
this.$set(this.formData.externalVO,'clearanceRequire',response.data.externalBackVO.clearanceRequire)
this.$set(this.formData.externalVO,'provide',response.data.externalBackVO.provide)
this.$set(this.formData.externalVO,'badCooperationRecord',response.data.externalBackVO.badCooperationRecord)
}
}); });
} }
}) })
...@@ -327,6 +649,58 @@ export default { ...@@ -327,6 +649,58 @@ export default {
}, },
mounted() {}, mounted() {},
methods: { methods: {
strToArray(val) {
if(!val || val == '') {
return []
}else{
let data = val.split(",")
return data.map(item=>Number(item))
}
},
sameReceive() {
this.$set(this.formData.externalVO,'notifyCompanyName',this.formData.externalVO.receiveCompanyName)
this.$set(this.formData.externalVO,'notifyAddress',this.formData.externalVO.receiveAddress)
this.$set(this.formData.externalVO,'notifyTel',this.formData.externalVO.receiveTel)
this.$set(this.formData.externalVO,'notifyEmail',this.formData.externalVO.receiveEmail)
},
addFileNo() {
this.showFileNoDialog = true
this.$refs.fileNoForm.resetFields()
},
getFile() {
getFileNoPage().then(res => {
this.fileList = res.data.list
})
},
addfile() {
this.$refs.fileNoForm.validate(vaild=>{
if(vaild){
createFileNo(this.fileNoForm).then(()=>{
this.showFileNoDialog = false
this.getFile()
})
}else{
this.$message.error(this.$t('请完整填写表单'))
}
})
},
changeFile(val) {
let file = this.fileList.find(item=>item.id == val)
this.$set(this.formData.externalVO,'fromNo',file.fromNo)
this.$set(this.formData.externalVO,'baNo',file.baNo)
},
changeRequire(val) {
if(val != '自定义'){
this.$set(this.formData.externalVO,'clearanceRequire',val)
}else{
this.$set(this.formData.externalVO,'clearanceRequire','')
}
},
getCountry(countryId, districtId) {
let country = this.treeList.find(item=>item.id == countryId)
let district = country.children.find(item=>item.id == districtId)
return this.$l(country, 'title')+' '+this.$l(district, 'title')
},
delContact(index){ delContact(index){
this.$confirm(this.$t('确定删除此联系人么?')).then(() => { this.$confirm(this.$t('确定删除此联系人么?')).then(() => {
this.formData.contactList.splice(index, 1) this.formData.contactList.splice(index, 1)
...@@ -367,14 +741,32 @@ export default { ...@@ -367,14 +741,32 @@ export default {
if (!valid) { if (!valid) {
return this.$showFormValidateErrors(errors) return this.$showFormValidateErrors(errors)
} }
if(!this.formData.bankList.length){ if(this.formData.areaType == 0){
return this.$message.error(this.$t('请添加银行信息')) if(!this.formData.bankList.length){
return this.$message.error(this.$t('请添加银行信息'))
}
if(!this.formData.contactList.length){
return this.$message.error(this.$t('请添加联系人信息'))
}
} }
if(!this.formData.contactList.length){
return this.$message.error(this.$t('请添加联系人信息')) let data = JSON.parse(JSON.stringify(this.formData))
if(this.formData.areaType == 0) {
data.resourceVO.shipCompany = data.resourceVO.shipCompany?.toString()
data.resourceVO.ports = data.resourceVO.ports?.toString()
data.resourceVO.bookCompany = data.resourceVO.bookCompany?.toString()
data.resourceVO.trailerCompany = data.resourceVO.trailerCompany?.toString()
data.resourceVO.customsCompany = data.resourceVO.customsCompany?.toString()
data.resourceVO.certificateCompany = data.resourceVO.certificateCompany?.toString()
data.resourceVO.airdrome = data.resourceVO.airdrome?.toString()
data.resourceVO.airCompany = data.resourceVO.airCompany?.toString()
data.resourceVO.bookCompanyAir = data.resourceVO.bookCompanyAir?.toString()
data.resourceVO.customsCompanyAir = data.resourceVO.customsCompanyAir?.toString()
data.resourceVO.certificateCompanyAir = data.resourceVO.certificateCompanyAir?.toString()
}else{
delete data.resourceVO
} }
let data = Object.assign({}, this.formData)
// 修改的提交 // 修改的提交
if (data.id != null) { if (data.id != null) {
...@@ -417,4 +809,8 @@ export default { ...@@ -417,4 +809,8 @@ export default {
.red{ .red{
color: red; color: red;
} }
.supplier-item{
margin-left: 30px;
}
</style> </style>
...@@ -66,6 +66,8 @@ ...@@ -66,6 +66,8 @@
</el-table-column> </el-table-column>
<el-table-column fixed="right" :label="$t('操作')" align="center" class-name="small-padding fixed-width"> <el-table-column fixed="right" :label="$t('操作')" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleDetail(scope.row)"
v-hasPermi="['ecw:supplier:query']">{{$t('详情')}}</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['ecw:supplier:update']">{{$t('修改')}}</el-button> v-hasPermi="['ecw:supplier:update']">{{$t('修改')}}</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
...@@ -198,6 +200,11 @@ export default { ...@@ -198,6 +200,11 @@ export default {
handleAdd() { handleAdd() {
return this.$router.push('/supplier/edit') return this.$router.push('/supplier/edit')
}, },
/** 详情按钮操作 */
handleDetail(row) {
return this.$router.push('detail?id=' + row.id)
},
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment