Browse Source

Merge branch 'master_hella' of http://dev.ccwin-in.com:3000/sfms3.0/sfms3.0-uniapp into master_hella

hella_online_20240829
zhang_li 2 months ago
parent
commit
513ec5a63a
  1. 10
      .env.development
  2. 2
      .env.hella13
  3. 2
      .env.hella14
  4. 2
      .env.hella8
  5. 2
      .env.hella9
  6. 18
      src/common/detail.js
  7. 4
      src/manifest.json
  8. 40
      src/mycomponents/package/packageList.vue
  9. 483
      src/pages/fg/coms/comNoReceiptPopup.vue
  10. 517
      src/pages/fg/receiptNoPlan.vue
  11. 16
      src/pages/issue/record/issueRecord.vue
  12. 56
      src/pages/purchaseReceipt/coms/comReceiptDetailCard.vue
  13. 76
      src/pages/purchaseReceipt/job/receiptDetail.vue
  14. 4
      src/pages/repleinsh/record/repleinshRecord.vue

10
.env.development

@ -1,11 +1,11 @@
#VITE_BASE_URL=http://dev.ccwin-in.com:25300/api/admin-api
#VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25300/api/admin-api
VITE_BASE_URL=http://172.21.32.14:81/api/admin-api
VITE_BASE_URL_IMAGE=http://172.21.32.14:81/admin-api
VITE_BASE_URL=http://172.21.32.14:81/api/admin-api VITE_BASE_URL_IMAGE=http://172.21.32.14:81/admin-api
# 租户配置 VITE_TENANT='[{"text":"长春1379","value":1},{"text":"成都1397","value":2},{"text":"长春2379","value":3}]'
# 租户配置
VITE_TENANT='[{"text":"长春1379","value":1}]'
# 是否是测试环境
VITE_isDevelopment=true
# 积木报表请求路径
VITE_JMREPORT_BASE_URL='http://dev.ccwin-in.com:25310'
VITE_JMREPORT_BASE_URL='http://172.21.32.14:90'

2
.env.hella13

@ -5,7 +5,7 @@ VITE_BASE_URL_IMAGE=http://172.21.32.13:81/admin-api
VITE_TENANT='[{"text":"长春1379","value":1}]'
# 是否是测试环境
VITE_isDevelopment=true
VITE_isDevelopment=false
# 积木报表请求路径
VITE_JMREPORT_BASE_URL='http://172.21.32.13:90'

2
.env.hella14

@ -5,7 +5,7 @@ VITE_BASE_URL_IMAGE=http://172.21.32.14:81/admin-api
VITE_TENANT='[{"text":"长春1379","value":1}]'
# 是否是测试环境
VITE_isDevelopment=false
VITE_isDevelopment=true
# 积木报表请求路径
VITE_JMREPORT_BASE_URL='http://172.21.32.14:90'

2
.env.hella8

@ -5,7 +5,7 @@ VITE_BASE_URL_IMAGE=http://172.22.32.8:81/admin-api
VITE_TENANT='[{"text":"成都1397","value":2},{"text":"长春2379","value":3}]'
# 是否是测试环境
VITE_isDevelopment=true
VITE_isDevelopment=false
# 积木报表请求路径

2
.env.hella9

@ -5,7 +5,7 @@ VITE_BASE_URL_IMAGE=http://172.22.32.9:81/admin-api
VITE_TENANT='[{"text":"成都1397","value":2},{"text":"长春2379","value":3}]'
# 是否是测试环境
VITE_isDevelopment=false
VITE_isDevelopment=true
# 积木报表请求路径
VITE_JMREPORT_BASE_URL='http://172.22.32.9:90'

18
src/common/detail.js

