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

改bug

parent 846e2f0c
......@@ -98,3 +98,12 @@ export function getTradeCityList(query) {
params: query
})
}
export function listByIds(params){
return request({
url: '/ecw/region/listByIds',
method: 'get',
params
})
}
\ No newline at end of file
<template>
<div>
<el-select v-model="formData.country">
<el-select v-model="formData.country" :disabled="readonly">
<el-option v-for="(item) in treeList" :value="item.id" :label="item.titleZh" :key="item.id" />
</el-select>
<el-select v-model="formData.province" class="ml-10">
<el-select v-model="formData.province" class="ml-10" :disabled="readonly">
<el-option v-for="(item) in provinceList" :value="item.id" :label="item.titleZh" :key="item.id" />
</el-select>
<el-select v-model="formData.city" class="ml-10">
<el-select v-model="formData.city" class="ml-10" :disabled="readonly">
<el-option v-for="(item) in cityList" :value="item.id" :label="item.titleZh" :key="item.id" />
</el-select>
</div>
......@@ -18,7 +18,8 @@ export default {
props:{
country: Number,
city: Number,
province: Number
province: Number,
readonly: Boolean
},
data(){
return {
......
......@@ -6,7 +6,7 @@
<template v-if="order.containerNumber">- {{order.containerNumber}}</template>
</div>
<el-row :gutter="20">
<el-col :span="12" v-if="order.consignorVO">
<el-col :span="8" v-if="order.consignorVO">
<el-descriptions class="margin-top" border title="发货人" :column="1" :labelStyle="{width:'150px'}">
<el-descriptions-item label="发货人">{{order.consignorVO.name}}</el-descriptions-item>
<el-descriptions-item label="发货人电话">{{order.consignorVO.phone}}</el-descriptions-item>
......@@ -16,14 +16,23 @@
</el-descriptions-item>
</el-descriptions>
</el-col>
<el-col :span="12" v-if="order.consigneeVO">
<el-descriptions class="margin-top" border title="收货人" :column="1" :labelStyle="{width:'150px'}">
<el-col :span="16" v-if="order.consigneeVO">
<el-descriptions class="margin-top" border title="收货人" :column="2" :labelStyle="{width:'150px'}">
<el-descriptions-item label="收货人">{{order.consigneeVO.name}}</el-descriptions-item>
<el-descriptions-item label="收货人电话">{{order.consigneeVO.phone}}</el-descriptions-item>
<el-descriptions-item label="收货人邮箱">{{order.consigneeVO.email}}</el-descriptions-item>
<el-descriptions-item label="收货人公司名称">
{{order.consigneeVO.company}}
</el-descriptions-item>
<el-descriptions-item label="收货方式">
<dict-tag :type="DICT_TYPE.ECW_HARVEST_METHOD" :value="order.consigneeVO.harvestMethod" />
</el-descriptions-item>
<el-descriptions-item label="收货地区">
{{region}}
</el-descriptions-item>
<el-descriptions-item label="收货地址">
{{order.consigneeVO.address}}
</el-descriptions-item>
</el-descriptions>
</el-col>
</el-row>
......@@ -72,41 +81,42 @@
<el-tabs v-model="activeName">
<el-tab-pane label="货物详情" name="first">
<el-table :data="order.orderItemVOList" border style="width: 100%">
<el-table-column prop="prodTitleZh" label="序号">
<el-table-column prop="prodTitleZh" label="序号" width="90px">
<template slot-scope="scope">{{scope.$index + 1}}</template>
</el-table-column>
<el-table-column prop="prodTitleZh" label="中文品名" />
<el-table-column prop="prodTitleEn" label="英文品名" />
<el-table-column prop="brand" label="品牌">
<el-table-column prop="brand" label="品牌" width="90px">
<template slot-scope="{row}">
<dict-tag :type="DICT_TYPE.ECW_IS_BRAND" :value="row.brand" />
<dict-tag :type="DICT_TYPE.ECW_IS_BRAND" :value="row.brandType" />
</template>
</el-table-column>
<el-table-column prop="num" label="填单件数" />
<el-table-column prop="sumNum" label="入仓件数" />
<el-table-column prop="unit" label="单位">
<el-table-column prop="num" label="填单件数" width="90px"/>
<el-table-column prop="sumNum" label="入仓件数" width="90px"/>
<el-table-column prop="unit" label="单位" width="90px">
<template slot-scope="{row}">
<dict-tag :type="DICT_TYPE.ECW_PACKAGE_TYPE" :value="row.unit" />
</template>
</el-table-column>
<el-table-column prop="worth" label="货值" />
<el-table-column prop="worth" label="货值" width="120px"/>
<el-table-column prop="" label="材质">
<template slot-scope="{row}">
<dict-tag :type="DICT_TYPE.ECW_PRODUCT_MATERIAL" :value="row.material" />
</template>
</el-table-column>
<el-table-column prop="volume" label="体积(m3)" />
<el-table-column prop="weight" label="重量(kg)" />
<el-table-column prop="volume" label="体积(m³)" width="90px"/>
<el-table-column prop="weight" label="重量(kg)" width="90px"/>
<el-table-column prop="quantity" label="数量(个)" width="90px"/>
<el-table-column prop="" label="费用类型">
<template slot-scope="{row}">
<dict-tag :type="DICT_TYPE.FEE_TYPE" :value="row.feeType" />
</template>
</el-table-column>
<el-table-column prop="" label="成交单价">
<el-table-column prop="" label="成交单价" width="220px">
<template slot-scope="{row}">
<template v-if="row.charging ==1">
全包价 // TODO 缺少全包价字段
全包价 {{row.seaFreight}} {{currentcyMap[row.seaFreightCurrency]}} / {{unitMap[row.seaFreightVolume]}}
</template>
<template v-else>
<div>
......@@ -187,6 +197,7 @@ import {getUnitList} from '@/api/ecw/unit'
import {getCurrencyList} from '@/api/ecw/currency'
import {getReceivableListByOrderId} from '@/api/ecw/receipt'
import { getChannel } from '@/api/ecw/channel';
import {listByIds} from '@/api/ecw/region'
export default {
name: "detail",
......@@ -221,7 +232,8 @@ export default {
currencyList: [],
unitList:[],
feeList: [],
channelName: '/'
channelName: '/',
region: ''
}
},
computed:{
......@@ -260,6 +272,17 @@ export default {
},
'order.channelId'(){
this.getChannel()
},
'order.consigneeVO'(val){
if(!val) return '-'
listByIds({ids: [val.country, val.province, val.city].join(',')}).then(res => {
console.log('listById', res)
let region = ''
res.data.forEach(item => {
region += " " + item.titleZh
})
this.region = region
})
}
},
created() {
......
......@@ -3,7 +3,7 @@
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-card>
<div slot="header" class="card-title">新建订单</div>
<div slot="header" class="card-title">{{ editMode ? '新建订单' : '编辑订单'}}</div>
<el-form-item label="订单类型" style="margin-bottom: 0">
<el-checkbox-group v-model="form.type">
<el-checkbox label="1">集运服务</el-checkbox>
......@@ -109,12 +109,12 @@
</el-table-column>
<el-table-column label="中文品名" width="160px">
<template slot-scope="{row}">
<product-selector v-model="row.prodId" @change="onProductChange(row, $event)" :disabled="!form.lineId" />
<product-selector v-model="row.prodId" @change="onProductChange(row, $event)" :disabled="!form.lineId || !productEditable" />
</template>
</el-table-column>
<el-table-column label="英文品名" width="160px">
<template slot-scope="{row}">
<product-selector lang="En" v-model="row.prodId" @change="onProductChange(row, $event)" :disabled="!form.lineId" />
<product-selector lang="En" v-model="row.prodId" @change="onProductChange(row, $event)" :disabled="!form.lineId || !productEditable" />
</template>
</el-table-column>
<!-- <el-table-column label="商品类型" width="160px">
......@@ -125,22 +125,22 @@
<el-table-column label="品牌" width="100px">
<template slot-scope="{row}">
<dict-selector v-model="row.brand" :type="DICT_TYPE.ECW_IS_BRAND" defaultable @input="calculationPrice(row)" :disabled="!form.lineId" />
<dict-selector v-model="row.brand" :type="DICT_TYPE.ECW_IS_BRAND" defaultable @input="calculationPrice(row)" :disabled="!form.lineId || !productEditable" />
</template>
</el-table-column>
<el-table-column label="件数" width="90px">
<template slot-scope="{row}">
<el-input v-model.number="row.num" :disabled="!form.lineId" />
<el-input v-model.number="row.num" :disabled="!form.lineId || !productEditable" />
</template>
</el-table-column>
<el-table-column label="包装单位">
<template slot-scope="{row}">
<dict-selector v-model="row.unit" :type="DICT_TYPE.ECW_PACKAGE_TYPE" defaultable :disabled="!form.lineId" />
<dict-selector v-model="row.unit" :type="DICT_TYPE.ECW_PACKAGE_TYPE" defaultable :disabled="!form.lineId || !productEditable" />
</template>
</el-table-column>
<el-table-column label="数量(个)" width="120px">
<template slot-scope="{row}">
<el-input v-model="row.quantity" type="number" :disabled="!form.lineId" />
<el-input v-model="row.quantity" type="number" :disabled="!form.lineId || !productEditable" />
</template>
</el-table-column>
<!-- <el-table-column label="箱规(m)" width="120px">
......@@ -150,12 +150,12 @@
</el-table-column> -->
<el-table-column label="体积(m³)" width="100px">
<template slot-scope="{row}">
<el-input v-model="row.volume" :disabled="!form.lineId" />
<el-input v-model="row.volume" :disabled="!form.lineId || !productEditable" />
</template>
</el-table-column>
<el-table-column label="重量(kg)" width="100px">
<template slot-scope="{row}">
<el-input v-model="row.weight" :disabled="!form.lineId" />
<el-input v-model="row.weight" :disabled="!form.lineId || !productEditable" />
</template>
</el-table-column>
<el-table-column label="货值(RMB)" width="100px">
......@@ -165,7 +165,7 @@
</el-table-column>
<el-table-column label="商品特性" width="250px">
<template slot-scope="{row}">
<el-checkbox-group v-model="row.prodAttrArr" @change="onProductAttrChange(row, $event); calculationPrice(row)" :disabled="!form.lineId">
<el-checkbox-group v-model="row.prodAttrArr" @change="onProductAttrChange(row, $event); calculationPrice(row)" :disabled="!form.lineId || !productEditable">
<el-checkbox v-for="item in productAttrList" :label="item.id" :key="item.id">{{item.attrName}}</el-checkbox>
</el-checkbox-group>
</template>
......@@ -199,7 +199,7 @@
<el-table-column label="商品链接" width="200px" align="center">
<template slot-scope="{row}">
<el-link type="primary" :href="row.link" target="_blank" style="display:block">{{row.link}}</el-link>
<el-button type="primary" size="mini" @click="setLink(row)">
<el-button type="primary" size="mini" @click="setLink(row)" v-if="productEditable">
{{row.link ? '编辑商品链接' : '添加商品链接'}}
</el-button>
</template>
......@@ -225,7 +225,7 @@
{{sum.totalWeight || 0}}kg
</el-descriptions-item>
<el-descriptions-item label="总数量">
{{sum.totalWorth || 0}}
{{sum.totalQuatity || 0}}
</el-descriptions-item>
<el-descriptions-item label="总货值(RMB)">
{{sum.totalWorth || 0}}元
......@@ -598,12 +598,14 @@ export default {
totalVolume: 0,
totalWeight: 0,
totalWorth: 0,
totalQuatity: 0
}
this.productList.forEach(item => {
sum.totalNum += parseInt(item.num) || 0
sum.totalVolume += parseFloat(item.volume) || 0
sum.totalWeight += parseFloat(item.weight) || 0
sum.totalWorth += parseFloat(item.worth) || 0
sum.totalQuatity += parseInt(item.quantity) || 0
})
return sum
......@@ -611,6 +613,15 @@ export default {
// 总优惠金额
discount(){
return 0
},
// 是否编辑
editMode(){
return this.$route.path.indexOf('create') == -1
},
// 是否可以编辑商品基本信息(货值除外)
productEditable(){
// 非编辑模式 或者 草稿状态就可以编辑
return !this.editMode || this.form.status == 0
}
},
watch:{
......
......@@ -130,10 +130,16 @@
</el-table-column>
<el-table-column label="唛头" align="center" prop="marks" />
<el-table-column label="总箱数/入仓箱数" align="center" prop="sumNum">
<template slot-scope="{row}">{{row.totalNum}}箱/{{row.sumNum}}</template>
<template slot-scope="{row}">
{{row.totalNum}}箱/{{row.sumNum}}
</template>
</el-table-column>
<el-table-column label="体积/重量" align="center" prop="sumWeight">
<template slot-scope="{row}">{{row.sumVolume}}m³ /{{row.sumWeight}}Kg</template>
<template slot-scope="{row}">
<!--入仓前是填单数据,入仓后是入仓数据-->
<template v-if="row.inWarehouseState <= 1">{{row.costVO.totalVolume}}m³ /{{row.costVO.totalWeight}}Kg箱</template>
<template v-else>{{row.sumVolume}}m³ /{{row.sumWeight}}Kg箱</template>
</template>
</el-table-column>
<el-table-column label="始发仓" align="center" prop="departureName" />
<el-table-column label="运输方式/目的地" align="center" prop="transportId">
......
......@@ -425,14 +425,13 @@ export default {
this.product = res.data
})
}else{
// 不指定产品获取类型等信息
this.getTypeList();
this.getAttrList();
}
//获取城市列表
this.getAllCityList();
this.getAllCityList()
this.getChannelList()
this.getTypeList()
//获取货币列表
this.requestCurrencyList();
......
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