Commit 82f62083 by LJM

js

parent 4f4553f0
......@@ -101,6 +101,17 @@
}
}
}
.radio-wrap {
padding: 22rpx 0;
label {
margin-right: 10rpx;
}
text {
font-size: 18rpx;
color: #292b33;
margin-left: 5rpx;
}
}
.list {
margin-top: 15rpx;
padding-bottom: 150rpx;
......
......@@ -25,6 +25,42 @@
<text class="iconfont icon-a-juxing11" @click="clearInput()" v-if="input_flag"></text>
</view>
</view>
<view class="radio-wrap row verCenter" style="padding-bottom: 0;">
<radio-group name="radio1">
<label>
<radio value="1" style="transform:scale(0.7)" :checked="filter_checkbox[0]" color="#1969f9" @click="toggle(0)" />
<text>采购入库</text>
</label>
</radio-group>
<radio-group name="radio2">
<label>
<radio value="4" style="transform:scale(0.7)" :checked="filter_checkbox[1]" color="#1969f9" @click="toggle(1)" />
<text>委托入库</text>
</label>
</radio-group>
<radio-group name="radio3">
<label>
<radio value="2" style="transform:scale(0.7)" :checked="filter_checkbox[2]" color="#1969f9" @click="toggle(2)" />
<text>退货入库</text>
</label>
</radio-group>
</view>
<view class="radio-wrap row verCenter">
<radio-group name="radio" @change="radioChange">
<label>
<radio value="" style="transform:scale(0.7)" checked="true" color="#1969f9" />
<text>全部</text>
</label>
<label>
<radio value="0" style="transform:scale(0.7)" color="#1969f9" />
<text>已理货</text>
</label>
<label>
<radio value="1" style="transform:scale(0.7)" color="#1969f9" />
<text>已提交</text>
</label>
</radio-group>
</view>
<view class="list row bothSide" v-if="list.length > 0">
<view class="box" v-for="(item, index) in list" :key="index" :class="{ curr: filter_list[index] }">
<view class="check-box-icon" @click="filterChange(index)"></view>
......@@ -36,6 +72,10 @@
<text class="label">物流单号:</text>
<text class="t1">{{ item.tracking_no }}</text>
</view>
<view class="text-item row verCenter">
<text class="label">入库单类型:</text>
<text class="t1">{{ item.stock_in_type_cn }}</text>
</view>
<view class="bor row"></view>
<view class="text-item row verCenter">
<text class="label">入仓号:</text>
......@@ -72,7 +112,7 @@
<view class="btn3 row rowCenter verCenter" @click="cancelTallyReceive(1)">取消理货</view>
<view class="row verCenter" style="width: calc(100% - 308rpx);">
<view class="btn2 row rowCenter verCenter" style="width: 50%;border-right: 1px solid #fff;" @click="submitTallyReceive()">提交</view>
<view class="btn2 row rowCenter verCenter" style="width: 50%;">批量打印入库标签</view>
<view class="btn2 row rowCenter verCenter" style="width: 50%;" @click="padTallyPrint()">批量打印入库标签</view>
</view>
</view>
<!-- 理货详情弹窗 -->
......@@ -199,11 +239,14 @@ export default {
filter_id: [], //入库单列表的入库登记
detail: {}, //详情的数据
image_list: [], //图片列表
filter_checkbox: [true, true, true],
searchParams: {
stock_in_sn: '', //入库单号
tracking_no: '', //物流单号
stock_in_with_stock_in_items_inhouse: '', //入仓单号
container_id: '' //容器
container_id: '', //容器,
tally_status: 0, //默认显示已理货
stock_tally_with_stock_in_stock_in_type_in: ''
}
};
},
......@@ -211,6 +254,10 @@ export default {
this.getData();
},
methods: {
radioChange(e) {
this.searchParams.tally_status = e.detail.value;
this.getData();
},
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value);
this.index = e.detail.value;
......@@ -265,6 +312,16 @@ export default {
}
this.getData();
},
toggle(index) {
var ids = [1, 4, 2];
this.$set(this.filter_checkbox, index, (this.filter_checkbox[index] = !this.filter_checkbox[index]));
let filter_arr = this.findIndex(this.filter_checkbox, true);
var filteredIds = filter_arr.map(function(index) {
return ids[index];
});
this.searchParams.stock_tally_with_stock_in_stock_in_type_in = filteredIds.join(',');
this.getData();
},
/**
* 单号搜索
* @param {Object} event
......@@ -323,7 +380,21 @@ export default {
});
return false;
}
this.request(API.cancelTallyReceive, 'POST', { tally_id: tally_id }, true).then(res => {
let filter_arr = this.findIndex(this.filter_list, true);
let stock_in_id = filter_arr.map(i => this.list[i].stock_in_id);
let stock_in_item_id = filter_arr.map(i => this.list[i].stock_in_item_id);
let stock_in_type_arr = filter_arr.map(i => this.list[i].stock_in_type);
const same = stock_in_type_arr.every((val, i, arr) => val === stock_in_type_arr[0]);
if (!same) {
uni.showModal({
title: '提示',
content: '请勾选相同的入库单类型',
showCancel: false
});
return false;
}
this.request(API.cancelTallyReceive, 'POST', { tally_id: this.filter_id.join(','), stock_in_id: stock_in_id.join(','), stock_in_item_id: stock_in_item_id.join(',') }, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '提交成功',
......@@ -343,6 +414,43 @@ export default {
});
},
/**
* 批量打印
*/
padTallyPrint() {
let filter_arr = this.findIndex(this.filter_list, true);
let warehouse_id = filter_arr.map(i => this.list[i].warehouse_id);
if (this.filter_id.length == 0) {
uni.showToast({
title: '请选择货品',
icon: 'error'
});
return false;
}
this.request(API.padTallyPrint, 'POST', { tally_ids: this.filter_id.join(','), warehouse_id: warehouse_id.join(',') }, true).then(res => {
uni.showLoading({
title: '正在打印中...'
});
if (res.code === 0) {
setTimeout(() => {
uni.hideLoading();
uni.showToast({
title: '打印成功',
icon: 'success'
});
this.getData();
this.filter_id = [];
}, 5000);
} else {
uni.showModal({
title: '提示',
content: res.msg,
showCancel: false
});
}
});
},
/**
* 取消理货
*/
cancelTallyReceive(type, ids) {
......
......@@ -44,6 +44,10 @@ const API = {
* */
cancelTallyReceive: API_BASE + '/api/stockIn/tallyReceive/cancelTallyReceive',
/**
* 批量打印
* */
padTallyPrint: API_BASE + '/api/label/padTallyPrint',
/**
* 提交
* */
submitTallyReceive: API_BASE + '/api/stockIn/tallyReceive/submitTallyReceive',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment