Commit 1c3d1d71 authored by Smile's avatar Smile

需求129 后台-集运-包裹列表-编辑包裹

parent 5fdcaef2
<template>
<Edit more />
</template>
<script>
// 对edit组件复用并更名,防止keepalive缓存数据
import Edit from './edit.vue'
export default {
name: 'EcwConsCreateMore',
components: {Edit}
}
</script>
......@@ -9,7 +9,7 @@
:key="$route.fullPath"
:validate-on-rule-change="false"
>
<div class="page-title">{{ editMode ? $t('编辑包裹') + '-' + (form.orderNo) : $t('新建包裹') }}</div>
<div class="page-title">{{ editMode ? $t('编辑包裹') + '-' + (form.consNo) : $t('新建包裹') }}</div>
<el-card class="form-section mt-10">
<el-form-item :label="$t('集运仓库')" v-model="form.wareId" prop="wareId" :rules="{
required: true, message: '请选择集运仓库', trigger: 'blur'
......@@ -214,6 +214,9 @@ import ImageUpload from "@/components/ImageUpload/index.vue";
export default {
name: "EcwConsEdit",
props: {
more:Boolean // 标识多个预报
},
components: {
ImageUpload,
ProductSelector,
......@@ -343,15 +346,59 @@ export default {
return this.$message.error(this.$t(`请选择运输方式或目的城市`))
}
})
//货值要大于等于10,不大于10的要弹窗提示,左侧是忽略继续提交右侧按钮时前去检查
if (this.form.worth <= 10) {
return this.$confirm(this.$t('货值需要大于等于10,请检查'), this.$t('提示'), {
confirmButtonText: this.$t('忽略继续提交'),
cancelButtonText: this.$t('前去检查'),
type: 'warning'
}).then(() => {
this.createCons()
}).catch(() => {
this.$message({
type: 'info',
message: this.$t('已取消提交')
});
});
}else {
this.createCons()
}
},
createCons() {
createCons(this.form).then(res => {
if (res.code == 200) {
if (res.code === 0) {
this.$message.success(this.$t('创建成功'))
this.$router.push({path: '/cons/cons'})
if (this.more) {
this.resetByMore()
} else {
this.$redirect('success?consId=' + res.data)
}
} else {
this.$message.error(res.msg)
}
})
},
resetByMore(){
const oldForm=this.form
this.form={
consItemVOList: [],
wareId: oldForm.wareId,
customerNumber: '',
consignorPhone: '',
consignorCountryCode: '',
transportId: oldForm.transportId,
departureId: null,
consigneeCountryId: oldForm.consigneeCountryId,
consigneeCityId: oldForm.consigneeCityId,
warehouseLineId: oldForm.warehouseLineId,
expressNo: '',
expressId: null,
worth: '',
remarks: '',
imgs: []
}
this.addProduct()
},
// 删除一条产品
delProduct(index) {
......
......@@ -98,7 +98,7 @@
</el-table-column>
<el-table-column label="验货数据" align="center">
<template slot-scope="scope">
{{getInspectionInfo(scope.row.consItemList)}}
{{getInspectionInfo(scope.row.consItemList,scope.row.inspectStatus)}}
</template>
</el-table-column>
<el-table-column label="货值(RMB)" align="center" prop="worth" />
......@@ -123,9 +123,16 @@
{{isChinese?scope.row.destTitleZh:scope.row.destTitleEn}}
</template>
</el-table-column>
<el-table-column :label="$t('出货渠道')" align="center">
<template slot-scope="scope">
{{scope.row.channelName||"/"}}
<el-table-column
prop="tansportType"
:label="$t('出货渠道')"
align="center"
width="100"
>
<template slot-scope="{ row }">
<div>
{{ channelName(row.channelId) }}
</div>
</template>
</el-table-column>
<el-table-column :label="$t('验货')" align="center">
......@@ -175,7 +182,7 @@
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.page" :limit.sync="queryParams.row"
@pagination="getList"/>
<!-- 对话框(添加 / 修改) -->
......@@ -272,6 +279,7 @@ import SpecialNeedsConsLook from "@/views/ecw/cons/components/SpecialNeedsConsLo
import { getCurrencyList } from "@/api/ecw/currency"
import FeeApplicationCons from "@/views/ecw/cons/components/FeeApplicationCons.vue"
import FeeApplication from "@/views/ecw/order/feeApplication.vue"
import {getChannelList} from "@/api/ecw/channel";
export default {
name: "Cons",
......@@ -295,6 +303,7 @@ export default {
total: 0,
// 集运包裹主列表
list: [],
channelList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
......@@ -313,8 +322,8 @@ export default {
dateRangeCreateTime: [],
// 查询参数
queryParams: {
pageNo: 1,
pageSize: 10,
page: 1,
row: 10,
customerId: null,
customerNumber: null,
transportId: null,
......@@ -351,6 +360,7 @@ export default {
};
},
created() {
this.getChannelList()
this.getList();
getWarehouseList().then((r) => {
this.warehouseList = r.data;
......@@ -360,6 +370,12 @@ export default {
getCurrencyList().then((res) => (this.currencyList = res.data))
},
computed: {
// 根据渠道id获取渠道名
channelName() {
return (id) => {
return id!==null&&this.keyedChannel[id] ? this.keyedChannel[id].nameZh : null;
};
},
isChinese() {
return this.$i18n.locale === "zh_CN";
},
......@@ -383,6 +399,9 @@ export default {
},
},
methods: {
getChannelList() {
getChannelList().then((res) => (this.channelList = res.data))
},
getAddressProvince() {
getRegionList(1, 1).then(({ data }) => {
this.AddressProvince = data
......@@ -408,7 +427,10 @@ export default {
getGoodsName(val){
return val.map((item, index) => `${index + 1}.${item.prodName}*${item.quantity}`).join('<br>');
},
getInspectionInfo(val){
getInspectionInfo(val,status){
if (!status && status!==2){
return null
}
let inspectionNums = 0;
let inspectionUnit;
let inspectionQuantitys=0;
......@@ -421,7 +443,7 @@ export default {
inspectionVolumes += item.inspectionVolume;
inspectionWeights += item.inspectionWeight;
});
return `${inspectionQuantitys}${inspectionUnit} ${inspectionVolumes}${inspectionWeights}kg ${inspectionNums}件`;
return `${inspectionQuantitys}${inspectionUnit?inspectionUnit:this.$t('')} ${inspectionVolumes}${inspectionWeights}kg ${inspectionNums}件`;
},
/** 查询列表 */
getList() {
......@@ -474,7 +496,7 @@ export default {
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.queryParams.page = 1;
this.getList();
},
/** 重置按钮操作 */
......@@ -540,8 +562,8 @@ export default {
handleExport() {
// 处理查询参数
let params = {...this.queryParams};
params.pageNo = undefined;
params.pageSize = undefined;
params.page = undefined;
params.row = undefined;
this.addBeginAndEndTime(params, this.dateRangeWatEtime, 'watEtime');
this.addBeginAndEndTime(params, this.dateRangeWatTime, 'watTime');
this.addBeginAndEndTime(params, this.dateRangeSignedTime, 'signedTime');
......
<template>
<div style="width: 1120px">
<div style="display: flex;justify-content: space-around;margin-top: 30px;">
<div class="el-icon-check" style="font-size: 100px;color: #67C23A;"/>
<div>
<el-row>
<span style="font-weight: bold;font-size: 18px;">{{ $t('新建包裹成功') }}</span>
</el-row>
<el-row style="margin-top: 10px;">
<span style="font-size: 16px; font-weight: bold; color: #666;">{{ $t('您的包裹号') }}{{ cons.expressNo }}</span>
</el-row>
<el-row style="margin-top: 10px;">
<el-button type="primary" @click="$redirect('create')">{{ $t('继续添加') }}</el-button>
</el-row>
<el-row style="margin-top: 10px;">
<template v-for="(item, index) in warehouseList">
<el-button :type="warehouseList.length === 1 ||cons.wareId === item.id ? 'primary' : 'default'"
@click="setWarehouseId(item)">
{{ item.titleZh }}
</el-button>
</template>
</el-row>
<el-row style="margin-top: 10px;" type="flex" justify="center">
<el-col>
<span style="font-size: 14px;color: #666;">{{ $t('会员号') }}:{{ cons.customerNumber }}</span><el-link class="copy-btn" :data-clipboard-text="consCustomerNumberCopy" type="primary" style="margin-left:10px;vertical-align: bottom;">复制</el-link>
</el-col>
<el-col>
<span style="font-size: 14px;color: #666;">{{ $t('运输偏好') }} :</span>
<el-radio-group style="margin-left: 5px" v-model="transport">
<el-radio v-for="dict in getDictDatas(DICT_TYPE.ECW_PREFERENCE_TRANSPORT_TYPE)" :key="dict.label" :label="dict.label">{{ $l(dict, "label") }}</el-radio>
</el-radio-group>
</el-col>
</el-row>
<el-row style="margin-top: 30px;" type="flex" justify="center">
<el-col>
<span style="font-size: 14px;color: #666;">{{ $t('收件人') }}:{{warehouse.head}} {{ cons.customerNumber }}</span><el-link class="copy-btn" :data-clipboard-text="consCustomerHeadCopy" type="primary" style="margin-left:10px;vertical-align: bottom;">复制</el-link>
</el-col>
<el-col>
<span style="font-size: 14px;color: #666;">{{ $t('电话') }}:{{warehouse.tell}}</span><el-link class="copy-btn" :data-clipboard-text="consCustomerPhoneCopy" type="primary" style="margin-left:10px;vertical-align: bottom;">复制</el-link>
</el-col>
</el-row>
<el-row style="margin-top: 30px;">
<span style="font-size: 14px;color: #666;">{{ $t('仓库地址') }}:{{ warehouse.addressZh }} {{ cons.customerNumber }}</span><el-link class="copy-btn" :data-clipboard-text="consCustomerWarehouseCopy" type="primary" style="margin-left:10px;vertical-align: bottom;">复制</el-link>
</el-row>
</div>
</div>
<div class="actions mt-50">
<el-button class="copy-btn" :data-clipboard-text="consCopy">{{ $t('一键复制') }}</el-button>
<el-button type="warning" @click="showNotice = true">{{ $t('入仓须知') }}</el-button>
<el-button type="primary" @click="$redirect('detail?orderId=' + order.orderId)">{{ $t('禁运物品') }}</el-button>
</div>
<el-dialog :title="$t('查看须知')" :visible.sync="showNotice" width="700px">
<!-- <img :src="noticeUrl" id="noticeImg" /> -->
<need-know keyname="warehousing" ref="needKnow"/>
<div style="text-align:center">
<el-button type="primary" @click="$refs.needKnow.downloadPdf()">{{ $t('下载') }}</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import NeedKnow from '@/components/NeedKnow'
import ClipboardJS from "clipboard";
import {getCons} from "@/api/ecw/cons";
import {getConsWarehouse} from "@/api/ecw/warehouse";
import { getDictDatas, DICT_TYPE } from '@/utils/dict'
let clipboard;
export default {
components: {NeedKnow},
data() {
return {
cons: null,
showNotice: false,
warehouseList: [],
warehouse:{},
transport:null
// noticeUrl: 'http://v4.groupage.cn/Public/images/notice.png'
}
},
computed: {
consCopy(){
return `会员号:${this.cons.customerNumber}\n运输偏好${this.transport}\n收件人:${this.warehouse.head} ${this.cons.customerNumber}\n电话:${this.warehouse.tell}\n仓库地址:${this.warehouse.addressZh} ${this.cons.customerNumber}`;
},
consCustomerNumberCopy(){
return `会员号:${this.cons.customerNumber}`;
},
consCustomerHeadCopy(){
return `收件人:${this.warehouse.head} ${this.cons.customerNumber}`;
},
consCustomerPhoneCopy(){
return `电话:${this.warehouse.tell}`;
},
consCustomerWarehouseCopy(){
return `仓库地址:${this.warehouse.addressZh} ${this.cons.customerNumber}`;
}
},
async created() {
getConsWarehouse().then((r) => {
this.warehouseList = r.data;
this.setWarehouseId()
});
await this.loadData()
await this.$nextTick()
clipboard = new ClipboardJS('.copy-btn')
clipboard.on('success', () => {
this.$message.success(this.$t('复制成功'))
})
clipboard.on('error', () => {
this.$message.error(this.$t('复制失败'))
})
},
destroyed() {
clipboard.destroy()
},
methods: {
getDictDatas,
setWarehouseId(item) {
if (item){
this.warehouse=item
}else {
this.warehouse=this.warehouseList.find(item=>item.id===this.cons.wareId)
console.log(this.warehouse)
}
},
async loadData() {
await getCons(this.$route.query.consId)
.then(res => {
this.cons = res.data
console.log(this.cons)
})
}
}
}
</script>
<style scoped lang="scss">
.wrapper {
padding: 100px;
display: flex;
justify-content: center;
.icon {
display: flex;
justify-content: flex-end;
margin-right: 50px;
align-items: center;
img {
width: 100px;
height: 100px;
}
}
.title {
font-size: 30px;
margin-bottom: 20px;
}
}
.line {
font-size: 14px;
margin-bottom: 10px;
}
.actions {
display: flex;
justify-content: center;
}
.bold {
font-weight: bold;
}
.font-lg {
font-size: 1.5rem !important;
}
</style>
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