@@ -242,6 +271,8 @@ export default class PurchaseWHSRM extends BasePage {
moren2 = '请选择批次号';
moren3 = '请选择不良分类';
moren4 = '请选择检验位置';
+ moren5 = '请选择来料类别';
+ moren6 = '请选择物料来源';
list: any = [];
show = false;
showselect = false;
@@ -261,6 +292,30 @@ export default class PurchaseWHSRM extends BasePage {
radiovalue: null,
},
];
+ listselectoa: any = [
+ {
+ type: 1,
+ name: '是',
+ radiovalue: null,
+ },
+ {
+ type: 0,
+ name: '否',
+ radiovalue: null,
+ },
+ ];
+ listselectdetermine: any = [
+ {
+ type: 'Y',
+ name: '合格',
+ radiovalue: null,
+ },
+ {
+ type: 'N',
+ name: '不合格',
+ radiovalue: null,
+ },
+ ];
selectList: any = {};
selectList1: any = {};
defectCodeList: any = {};
@@ -273,58 +328,8 @@ export default class PurchaseWHSRM extends BasePage {
// this.remove = e.pickerName;
// }
orderNo: any = '';
- selectlist: any = [
- {
- value: 1,
- label: '中国',
- children: [
- {
- value: 2,
- label: '广东',
- children: [
- {
- value: 3,
- label: '深圳',
- },
- {
- value: 4,
- label: '广州',
- },
- ],
- },
- {
- value: 5,
- label: '广西',
- children: [
- {
- value: 6,
- label: '南宁',
- },
- {
- value: 7,
- label: '桂林',
- },
- ],
- },
- ],
- },
- {
- value: 8,
- label: '美国',
- children: [
- {
- value: 9,
- label: '纽约',
- children: [
- {
- value: 10,
- label: '皇后街区',
- },
- ],
- },
- ],
- },
- ];
+ // 自动取数
+ WeightInfolist: any = [];
detailList: any = [];
equipmentindex: any = [];
tagsvalue: any = '';
@@ -341,6 +346,11 @@ export default class PurchaseWHSRM extends BasePage {
aNoOkquality: null,
bNoOkquality: null,
cNoOkquality: null,
+ checkResult: null,
+ materialType: null,
+ materialFrom: null,
+ remark: null,
+ startOA: null,
};
isvalue = false;
isvalue2 = false;
@@ -357,6 +367,12 @@ export default class PurchaseWHSRM extends BasePage {
imgurl: any = 'http://lj08.cn/21001871815240307020600048115350';
// 不良类型
isshowtype = false;
+ // 来料类别
+ getmaterialType: any = [];
+ selectmaterialType: any = {};
+ // 物料来源
+ getmaterialFromList: any = [];
+ selectmaterialFromList: any = {};
// 引入原生插件
// 调用插件的 mpaasScan 方法
@@ -364,6 +380,7 @@ export default class PurchaseWHSRM extends BasePage {
tagClick(index) {
this.tagslist.splice(index, 1);
}
+ // 标准输入
ontagsadd() {
if (this.tagsvalue == '' || this.tagsvalue == undefined) {
// this.customToast('请扫码设备编码');
@@ -379,7 +396,15 @@ export default class PurchaseWHSRM extends BasePage {
// this.isfocus = true;
// });
}
+ // 页面加载
async onLoad(options) {
+ uni.$on('scanCodeData', (data) => {
+ let str = `${data.code}`;
+ let recData = JSON.parse(str);
+ console.log(recData);
+ this.scanCodeOne2;
+ // 现在你可以使用 recData 进行进一步的处理
+ });
this.getselectlist();
if (options.listitem) {
let str = decodeURIComponent(options.listitem);
@@ -399,6 +424,7 @@ export default class PurchaseWHSRM extends BasePage {
}
}
}
+ // 获取下拉
async getselectlist() {
await this.model.getCheckType();
await this.model.getcheckLocList();
@@ -421,12 +447,40 @@ export default class PurchaseWHSRM extends BasePage {
this.defectCodelist.push(a);
});
}
+ async getmaterialTypePDA() {
+ await this.model.getmaterialTypePDA();
+ this.getmaterialType = this.model.locList2;
+ }
+ // 自动取数
+ async WeightInfo(item) {
+ let query = {
+ factoryCode: session.PoolName,
+ recordId: item.recordId,
+ };
+ await this.model.getWeightInfo(query);
+ // let actualValue = '["111","111"]'
+ // item.actualValue = actualValue
+ this.WeightInfolist = this.model.WeightInfoList;
+ if (this.WeightInfolist.msg) {
+ item.actualValue = this.WeightInfolist.msg;
+ }
+ }
+ async getmaterialFromListPDA() {
+ await this.model.getmaterialFromListPDA();
+ this.getmaterialFromList = this.model.locList3;
+ }
async onPass(item) {
this.clickitem = item;
let query1 = {
factoryCode: session.PoolName,
workorderCode: this.clickitem.orderNo,
};
+ this.getDefectListPDA();
+ this.getmaterialFromListPDA();
+ this.getmaterialTypePDA();
+ if (this.selectList.value == 'checkTypeLL') {
+ this.formdata.startOA = 1;
+ }
await this.model.getBatchList(query1);
let labelname = this.selectList.value;
if (labelname == 'checkTypeSCXJ') {
@@ -466,10 +520,27 @@ export default class PurchaseWHSRM extends BasePage {
item.babtype = this.defectCodelist;
item.defectlabel = null;
});
+ this.determine();
+ // if (this.detaillistceshi.some((item) => item.status === 'Y')) {
+ // this.formdata.checkResult = '合格'
+ // }
+ // if (this.detaillistceshi.some((item) => item.status === 'N')) {
+ // this.formdata.checkResult = '不合格'
+ // }
this.show = true;
}
+ // 最终判定是否合格
+ determine() {
+ if (this.detaillistceshi.some((item) => item.status === 'Y')) {
+ this.formdata.checkResult = 'Y';
+ }
+ if (this.detaillistceshi.some((item) => item.status === 'N')) {
+ this.formdata.checkResult = 'N';
+ }
+ }
radioGroupChange(item, value, index) {
- console.log(item, value, index);
+ console.log(item, value, index, '切换单选框');
+ this.determine();
}
radioChange(e) {
console.log(e);
@@ -553,6 +624,14 @@ export default class PurchaseWHSRM extends BasePage {
await this.model.getCheckTaskListall(query);
this.list = this.model.CheckTaskListall;
}
+ async selectProductlocCode4(e: any) {
+ this.selectmaterialType = e.pickerName;
+ this.formdata.materialType = this.selectmaterialType.value;
+ }
+ async selectProductlocCode5(e: any) {
+ this.selectmaterialFromList = e.pickerName;
+ this.formdata.materialFrom = this.selectmaterialFromList.value;
+ }
focustype(item, value, index) {
this.isfocus = false;
this.$nextTick(() => {
@@ -580,15 +659,6 @@ export default class PurchaseWHSRM extends BasePage {
this.show = false;
this.form3.barCodewl = '';
}
- onblur() {
- this.showselect = true;
- }
- onfocus() {
- this.showselect = false;
- }
- onclick() {
- this.showselect = true;
- }
async getlist() {
let query = {
factoryCode: session.PoolName,
@@ -665,6 +735,32 @@ export default class PurchaseWHSRM extends BasePage {
});
return;
}
+ if (this.formdata.checkResult == 'N') {
+ if (this.formdata.remark === null || this.formdata.remark === '') {
+ (this.$refs.uToast as any).show({
+ title: '不合格描述不能为空',
+ type: 'default',
+ });
+ return;
+ }
+ }
+ if (this.selectList.value == 'checkTypeLL') {
+ if (this.formdata.materialType === null || this.formdata.materialType === '') {
+ (this.$refs.uToast as any).show({
+ title: '请选择来料类别',
+ type: 'default',
+ });
+ return;
+ }
+ if (this.formdata.materialFrom === null || this.formdata.materialFrom === '') {
+ (this.$refs.uToast as any).show({
+ title: '请选择物料来源',
+ type: 'default',
+ });
+ return;
+ }
+ }
+
// if (this.isquality) {
// (this.$refs.uToast as any).show({
// title: '数量不能为空',
@@ -720,9 +816,34 @@ export default class PurchaseWHSRM extends BasePage {
workorderCodeSap: this.clickitem.workorderCodeSap,
qcCheckTaskDetails: this.detaillistceshi,
defects: this.detaillistdefects,
+ // 检验编码
+ checkNo: this.clickitem.checkNo,
+ // 批次编码
incomeBatchNo: incomeBatchNo,
+ //物料编号
+ materialCode: this.clickitem.materialCode,
+ // 物料名称
+ materialName: this.clickitem.materialName,
+ // 供应商编码
+ supplierCode: this.clickitem.supplierCode,
+ // 供应商名称
+ supplierName: this.clickitem.supplierName,
+ // 来料数量
+ quality: this.clickitem.quality,
+ // 单位
+ unit: this.clickitem.unit,
+ //是否发起oa
+ startOA: this.formdata.startOA,
+ // 最终判定结果
+ checkResult: this.formdata.checkResult,
+ // 不合格措述
+ remark: this.formdata.remark,
+ // 来料类别
+ materialType: this.formdata.materialType,
+ // 物料来源
+ materialFrom: this.formdata.materialFrom,
};
- console.log(query);
+ console.log(query, this.formdata);
await this.model.commitCheckTaskList(query);
if (this.model.SubmitCode.code == '200') {
(this.$refs.uToast as any).show({
@@ -890,6 +1011,15 @@ export default class PurchaseWHSRM extends BasePage {
}