@ -34,8 +34,9 @@ export function getTreeDataSource(dataList) {
items.forEach(r =>
r.subList.forEach(s => {
s.packList = childList.filter(c => c.parentPackingNumber == s.packingNumber)
s.packList.forEach(pac=>{
pac.scaned=false;
s.packList.forEach(pac => {
pac.scaned = false;
pac.scanDate = new Date();
})
})
)
@ -61,7 +62,7 @@ export function getDataSource(subList) {
}
})
return items;
}
}
export function createItemInfo(detail) {
let item = {
@ -79,6 +80,7 @@ export function createItemInfo(detail) {
export function createDetailInfo(data) {
data.scaned = false;
data.scanDate = new Date();
let detail = data;
detail.packList = [];
return detail;
@ -104,8 +106,8 @@ export function calcHandleQty(detailSource) {
item.handleQty = new Decimal(0).toNumber();
item.qty = new Decimal(0).toNumber();
for (let detail of item.subList) {
if (detail != undefined ) {
if(detail.scaned){
if (detail != undefined) {
if (detail.scaned) {
item.handleQty = calc.add(item.handleQty, detail.handleQty);
}
item.qty = calc.add(item.qty, detail.qty);
@ -120,10 +122,10 @@ export function calcTreeHandleQty(detailSource) {
for (let detail of item.subList) {
if (detail != undefined && detail.scaned) {
if(detail.packList.length>0){
if (detail.packList.length > 0) {
detail.handleQty = new Decimal(0).toNumber();
for (let pack of detail.packList){
if(pack!=undefined&&pack.scaned){
for (let pack of detail.packList) {
if (pack != undefined && pack.scaned) {
detail.handleQty = calc.add(detail.handleQty, pack.handleQty);
}
}

4
src/manifest.json

@ -2,8 +2,8 @@
"name" : "wms",
"appid" : "__UNI__C9CF4BF",
"description" : "",
"versionName" : "1.0.28",
"versionCode" : 28,
"versionName" : "1.0.37",
"versionCode" : 37,
"transformPx" : false,
/* 5+App */
"app-plus" : {

40
src/mycomponents/package/packageList.vue

@ -4,14 +4,23 @@
<uni-collapse ref="collapse2" @change="collapseChange">
<uni-collapse-item :disabled="false">
<template v-slot:title>
<uni-swipe-action>
<uni-swipe-action-item
:right-options="(item.scaned&&isEdit)?editAndRemoveOptions : item.scaned? removeOptions:options"
@click="swipeClick($event,item,'parent')">
<package-card :dataContent="item" :isShowLocation="false"
:isShowFromLocation="isShowFromLocation" :isShowStatus="isShowStatus"></package-card>
:isShowFromLocation="isShowFromLocation"
:isShowStatus="isShowStatus"></package-card>
</uni-swipe-action-item>
</uni-swipe-action>
</template>
<view v-for="(pack,index) in item.packList" :key="pack.id"
style=" width: 100%; background-color: antiquewhite;">
<uni-swipe-action>
<uni-swipe-action-item :right-options="(pack.scaned&&isEdit)?editAndRemoveOptions : pack.scaned? removeOptions:options"
@click="swipeClick($event,pack)">
<uni-swipe-action-item
:right-options="(pack.scaned&&isEdit)?editAndRemoveOptions : pack.scaned? removeOptions:options"
@click="swipeClick($event,pack,'child')">
<package-card :dataContent="pack" :isShowLocation="false" :isShowFromLocation="false"
:isShowToLocation="false" :isShowBatch="false"></package-card>
</uni-swipe-action-item>
@ -104,13 +113,36 @@
},
methods: {
swipeClick(e, item) {
swipeClick(e, item, type) {
if (e.content.text == "编辑") {
this.edit(item)
} else if (e.content.text == "移除") {
if (type == 'parent') {
this.removeParent(item);
} else {
this.remove(item)
}
}
},
removeParent(item) {
this.$refs.comMessage.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
item.scaned = false
item.handleQty = null;
item.packList.forEach(subItem => {
subItem.scaned = false
subItem.handleQty = null;
})
this.$emit('updateData')
this.$forceUpdate()
}
});
},
remove(item) {
this.$refs.comMessage.showQuestionMessage("确定移除扫描信息?",
res => {

483
src/pages/fg/coms/comNoReceiptPopup.vue

@ -0,0 +1,483 @@
<template>
<view class="">
<uni-popup ref="popup" :maskClick="false">
<view class="uni-flex uni-column pop_customer">
<view class="" style="padding:10rpx">
<view class="uni-flex u-col-center uni-row space-between" style="padding: 10rpx 10rpx 20rpx 10rpx">
<view class="" style="font-size: 35rpx;">
{{title}}
</view>
<image style="width: 35rpx;height: 35rpx;" src="/static/icons/icons_close.svg"
@click="closeRequestPopup()"></image>
</view>
<view class='split_line'></view>
<view class="uni-flex uni-column" style="background-color: white; ">
<view class="uni-flex uni-column">
<view class="title " style="display: flex; align-items: center;padding: 10rpx;">
<text style=" flex-shrink: 0;width: 25%;">生产线</text>
<view class="customerBorder" @click="showSelectLine">
{{productionLineName}}
</view>
<u-select v-model="showProductLineSelect" mode="mutil-column-auto"
:list="productLineList" @confirm="confirmSelectLine"></u-select>
<view class="">
<image src="/static/icons/down.svg" mode=""
style=" width: 40rpx;height: 40rpx;margin-left: 20rpx;" @click="showSelectLine">
</image>
</view>
</view>
<view class='split_line'></view>
<view class="title " style="display: flex; align-items: center;padding: 10rpx;">
<text style=" flex-shrink: 0;width: 25%;">计划日期</text>
<view class="customerBorder" @click="showSelectDate">
{{planDate}}
</view>
<u-select v-model="showDateSelect" mode="mutil-column-auto"
:list="planDateList" @confirm="confirmSelectDate"></u-select>
<view class="">
<image src="/static/icons/down.svg" mode=""
style=" width: 40rpx;height: 40rpx;margin-left: 20rpx;" @click="showSelectDate">
</image>
</view>
</view>
<view class='split_line'></view>
<view class="title " style="display: flex;align-items: center;padding: 10rpx;">
<text style=" flex-shrink: 0; width: 25%;">物料代码</text>
<view class="customerBorder">
{{itemCode}}
</view>
<view v-if="planQty>0">{{planQty}}({{getUomInfo(uom)}})</view>
<u-select v-model="showItemCodeSelect" mode="single-column" :list="itemCodeList"
@confirm="confirmSelectItem"></u-select>
<view class="" >
<image src="" mode=""
style=" width: 40rpx;height: 40rpx;margin-left: 20rpx;"
>
</image>
</view>
</view>
<view class='split_line'></view>
<view class="title " style="display: flex;align-items: center;padding: 10rpx;">
<text style=" flex-shrink: 0; width: 25%;">包装规格</text>
<view class="customerBorder">
{{packUnitName}}
</view>
<u-select v-model="showPackUnitSelect" mode="single-column" :list="packUnitList"
@confirm="confirmSelectPackUnit"></u-select>
<view class="">
<image src="/static/icons/down.svg" mode=""
style=" width: 40rpx;height: 40rpx;margin-left: 20rpx;"
@click="showSelectPackUnit">
</image>
</view>
</view>
<view class='split_line'></view>
<view class="title " style="display: flex;align-items: center;padding: 10rpx;">
<text style=" flex-shrink: 0; width: 25%;">批次</text>
<uni-easyinput v-model="batch"></uni-easyinput>
<view class="">
<image src="" mode="" style=" width: 40rpx;height: 40rpx;margin-left: 20rpx;"
@click="showSelectLine">
</image>
</view>
</view>
<view class='split_line'></view>
</view>
</view>
</view>
<view class="uni-flex uni-row hide_border">
<button class="btn_edit_big_cancle" hover-class="btn_edit_big_after" @click="cancel()">取消</button>
<button class="btn_edit_big_confirm" hover-class="btn_edit_big_after" @click="confirm()">确认</button>
</view>
</view>
</uni-popup>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import {
getIssueJobByProductionline,
getPlaneInfoByproductLine,
getPackUnitByItemCode,
getProductionlineAndWorkStation
} from '@/api/request2.js';
import {
getPackUnitName,
getUomInfo
} from '@/common/directory.js';
import {
getCurrDate,
getBatch8,
dateFormatData,
lastThreeDays
} from '@/common/basic.js';
import {
calc
} from '@/common/calc.js';
import uom from '@/mycomponents/qty/uom.vue'
import packQty from '@/mycomponents/qty/packQty.vue'
import balanceStatus from '@/mycomponents/status/balanceStatus.vue'
import winScanItem from '@/mycomponents/scan/winScanItem.vue'
export default {
components: {
uom,
balanceStatus,
winScanItem,
packQty,
},
data() {
return {
itemCode: '请选择物料信息',
uom: "",
qty: null,
planQty: 0,
goodQty: 0,
planNumber: "",
productLineCode: "",
showProductLineSelect: false,
productLineList: [],
productionLineName: "请选择生产线",
productionLineCode: "",
batch: "",
packUnitName: "请选择包装规格",
packUnit: "",
packUnitList: [],
packQtyHint: "",
packQty: 0,
showPackUnitSelect: false,
itemCodeList: [],
showItemCodeSelect: false,
workStationCode: "",
planDate: '',
showDateSelect:false,
planDateList:[],
fgLocationCode:"",
rawLocationCode:""
}
},
props: {
title: {
type: String,
default: '开工阶段'
},
itemCodeTypeList: {
type: Array,
default: []
},
},
methods: {
openRequestPopup() {
this.initData();
this.planDate =getCurrDate()
this.batch = getBatch8()
this.$refs.popup.open('bottom')
},
initData() {
this.itemCode = '请选择物料信息';
this.uom = ""
this.planQty = 0
this.goodQty = 0;
this.packQty = 0;
this.planNumber = ""
this.productLineCode = ""
this.showProductLineSelect = false
this.productLineList = []
this.productionLineName = "请选择生产线"
this.productionLineCode = ""
this.batch = ""
this.packUnitName = "请选择包装规格"
this.packUnit = "",
this.packQtyHint = ""
this.showPackUnitSelect = false
// this.packUnitList = []
this.itemCodeList = []
this.showItemCodeSelect = false
this.workStationCode = ""
this.planDate=""
this.showDateSelect =false
this.planDateList=[]
this.fgLocationCode=""
this.rawLocationCode=""
},
closeRequestPopup() {
this.$refs.popup.close()
},
itemCodeLoseFocus() {
this.itemCodeFocus = false;
},
confirm() {
if (!this.planDate) {
this.showErrorMessage('请先选择计划日期');
return;
}
if (this.productionLineName == "请选择生产线") {
this.showErrorMessage("请选择生产线")
return
}
if (!this.batch) {
this.showErrorMessage("请输入批次例如:20200101")
return
}
if (this.itemCode == "请选择物料信息") {
this.showErrorMessage("请选择物料信息")
return
}
if (this.packUnitName == "请选择包装规格") {
this.showErrorMessage("请选择包装规格")
return
}
this.callback();
},
callback() {
let item = {
productionLineName: this.productionLineName,
productionLineCode: this.productionLineCode, //线
itemCode: this.itemCode,
uom: this.getUomInfo(this.uom),
batch: this.batch,
packUnitName: this.packUnitName,
packUnit: this.packUnit,
packQtyHint: this.packQtyHint,
packQty: this.packQty,
planQty: this.planQty,
goodQty: this.goodQty,
planNumber: this.planNumber,
workStationCode: this.workStationCode,
fgLocationCode:this.fgLocationCode,
rawLocationCode:this.rawLocationCode
};
this.closeRequestPopup();
this.$emit("confirm", item);
},
showErrorMessage(message, type) {
setTimeout(r => {
this.$refs.comMessage.showErrorMessage(message, res => {})
})
},
cancel(e) {
this.closeRequestPopup();
},
confirmSelectLine(data) {
this.productionLineName = data[0].label + "—" + data[1].label
this.productionLineCode = data[0].value
this.workStationCode = data[1].value
var parent =this.productLineList.filter(res=>res.value==this.productionLineCode)
var fgLocation =parent[0].children.filter(children=>children.value==this.workStationCode)
this.fgLocationCode= fgLocation[0].fgLocationCode;
this.clearItemCode()
this.clearPackUnit()
},
clearItemCode(){
this.planDate =getCurrDate()
this.itemCode ="请选择物料信息"
this.uom = ""
this.planQty = 0;
this.goodQty = 0
this.planNumber = ""
},
confirmSelectDate(data) {
this.planDate=data[0].label
},
showSelectDate(){
this.showDateSelect =true;
var list =lastThreeDays(3);
this.planDateList=[]
list.forEach(res=>{
this.planDateList.push({
label :res,
value:""
})
})
},
showSelectLine() {
if (this.productLineList.length == 0) {
uni.showLoading({
title: "加载中",
mask: true
})
getProductionlineAndWorkStation().then(res => {
uni.hideLoading()
if (res.data && res.data.length > 0) {
this.productLineList = res.data
this.showProductLineSelect = true
} else {
this.showErrorMessage('未查找到生产线信息');
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error);
})
} else {
this.showProductLineSelect = true
}
},
showSelectItemCode() {
if (!this.planDate) {
this.showErrorMessage('请先选择计划日期');
return;
}
if (!this.productionLineCode) {
this.showErrorMessage('请先选择生产线');
return;
}
uni.showLoading({
title: "加载中",
mask: true
})
getPlaneInfoByproductLine(this.productionLineCode, this.planDate).then(res => {
uni.hideLoading()
if (res.data && res.data.length > 0) {
res.data.forEach(item => {
item.label = item.itemCode + "(" + item.planQty + this.getUomInfo(item.uom) + ")"
item.value = item
})
this.itemCodeList = res.data
this.showItemCodeSelect = true
} else {
this.showErrorMessage('未查找到物料信息');
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error);
})
},
confirmSelectItem(data) {
let productionPlan = data[0].value;
this.itemCode = productionPlan.itemCode;
this.uom = productionPlan.uom
this.planQty = productionPlan.planQty;
this.goodQty = productionPlan.goodQty
this.planNumber = productionPlan.number
//
this.clearPackUnit();
uni.showLoading({
title: "加载中",
mask: true
})
getPackUnitByItemCode(this.itemCode).then(res => {
uni.hideLoading()
if (res.data && res.data.list.length > 0) {
res.data.list.forEach(item => {
item.value = item.packUnit
item.label = getPackUnitName(item.packUnit) + "(" + item.packQty + this
.getUomInfo(item.uom) + ")";
})
this.packUnitList = res.data.list
var defaultData =res.data.list.filter(item=>item.defaultPackageunit=="TRUE")
this.confirmSelectPackUnit(defaultData)
}
}).catch(error => {
uni.hideLoading()
})
},
clearPackUnit(){
this.packUnitName = "请选择包装规格"
this.packUnit = ""
let pack = this.packUnitList.filter(r => r.packUnit == this.packUnit);
this.packQtyHint = "";
this.packQty = 0
},
showSelectPackUnit() {
if (this.itemCode == "请选择物料信息") {
this.showErrorMessage('请先选择物料');
return;
}
uni.showLoading({
title: "加载中",
mask: true
})
getPackUnitByItemCode(this.itemCode).then(res => {
uni.hideLoading()
if (res.data && res.data.list.length > 0) {
res.data.list.forEach(item => {
item.value = item.packUnit
item.label = getPackUnitName(item.packUnit) + "(" + item.packQty + this
.getUomInfo(item.uom) + ")";
})
this.packUnitList = res.data.list
this.showPackUnitSelect = true
} else {
this.showErrorMessage('未查找到包装信息');
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error);
})
},
confirmSelectPackUnit(data) {
this.packUnitName = data[0].label
this.packUnit = data[0].value
let pack = this.packUnitList.filter(r => r.packUnit == this.packUnit);
this.packQtyHint = pack[0].packQty + "(" + this
.getUomInfo(pack[0].uom) + ")";
this.packQty = pack[0].packQty
},
getUomInfo(uom) {
let item = getUomInfo(uom);
if (item == '') {
return uom;
} else {
return item.label
}
},
}
}
</script>
<style lang="scss">
.title {
font-size: 30rpx;
}
.customerBorder {
width: 100%;
border: 1rpx solid lightgray;
border-radius: 5rpx;
padding: 15rpx;
}
</style>

517
src/pages/fg/receiptNoPlan.vue

@ -1,37 +1,542 @@
<template>
<view class="page-wraper" style="background-color: #fff;">
<view class="header">
<view class="">
<com-blank-view @goScan='openFg' v-if="!dataContent"></com-blank-view>
</view>
<view class="" v-if="dataContent">
<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">
<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 class="cell_info">
<view class="text_lightblue">已完工</view>
<view>{{ dataContent.goodQty }}{{dataContent.uom}}</view>
</view>
<view class="cell_info">
<view class="text_lightblue">未完工</view>
<view>{{dataContent.noGoodQty}}{{dataContent.uom}}</view>
</view>
</view>
<view class='split_line'></view>
<view class="" style="padding-top: 10rpx; padding-bottom: 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;">
<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>
</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>
{{dataContent.packQtyHint}}
</view>
</view>
<view class='split_line' v-if="dataContent"></view>
</view>
</view>
<view style="margin-top: 480rpx; 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: 50rpx; padding-top: 10rpx; padding-bottom: 10rpx;">
<view class="auto-wrap" style="font-size: 35rpx;font-weight: bold; width: 100%;">
<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" />
</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="">
<com-blank-view @goScan='openFg' v-if="detailSource.length==0"></com-blank-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>
<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>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
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 {
Exception
} from 'sass';
export default {
components: {
comBlankView
comBlankView,
comNoReceiptPopup,
item,
batch,
pack,
winScanButton,
winScanFgLabel,
comFgCard
},
data() {
return {
detailSource:[]
dataContent: null,
options: [],
showList: [],
allList: [],
index: 1,
loadingType: "",
pageSize: 20
};
},
onShow() {
onShow() {},
onLoad() {
this.options = getRemoveOption()
this.openFg();
},
onReachBottom() {
console.log("onReachBottom")
//
if (this.loadingType == 'nomore') {
return;
}
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";
}
},
mounted() {
},
methods: {
openFg(){
openFg() {
setTimeout(res => {
if (this.$refs.comNoReceiptPopup) {
this.$refs.comNoReceiptPopup.openRequestPopup();
}
}, 600)
},
requestConfirm(result) {
this.dataContent = {
itemCode: result.itemCode,
planNumber: result.planNumber, //
handleQty: 0,
qty: 0,
planQty: result.planQty,
goodQty: result.goodQty,
noGoodQty: calc.sub(result.planQty, result.goodQty),
packQtyHint: result.packQtyHint,
packQty: result.packQty,
uom: result.uom,
batch: result.batch,
packUnit: result.packUnit,
workStationCode: result.workStationCode,
fgLocationCode:result.fgLocationCode,
subList: []
}
},
initList() {
this.index = 1;
this.showList = []
this.loadingType = "";
this.showList = this.getDataPage(this.index, this.pageSize)
},
getDataPage(pageNo, 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 (res) {
this.allList.splice(index, 1);
this.initList()
}
})
}
},
submit() {
if (this.allList.length == 0) {
this.showErrorMessage("请先扫描唯一码")
return;
}
if (this.allList.length < this.dataContent.packQty) {
this.$refs.comMessage.showQuestionMessage("扫描数量小于包装规格数量,是否提交?", res => {
if (res) {
this.commit()
}
});
} else {
this.commit();
}
},
async commit() {
try {
uni.showLoading({
title: "提交中...",
mask: true
})
let params = this.setParams()
console.log(JSON.stringify(params))
let list = []
var planData = await planReceiptSubmit(params)
if (planData.data) {
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
supplierCode: item.supplierCode, //
qty: item.qty, //
printTimes: getCurrDateTime(), //
productionLineCode: item.productionLineCode, //线
barcodeString: item.barcodeString, //
barcodeBase64: '',
requestNumber: item.requestNumber
})
})
} else {
throw new Error("提交失败")
}
createPutawayRequestByPlan(list[0].requestNumber).then(res => {
createInspectRequestByPlan(list[0].requestNumber)
})
var queryParams = {
filters: [{
column: "plan_type",
action: "==",
value: "assemble"
},
{
column: "number",
action: "==",
value: this.dataContent.planNumber
}
],
pageNo: 1,
pageSize: 100,
}
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();
} else {
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.allList = []
this.index = 1
}
} else {
throw new Error("未查找到单据信息")
}
uni.hideLoading()
this.showCommitSuccessMessage("提交成功<br>生成装配收货记录<br>"+list[0].requestNumber, list)
} catch (error) {
uni.hideLoading()
var hint = error.message ? error.message : error
this.showErrorMessage(hint)
}
},
setParams() {
this.allList.forEach(res => {
res.outsideItemCode = res.itemCode
res.outsideProduceDate = null
res.outsideSerialNumber = res.order
})
this.dataContent.subList = this.allList
return this.dataContent
},
clear() {
this.$refs.comMessage.showQuestionMessage("是否要清空?", res => {
if (res) {
this.clearData()
this.openFg();
}
})
},
clearData() {
this.dataContent = null
this.showList = []
this.allList = []
this.index = 1;
},
openScanPopup() {
var itemCode = this.dataContent.itemCode
console.log("物料", itemCode)
this.$refs.scanPopup.openScanPopup(itemCode);
},
getScanResult(result) {
let that = this;
//TODO
//mes
isCheckMesCode(result.content).then(res => {
if (res.data) {
if (that.dataContent) {
var itemIndex = this.allList.findIndex(r =>
r.itemCode == result.itemCode &&
r.order == result.order);
//
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)
})
},
calcFgQty() {
this.dataContent.handleQty = this.allList.length;
if (this.dataContent.handleQty == this.dataContent.packQty) {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.closeScanPopup();
}
this.commit()
}
},
scanPopupGetFocus() {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.getfocus();
}
},
scanPopupLoseFocus() {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.losefocus();
}
},
showCommitSuccessMessage(hint, pointData) {
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 => {
if (res) {
this.scanPopupGetFocus()
}
});
}
}
}
</script>
<style>
<style scoped lang="scss">
page {
width: 100%;
height: 100%;
background-color: #fff;
}
.page-wraper {
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
}
.header {
position: fixed;
/* #ifdef H5 */
top: 88rpx;
/* #endif */
left: 0;
width: 100%;
background-color: #fff;
z-index: 10;
padding: 10rpx;
/* 确保头部在内容之上 */
}
.page-footer {
position: fixed;
bottom: 0;
left: 0;
right: 0;
}
.page-main {
flex: 1;
position: relative;
}
.page-main-scroll {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
}
.page-main-list {
/* height: 80rpx;
line-height: 80rpx; */
text-align: center;
background: #e0e0e0;
}
.item {
background-color: #fff;
}
.item_scaned {
background-color: antiquewhite;
}
.auto-wrap {
white-space: normal;
word-break: break-all;
overflow-wrap: break-word;
/* 对于兼容性更好的情况 */
}
</style>

16
src/pages/issue/record/issueRecord.vue

@ -115,7 +115,7 @@
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue'
import recordDetailCard from '@/mycomponents/record/recordDetailCard.vue'
import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue'
import balance from '@/mycomponents/balance/balance.vue'
export default {
components: {
winScanButton,
@ -124,7 +124,8 @@
comBlankView,
recordComDetailCard,
recordDetailCard,
winComScanBalance
winComScanBalance,
balance
},
data() {
return {
@ -137,7 +138,7 @@
toLocationAreaTypeList: [],
inInventoryStatus: "", //
outInventoryStatus: "", //
businessType: {},
businessType: null,
showToLoaction: true,
recommendLocationList: [], //
fromWarehouseCode: '', //
@ -513,18 +514,11 @@
closeScanMessage() {
this.scanPopupGetFocus();
},
getLocation(location, code) {
this.getFromLocationCode(location, code)
},
getFromLocationCode(location, code) {
this.fromLocationInfo = location;
this.fromLocationCode = code;
this.openScanPopup();
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
this.clearData();
this.openScanPopup();
})
},

56
src/pages/purchaseReceipt/coms/comReceiptDetailCard.vue

@ -3,10 +3,17 @@
<uni-collapse ref="collapse">
<uni-collapse-item :open="true">
<template v-slot:title>
<uni-swipe-action>
<uni-swipe-action-item :right-options="dataContent.handleQty>0? removeOptions:options"
@click="swipeClick($event,dataContent)">
<itemCompareQty :dataContent="dataContent" :handleQty="dataContent.handleQty"
:isShowPackUnit="false"></itemCompareQty>
</uni-swipe-action-item>
</uni-swipe-action>
</template>
<package-list :dataContent="dataContent.subList" :isEdit="settingParam.allowModifyQty=='TRUE'" :settingParam="settingParam" @collapseChange="collapseChange" @updateData="updateData" :isShowFromLocation="false"></package-list>
<package-list :dataContent="dataContent.subList" :isEdit="settingParam.allowModifyQty=='TRUE'"
:settingParam="settingParam" @collapseChange="collapseChange" @updateData="updateData"
:isShowFromLocation="false"></package-list>
</uni-collapse-item>
</uni-collapse>
@ -32,7 +39,8 @@
import {
getDetailOption,
getPurchaseReceiptOption
getPurchaseReceiptOption,
getRemoveOption
} from '@/common/array.js';
export default {
@ -77,7 +85,9 @@
},
locatonItem: {},
detailOptions: [],
scanOptions: []
scanOptions: [],
options: [],
removeOptions: [],
}
},
@ -90,7 +100,9 @@
.allowModifyLocation)
}
if (this.removeOptions.length == 0) {
this.removeOptions = getRemoveOption();
}
},
updated() {
@ -98,7 +110,7 @@
},
methods: {
collapseChange(){
collapseChange() {
setTimeout(() => {
this.resizeCollapse();
}, 500)
@ -132,7 +144,7 @@
} else if (e.content.text == "库位") {
this.showLocation(item)
} else if (e.content.text == "移除") {
this.remove(item)
this.removeScan(item)
}
},
edit(item) {
@ -153,22 +165,42 @@
this.showItem = item;
this.$refs.jobDetailPopup.openPopup(item)
},
remove(item) {
this.$refs.message.showQuestionMessage("确定移除扫描信息?",
removeScan(item) {
this.$refs.message.showQuestionMessage("确定移除物料的所有扫描信息?",
res => {
if (res) {
item.scaned = false
item.handleQty = null
this.$forceUpdate()
this.$emit('remove', item)
item.subList.forEach(lst => {
lst.scaned = false;
lst.handleQty = null;
lst.packList.forEach(pack => {
pack.scaned = false;
pack.handleQty = null;
})
})
// this.$forceUpdate()
// this.$emit('remove', item)
}
});
},
// remove(item) {
// this.$refs.message.showQuestionMessage("?",
// res => {
// if (res) {
// item.scaned = false
// item.handleQty = null
// this.$forceUpdate()
// this.$emit('remove', item)
// }
// });
// },
confirm(qty) {
this.editItem.handleQty = qty;
this.$emit('updateData')
},
updateData(){
updateData() {
this.$emit('updateData')
}
}

76
src/pages/purchaseReceipt/job/receiptDetail.vue

@ -14,9 +14,9 @@
@change="switchChange"></u-switch>
</view>
</view>
<view class="" v-if ="operation=='reject'">
<view class="" v-if="operation=='reject'">
<uni-section title="拒收原因" type="line">
<uni-easyinput v-model="reasonText" placeholder="请输入拒收原因" ></uni-easyinput>
<uni-easyinput v-model="reasonText" placeholder="请输入拒收原因"></uni-easyinput>
</uni-section>
</view>
@ -44,8 +44,7 @@
<view v-if="operation=='receipt'" class="uni-flex u-col-center space-between padding_10">
<view>
<locationCompare ref="locationCompare" title="收货库位" :recommendLocationCode="jobToLocationCode"
@getLocation='scanLocationCode'
:locationAreaTypeList="toLocationAreaTypeList">
@getLocation='scanLocationCode' :locationAreaTypeList="toLocationAreaTypeList">
</locationCompare>
</view>
<view>
@ -79,7 +78,7 @@
goHome,
getCurrDateTime,
getPackingNumberAndBatch,
compareAsc,
compareDesc,
navigateBack,
getSwitchInfoByCode
} from '@/common/basic.js';
@ -143,8 +142,8 @@
operation: '',
scanMessage: '',
status: '',
switchCode:"",
isCheckLocation: 'purchaseReceiptLocationCodeValidate',//
switchCode: "",
isCheckLocation: 'purchaseReceiptLocationCodeValidate', //
reasonText: "",
};
},
@ -155,7 +154,7 @@
this.scanMessage = option.scanMessage;
this.operation = option.operation;
this.status = option.status;
this.switchCode = "purchasereceiptPrintPDA"//pda
this.switchCode = "purchasereceiptPrintPDA" //pda
},
@ -249,7 +248,7 @@
}
that.isAllReceived = false;
//ASN
if(this.scanMessage){
if (this.scanMessage) {
this.$refs.scanPopup.simulateScan(this.scanMessage);
}
@ -265,7 +264,6 @@
getScanResult(result) {
try {
var itemCode = result.label.itemCode;
var detail = this.detailSource.find(r => r.itemCode == itemCode);
@ -284,17 +282,19 @@
} else {
itemDetail.forEach(item => {
item.scaned = true;
itemDetail.scanDate = new Date();
item.handleQty = item.qty;
item.toLocationCode = this.toLocationCode;
})
this.detailSource[0].subList.sort(compareAsc('scaned')); //
calcHandleQty(this.detailSource);
this.detailSource[0].subList.sort(compareDesc('scanDate')); //
this.continueScan()
this.$forceUpdate()
}
}
} else if (result.label.labelType == "PurchaseLabel") {
var packingNumber = result.label.packingNumber;
var packingNumber = result.package.number;
var parentpackingNumber = result.package.parentNumber;
var batch = result.label.batch;
var qty = result.label.qty;
var detail = this.detailSource.find(r => r.itemCode == itemCode);
@ -305,39 +305,35 @@
var itemDetail = detail.subList.find(r => r.packingNumber == packingNumber && r.batch ==
batch);
if (itemDetail == undefined) {
var isExit;
for (let subItem of detail.subList) {
var item;
for (let pack of subItem.packList) {
if (pack.packingNumber == packingNumber &&
pack.batch == batch) {
item = pack;
isExit = pack;
break;
}
}
if (item != undefined) {
subItem.scaned = true
subItem.handleQty = 0;
item = undefined
}
}
itemDetail = detail.subList.find(r => r.packingNumber == parentpackingNumber && r.batch ==
batch);
if (isExit == undefined) {
if (itemDetail == undefined) {
this.showMessage("箱码【" + packingNumber + "】、批次【" + batch + "】不在列表中")
} else {
if ( isExit.scaned) {
this.showMessage("箱码【" + packingNumber + "】已经扫描")
var pack = itemDetail.packList.find(p => p.packingNumber == packingNumber &&
p.batch == batch)
if (pack == undefined) {
this.showMessage("箱码【" + packingNumber + "】、批次【" + batch + "】不在列表中")
} else {
if (pack.scaned) {
pack.scanDate = new Date();
this.showMessage("箱码【" + packingNumber + "】已经扫描");
} else {
isExit.scaned = true
isExit.handleQty = Number(result.label.qty);
isExit.toLocationCode = this.toLocationCode;
isExit.labelQty = Number(result.label.qty);
pack.scaned = true
pack.scanDate = new Date();
pack.handleQty = Number(result.label.qty);
pack.toLocationCode = this.toLocationCode;
pack.labelQty = Number(result.label.qty);
}
}
calcTreeHandleQty(this.detailSource);
itemDetail.packList.sort(compareDesc('scanDate')); //
this.$forceUpdate()
}
} else {
//,
var scanedLength = 0;
itemDetail.packList.forEach(res => {
if (res.scaned) {
@ -346,21 +342,23 @@
})
if (itemDetail.scaned && scanedLength == itemDetail
.packList.length) {
isExit.scanDate = new Date();
this.showMessage("箱码【" + packingNumber + "】已经扫描")
} else {
itemDetail.scaned = true;
this.detailSource[0].subList.sort(compareAsc('scaned')); //
itemDetail.scanDate = new Date();
itemDetail.handleQty = Number(result.label.qty);
itemDetail.toLocationCode = this.toLocationCode;
itemDetail.labelQty = Number(result.label.qty);
itemDetail.packList.forEach(pac => {
pac.scaned = true
pac.scanDate = new Date();
pac.handleQty = Number(pac.qty);
pac.toLocationCode = this.toLocationCode;
})
calcTreeHandleQty(this.detailSource);
var test = this.detailSource
this.detailSource[0].subList.sort(compareDesc('scanDate')); //
this.continueScan()
this.$forceUpdate()
}
@ -445,7 +443,7 @@
},
reject() {
if(!this.reasonText){
if (!this.reasonText) {
this.showMessage("请输入拒收原因")
return;
}

4
src/pages/repleinsh/record/repleinshRecord.vue

@ -9,7 +9,7 @@
<uni-collapse ref="collapse">
<uni-collapse-item :open="true">
<template v-slot:title>
<view class="card_itemName" style="padding: 3px 5px; font-size: 28rpx;">
<view class="card_itemName" style="font-size: 28rpx;">
先进先出推荐信息
</view>
</template>
@ -542,6 +542,7 @@
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
this.clear();
this.openScanPopup();
})
},
@ -552,6 +553,7 @@
this.detailSource = [];
this.toLocationCode = "";
this.itemCode = ""
this.recommendList = [];
}
}
}

Loading…
Cancel
Save