|
@@ -80,6 +80,7 @@
|
|
|
time: new DateFormat(new Date()).toString(),
|
|
|
show: false,
|
|
|
operateUser: this.$storage.getStorageSync('userInfo').id,
|
|
|
+ userInfo: this.$storage.getStorageSync('userInfo'),
|
|
|
plcStationCode: '1',
|
|
|
stockChangeType: '20',
|
|
|
remark: '',
|
|
@@ -91,17 +92,21 @@
|
|
|
{ label: '出库', value: 20 },
|
|
|
{ label: '盘点删除', value: 21 },
|
|
|
{ label: '补出库', value: 23 },
|
|
|
- ]
|
|
|
+ ],
|
|
|
+ roleKey:null,
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
/* 选择类型 */
|
|
|
typeSelectitem(index, item) {
|
|
|
this.stockChangeType = item.value;
|
|
|
+
|
|
|
},
|
|
|
/* 选择领料人 */
|
|
|
selectitem(index, item) {
|
|
|
this.operateUser = item.value;
|
|
|
+ this.roleKey = item.roleKey
|
|
|
+ console.log(this.userInfo)
|
|
|
},
|
|
|
/* 选择仓库 */
|
|
|
storeSelectitem(index, item) {
|
|
@@ -120,14 +125,17 @@
|
|
|
stockChangeType: this.stockChangeType,
|
|
|
remark: this.remark
|
|
|
}
|
|
|
- if((this.roleKey == 'sewing' || this.roleKey == 'crop') && this.stockChangeType == 20){
|
|
|
- obj.stockChangeType = 30
|
|
|
+ console.log(this.roleKey)
|
|
|
+ console.log(this.stockChangeType)
|
|
|
+ if((this.roleKey == 'sewing' || this.roleKey == 'crop')){
|
|
|
+ if(this.stockChangeType == 20) obj.stockChangeType = 30
|
|
|
+
|
|
|
}
|
|
|
console.log(obj)
|
|
|
this.$http.HandleMacStockInOut(obj).then(res => {
|
|
|
console.log(res)
|
|
|
if(res.code === 0) {
|
|
|
- this.materialReceiveSubmit()
|
|
|
+ this.materialReceiveSubmit(obj)
|
|
|
this.$msg.showToast(res.msg || '操作成功!')
|
|
|
this.timer = setTimeout(() => {
|
|
|
this.$utils.back()
|
|
@@ -136,20 +144,23 @@
|
|
|
})
|
|
|
|
|
|
},
|
|
|
- materialReceiveSubmit(){
|
|
|
- if(this.stockChangeType == 29 || this.stockChangeType == 20 || this.stockChangeType == 30){
|
|
|
+ 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/list',
|
|
|
+ url: 'http://120.79.80.64:8050' + '/cloudApi/materialReceive/submit',
|
|
|
method: 'POST',
|
|
|
header:{
|
|
|
'Content-Type' : 'application/json',
|
|
|
},
|
|
|
data: {
|
|
|
- jobNo: this.userInfo.jobNo
|
|
|
+ checkUserId: this.userInfo.id
|
|
|
},
|
|
|
success: res => {
|
|
|
console.log(res);
|
|
|
- },
|
|
|
+ },fail(err) {
|
|
|
+ console.log(err);
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
},
|
|
@@ -189,11 +200,13 @@
|
|
|
pageSize: 999,
|
|
|
takeUser: true
|
|
|
}).then(res => {
|
|
|
+ console.log(res)
|
|
|
if(res.code == 0) {
|
|
|
let list = res.result.list.map(item => {
|
|
|
return {
|
|
|
label: item.realName,
|
|
|
- value: item.id
|
|
|
+ value: item.id,
|
|
|
+ roleKey: item.roleKey
|
|
|
}
|
|
|
})
|
|
|
this.userList = list
|