Browse Source

样式 2024/8/2

hella_vue3
王志国 1 month ago
parent
commit
31db3d40ab
  1. 2
      src/pages/fg/receiptByPlan.vue
  2. 363
      src/pages/fg/receiptNoPlan.vue

2
src/pages/fg/receiptByPlan.vue

@ -8,7 +8,6 @@
<view class="page-header">
<view class="header-view" >
<view class="" style="font-size: 35rpx; padding: 10rpx; padding-left: 15rpx"> 生产计划{{ dataContent.planNumber }} </view>
<view class="split_line"></view>
<view class="cell_box uni-flex uni-row">
<view class="cell_info">
@ -28,7 +27,6 @@
<view>{{ dataContent.noGoodQty }}{{ dataContent.uom }}</view>
</view>
</view>
<view class="split_line"></view>
</view>
</view>
<view class="" style="padding-top: 10rpx; padding-bottom: 10rpx; margin-left: 10rpx">

363
src/pages/fg/receiptNoPlan.vue

@ -1,95 +1,122 @@
<template>
<view class="page-wraper" style="background-color: #fff">
<view class="page-wraper" style="background-color: #fff;">
<view class="header">
<view class="">
<com-blank-view @goScan="openFg" v-if="!dataContent"></com-blank-view>
<com-blank-view @goScan='openFg' v-if="!dataContent"></com-blank-view>
</view>
<view class="" v-if="dataContent">
<view class="cell_box uni-flex uni-row">
<view class="cell_info">
<view class="text_lightblue">完工库位</view>
<view style="font-size: 30rpx; margin-top: 13rpx">{{ dataContent.fgLocationCode }} </view>
</view>
<view class="cell_info">
<view class="text_lightblue">计划数</view>
<view>{{ dataContent.planQty }}{{ dataContent.uom }}</view>
<view class="page-header">
<view class="header-view">
<view class="cell_box uni-flex uni-row">
<view class="cell_info">
<view class="text_lightblue">完工库位</view>
<view style="font-size: 30rpx; margin-top: 13rpx;">{{dataContent.fgLocationCode}}
</view>
</view>
<view class="cell_info">
<view class="text_lightblue">计划数</view>
<view>{{dataContent.planQty}}{{dataContent.uom}}</view>
</view>
</view>
</view>
</view>
<view class="split_line"></view>
<view class="" style="padding-top: 10rpx; padding-bottom: 10rpx; margin-left: 10rpx">
<view class="" style="padding: 10rpx; margin-left: 10rpx;">
<item :dataContent="dataContent"></item>
</view>
<view class="split_line"></view>
<view class="uni-flex uni-row space-between" style="align-items: center">
<view style="word-break: break-all">
<view class='split_line'></view>
<view class="uni-flex uni-row space-between" style="align-items: center;padding: 0 10rpx;">
<view style="word-break: break-all;">
<batch :batch="dataContent.batch"></batch>
<view class="card_view">
<text style="color: #ffa500; padding: 5px; font-size: 30rpx">包装规格</text>
<text class="card_content">{{ dataContent.packUnit }} </text>
<view class="card_view ">
<text style="color: #FFA500;padding: 5px;font-size: 30rpx;">包装规格</text>
<text class="card_content ">{{dataContent.packUnit}} </text>
</view>
</view>
<view style="word-break: break-all; font-size: 35rpx; font-weight: bold">
<text v-if="dataContent.handleQty > 0" style="color: #ffa500">{{ dataContent.handleQty }}/</text>
<view style="word-break: break-all; font-size: 35rpx; font-weight: bold;">
<text v-if="dataContent.handleQty>0" style="color: #FFA500;">{{dataContent.handleQty}}/</text>
<!-- {{dataContent.packQtyHint}} -->
<text class="text_recommend">{{ dataContent.packQtyHint }}</text>
<text class="text_recommend">{{dataContent.packQtyHint}}</text>
</view>
</view>
</view>
</view>
<view style="margin-top: 350rpx; padding-bottom: 160rpx" v-if="dataContent">
<view style="margin-top: 350rpx; padding-bottom: 160rpx;" v-if="dataContent">
<scroll-view scroll-y="true" class="">
<view class="scan_view" v-for="(item, index) in showList" :key="index">
<uni-swipe-action>
<uni-swipe-action-item :right-options="options" @click="swipeClick($event, item, index)">
<view class="uni-flex uni-row" style="margin-left: 30rpx; margin-top: 10rpx; margin-bottom: 10rpx">
<light :lightCode="item.content"></light>
<uni-swipe-action-item :right-options="options" @click="swipeClick($event,item,index)">
<view class="uni-flex uni-row "
style="margin-left: 30rpx; margin-top: 10rpx; margin-bottom: 10rpx;">
<light :lightCode='item.content'></light>
<!-- <view class="auto-wrap" style="font-size: 35rpx;font-weight: bold; width: 100%;">
<text style="font-size: 30rpx;color: #B66463;">唯一码 </text>
{{item.content}}
</view> -->
<text style="font-size: 30rpx;color: #B66463;">唯一码 </text>
{{item.content}}
</view> -->
</view>
</uni-swipe-action-item>
</uni-swipe-action>
<u-line color="#D8D8D8"></u-line>
</view>
</scroll-view>
<uni-load-more :status="loadingType" v-if="showList.length > 0" />
<uni-load-more :status="loadingType" v-if="showList.length>0" />
</view>
<view class="page-footer" v-if="dataContent">
<view class="uni-flex u-col-center space-between" style="background-color: ghostwhite; width: 100%">
<view class="uni-flex u-col-center space-between " style="background-color:ghostwhite; width: 100%; ">
<view class="">
<view class="uni-flex uni-row"> </view>
<view class="uni-flex uni-row">
</view>
</view>
<view class="uni-flex uni-row">
<button class="btn_single_clear" hover-class="btn_commit_after" style="margin-right: 50rpx" @click="clear">清空</button>
<view class=" uni-flex uni-row">
<button class="btn_single_clear" hover-class="btn_commit_after" style="margin-right: 50rpx;"
@click="clear">清空</button>
<button class="btn_single_commit" hover-class="btn_commit_after" @click="submit">提交</button>
</view>
</view>
</view>
<comNoReceiptPopup ref="comNoReceiptPopup" @confirm="requestConfirm"></comNoReceiptPopup>
<win-scan-button v-if="dataContent" @goScan="openScanPopup"></win-scan-button>
<win-scan-fg-label ref="scanPopup" @getResult="getScanResult" title="制品标签"></win-scan-fg-label>
<comNoReceiptPopup ref="comNoReceiptPopup" @confirm='requestConfirm'></comNoReceiptPopup>
<win-scan-button v-if="dataContent" @goScan='openScanPopup'></win-scan-button>
<win-scan-fg-label ref="scanPopup" @getResult='getScanResult' title='制品标签'></win-scan-fg-label>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import { Exception } from 'sass'
import { isCheckMesCode, planReceiptSubmit, createPutawayRequestByPlan, createInspectRequestByPlan, getPlanByNumber } from '@/api/request2.js'
import { calc } from '@/common/calc.js'
import { getRemoveOption, deepCopyData, getCurrDateTime, compare } from '@/common/basic.js'
import {
isCheckMesCode,
planReceiptSubmit,
createPutawayRequestByPlan,
createInspectRequestByPlan,
getPlanByNumber
} from '@/api/request2.js';
import {
calc
} from '@/common/calc.js';
import {
getRemoveOption,
deepCopyData,
getCurrDateTime,
compare
} from '@/common/basic.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import comNoReceiptPopup from '@/pages/fg/coms/comNoReceiptPopup.vue'
import item from '@/mycomponents/item/item.vue'
import batch from '@/mycomponents/balance/batch.vue'
import pack from '@/mycomponents/balance/pack.vue'
import winScanFgLabel from '@/mycomponents/scan/winScanFgLabel.vue'
import comFgCard from '@/pages/productReceipt/coms/comFgCard.vue'
import winScanFgLabel from "@/mycomponents/scan/winScanFgLabel.vue"
import comFgCard from "@/pages/productReceipt/coms/comFgCard.vue"
import light from '@/mycomponents/balance/light.vue'
import {
Exception
} from 'sass';
export default {
components: {
@ -110,46 +137,50 @@ export default {
showList: [],
allList: [],
index: 1,
loadingType: '',
loadingType: "",
pageSize: 20
}
};
},
onShow() {},
onShow() {
},
onLoad() {
this.options = getRemoveOption()
this.openFg()
this.openFg();
},
onReachBottom() {
console.log('onReachBottom')
//
console.log("onReachBottom")
//
if (this.loadingType == 'nomore') {
return
return;
}
this.index++
const list = this.getDataPage(this.index, this.pageSize)
this.index++;
var list = this.getDataPage(this.index, this.pageSize)
if (list.length > 0) {
// this.showList=list
this.showList = this.showList.concat(list)
} else {
//
this.loadingType = 'nomore'
//
this.loadingType = "nomore";
}
},
mounted() {},
mounted() {
},
methods: {
openFg() {
setTimeout((res) => {
setTimeout(res => {
if (this.$refs.comNoReceiptPopup) {
this.$refs.comNoReceiptPopup.openRequestPopup()
this.$refs.comNoReceiptPopup.openRequestPopup();
}
}, 600)
},
requestConfirm(result) {
this.dataContent = {
itemCode: result.itemCode,
planNumber: result.planNumber, //
planNumber: result.planNumber, //
handleQty: 0,
qty: 0,
planQty: result.planQty,
@ -167,133 +198,143 @@ export default {
},
initList() {
this.index = 1
this.index = 1;
this.showList = []
this.loadingType = ''
this.loadingType = "";
this.showList = this.getDataPage(this.index, this.pageSize)
},
getDataPage(pageNo, pageSize) {
//
const totalPages = Math.ceil(this.allList.length / pageSize)
//
const start = (pageNo - 1) * pageSize
const end = start + pageSize //
//
var totalPages = Math.ceil(this.allList.length / pageSize);
//
const start = (pageNo - 1) * pageSize;
const end = start + pageSize; //
return this.allList.slice(start, end)
},
swipeClick(e, dataContent, index) {
if (e.content.text == '移除') {
this.$refs.comMessage.showQuestionMessage('是否要移除', (res) => {
if (e.content.text == "移除") {
this.$refs.comMessage.showQuestionMessage("是否要移除", res => {
if (res) {
this.allList.splice(index, 1)
this.allList.splice(index, 1);
this.initList()
}
})
}
},
submit() {
if (this.allList.length == 0) {
this.showErrorMessage('请先扫描唯一码')
return
this.showErrorMessage("请先扫描唯一码")
return;
}
if (this.allList.length < this.dataContent.packQty) {
this.$refs.comMessage.showQuestionMessage('扫描数量小于包装规格数量,是否提交?', (res) => {
this.$refs.comMessage.showQuestionMessage("扫描数量小于包装规格数量,是否提交?", res => {
if (res) {
this.commit()
}
})
});
} else {
this.commit()
this.commit();
}
},
async commit() {
try {
uni.showLoading({
title: '提交中...',
title: "提交中...",
mask: true
})
const params = this.setParams()
let params = this.setParams()
console.log(JSON.stringify(params))
const list = []
const planData = await planReceiptSubmit(params)
let list = []
var planData = await planReceiptSubmit(params)
if (planData.data) {
planData.data.forEach((item) => {
planData.data.forEach(item => {
list.push({
itemCode: item.itemCode, //
itemName: item.itemName, //
packName: item.packName, //
packageCode: item.toPackingNumber, //
batch: item.toBatch, //
parentNumber: item.parentNumber, //
itemType: item.itemType, //
asnNumber: item.asnNumber, // ASN
batch: item.toBatch, //
parentNumber: item.parentNumber, //
itemType: item.itemType, //
asnNumber: item.asnNumber, //ASN
supplierCode: item.supplierCode, //
qty: item.qty, //
printTimes: getCurrDateTime(), //
productionLineCode: item.productionLineCode, // 线
productionLineCode: item.productionLineCode, //线
barcodeString: item.barcodeString, //
barcodeBase64: '',
requestNumber: item.requestNumber
})
})
} else {
throw new Error('提交失败')
throw new Error("提交失败")
}
createPutawayRequestByPlan(list[0].requestNumber).then((res) => {
createPutawayRequestByPlan(list[0].requestNumber).then(res => {
createInspectRequestByPlan(list[0].requestNumber)
})
const queryParams = {
filters: [
var queryParams = {
filters: [{
column: "plan_type",
action: "==",
value: "assemble"
},
{
column: 'plan_type',
action: '==',
value: 'assemble'
},
{
column: 'number',
action: '==',
column: "number",
action: "==",
value: this.dataContent.planNumber
}
],
pageNo: 1,
pageSize: 100
pageSize: 100,
}
const planeInfo = await getPlanByNumber(queryParams)
var planeInfo = await getPlanByNumber(queryParams);
if (planeInfo.data && planeInfo.data.list.length > 0) {
if (planeInfo.data.list[0].goodQty >= planeInfo.data.list[0].planQty) {
this.clear()
this.clear();
} else {
this.dataContent.planNumber = planeInfo.data.list[0].number
this.dataContent.handleQty = 0
this.dataContent.planNumber = planeInfo.data.list[0].number;
this.dataContent.handleQty = 0;
this.dataContent.planQty = planeInfo.data.list[0].planQty
this.dataContent.goodQty = planeInfo.data.list[0].goodQty
;(this.dataContent.noGoodQty = calc.sub(planeInfo.data.list[0].planQty, planeInfo.data.list[0].goodQty)), (this.dataContent.subList = [])
this.showList = []
this.dataContent.noGoodQty = calc.sub(planeInfo.data.list[0].planQty, planeInfo.data.list[
0].goodQty),
this.dataContent.subList = []
this.showList = [];
this.allList = []
this.index = 1
}
} else {
throw new Error('未查找到单据信息')
throw new Error("未查找到单据信息")
}
uni.hideLoading()
this.showCommitSuccessMessage(`提交成功<br>生成装配收货记录<br>${list[0].requestNumber}`, list)
this.showCommitSuccessMessage("提交成功<br>生成装配收货记录<br>" + list[0].requestNumber, list)
} catch (error) {
uni.hideLoading()
const hint = error.message ? error.message : error
var hint = error.message ? error.message : error
this.showErrorMessage(hint)
}
},
setParams() {
this.allList.forEach((res) => {
this.allList.forEach(res => {
res.outsideItemCode = res.itemCode
res.outsideProduceDate = null
res.outsideSerialNumber = res.order
@ -304,69 +345,72 @@ export default {
},
clear() {
this.$refs.comMessage.showQuestionMessage('是否要清空?', (res) => {
this.$refs.comMessage.showQuestionMessage("是否要清空?", res => {
if (res) {
this.clearData()
this.openFg()
this.openFg();
}
})
},
clearData() {
this.dataContent = null
this.showList = []
this.allList = []
this.index = 1
this.index = 1;
},
openScanPopup() {
const { itemCode } = this.dataContent
console.log('物料', itemCode)
this.$refs.scanPopup.openScanPopup(itemCode)
var itemCode = this.dataContent.itemCode
console.log("物料", itemCode)
this.$refs.scanPopup.openScanPopup(itemCode);
},
getScanResult(result) {
const that = this
// TODO
// mes
isCheckMesCode(result.content)
.then((res) => {
if (res.data) {
if (that.dataContent) {
const itemIndex = this.allList.findIndex((r) => r.content == result.content)
//
if (itemIndex == -1) {
// if (this.allList.length > this.dataContent.packQty) {
// this.showErrorMessage("")
// return;
// }
result.countTime = new Date()
this.allList.push(result)
this.allList.sort(compare('countTime')) //
this.initList()
this.scanPopupGetFocus()
this.calcFgQty()
} else {
this.$refs.comMessage.showQuestionMessage(`唯一码【${result.content}】已经扫描,是否移除`, (res) => {
if (res) {
this.allList.splice(itemIndex, 1)
this.allList.sort(compare('countTime')) //
this.initList()
that.calcFgQty()
}
})
}
let that = this;
//TODO
//mes
isCheckMesCode(result.content).then(res => {
if (res.data) {
if (that.dataContent) {
var itemIndex = this.allList.findIndex(r =>
r.content == result.content);
//
if (itemIndex == -1) {
// if (this.allList.length > this.dataContent.packQty) {
// this.showErrorMessage("")
// return;
// }
result.countTime = new Date();
this.allList.push(result);
this.allList.sort(compare('countTime')); //
this.initList()
this.scanPopupGetFocus();
this.calcFgQty();
} else {
this.$refs.comMessage.showQuestionMessage("唯一码【" + result.content +
'】已经扫描,是否移除',
res => {
if (res) {
this.allList.splice(itemIndex, 1)
this.allList.sort(compare('countTime')); //
this.initList()
that.calcFgQty();
}
})
}
}
})
.catch((error) => {
this.showErrorMessage(error)
})
}
}).catch(error => {
this.showErrorMessage(error)
})
},
calcFgQty() {
this.dataContent.handleQty = this.allList.length
this.dataContent.handleQty = this.allList.length;
if (this.dataContent.handleQty == this.dataContent.packQty) {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.closeScanPopup()
this.$refs.scanPopup.closeScanPopup();
}
this.commit()
}
@ -374,33 +418,36 @@ export default {
scanPopupGetFocus() {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.getfocus()
this.$refs.scanPopup.getfocus();
}
},
scanPopupLoseFocus() {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.losefocus()
this.$refs.scanPopup.losefocus();
}
},
showCommitSuccessMessage(hint, pointData) {
this.$refs.comMessage.showSuccessMessage(hint, (res) => {
this.$refs.comMessage.showSuccessMessage(hint, res => {
if (pointData.length > 0) {
uni.navigateTo({
url: `/pages/point/index?points=${JSON.stringify(pointData)}`
})
});
}
})
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, (res) => {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
this.scanPopupGetFocus()
}
})
});
}
}
}
</script>
@ -420,14 +467,10 @@ page {
.header {
position: fixed;
/* #ifdef H5 */
top: 88rpx;
/* #endif */
left: 0;
width: 100%;
background-color: #fff;
z-index: 10;
padding: 10rpx;
/* 确保头部在内容之上 */
}
@ -438,6 +481,7 @@ page {
right: 0;
}
.page-main {
flex: 1;
position: relative;
@ -453,9 +497,10 @@ page {
.page-main-list {
/* height: 80rpx;
line-height: 80rpx; */
line-height: 80rpx; */
text-align: center;
background: #e0e0e0;
}
.item {
@ -472,4 +517,4 @@ page {
overflow-wrap: break-word;
/* 对于兼容性更好的情况 */
}
</style>
</style>
Loading…
Cancel
Save