|
|
|
<template>
|
|
|
|
<basic-container>
|
|
|
|
<div class="avue-crud">
|
|
|
|
<el-row :hidden="!search" style="padding:6px 18px">
|
|
|
|
<!-- 查询模块 -->
|
|
|
|
<el-form :inline="true" :model="query">
|
|
|
|
<!-- 查询按钮 -->
|
|
|
|
<el-form-item>
|
|
|
|
<el-button type="primary" icon="el-icon-search" @click="searchChange">搜 索</el-button>
|
|
|
|
<el-button icon="el-icon-delete" @click="searchReset()">清 空</el-button>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form>
|
|
|
|
</el-row>
|
|
|
|
<el-row style="margin-top: 30px">
|
|
|
|
<el-button-group>
|
|
|
|
<el-button type="primary" icon="el-icon-warning" @click="aaa" >待确认</el-button>
|
|
|
|
<el-button type="primary" icon="el-icon-circle-check" @click="bbb">已确认<i class="el-icon-arrow-right el-icon--right"></i></el-button>
|
|
|
|
<el-button type="primary" icon="el-icon-view" @click="ccc">全部</el-button>
|
|
|
|
</el-button-group>
|
|
|
|
<div class="avue-crud__header">
|
|
|
|
<!-- 头部左侧按钮模块 -->
|
|
|
|
<div class="avue-crud__left" style="margin-top: 20px">
|
|
|
|
<el-button type="primary" icon="el-icon-plus" @click="handleAdd">添加预约</el-button>
|
|
|
|
<el-button type="danger" icon="el-icon-delete" @click="handleConfirmReservations" plain>批量确认</el-button>
|
|
|
|
<el-button type="danger" icon="el-icon-delete" @click="handleStockUp" plain>批量转备货</el-button>
|
|
|
|
<el-button type="danger" icon="el-icon-delete" @click="handleDeliverys" plain>批量转配送</el-button>
|
|
|
|
</div>
|
|
|
|
<!-- 头部右侧按钮模块 -->
|
|
|
|
<div class="avue-crud__right">
|
|
|
|
<el-button icon="el-icon-refresh" @click="searchChange" circle></el-button>
|
|
|
|
<el-button icon="el-icon-search" @click="searchHide" circle></el-button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</el-row>
|
|
|
|
<el-row >
|
|
|
|
<!-- 列表模块 -->
|
|
|
|
<el-table ref="table" v-loading="loading"
|
|
|
|
@selection-change="selectionChange"
|
|
|
|
:data="data"
|
|
|
|
:height="height"
|
|
|
|
style="width: 100%"
|
|
|
|
:border="option.border">
|
|
|
|
<el-table-column type="selection" v-if="option.selection" width="55" align="center"></el-table-column>
|
|
|
|
<el-table-column type="expand" v-if="option.expand" align="center"></el-table-column>
|
|
|
|
<el-table-column v-if="option.index" label="序号" type="index" width="80px" align="center"></el-table-column>
|
|
|
|
|
|
|
|
<template v-for="(item,index) in option.column">
|
|
|
|
<!-- table字段 -->
|
|
|
|
<el-table-column v-if="item.hide!==true"
|
|
|
|
:prop="item.prop"
|
|
|
|
:label="item.label"
|
|
|
|
:width="item.width"
|
|
|
|
:key="index">
|
|
|
|
</el-table-column>
|
|
|
|
</template>
|
|
|
|
<!-- 操作栏模块 -->
|
|
|
|
<el-table-column prop="menu" label="操作" :width="220" align="center">
|
|
|
|
<template #="{row}">
|
|
|
|
<el-button type="primary" text icon="el-icon-view" @click="handleView(row)">查看</el-button>
|
|
|
|
<el-button type="primary" text icon="el-icon-edit" @click="handleEdit(row)">编辑</el-button>
|
|
|
|
<el-button type="primary" text icon="el-icon-delete" @click="rowDel(row)">删除</el-button>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table>
|
|
|
|
</el-row>
|
|
|
|
<el-row>
|
|
|
|
<div class="avue-crud__pagination" style="width:100%">
|
|
|
|
<!-- 分页模块 -->
|
|
|
|
<el-pagination align="right"
|
|
|
|
background
|
|
|
|
@size-change="sizeChange"
|
|
|
|
@current-change="currentChange"
|
|
|
|
:current-page="page.currentPage"
|
|
|
|
:page-sizes="[10, 20, 30, 40, 50, 100]"
|
|
|
|
:page-size="page.pageSize"
|
|
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
:total="page.total">
|
|
|
|
</el-pagination>
|
|
|
|
</div>
|
|
|
|
</el-row>
|
|
|
|
<!-- 表单模块 -->
|
|
|
|
<el-dialog :title="title"
|
|
|
|
v-model="box"
|
|
|
|
width="50%"
|
|
|
|
:before-close="beforeClose"
|
|
|
|
append-to-body>
|
|
|
|
<el-form :disabled="view" ref="form" :model="form" label-width="80px">
|
|
|
|
<!-- 表单字段 -->
|
|
|
|
<el-form-item label="订单自编号;订单自编号,关联订单表" prop="orderId">
|
|
|
|
<el-input v-model="form.orderId" placeholder="请输入订单自编号;订单自编号,关联订单表"/>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="收货人" prop="consignee">
|
|
|
|
<el-input v-model="form.consignee" placeholder="请输入收货人"/>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="收件地址" prop="deliveryAddress">
|
|
|
|
<el-input v-model="form.deliveryAddress" placeholder="请输入收件地址"/>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="预约时间" prop="reservationData">
|
|
|
|
<el-input v-model="form.reservationDate" placeholder="请输入预约时间"/>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="服务类型;预约服务类型;1-上楼、2-超区、3-拆样、4-平移、5-分拣、6-搬运、7-返货;" prop="serveType">
|
|
|
|
<el-input v-model="form.serveType" placeholder="请输入服务类型;预约服务类型;1-上楼、2-超区、3-拆样、4-平移、5-分拣、6-搬运、7-返货;"/>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="配送方式;预约添加送货方式;1-送货(商配的唯一方式)、2-送货上楼、3-送装一体、4-装" prop="deliveryType">
|
|
|
|
<el-input v-model="form.deliveryType" placeholder="请输入配送方式;预约添加送货方式;1-送货(商配的唯一方式)、2-送货上楼、3-送装一体、4-装"/>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="到付运费" prop="collectFee">
|
|
|
|
<el-input v-model="form.collectFee" placeholder="请输入到付运费"/>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="其他费用" prop="otherFee">
|
|
|
|
<el-input v-model="form.otherFee" placeholder="请输入其他费用"/>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="代付运费" prop="replaceFee">
|
|
|
|
<el-input v-model="form.replaceFee" placeholder="请输入代付运费"/>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="收件人电话" prop="deliveryPhone">
|
|
|
|
<el-input v-model="form.deliveryPhone" placeholder="请输入收件人电话"/>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="预约信息状态;预约列表信息状态;1-待确认、2-已确认" prop="resvervationStatus">
|
|
|
|
<el-input v-model="form.resvervationStatus" placeholder="请输入预约信息状态;预约列表信息状态;1-待确认、2-已确认"/>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="订单来源" prop="orderSource">
|
|
|
|
<el-input v-model="form.orderSource" placeholder="请输入订单来源"/>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="备货状态;备货状态;1-未备货、2-待备货、3-已备货" prop="stockupStatus">
|
|
|
|
<el-input v-model="form.stockupStatus" placeholder="请输入备货状态;备货状态;1-未备货、2-待备货、3-已备货"/>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="备货区编号" prop="goodsShelfId">
|
|
|
|
<el-input v-model="form.goodsShelfId" placeholder="请输入备货区编号"/>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="预留1" prop="reserve1">
|
|
|
|
<el-input v-model="form.reserve1" placeholder="请输入预留1"/>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="预留2" prop="reserve2">
|
|
|
|
<el-input v-model="form.reserve2" placeholder="请输入预留2"/>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="预留3" prop="reserve3">
|
|
|
|
<el-input v-model="form.reserve3" placeholder="请输入预留3"/>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="预留4" prop="reserve4">
|
|
|
|
<el-input v-model="form.reserve4" placeholder="请输入预留4"/>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="预留5" prop="reserve5">
|
|
|
|
<el-input v-model="form.reserve5" placeholder="请输入预留5"/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form>
|
|
|
|
<!-- 表单按钮 -->
|
|
|
|
<template #footer>
|
|
|
|
<span v-if="!view" class="dialog-footer">
|
|
|
|
<el-button type="primary" icon="el-icon-circle-check" @click="handleSubmit">提 交</el-button>
|
|
|
|
<el-button icon="el-icon-circle-close" @click="box = false">取 消</el-button>
|
|
|
|
</span>
|
|
|
|
</template>
|
|
|
|
</el-dialog>
|
|
|
|
</div>
|
|
|
|
</basic-container>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { getList, getDetail, add, update, remove,confirms,addReservations } from "@/api/distribution/distributionReservation";
|
|
|
|
import option from "@/option/distribution/distributionReservation";
|
|
|
|
import { mapGetters } from "vuex";
|
|
|
|
import { getDictionaryBiz } from '@/api/system/dict';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
data () {
|
|
|
|
return {
|
|
|
|
height: 0,
|
|
|
|
// 弹框标题
|
|
|
|
title: '',
|
|
|
|
// 是否展示弹框
|
|
|
|
box: false,
|
|
|
|
// 是否显示查询
|
|
|
|
search: true,
|
|
|
|
// 加载中
|
|
|
|
loading: true,
|
|
|
|
// 是否为查看模式
|
|
|
|
view: false,
|
|
|
|
// 查询信息
|
|
|
|
query: {},
|
|
|
|
// 分页信息
|
|
|
|
page: {
|
|
|
|
currentPage: 1,
|
|
|
|
pageSize: 10,
|
|
|
|
total: 40
|
|
|
|
},
|
|
|
|
// 表单数据
|
|
|
|
form: {},
|
|
|
|
// 选择行
|
|
|
|
selectionList: [],
|
|
|
|
// 表单配置
|
|
|
|
option: option,
|
|
|
|
// 表单列表
|
|
|
|
data: [],
|
|
|
|
//配送方式字典列表
|
|
|
|
deliveryTypeData:[],
|
|
|
|
//配送类型字典列表
|
|
|
|
resvervationStatusData:[],
|
|
|
|
stockupStatusData:[],
|
|
|
|
orderSourceData:[],
|
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted () {
|
|
|
|
this.init();
|
|
|
|
this.onLoad(this.page);
|
|
|
|
this.getDictionary();
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
...mapGetters(["permission"]),
|
|
|
|
ids () {
|
|
|
|
let ids = [];
|
|
|
|
this.selectionList.forEach(ele => {
|
|
|
|
ids.push(ele.id);
|
|
|
|
});
|
|
|
|
return ids.join(",");
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
init () {
|
|
|
|
this.height = this.setPx(document.body.clientHeight - 340);
|
|
|
|
},
|
|
|
|
//数据字典数据获取
|
|
|
|
getDictionary(){
|
|
|
|
getDictionaryBiz("addvalue_serve_type").then(res=>{
|
|
|
|
this.addvalueServeTypeData = res.data.data;
|
|
|
|
console.log(this.addvalueServeTypeData);
|
|
|
|
})
|
|
|
|
getDictionaryBiz("delivery_type").then(res=>{
|
|
|
|
this.deliveryTypeData = res.data.data;
|
|
|
|
console.log(this.deliveryWayData);
|
|
|
|
})
|
|
|
|
//订单来源
|
|
|
|
getDictionaryBiz("order_source").then(res=>{
|
|
|
|
this.orderSourceData = res.data.data;
|
|
|
|
console.log(this.deliveryTypeData);
|
|
|
|
})
|
|
|
|
//预约状态
|
|
|
|
getDictionaryBiz("resvervation_status").then(res=>{
|
|
|
|
this.resvervationStatusData = res.data.data;
|
|
|
|
console.log(this.deliveryTypeData);
|
|
|
|
})
|
|
|
|
//备货状态
|
|
|
|
getDictionaryBiz("stockup_status").then(res=>{
|
|
|
|
this.stockupStatusData = res.data.data;
|
|
|
|
console.log(this.deliveryTypeData);
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
searchHide () {
|
|
|
|
this.search = !this.search;
|
|
|
|
},
|
|
|
|
searchChange () {
|
|
|
|
this.onLoad(this.page);
|
|
|
|
},
|
|
|
|
searchReset () {
|
|
|
|
this.query = {};
|
|
|
|
this.page.currentPage = 1;
|
|
|
|
this.onLoad(this.page);
|
|
|
|
},
|
|
|
|
handleConfirmReservations(){
|
|
|
|
if (this.selectionList.length === 0) {
|
|
|
|
this.$message.warning("请选择至少一条数据");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
let param = {};
|
|
|
|
param.ids=this.ids.toString();
|
|
|
|
addReservations(param).then(res=>{
|
|
|
|
this.selectionClear();
|
|
|
|
this.onLoad(this.page);
|
|
|
|
this.$message({
|
|
|
|
type: "success",
|
|
|
|
message: "操作成功!"
|
|
|
|
});
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
handleSubmit () {
|
|
|
|
if (!this.form.id) {
|
|
|
|
add(this.form).then(() => {
|
|
|
|
this.box = false;
|
|
|
|
this.onLoad(this.page);
|
|
|
|
this.$message({
|
|
|
|
type: "success",
|
|
|
|
message: "操作成功!"
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
update(this.form).then(() => {
|
|
|
|
this.box = false;
|
|
|
|
this.onLoad(this.page);
|
|
|
|
this.$message({
|
|
|
|
type: "success",
|
|
|
|
message: "操作成功!"
|
|
|
|
});
|
|
|
|
})
|
|
|
|
}
|
|
|
|
},
|
|
|
|
handleAdd () {
|
|
|
|
this.$router.push({
|
|
|
|
path: '/distribution/reservation/reservationFrom',
|
|
|
|
});
|
|
|
|
},
|
|
|
|
handleEdit (row) {
|
|
|
|
this.title = '编辑'
|
|
|
|
this.box = true
|
|
|
|
getDetail(row.id).then(res => {
|
|
|
|
this.form = res.data.data;
|
|
|
|
});
|
|
|
|
},
|
|
|
|
aaa(){
|
|
|
|
this.query.reservationStatus='1';
|
|
|
|
this.onLoad(this.page)
|
|
|
|
},
|
|
|
|
bbb(){
|
|
|
|
this.query.reservationStatus='2';
|
|
|
|
this.onLoad(this.page)
|
|
|
|
},
|
|
|
|
ccc(){
|
|
|
|
this.query.reservationStatus='';
|
|
|
|
this.onLoad(this.page);
|
|
|
|
},
|
|
|
|
handleView (row) {
|
|
|
|
this.title = '查看'
|
|
|
|
this.view = true;
|
|
|
|
this.box = true;
|
|
|
|
getDetail(row.id).then(res => {
|
|
|
|
this.form = res.data.data;
|
|
|
|
});
|
|
|
|
},
|
|
|
|
/**
|
|
|
|
* 批量转配送
|
|
|
|
*/
|
|
|
|
handleDeliverys(){
|
|
|
|
|
|
|
|
this.$router.push({
|
|
|
|
path: '/distribution/reservation/atlas',
|
|
|
|
});
|
|
|
|
},
|
|
|
|
handleStockUp(){
|
|
|
|
if (this.selectionList.length === 0) {
|
|
|
|
this.$message.warning("请选择至少一条数据");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
let param= {}
|
|
|
|
param.ids = this.ids;
|
|
|
|
const date = new Date();
|
|
|
|
const year = date.getFullYear();
|
|
|
|
const month = (date.getMonth() + 1).toString().padStart(2, '0');
|
|
|
|
const day = date.getDate().toString().padStart(2, '0');
|
|
|
|
const formattedDate = `${year}-${month}-${day}`;
|
|
|
|
console.log(formattedDate);
|
|
|
|
param.stockupDate=formattedDate;
|
|
|
|
param.goodsAreaId="46546456156";
|
|
|
|
param.addvalueType="1";
|
|
|
|
confirms(param).then(()=>{
|
|
|
|
this.selectionClear();
|
|
|
|
this.onLoad(this.page);
|
|
|
|
this.$message({
|
|
|
|
type: "success",
|
|
|
|
message: "操作成功!"
|
|
|
|
});
|
|
|
|
})
|
|
|
|
},
|
|
|
|
handleDelete () {
|
|
|
|
if (this.selectionList.length === 0) {
|
|
|
|
this.$message.warning("请选择至少一条数据");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
this.$confirm("确定将选择数据删除?", {
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
cancelButtonText: "取消",
|
|
|
|
type: "warning"
|
|
|
|
})
|
|
|
|
.then(() => {
|
|
|
|
return remove(this.ids);
|
|
|
|
})
|
|
|
|
.then(() => {
|
|
|
|
this.selectionClear();
|
|
|
|
this.onLoad(this.page);
|
|
|
|
this.$message({
|
|
|
|
type: "success",
|
|
|
|
message: "操作成功!"
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
rowDel (row) {
|
|
|
|
this.$confirm("确定将选择数据删除?", {
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
cancelButtonText: "取消",
|
|
|
|
type: "warning"
|
|
|
|
})
|
|
|
|
.then(() => {
|
|
|
|
return remove(row.id);
|
|
|
|
})
|
|
|
|
.then(() => {
|
|
|
|
this.onLoad(this.page);
|
|
|
|
this.$message({
|
|
|
|
type: "success",
|
|
|
|
message: "操作成功!"
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
beforeClose (done) {
|
|
|
|
done()
|
|
|
|
this.form = {};
|
|
|
|
this.view = false;
|
|
|
|
},
|
|
|
|
selectionChange (list) {
|
|
|
|
this.selectionList = list;
|
|
|
|
},
|
|
|
|
selectionClear () {
|
|
|
|
this.selectionList = [];
|
|
|
|
this.$refs.table.clearSelection();
|
|
|
|
},
|
|
|
|
currentChange (currentPage) {
|
|
|
|
this.page.currentPage = currentPage;
|
|
|
|
this.onLoad(this.page);
|
|
|
|
},
|
|
|
|
sizeChange (pageSize) {
|
|
|
|
this.page.pageSize = pageSize;
|
|
|
|
this.onLoad(this.page);
|
|
|
|
},
|
|
|
|
onLoad (page, params = {}) {
|
|
|
|
this.loading = true;
|
|
|
|
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
|
|
|
|
const data = res.data.data;
|
|
|
|
console.log(">>>>>>>",data);
|
|
|
|
data.records.forEach(item=>{
|
|
|
|
this.orderSourceData.forEach(a=>{
|
|
|
|
if (item.orderSource===a.dictKey){
|
|
|
|
item.orderSource = a.dictValue;
|
|
|
|
}
|
|
|
|
})
|
|
|
|
this.stockupStatusData.forEach(b=>{
|
|
|
|
if (item.stockupStatus===b.dictKey){
|
|
|
|
item.stockupStatus = b.dictValue;
|
|
|
|
}
|
|
|
|
})
|
|
|
|
this.resvervationStatusData.forEach(e=>{
|
|
|
|
if (item.reservationStatus===e.dictKey){
|
|
|
|
item.reservationStatus = e.dictValue;
|
|
|
|
}
|
|
|
|
})
|
|
|
|
this.deliveryTypeData.forEach(c=>{
|
|
|
|
if (item.deliveryType===c.dictKey){
|
|
|
|
console.log("465465465465");
|
|
|
|
item.deliveryType = c.dictValue;
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
this.page.total = data.total;
|
|
|
|
this.data = data.records;
|
|
|
|
this.loading = false;
|
|
|
|
this.selectionClear();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|