Commit bb983352 authored by dragondean@qq.com's avatar dragondean@qq.com

完善订单和报价单

parent 2a96bde2
......@@ -69,6 +69,7 @@
"vue-ueditor-wrap": "^2.5.6",
"vuedraggable": "2.24.3",
"vuex": "3.6.0",
"xlsx": "^0.18.5",
"xml-js": "^1.6.11"
},
"devDependencies": {
......
......@@ -37,25 +37,32 @@ export default {
.flex-1{
flex: 1;
}
.ml-10{
margin-left: 10px;
.center{
align-content: center;
text-align: center;
}
.mr-10{
margin-right: 10px;
}
.mb-10{
margin-bottom: 10px;
}
.mt-10{
margin-top: 10px;
}
.w-100{
width: 100px;
}
.w-150{
width: 150px;
.flex-center{
display: flex;
align-items: center;
justify-content: center;
}
.w-200{
width: 200px;
$sizes: 10,20,30,50,100,200,500,800,1000;
@for $i from 1 through length($sizes){
$item: nth($sizes, $i);
.ml-#{$item}{
margin-left: #{$item}px;
}
.mr-#{$item}{
margin-right: #{$item}px;
}
.mb-#{$item}{
margin-bottom: #{$item}px;
}
.mt-#{$item}{
margin-top: #{$item}px;
}
.w-#{$item}{
width: #{$item}px;
}
}
</style>
......@@ -3,10 +3,10 @@
<el-select v-model="formData.country">
<el-option v-for="(item) in treeList" :value="item.id" :label="item.titleZh" :key="item.id" />
</el-select>
<el-select v-model="formData.province">
<el-select v-model="formData.province" class="ml-10">
<el-option v-for="(item) in provinceList" :value="item.id" :label="item.titleZh" :key="item.id" />
</el-select>
<el-select v-model="formData.city">
<el-select v-model="formData.city" class="ml-10">
<el-option v-for="(item) in cityList" :value="item.id" :label="item.titleZh" :key="item.id" />
</el-select>
</div>
......
......@@ -10,66 +10,72 @@
<el-radio label="2">收件人</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="订单类型" style="margin-bottom: 0">
<el-checkbox-group v-model="form.type">
<el-checkbox label="1">集运服务</el-checkbox>
<!-- <el-checkbox label="2">海外仓</el-checkbox> -->
</el-checkbox-group>
</el-form-item>
<el-descriptions :column="3" border>
<el-descriptions-item label="*发货人" >
<el-descriptions-item label="*发货人" :labelStyle="labelStyle" >
<el-form-item label="" label-width="0" style="margin-bottom: 0" prop="consignorId" required error="发货人不能为空">
<customer-contact-selector v-model="form.consignorId" @change="consignor = $event" />
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="发货人">
<el-descriptions-item label="发货人" :labelStyle="labelStyle">
{{consignor.contactsName || ''}}
</el-descriptions-item>
<el-descriptions-item label="手机号">
<el-descriptions-item label="手机号" :labelStyle="labelStyle">
{{consignor.areaCode}} {{consignor.phoneNew || ''}}
</el-descriptions-item>
<el-descriptions-item label="发货人公司">
{{consignor.customerName || ''}}
</el-descriptions-item>
<el-descriptions-item label="客户来源">
{{consignor.source || ''}} // TODO
<el-descriptions-item label="发货人公司名称" :labelStyle="labelStyle">
{{consignor.company || ''}}
</el-descriptions-item>
<el-descriptions-item label="客户来源" :labelStyle="labelStyle">
{{consignor.email || ''}}
</el-descriptions-item><!--
<el-descriptions-item label="社交软件">
{{consignor.social}} {{consignor.socialNumber}}
</el-descriptions-item>
<el-descriptions-item label="联系地址">
{{consignor.address || ''}}
{{consignor.address || ''}} -->
</el-descriptions-item>
</el-descriptions>
<el-descriptions :column="3" border>
<el-descriptions-item label="*收货人">
<el-descriptions-item label="*收货人" :labelStyle="labelStyle">
<el-form-item label="" label-width="0" style="margin-bottom: 0" prop="consigneeId" required error="收货人不能为空">
<customer-contact-selector v-model="form.consigneeId" @change="consignee = $event" />
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="收货人">
<el-descriptions-item label="收货人" :labelStyle="labelStyle">
{{consignee.contactsName || ''}}
</el-descriptions-item>
<el-descriptions-item label="手机号">
<el-descriptions-item label="手机号" :labelStyle="labelStyle">
{{consignee.areaCode}} {{consignee.phoneNew}}
</el-descriptions-item>
<el-descriptions-item label="收货人公司">
{{consignee.customerName || ''}}
</el-descriptions-item>
<el-descriptions-item label="客户来源">
{{consignee.source || ''}} // TODO
<el-descriptions-item label="发货人公司名称" :labelStyle="labelStyle">
{{consignee.company || ''}}
</el-descriptions-item>
<el-descriptions-item label="Email" :labelStyle="labelStyle">
{{consignee.email || ''}}
</el-descriptions-item><!--
<el-descriptions-item label="社交软件">
{{consignee.social}} {{consignee.socialNumber}}
</el-descriptions-item>
<el-descriptions-item label="联系地址">
{{consignee.address || ''}} // TODO
</el-descriptions-item>
</el-descriptions-item> -->
</el-descriptions>
<el-descriptions :column="2" border>
<el-descriptions-item label="*运输方式">
<el-descriptions-item label="*运输方式" :labelStyle="labelStyle">
<el-form-item label="" label-width="0" style="margin-bottom: 0" prop="transportId" required error="请选择运输方式">
<dict-selector :type="DICT_TYPE.ECW_TRANSPORT_TYPE" v-model="form.transportId" @input="calculationPrice" />
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="出货渠道">
<el-descriptions-item label="出货渠道" v-if="getDictData(DICT_TYPE.ECW_TRANSPORT_TYPE, form.transportId).cssClass == 'channel'" :labelStyle="labelStyle">
<el-form-item label="" label-width="0" style="margin-bottom: 0" prop="channelId" :required="getDictData(DICT_TYPE.ECW_TRANSPORT_TYPE, form.transportId).cssClass == 'channel'" error="请选择出货渠道">
<selector
:disabled="getDictData(DICT_TYPE.ECW_TRANSPORT_TYPE, form.transportId).cssClass != 'channel'"
......@@ -81,22 +87,23 @@
></selector>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="*始发城市">
</el-descriptions>
<el-descriptions :column="2" border>
<el-descriptions-item label="*始发城市" :labelStyle="labelStyle">
<el-form-item label="" label-width="0" style="margin-bottom: 0" prop="departureId" required error="始发地必选">
<el-select v-model="form.departureId" placeholder="请选择始发地">
<el-option v-for="item in expoerCityList" :label="item.titleZh" :value="item.id" :key="item.id"></el-option>
</el-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="*目的城市">
<el-descriptions-item label="*目的城市" :labelStyle="labelStyle">
<el-form-item label="" label-width="0" style="margin-bottom: 0" prop="objectiveId" required error="目的城市必选">
<el-select v-model="form.objectiveId" placeholder="请选择始发地">
<el-option v-for="item in importCityList" :label="item.titleZh" :value="item.id" :key="item.id"></el-option>
</el-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="*请选择线路" :span="2">
<el-descriptions-item label="*请选择线路" :span="2" :labelStyle="labelStyle">
<el-row :gutter="10">
<el-col :span="12">
<el-input :value="getRouterNameById(form.lineId)" readonly placeholder="请在右侧选择线路"></el-input>
......@@ -222,7 +229,7 @@
全包价:{{row.fee.freight}} {{currentcyMap[row.fee.freightCurrency]}} / {{unitMap[row.fee.freightVolume]}}
</template>
</template>
<template v-else-if="!row.fee.freight && !row.fee.clearanceFee">未报价</template>
<template v-else-if="!row.fee || !row.fee.freight && !row.fee.clearanceFee">未报价</template>
<template v-else-if="row.fee">
<div>
运费:{{row.fee.freight}} {{currentcyMap[row.fee.freightCurrency]}} / {{unitMap[row.fee.freightVolume]}}
......@@ -435,7 +442,9 @@ export default {
fee: {}, // 费用
// 表单参数
form: {
sendstatus:0
sendstatus:0,
type: [],
isCargoControl: false,
},
// 表单校验
rules: {
......@@ -443,7 +452,8 @@ export default {
consignorId: [{ required: true, message: "客户id,发货人不能为空", trigger: "blur" }],
consigneeId: [{ required: true, message: "收货人id不能为空", trigger: "blur" }],
sendstatus: [{ required: true, message: "站内信状态,0未发送,1已发送不能为空", trigger: "blur" }], */
}
},
labelStyle: 'width:120px',
};
},
computed:{
......@@ -477,6 +487,11 @@ export default {
transport(){
return this.transportList.find(item => item.value == this.form.transportId)
},
selectedRouter(){
// otherService 1 送货上门,2非控货订单代收货款
if(!this.form.lineId)return null
return this.routerList.find(item => item.id == this.form.lineId)
},
currentMap(){
let map = {}
this.currencyList.forEach(item => {
......@@ -522,7 +537,13 @@ export default {
},
'form.channelId'(){
this.getOpenedRouterList()
}
},
'form.lineId'(lineId){
let router = this.routerList.find(item => item.id == lineId)
this.$set(this.form, 'departureId', router.startCityId)
this.$set(this.form, 'objectiveId', router.destCityId)
// TODO 还需要回填渠道信息,暂时缺少渠道ID
},
},
created() {
getProductAttrList().then(res => this.productAttrList = res.data)
......@@ -530,12 +551,7 @@ export default {
getTradeCityList().then(res => this.tradeCityList = res.data)
getCurrencyList().then(res => this.currencyList = res.data)
getUnitList().then(res => this.unitList = res.data)
this.getDictDatas(this.DICT_TYPE.ECW_TRANSPORT_TYPE).forEach(res => {
this.transportList.push({
transportId: +res.value, // 转为整形
label: res.label,
})
})
this.transportList = this.getDictDatas(this.DICT_TYPE.ECW_TRANSPORT_TYPE)
if(this.$route.query.id){
getOffer(this.$route.query.id).then(res => {
......
......@@ -4,8 +4,15 @@
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-card>
<div slot="header" class="card-title">新建订单</div>
<el-descriptions :column="3" border>
<el-form-item label="订单类型" style="margin-bottom: 0">
<el-checkbox-group v-model="form.type">
<el-checkbox label="1">集运服务</el-checkbox>
<el-checkbox label="2">海外仓</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-descriptions :column="3" border v-if="form.type.indexOf(1) < 0">
<el-descriptions-item label="*发货人" :labelStyle="labelStyle">
<el-form-item label="" label-width="0" style="margin-bottom: 0" prop="consignorContactsId" required error="发货人不能为空">
<customer-contact-selector v-model="form.consignorContactsId" @change="consignorContact = $event" />
......@@ -15,7 +22,7 @@
{{consignorContact.phoneNew || ''}}
</el-descriptions-item>
<el-descriptions-item label="发货人公司" :labelStyle="labelStyle">
{{consignorContact.customerName || ''}}
{{consignorContact.company || ''}}
</el-descriptions-item>
<el-descriptions-item label="Email" :labelStyle="labelStyle">
{{consignorContact.email || ''}}
......@@ -31,7 +38,7 @@
{{consigneeContact.phoneNew || ''}}
</el-descriptions-item>
<el-descriptions-item label="收货人公司" :labelStyle="labelStyle">
{{consigneeContact.customerName || ''}}
{{consigneeContact.company || ''}}
</el-descriptions-item>
<el-descriptions-item label="Email" :labelStyle="labelStyle">
{{consigneeContact.email || ''}}
......@@ -90,7 +97,7 @@
<div slot="header" class="card-title">
<div class="card-name">商品信息</div>
<el-button type="primary" size="mini" @click="addProduct(null)">添加货物</el-button>
<el-button type="primary" size="mini">批量添加货物</el-button>
<el-button type="primary" size="mini" @click="showBatchImportDialog=true">批量添加货物</el-button>
</div>
<el-table :data="productList" border>
<el-table-column label="序号" width="60px" fixed>
......@@ -162,7 +169,7 @@
</template>
</el-table-column>
<el-table-column label="运费" width="200px">
<!-- <el-table-column label="运费" width="200px">
<template slot-scope="{row}">
<template v-if="row.fee && row.fee.charging == 1">
<template v-if="!row.fee.freight">未报价</template>
......@@ -180,7 +187,7 @@
</div>
</template>
</template>
</el-table-column>
</el-table-column> -->
<el-table-column label="是否预付">
<template slot-scope="{row}">
<dict-tag v-if="row.fee" :type="DICT_TYPE.ECW_PAY_ADVANCE" :value="row.fee.isPayAdvance" />
......@@ -196,7 +203,7 @@
</el-card>
<el-card class="mt-10"> -->
<div class="card-title" style="padding:20px 0;">合计</div>
<el-descriptions :column="4" border>
<el-descriptions :column="6" border>
<el-descriptions-item label="总件数">
{{sum.totalNum || 0}}
</el-descriptions-item>
......@@ -206,16 +213,19 @@
<el-descriptions-item label="总重量">
{{sum.totalWeight || 0}}kg
</el-descriptions-item>
<el-descriptions-item label="数量">
<el-descriptions-item label="数量">
{{sum.totalWorth || 0}}
</el-descriptions-item>
<el-descriptions-item label="总货值(RMB)">
{{sum.totalWorth || 0}}元
</el-descriptions-item>
<el-descriptions-item label="保价费">
{{fee.insuranceFee || 0}} 美元
</el-descriptions-item>
</el-descriptions>
</el-card>
<el-card class="mt-10">
<el-card class="mt-10" v-if="0">
<div class="card-title" slot="header">预计费用</div>
<el-descriptions :column="5" border>
......@@ -288,8 +298,8 @@
<dict-selector :type="DICT_TYPE.INFRA_BOOLEAN_STRING" formatter="bool" v-model="form.isCollection" form-type="radio" />
</el-descriptions-item>
<el-descriptions-item label="代收货款金额" v-if="collectionProxy">
<el-input v-model="form.collectionProxy" placeholder="" style="width:200px"></el-input>
<selector v-model="form.collectionProxyCurrency" :options="currencyList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
<el-input v-model="form.collectionProxy" placeholder="" class="w-200 mr-10"></el-input>
<selector v-model="form.collectionProxyCurrency" :options="currencyList" label-field="titleZh" value-field="id" defaultable class="w-100" />
</el-descriptions-item>
<el-descriptions-item label="单证报关" :span="2">
......@@ -390,6 +400,35 @@
</el-form-item>
</el-form>
<el-dialog title="批量导入" :visible.sync="showBatchImportDialog" width="1000px" :close-on-click-modal="false">
<el-steps :active="importData.length > 0 ? 1 : 0" finish-status="success" class="w-500" style="margin: 20px auto">
<el-step title="上传集装箱"></el-step>
<el-step title="开始导入"></el-step>
<el-step title="完成"></el-step>
</el-steps>
<div class="mt-20">
<el-input type="file" @input="onFileChoosed" class="w-200 mr-10"></el-input>
<el-button type="info" @click="downloadTpl">装箱单模板</el-button>
</div>
<el-table :data="importData" class="mt-10" height="300">
<el-table-column label="序号"></el-table-column>
<el-table-column label="产品名称"></el-table-column>
<el-table-column label="英文名称"></el-table-column>
<el-table-column label="品牌"></el-table-column>
<el-table-column label="箱数"></el-table-column>
<el-table-column label="重量"></el-table-column>
<el-table-column label="体积"></el-table-column>
<el-table-column label="有无单证"></el-table-column>
<el-table-column label="缺货箱数"></el-table-column>
<el-table-column label="数量"></el-table-column>
<el-table-column label="材质"></el-table-column>
</el-table>
<div class="mt-10 center">
<el-button type="primary">下一步</el-button>
<el-button type="default" @click="showBatchImportDialog=false">取消</el-button>
</div>
</el-dialog>
</div>
</template>
......@@ -409,6 +448,9 @@ import { getCustomer } from '@/api/ecw/customer';
import AreaSelector from '@/components/AreaSelector'
import {calculationPrice} from '@/api/ecw/product'
import {getCustomerAvailableCouponList} from '@/api/ecw/coupon'
import * as xlsx from 'xlsx'
window.xlsx = xlsx
export default {
name: "OrderEdit",
components: {
......@@ -441,6 +483,7 @@ export default {
form: {
sendstatus:0,
isCargoControl: false,
type:[]
},
// 表单校验
......@@ -448,6 +491,8 @@ export default {
},
labelStyle: 'width:120px',
showBatchImportDialog: false, // 显示批量导入弹窗
importData:[]
};
},
computed:{
......@@ -593,6 +638,7 @@ export default {
item.prodAttrArr = item.prodAttrIds.split(',').filter(item => item != '')
this.addProduct(Object.assign({}, item))
})
this.form.type = this.form.type ? this.form.type.split(',').filter(item => item != '') : []
})
}else this.addProduct()
......@@ -611,6 +657,24 @@ export default {
})
},
methods: {
downloadTpl(){
window.open('http://v4.groupage.cn/Download/%E8%A3%85%E7%AE%B1%E5%8D%95%E6%A8%A1%E6%9D%BF.xls')
},
onFileChoosed(e){
window.choosed = e
console.log('onFileChoosed', e)
const reader = new FileReader();
reader.readAsBinaryString(e.target.files[0]);
reader.onload = function(e) {
const data = e.target.result;
const zzexcel = xlsx.read(data, {
type: 'binary'
})
window.zzexcel = zzexcel
window.tableJson = xlsx.utils.sheet_to_json(zzexcel.Sheets[zzexcel.SheetNames[0]])
}
},
onProductChange(row, product){
console.log(product)
row.goodsType = product ? product.typeId : null
......@@ -734,6 +798,7 @@ export default {
orderItemVOList: this.productList,
couponIds: coupons.join(",")
})
data.type = data.type.join(',')
updateOrder(data).then(response => {
this.$modal.msgSuccess("修改成功");
this.$router.back()
......@@ -751,6 +816,7 @@ export default {
// transportUpdateReqVOList: this.transportList.filter(item => item._enabled),
orderItemVOList: this.productList
})
data.type = data.type.join(',')
// 添加的提交
createOrder(data).then(response => {
this.$modal.msgSuccess("新增成功");
......@@ -770,7 +836,7 @@ export default {
flex: 1;
}
}
.mt-10{
/* .mt-10{
margin-top: 10px;
}
} */
</style>
\ No newline at end of file
......@@ -177,6 +177,7 @@
v-hasPermi="['ecw:order:update']">特价</el-button>
<el-button type="text" size="mini" @click="$router.push(`/order/release?orderId=${scope.row.orderId}`)">确认放货</el-button>
<el-button type="text" size="mini" @click="$router.push(`/order/singleApply?orderNo=${scope.row.orderNo}`)">合单申请</el-button>
</div>
</el-popover>
......
......@@ -185,11 +185,10 @@ export default {
},
created() {
if (this.$route.query.orderNo) {
this.queryParams.mergedOrderNo = op.orderNo
this.getList()
}else{
this.getList()
this.queryParams.mergedOrderNo = this.$route.query.orderNo
}
this.getList()
getTradeCityList().then(res => this.tradeCityList = res.data)
},
methods: {
......
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