Commit 1a9a1b1c by LJM

bug

parent b34df578
Showing with 151 additions and 142 deletions
......@@ -20,7 +20,9 @@
<view class="search-box row bothSide verCenter" v-if="formParams.type == 5" style="margin-bottom: 22rpx;">
<view class="sn row rowCenter verCenter">
<view>
<view class="row verCenter"><view class="uni-input">数量</view></view>
<view class="row verCenter">
<view class="uni-input">数量</view>
</view>
</view>
</view>
<view class="search-bar row bothSide verCenter">
......@@ -34,7 +36,9 @@
<view class="search-box row bothSide verCenter" style="margin-bottom: 22rpx;">
<view class="sn row rowCenter verCenter">
<view>
<view class="row verCenter"><view class="uni-input">目标打印机</view></view>
<view class="row verCenter">
<view class="uni-input">目标打印机</view>
</view>
</view>
</view>
<view class="search-bar row bothSide verCenter">
......@@ -48,7 +52,9 @@
<view class="search-box row bothSide verCenter" style="margin-bottom: 22rpx;">
<view class="sn row rowCenter verCenter">
<view>
<view class="row verCenter"><view class="uni-input">标签版本</view></view>
<view class="row verCenter">
<view class="uni-input">标签版本</view>
</view>
</view>
</view>
<view class="row bothSide verCenter select-wrap">
......@@ -63,7 +69,9 @@
<view class="search-box row bothSide verCenter" style="margin-bottom: 22rpx;">
<view class="sn row rowCenter verCenter">
<view>
<view class="row verCenter"><view class="uni-input">仓库</view></view>
<view class="row verCenter">
<view class="uni-input">仓库</view>
</view>
</view>
</view>
<view class="row bothSide verCenter select-wrap">
......@@ -80,165 +88,165 @@
</template>
<script>
import { API } from '@/util/api.js';
import debounce from 'lodash/debounce';
import { API } from '@/util/api.js';
import debounce from 'lodash/debounce';
export default {
data() {
return {
company_id: 1,
input_flag: false,
input_flag_num: false,
index: 0,
print_language_index: 0,
print_language: ['中文', '英文'],
labelStyles: [
{
id: 5,
name: '入库标签'
},
{
id: 1,
name: '库位标签'
},
{
id: 2,
name: '库区标签'
},
{
id: 3,
name: '区域标签'
},
{
id: 4,
name: '容器标签'
export default {
data() {
return {
company_id: 1,
input_flag: false,
input_flag_num: false,
index: 0,
print_language_index: 0,
print_language: ['中文', '英文'],
labelStyles: [{
id: 5,
name: '入库标签'
},
{
id: 1,
name: '库位标签'
},
{
id: 2,
name: '库区标签'
},
{
id: 3,
name: '区域标签'
},
{
id: 4,
name: '容器标签'
}
],
warehouse_arr: [],
warehouse_index: 0,
formParams: {
user_email: '', // 登录账号邮箱
warehouse_id: '', // 登录仓库
sn: '',
target_printer_ip: '', //模板打印机
tally_qty: '', //打印数量
print_language: 1, //标签版本
type: 5, //库位 1;库区 2;区域 3; 容器 4;入库 5 默认5
warehouse_id: '', //仓库id
print_type: 1
}
],
warehouse_arr: [],
warehouse_index: 0,
formParams: {
user_email: '', // 登录账号邮箱
warehouse_id: '', // 登录仓库
sn: '',
target_printer_ip: '', //模板打印机
tally_qty: '', //打印数量
print_language: 1, //标签版本
type: 5, //库位 1;库区 2;区域 3; 容器 4;入库 5 默认5
warehouse_id: '' //仓库id
}
};
},
onShow() {
let company_id = uni.getStorageSync('company_id') || 1;
if (company_id == 1) {
this.warehouse_arr = [{ name: '深圳现货仓', value: '7' }, { name: '深圳自营仓', value: 9 }];
this.formParams.warehouse_id = 7;
} else if (company_id == 2) {
this.warehouse_arr = [{ name: '香港仓', value: '10' }];
this.formParams.warehouse_id = 10;
}
},
methods: {
/**
* 清空数据
*/
clearInput(type) {
if (type == 1) {
this.formParams.sn = '';
this.input_flag = false;
} else if (type == 2) {
this.formParams.tally_qty = '';
this.input_flag_num = false;
};
},
onShow() {
let company_id = uni.getStorageSync('company_id') || 1;
if (company_id == 1) {
this.warehouse_arr = [{ name: '深圳现货仓', value: '7' }, { name: '深圳自营仓', value: 9 }];
this.formParams.warehouse_id = 7;
} else if (company_id == 2) {
this.warehouse_arr = [{ name: '香港仓', value: '10' }];
this.formParams.warehouse_id = 10;
}
},
/**
* 单号搜索
* @param {Object} event
*/
handleInput: debounce(function(type, val) {
if (val) {
methods: {
/**
* 清空数据
*/
clearInput(type) {
if (type == 1) {
this.input_flag = true;
this.formParams.sn = '';
this.input_flag = false;
} else if (type == 2) {
this.input_flag_num = true;
this.formParams.tally_qty = '';
this.input_flag_num = false;
}
} else {
},
/**
* 单号搜索
* @param {Object} event
*/
handleInput: debounce(function(type, val) {
if (val) {
if (type == 1) {
this.input_flag = true;
} else if (type == 2) {
this.input_flag_num = true;
}
} else {
if (type == 1) {
this.input_flag = false;
} else if (type == 2) {
this.input_flag_num = false;
}
}
}, 500),
bindPickerChange: function(e, type) {
if (type == 1) {
this.input_flag = false;
//标签版本切换
this.print_language_index = e.detail.value;
this.formParams.print_language = Number(e.detail.value) + 1;
} else if (type == 2) {
this.input_flag_num = false;
this.warehouse_index = e.detail.value;
this.formParams.warehouse_id = this.warehouse_arr[e.detail.value].value;
} else {
this.index = e.detail.value;
this.formParams.type = this.labelStyles[e.detail.value].id;
}
}
}, 500),
bindPickerChange: function(e, type) {
if (type == 1) {
//标签版本切换
this.print_language_index = e.detail.value;
this.formParams.print_language = Number(e.detail.value) + 1;
} else if (type == 2) {
this.warehouse_index = e.detail.value;
this.formParams.warehouse_id = this.warehouse_arr[e.detail.value].value;
} else {
this.index = e.detail.value;
this.formParams.type = this.labelStyles[e.detail.value].id;
}
},
/**
* 打印
*/
latePrint() {
if (!this.formParams.sn) {
uni.showToast({
title: '请输入标签',
icon: 'error'
});
return false;
}
if (this.formParams.type == 5) {
if (!this.formParams.tally_qty) {
},
/**
* 打印
*/
latePrint() {
if (!this.formParams.sn) {
uni.showToast({
title: '请输入数量',
title: '请输入标签',
icon: 'error'
});
return false;
}
} else {
this.formParams.tally_qty = 1;
}
this.formParams.user_email = uni.getStorageSync('oa_user_email') || '';
if (this.formParams.type == 5) {
if (!this.formParams.tally_qty) {
uni.showToast({
title: '请输入数量',
icon: 'error'
});
return false;
}
} else {
this.formParams.tally_qty = 1;
}
// company_id == 1 ? '深圳市猎芯科技有限公司' : '深贸电子有限公司'
this.company_id = uni.getStorageSync('company_id') || 1;
this.formParams.user_email = uni.getStorageSync('oa_user_email') || '';
// 7 深圳仓, 10 香港仓
if (this.company_id == 1) {
this.formParams.warehouse_id = 7;
} else {
this.formParams.warehouse_id = 10;
}
// company_id == 1 ? '深圳市猎芯科技有限公司' : '深贸电子有限公司'
this.company_id = uni.getStorageSync('company_id') || 1;
this.request(API.latePrint, 'POST', this.formParams, true).then(res => {
if (res.code === 0) {
uni.showLoading({
title: '正在打印中...'
});
setTimeout(() => {
uni.hideLoading();
}, 5000);
// 7 深圳仓, 10 香港仓
if (this.company_id == 1) {
this.formParams.warehouse_id = 7;
} else {
uni.showModal({
itle: '提示',
content: res.msg,
showCancel: false
});
this.formParams.warehouse_id = 10;
}
});
this.request(API.latePrint, 'POST', this.formParams, true).then(res => {
if (res.code === 0) {
uni.showLoading({
title: '正在打印中...'
});
setTimeout(() => {
uni.hideLoading();
}, 5000);
} else {
uni.showModal({
itle: '提示',
content: res.msg,
showCancel: false
});
}
});
}
}
}
};
};
</script>
<style scoped lang="scss">
@import '@/assets/css/repairPrint/index.scss';
</style>
@import '@/assets/css/repairPrint/index.scss';
</style>
\ No newline at end of file
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