Commit d06559bf by LJM

css

parent 9394c104
Showing with 100 additions and 78 deletions
......@@ -45,94 +45,116 @@
</template>
<script>
import { API } from '@/util/api.js';
import { API } from '@/util/api.js';
export default {
data() {
return {
box_sn: '',
code_str: 'QTY:500 PN:PR03-1R CPN:PR03000201008JAC00 PO:18365781/11 CPO:B131190+A64120 MFR:VISHAY MPN:PR03000201008JAC00 RoHS',
code_type: '',
list: [],
selectedIndexs: [],
index: -1,
array: ['扫描digikey', '扫描Mouser', '扫描Arrow', '扫描Rochester', '扫描TME', '扫描Chip1stop'],
arrar_val: ['digikey', 'Mouser', 'Arrow', 'Rochester', 'TME', 'Chip1stop']
};
},
created() {},
methods: {
getBoxSnAndNum() {
this.request(API.getBoxSnAndNum, 'POST', { box_sn: this.box_sn }, false).then(res => {
if (res.err_code === 0) {
this.list = res.data;
} else {
uni.showModal({
title: '提示',
content: res.err_msg,
showCancel: false
});
}
});
},
identifyQrCodeNumAndSn() {
this.request(API.identifyQrCodeNumAndSn, 'POST', { code_str: this.code_str, code_type: this.code_type }, false).then(res => {
if (res.err_code === 0) {
this.list.unshift({
goods_num: res.data.num || '',
goods_sn: res.data.sn || '',
scan_time: '',
wsbxnmsn_id: ''
});
} else {
uni.showModal({
title: '提示',
content: res.err_msg,
showCancel: false
});
}
});
},
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.target.value);
this.index = e.target.value;
this.code_type = this.arrar_val[e.target.value];
this.identifyQrCodeNumAndSn();
},
selectionChange(e) {
this.selectedIndexs = e.detail.index;
},
scanChange(event) {
var val = event.target.value;
if (val) {
this.identifyQrCodeNumAndSn();
}
},
inputChange(event) {
var val = event.target.value;
if (val) {
this.getBoxSnAndNum();
export default {
data() {
return {
box_sn: '',
code_str: 'QTY:500 PN:PR03-1R CPN:PR03000201008JAC00 PO:18365781/11 CPO:B131190+A64120 MFR:VISHAY MPN:PR03000201008JAC00 RoHS',
code_type: '',
list: [],
selectedIndexs: [],
index: -1,
array: ['扫描digikey', '扫描Mouser', '扫描Arrow', '扫描Rochester', '扫描TME', '扫描Chip1stop'],
arrar_val: ['digikey', 'Mouser', 'Arrow', 'Rochester', 'TME', 'Chip1stop']
};
},
created() {},
methods: {
getBoxSnAndNum() {
this.request(API.getBoxSnAndNum, 'POST', { box_sn: this.box_sn }, false).then(res => {
if (res.err_code === 0) {
this.list = res.data;
} else {
uni.showModal({
title: '提示',
content: res.err_msg,
showCancel: false
});
}
},
deleteChange() {
if (this.selectedIndexs.length <= 0) {
});
},
identifyQrCodeNumAndSn() {
this.request(API.identifyQrCodeNumAndSn, 'POST', { code_str: this.code_str, code_type: this.code_type }, false).then(res => {
if (res.err_code === 0) {
this.list.unshift({
goods_num: res.data.num || '',
goods_sn: res.data.sn || '',
scan_time: '',
wsbxnmsn_id: ''
});
} else {
uni.showModal({
title: '提示',
content: '请选择要删除的数据',
content: res.err_msg,
showCancel: false
});
return false;
}
for (let i = 0; i < this.selectedIndexs.length; i++) {
this.list.splice(this.selectedIndexs[i], 1);
});
},
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.target.value);
this.index = e.target.value;
this.code_type = this.arrar_val[e.target.value];
this.identifyQrCodeNumAndSn();
},
selectionChange(e) {
this.selectedIndexs = e.detail.index;
},
scanChange(event) {
var val = event.target.value;
if (val) {
this.identifyQrCodeNumAndSn();
}
},
inputChange(event) {
var val = event.target.value;
if (val) {
this.getBoxSnAndNum();
}
},
deleteChange() {
if (this.selectedIndexs.length <= 0) {
uni.showModal({
title: '提示',
content: '请选择要删除的数据',
showCancel: false
});
return false;
}
for (let i = 0; i < this.selectedIndexs.length; i++) {
this.list.splice(this.selectedIndexs[i], 1);
}
},
submit() {
let params = {};
for (let i = 0; i < this.list.length; i++) {
params['goods_sn[' + i + ']'] = this.list[i].goods_sn;
params['goods_num[' + i + ']'] = this.list[i].goods_num;
params['wsbxnmsn_id[' + i + ']'] = this.list[i].wsbxnmsn_id;
}
params.box_sn = this.box_sn;
this.request(API.submitBoxSnAndNum, 'POST', params, false).then(res => {
if (res.err_code === 0) {
uni.showModal({
title: '提示',
content: '保存成功',
showCancel: false
});
} else {
uni.showModal({
title: '提示',
content: res.err_msg,
showCancel: false
});
}
},
submit() {}
});
}
};
}
};
</script>
<style lang="scss">
@import '../../assets/css/scanInventory/index.scss';
@import '../../assets/css/scanInventory/index.scss';
</style>
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