cosmoim-852 fix 成品下线新增库位推荐功能 && 虚拟单交接逻辑修改 && 新增补料创建页面

master
hou 3 years ago
parent 1e7bdd4ad9
commit 3121840be2

@ -15,7 +15,7 @@
"editor.defaultFormatter": "esbenp.prettier-vscode" "editor.defaultFormatter": "esbenp.prettier-vscode"
}, },
"[vue]": { "[vue]": {
"editor.defaultFormatter": "esbenp.prettier-vscode" "editor.defaultFormatter": "johnsoncodehk.volar"
}, },
"[json]": { "[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode" "editor.defaultFormatter": "esbenp.prettier-vscode"

@ -24,6 +24,7 @@ export default {
request_Tip11: 'HTTP版本不受支持', request_Tip11: 'HTTP版本不受支持',
sweep: '是否退扫', sweep: '是否退扫',
success: '操作成功', success: '操作成功',
recommended: '推荐库位',
error: '操作失败', error: '操作失败',
operation: '操作', operation: '操作',
//版本更新 //版本更新
@ -35,6 +36,7 @@ export default {
//服务器设置 //服务器设置
ServerSetting: '服务器设置', ServerSetting: '服务器设置',
PleaseInputIPAddress: '请输入IP地址', PleaseInputIPAddress: '请输入IP地址',
open: '开启',
PleaseInputPortNumber: '请输入端口号', PleaseInputPortNumber: '请输入端口号',
Save: '保存', Save: '保存',
TryAgain: '地址无效或服务不可用,请重试', TryAgain: '地址无效或服务不可用,请重试',
@ -391,6 +393,8 @@ export default {
product_Tip1: '库位不能为空', product_Tip1: '库位不能为空',
product_Tip2: '请至少选择一条数据', product_Tip2: '请至少选择一条数据',
product_Tip3: '请选择库位', product_Tip3: '请选择库位',
Enable: '库位记忆已开启',
Closerepository: '库位记忆已关闭',
product_Tip7: '同一条码不可重复录入!', product_Tip7: '同一条码不可重复录入!',
product_Tip8: '扫码成功', product_Tip8: '扫码成功',
product_Tip9: '该条码未入库', product_Tip9: '该条码未入库',

@ -254,8 +254,12 @@ export default {
InventoryMateriel: 'MAT name', InventoryMateriel: 'MAT name',
InventoryTotalNumber: 'Total', InventoryTotalNumber: 'Total',
create: 'create', create: 'create',
open: 'open',
materialName: 'materialName', materialName: 'materialName',
Enable: 'The memory function is enabled',
Closerepository: 'The memory function is disabled',
quantityNum: 'The loading quantity', quantityNum: 'The loading quantity',
recommended: 'RecommendedLoc',
materialCode: 'Please enter the material number', materialCode: 'Please enter the material number',
receive: 'receiveLoc', receive: 'receiveLoc',
Production: 'Production orders', Production: 'Production orders',

@ -150,7 +150,7 @@ export default class LoginPage extends BasePage {
console.log('image', this.image); console.log('image', this.image);
console.log('Version////', this.Version); console.log('Version////', this.Version);
} }
Version = '1.0.16'; Version = '1.0.19';
compareVersion(version1: any, version2: any) { compareVersion(version1: any, version2: any) {
//version1 1 &&& version2 -1 //version1 1 &&& version2 -1
const newVersion1 = `${version1}`.split('.').length < 3 ? `${version1}`.concat('.0') : `${version1}`; const newVersion1 = `${version1}`.split('.').length < 3 ? `${version1}`.concat('.0') : `${version1}`;

@ -13,22 +13,14 @@
<u-form-item :label="$t('message.product_barCode')"> <u-form-item :label="$t('message.product_barCode')">
<u-search :placeholder="$t('message.po_PleaseInput')" v-model.trim="form.barCode" @search="getBarcode" :focus="firstFocus" maxlength="20" :show-action="false"></u-search> <u-search :placeholder="$t('message.po_PleaseInput')" v-model.trim="form.barCode" @search="getBarcode" :focus="firstFocus" maxlength="20" :show-action="false"></u-search>
</u-form-item> </u-form-item>
<u-form-item :label="$t('message.recommended')">
<u-switch v-model="open" @change="change"></u-switch>
</u-form-item>
<u-form-item :required="true" :label="$t('message.product_Location')" prop="dockName"> <u-form-item :required="true" :label="$t('message.product_Location')" prop="dockName">
<jPicker sureColor="#ff0000" @bindpicker="bookTypeChange" showKey="value" valKey="value" :val="form.aimWl.value" :options="model.returningTypeList" :focus="true" /> <jPicker sureColor="#ff0000" @bindpicker="bookTypeChange" showKey="value" valKey="value" :val="form.aimWl.value" :options="model.returningTypeList" :focus="true" />
<u-col :span="3"> <u-col :span="3">
<u-button type="success" @click="add">{{ $t('message.product_add') }}</u-button> <u-button type="success" @click="add">{{ $t('message.product_add') }}</u-button>
</u-col> </u-col>
<!-- <u-input v-model="form.dockName" type="select" @click="returningTypeSelect = true" />-->
<!-- <u-select-->
<!-- v-model="returningTypeSelect"-->
<!-- :list="model.returningTypeList"-->
<!-- @confirm="-->
<!-- (v) => {-->
<!-- form.dockCode = v[0].value;-->
<!-- form.dockName = v[0].label;-->
<!-- }-->
<!-- "-->
<!-- ></u-select>-->
</u-form-item> </u-form-item>
</u-col> </u-col>
<u-col :span="12"> <u-col :span="12">
@ -96,6 +88,7 @@ export default class finishProductOfflineDom extends BasePage {
* 月台类型选择 * 月台类型选择
*/ */
returningTypeSelect = false; returningTypeSelect = false;
open = false;
/** /**
* 页面Module * 页面Module
*/ */
@ -141,7 +134,20 @@ export default class finishProductOfflineDom extends BasePage {
bookTypeChange(e: any) { bookTypeChange(e: any) {
this.form.aimWl = e.pickerName; this.form.aimWl = e.pickerName;
} }
change(status: any) {
console.log(status);
if (this.open) {
uni.showToast({
title: this.$t('message.Enable') as string,
image: '/static/icons/icon-51.png',
});
} else {
uni.showToast({
title: this.$t('message.Closerepository') as string,
image: '/static/icons/icon-52.png',
});
}
}
// onReadyonLoad // onReadyonLoad
async onReady() { async onReady() {
this.$form.setRules(this.rules); this.$form.setRules(this.rules);
@ -269,6 +275,7 @@ export default class finishProductOfflineDom extends BasePage {
} }
} }
async getBarcode() { async getBarcode() {
if (this.open == false) {
if (this.form.barCode.length < 20) { if (this.form.barCode.length < 20) {
this.customToast(this.$t('message.barCodeLength') as string); this.customToast(this.$t('message.barCodeLength') as string);
return; return;
@ -282,6 +289,37 @@ export default class finishProductOfflineDom extends BasePage {
await this.model.queryTypeList(this.model.materielList[0].productCode); await this.model.queryTypeList(this.model.materielList[0].productCode);
this.form.aimWl = model.firstLocation; this.form.aimWl = model.firstLocation;
} }
} else {
if (this.form.barCode.length < 20) {
this.customToast(this.$t('message.barCodeLength') as string);
return;
}
if (this.form.barCode.length > 20) {
this.customToast(this.$t('message.standard') as string);
return;
}
await this.model.queryOrderInInfo(this.form);
if (this.model.searchCode == '1') {
if (this.materielList.length == 0) {
this.materielList.push(this.model.materielList[0]);
this.materielList[this.materielList.length - 1].locCode = this.form.aimWl.label;
} else {
let flag = 0;
for (let i = 0; i < this.materielList.length; i++) {
if (this.form.barCode == this.materielList[i].barcode) {
flag = 1;
break;
}
}
if (flag == 0) {
this.materielList.push(this.model.materielList[0]);
this.materielList[this.materielList.length - 1].locCode = this.form.aimWl.label;
} else {
this.customToast(this.$t('message.product_Tip7') as string);
}
}
}
}
} }
} }
</script> </script>
@ -306,13 +344,16 @@ export default class finishProductOfflineDom extends BasePage {
font-size: 34rpx; font-size: 34rpx;
font-weight: 500; font-weight: 500;
text-align: center; text-align: center;
.title { .title {
flex: 3; flex: 3;
} }
.left, .left,
.right { .right {
flex: 1; flex: 1;
} }
.icon { .icon {
display: flex; display: flex;
justify-content: center; justify-content: center;

@ -90,18 +90,40 @@ export const PropoHeader = [
{ {
label: vm.$t('message.po_MaterielNo'), label: vm.$t('message.po_MaterielNo'),
key: 'materialCode', key: 'materialCode',
width: 177, width: 300,
}, },
{ {
label: vm.$t('message.po_MaterielDes'), label: vm.$t('message.po_MaterielDes'),
key: 'sendSpot', key: 'materialDesc',
width: 450,
}, },
{ {
label: vm.$t('message.Pi_unit'), label: vm.$t('message.Pi_unit'),
key: 'wlCode', key: 'unit',
width: 300,
}, },
{ {
label: vm.$t('message.Production'), label: vm.$t('message.Production'),
key: 'qty', key: 'prdOrder',
width: 300,
},
];
export const CreteListHeader = [
{
label: vm.$t('message.po_MaterielNo'),
key: 'materialCode',
width: 200,
},
{
label: vm.$t('message.receiveAStation'),
key: 'sendSpot',
},
{
label: vm.$t('message.Production'),
key: 'prdOrder',
},
{
label: vm.$t('message.quantityNum'),
key: 'amount',
}, },
]; ];

@ -11,38 +11,38 @@
<view class="content"> <view class="content">
<view class="single"> <view class="single">
<view class="single-right"> <view class="single-right">
<u-button type="primary" @click="show = !show">{{ $t('message.Warehouse_Tip6') }}</u-button> <u-button type="primary" @click="propoWindow">{{ $t('message.Warehouse_Tip6') }}</u-button>
</view> </view>
</view> </view>
<view class="material"> <view class="material">
<view class="material-right"> <view class="material-right">
<view class="material-right-title">{{ $t('message.Production') }}:</view> <view class="material-right-title">{{ $t('message.Production') }}:</view>
<view class="material-right-code" style="overflow: hidden">{{ some.materialDesc }}</view> <view class="material-right-code" style="overflow: hidden">{{ some.prdOrder }}</view>
</view> </view>
</view> </view>
<view class="material"> <view class="material">
<view class="material-right"> <view class="material-right">
<view class="material-right-title">{{ $t('message.Pi_materielNo') }}:</view> <view class="material-right-title">{{ $t('message.Pi_materielNo') }}:</view>
<view class="material-right-code" style="overflow: hidden">{{ some.materialDesc }}</view> <view class="material-right-code" style="overflow: hidden">{{ some.materialCode }}</view>
</view> </view>
</view> </view>
<view class="material"> <view class="material">
<view class="material-right"> <view class="material-right">
<view class="material-right-title">{{ $t('message.materialName') }}:</view> <view class="material-right-title">{{ $t('message.materialName') }}:</view>
<view class="material-right-code" style="overflow: hidden">{{ some.totalFillAmount }}</view> <view class="material-right-code" style="overflow: hidden">{{ some.materialDesc }}</view>
</view> </view>
</view> </view>
<view class="material"> <view class="material">
<view class="material-right"> <view class="material-right">
<view class="material-right-title">{{ $t('message.Pi_unit') }}:</view> <view class="material-right-title">{{ $t('message.Pi_unit') }}:</view>
<view class="material-right-code" style="overflow: hidden">{{ some.amount }}</view> <view class="material-right-code" style="overflow: hidden">{{ some.unit }}</view>
</view> </view>
</view> </view>
<!-- 库位 --> <!-- 库位 -->
<view class="library"> <view class="library">
<view class="library-left"> <view class="library-left">
<view>{{ $t('message.receiveAStation') }}:</view> <view>{{ $t('message.receiveAStation') }}:</view>
<view class="material-right-code" style="overflow: hidden">{{ some.amount }}</view> <view class="material-right-code" style="overflow: hidden">{{ some.sendSpot }}</view>
</view> </view>
</view> </view>
<view class="library"> <view class="library">
@ -56,25 +56,31 @@
</view> </view>
</view> </view>
<!-- 表格 --> <!-- 表格 -->
<wyb-table class="table" ref="table" width="100%" show-left-and-right-border :headers="detailHeader" :contents="LocationList" :show-vert-border="false" @onCellClick="deleteItem($event)"></wyb-table> <wyb-table class="table" ref="table" width="100%" show-left-and-right-border :headers="detailHeader" :contents="List" :show-vert-border="false" @onCellClick="deleteItem($event)"></wyb-table>
</view> </view>
<!-- 弹窗 --> <!-- 弹窗 -->
<u-popup v-model="show" mode="center" closeable width="95%" height="90%" border-radius="14"> <u-popup v-model="show" mode="center" closeable width="95%" height="90%" border-radius="14">
<view class="single"> <view class="single">
<view class="single-left"> <view class="single-left">
<view>{{ $t('message.po_MaterielNo') }}</view> <view>{{ $t('message.Production') }}</view>
<u-search :placeholder="$t('message.materialCode')" v-model.trim="form.documentNo" @search="query" :show-action="false"></u-search> <u-search :placeholder="$t('message.Commission_tips1')" v-model.trim="prdOrder" :show-action="false"> </u-search>
</view> </view>
<view class="single-right"> </view>
<view class="singles">
<view class="single-lefts">
<view>{{ $t('message.po_MaterielNo') }}</view>
<u-search :placeholder="$t('message.materialCode')" v-model.trim="materialCode" :show-action="false"> </u-search>
</view>
<view class="single-rights">
<u-button type="primary" @click="query">{{ $t('message.Query') }}</u-button> <u-button type="primary" @click="query">{{ $t('message.Query') }}</u-button>
</view> </view>
</view> </view>
<scroll-view scroll-y="true" style="height: 480px; padding-top: 20px; overflow-x: auto"> <scroll-view scroll-y="true" scroll-x="true" style="height: 440px; padding-top: 20px; white-space: nowrap">
<view> <view style="display: inline-block">
<wyb-table class="table" ref="table" enable-check="multiple" show-left-and-right-border width="100%" :headers="PropoHeader" :contents="LocationList" :show-vert-border="false"></wyb-table> <wyb-table class="table" ref="table" enable-check="single" show-left-and-right-border width="100%" :headers="PropoHeader" @onCheck="selectItem($event)" :contents="model.MaterialList" :show-vert-border="false"></wyb-table>
</view> </view>
</scroll-view> </scroll-view>
<u-button type="primary">{{ $t('message.workArea_Confirm') }}</u-button> <u-button type="primary" @click="onOk">{{ $t('message.workArea_Confirm') }}</u-button>
</u-popup> </u-popup>
<view class="bottom-bar"> <view class="bottom-bar">
<div class="container"> <div class="container">
@ -96,298 +102,142 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { Component, Ref } from 'vue-property-decorator'; import { Component } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page'; import { BasePage } from '@/components/base/page';
import model from './model'; import model from './model';
import { session } from '@/store/modules/session';
import { VForm, VFormRules } from 'vue/types/form';
import jPicker from '@/components/J-Picker/jPicker.vue'; import jPicker from '@/components/J-Picker/jPicker.vue';
import { detailHeader, PropoHeader } from './config'; import { CreteListHeader, PropoHeader } from './config';
import { auth } from '@/store/modules/auth';
@Component({ @Component({
components: { components: {
jPicker, jPicker,
}, },
}) })
export default class RawReceiptDetail extends BasePage { export default class RawReceiptDetail extends BasePage {
/** detailHeader = CreteListHeader;
* 表单引用 PropoHeader = PropoHeader;
*/
@Ref('form') readonly $form!: VForm;
@Ref('submitForm') readonly $submitForm!: VForm;
@Ref('form2') readonly $form2!: VForm;
submitForm = {
receiver: '',
receiverName: '',
password: '',
};
model = model; model = model;
show = false;
materialList: any = [];
type = 'text';
wlCode: any = '';
border = true; border = true;
operatorName = ''; show = false;
// List: any = [];
LocationList: any = [];
//
Location: any = [];
someIndex = 0;
some: any = {}; some: any = {};
qty: any = ''; qty: any = '';
form: any = { //
documentNo: '', prdOrder: any = '';
amount: null, //
}; materialCode: any = '';
form2 = { async propoWindow() {
operatorPass: '', // this.show = !this.show;
rfPwd: '', await this.query();
};
rules: VFormRules<any> = {
amount: [{ required: true, message: this.$t('message.Pi_tip1') as string }],
};
detailHeader = detailHeader;
PropoHeader = PropoHeader;
empty() {
this.some = {};
this.someIndex = 0;
this.qty = '';
this.Location = [];
this.wlCode = '';
this.materialList = [];
this.model.blDetailList.length = 0;
}
LocEmpty() {
this.some = {};
this.someIndex = 0;
this.qty = '';
this.wlCode = '';
this.materialList = [];
this.model.blDetailList.length = 0;
this.LocationList = [];
} }
async query() { async query() {
if (this.form.documentNo == '') {
this.customToast(this.$t('message.Commission_tips1') as string);
}
this.LocEmpty();
this.wlCode = this.Location[0];
let inPrdOrderList = this.form.documentNo.split(',');
let params = { let params = {
inPrdOrderList, prdOrder: this.prdOrder,
materialCode: this.materialCode,
}; };
await this.model.queryBlDetailList(params).then(() => { await this.model.queryMaterialList(params);
this.model.blDetailList.forEach((item: any) => {
let arr = {
label: item.materialCode,
value: item.materialCode,
sapSupplyId: item.sapSupplyId,
};
this.materialList.push(arr);
item.wlList = [];
});
this.some = this.model.blDetailList[0];
this.someIndex = 0;
});
await this.model.queryItemLoc({
workArea: session.workareaCode,
loginName: session.loginName,
sendSpot: null,
materialCode: this.some.materialCode,
factoryCode: session.factoryCode,
});
if (this.model.LocList.length != 0) {
this.Location = [];
this.Location = this.model.LocList;
this.wlCode = this.Location[0];
} else {
console.log('1');
} }
} selectItem(e: any) {
async materialChoice(e: any) { console.log(e);
this.model.blDetailList.forEach((item: any, index: any) => { this.model.MaterialList.forEach((item: any) => {
if (item.sapSupplyId == e.pickerName.sapSupplyId) { if (item.checked) {
this.some = item; this.some = item;
this.someIndex = index;
} }
}); });
await this.model.queryItemLoc({ }
workArea: session.workareaCode, onOk() {
loginName: session.loginName, let flag = false;
sendSpot: null, this.model.MaterialList.forEach((item: any) => {
materialCode: this.some.materialCode, if (item.checked) {
factoryCode: session.factoryCode, flag = true;
}
}); });
if (this.model.LocList.length != 0) { if (flag == false) {
this.Location = []; uni.showToast({
this.Location = this.model.LocList; title: this.$t('message.Commission_tips6') as any,
this.wlCode = this.Location[0]; image: '/static/icons/icon-52.png',
} else { });
console.log('1'); return;
}
this.qty = '';
}
LocationChoice(e: any) {
this.wlCode = e.pickerName;
}
async onOperatorConfirm(loginName: string) {
try {
const { userName } = await auth.getUserInfo({ loginName });
this.form2.operatorPass = loginName;
this.operatorName = userName;
} catch {
this.form2.operatorPass = '';
this.operatorName = '';
} }
this.show = !this.show;
this.model.MaterialList.length = 0;
this.prdOrder = '';
this.materialCode = '';
} }
Add() { Add() {
if (this.qty == '' || this.wlCode == '') {
this.customToast(this.$t('message.AppendMateriel1') as string);
return;
}
if (parseFloat(this.qty) <= 0) {
this.customToast(this.$t('message.AppendMateriel2') as string);
return;
}
if (parseFloat(this.qty) > model.blDetailList[this.someIndex].amount) {
this.customToast(this.$t('message.AppendMateriel3') as string);
return;
}
let num = parseFloat(this.qty);
this.model.blDetailList[this.someIndex].wlList.forEach((item: any) => {
num += parseFloat(item.qty);
});
if (num > this.model.blDetailList[this.someIndex].amount) {
this.customToast(this.$t('message.AppendMateriel3') as string);
return;
}
let isTrue = true;
if (this.LocationList.length != 0) {
this.model.blDetailList[this.someIndex].wlList.forEach((item: any) => {
if (this.wlCode.sendSpot != item.Code) {
this.customToast(this.$t('message.AppendMateriel4') as string);
return (isTrue = false);
}
});
}
if (this.some == {}) { if (this.some == {}) {
this.customToast(this.$t('message.AppendMateriel5') as string); uni.showToast({
title: this.$t('message.Commission_tips6') as any,
image: '/static/icons/icon-52.png',
});
this.qty = '';
return; return;
} }
if (isTrue == true) { if (this.qty == '') {
let arr = { uni.showToast({
wlCode: this.wlCode.label, title: this.$t('message.Summary_PleaseInputNumber') as any,
qty: this.qty, image: '/static/icons/icon-52.png',
Code: this.wlCode.sendSpot, });
...this.some, return;
}; }
this.LocationList.push(arr); if (this.List.length != 0) {
this.model.blDetailList[this.someIndex].wlList.push(arr); let next = true;
this.List.forEach((item: any) => {
if (item.prdOrder == this.some.prdOrder && item.materialCode == this.some.materialCode && item.mrpCode == this.some.mrpCode && item.sendSpot == this.some.sendSpot) {
return (next = false);
}
});
if (next) {
this.some.amount = this.qty;
this.List.push(this.some);
this.qty = '';
} else {
uni.showToast({
title: this.$t('message.repeatedly') as any,
image: '/static/icons/icon-52.png',
});
this.qty = '';
return;
}
} else {
this.some.amount = this.qty;
this.List.push(this.some);
this.qty = ''; this.qty = '';
this.business();
} }
} }
deleteItem(e: any) { deleteItem(e: any) {
console.log(e);
uni.showModal({ uni.showModal({
content: this.$t('message.product_Delete') as string, title: this.$t('message.product_Delete') as any,
cancelText: this.$t('message.Cancel') as string, success: (res: any) => {
confirmText: this.$t('message.workArea_Confirm') as string,
success: (res) => {
if (res.confirm) { if (res.confirm) {
let lineData = e.lineData; this.List.splice(e.contentIndex, 1);
let i: any;
this.model.blDetailList.forEach((item: any, index: any) => {
if (item.materialCode == lineData.materialCode && item.sendSpot == lineData.sendSpot) {
i = index;
}
});
let NextIndex: any;
this.model.blDetailList[i].wlList.forEach((item: any, index: any) => {
if (item.wlCode == lineData.wlCode && item.qty == lineData.qty) {
NextIndex = index;
}
});
this.model.blDetailList[i].wlList.splice(NextIndex, 1);
this.LocationList.splice(e.contentIndex, 1);
let num: any = 0;
this.model.blDetailList[i].wlList.forEach((item: any) => {
num += parseFloat(item.qty);
});
this.model.blDetailList[i].fillAmount = num;
console.log('this.model.blDetailList', this.model.blDetailList);
} else if (res.cancel) { } else if (res.cancel) {
return; return;
} }
}, },
}); });
} }
business() {
let num = 0;
this.model.blDetailList[this.someIndex].wlList.forEach((item: any) => {
num += parseFloat(item.qty);
});
this.model.blDetailList[this.someIndex].fillAmount = num;
this.some.fillAmount = num;
console.log('this.model.blDetailList', this.model.blDetailList);
}
async onReady() {
let content = {
loginName: session.loginName,
sendSpot: null,
factoryCode: session.factoryCode,
workArea: session.workareaCode,
};
let res: any = await this.model.queryByFactoryCodeAndWorkAreaCode(content);
console.log('res>>>>>>>>>>>>>>>>>>>>>>', res);
res.forEach((item: any) => {
let pickerName: any = {};
pickerName.label = item.locationCode;
pickerName.value = item.locationCode + '(' + item.sendSpot + ')';
pickerName.sendSpot = item.sendSpot;
this.Location.push(pickerName);
});
this.model.blDetailList.forEach((item: any) => {
item.receiptAmount = 0;
item.wlQTyList = [];
});
this.model.blDetailList.length = 0;
this.wlCode = this.Location[0];
}
async bill() {
if (this.some == {} || this.some.prdOrder == null) {
// uni.showToast({
// icon: 'none',
// title: this.$t('message.Commission_tips6') as string,
// });
this.customToast(this.$t('message.Commission_tips6') as string);
return;
}
let person = JSON.parse(uni.getStorageSync('__GWMS_APP_STATE_DATA__') as any);
let content = {
loginName: person.session.user.loginName,
prdOrder: this.some.prdOrder,
};
await this.model.querydetaildlist(content);
this.redirectTo(this.page.raw.handover.feeding.Local);
}
async onSubmit() { async onSubmit() {
this.model.blDetailList.forEach((item: any) => { this.List.forEach((item: any) => {
item.wlList.forEach((item: any) => { item.factoryCode = this.session.factoryCode;
item.wlList = null; item.loginName = this.session.loginName;
}); });
await this.model.submitList(this.List);
console.log('submitListCode', this.model.submitListCode);
if (this.model.submitListCode) {
uni.showToast({
title: this.$t('message.Warehouse_Tip9') as any,
image: '/static/icons/icon-51.png',
}); });
let dataList = this.model.blDetailList; this.empty();
const params = { }
dataList, }
...this.form2, empty() {
factoryCode: this.session.factoryCode, this.List = [];
loginName: this.session.loginName, this.some = {};
};
await this.model.saveBlDetailUpload(params).then(() => {
this.qty = ''; this.qty = '';
this.LocationList = []; this.prdOrder = '';
this.query(); this.materialCode = '';
});
} }
} }
</script> </script>
@ -398,23 +248,28 @@ export default class RawReceiptDetail extends BasePage {
background-size: 100% 600rpx; background-size: 100% 600rpx;
padding: 118rpx 30rpx 162rpx; padding: 118rpx 30rpx 162rpx;
min-height: 100%; min-height: 100%;
.uni-scroll-view-content { .uni-scroll-view-content {
overflow-x: auto; overflow-x: auto;
.single { .single {
width: 100%; width: 100%;
height: 100px; height: 80px;
display: flex; display: flex;
padding-top: 50px; padding-top: 30px;
.single-left { .single-left {
width: 80%; width: 100%;
height: 60px; height: 60px;
display: flex; display: flex;
view { view {
width: 110rpx; width: 110rpx;
height: 100%; height: 100%;
line-height: 100rpx; line-height: 100rpx;
} }
} }
.single-right { .single-right {
button { button {
margin-top: 15rpx; margin-top: 15rpx;
@ -423,7 +278,35 @@ export default class RawReceiptDetail extends BasePage {
} }
} }
} }
.singles {
width: 100%;
height: 50px;
// height: 100px;
display: flex;
.single-lefts {
width: 80%;
height: 60px;
display: flex;
view {
width: 110rpx;
height: 100%;
line-height: 100rpx;
} }
}
.single-rights {
button {
margin-top: 15rpx;
width: 150rpx;
height: 70rpx;
}
}
}
}
.header { .header {
position: fixed; position: fixed;
top: 36rpx; top: 36rpx;
@ -437,13 +320,16 @@ export default class RawReceiptDetail extends BasePage {
font-size: 34rpx; font-size: 34rpx;
font-weight: 500; font-weight: 500;
text-align: center; text-align: center;
.title { .title {
flex: 3; flex: 3;
} }
.left, .left,
.right { .right {
flex: 1; flex: 1;
} }
.icon { .icon {
display: flex; display: flex;
justify-content: center; justify-content: center;
@ -452,41 +338,50 @@ export default class RawReceiptDetail extends BasePage {
height: 88rpx; height: 88rpx;
} }
} }
.content { .content {
width: 100%; width: 100%;
background: white; background: white;
border-radius: 15rpx; border-radius: 15rpx;
padding: 10rpx; padding: 10rpx;
.material { .material {
width: 100%; width: 100%;
height: 100rpx; height: 100rpx;
display: flex; display: flex;
.material-left { .material-left {
width: 100%; width: 100%;
height: 100%; height: 100%;
display: flex; display: flex;
view { view {
width: 145rpx; width: 145rpx;
line-height: 100rpx; line-height: 100rpx;
} }
.search { .search {
padding-left: 12px; padding-left: 12px;
} }
} }
} }
.material { .material {
width: 100%; width: 100%;
height: 100rpx; height: 100rpx;
display: flex; display: flex;
.material-right { .material-right {
width: 100%; width: 100%;
height: 100%; height: 100%;
display: flex; display: flex;
.material-right-title { .material-right-title {
width: 145rpx; width: 145rpx;
height: 100%; height: 100%;
line-height: 100rpx; line-height: 100rpx;
} }
.material-right-code { .material-right-code {
width: 80%; width: 80%;
height: 100%; height: 100%;
@ -497,18 +392,22 @@ export default class RawReceiptDetail extends BasePage {
} }
} }
} }
.number { .number {
height: 100rpx; height: 100rpx;
display: flex; display: flex;
.number-left { .number-left {
width: 50%; width: 50%;
height: 100%; height: 100%;
display: flex; display: flex;
.number-left-title { .number-left-title {
width: 120rpx; width: 120rpx;
height: 100%; height: 100%;
line-height: 100rpx; line-height: 100rpx;
} }
.input { .input {
width: 200rpx; width: 200rpx;
height: 70rpx; height: 70rpx;
@ -516,16 +415,19 @@ export default class RawReceiptDetail extends BasePage {
margin-left: 15rpx; margin-left: 15rpx;
} }
} }
.number-right { .number-right {
width: 50%; width: 50%;
height: 100%; height: 100%;
display: flex; display: flex;
.number-right-title { .number-right-title {
width: 120rpx; width: 120rpx;
height: 100%; height: 100%;
line-height: 100rpx; line-height: 100rpx;
text-align: center; text-align: center;
} }
.input { .input {
width: 200rpx; width: 200rpx;
height: 70rpx; height: 70rpx;
@ -534,32 +436,39 @@ export default class RawReceiptDetail extends BasePage {
} }
} }
} }
.library { .library {
width: 100%; width: 100%;
height: 100rpx; height: 100rpx;
.library-left { .library-left {
width: 100%; width: 100%;
height: 100%; height: 100%;
display: flex; // display: flex;
view { view {
width: 120rpx; width: 120rpx;
line-height: 100rpx; line-height: 100rpx;
} }
.search {
padding-left: 19px; .material-right-code {
text-align: left; width: 200px;
padding-left: 20px;
} }
} }
.library-right { .library-right {
width: 50%; width: 50%;
height: 100%; height: 100%;
display: flex; display: flex;
.library-right-title { .library-right-title {
width: 120rpx; width: 120rpx;
height: 100%; height: 100%;
line-height: 100rpx; line-height: 100rpx;
// text-align: center; // text-align: center;
} }
.input { .input {
width: 200rpx; width: 200rpx;
height: 70rpx; height: 70rpx;
@ -567,10 +476,12 @@ export default class RawReceiptDetail extends BasePage {
margin-left: 15rpx; margin-left: 15rpx;
} }
} }
.add { .add {
width: 100%; width: 100%;
height: 100rpx; height: 100rpx;
position: relative; position: relative;
button { button {
position: absolute; position: absolute;
top: 10rpx; top: 10rpx;
@ -579,6 +490,7 @@ export default class RawReceiptDetail extends BasePage {
} }
} }
} }
.bottom-bar { .bottom-bar {
z-index: 21; z-index: 21;
position: fixed; position: fixed;

@ -18,11 +18,13 @@ export class FeedingModule extends VuexModule {
blDetailList: any[] = []; blDetailList: any[] = [];
detailedList: any; detailedList: any;
LocList: any = []; LocList: any = [];
submitListCode: any = '';
/** /**
* *
*/ */
locationList = []; locationList = [];
MaterialList: any = [];
/** /**
* *
@ -177,6 +179,23 @@ export class FeedingModule extends VuexModule {
return { locationList }; return { locationList };
} }
@MutationAction
async queryMaterialList(params: any) {
const res: any = await http.post(url.auth.query.queryAppendDetail, {
factoryCode: session.factoryCode,
loginName: session.loginName,
prdOrder: params.prdOrder,
materialCode: params.materialCode,
});
const MaterialList = res.list;
return { MaterialList };
}
@MutationAction
async submitList(params: any) {
const res: any = await http.post(url.auth.query.createAppendList, params);
const submitListCode = res.code;
return { submitListCode };
}
@Action({ commit: 'updateCheckedOrderInInfoListKw' }) @Action({ commit: 'updateCheckedOrderInInfoListKw' })
async queryByFactoryCodeAndWorkAreaCode(content: any) { async queryByFactoryCodeAndWorkAreaCode(content: any) {
const res = await http.post('/wmspda/fg/queryByFactoryCodeAndWorkAreaCode', content); const res = await http.post('/wmspda/fg/queryByFactoryCodeAndWorkAreaCode', content);

@ -8,24 +8,10 @@
<view class="right"></view> <view class="right"></view>
</view> </view>
<view class="table-wrapper"> <view class="table-wrapper">
<wyb-table class="table" ref="table" width="100%" show-left-and-right-border @onCheck="ClickHandover" enable-check="single" :headers="headers" :contents="model.proOrderResultList" :show-vert-border="false"></wyb-table> <wyb-table class="table" ref="table" @onCellClick="Modify($event)" width="100%" show-left-and-right-border @onCheck="ClickHandover" enable-check="multiple" :headers="headers" :contents="model.proOrderResultList" :show-vert-border="false"> </wyb-table>
</view> </view>
<view class="bottom-bar"> <view class="bottom-bar">
<view class="extra"> <view class="extra">
<u-form ref="amountForm" :model="amountForm" :error-type="['toast']">
<u-row class="bottom-info">
<!-- <u-col :span="6">
<u-form-item prop="sendSpot" label="源工位" label-width="120rpx">
<u-input v-model="amountForm.oriSendSpot" />
</u-form-item>
</u-col> -->
<u-col :span="12">
<u-form-item prop="amount" :label="$t('message.Pi_HandoverQuantity')" label-width="240rpx">
<u-input type="number" v-model="amountForm.amount" :border="border" :placeholder="$t('message.po_PleaseInput')" />
</u-form-item>
</u-col>
</u-row>
</u-form>
<u-form ref="submitForm" :model="submitForm" :error-type="['toast']"> <u-form ref="submitForm" :model="submitForm" :error-type="['toast']">
<u-row class="bottom-info"> <u-row class="bottom-info">
<u-col :span="6"> <u-col :span="6">
@ -55,6 +41,18 @@
</u-col> </u-col>
</u-row> </u-row>
</view> </view>
<!-- 弹窗 -->
<u-popup v-model="show" mode="center" closeable width="95%" height="15%" border-radius="14">
<view class="singles">
<view class="single-lefts">
<view>{{ $t('message.dn_Number') }}</view>
<u-search :placeholder="$t('message.Summary_PleaseInputNumber')" v-model.trim="nextNum" :show-action="false"> </u-search>
</view>
<view class="single-rights">
<u-button type="primary" @click="ModifyConfirm">{{ $t('message.product_Confirm') }}</u-button>
</view>
</view>
</u-popup>
</view> </view>
</view> </view>
</template> </template>
@ -87,6 +85,9 @@ export default class VirtualSummary extends BasePage {
* 表头 * 表头
*/ */
headers = summaryHeaders; headers = summaryHeaders;
show = false;
nextNum: any = '';
itemIndex = 0;
/** /**
* 处理完成 * 处理完成
@ -136,8 +137,8 @@ export default class VirtualSummary extends BasePage {
// onReadyonLoad // onReadyonLoad
onReady() { onReady() {
this.$amountForm.setRules(this.amountFormRules); // this.$amountForm.setRules(this.amountFormRules);
this.$submitForm.setRules(this.submitFormRules); // this.$submitForm.setRules(this.submitFormRules);
this.isBusinessFinished = false; this.isBusinessFinished = false;
} }
/** /**
@ -150,77 +151,44 @@ export default class VirtualSummary extends BasePage {
this.submitForm.receiver = this.submitForm.receiverName; this.submitForm.receiver = this.submitForm.receiverName;
this.submitForm.receiverName = userName; this.submitForm.receiverName = userName;
} }
Modify(e: any) {
this.itemIndex = e.contentIndex;
this.show = !this.show;
this.nextNum = '';
}
ModifyConfirm() {
if (this.nextNum == '') {
uni.showToast({
title: this.$t('message.Summary_PleaseInputNumber') as any,
image: '/static/icons/icon-52.png',
});
return;
}
let num: any = parseFloat(this.model.proOrderResultList[this.itemIndex].amount) - parseFloat(this.model.proOrderResultList[this.itemIndex].totalMoAmount);
if (parseFloat(this.nextNum) > num) {
uni.showToast({
title: this.$t('message.Commission_tips4') as any,
image: '/static/icons/icon-52.png',
});
return;
}
this.model.proOrderResultList[this.itemIndex].hvAmount = this.nextNum;
this.show = !this.show;
}
// //
ClickHandover(e: any) { ClickHandover(e: any) {
console.log(e); console.log(e);
let item = e.data[e.data.length - 1].lineData; if (e.data.length != this.model.proOrderResultList.length) {
let num: any = parseFloat(item.amount) - parseFloat(item.totalMoAmount); let index = e.data[e.data.length - 1].index;
if (num > item.virtualAmount) { let num: any = parseFloat(this.model.proOrderResultList[index].amount) - parseFloat(this.model.proOrderResultList[index].totalMoAmount);
this.amountForm.amount = item.virtualAmount; this.model.proOrderResultList[index].hvAmount = num;
} else {
this.amountForm.amount = num;
}
}
onOk() {
this.$amountForm.validate(async (valid) => {
if (!valid) return;
//
const firstRecord = model.proOrderResultList[0];
if (firstRecord === undefined) {
this.customToast(this.$t('message.LBWK') as string);
return;
}
console.log('firstRecord', firstRecord);
///
await model.checkAmount({
sapFactoryCode: model.sapFactoryCode,
loginName: session.loginName as string,
materialCode: firstRecord.materialCode,
unit: firstRecord.unit,
mrpCode: firstRecord.mrpCode,
factoryCode: session.factoryCode as string,
sendSpot: firstRecord.sendSpot,
amount: this.amountForm.amount,
});
//
const firstSelection = this.model.proOrderResultList.filter((_: any) => _.checked);
console.log('.......????', firstSelection.length);
if (firstSelection === undefined) {
this.customToast(this.$t('message.Pi_tip7') as string);
} else {
if (firstSelection.length > 1) {
this.customToast(this.$t('message.Pi_tip19') as string);
return;
} else {
const inputAmount = parseFloat(this.amountForm.amount); //
//const totalHvAmount = firstSelection[0].totalHvAmount;
const demand = firstSelection[0].amount; //
const totalMoAmount = firstSelection[0].totalMoAmount; //
console.log('2222', 2222222222222222222);
if (inputAmount + totalMoAmount > demand) {
this.customToast(this.$t('message.Pi_tip14') as string);
return;
}
console.log(1);
if (inputAmount <= 0) {
this.customToast(this.$t('message.Pi_tip2') as string);
} else { } else {
this.model.proOrderResultList.forEach((item: any) => { this.model.proOrderResultList.forEach((item: any) => {
if (item.checked) { let num: any = parseFloat(item.amount) - parseFloat(item.totalMoAmount);
item.hvAmount = this.amountForm.amount; item.hvAmount = num;
}
});
uni.showToast({
//icon: 'success',
title: this.$t('message.success') as string,
duration: 2000,
image: '/static/icons/icon-51.png',
}); });
} }
} }
}
});
}
onSubmit() { onSubmit() {
this.$submitForm.validate(async (valid) => { this.$submitForm.validate(async (valid) => {
if (valid) { if (valid) {
@ -330,13 +298,16 @@ export default class VirtualSummary extends BasePage {
font-size: 34rpx; font-size: 34rpx;
font-weight: 500; font-weight: 500;
text-align: center; text-align: center;
.title { .title {
flex: 3; flex: 3;
} }
.left, .left,
.right { .right {
flex: 1; flex: 1;
} }
.icon { .icon {
display: flex; display: flex;
justify-content: center; justify-content: center;
@ -363,6 +334,34 @@ export default class VirtualSummary extends BasePage {
right: 0; right: 0;
z-index: 1000; z-index: 1000;
.singles {
width: 100%;
height: 50px;
// height: 100px;
display: flex;
padding-top: 35px;
.single-lefts {
width: 80%;
height: 60px;
display: flex;
view {
width: 110rpx;
height: 100%;
line-height: 100rpx;
}
}
.single-rights {
button {
margin-top: 15rpx;
width: 150rpx;
height: 70rpx;
}
}
}
.container { .container {
background: #ffffff; background: #ffffff;
box-shadow: 0 1rpx 20rpx 0 rgba(128, 128, 128, 0.2); box-shadow: 0 1rpx 20rpx 0 rgba(128, 128, 128, 0.2);

@ -25,6 +25,8 @@ export const url = {
query: { query: {
location: '/wmspda/auth/query/location', location: '/wmspda/auth/query/location',
location1: '/wmspda/material/orderin/receiveloc', location1: '/wmspda/material/orderin/receiveloc',
queryAppendDetail: '/wmspda/bl/queryAppendDetail',
createAppendList: '/wmspda/bl/createAppendList',
}, },
systime: '/wmspda/auth/systime', systime: '/wmspda/auth/systime',
userInfo: '/wmspda/auth/userinfo', userInfo: '/wmspda/auth/userinfo',

Loading…
Cancel
Save