Commit c5b82942 by 肖康

x

parent 70596d0f
//const host = 'http://www.photo.com:8000';//开发环境
const host = 'http://www.photo.com:8000';//开发环境
const host = 'http://smapi.ichunt.net';//线上环境
//const host = 'http://smapi.ichunt.net';//线上环境
const axios = ({ method = 'GET', url, data = {}, isLoading = true }) => {
......@@ -10,7 +10,6 @@ const axios = ({ method = 'GET', url, data = {}, isLoading = true }) => {
dd.showLoading({
content: '加载中...',
});
return new Promise((resolve, reject) => {
dd.httpRequest({
url: url_,
......@@ -19,8 +18,10 @@ const axios = ({ method = 'GET', url, data = {}, isLoading = true }) => {
success: function (res) {
isLoading && dd.hideLoading();
resolve(res)
},
fail: function (err) {
isLoading && dd.hideLoading();
dd.showToast({
type: 'fail',
......
......@@ -6,11 +6,11 @@
</view>
<view class="list-box list-box2">
<text >明细扫码:</text>
<input placeholder="点击输入框扫码 " focus="true" onBlur="bindKeyInput2" onFocus="initInput" value="{{inputValue2}}"/>
<input placeholder="点击输入框扫码 " focus="true" onInput="bindKeyInput2" onFocus="initInput" value="{{inputValue2}}"/>
<view onTap="saoma">锁定</view>
</view>
<view class="detail-list">
<view hidden="{{item.order_info.isShow ? false : true}}" class="group {{(item.order_info.scanqty==0)?'':(item.order_info.qty==item.order_info.scanqty)?'y':'d'}}" a:for="{{list}}">
<view id="{{item.order_info.id}}" onTap="tabListDetail" hidden="{{item.order_info.isShow ? false : true}}" class="group {{(item.order_info.scanqty==0)?'':(item.order_info.qty==item.order_info.scanqty)?'y':'d'}}" a:for="{{list}}">
<view class="g-t">
{{item.order_info.materialname}}
</view>
......
......@@ -257,6 +257,23 @@ Page({
// 页面加载完成
getApp().setName(this)
},
tabListDetail(event){
//获取明细ID值
let detail_id =event.currentTarget.id;
this.data.list.forEach((item) => {
if (item.order_info.id == detail_id) {
item.order_info.isShow = 1
} else {
item.order_info.isShow = 0
}
});
this.setData({
list: this.data.list,
detailId: detail_id
})
this.subMxActionShee()
},
getDateList() {
axios({
......@@ -266,6 +283,7 @@ Page({
res.data.data.forEach((item) => {
item.order_info.isShow = 1
});
this.setData({
list: res.data.data
})
......@@ -281,9 +299,14 @@ Page({
})
},
getSaoMaId(code) {
console.log(code)
axios({
url: "/photo_taking/scan_order_detail/" + this.data.inputValue + "/" + encodeURI(code)
url: "/photo_taking/scan_order_detail",
method: "POST",
data: {
order_id: this.data.inputValue,
scan_str: code
}
}).then(res => {
if (res.data.code == 0) {
//请求得到的ID值
......@@ -322,6 +345,7 @@ Page({
//this.getSaoMaId(code_)
//}
//});
console.log(this.data.inputValue2)
this.getSaoMaId(this.data.inputValue2)
},
......@@ -409,9 +433,15 @@ Page({
});
},
bindKeyInput2(e) {
this.setData({
let code_text = e.detail.value
if (code_text.split("|").length==6) {
this.setData({
inputValue2: e.detail.value,
});
this.saoma()
}
},
initInput(){
......
......@@ -2,7 +2,7 @@
<view class="list-box">
<text>出库单号:</text>
<view class="inputbox" >
<input placeholder="点击输入框扫码" onBlur="bindKeyInput" onFocus="initInput" value="{{inputValue}}" autofocus="autofocus" focus="true"/>
<input placeholder="点击输入框扫码" onInput="bindKeyInput" onFocus="initInput" value="{{inputValue}}" autofocus="autofocus" focus="true"/>
</view>
<view class="bl" onTap="gotoDetail">锁定</view>
</view>
\ No newline at end of file
......@@ -11,7 +11,7 @@ Page({
onReady() {
// 页面加载完成
getApp().setName(this)
getApp().setName(this)
},
saoma() {
dd.scan({
......@@ -25,18 +25,18 @@ Page({
});
},
initInput(e){
initInput(e) {
this.setData({
inputValue: ""
});
},
bindKeyInput(e) {
this.setData({
inputValue: e.detail.value,
});
let code_text=e.detail.value
code_text=code_text.substring(code_text.length-4);
if(code_text=="|001"){
let code_text = e.detail.value
code_text = code_text.substring(code_text.length - 4);
if (code_text == "|001") {
this.setData({
inputValue: e.detail.value,
});
this.gotoDetail()
}
},
......
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