Commit 4dc7f2ef authored by Smile's avatar Smile

任务132后台-集运-包裹列表-批量签收

parent 22618891
......@@ -17,6 +17,13 @@ export function updateCons(data) {
data: data
})
}
export function updateConsBatchSignOff(data) {
return request({
url: '/ecw/cons/updateConsBatchSignOff',
method: 'put',
data: data
})
}
// 删除集运包裹主
export function deleteCons(id) {
......
<template>
<el-dialog :title="$t('批量签收')" :before-close="()=>{$emit('update:showConsBatchSignOff',false)}"
:visible.sync="showConsBatchSignOff">
<h1>合共<span style="color: red">{{ consIds.length }}</span> 个包裹</h1>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item :label="$t('集运仓库')" v-model="form.wareId" prop="wareId" :rules="{
required: true, message: '请选择集运仓库', trigger: 'blur'
}">
<template v-for="(item, index) in warehouseList">
<el-button :type="warehouseList.length === 1 ||form.wareId === item.id ? 'primary' : 'default'"
@click="setWarehouseId(item)">
{{ item.titleZh }}
</el-button>
</template>
</el-form-item>
<el-row :gutter="10">
<el-col :span="10">
<el-form-item label="签收人" prop="signer">
<el-select
v-model="form.signer"
:placeholder="$t('请选择签收人')"
clearable
size="small"
>
<el-option
v-for="dict in allSimplList"
:key="dict.id"
:label="dict.nickname"
:value="dict.id"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item label="签收时间" prop="signedTime">
<el-date-picker clearable v-model="form.signedTime" type="date" value-format="timestamp"
placeholder="选择签收时间" />
</el-form-item>
</el-col>
</el-row>
<el-form-item label="签收时间" prop="mediaUrl">
<image-upload v-model="form.mediaUrl"/>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">{{ $t("确认签收") }}</el-button>
<el-button @click="$emit('update:showConsBatchSignOff',false)">{{ $t("取 消") }}</el-button>
</span>
</el-dialog>
</template>
<script>
import imageUpload from "@/components/ImageUpload/index.vue";
import {updateConsBatchSignOff} from '@/api/ecw/cons'
import {DICT_TYPE} from "@/utils/dict";
import {listAllSimpl} from "@/api/system/user";
import Template from "@/views/cms/template/index.vue";
import {getConsWarehouse} from "@/api/ecw/warehouse";
export default {
name: 'EcwBatchSignOff',
computed: {
DICT_TYPE() {
return DICT_TYPE
}
},
components: {Template, imageUpload},
props: {
consIds: { // 接收数组
type: Array,
default: () => []
},
showConsBatchSignOff: {
type: Boolean,
default: false
}
},
data() {
return {
form: {},
warehouseList: [],
allSimplList:[],
rules: {
status: [
{ required: true, message: "请选择状态", trigger: "blur" }
]
},
}
},
created() {
listAllSimpl().then((r) => {
this.allSimplList = r.data
})
getConsWarehouse().then((r) => {
this.warehouseList = r.data;
if (this.warehouseList.length === 1) {
this.setWarehouseId(this.warehouseList[0]);
}
});
},
methods: {
setWarehouseId(item) {
this.$set(this.form, 'wareId', item.id)
},
submitForm() {
//二次确认
this.$modal
.confirm(this.$t("确认签收" + "?"))
.then(() => {
this.form.consIds = this.consIds;
this.$refs.form.validate(validate => {
if (validate) {
updateConsBatchSignOff(this.form).then(response => {
this.$emit("update:showConsBatchSignOff", false)
this.$emit("determine")
this.$modal.msgSuccess("批量签收成功")
})
}
})
})
.catch(() => {
return false;
});
}
}
}
</script>
<style scoped lang="scss">
</style>
......@@ -197,7 +197,7 @@
</el-card>
<el-card class="form-section mt-10">
<div slot="header" class="card-title1">{{ $t('签收图片') }}</div>
<el-form-item prop="img">
<el-form-item prop="mediaUrl">
<image-upload v-model="form.mediaUrl"/>
</el-form-item>
</el-card>
......
......@@ -64,11 +64,30 @@
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
v-hasPermi="['ecw:cons:export']">导出</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleEdit">单个预报</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="info" plain icon="el-icon-plus" size="mini" @click="handleEditMore">多个预报</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleBatchSignOff">批量签收</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="el-icon-plus" size="mini" @click="handleAdd">批量更新货运信息</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="el-icon-plus" size="mini" >转运</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="el-icon-plus" size="mini" >批量申请费用</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 列表 -->
<el-table v-loading="loading" :data="list">
<el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" fixed></el-table-column>
<el-table-column label="快递单号" align="center" prop="expressNo" />
<el-table-column label="客户" align="center">
<template slot-scope="scope">
......@@ -264,7 +283,7 @@
<SpecialNeedsConsLook :showSpecialNeedsConsLook.sync="showSpecialNeedsConsLook" :consNum="consNum" :consId="id"></SpecialNeedsConsLook>
<fee-application-cons v-if="feeApplicationBol" :consId="id" :currencys="JSON.stringify(currencyList)" :dialog-visible.sync="feeApplicationBol "@refresh="getList"></fee-application-cons>
<ConsFollowupEdit :showConsFollowupEdit.sync="showConsFollowupEdit" :id="id" @determine="getList"></ConsFollowupEdit>
<batch-sign-off :showConsBatchSignOff.sync="showConsBatchSignOff" @determine="getList" :consIds="consIds"></batch-sign-off>
</div>
</template>
......@@ -283,6 +302,7 @@ import FeeApplicationCons from "@/views/ecw/cons/components/FeeApplicationCons.v
import FeeApplication from "@/views/ecw/order/feeApplication.vue"
import {getChannelList} from "@/api/ecw/channel";
import ConsFollowupEdit from "@/views/ecw/consFollowup/components/ConsFollowupEdit.vue"
import BatchSignOff from "@/views/ecw/cons/batchSignOff.vue";
export default {
name: "Cons",
......@@ -293,7 +313,8 @@ export default {
FeeApplicationCons,
SpecialNeedsConsLook,
ConsFollowupEdit,
SpecialNeedsCons
SpecialNeedsCons,
BatchSignOff
},
data() {
return {
......@@ -317,6 +338,7 @@ export default {
key: "numberKey",
value: ""
},
consIds:[],
dateRangeWatEtime: [],
warehouseList:[],
AddressProvince:[],
......@@ -358,6 +380,7 @@ export default {
showSpecialNeedsCons: false,
showSpecialNeedsConsLook: false,
showConsFollowupEdit: false,
showConsBatchSignOff: false,
id: null,
currencyList: [],
consNum: null,
......@@ -404,6 +427,9 @@ export default {
},
},
methods: {
handleSelectionChange(val){
this.consIds = val.map((i) => i.id)
},
getChannelList() {
getChannelList().then((res) => (this.channelList = res.data))
},
......@@ -495,6 +521,7 @@ export default {
watEtime: undefined,
watTime: undefined,
signed: undefined,
signer: undefined,
signedTime: undefined,
signedRemarks: undefined,
sumQuantity: undefined,
......@@ -518,6 +545,19 @@ export default {
this.resetForm("queryForm");
this.handleQuery();
},
handleEditMore(){
this.$router.push("/cons/cons/create-more")
},
handleEdit(){
this.$router.push("/cons/cons/create")
},
handleBatchSignOff(){
if(!this.consIds.length){
return this.$message.error(this.$t('最少选择一个包裹'))
}
this.showConsBatchSignOff=true;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
......
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