Commit d202add2 authored by chenjiuping's avatar chenjiuping

Merge remote-tracking branch 'origin/dev' into dev

parents acc186e6 3c9adac0
......@@ -26,7 +26,7 @@ export default {
methods:{
downloadPdf(){
download({id: this.detail.id}).then(res => {
saveFie.pdf(res, '入仓须知.pdf')
this.$download.pdf(res, '入仓须知.pdf')
})
},
download(){
......
......@@ -108,11 +108,30 @@ 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)
}
window.ElementUI = Element
// 显示表单错误信息
Vue.prototype.$showFormValidateErrors = (errors) => {
let vm = new Vue()
let createElement = vm.$createElement
let fieldList = Object.values(errors)
Element.Notification({
title: '表单错误',
type: 'warning',
duration: 3000,
message: createElement('div', fieldList.map(function (errorList) {
return createElement('div', errorList.map((item) => {
return createElement('div', item.message)
}))
}))
})
}
Vue.config.productionTip = false
......
......@@ -295,13 +295,13 @@
{{fee.insuranceFee || 0}} {{$t('美元')}}
</el-descriptions-item>
<el-descriptions-item :label="$t('总运费')">
<template v-for="item in clearanceFeeList">
<template v-for="item in freightFeeList">
<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">
<template v-for="item in clearanceFeeList">
<div :key="item.currencyId">{{item.amount || 0}}{{currencyMap[item.currencyId]}}</div>
</template>
</el-descriptions-item>
......@@ -724,7 +724,7 @@ export default {
if(this.$route.query.id){
this.getOffer()
}//else this.addProduct()
}else this.addProduct()
},
methods: {
getOffer(){
......@@ -799,10 +799,6 @@ export default {
this.calculationPrice()
},
addProduct(data){
if(!data && !this.form.lineId){
return this.$message.error(this.$t('请先选择路线'))
}
console.log('addProduct', JSON.stringify(data))
this.form.prodCreateReqVOList.push(data || {prodAttrArr:[]})
},
// 计算商品运费
......@@ -850,8 +846,19 @@ export default {
},
/** 提交按钮 */
submitForm(status) {
this.$refs["form"].validate(valid => {
this.$refs["form"].validate((valid, errors) => {
console.log({valid, errors})
if (!valid) {
return this.$showFormValidateErrors(errors);
/* let h = this.$createElement
this.$notify({
'title': '表单错误',
type: 'warning',
message: h('div', [
h('div', '请填写某某'),
h('div', '水电费水电费')
])
}) */
return;
}
......
......@@ -5,7 +5,7 @@
<div id="myproa">
<p style="padding-bottom:10px;font-size:16px;">
{{$t('订单号')}}{{detail.orderNo}}
&nbsp;&nbsp;&nbsp;{{$t('发货人电话')}}{{detail.name}} {{detail.phone}}
&nbsp;&nbsp;&nbsp;{{$t('发货人电话')}}{{detail.consignorVO.countryCode}} {{detail.consignorVO.phone}}
&nbsp;&nbsp;&nbsp;{{$t('提货地点')}}{{objective.titleZh}}
<img :src="qrcode" style="margin-left: 10px;width:17mm;vertical-align:middle" />
</p>
......@@ -33,7 +33,7 @@
</label>
</td>
<td style="text-align:center;padding:0 0px;border:1px dashed #ccc;">
{{item.marks}}
{{detail.marks}}
</td>
<td style="text-align:center;padding:0 0px;border:1px dashed #ccc;">
{{item.prodTitleZh}}<br/>{{item.prodTitleEn}}
......
<script>
// 对edit组件复用并更名,防止keepalive缓存数据
import edit from './edit.vue'
edit.name = 'OrderCreate'
export default edit
</script>
\ No newline at end of file
......@@ -360,12 +360,11 @@
</div>
</div>
<div>
<el-form-item :label="$t('预计送货日期')" prop="deliveryDate" class="ml-20">
<el-form-item :label="$t('预计送货日期')" prop="deliveryDate">
<el-date-picker v-model="form.deliveryDate" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
</div>
<div>
<el-form-item :label="$t('收货方式')" prop="harvestMethod" class="ml-20">
<dict-selector :type="DICT_TYPE.ECW_HARVEST_METHOD" v-model="form.harvestMethod" :filter="item => item.value == 1 || homeDeliveryService" defaultable />
</el-form-item>
......@@ -407,30 +406,39 @@
<el-button type="primary" slot="append" @click="getOrderCourierNumber">{{$t('生成单号')}}</el-button>
</el-input>
</el-form-item>
<br/>
<el-form-item :label="$t('是否双清')" v-if="[2,3,4].indexOf(+form.transportId) > -1">
<dict-selector v-model="form.doubleClear" form-type="radio" :type="DICT_TYPE.ECW_DOUBLE_CLEAR" />
</el-form-item>
<el-form-item :label="$t('航空公司')" v-if="[3,4].indexOf(+form.transportId) > -1">
<!--待查询备选数据-->
<el-select placeholder="" v-model="form.airlineCompany">
</el-select>
</el-form-item>
<el-form-item :label="$t('船公司')" v-if="[2].indexOf(+form.transportId) > -1">
<el-select placeholder="" v-model="form.shippingCompany">
</el-select>
</el-form-item>
<el-form-item :label="$t('清关证书')" v-if="[2,3,4].indexOf(+form.transportId) > -1">
<dict-selector v-model="form.customsClearCert" form-type="radio" :type="DICT_TYPE.INFRA_BOOLEAN_STRING" fomatter="bool" />
</el-form-item>
<el-form-item label="清关证书备注" v-if="[2,3,4].indexOf(+form.transportId) > -1">
<el-input v-model="form.remarks" ></el-input>
</el-form-item>
<el-form-item label="是否拆包" v-if="[3,4].indexOf(+form.transportId) > -1">
<dict-selector v-model="form.isUnpack" form-type="radio" :type="DICT_TYPE.INFRA_BOOLEAN_STRING" fomatter="bool" />
</el-form-item>
<div v-if="[2,3,4].indexOf(+form.transportId) > -1">
<el-form-item :label="$t('是否双清')">
<dict-selector v-model="form.doubleClear" form-type="radio" :type="DICT_TYPE.ECW_DOUBLE_CLEAR" />
</el-form-item>
</div>
<div v-if="[3,4].indexOf(+form.transportId) > -1">
<el-form-item :label="$t('航空公司')">
<!--待查询备选数据-->
<el-select placeholder="" v-model="form.airlineCompany">
</el-select>
</el-form-item>
</div>
<div v-if="[2].indexOf(+form.transportId) > -1">
<el-form-item :label="$t('船公司')">
<el-select placeholder="" v-model="form.shippingCompany">
</el-select>
</el-form-item>
</div>
<div v-if="[2,3,4].indexOf(+form.transportId) > -1">
<el-form-item :label="$t('清关证书')">
<dict-selector v-model="form.customsClearCert" form-type="radio" :type="DICT_TYPE.INFRA_BOOLEAN_STRING" fomatter="bool" />
</el-form-item>
<el-form-item label="清关证书备注" >
<el-input v-model="form.remarks" ></el-input>
</el-form-item>
</div>
<div v-if="[3,4].indexOf(+form.transportId) > -1">
<el-form-item label="是否拆包">
<dict-selector v-model="form.isUnpack" form-type="radio" :type="DICT_TYPE.INFRA_BOOLEAN_STRING" fomatter="bool" />
</el-form-item>
</div>
<div class="form-section">
<el-form-item :label="$t('单票立刻转运')" v-if="[3,4].indexOf(+form.transportId) > -1">
<dict-selector v-model="form.isSingleTicketTransport" form-type="radio" :type="DICT_TYPE.INFRA_BOOLEAN_STRING" fomatter="bool" />
......@@ -513,6 +521,8 @@ import ChooseContactDialog from '@/components/ChooseContactDialog'
import QuickCreateCustomer from '@/components/QuickCreateCustomer'
import {calculationPrice} from '@/api/ecw/product'
// 缓存默认的表单数据
let defaultFormData = null
export default {
name: "EcwOrderEdit",
......@@ -716,6 +726,8 @@ export default {
}
},
created() {
defaultFormData = Object.assign({}, this.form)
this.couponTypeList = this.getDictDatas(this.DICT_TYPE.ECW_COUPON_TYPE)
this.couponTypeList.forEach(item => {
this.$set(this.selectedCoupons, item.value, null)
......@@ -935,6 +947,11 @@ export default {
// 添加的提交
createOrder(data).then(response => {
this.$modal.msgSuccess(this.$t("新增成功"));
// 重置数据
this.form = {...defaultFormData}
this.$refs.form.clearValidate()
this.$redirect('success?orderId=' + response.data)
});
});
......
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