You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

630 lines
20 KiB

2 years ago
<template>
<basic-container>
<div class="avue-crud">
<el-row :hidden="!search" style="margin-bottom: 5%">
<!-- 列表模块 -->
<el-table ref="table" v-loading="loading"
:data="data"
height="20%"
style="width: 100%"
:border="option.border">
<template v-for="(item,index) in option.columnBasic">
<!-- 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>
</el-row>
<el-row>
<el-tabs
type="card"
class="demo-tabs"
style="width: 100%"
v-model="activeName"
@tab-click="handleClick"
>
<el-tab-pane label="订单列表" name="library">
<el-table ref="table" v-loading="loading"
@selection-change="selectionChange"
:data="dataPare"
: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="60" align="center">
</el-table-column>
<template v-for="(item,index) in option.columnStockOrder">
<!-- 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>
<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-tab-pane>
<el-tab-pane label="备货包件" name="outbound">
<el-table ref="table" v-loading="loading"
@selection-change="selectionChange"
:data="data1"
:height="height"
style="width: 100%"
:border="option.border">
<!-- <el-table-column type="selection" v-if="option.selection" width="55" align="center"></el-table-column>-->
2 years ago
<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="60" align="center">
</el-table-column>
<template v-for="(item,index) in option.columnStockingBag">
<!-- table字段 -->
<el-table-column v-if="item.hide!==true"
:prop="item.prop"
:label="item.label"
:width="item.width"
:key="index">
</el-table-column>
</template>
<!-- 操作栏模块
2 years ago
<el-table-column prop="menu" label="操作" :width="220" align="center">
<template #="{row}">
&lt;!&ndash; <el-button type="primary" text icon="el-icon-view" @click="handleView(row)">查看</el-button>&ndash;&gt;
&lt;!&ndash; <el-button type="primary" text icon="el-icon-edit" @click="handleEdit(row)">编辑</el-button>&ndash;&gt;
&lt;!&ndash; <el-button type="primary" text icon="el-icon-delete" @click="rowDel(row)">删除</el-button>&ndash;&gt;
2 years ago
</template>
</el-table-column>-->
2 years ago
</el-table>
<div class="avue-crud__pagination" style="width:100%">
<!-- 分页模块 -->
<el-pagination align="right"
background
@size-change="sizeChange"
@current-change="currentChange"
:current-page="page1.currentPage"
:page-sizes="[10, 20, 30, 40, 50, 100]"
:page-size="page1.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="page1.total">
</el-pagination>
</div>
</el-tab-pane>
<el-tab-pane label="库存品" name="enter">
<el-table ref="table" v-loading="loading"
@selection-change="selectionChange"
:data="data2"
:height="height"
style="width: 100%"
:border="option.border">
<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="70" align="center">
</el-table-column>
<template v-for="(item,index) in option.columnInventory">
<!-- 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>
<div class="avue-crud__pagination" style="width:100%">
<!-- 分页模块 -->
<el-pagination align="right"
background
@size-change="sizeChange"
@current-change="currentChange"
:current-page="page2.currentPage"
:page-sizes="[10, 20, 30, 40, 50, 100]"
:page-size="page2.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="page2.total">
</el-pagination>
</div>
</el-tab-pane>
</el-tabs>
</el-row>
<!-- <el-row>
<div class="avue-crud__pagination" style="width:100%">
&lt;!&ndash; 分页模块 &ndash;&gt;
<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 v-model="dialogFormCustomer" title="修改客户信息">
2 years ago
<el-form :model="formCustomer">
<el-form-item label="姓名" :label-width="formLabelWidth">
<el-input v-model="formCustomer.name" autocomplete="off" />
</el-form-item>
<el-form-item label="电话" :label-width="formLabelWidth">
<el-input v-model="formCustomer.phone" autocomplete="off" />
</el-form-item>
<el-form-item label="地址" :label-width="formLabelWidth">
<el-input
v-model="formCustomer.address"
:rows="2"
type="textarea"
placeholder="请填写地址"
/>
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogFormCustomer = false">取消</el-button>
&lt;!&ndash; <el-button type="primary" @click="dialogFormVisible = false"> 确定 </el-button>&ndash;&gt;
2 years ago
<el-button type="primary" @click="callFordelivery('3')"> 确定 </el-button>
</span>
</template>
</el-dialog>-->
2 years ago
</div>
</basic-container>
</template>
<script>
import {
getList,
getDetail,
add,
update,
remove,
getDetailStockupOwn,
getDetailReservationOwn, getDetailOrderOwn, getDetailInventoryOwn
} from '@/api/distribution/distrilbutionBillLading';
import option from "@/option/distribution/distrilbutionBillLading";
2 years ago
import { mapGetters } from "vuex";
import { getDictionaryBiz } from '@/api/system/dict';
import { getParcelListOwn } from '@/api/distribution/distributionParcelList';
export default {
data () {
return {
height: 0,
activeName: 'library',
2 years ago
// 弹框标题
title: '',
// 是否展示弹框
box: false,
// 是否显示查询
search: true,
// 加载中
loading: false,
2 years ago
// 是否为查看模式
view: false,
// 查询信息
query: {},
// 分页信息
page: {
currentPage: 1,
pageSize: 10,
total: 40
},
// 分页信息
page1: {
currentPage: 1,
pageSize: 10,
total: 40
},
// 分页信息
page2: {
currentPage: 1,
pageSize: 10,
total: 40
},
// 分页信息
page3: {
currentPage: 1,
pageSize: 10,
total: 40
},
// 表单数据
form: {},
formCall: {},// 通知
formService: {}, // 服务
formCustomer: {}, // 客户
// 选择行
selectionList: [],
// 表单配置
option: option,
// 表单列表
data: [],
data1: [],
data2: [],
dataPare: [],
data3: [],
distributionType: [],
serveTypeList: [],
deliveryWayList: [],
stockupStatusList: [],
dialogTableVisible: false,
dialogFormVisible: false,
dialogFormCustomer: false,
dialogFormService: false,
formLabelWidth: '120px',
handler:true, //首次
trade:false, // 商
municipal:true, // 市
taker:true, // 自提
}
},
mounted () {
this.init();
},
watch:{
'$route.query.id':{
handler(newVal, oldVal) {
// console.log(newVal, oldVal);
this.init();
},
deep: true,
immediate: true
}
},
computed: {
...mapGetters(["permission"]),
permissionList() {
return {
addBtn: this.validData(this.permission.basicdataBrandCategory_add, false),
viewBtn: this.validData(this.permission.basicdataBrandCategory_view, false),
delBtn: this.validData(this.permission.basicdataBrandCategory_delete, false),
editBtn: this.validData(this.permission.basicdataBrandCategory_edit, false)
};
},
ids () {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(",");
}
},
methods: {
handleClick (tab, event) {
console.log(tab, event)
console.log(tab.props.name);
this.leibiao = tab.props.name;
if( this.leibiao == 'library'){
//订单
this.getOrderList(this.page);
}else if( this.leibiao == 'outbound'){
//包件
this.getStockUpParcelsList(this.page1);
}else if( this.leibiao == 'enter'){
//库存品
this.getInventoryList(this.page2);
}
2 years ago
},
init () {
this.height = this.setPx(document.body.clientHeight - 570);
getDictionaryBiz('distribution_type').then(res => { //配送类型
this.distributionType = res.data.data;
});
getDictionaryBiz('delivery_way').then(res => { //配送方式
this.deliveryWayList = res.data.data;
});
getDictionaryBiz('stockup_status').then(res => { //配送方式
this.stockupStatusList = res.data.data;
});
getDictionaryBiz('addvalue_serve_type').then(res => { //服务类型
this.serveTypeList = res.data.data;
});
this.onLoad(this.page);
},
searchHide () {
this.search = !this.search;
},
searchChange () {
this.onLoad(this.page);
},
searchReset () {
this.query = {};
this.page.currentPage = 1;
this.onLoad(this.page);
},
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: "操作成功!"
});
})
}
},
//全部
handleEntire(){
this.handler = true;
this.taker = true;
this.trade = false;
},
//商配
handleTrade(){
// this.handler = true;
this.trade = true;
},
//商配
handleMunicipal(){
// this.handler = true;
// this.taker = true;
},
//自提
handlePickUpStore(){
this.loading = true;
// console.log("this.query",this.query);
let params = {};
this.query.typeService = '1';
getList(this.page.currentPage, this.page.pageSize, Object.assign(params, this.query)).then(res => {
const data = res.data.data;
this.page.total = data.total;
this.data = data.records;
this.loading = false;
this.selectionClear();
this.handler = false;
this.taker = false;
});
}, //自提的通知
handleInform(index){
this.loading = true;
// console.log("this.query",this.query);
let params = {};
this.query.typeService = '1';
switch (index) {
case '1':
this.query.notification = index;
break;
case '2':
this.query.notification = index;
break;
}
this.query.typeService = '1';
getList(this.page.currentPage, this.page.pageSize, Object.assign(params, this.query)).then(res => {
const data = res.data.data;
this.page.total = data.total;
this.data = data.records;
this.loading = false;
this.selectionClear();
this.handler = false;
this.taker = false;
});
},
handleAdd () {
this.title = '新增'
this.form = {}
this.box = true
},
handleEdit (row) {
this.title = '编辑'
this.box = true
getDetail(row.id).then(res => {
this.form = res.data.data;
});
},
handleView (row) {
this.title = '查看'
this.view = true;
this.box = true;
getDetail(row.id).then(res => {
this.form = res.data.data;
});
},
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) {
// console.log("添加阿斯顿发生",list);
this.selectionList = list;
},
selectionClear () {
this.selectionList = [];
// this.$refs.table.clearSelection();
},
currentChange (currentPage) {
if(!!this.leibiao && this.leibiao == 'library'){
this.page.currentPage = currentPage;
this.getOrderList(this.page);
}else if(!!this.leibiao && this.leibiao == 'outbound'){
this.page1.currentPage = currentPage;
this.getStockUpParcelsList(this.page1);
}
else if(!!this.leibiao && this.leibiao == 'enter'){
this.page2.currentPage = currentPage;
this.getInventoryList(this.page2);
}
else {
this.page3.currentPage = currentPage;
this.getReservationList(this.page3);
}
},
sizeChange (pageSize) {
if(!!this.leibiao && this.leibiao == 'library'){
this.page.pageSize = pageSize;
this.getOrderList(this.page);
}else if(!!this.leibiao && this.leibiao == 'outbound'){
this.page1.pageSize = pageSize;
this.getStockUpParcelsList(this.page1);
}
else if(!!this.leibiao && this.leibiao == 'enter'){
this.page2.pageSize = pageSize;
this.getInventoryList(this.page2);
}
else{
this.page3.pageSize = pageSize;
this.getReservationList(this.page3);
}
},
onLoad (page, params = {}) {
// this.loading = true;
this.query.id = this.$route.query.id;
getDetailStockupOwn(this.$route.query.id).then(res => {
console.log("返回的值",res.data.data);
2 years ago
const data = res.data.data;
this.data[0] = data;
this.loading = false;
this.getOrderList(page);
2 years ago
// console.log(">>>>>",this.data[0],deliveryTypeName,deliveryWayName,serveTypeName);
this.selectionClear();
});
} ,
//查询包件列表
async getStockUpParcelsList(page){
let a = await getDetailReservationOwn(page.currentPage,page.pageSize,{id :this.$route.query.id});
2 years ago
console.log("包件...",a.data);
const data = a.data.data;
this.data1 = data.records;
this.data1.forEach(i =>{
let b = this.stockupStatusList.find( a => a.dictKey == i.stockupStatus);
if(!!b){
i.stockupStatusName = b.dictValue;
}
})
this.page1.total = a.data.data.total;
this.loading = false;
this.selectionClear();
},
//查询订单列表
async getOrderList(page){
let a =await getDetailOrderOwn(page.currentPage,page.pageSize,{id :this.$route.query.id});
console.log("订单...",a.data);
const data = a.data.data;
this.dataPare = data.records;
this.dataPare.forEach(i =>{
let b = this.stockupStatusList.find( a => a.dictKey == i.stockupStatus);
if(!!b){
i.stockupStatusName = b.dictValue;
}
})
this.page.total = a.data.data.total;
this.loading = false;
this.selectionClear();
},
//查询库存品列表
async getInventoryList(page){
let a =await getDetailInventoryOwn(page.currentPage,page.pageSize,{id :this.$route.query.id});
console.log("库存品...",a.data);
const data = a.data.data;
this.data2 = data.records;
this.data2.forEach(i =>{
let b = this.stockupStatusList.find( a => a.dictKey == i.stockupStatus);
if(!!b){
i.stockupStatusName = b.dictValue;
}
})
this.page2.total = a.data.data.total;
this.loading = false;
this.selectionClear();
},
//转换类型
getOwnServer(row,name,list){
row.forEach( i =>{
let a = list.find( s => s.dictKey == i);
name += a.dictValue+' ';
});
return name;
},
}
};
</script>
<style scoped>
.el-button--text {
margin-right: 15px;
}
.el-select {
width: 300px;
}
.el-input {
width: 300px;
}
.dialog-footer button:first-child {
margin-right: 10px;
}
</style>