Browse Source

新增单一转库存品

fix_bug_pro20231227
qb 1 year ago
parent
commit
d8de4f7c62
  1. 12
      src/api/distribution/distributionStockArticle.js
  2. 25
      src/router/views/index.js
  3. 6
      src/views/distribution/deliverylist/distributionDeliveryList.vue
  4. 12
      src/views/distribution/inventory/delivery/distributionStockArticle.vue
  5. 27
      src/views/distribution/inventory/delivery/distributionStockArticleSelf.vue
  6. 133
      src/views/distribution/inventory/distributionStockArticleFrom.vue

12
src/api/distribution/distributionStockArticle.js

@ -114,13 +114,13 @@ export const add = (row) => {
data: row
})
}
export const addStockRow = (row) => {
export const addStockRow = params => {
return request({
url: '/api/logpm-distribution/distributionStockArticle/saveStockRow',
method: 'post',
data: row
})
}
url: '/api/logpm-distribution/distributionParcelList/packageTransfer',
method: 'get',
params,
});
};
/**
* 转库存品
* @param ids

25
src/router/views/index.js

@ -27,15 +27,22 @@ export default [
},
],
},
// {
// path: '/tjpage',
// name: '统计页面',
// meta: {
// i18n: 'dashboard',
// menu: false,
// },
// component: () => import(/* webpackChunkName: "views" */ '@/views/wel/dataStatistics.vue'),
// },
{
path: '/distribution',
name: '统计页面',
meta: {
i18n: 'dashboard',
menu: false,
},
redirect: '/distribution/distributionStockArticleFrom',
component: Layout,
children: [
{
path: 'distributionStockArticleFrom',
component: () => import('@/views/distribution/inventory/distributionStockArticleFrom.vue'),
},
],
},
{
path: '/test',
component: Layout,

6
src/views/distribution/deliverylist/distributionDeliveryList.vue

@ -7,7 +7,7 @@
<el-form-item label="配送车次:">
<el-input v-model="query.trainNumber" placeholder="请输入配送车次"></el-input>
</el-form-item>
<el-form-item label="配送日期:" class='el-times'>
<el-form-item label="配送日期:" class="el-times">
<el-date-picker
v-model="query.taskTime"
type="date"
@ -160,9 +160,9 @@
<div class="avue-crud__header">
<!-- 头部左侧按钮模块 -->
<div class="avue-crud__left" style="margin-top: 20px">
<el-button type="primary" icon="el-icon-plus" @click="printBatchOrder"
<!-- <el-button type="primary" icon="el-icon-plus" @click="printBatchOrder"
>批量打印</el-button
>
> -->
<!-- <el-button type="danger" icon="el-icon-delete" @click="handleDelete" plain> </el-button>-->
</div>
<!-- 头部右侧按钮模块 -->

12
src/views/distribution/inventory/delivery/distributionStockArticle.vue

@ -1093,7 +1093,9 @@ export default {
},
handleTemplate() {
exportBlob(
`/api/logpm-distribution/distributionStockArticle/import-stockArticle?${this.website.tokenHeader}=${getToken()}`
`/api/logpm-distribution/distributionStockArticle/import-stockArticle?${
this.website.tokenHeader
}=${getToken()}`
).then(res => {
downloadXls(res.data, '用户数据模板.xlsx');
});
@ -1290,6 +1292,14 @@ export default {
'订单信息不完整,请完善包件信息!如没有请维护物料信息,在选择!!!'
);
}
if (this.selectionList.length === 1) {
console.log('111>>>>>>>>>>>>>>', this.selectionList[0]);
return this.$router.push(
'/distribution/inventory/distributionStockArticleFrom?id=' + this.selectionList[0].id
);
}
this.getSock();
},
getSock() {

27
src/views/distribution/inventory/delivery/distributionStockArticleSelf.vue

@ -584,16 +584,18 @@ export default {
fixed: false,
sortable: true,
},
{
prop: 'isZero',
label: '零担',
type: 2,
values: '',
width: '130',
checkarr: [],
fixed: false,
sortable: true,
},
// {
// prop: 'isZero',
// label: '',
// type: 2,
// values: '',
// width: '130',
// checkarr: [
// ],
// fixed: false,
// sortable: true,
// },
{
prop: 'warehouse',
label: '所在仓库',
@ -1484,7 +1486,7 @@ export default {
const flag = this.selectionList.every(i => {
if (_mallName !== i.mallName) {
this.$message.warning('请选择同一商场');
return false
return false;
}
if (consigneeMobile != i.consigneeMobile && consigneePerson != i.consigneePerson) {
@ -1759,9 +1761,6 @@ export default {
type: 'error',
message: '功能还在开发中',
});
this.title = '新增';
this.form = {};
this.box = true;
},
handleEdit(row) {
this.title = '编辑';

133
src/views/distribution/inventory/distributionStockArticleFrom.vue

@ -6,27 +6,36 @@
<div class="avue-crud__left">
<el-button type="primary" icon="el-icon-plus" @click="handleTrade">确定</el-button>
</div>
</div>
<el-row>
<!-- 列表模块 -->
<el-table ref="table" v-loading="loading"
<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>
: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="70" align="center">
</el-table-column>
<template v-for="(item, index) in option.column">
<!-- table字段 -->
<el-table-column v-if="item.hide!==true"
<el-table-column
v-if="item.hide !== true"
:prop="item.prop"
:label="item.label"
:width="item.width"
:key="index">
:key="index"
>
</el-table-column>
</template>
<el-table-column prop="menu" label="转库存品数量" :width="220" align="center">
@ -49,7 +58,8 @@
<el-row>
<div class="avue-crud__pagination" style="width: 100%">
<!-- 分页模块 -->
<el-pagination align="right"
<el-pagination
align="right"
background
@size-change="sizeChange"
@current-change="currentChange"
@ -57,7 +67,8 @@
:page-sizes="[30, 50, 80, 120]"
:page-size="page.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="page.total">
:total="page.total"
>
</el-pagination>
</div>
</el-row>
@ -66,9 +77,9 @@
</template>
<script>
import { getList, getDetail, add, update, remove } from "@/api/distribution/distributionParcelList";
import option from "@/option/distribution/distributionStockArticleFrom";
import { mapGetters } from "vuex";
import { getList, getDetail, add, update, remove } from '@/api/distribution/distributionParcelList';
import option from '@/option/distribution/distributionStockArticleFrom';
import { mapGetters } from 'vuex';
import { addStockRow } from '@/api/distribution/distributionStockArticle';
export default {
@ -91,7 +102,7 @@ export default {
page: {
currentPage: 1,
pageSize: 30,
total: 40
total: 40,
},
//
form: {},
@ -101,51 +112,47 @@ export default {
option: option,
//
data: [],
}
};
},
mounted() {
this.init();
this.onLoad(this.page);
},
computed: {
...mapGetters(["permission"]),
...mapGetters(['permission']),
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(",");
}
return ids.join(',');
},
},
methods: {
handleTrade(){
async handleTrade() {
if (this.ids.length > 0) {
let par ={
ids : this.ids,
id: this.$route.query.id
}
let a = addStockRow(par);
console.log(">>>>===",a.data);
if(a.data.success){
this.onLoad(this.page);
}
let a = await addStockRow({ids: this.ids});
console.log('>>>>===', a.data);
// if (a.data.success) {
// this.onLoad(this.page);
// }
} else {
this.$message.warning("请选择需要转的包件信息!!!");
this.$message.warning('请选择需要转的包件信息!!!');
}
},
//
handleNumberRange(e, row) {
console.log("执行了2222",e,e.target.value,row);
console.log('执行了2222', e, e.target.value, row);
if (e.target.value) {
e.target.value = e.target.value.replace(/[^\.\d]/g, ''); //
if (e.target.value) {
e.target.value = e.target.value.replace(/[^\.\d]/g,'') //
if(e.target.value) { //
//
e.target.value = parseInt(e.target.value); //
}
if((e.target.value > row.quantity )) {
this.$message.error('数量不能大于订单数')
if (e.target.value > row.quantity) {
this.$message.error('数量不能大于订单数');
e.target.value = row.quantity;
return
return;
}
}
},
@ -169,8 +176,8 @@ export default {
this.box = false;
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
type: 'success',
message: '操作成功!',
});
});
} else {
@ -178,26 +185,26 @@ export default {
this.box = false;
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
type: 'success',
message: '操作成功!',
});
});
})
}
},
handleAdd() {
this.title = '新增'
this.form = {}
this.box = true
this.title = '新增';
this.form = {};
this.box = true;
},
handleEdit(row) {
this.title = '编辑'
this.box = true
this.title = '编辑';
this.box = true;
getDetail(row.id).then(res => {
this.form = res.data.data;
});
},
handleView(row) {
this.title = '查看'
this.title = '查看';
this.view = true;
this.box = true;
getDetail(row.id).then(res => {
@ -206,13 +213,13 @@ export default {
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
this.$message.warning('请选择至少一条数据');
return;
}
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
this.$confirm('确定将选择数据删除?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
return remove(this.ids);
@ -221,16 +228,16 @@ export default {
this.selectionClear();
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
type: 'success',
message: '操作成功!',
});
});
},
rowDel(row) {
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
this.$confirm('确定将选择数据删除?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
return remove(row.id);
@ -238,19 +245,19 @@ export default {
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
type: 'success',
message: '操作成功!',
});
});
},
beforeClose(done) {
done()
done();
this.form = {};
this.view = false;
},
selectionChange(list) {
this.selectionList = list;
console.log("<><><><><==",list);
console.log('<><><><><==', list);
},
selectionClear() {
this.selectionList = [];
@ -267,7 +274,7 @@ export default {
onLoad(page, params = {}) {
this.loading = true;
this.query.stockArticleId = this.$route.query.id;
this.query.conditions = "1";
this.query.conditions = '1';
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
const data = res.data.data;
this.page.total = data.total;
@ -275,7 +282,7 @@ export default {
this.loading = false;
this.selectionClear();
});
}
}
},
},
};
</script>

Loading…
Cancel
Save