Browse Source

样式 2024/8/2

pull/1/head
test 6 months 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="page-header">
<view class="header-view" > <view class="header-view" >
<view class="" style="font-size: 35rpx; padding: 10rpx; padding-left: 15rpx"> 生产计划{{ dataContent.planNumber }} </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_box uni-flex uni-row">
<view class="cell_info"> <view class="cell_info">
@ -28,7 +27,6 @@
<view>{{ dataContent.noGoodQty }}{{ dataContent.uom }}</view> <view>{{ dataContent.noGoodQty }}{{ dataContent.uom }}</view>
</view> </view>
</view> </view>
<view class="split_line"></view>
</view> </view>
</view> </view>
<view class="" style="padding-top: 10rpx; padding-bottom: 10rpx; margin-left: 10rpx"> <view class="" style="padding-top: 10rpx; padding-bottom: 10rpx; margin-left: 10rpx">

363
src/pages/fg/receiptNoPlan.vue

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