Browse Source

Merge branch 'dev' into pre-production

fix_bug_pro20231227
pref_mail@163.com 2 years ago
parent
commit
23403953d3
  1. 7
      src/api/distribution/distributionStockArticle.js
  2. 2
      src/api/warehouse/WarehouseStock.js
  3. 261
      src/option/warehouse/warehouseStock.js
  4. 64
      src/views/basicdata/warehouse/goodsShelf/basicdataGoodsShelf.vue
  5. 208
      src/views/distribution/reservation/reservationAddFrom.vue
  6. 22
      src/views/distribution/reservation/reservationSubmitFrom.vue
  7. 13
      src/views/distribution/signfor/distributionSignfor.vue
  8. 2
      src/views/distribution/signfor/distributionSignfortreat.vue
  9. 157
      src/views/distribution/turndelivery/deliveryDiscuss.vue
  10. 659
      src/views/warehouse/warehouseStock/warehouseStock.vue

7
src/api/distribution/distributionStockArticle.js

@ -212,12 +212,15 @@ export const selectDiscussStockArticleInfoList = (current, size, params) => {
})
}
export const selectUpdateAvailableStockArticle = (id) => {
export const selectUpdateAvailableStockArticle = (current, size, id,params) => {
return request({
url: '/api/logpm-distribution/reservation/selectUpdateAvailableStockArticle',
method: 'get',
params: {
id
...params,
current,
size,
id,
}
})
}

2
src/api/warehouse/WarehouseStock.js

@ -2,7 +2,7 @@ import request from '@/axios';
export const getList = (current, size, params) => {
return request({
url: '/api/logpm-warehouse/warehouseStock/list',
url: '/api/logpm-warehouse/warehouseStock/page',
method: 'get',
params: {
...params,

261
src/option/warehouse/warehouseStock.js

@ -11,257 +11,88 @@ export default {
dialogClickModal: false,
column: [
{
label: "租户号",
prop: "tenantId",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
label: '节点名称',
prop: 'nodeName'
},
{
label: "创建人",
prop: "createUser",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
label: '服务号',
prop: 'serviceNumber'
},
{
label: "创建时间",
prop: "createTime",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
label: '订单自编号',
prop: 'orderCode'
},
{
label: "更新人",
prop: "updateUser",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
label: '商场名称',
prop: 'mallName',
},
{
label: "更新时间",
prop: "updateTime",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
prop: 'firsts',
label: '一级品',
width: '100',
},
{
label: "状态",
prop: "status",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
prop: 'second',
label: '二级品',
width: '100'
},
{
label: "是否已删除",
prop: "isDeleted",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
prop: 'thirdProduct',
label: '三级品',
width: '100',
},
{
label: "创建部门",
prop: "createDept",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
label: '运单号',
prop: 'waybillNumber',
},
{
label: "主键",
prop: "id",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
label: '物料名称',
prop: 'materialName'
},
{
label: "reserve1",
prop: "reserve1",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
label: '物料编号',
prop: 'materialCode'
},
{
label: "预留2",
prop: "reserve2",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
label: '物料单位',
prop: 'materialUnit',
},
{
label: "预留3",
prop: "reserve3",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
label: '入库时间',
prop: 'warehouseEntryTime'
},
// {
// label: "",
// prop: "reserve4",
// type: "input",
// addDisplay: false,
// editDisplay: false,
// viewDisplay: false,
// hide: true,
// },
{
label: "预留5",
prop: "reserve5",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
label: '在库时间',
prop: 'storeTime'
},
{
label: "货位信息",
prop: "goodsAllocation",
type: "input",
label: '服务号',
prop: 'serviceNumber'
},
{
label: "在库订单ID",
prop: "stockArticle",
type: "input",
label: '在库件数',
prop: 'handQuantity'
},
{
label: "包条码",
prop: "coding",
type: "input",
label: '是否齐套',
prop: 'completeSetName',
},
{
label: " 状态 1 配送 2自提",
prop: "conditions",
type: "input",
label: '品牌',
prop: 'brand',
},
{
label: "货物名称",
prop: "goodsName",
type: "input",
label: '包条码',
prop: 'orderPackageCode'
},
{
label: "库存品ID",
prop: "stockListId",
type: "input",
},
{
label: "拆包数",
prop: "unpackingQuantity",
type: "input",
},
{
label: "在库包件ID",
prop: "parcelListId",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: "单位",
prop: "unit",
type: "input",
hide: true,
},
{
label: "订单自编号",
prop: "orderSelfNumbering",
type: "input",
},
{
label: "预约id",
prop: "reservationId",
type: "input",
},
{
label: "预约单号",
prop: "reservationCode",
type: "input",
hide: true,
},
// {
// label: "出库类型 1商 2市 3自",
// prop: "outboundType",
// type: "input",
// },
// {
// label: "配送ID",
// prop: "deliveryListId",
// type: "input",
// addDisplay: false,
// editDisplay: false,
// viewDisplay: false,
// hide: true,
// },
{
label: "配送编号",
prop: "deliveryListCode",
type: "input",
},
{
label: "备货区",
prop: "stockupArea",
type: "input",
},
// {
// label: "自提ID",
// prop: "billLadingId",
// type: "input",
// addDisplay: false,
// editDisplay: false,
// viewDisplay: false,
// hide: true,
// },
{
label: "扫码类型 1包件 2库存品",
prop: "type",
type: "input",
},
// {
// label: "物料id",
// prop: "materialId",
// type: "input",
// addDisplay: false,
// editDisplay: false,
// viewDisplay: false,
// hide: true,
// },
// {
// label: "商场/客户",
// prop: "marketId",
// type: "input",
// },
{
label: "备货id",
prop: "stockupId",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
label: '顾客地址',
prop: 'customerAddress'
},
]
}

64
src/views/basicdata/warehouse/goodsShelf/basicdataGoodsShelf.vue

@ -133,6 +133,7 @@
</el-pagination>
</div>
</el-row>
<!-- 表单模块 -->
<el-dialog :title="title"
v-model="box"
@ -185,16 +186,16 @@
</el-col>
<el-col :span="12" v-if="!allocation">
<el-form-item label="货 区:" prop="goodsAreaId" label-width="100px">
<el-select v-model="form.goodsAreaId" clearable placeholder="请选择货区" style="width: 88%;">
<el-option
v-for="item in optioner"
:key="item.id"
:label="item.headline"
:value="item.id">
</el-option>
</el-select>
<!-- <el-cascader :options="optioner" clearable style="width: 88%" v-model="form.goodsAreaInfo" :show-all-levels="false">-->
<!-- </el-cascader>-->
<el-cascader :options="optioner" style="width: 80%" v-model="form.goodsAreaId" placeholder="请选择货区" :show-all-levels="false" clearable />
<!-- <el-select v-model="form.goodsAreaId" clearable placeholder="请选择货区" style="width: 88%;">-->
<!-- <el-option-->
<!-- v-for="item in optioner"-->
<!-- :key="item.id"-->
<!-- :label="item.headline"-->
<!-- :value="item.id">-->
<!-- </el-option>-->
<!-- </el-select>-->
</el-form-item>
</el-col>
<!-- <el-col :span="12">-->
@ -618,11 +619,11 @@ export default {
this.goodsShelfStatusData = res.data.data;
});
getGoodsAreaNodeList().then(res=>{
console.log("res>>>>>>>>>>>>>>",res);
const data = this.formatCascaderData(res.data.data);
console.log("data>>>>>>>>>>>>>>",data);
this.optioner = data
console.log(">>>>>>>>>>>>>>>>optioner",this.optioner);
})
getTemplateData("9").then(res=>{
@ -632,18 +633,34 @@ export default {
})
},
// childrenundefined
formatCascaderData(data)
{
formatCascaderData(data){
console.log("------------>",data);
const a =[];
for (var i = 0; i < data.length; i++) {
if (null==data[i].children ||data[i].children.length < 1) {
// childrenchildrenundefined
delete data[i].leaf;
} else {
// children
this.formatCascaderData(data[i].children)
let b =
{
value:data[i].id,
label:data[i].name,
children:[]
}
if (!!data[i].children && data[i].children.length > 1) {
let k = data[i].children;
let j=[];
k.forEach(item=>{
let c={
value:item.id,
label:item.headline,
}
j.push(c);
})
//
b.children=j;
}
a.push(b);
}
return data
console.log("--------------->a".a);
return a
},
searchHide () {
this.search = !this.search;
@ -704,6 +721,11 @@ export default {
if (!this.form.id) {
console.log("this.form>>>>>>>", this.form);
console.log("this.optioner>>>>>>>", this.optioner);
if (!!this.form.goodsAreaId && this.form.goodsAreaId.length > 1){
//ID
let a = this.form.goodsAreaId;
this.form.goodsAreaId = a[a.length - 1];
}
this.optioner.map(item => {
if (item.id == this.form.goodsAreaId) {
this.form.goodsAreaName = item.headline

208
src/views/distribution/reservation/reservationAddFrom.vue

@ -185,6 +185,7 @@
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="库存品">
@ -285,6 +286,23 @@
</el-table-column>
</template>
</el-table>
<el-row>
<div class="avue-crud__pagination" style="width: 100%">
<!-- 分页模块 -->
<el-pagination
align="right"
background
@size-change="sizeOrderChange"
@current-change="currentOrderChange"
: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-form-item style="margin-left: 45%;margin-top: 5px">
<el-button type="primary" icon="el-icon-circle-close" @click="onSubmitOrder">提交(订单)</el-button>
<el-button icon="el-icon-circle-close" @click="orderShow=false"> </el-button>
@ -679,50 +697,51 @@
console.log("------------>",'预约编辑');
//
//
selectUpdateAvailableStockArticle(this.reservationId).then(res=>{
console.log('res------------>', res);
const data = res.data.data;
this.stockArticleInfo = data
this.stockArticleInfo.forEach((item, index) => {
//
this.checkOrder(item, index);
if (this.orderData) {
this.orderData.forEach(o => {
if (o.id === item.id) {
this.$nextTick(() => {
this.$refs.orderList.toggleRowSelection(this.stockArticleInfo[index], true);
});
}
});
}else {
this.orderList = [];
}
});
})
// selectUpdateAvailableStockArticle(this.reservationId).then(res=>{
// console.log('res------------>', res);
// const data = res.data.data;
// this.stockArticleInfo = data
// this.stockArticleInfo.forEach((item, index) => {
// //
// this.checkOrder(item, index);
// if (this.orderData) {
// this.orderData.forEach(o => {
// if (o.id === item.id) {
// this.$nextTick(() => {
// this.$refs.orderList.toggleRowSelection(this.stockArticleInfo[index], true);
// });
// }
// });
// }else {
// this.orderList = [];
// }
// });
// })
this.onLoadEditOrder(this.page);
}else {
selectStockArticleInfoList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then( res => {
console.log('res------------>', res);
const data = res.data.data;
this.stockArticleInfo = data.records;
this.stockArticleInfo.forEach((item, index) => {
//
this.checkOrder(item, index);
// if (this.orderData) {
// this.orderData.forEach(o => {
// if (o.id === item.id) {
// this.$nextTick(() => {
// this.$refs.orderList.toggleRowSelection(this.stockArticleInfo[index], true);
// });
// }
// });
// }else {
// this.orderList = [];
// }
});
this.orderList = [];
});
this.onLoadOrder(this.page);
// selectStockArticleInfoList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then( res => {
// console.log('res------------>', res);
// const data = res.data.data;
// this.stockArticleInfo = data.records;
// this.stockArticleInfo.forEach((item, index) => {
// //
// this.checkOrder(item, index);
// // if (this.orderData) {
// // this.orderData.forEach(o => {
// // if (o.id === item.id) {
// // this.$nextTick(() => {
// // this.$refs.orderList.toggleRowSelection(this.stockArticleInfo[index], true);
// // });
// // }
// // });
// // }else {
// // this.orderList = [];
// // }
// });
// this.orderList = [];
//
// });
}
this.loading = false;
console.log("this.stockArticleInfo------------->",this.stockArticleInfo);
@ -976,16 +995,22 @@
let page = this.page;
this.query.typeService = 2;
this.query.genre = 1;
selectStockArticleList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
const data = res.data.data;
data.records.forEach(item => {
item.reservationNum = item.handQuantity;
});
this.page.total = data.total;
this.stockArticleInfo = data.records;
this.loading = false;
// this.selectionClear();
});
if (this.reservationId){
this.onLoadEditOrder(this.page)
}else {
this.onLoadOrder(this.page)
}
// selectStockArticleList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
// const data = res.data.data;
// data.records.forEach(item => {
// item.reservationNum = item.handQuantity;
// });
// this.page.total = data.total;
// this.stockArticleInfo = data.records;
// this.loading = false;
// // this.selectionClear();
// });
},
searchStockList() {
let params = {};
@ -1266,15 +1291,82 @@
this.query = {};
// this.$refs.table.clearSelection();
},
currentChange(currentPage) {
currentOrderChange(currentPage) {
this.page.currentPage = currentPage;
this.onLoad(this.page);
if (this.reservationId){
this.onLoadEditOrder(this.page,this.reservationId);
}else {
this.onLoadOrder(this.page);
}
},
sizeChange(pageSize) {
sizeOrderChange(pageSize) {
this.page.pageSize = pageSize;
this.onLoad(this.page);
if (this.reservationId){
this.onLoadEditOrder(this.page,this.reservationId);
}else {
this.onLoadOrder(this.page);
}
},
onLoad(page, params = {}) {
onLoadEditOrder(arg,params = {}){
const page = arg;
selectUpdateAvailableStockArticle(page.currentPage, page.pageSize,this.reservationId,Object.assign(params, this.query)).then(res=>{
console.log('res------------>', res);
const data = res.data.data;
this.stockArticleInfo = data.records;
this.stockArticleInfo.forEach((item, index) => {
//
this.checkOrder(item, index);
if (this.orderData) {
this.orderData.forEach(o => {
if (o.id === item.id) {
//
this.$nextTick(() => {
this.$refs.orderList.toggleRowSelection(this.stockArticleInfo[index], true);
});
}
});
}else {
this.orderList = [];
}
});
this.page.total = data.total;
})
// this.query = {};
},
onLoadOrder(arg,params={}){
console.log("------------->arg",arg);
const page = arg;
console.log("------------->page",page);
selectStockArticleInfoList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then( res => {
console.log('res------------>', res);
const data = res.data.data;
this.stockArticleInfo = data.records;
this.stockArticleInfo.forEach((item, index) => {
//
this.checkOrder(item, index);
// if (this.orderData) {
// this.orderData.forEach(o => {
// if (o.id === item.id) {
// this.$nextTick(() => {
// this.$refs.orderList.toggleRowSelection(this.stockArticleInfo[index], true);
// });
// }
// });
// }else {
// this.orderList = [];
// }
this.page.total = data.total;
});
this.orderList = [];
});
},
onLoad() {
// this.loading = true;
this.form.deliveryType = '2';
this.form.deliveryWay = '10';

22
src/views/distribution/reservation/reservationSubmitFrom.vue

@ -1082,16 +1082,16 @@
});
// this.form.stockArticleList = this.packageList;
console.log('>>>>>>>>', this.form);
if (this.reservationId) {
this.form.id = this.reservationId;
update(this.form).then(() => {
this.$router.go(-1);
this.$message({
type: 'success',
message: '操作成功!'
});
});
} else {
// if (this.reservationId) {
// this.form.id = this.reservationId;
// update(this.form).then(() => {
// this.$router.go(-1);
// this.$message({
// type: 'success',
// message: '!'
// });
// });
// } else {
add(this.form).then(() => {
this.$router.go(-1);
this.$message({
@ -1099,7 +1099,7 @@
message: '操作成功!'
});
});
}
// }
},
handleClose(done) {
this.$confirm('确认关闭?')

13
src/views/distribution/signfor/distributionSignfor.vue

@ -436,7 +436,18 @@ export default {
},
{
prop: 'signingStatusAll',
label: '签收状态',
label: '司机签收状态',
type: 2,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
head: false,
},
{
prop: 'signingStatusAll',
label: '文员复核状态',
type: 2,
values: '',
width: '150',

2
src/views/distribution/signfor/distributionSignfortreat.vue

@ -128,7 +128,7 @@
>
<template #default="slotProps">
<el-button size="small" @click="editsolt(slotProps.scope)"> </el-button>
<el-button size="small" @click="handleSign(slotProps.scope.row)"> </el-button>
<el-button size="small" @click="handleSign(slotProps.scope.row)"> </el-button>
<!-- <el-button size="small" type="danger" @click="delectsolt(slotProps.scope)"-->
<!-- >Delete</el-button>-->
</template>

157
src/views/distribution/turndelivery/deliveryDiscuss.vue

@ -386,8 +386,8 @@
<el-pagination
align="right"
background
@size-change="sizeChange"
@current-change="currentChange"
@size-change="sizeOrderChange"
@current-change="currentOrderChange"
:current-page="page.currentPage"
:page-sizes="[10, 20, 30, 40, 50, 100]"
:page-size="page.pageSize"
@ -901,13 +901,22 @@
}
this.loading = false;
},
sizeChange(pageSize) {
sizeOrderChange(pageSize) {
this.page.pageSize = pageSize;
this.onLoad(this.page);
if (this.deliveryListId){
//
this.selectDiscussStockArticle(this.page);
}else {
this.onLoadOrder(this.page);
}
},
currentChange(currentPage) {
currentOrderChange(currentPage) {
this.page.currentPage = currentPage;
this.onLoad(this.page);
if (this.deliveryListId){
this.selectDiscussStockArticle(this.page);
}else {
this.onLoadOrder(this.page);
}
},
checkPackage(row, index) {
console.log('>>>>>>>>>>>>', row, index);
@ -1485,40 +1494,44 @@
if (this.deliveryListId) {
//
this.query.deliveryId = this.deliveryListId;
selectDiscussStockArticleInfoList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
console.log("----------------------------->",res.data.data);
const data = res.data.data;
// this.page.total = data.total;
this.stockArticleInfo = data;
this.stockArticleInfo.forEach((item, index) => {
if (this.orderData) {
this.orderData.forEach(a => {
if (item.id === a.id) {
this.$nextTick(() => {
this.$refs.stockArticleTable.toggleRowSelection(this.stockArticleInfo[index], true);
});
console.log("item---------------->",item);
this.checkOrder(item,index)
}
});
}
});
});
this.selectDiscussStockArticle(page);
// selectDiscussStockArticleInfoList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
// console.log("----------------------------->",res.data.data);
// const data = res.data.data;
// // this.page.total = data.total;
// this.stockArticleInfo = data.records;
// this.stockArticleInfo.forEach((item, index) => {
// if (this.orderData) {
// this.orderData.forEach(a => {
// if (item.id === a.id) {
// this.$nextTick(() => {
// this.$refs.stockArticleTable.toggleRowSelection(this.stockArticleInfo[index], true);
// });
// console.log("item---------------->",item);
// this.checkOrder(item,index)
// }
// });
// }
// });
// this.page.total = data.total;
// });
this.query = {};
} else {
selectStockArticleInfoList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
console.log(res.data.data);
const data = res.data.data;
this.page.total = data.total;
this.stockArticleInfo = data.records;
this.stockArticleInfo.forEach((item, index) => {
this.checkOrder(item,index)
});
});
//
this.onLoadOrder(page);
// selectStockArticleInfoList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
// console.log(res.data.data);
// const data = res.data.data;
// this.page.total = data.total;
// this.stockArticleInfo = data.records;
// this.stockArticleInfo.forEach((item, index) => {
// this.checkOrder(item,index)
// });
// this.page.total = data.total;
// });
this.query = {};
}
this.loading = false;
this.query = {};
// this.selectionClear();
// if (this.deliveryListId) {
// //
@ -1544,8 +1557,32 @@
genre: '1'
};
this.searchChange();
}
,
},
selectDiscussStockArticle(arg,params={}){
this.query.typeService = 1;
this.query.genre = '1';
const page = arg;
selectDiscussStockArticleInfoList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
console.log("----------------------------->",res.data.data);
const data = res.data.data;
// this.page.total = data.total;
this.stockArticleInfo = data.records;
this.stockArticleInfo.forEach((item, index) => {
if (this.orderData) {
this.orderData.forEach(a => {
if (item.id === a.id) {
this.$nextTick(() => {
this.$refs.stockArticleTable.toggleRowSelection(this.stockArticleInfo[index], true);
});
console.log("item---------------->",item);
this.checkOrder(item,index)
}
});
}
});
this.page.total = data.total;
});
},
searchChange() {
let params = {};
this.query.typeService = 1;
@ -1610,8 +1647,48 @@
selectionClear() {
this.selectionList = [];
this.query = {};
}
,
},
selectDiscussStockArticle(arg,params={}){
this.query.typeService = 1;
this.query.genre = '1';
const page = arg;
selectDiscussStockArticleInfoList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
console.log("----------------------------->",res.data.data);
const data = res.data.data;
// this.page.total = data.total;
this.stockArticleInfo = data.records;
this.stockArticleInfo.forEach((item, index) => {
if (this.orderData) {
this.orderData.forEach(a => {
if (item.id === a.id) {
this.$nextTick(() => {
this.$refs.stockArticleTable.toggleRowSelection(this.stockArticleInfo[index], true);
});
console.log("item---------------->",item);
this.checkOrder(item,index)
}
});
}
});
this.page.total = data.total;
});
},
onLoadOrder(arg,params={}){
this.query.typeService = 1;
this.query.genre = '1';
const page =arg;
selectStockArticleInfoList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
console.log(res.data.data);
const data = res.data.data;
// this.page.total = data.total;
this.stockArticleInfo = data.records;
this.stockArticleInfo.forEach((item, index) => {
//
this.checkOrder(item,index)
});
this.page.total = data.total;
});
},
async onLoad(page, params = {}) {
this.stockUpForm.deliveryType = '1';
console.log('》》》》》》》》》》》》》》》', this.deliveryListId);

659
src/views/warehouse/warehouseStock/warehouseStock.vue

@ -1,225 +1,502 @@
<template>
<basic-container>
<avue-crud :option="option"
v-model:search="search"
v-model:page="page"
v-model="form"
:table-loading="loading"
:data="data"
:permission="permissionList"
:before-open="beforeOpen"
ref="crud"
@row-update="rowUpdate"
@row-save="rowSave"
@row-del="rowDel"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad">
<!-- <template #menu-left>-->
<!-- <el-button type="danger"-->
<!-- icon="el-icon-delete"-->
<!-- plain-->
<!-- v-if="permission.distributionStock_delete"-->
<!-- @click="handleDelete"> -->
<!-- </el-button>-->
<!-- <el-button type="warning"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- @click="handleExport"> -->
<!-- </el-button>-->
<!-- </template>-->
</avue-crud>
<div class="avue-crud">
<el-row>
<!-- 列表模块 -->
<tablecmt
:columnList="columnList"
:tableData="data"
:loading="loading"
@inputTxt="inputsc"
@timeCheck="timesc"
@btnCheck="btnsc"
@selectCheck="selectsc"
@selection="selectionChange"
>
<!-- <template #default="slotProps">-->
<!-- <el-button type="primary" text icon="el-icon-view" @click="handleView(slotProps.scope)">查看</el-button>-->
<!-- <el-button type="primary" text icon="el-icon-edit" @click="handleCallDeliveryOwn(slotProps.scope)">修改客户信息</el-button>-->
<!-- </template>-->
</tablecmt>
</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>
<!-- 表单模块 -->
</div>
</basic-container>
<edittablehead
@setcolum="setnewcolum"
@closce="showdrawer"
:drawerShow="drawerShow"
:columnList="columnList"
></edittablehead>
</template>
<script>
import {getList, getDetail, add, update, remove} from "@/api/warehouse/warehouseStock";
import option from "@/option/warehouse/warehouseStock";
import {mapGetters} from "vuex";
import {exportBlob} from "@/api/common";
import {getToken} from '@/utils/auth';
import {downloadXls} from "@/utils/util";
import {dateNow} from "@/utils/date";
import NProgress from 'nprogress';
import 'nprogress/nprogress.css';
export default {
data() {
return {
form: {},
query: {},
search: {},
loading: true,
page: {
pageSize: 10,
currentPage: 1,
total: 0
export default {
data () {
return {
columnList: [
{
prop: 'nodeName',
label: '节点名称',
type: 2,
values: '',
width: '150',
checkarr: [],
fixed: true,
sortable: false,
head: false,
},
{
prop: 'orderCode',
label: '订单自编码',
type: 2,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
},
{
prop: 'orderPackageCode',
label: '包件码',
type: 2,
values: '',
width: '180',
checkarr: [],
fixed: false,
sortable: true,
},
{
prop: 'serviceNumber',
label: '服务号',
type: 2,
values: '',
width: '180',
checkarr: [],
fixed: false,
sortable: true,
},
{
prop: 'brandName',
label: '品牌',
type: 2,
values: '',
width: '180',
checkarr: [],
fixed: false,
sortable: true,
},
{
prop: 'materialCode',
label: '物料编号',
type: 2,
values: '',
width: '180',
checkarr: [],
fixed: false,
sortable: true,
},
{
prop: 'materialName',
label: '物料名称',
type: 2,
values: '',
width: '180',
checkarr: [],
fixed: false,
sortable: true,
},
{
prop: 'firsts',
label: '一级品',
type: 2,
values: '',
width: '180',
checkarr: [],
fixed: false,
sortable: true,
},
{
prop: 'second',
label: '二级品',
type: 2,
values: '',
width: '180',
checkarr: [],
fixed: false,
sortable: true,
},
selectionList: [],
option: option,
data: []
};
},
computed: {
...mapGetters(["permission"]),
permissionList() {
return {
addBtn: this.validData(this.permission.distributionStock_add, false),
viewBtn: this.validData(this.permission.distributionStock_view, false),
delBtn: this.validData(this.permission.distributionStock_delete, false),
editBtn: this.validData(this.permission.distributionStock_edit, false)
};
{
prop: 'thirdProduct',
label: '三级品',
type: 2,
values: '',
width: '180',
checkarr: [],
fixed: false,
sortable: true,
},
{
prop: 'warehouseEntryTimeEnd',
label: '入库时间',
type: 2,
values: '',
width: '180',
checkarr: [],
fixed: false,
sortable: true,
},
{
prop: 'waybillNumber',
label: '运单号',
type: 2,
values: '',
width: '180',
checkarr: [],
fixed: false,
sortable: true,
},
{
prop: 'operatorName',
label: '操作员',
type: 2,
values: '',
width: '180',
checkarr: [],
fixed: false,
sortable: false,
},
{
prop: 'createTime',
label: '操作时间',
type: 2,
values: '',
width: '180',
checkarr: [],
fixed: false,
sortable: true,
},
// {
// prop: '',
// label: '',
// type: 6,
// values: '',
// width: '230',
// checkarr: [],
// fixed: 'right',
// hide: true,
// },
// ...
],
height: 0,
//
title: '',
//
box: false,
//
search: true,
//
loading: true,
//
view: false,
//
query: {},
//
page: {
currentPage: 1,
pageSize: 20,
total: 40
},
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
//
form: {},
//
selectionList: [],
//
option: option,
//
data: [],
}
},
mounted () {
this.init();
this.onLoad(this.page);
/**
* 初始化获取本地缓存的编辑隐藏的列表
* 固定搭配不能更改
*/
// let checkList=[]
// this.columnList.map(item => {
// item.head = false;
// });
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;
}
});
return ids.join(",");
});
} 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: {
showdrawer(value) {
this.drawerShow = value;
},
/**
* 弹窗的勾选回调用于更改头部数组
* 固定搭配只需要更换 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);
}
},
methods: {
rowSave(row, done, loading) {
add(row).then(() => {
selectionsc(value) {
console.log('11111', value);
},
delectsolt(scope) {
const { row } = scope;
console.log('2222222', row);
},
editsolt(scope) {
const { row } = scope;
console.log('33333', row);
},
btnsc(index, row) {
console.log('4444444', index, row);
},
selectsc(index, row) {
console.log(index, row);
},
timesc(index, row) {
console.log(index, row);
},
inputsc(index, row) {
console.log(index, row);
},
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: "操作成功!"
});
done();
}, error => {
loading();
window.console.log(error);
});
},
rowUpdate(row, index, done, loading) {
update(row).then(() => {
} else {
update(this.form).then(() => {
this.box = false;
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
done();
}, error => {
loading();
console.log(error);
});
},
rowDel(row) {
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(row.id);
})
.then(() => {
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"
}
},
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(() => {
return remove(this.ids);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
this.$refs.crud.toggleSelection();
.then(() => {
this.selectionClear();
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
},
handleExport() {
let downloadUrl = `/distributionStock/distributionStock/export-distributionStock?${this.website.tokenHeader}=${getToken()}`;
const {
} = this.query;
let values = {
};
this.$confirm("是否导出数据?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
NProgress.start();
exportBlob(downloadUrl, values).then(res => {
downloadXls(res.data, `备货扫描记录${dateNow()}.xlsx`);
NProgress.done();
})
});
},
beforeOpen(done, type) {
if (["edit", "view"].includes(type)) {
getDetail(this.form.id).then(res => {
this.form = res.data.data;
},
rowDel (row) {
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(row.id);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
}
done();
},
searchReset() {
this.query = {};
this.onLoad(this.page);
},
searchChange(params, done) {
this.query = params;
this.page.currentPage = 1;
this.onLoad(this.page, params);
done();
},
selectionChange(list) {
this.selectionList = list;
},
selectionClear() {
this.selectionList = [];
this.$refs.crud.toggleSelection();
},
currentChange(currentPage){
this.page.currentPage = currentPage;
},
sizeChange(pageSize){
this.page.pageSize = pageSize;
},
refreshChange() {
this.onLoad(this.page, this.query);
},
onLoad(page, params = {}) {
this.loading = true;
const {
} = this.query;
let values = {
};
getList(page.currentPage, page.pageSize, values).then(res => {
const data = res.data.data;
this.page.total = data.total;
this.data = data.records;
this.loading = false;
this.selectionClear();
});
}
},
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;
this.page.total = data.total;
this.data = data.records;
this.loading = false;
});
}
};
}
};
</script>
<style>
</style>

Loading…
Cancel
Save