Commit 8d4ea0ab by LJM

js

parent 96966002
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
<text class="check-box-icon" :class="{ curr: this.filter_list.length == this.filter_id.length }"></text> <text class="check-box-icon" :class="{ curr: this.filter_list.length == this.filter_id.length }"></text>
<text class="text">全选</text> <text class="text">全选</text>
</view> </view>
<view class="btn4 row rowCenter verCenter" @click="delStockInRegister(1)">取消登记</view> <view class="btn4 row rowCenter verCenter" @click="closeStockInRegister(1)">取消登记</view>
</view> </view>
<!-- 入库单详情弹窗 --> <!-- 入库单详情弹窗 -->
<uni-drawer ref="showRight" mode="right"> <uni-drawer ref="showRight" mode="right">
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
<text class="tt">{{ detail.arrival_name }}</text> <text class="tt">{{ detail.arrival_name }}</text>
</view> </view>
</view> </view>
<view class="btn row rowCenter verCenter"><view class="btn2 row rowCenter verCenter" @click="delStockInRegister(2, detail.stock_in_id)" style="width: 100%;">取消登记</view></view> <view class="btn row rowCenter verCenter"><view class="btn2 row rowCenter verCenter" @click="closeStockInRegister(2, detail.stock_in_sn)" style="width: 100%;">取消登记</view></view>
</view> </view>
</uni-drawer> </uni-drawer>
</view> </view>
...@@ -193,7 +193,7 @@ export default { ...@@ -193,7 +193,7 @@ export default {
filterChange(index) { filterChange(index) {
this.$set(this.filter_list, index, (this.filter_list[index] = !this.filter_list[index])); this.$set(this.filter_list, index, (this.filter_list[index] = !this.filter_list[index]));
let filter_arr = this.findIndex(this.filter_list, true); let filter_arr = this.findIndex(this.filter_list, true);
this.filter_id = filter_arr.map(i => this.list[i].stock_in_id); this.filter_id = filter_arr.map(i => this.list[i].stock_in_sn);
}, },
/** /**
* 全选 * 全选
...@@ -203,7 +203,7 @@ export default { ...@@ -203,7 +203,7 @@ export default {
this.filter_list = createArray(this.list.length, this.all_flag); this.filter_list = createArray(this.list.length, this.all_flag);
if (this.all_flag) { if (this.all_flag) {
this.filter_id = this.list.map(function(item) { this.filter_id = this.list.map(function(item) {
return item.stock_in_id; return item.stock_in_sn;
}); });
} else { } else {
this.filter_id = []; this.filter_id = [];
...@@ -273,8 +273,8 @@ export default { ...@@ -273,8 +273,8 @@ export default {
* @param {Object} type * @param {Object} type
* @param {Object} id * @param {Object} id
*/ */
delStockInRegister(type, id) { closeStockInRegister(type, id) {
var stock_in_id = []; var stock_in_sn = [];
if (type == 1) { if (type == 1) {
if (this.filter_id.length == 0) { if (this.filter_id.length == 0) {
uni.showToast({ uni.showToast({
...@@ -283,9 +283,9 @@ export default { ...@@ -283,9 +283,9 @@ export default {
}); });
return false; return false;
} }
stock_in_id = this.filter_id; stock_in_sn = this.filter_id;
} else if (type == 2) { } else if (type == 2) {
stock_in_id[0] = id; stock_in_sn[0] = id;
} }
uni.showModal({ uni.showModal({
...@@ -294,7 +294,7 @@ export default { ...@@ -294,7 +294,7 @@ export default {
showCancel: true, showCancel: true,
success: res => { success: res => {
if (res.confirm) { if (res.confirm) {
this.request(API.delStockInRegister, 'POST', { stock_in_id: JSON.stringify(stock_in_id) }, true).then(res => { this.request(API.closeStockInRegister, 'POST', { stock_in_sn: JSON.stringify(stock_in_sn) }, true).then(res => {
if (res.code === 0) { if (res.code === 0) {
uni.showToast({ uni.showToast({
title: '取消成功', title: '取消成功',
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<view class="text">容 器</view> <view class="text">容 器</view>
<view class="search-width row verCenter" v-if="tallyContainer.length > 0"> <view class="search-width row verCenter" v-if="tallyContainer.length > 0">
<text class="iconfont icon-juxing1"></text> <text class="iconfont icon-juxing1"></text>
<picker @change="bindPickerContainChange" :value="indexContainer" :range="tallyContainer" range-key="name" style="width: 100%;height: 100%;"> <picker @change="bindPickerContainChange($event, 1)" :value="indexContainer" :range="tallyContainer" range-key="name" style="width: 100%;height: 100%;">
<view class="row verCenter bothSide wrap"> <view class="row verCenter bothSide wrap">
<view class="uni-input row verCenter">{{ tallyContainer[indexContainer].name || '请选择' }}</view> <view class="uni-input row verCenter">{{ tallyContainer[indexContainer].name || '请选择' }}</view>
<view class="uni-arrow"></view> <view class="uni-arrow"></view>
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
<view class="row verCenter bothSide" v-if="tallyContainer.length > 0"> <view class="row verCenter bothSide" v-if="tallyContainer.length > 0">
<view class="search row bothSide verCenter" style="width: 100%;" v-if="tallyContainer.length > 0"> <view class="search row bothSide verCenter" style="width: 100%;" v-if="tallyContainer.length > 0">
<text class="iconfont icon-juxing1"></text> <text class="iconfont icon-juxing1"></text>
<picker @change="bindPickerContainChange" :value="indexContainer" :range="tallyContainer" :range-key="'name'" style="width: 100%;height: 100%;"> <picker @change="bindPickerContainChange($event, 2)" :value="indexContainer" :range="tallyContainer" :range-key="'name'" style="width: 100%;height: 100%;">
<view class="row verCenter bothSide wrap" style="width: 100%;height: 55rpx;"> <view class="row verCenter bothSide wrap" style="width: 100%;height: 55rpx;">
<view class="uni-input row verCenter">{{ tallyContainer[indexContainer].name }}</view> <view class="uni-input row verCenter">{{ tallyContainer[indexContainer].name }}</view>
<view class="uni-arrow"></view> <view class="uni-arrow"></view>
...@@ -296,11 +296,13 @@ export default { ...@@ -296,11 +296,13 @@ export default {
console.log('picker发送选择改变,携带值为', e.detail.value); console.log('picker发送选择改变,携带值为', e.detail.value);
this.index = e.detail.value; this.index = e.detail.value;
}, },
bindPickerContainChange(e) { bindPickerContainChange(e, type) {
this.indexContainer = e.detail.value; this.indexContainer = e.detail.value;
this.formParams.container_id = this.tallyContainer[e.detail.value].id; this.formParams.container_id = this.tallyContainer[e.detail.value].id;
this.searchParams.container_id = this.tallyContainer[e.detail.value].id; this.searchParams.container_id = this.tallyContainer[e.detail.value].id;
this.getData(); if (type == 1) {
this.getData();
}
}, },
/** /**
* 获取列表数据 * 获取列表数据
......
...@@ -28,9 +28,9 @@ const API = { ...@@ -28,9 +28,9 @@ const API = {
* */ * */
addStockInRegister: API_BASE + '/api/stockIn/stockInRegister/addStockInRegister', addStockInRegister: API_BASE + '/api/stockIn/stockInRegister/addStockInRegister',
/** /**
* 删除到货登记 * 取消到货登记
* */ * */
delStockInRegister: API_BASE + '/api/stockIn/stockInRegister/delStockInRegister', closeStockInRegister: API_BASE + '/api/stockIn/stockInRegister/closeStockInRegister',
/** /**
* 待理货列表 * 待理货列表
* */ * */
......
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