ljlong_2630
2 months ago
151 changed files with 10617 additions and 2144 deletions
@ -1,11 +0,0 @@ |
|||||
VITE_BASE_URL=http://172.21.32.13:81/api/admin-api |
|
||||
VITE_BASE_URL_IMAGE=http://172.21.32.13:81/admin-api |
|
||||
|
|
||||
# 租户配置 |
|
||||
VITE_TENANT='[{"text":"长春1379","value":1}]' |
|
||||
|
|
||||
# 是否是测试环境 |
|
||||
VITE_isDevelopment=false |
|
||||
|
|
||||
# 积木报表请求路径 |
|
||||
VITE_JMREPORT_BASE_URL='http://172.21.32.13:90' |
|
@ -1,11 +0,0 @@ |
|||||
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}]' |
|
||||
|
|
||||
# 是否是测试环境 |
|
||||
VITE_isDevelopment=true |
|
||||
|
|
||||
# 积木报表请求路径 |
|
||||
VITE_JMREPORT_BASE_URL='http://172.21.32.14:90' |
|
@ -1,11 +0,0 @@ |
|||||
VITE_BASE_URL=https://scp.faway-hella.com:81/api/admin-api |
|
||||
VITE_BASE_URL_IMAGE=https://scp.faway-hella.com:81/admin-api |
|
||||
|
|
||||
# 租户配置 |
|
||||
VITE_TENANT='[{"text":"长春1379","value":1}]' |
|
||||
|
|
||||
# 是否是测试环境 |
|
||||
VITE_isDevelopment=true |
|
||||
|
|
||||
# 积木报表请求路径 |
|
||||
VITE_JMREPORT_BASE_URL='https://scp.faway-hella.com' |
|
@ -1,11 +0,0 @@ |
|||||
VITE_BASE_URL=https://scptest.faway-hella.com:81/api/admin-api |
|
||||
VITE_BASE_URL_IMAGE=https://scptest.faway-hella.com:81/admin-api |
|
||||
|
|
||||
# 租户配置 |
|
||||
VITE_TENANT='[{"text":"长春1379","value":1},{"text":"成都1397","value":2},{"text":"长春2379","value":3}]' |
|
||||
|
|
||||
# 是否是测试环境 |
|
||||
VITE_isDevelopment=true |
|
||||
|
|
||||
# 积木报表请求路径 |
|
||||
VITE_JMREPORT_BASE_URL='https://scptest.faway-hella.com' |
|
@ -1,12 +0,0 @@ |
|||||
VITE_BASE_URL=http://172.22.32.8:81/api/admin-api |
|
||||
VITE_BASE_URL_IMAGE=http://172.22.32.8:81/admin-api |
|
||||
|
|
||||
# 租户配置 |
|
||||
VITE_TENANT='[{"text":"成都1397","value":2},{"text":"长春2379","value":3}]' |
|
||||
|
|
||||
# 是否是测试环境 |
|
||||
VITE_isDevelopment=false |
|
||||
|
|
||||
|
|
||||
# 积木报表请求路径 |
|
||||
VITE_JMREPORT_BASE_URL='http://172.22.32.8:90' |
|
@ -1,11 +0,0 @@ |
|||||
VITE_BASE_URL=http://172.22.32.9:81/api/admin-api |
|
||||
VITE_BASE_URL_IMAGE=http://172.22.32.9:81/admin-api |
|
||||
|
|
||||
# 租户配置 |
|
||||
VITE_TENANT='[{"text":"成都1397","value":2},{"text":"长春2379","value":3}]' |
|
||||
|
|
||||
# 是否是测试环境 |
|
||||
VITE_isDevelopment=true |
|
||||
|
|
||||
# 积木报表请求路径 |
|
||||
VITE_JMREPORT_BASE_URL='http://172.22.32.9:90' |
|
@ -1,12 +1,14 @@ |
|||||
VITE_BASE_URL=http://172.22.32.8:81/api/admin-api |
VITE_BASE_URL=http://192.168.120.34:81/api/admin-api |
||||
VITE_BASE_URL_IMAGE=http://172.22.32.8:81/admin-api |
VITE_BASE_URL_IMAGE=http://192.168.120.34:81/admin-api |
||||
|
|
||||
# 租户配置 |
# 租户配置 |
||||
VITE_TENANT='[{"text":"成都1397","value":2},{"text":"长春2379","value":3}]' |
VITE_TENANT='[{"text":"英泰","value":1}]' |
||||
|
|
||||
# 是否是测试环境 |
# 是否是测试环境 |
||||
VITE_isDevelopment=false |
VITE_isDevelopment=true |
||||
|
|
||||
|
|
||||
# 积木报表请求路径 |
# 积木报表请求路径 |
||||
VITE_JMREPORT_BASE_URL='http://172.22.32.8:90' |
VITE_JMREPORT_BASE_URL='http://192.168.120.34:81/api' |
||||
|
|
||||
|
# 项目管理模式 批次货/包装 |
||||
|
VITE_MANAGE_MODEL="BY_BATCH" |
@ -1,12 +1,14 @@ |
|||||
|
VITE_BASE_URL=http://192.168.120.35:81/api/admin-api |
||||
VITE_BASE_URL=http://dev.ccwin-in.com:25300/api/admin-api |
VITE_BASE_URL_IMAGE=http://192.168.120.35:81/admin-api |
||||
VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25300/admin-api |
|
||||
|
|
||||
# 租户配置 |
# 租户配置 |
||||
VITE_TENANT='[{"text":"长春1379","value":1},{"text":"成都1397","value":2},{"text":"长春2379","value":3}]' |
VITE_TENANT='[{"text":"英泰","value":1}]' |
||||
|
|
||||
# 是否是测试环境 |
# 是否是测试环境 |
||||
VITE_isDevelopment=true |
VITE_isDevelopment=true |
||||
|
|
||||
# 积木报表请求路径 |
# 积木报表请求路径 |
||||
VITE_JMREPORT_BASE_URL='http://dev.ccwin-in.com:25310' |
VITE_JMREPORT_BASE_URL='http://192.168.120.35:81/api' |
||||
|
|
||||
|
# 项目管理模式 批次货/包装 |
||||
|
VITE_MANAGE_MODEL="BY_BATCH" |
@ -0,0 +1,15 @@ |
|||||
|
VITE_BASE_URL=http://dev.ccwin-in.com:28051/api/admin-api |
||||
|
VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:28051/admin-api |
||||
|
|
||||
|
# 租户配置 |
||||
|
VITE_TENANT='[{"text":"英泰","value":1}]' |
||||
|
|
||||
|
# 是否是测试环境 |
||||
|
VITE_isDevelopment=false |
||||
|
|
||||
|
|
||||
|
# 积木报表请求路径 |
||||
|
VITE_JMREPORT_BASE_URL='http://dev.ccwin-in.com:28051' |
||||
|
|
||||
|
# 项目管理模式 批次货/包装 |
||||
|
VITE_MANAGE_MODEL="BY_BATCH" |
@ -1,7 +0,0 @@ |
|||||
# 设置基础镜像 |
|
||||
FROM win-nginx |
|
||||
|
|
||||
WORKDIR /opt/sfms3.0-uniapp |
|
||||
COPY nginx_prod.conf /usr/local/nginx/conf/nginx.conf |
|
||||
# 将dist/build/h5/文件中的内容复制到 /opt/sfms3.0-uniapp 这个目录下面 |
|
||||
COPY dist/build/h5/ /opt/sfms3.0-uniapp |
|
@ -1,57 +0,0 @@ |
|||||
user root; |
|
||||
worker_processes 2; |
|
||||
|
|
||||
events { |
|
||||
worker_connections 1024; |
|
||||
} |
|
||||
|
|
||||
http { |
|
||||
include mime.types; |
|
||||
charset utf-8,gbk; |
|
||||
default_type application/octet-stream; |
|
||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' |
|
||||
'$status $body_bytes_sent "$http_referer" ' |
|
||||
'"$http_user_agent" "$http_x_forwarded_for" "$request_time $upstream_response_time"'; |
|
||||
|
|
||||
proxy_cache_path /opt/nginx_cache/ levels=1:2 keys_zone=my_zone:10m inactive=300s max_size=5g; |
|
||||
access_log logs/access.log main; |
|
||||
sendfile on; |
|
||||
#tcp_nopush on; |
|
||||
keepalive_timeout 600s; |
|
||||
client_max_body_size 200m; |
|
||||
gzip on; |
|
||||
gzip_min_length 10k; |
|
||||
gzip_comp_level 9; |
|
||||
gzip_buffers 4 16k; |
|
||||
gzip_types text/plain application/javascript text/css application/xml text/javascript image/jpeg image/gif image/png; |
|
||||
gzip_vary on; |
|
||||
gzip_disable "MSIE [1-6]\."; |
|
||||
upstream sfms3.0 { |
|
||||
server localhost:90 weight=10 max_fails=3 fail_timeout=10s; |
|
||||
} |
|
||||
server { |
|
||||
listen 81; |
|
||||
server_name_in_redirect off; |
|
||||
server_name _; |
|
||||
location /api/ { |
|
||||
proxy_pass http://sfms3.0/; |
|
||||
proxy_next_upstream http_500 http_502 http_503 http_504 error timeout invalid_header; |
|
||||
proxy_set_header X-Forwared-For $proxy_add_x_forwarded_for; |
|
||||
proxy_set_header Host $http_host; |
|
||||
proxy_set_header X-Real-IP $remote_addr; |
|
||||
proxy_set_header X-Forwarded-For $http_x_forwarded_for; |
|
||||
} |
|
||||
location /profile/ { |
|
||||
alias /opt/profile/; |
|
||||
index index.html index.htm; |
|
||||
} |
|
||||
location / { |
|
||||
proxy_cache my_zone; |
|
||||
proxy_cache_valid 200 304 12h; |
|
||||
proxy_cache_key $host$uri$is_args$args; |
|
||||
try_files $uri $uri/ /index.html; |
|
||||
root /opt/sfms3.0-uniapp; |
|
||||
index index.html index.htm; |
|
||||
} |
|
||||
} |
|
||||
} |
|
@ -1,241 +0,0 @@ |
|||||
<template> |
|
||||
<view class="" style="background-color: #fff;"> |
|
||||
|
|
||||
<item-compare-qty :dataContent="dataContent" :handleQty="dataContent.handleQty" |
|
||||
:isShowStdPack="false"> |
|
||||
</item-compare-qty> |
|
||||
|
|
||||
|
|
||||
<view class="" v-for="(item,index) in dataContent.subList" :key="index"> |
|
||||
<uni-swipe-action ref="swipeAction"> |
|
||||
<uni-swipe-action-item @click="swipeClick($event,item)" |
|
||||
:right-options="(item.scaned&&isEdit)?editAndRemoveOptions : item.scaned? removeOptions:options" |
|
||||
style='padding:0px 0px 5px 0px;align-items: center;'> |
|
||||
|
|
||||
<view v-if="item.isRecommend" class="uni-flex" style="flex-direction: row;"> |
|
||||
<view class="" style="font-size: 32rpx; color: black; font-weight: bold; text-align: center;background-color: antiquewhite;display: flex;align-items: center;justify-content: center;padding: 0px 10rpx;"> |
|
||||
推<br/> |
|
||||
荐 |
|
||||
</view> |
|
||||
<view class="" style="flex:1;"> |
|
||||
<batch v-if="item.batch" :batch="item.batch"></batch> |
|
||||
<location v-if="item.fromLocationCode" title="来源库位" :locationCode="item.fromLocationCode"> |
|
||||
</location> |
|
||||
</view> |
|
||||
<text style="font-size: 30rpx;color: #2979ff; " @click="copy(item)" v-if="isDevlement()">复制</text> |
|
||||
|
|
||||
</view> |
|
||||
|
|
||||
<view v-else class="uni-flex" style="flex-direction: row; margin-top: 5rpx;"> |
|
||||
<view class="" style="font-size: 32rpx; color: black; font-weight: bold; text-align: center;background-color: antiquewhite;display: flex;align-items: center;justify-content: center;padding: 0px 10rpx;"> |
|
||||
实<br/> |
|
||||
际 |
|
||||
</view> |
|
||||
<view class="scan_view" style="flex:1;"> |
|
||||
<batch v-if="item.batch" :batch="item.batch"></batch> |
|
||||
<location v-if="item.fromLocationCode" title="来源库位" :locationCode="item.fromLocationCode"> |
|
||||
</location> |
|
||||
</view> |
|
||||
<!-- <recommend :detail="item" :isShowStatus="isShowStatus" :isShowToLocation="false"> |
|
||||
</recommend> --> |
|
||||
</view> |
|
||||
|
|
||||
|
|
||||
</uni-swipe-action-item> |
|
||||
</uni-swipe-action> |
|
||||
</view> |
|
||||
|
|
||||
<balance-qty-edit ref="qtyEdit" :settingParam="settingParam" :queryBalance="queryBalance" @confirm="confirm"></balance-qty-edit> |
|
||||
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation' |
|
||||
:locationAreaTypeList="locationAreaTypeList"></win-scan-location> |
|
||||
<comMessage ref="message"></comMessage> |
|
||||
</view> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue' |
|
||||
import recommend from '@/mycomponents/recommend/recommend.vue' |
|
||||
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue' |
|
||||
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" |
|
||||
import location from '@/mycomponents/balance/location.vue' |
|
||||
import toLocation from '@/mycomponents/balance/toLocation.vue' |
|
||||
import batch from '@/mycomponents/balance/batch.vue' |
|
||||
import config from '@/static/config.js' |
|
||||
|
|
||||
import { |
|
||||
getRemoveOption, |
|
||||
getEditRemoveOption |
|
||||
} from '@/common/array.js'; |
|
||||
|
|
||||
export default { |
|
||||
emits: ['openDetail', "updateData"], |
|
||||
components: { |
|
||||
itemCompareQty, |
|
||||
recommend, |
|
||||
balanceQtyEdit, |
|
||||
winScanLocation, |
|
||||
location, |
|
||||
toLocation, |
|
||||
itemCompareQty, |
|
||||
batch, |
|
||||
}, |
|
||||
props: { |
|
||||
dataContent: { |
|
||||
type: Object, |
|
||||
default: null |
|
||||
}, |
|
||||
settingParam: { |
|
||||
type: Object, |
|
||||
default: null |
|
||||
}, |
|
||||
isShowPack: { |
|
||||
type: Boolean, |
|
||||
default: true |
|
||||
}, |
|
||||
isShowBatch: { |
|
||||
type: Boolean, |
|
||||
default: true |
|
||||
}, |
|
||||
isShowLocation: { |
|
||||
type: Boolean, |
|
||||
default: true |
|
||||
}, |
|
||||
locationAreaTypeList: { |
|
||||
type: Array, |
|
||||
default: null |
|
||||
}, |
|
||||
queryBalance: { |
|
||||
type: Boolean, |
|
||||
default: true |
|
||||
}, |
|
||||
isShowStatus: { |
|
||||
type: Boolean, |
|
||||
default: true |
|
||||
}, |
|
||||
isEdit: { |
|
||||
type: Boolean, |
|
||||
default: true |
|
||||
}, |
|
||||
}, |
|
||||
watch: { |
|
||||
dataContent: { |
|
||||
handler(newName, oldName) { |
|
||||
if (this.dataContent.subList.length > 0) { |
|
||||
this.$nextTick(res => { |
|
||||
setTimeout(() => { |
|
||||
if (this.$refs.collapse1) { |
|
||||
this.$refs.collapse1.resize(); |
|
||||
} |
|
||||
}, 500) |
|
||||
}) |
|
||||
} |
|
||||
}, |
|
||||
immediate: true, |
|
||||
deep: true |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
data() { |
|
||||
return { |
|
||||
option: [], |
|
||||
showItem: {}, |
|
||||
locatonItem: {}, |
|
||||
editItem: {}, |
|
||||
detailOptions: [], |
|
||||
scanOptions: [], |
|
||||
|
|
||||
options: [], |
|
||||
removeOptions: [], |
|
||||
editAndRemoveOptions: [] |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
mounted() { |
|
||||
|
|
||||
this.removeOptions = getRemoveOption(); |
|
||||
this.editAndRemoveOptions = getEditRemoveOption() |
|
||||
// this.showLocation(); |
|
||||
}, |
|
||||
|
|
||||
methods: { |
|
||||
swipeClick(e, item) { |
|
||||
if (e.content.text == "详情") { |
|
||||
this.detail(item) |
|
||||
} else if (e.content.text == "编辑") { |
|
||||
this.edit(item) |
|
||||
} else if (e.content.text == "库位") { |
|
||||
this.showLocation(item) |
|
||||
} else if (e.content.text == "移除") { |
|
||||
this.remove(item) |
|
||||
} |
|
||||
}, |
|
||||
edit(item) { |
|
||||
this.editItem = item; |
|
||||
this.$refs.qtyEdit.openEditPopup(item.balance, item.handleQty); |
|
||||
}, |
|
||||
|
|
||||
detail(item) { |
|
||||
this.$emit('openDetail', item); |
|
||||
// this.showItem = item; |
|
||||
// this.$refs.jobDetailPopup.openPopup(item) |
|
||||
}, |
|
||||
remove(item) { |
|
||||
this.$refs.message.showQuestionMessage("确定移除扫描信息?", |
|
||||
res => { |
|
||||
if (res) { |
|
||||
item.scaned = false |
|
||||
item.balance = {} |
|
||||
item.handleQty = null; |
|
||||
this.$forceUpdate() |
|
||||
this.$emit('remove', item) |
|
||||
} |
|
||||
}); |
|
||||
}, |
|
||||
confirm(qty) { |
|
||||
this.editItem.handleQty = qty; |
|
||||
this.$emit('updateData') |
|
||||
}, |
|
||||
showLocation(item) { |
|
||||
this.locatonItem = item; |
|
||||
this.$refs.scanLocationCode.openScanPopup(); |
|
||||
}, |
|
||||
//扫描源库位 |
|
||||
getLocation(location, code) { |
|
||||
this.locatonItem.toLocationCode = code; |
|
||||
this.$emit('updateData') |
|
||||
}, |
|
||||
isDevlement() { |
|
||||
return config.isDevelopment; |
|
||||
}, |
|
||||
copy(detail) { |
|
||||
console.log(detail) |
|
||||
// HPQ;V1.0;ICE115F11161AG;PP20230427000026;B20230427002;Q100 |
|
||||
var content = "HPQ;V1.0;I" + detail.itemCode + ";P" + detail.packingNumber + ";B" + detail |
|
||||
.batch + ";Q" + detail.qty |
|
||||
// #ifdef H5 |
|
||||
this.$copyText(content).then( |
|
||||
res => { |
|
||||
uni.showToast({ |
|
||||
title: '复制采购标签成功', |
|
||||
icon: 'none' |
|
||||
}) |
|
||||
} |
|
||||
) |
|
||||
// #endif |
|
||||
// #ifndef H5 |
|
||||
uni.setClipboardData({ |
|
||||
data: content, |
|
||||
success: () => { |
|
||||
uni.showToast({ |
|
||||
title: '复制采购标签成功' |
|
||||
}) |
|
||||
} |
|
||||
}) |
|
||||
// #endif |
|
||||
}, |
|
||||
} |
|
||||
} |
|
||||
</script> |
|
||||
|
|
||||
<style> |
|
||||
</style> |
|
@ -0,0 +1,226 @@ |
|||||
|
<template> |
||||
|
<view class="uni-numbox"> |
||||
|
<view @click="_calcValue('minus')" class="uni-numbox__minus uni-numbox-btns" :style="{background}"> |
||||
|
<text class="uni-numbox--text" :class="{ 'uni-numbox--disabled': inputValue <= min || disabled }">-</text> |
||||
|
</view> |
||||
|
<input :disabled="disabled" @input="onKeyInput" @blur="_onBlur" class="uni-numbox__value" type="number" |
||||
|
v-model="inputValue" /> |
||||
|
<view @click="_calcValue('plus')" class="uni-numbox__plus uni-numbox-btns" :style="{background}"> |
||||
|
<text class="uni-numbox--text" :class="{ 'uni-numbox--disabled': inputValue >= max || disabled }">+</text> |
||||
|
</view> |
||||
|
</view> |
||||
|
</template> |
||||
|
<script> |
||||
|
/** |
||||
|
* NumberBox 数字输入框 |
||||
|
* @description 带加减按钮的数字输入框 |
||||
|
* @tutorial https://ext.dcloud.net.cn/plugin?id=31 |
||||
|
* @property {Number} value 输入框当前值 |
||||
|
* @property {Number} min 最小值 |
||||
|
* @property {Number} max 最大值 |
||||
|
* @property {Number} step 每次点击改变的间隔大小 |
||||
|
* @property {String} background 背景色 |
||||
|
* @property {Boolean} disabled = [true|false] 是否为禁用状态 |
||||
|
* @event {Function} change 输入框值改变时触发的事件,参数为输入框当前的 value |
||||
|
*/ |
||||
|
|
||||
|
export default { |
||||
|
name: "UniNumberBox", |
||||
|
emits: ['change'], |
||||
|
props: { |
||||
|
value: { |
||||
|
type: [Number, String], |
||||
|
default: 1 |
||||
|
}, |
||||
|
min: { |
||||
|
type: Number, |
||||
|
default: 0 |
||||
|
}, |
||||
|
max: { |
||||
|
type: Number, |
||||
|
default: 100 |
||||
|
}, |
||||
|
step: { |
||||
|
type: Number, |
||||
|
default: 1 |
||||
|
}, |
||||
|
background: { |
||||
|
type: String, |
||||
|
default: '#f5f5f5' |
||||
|
}, |
||||
|
disabled: { |
||||
|
type: Boolean, |
||||
|
default: false |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
inputValue: 0 |
||||
|
}; |
||||
|
}, |
||||
|
watch: { |
||||
|
inputValue(newVal, oldVal) { |
||||
|
if (+newVal !== +oldVal) { |
||||
|
this.$emit("change", newVal); |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
this.inputValue = +this.value; |
||||
|
}, |
||||
|
methods: { |
||||
|
setValue(value){ |
||||
|
this.inputValue=value; |
||||
|
}, |
||||
|
//输入框实时获取输入内容 |
||||
|
onKeyInput: function(event) { |
||||
|
//console.log( event.detail.value) |
||||
|
var hint = event.detail.value; |
||||
|
if (!Number.isInteger(hint)) { |
||||
|
// 如果不是整数,则设置为上一个有效值 |
||||
|
var temp = hint.toString().match(/^\d+/) |
||||
|
if(Array.isArray(temp)){ |
||||
|
this.inputValue =temp[0] |
||||
|
}else { |
||||
|
this.inputValue =temp |
||||
|
} |
||||
|
|
||||
|
// this.inputValue = hint.toString().match(/^\d+/) || 0; |
||||
|
} else { |
||||
|
// 如果是整数,则更新数据 |
||||
|
this.inputValue = hint; |
||||
|
} |
||||
|
}, |
||||
|
//加、减操作(minus:减;plus:加) |
||||
|
_calcValue(type) { |
||||
|
if (this.disabled) { |
||||
|
return; |
||||
|
} |
||||
|
const scale = this._getDecimalScale(); |
||||
|
let value = this.inputValue * scale; |
||||
|
let step = this.step * scale; |
||||
|
if (type === "minus") { |
||||
|
value -= step; |
||||
|
if (value < (this.min * scale)) { |
||||
|
return; |
||||
|
} |
||||
|
if (value > (this.max * scale)) { |
||||
|
value = this.max * scale |
||||
|
} |
||||
|
} else if (type === "plus") { |
||||
|
value += step; |
||||
|
if (value > (this.max * scale)) { |
||||
|
return; |
||||
|
} |
||||
|
if (value < (this.min * scale)) { |
||||
|
value = this.min * scale |
||||
|
} |
||||
|
} |
||||
|
if ((value + '').length > 5) { |
||||
|
value = value.toFixed(0); //toFixed保留小数点位数方法 |
||||
|
} |
||||
|
this.inputValue = String(value / scale); |
||||
|
}, |
||||
|
_getDecimalScale() { |
||||
|
let scale = 1; |
||||
|
// 浮点型 |
||||
|
// if (~~this.step !== this.step) { |
||||
|
// scale = Math.pow(10, (this.step + "").split(".")[1].length); |
||||
|
// } |
||||
|
return scale; |
||||
|
}, |
||||
|
_onBlur(event) { |
||||
|
let value = event.detail.value; |
||||
|
if (!value) { |
||||
|
return; |
||||
|
} |
||||
|
value = +value; |
||||
|
if (value > this.max) { |
||||
|
value = this.max; |
||||
|
} else if (value < this.min) { |
||||
|
value = this.min; |
||||
|
} |
||||
|
this.inputValue = value; |
||||
|
/*小数点后保留四位*/ |
||||
|
// if (value > 0) { |
||||
|
|
||||
|
// event.detail.value =parseFloat(event.detail.value).toFixed(0) |
||||
|
// } else { |
||||
|
// event.detail.value =-parseFloat(event.detail.value).toFixed(0) |
||||
|
// } |
||||
|
//重新赋值给input |
||||
|
this.$nextTick(() => { |
||||
|
this.inputValue = event.detail.value; |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
}; |
||||
|
</script> |
||||
|
<style lang="scss" scoped> |
||||
|
$box-height: 26px; |
||||
|
$bg: #f5f5f5; |
||||
|
$br: 2px; |
||||
|
$color: #333; |
||||
|
|
||||
|
.uni-numbox { |
||||
|
/* #ifndef APP-NVUE */ |
||||
|
display: flex; |
||||
|
/* #endif */ |
||||
|
flex-direction: row; |
||||
|
} |
||||
|
|
||||
|
.uni-numbox-btns { |
||||
|
/* #ifndef APP-NVUE */ |
||||
|
display: flex; |
||||
|
/* #endif */ |
||||
|
flex-direction: row; |
||||
|
align-items: center; |
||||
|
justify-content: center; |
||||
|
padding: 0 8px; |
||||
|
background-color: $bg; |
||||
|
/* #ifdef H5 */ |
||||
|
cursor: pointer; |
||||
|
/* #endif */ |
||||
|
} |
||||
|
|
||||
|
.uni-numbox__value { |
||||
|
margin: 0 2px; |
||||
|
background-color: $bg; |
||||
|
width: 100px; |
||||
|
height: $box-height; |
||||
|
text-align: center; |
||||
|
font-size: 14px; |
||||
|
border-left-width: 0; |
||||
|
border-right-width: 0; |
||||
|
color: $color; |
||||
|
} |
||||
|
|
||||
|
.uni-numbox__minus { |
||||
|
border-top-left-radius: $br; |
||||
|
border-bottom-left-radius: $br; |
||||
|
width: 64rpx; |
||||
|
} |
||||
|
|
||||
|
.uni-numbox__plus { |
||||
|
border-top-right-radius: $br; |
||||
|
border-bottom-right-radius: $br; |
||||
|
width: 64rpx; |
||||
|
} |
||||
|
|
||||
|
.uni-numbox--text { |
||||
|
// fix nvue |
||||
|
line-height: 20px; |
||||
|
|
||||
|
font-size: 20px; |
||||
|
font-weight: 300; |
||||
|
color: $color; |
||||
|
} |
||||
|
|
||||
|
.uni-numbox .uni-numbox--disabled { |
||||
|
color: #c0c0c0 !important; |
||||
|
/* #ifdef H5 */ |
||||
|
cursor: not-allowed; |
||||
|
/* #endif */ |
||||
|
} |
||||
|
</style> |
||||
|
|
@ -0,0 +1,98 @@ |
|||||
|
<template> |
||||
|
<view> |
||||
|
<status v-if="isShowStatus" :status='dataContent.inventoryStatus'></status> |
||||
|
|
||||
|
<view class="uni-flex uni-row center"> |
||||
|
<view class="text_recommend " v-if="Number(recommendQty)"> |
||||
|
{{Number(recommendQty)}}/ |
||||
|
</view> |
||||
|
<view class="text_recommend "> |
||||
|
{{Number(dataContent.qty)}} |
||||
|
</view> |
||||
|
<uom :uom="dataContent.uom"></uom> |
||||
|
</view> |
||||
|
|
||||
|
<view> |
||||
|
<pack-unit :dataContent="dataContent"></pack-unit> |
||||
|
<!-- <std-pack-qty v-show="isShowStdPack" :dataContent="dataContent"></std-pack-qty> --> |
||||
|
</view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
// import packQty from '@/mycomponents/qty/packQty.vue' |
||||
|
import packUnit from '@/mycomponents/qty/packUnit.vue' |
||||
|
import uom from '@/mycomponents/qty/uom.vue' |
||||
|
import status from '@/mycomponents/status/status.vue' |
||||
|
|
||||
|
export default { |
||||
|
components: { |
||||
|
// packQty, |
||||
|
packUnit, |
||||
|
uom, |
||||
|
status |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
|
||||
|
}; |
||||
|
}, |
||||
|
// 此处定义传入的数据 |
||||
|
props: { |
||||
|
type: { |
||||
|
type: String, |
||||
|
default: 'default' //recommend:推荐 compare:对比 |
||||
|
}, |
||||
|
|
||||
|
dataContent: { |
||||
|
type: Object, |
||||
|
default: {} |
||||
|
}, |
||||
|
recommendQty: { |
||||
|
type: Number, |
||||
|
default: 0 |
||||
|
}, |
||||
|
|
||||
|
handleQty: { |
||||
|
type: Number, |
||||
|
default: 0 |
||||
|
}, |
||||
|
|
||||
|
isShowStatus: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowStdPack: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
objTextStyle: { |
||||
|
type: Object, |
||||
|
default: null |
||||
|
}, |
||||
|
isShowPackCount: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowCount: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
} |
||||
|
}, |
||||
|
watch: { |
||||
|
|
||||
|
}, |
||||
|
methods: { |
||||
|
calc(qty, packQty) { |
||||
|
if(qty&&packQty){ |
||||
|
return Math.ceil(Number(qty) / Number(packQty)); |
||||
|
}else{ |
||||
|
return 0 |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss"> |
||||
|
</style> |
@ -0,0 +1,297 @@ |
|||||
|
<template> |
||||
|
<view style=" "> |
||||
|
<uni-drawer ref="showRight" mode="left" :mask-click="true" :width="340"> |
||||
|
<view style="height:100vh;display:flex;flex-direction:column;"> |
||||
|
<view class="" style=" display:flex; background-color:#007AFF ; |
||||
|
flex-direction: row; |
||||
|
align-items: center; |
||||
|
|
||||
|
justify-content: center; |
||||
|
"> |
||||
|
<view class="uni-flex" style=" |
||||
|
color: #fff; |
||||
|
padding: 20rpx; |
||||
|
font-size: 35rpx;"> |
||||
|
先进先出查询 |
||||
|
</view> |
||||
|
<view class="" @click="closeDrawer" style="position: fixed; color: #fff; font-size: 35rpx;right: 0; padding-right: 15rpx;"> |
||||
|
关闭 |
||||
|
</view> |
||||
|
</view> |
||||
|
|
||||
|
<scroll-view v-if="true" style="height: calc(100vh - 180rpx)" scroll-y="true" > |
||||
|
<!-- <button @click="closeDrawer" type="primary">关闭Drawer</button> --> |
||||
|
<!-- <view v-for="item in 110" :key="item">可滚动内容 {{ item }}</view> --> |
||||
|
<view class="" style="margin: 10rpx; font-size: 35rpx;"> |
||||
|
物料号: |
||||
|
</view> |
||||
|
<view style=" margin: 10rpx; display: flex; align-items: center;"> |
||||
|
<uni-easyinput class="uni-mt-5" prefixIcon="search" v-model="itemCode" placeholder="请输入物料号" |
||||
|
@clear="clearItemCode" ></uni-easyinput> |
||||
|
<!-- <view>查询</view> --> |
||||
|
<!-- <button style="height: 80rpx; align-items: center; text-align: center;" type="primary" size="mini" >查询</button> --> |
||||
|
</view> |
||||
|
|
||||
|
<view class="" style="margin: 10rpx; margin-top: 20rpx; font-size: 35rpx;"> |
||||
|
仓库: |
||||
|
</view> |
||||
|
<view style=" margin: 10rpx; display: flex; align-items: center;"> |
||||
|
<uni-easyinput class="uni-mt-5" prefixIcon="search" v-model="warehouseCode" placeholder="请输入仓库" |
||||
|
></uni-easyinput> |
||||
|
</view> |
||||
|
|
||||
|
<view v-for="(item, index) in itemCodeResult" :key="index" @click="selectItemCode(item)"> |
||||
|
<view class="" style="font-size: 30rpx; margin: 20rpx;"> |
||||
|
<view class=""> |
||||
|
({{index+1}}) 物料代码 : {{item.code}} |
||||
|
</view> |
||||
|
<view class=""> |
||||
|
名称 : {{item.name}} |
||||
|
</view> |
||||
|
<view class=""> |
||||
|
描述1 : {{item.desc1}} |
||||
|
</view> |
||||
|
<view class=""> |
||||
|
描述2 : {{item.desc1}} |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="split_line"></view> |
||||
|
</view> |
||||
|
<scroll-view v-if="tableData.length>0" |
||||
|
|
||||
|
:scroll-x="true" |
||||
|
:scroll-y="true" |
||||
|
style=" width: 340px; display: flex; align-items: center; justify-content: center; "> |
||||
|
|
||||
|
<uni-table border stripe emptyText="暂无更多数据"> |
||||
|
<!-- 表头行 --> |
||||
|
<uni-tr> |
||||
|
<!-- <uni-th align="left">批次</uni-th> |
||||
|
<uni-th align="left">库位</uni-th> |
||||
|
<uni-th align="left">状态</uni-th> |
||||
|
<uni-th align="left">数量</uni-th> |
||||
|
<uni-th align="left">单位</uni-th> --> |
||||
|
<uni-th width="60" align="left">批次</uni-th> |
||||
|
<uni-th width="60" align="left">库位</uni-th> |
||||
|
<uni-th width="60" align="left">状态</uni-th> |
||||
|
<uni-th width="100" align="left">数量</uni-th> |
||||
|
<uni-th width="60" align="left">单位</uni-th> |
||||
|
</uni-tr> |
||||
|
<!-- 表格数据行 --> |
||||
|
<uni-tr v-for="(item, index) in tableData" :key="index"> |
||||
|
<uni-td>{{item.batch}}</uni-td> |
||||
|
<uni-td>{{item.locationCode}}</uni-td> |
||||
|
<uni-td>{{statusDesc(item.inventoryStatus)}}</uni-td> |
||||
|
<uni-td>{{item.totalQty}}</uni-td> |
||||
|
<uni-td> |
||||
|
<uom :uom="uom"></uom> |
||||
|
</uni-td> |
||||
|
</uni-tr> |
||||
|
|
||||
|
</uni-table> |
||||
|
<!-- <view class="uni-flex" style=" flex-direction: column; position: fixed; bottom: 0; margin-bottom: 100rpx; background-color: #fff; width: 100%; align-items: center;" > |
||||
|
<view class="" style="width: 100%; display: flex; justify-content: center; font-size: 32rpx;margin-top: 10rpx;margin-bottom: 10rpx;"> |
||||
|
<view class="" >当前页:{{ current }},总数:{{ total }}条,每页:{{ pageSize }} |
||||
|
</view> |
||||
|
|
||||
|
</view> |
||||
|
<uni-pagination :current="current" :total="total" :show-icon="true" |
||||
|
@change="change" /> |
||||
|
</view> --> |
||||
|
|
||||
|
|
||||
|
</scroll-view> |
||||
|
|
||||
|
</scroll-view> |
||||
|
|
||||
|
<button @click="query" type="primary" style="padding-left: 20rpx; width: 100%;">查询</button> |
||||
|
</view> |
||||
|
|
||||
|
</uni-drawer> |
||||
|
<comMessage ref="comMessage"></comMessage> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
getBasicItemByCodeSenior, |
||||
|
getBalanceByBusinessType, |
||||
|
getBasicItemByCode |
||||
|
} from '@/api/request2.js'; |
||||
|
|
||||
|
import { |
||||
|
getInventoryStatusStyle, |
||||
|
getInventoryStatusName |
||||
|
} from '@/common/directory.js'; |
||||
|
|
||||
|
import uom from '@/mycomponents/qty/uom.vue' |
||||
|
|
||||
|
export default { |
||||
|
components: {uom}, |
||||
|
|
||||
|
data() { |
||||
|
return { |
||||
|
itemCode: "", |
||||
|
itemCodeResult: [], |
||||
|
current: 1, |
||||
|
total: 18, |
||||
|
tableData: [], |
||||
|
warehouseCode:"", |
||||
|
areaCode:"", |
||||
|
uom:"" |
||||
|
} |
||||
|
}, |
||||
|
props: { |
||||
|
// detail: { |
||||
|
// type: Object, |
||||
|
// default: {} |
||||
|
// }, |
||||
|
businessTypeCode: { |
||||
|
type: String, |
||||
|
default: "" |
||||
|
} |
||||
|
}, |
||||
|
watch: { |
||||
|
|
||||
|
}, |
||||
|
methods: { |
||||
|
statusStyle: function(val) { |
||||
|
return getInventoryStatusStyle(val); |
||||
|
}, |
||||
|
statusDesc(value) { |
||||
|
return getInventoryStatusName(value) |
||||
|
}, |
||||
|
change() { |
||||
|
|
||||
|
}, |
||||
|
showErrorMessage(message) { |
||||
|
this.$refs.comMessage.showErrorMessage(message, res => { |
||||
|
if (res) { |
||||
|
|
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
selectItemCode(item) { |
||||
|
this.itemCode = item.code |
||||
|
this.itemCodeResult = [] |
||||
|
this.getBalanceByBusiness(this.itemCode, this.businessTypeCode) |
||||
|
}, |
||||
|
clearItemCode() { |
||||
|
this.itemCode = "" |
||||
|
this.itemCodeResult = [] |
||||
|
this.tableData = [] |
||||
|
}, |
||||
|
onConfirmItemCode() { |
||||
|
if (!this.itemCode) { |
||||
|
this.showErrorMessage("物料号为空,请先输入物料号") |
||||
|
return; |
||||
|
} |
||||
|
this.tableData = [] |
||||
|
uni.showLoading({ |
||||
|
title: "加载中", |
||||
|
mask: true |
||||
|
}) |
||||
|
|
||||
|
getBasicItemByCodeSenior(this.itemCode).then(res => { |
||||
|
if (res.data && res.data.list.length > 0) { |
||||
|
if (res.data.list.length == 1) { |
||||
|
this.itemCode = res.data.list[0].code |
||||
|
this.getBalanceByBusiness(this.itemCode, this.businessTypeCode) |
||||
|
} else { |
||||
|
uni.hideLoading() |
||||
|
this.itemCodeResult = res.data.list |
||||
|
} |
||||
|
} else { |
||||
|
uni.hideLoading() |
||||
|
this.showErrorMessage("未查找到物料[" + this.itemCode + "]") |
||||
|
} |
||||
|
|
||||
|
}).catch(error => { |
||||
|
uni.hideLoading() |
||||
|
this.showErrorMessage(error) |
||||
|
}) |
||||
|
}, |
||||
|
getBalanceByBusiness(itemCode, businessType) { |
||||
|
var params = { |
||||
|
itemCode: itemCode, |
||||
|
businessType: businessType, |
||||
|
inOrOut: "out" |
||||
|
} |
||||
|
getBalanceByBusinessType(params).then(res => { |
||||
|
uni.hideLoading() |
||||
|
if (res.data && res.data.length > 0) { |
||||
|
this.tableData = res.data |
||||
|
} else { |
||||
|
this.showErrorMessage("系统异常:按" + res.msg + "未查找到库存") |
||||
|
} |
||||
|
|
||||
|
}).catch(error => { |
||||
|
uni.hideLoading() |
||||
|
this.showErrorMessage(error) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
showDrawer() { |
||||
|
this.$refs.showRight.open(); |
||||
|
}, |
||||
|
closeDrawer() { |
||||
|
this.$refs.showRight.close(); |
||||
|
}, |
||||
|
query(){ |
||||
|
if(this.itemCode==""){ |
||||
|
this.showErrorMessage("物料代码为空,请输入物料代码") |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
// if(this.warehouseCode==""){ |
||||
|
// this.showErrorMessage("仓库代码为空,请输入仓库代码") |
||||
|
// return; |
||||
|
// } |
||||
|
uni.showLoading({ |
||||
|
title:"查询中", |
||||
|
mask:true |
||||
|
}) |
||||
|
this.uom="" |
||||
|
getBasicItemByCode(this.itemCode).then(res=>{ |
||||
|
if(res.data&&res.data.list.length==1){ |
||||
|
this.uom =res.data.list[0].uom |
||||
|
this.queryBalance() |
||||
|
}else { |
||||
|
uni.hideLoading() |
||||
|
this.showErrorMessage("未查询到物料号"+[this.itemCode]+"的信息") |
||||
|
} |
||||
|
}).catch(error=>{ |
||||
|
uni.hideLoading() |
||||
|
this.showErrorMessage(error) |
||||
|
}) |
||||
|
|
||||
|
|
||||
|
}, |
||||
|
queryBalance(){ |
||||
|
var params ={ |
||||
|
itemCode: this.itemCode, |
||||
|
warehouseCode:this.warehouseCode, |
||||
|
businessType: this.businessTypeCode, |
||||
|
inOrOut: "out" |
||||
|
} |
||||
|
getBalanceByBusinessType(params).then(res => { |
||||
|
uni.hideLoading() |
||||
|
if (res.data && res.data.length > 0) { |
||||
|
this.tableData = res.data |
||||
|
} else { |
||||
|
this.showErrorMessage("系统异常:按" + res.msg + "未查找到库存") |
||||
|
} |
||||
|
|
||||
|
}).catch(error => { |
||||
|
uni.hideLoading() |
||||
|
this.showErrorMessage(error) |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
</style> |
@ -0,0 +1,225 @@ |
|||||
|
<template> |
||||
|
<view class="" style="background-color: #fff;"> |
||||
|
<uni-collapse ref="collapse1"> |
||||
|
<uni-collapse-item :open="true"> |
||||
|
<template v-slot:title> |
||||
|
<uni-swipe-action> |
||||
|
<uni-swipe-action-item @click="removeItem($event,dataContent)" :right-options="removeOptions"> |
||||
|
<item-qty :dataContent="dataContent" :isShowBalance="true" |
||||
|
:isShowBalanceQty="isShowBalanceQty" |
||||
|
:isShowRecommendQty="false" |
||||
|
></item-qty> |
||||
|
<view style="margin-left: 10px; margin-top: 5px;"> |
||||
|
<pack title='父包装' v-if="dataContent.containerNumber" :packingCode='dataContent.containerNumber'></pack> |
||||
|
<location v-if="isShowParentToLocation" title='目标库位' |
||||
|
:locationCode='dataContent.toLocationCode'></location> |
||||
|
</view> |
||||
|
</uni-swipe-action-item> |
||||
|
</uni-swipe-action> |
||||
|
</template> |
||||
|
<view class='split_line'></view> |
||||
|
<view class="" v-for="(detail,index) in dataContent.subList" :key="index"> |
||||
|
<uni-swipe-action> |
||||
|
<uni-swipe-action-item @click="swipeClick($event,detail,index)" |
||||
|
:right-options="detail.scaned?scanOptions:detailOptions"> |
||||
|
<balance :dataContent="detail" :isShowStdPack="false" :isShowStatus="isShowStatus" |
||||
|
:isShowPack="true" :isShowFromLocation="isShowFromLocation" |
||||
|
:isShowToLocation="isShowToLocation" :isShowParentPack="isShowParentPack"> |
||||
|
</balance> |
||||
|
</uni-swipe-action-item> |
||||
|
</uni-swipe-action> |
||||
|
<!-- <view class='split_line'></view> --> |
||||
|
</view> |
||||
|
</uni-collapse-item> |
||||
|
</uni-collapse> |
||||
|
<balance-qty-edit ref="balanceQtyEdit" @confirm="confirm" ></balance-qty-edit> |
||||
|
<record-detail-popup ref="recordDetailPopup"></record-detail-popup> |
||||
|
<comMessage ref="comMessage"></comMessage> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import itemQty from '@/mycomponents/item/itemQty.vue' |
||||
|
import balance from '@/mycomponents/balance/balance.vue' |
||||
|
import recommend from '@/mycomponents/recommend/recommend.vue' |
||||
|
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue' |
||||
|
import balanceDetailPopup from '@/mycomponents/balance/balanceDetailPopup.vue' |
||||
|
import purchaseLabel from '@/mycomponents/balance/purchaseLabel.vue' |
||||
|
import location from '@/mycomponents/balance/location.vue' |
||||
|
import recordDetailPopup from '@/mycomponents/detail/recordDetailPopup.vue' |
||||
|
import pack from '@/mycomponents/balance/pack.vue' |
||||
|
import PackageAndItemCard from '@/mycomponents/package/PackageAndItemCard.vue' |
||||
|
|
||||
|
import { |
||||
|
getDetailOption, |
||||
|
getDetailEditRemoveOption, |
||||
|
getClearOption, |
||||
|
getEditLocationRemoveOption, |
||||
|
getRecordOption |
||||
|
} from '@/common/array.js'; |
||||
|
export default { |
||||
|
components: { |
||||
|
itemQty, |
||||
|
recommend, |
||||
|
balance, |
||||
|
balanceQtyEdit, |
||||
|
balanceDetailPopup, |
||||
|
purchaseLabel, |
||||
|
location, |
||||
|
recordDetailPopup, |
||||
|
pack, |
||||
|
PackageAndItemCard |
||||
|
// winListHint |
||||
|
}, |
||||
|
props: { |
||||
|
dataContent: { |
||||
|
type: Object, |
||||
|
default: {} |
||||
|
}, |
||||
|
settingParam: { |
||||
|
type: Object, |
||||
|
default: {} |
||||
|
}, |
||||
|
|
||||
|
isShowStatus: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
|
||||
|
isShowFromLocation: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
|
||||
|
isShowToLocation: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowParentToLocation: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
|
||||
|
isShowBalanceQty: { |
||||
|
type: Boolean, |
||||
|
default: false |
||||
|
}, |
||||
|
|
||||
|
isShowParentPack: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
|
||||
|
isShowModifedLocation: { |
||||
|
type: Boolean, |
||||
|
default: false |
||||
|
}, |
||||
|
allowModifyQty: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
allowModifyLocation: { |
||||
|
type: Boolean, |
||||
|
default: false |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
watch: { |
||||
|
|
||||
|
dataContent: { |
||||
|
handler(newName, oldName) { |
||||
|
if (this.dataContent.subList.length > 0) { |
||||
|
this.$nextTick(res => { |
||||
|
setTimeout(() => { |
||||
|
if (this.$refs.collapse1) { |
||||
|
this.$refs.collapse1.resize(); |
||||
|
} |
||||
|
}, 500) |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
immediate: true, |
||||
|
deep: true |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
data() { |
||||
|
return { |
||||
|
option: [], |
||||
|
title: "推荐详情", |
||||
|
showItem: {}, |
||||
|
editItem: {}, |
||||
|
detailOptions: [], |
||||
|
scanOptions: [], |
||||
|
removeOptions: [], |
||||
|
dataList: [] |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
mounted() { |
||||
|
this.detailOptions = getDetailOption(); |
||||
|
this.scanOptions = getRecordOption(this.allowModifyQty,this.allowModifyLocation); |
||||
|
this.removeOptions = this.isShowModifedLocation ?getEditLocationRemoveOption():getClearOption(); |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
removeItem(e, dataContent) { |
||||
|
if (e.content.text == "移除") { |
||||
|
this.$refs.comMessage.showQuestionMessage("确定清空物料及箱码信息?", |
||||
|
res => { |
||||
|
if (res) { |
||||
|
this.$emit('removeItem', dataContent) |
||||
|
// this.$emit('removeItem', this.dataContent) |
||||
|
} |
||||
|
}); |
||||
|
} else { |
||||
|
this.editLocation(dataContent) |
||||
|
} |
||||
|
}, |
||||
|
swipeClick(e, item, index) { |
||||
|
if (e.content.text == "详情") { |
||||
|
this.detail(item) |
||||
|
} else if (e.content.text == "编辑") { |
||||
|
this.edit(item) |
||||
|
} else if (e.content.text == "移除") { |
||||
|
this.remove(item, index) |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
edit(item) { |
||||
|
this.editItem = item; |
||||
|
this.$refs.balanceQtyEdit.openEditPopup(this.editItem, this.editItem.handleQty); |
||||
|
}, |
||||
|
|
||||
|
detail(item) { |
||||
|
this.showItem = item; |
||||
|
this.$refs.recordDetailPopup.openPopup(item); |
||||
|
}, |
||||
|
|
||||
|
remove(item, index) { |
||||
|
this.$refs.comMessage.showQuestionMessage("确定移除扫描信息?", |
||||
|
res => { |
||||
|
if (res) { |
||||
|
this.dataContent.subList.splice(index, 1) |
||||
|
this.$emit('removePack') |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
editLocation(item) { |
||||
|
this.editItem = item; |
||||
|
this.$emit('editLocation', item) |
||||
|
}, |
||||
|
|
||||
|
confirm(qty) { |
||||
|
// this.editItem.qty = qty; |
||||
|
this.editItem.handleQty = qty; |
||||
|
this.$emit('updateData') |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
</style> |
@ -1,203 +0,0 @@ |
|||||
<template> |
|
||||
<view class="" style="background-color: #fff;"> |
|
||||
|
|
||||
<!-- <item-qty :dataContent="dataContent" :handleQty="dataContent.handleQty"></item-qty> --> |
|
||||
<item-compare-qty :dataContent="dataContent" :handleQty="dataContent.handleQty" :isShowStdPack="false"> |
|
||||
</item-compare-qty> |
|
||||
<view class='split_line'></view> |
|
||||
<view class="" v-for="(item,index) in dataContent.subList"> |
|
||||
<uni-swipe-action ref="swipeAction" v-if="index ==0" :class="item.scaned?'scan_view':''"> |
|
||||
<uni-swipe-action-item :right-options="(item.scaned&&isEdit)?editAndRemoveOptions : item.scaned? removeOptions:options" @click="swipeClick($event,item)"> |
|
||||
<div style="display: flex;"> |
|
||||
<div style="flex: 1;"> |
|
||||
<batch v-if="item.batch" :batch="item.batch"></batch> |
|
||||
<location v-if="item.fromLocationCode" title="来源库位" :locationCode="item.fromLocationCode"> |
|
||||
</location> |
|
||||
<to-location v-if="item.toLocationCode" title="目标库位" :locationCode="item.toLocationCode"> |
|
||||
</to-location></div> |
|
||||
<text style="font-size: 30rpx;color: #2979ff; " @click="copy(item)" v-if="isDevlement()">复制</text> |
|
||||
</div> |
|
||||
</uni-swipe-action-item> |
|
||||
</uni-swipe-action> |
|
||||
</view> |
|
||||
|
|
||||
<balance-qty-edit ref="qtyEdit" :settingParam="settingParam" @confirm="confirm" |
|
||||
:allowEditStatus="true"></balance-qty-edit> |
|
||||
<win-scan-location ref="scanLocationCode" :locationAreaTypeList="locationAreaTypeList" title="目标库位" @getLocation='getLocation'></win-scan-location> |
|
||||
<detail-info-popup ref="detailInfoPopup"></detail-info-popup> |
|
||||
<comMessage ref="message"></comMessage> |
|
||||
</view> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
import itemQty from '@/mycomponents/item/itemQty.vue' |
|
||||
import recommend from '@/mycomponents/recommend/recommend.vue' |
|
||||
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue' |
|
||||
import detailInfoPopup from '@/pages/inventoryMove/coms/detailInfoPopup.vue' |
|
||||
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" |
|
||||
import location from '@/mycomponents/balance/location.vue' |
|
||||
import toLocation from '@/mycomponents/balance/toLocation.vue' |
|
||||
import batch from '@/mycomponents/balance/batch.vue' |
|
||||
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue' |
|
||||
import config from '@/static/config.js' |
|
||||
|
|
||||
import { |
|
||||
getRemoveOption, |
|
||||
getEditRemoveOption |
|
||||
} from '@/common/array.js'; |
|
||||
|
|
||||
export default { |
|
||||
components: { |
|
||||
itemQty, |
|
||||
recommend, |
|
||||
balanceQtyEdit, |
|
||||
detailInfoPopup, |
|
||||
winScanLocation, |
|
||||
location, |
|
||||
toLocation, |
|
||||
itemCompareQty, |
|
||||
batch, |
|
||||
}, |
|
||||
data() { |
|
||||
return { |
|
||||
option: [], |
|
||||
title: "推荐详情", |
|
||||
showItem: {}, |
|
||||
editItem: { |
|
||||
|
|
||||
}, |
|
||||
detailOptions: [], |
|
||||
scanOptions: [], |
|
||||
options: [], |
|
||||
removeOptions: [], |
|
||||
editAndRemoveOptions: [] |
|
||||
} |
|
||||
}, |
|
||||
props: { |
|
||||
dataContent: { |
|
||||
type: Object, |
|
||||
default: {} |
|
||||
}, |
|
||||
settingParam: { |
|
||||
type: Object, |
|
||||
default: {} |
|
||||
}, |
|
||||
allowEditQty: { |
|
||||
type: Boolean, |
|
||||
default: false |
|
||||
}, |
|
||||
locationAreaTypeList: { |
|
||||
type: Array, |
|
||||
default: [] |
|
||||
}, |
|
||||
isEdit: { |
|
||||
type: Boolean, |
|
||||
default: true |
|
||||
}, |
|
||||
}, |
|
||||
watch: { |
|
||||
dataContent: { |
|
||||
handler(newName, oldName) { |
|
||||
if (this.dataContent.subList.length > 0) { |
|
||||
this.$nextTick(res => { |
|
||||
setTimeout(() => { |
|
||||
if (this.$refs.collapse1) { |
|
||||
this.$refs.collapse1.resize(); |
|
||||
} |
|
||||
}, 200) |
|
||||
}) |
|
||||
} |
|
||||
}, |
|
||||
immediate: true, |
|
||||
deep: true |
|
||||
} |
|
||||
}, |
|
||||
mounted() { |
|
||||
this.removeOptions = getRemoveOption(); |
|
||||
this.editAndRemoveOptions = getEditRemoveOption() |
|
||||
}, |
|
||||
methods: { |
|
||||
openDetailCardPopup() { |
|
||||
this.$refs.winHint.openScanPopup() |
|
||||
}, |
|
||||
swipeClick(e, item) { |
|
||||
if (e.content.text == "详情") { |
|
||||
this.detail(item) |
|
||||
} else if (e.content.text == "编辑") { |
|
||||
this.edit(item) |
|
||||
} else if (e.content.text == "库位") { |
|
||||
this.showLocation(item) |
|
||||
} else if (e.content.text == "移除") { |
|
||||
this.remove(item) |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
edit(item) { |
|
||||
this.editItem = item; |
|
||||
this.$refs.qtyEdit.openEditPopup(item.balance, item.handleQty); |
|
||||
}, |
|
||||
|
|
||||
detail(item) { |
|
||||
this.$emit('openDetail', item); |
|
||||
}, |
|
||||
|
|
||||
remove(item) { |
|
||||
this.$refs.message.showQuestionMessage("确定移除扫描信息?", |
|
||||
res => { |
|
||||
if (res) { |
|
||||
item.scaned = false |
|
||||
item.balance = {} |
|
||||
item.handleQty = 0; |
|
||||
this.$forceUpdate() |
|
||||
this.$emit('remove', item) |
|
||||
} |
|
||||
}); |
|
||||
}, |
|
||||
confirm(qty) { |
|
||||
this.editItem.handleQty = qty; |
|
||||
this.$emit('updateData') |
|
||||
}, |
|
||||
showLocation(item) { |
|
||||
this.locatonItem = item; |
|
||||
this.$refs.scanLocationCode.openScanPopup(); |
|
||||
}, |
|
||||
//扫描源库位 |
|
||||
getLocation(location, code) { |
|
||||
this.locatonItem.toLocationCode = code; |
|
||||
this.$emit('updateData') |
|
||||
}, |
|
||||
isDevlement() { |
|
||||
return config.isDevelopment; |
|
||||
}, |
|
||||
copy(detail) { |
|
||||
console.log(detail) |
|
||||
// HPQ;V1.0;ICE115F11161AG;PP20230427000026;B20230427002;Q100 |
|
||||
var content = "HPQ;V1.0;I" + detail.itemCode + ";P" + detail.packingNumber + ";B" + detail |
|
||||
.batch + ";Q" + detail.qty |
|
||||
// #ifdef H5 |
|
||||
this.$copyText(content).then( |
|
||||
res => { |
|
||||
uni.showToast({ |
|
||||
title: '复制采购标签成功', |
|
||||
icon: 'none' |
|
||||
}) |
|
||||
} |
|
||||
) |
|
||||
// #endif |
|
||||
// #ifndef H5 |
|
||||
uni.setClipboardData({ |
|
||||
data: content, |
|
||||
success: () => { |
|
||||
uni.showToast({ |
|
||||
title: '复制采购标签成功' |
|
||||
}) |
|
||||
} |
|
||||
}) |
|
||||
// #endif |
|
||||
}, |
|
||||
} |
|
||||
} |
|
||||
</script> |
|
||||
|
|
||||
<style> |
|
||||
</style> |
|
@ -0,0 +1,313 @@ |
|||||
|
<template> |
||||
|
<view class=""> |
||||
|
<u-popup v-model="showOne" mode="bottom" border-radius="14" z-index='12'> |
||||
|
<view class="title"> |
||||
|
<view class="title-txt"> |
||||
|
需求信息 |
||||
|
</view> |
||||
|
<u-icon name="close" color="#4f4f4f" size="28" @click="showOne = false"></u-icon> |
||||
|
</view> |
||||
|
<view class="item"> |
||||
|
<view class="label">来源库位:</view> |
||||
|
<view class="value"> |
||||
|
<u-input v-model="fromLocationCode" @confirm="fromLocationScanMsg" @blur="fromLocationScanMsg" |
||||
|
|
||||
|
></u-input> |
||||
|
<u-icon name="close-circle-fill" color="#acacac" size="36" @click="fromLocationCode=''" |
||||
|
v-if="fromLocationCode"></u-icon> |
||||
|
</view> |
||||
|
<view class="searchIcon"> |
||||
|
<image src="/static/search.svg" mode="" @click="fromLocationClick" /> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="item"> |
||||
|
<view class="label">零件:</view> |
||||
|
<view class="value"> |
||||
|
<u-input v-model="itemCode" @confirm="itemCodeScanMsg" @blur="itemCodeScanMsg"></u-input> |
||||
|
<u-icon name="close-circle-fill" color="#acacac" size="36" @click="itemCode=''" |
||||
|
v-if="itemCode"></u-icon> |
||||
|
</view> |
||||
|
<view class="searchIcon"> |
||||
|
<image src="/static/search.svg" mode="" @click="itemCodeClick" /> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="item"> |
||||
|
<view class="label">批次:</view> |
||||
|
<view class="value"> |
||||
|
<u-input v-model='batch'></u-input> |
||||
|
<u-icon name="close-circle-fill" color="#acacac" size="36" @click="batch = ''" |
||||
|
v-if="batch"></u-icon> |
||||
|
</view> |
||||
|
<view class="searchIcon"></view> |
||||
|
</view> |
||||
|
<view class="item"> |
||||
|
<view class="label">数量:</view> |
||||
|
<view class="value1"> |
||||
|
<u-number-box v-model="handleQty"></u-number-box> |
||||
|
<uom :uom="uom"></uom> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="uni-flex uni-row hide_border"> |
||||
|
<button class="btn_edit_big_cancle" hover-class="btn_edit_big_after" |
||||
|
@click="showOne = false">取消</button> |
||||
|
<button class="btn_edit_big_confirm" hover-class="btn_edit_big_after" @click="clickConfirm">确认</button> |
||||
|
</view> |
||||
|
</u-popup> |
||||
|
|
||||
|
<!-- <win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getFromLocation' |
||||
|
:locationAreaTypeList="fromLocationAreaTypeList"></win-scan-location> --> |
||||
|
<comMessage ref="comMessage"></comMessage> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" |
||||
|
import { |
||||
|
getBusinessType |
||||
|
} from '@/common/record.js'; |
||||
|
|
||||
|
import { |
||||
|
getLabelInfo |
||||
|
} from '../../../common/label.js'; |
||||
|
|
||||
|
import { |
||||
|
getBasicLocationByCode, |
||||
|
} from '@/api/request2.js'; |
||||
|
|
||||
|
import uom from '@/mycomponents/qty/uom.vue' |
||||
|
|
||||
|
|
||||
|
|
||||
|
export default { |
||||
|
components: { |
||||
|
winScanLocation, |
||||
|
uom |
||||
|
}, |
||||
|
emits: ["showFromLocationPopup", 'itemCodeClick', 'onConfirm', 'getInputMsgResult', 'clearFromLocationCode', |
||||
|
'clickBtnClearItemCode' |
||||
|
], |
||||
|
data() { |
||||
|
return { |
||||
|
handleQty: 0, |
||||
|
fromLocationCode: '', |
||||
|
itemCode: '', |
||||
|
batch: '', |
||||
|
showOne: false, |
||||
|
isFromLocationFocus: false, |
||||
|
uom: "" |
||||
|
} |
||||
|
}, |
||||
|
props: { |
||||
|
// 是否显示第一层弹窗 |
||||
|
showOnePop: { |
||||
|
type: Boolean, |
||||
|
default: false |
||||
|
}, |
||||
|
}, |
||||
|
mounted() {}, |
||||
|
methods: { |
||||
|
// 打开扫描来源库位组件 |
||||
|
fromLocationClick() { |
||||
|
// this.$refs.scanLocationCode.openScanPopup() |
||||
|
this.$emit("showFromLocationPopup"); |
||||
|
}, |
||||
|
// 显示箱码 |
||||
|
itemCodeClick() { |
||||
|
// this.$refs.scanLocationCode.openScanPopup() |
||||
|
if (!this.fromLocationCode) { |
||||
|
this.$refs.comMessage.showMessage("请先扫描来源库位") |
||||
|
return |
||||
|
} |
||||
|
this.$emit("itemCodeClick"); |
||||
|
}, |
||||
|
clickConfirm() { |
||||
|
// this.$refs.scanLocationCode.openScanPopup() |
||||
|
|
||||
|
let obj = { |
||||
|
fromLocationCode: this.fromLocationCode, |
||||
|
itemCode: this.itemCode, |
||||
|
batch: this.batch, |
||||
|
handleQty: this.handleQty, |
||||
|
} |
||||
|
this.$emit("onConfirm", obj); |
||||
|
// if(!obj.fromLocationCode){ |
||||
|
// this.$refs.comMessage.showErrorMessage('请选择来源库位'); |
||||
|
// return; |
||||
|
// } |
||||
|
// if(!obj.itemCode){ |
||||
|
// this.$refs.comMessage.showErrorMessage('请选择零件'); |
||||
|
// return; |
||||
|
// } |
||||
|
// if(!obj.handleQty){ |
||||
|
// this.$refs.comMessage.showErrorMessage('请输入数量'); |
||||
|
// return; |
||||
|
// } |
||||
|
|
||||
|
}, |
||||
|
fromLocationScanMsg() { |
||||
|
setTimeout(() => { |
||||
|
if (this.fromLocationCode) { |
||||
|
this.scanMsg = this.fromLocationCode |
||||
|
this.fromWitch = 'fromLocationScanMsg' |
||||
|
this.isFromLocationFocus = false |
||||
|
this.handelScanMsg() |
||||
|
} |
||||
|
}, 500); |
||||
|
|
||||
|
}, |
||||
|
itemCodeScanMsg() { |
||||
|
setTimeout(() => { |
||||
|
if (this.itemCode) { |
||||
|
if (!this.fromLocationCode) { |
||||
|
this.$refs.comMessage.showMessage("请先扫描来源库位") |
||||
|
return |
||||
|
} |
||||
|
this.fromWitch = 'itemCodeScan' |
||||
|
this.scanMsg = this.itemCode |
||||
|
this.handelScanMsg() |
||||
|
} |
||||
|
}, 500); |
||||
|
|
||||
|
}, |
||||
|
handelScanMsg() { |
||||
|
//点击了回车 |
||||
|
// uni.showLoading({ |
||||
|
// title: '解析中...', |
||||
|
// mask: true |
||||
|
// }) |
||||
|
let that = this; |
||||
|
console.log(777, that.scanMsg) |
||||
|
// if(index==-1){ |
||||
|
// that.scanMsg =that.scanMsg + "\n"; |
||||
|
// } |
||||
|
console.log(that.scanMsg.includes('\n')) |
||||
|
if (that.scanMsg) { |
||||
|
// that.scanMsg = 'HPQ;V1.0;ICE115F11161AG;PP20230427000027;B20230427002;Q50'; |
||||
|
setTimeout(() => { |
||||
|
that.losefocus(); |
||||
|
let content = uni.$u.trim(that.scanMsg) |
||||
|
if (content == "") { |
||||
|
// that.getfocus(); |
||||
|
this.$refs.comMessage.showErrorMessage("扫描内容为空,请重新扫描", res => { |
||||
|
if (res) { |
||||
|
that.scanMsg = "" |
||||
|
that.getfocus(); |
||||
|
} |
||||
|
}) |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
if (that.isShowHistory) { |
||||
|
that.scanList.unshift(content); |
||||
|
} |
||||
|
|
||||
|
getLabelInfo(content, this.headerType, callback => { |
||||
|
// uni.hideLoading(); |
||||
|
let scanResult = callback; |
||||
|
scanResult.scanMessage = content |
||||
|
if (scanResult.success) { |
||||
|
// that.getfocus();//不能自动获取焦点 |
||||
|
console.log(scanResult) |
||||
|
that.$emit("getInputMsgResult", scanResult, this.fromWitch); |
||||
|
} else { |
||||
|
that.losefocus(); |
||||
|
this.$refs.comMessage.showErrorMessage(scanResult.message, res => { |
||||
|
if (res) { |
||||
|
that.getfocus(); |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
}); |
||||
|
}, 200); |
||||
|
} |
||||
|
}, |
||||
|
losefocus() { |
||||
|
let that = this; |
||||
|
this.$nextTick(r => { |
||||
|
that.boxfocus = false; |
||||
|
}); |
||||
|
}, |
||||
|
clickBtnClearFromLocation() { |
||||
|
this.$emit("clickBtnClearFromLocation"); |
||||
|
}, |
||||
|
clickBtnClearItemCode() { |
||||
|
this.$emit("clickBtnClearItemCode"); |
||||
|
}, |
||||
|
}, |
||||
|
watch: { |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss"> |
||||
|
.title { |
||||
|
padding: 30rpx 20rpx; |
||||
|
display: flex; |
||||
|
border-bottom: 1px solid rgba(230, 230, 230, 1); |
||||
|
|
||||
|
.title-txt { |
||||
|
flex: 1; |
||||
|
font-weight: bold; |
||||
|
font-size: 32rpx; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
.select { |
||||
|
display: flex; |
||||
|
} |
||||
|
|
||||
|
.border { |
||||
|
border: 1px solid rgba(230, 230, 230, 1) |
||||
|
} |
||||
|
|
||||
|
::v-deep .u-input__right-icon__clear { |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
justify-content: center; |
||||
|
color: #a7a7a7; |
||||
|
} |
||||
|
|
||||
|
.item { |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
padding: 20rpx; |
||||
|
border-bottom: 1px solid #dedede; |
||||
|
|
||||
|
.value { |
||||
|
flex: 1; |
||||
|
width: 0px; |
||||
|
height: 80rpx; |
||||
|
border: 1px solid #dedede; |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
font-size: 32rpx; |
||||
|
padding: 0px 20rpx; |
||||
|
} |
||||
|
|
||||
|
.value1 { |
||||
|
flex: 1; |
||||
|
width: 0px; |
||||
|
height: 80rpx; |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
font-size: 32rpx; |
||||
|
} |
||||
|
|
||||
|
.searchIcon { |
||||
|
width: 40rpx; |
||||
|
margin-left: 20rpx; |
||||
|
|
||||
|
image { |
||||
|
width: 40rpx; |
||||
|
height: 40rpx |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.uom { |
||||
|
margin-left: 10rpx; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
</style> |
@ -0,0 +1,828 @@ |
|||||
|
<template> |
||||
|
<view class="page-wraper"> |
||||
|
<view class="page-header"> |
||||
|
<view class="header-view"> |
||||
|
<view class="header_job_top"> |
||||
|
<job-top :dataContent="jobContent"></job-top> |
||||
|
</view> |
||||
|
<work-station :workshopCode="jobContent.workShopCode" |
||||
|
:productionLineCode="jobContent.detailProductionLineCode" |
||||
|
:workStationCode="jobContent.detailWorkStationCode" |
||||
|
:rawLocationCode="jobContent.detailToLocationCode"> |
||||
|
</work-station> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="page-main"> |
||||
|
<scroll-view scroll-y="true" class="page-main-scroll"> |
||||
|
<view v-for="(toLocation, index) in detailSource"> |
||||
|
<comIssueDetailCardBatch ref='comIssueDetailCardBatch' :dataContent="toLocation" :settingParam="jobContent" |
||||
|
@updateData='updateData'> |
||||
|
</comIssueDetailCardBatch> |
||||
|
<view class="split_line"></view> |
||||
|
</view> |
||||
|
</scroll-view> |
||||
|
</view> |
||||
|
|
||||
|
<view class="page-footer"> |
||||
|
<view class="uni-flex u-col-center space-between padding_10" |
||||
|
style="background-color:ghostwhite; width: 100%; "> |
||||
|
<view class=""> |
||||
|
</view> |
||||
|
<view class=" uni-flex uni-row"> |
||||
|
<button class="btn_single_commit" hover-class="btn_commit_after" @click="autoCommit()">提交</button> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
|
||||
|
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
||||
|
<!-- <com-scan-issue-pack ref="comScanIssuePack" @closeScan='closeScan' @updateData='updateData' |
||||
|
@afterScan='afterScan' :locationCode='fromLocationCode'> |
||||
|
</com-scan-issue-pack> --> |
||||
|
|
||||
|
<winScanPackAndLocation :balanceFromInventoryStatuses="true" ref="scanPopup" |
||||
|
@getResult='getScanResult' :noShowBalanceMessage="false" @confirm='confirmFromLocation'> |
||||
|
</winScanPackAndLocation> |
||||
|
<balance-select ref="balanceSelect" ></balance-select> |
||||
|
<comMessage ref="comMessage"></comMessage> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
takeIssueJob, |
||||
|
cancleTakeIssueJob, |
||||
|
getIssueJobDetail, |
||||
|
issueJobSubmit |
||||
|
} from '@/api/request2.js'; |
||||
|
|
||||
|
import { |
||||
|
goHome, |
||||
|
navigateBack, |
||||
|
getRemoveOption, |
||||
|
getCurrDateTime, |
||||
|
getDirectoryItemArray, |
||||
|
getPackingNumberAndBatch, |
||||
|
deepCopyData, |
||||
|
compareAsc, |
||||
|
} from '@/common/basic.js'; |
||||
|
|
||||
|
import { |
||||
|
getManagementPrecisions |
||||
|
} from '@/common/balance.js'; |
||||
|
import { |
||||
|
calc |
||||
|
} from '@/common/calc.js'; |
||||
|
|
||||
|
|
||||
|
import { |
||||
|
getDataSourceBatch, |
||||
|
getTreeDataSource, |
||||
|
calcTreeHandleQty, |
||||
|
getScanCount, |
||||
|
getThreeDataSource |
||||
|
} from '@/common/detail.js'; |
||||
|
|
||||
|
import { |
||||
|
calcHandleQtyAdd |
||||
|
} from '@/common/record.js'; |
||||
|
|
||||
|
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue' |
||||
|
import comIssueDetailCard from '@/pages/issue/coms/comIssueDetailCard.vue' |
||||
|
import comIssueDetailCardBatch from '@/pages/issue/coms/comIssueDetailCardBatch.vue' |
||||
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
||||
|
import comScanIssuePack from '@/pages/issue/coms/comScanIssuePack.vue' |
||||
|
import jobTop from '@/mycomponents/job/jobTop.vue' |
||||
|
import workStation from '@/mycomponents/workStation/workStation.vue' |
||||
|
import balanceSelect from '@/mycomponents/balance/balanceSelect.vue' |
||||
|
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" |
||||
|
|
||||
|
export default { |
||||
|
name: 'issueDetail', |
||||
|
components: { |
||||
|
jobDetailPopup, |
||||
|
winScanButton, |
||||
|
comIssueDetailCard, |
||||
|
comScanIssuePack, |
||||
|
jobTop, |
||||
|
workStation, |
||||
|
balanceSelect, |
||||
|
comIssueDetailCardBatch, |
||||
|
winScanPackAndLocation |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
id: '', |
||||
|
jobContent: {}, //任务内容 |
||||
|
subList: [], //接口返回的任务subList |
||||
|
detailSource: [], //绑定在页面上的数据源 |
||||
|
detailOptions: [], |
||||
|
scanOptions: [], |
||||
|
jobStatus: "", |
||||
|
scanMessage: '', |
||||
|
managementList: [], |
||||
|
managementType: "", |
||||
|
fromLocationCode:'' |
||||
|
}; |
||||
|
}, |
||||
|
|
||||
|
props: { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
onLoad(option) { |
||||
|
uni.setNavigationBarTitle({ |
||||
|
title: option.title + '详情' |
||||
|
}); |
||||
|
this.id = option.id; |
||||
|
this.scanMessage = option.scanMessage || ''; |
||||
|
if (this.id != undefined) { |
||||
|
//新建的任务自动接收 |
||||
|
if (option.status == "1") { |
||||
|
this.receive((callback => { |
||||
|
this.getDetail(); |
||||
|
})); |
||||
|
} else { |
||||
|
this.getDetail(); |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
onNavigationBarButtonTap(e) { |
||||
|
if (e.index === 0) { |
||||
|
goHome(); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
//拦截返回按钮事件 |
||||
|
onBackPress(e) { |
||||
|
//已经接收但是没提交任务 |
||||
|
if (e.from === 'backbutton') { |
||||
|
if (this.jobStatus == "2") { |
||||
|
//取消承接任务 |
||||
|
cancleTakeIssueJob(this.id).then(res => { |
||||
|
uni.navigateBack(); |
||||
|
}).catch(error => { |
||||
|
uni.navigateBack(); |
||||
|
}) |
||||
|
} else { |
||||
|
uni.navigateBack(); |
||||
|
} |
||||
|
|
||||
|
return true; |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
watch: { |
||||
|
locationTypes(newVal) { |
||||
|
let value = newVal; |
||||
|
}, |
||||
|
}, |
||||
|
mounted: function() { |
||||
|
// this.resizeCollapse(); |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
resizeCollapse() { |
||||
|
this.$nextTick(r => { |
||||
|
this.$refs.comIssueDetailCardBatch.forEach(r => { |
||||
|
r.resizeCollapse(); |
||||
|
}) |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
//接收 |
||||
|
receive(callback) { |
||||
|
if (this.id != null) { |
||||
|
takeIssueJob(this.id).then(res => { |
||||
|
callback(); |
||||
|
}).catch(error => { |
||||
|
this.showErrorMessage(error) |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
getDetail() { |
||||
|
var that = this; |
||||
|
uni.showLoading({ |
||||
|
title: "加载中....", |
||||
|
mask: true |
||||
|
}); |
||||
|
getIssueJobDetail(that.id).then(res => { |
||||
|
uni.hideLoading(); |
||||
|
if (res.data == null) { |
||||
|
that.showMessage('未获取到详情'); |
||||
|
} else { |
||||
|
if (res.data.subList.length > 0) { |
||||
|
// res.data.allowModifyLocation = 'FALSE' |
||||
|
that.jobContent = res.data; |
||||
|
that.jobStatus = res.data.status |
||||
|
that.subList = res.data.subList; |
||||
|
that.detailSource = getDataSourceBatch(that.subList) |
||||
|
that.jobContent.detailToLocationCode = res.data.subList[0].toLocationCode |
||||
|
that.toLocationCode= res.data.subList[0].toLocationCode |
||||
|
that.fromLocationCode = that.subList[0].fromLocationCode |
||||
|
|
||||
|
that.detailSource.forEach(r => { |
||||
|
r.subList.forEach(s => { |
||||
|
s.isRecommTaskItem = true//为推荐任务 |
||||
|
}) |
||||
|
}) |
||||
|
//任务中已经扫描,模拟扫描赋值 |
||||
|
if (this.scanMessage) { |
||||
|
this.openScanPopupSimulate(this.scanMessage); |
||||
|
|
||||
|
} |
||||
|
setTimeout(r => { |
||||
|
that.resizeCollapse(); |
||||
|
}, 100) |
||||
|
// that.detailSource.forEach(r => { |
||||
|
// r.subList.forEach(s => { |
||||
|
// if (this.scanedPackingNumber && this.scanedPackingNumber == s |
||||
|
// .packingNumber) { |
||||
|
// s.scaned = true |
||||
|
// s.cancleScanedHiht = true |
||||
|
// //模拟扫描功能 |
||||
|
// this.openScanPopupSimulate(s); |
||||
|
// this.scanedPackingNumber = '' |
||||
|
// } |
||||
|
// }) |
||||
|
// }) |
||||
|
|
||||
|
} else { |
||||
|
that.showMessage('列表数据为0'); |
||||
|
} |
||||
|
} |
||||
|
}).catch(error => { |
||||
|
uni.hideLoading() |
||||
|
this.showErrorMessage(error) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
closeScan() { |
||||
|
this.resizeCollapse(); |
||||
|
}, |
||||
|
|
||||
|
getScanResult(result, managementTypeParams) { |
||||
|
this.managementType = managementTypeParams |
||||
|
let array1 = []//记录推荐的库位 |
||||
|
let array2 = []//记录推荐的批次 |
||||
|
this.detailSource.forEach(item=>{ |
||||
|
item.subList.forEach(cur=>{ |
||||
|
array1.push(cur.fromLocationCode) |
||||
|
array2.push(cur.batch) |
||||
|
}) |
||||
|
}) |
||||
|
// 扫描的库位是否在 |
||||
|
const obj1 = array1.find(item=>item == result.fromLocationCode) |
||||
|
const obj2 = array2.find(item=>item == result.label.batch) |
||||
|
if(this.jobContent.allowModifyLocation == 'FALSE'){ |
||||
|
if(!obj1){ |
||||
|
this.showErrorMessage(`不可以扫描推荐库位【${array1.join(',')}】以外的库位`) |
||||
|
return |
||||
|
} |
||||
|
} |
||||
|
if(this.jobContent.allowModifyBatch == 'FALSE'){ |
||||
|
if(!obj2){ |
||||
|
this.showErrorMessage(`不可以扫描推荐批次【${array2.join(',')}】以外的批次`) |
||||
|
return |
||||
|
} |
||||
|
} |
||||
|
if(!obj1){ |
||||
|
this.recommendQty = 0 |
||||
|
}else{ |
||||
|
this.recommendQty = result.balance.qty |
||||
|
} |
||||
|
// this.managementType = managementTypeParams |
||||
|
if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){ |
||||
|
this.setDataBatch(result) |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
setDataBatch(result) { |
||||
|
console.log(result) |
||||
|
try { |
||||
|
let that = this |
||||
|
this.balanceinfo = result.balance |
||||
|
var packingNumber = result.label.packingNumber; |
||||
|
var batch = result.label.batch; |
||||
|
var qty = result.label.qty; |
||||
|
var itemCode = result.label.itemCode; |
||||
|
var locationCode = result.fromLocationCode; |
||||
|
|
||||
|
if (!result.balance) { |
||||
|
this.showMessage("没有库存余额") |
||||
|
return; |
||||
|
} |
||||
|
// var inventoryStatus = "OK"; |
||||
|
var detail = this.detailSource.find(r => r.itemCode == itemCode); |
||||
|
|
||||
|
if (detail == undefined) { |
||||
|
this.showErrorMessage("物料号【" + itemCode + "】不在列表中") |
||||
|
} else { |
||||
|
|
||||
|
var itemDetail = detail.subList.find(r => { |
||||
|
return r.batch == batch && |
||||
|
r.fromLocationCode == result.fromLocationCode |
||||
|
}) |
||||
|
if (itemDetail == undefined) { |
||||
|
var isExit; |
||||
|
for (let subItem of detail.subList) { |
||||
|
var item; |
||||
|
// for (let pack of subItem.packList) { |
||||
|
// if (pack.batch == batch) { |
||||
|
// item = pack; |
||||
|
// isExit = pack; |
||||
|
// break; |
||||
|
// } |
||||
|
// } |
||||
|
// if (item != undefined) { |
||||
|
// subItem.scaned = true |
||||
|
// subItem.handleQty = 0; |
||||
|
// item = undefined |
||||
|
// } |
||||
|
} |
||||
|
if (isExit == undefined) { |
||||
|
// this.showErrorMessage("批次【" + batch + "】库位【" + result |
||||
|
// .fromLocationCode + "】不在列表中") |
||||
|
detail.subList.push({ |
||||
|
scaned:true, |
||||
|
fromLocationCode:this.fromLocationCode, |
||||
|
toLocationCode:this.toLocationCode, |
||||
|
batch:result.label.batch, |
||||
|
handleQty:result.label.qty, |
||||
|
qty:0, |
||||
|
inventoryStatus:result.balance.inventoryStatus, |
||||
|
toLocation:result.balance.toLocation, |
||||
|
balance:result.balance, |
||||
|
balanceQty:result.balance.qty, |
||||
|
packQty:result.package.packQty, |
||||
|
packUnit:result.package.packUnit, |
||||
|
uom:result.balance.uom, |
||||
|
isRecommTaskItem:false,//不是推荐任务中的任务 |
||||
|
// packList:[{ |
||||
|
// scaned : true, |
||||
|
// handleQty : Number(result.label.qty), |
||||
|
// toLocationCode : result.balance.toLocationCode, |
||||
|
// }] |
||||
|
}) |
||||
|
detail.handleQty = 0 |
||||
|
detail.qty = 0 |
||||
|
detail.subList.forEach(item=>{ |
||||
|
item.handleQty =item.handleQty || 0 |
||||
|
detail.handleQty = calc.add(detail.handleQty,item.handleQty) |
||||
|
detail.qty = calc.add(detail.qty,item.qty) |
||||
|
// item.packList.forEach(cur=>{ |
||||
|
// cur.handleQty = calc.add(detail.handleQty,item.handleQty) |
||||
|
// }) |
||||
|
}) |
||||
|
setTimeout(r => { |
||||
|
that.resizeCollapse(); |
||||
|
that.$forceUpdate() |
||||
|
}, 100) |
||||
|
} else { |
||||
|
if (!isExit.cancleScanedHiht && isExit.scaned) { |
||||
|
// this.showMessage("批次【" + batch + "】已经扫描") |
||||
|
} else { |
||||
|
isExit.scaned = true |
||||
|
let qty = 0; |
||||
|
if (result.balance != null) { |
||||
|
qty = Number(result.balance.qty); |
||||
|
} else { |
||||
|
qty = Number(result.label.qty); |
||||
|
} |
||||
|
isExit.handleQty = Number(result.label.qty); |
||||
|
isExit.toLocationCode = this.toLocationCode; |
||||
|
} |
||||
|
itemDetail.handleQty = calc.add(itemDetail.handleQty,result.label.qty); |
||||
|
detail.handleQty = 0 |
||||
|
detail.balance = result.balance, |
||||
|
detail.subList.forEach(item=>{ |
||||
|
item.handleQty =item.handleQty || 0 |
||||
|
detail.handleQty = calc.add(detail.handleQty,item.handleQty) |
||||
|
// item.packList.forEach(cur=>{
// cur.handleQty = calc.add(detail.handleQty,item.handleQty)
// }) |
||||
|
}) |
||||
|
// calcHandleQtyAdd(this.detailSource, result.label); |
||||
|
} |
||||
|
this.continueScan() |
||||
|
this.$forceUpdate() |
||||
|
} else { |
||||
|
var scanedLength = 0; |
||||
|
// itemDetail.packList.forEach(res => { |
||||
|
// if (res.scaned) { |
||||
|
// scanedLength++; |
||||
|
// } |
||||
|
// }) |
||||
|
//大哥让加的 |
||||
|
itemDetail.fromInventoryStatus = result.balance.inventoryStatus; |
||||
|
|
||||
|
if (itemDetail.scaned ) { |
||||
|
// this.showMessage("箱码【" + packingNumber + "】已经扫描") |
||||
|
// calcHandleQtyAdd(this.detailSource, result.label); |
||||
|
itemDetail.balance=result.balance |
||||
|
itemDetail.balanceQty=result.balance.qty |
||||
|
itemDetail.uom=result.balance.uom, |
||||
|
itemDetail.handleQty = calc.add(itemDetail.handleQty,result.label.qty); |
||||
|
detail.handleQty = 0 |
||||
|
detail.subList.forEach(item=>{ |
||||
|
detail.handleQty = calc.add(detail.handleQty,item.handleQty) |
||||
|
}) |
||||
|
} else { |
||||
|
itemDetail.scaned = true; |
||||
|
this.detailSource[0].subList.sort(compareAsc('scaned')); //按扫描信息排序 |
||||
|
itemDetail.handleQty = result.label.qty; |
||||
|
itemDetail.scaned = true |
||||
|
itemDetail.balance=result.balance |
||||
|
itemDetail.balanceQty=result.balance.qty |
||||
|
itemDetail.uom=result.balance.uom |
||||
|
itemDetail.packQty=result.package.packQty |
||||
|
itemDetail.packUnit=result.package.packUnit |
||||
|
itemDetail.fromlocationCode=this.fromLocationCode |
||||
|
itemDetail.toLocationCode=this.toLocationCode |
||||
|
itemDetail.isRecommTaskItem = true//是推荐任务中的数量 |
||||
|
// itemDetail.toInventoryStatus = "OK" |
||||
|
// itemDetail.packList.forEach(pac => { |
||||
|
// pac.scaned = true |
||||
|
// pac.handleQty = Number(result.label.qty); |
||||
|
// pac.toLocationCode = result.balance.toLocationCode; |
||||
|
// }) |
||||
|
detail.handleQty = 0 |
||||
|
detail.subList.forEach(item=>{ |
||||
|
console.log(item.handleQty) |
||||
|
item.handleQty =item.handleQty || 0 |
||||
|
detail.handleQty = calc.add(detail.handleQty,item.handleQty) |
||||
|
// item.packList.forEach(cur=>{
// cur.handleQty = calc.add(detail.handleQty,item.handleQty)
// }) |
||||
|
}) |
||||
|
// calcTreeHandleQty(this.detailSource); |
||||
|
this.continueScan() |
||||
|
this.$forceUpdate() |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
this.detailSource.forEach(item => { |
||||
|
item.subList.forEach(detail => { |
||||
|
detail.packingNumber = '' |
||||
|
}) |
||||
|
}) |
||||
|
} catch (e) { |
||||
|
this.showMessage(e.message) |
||||
|
} |
||||
|
}, |
||||
|
//继续扫描 |
||||
|
continueScan() { |
||||
|
this.scanCount = getScanCount(this.subList); |
||||
|
if (this.scanCount == this.subList.length) { |
||||
|
this.closeScanPopup(); |
||||
|
} else { |
||||
|
this.scanPopupGetFocus(); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
submit() { |
||||
|
uni.showLoading({ |
||||
|
title: "提交中....", |
||||
|
mask: true |
||||
|
}); |
||||
|
//目前任务只到一个库位 |
||||
|
var itemCodes = [] |
||||
|
let locationCode = this.toLocationCode |
||||
|
this.detailSource.forEach(toLocation => { |
||||
|
itemCodes.push(toLocation.itemCode) |
||||
|
}) |
||||
|
|
||||
|
//获取管理模式,封装参数 |
||||
|
getManagementPrecisions(itemCodes, locationCode, res => { |
||||
|
if (res.success) { |
||||
|
this.managementList = res.list; |
||||
|
this.submitJob(); |
||||
|
} else { |
||||
|
uni.hideLoading(); |
||||
|
this.showErrorMessage(res.message); |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
submitJob() { |
||||
|
var params = this.setParams() |
||||
|
console.log(params) |
||||
|
|
||||
|
// if (!params.subList || params.subList.length == 0) { |
||||
|
// uni.hideLoading() |
||||
|
// this.showErrorMessage("请扫描您需要提交的发料任务") |
||||
|
// return |
||||
|
// } |
||||
|
const isTrue = params.subList.some(item=>{ |
||||
|
return item.recordList.some(cur=>cur.scaned) == true |
||||
|
}) |
||||
|
|
||||
|
if(!isTrue){ |
||||
|
uni.hideLoading() |
||||
|
this.showErrorMessage("请扫描您需要提交的发料任务") |
||||
|
return |
||||
|
} |
||||
|
|
||||
|
console.log("提交参数", params); |
||||
|
return |
||||
|
issueJobSubmit(params).then(res => { |
||||
|
uni.hideLoading() |
||||
|
if (res.data) { |
||||
|
this.showCommitSuccessMessage("提交成功\n生成发料记录\n" + res.data) |
||||
|
} else { |
||||
|
this.showErrorMessage("提交失败[" + res.msg + "]") |
||||
|
} |
||||
|
}).catch(error => { |
||||
|
uni.hideLoading() |
||||
|
this.showErrorMessage(error) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
setParams() { |
||||
|
var subList = [] |
||||
|
var createTime = getCurrDateTime(); |
||||
|
var creator = this.$store.state.user.id |
||||
|
this.detailSource.forEach(toLocationCode => { |
||||
|
let arr = [] |
||||
|
toLocationCode.subList.forEach(record=>{ |
||||
|
if(record.scaned){ |
||||
|
let obj = {...toLocationCode,...record} |
||||
|
obj.recordList = [] |
||||
|
delete obj.balance |
||||
|
delete obj.subList |
||||
|
let obj1 ={} |
||||
|
obj1.supplierCode = record.supplierCode; |
||||
|
obj1.batch = record.batch; |
||||
|
obj1.copyContent =record.copyContent; |
||||
|
obj1.fromInventoryStatus =record.fromInventoryStatus; |
||||
|
obj1.fromLocationCode =record.fromLocationCode; |
||||
|
obj1.handleQty =record.handleQty; |
||||
|
obj1.inventoryStatus =record.fromInventoryStatus; |
||||
|
obj1.packQty =record.packQty; |
||||
|
obj1.packUnit =record.packUnit; |
||||
|
obj1.packingNumber =record.packingNumber; |
||||
|
obj1.qty =record.qty; |
||||
|
obj1.scaned =record.scaned; |
||||
|
obj1.toLocationCode =record.toLocationCode; |
||||
|
obj1.fromPackingNumber =''; |
||||
|
obj1.fromBatch = record.batch; |
||||
|
obj1.toBatch = record.batch; |
||||
|
obj1.toInventoryStatus = record.inventoryStatus; |
||||
|
obj1.toPackingNumber =""; |
||||
|
obj1.packingNumber = ""; |
||||
|
|
||||
|
let single_price = record.balance.singlePrice == null ? 0 : record.balance.singlePrice; |
||||
|
|
||||
|
obj1.singlePrice = single_price; |
||||
|
obj1.amount = single_price *record.qty; |
||||
|
obj.recordList.push(obj1) |
||||
|
subList.push(obj) |
||||
|
} |
||||
|
}) |
||||
|
}) |
||||
|
|
||||
|
this.jobContent.subList = subList |
||||
|
this.jobContent.createTime = createTime; |
||||
|
this.jobContent.creator = creator; |
||||
|
return this.jobContent; |
||||
|
}, |
||||
|
|
||||
|
cancel() { |
||||
|
let that = this; |
||||
|
this.$refs.comMessage.showQuestionMessage('是否要清空已扫描的物料和目标库位信息?', res => { |
||||
|
if (res) { |
||||
|
that.clearInfo(); |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
clearInfo() { |
||||
|
this.dataContent.itemCodeList.forEach(res => { |
||||
|
if (res.recommendList != null) { |
||||
|
res.recommendList.forEach(res1 => { |
||||
|
if (res1.locationCodeList != null) { |
||||
|
res1.locationCodeList.forEach(res2 => { |
||||
|
if (res2.packingCodeList != null) { |
||||
|
res2.packingCodeList.forEach(res3 => { |
||||
|
res3.itemCode = ""; |
||||
|
res3.qty = 0; |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
updateData(record) { |
||||
|
this.detailSource.forEach(item=>{ |
||||
|
item.handleQty = 0 |
||||
|
item.subList.forEach(cur=>{ |
||||
|
item.handleQty = calc.add(cur.handleQty,item.handleQty) |
||||
|
}) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
afterScan() { |
||||
|
this.resizeCollapse(); |
||||
|
// this.autoCommit() |
||||
|
}, |
||||
|
|
||||
|
autoCommit(){ |
||||
|
// this.$throttle(this.submit, 2000, this)() |
||||
|
// this.jobContent.allowSmallerQty = 'FALSE' |
||||
|
// this.jobContent.allowBiggerQty = 'FALSE' |
||||
|
let str="" |
||||
|
let str1="" |
||||
|
let str2="" |
||||
|
let str3="" |
||||
|
let isTrue = true |
||||
|
this.detailSource.forEach(detail => { |
||||
|
const isScaned = detail.subList.some(cur=>cur.scaned) |
||||
|
if(isScaned){ |
||||
|
if(parseFloat(detail.handleQty)<parseFloat(detail.qty)){ |
||||
|
str += `物料号【${detail.itemCode}】提交数量【${detail.handleQty}】不允许小于任务数量【${detail.qty}】\n` |
||||
|
} |
||||
|
if(parseFloat(detail.handleQty)>parseFloat(detail.qty)){ |
||||
|
str1 += `物料号【${detail.itemCode}】提交数量【${detail.handleQty}】不允许大于任务数量【${detail.qty}\n】` |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
detail.subList.forEach(item => { |
||||
|
if(item.scaned){ |
||||
|
if(parseFloat(item.handleQty)>parseFloat(item.balance.qty)){ |
||||
|
str2 += `物料号【${detail.itemCode}】批次【${item.batch}】提交数量【${parseFloat(item.handleQty)}】不可以大于库存数量【${item.balance.qty}】\n` |
||||
|
} |
||||
|
} |
||||
|
if(item.isRecommTaskItem){//扫描推荐任务中的任务时候才有这个提示 |
||||
|
item.handleQty = item.handleQty || 0 |
||||
|
if(item.handleQty == 0 && isTrue){ |
||||
|
isTrue = false |
||||
|
str3 = '推荐的箱码没扫,' |
||||
|
} |
||||
|
if(parseFloat(item.handleQty)!=parseFloat(item.qty)){ |
||||
|
str3 += `物料号【${detail.itemCode}】批次【${item.batch}】扫描数量【${parseFloat(item.handleQty)}】和任务数量【${item.qty}】不一致\n` |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
}) |
||||
|
}) |
||||
|
if (this.jobContent.allowSmallerQty == "FALSE") { |
||||
|
if (str) { |
||||
|
str = '不允许提交\n' + str |
||||
|
this.showErrorMessage(str) |
||||
|
return |
||||
|
} |
||||
|
} |
||||
|
if (this.jobContent.allowBiggerQty == 'FALSE') { |
||||
|
if (str1) { |
||||
|
str1 = '不允许提交\n' + str1 |
||||
|
this.showErrorMessage(str1) |
||||
|
return |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
if (str2) { |
||||
|
str2 = '不允许提交\n' + str2 |
||||
|
this.showErrorMessage(str2) |
||||
|
return |
||||
|
} |
||||
|
console.log(str3) |
||||
|
if(str3){ |
||||
|
str3 = str3+"是否提交" |
||||
|
this.$refs.comMessage.showQuestionMessage1(str3, 'red', res => { |
||||
|
if (res) { |
||||
|
//防止重复点击 |
||||
|
this.$throttle(this.submit, 2000, this)() |
||||
|
} else { |
||||
|
this.scanPopupGetFocus() |
||||
|
} |
||||
|
}); |
||||
|
}else { |
||||
|
//防止重复点击 |
||||
|
this.$throttle(this.submit, 2000, this)() |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
scanPopupGetFocus() { |
||||
|
if (this.$refs.comScanIssuePack) { |
||||
|
this.$refs.comScanIssuePack.getfocus(); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
showMessage(message) { |
||||
|
this.$refs.comMessage.showMessage(message, res => { |
||||
|
if (res) { |
||||
|
this.afterCloseMessage() |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
showErrorMessage(message) { |
||||
|
this.$refs.comMessage.showErrorMessage(message, res => { |
||||
|
if (res) { |
||||
|
this.afterCloseMessage() |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
showScanMessage(message) { |
||||
|
this.$refs.comMessage.showScanMessage(message); |
||||
|
}, |
||||
|
|
||||
|
showCommitSuccess() { |
||||
|
this.$refs.comMessage.showCommitSuccess(); |
||||
|
}, |
||||
|
|
||||
|
showCommitSuccessMessage(hint) { |
||||
|
this.$refs.comMessage.showSuccessMessage(hint, res => { |
||||
|
navigateBack(1) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
showRescanMessage(message) { |
||||
|
this.$refs.comMessage.showRescanMessage(message); |
||||
|
}, |
||||
|
|
||||
|
afterCloseMessage() { |
||||
|
this.scanPopupGetFocus(); |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
closeScanMessage() { |
||||
|
this.scanPopupGetFocus(); |
||||
|
}, |
||||
|
confirm(data) { |
||||
|
this.dataContent = data; |
||||
|
}, |
||||
|
confirmResult(result) { |
||||
|
this.dataContent = result; |
||||
|
this.$forceUpdate(); |
||||
|
}, |
||||
|
openScanPopup() { |
||||
|
let fromlocationCode = ''; |
||||
|
let fromlocationList = []; |
||||
|
for (var i = 0; i < this.detailSource.length; i++) { |
||||
|
let item = this.detailSource[i]; |
||||
|
item.subList.forEach(l => { |
||||
|
//重复的库位不往里面插入 |
||||
|
var location = fromlocationList.find(res => res == l.fromLocationCode) |
||||
|
if (location == undefined) { |
||||
|
fromlocationList.push(l.fromLocationCode); |
||||
|
} |
||||
|
//来源库位赋默认值 |
||||
|
if (fromlocationCode == '') { |
||||
|
if (!l.scaned) { |
||||
|
fromlocationCode = l.fromLocationCode; |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
this.$refs.scanPopup.openScanPopupForJob(fromlocationCode, fromlocationList, this.jobContent); |
||||
|
}, |
||||
|
|
||||
|
openScanPopupSimulate(scanMessage) { |
||||
|
this.$refs.comScanIssuePack.openScanPopupForJobSimulate(this.detailSource, this.jobContent, scanMessage); |
||||
|
}, |
||||
|
|
||||
|
closeScanPopup() { |
||||
|
// this.updateCommitBtn(); |
||||
|
}, |
||||
|
confirmFromLocation(fromLocationCodeParams){ |
||||
|
this.fromLocationCode = fromLocationCodeParams |
||||
|
} |
||||
|
} |
||||
|
}; |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
.uni-numbox__value { |
||||
|
width: 40px; |
||||
|
} |
||||
|
|
||||
|
button[disabled] { |
||||
|
background-color: #3C9CFF; |
||||
|
color: #fff; |
||||
|
opacity: 0.7; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
// /deep/ .input-value { |
||||
|
// font-size: 16px; |
||||
|
// } |
||||
|
|
||||
|
// /deep/ .uni-collapse-item__title-text { |
||||
|
// font-size: 16px; |
||||
|
// } |
||||
|
|
||||
|
// /deep/ .uni-collapse-item--border { |
||||
|
// border-bottom-width: 0px; |
||||
|
// border-bottom-color: #ebeef5; |
||||
|
// } |
||||
|
|
||||
|
// /deep/ .uni-collapse-item--border { |
||||
|
// border-bottom-width: 1px; |
||||
|
// border-bottom-color: #ebeef5; |
||||
|
// } |
||||
|
</style> |
@ -0,0 +1,569 @@ |
|||||
|
<template> |
||||
|
<view class="page-wraper"> |
||||
|
<view class=""> |
||||
|
<com-blank-view @goScan='showFromLocationPopup' v-if="detailSource.length==0"></com-blank-view> |
||||
|
</view> |
||||
|
<view class="page-wraper" v-if="detailSource.length>0"> |
||||
|
|
||||
|
<view class="page-main"> |
||||
|
<scroll-view scroll-y="true" class="page-main-scroll"> |
||||
|
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> |
||||
|
<view class=""> |
||||
|
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent" |
||||
|
:isShowFromLocation="true" @removeItem="removeItem(index,item)" |
||||
|
:isShowToLocation="false" :isShowParentToLocation="false" @updateData="updateData" |
||||
|
:allowModifyQty="true" |
||||
|
@removePack="removePack"> |
||||
|
</record-com-detail-card> |
||||
|
|
||||
|
</view> |
||||
|
</view> |
||||
|
</scroll-view> |
||||
|
</view> |
||||
|
<view class="page-footer"> |
||||
|
<view class="uni-flex u-col-center space-between padding_10" |
||||
|
style="background-color:ghostwhite; width: 100%; "> |
||||
|
<view class="uni-row uni-flex"> |
||||
|
<text>生产线:</text> |
||||
|
<view class="uni-flex u-col-center uni-row" @click="showSelect"> |
||||
|
<view class="" style="margin-left: 20rpx;"> |
||||
|
{{positionInfo}} |
||||
|
</view> |
||||
|
<u-select v-model="show" mode="mutil-column-auto" :list="positionList" |
||||
|
@confirm="confirmSelect"></u-select> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class=" uni-flex uni-row"> |
||||
|
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
||||
|
</view> |
||||
|
<win-scan-location ref="scanFromLocationCode" title="来源库位" @getLocation='getFromLocation' |
||||
|
:locationAreaTypeList="fromLocationAreaTypeList"></win-scan-location> |
||||
|
|
||||
|
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' :title="'箱码'"> |
||||
|
</win-scan-pack-and-location> |
||||
|
<!-- <winComScanBalance ref="scanPopup" @getBalance='getScanResult' :bussinessCode="businessTypeCode"> |
||||
|
</winComScanBalance> --> |
||||
|
<fifoQuery ref="refFifoQuery" :businessTypeCode="businessTypeCode"></fifoQuery> |
||||
|
|
||||
|
<comMessage ref="comMessage"></comMessage> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
issueRecordSubmit, |
||||
|
getWorkShopLineStation, |
||||
|
getBalanceByFilter |
||||
|
} from '@/api/request2.js'; |
||||
|
|
||||
|
import { |
||||
|
goHome, |
||||
|
getPackingNumberAndBatchByList, |
||||
|
deepCopyData, |
||||
|
getSwitchInfoByCode |
||||
|
} from '@/common/basic.js'; |
||||
|
|
||||
|
import { |
||||
|
calc |
||||
|
} from '@/common/calc.js'; |
||||
|
|
||||
|
import { |
||||
|
getInventoryStatusDesc, |
||||
|
getDirectoryItemArray |
||||
|
} from '@/common/directory.js'; |
||||
|
|
||||
|
import { |
||||
|
getBusinessType, |
||||
|
createItemInfo, |
||||
|
createDetailInfo, |
||||
|
calcHandleQty, |
||||
|
} from '@/common/record.js'; |
||||
|
|
||||
|
import { |
||||
|
getManagementPrecisions, |
||||
|
getPrecisionStrategyList, |
||||
|
getPrecisionStrategyParams |
||||
|
} from '@/common/balance.js'; |
||||
|
|
||||
|
import { |
||||
|
Decimal |
||||
|
} from 'decimal.js'; //引入 |
||||
|
|
||||
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
||||
|
import winScanPack from '@/mycomponents/scan/winScanPack.vue' |
||||
|
import requiredLocation from '@/mycomponents/location/requiredLocation.vue' |
||||
|
import comBlankView from '@/mycomponents/common/comBlankView.vue' |
||||
|
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" |
||||
|
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" |
||||
|
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' |
||||
|
import recordDetailCard from '@/mycomponents/record/recordDetailCard.vue' |
||||
|
import balanceSelect from '@/mycomponents/balance/balanceSelect.vue' |
||||
|
import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue' |
||||
|
import fifoQuery from '@/mycomponents/query/fifoQuery.vue' |
||||
|
|
||||
|
|
||||
|
export default { |
||||
|
components: { |
||||
|
winScanButton, |
||||
|
winScanPack, |
||||
|
requiredLocation, |
||||
|
comBlankView, |
||||
|
winScanLocation, |
||||
|
winScanPackAndLocation, |
||||
|
recordComDetailCard, |
||||
|
recordDetailCard, |
||||
|
balanceSelect, |
||||
|
winComScanBalance, |
||||
|
fifoQuery |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
id: '', |
||||
|
dataContent: {}, //内容 |
||||
|
detailSource: [], //绑定在页面上的数据源 |
||||
|
fromLocationInfo: {}, |
||||
|
fromLocationCode: "", |
||||
|
fromLocationAreaTypeList: [], |
||||
|
toLocationAreaTypeList: [], |
||||
|
inInventoryStatus: "", //目标入库库存状态 |
||||
|
outInventoryStatus: "", //来源出库库存状态 |
||||
|
businessType: {}, |
||||
|
showToLoaction: true, |
||||
|
recommendLocationList: [], //推荐库位列表 |
||||
|
fromWarehouseCode: '', //来源仓库 |
||||
|
businessTypeCode: "Issue", |
||||
|
positionList: [], |
||||
|
show: false, |
||||
|
positionInfo: "请选择生产线", |
||||
|
resultData: {}, |
||||
|
itemCode: "", |
||||
|
managementType: '', |
||||
|
fifoSwitch:false |
||||
|
}; |
||||
|
}, |
||||
|
onLoad(option) { |
||||
|
uni.setNavigationBarTitle({ |
||||
|
title: option.title |
||||
|
}) |
||||
|
this.clearData(); |
||||
|
this.getBusinessType() |
||||
|
this.fifoSwitch = getSwitchInfoByCode("directIssueFifoSwitch") |
||||
|
// if (this.positionList.length == 0) { |
||||
|
getWorkShopLineStation().then(res => { |
||||
|
if (res.data != null && res.data.length > 0) { |
||||
|
this.positionList = res.data |
||||
|
} else { |
||||
|
this.showErrorMessage('未查找到位置信息'); |
||||
|
} |
||||
|
|
||||
|
}).catch(error => { |
||||
|
this.showErrorMessage(error); |
||||
|
}) |
||||
|
// } |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
//返回首页 |
||||
|
onNavigationBarButtonTap(e) { |
||||
|
if (e.index === 0) { |
||||
|
goHome(); |
||||
|
} else if (e.index == 1) { |
||||
|
this.$refs.refFifoQuery.showDrawer(); |
||||
|
this.closeScanPopup(); |
||||
|
} |
||||
|
}, |
||||
|
//拦截返回按钮事件 |
||||
|
onBackPress(e) {}, |
||||
|
|
||||
|
onPullDownRefresh() {}, |
||||
|
|
||||
|
mounted() {}, |
||||
|
|
||||
|
methods: { |
||||
|
getBusinessType() { |
||||
|
getBusinessType(this.businessTypeCode, res => { |
||||
|
if (res.success) { |
||||
|
this.businessType = res.businessType; |
||||
|
this.fromInventoryStatuses = getDirectoryItemArray(res.fromInventoryStatuses); |
||||
|
this.fromLocationAreaTypeList = res.fromLocationAreaTypeList |
||||
|
this.showFromLocationPopup(); |
||||
|
} else { |
||||
|
this.showErrorMessage(res.message) |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
getScanResult(result, managementTypeParams) { |
||||
|
this.managementType = managementTypeParams |
||||
|
if (managementTypeParams == "BY_BATCH" || managementTypeParams == "BY_QUANTITY") { |
||||
|
this.setDataBatch(result); |
||||
|
} else { |
||||
|
this.setData(result); |
||||
|
} |
||||
|
}, |
||||
|
async setData(result) { |
||||
|
let balance = result.balance; |
||||
|
let label = result.label; |
||||
|
let pack = result.package; |
||||
|
var item = this.detailSource.find(res => { |
||||
|
if (res.itemCode == balance.itemCode) { |
||||
|
return res |
||||
|
} |
||||
|
}) |
||||
|
if (item == undefined) { |
||||
|
var itemp = createItemInfo(balance, pack); |
||||
|
let newDetail = createDetailInfo(balance, pack); // |
||||
|
itemp.subList.push(newDetail); |
||||
|
this.detailSource.push(itemp) |
||||
|
} else { |
||||
|
var detail = item.subList.find(r => { |
||||
|
if (r.packingNumber == balance.packingNumber && |
||||
|
r.batch == balance.batch && |
||||
|
r.locationCode == balance.locationCode && |
||||
|
r.inventoryStatus == balance.inventoryStatus) { |
||||
|
return r; |
||||
|
} |
||||
|
}) |
||||
|
if (detail == undefined) { |
||||
|
let newDetail = createDetailInfo(balance, pack); |
||||
|
item.subList.push(newDetail); |
||||
|
} else { |
||||
|
if (detail.scaned == true) { |
||||
|
this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]重复扫描") |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
calcHandleQty(this.detailSource) |
||||
|
}, |
||||
|
|
||||
|
setDataBatch(result) { |
||||
|
let balance = result.balance; |
||||
|
let label = result.label; |
||||
|
let pack = result.package; |
||||
|
var item = this.detailSource.find(res => { |
||||
|
if (res.itemCode == balance.itemCode) { |
||||
|
return res |
||||
|
} |
||||
|
}) |
||||
|
if (item == undefined) { |
||||
|
var itemp = createItemInfo(balance, pack); |
||||
|
let newDetail = createDetailInfo(balance, pack,label); |
||||
|
newDetail.handleQty =label.qty |
||||
|
itemp.subList.push(newDetail); |
||||
|
this.detailSource.push(itemp) |
||||
|
} else { |
||||
|
var detail = item.subList.find(r => { |
||||
|
if (r.batch == balance.batch && |
||||
|
r.locationCode == balance.locationCode && |
||||
|
r.inventoryStatus == balance.inventoryStatus) { |
||||
|
return r; |
||||
|
} |
||||
|
}) |
||||
|
if (detail == undefined) { |
||||
|
let newDetail = createDetailInfo(balance, pack,label); |
||||
|
newDetail.handleQty =label.qty |
||||
|
item.subList.push(newDetail); |
||||
|
} else { |
||||
|
detail.handleQty =calc.add(detail.handleQty, result.label.qty) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
calcHandleQty(this.detailSource) |
||||
|
}, |
||||
|
|
||||
|
showErrorMessage(message) { |
||||
|
this.$refs.comMessage.showErrorMessage(message, res => { |
||||
|
if (res) { |
||||
|
this.scanPopupGetFocus() |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
showSelect() { |
||||
|
// if (this.editPosition) { |
||||
|
this.show = true |
||||
|
// } |
||||
|
}, |
||||
|
|
||||
|
confirmSelect(e) { |
||||
|
this.positionInfo = e[0].label + "-" + e[1].label + "-" + e[2].label |
||||
|
console.log("位置", this.positionInfo) |
||||
|
this.workshopCode = e[0].value |
||||
|
this.productionLineCode = e[1].value |
||||
|
this.workStationCode = e[2].value |
||||
|
this.workShopName = e[0].label |
||||
|
this.productionLineName = e[1].label |
||||
|
this.workStationName = e[2].label |
||||
|
|
||||
|
let shop = this.positionList.find(shop => shop.value == this.workshopCode); |
||||
|
if (shop != undefined && shop.children != undefined) { |
||||
|
let prodLine = shop.children.find(line => line.value == this.productionLineCode); |
||||
|
if (prodLine != undefined && prodLine.children != undefined) { |
||||
|
let station = prodLine.children.find(r => r.value == this.workStationCode); |
||||
|
if (station.rawLocationCode == '' && station.rawLocationCode == null) { |
||||
|
this.showErrorMessage(this.workStationName + "的原材料库位为空,请重新选择") |
||||
|
return; |
||||
|
} else { |
||||
|
this.rawLocationCode = station.rawLocationCode; |
||||
|
this.fgLocationCode = station.fgLocationCode; |
||||
|
} |
||||
|
} else { |
||||
|
this.showErrorMessage("生产线-工位基础信息维护错误") |
||||
|
} |
||||
|
} else { |
||||
|
this.showErrorMessage("车间-生产线基础信息维护错误") |
||||
|
} |
||||
|
|
||||
|
//赋值到库位代码 |
||||
|
let toLocationCode = '' |
||||
|
this.positionList.forEach(item => { |
||||
|
if (this.workshopCode == item.value) { // 车间 |
||||
|
item.children.find(child => { |
||||
|
if (this.productionLineCode == child.value) { |
||||
|
toLocationCode = child.children.find(subChild => this.workStationCode == |
||||
|
subChild.value).rawLocationCode; |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
this.detailSource.forEach(item => { |
||||
|
item.subList.forEach(detail => { |
||||
|
detail.toLocationCode = toLocationCode |
||||
|
detail.productionLineCode = this.productionLineCode |
||||
|
detail.workStationCode = this.workStationCode |
||||
|
}) |
||||
|
}) |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
removeItem(index, item) { |
||||
|
this.detailSource.splice(index, 1) |
||||
|
}, |
||||
|
|
||||
|
removePack() { |
||||
|
for (var i = 0; i < this.detailSource.length; i++) { |
||||
|
var item = this.detailSource[i]; |
||||
|
if (item.subList.length == 0) { |
||||
|
this.detailSource.splice(i, 1) |
||||
|
} |
||||
|
} |
||||
|
this.updateData(); |
||||
|
}, |
||||
|
|
||||
|
openScanPopup() { |
||||
|
if (this.businessType) { |
||||
|
if (this.fromLocationCode == "") { |
||||
|
this.showFromLocationPopup(); |
||||
|
return |
||||
|
} |
||||
|
this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType); |
||||
|
} else { |
||||
|
this.getBusinessType() |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
showFromLocationPopup() { |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.scanFromLocationCode.openScanPopup(); |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
closeScanPopup() { |
||||
|
if (this.$refs.scanFromLocationCode != undefined) { |
||||
|
this.$refs.scanFromLocationCode.closeScanPopup(); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
scanPopupGetFocus() { |
||||
|
if (this.$refs.scanPopup) { |
||||
|
this.$refs.scanPopup.packGetFocus(); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
// scanLocationCode(location, code) { |
||||
|
// this.toLocationCode = code |
||||
|
// this.toLocationCode = location; |
||||
|
|
||||
|
// }, |
||||
|
|
||||
|
commit() { |
||||
|
if (this.positionInfo == '请选择生产线' || !this.positionInfo) { |
||||
|
this.showErrorMessage("请选择生产线") |
||||
|
return |
||||
|
} |
||||
|
var commitHint="" |
||||
|
this.detailSource.forEach((item) => { |
||||
|
item.subList.forEach(cur=>{ |
||||
|
if(cur.scaned){ |
||||
|
if(parseFloat(cur.handleQty)>parseFloat(cur.qty)){ |
||||
|
commitHint += `物料号【${item.itemCode}】批次【${cur.batch}】实际提交数量【${cur.handleQty}】不可以大于库存数量【${cur.qty}】\n` |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
}) |
||||
|
if(commitHint){ |
||||
|
this.showErrorMessage(commitHint) |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
uni.showLoading({ |
||||
|
title: "提交中....", |
||||
|
mask: true |
||||
|
}); |
||||
|
|
||||
|
//记录有目标库位,需要查询管理模式 |
||||
|
let precisionStrategyParams = getPrecisionStrategyParams(this.detailSource); |
||||
|
//2:获取管理模式,封装参数 |
||||
|
getPrecisionStrategyList(precisionStrategyParams, res => { |
||||
|
if (res.success) { |
||||
|
this.managementList = res.list; |
||||
|
var params = { |
||||
|
...this.setRecordParams() |
||||
|
} |
||||
|
console.log("提交参数", JSON.stringify(params)); |
||||
|
const isHaveItem = params.subList.find(item => item.handleQty > item.balanceQty) |
||||
|
if (isHaveItem) { |
||||
|
this.showErrorMessage(`物料号${isHaveItem.itemCode}`) |
||||
|
this.$refs.comMessage.showConfirmWarningModal('物料号' + isHaveItem.itemCode + '数量[' + |
||||
|
isHaveItem.handleQty + ']不允许大于库存数量[' + isHaveItem.balanceQty + ']') |
||||
|
uni.hideLoading() |
||||
|
return |
||||
|
} |
||||
|
issueRecordSubmit(params).then(res => { |
||||
|
uni.hideLoading() |
||||
|
if (res.data) { |
||||
|
this.showCommitSuccessMessage("提交成功\n生成直接发料记录\n" + res.data) |
||||
|
} else { |
||||
|
this.showErrorMessage("提交失败[" + res.msg + "]") |
||||
|
} |
||||
|
}).catch(error => { |
||||
|
uni.hideLoading() |
||||
|
this.showErrorMessage(error) |
||||
|
}) |
||||
|
} else { |
||||
|
uni.hideLoading(); |
||||
|
this.showErrorMessage(res.message); |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
setRecordParams() { |
||||
|
var subList = [] |
||||
|
var creator = this.$store.state.user.id |
||||
|
this.detailSource.forEach(item => { |
||||
|
item.subList.forEach(detail => { |
||||
|
if (detail.scaned) { |
||||
|
var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode, |
||||
|
detail.packingNumber, detail.toLocationCode, detail.batch); |
||||
|
var submitItem = deepCopyData(detail) |
||||
|
submitItem.toPackingNumber = info.packingNumber; |
||||
|
submitItem.toBatch = info.batch; |
||||
|
submitItem.toContainerNumber = detail.containerNumber; |
||||
|
|
||||
|
submitItem.fromPackingNumber = info.packingNumber; |
||||
|
submitItem.fromBatch = info.batch; |
||||
|
submitItem.fromContainerNumber = detail.containerNumber; |
||||
|
|
||||
|
submitItem.fromLocationCode = detail.locationCode; |
||||
|
submitItem.toLocationCode = detail.toLocationCode; |
||||
|
|
||||
|
// detail.toInventoryStatus = detail.inventoryStatus |
||||
|
// detail.toLocationCode = detail.toLocationCode |
||||
|
submitItem.qty = detail.handleQty; |
||||
|
submitItem.package = ""; |
||||
|
submitItem.balanceQty = detail.balanceQty; |
||||
|
submitItem.recordList = [{ |
||||
|
toInventoryStatus: detail.inventoryStatus, |
||||
|
fromParentPackingNumber: detail.parentNumber, |
||||
|
fromPackingNumber: info.packingNumber, |
||||
|
fromBatch: info.batch, |
||||
|
toPackingNumber: info.packingNumber, |
||||
|
toBatch: info.batch, |
||||
|
fromLocationCode: detail.locationCode, |
||||
|
toLocationCode: detail.toLocationCode, |
||||
|
handleQty: detail.handleQty, |
||||
|
fromPackUnit: detail.packUnit, |
||||
|
toPackUnit: detail.packUnit, |
||||
|
fromPackQty: detail.packQty, |
||||
|
toPackQty: detail.packQty |
||||
|
}] |
||||
|
subList.push(submitItem) |
||||
|
} |
||||
|
}) |
||||
|
}) |
||||
|
if (subList.length > 0) { |
||||
|
this.dataContent.toWarehouseCode = subList[0].toWarehouseCode; |
||||
|
} |
||||
|
this.dataContent.subList = subList |
||||
|
this.dataContent.creator = creator; |
||||
|
this.dataContent.fromWarehouseCode = this.fromWarehouseCode; |
||||
|
return this.dataContent; |
||||
|
}, |
||||
|
|
||||
|
showMessage(message) { |
||||
|
this.$refs.comMessage.showMessage(message, res => { |
||||
|
if (res) {} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
showScanMessage(message) { |
||||
|
this.$refs.comMessage.showScanMessage(message); |
||||
|
}, |
||||
|
|
||||
|
afterCloseMessage() { |
||||
|
this.scanPopupGetFocus(); |
||||
|
}, |
||||
|
|
||||
|
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(); |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
updateData() { |
||||
|
calcHandleQty(this.detailSource); |
||||
|
for (var i = 0; i < this.detailSource.length; i++) { |
||||
|
let item = this.detailSource[i]; |
||||
|
if (item.qty == 0) { |
||||
|
this.detailSource.splice(i, 1) |
||||
|
} |
||||
|
} |
||||
|
this.$forceUpdate(); |
||||
|
|
||||
|
}, |
||||
|
getFromLocation(location) { |
||||
|
this.fromLocationCode = location.code; |
||||
|
this.fromLocationInfo = location; |
||||
|
this.openScanPopup(); |
||||
|
}, |
||||
|
clearData() { |
||||
|
this.fromLocationInfo = {}; |
||||
|
this.fromLocationCode = ''; |
||||
|
this.fromWarehouseCode = ''; |
||||
|
this.toWarehouseCode = ''; |
||||
|
this.detailSource = []; |
||||
|
this.positionInfo = "请选择生产线"; |
||||
|
this.itemCode = "" |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
</style> |
@ -0,0 +1,391 @@ |
|||||
|
<template> |
||||
|
<view class="page-wraper"> |
||||
|
<view class=""> |
||||
|
<com-blank-view @goScan='openScanPopup' v-if="detailSource.length==0"></com-blank-view> |
||||
|
</view> |
||||
|
|
||||
|
<view class="page-wraper" v-if="detailSource.length>0"> |
||||
|
<view class="page-main"> |
||||
|
<scroll-view scroll-y="true" class="page-main-scroll"> |
||||
|
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> |
||||
|
<view class=""> |
||||
|
<record-com-detail-card :dataContent="item" @removeItem="removeItem(index,item)" |
||||
|
@updateData="updateData" @removePack='updateData' :isShowToLocation="false" |
||||
|
:isShowPackingNumberProps="true" :isShowFromLocation="false" :isShowParentToLocation="false"> |
||||
|
</record-com-detail-card> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="uni-flex uni-row" style="margin-left: 30rpx;margin-top: 10rpx; "> |
||||
|
|
||||
|
<text style="font-size: 35rpx; margin-right: 20rpx;">拆出数量 :</text> |
||||
|
<numbeIntegerrBox :min="1" :step="1" :max="9999999" @change="calcQty($event,splitCount)" :value="splitCount"> |
||||
|
</numbeIntegerrBox> |
||||
|
<uom :uom="detailSource[0].uom"></uom> |
||||
|
</view> |
||||
|
</scroll-view> |
||||
|
</view> |
||||
|
|
||||
|
<view class="page-footer"> |
||||
|
<view class="uni-flex u-col-center space-between padding_10" |
||||
|
style="background-color:ghostwhite; width: 100%; "> |
||||
|
<view class=""> |
||||
|
</view> |
||||
|
<view class=" uni-flex uni-row"> |
||||
|
<button class="btn_single_commit" hover-class="btn_commit_after" |
||||
|
@click="$throttle(commit,2000,this)()">提交</button> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
|
||||
|
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
||||
|
</view> |
||||
|
|
||||
|
<win-scan-pack ref="scanPopup" @getResult='getScanResult' headerType='HPQ,HMQ'></win-scan-pack> |
||||
|
<comMessage ref="comMessage"></comMessage> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
goHome, |
||||
|
showConfirmMsg, |
||||
|
getCurrDateTime |
||||
|
} from '@/common/basic.js'; |
||||
|
|
||||
|
import { |
||||
|
splitPackageRecordForYtSubmit |
||||
|
} from '@/api/request2.js'; |
||||
|
|
||||
|
import { |
||||
|
calc |
||||
|
} from '@/common/calc.js'; |
||||
|
|
||||
|
import { |
||||
|
getInventoryStatusDesc, |
||||
|
getDirectoryItemArray |
||||
|
} from '@/common/directory.js'; |
||||
|
|
||||
|
import { |
||||
|
createItemInfo, |
||||
|
createDetailInfo, |
||||
|
calcHandleQty |
||||
|
} from '@/common/record.js'; |
||||
|
|
||||
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
||||
|
import winScanPack from '@/mycomponents/scan/winScanPack.vue' |
||||
|
import requiredLocation from '@/mycomponents/location/requiredLocation.vue' |
||||
|
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' |
||||
|
import comBlankView from '@/mycomponents/common/comBlankView.vue' |
||||
|
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" |
||||
|
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" |
||||
|
import recommendBalance from '@/mycomponents/balance/recommendBalance.vue' |
||||
|
import comPackageRecord from '@/pages/package/coms/comPackageRecord.vue' |
||||
|
import uom from '@/mycomponents/qty/uom.vue' |
||||
|
import numberBox from '@/mycomponents/qty/numberBox.vue' |
||||
|
import numbeIntegerrBox from '@/mycomponents/qty/numbeIntegerrBox.vue' |
||||
|
|
||||
|
export default { |
||||
|
components: { |
||||
|
winScanButton, |
||||
|
winScanPack, |
||||
|
requiredLocation, |
||||
|
comBlankView, |
||||
|
winScanLocation, |
||||
|
winScanPackAndLocation, |
||||
|
recommendBalance, |
||||
|
recordComDetailCard, |
||||
|
comPackageRecord, |
||||
|
uom, |
||||
|
numberBox, |
||||
|
numbeIntegerrBox |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
id: '', |
||||
|
detailSource: [], //绑定在页面上的数据源 |
||||
|
fromLocationCode: "", |
||||
|
toLocationCode: "", |
||||
|
fromLocationAreaTypeList: [], |
||||
|
inInventoryStatus: "", //目标入库库存状态 |
||||
|
outInventoryStatus: "", //来源出库库存状态 |
||||
|
businessType: {}, |
||||
|
dataContent: {}, |
||||
|
currentItemCode: "", |
||||
|
toPackingNumber: "", |
||||
|
itemCode: "", |
||||
|
splitCount: 1, |
||||
|
typeCode: "SplitPackage", |
||||
|
}; |
||||
|
}, |
||||
|
onLoad(option) { |
||||
|
uni.setNavigationBarTitle({ |
||||
|
title: option.title |
||||
|
}) |
||||
|
|
||||
|
this.openScanPopup(); |
||||
|
}, |
||||
|
//返回首页 |
||||
|
onNavigationBarButtonTap(e) { |
||||
|
if (e.index === 0) { |
||||
|
goHome(); |
||||
|
} |
||||
|
}, |
||||
|
//拦截返回按钮事件 |
||||
|
onBackPress(e) {}, |
||||
|
|
||||
|
onPullDownRefresh() {}, |
||||
|
|
||||
|
mounted() {}, |
||||
|
methods: { |
||||
|
openScanPopup() { |
||||
|
setTimeout(res=>{ |
||||
|
if (this.detailSource.length > 0) { |
||||
|
showConfirmMsg("拆标签信息还没提交,是否要重新扫描?", res => { |
||||
|
if (res) { |
||||
|
this.clearData(); |
||||
|
this.$refs.scanPopup.openScanPopup(""); |
||||
|
} |
||||
|
}) |
||||
|
} else { |
||||
|
this.$refs.scanPopup.openScanPopup(""); |
||||
|
} |
||||
|
},100) |
||||
|
}, |
||||
|
|
||||
|
getScanResult(result) { |
||||
|
this.setData(result); |
||||
|
}, |
||||
|
|
||||
|
setData(result) { |
||||
|
let balance = result.balance; |
||||
|
let label = result.label; |
||||
|
let itemCode = result.label.itemCode |
||||
|
let batch = result.label.batch; |
||||
|
let pack = result.package; |
||||
|
pack.qty = result.label.qty; |
||||
|
pack.inventoryStatus = "OK" |
||||
|
this.fromPackUnit = pack.packUnit; |
||||
|
this.fromPack = pack; |
||||
|
|
||||
|
var item = this.detailSource.find(res => { |
||||
|
if (res.itemCode == itemCode) { |
||||
|
return res |
||||
|
} |
||||
|
}) |
||||
|
if (item == undefined) { |
||||
|
if (this.itemCode != "" && this.itemCode != itemCode) { |
||||
|
this.showErrorMessage("请扫描物料为【" + this.itemCode + "】的箱码") |
||||
|
return; |
||||
|
} |
||||
|
var itemp = createItemInfo(pack, pack); |
||||
|
itemp.handleQty = 0 |
||||
|
let newDetail = createDetailInfo(pack, pack); // |
||||
|
newDetail.handleQty = 0 |
||||
|
newDetail.scaned = false |
||||
|
newDetail.packingNumber = pack.number |
||||
|
itemp.subList.push(newDetail); |
||||
|
this.detailSource.push(itemp) |
||||
|
this.itemCode = itemCode; |
||||
|
this.closeScanPopup() |
||||
|
} else { |
||||
|
// var detail = item.subList.find(r => { |
||||
|
// if (r.packingNumber == pack.packingNumber && |
||||
|
// r.batch == batch) { |
||||
|
// return r; |
||||
|
// } |
||||
|
// }) |
||||
|
// if (detail == undefined) { |
||||
|
// let newDetail = createDetailInfo(pack, pack); |
||||
|
// newDetail.packingNumber=pack.number |
||||
|
// newDetail.handleQty = 0 |
||||
|
// item.subList.push(newDetail); |
||||
|
// this.closeScanPopup() |
||||
|
// } else { |
||||
|
// if (detail.scaned == true) { |
||||
|
// this.showErrorMessage("箱码[" + detail.packingNumber + "批次[" + balance.batch + "]重复扫描") |
||||
|
// } |
||||
|
// } |
||||
|
} |
||||
|
this.calcHandleQty(); |
||||
|
}, |
||||
|
|
||||
|
calcHandleQty() { |
||||
|
calcHandleQty(this.detailSource) |
||||
|
this.$forceUpdate(); |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
showErrorMessage(message) { |
||||
|
this.$refs.comMessage.showErrorMessage(message, res => { |
||||
|
if (res) { |
||||
|
|
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
updateData() { |
||||
|
this.calcHandleQty(); |
||||
|
for (var i = 0; i < this.detailSource.length; i++) { |
||||
|
let item = this.detailSource[i]; |
||||
|
if (item.qty == 0) { |
||||
|
this.detailSource.splice(i, 1) |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
removeItem(index, item) { |
||||
|
this.detailSource.splice(index, 1) |
||||
|
}, |
||||
|
|
||||
|
closeScanPopup() { |
||||
|
if (this.$refs.scanPopup != undefined) { |
||||
|
this.$refs.scanPopup.closeScanPopup(); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
scanPopupGetFocus() { |
||||
|
if (this.$refs.scanPopup != undefined) { |
||||
|
this.$refs.scanPopup.getfocus(); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
commit() { |
||||
|
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) { |
||||
|
|
||||
|
if (this.splitCount <= 0) { |
||||
|
this.showErrorMessage("拆出数量必须大于0") |
||||
|
return; |
||||
|
} |
||||
|
if (this.splitCount > this.detailSource[0].qty) { |
||||
|
this.showErrorMessage("拆出数量不能大于标签数量") |
||||
|
return; |
||||
|
} |
||||
|
uni.showLoading({ |
||||
|
title: "提交中....", |
||||
|
mask: true |
||||
|
}); |
||||
|
|
||||
|
var params = this.setParams(); |
||||
|
console.log("提交" + JSON.stringify(params)) |
||||
|
splitPackageRecordForYtSubmit(params).then(res => { |
||||
|
uni.hideLoading() |
||||
|
if (res.data) { |
||||
|
|
||||
|
let list = [] |
||||
|
res.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: '', |
||||
|
}) |
||||
|
}) |
||||
|
this.showCommitSuccessMessage("提交成功\n生成拆标签记录\n", list) |
||||
|
|
||||
|
} else { |
||||
|
this.showErrorMessage("提交失败[" + res.msg + "]") |
||||
|
} |
||||
|
}).catch(error => { |
||||
|
uni.hideLoading() |
||||
|
this.showErrorMessage(error) |
||||
|
}) |
||||
|
} else { |
||||
|
this.showErrorMessage("没有要提交的数据") |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
setParams() { |
||||
|
var subList = [] |
||||
|
var creator = this.$store.state.user.id |
||||
|
this.detailSource.forEach(item => { |
||||
|
item.subList.forEach(detail => { |
||||
|
var subItem = {}; |
||||
|
Object.assign(subItem, detail) |
||||
|
subItem.itemCode = subItem.itemCode; |
||||
|
subItem.itemName = detail.package.itemName; |
||||
|
subItem.itemDesc1 = detail.package.itemDesc1; |
||||
|
subItem.itemDesc2 = detail.package.itemDesc2; |
||||
|
|
||||
|
subItem.fromInventoryStatus = subItem.inventoryStatus; |
||||
|
subItem.toInventoryStatus = subItem.inventoryStatus; |
||||
|
|
||||
|
subItem.fromQty = subItem.qty |
||||
|
subItem.toQty = this.splitCount |
||||
|
|
||||
|
subItem.fromPackingNumber = subItem.packingNumber; |
||||
|
subItem.toPackingNumber = subItem.packingNumber; |
||||
|
|
||||
|
subItem.fromBatch = subItem.batch; |
||||
|
subItem.toBatch = subItem.batch; |
||||
|
subItem.locationCode = detail.locationCode; |
||||
|
subItem.package = "" |
||||
|
subItem.Records = "" |
||||
|
subList.push(subItem) |
||||
|
|
||||
|
}) |
||||
|
}) |
||||
|
|
||||
|
this.dataContent.subList = subList; |
||||
|
this.dataContent.creator = creator; |
||||
|
return this.dataContent; |
||||
|
}, |
||||
|
|
||||
|
showMessage(message) { |
||||
|
this.$refs.comMessage.showMessage(message, res => { |
||||
|
if (res) {} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
showScanMessage(message) { |
||||
|
this.$refs.comMessage.showScanMessage(message); |
||||
|
}, |
||||
|
|
||||
|
afterCloseMessage() { |
||||
|
this.scanPopupGetFocus(); |
||||
|
}, |
||||
|
|
||||
|
closeScanMessage() { |
||||
|
this.scanPopupGetFocus(); |
||||
|
}, |
||||
|
|
||||
|
showCommitSuccessMessage(hint, pointData) { |
||||
|
this.$refs.comMessage.showSuccessMessage(hint, res => { |
||||
|
this.clearData(); |
||||
|
if (pointData.length > 0) { |
||||
|
uni.navigateTo({ |
||||
|
url: `/pages/point/index?points=${JSON.stringify(pointData)}` |
||||
|
}); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
clearData() { |
||||
|
this.detailSource = [] |
||||
|
this.fromLocationCode = ''; |
||||
|
this.currentItemCode = "" |
||||
|
this.dataContent = {} |
||||
|
this.itemCode = "" |
||||
|
this.splitCount = 1 |
||||
|
}, |
||||
|
|
||||
|
calcQty(val) { |
||||
|
this.splitCount = val; |
||||
|
}, |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
|
||||
|
</style> |
@ -0,0 +1,48 @@ |
|||||
|
<template> |
||||
|
<view class=""> |
||||
|
<productPutawayRecordByBatch :title="title" ref="productPutawayRecordByBatch" putawayType='assemble'></productPutawayRecordByBatch> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import productPutawayRecordByBatch from '@/pages/productPutaway/record/productPutawayRecordByBatch.vue' |
||||
|
|
||||
|
export default { |
||||
|
components: { |
||||
|
productPutawayRecordByBatch |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
title:'' |
||||
|
}; |
||||
|
}, |
||||
|
onLoad(option){ |
||||
|
this.title = option.title |
||||
|
}, |
||||
|
|
||||
|
onShow() { |
||||
|
if(this.$refs.productPutawayRecordByBatch!=undefined){ |
||||
|
// this.$refs.productPutawayRecord.refresh(); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
onPullDownRefresh() { |
||||
|
// this.$refs.productPutawayRecord.refresh(); |
||||
|
}, |
||||
|
onNavigationBarButtonTap(e) { |
||||
|
if (e.index === 0) { |
||||
|
this.$refs.productPutawayRecordByBatch.toHome(); |
||||
|
} else if (e.index == 1) { |
||||
|
this.$refs.productPutawayRecordByBatch.openFilter(); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
|
||||
|
</style> |
@ -0,0 +1,651 @@ |
|||||
|
<template> |
||||
|
<view class="page-wraper"> |
||||
|
<view class=""> |
||||
|
<com-blank-view @goScan='openScanPopup' v-if="detailSource.length==0"></com-blank-view> |
||||
|
</view> |
||||
|
<view class="page-wraper" v-if="detailSource.length>0" style="height: calc(100vh - 44px);"> |
||||
|
<view class="page-main"> |
||||
|
<scroll-view scroll-y="true" class="page-main-scroll"> |
||||
|
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> |
||||
|
<view class=""> |
||||
|
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent" |
||||
|
:isShowStatus="true" :isShowToLocation='false' @removeItem="removeItem(index,item)" |
||||
|
:isShowModifedLocation="true" |
||||
|
@updateData="updateData" @removePack="removePack" @editLocation="showScanToLocation" |
||||
|
> |
||||
|
</record-com-detail-card> |
||||
|
</view> |
||||
|
</view> |
||||
|
</scroll-view> |
||||
|
</view> |
||||
|
|
||||
|
<view class="page-footer" v-if="detailSource.length>0"> |
||||
|
<view class="uni-flex u-col-center space-between padding_10" |
||||
|
style="background-color:ghostwhite; width: 100%; "> |
||||
|
<view class=""> |
||||
|
|
||||
|
</view> |
||||
|
<view class=" uni-flex uni-row"> |
||||
|
<button class="btn_single_reject" style="margin-right:5px ;" hover-class="btn_commit_after" |
||||
|
@click="cancel">取消</button> |
||||
|
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
|
||||
|
</view> |
||||
|
|
||||
|
<win-scan-button v-if="detailSource.length>0" @goScan='openScanPopup'></win-scan-button> |
||||
|
|
||||
|
|
||||
|
<winComScanBalance ref="scanPopup" @getBalance='getScanResult' :bussinessCode="businessTypeCode"> |
||||
|
</winComScanBalance> |
||||
|
|
||||
|
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getToLocationCode' |
||||
|
:locationAreaTypeList="toLocationAreaTypeList"></win-scan-location> |
||||
|
|
||||
|
<win-scan-pack-and-location ref="winScanPackAndLocationRef" @getResult='getScanResult' :allowModifyLocation='false'> |
||||
|
</win-scan-pack-and-location> |
||||
|
<comMessage ref="comMessage"></comMessage> |
||||
|
<win-scan-location ref="winScanFromLocation" title="来源库位" @getLocation='getLocation' |
||||
|
:locationAreaTypeList="fromLocationAreaTypeList"></win-scan-location> |
||||
|
<comMessage ref="comMessage"></comMessage> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
productPutawayRecordSubmit, |
||||
|
getrecommendLocationExpectin, |
||||
|
recommendLocationRemoveExpectin, |
||||
|
getBalanceByFilter |
||||
|
} from '@/api/request2.js'; |
||||
|
import { |
||||
|
goHome, |
||||
|
getPackingNumberAndBatchByList, |
||||
|
deepCopyData |
||||
|
} from '@/common/basic.js'; |
||||
|
import { |
||||
|
getPrecisionStrategyList, |
||||
|
getManagementPrecisions |
||||
|
} from '@/common/balance.js'; |
||||
|
|
||||
|
import { |
||||
|
getInventoryStatusDesc, |
||||
|
getDirectoryItemArray |
||||
|
} from '@/common/directory.js'; |
||||
|
|
||||
|
import { |
||||
|
getBusinessType, |
||||
|
createItemInfo, |
||||
|
createDetailInfo, |
||||
|
calcHandleQty, |
||||
|
} from '@/common/record.js'; |
||||
|
|
||||
|
import { |
||||
|
calc |
||||
|
} from '@/common/calc.js'; |
||||
|
|
||||
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
||||
|
import requiredLocation from '@/mycomponents/location/requiredLocation.vue' |
||||
|
import comProductionRecord from '@/pages/productionReceipt/coms/comProductionRecord.vue' |
||||
|
import comBlankView from '@/mycomponents/common/comBlankView.vue' |
||||
|
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' |
||||
|
import winScanPackage from '@/mycomponents/scan/winScanPackage.vue' |
||||
|
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" |
||||
|
import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue' |
||||
|
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" |
||||
|
import { |
||||
|
updateTitle |
||||
|
} from '@/common/basic.js'; |
||||
|
|
||||
|
export default { |
||||
|
components: { |
||||
|
winScanButton, |
||||
|
comProductionRecord, |
||||
|
requiredLocation, |
||||
|
comBlankView, |
||||
|
recordComDetailCard, |
||||
|
winScanPackage, |
||||
|
winScanLocation, |
||||
|
winComScanBalance, |
||||
|
winScanPackAndLocation, |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
id: '', |
||||
|
scanCount: 0, |
||||
|
dataContent: {}, //任务内容 |
||||
|
subList: [], //接口返回的任务subList |
||||
|
detailSource: [], //绑定在页面上的数据源 |
||||
|
fromLocationCode: "", |
||||
|
toLocationCode: "", |
||||
|
fromLocationAreaTypeList: [], |
||||
|
tolocationTypeList: [], |
||||
|
toLocationAreaTypeList: [], |
||||
|
inInventoryStatus: "", //目标入库库存状态 |
||||
|
outInventoryStatus: "", //来源出库库存状态:"", |
||||
|
businessTypeCode: "ProductPutaway", |
||||
|
businessType: {}, |
||||
|
managementList: [], |
||||
|
type: '', |
||||
|
editItem: null, |
||||
|
managementType:'' |
||||
|
}; |
||||
|
}, |
||||
|
// 装配收货:type = 'assemble' |
||||
|
// 预生产收货:type = 'predict' |
||||
|
props: { |
||||
|
putawayType: 'assemble', |
||||
|
}, |
||||
|
|
||||
|
//返回首页 |
||||
|
onNavigationBarButtonTap(e) { |
||||
|
if (e.index === 0) { |
||||
|
goHome(); |
||||
|
} |
||||
|
}, |
||||
|
//拦截返回按钮事件 |
||||
|
onBackPress(e) {}, |
||||
|
|
||||
|
onPullDownRefresh() {}, |
||||
|
|
||||
|
mounted() { |
||||
|
getBusinessType(this.businessTypeCode, res => { |
||||
|
if (res.success) { |
||||
|
this.businessType = res.businessType; |
||||
|
this.fromInventoryStatuses = getDirectoryItemArray(res.fromInventoryStatuses); |
||||
|
this.fromLocationAreaTypeList = res.fromLocationAreaTypeList |
||||
|
this.openScanPopup(); |
||||
|
} else { |
||||
|
this.showErrorMessage(res.message) |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
getScanResult(result,managementTypeParams) { |
||||
|
this.managementType = managementTypeParams |
||||
|
if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){ |
||||
|
this.setDataBatch(result) |
||||
|
}else{ |
||||
|
this.setData(result) |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
async setData(result) { |
||||
|
let balance = result.balance; |
||||
|
let label = result.label; |
||||
|
let pack = result.package; |
||||
|
|
||||
|
var item = this.detailSource.find(res => { |
||||
|
if (res.itemCode == balance.itemCode) { |
||||
|
return res |
||||
|
} |
||||
|
}) |
||||
|
if (item == undefined) { |
||||
|
var itemp = createItemInfo(balance, pack); |
||||
|
// itemp.containerNumber="" |
||||
|
let newDetail = createDetailInfo(balance, pack); // |
||||
|
newDetail.fromLocationCode=balance.locationCode |
||||
|
|
||||
|
newDetail.parentNumber = pack.parentNumber; |
||||
|
newDetail.packingNumber = pack.number |
||||
|
newDetail.packUnit = pack.packUnit; |
||||
|
newDetail.packQty = pack.packQty; |
||||
|
if (balance.lableQty) { |
||||
|
newDetail.handleQty = balance.lableQty |
||||
|
} |
||||
|
itemp.subList.push(newDetail); |
||||
|
this.detailSource.push(itemp) |
||||
|
this.itemCode = balance.itemCode; |
||||
|
this.fromLocationCode = balance.locationCode |
||||
|
await this.getRecommendLocation(balance,result) |
||||
|
await this.scanPopupGetFocus() |
||||
|
} else { |
||||
|
var detail = item.subList.find(r => { |
||||
|
if (r.packingNumber == pack.parentNumber && |
||||
|
r.batch == balance.batch && |
||||
|
r.fromLocationCode == balance.locationCode && |
||||
|
r.inventoryStatus == balance.inventoryStatus) { |
||||
|
return r; |
||||
|
} |
||||
|
}) |
||||
|
|
||||
|
if(detail == undefined){ |
||||
|
let newDetail = createDetailInfo(balance, pack); |
||||
|
newDetail.parentNumber = pack.parentNumber; |
||||
|
newDetail.packingNumber = pack.number |
||||
|
newDetail.packUnit = pack.packUnit; |
||||
|
newDetail.packQty = pack.packQty; |
||||
|
newDetail.fromLocationCode=balance.locationCode |
||||
|
if (balance.lableQty) { |
||||
|
newDetail.handleQty = balance.lableQty |
||||
|
} |
||||
|
item.subList.push(newDetail); |
||||
|
this.scanPopupGetFocus() |
||||
|
}else { |
||||
|
if (detail.scaned == true) { |
||||
|
this.showErrorMessage("箱码[" + detail.packingNumber + "批次[" + balance.batch + "]重复扫描") |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
calcHandleQty(this.detailSource); |
||||
|
}, |
||||
|
|
||||
|
async setDataBatch(result) { |
||||
|
let balance = result.balance; |
||||
|
let label = result.label; |
||||
|
let pack = result.package; |
||||
|
|
||||
|
var item = this.detailSource.find(res => { |
||||
|
if (res.itemCode == balance.itemCode) { |
||||
|
return res |
||||
|
} |
||||
|
}) |
||||
|
if (item == undefined) { |
||||
|
var itemp = createItemInfo(balance, pack); |
||||
|
// itemp.containerNumber="" |
||||
|
let newDetail = createDetailInfo(balance, pack); // |
||||
|
newDetail.fromLocationCode=balance.locationCode |
||||
|
|
||||
|
newDetail.parentNumber = pack.parentNumber; |
||||
|
newDetail.packingNumber = pack.number |
||||
|
newDetail.packUnit = pack.packUnit; |
||||
|
newDetail.packQty = pack.packQty; |
||||
|
if (balance.lableQty) { |
||||
|
newDetail.handleQty = balance.lableQty |
||||
|
} |
||||
|
itemp.subList.push(newDetail); |
||||
|
this.detailSource.push(itemp) |
||||
|
this.itemCode = balance.itemCode; |
||||
|
this.fromLocationCode = balance.locationCode |
||||
|
await this.getRecommendLocation(balance,result) |
||||
|
await this.scanPopupGetFocus() |
||||
|
} else { |
||||
|
var detail = item.subList.find(r => { |
||||
|
if (r.packingNumber == pack.parentNumber && |
||||
|
r.batch == balance.batch && |
||||
|
r.fromLocationCode == balance.locationCode && |
||||
|
r.inventoryStatus == balance.inventoryStatus) { |
||||
|
return r; |
||||
|
} |
||||
|
}) |
||||
|
|
||||
|
if(detail == undefined){ |
||||
|
let newDetail = createDetailInfo(balance, pack); |
||||
|
newDetail.parentNumber = pack.parentNumber; |
||||
|
newDetail.packingNumber = pack.number |
||||
|
newDetail.packUnit = pack.packUnit; |
||||
|
newDetail.packQty = pack.packQty; |
||||
|
newDetail.fromLocationCode=balance.locationCode |
||||
|
if (balance.lableQty) { |
||||
|
newDetail.handleQty = balance.lableQty |
||||
|
} |
||||
|
item.subList.push(newDetail); |
||||
|
this.scanPopupGetFocus() |
||||
|
}else { |
||||
|
detail.handleQty = calc.add(detail.handleQty,result.label.qty) |
||||
|
} |
||||
|
} |
||||
|
calcHandleQty(this.detailSource); |
||||
|
}, |
||||
|
|
||||
|
async getRecommendLocation(balance,result) { |
||||
|
uni.showLoading({ |
||||
|
title: '扫描中...', |
||||
|
mask: true |
||||
|
}) |
||||
|
|
||||
|
let param = { |
||||
|
expectinNumber: balance.packingNumber + "-" + Date.now(), |
||||
|
itemCode: balance.itemCode, |
||||
|
inventoryStatus: balance.inventoryStatus, |
||||
|
batch: balance.batch |
||||
|
}; |
||||
|
console.log(JSON.stringify(param)) |
||||
|
await getrecommendLocationExpectin(param).then(async result1 => { |
||||
|
uni.hideLoading(); |
||||
|
let item = this.detailSource.find(res => { |
||||
|
if (res.itemCode == balance.itemCode) { |
||||
|
return res |
||||
|
} |
||||
|
}) |
||||
|
item.toLocationCode = result1.data.code; |
||||
|
item.expectinNumber = result1.data.expectinNumber; |
||||
|
await this.getToLocationBalance(item.toLocationCode,result) |
||||
|
this.$forceUpdate(); |
||||
|
}).catch(error => { |
||||
|
uni.hideLoading() |
||||
|
this.showErrorMessage(error); |
||||
|
}) |
||||
|
}, |
||||
|
//查询到目标库位的库存余额 |
||||
|
async getToLocationBalance(toLocationCode,result) { |
||||
|
uni.showLoading({ |
||||
|
title: '查询中', |
||||
|
mask: true |
||||
|
}) |
||||
|
var filters = [] |
||||
|
if (result.package.parentNumber) { |
||||
|
var packingNumber = result.package.parentNumber + "," + result.package.number; |
||||
|
filters.push({ |
||||
|
column: "packingNumber", |
||||
|
action: "in", |
||||
|
value: packingNumber |
||||
|
}) |
||||
|
} else { |
||||
|
filters.push({ |
||||
|
column: "packingNumber", |
||||
|
action: "==", |
||||
|
value: result.package.number |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
filters.push({ |
||||
|
column: "itemCode", |
||||
|
action: "==", |
||||
|
value: result.package.itemCode |
||||
|
}) |
||||
|
filters.push({ |
||||
|
column: "batch", |
||||
|
action: "==", |
||||
|
value: result.package.batch |
||||
|
}) |
||||
|
|
||||
|
filters.push({ |
||||
|
column: "areaType", |
||||
|
action: "in", |
||||
|
value: this.toLocationAreaTypeList.join(',') |
||||
|
}) |
||||
|
|
||||
|
|
||||
|
var params = { |
||||
|
filters: filters, |
||||
|
pageNo: 1, |
||||
|
pageSize: 100, |
||||
|
} |
||||
|
await getManagementPrecisions([result.package.itemCode], toLocationCode,async res => { |
||||
|
if (res.success) { |
||||
|
this.managementList = res.list; |
||||
|
this.managementType = this.managementList.some(item => item.ManagementPrecision == 'BY_BATCH') ? 'BY_BATCH' : '' |
||||
|
if(this.managementType == 'BY_BATCH'){ |
||||
|
uni.hideLoading() |
||||
|
}else{ |
||||
|
await getBalanceByFilter(params).then(res => { |
||||
|
uni.hideLoading() |
||||
|
if (res.data.list.length > 0) { |
||||
|
this.showErrorMessage("包装在库位【" + res.data.list[0].locationCode + "】已有库存余额"); |
||||
|
} |
||||
|
// callback(res.data) |
||||
|
}).catch(err => { |
||||
|
this.showErrorMessage(err.message); |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
|
||||
|
}, |
||||
|
//移除推荐的预占用库位 |
||||
|
removeRecommendLocation(lst) { |
||||
|
let param = { |
||||
|
expectinNumberList: lst, |
||||
|
}; |
||||
|
recommendLocationRemoveExpectin(param).then(res => { |
||||
|
|
||||
|
}).catch(err => { |
||||
|
this.showErrorMessage('【' + lst.join(',') + '】移除预占用失败,请在PC端的预占用中移除') |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
showScanToLocation(item) { |
||||
|
this.editItem = item; |
||||
|
setTimeout(r => { |
||||
|
this.$refs.scanLocationCode.openScanPopup(); |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
showErrorMessage(message) { |
||||
|
this.scanPopupLoseFocus(); |
||||
|
this.$refs.comMessage.showErrorMessage(message, res => { |
||||
|
this.scanPopupGetFocus(); |
||||
|
}); |
||||
|
}, |
||||
|
calcHandleQty() { |
||||
|
calcHandleQty(this.detailSource); |
||||
|
this.$forceUpdate(); |
||||
|
}, |
||||
|
|
||||
|
removeItem(index, item) { |
||||
|
this.removeRecommendLocation([item.expectinNumber]); |
||||
|
this.detailSource.splice(index, 1) |
||||
|
}, |
||||
|
removePack() { |
||||
|
for (var i = 0; i < this.detailSource.length; i++) { |
||||
|
var item = this.detailSource[i]; |
||||
|
if (item.subList.length == 0) { |
||||
|
this.detailSource.splice(i, 1) |
||||
|
this.removeRecommendLocation(item) |
||||
|
} |
||||
|
} |
||||
|
this.updateData(); |
||||
|
}, |
||||
|
|
||||
|
openScanPopup() { |
||||
|
if (this.businessType) { |
||||
|
this.toLocationAreaTypeList = getDirectoryItemArray(this.businessType.inAreaTypes) |
||||
|
// this.$refs.scanPopup.openScanPopup(this.businessType); |
||||
|
this.openFromLocationScanPopup() |
||||
|
} else { |
||||
|
this.getBusinessType() |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
closeScanPopup() { |
||||
|
if (this.$refs.scanPopup != undefined) { |
||||
|
this.$refs.scanPopup.closeScanPopup(); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
scanPopupGetFocus() { |
||||
|
if (this.$refs.scanPopup != undefined) { |
||||
|
this.$refs.scanPopup.getfocus(); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
scanPopupLoseFocus() { |
||||
|
if (this.$refs.scanPopup != undefined) { |
||||
|
this.$refs.scanPopup.losefocus(); |
||||
|
} |
||||
|
}, |
||||
|
openFromLocationScanPopup() { |
||||
|
if (this.fromLocationCode == "") { |
||||
|
this.showFromLocationPopup(); |
||||
|
return |
||||
|
} |
||||
|
this.$refs.winScanPackAndLocationRef.openScanPopupForType(this.fromLocationCode, this.businessType); |
||||
|
}, |
||||
|
showFromLocationPopup() { |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.winScanFromLocation.openScanPopup(); |
||||
|
}) |
||||
|
}, |
||||
|
scanLocationCode(location, code) { |
||||
|
this.toLocationCode = code |
||||
|
this.detailSource.forEach(item => { |
||||
|
item.subList.forEach(detail => { |
||||
|
detail.toLocationCode = code |
||||
|
}) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
commit() { |
||||
|
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) { |
||||
|
//查询管理模式 |
||||
|
uni.showLoading({ |
||||
|
title: "提交中....", |
||||
|
mask: true |
||||
|
}); |
||||
|
|
||||
|
var params = this.setParams() |
||||
|
|
||||
|
console.log("提交" + JSON.stringify(params)) |
||||
|
const isHaveItem =params.subList.find(item=>item.handleQty > item.balanceQty) |
||||
|
if(isHaveItem){ |
||||
|
this.showErrorMessage(`物料号${isHaveItem.itemCode}`) |
||||
|
this.$refs.comMessage.showConfirmWarningModal('物料号'+isHaveItem.itemCode+'数量[' + isHaveItem.handleQty + ']不允许大于库存数量[' + isHaveItem.balanceQty + ']') |
||||
|
uni.hideLoading() |
||||
|
return |
||||
|
} |
||||
|
productPutawayRecordSubmit(params).then(res => { |
||||
|
uni.hideLoading() |
||||
|
if (res.data) { |
||||
|
this.showCommitSuccessMessage("提交成功\n生成制品上架记录\n" + res.data) |
||||
|
let removeId = []; |
||||
|
this.detailSource.forEach(r => { |
||||
|
removeId.push(r.expectinNumber); |
||||
|
}) |
||||
|
|
||||
|
this.removeRecommendLocation(removeId); |
||||
|
} else { |
||||
|
this.showErrorMessage("提交失败[" + res.msg + "]") |
||||
|
} |
||||
|
}).catch(error => { |
||||
|
uni.hideLoading() |
||||
|
this.showErrorMessage(error) |
||||
|
}) |
||||
|
// } else { |
||||
|
// uni.hideLoading(); |
||||
|
// this.showErrorMessage(res.message); |
||||
|
// } |
||||
|
|
||||
|
} else { |
||||
|
this.showErrorMessage("没有要提交的数据,请先扫描") |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
setPrecisionStrategParams() { |
||||
|
var itemList = [] |
||||
|
this.detailSource.forEach(item => { |
||||
|
item.subList.forEach(detail => { |
||||
|
if (detail.scaned) { |
||||
|
detail.toLocationCode = this.toLocationCode; |
||||
|
var filterResult = itemList.filter(res => { |
||||
|
if (res.itemCode == item.itemCode && |
||||
|
detail.toLocationCode == res.locationCode) { |
||||
|
return res |
||||
|
} |
||||
|
}) |
||||
|
//去掉重复元素 |
||||
|
if (filterResult.length == 0) { |
||||
|
var result = { |
||||
|
itemCode: item.itemCode, |
||||
|
locationCode: detail.toLocationCode |
||||
|
} |
||||
|
itemList.push(result) |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
}) |
||||
|
return itemList; |
||||
|
}, |
||||
|
|
||||
|
setParams() { |
||||
|
let that = this; |
||||
|
var subList = [] |
||||
|
var creator = this.$store.state.user.id |
||||
|
that.detailSource.forEach(item => { |
||||
|
item.subList.forEach(detail => { |
||||
|
if (detail.scaned) { |
||||
|
var submitItem = deepCopyData(detail) |
||||
|
submitItem.itemCode = detail.itemCode; |
||||
|
submitItem.itemName = detail.package.itemName; |
||||
|
submitItem.itemDesc1 = detail.package.itemDesc1; |
||||
|
submitItem.itemDesc2 = detail.package.itemDesc2; |
||||
|
submitItem.inventoryStatus = detail.inventoryStatus; |
||||
|
|
||||
|
submitItem.fromPackingNumber = detail.packingNumber; |
||||
|
submitItem.toPackingNumber = detail.packingNumber; |
||||
|
|
||||
|
submitItem.fromParentPackingNumber = detail.parentNumber; |
||||
|
submitItem.fromBatch = detail.package.batch; |
||||
|
submitItem.toBatch = detail.package.batch; |
||||
|
|
||||
|
submitItem.fromLocationCode = detail.locationCode; |
||||
|
submitItem.toLocationCode = item.toLocationCode; |
||||
|
|
||||
|
submitItem.qty = detail.handleQty; |
||||
|
submitItem.package = ""; |
||||
|
subList.push(submitItem) |
||||
|
} |
||||
|
}) |
||||
|
}) |
||||
|
that.dataContent.subList = subList; |
||||
|
that.dataContent.creator = creator; |
||||
|
that.dataContent.type = that.putawayType; |
||||
|
return that.dataContent; |
||||
|
}, |
||||
|
|
||||
|
showMessage(message) { |
||||
|
this.$refs.comMessage.showMessage(message, res => { |
||||
|
if (res) {} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
showScanMessage(message) { |
||||
|
this.$refs.comMessage.showScanMessage(message); |
||||
|
}, |
||||
|
|
||||
|
afterCloseMessage() { |
||||
|
this.scanPopupGetFocus(); |
||||
|
}, |
||||
|
|
||||
|
closeScanMessage() { |
||||
|
this.scanPopupGetFocus(); |
||||
|
}, |
||||
|
|
||||
|
getToLocationCode(location, code) { |
||||
|
this.editItem.toLocationCode = code; |
||||
|
}, |
||||
|
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(); |
||||
|
}) |
||||
|
}, |
||||
|
clearData() { |
||||
|
this.fromLocationCode = ''; |
||||
|
this.subList = []; |
||||
|
this.detailSource = []; |
||||
|
this.toLocationCode = ''; |
||||
|
this.dataContent = {} |
||||
|
}, |
||||
|
|
||||
|
updateData() { |
||||
|
this.calcHandleQty(); |
||||
|
for (var i = 0; i < this.detailSource.length; i++) { |
||||
|
let item = this.detailSource[i]; |
||||
|
if (item.qty == 0) { |
||||
|
this.detailSource.splice(i, 1) |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
cancel() { |
||||
|
this.clearData(); |
||||
|
this.openScanPopup(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
|
||||
|
</style> |
@ -0,0 +1,48 @@ |
|||||
|
<template> |
||||
|
<view class=""> |
||||
|
<productPutawayRecordByBatch :title="title" ref="productPutawayRecordByBatch" putawayType='predict'></productPutawayRecordByBatch> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import productPutawayRecordByBatch from '@/pages/productPutaway/record/productPutawayRecordByBatch.vue' |
||||
|
|
||||
|
export default { |
||||
|
components: { |
||||
|
productPutawayRecordByBatch |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
title:'' |
||||
|
}; |
||||
|
}, |
||||
|
onLoad(option){ |
||||
|
this.title = option.title |
||||
|
}, |
||||
|
|
||||
|
onShow() { |
||||
|
if(this.$refs.productPutawayRecordByBatch!=undefined){ |
||||
|
this.$refs.productPutawayRecordByBatch.refresh(); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
onPullDownRefresh() { |
||||
|
this.$refs.productPutawayRecordByBatch.refresh(); |
||||
|
}, |
||||
|
onNavigationBarButtonTap(e) { |
||||
|
if (e.index === 0) { |
||||
|
this.$refs.productPutawayRecordByBatch.toHome(); |
||||
|
} else if (e.index == 1) { |
||||
|
this.$refs.productPutawayRecordByBatch.openFilter(); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
|
||||
|
</style> |
@ -0,0 +1,171 @@ |
|||||
|
<template> |
||||
|
<view class="" style="background-color: #fff;"> |
||||
|
<uni-collapse ref="collapse1" @change=""> |
||||
|
<uni-collapse-item :open="true"> |
||||
|
<template v-slot:title> |
||||
|
<uni-swipe-action ref="swipeAction"> |
||||
|
<uni-swipe-action-item @click="removeData($event,dataContent)" :right-options="removeOptions"> |
||||
|
<item-qty :dataContent="dataContent" :handleQty="dataContent.handleQty" |
||||
|
:isShowBalance="true"></item-qty> |
||||
|
</uni-swipe-action-item> |
||||
|
</uni-swipe-action> |
||||
|
|
||||
|
</template> |
||||
|
<view class='split_line'></view> |
||||
|
<view class="" v-for="(item,index) in dataContent.subList"> |
||||
|
<uni-swipe-action ref="swipeAction"> |
||||
|
<uni-swipe-action-item @click="swipeClick($event,item,index)" |
||||
|
:right-options="item.scaned?scanOptions:detailOptions"> |
||||
|
<balance :dataContent="item" :isShowStdPack="false" :isShowStatus="true" |
||||
|
:isShowPack="true" :isShowFromLocation="true"></balance> |
||||
|
<!-- <production-label :dataContent="item" :packageContent="item.package" |
||||
|
:isShowLocation="false"> |
||||
|
</production-label> --> |
||||
|
|
||||
|
</uni-swipe-action-item> |
||||
|
</uni-swipe-action> |
||||
|
</view> |
||||
|
</uni-collapse-item> |
||||
|
</uni-collapse> |
||||
|
<!-- <recommend-qty-edit ref="recommendQtyEdit" :dataContent="editItem" :handleQty="editItem.qty" @confirm="confirm" :isShowStatus="isShowStatus"></recommend-qty-edit> --> |
||||
|
<balance-qty-edit ref="balanceQtyEdit" @confirm="confirm" ></balance-qty-edit> |
||||
|
<package-detail-popup ref='packageDetailPopup'> |
||||
|
</package-detail-popup> |
||||
|
<comMessage ref="comMessage"></comMessage> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import itemQty from '@/mycomponents/item/itemQty.vue' |
||||
|
import recommend from '@/mycomponents/recommend/recommend.vue' |
||||
|
import productionLabel from '@/mycomponents/balance/productionLabel.vue' |
||||
|
import record from '@/mycomponents/record/record.vue' |
||||
|
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue' |
||||
|
import recommendQtyEdit from '@/mycomponents/qty/recommendQtyEdit.vue' |
||||
|
import packageDetailPopup from '@/mycomponents/package/packageDetailPopup.vue' |
||||
|
import balance from '@/mycomponents/balance/balance.vue' |
||||
|
|
||||
|
import { |
||||
|
getDetailOption, |
||||
|
getDetailEditRemoveOption, |
||||
|
getClearOption |
||||
|
} from '@/common/array.js'; |
||||
|
export default { |
||||
|
components: { |
||||
|
itemQty, |
||||
|
recommend, |
||||
|
packageDetailPopup, |
||||
|
productionLabel, |
||||
|
recommendQtyEdit, |
||||
|
record, |
||||
|
balance, |
||||
|
balanceQtyEdit |
||||
|
}, |
||||
|
props: { |
||||
|
dataContent: { |
||||
|
type: Object, |
||||
|
default: {} |
||||
|
}, |
||||
|
settingParam: { |
||||
|
type: Object, |
||||
|
default: {} |
||||
|
}, |
||||
|
fromInventoryStatus: { |
||||
|
type: String, |
||||
|
default: "" |
||||
|
}, |
||||
|
toInventoryStatus: { |
||||
|
type: String, |
||||
|
default: "" |
||||
|
}, |
||||
|
isShowStatus: { |
||||
|
type: Boolean, |
||||
|
default: false |
||||
|
} |
||||
|
}, |
||||
|
watch: { |
||||
|
dataContent: { |
||||
|
handler(newName, oldName) { |
||||
|
if (this.dataContent.subList.length > 0) { |
||||
|
if (this.$refs.collapse1 != undefined) { |
||||
|
this.$nextTick(res => { |
||||
|
this.$refs.collapse1.resize() |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
immediate: true, |
||||
|
deep: true |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
data() { |
||||
|
return { |
||||
|
option: [], |
||||
|
title: "推荐详情", |
||||
|
showItem: {}, |
||||
|
editItem: {}, |
||||
|
detailOptions: [], |
||||
|
scanOptions: [], |
||||
|
removeOptions: [], |
||||
|
dataList: [] |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
mounted() { |
||||
|
this.detailOptions = getDetailOption(); |
||||
|
this.scanOptions = getDetailEditRemoveOption(); |
||||
|
this.removeOptions = getClearOption(); |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
removeData(e, dataContent) { |
||||
|
if (e.content.text == "清空") { |
||||
|
this.$refs.comMessage.showQuestionMessage("确定清空物料及箱码信息?", |
||||
|
res => { |
||||
|
if (res) { |
||||
|
this.$emit('removeItem') |
||||
|
// this.$emit('removeItem', this.dataContent) |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
}, |
||||
|
swipeClick(e, item, index) { |
||||
|
if (e.content.text == "详情") { |
||||
|
this.detail(item.package) |
||||
|
} else if (e.content.text == "编辑") { |
||||
|
this.edit(item) |
||||
|
} else if (e.content.text == "移除") { |
||||
|
this.remove(item, index) |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
edit(item) { |
||||
|
this.editItem = item; |
||||
|
this.$refs.balanceQtyEdit.openEditPopup(this.editItem, this.editItem.handleQty); |
||||
|
// this.$refs.recommendQtyEdit.openEditPopup(item.qty); |
||||
|
}, |
||||
|
|
||||
|
detail(packageInfo) { |
||||
|
this.showItem = packageInfo; |
||||
|
this.$refs.packageDetailPopup.openPopup(packageInfo) |
||||
|
}, |
||||
|
remove(item, index) { |
||||
|
this.$refs.comMessage.showQuestionMessage("确定移除扫描信息?", |
||||
|
res => { |
||||
|
if (res) { |
||||
|
this.dataContent.subList.splice(index, 1) |
||||
|
this.$emit('removePack') |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
confirm(qty) { |
||||
|
this.editItem.handleQty = qty; |
||||
|
this.$emit('updateData') |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
</style> |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue