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.

735 lines
19 KiB

<template>
<basic-container>
<div class="avue-crud">
<el-row>
<div class="avue-crud__header">
<!-- 头部左侧按钮模块 -->
<div class="avue-crud__left">
<!-- <el-button type="primary" icon="el-icon-plus" @click="handleAdd"> </el-button>-->
<!-- <el-button type="danger" icon="el-icon-delete" @click="handleDelete" plain> </el-button>-->
<el-button type="danger" icon="el-icon-download" @click="handleExportInfo" plain
>导出
</el-button>
</div>
<!-- 头部右侧按钮模块 -->
<div class="avue-crud__right">
<el-button icon="el-icon-refresh" @click="searchChange" circle></el-button>
<el-button icon="Operation" @click="showdrawer(true)" circle></el-button>
2 years ago
<!-- <el-button icon="el-icon-search" @click="searchHide" circle></el-button> -->
</div>
</div>
</el-row>
<el-row>
<!-- 列表模块 -->
<tablecmt
:columnList="columnList"
:tableData="data"
:loading="loading"
@inputTxt="inputsc"
@timeCheck="timesc"
@btnCheck="btnsc"
@selectCheck="selectsc"
@selection="selectionsc"
>
<template #default="slotProps">
2 years ago
<el-text size="small" @click="editsolt(slotProps.scope)"> </el-text>
</template>
</tablecmt>
</el-row>
<el-row class='el-fy'>
<div class="avue-crud__pagination flex-c-sb" style="width: 100%">
<div style="font-size: 14px">勾选数量: {{ selectionList.length }}</div>
<!-- 分页模块 -->
<el-pagination
align="right"
background
@size-change="sizeChange"
@current-change="currentChange"
:current-page="page.currentPage"
:page-sizes="[30, 50, 80, 120]"
: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="consignee">
<el-input v-model="form.consignee" placeholder="请输入客户" />
</el-form-item>
<el-form-item label="客户电话" prop="consigneePhone">
<el-input v-model="form.consigneePhone" placeholder="请输入客户电话" />
</el-form-item>
<el-form-item label="收货地址" prop="deliveryAddress">
<el-input v-model="form.deliveryAddress" placeholder="请输入收货地址" />
</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>
<edittablehead
@setcolum="setnewcolum"
@closce="showdrawer"
:drawerShow="drawerShow"
:columnList="columnList"
></edittablehead>
</template>
<script>
import {
getList,
getPage,
getDetail,
add,
update,
remove,
getSigndetailExport,
} from '@/api/distribution/distributionSigndetail';
import option from '@/option/distribution/distributionSigndetail';
import { mapGetters } from 'vuex';
import dayjs from 'dayjs';
import { getDictionaryBiz } from '@/api/system/dict';
import { getDeliveryListExport } from '@/api/distribution/distributionDeliveryList';
import { downloadXls } from '@/utils/util';
import { getSignforExport } from '@/api/distribution/distributionSignfor';
export default {
data() {
return {
drawerShow: false,
height: 0,
// 弹框标题
title: '',
// 是否展示弹框
box: false,
// 是否显示查询
search: true,
// 加载中
loading: true,
// 是否为查看模式
view: false,
// 查询信息
query: {},
// 分页信息
page: {
currentPage: 1,
2 years ago
pageSize: 30,
total: 40,
},
// 表单数据
form: {},
// 选择行
selectionList: [],
// 表单配置
option: option,
columnList: [
{
prop: '',
label: '序号',
type: 0,
values: '',
width: 55,
checkarr: [],
fixed: true,
},
{
2 years ago
prop: 'serviceNumber',
label: '服务号',
type: 2,
values: '',
width: '130',
checkarr: [],
fixed: true,
sortable: true,
head: false,
},
{
prop: 'trainNumber',
label: '配送车次号',
type: 2,
values: '',
width: '130',
checkarr: [],
fixed: false,
sortable: true,
head: false,
},
{
prop: 'type',
label: '配送类型',
type: 3,
values: '',
width: '130',
2 years ago
checkarr: [
{
value: '2',
label: '市配',
},
{
value: '1',
label: '商配',
},
],
fixed: false,
sortable: true,
},
{
prop: 'orderCode',
label: '订单自编号',
type: 2,
values: '',
width: '130',
checkarr: [],
fixed: false,
sortable: true,
head: false,
},
{
prop: 'mallName',
label: '商城名称',
type: 2,
values: '',
width: '130',
checkarr: [],
fixed: false,
sortable: true,
},
2 years ago
// {
// prop: 'descriptionGoods',
// label: '货物名称',
// type: 2,
// values: '',
// width: '130',
// checkarr: [],
// fixed: false,
// sortable: true,
// },
{
2 years ago
prop: 'warehouse',
label: '仓库',
type: 2,
values: '',
width: '130',
checkarr: [],
fixed: false,
sortable: true,
},
{
prop: 'warehouseEntryTime',
label: '入库时间',
type: 4,
values: '',
width: '130',
checkarr: [],
fixed: false,
sortable: true,
},
2 years ago
// {
// prop: 'leadTime',
// label: '备货时间',
// type: 4,
// values: '',
// width: '130',
2 years ago
// checkarr: [],
// fixed: false,
// sortable: true,
// },
{
prop: 'sjsigningTime',
label: '司机签收时间',
type: 4,
values: '',
width: '130',
checkarr: [],
fixed: false,
sortable: true,
head: false,
},
{
prop: 'signingTime',
label: '文员签收时间',
type: 4,
values: '',
width: '130',
checkarr: [],
fixed: false,
sortable: true,
head: false,
},
{
prop: 'storeTime',
label: '在库时长',
type: 2,
values: '',
width: '130',
checkarr: [],
fixed: false,
sortable: true,
},
{
prop: 'totalNumber',
label: '订单总件数',
type: 2,
values: '',
width: '130',
checkarr: [],
fixed: false,
sortable: true,
},
{
prop: 'signfornum',
label: '签收件数',
type: 2,
values: '',
width: '130',
checkarr: [],
fixed: false,
sortable: true,
},
{
prop: 'completeSet',
label: '是否齐套',
type: 3,
values: '',
width: '130',
checkarr: [
{
value: '1',
label: '是',
},
{
value: '2',
label: '否',
},
],
fixed: false,
sortable: true,
},
{
prop: 'brand',
label: '品牌',
type: 2,
values: '',
width: '130',
checkarr: [],
fixed: false,
sortable: true,
},
{
2 years ago
prop: 'consignee',
label: '顾客名称',
type: 2,
values: '',
width: '130',
checkarr: [],
fixed: false,
sortable: true,
},
{
2 years ago
prop: 'deliveryPhone',
label: '客户电话',
type: 2,
values: '',
width: '130',
checkarr: [],
fixed: false,
sortable: true,
},
{
prop: 'deliveryAddress',
label: '顾客地址',
type: 2,
values: '',
width: '130',
checkarr: [],
fixed: false,
sortable: true,
},
{
prop: '',
label: '操作',
type: 6,
values: '',
width: '200',
checkarr: [],
fixed: 'right',
hide: true,
},
// 更多列的配置...
],
// 表单列表
data: [],
//业务类型
deliveryTypeData: [],
};
},
mounted() {
this.init();
this.queryDictionary();
/**
* 初始化获取本地缓存的编辑隐藏的列表
* 固定搭配不能更改
*/
let checkListnewarr = this.$functions.getStorage(window.location.pathname + 'checkList');
let flexListnewarr = this.$functions.getStorage(window.location.pathname + 'flexList');
let sortlistnewarr = this.$functions.getStorage(window.location.pathname + 'sortlist');
if (checkListnewarr) {
this.columnList.map(item => {
item.head = false;
});
checkListnewarr.map(ite => {
this.columnList.map(item => {
if (ite == item.label) {
item.head = true;
}
});
});
} else {
let arr = [];
this.columnList.map(item => {
if (item.head) {
arr.push(item.label);
}
});
this.$functions.setStorage(window.location.pathname + 'checkList', arr);
}
if (flexListnewarr) {
this.columnList.map(item => {
item.fixed = false;
});
flexListnewarr.map(ite => {
this.columnList.map(item => {
if (ite == item.label) {
if (item.type == 6) {
item.fixed = 'right';
} else {
item.fixed = true;
}
}
});
});
} else {
let arr = [];
this.columnList.map(item => {
if (item.fixed) {
arr.push(item.label);
}
});
this.$functions.setStorage(window.location.pathname + 'flexList', arr);
}
if (sortlistnewarr) {
this.columnList.map(item => {
item.sortable = false;
});
sortlistnewarr.map(ite => {
this.columnList.map(item => {
if (ite == item.label) {
item.sortable = true;
}
});
});
} else {
let arr = [];
this.columnList.map(item => {
if (item.sortable) {
arr.push(item.label);
}
});
this.$functions.setStorage(window.location.pathname + 'sortlist', arr);
}
},
computed: {
...mapGetters(['permission']),
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(',');
},
},
methods: {
/**
* 导出
* */
handleExportInfo() {
let row = {};
// if (!!this.ids) {
// row.ids = this.ids;
// }
const ids = this.selectionList.join(',');
row.ids = ids;
// console.log("<><><>>",ids);
row = {...row, ...this.query}
getSigndetailExport(row).then(res => {
// console.log(res.data);
downloadXls(res.data, '签收明细数据.xlsx');
});
},
showdrawer(value) {
this.drawerShow = value;
},
queryDictionary() {
// getDictionaryBiz('distribution_signfor_status').then(res => {
// this.signingStatusData = res.data.data;
// });
getDictionaryBiz('distribution_type').then(res => {
this.deliveryTypeData = res.data.data;
this.columnList[3].checkarr = res.data.data.map(item => {
item.value = item.dictKey;
item.label = item.dictValue;
return item;
});
this.onLoad(this.page);
});
},
/**
* 弹窗的勾选回调用于更改头部数组
* 固定搭配只需要更换 columnList
*/
setnewcolum(newarr, headarr, type) {
// console.log(newarr,'+++++++++++')
if (type == 1) {
this.columnList = newarr;
this.$functions.setStorage(window.location.pathname + 'checkList', headarr);
} else if (type == 2) {
this.columnList = newarr;
this.$functions.setStorage(window.location.pathname + 'flexList', headarr);
} else if (type == 3) {
this.columnList = newarr;
this.$functions.setStorage(window.location.pathname + 'sortlist', headarr);
}
},
selectionsc(value) {
console.log(value);
this.selectionList = value.map(item => item.id);
},
delectsolt(scope) {
const { row } = scope;
console.log(row);
},
editsolt(scope) {
const { row } = scope;
console.log('订单》》》》》》', row);
this.$router.push({
path: '/distribution/signdetail/distributionSigndetaledt',
query: {
data: encodeURIComponent(JSON.stringify(row)),
name: row.orderCode + '-查看订单',
},
});
},
btnsc(index, row) {
console.log(index, row);
},
selectsc(index, row) {
this.query[row.prop] = index;
if (!index) {
delete this.query[row.prop];
}
this.onLoad(this.page);
},
timesc(index, row) {
if (!!index) {
index = dayjs(index).format('YYYY-MM-DD');
}
this.query[row.prop] = index;
if (!index) {
delete this.query[row.prop];
}
this.onLoad(this.page);
},
inputsc(index, row) {
this.query[row.prop] = index;
if (!index) {
delete this.query[row.prop];
}
this.onLoad(this.page);
},
init() {
this.height = this.setPx(document.body.clientHeight - 340);
},
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: '操作成功!',
});
});
}
},
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) {
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;
Squashed commit of the following: commit 859932a264850d576194e4a85decdd2c542ee4fb Author: kilo <wan.ren@foxmail.com> Date: Fri Jun 16 11:18:14 2023 +0800 配送api调整 commit 8f849258241bef3bc65275eb8c6c72f084b0d42d Author: kilo <wan.ren@foxmail.com> Date: Fri Jun 16 11:15:28 2023 +0800 配送api调整 commit bb3434c07a54363a55b1f808554d59a35dff51f2 Author: caoyizhong <1270296080@qq.com> Date: Fri Jun 16 10:56:59 2023 +0800 添加班组 commit e59ea0d301e70c20aa15eb800c66417e57462d47 Merge: ffbd2d0 ccb3fd8 Author: caoyizhong <1270296080@qq.com> Date: Fri Jun 16 09:16:03 2023 +0800 Merge remote-tracking branch 'origin/dev' into dev commit ffbd2d028f29d5f7dbd2140d235aaa9f3c3a9098 Author: caoyizhong <1270296080@qq.com> Date: Fri Jun 16 09:15:54 2023 +0800 修改备货查询 commit ccb3fd8ad5b5a459ea3188b3f3e417e3668d1290 Author: 0.0 <1092404103.qq.com> Date: Thu Jun 15 20:27:23 2023 +0800 1.调整搜索时间 commit 9ef429246e8b9e9c7d5da01edd441a92bdcd34ab Author: kilo <wan.ren@foxmail.com> Date: Thu Jun 15 19:38:33 2023 +0800 仓库所属部门调整 commit 3d2b759b4ec9fe56205094050addedf626bd9533 Author: caoyizhong <1270296080@qq.com> Date: Thu Jun 15 16:23:00 2023 +0800 修改备货 commit c58aa3a26bc61fae9808270b1763a815d5be6549 Author: kilo <wan.ren@foxmail.com> Date: Thu Jun 15 15:01:55 2023 +0800 备货、预约页面 commit 0aa1c28db68dc5233143a3efe27b20db3a86336b Merge: ca423ac 72e0847 Author: caoyizhong <1270296080@qq.com> Date: Thu Jun 15 10:30:15 2023 +0800 Merge remote-tracking branch 'origin/dev' into dev commit ca423ac6e649b61a4febd224fd61d3f7103c6d46 Author: caoyizhong <1270296080@qq.com> Date: Thu Jun 15 10:30:09 2023 +0800 添加库存品页面 # Conflicts: # src/option/distribution/distributionStockList.js # src/views/distribution/inventory/distributionStockArticle.vue # src/views/distribution/inventory/distributionStockList.vue # src/views/distribution/signfor/distributionSignfor.vue # vite.config.js
2 years ago
// this.query.warehousingTime = new Date(this.query.warehousingTime)
// console.log("this.query.warehousingTime>>>>>>>>",this.query.warehousingTime);
getPage(page.currentPage, page.pageSize, this.query).then(res => {
const data = res.data.data;
for (let i = 0; i < data.records.length; i++) {
// eslint-disable-next-line no-empty
for (let j = 0; j < this.deliveryTypeData.length; j++) {
// eslint-disable-next-line no-empty
if (data.records[i].deliveryType == this.deliveryTypeData[j].dictKey) {
data.records[i].deliveryType = this.deliveryTypeData[j].dictValue;
}
}
data.records[i].completeSet = '是';
if (data.records[i].completeSet == '1') {
data.records[i].completeSet = '否';
}
}
this.page.total = data.total;
this.data = data.records;
this.loading = false;
this.selectionClear();
});
},
},
};
</script>
<style scoped lang="scss">
.avue-crud__right {
display: flex;
align-items: flex-end;
}
:deep(.avue-crud) {
display: flex;
height: 100%;
flex-direction: column;
}
:deep(.el-card__body) {
height: 100%;
}
:deep(.el-card) {
height: 100%;
display: flex;
flex-direction: column;
}
.el-fy {
flex: 1;
display: flex;
align-items: flex-end;
}
</style>