质检bug修改&增加扫码调试

master
guoshuang 2 years ago
parent bf493bd65c
commit 2b7fd85111

@ -1,16 +1,20 @@
{ // launch.json configurations app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/ {
// launchtypelocalremote, localremote // launch.json configurations app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
"version": "0.0", // launchtypelocalremote, localremote
"configurations": [{ "version" : "0.0",
"app-plus" : "configurations" : [
{ {
"launchtype" : "local" "app-plus" : {
}, "launchtype" : "local"
"default" : },
{ "default" : {
"launchtype" : "local" "launchtype" : "local"
}, },
"type" : "uniCloud" "type" : "uniCloud"
} },
{
"playground" : "standard",
"type" : "uni-app:app-android"
}
] ]
} }

@ -12,8 +12,10 @@
/* 5+App */ /* 5+App */
"modules" : { "modules" : {
// //
"Camera" : {} // "Camera" : {}, //
"Barcode" : {}
}, },
// "Camera" : {}
/* */ /* */
"distribute" : { "distribute" : {
/* */ /* */

@ -13,7 +13,7 @@
<view class="single-left"> <view class="single-left">
<view>rfid:</view> <view>rfid:</view>
<u-search placeholder="请扫描" :focus="shouciFocus" v-model="orderNo" :show-action="false"></u-search> <u-search placeholder="请扫描" :focus="shouciFocus" v-model="orderNo" :show-action="false"></u-search>
<!-- <uni-icons type="scan" size="25" @click="scanCodeOne" style="color: #0b9eff; margin: auto; padding: 10rpx"></uni-icons> --> <uni-icons type="scan" size="35" @click="scanCodeOne" style="color: #0b9eff; margin: auto; padding: 22rpx"></uni-icons>
</view> </view>
<view class="single-right"> <view class="single-right">
<u-button type="primary" @click="query"></u-button> <u-button type="primary" @click="query"></u-button>
@ -206,11 +206,12 @@ export default class PalletChange extends BasePage {
scanCodeOne() { scanCodeOne() {
uni.scanCode({ uni.scanCode({
scanType: ['barCode'], scanType: ['barCode'],
success: function (res) { success: (res) => {
console.log('条码类型:' + res.scanType);
console.log('条码内容:' + res.result);
this.orderNo = res.result; this.orderNo = res.result;
}, },
fail(result) {
this.customToast(result);
},
}); });
} }
} }
@ -283,7 +284,7 @@ export default class PalletChange extends BasePage {
display: flex; display: flex;
view { view {
width: 142rpx; // width: 142rpx;
height: 100%; height: 100%;
line-height: 100rpx; line-height: 100rpx;
} }

@ -28,19 +28,19 @@
</u-form-item> --> </u-form-item> -->
<!-- 订单 --> <!-- 订单 -->
<u-form-item label="订单"> <u-form-item label="订单">
<u-input :disabled="true" v-model="model.orderNoItemList.orderCode" placeholder="" style="overflow: hidden" /> <u-input :disabled="true" v-model="orderNoItemList.orderCode" placeholder="" style="overflow: hidden" />
</u-form-item> </u-form-item>
<!-- 机台 --> <!-- 机台 -->
<u-form-item label="机台"> <u-form-item label="机台">
<u-input :disabled="true" v-model="model.orderNoItemList.machineName" placeholder="" style="overflow: hidden" /> <u-input :disabled="true" v-model="orderNoItemList.machineName" placeholder="" style="overflow: hidden" />
</u-form-item> </u-form-item>
<!-- 产品 --> <!-- 产品 -->
<u-form-item label="产品"> <u-form-item label="产品">
<u-input :disabled="true" v-model="model.orderNoItemList.productName" placeholder="" /> <u-input :disabled="true" v-model="orderNoItemList.productName" placeholder="" />
</u-form-item> </u-form-item>
<!-- 工单 --> <!-- 工单 -->
<u-form-item label="工单"> <u-form-item label="工单">
<u-input :disabled="true" v-model="model.orderNoItemList.workorderCode" placeholder="" /> <u-input :disabled="true" v-model="orderNoItemList.workorderCode" placeholder="" />
</u-form-item> </u-form-item>
<u-form-item label="缓存区"> <u-form-item label="缓存区">
<jPicker sureColor="#ff0000" :moren="moren" @bindpicker="selectProductLOC" showKey="label" valKey="value" :val="productLocList.value" :options="model.DictList" /> <jPicker sureColor="#ff0000" :moren="moren" @bindpicker="selectProductLOC" showKey="label" valKey="value" :val="productLocList.value" :options="model.DictList" />
@ -126,6 +126,7 @@ export default class productCheckReceipt extends BasePage {
autoHeight = true; autoHeight = true;
imgList: any = []; imgList: any = [];
imgUrlList: any = []; imgUrlList: any = [];
orderNoItemList: any = {};
isqualified = [ isqualified = [
{ {
label: '合格', label: '合格',
@ -138,8 +139,12 @@ export default class productCheckReceipt extends BasePage {
]; ];
productCodeList: any = {}; productCodeList: any = {};
async onReady() { async onLoad() {
await this.model.getDictList(); try {
await this.model.getDictList();
} catch (error) {
console.error('接口调用出错:', error);
}
//this.remove = this.model.WlList[0]; //this.remove = this.model.WlList[0];
} }
scrollLeft() { scrollLeft() {
@ -225,7 +230,13 @@ export default class productCheckReceipt extends BasePage {
this.customToast('请输入nficl'); this.customToast('请输入nficl');
return; return;
} }
await this.model.queryOrderNo(this.orderNo); let orderNoItemList = await this.model.queryOrderNo(this.orderNo);
if (orderNoItemList == undefined) {
this.customToast('该rfid未查到数据请使用正确的rfid');
} else {
this.orderNoItemList = orderNoItemList;
}
//console.log('this.orderNoItemList', this.orderNoItemList);
} }
histroyItem: any = {}; histroyItem: any = {};
generateGUID() { generateGUID() {
@ -237,10 +248,48 @@ export default class productCheckReceipt extends BasePage {
} }
async selectProductCode(e: any) { async selectProductCode(e: any) {
this.productCodeList = e.pickerName; this.productCodeList = e.pickerName;
if (this.productCodeList.value == '0') { // if (this.productCodeList.value == '0') {
// }
}
barcode: any = '';
async onSubmit() {
if (this.orderNo == '' || this.orderNo.length == 0) {
this.customToast('请输入nficl');
return;
}
if (this.orderNoItemList.orderCode == undefined) {
this.customToast('该rfid不可用不可质检');
return;
}
if (this.productCodeList.value == '') {
this.customToast('请选择是否合格');
return;
}
if (this.badMeg == '') {
this.customToast('请输入不良描述');
return;
}
console.log('tupian', this.imgList.join(','));
let params = {
rfid: this.orderNo,
factoryCode: session.FactoryCode,
orderCode: this.orderNoItemList.orderCode,
workorderCode: this.orderNoItemList.workorderCode,
machineCode: this.orderNoItemList.machineCode,
machineName: this.orderNoItemList.machineName,
badMeg: this.badMeg,
productCode: this.orderNoItemList.productCode,
productName: this.orderNoItemList.productName,
productSpc: this.orderNoItemList.productSpc,
isqua: this.productCodeList.value,
fileId: this.imgList.join(','),
};
await this.model.OnSubmit(params);
if (this.model.SubmitCode == 200) {
// this.customToast('');
// //
var currentDate = new Date(); var currentDate = new Date();
// //
var year = currentDate.getFullYear(); var year = currentDate.getFullYear();
var month = ('0' + (currentDate.getMonth() + 1)).slice(-2); var month = ('0' + (currentDate.getMonth() + 1)).slice(-2);
@ -255,44 +304,11 @@ export default class productCheckReceipt extends BasePage {
rfidNo: this.orderNo, rfidNo: this.orderNo,
reqCode: this.generateGUID(), reqCode: this.generateGUID(),
reqTime: formattedDate, reqTime: formattedDate,
currentStationNo: model.orderNoItemList.machineCode, currentStationNo: this.orderNoItemList.machineCode,
productionState: this.productLocList.value, productionState: this.productLocList.value,
checkResult: this.productCodeList.value,
}; };
await this.model.sendDestinationStations(params); await this.model.sendDestinationStations(params);
}
}
barcode: any = '';
async onSubmit() {
if (this.orderNo == '' || this.orderNo.length == 0) {
this.customToast('请输入nficl');
return;
}
if (this.productCodeList.value == '') {
this.customToast('请选择是否合格');
return;
}
if (this.badMeg == '') {
this.customToast('请输入不良描述');
return;
}
console.log('tupian', this.imgList.join(','));
let params = {
rfid: this.orderNo,
factoryCode: session.FactoryCode,
orderCode: model.orderNoItemList.orderCode,
workorderCode: model.orderNoItemList.workorderCode,
machineCode: model.orderNoItemList.machineCode,
machineName: model.orderNoItemList.machineName,
badMeg: this.badMeg,
productCode: model.orderNoItemList.productCode,
productName: model.orderNoItemList.productName,
productSpc: model.orderNoItemList.productSpc,
isqua: this.productCodeList.value,
fileId: this.imgList.join(','),
};
await this.model.OnSubmit(params);
if (this.model.SubmitCode == 200) {
// this.customToast('');
this.uni.showToast({ title: '质检成功' }); this.uni.showToast({ title: '质检成功' });
this.orderNo = ''; this.orderNo = '';
this.badMeg = ''; this.badMeg = '';
@ -300,6 +316,7 @@ export default class productCheckReceipt extends BasePage {
this.productLocList = {}; this.productLocList = {};
this.imgUrlList = []; this.imgUrlList = [];
this.imgList = []; this.imgList = [];
this.orderNoItemList = {};
this.model.empty(); this.model.empty();
this.shouciFocus = false; this.shouciFocus = false;
this.$nextTick(() => { this.$nextTick(() => {

@ -156,7 +156,8 @@ export default class RawHome extends BasePage {
} }
.u-col { .u-col {
// margin-bottom: 30rpx; // margin-bottom: 30rpx;
margin-left: 12px; // margin-left: 12px;
flex: 1;
} }
.u-btn { .u-btn {
height: 160rpx; height: 160rpx;

@ -6,7 +6,7 @@ module.exports = {
target: 'http://192.168.202.20:9000', target: 'http://192.168.202.20:9000',
changeOrigin: true, changeOrigin: true,
// pathRewrite: { // pathRewrite: {
// '^/dev-api': '', // '^/prod-ap': '',
// }, // },
}, },
'/dev-api': { '/dev-api': {

Loading…
Cancel
Save