|
@@ -91,9 +91,11 @@
|
|
|
typeList: [
|
|
|
{ label: '出库', value: 20 },
|
|
|
{ label: '盘点删除', value: 21 },
|
|
|
- { label: '补出库', value: 29 },
|
|
|
+ { label: '补出库', value: 23 },
|
|
|
],
|
|
|
roleKey:null,
|
|
|
+ accountNo:null,
|
|
|
+ token:this.$storage.getStorageSync('token'),
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
@@ -106,7 +108,8 @@
|
|
|
selectitem(index, item) {
|
|
|
this.operateUser = item.value;
|
|
|
this.roleKey = item.roleKey
|
|
|
- console.log(this.userInfo)
|
|
|
+ this.accountNo = item.accountNo
|
|
|
+ console.log(this.accountNo)
|
|
|
},
|
|
|
/* 选择仓库 */
|
|
|
storeSelectitem(index, item) {
|
|
@@ -125,17 +128,25 @@
|
|
|
stockChangeType: this.stockChangeType,
|
|
|
remark: this.remark
|
|
|
}
|
|
|
- console.log(this.roleKey)
|
|
|
- console.log(this.stockChangeType)
|
|
|
+ console.log(obj)
|
|
|
+
|
|
|
+
|
|
|
if((this.roleKey == 'sewing' || this.roleKey == 'crop' || this.roleKey == '001')){
|
|
|
- if(this.stockChangeType == 20) obj.stockChangeType = 30
|
|
|
+ if(this.stockChangeType == 20){
|
|
|
+ this.materialReceiveSubmit(obj)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(this.stockChangeType == 23){
|
|
|
+ this.materialReceiveSubmit(obj)
|
|
|
+ return
|
|
|
}
|
|
|
- console.log(obj)
|
|
|
+
|
|
|
|
|
|
this.$http.HandleMacStockInOut(obj).then(res => {
|
|
|
console.log(res)
|
|
|
if(res.code === 0) {
|
|
|
- this.materialReceiveSubmit(obj)
|
|
|
+
|
|
|
this.$msg.showToast(res.msg || '操作成功!')
|
|
|
this.timer = setTimeout(() => {
|
|
|
this.$utils.back()
|
|
@@ -144,24 +155,51 @@
|
|
|
})
|
|
|
},
|
|
|
materialReceiveSubmit(obj){
|
|
|
- console.log(obj)
|
|
|
- if(obj.stockChangeType == 29 || obj.stockChangeType == 20 || obj.stockChangeType == 30){
|
|
|
- uni.request({
|
|
|
- url: 'http://120.79.80.64:8050' + '/cloudApi/materialReceive/submit',
|
|
|
- method: 'POST',
|
|
|
- header:{
|
|
|
- 'Content-Type' : 'application/json',
|
|
|
- },
|
|
|
- data: {
|
|
|
- checkUserId: this.userInfo.id
|
|
|
- },
|
|
|
- success: res => {
|
|
|
- console.log(res);
|
|
|
- },fail(err) {
|
|
|
- console.log(err);
|
|
|
+ console.log({
|
|
|
+ rfidItems: this.scanList.map(item => item.rfidCode),
|
|
|
+ submitUserId:this.userInfo.id,
|
|
|
+ submitUserAccount:this.userInfo.account,
|
|
|
+ receiveUserAccount: this.accountNo,
|
|
|
+ type:(this.stockChangeType == 20) ? 1 : 2,
|
|
|
+ userId: this.operateUser,
|
|
|
+ plcCode: this.plcStationCode,
|
|
|
+ rfidItems: this.scanList.map(item => item.rfidCode),
|
|
|
+ stockChangeType: this.stockChangeType,
|
|
|
+ remark: this.remark,
|
|
|
+ token:this.token
|
|
|
+ })
|
|
|
+ uni.request({
|
|
|
+ url: 'http://120.79.80.64:8050' + '/cloudApi/materialReceiving/submit',
|
|
|
+ method: 'POST',
|
|
|
+ header:{
|
|
|
+ 'Content-Type' : 'application/json',
|
|
|
+ },
|
|
|
+ data: {
|
|
|
+ rfidItems: this.scanList.map(item => item.rfidCode),
|
|
|
+ submitUserId:this.userInfo.id,
|
|
|
+ submitUserAccount:this.userInfo.account,
|
|
|
+ receiveUserAccount: this.accountNo,
|
|
|
+ type:(this.stockChangeType == 20) ? 1 : 2,
|
|
|
+ userId: this.operateUser,
|
|
|
+ plcCode: this.plcStationCode,
|
|
|
+ rfidItems: this.scanList.map(item => item.rfidCode),
|
|
|
+ stockChangeType: this.stockChangeType,
|
|
|
+ remark: this.remark,
|
|
|
+ token:this.token
|
|
|
+ },
|
|
|
+ success: res => {
|
|
|
+ console.log(res)
|
|
|
+ if(res.data.code == 200){
|
|
|
+ this.$msg.showToast(res.msg || '操作成功!')
|
|
|
+ this.timer = setTimeout(() => {
|
|
|
+ this.$utils.back()
|
|
|
+ }, 2000)
|
|
|
}
|
|
|
- });
|
|
|
- }
|
|
|
+
|
|
|
+ },fail(err) {
|
|
|
+ console.log(err);
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
/* 扫描添加 */
|
|
|
scan() {
|
|
@@ -205,7 +243,8 @@
|
|
|
return {
|
|
|
label: item.realName,
|
|
|
value: item.id,
|
|
|
- roleKey: item.roleKey
|
|
|
+ roleKey: item.roleKey,
|
|
|
+ accountNo:item.accountNo
|
|
|
}
|
|
|
})
|
|
|
this.userList = list
|
|
@@ -229,7 +268,7 @@
|
|
|
onLoad(option) {
|
|
|
this.getUserPageList()
|
|
|
this.getStockHouse()
|
|
|
- console.log(option)
|
|
|
+ console.log(this.$storage.getStorageSync('token'),'token')
|
|
|
uni.$on('scan-list', res => {
|
|
|
console.log('?????????????')
|
|
|
console.log(res)
|