add:产成品入库优化
This commit is contained in:
parent
c16c69fc0a
commit
dfce0834db
@ -1,776 +0,0 @@
|
||||
<template>
|
||||
<view>
|
||||
<view>
|
||||
<!-- <u-navbar back-text="返回" title="成品入库" :background="background"></u-navbar> -->
|
||||
<navVar :mysNavConfig="navConfig" @onLeftClick="onLeftClick"></navVar>
|
||||
</view>
|
||||
<view style="margin: 10rpx;">
|
||||
<u-form ref="testForm">
|
||||
<view class="content" :class="{'collapsed': isCollapsed}">
|
||||
<u-form-item :border-bottom="false">
|
||||
<label>选择仓库:</label>
|
||||
<zxzUniDataSelect filterable v-model="ERPLOCATION" :localdata="items" @change="change">
|
||||
</zxzUniDataSelect>
|
||||
</u-form-item>
|
||||
<u-form-item :border-bottom="false">
|
||||
<label>选择库位:</label>
|
||||
<zxzUniDataSelect filterable v-model="LOCATIONNAME" :localdata="items_Location"
|
||||
@filter="getitems_LocationAll"></zxzUniDataSelect>
|
||||
</u-form-item>
|
||||
<zb-table style="height: 200upx;" ref="zbTable" :show-header="true" :columns="column" :stripe="true"
|
||||
:fit="true" :highlight="true" :border="true" :data="sumList"></zb-table>
|
||||
</view>
|
||||
|
||||
<!-- <view class="header" @click="toggle">
|
||||
<text style="width: 100%; text-align: center; align-self: center; display: flex; background-color:#777777">点击折叠/展开</text>
|
||||
</view> -->
|
||||
|
||||
<u-form-item :border-bottom="false">
|
||||
<p>扫描条码:</p>
|
||||
<u-input :border="true" v-model="MATERIALPACKINGNAME" placeholder="请扫描条码" :focus="focusBarCode"
|
||||
@confirm="ScanFGBarCode" />
|
||||
</u-form-item>
|
||||
<!-- <br /> -->
|
||||
<u-card style="border: 1rpx solid #0081ff" :show-head="false" :full="true"
|
||||
:body-style="{ height: '100rpx' }">
|
||||
<view slot="body">
|
||||
<u-row>
|
||||
<u-col span="6">
|
||||
<view>数量:{{ MATERIALQUANTITY || '0' }}</view>
|
||||
</u-col>
|
||||
<u-col span="6">
|
||||
<view>标签数:{{ JS || '0' }}</view>
|
||||
</u-col>
|
||||
</u-row>
|
||||
</view>
|
||||
</u-card>
|
||||
<view>
|
||||
<u-input v-if="false" v-model="opCode" />
|
||||
<uni-datetime-picker style="align-items: center;" type="date" :default-date="timeDate"
|
||||
:clear-icon="false" v-model="commitDate" @maskClick="maskClick" />
|
||||
<u-button @click="FGStockIn" type="primary" :loading="loading">确定</u-button>
|
||||
</view>
|
||||
</u-form>
|
||||
<br />
|
||||
<view class="search-box">
|
||||
<input type="text" placeholder="请输入搜索批次" v-model="searchBatch" class="search-input" />
|
||||
</view>
|
||||
<u-modal :show="showModal" :title="titleModal" :content='contentModal'></u-modal>
|
||||
<view class="container" style="height: 800upx;">
|
||||
|
||||
<view v-for="(item, index) in BoxListInfo" :key="item.id" class="list-item"
|
||||
:class="{ 'swiped': isSwiped[index], 'swiping': isSwiping[index] }"
|
||||
@touchstart="handleTouchStart(index, $event)" @touchmove="handleTouchMove(index, $event)"
|
||||
@touchend="handleTouchEnd(index, $event)">
|
||||
|
||||
<view :class="setVisableCharge( item.CHARGE )">
|
||||
<view>
|
||||
<div>
|
||||
<text class="card-description"> 批次: {{ item.CHARGE }}</text>
|
||||
</div>
|
||||
<div>
|
||||
<text class="card-description"> 料号: {{ item.MATERIALSPECNAME }}</text>
|
||||
<text class="card-description"> 阶段: {{ item.PHASE }}</text>
|
||||
<text class="card-description"> SDK规格: {{ item.SPECNAME }}</text>
|
||||
</div>
|
||||
<div>
|
||||
<text class="card-description"> 品名: {{ item.DESC_CN }}</text>
|
||||
</div>
|
||||
<div>
|
||||
<text class="card-description"> 实际规格: {{ item.TRUEGG }}</text>
|
||||
</div>
|
||||
<div>
|
||||
<text class="card-description"> 仓库: {{ item.ERPLOCATION }}</text>
|
||||
</div>
|
||||
<div>
|
||||
<text class="card-description"> 货位: {{ item.LOCATIONNAME }}</text>
|
||||
</div>
|
||||
<div>
|
||||
<text class="card-description"> 数量: {{ item.MATERIALQUANTITY }} {{ item.UNIT }}</text>
|
||||
</div>
|
||||
</view>
|
||||
<!-- <view class="delete-btn" @click="deleteItem(item, index)" v-if="showDeleteBtn === index">删除</view> -->
|
||||
<button class="delete-button" @click="deleteItem(item, index)" >删除</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
<script>
|
||||
import zxzUniDataSelect from "@/components/zxz-uni-data-select/zxz-uni-data-select.vue"
|
||||
import {
|
||||
getOpCode
|
||||
} from '@/common/api.js';
|
||||
import navVar from "@/components/navBar/navBar.vue"
|
||||
export default {
|
||||
components: {
|
||||
zxzUniDataSelect,
|
||||
navVar
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
sumList: [],
|
||||
column: [ //列
|
||||
{
|
||||
name: 'RECEIVEREQUESTNAME',
|
||||
label: '单号'
|
||||
},
|
||||
{
|
||||
name: 'MATERIALSPECNAME',
|
||||
label: '料号'
|
||||
},
|
||||
{
|
||||
name: 'SDK_ID',
|
||||
label: '规格'
|
||||
}, {
|
||||
name: 'AREANAME',
|
||||
label: '阶段'
|
||||
},
|
||||
{
|
||||
name: 'QTY',
|
||||
label: '计划数量'
|
||||
},
|
||||
{
|
||||
name: 'REQTY',
|
||||
label: '剩余数量'
|
||||
},
|
||||
],
|
||||
showModal: false,
|
||||
titleModal: "提示",
|
||||
contentModal: '是否确定返回?',
|
||||
navConfig: {
|
||||
navBarHeight: "500rpx",
|
||||
navPadding: false,
|
||||
isHome: false,
|
||||
navPadding: true,
|
||||
navFixed: true,
|
||||
bgImage: 'linear-gradient(45deg, rgb(28, 187, 180), rgb(141, 198, 63))',
|
||||
isCustomFn: true,
|
||||
navTitle: {
|
||||
text: "成品入库",
|
||||
color: "rgb(96, 98, 102)",
|
||||
fontSize: "14px", // px upx rpx
|
||||
fontWeight: "normal", // blod
|
||||
},
|
||||
leftText: {
|
||||
text: "返回",
|
||||
color: "rgb(96, 98, 102)",
|
||||
fontSize: "14px", // px upx rpx
|
||||
fontWeight: "", // blod
|
||||
},
|
||||
leftIconPath: '../../../../static/img/back.png'
|
||||
},
|
||||
RECEIVEREQUESTNAME: "",
|
||||
MATERIALQUANTITY: 0,
|
||||
items_In: [],
|
||||
items_En: [],
|
||||
INITILATION: '', //起始点
|
||||
ENDING: '', //目的地
|
||||
AB: '', //AB轴
|
||||
DURABLENAMECode: '', //卷芯
|
||||
AreaName: '',
|
||||
Area: [],
|
||||
value: '',
|
||||
show: false,
|
||||
AGVshow: false,
|
||||
orgObject: {
|
||||
ERPFACTORY: '',
|
||||
DESCRIPTION: ''
|
||||
}, // 组织对象
|
||||
datamodel: '',
|
||||
LocationName: '', //库位信息
|
||||
LOCATIONNAME: '',
|
||||
ERPFACTORY: JSON.parse(uni.getStorageSync('orgObject')).ERPFACTORY, //组织
|
||||
ERPLOCATION: '', //库位
|
||||
tabH: 800, //表格的宽度
|
||||
MATERIALSPECNAME: '',
|
||||
MATERIALPACKINGNAME: '470112930|1|C|600mm*600m|SH1103A001A20241026A004|20241026|11|2520', //条码
|
||||
MATERIALPACKINGNAME2: '', //条码
|
||||
CHARGE: '', //批次
|
||||
DESC_CN: '', //品名
|
||||
SPECNAME: '', //规格
|
||||
SDK_ID: '', //规格ID
|
||||
RECEIVEACTNO: '', //入库单号
|
||||
UNIT: '', //单位
|
||||
PHASE: '', //阶段
|
||||
QTY: '', //数量
|
||||
JS: 0, //卷数
|
||||
background: {
|
||||
backgroundImage: 'linear-gradient(45deg, rgb(28, 187, 180), rgb(141, 198, 63))'
|
||||
}, //返回按钮的样式
|
||||
colors: ['#007aff', '#4cd964', '#dd524d'],
|
||||
styleType: 'button',
|
||||
current: 0,
|
||||
BoxListInfo: [], //后端传回来的绑定表格的数据
|
||||
colorIndex: 0,
|
||||
activeColor: '#007aff',
|
||||
loading: false,
|
||||
scanData: [], //已扫描箱
|
||||
barCode: "", //条码
|
||||
focusBarCode: false, //焦点是否被选中
|
||||
focusShipRequest: true, //默认焦点在单号
|
||||
siteName: "",
|
||||
userId: "",
|
||||
items: [],
|
||||
items_Location: [],
|
||||
commitDate: '',
|
||||
items_LocationAll: [],
|
||||
timeDate: '',
|
||||
opCode: '',
|
||||
startX: [], // 存储触摸开始时的X坐标
|
||||
isSwiping: [], // 标记是否正在滑动
|
||||
isSwiped: [], // 标记是否已滑动以显示删除按钮
|
||||
showDeleteBtn: null, // 显示删除按钮的索引
|
||||
isCollapsed: false, // 默认为展开状态
|
||||
searchBatch: '', //搜索的批次
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.tabH = this.$GetRemainingHeight(4, 0); //定义表格的高度
|
||||
let that = this
|
||||
uni.getStorage({
|
||||
key: "sitename",
|
||||
success(res) {
|
||||
that.siteName = res.data
|
||||
}
|
||||
})
|
||||
uni.getStorage({
|
||||
key: "userid",
|
||||
success(res) {
|
||||
that.userId = res.data
|
||||
}
|
||||
})
|
||||
|
||||
this.orgObject = JSON.parse(uni.getStorageSync('orgObject'))
|
||||
this.getERPLocation();
|
||||
// this.GetLiberaryBaeIn()
|
||||
// this.GetLiberaryBaeEn()
|
||||
this.getTimeData();
|
||||
},
|
||||
created() {
|
||||
// 初始化数组长度与items相同
|
||||
this.startX = new Array(1).fill(0);
|
||||
|
||||
this.isSwiping = new Array(1).fill(false);
|
||||
this.isSwiped = new Array(1).fill(false);
|
||||
console.log(this.startX + ":" + this.isSwiping + ":" + this.isSwiped)
|
||||
},
|
||||
methods: {
|
||||
//折叠
|
||||
toggle() {
|
||||
this.isCollapsed = !this.isCollapsed;
|
||||
},
|
||||
//隐藏展示批次
|
||||
setVisableCharge(iCharge) {
|
||||
if (this.searchBatch == '') {
|
||||
return 'card-display'
|
||||
} else {
|
||||
if (iCharge.includes(this.searchBatch)) {
|
||||
return 'card-dispaly'
|
||||
} else {
|
||||
return 'card-hidden'
|
||||
}
|
||||
}
|
||||
},
|
||||
getTimeData() {
|
||||
var year = new Date().getFullYear(); //年
|
||||
if (year < 1900) year = year + 1900;
|
||||
var month = new Date().getMonth() + 1; //月
|
||||
if (month < 10) month = '0' + month;
|
||||
var day = new Date().getDate(); //日
|
||||
if (day < 10) day = '0' + day;
|
||||
const calendar1 = year + '-' + month + '-' + day
|
||||
this.commitDate = calendar1
|
||||
},
|
||||
maskClick(e) {
|
||||
console.log('maskClick事件:', e);
|
||||
},
|
||||
onLeftClick() {
|
||||
uni.showModal({
|
||||
title: this.titleModal, // 模态框标题
|
||||
content: this.contentModal, // 模态框内容
|
||||
showCancel: true, // 是否显示取消按钮,默认为true
|
||||
cancelText: '取消', // 取消按钮的文字
|
||||
confirmText: '确定', // 确定按钮的文字
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
uni.navigateBack({
|
||||
delta: 1 // 返回的页面数,如果 delta 大于现有页面数,则返回到首页
|
||||
});
|
||||
console.log('用户点击了确定');
|
||||
// 执行确认后的逻辑
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击了取消');
|
||||
// 执行取消后的逻辑
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
handleTouchStart(index, event) {
|
||||
this.startX[index] = event.touches[0].clientX;
|
||||
this.isSwiping[index] = false;
|
||||
this.isSwiped[index] = false;
|
||||
},
|
||||
handleTouchMove(index, event) {
|
||||
const currentX = event.touches[0].clientX;
|
||||
const diffX = currentX - this.startX[index];
|
||||
|
||||
// 根据滑动方向更新状态
|
||||
if (diffX < -50 && !this.isSwiped[index]) { // 假设50px是触发删除的阈值
|
||||
console.log(diffX)
|
||||
this.isSwiping[index] = true;
|
||||
this.isSwiped[index] = true;
|
||||
} else {
|
||||
this.isSwiping[index] = false;
|
||||
// 如果手指松开时未超过阈值,则不保持swiped状态
|
||||
if (!this.isSwipingOnEnd(index, event)) {
|
||||
this.isSwiped[index] = false;
|
||||
}
|
||||
}
|
||||
},
|
||||
handleTouchEnd(index, event) {
|
||||
console.log("2")
|
||||
// 检查是否在滑动结束时仍然处于滑动状态
|
||||
this.isSwipingOnEnd(index, event);
|
||||
// 重置isSwiping状态
|
||||
this.isSwiping[index] = false;
|
||||
},
|
||||
isSwipingOnEnd(index, event) {
|
||||
console.log("111111")
|
||||
// 这里可以添加逻辑来判断是否在滑动结束时仍然超过了阈值
|
||||
// 但由于我们已经在handleTouchMove中处理了,所以这里可以简单地返回isSwiped的状态
|
||||
return this.isSwiped[index];
|
||||
},
|
||||
|
||||
deleteItem(row, index) {
|
||||
console.log("***********" + index)
|
||||
this.BoxListInfo.splice(index, 1)
|
||||
this.MATERIALQUANTITY = this.MATERIALQUANTITY - row.MATERIALQUANTITY
|
||||
this.JS = this.JS - 1
|
||||
if (this.BoxListInfo.length > 0) {
|
||||
for (let i = 0; i < this.sumList.length; i++) {
|
||||
if (this.BoxListInfo.every(el => el.RECEIVEREQUESTNAME != this.sumList[i].RECEIVEREQUESTNAME)) {
|
||||
this.sumList.splice(i, 1)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.sumList = []
|
||||
}
|
||||
this.deletingIndex = null;
|
||||
this.$showMessage("删除成功")
|
||||
},
|
||||
|
||||
change(e) {
|
||||
this.ERPLOCATION = e.value;
|
||||
this.LOCATIONNAME = ""
|
||||
this.getLocationName();
|
||||
},
|
||||
//获取焦点的公共方法
|
||||
getfocus(nextfocus) {
|
||||
this.initfocus()
|
||||
this[nextfocus]
|
||||
this.$nextTick(() => { //vue是数据全部修改后才进行的视图更新,哪nextTick函数就是为了拿到最新的数据,还不懂的可以去百度
|
||||
this[nextfocus] = true
|
||||
})
|
||||
},
|
||||
getERPLocation() {
|
||||
this.items = [];
|
||||
this.$MyRequest('/api/storage/getERPLocation', {
|
||||
ERPFACTORYNAME: this.ERPFACTORY
|
||||
}).then(res => {
|
||||
if (res.data.success) {
|
||||
for (let i = 0; i < res.data.resultObj.length; i++) {
|
||||
var _Arr = res.data.resultObj[i];
|
||||
this.items.push({
|
||||
text: _Arr.DESCRIPTION,
|
||||
value: _Arr.ERPLOCATIONNAME
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.$showMessage(res.data.message)
|
||||
}
|
||||
});
|
||||
},
|
||||
getLocationName() {
|
||||
this.items_Location = []
|
||||
if (this.ERPLOCATION != '') {
|
||||
this.$MyRequest('/api/storage/getLocationNameForERPLocation', {
|
||||
ERPLocation: this.ERPLOCATION
|
||||
}).then(res => {
|
||||
if (res.data.success) {
|
||||
for (let i = 0; i < res.data.resultObj.length; i++) {
|
||||
var _Arr = res.data.resultObj[i];
|
||||
this.items_LocationAll.push({
|
||||
text: _Arr.DESCRIPTION,
|
||||
value: _Arr.STORAGENAME
|
||||
});
|
||||
|
||||
}
|
||||
this.getitems_LocationAll('');
|
||||
} else {
|
||||
this.$showMessage(res.data.message)
|
||||
}
|
||||
this.focusBarCode = true
|
||||
this.focusShipRequest = false
|
||||
}).catch(err => {
|
||||
this.$showMessage(err)
|
||||
});
|
||||
} else {
|
||||
this.$showMessage("请先选择仓库")
|
||||
}
|
||||
|
||||
},
|
||||
getitems_LocationAll(query) {
|
||||
console.log(query + "&&&&&&&&&&&&&&")
|
||||
var arr = this.items_LocationAll.filter(item => {
|
||||
return (item.text.includes(query)) || (item.value.includes(query))
|
||||
})
|
||||
if (arr.length > 50) {
|
||||
this.items_Location = arr.slice(0, 50)
|
||||
} else {
|
||||
this.items_Location = arr
|
||||
}
|
||||
console.log(this.items_Location)
|
||||
},
|
||||
//扫描成品入库条码
|
||||
ScanFGBarCode() {
|
||||
this.focusBarCode = false;
|
||||
if (this.BoxListInfo.some(box => box.MATERIALPACKINGNAME === this.MATERIALPACKINGNAME)) {
|
||||
this.$showMessage("改标签已扫描,请不要重复扫描!");
|
||||
this.$nextTick(() => {
|
||||
this.MATERIALPACKINGNAME = ""
|
||||
this.focusBarCode = true
|
||||
this.focusShipRequest = false
|
||||
})
|
||||
this.$playFail()
|
||||
return;
|
||||
}
|
||||
if (this.LOCATIONNAME == null || this.LOCATIONNAME == "") {
|
||||
this.$showMessage("请选择货位!");
|
||||
this.$nextTick(() => {
|
||||
this.MATERIALPACKINGNAME = ""
|
||||
this.focusBarCode = true
|
||||
this.focusShipRequest = false
|
||||
})
|
||||
this.$playFail()
|
||||
return;
|
||||
}
|
||||
if (this.ERPFACTORY == null || this.ERPFACTORY == "") {
|
||||
this.$showMessage("请选择组织!");
|
||||
this.$nextTick(() => {
|
||||
this.MATERIALPACKINGNAME = ""
|
||||
this.focusBarCode = true
|
||||
this.focusShipRequest = false
|
||||
})
|
||||
this.$playFail()
|
||||
return;
|
||||
}
|
||||
if (this.ERPLOCATION == null || this.ERPLOCATION == "") {
|
||||
this.$showMessage("请选择仓库!");
|
||||
this.$nextTick(() => {
|
||||
this.MATERIALPACKINGNAME = ""
|
||||
this.focusBarCode = true
|
||||
this.focusShipRequest = false
|
||||
})
|
||||
this.$playFail()
|
||||
return;
|
||||
}
|
||||
var barCodeArr = this.MATERIALPACKINGNAME.split("|");
|
||||
// 470110856|1|C|75mm*1000m|SHBP01JT1202305240009|20230524|11|75
|
||||
if (barCodeArr.length < 7) {
|
||||
this.$showMessage("条码规则不符合需求!")
|
||||
this.$nextTick(() => {
|
||||
this.MATERIALPACKINGNAME = ""
|
||||
this.focusBarCode = true
|
||||
this.focusShipRequest = false
|
||||
})
|
||||
this.$playFail()
|
||||
return;
|
||||
}
|
||||
let orderList = this.sumList.map(item => item.RECEIVEREQUESTNAME)
|
||||
this.$MyRequest('/FGStockIn/getBarCode', {
|
||||
MATERIALPACKINGNAME: this.MATERIALPACKINGNAME,
|
||||
ERPFACTORY: this.ERPFACTORY,
|
||||
ERPLOCATION: this.ERPLOCATION,
|
||||
LOCATIONNAME: this.LOCATIONNAME,
|
||||
MATERIALSPECNAME: barCodeArr[0],
|
||||
user: this.userId,
|
||||
// commitDate : this.commitDate,
|
||||
}).then(res => {
|
||||
if (res.data.success) {
|
||||
console.log(res.data.resultObj[0])
|
||||
this.BoxListInfo.push(res.data.resultObj[0]);
|
||||
this.JS = 0
|
||||
this.MATERIALQUANTITY = 0
|
||||
this.sumList = [];
|
||||
for (let i = 0; i < this.BoxListInfo.length; i++) {
|
||||
this.JS = parseFloat(this.JS) + 1
|
||||
this.MATERIALQUANTITY = parseFloat(this.MATERIALQUANTITY) + parseFloat(this
|
||||
.BoxListInfo[i].MATERIALQUANTITY)
|
||||
if (this.sumList.every(el => el.RECEIVEREQUESTNAME != this.BoxListInfo[i]
|
||||
.RECEIVEREQUESTNAME)) {
|
||||
this.sumList.push(this.BoxListInfo[i])
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
Vue.prototype.$playSuccess()
|
||||
} catch (e) {}
|
||||
|
||||
} else {
|
||||
this.$showMessage(res.data.message)
|
||||
this.MATERIALPACKINGNAME = ""
|
||||
this.$playFail()
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.MATERIALPACKINGNAME = ""
|
||||
this.focusBarCode = true
|
||||
this.focusShipRequest = false
|
||||
})
|
||||
}).catch(err => {
|
||||
this.$showMessage(err)
|
||||
this.$nextTick(() => {
|
||||
this.MATERIALPACKINGNAME = ""
|
||||
this.focusBarCode = true
|
||||
this.focusShipRequest = false
|
||||
})
|
||||
this.$playFail()
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 入库审核
|
||||
*/
|
||||
FGStockIn() {
|
||||
console.log(this.commitDate)
|
||||
if (this.BoxListInfo.length > 0) {
|
||||
console.log(this.commitDate)
|
||||
this.loading = true;
|
||||
// if(this.commitDate == ''){
|
||||
// this.commitDate = this.timeDate
|
||||
// }
|
||||
console.log(this.commitDate)
|
||||
this.BoxListInfo.map(item => delete item.key)
|
||||
getOpCode({
|
||||
opcode: this.opCode,
|
||||
user: this.userId
|
||||
}).then((res) => {
|
||||
console.log(res.resultObj)
|
||||
this.opCode = res.resultObj
|
||||
this.$MyRequest('/FGStockIn/FGStockIn', {
|
||||
boxList: this.BoxListInfo,
|
||||
user: this.userId,
|
||||
opcode: this.opCode,
|
||||
commitDate: this.commitDate
|
||||
}).then(res => {
|
||||
if (res.data.success) {
|
||||
this.opCode = '';
|
||||
this.loading = false;
|
||||
if (this.value == 'true') {
|
||||
if (this.AGVshow == true) {
|
||||
this.SendTransportTask()
|
||||
} else {
|
||||
this.SendTransportTaskNOAGV()
|
||||
}
|
||||
}
|
||||
this.loading = false;
|
||||
this.resetValue();
|
||||
this.$showMessage(res.data.message)
|
||||
} else {
|
||||
this.loading = false;
|
||||
this.$showMessage(res.data.message)
|
||||
}
|
||||
this.focusBarCode = true
|
||||
this.focusShipRequest = false
|
||||
}).catch(err => {
|
||||
this.loading = false;
|
||||
this.$showMessage(err)
|
||||
});
|
||||
})
|
||||
} else {
|
||||
this.$showMessage("入库数量为空!")
|
||||
}
|
||||
},
|
||||
|
||||
resetValue() {
|
||||
this.opCode = "";
|
||||
this.MATERIALPACKINGNAME = "";
|
||||
this.BoxListInfo = [];
|
||||
this.RECEIVEACTNO = "";
|
||||
this.MATERIALSPECNAME = "";
|
||||
this.PHASE = "";
|
||||
this.SPECNAME = "";
|
||||
this.DESC_CN = "";
|
||||
this.CHARGE = "";
|
||||
this.MATERIALQUANTITY = 0;
|
||||
this.JS = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
switch {
|
||||
color: #FFCC33;
|
||||
}
|
||||
|
||||
u-form-item {
|
||||
margin: 5rpx;
|
||||
padding: 5rpx;
|
||||
}
|
||||
|
||||
/* 基础样式 */
|
||||
.picker {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
width: 100%;
|
||||
/* 根据需要调整宽度 */
|
||||
}
|
||||
|
||||
.row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 10px;
|
||||
/* 行与行之间的间距 */
|
||||
}
|
||||
|
||||
.col {
|
||||
flex: 1;
|
||||
/* 使得每列占据相等的空间 */
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
label {
|
||||
// font-weight: bold;
|
||||
/* 标签加粗 */
|
||||
margin-bottom: 5px;
|
||||
/* 标签和值之间的间距 */
|
||||
}
|
||||
|
||||
.value {
|
||||
/* 值的样式,可以根据需要调整 */
|
||||
}
|
||||
|
||||
.container {
|
||||
|
||||
padding: 10px;
|
||||
|
||||
}
|
||||
|
||||
.list-item {
|
||||
|
||||
margin-top: 16px;
|
||||
/* 卡片之间的间距 */
|
||||
// padding: 12px;
|
||||
/* 卡片内部的内边距 */
|
||||
background-color: #aaaa7f;
|
||||
/* 卡片背景色 */
|
||||
border-radius: 8px;
|
||||
/* 卡片边框圆角 */
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
/* 卡片阴影效果 */
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
/* 根据您的布局需求调整 */
|
||||
overflow: hidden;
|
||||
/* 防止内容溢出 */
|
||||
position: relative;
|
||||
/* 用于定位删除按钮 */
|
||||
}
|
||||
|
||||
// .item-content {
|
||||
// flex: 1;
|
||||
// padding-left: 10px;
|
||||
|
||||
// }
|
||||
.card-display {
|
||||
flex: 1;
|
||||
// padding-left: 10px;
|
||||
display: flex;
|
||||
// margin-bottom: 16px;
|
||||
/* 卡片之间的间距 */
|
||||
// padding: 12px;
|
||||
/* 卡片内部的内边距 */
|
||||
background-color: #aaaa7f;
|
||||
/* 卡片背景色 */
|
||||
// border-radius: 8px;
|
||||
/* 卡片边框圆角 */
|
||||
// box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
/* 卡片阴影效果 */
|
||||
}
|
||||
|
||||
.card-description {
|
||||
margin: 5rpx;
|
||||
}
|
||||
|
||||
.card-hidden {
|
||||
flex: 1;
|
||||
// padding-left: 10px;
|
||||
display: none;
|
||||
// margin-bottom: 16px;
|
||||
// /* 卡片之间的间距 */
|
||||
// padding: 12px;
|
||||
// /* 卡片内部的内边距 */
|
||||
// background-color: #aaaa7f;
|
||||
// /* 卡片背景色 */
|
||||
// border-radius: 8px;
|
||||
// /* 卡片边框圆角 */
|
||||
// box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
/* 卡片阴影效果 */
|
||||
}
|
||||
|
||||
.list-item.swiped {
|
||||
transform: translateX(-80px);
|
||||
/* 滑动后偏移量,根据删除按钮宽度调整 */
|
||||
}
|
||||
|
||||
.delete-button {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
/* 放置在右侧 */
|
||||
bottom: 0;
|
||||
width: 80px;
|
||||
/* 根据需要调整宽度 */
|
||||
background-color: red;
|
||||
color: white;
|
||||
border: none;
|
||||
text-align: center;
|
||||
line-height: 100%;
|
||||
/* 垂直居中 */
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transform: translateX(100%);
|
||||
/* 初始时完全在视图外 */
|
||||
// transition: transform 0.3s ease;
|
||||
/* 平滑过渡 */
|
||||
}
|
||||
|
||||
.list-item.swiped .delete-button {
|
||||
transform: translateX(10%);
|
||||
/* 滑动后显示删除按钮 */
|
||||
}
|
||||
|
||||
.swipe-overlay {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
z-index: 1;
|
||||
/* 确保覆盖在内容之上 */
|
||||
}
|
||||
|
||||
.collapsed {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
@ -15,16 +15,16 @@
|
||||
<u-form-item :border-bottom="false">
|
||||
<label>选择库位:</label>
|
||||
<zxzUniDataSelect filterable v-model="LOCATIONNAME" :localdata="items_Location"
|
||||
@filter="getitems_LocationAll"></zxzUniDataSelect>
|
||||
@inputChange="getitems_LocationAll" @change="changeLocationName"></zxzUniDataSelect>
|
||||
</u-form-item>
|
||||
<zb-table style="height: 200upx;" ref="zbTable" :show-header="true" :columns="column" :stripe="true"
|
||||
:fit="true" :highlight="true" :border="true" :data="sumList"></zb-table>
|
||||
</view>
|
||||
|
||||
<!-- <view class="header" @click="toggle">
|
||||
|
||||
<!-- <view class="header" @click="toggle">
|
||||
<text style="width: 100%; text-align: center; align-self: center; display: flex; background-color:#777777">点击折叠/展开</text>
|
||||
</view> -->
|
||||
|
||||
|
||||
<u-form-item :border-bottom="false">
|
||||
<p>扫描条码:</p>
|
||||
<u-input :border="true" v-model="MATERIALPACKINGNAME" placeholder="请扫描条码" :focus="focusBarCode"
|
||||
@ -48,51 +48,50 @@
|
||||
<u-input v-if="false" v-model="opCode" />
|
||||
<uni-datetime-picker style="align-items: center;" type="date" :default-date="timeDate"
|
||||
:clear-icon="false" v-model="commitDate" @maskClick="maskClick" />
|
||||
<u-button @click="FGStockIn" type="primary" :loading="loading" >确定</u-button>
|
||||
<u-button @click="FGStockIn" type="primary" :loading="loading">确定</u-button>
|
||||
</view>
|
||||
</u-form>
|
||||
<br />
|
||||
<view class="search-box">
|
||||
<input
|
||||
type="text"
|
||||
placeholder="请输入搜索批次"
|
||||
v-model="searchBatch"
|
||||
class="search-input"
|
||||
/>
|
||||
</view>
|
||||
<view class="search-box">
|
||||
<input type="text" placeholder="请输入搜索批次" v-model="searchBatch" class="search-input" />
|
||||
</view>
|
||||
<u-modal :show="showModal" :title="titleModal" :content='contentModal'></u-modal>
|
||||
<view class="container" style="height: 800upx;">
|
||||
<view class="list-item" v-for="(item, index) in BoxListInfo" :key="item.id"
|
||||
@touchstart="onTouchStart(index, $event)" @touchmove="onTouchMove(index, $event)"
|
||||
@touchend="onTouchEnd(item,index, $event)" :style="getItemStyle(index)">
|
||||
|
||||
<view :class="setVisableCharge( item.CHARGE )">
|
||||
<view :class="setVisableCharge( item.CHARGE )">
|
||||
<view>
|
||||
<div>
|
||||
<text class="card-description"> 批次: {{ item.CHARGE }}</text>
|
||||
</div>
|
||||
<div>
|
||||
<text class="card-description"> 料号: {{ item.MATERIALSPECNAME }}</text>
|
||||
<text class="card-description"> 阶段: {{ item.PHASE }}</text>
|
||||
<text class="card-description"> SDK规格: {{ item.SPECNAME }}</text>
|
||||
</div>
|
||||
<div>
|
||||
<text class="card-description"> 品名: {{ item.DESC_CN }}</text>
|
||||
</div>
|
||||
<div>
|
||||
<text class="card-description"> 实际规格: {{ item.TRUEGG }}</text>
|
||||
</div>
|
||||
<div>
|
||||
<text class="card-description"> 仓库: {{ item.ERPLOCATION }}</text>
|
||||
</div>
|
||||
<div>
|
||||
<text class="card-description"> 货位: {{ item.LOCATIONNAME }}</text>
|
||||
</div>
|
||||
<div>
|
||||
<text class="card-description"> 数量: {{ item.MATERIALQUANTITY }} {{ item.UNIT }}</text>
|
||||
</div>
|
||||
</view>
|
||||
<view class="delete-btn" @click="deleteItem(item, index)" v-if="showDeleteBtn === index">删除</view>
|
||||
<div>
|
||||
<text class="card-description"> 批次: {{ item.CHARGE }}</text>
|
||||
</div>
|
||||
<div>
|
||||
<text class="card-description"> 料号: {{ item.MATERIALSPECNAME }}</text>
|
||||
<text class="card-description"> 阶段: {{ item.PHASE }}</text>
|
||||
<text class="card-description"> SDK规格: {{ item.SPECNAME }}</text>
|
||||
</div>
|
||||
<div>
|
||||
<text class="card-description"> 品名: {{ item.DESC_CN }}</text>
|
||||
</div>
|
||||
<div>
|
||||
<text class="card-description"> 实际规格: {{ item.TRUEGG }}</text>
|
||||
</div>
|
||||
<div>
|
||||
<text class="card-description"> 仓库: {{ item.ERPLOCATION }}</text>
|
||||
</div>
|
||||
<div>
|
||||
<text class="card-description"> 货位: {{ item.LOCATIONNAME }}</text>
|
||||
</div>
|
||||
<div>
|
||||
<text class="card-description"> 数量: {{ item.MATERIALQUANTITY }} {{ item.UNIT }}</text>
|
||||
</div>
|
||||
|
||||
<div class="button-group" style="margin: 5rpx; align: center;">
|
||||
<u-button type="primary" size="mini" @click="deleteItem(item, index)">删除</u-button>
|
||||
</div>
|
||||
</view>
|
||||
<!-- <view class="delete-btn" @click="deleteItem(item, index)" >删除</view> -->
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -106,6 +105,9 @@
|
||||
import {
|
||||
getOpCode
|
||||
} from '@/common/api.js';
|
||||
import {
|
||||
cals
|
||||
} from '@/utils/cal'
|
||||
import navVar from "@/components/navBar/navBar.vue"
|
||||
export default {
|
||||
components: {
|
||||
@ -226,8 +228,9 @@
|
||||
endX: 0, // 触摸结束时的X坐标
|
||||
isMoving: false, // 是否正在滑动
|
||||
showDeleteBtn: null, // 显示删除按钮的索引
|
||||
isCollapsed: false ,// 默认为展开状态
|
||||
searchBatch : '',//搜索的批次
|
||||
isCollapsed: false, // 默认为展开状态
|
||||
searchBatch: '', //搜索的批次
|
||||
lockInput:true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -248,6 +251,7 @@
|
||||
|
||||
this.orgObject = JSON.parse(uni.getStorageSync('orgObject'))
|
||||
this.getERPLocation();
|
||||
//this.getLocationName();
|
||||
// this.GetLiberaryBaeIn()
|
||||
// this.GetLiberaryBaeEn()
|
||||
this.getTimeData();
|
||||
@ -258,7 +262,7 @@
|
||||
this.isCollapsed = !this.isCollapsed;
|
||||
},
|
||||
//隐藏展示批次
|
||||
setVisableCharge (iCharge) {
|
||||
setVisableCharge(iCharge) {
|
||||
if (this.searchBatch == '') {
|
||||
return 'card-display'
|
||||
} else {
|
||||
@ -314,7 +318,7 @@
|
||||
onTouchMove(index, event) {
|
||||
this.endX = event.touches[0].clientX;
|
||||
if (this.startX - this.endX > 50) { // 判断滑动距离,可以根据需要调整
|
||||
console.log("222")
|
||||
console.log("222")
|
||||
this.isMoving = true;
|
||||
this.showDeleteBtn = index;
|
||||
} else if (this.endX - this.startX > 50) {
|
||||
@ -384,6 +388,9 @@
|
||||
this.LOCATIONNAME = ""
|
||||
this.getLocationName();
|
||||
},
|
||||
changeLocationName(e) {
|
||||
this.LOCATIONNAME = e.value;
|
||||
},
|
||||
//获取焦点的公共方法
|
||||
getfocus(nextfocus) {
|
||||
this.initfocus()
|
||||
@ -412,31 +419,29 @@
|
||||
},
|
||||
getLocationName() {
|
||||
this.items_Location = []
|
||||
if (this.ERPLOCATION != '') {
|
||||
this.$MyRequest('/api/storage/getLocationNameForERPLocation', {
|
||||
ERPLocation: this.ERPLOCATION
|
||||
}).then(res => {
|
||||
if (res.data.success) {
|
||||
for (let i = 0; i < res.data.resultObj.length; i++) {
|
||||
var _Arr = res.data.resultObj[i];
|
||||
this.items_LocationAll.push({
|
||||
text: _Arr.DESCRIPTION,
|
||||
value: _Arr.STORAGENAME
|
||||
});
|
||||
|
||||
}
|
||||
this.getitems_LocationAll('');
|
||||
} else {
|
||||
this.$showMessage(res.data.message)
|
||||
this.items_LocationAll = []
|
||||
let ERPFACTORY = JSON.parse(uni.getStorageSync('orgObject')).ERPFACTORY;
|
||||
this.$MyRequest('/api/storage/getLocationNameForERPLocation', {
|
||||
ERPLocation: this.ERPLOCATION
|
||||
}).then(res => {
|
||||
if (res.data.success) {
|
||||
for (let i = 0; i < res.data.resultObj.length; i++) {
|
||||
var _Arr = res.data.resultObj[i];
|
||||
this.items_LocationAll.push({
|
||||
text: _Arr.DESCRIPTION,
|
||||
value: _Arr.STORAGENAME
|
||||
});
|
||||
}
|
||||
this.focusBarCode = true
|
||||
this.focusShipRequest = false
|
||||
}).catch(err => {
|
||||
this.$showMessage(err)
|
||||
});
|
||||
} else {
|
||||
this.$showMessage("请先选择仓库")
|
||||
}
|
||||
console.log(this.items_LocationAll)
|
||||
this.getitems_LocationAll('');
|
||||
} else {
|
||||
this.$showMessage(res.data.message)
|
||||
}
|
||||
this.focusBarCode = true
|
||||
this.focusShipRequest = false
|
||||
}).catch(err => {
|
||||
this.$showMessage(err)
|
||||
});
|
||||
|
||||
},
|
||||
getitems_LocationAll(query) {
|
||||
@ -444,117 +449,129 @@
|
||||
var arr = this.items_LocationAll.filter(item => {
|
||||
return (item.text.includes(query)) || (item.value.includes(query))
|
||||
})
|
||||
if (arr.length > 50) {
|
||||
this.items_Location = arr.slice(0, arr.length)
|
||||
/* if (arr.length > 50) {
|
||||
this.items_Location = arr.slice(0, 50)
|
||||
} else {
|
||||
this.items_Location = arr
|
||||
}
|
||||
} */
|
||||
console.log(this.items_Location)
|
||||
},
|
||||
//扫描成品入库条码
|
||||
ScanFGBarCode() {
|
||||
this.focusBarCode = false;
|
||||
if (this.BoxListInfo.some(box => box.MATERIALPACKINGNAME === this.MATERIALPACKINGNAME)) {
|
||||
this.$showMessage("改标签已扫描,请不要重复扫描!");
|
||||
this.$nextTick(() => {
|
||||
this.MATERIALPACKINGNAME = ""
|
||||
this.focusBarCode = true
|
||||
this.focusShipRequest = false
|
||||
})
|
||||
this.$playFail()
|
||||
return;
|
||||
}
|
||||
if (this.LOCATIONNAME == null || this.LOCATIONNAME == "") {
|
||||
this.$showMessage("请选择货位!");
|
||||
this.$nextTick(() => {
|
||||
this.MATERIALPACKINGNAME = ""
|
||||
this.focusBarCode = true
|
||||
this.focusShipRequest = false
|
||||
})
|
||||
this.$playFail()
|
||||
return;
|
||||
}
|
||||
if (this.ERPFACTORY == null || this.ERPFACTORY == "") {
|
||||
this.$showMessage("请选择组织!");
|
||||
this.$nextTick(() => {
|
||||
this.MATERIALPACKINGNAME = ""
|
||||
this.focusBarCode = true
|
||||
this.focusShipRequest = false
|
||||
})
|
||||
this.$playFail()
|
||||
return;
|
||||
}
|
||||
if (this.ERPLOCATION == null || this.ERPLOCATION == "") {
|
||||
this.$showMessage("请选择仓库!");
|
||||
this.$nextTick(() => {
|
||||
this.MATERIALPACKINGNAME = ""
|
||||
this.focusBarCode = true
|
||||
this.focusShipRequest = false
|
||||
})
|
||||
this.$playFail()
|
||||
return;
|
||||
}
|
||||
var barCodeArr = this.MATERIALPACKINGNAME.split("|");
|
||||
// 470110856|1|C|75mm*1000m|SHBP01JT1202305240009|20230524|11|75
|
||||
if (barCodeArr.length < 7) {
|
||||
this.$showMessage("条码规则不符合需求!")
|
||||
this.$nextTick(() => {
|
||||
this.MATERIALPACKINGNAME = ""
|
||||
this.focusBarCode = true
|
||||
this.focusShipRequest = false
|
||||
})
|
||||
this.$playFail()
|
||||
return;
|
||||
}
|
||||
let orderList = this.sumList.map(item => item.RECEIVEREQUESTNAME)
|
||||
this.$MyRequest('/FGStockIn/getBarCode', {
|
||||
MATERIALPACKINGNAME: this.MATERIALPACKINGNAME,
|
||||
ERPFACTORY: this.ERPFACTORY,
|
||||
ERPLOCATION: this.ERPLOCATION,
|
||||
LOCATIONNAME: this.LOCATIONNAME,
|
||||
MATERIALSPECNAME: barCodeArr[0],
|
||||
user: this.userId,
|
||||
// commitDate : this.commitDate,
|
||||
}).then(res => {
|
||||
if (res.data.success) {
|
||||
console.log(res.data.resultObj[0])
|
||||
this.BoxListInfo.push(res.data.resultObj[0]);
|
||||
this.JS = 0
|
||||
this.MATERIALQUANTITY = 0
|
||||
this.sumList = [];
|
||||
for (let i = 0; i < this.BoxListInfo.length; i++) {
|
||||
this.JS = parseFloat(this.JS) + 1
|
||||
this.MATERIALQUANTITY = parseFloat(this.MATERIALQUANTITY) + parseFloat(this
|
||||
.BoxListInfo[i].MATERIALQUANTITY)
|
||||
if (this.sumList.every(el => el.RECEIVEREQUESTNAME != this.BoxListInfo[i]
|
||||
.RECEIVEREQUESTNAME)) {
|
||||
this.sumList.push(this.BoxListInfo[i])
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
Vue.prototype.$playSuccess()
|
||||
} catch (e) {}
|
||||
|
||||
} else {
|
||||
this.$showMessage(res.data.message)
|
||||
this.MATERIALPACKINGNAME = ""
|
||||
this.opCode = '';
|
||||
if (this.lockInput) {
|
||||
this.lockInput = false;
|
||||
this.focusBarCode = false;
|
||||
if (this.BoxListInfo.some(box => box.MATERIALPACKINGNAME === this.MATERIALPACKINGNAME)) {
|
||||
this.$showMessage("改标签已扫描,请不要重复扫描!");
|
||||
this.$nextTick(() => {
|
||||
this.MATERIALPACKINGNAME = ""
|
||||
this.focusBarCode = true
|
||||
this.focusShipRequest = false
|
||||
this.lockInput = true;
|
||||
})
|
||||
this.$playFail()
|
||||
return;
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.MATERIALPACKINGNAME = ""
|
||||
this.focusBarCode = true
|
||||
this.focusShipRequest = false
|
||||
})
|
||||
}).catch(err => {
|
||||
this.$showMessage(err)
|
||||
this.$nextTick(() => {
|
||||
this.MATERIALPACKINGNAME = ""
|
||||
this.focusBarCode = true
|
||||
this.focusShipRequest = false
|
||||
})
|
||||
this.$playFail()
|
||||
});
|
||||
// if (this.LOCATIONNAME == null || this.LOCATIONNAME == "") {
|
||||
// this.$showMessage("请选择货位!");
|
||||
// this.$nextTick(() => {
|
||||
// this.MATERIALPACKINGNAME = ""
|
||||
// this.focusBarCode = true
|
||||
// this.focusShipRequest = false
|
||||
// })
|
||||
// this.$playFail()
|
||||
// return;
|
||||
// }
|
||||
if (this.ERPFACTORY == null || this.ERPFACTORY == "") {
|
||||
this.$showMessage("请选择组织!");
|
||||
this.$nextTick(() => {
|
||||
this.MATERIALPACKINGNAME = ""
|
||||
this.focusBarCode = true
|
||||
this.focusShipRequest = false
|
||||
this.lockInput = true;
|
||||
})
|
||||
this.$playFail()
|
||||
return;
|
||||
}
|
||||
if (this.ERPLOCATION == null || this.ERPLOCATION == "") {
|
||||
this.$showMessage("请选择仓库!");
|
||||
this.$nextTick(() => {
|
||||
this.MATERIALPACKINGNAME = ""
|
||||
this.focusBarCode = true
|
||||
this.focusShipRequest = false
|
||||
this.lockInput = true;
|
||||
})
|
||||
this.$playFail()
|
||||
return;
|
||||
}
|
||||
var barCodeArr = this.MATERIALPACKINGNAME.split("|");
|
||||
// 470110856|1|C|75mm*1000m|SHBP01JT1202305240009|20230524|11|75
|
||||
if (barCodeArr.length < 7) {
|
||||
this.$showMessage("条码规则不符合需求!")
|
||||
this.$nextTick(() => {
|
||||
this.MATERIALPACKINGNAME = ""
|
||||
this.focusBarCode = true
|
||||
this.focusShipRequest = false
|
||||
this.lockInput = true;
|
||||
})
|
||||
this.$playFail()
|
||||
return;
|
||||
}
|
||||
let orderList = this.sumList.map(item => item.RECEIVEREQUESTNAME)
|
||||
this.$MyRequest('/FGStockIn/getBarCode', {
|
||||
MATERIALPACKINGNAME: this.MATERIALPACKINGNAME,
|
||||
ERPFACTORY: this.ERPFACTORY,
|
||||
ERPLOCATION: this.ERPLOCATION,
|
||||
LOCATIONNAME: this.LOCATIONNAME,
|
||||
MATERIALSPECNAME: barCodeArr[0],
|
||||
user: this.userId,
|
||||
// commitDate : this.commitDate,
|
||||
}).then(res => {
|
||||
if (res.data.success) {
|
||||
console.log(res.data.resultObj[0])
|
||||
this.BoxListInfo.unshift(res.data.resultObj[0]);
|
||||
this.JS = 0
|
||||
this.MATERIALQUANTITY = 0
|
||||
this.sumList = [];
|
||||
for (let i = 0; i < this.BoxListInfo.length; i++) {
|
||||
this.JS = parseFloat(this.JS) + 1
|
||||
this.MATERIALQUANTITY = (cals.add(this.MATERIALQUANTITY, this.BoxListInfo[i]
|
||||
.MATERIALQUANTITY)).toNumber()
|
||||
if (this.sumList.every(el => el.RECEIVEREQUESTNAME != this.BoxListInfo[i]
|
||||
.RECEIVEREQUESTNAME)) {
|
||||
this.sumList.push(this.BoxListInfo[i])
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
Vue.prototype.$playSuccess()
|
||||
} catch (e) {}
|
||||
|
||||
} else {
|
||||
this.$showMessage(res.data.message)
|
||||
this.MATERIALPACKINGNAME = ""
|
||||
this.$playFail()
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.MATERIALPACKINGNAME = ""
|
||||
this.focusBarCode = true
|
||||
this.focusShipRequest = false
|
||||
this.lockInput = true;
|
||||
})
|
||||
}).catch(err => {
|
||||
this.$showMessage(err)
|
||||
this.$nextTick(() => {
|
||||
this.MATERIALPACKINGNAME = ""
|
||||
this.focusBarCode = true
|
||||
this.focusShipRequest = false
|
||||
this.lockInput = true;
|
||||
})
|
||||
this.$playFail()
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@ -569,6 +586,7 @@
|
||||
// if(this.commitDate == ''){
|
||||
// this.commitDate = this.timeDate
|
||||
// }
|
||||
this.opCode = '';
|
||||
console.log(this.commitDate)
|
||||
this.BoxListInfo.map(item => delete item.key)
|
||||
getOpCode({
|
||||
@ -583,7 +601,7 @@
|
||||
opcode: this.opCode,
|
||||
commitDate: this.commitDate
|
||||
}).then(res => {
|
||||
if (res.data.success) {
|
||||
if (res.data.success || res.data.code == 200) {
|
||||
this.opCode = '';
|
||||
this.loading = false;
|
||||
if (this.value == 'true') {
|
||||
@ -681,7 +699,7 @@
|
||||
}
|
||||
|
||||
.list-item {
|
||||
|
||||
|
||||
margin-top: 16px;
|
||||
/* 卡片之间的间距 */
|
||||
// padding: 12px;
|
||||
@ -714,9 +732,11 @@
|
||||
// box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
/* 卡片阴影效果 */
|
||||
}
|
||||
|
||||
.card-description {
|
||||
margin: 5rpx;
|
||||
}
|
||||
|
||||
.card-hidden {
|
||||
flex: 1;
|
||||
// padding-left: 10px;
|
||||
@ -733,19 +753,19 @@
|
||||
/* 卡片阴影效果 */
|
||||
}
|
||||
|
||||
.delete-btn {
|
||||
position: absolute;
|
||||
right: 120;
|
||||
top: 0;
|
||||
width: 120px;
|
||||
height: 100%;
|
||||
background-color: red;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
line-height: 120px; /* 仅当按钮高度固定为120px时使用 */
|
||||
}
|
||||
// .delete-btn {
|
||||
// position: absolute;
|
||||
// right: 120;
|
||||
// top: 0;
|
||||
// width: 120px;
|
||||
// height: 100%;
|
||||
// background-color: red;
|
||||
// color: #fff;
|
||||
// text-align: center;
|
||||
// line-height: 120px; /* 仅当按钮高度固定为120px时使用 */
|
||||
// }
|
||||
|
||||
.collapsed {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
</style>
|
@ -17,8 +17,8 @@
|
||||
<zxzUniDataSelect filterable v-model="LOCATIONNAME" :localdata="items_Location"
|
||||
@inputChange="getitems_LocationAll" @change="changeLocationName"></zxzUniDataSelect>
|
||||
</u-form-item>
|
||||
<zb-table style="height: 200upx;" ref="zbTable" :show-header="true" :columns="column" :stripe="true"
|
||||
:fit="true" :highlight="true" :border="true" :data="sumList"></zb-table>
|
||||
<!-- <zb-table style="height: 200upx;" ref="zbTable" :show-header="true" :columns="column" :stripe="true"
|
||||
:fit="true" :highlight="true" :border="true" :data="sumList"></zb-table> -->
|
||||
</view>
|
||||
|
||||
<!-- <view class="header" @click="toggle">
|
||||
@ -52,10 +52,10 @@
|
||||
</view>
|
||||
</u-form>
|
||||
<br />
|
||||
<view class="search-box">
|
||||
<!-- <view class="search-box">
|
||||
<input type="text" placeholder="请输入搜索批次" v-model="searchBatch" class="search-input" />
|
||||
</view>
|
||||
<u-modal :show="showModal" :title="titleModal" :content='contentModal'></u-modal>
|
||||
</view> -->
|
||||
<!-- <u-modal :show="showModal" :title="titleModal" :content='contentModal'></u-modal>
|
||||
<view class="container" style="height: 800upx;">
|
||||
<view class="list-item" v-for="(item, index) in BoxListInfo" :key="item.id"
|
||||
@touchstart="onTouchStart(index, $event)" @touchmove="onTouchMove(index, $event)"
|
||||
@ -91,10 +91,88 @@
|
||||
<u-button type="primary" size="mini" @click="deleteItem(item, index)">删除</u-button>
|
||||
</div>
|
||||
</view>
|
||||
<!-- <view class="delete-btn" @click="deleteItem(item, index)" >删除</view> -->
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="uni-padding-wrap uni-common-mt">
|
||||
<uni-segmented-control :current="current" :values="nameItem" :style-type="styleType"
|
||||
:active-color="activeColor" @clickItem="clickitem" />
|
||||
</view>
|
||||
<view style="padding-bottom: 170rpx;">
|
||||
<view v-show="current === 0">
|
||||
<!-- fit 列的宽度是否自撑开 -->
|
||||
<view style="margin-bottom: 180rpx;">
|
||||
<!-- <view class="search-box">
|
||||
<u-input type="text" placeholder="请输入搜索料号" v-model="searchSpec" class="search-input" clearable />
|
||||
</view> -->
|
||||
<view class="list-item" v-for="(item, index) in sumList" :key="item.id">
|
||||
|
||||
<view
|
||||
:class="setBbColorByCharge(item.IS_CHECK,item.BHFLG, item.MATERIALSPECNAME)"
|
||||
@click="toggleFold(index)"
|
||||
:style="{ background: item.TOTALQTY == item.HAVEQUANTITY ? backgColor : '' }"
|
||||
>
|
||||
<div>
|
||||
<text class="card-description"> 单号: {{ item.RECEIVEREQUESTNAME }}</text>
|
||||
|
||||
<text class="card-description"> 料号: {{ item.MATERIALSPECNAME }}</text>
|
||||
</div>
|
||||
<!-- <div>
|
||||
<text class="card-description"> 阶段: {{ item.PHASE }}</text>
|
||||
|
||||
<text class="card-description"> 实际规格: {{ item.SDK_ID }}</text>
|
||||
</div> -->
|
||||
<div>
|
||||
<text class="card-description"> 计划数量: {{ item.TOTALQTY }} {{ item.UNIT }}</text>
|
||||
|
||||
<!-- <text class="card-description"> 备货数量: {{ item.ASSIGNEDQUANTITY }}
|
||||
{{ item.UNIT }}</text> -->
|
||||
<text class="card-description"> 已扫描数量: {{ item.HAVEQUANTITY }} {{ item.UNIT }}</text>
|
||||
</div>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-show="current === 1">
|
||||
<view class="list-item" v-for="(item, index) in BoxListInfo" :key="item.id">
|
||||
<view @click="toggleFold(index)">
|
||||
<div>
|
||||
<text class="card-description"> 标签: {{ item.MATERIALPACKINGNAME }}</text>
|
||||
</div>
|
||||
<div>
|
||||
<text class="card-description"> 批次: {{ item.CHARGE }}</text>
|
||||
</div>
|
||||
<div>
|
||||
<text class="card-description"> 料号: {{ item.MATERIALSPECNAME }}</text>
|
||||
|
||||
<text class="card-description"> 实际规格: {{ item.SDK_ID }}</text>
|
||||
<!--
|
||||
<text class="card-description"> 阶段: {{ item.PHASE }}</text> -->
|
||||
</div>
|
||||
<div>
|
||||
<text class="card-description"> 品名: {{ item.DESC_CN }}</text>
|
||||
|
||||
<text class="card-description"> 数量: {{ item.MATERIALQUANTITY }} {{ item.UNIT }}</text>
|
||||
</div>
|
||||
<!-- <div>
|
||||
<text class="card-description"> 组织: {{ item.ERPFACTORY }}</text>
|
||||
|
||||
<text class="card-description"> 仓库: {{ item.ERPLOCATION }}</text>
|
||||
|
||||
<text class="card-description"> 货位: {{ item.LOCATIONNAME }}</text>
|
||||
</div> -->
|
||||
<!-- <div>
|
||||
<text class="card-description" v-if="isFolded[index]" @click.stop>点击折叠</text>
|
||||
<text class="card-description" v-else @click.stop>点击展开</text>
|
||||
</div> -->
|
||||
<div class="button-group">
|
||||
<u-button type="primary" style="height: 50rpx;line-height: 50rpx;width: 200rpx;margin-bottom: 10rpx;" @click="deleteItem(item,index)">删除</u-button>
|
||||
</div>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -116,6 +194,12 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
backgColor: 'limegreen',
|
||||
current: 1,
|
||||
nameItem: ['单号列表', '标签列表'],
|
||||
styleType: 'text',
|
||||
activeColor: '#007aff',
|
||||
isFolded: [], // 用于存储每个项目的折叠状态,初始为 false(不折叠)
|
||||
sumList: [],
|
||||
column: [ //列
|
||||
{
|
||||
@ -348,17 +432,49 @@
|
||||
};
|
||||
|
||||
},
|
||||
//分栏器的点击事件
|
||||
clickitem(e) {
|
||||
if (this.current !== e.currentIndex) {
|
||||
this.current = e.currentIndex //获取当前选中的index
|
||||
}
|
||||
},
|
||||
toggleFold(index) {
|
||||
this.$set(this.isFolded, index, !this.isFolded[index]);
|
||||
},
|
||||
setBbColorByCharge(isCHECK, isBH, SpecName = "") {
|
||||
let spec = this.searchSpec
|
||||
let showhidd = 'show'
|
||||
if (SpecName.includes(spec) || spec == '') {
|
||||
showhidd = 'show'
|
||||
} else {
|
||||
showhidd = 'hidden'
|
||||
}
|
||||
console.log("setBbColorByCharge" + isCHECK + ":" + isBH)
|
||||
if (isCHECK == 'Y' && isBH == 'Y') {
|
||||
return 'yellowgreen' + '-' + showhidd
|
||||
} else if (isCHECK == 'N' && isBH == 'N') {
|
||||
return 'white' + '-' + showhidd
|
||||
} else {
|
||||
return 'yellow' + '-' + showhidd
|
||||
}
|
||||
},
|
||||
deleteItem(row, index) {
|
||||
console.log("***********" + index)
|
||||
this.BoxListInfo.splice(index, 1)
|
||||
this.MATERIALQUANTITY = this.MATERIALQUANTITY - row.MATERIALQUANTITY
|
||||
this.MATERIALQUANTITY = cals.sub(this.MATERIALQUANTITY,row.MATERIALQUANTITY).toNumber()
|
||||
this.JS = this.JS - 1
|
||||
if (this.BoxListInfo.length > 0) {
|
||||
for (let i = 0; i < this.sumList.length; i++) {
|
||||
if (this.BoxListInfo.every(el => el.RECEIVEREQUESTNAME != this.sumList[i].RECEIVEREQUESTNAME)) {
|
||||
if (this.BoxListInfo.every(el => el.RECEIVEREQUESTNAME != this.sumList[i].RECEIVEREQUESTNAME || el.MATERIALSPECNAME != this.sumList[i].MATERIALSPECNAME)) {
|
||||
this.sumList.splice(i, 1)
|
||||
}
|
||||
}
|
||||
// 新加
|
||||
this.sumList.map(val => {
|
||||
if ((val.RECEIVEREQUESTNAME == row.RECEIVEREQUESTNAME) && (val.MATERIALSPECNAME == row.MATERIALSPECNAME)) {
|
||||
val.HAVEQUANTITY = (cals.sub(val.HAVEQUANTITY,row.MATERIALQUANTITY)).toNumber()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.sumList = []
|
||||
}
|
||||
@ -519,7 +635,7 @@
|
||||
this.$playFail()
|
||||
return;
|
||||
}
|
||||
let orderList = this.sumList.map(item => item.RECEIVEREQUESTNAME)
|
||||
// let orderList = this.sumList.map(item => item.RECEIVEREQUESTNAME)
|
||||
this.$MyRequest('/FGStockIn/getBarCode', {
|
||||
MATERIALPACKINGNAME: this.MATERIALPACKINGNAME,
|
||||
ERPFACTORY: this.ERPFACTORY,
|
||||
@ -530,20 +646,91 @@
|
||||
// commitDate : this.commitDate,
|
||||
}).then(res => {
|
||||
if (res.data.success) {
|
||||
console.log(res.data.resultObj[0])
|
||||
this.BoxListInfo.unshift(res.data.resultObj[0]);
|
||||
// console.log(res.data.resultObj[0])
|
||||
// this.BoxListInfo.unshift(res.data.resultObj[0]);
|
||||
// this.JS = 0
|
||||
// this.MATERIALQUANTITY = 0
|
||||
// this.sumList = [];
|
||||
// for (let i = 0; i < this.BoxListInfo.length; i++) {
|
||||
// this.JS = parseFloat(this.JS) + 1
|
||||
// this.MATERIALQUANTITY = (cals.add(this.MATERIALQUANTITY, this.BoxListInfo[i]
|
||||
// .MATERIALQUANTITY)).toNumber()
|
||||
// if (this.sumList.every(el => el.RECEIVEREQUESTNAME != this.BoxListInfo[i]
|
||||
// .RECEIVEREQUESTNAME)) {
|
||||
// this.sumList.push(this.BoxListInfo[i])
|
||||
// }
|
||||
// }
|
||||
|
||||
var _Arr = res.data.resultObj;
|
||||
// res.data.resultObj[0]
|
||||
|
||||
let PakageList = res.data.resultObj?.list2[0] || {};
|
||||
let orderList = res.data.resultObj?.list4[0] || {};
|
||||
this.BoxListInfo.unshift(PakageList);
|
||||
if(!this.sumList.length) {
|
||||
this.sumList.unshift(orderList);
|
||||
}
|
||||
|
||||
this.JS = 0
|
||||
this.MATERIALQUANTITY = 0
|
||||
this.sumList = [];
|
||||
for (let i = 0; i < this.BoxListInfo.length; i++) {
|
||||
this.JS = parseFloat(this.JS) + 1
|
||||
this.MATERIALQUANTITY = (cals.add(this.MATERIALQUANTITY, this.BoxListInfo[i]
|
||||
.MATERIALQUANTITY)).toNumber()
|
||||
if (this.sumList.every(el => el.RECEIVEREQUESTNAME != this.BoxListInfo[i]
|
||||
.RECEIVEREQUESTNAME)) {
|
||||
this.sumList.push(this.BoxListInfo[i])
|
||||
}
|
||||
this.JS = Number(this.JS) + 1
|
||||
this.MATERIALQUANTITY = (cals.add(this.MATERIALQUANTITY,this.BoxListInfo[i].MATERIALQUANTITY)).toNumber()
|
||||
}
|
||||
// this.sumList = [];
|
||||
// this.MATERIALPACKINGNAME = _Arr[0].MATERIALPACKINGNAME;
|
||||
// this.CHARGE = _Arr[0].CHARGE;
|
||||
// this.MATERIALSPECNAME = _Arr[0].MATERIALSPECNAME;
|
||||
// this.SPECNAME = _Arr[0].SPECNAME;
|
||||
// this.DESC_CN = _Arr[0].DESC_CN;
|
||||
// this.PHASE = _Arr[0].PHASE;
|
||||
/* if (this.RECEIVEACTNO == "") {
|
||||
this.createActNo();
|
||||
} else {
|
||||
this.createBoxInfo();
|
||||
} */
|
||||
// this.MATERIALPACKINGNAME = "" HAVEQUANTITY
|
||||
|
||||
// || (el.MATERIALSPECNAME != this.BoxListInfo[i].MATERIALSPECNAME)
|
||||
// for (let i = 0; i < this.BoxListInfo.length; i++) {
|
||||
// if (this.sumList.every(el => ((el.RECEIVEREQUESTNAME != this.BoxListInfo[i].RECEIVEREQUESTNAME)))) {
|
||||
// this.sumList.unshift(this.BoxListInfo[i])
|
||||
// }
|
||||
// }
|
||||
// for (let i = 0; i < this.BoxListInfo.length; i++) {
|
||||
// this.sumList.map(val => {
|
||||
// // if((val.RECEIVEREQUESTNAME == this.BoxListInfo[i].RECEIVEREQUESTNAME)) {
|
||||
// val.HAVEQUANTITY = this.BoxListInfo.reduce((total, currentValue) => {
|
||||
// if(val.RECEIVEREQUESTNAME == currentValue.RECEIVEREQUESTNAME) {
|
||||
// return cals.add(total,currentValue.MATERIALQUANTITY).toNumber()
|
||||
// }
|
||||
// },0)
|
||||
// // }
|
||||
// })
|
||||
// }
|
||||
/* console.log('orderList',orderList)
|
||||
for (let i = 0; i < this.BoxListInfo.length; i++) {
|
||||
if (this.sumList.every(el => ((el.RECEIVEREQUESTNAME != this.BoxListInfo[i].RECEIVEREQUESTNAME)))) {
|
||||
console.log(111)
|
||||
this.sumList = [...this.sumList,...orderList]
|
||||
}
|
||||
}*/
|
||||
|
||||
this.sumList.map(val => {
|
||||
if((val.RECEIVEREQUESTNAME == PakageList.RECEIVEREQUESTNAME && val.MATERIALSPECNAME == PakageList.MATERIALSPECNAME)) {
|
||||
val.HAVEQUANTITY = cals.add(val.HAVEQUANTITY,PakageList.MATERIALQUANTITY).toNumber()
|
||||
}
|
||||
// else {
|
||||
// orderList.HAVEQUANTITY = PakageList.MATERIALQUANTITY
|
||||
// this.sumList.unshift(orderList);
|
||||
// }
|
||||
})
|
||||
if(this.sumList.every(el => el.RECEIVEREQUESTNAME != PakageList.RECEIVEREQUESTNAME || el.MATERIALSPECNAME != PakageList.MATERIALSPECNAME)) {
|
||||
orderList.HAVEQUANTITY = PakageList.MATERIALQUANTITY
|
||||
this.sumList.unshift(orderList);
|
||||
}
|
||||
|
||||
console.log('this.sumList',this.sumList)
|
||||
|
||||
try {
|
||||
Vue.prototype.$playSuccess()
|
||||
|
Loading…
x
Reference in New Issue
Block a user