|
|
|
@ -13,7 +13,7 @@
|
|
|
|
|
<u-search
|
|
|
|
|
:placeholder="$t('message.po_PleaseInput')"
|
|
|
|
|
v-model="form.poNo"
|
|
|
|
|
@search="model.queryOrder"
|
|
|
|
|
@search="queryOrder"
|
|
|
|
|
:show-action="false"
|
|
|
|
|
></u-search>
|
|
|
|
|
</u-form-item>
|
|
|
|
@ -91,22 +91,27 @@
|
|
|
|
|
<u-row>
|
|
|
|
|
<u-col :span="8"></u-col>
|
|
|
|
|
<u-col :span="4">
|
|
|
|
|
<u-button :style="{margin:'24rpx 0'}" type="primary">{{$t('message.product_add')}}</u-button>
|
|
|
|
|
<u-button :style="{margin:'24rpx 0'}" type="primary" size="medium" class="confirm" @click="confirm">{{$t('message.product_add')}}</u-button>
|
|
|
|
|
</u-col>
|
|
|
|
|
</u-row>
|
|
|
|
|
<u-col :span="12">
|
|
|
|
|
<view class="table-wrapper">
|
|
|
|
|
<wyb-table
|
|
|
|
|
class="table"
|
|
|
|
|
ref="table"
|
|
|
|
|
width="100%"
|
|
|
|
|
enable-check="multiple"
|
|
|
|
|
show-left-and-right-border
|
|
|
|
|
:headers="headers"
|
|
|
|
|
:contents="materialList"
|
|
|
|
|
:show-vert-border="false"
|
|
|
|
|
@onCheck="onCheck"
|
|
|
|
|
></wyb-table>
|
|
|
|
|
<u-table class="library-table">
|
|
|
|
|
<u-tr class="u-tr">
|
|
|
|
|
<u-th class="u-th">{{ $t("message.CommissionedLocation") }}</u-th>
|
|
|
|
|
<u-th class="u-th">{{ $t("message.CommissionedGoOutNumber") }}</u-th>
|
|
|
|
|
<u-th class="u-th">{{ $t("message.operation") }}</u-th>
|
|
|
|
|
</u-tr>
|
|
|
|
|
<u-tr class="u-tr" v-for="(item, index) in LocationList" :key="index">
|
|
|
|
|
<u-td class="u-td">{{ item.locationCode }}</u-td>
|
|
|
|
|
<u-td class="u-td">{{ item.scanAmount }}</u-td>
|
|
|
|
|
<u-td class="u-td">
|
|
|
|
|
<div class="u-td" @click="deleteItem(index)">
|
|
|
|
|
{{ $t("message.product_Delete") }}
|
|
|
|
|
</div>
|
|
|
|
|
</u-td>
|
|
|
|
|
</u-tr>
|
|
|
|
|
</u-table>
|
|
|
|
|
</view>
|
|
|
|
|
</u-col>
|
|
|
|
|
</u-form>
|
|
|
|
@ -120,7 +125,7 @@
|
|
|
|
|
</u-button>
|
|
|
|
|
</u-col>
|
|
|
|
|
<u-col :span="4">
|
|
|
|
|
<u-button type="primary" @click="resetHandle">{{ $t('message.product_Upload') }}</u-button>
|
|
|
|
|
<u-button type="primary" @click="onSubmit">{{ $t('message.product_Upload') }}</u-button>
|
|
|
|
|
</u-col>
|
|
|
|
|
<u-col :span="4">
|
|
|
|
|
<u-button type="error" @click="onOk">{{ $t('message.po_Return') }}</u-button>
|
|
|
|
@ -151,6 +156,7 @@ export default class stoOutboundDom extends BasePage {
|
|
|
|
|
*/
|
|
|
|
|
@Ref('table') readonly $table: any;
|
|
|
|
|
|
|
|
|
|
LocationList: any = [];
|
|
|
|
|
/**
|
|
|
|
|
* 页面Module
|
|
|
|
|
*/
|
|
|
|
@ -232,6 +238,14 @@ export default class stoOutboundDom extends BasePage {
|
|
|
|
|
uni.navigateBack({ delta: 1 });
|
|
|
|
|
this.$table.onEmpty();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 单号查询
|
|
|
|
|
async queryOrder(poNo:string){
|
|
|
|
|
const {orderInInfo} = await model.queryOrder(poNo)
|
|
|
|
|
Object.assign(this.form,{
|
|
|
|
|
...orderInInfo
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
materialConfirm(v: any) {
|
|
|
|
|
console.log('v[0].value', v[0]);
|
|
|
|
|
// this.form.productCode = v[0].value;
|
|
|
|
@ -271,63 +285,76 @@ export default class stoOutboundDom extends BasePage {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
confirm() {
|
|
|
|
|
// if (this.wlCode == "" || this.number == "") {
|
|
|
|
|
// uni.showToast({
|
|
|
|
|
// icon: "none",
|
|
|
|
|
// title: "请输入正确的库位和数量",
|
|
|
|
|
// });
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
console.log('123')
|
|
|
|
|
this.LocationList.push(this.form)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
deleteItem(index: any) {
|
|
|
|
|
this.LocationList.splice(index, 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 条码回车
|
|
|
|
|
* 提交
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
onSubmit() {
|
|
|
|
|
this.$form.validate(async (valid: boolean) => {
|
|
|
|
|
if (this.form.productCode.slice(0, 9) != this.form.barCode.slice(0, 9)) {
|
|
|
|
|
uni.showToast({ icon: 'none', title: this.$t('message.product_Tip5') as string });
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (parseInt(this.form.orderAmount) <= parseInt(this.form.scanAmount)) {
|
|
|
|
|
uni.showToast({ icon: 'none', title: this.$t('message.product_Tip6') as string });
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
let list = [
|
|
|
|
|
{
|
|
|
|
|
order3: this.form.orderNo,
|
|
|
|
|
productCode: this.form.productCode,
|
|
|
|
|
productDescZh: this.form.productDescZh,
|
|
|
|
|
barCode: this.form.barCode,
|
|
|
|
|
dockCode: this.form.dockCode,
|
|
|
|
|
dockName: this.form.dockName,
|
|
|
|
|
orderType: 3,
|
|
|
|
|
type: 0,
|
|
|
|
|
keepBy: session.loginName as string,
|
|
|
|
|
loginName: session.loginName as string,
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
// if (this.form.productCode.slice(0, 9) != this.form.barCode.slice(0, 9)) {
|
|
|
|
|
// uni.showToast({ icon: 'none', title: this.$t('message.product_Tip5') as string });
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
// if (parseInt(this.form.orderAmount) <= parseInt(this.form.scanAmount)) {
|
|
|
|
|
// uni.showToast({ icon: 'none', title: this.$t('message.product_Tip6') as string });
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
const list = this.LocationList.map( (item:any) =>({
|
|
|
|
|
wlCode:item.locationCode,
|
|
|
|
|
nowAmount:item.scanAmount,
|
|
|
|
|
}))
|
|
|
|
|
|
|
|
|
|
if (valid) {
|
|
|
|
|
const res = await this.model.tluSubmit(list);
|
|
|
|
|
const res = await this.model.materialComplete({
|
|
|
|
|
poNo:this.form.poNo,
|
|
|
|
|
materialCode:this.form.materialCode,
|
|
|
|
|
list
|
|
|
|
|
});
|
|
|
|
|
console.log('fanhui ', res);
|
|
|
|
|
// if (res.barcode) {
|
|
|
|
|
// // this.materialList.push(res);
|
|
|
|
|
// this.form.scanAmount = res.scanAmount;
|
|
|
|
|
// }
|
|
|
|
|
if (this.materialList.length == 0) {
|
|
|
|
|
await this.materialList.push(res);
|
|
|
|
|
this.form.scanAmount += 1;
|
|
|
|
|
this.$table.onCheckAllTap();
|
|
|
|
|
} else {
|
|
|
|
|
let flag = 0;
|
|
|
|
|
for (let i = 0; i < this.materialList.length; i++) {
|
|
|
|
|
console.log('11111', this.materialList[i]);
|
|
|
|
|
if (this.form.barCode == this.materialList[i].barcode) {
|
|
|
|
|
flag = 1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (flag == 0) {
|
|
|
|
|
await this.$table.onCheckAllTap();
|
|
|
|
|
await this.materialList.push(res);
|
|
|
|
|
this.form.scanAmount += 1;
|
|
|
|
|
this.$table.onCheckAllTap();
|
|
|
|
|
} else {
|
|
|
|
|
uni.showToast({ icon: 'none', title: this.$t('message.product_Tip7') as string });
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// if (this.materialList.length == 0) {
|
|
|
|
|
// await this.materialList.push(res);
|
|
|
|
|
// this.form.scanAmount += 1;
|
|
|
|
|
// this.$table.onCheckAllTap();
|
|
|
|
|
// } else {
|
|
|
|
|
// let flag = 0;
|
|
|
|
|
// for (let i = 0; i < this.materialList.length; i++) {
|
|
|
|
|
// console.log('11111', this.materialList[i]);
|
|
|
|
|
// if (this.form.barCode == this.materialList[i].barcode) {
|
|
|
|
|
// flag = 1;
|
|
|
|
|
// break;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// if (flag == 0) {
|
|
|
|
|
// await this.$table.onCheckAllTap();
|
|
|
|
|
// await this.materialList.push(res);
|
|
|
|
|
// this.form.scanAmount += 1;
|
|
|
|
|
// this.$table.onCheckAllTap();
|
|
|
|
|
// } else {
|
|
|
|
|
// uni.showToast({ icon: 'none', title: this.$t('message.product_Tip7') as string });
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
const item = {
|
|
|
|
|