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 }) => { const axios = ({ method = 'GET', url, data = {}, isLoading = true }) => {
...@@ -10,7 +10,6 @@ const axios = ({ method = 'GET', url, data = {}, isLoading = true }) => { ...@@ -10,7 +10,6 @@ const axios = ({ method = 'GET', url, data = {}, isLoading = true }) => {
dd.showLoading({ dd.showLoading({
content: '加载中...', content: '加载中...',
}); });
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
dd.httpRequest({ dd.httpRequest({
url: url_, url: url_,
...@@ -19,8 +18,10 @@ const axios = ({ method = 'GET', url, data = {}, isLoading = true }) => { ...@@ -19,8 +18,10 @@ const axios = ({ method = 'GET', url, data = {}, isLoading = true }) => {
success: function (res) { success: function (res) {
isLoading && dd.hideLoading(); isLoading && dd.hideLoading();
resolve(res) resolve(res)
}, },
fail: function (err) { fail: function (err) {
isLoading && dd.hideLoading(); isLoading && dd.hideLoading();
dd.showToast({ dd.showToast({
type: 'fail', type: 'fail',
......
...@@ -6,11 +6,11 @@ ...@@ -6,11 +6,11 @@
</view> </view>
<view class="list-box list-box2"> <view class="list-box list-box2">
<text >明细扫码:</text> <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 onTap="saoma">锁定</view>
</view> </view>
<view class="detail-list"> <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"> <view class="g-t">
{{item.order_info.materialname}} {{item.order_info.materialname}}
</view> </view>
......
...@@ -257,6 +257,23 @@ Page({ ...@@ -257,6 +257,23 @@ Page({
// 页面加载完成 // 页面加载完成
getApp().setName(this) 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() { getDateList() {
axios({ axios({
...@@ -266,6 +283,7 @@ Page({ ...@@ -266,6 +283,7 @@ Page({
res.data.data.forEach((item) => { res.data.data.forEach((item) => {
item.order_info.isShow = 1 item.order_info.isShow = 1
}); });
this.setData({ this.setData({
list: res.data.data list: res.data.data
}) })
...@@ -281,9 +299,14 @@ Page({ ...@@ -281,9 +299,14 @@ Page({
}) })
}, },
getSaoMaId(code) { getSaoMaId(code) {
console.log(code)
axios({ 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 => { }).then(res => {
if (res.data.code == 0) { if (res.data.code == 0) {
//请求得到的ID值 //请求得到的ID值
...@@ -322,6 +345,7 @@ Page({ ...@@ -322,6 +345,7 @@ Page({
//this.getSaoMaId(code_) //this.getSaoMaId(code_)
//} //}
//}); //});
console.log(this.data.inputValue2)
this.getSaoMaId(this.data.inputValue2) this.getSaoMaId(this.data.inputValue2)
}, },
...@@ -409,9 +433,15 @@ Page({ ...@@ -409,9 +433,15 @@ Page({
}); });
}, },
bindKeyInput2(e) { bindKeyInput2(e) {
this.setData({ let code_text = e.detail.value
if (code_text.split("|").length==6) {
this.setData({
inputValue2: e.detail.value, inputValue2: e.detail.value,
}); });
this.saoma()
}
}, },
initInput(){ initInput(){
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view class="list-box"> <view class="list-box">
<text>出库单号:</text> <text>出库单号:</text>
<view class="inputbox" > <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>
<view class="bl" onTap="gotoDetail">锁定</view> <view class="bl" onTap="gotoDetail">锁定</view>
</view> </view>
\ No newline at end of file
...@@ -11,7 +11,7 @@ Page({ ...@@ -11,7 +11,7 @@ Page({
onReady() { onReady() {
// 页面加载完成 // 页面加载完成
getApp().setName(this) getApp().setName(this)
}, },
saoma() { saoma() {
dd.scan({ dd.scan({
...@@ -25,18 +25,18 @@ Page({ ...@@ -25,18 +25,18 @@ Page({
}); });
}, },
initInput(e){ initInput(e) {
this.setData({ this.setData({
inputValue: "" inputValue: ""
}); });
}, },
bindKeyInput(e) { bindKeyInput(e) {
this.setData({ let code_text = e.detail.value
inputValue: e.detail.value, code_text = code_text.substring(code_text.length - 4);
}); if (code_text == "|001") {
let code_text=e.detail.value this.setData({
code_text=code_text.substring(code_text.length-4); inputValue: e.detail.value,
if(code_text=="|001"){ });
this.gotoDetail() 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