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

供应商,报价单,框架基础功能完善

parent 7cd0b997
......@@ -56,6 +56,7 @@ export default {
},
watch: {
$route() {
console.log(this.$route, this.$route.redirectedFrom)
this.addTags()
this.moveToCurrentTag()
},
......
......@@ -25,7 +25,7 @@ import DictSelector from '@/components/DictSelector'
// import 'highlight.js/styles/github-gist.css'
import {DICT_TYPE, getDictDataLabel, getDictDatas, getDictDatas2} from "@/utils/dict";
import i18n from './i18n'
console.log({i18n})
// 全局方法挂载
Vue.prototype.getDicts = getDicts
Vue.prototype.getConfigKey = getConfigKey
......@@ -108,6 +108,11 @@ import '@/styles/index.scss'
Vue.use(Element, {
size: Cookies.get('size') || 'medium' // set element-ui default size
})
Vue.prototype.$redirect = (path) =>{
let currentView = router.history.current
router.replace(path)
store.dispatch("tagsView/delView", currentView)
}
Vue.config.productionTip = false
......
......@@ -176,7 +176,6 @@ const actions = {
})
},
delCurrentView({ dispatch }){
// console.log('delCurrentView', router.history.current)
const view = router.history.current
return dispatch('delView', view).then(({visitedViews}) => {
const latestView = visitedViews.slice(-1)[0]
......
......@@ -109,6 +109,7 @@ export const DICT_TYPE = {
ECW_PRICE_TYPE: 'price_type',
ECW_RELEASE_STATUS: 'release_status', // 放货状态
ECW_PICK_RECURRENT_NUCLEAR_TYPE: 'PICK_RECURRENT_NUCLEAR_TYPE', // 放货反复核类型
ECW_COST_FEE_TYPE: 'cost_fee_type', // 清单费用类型
//--------ecw---------
CUSTOMER_STATUS: 'customer_status',
CUSTOMER_SOURCE: 'customer_source',
......
......@@ -224,16 +224,16 @@
<template v-if="row.fee && row.fee.charging == 1">
<template v-if="!row.fee.freight">{{$t('未报价')}}</template>
<template v-else>
{{$t('全包价')}}{{row.fee.freight}} {{currentcyMap[row.fee.freightCurrency]}} / {{unitMap[row.fee.freightVolume]}}
{{$t('全包价')}}{{row.fee.freight}} {{currencyMap[row.fee.freightCurrency]}} / {{unitMap[row.fee.freightVolume]}}
</template>
</template>
<template v-else-if="!row.fee || !row.fee.freight && !row.fee.clearanceFee">{{$t('未报价')}}</template>
<template v-else-if="row.fee">
<div>
{{$t('运费')}}{{row.fee.freight}} {{currentcyMap[row.fee.freightCurrency]}} / {{unitMap[row.fee.freightVolume]}}
{{$t('运费')}}{{row.fee.freight}} {{currencyMap[row.fee.freightCurrency]}} / {{unitMap[row.fee.freightVolume]}}
</div>
<div>
{{$t('清关费')}}{{row.fee.oneClearanceFee}} {{currentcyMap[row.fee.clearanceFeeCurrency]}} / {{unitMap[row.fee.clearanceFeeVolume]}}
{{$t('清关费')}}{{row.fee.oneClearanceFee}} {{currencyMap[row.fee.clearanceFeeCurrency]}} / {{unitMap[row.fee.clearanceFeeVolume]}}
</div>
</template>
</template>
......@@ -295,13 +295,13 @@
</el-descriptions-item>
<el-descriptions-item :label="$t('总运费')">
<template v-for="item in clearanceFeeList">
<div :key="item.currencyId">{{item.amount || 0}}{{currentcyMap[item.currencyId]}}</div>
<div :key="item.currencyId">{{item.amount || 0}}{{currencyMap[item.currencyId]}}</div>
</template>
</el-descriptions-item>
<!--代收货款,只有非控货订单、并且线路开通了代收货款后,才显示是否代收货款选项-->
<el-descriptions-item :label="$t('总清关费')">
<template v-for="item in freightFeeList">
<div :key="item.currencyId">{{item.amount || 0}}{{currentcyMap[item.currencyId]}}</div>
<div :key="item.currencyId">{{item.amount || 0}}{{currencyMap[item.currencyId]}}</div>
</template>
</el-descriptions-item>
<el-descriptions-item :label="$t('其他费用')">
......@@ -310,7 +310,7 @@
</el-descriptions-item>
<el-descriptions-item :label="$t('原价')" :span="2">
<template v-for="item in originalFeeList">
<div :key="item.currencyId">{{item.amount || 0}}{{currentcyMap[item.currencyId]}}</div>
<div :key="item.currencyId">{{item.amount || 0}}{{currencyMap[item.currencyId]}}</div>
</template>
</el-descriptions-item>
</el-descriptions>
......@@ -337,7 +337,7 @@
<el-table-column label="">
<template slot-scope="{row}">
-{{row.reduceAmount}}
{{currentcyMap[row.reduceCurrencyId]}}
{{currencyMap[row.reduceCurrencyId]}}
</template>
</el-table-column>
<el-table-column label="">
......@@ -350,12 +350,12 @@
<el-descriptions :column="1" class="mt-20">
<el-descriptions-item :label="$t('优惠费用')" v-if="couponTotalAmountList && couponTotalAmountList.length">
<div v-for="(item, discountIndex) in couponTotalAmountList" :key="discountIndex">
{{item.totalAmount}} {{currentcyMap[item.currencyId]}}
{{item.totalAmount}} {{currencyMap[item.currencyId]}}
</div>
</el-descriptions-item>
<el-descriptions-item :label="$t('预计费用')">
<template v-for="item in estimatedCosts">
<div :key="item.currencyId">{{item.amount || 0}}{{currentcyMap[item.currencyId]}}</div>
<div :key="item.currencyId">{{item.amount || 0}}{{currencyMap[item.currencyId]}}</div>
</template>
</el-descriptions-item>
</el-descriptions>
......@@ -529,6 +529,7 @@ export default {
endTime: [{ required: true, message: "有效期结束时间不能为空"}],
transportId: [{ required: true, message: "选择运输方式"}],
channelId: [{ required: true, message: "选择出货渠道"}],
stopTime: [{ required: true, message: "不能为空"}]
/*sendstatus: [{ required: true, message: "站内信状态,0未发送,1已发送不能为空", trigger: "blur" }], */
},
labelStyle: 'width:120px',
......@@ -576,17 +577,17 @@ export default {
if(!this.form.lineId)return null
return this.routerList.find(item => item.id == this.form.lineId)
},
currentcyMap(){
currencyMap(){
let map = {}
this.currencyList.forEach(item => {
map[item.id] = item.titleZh
map[item.id] = this.$l(item, 'title')
})
return map
},
unitMap(){
let map = {}
this.unitList.forEach(item => {
map[item.id] = item.titleZh
map[item.id] = this.$l(item, 'title')
})
return map
},
......@@ -669,9 +670,6 @@ export default {
if(!this.selectedRouter || !this.selectedRouter.otherService) return []
return this.selectedRouter.otherService.split(',')
}
/* productKeyd(){
return arrryToKeyedObjectBy(this.productList, 'prodId')
} */
},
watch:{
// 始发地
......@@ -745,14 +743,6 @@ export default {
this.contactChooseType = 'consignor'
this.onContactChoose(data.list.find(item => item.customerContactsId == res.data.consignorId))
})
/* res.data.transportRespVOList.forEach(item => {
let transport = this.transportList.find(t => t.transportId == item.transportId)
console.log(item.transportId, transport)
Object.assign(transport, item, {_enabled: true})
}) */
/* this.$nextTick(() => {
this.updateEnabledTransports()
}) */
})
}//else this.addProduct()
},
......@@ -773,12 +763,6 @@ export default {
this.contactChooseType = null
this.quickCreateType = null
},
/* onProductChange(row, product){
row.goodsType = product.typeId;
// 保存商品id和品名,用于优惠信息显示
this.$set(this.productNames, product.id, product.titleZh)
this.calculationPrice()
}, */
onProductChange(row, product){
console.log(product)
// row.goodsType = product ? product.typeId : null
......@@ -888,7 +872,7 @@ export default {
// 添加的提交
createOffer(data).then(response => {
this.$modal.msgSuccess(this.$t("新增成功"));
this.$router.replace('index')
this.$redirect('index')
});
});
},
......
......@@ -47,63 +47,49 @@
</template>
</el-table-column>
<el-table-column :label="$t('运输方式')" align="left">
<template slot-scope="scope" v-if="scope.row.transportIds" >
<span v-for="(item, index) in scope.row.transportIds.split(',')" :key="index">
<dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="item" />
</span>
<template slot-scope="scope" >
<dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="scope.row.transportId" />
</template>
</el-table-column>
<el-table-column :label="$t('业务员')" align="left">
<template slot-scope="scope">
暂无
</template>
<el-table-column :label="$t('业务员')" align="left" prop="creatorName">
</el-table-column>
<el-table-column :label="$t('预计销售额')" align="center" prop="estCost">
<el-table-column :label="$t('预计销售额')" align="left" prop="estCost">
<template slot-scope="{row}">
<div class="" v-if="row.estCostVO.clearanceNGN || row.estCostVO.clearanceRMB || row.estCostVO.clearanceUSD">
{{$t('清关费')}}
<span v-if="row.estCostVO.clearanceNGN">{{row.estCostVO.clearanceNGN}}N</span>
<span v-if="row.estCostVO.clearanceRMB">{{row.estCostVO.clearanceRMB}}</span>
<span v-if="row.estCostVO.clearanceUSD">{{row.estCostVO.clearanceUSD}}$</span>
<div class="" v-for="item in row.estCostVO.feeDtoList" :key="item.feeType">
<dict-tag :type="DICT_TYPE.ECW_COST_FEE_TYPE" :value="item.feeType" />
{{item.amount}} {{currencyMap[item.currencyId]}}
</div>
<div class="" v-if="row.estCostVO.seaNGN || row.estCostVO.seaRMB || row.estCostVO.seaUSD">
{{$t('运费')}}
<span v-if="row.estCostVO.seaNGN">{{row.estCostVO.seaNGN}}N</span>
<span v-if="row.estCostVO.seaRMB">{{row.estCostVO.seaRMB}}</span>
<span v-if="row.estCostVO.seaUSD">{{row.estCostVO.seaUSD}}$</span>
</div>
</template>
</el-table-column>
<el-table-column :label="$t('操作')" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<template v-if="[1,2].indexOf(scope.row.status) > -1">
<el-button size="mini" type="text" icon="el-icon-edit" @click="$router.push('detail?offerId=' + scope.row.offerId)"
<el-button size="mini" type="text" @click="$router.push('detail?offerId=' + scope.row.offerId)"
v-hasPermi="['ecw:offer:update']">{{$t('详情')}}</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="$router.push('edit?id=' + scope.row.offerId)"
<el-button size="mini" type="text" @click="$router.push('edit?id=' + scope.row.offerId)"
v-hasPermi="['ecw:offer:update']">{{$t('编辑')}}</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="$router.push('logList?offerId=' + scope.row.offerId)"
<el-button size="mini" type="text" @click="$router.push('logList?offerId=' + scope.row.offerId)"
v-hasPermi="['ecw:offer:update']">{{$t('跟进')}}</el-button>
</template>
<template v-if="scope.row.status == 2">
<el-button size="mini" type="text" icon="el-icon-edit" @click="$router.push('detail?offerId=' + scope.row.offerId)"
<el-button size="mini" type="text" @click="$router.push('detail?offerId=' + scope.row.offerId)"
v-hasPermi="['ecw:offer:update']">{{$t('详情')}}</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="$router.push(`result?offerId=${scope.row.offerId}&number=${scope.row.number}`)"
<el-button size="mini" type="text" @click="$router.push(`result?offerId=${scope.row.offerId}&number=${scope.row.number}`)"
v-hasPermi="['ecw:offer:update']">{{$t('结果')}}</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="$router.push('/offer/special/' + scope.row.offerId)"
<el-button size="mini" type="text" @click="$router.push('/offer/special/' + scope.row.offerId)"
v-hasPermi="['ecw:offer:update']">{{$t('特价')}}</el-button>
<el-button size="mini" type="text" icon="el-icon-edit"
<el-button size="mini" type="text"
v-hasPermi="['ecw:offer:update']">{{$t('取消')}}</el-button>
<el-button size="mini" type="text" icon="el-icon-edit"
<el-button size="mini" type="text"
v-hasPermi="['ecw:offer:update']">{{$t('恢复')}}</el-button>
</template>
<el-button size="mini" type="text" icon="el-icon-edit" @click="$router.push('detail?offerId=' + scope.row.offerId)"
<el-button size="mini" type="text" @click="$router.push('detail?offerId=' + scope.row.offerId)"
v-hasPermi="['ecw:offer:update']">{{$t('详情')}}</el-button>
<el-button size="mini" type="text" icon="el-icon-delete"
<el-button size="mini" type="text"
v-hasPermi="['ecw:offer:delete']">{{$t('删除')}}</el-button>
</template>
</el-table-column>
......@@ -116,7 +102,8 @@
</template>
<script>
import { createOffer, updateOffer, deleteOffer, getOffer, getOfferPage, exportOfferExcel } from "@/api/ecw/offer";
import { deleteOffer, getOfferPage, exportOfferExcel } from "@/api/ecw/offer";
import { getCurrencyList } from '@/api/ecw/currency';
export default {
name: "Offer",
......@@ -173,12 +160,24 @@ export default {
estCost: null,
sendstatus: null,
},
currencyList: []
};
},
computed:{
currencyMap(){
let map = {}
this.currencyList.forEach(item => {
map[item.id] = this.$l(item, 'title')
})
return map
},
},
created() {
this.getList();
getCurrencyList().then(res => {
this.currencyList = res.data
})
},
methods: {
/** 查询列表 */
......
......@@ -934,7 +934,7 @@ export default {
// 添加的提交
createOrder(data).then(response => {
this.$modal.msgSuccess(this.$t("新增成功"));
this.$router.replace('success?orderId=' + response.data)
this.$redirect('success?orderId=' + response.data)
});
});
},
......
......@@ -22,9 +22,9 @@
</el-col>
</el-row>
<div class="actions">
<el-button type="primary" @click="$router.replace('detail?orderId=' + order.orderId)">{{$t('查看订单')}}</el-button>
<el-button type="primary" @click="$redirect('detail?orderId=' + order.orderId)">{{$t('查看订单')}}</el-button>
<el-button type="warning" @click="showNotice = true">{{$t('入仓须知')}}</el-button>
<el-button type="info" @click="$router.replace('create')">{{$t('再来一单')}}</el-button>
<el-button type="info" @click="$redirect('create')">{{$t('再来一单')}}</el-button>
</div>
<el-dialog :title="$t('查看须知')" :visible.sync="showNotice" width="700px">
......@@ -60,31 +60,7 @@ export default {
.then(res => {
this.order = res.data
})
},
/* download(){
let el = document.getElementById('noticeImg')
this.downloadIamge(this.noticeUrl, 'ce')
},
downloadIamge(imgsrc, name) {
//下载图片地址和图片名
var image = new Image()
// 解决跨域 Canvas 污染问题
image.setAttribute('crossOrigin', 'anonymous')
image.onload = function () {
var canvas = document.createElement('canvas')
canvas.width = image.width
canvas.height = image.height
var context = canvas.getContext('2d')
context.drawImage(image, 0, 0, image.width, image.height)
var base64 = canvas.toDataURL('image/png') //得到图片的base64编码数据
document.getElementById('noticeImg').setAttribute('src', base64)
window.base64 = base64
let blob = dataURLtoBlob(base64)
FileSaver.saveAs(blob, '入仓须知.png');
}
image.src = imgsrc
} */
}
}
}
</script>
......
......@@ -356,7 +356,7 @@ export default {
// 添加的提交
createSupplier(data).then(response => {
this.$modal.msgSuccess(this.$t(this.$t("新增成功")));
this.$router.replace('supplier')
this.$redirect('supplier')
});
});
},
......
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