Browse Source

解决冲突

intex_online20241205
ljlong_2630 2 months ago
parent
commit
00d1bd0427
  1. 3
      .env.development
  2. 11
      .env.hella13
  3. 11
      .env.hella14
  4. 11
      .env.hella15
  5. 11
      .env.hella16
  6. 12
      .env.hella8
  7. 11
      .env.hella9
  8. 14
      .env.production
  9. 12
      .env.test
  10. 15
      .env.test-dev
  11. 7
      Dockerfile_prod
  12. 21
      nginx.conf
  13. 57
      nginx_prod.conf
  14. 19
      package.json
  15. 35
      src/api/request2.js
  16. 16
      src/common/balance.js
  17. 65
      src/common/detail.js
  18. 26
      src/common/directory.js
  19. 44
      src/common/label.js
  20. 55
      src/common/record.js
  21. 10
      src/mycomponents/balance/balance.vue
  22. 21
      src/mycomponents/balance/pack.vue
  23. 4
      src/mycomponents/balance/recommendBalanceBatch.vue
  24. 114
      src/mycomponents/detail/comDetailCardBatch.vue
  25. 71
      src/mycomponents/detail/comJobDetailCardBatch.vue
  26. 56
      src/mycomponents/detail/comRecommendDetailCard.vue
  27. 241
      src/mycomponents/detail/comRecommendDetailCardBatch.vue
  28. 2
      src/mycomponents/item/itemCompareQty.vue
  29. 4
      src/mycomponents/job/jobComMainDetailCard.vue
  30. 2
      src/mycomponents/job/jobSettingInfo.vue
  31. 19
      src/mycomponents/package/packageCard.vue
  32. 48
      src/mycomponents/package/packageList.vue
  33. 2
      src/mycomponents/qty/balanceQtyEdit.vue
  34. 7
      src/mycomponents/qty/compareQty.vue
  35. 226
      src/mycomponents/qty/numbeIntegerrBox.vue
  36. 2
      src/mycomponents/qty/packUnit.vue
  37. 11
      src/mycomponents/qty/qtyEdit.vue
  38. 98
      src/mycomponents/qty/recommendHandleQty.vue
  39. 10
      src/mycomponents/qty/recommendQty.vue
  40. 44
      src/mycomponents/qty/recommendQtyEdit.vue
  41. 297
      src/mycomponents/query/fifoQuery.vue
  42. 27
      src/mycomponents/record/recordComDetailCard.vue
  43. 225
      src/mycomponents/record/recordComDetailCardBatch.vue
  44. 23
      src/mycomponents/scan/winComScan.vue
  45. 3
      src/mycomponents/scan/winComScanBalance.vue
  46. 4
      src/mycomponents/scan/winComScanFg.vue
  47. 8
      src/mycomponents/scan/winScanLocation.vue
  48. 10
      src/mycomponents/scan/winScanPack.vue
  49. 51
      src/mycomponents/scan/winScanPackAndLocation.vue
  50. 137
      src/pages.json
  51. 7
      src/pages/count/job/countJob.vue
  52. 2
      src/pages/count/job/fuzzyCountJob.vue
  53. 132
      src/pages/customerReturn/job/returnDetail.vue
  54. 2
      src/pages/customerReturn/job/returnJob.vue
  55. 2
      src/pages/customerReturn/record/recordList.vue
  56. 63
      src/pages/customerReturn/record/returnRecord.vue
  57. 125
      src/pages/deliver/coms/comDeliverDetailCardBatch.vue
  58. 760
      src/pages/deliver/coms/comScanDeliverPackBatch.vue
  59. 4
      src/pages/deliver/coms/jobInfoPopup.vue
  60. 520
      src/pages/deliver/job/deliverDetailBatch.vue
  61. 2
      src/pages/deliver/job/deliverJob.vue
  62. 79
      src/pages/deliver/record/deliverRecord.vue
  63. 16
      src/pages/fg/coms/comNoReceiptPopup.vue
  64. 17
      src/pages/fg/coms/comReceiptPopup.vue
  65. 4
      src/pages/fg/receiptByPlan.vue
  66. 4
      src/pages/fg/receiptNoPlan.vue
  67. 2
      src/pages/index/index.vue
  68. 2
      src/pages/inspect/job/inspectJob.vue
  69. 12
      src/pages/inventoryMove/coms/comInventoryDetailCard.vue
  70. 203
      src/pages/inventoryMove/coms/comInventoryDetailCardBatch.vue
  71. 2
      src/pages/inventoryMove/coms/comMoveJob.vue
  72. 379
      src/pages/inventoryMove/coms/comMoveRecord.vue
  73. 6
      src/pages/inventoryMove/coms/comMoveRecordCard.vue
  74. 313
      src/pages/inventoryMove/coms/okToHoldRecordPack.vue
  75. 245
      src/pages/inventoryMove/job/inventoryMoveDetail.vue
  76. 2
      src/pages/inventoryMove/job/inventoryMoveJob.vue
  77. 2
      src/pages/inventoryMove/record/holdToOkRecord.vue
  78. 3
      src/pages/inventoryMove/record/okToHoldRecord.vue
  79. 83
      src/pages/issue/coms/comIssueDetailCardBatch.vue
  80. 32
      src/pages/issue/coms/comScanIssuePack.vue
  81. 30
      src/pages/issue/job/issueDetail.vue
  82. 828
      src/pages/issue/job/issueDetailBatch.vue
  83. 52
      src/pages/issue/job/issueJob.vue
  84. 4
      src/pages/issue/job/issueJob0816.vue
  85. 12
      src/pages/issue/record/directIssue.vue
  86. 569
      src/pages/issue/record/directIssueByBatch.vue
  87. 2
      src/pages/itemHold/record/recordList.vue
  88. 391
      src/pages/label/record/splitLabel.vue
  89. 2
      src/pages/login/index.vue
  90. 2
      src/pages/package/job/overPackageJob.vue
  91. 2
      src/pages/productDismantle/job/productDismantleJob.vue
  92. 20
      src/pages/productPutaway/job/productPutawayDetail.vue
  93. 2
      src/pages/productPutaway/job/productPutawayJob.vue
  94. 48
      src/pages/productPutaway/record/fgDirectPutawayByBatch.vue
  95. 651
      src/pages/productPutaway/record/productPutawayRecordByBatch.vue
  96. 48
      src/pages/productPutaway/record/semiDirectPutawayByBatch.vue
  97. 114
      src/pages/productReceipt/coms/comProductDetailCardBatch.vue
  98. 171
      src/pages/productReceipt/coms/comProductRecordBatch.vue
  99. 2
      src/pages/productReceipt/job/ccProductReceiptJob.vue
  100. 2
      src/pages/productReceipt/job/completeReceiveJob.vue

3
.env.development

@ -9,3 +9,6 @@ VITE_isDevelopment=true
# 积木报表请求路径
VITE_JMREPORT_BASE_URL='http://localhost:12080'
# 项目管理模式 批次货/包装
VITE_MANAGE_MODEL="BY_BATCH"

11
.env.hella13

@ -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'

11
.env.hella14

@ -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'

11
.env.hella15

@ -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'

11
.env.hella16

@ -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'

12
.env.hella8

@ -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'

11
.env.hella9

@ -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'

14
.env.production

@ -1,12 +1,14 @@
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_BASE_URL=http://192.168.120.34:81/api/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"

12
.env.test

@ -1,12 +1,14 @@
VITE_BASE_URL=http://dev.ccwin-in.com:25300/api/admin-api
VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25300/admin-api
VITE_BASE_URL=http://192.168.120.35:81/api/admin-api
VITE_BASE_URL_IMAGE=http://192.168.120.35:81/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_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"

15
.env.test-dev

@ -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"

7
Dockerfile_prod

@ -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

21
nginx.conf

@ -41,6 +41,27 @@ http {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $http_x_forwarded_for;
}
location ^~ /jmreport/ {
proxy_pass http://localhost:100/jmreport/;
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 X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $http_x_forwarded_for;
}
location ^~ /magic/ {
proxy_pass http://localhost:100/magic/;
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 X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $http_x_forwarded_for;
}
location /profile/ {
proxy_cache my_zone;
proxy_cache_valid 200 304 12h;
proxy_cache_key $host$uri$is_args$args;
alias /opt/profile/;
index index.html index.htm;
}
location / {
proxy_cache my_zone;
proxy_cache_valid 200 304 12h;

57
nginx_prod.conf

@ -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;
}
}
}

19
package.json

@ -8,19 +8,14 @@
"dev": "uni",
"dev:h5:ssr": "uni --ssr",
"dev:mp-weixin": "uni -p mp-weixin",
"hella8:app": "uni build -p app --mode hella8",
"hella8:app-android": "uni build -p app-android --mode hella8",
"hella8:app-ios": "uni build -p app-ios --mode hella8",
"hella8:h5:ssr": "uni build --ssr --mode hella8",
"hella8:mp-weixin": "uni build -p mp-weixin --mode hella8",
"prod": "uni build --mode production",
"test:app": "uni build -p app --mode test",
"test:app-android": "uni build -p app-android --mode test",
"test:app-ios": "uni build -p app-ios --mode test",
"test:h5:ssr": "uni build --ssr --mode test",
"test:mp-weixin": "uni build -p mp-weixin --mode test",
"prod": "uni build --mode production",
"test": "uni build --mode test",
"hella8": "uni build --mode hella8",
"hella9": "uni build --mode hella9",
"hella13": "uni build --mode hella13",
"hella14": "uni build --mode hella14",
"hella15": "uni build --mode hella15",
"hella16": "uni build --mode hella16"
"test-dev": "uni build --mode test-dev"
},
"dependencies": {
"@dcloudio/uni-app": "3.0.0-3090920231225001",

35
src/api/request2.js

@ -421,7 +421,7 @@ export function getPackageByNumber(number) {
* @param {*}
*
*/
export function getPackageListByNumber(number) {
export async function getPackageListByNumber(number) {
var params = {
number: number,
pageNo: 1,
@ -866,7 +866,18 @@ export function getPurchaseReceiptJobDetail(id) {
data: {},
});
}
/**
* 采购收货 获取收货记录的列表
* @param {*} id 任务id
*
*/
export function getPurchaseReceiptJobDetailListByNmber(requestNumber) {
return request({
url: baseApi + "/wms/purchasereceipt-record-detail/listByNmber?requestNumber=" + requestNumber,
method: "get",
data: {},
});
}
/**
* 采购收货 任务提交
* @param {*} 任务id
@ -4270,6 +4281,18 @@ export function splitPackageRecordSubmit(params) {
});
}
/**
* 拆包 英泰 提交
* @param {*} params
*/
export function splitPackageRecordForYtSubmit(params) {
return request({
url: baseApi + "/wms/packagesplit-main/createForYT",
method: "post",
data: params,
});
}
/**
* 合包 提交
* @param {*} params
@ -4301,8 +4324,8 @@ export function overPackageRecordSubmit(params) {
* @param {*}
*
*/
export function getManagementPrecision(params) {
return request({
export async function getManagementPrecision(params) {
return await request({
url: baseApi + "/wms/rule/getPrecisionStrategyByItemCodes",
method: "post",
data: params,
@ -4370,8 +4393,8 @@ export function getTransactionByFilter(param) {
* @param {*}
*
*/
export function getPrecisionStrategy(param) {
return request({
export async function getPrecisionStrategy(param) {
return await request({
url: baseApi + "/wms/rule/getPrecisionStrategy",
method: "post",
data: param,

16
src/common/balance.js

@ -75,7 +75,7 @@ export function getPrecisionStrategyParamsByLocation(detailSource, toLocationCod
* @param {*}
*
*/
export function getPrecisionStrategyList(itemList, callback) {
export async function getPrecisionStrategyList(itemList, callback) {
// let jsonParem = JSON.stringify(param)
let result = {
list: [],
@ -83,7 +83,7 @@ export function getPrecisionStrategyList(itemList, callback) {
message: ''
};
getPrecisionStrategy(itemList).then(res => {
await getPrecisionStrategy(itemList).then(res => {
if (res.data == null) {
result.success = false
result.message = '未查询到管理精度信息'
@ -105,7 +105,7 @@ export function getPrecisionStrategyList(itemList, callback) {
* @param {*}
*
*/
export function getManagementPrecisions(itemCodes, locationCode, callback) {
export async function getManagementPrecisions(itemCodes, locationCode, callback) {
// let jsonParem = JSON.stringify(param)
let result = {
list: [],
@ -117,7 +117,7 @@ export function getManagementPrecisions(itemCodes, locationCode, callback) {
itemCodes: itemCodes,
locationCode: locationCode
}
getManagementPrecision(params).then(res => {
await getManagementPrecision(params).then(res => {
if (res.data == null) {
result.success = false
result.message = '未查询到管理精度信息'
@ -397,13 +397,13 @@ export function byQuantity(label, locationCode, fromInventoryStatuses, callback)
})
filters.push({
column: "packingNumber",
action: "==",
value: null
action: "isStr",
value: ''
})
filters.push({
column: "batch",
action: "==",
value: null
action: "isStr",
value:''
})
filters.push({
column: "locationCode",

65
src/common/detail.js

@ -41,7 +41,49 @@ export function getTreeDataSource(dataList) {
})
)
}
return items;
}
export function getThreeDataSource(data) {
let items = []
let obj ={
...data.subList[0]
}
console.log(12)
data.subList.forEach((item)=>{
item.threeList = [{
fromLocationCode:item.fromLocationCode,
batch:item.batch,
handleQty:0,
qty:item.qty,
inventoryStatus:item.inventoryStatus,
toLocationCode:item.toLocationCode,
}]
item.packList=[{
scaned : false,
scanDate: new Date()
}]
})
obj.subList = data.subList
items.push(obj)
return items;
}
export function getDataSourceBatch(subList) {
let items = [];
subList.forEach(detail => {
var item = items.find(r =>
r.itemCode == detail.itemCode )
if (item == undefined) {
item = createItemInfo(detail);
let newDetail = createDetailInfo(detail); //
item.subList.push(newDetail);
items.push(item)
} else {
item.qty = calc.add(item.qty, detail.qty)
let newDetail = createDetailInfo(detail); //
item.subList.push(newDetail);
}
})
return items;
}
@ -102,6 +144,7 @@ export function createRecordInfo(detail, balance) {
//计算实际数量
export function calcHandleQty(detailSource) {
console.log(999,detailSource)
for (let item of detailSource) {
item.handleQty = new Decimal(0).toNumber();
item.qty = new Decimal(0).toNumber();
@ -115,7 +158,25 @@ export function calcHandleQty(detailSource) {
}
}
}
//计算计划外入库实际数量和任务数量
export function calcHandleQtyPlanOut(detailSource) {
console.log(999,detailSource)
for (let item of detailSource) {
item.handleQty = new Decimal(0).toNumber();
item.qty = new Decimal(0).toNumber();
for (let detail of item.subList) {
if (detail != undefined) {
if (detail.scaned) {
item.handleQty = calc.add(item.handleQty, detail.handleQty);
}
console.log(detail.isRecommend)
if(detail.isRecommend){
item.qty = calc.add(item.qty, detail.qty);
}
}
}
}
}
//计算推荐和扫描的不是用一个的数量
export function calcHandleNewQty(detailSource) {
for (let item of detailSource) {
@ -151,6 +212,8 @@ export function calcTreeHandleQty(detailSource) {
detail.handleQty = calc.add(detail.handleQty, pack.handleQty);
}
}
}else{
detail.handleQty = new Decimal(0).toNumber();
}
if(detail.handleQty){
item.handleQty = calc.add(item.handleQty, detail.handleQty);

26
src/common/directory.js

@ -211,6 +211,18 @@ export function getListItemTypeDesc(list) {
return desc;
}
//获取物品状态(多个)
export function getListItemStatusDesc(list) {
let desc = '';
list.forEach(res => {
desc += getItemStateInfo(res).label + ","
})
desc = desc.slice(0, -1);
return desc;
}
//获取物品类型
export function getItemTypeInfo(value) {
var resultInfo = "";
@ -304,6 +316,20 @@ export function getLocationAreaTypeName(value) {
return location == '' ? value : location.label;
}
//获取物品类型名称
export function getItemTypeName(value) {
let location = getItemTypeInfo(value);
return location == '' ? value : location.label;
}
//获取物品状态名称
export function getItemStatusName(value) {
let location = getItemStateInfo(value);
return location == '' ? value : location.label;
}
//获取库位类型名称
export function getLocationTypeName(value) {

44
src/common/label.js

@ -10,10 +10,11 @@ import {
getDirectoryItemArray
} from '../common/directory.js';
import {
getManagementPrecisions
} from '@/common/balance.js';
export function getLabelInfo(scanMsg, headerType, callBack) {
console.log('扫描信息:', scanMsg);
export function getLabelInfo(scanMsg, headerType, callBack,locationCode,isHavePackNumber) {
if (scanMsg.length == 0) {
return null
}
@ -41,17 +42,17 @@ export function getLabelInfo(scanMsg, headerType, callBack) {
let type = header.substring(header.length - 1, header.length);
if (type == 'Q') //qrcode
{
getQRCodeInfo(header, version, scanMsg, callBack);
getQRCodeInfo(header, version, scanMsg, callBack,locationCode,isHavePackNumber);
}
// else if (type == 'B') //barcode
// {
// getBarCodeInfo(header, version, items[2], callBack);
// }
else { //直接输入文本
getBarCodeInfo('text', 'V1.0', scanMsg, callBack);
getBarCodeInfo('text', 'V1.0', scanMsg, callBack,locationCode,isHavePackNumber);
}
} else {
getBarCodeInfo('text', 'V1.0', scanMsg, callBack);
getBarCodeInfo('text', 'V1.0', scanMsg, callBack,locationCode,isHavePackNumber);
// let labelResult = {
// label: {
// labelType: "",
@ -66,7 +67,7 @@ export function getLabelInfo(scanMsg, headerType, callBack) {
}
}
export function getQRCodeInfo(header, version, scanMsg, callBack) {
export function getQRCodeInfo(header, version, scanMsg, callBack,locationCode,isHavePackNumber) {
//获取包装信息
let labelItem = labelDic.find(r => r.header == header && r.version == version);
if (labelItem == undefined) {
@ -91,7 +92,7 @@ export function getQRCodeInfo(header, version, scanMsg, callBack) {
};
labelDic.push(newItem);
getLabelItems(newItem, scanMsg, callBack);
getLabelItems(newItem, scanMsg, callBack,locationCode,isHavePackNumber);
}
}).catch(err => {
labelResult.success = false;
@ -99,22 +100,35 @@ export function getQRCodeInfo(header, version, scanMsg, callBack) {
callBack(err);
})
} else {
getLabelItems(labelItem, scanMsg, callBack);
getLabelItems(labelItem, scanMsg, callBack,locationCode,isHavePackNumber);
}
}
export function getLabelItems(labelItem, scanMsg, callBack) {
export async function getLabelItems(labelItem, scanMsg, callBack,locationCode) {
let managementType = ""
let labelResult = analysisQRCodeLabel(labelItem, scanMsg);
if (labelResult.label.labelType == 'PurchaseLabel' || labelResult.label.labelType == 'MakeLabel') {
//查询包装信息
let packingNumber = labelResult.label.packingNumber
let packingNumber1 = labelResult.label.packingNumber//记录单号
if(locationCode){
await getManagementPrecisions([labelResult.label.itemCode], locationCode, res => {
if (res.success) {
const managementList = res.list;
managementType = managementList&&managementList[0]&&managementList[0].ManagementPrecision ? managementList[0].ManagementPrecision :'BY_PACKAGING'
if(managementType == 'BY_BATCH' || managementType == 'BY_QUANTITY'){
if(!isHavePackNumber){
packingNumber = ''
}
}
}
})
}
if (packingNumber != undefined && packingNumber != '') {
getPackageListByNumber(packingNumber).then(pack => {
await getPackageListByNumber(packingNumber).then(pack => {
if (pack.data.reqPackage) {
labelResult.package = pack.data.reqPackage;
labelResult.package.subList = pack.data.subList;
console.log('包装信息', JSON.stringify(labelResult.package))
} else {
labelResult.success = false;
labelResult.message = '包装号[' + packingNumber + ']没有包装信息';
@ -128,6 +142,10 @@ export function getLabelItems(labelItem, scanMsg, callBack) {
} else {
//线边的物料可能没有箱码
labelResult.package = labelResult.label;
labelResult.package.number = packingNumber1 ? packingNumber1 : ''
labelResult.package.packingNumber=''
labelResult.managementType = managementType
console.log(999,labelResult)
callBack(labelResult);
// labelResult.success = false;
// labelResult.message = '在条码中未解析到箱码';

55
src/common/record.js

@ -31,6 +31,22 @@ export function createItemInfo(balance, pack) {
item.containerNumber = pack.parentNumber ? pack.parentNumber : pack.number;
return item;
}
export function createItemInfoForLabel(balance, label) {
let item = {
itemCode: label.itemCode,
itemName: label.itemName,
packQty: '',
packUnit: '',
qty: new Decimal(balance.qty).toNumber(),
handleQty: new Decimal(0).toNumber(),
uom: balance.uom,
subList: [],
// packingNumber: pack.number,
// parentPackingNumber: pack.parentNumber,
}
item.containerNumber = balance.parentNumber ? balance.parentNumber : balance.number;
return item;
}
export function createDetailInfo(balance, pack) {
balance.scaned = true;
@ -48,7 +64,23 @@ export function createDetailInfo(balance, pack) {
return detail;
}
export function createDetailInfoForLabel(balance, pack,label) {
balance.scaned = true;
// data.toInventoryStatus = this.toInventoryStatus == "" ? data.inventoryStatus : this.toInventoryStatus;
// data.inventoryStatus = data.inventoryStatus;
let detail = deepCopyData(balance);
detail.balanceQty = new Decimal(detail.qty).toNumber()
detail.qty = new Decimal(balance.qty).toNumber();
detail.packQty =''
detail.packUnit =''
console.log(988,label.qty)
detail.handleQty = new Decimal(label.qty).toNumber();
// detail.package = pack;
// detail.productionlineCode = pack.productionLineCode; // 制品回收记录需要加的
// detail.toInventoryStatus = balance.inventoryStatus; // 制品回收记录需要加的
return detail;
}
export function createDetailByPackInfo(pack) {
@ -79,7 +111,22 @@ export function calcHandleQty(detailSource) {
}
}
}
//添加数量
export function calcHandleQtyAdd(detailSource,label) {
for (let item of detailSource) {
item.handleQty = item.handleQty || new Decimal(0).toNumber();
item.qty = item.qty|| new Decimal(0).toNumber();
item.handleQty = calc.add(item.handleQty, label.qty);
for (let detail of item.subList) {
if (detail != undefined) {
if (detail.scaned) {
detail.handleQty = calc.add(detail.handleQty, label.qty);
}
// item.qty = calc.add(item.qty, detail.qty);
}
}
}
}
export function calcTreeHandleQty(detailSource) {
for (let item of detailSource) {
item.handleQty = new Decimal(0).toNumber();
@ -104,7 +151,8 @@ export function getBusinessType(typeCode, callback) {
businessType: '',
fromLocationAreaTypeList: '',
toLocationAreaTypeList: '',
itemCodeTypeList: "",
itemTypeList: "",
itemStatusList:"",
useOnTheWay: "FALSE",
fromInventoryStatuses: '',
toInventoryStatuses: '',
@ -115,7 +163,8 @@ export function getBusinessType(typeCode, callback) {
result.businessType = res.data.list[0];
result.fromLocationAreaTypeList = getDirectoryItemArray(res.data.list[0].outAreaTypes);
result.toLocationAreaTypeList = getDirectoryItemArray(res.data.list[0].inAreaTypes);
result.itemCodeTypeList = getDirectoryItemArray(res.data.list[0].itemTypes)
result.itemTypeList = getDirectoryItemArray(res.data.list[0].itemTypes)
result.itemStatusList =getDirectoryItemArray(res.data.list[0].itemStatuses)
result.fromInventoryStatuses = res.data.list[0].outInventoryStatuses;
result.toInventoryStatuses = res.data.list[0].inInventoryStatuses;
result.useOnTheWay = res.data.list[0].useOnTheWay

10
src/mycomponents/balance/balance.vue

@ -4,7 +4,9 @@
<view>
<pack v-if="isShowParentPack &&dataContent.parentNumber" title="父包装"
:packingCode="dataContent.parentNumber"></pack>
<pack v-if="isShowPack && dataContent.packingNumber" :packingCode="dataContent.packingNumber"></pack>
<pack v-if="isShowPack && dataContent.packingNumber"
:isShowPackingNumberProps="isShowPackingNumberProps"
:packingCode="dataContent.packingNumber"></pack>
<batch v-if="isShowBatch && dataContent.batch" :batch="dataContent.batch"></batch>
<location title="来源库位" v-if="isShowFromLocation" :locationCode="dataContent.locationCode"></location>
<to-location title="目标库位" v-if="isShowToLocation" :locationCode="dataContent.toLocationCode">
@ -96,6 +98,12 @@
type: Boolean,
default: true
},
isShowPackingNumberProps: {
type: Boolean,
default: false
},
},
watch: {

21
src/mycomponents/balance/pack.vue

@ -1,33 +1,40 @@
<template>
<view class="card_view">
<view class="card_view" v-if="ShowPackingNumber || isShowPackingNumberProps">
<text class="card_packing_code ">{{title}}</text>
<text class="card_content ">{{packingCode}}</text>
</view>
</template>
<script>
import {
getSwitchInfoByCode
} from '@/common/basic.js';
export default {
components: {
},
data() {
return {
}
ShowPackingNumber:true
};
},
props: {
packingCode: {
type: String,
default: ''
},
title:
{
title:{
type:String,
default: '包装'
},
//
isShowPackingNumberProps:{
type:Boolean,
default:false
}
},
watch: {
mounted() {
this.ShowPackingNumber=getSwitchInfoByCode('ShowPackingNumber')
},
methods: {

4
src/mycomponents/balance/recommendBalanceBatch.vue

@ -6,8 +6,8 @@
推荐
</view>
<view style="word-break: break-all">
<pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack>
<batch v-if="isShowBatch" :batch="detail.batch"></batch>
<pack v-if="isShowPack&&detail.packingNumber" :packingCode="detail.packingNumber"></pack>
<batch v-if="isShowBatch&&detail.batch" :batch="detail.batch"></batch>
<location v-if="isShowLocation" :locationCode="detail.fromLocationCode"></location>
</view>
</view>

114
src/mycomponents/detail/comDetailCardBatch.vue

@ -1,29 +1,27 @@
<template>
<view 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" :class="item.scaned?'scan_view':''">
<uni-swipe-action ref="swipeAction" v-if='index==0'>
<view class="" style="background-color: #fff;">
<uni-collapse ref="collapse1" @change="">
<uni-collapse-item :open="true">
<template v-slot:title>
<item-compare-qty :dataContent="dataContent" :handleQty="dataContent.handleQty"
:isShowStdPack="false">
</item-compare-qty>
</template>
<uni-swipe-action-item
:right-options="(item.scaned&&isEdit)?editAndRemoveOptions : item.scaned? removeOptions:options"
@click="swipeClick($event,item,'parent')" style='padding:0px 0px 5px 0px;align-items: center;'>
<!-- <recommend :detail="item" :isShowStatus="isShowStatus" :isShowToLocation="false" isShowPack='false'>
</recommend> -->
<div style="display: flex;">
<div style="flex: 1;">
<batch v-if="item.batch" :batch="item.batch"></batch>
<location title="来源库位" v-if="item.fromLocationCode" :locationCode="item.fromLocationCode"></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" :queryBalance="queryBalance"
@confirm="confirm"></balance-qty-edit>
<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?scanOptions:detailOptions"
style='padding:0px 0px 5px 0px;align-items: center;'>
<recommend :detail="item" :isShowFromLocation="isShowFromLocation" :isShowStatus="isShowStatus" :isShowToLocation="isShowToLocation">
</recommend>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
</uni-collapse-item>
</uni-collapse>
<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>
@ -31,20 +29,13 @@
</template>
<script>
import config from '@/static/config.js'
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 {
getDetailOption,
getPurchaseReceiptOption,
getRemoveOption,
getEditRemoveOption
getPurchaseReceiptOption
} from '@/common/array.js';
export default {
@ -53,10 +44,7 @@
itemCompareQty,
recommend,
balanceQtyEdit,
winScanLocation,
location,
toLocation,
batch,
winScanLocation
},
props: {
dataContent: {
@ -79,6 +67,15 @@
type: Boolean,
default: true
},
isShowFromLocation: {
type: Boolean,
default: true
},
isShowToLocation: {
type: Boolean,
default: false
},
locationAreaTypeList: {
type: Array,
default: null
@ -91,10 +88,6 @@
type: Boolean,
default: true
},
isEdit: {
type: Boolean,
default: true
},
},
watch: {
dataContent: {
@ -109,8 +102,8 @@
})
}
},
immediate: true,
deep: true
}
@ -123,10 +116,7 @@
locatonItem: {},
editItem: {},
detailOptions: [],
scanOptions: [],
options: [],
removeOptions: [],
editAndRemoveOptions: []
scanOptions: []
}
},
@ -137,8 +127,7 @@
if (this.scanOptions.length == 0) {
this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, false)
}
this.removeOptions = getRemoveOption();
this.editAndRemoveOptions = getEditRemoveOption()
// this.showLocation();
},
@ -189,35 +178,6 @@
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>

71
src/mycomponents/detail/comJobDetailCardBatch.vue

@ -1,20 +1,23 @@
<!-- 采购上架任务详情按批次显示详情的组件 -->
<template>
<view class="" style="background-color: #fff;">
<uni-swipe-action>
<uni-swipe-action-item
:right-options="(dataContent.scaned&&isEdit)?editAndRemoveOptions : dataContent.scaned? removeOptions:options"
@click="swipeClick($event,dataContent,'parent')">
<itemCompareQty :dataContent="dataContent" :handleQty="dataContent.handleQty" :isShowPackUnit="true">
</itemCompareQty>
<batch v-if="dataContent.subList[0].batch" :batch="dataContent.subList[0].batch"></batch>
<location title="来源库位" v-if="dataContent.subList[0].fromLocationCode"
:locationCode="dataContent.subList[0].fromLocationCode">
</location>
</uni-swipe-action-item>
</uni-swipe-action>
<recommend-qty-edit ref="receiptEdit" :dataContent="editItem" :settingParam="settingParam" @confirm="confirm">
<uni-collapse ref="collapse">
<uni-collapse-item :open="true">
<template v-slot:title>
<itemCompareQty :dataContent="dataContent" :handleQty="dataContent.handleQty"
:isShowPackUnit="true"></itemCompareQty>
</template>
<package-list :dataContent="dataContent.subList"
:isEdit="settingParam.allowModifyQty=='TRUE'"
:settingParam="settingParam"
@collapseChange="collapseChange"
@updateData="updateData"
:isShowStatus="isShowStatus"
:isShowPackListStatus="isShowPackListStatus"
>{</package-list>
</uni-collapse-item>
</uni-collapse>
<recommend-qty-edit ref=" receiptEdit" :dataContent="editItem" :settingParam="settingParam" @confirm="confirm">
</recommend-qty-edit>
<comMessage ref="message"></comMessage>
</view>
@ -29,13 +32,7 @@
import pack from '@/mycomponents/balance/pack.vue'
import detailList from '@/mycomponents/detail/detailList.vue'
import packageList from '@/mycomponents/package/packageList.vue'
import location from '@/mycomponents/balance/location.vue'
import toLocation from '@/mycomponents/balance/toLocation.vue'
import batch from '@/mycomponents/balance/batch.vue'
import {
getRemoveOption,
getEditRemoveOption
} from '@/common/array.js';
import {
getDetailOption,
getPurchaseReceiptOption
@ -50,10 +47,7 @@
jobDetailPopup,
receiptDetailInfoPopup,
detailList,
packageList,
location,
toLocation,
batch,
packageList
},
props: {
dataContent: {
@ -75,10 +69,6 @@
isShowPackListStatus: {
type: Boolean,
default: true
},
isEdit: {
type: Boolean,
default: true
}
},
watch: {
@ -95,10 +85,7 @@
},
locatonItem: {},
detailOptions: [],
scanOptions: [],
options: [],
removeOptions: [],
editAndRemoveOptions: []
scanOptions: []
}
},
@ -110,9 +97,7 @@
this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, this.settingParam
.allowModifyLocation)
}
this.removeOptions = getRemoveOption();
this.editAndRemoveOptions = getEditRemoveOption()
},
@ -120,13 +105,13 @@
console.log('updated')
},
methods: {
collapseChange() {
methods: {
collapseChange(){
setTimeout(() => {
this.resizeCollapse();
}, 500)
},
resizeCollapse() {
this.$nextTick(r => {
this.$refs.collapse.resize()
@ -147,8 +132,8 @@
this.$forceUpdate();
},
swipeClick(e, item, type) {
if (e.content.text == "编辑") {
swipeClick(e, item) {
if (e.content.text == "编辑") {
this.edit(item)
} else if (e.content.text == "移除") {
this.remove(item)
@ -173,7 +158,7 @@
this.editItem.handleQty = qty;
this.$emit('updateData')
},
updateData() {
updateData(){
this.$emit('updateData')
}
}

56
src/mycomponents/detail/comRecommendDetailCard.vue

@ -13,24 +13,22 @@
<uni-swipe-action-item @click="swipeClick($event,item)"
:right-options="item.scaned?scanOptions:detailOptions"
style='padding:0px 0px 5px 0px;align-items: center;'>
<view v-if="item.isRecommend" class="uni-flex" style="flex-direction: row; align-items: center;background-color: antiquewhite;">
<view class="" style="font-size: 32rpx; color: black; font-weight: bold; text-align: center;">
<view v-if="item.isRecommend" class="uni-flex" style="flex-direction: row; align-items: center;">
<view class="" style="font-size: 32rpx; color: #3c9cff; font-weight: bold; text-align: center;padding: 10px;">
<br/>
</view>
<recommend :detail="item" :isShowStatus="isShowStatus" :isShowToLocation="false">
<recommend :detail="item" :isShowStatus="isShowStatus" :isShowFromLocation="isShowFromLocation" :isShowToLocation="isShowToLocation" style="flex:1" :isShowBatch='item.batch ? true:false' :isShowPack='isShowPack'>
</recommend>
</view>
<view v-else class="uni-flex" style="flex-direction: row; align-items: center;background-color: antiquewhite; margin-top: 5rpx;">
<view class="" style="font-size: 32rpx; color: red; font-weight: bold; text-align: center;">
<view v-else class="uni-flex" style="flex-direction: row; align-items: center; margin-top: 5rpx;" :class="item.scaned?'scan_view':''">
<view class="" style="font-size: 32rpx; color: rgb(107, 196, 78); font-weight: bold; text-align: center;padding: 10px;">
<br/>
</view>
<recommend :detail="item" :isShowStatus="isShowStatus" :isShowToLocation="false">
<recommend :detail="item" :isShowStatus="isShowStatus" :isShowFromLocation="isShowFromLocation" :isShowToLocation="isShowToLocation" style="flex:1" :isShowBatch='item.batch? true:false' :isShowPack='isShowPack'>
</recommend>
</view>
@ -40,7 +38,10 @@
</view>
</uni-collapse-item>
</uni-collapse>
<balance-qty-edit ref="qtyEdit" :settingParam="settingParam" :queryBalance="queryBalance" @confirm="confirm"></balance-qty-edit>
<!-- <balance-qty-edit ref="qtyEdit" :settingParam="settingParam" :queryBalance="queryBalance" @confirm="confirm"></balance-qty-edit> -->
<recommend-qty-edit ref="recommendQtyEdit" :dataContent="editItem" :handleQty="editItem.qty" @confirm="confirm" :settingParam='settingParam'
:isShowStatus="isShowStatus"></recommend-qty-edit>
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation'
:locationAreaTypeList="locationAreaTypeList"></win-scan-location>
<comMessage ref="message"></comMessage>
@ -50,7 +51,8 @@
<script>
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
// import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import recommendQtyEdit from '@/mycomponents/qty/recommendQtyEdit.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import {
getDetailOption,
@ -62,8 +64,9 @@
components: {
itemCompareQty,
recommend,
balanceQtyEdit,
winScanLocation
// balanceQtyEdit,
winScanLocation,
recommendQtyEdit
},
props: {
dataContent: {
@ -98,6 +101,14 @@
type: Boolean,
default: true
},
isShowFromLocation: {
type: Boolean,
default: true
},
isShowToLocation: {
type: Boolean,
default: true
},
},
watch: {
dataContent: {
@ -129,14 +140,20 @@
},
mounted() {
if (this.detailOptions.length == 0) {
this.detailOptions = getDetailOption();
}
if (this.scanOptions.length == 0) {
this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, false)
}
// this.showLocation();
if(import.meta.env.VITE_MANAGE_MODEL=="BY_PACKAGING"){
if (this.detailOptions.length == 0) {
this.detailOptions = getDetailOption();
}
}else {
this.scanOptions.splice(0,1)
}
},
methods: {
@ -153,7 +170,8 @@
},
edit(item) {
this.editItem = item;
this.$refs.qtyEdit.openEditPopup(item.balance, item.handleQty);
// this.$refs.qtyEdit.openEditPopup(item.balance, item.handleQty);
this.$refs.recommendQtyEdit.openTaskEditPopup(item.qty,item.handleQty,item.labelQty);
},
detail(item) {

241
src/mycomponents/detail/comRecommendDetailCardBatch.vue

@ -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>

2
src/mycomponents/item/itemCompareQty.vue

@ -20,7 +20,7 @@
<script>
import item from '@/mycomponents/item/item.vue'
import qty from '@/mycomponents/qty/qty.vue'
import recommendQty from '@/mycomponents/qty/recommendQty.vue'
import recommendQty from '@/mycomponents/qty/recommendHandleQty.vue'
import compareQty from '@/mycomponents/qty/compareQty.vue'
import balanceQty from '@/mycomponents/qty/balanceQty.vue'

4
src/mycomponents/job/jobComMainDetailCard.vue

@ -8,9 +8,9 @@
></itemCompareQty>
<!-- :objTextStyle="{'fontWeight':'bold','fontSize':'40rpx'}" -->
<div class="u-p-l-10">
<pack v-if="isShowPack && dataContent.packingNumber!=null" :packingCode="dataContent.packingNumber">
<pack v-if="isShowPack && dataContent.packingNumber" :packingCode="dataContent.packingNumber">
</pack>
<batch v-if="isShowBatch && dataContent.batch!=null" :batch="dataContent.batch"></batch>
<batch v-if="isShowBatch && dataContent.batch" :batch="dataContent.batch"></batch>
<view class="u-flex u-row-between">
<location v-if="isShowFromLocation&&dataContent.fromLocationCode" title="来源库位" :locationCode="dataContent.fromLocationCode">
</location>

2
src/mycomponents/job/jobSettingInfo.vue

@ -29,7 +29,7 @@
</view>
<view class="item">
<text class="item_title">允许修改批次 : </text>
<text class="text_wrap">{{converter(dataContent.allowModifyBach)}} </text>
<text class="text_wrap">{{converter(dataContent.allowModifyBatch)}} </text>
</view>
<view class="item">
<text class="item_title">允许部分完成 : </text>

19
src/mycomponents/package/packageCard.vue

@ -6,7 +6,8 @@
<view style="word-break: break-all;">
<!-- <container v-if="isShowContainer&&dataContent.containerNumber!=null" :container="dataContent.containerNumber">
</container> -->
<pack v-if="isShowPack && dataContent.packingNumber" :packingCode="dataContent.packingNumber"></pack>
<pack :packingCode="dataContent.packingNumber" :isShowPackingNumberProps='isShowPackingNumberProps'></pack>
<batch v-if="isShowBatch && dataContent.batch!=null" :batch="dataContent.batch"></batch>
<location v-if="isShowFromLocation" title="来源库位" :locationCode="dataContent.fromLocationCode">
</location>
@ -19,12 +20,12 @@
<recommend-qty v-if="dataContent.handleQty==null || dataContent.handleQty==undefined" :dataContent="dataContent"
:isShowStdPack="false" :isShowStatus="isShowStatus"></recommend-qty>
<compare-qty v-else :dataContent="dataContent" :recommendQty="Number(dataContent.qty)"
:handleQty="Number(dataContent.handleQty)" :isShowStdPack="false" :isShowStatus="isShowStatus">
:handleQty="Number(dataContent.handleQty)" :isShowStdPack="false" :isShowStatus="isShowStatus" :isShowRecommendQty='isShowRecommendQty'>
</compare-qty>
<view class="uni-flex uni-row center" style="vertical-align:center ;" v-if="isDevlement()">
<!-- <view class="uni-flex uni-row center" style="vertical-align:center ;" v-if="isDevlement()">
<text style="font-size: 25rpx;color: #2979ff; width: 45rpx; " @click="copy">复制</text>
</view>
</view> -->
</view>
</view>
</view>
@ -90,7 +91,15 @@
type: String,
default: '库位'
},
//
isShowPackingNumberProps:{
type:Boolean,
default:false
},
isShowRecommendQty: {
type: Boolean,
default: true
}
},
watch: {
//

48
src/mycomponents/package/packageList.vue

@ -1,13 +1,13 @@
<template>
<view class="">
<view class="" v-for="(item,index) in dataContent" :key="item.id">
<uni-collapse ref="collapse2" @change="collapseChange">
<uni-collapse-item :disabled="false">
<uni-collapse ref="collapse2" @change="collapseChange" >
<uni-collapse-item :disabled="false" :open="true">
<template v-slot:title>
<uni-swipe-action>
<uni-swipe-action-item
:right-options="(item.scaned&&isEdit)?editAndRemoveOptions : item.scaned? removeOptions:options"
@click="swipeClick($event,item,'parent')">
@click="swipeClick($event,item,'parent',index)">
<package-card :dataContent="item" :isShowLocation="false"
:isShowFromLocation="isShowFromLocation"
:isShowStatus="isShowStatus"></package-card>
@ -19,12 +19,13 @@
style=" width: 100%; background-color: antiquewhite;">
<uni-swipe-action>
<uni-swipe-action-item
:right-options="(pack.scaned&&isEdit)?editAndRemoveOptions : pack.scaned? removeOptions:options"
@click="swipeClick($event,pack,'child')">
<package-card :dataContent="pack" :isShowLocation="false" :isShowFromLocation="false"
:right-options="(pack.scaned)?editAndRemoveOptions : pack.scaned? removeOptions:options"
@click="swipeClick($event,pack,'child',index,item)">
<package-card :dataContent="pack" :isShowLocation="false" :isShowFromLocation="false" :isShowPackingNumberProps='isShowPackingNumberProps'
:isShowToLocation="false"
:isShowStatus="isShowPackListStatus"
:isShowBatch="false"></package-card>
:isShowStatus="isShowPackListStatus"
:isShowRecommendQty='false'
:isShowBatch="false"></package-card>
</uni-swipe-action-item>
</uni-swipe-action>
@ -32,7 +33,7 @@
</uni-collapse-item>
</uni-collapse>
</view>
<recommend-qty-edit ref="receiptEdit" :dataContent="editItem" :settingParam="settingParam" @confirm="confirm">
<recommend-qty-edit ref="receiptEdit" :dataContent="editItem" :settingParam="settingParam" @confirm="confirm" :isNumPackTips='isNumPackTips'>
</recommend-qty-edit>
<comMessage ref="comMessage"></comMessage>
</view>
@ -113,25 +114,34 @@
isEdit: {
type: Boolean,
default: false
}
},
//
isShowPackingNumberProps:{
type:Boolean,
default:false
},
isNumPackTips: {
type: Boolean,
default: false
},
},
watch: {
},
methods: {
swipeClick(e, item, type) {
swipeClick(e, item, type,index,ele) {
if (e.content.text == "编辑") {
this.edit(item)
} else if (e.content.text == "移除") {
if (type == 'parent') {
this.removeParent(item);
this.removeParent(item,type);
} else {
this.remove(item)
this.remove(item,type,index,ele)
}
}
},
removeParent(item) {
removeParent(item,type) {
this.$refs.comMessage.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
@ -142,7 +152,7 @@
subItem.handleQty = null;
})
this.$emit('updateData')
this.$emit('updateData',type,item)
this.$forceUpdate()
}
});
@ -150,13 +160,14 @@
remove(item) {
remove(item,type,index,ele) {
this.$refs.comMessage.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
item.scaned = false
item.handleQty = null;
this.$emit('updateData')
this.collapseChange()
this.$emit('updateData',type,item,index,ele)
this.$forceUpdate()
}
});
@ -164,7 +175,8 @@
edit(item) {
this.editItem = item;
this.$refs.receiptEdit.openTaskEditPopup(item.qty, item.handleQty, item.labelQty);
console.log(777,item)
this.$refs.receiptEdit.openTaskEditPopup(item.qty, item.handleQty, item.labelQty, item.packQty);
},
collapseChange() {
this.$emit("collapseChange");

2
src/mycomponents/qty/balanceQtyEdit.vue

@ -44,7 +44,7 @@
<view class="uni-flex uni-row space-between padding title u-col-center" v-if="queryBalance">
<text>库存数量 : </text>
<view class="uni-flex uni-row uni-center" style="align-items: center;">
<text class="text_recommend">{{Number(dataContent.balanceQty)}}</text>
<text class="text_recommend" v-if="dataContent.balanceQty">{{Number(dataContent.balanceQty)}}</text>
<uom :uom="dataContent.uom"></uom>
</view>
</view>

7
src/mycomponents/qty/compareQty.vue

@ -1,8 +1,9 @@
<template>
<view >
<status v-show="isShowStatus" :status='dataContent.inventoryStatus'></status>
<view>
<status v-show="isShowStatus && dataContent.inventoryStatus" :status='dataContent.inventoryStatus'></status>
<view class="uni-flex uni-row center">
<view class="uni-flex uni-row ">
<view v-if="Number(handleQty)!=0">
<view v-if="isShowRecommendQty">
<view v-if="Number(recommendQty)>Number(handleQty)" class="text_greater">
@ -28,7 +29,7 @@
</view>
</view>
</view>
<!-- <uom :uom="dataContent.uom">
<!-- <uom :uom="dataContent.uom">
</uom> -->
<uom v-show="Number(handleQty)!=0||(isShowRecommendQty&&Number(recommendQty)>0)" :uom="dataContent.uom">
</uom>

226
src/mycomponents/qty/numbeIntegerrBox.vue

@ -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>

2
src/mycomponents/qty/packUnit.vue

@ -1,5 +1,5 @@
<template>
<view class="std_pack" v-if="dataContent.packQty!=undefined">
<view class="std_pack" v-if="dataContent.packQty">
<text>
<!-- {{Number(dataContent.packQty)}}{{getUomInfo(dataContent.uom)}}/{{getPackUnitName(dataContent.packUnit)}} -->
<!-- {{getPackUnitName(dataContent.packUnit)}}({{Number(dataContent.packQty)}}{{getUomInfo(dataContent.uom)}}) -->

11
src/mycomponents/qty/qtyEdit.vue

@ -89,7 +89,11 @@
allowEditStatus: {
type: Boolean,
default: false
}
},
allowBiggerQty: {
type: String,
default: 'TRUE'
},
},
methods: {
openEditPopup(item, handleQty) {
@ -113,14 +117,15 @@
this.allQty = val * Number(this.dataContent.packQty);
},
setValue() {
console.log(344,this.allowBiggerQty)
var balanceQty = Number(this.dataContent.qty);
if (this.allQty == 0) {
this.$refs.comMessage.showConfirmWarningModal('数量必须大于0',
res => {
this.allQty = balanceQty;
})
} else if (this.allQty > balanceQty) {
this.$refs.comMessage.showConfirmWarningModal('数量[' + this.allQty + ']不允许大于库存数量[' + balanceQty + ']',
} else if (this.allQty > balanceQty && this.allowBiggerQty == 'FALSE') {
this.$refs.comMessage.showConfirmWarningModal('数量[' + this.allQty + ']不允许大于任务数量[' + balanceQty + ']',
res => {
this.allQty = balanceQty;
})

98
src/mycomponents/qty/recommendHandleQty.vue

@ -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>

10
src/mycomponents/qty/recommendQty.vue

@ -1,23 +1,23 @@
<template>
<view>
<status v-if="isShowStatus" :status='dataContent.inventoryStatus'></status>
<status v-if="isShowStatus && dataContent.inventoryStatus" :status='dataContent.inventoryStatus'></status>
<view class="uni-flex uni-row center" v-if="isShowCount" >
<view class="text_recommend ">
{{Number(dataContent.qty)}}
{{Number(dataContent.qty) ? Number(dataContent.qty) : ''}}
</view>
<!-- /{{Number(dataContent.packQty)}} -->
<!-- v-show="!isShowStdPack" -->
<uom :uom="dataContent.uom"></uom>
<view v-if="isShowPackCount && dataContent.packQty!=undefined" class="uni-flex uni-row ">
<!-- <view v-if="isShowPackCount && dataContent.packQty!=undefined" class="uni-flex uni-row ">
<view class="uom">/</view>
<view class="text_packQty">{{ calc(dataContent.qty,dataContent.packQty)}}
</view>
</view>
</view> -->
</view>
<view>
<pack-unit :dataContent="dataContent"></pack-unit>
<!-- <pack-unit :dataContent="dataContent"></pack-unit> -->
<!-- <std-pack-qty v-show="isShowStdPack" :dataContent="dataContent"></std-pack-qty> -->
</view>
</view>

44
src/mycomponents/qty/recommendQtyEdit.vue

@ -12,25 +12,22 @@
</view>
<view class='split_line'></view>
<view class="uni-flex uni-column" style="background-color: white; height:60%;">
<view class="uni-flex uni-column ">
<view class="uni-flex uni-row space-between padding title ">
<view class="uni-flex uni-column">
<view class="uni-flex uni-row space-between padding title " v-if="dataContent.packQty">
<text>包装个数 : </text>
<view class="uni-flex uni-row u-col-center">
<uni-number-box :min="0" @change="calcQty($event,stdCount)" :value="stdCount">
</uni-number-box>
{{getPackUnitName(dataContent.packUnit)}}
</view>
</view>
<view class='split_line'></view>
<view class="uni-flex uni-row space-between padding title u-col-center">
<view class='split_line' v-if="dataContent.packQty"></view>
<view class="uni-flex uni-row space-between padding title u-col-center" v-if="dataContent.packQty">
<text>包装规格 : </text>
<view class="uni-flex u-col-center uni-row">
<packUnit :dataContent="dataContent"></packUnit>
</view>
</view>
<view class='split_line'></view>
<view class="uni-flex uni-row space-between padding title u-col-center">
<text>总数量 : </text>
@ -41,6 +38,13 @@
</view>
</view>
<view class='split_line'></view>
<view class="uni-flex uni-row space-between padding title u-col-center" v-if="showBalanceQty">
<text>库存数量 : </text>
<view class="uni-flex uni-row uni-center" style="align-items: center;">
<text class="text_recommend">{{Number(dataContent.balanceQty)}}</text>
<uom :uom="dataContent.uom"></uom>
</view>
</view>
</view>
</view>
</view>
@ -108,6 +112,19 @@ import { nextTick } from 'vue';
type: Object,
default: null
},
isNumTips: {
type: Boolean,
default: true
},
//
isNumPackTips: {
type: Boolean,
default: false
},
showBalanceQty: {
type: Boolean,
default: false
},
},
methods: {
getPackUnitName(packUnit) {
@ -170,7 +187,18 @@ import { nextTick } from 'vue';
setValue() {
// var recommendQty = Number(this.dataContent.qty);
// var labelQty = Number(this.dataContent.record.label.qty);
if (this.allQty > this.labelQty) {
// isNumPackTips
if (this.allQty > parseFloat(this.dataContent.packQty) && this.isNumPackTips) {
this.$refs.comMessage.showErrorMessage('数量[' + this.allQty + ']不允许大于包装数量[' +
this.dataContent.packQty +
']',
res => {
this.allQty = this.dataContent.packQty
})
return
}
//
if (this.allQty > this.labelQty && this.isNumTips && !this.isNumPackTips) {
this.$refs.comMessage.showErrorMessage('数量[' + this.allQty + ']不允许大于标签数量[' +
this.labelQty +
']',

297
src/mycomponents/query/fifoQuery.vue

@ -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>

27
src/mycomponents/record/recordComDetailCard.vue

@ -4,7 +4,7 @@
<uni-collapse-item :open="true">
<template v-slot:title>
<uni-swipe-action>
<uni-swipe-action-item @click="removeItem($event,dataContent)" :right-options="removeOptions">
<uni-swipe-action-item @click="removeItem($event,dataContent)" :right-options="scanOptions">
<item-qty :dataContent="dataContent" :isShowBalance="true"
:isShowBalanceQty="isShowBalanceQty"
:isShowRecommendQty="false"
@ -23,7 +23,9 @@
<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"
:isShowPack="true"
:isShowPackingNumberProps="isShowPackingNumberProps"
:isShowFromLocation="isShowFromLocation"
:isShowToLocation="isShowToLocation" :isShowParentPack="isShowParentPack">
</balance>
</uni-swipe-action-item>
@ -32,7 +34,7 @@
</view>
</uni-collapse-item>
</uni-collapse>
<balance-qty-edit ref="balanceQtyEdit" @confirm="confirm" ></balance-qty-edit>
<balance-qty-edit ref="balanceQtyEdit" @confirm="confirm" :queryBalance="queryBalance" ></balance-qty-edit>
<record-detail-popup ref="recordDetailPopup"></record-detail-popup>
<comMessage ref="comMessage"></comMessage>
</view>
@ -109,19 +111,32 @@
type: Boolean,
default: true
},
isShowHandleQty: {
type: Boolean,
default: true
},
isShowModifedLocation: {
type: Boolean,
default: false
},
allowModifyQty: {
type: Boolean,
default: false
default: true
},
allowModifyLocation: {
type: Boolean,
default: false
}
},
queryBalance: {
type: Boolean,
default: true
},
isShowPackingNumberProps: {
type: Boolean,
default: false
},
},
watch: {

225
src/mycomponents/record/recordComDetailCardBatch.vue

@ -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>

23
src/mycomponents/scan/winComScan.vue

@ -58,6 +58,11 @@
import {
getLabelInfo
} from '../../common/label.js';
import {
getManagementPrecisions
} from '@/common/balance.js';
export default {
name: "winComScan",
@ -83,7 +88,16 @@
headerType: {
type: String,
default: 'HPQ' //HLB HMQ HCQ HPQ
}
},
locationCode:{
type: String,
default: ''
},
//
isHavePackNumber: {
type: Boolean,
default: false
},
},
data() {
return {
@ -99,7 +113,6 @@
}
},
mounted() {
},
watch: {
placeholder() {
@ -149,8 +162,7 @@
// })
let that = this;
// if(index==-1){
// that.scanMsg =that.scanMsg + "\n";
// }
// that.sc
if (that.scanMsg.includes('\n')) {
// that.scanMsg = 'HPQ;V1.0;ICE115F11161AG;PP20230427000027;B20230427002;Q50';
setTimeout(() => {
@ -170,6 +182,7 @@
if (that.isShowHistory) {
that.scanList.unshift(content);
}
getLabelInfo(content, this.headerType, callback => {
// uni.hideLoading();
let scanResult = callback;
@ -187,7 +200,7 @@
}
})
}
});
},this.locationCode,this.isHavePackNumber);
}, 200);
}
},

3
src/mycomponents/scan/winComScanBalance.vue

@ -131,7 +131,8 @@
}
this.getItemCodeType(result.package.itemCode, callBack => {
if(this.isCheckLocationBalance){
this.getToLocationBalance(this.resultData)
// this.getToLocationBalance(this.resultData)
this.queryBalance(this.resultData);
}else {
this.queryBalance(this.resultData)
}

4
src/mycomponents/scan/winComScanFg.vue

@ -58,9 +58,7 @@
import {
getMesPackInfo
} from '@/api/request2.js';
import {
Exception
} from 'sass';
export default {
name: "winComScan",

8
src/mycomponents/scan/winScanLocation.vue

@ -38,7 +38,7 @@
components: {
winComScan,
},
emits: ["getLocation"],
emits: ["getLocation","clearFromLocation"],
props: {
title: {
type: String,
@ -88,7 +88,6 @@
this.$refs.scan.clearScanValue();
},
getScanResult(result) {
uni.showLoading({
title: '扫描中...',
mask: true
@ -101,10 +100,9 @@
}
if(this.code==undefined){
uni.hideLoading();
this.showErrorMessage("扫描库位[" + this.code + "]为空,请输入正确的库位")
this.showErrorMessage("扫描库位为空,请输入正确的库位")
return
}
getBasicLocationByCode(this.code).then(res => {
uni.hideLoading();
@ -112,6 +110,7 @@
let result = res.data.list[0];
if(result.code!=this.code){
this.showErrorMessage('未查询到库位[' + this.code + ']')
this.$emit('clearFromLocation',this.code)
return;
}
var type = result.type;
@ -131,6 +130,7 @@
}
} else {
this.showErrorMessage('未查询到库位[' + this.code + ']')
this.$emit('clearFromLocation',this.code)
}
}).catch(error => {

10
src/mycomponents/scan/winScanPack.vue

@ -15,7 +15,7 @@
<view class="">
<view class="">
<win-com-scan ref="comscan" :placeholder="title" @getResult="getScanResult" :headerType="headerType"
:isShowHistory="isShowHistory" :clearResult="true"></win-com-scan>
:isShowHistory="isShowHistory" :clearResult="true" :locationCode='locationCode' :isHavePackNumber='isHavePackNumber'></win-com-scan>
</view>
</view>
</view>
@ -48,11 +48,13 @@
headerType:{
type: String,
default: 'HPQ'
}
},
},
data() {
return {
show: false,
locationCode:'',
isHavePackNumber:false,//
}
},
created() {
@ -69,8 +71,10 @@
})
},
openScanPopup() {
openScanPopup(locationCode1,isHavePackNumber) {
this.$refs.popup.open('bottom')
this.locationCode = locationCode1
this.isHavePackNumber = isHavePackNumber
setTimeout(res => {
this.getfocus()
}, 500)

51
src/mycomponents/scan/winScanPackAndLocation.vue

@ -27,7 +27,7 @@
placeholder-style="font-size:12px" style="padding: 5px;" @confirm="scanLocation" /> -->
<view v-if='allowModifyLocation'>
<uni-combox :candidates="fromLocationList" v-model="fromLocationCode" placeholder="请扫描来源库位"
<uni-combox :candidates="fromLocationList" v-model="fromLocationCode" placeholder="请扫描来源库位" disabled
@confirm="handleConfirm" style='height: 30rpx;border:1px solid #fff ;'></uni-combox>
</view>
<view v-else>
@ -125,6 +125,11 @@
type: String,
default: ""
},
//
isJustReplay: {
type: Boolean,
default: false
},
},
data() {
return {
@ -144,7 +149,8 @@
managementPrecision: '',
fromInventoryStatuses: "",
isCheck: false,
chooseWhich: '1'
chooseWhich: '1',
fromWarehouseCode:""
}
},
created() {
@ -236,6 +242,9 @@
scanLocation(scanResult) {
if(scanResult.fromLocationCode){
this.fromLocationCode = scanResult.fromLocationCode
}
var isCheck = false;
if (this.fromLocationCode == '') {
this.showErrorMessage('来源库位不能为空', callback => {
@ -269,8 +278,15 @@
if (available == "TRUE") {
if (checkDirectoryItemExist(this.fromLocationAreaTypeList, type)) {
this.location = result;
this.fromWarehouseCode=result.warehouseCode
// this.packGetFocus();
this.checkPackage(scanResult);
//
if(this.isJustReplay){
this.$emit("getResult",scanResult);
uni.hideLoading()
}else{
this.checkPackage(scanResult);
}
} else {
uni.hideLoading();
var hint = getListLocationAreaTypeDesc(this.fromLocationAreaTypeList);
@ -297,7 +313,7 @@
})
},
getScanResult(result) {
getScanResult(result,businessType) {
// console.log("", result)
// if (this.fromLocationCode == '' || this.fromLocationCode == null) {
// this.showMessage('', callback => {
@ -305,6 +321,15 @@
// })
// return;
// } else
//
if(businessType){
this.businessType = businessType;
this.fromInventoryStatuses = getDirectoryItemArray(this.businessType.outInventoryStatuses)
this.inventoryStatus = getDirectoryItemArray(this.businessType.outInventoryStatuses); //
this.fromLocationAreaTypeList = getDirectoryItemArray(this.businessType.outAreaTypes); //
}
this.scanLocation(result);
// debugger
// if(this.isCheck){
@ -334,6 +359,10 @@
})
}
this.chooseWhich = '2'
if(!result.label.itemCode){
this.showErrorMessage('扫描标签不对,请重新扫描')
return
}
if (res.data && res.data.list && res.data.list.length > 1) {
this.showBalanceSelect(res.data.list);
} else {
@ -389,6 +418,7 @@
mustHavaBalance(datas) {
if (datas.length == 0) {
this.showErrorMessage(this.getQueryCondition() + '\n未查找到库存记录', res => {
this.$emit('clearItemCode',this.scanResult)
this.packGetFocus();
})
} else if (datas.length == 1) {
@ -442,11 +472,17 @@
let data = {
label: this.scanResult.label,
package: this.scanResult.package,
fromWarehouseCode:this.fromWarehouseCode,
balance: datas,
fromLocationCode: this.fromLocationCode,
}
// this.packGetFocus();
this.$emit("getResult", data);
//
if (this.managementPrecision == 'BY_BATCH'||this.managementPrecision == 'BY_QUANTITY') {
this.$emit("getResult", data, this.managementPrecision);
} else {
this.$emit("getResult", data);
}
this.$emit("getCountScanResult", data);
},
@ -458,12 +494,13 @@
let data = {
label: this.scanResult.label,
package: this.scanResult.package,
fromWarehouseCode:this.fromWarehouseCode,
balance: item,
fromLocationCode: this.fromLocationCode,
}
this.packGetFocus();
//
if (this.managementPrecision == 'BY_BATCH') {
//
if (this.managementPrecision == 'BY_BATCH'||this.managementPrecision == 'BY_QUANTITY') {
this.$emit("getResult", data, this.managementPrecision);
} else {
this.$emit("getResult", data);

137
src/pages.json

@ -254,6 +254,62 @@
}
}
},
{
"path": "pages/purchaseReceipt/job/purchaseReceiptTool",
"style": {
"navigationBarTitleText": "协定品收货",
"enablePullDownRefresh": true,
"titleNView": {
// "autoBackButton": "true",
"buttons": [
//
{
"float": "right",
"fontSize": "58rpx", //
"text": "\ue696",
"fontSrc": "/static/ali_icon/iconfont.ttf"
},
{
"float": "right",
"fontSize": "52rpx", //
"text": "\ue6e2",
"fontSrc": "/static/ali_icon/iconfont.ttf"
}
]
}
}
},
{
"path": "pages/purchaseReceipt/job/purchaseReceiptDevelop",
"style": {
"navigationBarTitleText": "号试品收货",
"enablePullDownRefresh": true,
"titleNView": {
// "autoBackButton": "true",
"buttons": [
//
{
"float": "right",
"fontSize": "58rpx", //
"text": "\ue696",
"fontSrc": "/static/ali_icon/iconfont.ttf"
},
{
"float": "right",
"fontSize": "52rpx", //
"text": "\ue6e2",
"fontSrc": "/static/ali_icon/iconfont.ttf"
}
]
}
}
},
{
"path": "pages/purchaseReceipt/job/purchaseReject",
"style": {
@ -636,6 +692,13 @@
"enablePullDownRefresh": false
}
},
{
"path": "pages/issue/job/issueDetailBatch",
"style": {
"navigationBarTitleText": "发料任务详情",
"enablePullDownRefresh": false
}
},
{
"path": "pages/issue/job/issueJob0816",
"style": {
@ -709,6 +772,35 @@
}
}
},
{
"path": "pages/issue/record/directIssueByBatch",
"style": {
"navigationBarTitleText": "直接发料",
"enablePullDownRefresh": false,
"titleNView": {
"autoBackButton": "true",
"buttons": [
//
{
"float": "right",
"fontSize": "58rpx", //
"text": "\ue696",
"fontSrc": "/static/ali_icon/iconfont.ttf"
},
{
"float": "right",
"fontSize": "52rpx", //
"text": "\ue6e2",
"fontSrc": "/static/ali_icon/iconfont.ttf"
}
]
}
}
},
{
"path": "pages/issue/record/directIssue0816",
"style": {
@ -1411,6 +1503,15 @@
"enablePullDownRefresh": false
}
},
{
"path": "pages/productReceipt/record/productReceiptRecordByBatch",
"style": {
"navigationBarTitleText": "制品收货记录",
"enablePullDownRefresh": false
}
},
{
"path": "pages/productPutaway/job/productPutawayJob",
"style": {
@ -1471,6 +1572,24 @@
}
},
{
"path": "pages/productPutaway/record/fgDirectPutawayByBatch",
"style": {
"navigationBarTitleText": "装配直接上架",
"enablePullDownRefresh": false
}
},
{
"path": "pages/productPutaway/record/semiDirectPutawayByBatch",
"style": {
"navigationBarTitleText": "预生产直接上架",
"enablePullDownRefresh": false
}
},
{
@ -2153,7 +2272,7 @@
{
"path": "pages/inventoryMove/record/okToHoldRecord",
"style": {
"navigationBarTitleText": "合格转隔离记录",
"navigationBarTitleText": "物料隔离记录",
"enablePullDownRefresh": false
}
},
@ -2514,6 +2633,13 @@
"enablePullDownRefresh": false
}
},
{
"path": "pages/unPlanned/record/receiptRecordByBatch",
"style": {
"navigationBarTitleText": "计划外入库记录",
"enablePullDownRefresh": false
}
},
{
"path": "pages/unPlanned/record/issueRecord",
"style": {
@ -2542,6 +2668,15 @@
"enablePullDownRefresh": false
}
},
{
"path": "pages/label/record/splitLabel",
"style": {
"navigationBarTitleText": "拆标签",
"enablePullDownRefresh": false
}
},
{
"path": "pages/package/record/mergePackageRecord",
"style": {

7
src/pages/count/job/countJob.vue

@ -20,7 +20,7 @@
<uni-load-more :status="loadingType" />
</view>
<win-scan-button @goScan='openScanPopup' v-if="jobList.length>0"></win-scan-button>
<win-scan-button @goScan='openScanPopup' v-if="manageModel!='BY_BATCH'&&jobList.length>0"></win-scan-button>
<winScanPackJob title="库位" ref="scanPopup" @getResult='getScanResult'>
</winScanPackJob>
<jobList ref="jobList" @selectItem="selectItem"></jobList>
@ -84,7 +84,8 @@
creationTime: "",
status: "1,2",
fromLocationCode: ""
}
},
manageModel:import.meta.env.VITE_MANAGE_MODEL
};
},
onLoad(option) {
@ -209,7 +210,7 @@
if (this.queryParams.creationTime) {
filterParams.push({
column: "create_time",
action: "betweeen",
action: "between",
value: this.queryParams.creationTime
})
}

2
src/pages/count/job/fuzzyCountJob.vue

@ -150,7 +150,7 @@
if (this.checkedToday) {
filters.push({
column: "create_time",
action: "betweeen",
action: "between",
value: this.todayTime
})
}

132
src/pages/customerReturn/job/returnDetail.vue

@ -16,15 +16,15 @@
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<comDetailCardBatch :dataContent="item" :settingParam="jobContent" :isShowLocation="false"
<!-- <comDetailCardBatch :dataContent="item" :settingParam="jobContent" :isShowLocation="false"
@remove="updateData" @updateData="updateData" @openDetail="openDetail"
:locationAreaTypeList="toLocationAreaTypeList" v-if="managementType=='BY_BATCH'">
</comDetailCardBatch>
</comDetailCardBatch> -->
<comLableDetailCard :dataContent="item" :settingParam="jobContent"
:isShowStatus="false"
:isShowLocation="false"
@remove="updateData" @updateData="updateData" @openDetail="openDetail"
:locationAreaTypeList="toLocationAreaTypeList" v-else>
:locationAreaTypeList="toLocationAreaTypeList" >
</comLableDetailCard >
</view>
</view>
@ -79,6 +79,10 @@
calcHandleQty,
getScanCount
} from '@/common/detail.js';
import {
calc
} from '@/common/calc'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
@ -246,7 +250,7 @@
},
openScanPopup() {
this.$refs.scanPopup.openScanPopup();
this.$refs.scanPopup.openScanPopup( this.fromLocationCode );
},
closeScanPopup() {
@ -254,13 +258,59 @@
},
getScanResult(result) {
console.log(result)
if(this.managementType == "BY_BATCH" || this.managementType == "BY_QUANTITY" ){
this.setDataBatch(result)
}else{
this.setData(result)
}
},
setDataBatch(result){
try {
var packingNumber = result.package.number;
var batch = result.label.batch;
var qty = result.label.qty;
var itemCode = result.label.itemCode;
var detail = this.detailSource.find(r => r.itemCode == itemCode);
if (detail == undefined) {
this.showErrorMessage("物料号【" + itemCode + "】不在列表中")
} else {
console.log(366,batch)
console.log(366,detail.subList)
var itemDetail = detail.subList.find(r => {
return r.batch == batch
})
if (itemDetail == undefined) {
this.showErrorMessage( "批次[" + batch + "]不在列表中")
} else {
if (itemDetail.scaned) {
// this.showErrorMessage("[" + packingNumber + "]" + "[" + batch + "]")
itemDetail.handleQty = calc.add(Number(result.label.qty),itemDetail.handleQty)
} else {
itemDetail.scaned = true;
itemDetail.handleQty = Number(result.label.qty)
itemDetail.packQty = Number(result.package.packQty)
itemDetail.packUnit = result.package.packUnit
itemDetail.balanceQty=result.label.qty
this.calcHandleQty();
}
}
}
} catch (e) {
this.showMessage(e.message)
}
},
setData(result){
try {
var packingNumber = result.package.number;
var batch = result.label.batch;
var qty = result.label.qty;
var itemCode = result.label.itemCode;
var detail = this.detailSource.find(r => r.itemCode == itemCode);
if (detail == undefined) {
this.showErrorMessage("物料号【" + itemCode + "】不在列表中")
} else {
@ -279,7 +329,7 @@
itemDetail.packQty = Number(result.package.packQty)
itemDetail.packUnit = result.package.packUnit
this.calcHandleQty();
}
}
}
@ -287,7 +337,6 @@
this.showMessage(e.message)
}
},
scanLocationCode(location, code) {
this.toLocationCode = code
this.detailSource.forEach(item => {
@ -310,12 +359,20 @@
// //
if (this.scanCount == this.subList.length) {
this.checkCount();
if(this.managementType == "BY_BATCH" || this.managementType == "BY_QUANTITY" ){
this.checkCountBatch()
}else{
this.checkCount();
}
} else if (this.scanCount < this.subList.length) {
//
if (this.jobContent.allowPartialComplete == "TRUE") {
//
this.checkCount();
if(this.managementType == "BY_BATCH" || this.managementType == "BY_QUANTITY" ){
this.checkCountBatch()
}else{
this.checkCount();
}
} else {
//
this.$refs.comMessage.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => {
@ -354,7 +411,61 @@
this.submitJob()
}
},
checkCountBatch(){
//
let str = ''
let str1 = ''
let str2 = ''
let str3 = ''
this.detailSource.forEach((item) => {
item.subList.forEach(cur => {
if (cur.qty != cur.handleQty) {
var tempHandleQty =0
if(cur.handleQty){
tempHandleQty=cur.handleQty
}else {
tempHandleQty =0
}
str += `批次【${cur.batch}】提交数量【${tempHandleQty}】与任务物料数量【${cur.qty}】不一致`
}
if(cur.handleQty > cur.qty){
str1 = `批次【${cur.batch}】提交数量【${ cur.handleQty}】不可以大于推荐数量【${cur.qty}`
}
if(cur.handleQty < cur.qty){
str2 = `批次【${cur.batch}】提交数量【${ cur.handleQty}】不可以小于推荐数量【${cur.qty}`
}
if(parseFloat(cur.handleQty)>parseFloat(cur.balanceQty)){
str3 += `物料号【${item.itemCode}】批次【${cur.batch}】实际提交数量【${cur.handleQty}】不可以大于库存数量【${cur.qty}\n`
}
})
})
// this.jobContent.allowBiggerQty = 'FALSE'
if(this.jobContent.allowBiggerQty == 'FALSE' &&str1){
this.$refs.comMessage.showConfirmWarningModal(str1)
return
}
if(this.jobContent.allowSmallerQty == 'FALSE' && str2){
this.$refs.comMessage.showConfirmWarningModal(str2)
return
}
if(str3){
this.$refs.comMessage.showErrorMessage(str3);
return;
}
if (str) {
str = '任务明细未全部完成,是否提交?\n'+str
this.$refs.comMessage.showQuestionMessage1(str, 'red', res => {
if (res) {
this.submitJob()
}
});
} else {
this.submitJob()
}
},
submitJob() {
uni.showLoading({
title: "提交中....",
@ -370,6 +481,7 @@
this.managementList = res.list;
var params = this.setParams()
console.log("提交参数", JSON.stringify(params));
return;
customerReturnJobSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {

2
src/pages/customerReturn/job/returnJob.vue

@ -133,7 +133,7 @@
if (this.checkedToday) {
filters.push({
column: "create_time",
action: "betweeen",
action: "between",
value: this.todayTime
})
}

2
src/pages/customerReturn/record/recordList.vue

@ -147,7 +147,7 @@
if (this.queryParams.creationTime) {
filterParams.push({
column: "create_time",
action: "betweeen",
action: "between",
value: this.queryParams.creationTime
})
}

63
src/pages/customerReturn/record/returnRecord.vue

@ -70,6 +70,10 @@
createDetailInfo,
calcHandleQty
} from '@/common/record.js';
import {
calc
} from '@/common/calc.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
@ -109,7 +113,8 @@
toLocationAreaTypeList: [],
managementList: [],
toWarehouseCode: '',
toInventoryStatuses:""
toInventoryStatuses:"",
managementType:""
};
},
onLoad(option) {
@ -145,7 +150,18 @@
},
methods: {
getScanResult(result) {
getScanResult(result,managementTypeParams) {
this.managementType = managementTypeParams
console.log(managementTypeParams)
if (managementTypeParams == "BY_BATCH" || managementTypeParams == "BY_QUANTITY") {
this.setDataBatch(result)
} else {
this.setData(result)
}
},
setData(result){
let balance = result.balance;
let label = result.label;
let pack = result.package;
@ -180,7 +196,40 @@
}
}
this.calcHandleQty();
},
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); //
newDetail.packingNumber =pack.number
newDetail.handleQty =result.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);
item.subList.push(newDetail);
} else {
detail.handleQty =calc.add(detail.handleQty, result.label.qty)
}
}
this.calcHandleQty();
},
showErrorMessage(message) {
@ -266,7 +315,13 @@
if (res.success) {
this.managementList = res.list;
var params = this.setParams()
console.log("提交" + JSON.stringify(params))
console.log("提交" ,params)
let obj = params.subList.find(item=>item.balanceQty < item.handleQty)
if(obj){
this.$refs.comMessage.showConfirmWarningModal('批次[' +obj.batch + ']数量[' + obj.handleQty + ']不允许大于库存数量[' +obj.balanceQty + ']')
uni.hideLoading()
return
}
customerReturnRecordSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {

125
src/pages/deliver/coms/comDeliverDetailCardBatch.vue

@ -1,23 +1,32 @@
<template>
<view>
<!-- <requiredLocation title="需求库位" :locationCode="dataContent.toLocationCode"
:isShowEdit="dataContent.allowModifyLocation==1"></requiredLocation> -->
<view v-for="(item,index) in dataContent.subList">
<uni-swipe-action ref="swipeAction" :class="item.scaned? 'scan_view':''">
<uni-swipe-action-item
:right-options="(item.scaned&&isEdit)?editAndRemoveOptions : item.scaned? removeOptions:options"
@click="swipeClick($event,item,index)" style='padding:0px 0px 5px 0px;align-items: center;'>
<item-qty :dataContent="item" :handleQty="item.handleQty" :isShowBalanceQty="false"></item-qty>
<location :locationCode="item.fromLocationCode"></location>
<recommendBalanceBatch style='margin-left: 20px;' :detail="item" :isShowLocation="false"
:isShowPack="item.packingNumber"></recommendBalanceBatch>
</uni-swipe-action-item>
</uni-swipe-action>
<view>
<uni-collapse ref="collapse">
<uni-collapse-item :open="true" :class="dataContent.scaned?'scan_view':''">
<template v-slot:title>
<view class="split_line"></view>
<!-- 物品 -->
<item-qty :dataContent="dataContent" :handleQty="dataContent.handleQty" :isShowBalanceQty='false'></item-qty>
</template>
<uni-swipe-action ref="swipeAction" style="margin-top: 10px;"
v-for="(item,index) in dataContent.subList">
<uni-swipe-action-item
:right-options="(item.scaned&&isEdit)?editAndRemoveOptions : item.scaned? removeOptions:detailOptions" @click="itemCoceClick($event,item,index)">
<view class="" :class="item.scaned?'scan_view':''">
<recommend :detail="item" :isShowLocation="false" :isShowFromLocation="true" :isShowToLocation="settingParam.allowModifyLocation=='TRUE'"></recommend>
</view>
</uni-swipe-action-item>
</uni-swipe-action>
</uni-collapse-item>
</uni-collapse>
</view>
</view>
<qtyEdit ref="balanceQtyEdit" @confirm="confirm" :isShowStatus="true"></qtyEdit>
<!-- <balance-qty-edit ref="balanceQtyEdit" @confirm="confirm" :isShowStatus="true"></balance-qty-edit> -->
<recommend-qty-edit ref="receiptEdit" :dataContent="editItem" :settingParam="settingParam" @confirm="confirm">
</recommend-qty-edit>
<detail-info-popup ref="detailInfoPopup"></detail-info-popup>
<comMessage ref="message"></comMessage>
</template>
@ -25,39 +34,42 @@
<script>
import itemQty from '@/mycomponents/item/itemQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import recommendBalanceBatch from '@/mycomponents/balance/recommendBalanceBatch.vue'
import recommendBalance from '@/mycomponents/balance/recommendBalance.vue'
import handleBalance from '@/mycomponents/balance/handleBalance.vue'
import recommendQtyEdit from '@/mycomponents/qty/recommendQtyEdit.vue'
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import qtyEdit from '@/mycomponents/qty/qtyEdit.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import location from '@/mycomponents/balance/location.vue'
import detailInfoPopup from '@/pages/productionReceipt/coms/detailInfoPopup.vue'
import {
import comIssueRequestInfo from '@/pages/issue/coms/comIssueRequestInfo.vue'
import batch from '@/mycomponents/balance/batch.vue'
import qtyEdit from '@/mycomponents/qty/qtyEdit.vue'
import {
getDetailOption,
getPurchaseReceiptOption,
getRemoveOption,
getEditRemoveOption
getEditRemoveOption,
getRemoveOption
} from '@/common/array.js';
export default {
emits: ['updateData'],
emits: ['updateData', "removeItemCode"],
components: {
itemQty,
recommend,
recommendBalanceBatch,
recommendBalance,
handleBalance,
recommendQtyEdit,
requiredLocation,
qtyEdit,
balanceQtyEdit,
location,
detailInfoPopup
detailInfoPopup,
comIssueRequestInfo,
batch,
},
props: {
dataContent: {
type: Object,
default: {}
type: Array,
default: []
},
settingParam: {
type: Object,
@ -79,59 +91,82 @@ import {
editItem: {},
batchItem: {},
detailOptions: [],
scanOptions: []
scanOptions: [],
removeOptions: [],
editAndRemoveOptions:[]
}
},
mounted() {
this.removeOptions = getRemoveOption();
this.detailOptions = getDetailOption();
this.scanOptions = getEditRemoveOption();
this.removeOptions = getRemoveOption()
this.editAndRemoveOptions = getEditRemoveOption()
console.log(888,this.dataContent)
},
methods: {
resizeCollapse() {
this.$nextTick(r => {
this.$refs.collapse.forEach(r => {
r.childrens.forEach(i => {
this.$refs.collapse.resize()
this.$refs.collapse.childrens.forEach(i => {
i.init();
})
r.resize();
})
});
},
swipeClick(e, batch,
record,recordIndex,
batchIndex,
Batchs,
locatonIndex,
Locations) {
if (e.content.text == "编辑") {
this.edit(batch, record)
} else if (e.content.text == "移除") {
this.remove(batch, record, recordIndex,batchIndex,Batchs,locatonIndex,Locations)
}
},
swipeClick(e, item, index) {
itemCoceClick(e, item, index) {
if (e.content.text == "编辑") {
this.edit(item)
} else if (e.content.text == "移除") {
this.remove(item, index)
// this.dataContent.subList.splice(index, 1);
item.scaned = false
item.handleQty=0
this.$emit('updateData')
}
},
edit(item) {
let that = this;
that.editItem = item;
that.$refs.balanceQtyEdit.openEditPopup(item);
this.editItem = item;
this.$refs.receiptEdit.openTaskEditPopup(item.qty, item.handleQty, item.labelQty);
},
detail(item) {
this.showItem = item;
this.$refs.receiptHint.openScanPopup()
},
remove(item, index) {
remove(batch, record, recordIndex,batchIndex,Batchs,locatonIndex,Locations) {
this.$refs.message.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
item.handleQty = 0;
item.scaned = false ;
batch.Records.splice(recordIndex, 1);
if(batch.Records.length==0&&Batchs[batchIndex].isNewAdd){
Batchs.splice(batchIndex,1)
}
if(batch.Records.length==0&&Locations[locatonIndex].isNewAdd){
Locations.splice(locatonIndex,1)
}
this.resizeCollapse();
this.$emit('updateData', record)
}
});
},
confirm(val) {
console.log(44,this.editItem)
this.editItem.handleQty = Number(val);
this.$emit('updateData', this.editItem)
this.editItem.handleQty = Number(val);
this.$emit('updateData', this.editItem)
}
}
}

760
src/pages/deliver/coms/comScanDeliverPackBatch.vue

@ -3,18 +3,19 @@
<uni-popup ref="popup" :maskClick='false'>
<view class="">
<view class="popup_box">
<view class="pop_title uni-flex space-between">
<view class="" style="font-size: 35rpx;">
扫描箱码
扫描箱码
</view>
<view class="">
<image class="fr icons_scan_close" src="/static/icons/icons_scan_close.svg"
@click="closeScanPopup()"></image>
</view>
</view>
<!-- <view class="uni-flex uni-row" style="align-items: center;
<!-- <view class="uni-flex uni-row" style="align-items: center;
background-color: #fff;
margin-left: 20rpx;
margin-right: 20rpx;
@ -32,28 +33,29 @@
@confirm="confirmSelect"></u-select>
</view>
</view>
</view>
<u-line class='line_color'></u-line> -->
</view> -->
<!-- <u-line class='line_color'></u-line> -->
<view class="uni-flex uni-row" style="align-items: center;
<!-- <view class="uni-flex uni-row" style="align-items: center;
background-color: #fff;
margin-left: 20rpx;
margin-right: 20rpx;
margin-top: 8rpx;
border-radius: 8rpx;">
<view class="uni-center" style="width: 25%; ">
<view class="uni-center" style="width: 25%; font-size: 35rpx; ">
来源库位
</view>
<view class="" style="width: 75%; padding: 8rpx;">
<uni-combox :candidates="fromLocationList" v-model="fromLocationCode" placeholder="请选择库位"
@confirm="fromLocationUpdate"></uni-combox>
<uni-combox class="my-combox" :candidates="fromLocationList" v-model="fromLocationCode"
placeholder="请选择库位" @confirm="fromLocationUpdate"
:inputStyle="inputStyleObject"></uni-combox>
</view>
</view>
</view> -->
<view class="">
<view class="">
<win-com-scan ref="comscan" placeholder="箱标签" @getResult="onScan" :clearResult="true"
:headerType="headerType" :isShowHistory="false">
headerType="HPQ,HMQ" :isShowHistory="false" :locationCode='locationCode'>
</win-com-scan>
<view style="width: 100%;">
@ -76,7 +78,7 @@
<uni-swipe-action-item @click="swipeClick($event,record,index)"
:right-options="scanOptions">
<view style="padding: 0px 10px">
<balance :dataContent="record" :isShowLocation="false"
<balance :dataContent="record" :isShowFromLocation="false"
:isShowStdPack="false"></balance>
</view>
</uni-swipe-action-item>
@ -95,6 +97,10 @@
<balance-select ref="balanceSelect" @onSelectItem='selectBalanceItem'></balance-select>
<comMessage ref="comMessage"></comMessage>
<balance-qty-edit ref="balanceQtyEdit" @confirm="confirm" :isShowStatus="true"></balance-qty-edit>
<!-- 模拟扫描功能 -->
<!-- <win-com-scan v-show="false" ref="comscansimulate" placeholder="箱标签" @getResult="onScan" :clearResult="true"
headerType="HPQ,HMQ" :isShowHistory="false">
</win-com-scan> -->
</view>
</template>
@ -108,24 +114,33 @@
getDetailOption,
getDetailEditRemoveOption
} from '@/common/array.js';
import {
getWorkShopLineStation,
getBalanceByFilter,
getBalanceByParams,
} from '@/api/request2.js';
import {
uniqueArray
} from '@/common/basic.js';
import {
getDirectoryItemArray,
} from '@/common/directory.js';
getLabelInfo
} from '@/common/label.js';
import {
calc
} from '@/common/calc.js';
import {
getWorkShopLineStation
} from '@/api/request2.js';
import {
getBalanceByManagementPrecision
} from '@/common/balance.js';
import {
getDirectoryItemArray
} from '../../../common/directory.js';
export default {
name: 'winScanPack',
emits: ["afterScan", "closeScan"],
components: {
winComScan,
balance,
@ -137,12 +152,10 @@
type: String,
default: ''
},
headerType: {
locationCode:{
type: String,
default: "HPQ,HMQ"
},
default: ''
}
},
data() {
return {
@ -163,9 +176,14 @@
positionInfo: "请选择位置",
positionList: [],
defaultValueList: [],
fromInventoryStatuses: "",
packageInfo: {},
label: {},
fromInventoryStatuses: [],
packageInfo: {}
inputStyleObject: {
fontSize: "100rpx"
},
bussinessCode: 'Issue',
toLocationAreaTypeList: []
}
},
created() {
@ -177,13 +195,29 @@
this.scanOptions = getDetailEditRemoveOption();
},
methods: {
openScanPopupForJobSimulate(content, jobcontent, scanMessage) {
this.issueRecord = [];
this.dataContent = content;
this.jobContent = jobcontent;
this.initData();
getLabelInfo(scanMessage, "HPQ,HMQ", callback => {
if (callback.success) {
this.onScan(callback);
} else {
this.showErrorMessage(callback.message, res => {})
}
})
},
openScanPopup(content, jobcontent) {
this.issueRecord = [];
this.dataContent = content;
this.jobContent = jobcontent;
this.initData();
this.positionInfo = this.jobContent.workShopCode + "-" + this.jobContent.subList[0].productionLineCode +
"-" + this.jobContent.subList[0].workStationCode
// this.positionInfo = this.jobContent.workShopCode + "-" + this.jobContent.subList[0].productionLineCode +
// "-" + this.jobContent.subList[0].workStationCode
this.$refs.popup.open('bottom')
setTimeout(res => {
this.getfocus();
@ -202,57 +236,58 @@
let that = this;
that.fromLocationList = [];
if (that.dataContent != null) {
that.fromInventoryStatuses = getDirectoryItemArray(this.jobContent.outInventoryStatuses)
that.toLocation =that.dataContent.subList;
that.toLocationCode = that.dataContent.subList[0].toLocationCode;
that.fromLocationList = that.getFromLocationList();
that.fromInventoryStatuses = this.jobContent.outInventoryStatuses
that.toLocation = that.dataContent[0];
that.toLocationCode = that.dataContent[0].toLocationCode;
that.toLocationAreaTypeList = getDirectoryItemArray(this.jobContent.toAreaTypes)
// that.fromLocationList = that.getFromLocationList();
}
},
showBalanceSelect(items, packageInfo) {
this.packageInfo = packageInfo;
showBalanceSelect(items) {
this.$refs.balanceSelect.openPopup(items);
},
getFromLocationList() {
let list = [];
let location = this.dataContent.subList.find(r => r.toLocationCode == this.toLocationCode);
if (location != undefined) {
this.dataContent.subList.forEach(item => {
list.push(item.fromLocationCode)
})
this.fromLocationCode = list[0];
return list;
} else {
this.$refs.comMessage.showErrorMessages('需求库位【' + this.toLocationCode + '】不存在', res => {
this.toLocationCode = '';
});
}
},
// getFromLocationList() {
// let list = [];
// this.dataContent.forEach(location => {
// location.Items.forEach(item => {
// item.Locations.forEach(f => {
// let item = list.find(l => l == f.fromLocationCode);
// if (item == undefined) {
// list.push(f.fromLocationCode)
// }
// })
// })
// });
// //
// list = uniqueArray(list);
// this.fromLocationCode = list[0];
// return list;
// },
fromLocationUpdate(fromlocation) {
let location = this.fromLocationList.find(r => r == fromlocation)
// --
// if (location == undefined) {
this.fromLocationCode = fromlocation
// this.showErrorMessage('' + fromlocation + '')
// }
if (location == undefined) {
this.fromLocationCode = ''
this.showErrorMessage('发货库位【' + fromlocation + '】不存在')
}
},
onScan(result) {
queryBalance(result) {
try {
let that = this;
if (that.fromLocationCode == '') {
that.showErrorMessage('请选择来源库位', res => {
that.$refs.toLocationCombox.onFocus();
});
return;
}
// if (that.fromLocationCode == '') {
// that.showErrorMessage('', res => {
// that.$refs.toLocationCombox.onFocus();
// });
// return;
// }
let packageInfo = result.package;
let itemCode = result.label.itemCode;
let packingCode = result.label.packingNumber;
let lot = result.label.batch;
let item = that.toLocation.find(r => r.itemCode == itemCode);
let item = that.toLocation.Items.find(r => r.itemCode == itemCode);
if (item == undefined) {
that.showErrorMessage('未查找到物料【' + itemCode + '】的发货明细',
res => {
@ -261,90 +296,268 @@
)
return;
} else {
//
var params = {
itemCode: result.package.itemCode,
batch: result.label.batch,
packingNumber: result.label.packingNumber,
parentPackingNumber: result.package.parentNumber,
inventoryStatus: this.jobContent.outInventoryStatuses.split(','),
areaType: this.jobContent.fromAreaTypes.split(','),
bussinessCode: this.jobContent.businessType
}
uni.showLoading({
title: '加载中',
title: '查询中',
mask: true
})
getBalanceByManagementPrecision(result.label, that.fromLocationCode, that.fromInventoryStatuses,
balanceRes => {
if (balanceRes.success) {
if (balanceRes.data.list.length == 0) {
this.showErrorMessage('在来源库位[' + this.fromLocationCode + '],未查找到该包装的库存记录',
res => {
this.packGetFocus();
})
} else if (balanceRes.data.list.length == 1) {
let balance = balanceRes.data.list[0];
this.afterGetBalance(result.label, balance, packageInfo);
} else {
this.label = result.label;
this.showBalanceSelect(balanceRes.data.list, packageInfo);
}
getBalanceByParams(params).then(res => {
if (res.data.length == 0) {
var status = getInventoryStatusDesc(params.inventoryStatus)
var areaType = getListLocationAreaTypeDesc(params.areaType)
var hint =
"按物料号 [" + params.itemCode + "] \n" +
"包装号 [" + params.packingNumber + "] \n" +
"批次 [" + params.batch + "] \n" +
"状态 [" + status + "] \n" +
"库区 [" + areaType + "] \n" +
"未查找到库存余额"
this.showErrorMessage(hint,
res => {
that.getfocus();
})
} else if (res.data.length == 1) {
result.balance = res.data[0]
if (result.label.packingNumber != result.balance.packingNumber) {
result.balance.qty = Number(result.label.qty)
} else {
this.showErrorMessage(balanceRes.message.message);
result.balance.qty = Number(result.balance.qty)
}
uni.hideLoading();
});
this.afterGetBalance(result.label, result.balance, result.package);
} else {
//
this.$refs.balanceSelect.openPopup(res.data);
}
uni.hideLoading()
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error,
res => {
that.getfocus();
})
})
}
} catch (e) {
this.showErrorMessage(e.stack)
this.showErrorMessage(e.stack, res => {
that.getfocus();
})
uni.hideLoading();
}
},
getBalance(label, packageInfo, callback) {
var filters = []
if (packageInfo.parentNumber) {
var packingNumber = packageInfo.parentNumber + "," + label.packingNumber;
filters.push({
column: "packingNumber",
action: "in",
value: packingNumber
})
} else {
filters.push({
column: "packingNumber",
action: "==",
value: label.packingNumber
})
}
filters.push({
column: "itemCode",
action: "==",
value: label.itemCode
})
filters.push({
column: "batch",
action: "==",
value: label.batch
})
if (this.fromInventoryStatuses != null && this.fromInventoryStatuses != "") {
filters.push({
column: "inventoryStatus",
action: "in",
value: this.fromInventoryStatuses
})
}
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getBalanceByFilter(params).then(res => {
callback(res.data)
}).catch(err => {
this.showErrorMessage(err.message);
})
},
onScan(result) {
if (!result.package) {
this.showErrorMessage('扫描数据错误[' + result.label.code + "]",
res => {
this.getfocus();
}
)
return;
}
if (this.toLocation) {
let item = this.toLocation.Items.find(r => r.itemCode == result.package.itemCode);
if (!item) {
this.showErrorMessage('扫描物料代码不属于该任务');
return
}
this.getToLocationBalance(result)
}
},
//
getToLocationBalance(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,
}
getBalanceByFilter(params).then(res => {
uni.hideLoading()
if (res.data.list.length > 0) {
this.showErrorMessage("包装在库位【" + res.data.list[0].locationCode + "】已有库存余额");
} else {
this.queryBalance(result);
}
// callback(res.data)
}).catch(err => {
uni.hideLoading()
this.showErrorMessage(err.message);
})
},
selectBalanceItem(balance) {
this.afterGetBalance(balance, balance, this.packageInfo);
},
afterGetBalance(label, balance, packageInfo) {
let that = this;
try {
let itemCode = label.itemCode;
let packingCode = label.packingNumber;
let lot = label.batch;
let item = that.toLocation.find(r => r.itemCode == itemCode);
item.scaned =true
let fromLocation = that.toLocation.find(l => l.fromLocationCode == that.fromLocationCode);
// --
if(!fromLocation){
fromLocation = {
Batchs:[{
Recommends:[],
Records: [],
batch: label.batch,
detail:{
...packageInfo,
fromLocationCode: balance.locationCode,
toLocationCode:this.toLocationCode
},
handleQty: 0,
packingNumber: null,
// packingNumber: label.packingNumber,
qty: label.qty,
uom: label.uom
}],
toLocationCode:this.toLocationCode,
fromLocationCode: balance.locationCode,
handleQty: 0,
qty: label.qty,
uom: label.uom
}
item.Locations.push(fromLocation)
}
if (fromLocation != undefined) {
console.log(34444)
let batch = fromLocation.batch;
let item = that.toLocation.Items.find(r => r.itemCode == itemCode);
that.fromLocationCode = balance.locationCode;
let fromLocation = item.Locations.find(l => l.fromLocationCode == that.fromLocationCode);
//
if (fromLocation){
//
// if(fromLocation.isNewAdd){
// }else {
// //
// }
let batch = fromLocation.Batchs.find(r => r.batch == lot);
if (batch != undefined) {
that.addRecord(item.batch, label, balance, packageInfo)
if (batch.Records == undefined) {
batch.Records = [];
}
let record = batch.Records.find(r => r.packingNumber == packingCode);
if (record == undefined) {
//
if (batch.Recommends != undefined && batch.Recommends.length > 0) {
let recommend = batch.Recommends.find(r => r.packingNumber == packingCode);
if (recommend != undefined) {
that.addRecord(batch, label, balance, packageInfo)
} else {
//
if (this.jobContent.allowModifyPackingNumber == 'TRUE') {
that.addRecord(batch, label, balance, packageInfo);
} else {
that.showErrorMessage('未查找到该箱码【' + packingCode + '】的明细',
res => {
that.getfocus();
return;
}
)
}
}
} else {
that.addRecord(batch, label, balance, packageInfo)
}
} else {
// that.showErrorMessage('' + packingCode + ',',
// res => {
// that.getfocus();
// }
// )
that.addRecord(batch, label, balance, packageInfo)
}
} else {
if (this.jobContent.allowModifyBatch == "TRUE") {
this.showQuestionMessage('在【' + that.fromLocationCode + '】库位下,未查找到批次【' + lot +
'】的发货明细,是否要继续发货?', res => {
if (res) {
let batch = that.createBatchInfo(label, balance,packageInfo);
let batch = that.createBatchInfo(label, balance, packageInfo);
//details
if (fromLocation.Batchs.length > 0) {
batch.detail = fromLocation.Batchs[0].detail;
}
fromLocation.Batchs.unshift(batch);
this.getfocus();
that.$emit("afterScan");
}
})
} else {
@ -354,13 +567,168 @@
});
}
}
} else {
that.showErrorMessage('未查找到推荐库位【' + that.fromLocationCode + '】的发货明细',
res => {
that.getfocus();
}
)
}else {
//
if (this.jobContent.allowModifyLocation == "TRUE") {
this.showQuestionMessage("扫描物料[" + itemCode + "]的库位【" + that.fromLocationCode +
"】与推荐的库位不一致,是否要继续发货?", res => {
if (res) {
let locaion = that.createLocationInfo(label, balance, packageInfo);
item.Locations.push(locaion);
this.getfocus();
that.$emit("afterScan");
}
})
} else {
this.showErrorMessage("扫描物料[" + itemCode + "]的库位【" + that.fromLocationCode +
"】与推荐的库位不一致,不允许继续发货?")
}
}
// if (fromLocation && !fromLocation.isNewAdd) {
// let batch = fromLocation.Batchs.find(r => r.batch == lot);
// if (batch != undefined) {
// if (batch.Records == undefined) {
// batch.Records = [];
// }
// let record = batch.Records.find(r => r.packingNumber == packingCode);
// if (record == undefined) {
// //
// if (batch.Recommends != undefined && batch.Recommends.length > 0) {
// let recommend = batch.Recommends.find(r => r.packingNumber == packingCode);
// if (recommend != undefined) {
// that.addRecord(batch, label, balance, packageInfo)
// } else {
// //
// if (this.jobContent.allowModifyPackingNumber == 'TRUE') {
// that.addRecord(batch, label, balance, packageInfo);
// } else {
// that.showErrorMessage('' + packingCode + '',
// res => {
// that.getfocus();
// return;
// }
// )
// }
// }
// } else {
// that.addRecord(batch, label, balance, packageInfo)
// }
// } else {
// that.showErrorMessage('' + packingCode + ',',
// res => {
// that.getfocus();
// }
// )
// }
// } else {
// if (this.jobContent.allowModifyBatch == "TRUE") {
// this.showQuestionMessage('' + that.fromLocationCode + ',' + lot +
// ',?', res => {
// if (res) {
// let batch = that.createBatchInfo(label, balance, packageInfo);
// //details
// if (fromLocation.Batchs.length > 0) {
// batch.detail = fromLocation.Batchs[0].detail;
// }
// fromLocation.Batchs.unshift(batch);
// this.getfocus();
// that.$emit("afterScan");
// }
// })
// } else {
// that.showErrorMessage('' + lot + '',
// res => {
// that.getfocus();
// });
// }
// }
// } else {
// if (fromLocation&&fromLocation.isNewAdd) {
// let batch = fromLocation.Batchs.find(r => r.batch == lot);
// if (batch != undefined) {
// if (batch.Records == undefined) {
// batch.Records = [];
// }
// let record = batch.Records.find(r => r.packingNumber == packingCode);
// if (record == undefined) {
// //
// if (batch.Recommends != undefined && batch.Recommends.length > 0) {
// let recommend = batch.Recommends.find(r => r.packingNumber == packingCode);
// if (recommend != undefined) {
// that.addRecord(batch, label, balance, packageInfo)
// } else {
// //
// if (this.jobContent.allowModifyPackingNumber == 'TRUE') {
// that.addRecord(batch, label, balance, packageInfo);
// } else {
// that.showErrorMessage('' + packingCode + '',
// res => {
// that.getfocus();
// return;
// }
// )
// }
// }
// } else {
// that.addRecord(batch, label, balance, packageInfo)
// }
// } else {
// that.showErrorMessage('' + packingCode + ',',
// res => {
// that.getfocus();
// }
// )
// }
// } else {
// if (this.jobContent.allowModifyBatch == "TRUE") {
// this.showQuestionMessage('' + that.fromLocationCode + ',' + lot +
// ',?', res => {
// if (res) {
// let batch = that.createBatchInfo(label, balance, packageInfo);
// //details
// if (fromLocation.Batchs.length > 0) {
// batch.detail = fromLocation.Batchs[0].detail;
// }
// fromLocation.Batchs.unshift(batch);
// this.getfocus();
// that.$emit("afterScan");
// }
// })
// } else {
// that.showErrorMessage('' + lot + '',
// res => {
// that.getfocus();
// });
// }
// }
// } else {
// if (this.jobContent.allowModifyLocation == "TRUE") {
// this.showQuestionMessage("[" + itemCode + "]" + that.fromLocationCode +
// ",?", res => {
// if (res) {
// let locaion = that.createLocationInfo(label, balance, packageInfo);
// item.Locations.push(locaion);
// this.getfocus();
// that.$emit("afterScan");
// }
// })
// } else {
// this.showErrorMessage("[" + itemCode + "]" + that.fromLocationCode +
// ",?")
// }
// }
// }
} catch (e) {
that.showErrorMessage(e.stack,
res => {
@ -370,27 +738,32 @@
}
},
//
createLocationInfo(label, balance, packageInfo) {
let location = {
fromLocationCode: balance.locationCode,
qty: balance.qty,
uom: balance.uom,
handleQty: 0,
isNewAdd: true,
Batchs: []
}
let batch = this.createBatchInfo(label, balance, packageInfo);
batch.detail = balance;
batch.detail.fromLocationCode = balance.locationCode;
location.Batchs.push(batch);
return location;
},
createBatchInfo(data, balance, packageInfo) {
let batch = {
batch: data.lot||data.batch,
isNewAdd: true,
batch: data.batch,
qty: 0,
uom: data.uom,
handleQty: Number(data.qty),
Records: [],
detail:{
fromLocationCode:this.fromLocationCode, //balance.locationCode
toLocationCode:this.toLocationCode,
itemCode:data.itemCode,
handleQty: Number(data.qty),
packingNumber:data.packingNumber,
qty: 0,
uom:data.uom,
itemName:packageInfo.itemName,
itemDesc1:packageInfo.itemDesc1,
itemDesc2:packageInfo.itemDesc2,
singlePrice:balance.singlePrice,
amount:balance.amount
}
handleQty: Number(balance.qty),
Records: []
}
let record = this.creatRecord(data, balance, packageInfo);
batch.Records.push(record);
@ -405,33 +778,88 @@
scaned: true,
itemCode: label.itemCode,
packingNumber: label.packingNumber,
parentPackingNumber: packageInfo.parentNumber,
batch: label.batch,
qty: Number(label.qty) > Number(balance.qty) ? Number(balance.qty) : Number(label.qty),
// qty: Number(balance.qty),
// qty: Number(label.qty) > Number(balance.qty) ? Number(balance.qty) : Number(label.qty),
qty: Number(balance.qty),
handleQty: Number(balance.qty),
uom: balance.uom,
inventoryStatus: balance.inventoryStatus,
balance: balance,
toLocationCode: this.toLocationCode,
supplierCode: label.supplierCode,
packUnit: packageInfo.packUnit,
packQty: packageInfo.packQty,
singlePrice:balance.singlePrice,
amount:balance.amount
packQty: packageInfo.packQty
}
return record;
},
calcBatchHandleQty(batch,label,balance) {
this.dataContent.subList.forEach(item => {
if(item.itemCode == balance.itemCode&&item.batch == batch){
item.handleQty = item.handleQty || 0
item.handleQty = calc.add(item.handleQty, label.qty);
}
calcBatchHandleQty(batch) {
let handleQty = 0;
batch.Records.forEach(res => {
handleQty = calc.add(handleQty, res.qty)
})
batch.handleQty = handleQty;
},
addRecord(batch, label, balance, packageInfo) {
this.calcBatchHandleQty(batch,label,balance);
this.getfocus();
if (packageInfo.parentNumber) {
var checkData = batch.Records.find(r => {
if (r.packingNumber == packageInfo.parentNumber &&
r.batch == balance.batch) {
return r;
}
})
if (checkData) {
//
this.showErrorMessage("箱码[" + packageInfo.number + "]批次[" + balance.batch +
"]的父包装已经扫描")
} else {
let record = this.creatRecord(label, balance, packageInfo);
batch.Records.push(record);
this.issueRecord.unshift(record)
this.calcBatchHandleQty(batch);
this.getfocus();
this.$emit("afterScan");
}
} else {
//
var checkData = batch.Records.find(r => {
if (r.parentPackingNumber == packageInfo.number &&
r.batch == balance.batch) {
return r;
}
})
if (checkData) {
//
this.$refs.comMessage.showQuestionMessage("扫描箱码[" + checkData.parentPackingNumber + "]" + "批次[" +
balance
.batch + "]是父包装,是否移除子包装", res => {
if (res) {
batch.Records = [];
let record = this.creatRecord(label, balance, packageInfo);
batch.Records.push(record);
this.issueRecord.unshift(record)
this.calcBatchHandleQty(batch);
this.getfocus();
this.$emit("afterScan");
}
})
console.log("扫描的是父包装,是否移除子包装")
} else {
let record = this.creatRecord(label, balance, packageInfo);
batch.Records.push(record);
this.issueRecord.unshift(record)
this.calcBatchHandleQty(batch);
this.getfocus();
this.$emit("afterScan");
}
}
},
getfocus() {
@ -480,13 +908,17 @@
let item = this.toLocation.Items.find(r => r.itemCode == record.itemCode);
if (item != undefined) {
item.Locations.forEach(l => {
let batch = l.Batchs.find(b => b.packingNumber == record.packingNumber && b
.batch == record.batch);
let rIndex = batch.Records.findIndex(r => r.packingNumber == record
.packingNumber && r
.batch == record.batch);
batch.Records.splice(rIndex, 1);
if (batch && batch.Records && batch.Records.length > 0) {
let rIndex = batch.Records.findIndex(r => r.packingNumber == record
.packingNumber && r.batch == record.batch);
batch.Records.splice(rIndex, 1);
}
})
}
this.$emit('updateData', item);
@ -495,10 +927,16 @@
},
packGetFocus() {
this.$refs.comscan.getfocus();
if (this.$refs.comscan) {
this.$refs.comscan.getfocus();
}
},
packLoseFocus() {
this.$refs.comscan.losefocus();
if (this.$refs.comscan) {
this.$refs.comscan.losefocus();
}
},
showMessage(message, callback) {
setTimeout(r => {
@ -545,4 +983,8 @@
max-height: 300rpx;
padding: 10rpx;
}
</style>
.my-combox {
font-size: 50px;
}
</style>

4
src/pages/deliver/coms/jobInfoPopup.vue

@ -61,7 +61,9 @@
methods: {
openPopup(val) {
this.dataContent = val;
this.$refs.popup.open('bottom')
setTimeout(res => {
this.$refs.popup.open('bottom')
}, 500)
},
closePopup() {
this.$refs.popup.close()

520
src/pages/deliver/job/deliverDetailBatch.vue

@ -28,10 +28,11 @@
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
<view>
<comDeliverDetailCardBatch ref='comIssueDetailCard' :dataContent="detailSource" :settingParam="jobContent"
@updateData='updateData'>
</comDeliverDetailCardBatch>
<view v-for="(toLocation, index) in detailSource">
<comDeliverDetailCardBatch ref='comIssueDetailCardBatch' :dataContent="toLocation" :settingParam="jobContent"
@updateData='updateData' :allowBiggerQty='allowBiggerQty'>
</comDeliverDetailCardBatch>
<view class="split_line"></view>
</view>
</scroll-view>
</view>
@ -46,9 +47,13 @@
</view>
</view>
<win-scan-button @goScan='openScanDetailPopup'></win-scan-button>
<comScanDeliverPackBatch ref="comScanIssuePack" @closeScan='closeScan' @updateData='updateData'>
</comScanDeliverPackBatch>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
<!-- <comScanDeliverPackBatch ref="comScanIssuePack" @closeScan='closeScan' @updateData='updateData'>
</comScanDeliverPackBatch> -->
<winScanPackAndLocation :balanceFromInventoryStatuses="false" ref="scanPopup"
@getResult='getScanResult' :noShowBalanceMessage="false" @confirm='confirmFromLocation'>
</winScanPackAndLocation>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
@ -72,13 +77,20 @@
getRemoveOption,
getCurrDateTime,
getPackingNumberAndBatch,
deepCopyData
deepCopyData,
compareAsc,
} from '@/common/basic.js';
import {
getDataSource
} from '@/pages/issue/js/issue.js';
import {
getTreeDataSource,
calcTreeHandleQty,
getScanCount,
getThreeDataSource,
getDataSource,
calcHandleQty,
getDataSourceBatch
} from '@/common/detail.js';
import {
getManagementPrecisions
} from '@/common/balance.js';
@ -89,6 +101,7 @@
import comDeliverDetailCardBatch from '@/pages/deliver/coms/comDeliverDetailCardBatch.vue'
import comScanDeliverPackBatch from '@/pages/deliver/coms/comScanDeliverPackBatch.vue'
import jobTop from '@/mycomponents/job/jobTop.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
export default {
name: 'issueDetail',
@ -97,7 +110,8 @@
winScanButton,
comDeliverDetailCardBatch,
comScanDeliverPackBatch,
jobTop
jobTop,
winScanPackAndLocation
},
data() {
return {
@ -109,7 +123,8 @@
scanOptions: [],
status: "",
toLocationCode: "",
jobStatus: ""
jobStatus: "",
allowBiggerQty:"TRUE",//
};
},
@ -184,8 +199,10 @@
that.jobContent = res.data;
that.jobStatus = res.data.status;
that.subList = res.data.subList;
that.detailSource = res.data;
// that.detailSource = res.data;
that.detailSource = getDataSourceBatch(that.subList)
that.toLocationCode = that.subList[0].toLocationCode
that.allowBiggerQty = res.data.allowBiggerQty;
that.resizeCollapse();
} else {
that.showMessage('未获取到详情');
@ -201,11 +218,229 @@
},
resizeCollapse() {
this.$nextTick(r => {
this.$refs.comIssueDetailCardBatch.forEach(r => {
r.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
}
if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){
this.setDataBatch(result)
}else{
this.setData(result)
}
},
setDataBatch(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,
// 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=>{
item.handleQty = item.handleQty || 0
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.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=>{
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: "提交中....",
@ -214,18 +449,23 @@
//
var itemCodes = []
let locationCode = this.detailSource.subList[0].toLocationCode
this.detailSource.subList.forEach(item => {
itemCodes.push(item.itemCode)
//
var itemCodes = []
let locationCode = this.detailSource[0].subList[0].toLocationCode
this.detailSource.forEach(toLocation => {
itemCodes.push(toLocation.itemCode)
})
//
getManagementPrecisions(itemCodes, locationCode, res => {
if (res.success) {
this.managementList = res.list;
this.managementType = this.managementList && this.managementList[0] ? this.managementList[0].ManagementPrecision : 'BY_PACKAGING'
this.submitJob();
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
// this.showErrorMessage(res.message);
}
});
// //使
@ -246,51 +486,129 @@
},
checkCount() {
let str = ""
var taskQty = 0;
var totalQty = 0;
this.detailSource.subList.forEach(item => {
item.taskQty = calc.add(taskQty, item.qty)
var hanleQty = item.qty ? item.qty : 0
totalQty = calc.add(totalQty, hanleQty)
let str=""
this.detailSource.forEach(detail => {
detail.Items.forEach(item => {
var taskQty =0;
item.taskQty =calc.add(taskQty,item.qty)
var totalQty =0;
item.Locations.forEach(lco => {
lco.Batchs.forEach(batch => {
batch.Records.forEach(record => {
if(record){
var hanleQty =record.qty?record.qty:0
totalQty = calc.add(totalQty,hanleQty)
}
})
})
})
//
item.totalQty = totalQty
item.totalQty =totalQty
})
//
this.detailSource.subList.forEach(detail => {
if (this.jobContent.allowPartialComplete == "FALSE") {
if (item.taskQty != item.totalQty) {
})
//
this.detailSource.forEach(detail=>{
detail.Items.forEach(item=>{
if(this.jobContent.allowPartialComplete=="FALSE"){
if(item.taskQty!=item.totalQty){
str += `物料号【${item.itemCode}】任务数量【${item.taskQty}】与实际提交数量【${item.totalQty}】不一致\n`
}
}
})
})
if(str){
str = '不允许提交\n' + str
this.showErrorMessage(str)
}
return str?false:true
},
checkCountBatch() {
let str = ""
let str1 = ""
let str2 = ""
this.detailSource.forEach(detail => {
var taskQty = 0;
var totalQty = 0;
detail.subList.forEach(item => {
if(item.scaned){
item.taskQty=0
item.totalQty=0
item.taskQty =calc.add(item.taskQty,item.qty)
item.totalQty =calc.add(item.totalQty,item.handleQty)
if (this.jobContent.allowSmallerQty == "FALSE") {
if(item.handleQty!=item.taskQty){
str += `批次【${item.batch}】提交数量【${item.handleQty}】与任务物料数量【${item.taskQty}】不一致\n`
}
}
if (this.allowBiggerQty == 'FALSE') {
if ( item.taskQty < item.totalQty) {
str1 += '数量[' + item.totalQty + ']不允许大于任务数量[' + item.taskQty + ']'
}
}
if(item.handleQty>item.balance.qty){
str2 += `批次【${item.batch}】提交数量【${item.handleQty}】不可以大于库存数量【${item.balance.qty}`
}
}
})
})
if (str) {
str = '不允许提交\n' + str
this.showErrorMessage(str)
}
return str ? false : true
if (str1) {
str1 = '不允许提交\n' + str1
this.showErrorMessage(str1)
}
if (str2) {
str2 = '不允许提交\n' + str2
this.showErrorMessage(str2)
}
return str || str1 || str2 ? false : true
},
submitJob() {
var params = this.setParams()
console.log("提交参数", params);
if (params.subList.length == 0) {
uni.hideLoading()
this.$refs.comMessage.showConfirmMessageModal('请扫描箱码')
return
console.log("提交参数", params.subList);
// const isTrue = params.subList.some(item=>{
// console.log(item.recordList.some(cur=>cur.scaned))
// return item.recordList.some(cur=>cur.scaned) == true
// })
const isTrue = params.subList.some(item=>item.scaned)
if(!isTrue){
uni.hideLoading()
this.showErrorMessage("请扫描您需要提交的发货任务")
return
}
if (!this.checkCount()) {
uni.hideLoading()
return;
// return;
// if (params.subList.length == 0) {
// uni.hideLoading()
// this.$refs.comMessage.showConfirmMessageModal('')
// return
// }
if(this.managementType == "BY_BATCH" ||this.managementType == "BY_QUANTITY" ){
if (!this.checkCountBatch()) {
uni.hideLoading()
return;
}
}else{
if (!this.checkCount()) {
uni.hideLoading()
return;
}
}
deliverJobSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功\n生成发货记录\n" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
@ -305,40 +623,45 @@
var subList = []
var createTime = getCurrDateTime();
var creator = this.$store.state.user.id
this.detailSource.subList.forEach(r => {
if (r.scaned) {
let subItem = {
...r
}
subItem.recordList = []
let record = {};
record.handleQty = r.qty;
record.toContainerNumber = r.ContainerNumber;
record.toInventoryStatus = r.inventoryStatus;
record.toLocationCode = subItem.toLocationCode;
record.supplierCode = r.supplierCode;
var info = getPackingNumberAndBatch(this.managementList, r.itemCode, r.packingNumber, r.batch);
record.toPackingNumber = info.packingNumber;
record.packingNumber = info.packingNumber;
record.fromPackingNumber = info.packingNumber;
record.toBatch = info.batch;
subItem.toPackingNumber = info.packingNumber;
subItem.packingNumber = info.packingNumber;
subItem.fromPackingNumber = info.packingNumber;
// //使
// if (this.toLocationCode == null) {
// record.toPackingNumber = r.packingNumber;
// record.toBatch = r.batch;
// } else {
// var info = getPackingNumberAndBatch(this.managementList, r.itemCode,r.packingNumber, r.batch);
// record.toPackingNumber = info.packingNumber;
// record.toBatch = info.batch;
// }
subItem.recordList.push(record);
subList.push(deepCopyData(subItem));
}
console.log(this.detailSource)
this.detailSource.forEach(toLocationCode => {
// let obj = {...toLocationCode}
// delete obj.subList
let recordList = []
let obj1 ={}
let arr = toLocationCode.subList.filter(item=>item.scaned)
console.log(888,arr)
if(arr.length>0){
arr.forEach(record=>{
obj1.itemCode =toLocationCode.itemCode;
obj1.itemName =toLocationCode.itemName;
obj1.scaned =record.scaned;
obj1.handleQty =record.handleQty;
obj1.qty =record.qty;
obj1.fromLocationCode =record.fromLocationCode;
obj1.fromInventoryStatus =record.fromInventoryStatus;
obj1.copyContent =record.copyContent;
obj1.toContainerNumber = record.ContainerNumber;
obj1.toInventoryStatus =record.inventoryStatus;
obj1.toLocationCode = record.toLocationCode;
obj1.supplierCode = record.supplierCode;
obj1.toPackingNumber ='';
obj1.packingNumber = ''
obj1.fromPackingNumber = '';
obj1.toBatch = record.batch;
obj1.toPackingNumber = '';
obj1.packingNumber = '';
obj1.fromPackingNumber ='';
// obj = {...obj1}
recordList.push(obj1)
})
subList.push({
...obj1,
recordList: recordList
})
}
})
this.jobContent.subList = subList
this.jobContent.createTime = createTime;
this.jobContent.creator = creator;
@ -376,12 +699,12 @@
},
updateData(record) {
calcHandleQty(this.detailSource);
},
scanPopupGetFocus() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.getfocus();
this.$refs.scanPopup.packGetFocus();
}
},
@ -434,16 +757,41 @@
this.dataContent = result;
this.$forceUpdate();
},
openScanDetailPopup() {
var datacontent = {}
//
// Object.assign(datacontent, this.detailSource);
console.log(2323)
this.$refs.comScanIssuePack.openScanPopup(this.detailSource, this.jobContent);
},
// openScanDetailPopup() {
// var datacontent = {}
// //
// // Object.assign(datacontent, this.detailSource);
// this.$refs.comScanIssuePack.openScanPopup(this.detailSource, this.jobContent);
// },
closeScanPopup() {
this.updateCommitBtn();
// this.updateCommitBtn();
},
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.fromLocationCode = fromLocationCode
this.$refs.scanPopup.openScanPopupForJob(fromLocationCode, fromlocationList, this.jobContent);
},
},
confirmFromLocation(fromLocationCodeParams){
this.fromlocationCode = fromLocationCodeParams
}
};
</script>

2
src/pages/deliver/job/deliverJob.vue

@ -139,7 +139,7 @@
if (this.checkedToday) {
filters.push({
column: "create_time",
action: "betweeen",
action: "between",
value: this.todayTime
})
}

79
src/pages/deliver/record/deliverRecord.vue

@ -8,7 +8,9 @@
<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"
<record-com-detail-card
:dataContent="item" :index="index" :settingParam="dataContent"
:isShowParentToLocation="false"
:isShowLocation="true" @removeItem="removeItem(index,item)" @updateData="updateData"
@removePack="removePack">
</record-com-detail-card>
@ -80,6 +82,9 @@
calcHandleQty
} from '@/common/record.js';
import {
calc
} from '@/common/calc.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
@ -115,7 +120,8 @@
customerCode : "",
dataContent:{},
managementList:[],
deliverType:''//CUSTTHIRD_PARTY
deliverType:'',//CUSTTHIRD_PARTY
managementType:""
};
},
onLoad(option) {
@ -162,7 +168,16 @@
mounted() {},
methods: {
getScanResult(result) {
getScanResult(result,managementTypeParams) {
this.managementType = managementTypeParams
if (managementTypeParams == "BY_BATCH" || managementTypeParams == "BY_QUANTITY") {
this.setDataBatch(result)
} else {
this.setData(result)
}
},
setData(result){
let balance = result.balance;
let label = result.label;
let pack = result.package;
@ -197,8 +212,42 @@
}
}
this.calcHandleQty();
},
setDataBatch(result){
let balance = result.balance;
let label = result.label;
let pack = result.package;
let labelQty =result.label.qty;
let balanceQty =result.balance.qty;
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.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 {
detail.handleQty =calc.add(detail.handleQty, result.label.qty)
}
}
this.calcHandleQty();
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
@ -228,12 +277,16 @@
},
openScanPopup() {
if (this.fromLocationCode == "") {
this.showFromLocationPopup();
return
if (this.businessType) {
if (this.fromLocationCode == "") {
this.showFromLocationPopup();
return
}
this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType);
} else {
this.getBusinessType()
}
this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType);
},
showFromLocationPopup() {
@ -286,7 +339,13 @@
if (res.success) {
this.managementList = res.list;
var params = this.setParams()
console.log("提交" + JSON.stringify(params))
console.log("提交",params)
let obj = params.subList.find(item=>item.balanceQty < item.handleQty)
if(obj){
this.$refs.comMessage.showConfirmWarningModal('批次[' +obj.batch + ']数量[' + obj.handleQty + ']不允许大于库存数量[' +obj.balanceQty + ']')
uni.hideLoading()
return
}
deliverRecordSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {

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

@ -112,7 +112,7 @@
</view>
<view class='split_line'></view>
<view class="uni-flex uni-row" style="align-items: center; margin-top: 20rpx; margin-bottom: 20rpx; margin-left: 10rpx; justify-content: space-between;">
<view class="uni-flex uni-row" style="align-items: center; margin-top: 20rpx; margin-bottom: 20rpx; margin-left: 10rpx; justify-content: space-between;" v-if="EnableQms">
<view class="title" >
创建检验申请
</view>
@ -156,6 +156,10 @@
import {
calc
} from '@/common/calc.js';
import {
getSwitchInfoByCode
} from '@/common/basic.js';
import uom from '@/mycomponents/qty/uom.vue'
import packQty from '@/mycomponents/qty/packQty.vue'
@ -200,7 +204,8 @@
workshop: "",
bomVersion: "",
putAwayRequestSwitch:true,
putAwayInspectSwitch:true
putAwayInspectSwitch:true,
EnableQms:true
}
},
props: {
@ -213,6 +218,9 @@
default: []
},
},
mounted() {
this.EnableQms = getSwitchInfoByCode('EnableQms')
},
methods: {
openRequestPopup() {
@ -291,7 +299,9 @@
this.showErrorMessage("请选择包装规格")
return
}
if (!this.EnableQms) {
this.putAwayInspectSwitch = false
}
this.callback();
},

17
src/pages/fg/coms/comReceiptPopup.vue

@ -107,7 +107,7 @@
</view>
<view class='split_line'></view>
<view class="uni-flex uni-row" style="align-items: center; margin-top: 20rpx; margin-bottom: 20rpx; margin-left: 10rpx; justify-content: space-between;">
<view class="uni-flex uni-row" style="align-items: center; margin-top: 20rpx; margin-bottom: 20rpx; margin-left: 10rpx; justify-content: space-between;" v-if="EnableQms">
<view class="title" >
创建检验申请
</view>
@ -151,7 +151,9 @@
import {
calc
} from '@/common/calc.js';
import {
getSwitchInfoByCode
} from '@/common/basic.js';
import uom from '@/mycomponents/qty/uom.vue'
import packQty from '@/mycomponents/qty/packQty.vue'
import balanceStatus from '@/mycomponents/status/balanceStatus.vue'
@ -193,7 +195,8 @@
fgLocationCode: "",
rawLocationCode: "",
putAwayRequestSwitch:true,
putAwayInspectSwitch:true
putAwayInspectSwitch:true,
EnableQms:true
}
},
props: {
@ -206,6 +209,10 @@
default: []
},
},
mounted() {
this.EnableQms = getSwitchInfoByCode('EnableQms')
console.log(777,this.EnableQms)
},
methods: {
openRequestPopup() {
this.initData();
@ -279,7 +286,9 @@
this.showErrorMessage("请选择包装规格")
return
}
if (!this.EnableQms) {
this.putAwayInspectSwitch = false
}
this.callback();
},

4
src/pages/fg/receiptByPlan.vue

@ -130,9 +130,7 @@
import winScanFgLabel from "@/mycomponents/scan/winScanFgLabel.vue"
import comFgCard from "@/pages/productReceipt/coms/comFgCard.vue"
import light from '@/mycomponents/balance/light.vue'
import {
Exception
} from 'sass';
import {
nextTick
} from 'vue';

4
src/pages/fg/receiptNoPlan.vue

@ -124,9 +124,7 @@
import winScanFgLabel from "@/mycomponents/scan/winScanFgLabel.vue"
import comFgCard from "@/pages/productReceipt/coms/comFgCard.vue"
import light from '@/mycomponents/balance/light.vue'
import {
Exception
} from 'sass';
export default {
components: {

2
src/pages/index/index.vue

@ -388,7 +388,7 @@
console.log("包装规格获取失败", res)
})
var switchCode="FgPutawayLocationCodeValidate,SemiPutawayLocationCodeValidate,PurchasePutawayToLocationCodeValidate,IssueToLocationCodeValidate,fgProductReceipCommitValidate,semiProductReceipCommitValidate,purchasereceiptPrintPDA,purchaseReceiptLocationCodeValidate,CreateProductputawayRequestAfterProductreceiptRecordCreated";
var switchCode="FgPutawayLocationCodeValidate,SemiPutawayLocationCodeValidate,PurchasePutawayToLocationCodeValidate,IssueToLocationCodeValidate,fgProductReceipCommitValidate,semiProductReceipCommitValidate,purchasereceiptPrintPDA,purchaseReceiptLocationCodeValidate,CreateProductputawayRequestAfterProductreceiptRecordCreated,EnableQms,ShowPackingNumber,directIssueFifoSwitch";
getSwitchByCode(switchCode).then(res=>{
uni.setStorageSync("switch", res.data)

2
src/pages/inspect/job/inspectJob.vue

@ -126,7 +126,7 @@
if (this.checkedToday) {
filters.push({
column: "create_time",
action: "betweeen",
action: "between",
value: this.todayTime
})
}

12
src/pages/inventoryMove/coms/comInventoryDetailCard.vue

@ -3,7 +3,11 @@
<uni-collapse ref="collapse1" @change="">
<uni-collapse-item :open="true">
<template v-slot:title>
<item-qty :dataContent="dataContent" :handleQty="dataContent.handleQty"></item-qty>
<!-- {{dataContent.handleQty}}
<item-qty :dataContent="dataContent" :handleQty="dataContent.handleQty"></item-qty> -->
<item-compare-qty :dataContent="dataContent" :handleQty="dataContent.handleQty"
:isShowStdPack="false">
</item-compare-qty>
</template>
<view class='split_line'></view>
<view class="" v-for="(item,index) in dataContent.subList">
@ -27,6 +31,7 @@
<script>
import itemQty from '@/mycomponents/item/itemQty.vue'
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import detailInfoPopup from '@/pages/inventoryMove/coms/detailInfoPopup.vue'
@ -44,7 +49,8 @@
recommend,
balanceQtyEdit,
detailInfoPopup,
winScanLocation
winScanLocation,
itemCompareQty
},
data() {
return {
@ -134,6 +140,8 @@
item.scaned = false
item.balance = {}
item.handleQty = 0;
item.packUnit="";
item.packQty=undefined;
this.$forceUpdate()
this.$emit('remove', item)
}

203
src/pages/inventoryMove/coms/comInventoryDetailCardBatch.vue

@ -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>

2
src/pages/inventoryMove/coms/comMoveJob.vue

@ -170,7 +170,7 @@
if (this.checkedToday) {
filters.push({
column: "create_time",
action: "betweeen",
action: "between",
value: this.todayTime
})
}

379
src/pages/inventoryMove/coms/comMoveRecord.vue

@ -1,7 +1,7 @@
<template>
<view class="page-wraper">
<view class="">
<com-blank-view @goScan='showFromLocationPopup' v-if="detailSource.length==0"></com-blank-view>
<com-blank-view @goScan='showPopup' v-if="detailSource.length==0"></com-blank-view>
</view>
<view class="page-wraper" v-if="detailSource.length>0">
<view class='split_line'></view>
@ -11,7 +11,7 @@
<view class="">
<com-move-record-card :dataContent="item" :index="index" @removeData="removeData"
:isShowStatus="isShowStatus" @updateData="updateData" @removePack='removePack'
:allowEditStatus="allowEditStatus">
:allowEditQty="true" :allowEditStatus="allowEditStatus">
</com-move-record-card>
</view>
</view>
@ -31,12 +31,18 @@
</view>
</view>
</view>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
<win-scan-button @goScan='showPopup'></win-scan-button>
</view>
<!-- 合格转隔离单独的弹窗-->
<okToHoldRecordPack ref="okToHoldRecordPackRef" :showOnePop='showOnePop'
@showFromLocationPopup='showFromLocationPopup' @itemCodeClick='openScanPopup'
@onConfirm='okToHoldRecordPackConfirm' @getInputMsgResult="getInputMsgResult"></okToHoldRecordPack>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' :title="'箱码'">
</win-scan-pack-and-location>
<win-scan-location ref="scanFromLocationCode" title="来源库位" @getLocation='getFromLocation'
:locationAreaTypeList="fromLocationAreaTypeList"></win-scan-location>
:locationAreaTypeList="fromLocationAreaTypeList"
@clearFromLocation="clearFromLocationCode"></win-scan-location>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
@ -49,17 +55,23 @@
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import okToHoldRecordPack from '@/pages/inventoryMove/coms/okToHoldRecordPack.vue'
import {
getInventoryStatusName
} from '@/common/directory.js';
import {
inventoryMoveRecordSubmit,
getBasicLocationByCode,
getBasicItemByCode
} from '@/api/request2.js';
import {
getDirectoryItemArray
getDirectoryItemArray,
getItemTypeName,
getInventoryStatusName,
checkDirectoryItemExist,
getListItemTypeDesc,
getListItemStatusDesc,
getItemStatusName,
getInventoryStatusDesc
} from '@/common/directory.js';
import {
@ -68,16 +80,22 @@
import {
getPackingNumberAndBatchByList,
deepCopyData
deepCopyData,
} from '@/common/basic.js';
import {
getBusinessType,
createItemInfo,
createDetailInfo,
calcHandleQty
calcHandleQty,
createItemInfoForLabel,
createDetailInfoForLabel
} from '@/common/record.js';
import {
calc
} from '@/common/calc.js';
export default {
components: {
comEmptyView,
@ -87,6 +105,7 @@
comBlankView,
winScanLocation,
winScanPackAndLocation,
okToHoldRecordPack,
},
props: {
// fromInventoryStatus: {
@ -117,6 +136,11 @@
type: String,
default: ""
},
//
showOnePop: {
type: Boolean,
default: false
},
},
data() {
return {
@ -132,7 +156,12 @@
dataContent: {},
fromLocationAreaTypeList: [],
toLocationAreaTypeList: [],
isShowEditLocation: false
itemTypeList: [],
itemStatusList: [],
fromInventoryStatuses:[],
isShowEditLocation: false,
isJustReplay: true, //
fromWarehouseCode: ""
}
},
@ -140,9 +169,12 @@
getBusinessType(this.businessTypeCode, res => {
if (res.success) {
this.businessType = res.businessType;
this.itemTypeList = res.itemTypeList;
this.itemStatusList = res.itemStatusList;
this.fromLocationAreaTypeList = res.fromLocationAreaTypeList;
this.toLocationAreaTypeList = res.toLocationAreaTypeList;
this.showFromLocationPopup();
this.fromInventoryStatuses =getDirectoryItemArray(res.fromInventoryStatuses);
this.showPopup()
} else {
this.showErrorMessage(res.message)
}
@ -153,6 +185,7 @@
methods: {
initData() {
if (this.businessTypeCode == "Move") {
// this.title = "";
@ -218,6 +251,8 @@
},
openScanPopup() {
this.isJustReplay = true
this.fromLocationCode = this.$refs.okToHoldRecordPackRef.fromLocationCode || ' '
if (this.fromLocationCode == "") {
this.showFromLocationPopup();
return
@ -225,20 +260,152 @@
this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType);
},
showFromLocationPopup() {
this.$nextTick(() => {
this.$refs.scanFromLocationCode.openScanPopup();
})
// this.$refs.scanPopup.
this.$refs.scanFromLocationCode.openScanPopup();
},
showPopup() {
setTimeout(() => {
if (this.showOnePop) {
this.$refs.okToHoldRecordPackRef.fromLocationCode = ''
this.$refs.okToHoldRecordPackRef.itemCode = ''
this.$refs.okToHoldRecordPackRef.batch = ''
this.$refs.okToHoldRecordPackRef.handleQty = 0
this.$refs.okToHoldRecordPackRef.showOne = true
} else {
this.$refs.scanFromLocationCode.openScanPopup();
}
}, 500)
},
getFromLocation(location) {
this.fromLocationCode = location.code;
this.$refs.okToHoldRecordPackRef.fromLocationCode = location.code
this.fromLocationInfo = location;
this.openScanPopup();
if (!this.showOnePop) {
this.openScanPopup();
} else {
this.itemCode = ''
this.batch = ''
}
},
getToLocation(location, code) {
this.toLocationCode = code;
this.toLocationInfo = location;
},
getScanResult(result) {
getScanResult(result, managementTypeParams) {
this.fromWarehouseCode = result.fromWarehouseCode
this.managementType = managementTypeParams
if (this.showOnePop) {
if (this.isJustReplay) {
this.checkItemCode(result.label.itemCode, callBack => {
if (callBack) {
var itemType = callBack.itemType
var itemStatus = callBack.itemStatus
if (checkDirectoryItemExist(this.itemTypeList, itemType)) {
if (checkDirectoryItemExist(this.itemStatusList, itemStatus)) {
this.$refs.okToHoldRecordPackRef.itemCode = result.label.itemCode
this.$refs.okToHoldRecordPackRef.batch = result.label.batch
this.$refs.okToHoldRecordPackRef.uom = result.balance ? result.balance.uom : ""
this.getResult = result //
this.$refs.scanPopup.closeScanPopup()
} else {
this.$refs.okToHoldRecordPackRef.itemCode = ''
var hint = getListItemStatusDesc(this.itemStatusList);
this.showErrorMessage("扫描物料[" + result.label.itemCode + "]是[" +
getItemStatusName(itemStatus) + "],需要的物料状态是[" + hint + "]")
}
} else {
this.$refs.okToHoldRecordPackRef.itemCode = ''
var hint = getListItemTypeDesc(this.itemTypeList);
this.showErrorMessage("扫描物料[" + result.label.itemCode + "]是[" +
getItemTypeName(callBack) + "],需要的物料类型是[" + hint + "]")
}
} else {
this.$refs.okToHoldRecordPackRef.itemCode = ''
this.showErrorMessage('未查找到物料【' + result.label.itemCode + '】');
}
})
} else {
this.getScanResultAfterBatch(result, managementTypeParams)
}
} else {
if (managementTypeParams == "BY_BATCH" || managementTypeParams == "BY_QUANTITY") {
this.getScanResultAfterBatch(result, managementTypeParams)
} else {
this.getScanResultAfter(result, managementTypeParams)
}
}
},
okToHoldRecordPackConfirm(obj) {
// this.getResult. = result//
if (!obj.fromLocationCode) {
this.$refs.comMessage.showErrorMessage('请输入来源库位');
return;
}
if (!obj.itemCode) {
this.$refs.comMessage.showErrorMessage('请输入零件');
return;
}
if (!obj.handleQty) {
this.$refs.comMessage.showErrorMessage('请输入数量');
return;
}
this.getResult = this.getResult ? this.getResult : {
label: {},
fromLocationCode: ''
}
this.getResult.fromLocationCode = obj.fromLocationCode
this.getResult.label.itemCode = obj.itemCode
this.getResult.label.batch = obj.batch
this.getResult.label.qty = obj.handleQty
this.isJustReplay = false
this.$refs.scanPopup.getScanResult(this.getResult, this.businessType)
},
checkItemCode(itemCode, callBack) {
getBasicItemByCode(itemCode).then(res => {
if (res.data.list.length > 0) {
var itemType = res.data.list[0].type
var itemStatus = res.data.list[0].status
var info = {
itemType: itemType,
itemStatus: itemStatus
}
callBack(info)
} else {
callBack(null)
}
}).catch(error => {
callBack(null)
})
},
checkInventoryStatus(result,inventoryStatus) {
var isPass=true;
if (!checkDirectoryItemExist(this.fromInventoryStatuses, inventoryStatus)) {
isPass=false
var hint = getInventoryStatusDesc(this.fromInventoryStatuses);
this.showErrorMessage("查询库存是[" +
getInventoryStatusName(inventoryStatus) + "],需要的库存状态是[" + hint + "]")
}
return isPass;
},
clearFromLocationCode() {
this.$refs.okToHoldRecordPackRef.fromLocationCode = ''
},
getScanResultAfter(result) {
var balance = result.balance;
var pack = result.package;
var item = this.detailSource.find(res => {
@ -297,8 +464,165 @@
}
}
calcHandleQty(this.detailSource);
},
getScanResultAfterBatch(result, managementTypeParams) {
if(!this.checkInventoryStatus(result,result.balance.inventoryStatus)){
return;
}
var balance = result.balance;
this.balanceInfo = result.balance;
var pack = result.package;
var item = this.detailSource.find(res => {
if (res.itemCode == balance.itemCode) {
return res
}
})
// 0
if (!balance.qty) {
this.$refs.comMessage.showConfirmWarningModal("物料号[" + result.label.itemCode + "]库存余额数量是0")
return
}
//
if (result.label.qty > balance.qty) {
this.$refs.comMessage.showConfirmWarningModal("物料号[" + result.label.itemCode + "]数量[" + result.label
.qty + "]不可以大于库存余额数量[" + balance.qty + "]")
return
}
if (item == undefined) {
var itemp = createItemInfoForLabel(balance, result.label);
let newDetail = createDetailInfoForLabel(balance, pack, result.label);
// if (newDetail.packingNumber == '') {
// newDetail.packingNumber = pack.number;
// }
if (this.businessTypeCode == "Move") {
newDetail.toInventoryStatus = balance.inventoryStatus;
} else {
newDetail.toInventoryStatus = this.toInventoryStatus;
}
newDetail.toLocationCode = this.toLocationCode;
newDetail.managementTypeParams = managementTypeParams;
newDetail.fromLocationCode = result.fromLocationCode
newDetail.handleQty = Number(result.label.qty)
newDetail.batch = result.balance.batch
newDetail.packQty = balance.packQty;
newDetail.packUnit = balance.packUnit;
itemp.subList.push(newDetail);
this.detailSource.push(itemp)
this.clearFromLocation()
this.$refs.okToHoldRecordPackRef.handleQty = 0
this.$refs.okToHoldRecordPackRef.showOne = false
} else {
var detail = ''
if (managementTypeParams == 'BY_QUANTITY') {
detail = item.subList.find(r => {
if (r.fromLocationCode == balance.locationCode &&
r.scaned == true) {
return r;
}
})
} else if (managementTypeParams == 'BY_BATCH') {
detail = item.subList.find(r => {
if (r.batch == result.label.batch &&
r.fromLocationCode == balance.locationCode &&
r.scaned == true) {
return r;
}
})
}
console.log(detail)
if (detail == undefined) {
let newDetail = createDetailInfoForLabel(balance, pack, result.label);
// newDetail.inventoryStatus = balance.inventoryStatus;
if (this.businessTypeCode == "Move") {
newDetail.toInventoryStatus = balance.inventoryStatus;
} else {
newDetail.toInventoryStatus = this.toInventoryStatus;
}
// if (newDetail.packingNumber == '') {
// newDetail.packingNumber = pack.number;
// }
newDetail.toLocationCode = this.toLocationCode;
newDetail.managementTypeParams = managementTypeParams;
newDetail.fromLocationCode = result.fromLocationCode
newDetail.batch = result.label.batch
newDetail.handleQty = result.label.qty
newDetail.packQty = balance.packQty;
newDetail.packUnit = balance.packUnit;
item.subList.push(newDetail);
this.clearFromLocation()
this.$refs.okToHoldRecordPackRef.handleQty = 0
this.$refs.okToHoldRecordPackRef.showOne = false
} else {
// console.log(999,detail.handleQty)
// detail.handleQty =calc.add(detail.handleQty, result.label.qty)
if (managementTypeParams == 'BY_QUANTITY') {
this.showErrorMessage(
"物料号[" + item.itemCode + "]\n" + "批次[]\n" + "库位[" + detail.fromLocationCode + "]\n" +
"已经存在")
} else if (managementTypeParams == 'BY_BATCH') {
this.showErrorMessage(
"物料号[" + item.itemCode + "]\n" + "批次[" + detail.batch + "]\n" + "库位[" + detail
.fromLocationCode + "]\n" +
"已经存在")
}
}
}
calcHandleQty(this.detailSource);
},
getInputMsgResult(result, fromWitch) {
if (fromWitch == 'fromLocationScanMsg') {
this.isClearFromLocationCode = false
this.$refs.scanFromLocationCode.getScanResult(result)
} else if (fromWitch == 'itemCodeScan') {
result.fromLocationCode = this.fromLocationCode
result.label.itemCode = result.label.code
this.checkItemCode(result.label.itemCode, callBack => {
if (callBack) {
var itemType = callBack.itemType
var itemStatus = callBack.itemStatus
if (checkDirectoryItemExist(this.itemTypeList, itemType)) {
if (checkDirectoryItemExist(this.itemStatusList, itemStatus)) {
this.$refs.okToHoldRecordPackRef.itemCode=result.label.itemCode
} else {
this.$refs.okToHoldRecordPackRef.itemCode = ''
var hint = getListItemStatusDesc(this.itemStatusList);
this.showErrorMessage("扫描物料[" + result.label.itemCode + "]是[" +
getItemStatusName(itemStatus) + "],需要的物料状态是[" + hint + "]")
}
} else {
this.$refs.okToHoldRecordPackRef.itemCode = ''
var hint = getListItemTypeDesc(this.itemTypeList);
this.showErrorMessage("扫描物料[" + result.label.itemCode + "]是[" +
getItemTypeName(callBack) + "],需要的物料类型是[" + hint + "]")
}
} else {
this.$refs.okToHoldRecordPackRef.itemCode = ''
this.showErrorMessage('未查找到物料【' + result.label.itemCode + '】');
}
})
}
},
//
clearFromLocation(fromLocationCodeParams) {
this.$refs.okToHoldRecordPackRef.fromLocationCode = ''
// this.$refs.okToHoldRecordPackRef.itemCode =''
// this.$refs.okToHoldRecordPackRef.batch =''
// this.isClearFromLocationCode = true
},
//
clearItemCode(label) {
this.$refs.okToHoldRecordPackRef.itemCode = ''
// this.$refs.okToHoldRecordPackRef.batch =''
},
showErrorMessage(message) {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.packLoseFocus()
@ -407,7 +731,15 @@
});
return;
}
console.log("提交" + JSON.stringify(params))
// if(this.balanceInfo)
console.log("提交", params)
let obj = params.subList.find(item => item.balanceQty < item.handleQty)
if (obj) {
this.$refs.comMessage.showConfirmWarningModal('物料号[' + obj.itemCode + ']批次[' + obj.batch + ']数量[' + obj
.handleQty + ']不允许大于库存数量[' + obj.balanceQty + ']')
uni.hideLoading()
return
}
inventoryMoveRecordSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
@ -451,6 +783,7 @@
setParams() {
var subList = []
var creator = this.$store.state.user.id
console.log(233, this.detailSource)
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
@ -458,16 +791,16 @@
detail.packingNumber, detail.toLocationCode, detail.batch);
var submitItem = deepCopyData(detail)
submitItem.itemCode = detail.itemCode;
submitItem.itemName = detail.package.itemName;
submitItem.itemDesc1 = detail.package.itemDesc1;
submitItem.itemDesc2 = detail.package.itemDesc2;
submitItem.itemName = detail.itemName;
submitItem.itemDesc1 = detail.itemDesc1;
submitItem.itemDesc2 = detail.itemDesc2;
submitItem.fromInventoryStatus = detail.inventoryStatus;
submitItem.toInventoryStatus = detail.toInventoryStatus;
submitItem.fromPackingNumber = info.packingNumber;
submitItem.toPackingNumber = info.packingNumber;
submitItem.packingNumber = info.packingNumber;
submitItem.fromContainerNumber = detail.containerNumber;
submitItem.toContainerNumber = detail.containerNumber
@ -488,7 +821,7 @@
})
this.dataContent.subList = subList;
this.dataContent.creator = creator;
this.dataContent.fromWarehouseCode = this.fromLocationInfo.warehouseCode;
this.dataContent.fromWarehouseCode = this.fromWarehouseCode;
this.dataContent.toWarehouseCode = this.toLocationInfo.warehouseCode;
this.dataContent.businessType = this.businessTypeCode;
return this.dataContent;

6
src/pages/inventoryMove/coms/comMoveRecordCard.vue

@ -16,9 +16,9 @@
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item,index)"
:right-options="item.scaned?scanOptions:detailOptions">
<comMovebalance :dataContent="item" :isShowStdPack="false" :isShowPack="true"
<comMovebalance :dataContent="item" :isShowStdPack="false"
:fromInventoryStatus="item.inventoryStatus" :toInventoryStatus="item.toInventoryStatus"
:isShowLocation="true" :allowEditStatus='allowEditStatus'></comMovebalance>
:isShowLocation="true" :allowEditStatus='allowEditStatus' :isShowPack='item.managementTypeParams == "BY_PACKAGING"' ></comMovebalance>
</uni-swipe-action-item>
</uni-swipe-action>
<view class='split_line'></view>
@ -152,7 +152,7 @@
edit(item) {
this.editItem = item;
this.$refs.balanceQtyEdit.openEditPopup(item, item.qty);
this.$refs.balanceQtyEdit.openEditPopup(item, item.handleQty);
},
detail(item) {

313
src/pages/inventoryMove/coms/okToHoldRecordPack.vue

@ -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>

245
src/pages/inventoryMove/job/inventoryMoveDetail.vue

@ -12,15 +12,9 @@
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<comInventoryDetailCardBatch :dataContent="item" :settingParam="jobContent" @remove="updateData"
@updateData='updateData'
:locationAreaTypeList="toLocationAreaTypeList"
@openDetail="openDetail" v-if="managementType=='BY_BATCH'">
</comInventoryDetailCardBatch>
<comInventoryDetailCard :dataContent="item" :settingParam="jobContent" @remove="updateData"
@updateData='updateData' :locationAreaTypeList="toLocationAreaTypeList"
:allowEditQty ="jobContent.allowModifyQty=='TRUE'?true:false"
@openDetail="openDetail" v-else>
:allowEditQty="jobContent.allowModifyQty=='TRUE'?true:false" @openDetail="openDetail">
</comInventoryDetailCard>
</view>
</view>
@ -73,11 +67,14 @@
getPackingNumberAndBatchByList,
getInventoryStatusName,
} from '@/common/basic.js';
import {
calc
} from '@/common/calc.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import comInventoryDetailCard from '@/pages/inventoryMove/coms/comInventoryDetailCard.vue'
import comInventoryDetailCardBatch from '@/pages/inventoryMove/coms/comInventoryDetailCardBatch.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import detailInfoPopup from '@/pages/inventoryMove/coms/detailInfoPopup.vue'
import jobTop from '@/mycomponents/job/jobTop.vue'
@ -89,7 +86,6 @@
winScanButton,
winScanPack,
comInventoryDetailCard,
comInventoryDetailCardBatch,
winScanPackAndLocation,
detailInfoPopup,
jobTop
@ -104,7 +100,7 @@
toLocationInfo: {},
businessTypeInfo: {},
managementList: [],
managementType:'',
managementType: '',
businessTypeCode: '',
toLocationCode: '',
toInventoryStatus: '',
@ -242,7 +238,7 @@
that.toLocationAreaTypeList = getDirectoryItemArray(that.jobContent.toAreaTypes);
that.jobStatus = res.data.status
that.subList = res.data.subList;
that.detailSource =await getDataSource(that.subList)
that.detailSource = await getDataSource(that.subList)
//
var itemCodes = []
this.detailSource.forEach(item => {
@ -253,7 +249,8 @@
getManagementPrecisions(itemCodes, this.toLocationCode, res => {
if (res.success) {
this.managementList = res.list;
this.managementType = this.managementList.some(item => item.ManagementPrecision ==
this.managementType = this.managementList.some(item => item
.ManagementPrecision ==
'BY_BATCH') ? 'BY_BATCH' : ''
}
})
@ -288,6 +285,7 @@
calcHandleQty() {
calcHandleQty(this.detailSource)
console.log(this.detailSource)
this.continueScan()
this.$forceUpdate();
},
@ -315,7 +313,17 @@
},
getScanResult(result) {
getScanResult(result, managementPrecision) {
this.managementType = managementPrecision
if (managementPrecision == 'BY_BATCH' || managementPrecision == 'BY_QUANTITY') {
this.setDataBatch(result, managementPrecision)
} else {
this.setData(result, managementPrecision)
}
},
setDataBatch(result, managementPrecision) {
console.log(877, result.balance.qty)
try {
var packingNumber = result.label.packingNumber;
var batch = result.label.batch;
@ -325,11 +333,94 @@
if (detail == undefined) {
this.showMessage("物料号【" + itemCode + "】不在列表中")
} else {
var itemDetail = detail.subList.find(r => {
return r.batch == batch
})
if (itemDetail == undefined) {
this.showErrorMessage( "批次[" + batch + "]不在列表中")
var itemDetail = ''
if (managementPrecision == 'BY_QUANTITY') {
itemDetail = detail.subList.find(r => {
return r.itemCode == result.label.itemCode
})
} else {
itemDetail = detail.subList.find(r => {
return r.batch == batch
})
}
if (itemDetail == undefined && managementPrecision != 'BY_QUANTITY') {
this.showErrorMessage("批次[" + batch + "]不在列表中")
} else {
if (itemDetail.scaned) {
// this.showMessage("" + batch + "")
itemDetail.handleQty = calc.add(itemDetail.handleQty, Number(result.label.qty));
this.calcHandleQty();
} else {
let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus);
let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus);
if (itemDetail.inventoryStatus != result.balance.inventoryStatus) {
if (this.jobContent.allowModifyInventoryStatus == "TRUE") {
this.showQuestionMessage('任务中允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' +
itemStatus +
']不一致,是否继续转移?', res => {
if (res) {
itemDetail.scaned = true;
itemDetail.handleQty = Number(result.label.qty);
itemDetail.fromInventoryStatus = result.balance.inventoryStatus;
itemDetail.balance = result.balance;
itemDetail.balance.balanceQty = Number(result.balance.qty);
itemDetail.balance.packQty = Number(result.package.packQty)
itemDetail.balance.packUnit = result.package.packUnit
this.calcHandleQty();
} else {
this.scanPopupGetFocus();
}
});
} else {
this.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' +
itemStatus +
']不一致,不允许转移!', res => {
this.scanPopupGetFocus();
});
}
} else {
itemDetail.scaned = true;
itemDetail.handleQty = Number(result.label.qty);
itemDetail.fromInventoryStatus = result.balance.inventoryStatus;
itemDetail.balance = result.balance;
itemDetail.balance.balanceQty = Number(result.balance.qty);
itemDetail.balance.packQty = Number(result.package.packQty)
itemDetail.balance.packUnit = result.package.packUnit
this.calcHandleQty();
}
}
}
}
this.scanPopupGetFocus();
} catch (e) {
this.showErrorMessage(e.message);
}
},
setData(result, managementPrecision) {
try {
var packingNumber = result.label.packingNumber;
var batch = result.label.batch;
var qty = result.label.qty;
var itemCode = result.label.itemCode;
var detail = this.detailSource.find(r => r.itemCode == itemCode);
if (detail == undefined) {
this.showMessage("物料号【" + itemCode + "】不在列表中")
} else {
var itemDetail = ''
if (managementPrecision == 'BY_QUANTITY') {
itemDetail = detail.subList.find(r => {
return r.itemCode == result.label.itemCode
})
} else {
itemDetail = detail.subList.find(r => {
return r.batch == batch
})
}
if (itemDetail == undefined && managementPrecision != 'BY_QUANTITY') {
this.showErrorMessage("批次[" + batch + "]不在列表中")
} else {
if (itemDetail.scaned) {
this.showMessage("批次【" + batch + "】已经扫描")
@ -380,23 +471,44 @@
}
},
commit() {
async commit() {
this.scanCount = getScanCount(this.subList);
if (this.scanCount == 0) {
this.showErrorMessage("扫描数为0,请先扫描")
return;
}
//
this.managementList = [];
var precisionStrategParams = this.setPrecisionStrategParams()
await getPrecisionStrategyList(precisionStrategParams, res => {
if (res.success) {
this.managementList = res.list;
this.managementType = this.managementList && this.managementList[0] && this
.managementList[0].ManagementPrecision ? this.managementList[0]
.ManagementPrecision : 'BY_PACKAGING'
console.log(11, this.managementType)
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
}
})
//
//
if (this.scanCount == this.subList.length) {
this.checkCount();
if (this.managementType == 'BY_BATCH' || this.managementType == 'BY_QUANTITY') {
this.checkCountBatch();
} else {
this.checkCount();
}
} else if (this.scanCount < this.subList.length) {
//
if (this.jobContent.allowPartialComplete == "TRUE") {
//
this.checkCount();
if (this.managementType == 'BY_BATCH' || this.managementType == 'BY_QUANTITY') {
this.checkCountBatch();
} else {
this.checkCount();
}
} else {
//
this.$refs.comMessage.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => {
@ -435,44 +547,73 @@
this.submitJob()
}
},
checkCountBatch() {
//
let str = ''
let str1 = ''
this.detailSource.forEach((item) => {
item.subList.forEach(cur => {
if (cur.scaned) {
if (cur.qty != cur.handleQty) {
var tempHandleQty = 0
if (cur.handleQty) {
tempHandleQty = cur.handleQty
} else {
tempHandleQty = 0
}
var batchHint = cur.batch ? `批次【${cur.batch}` : ``
str += `物料号【${item.itemCode}` + `${batchHint}` +
`提交数量【${tempHandleQty}】与任务物料数量【${cur.qty}】不一致\n`
if (cur.handleQty > cur.balance.balanceQty) {
str1 += `物料号【${item.itemCode}` + `${batchHint}` +
`提交数量【${ cur.handleQty}】不可以大于库存数量【${cur.balance.balanceQty}`
}
}
} else {
var batchHint = cur.batch ? `批次【${cur.batch}` : ``
str += `物料号【${item.itemCode}` + `${batchHint}` +
`提交数量【0】与任务物料数量【${cur.qty}】不一致\n`
}
})
})
if (str1) {
this.$refs.comMessage.showConfirmWarningModal(str1)
return
}
if (str) {
str = '任务明细未全部完成,是否提交?\n' + str
this.$refs.comMessage.showQuestionMessage1(str, 'red', res => {
if (res) {
this.submitJob()
}
});
} else {
this.submitJob()
}
},
submitJob() {
uni.showLoading({
title: "提交中....",
mask: true
});
//
this.managementList = [];
var precisionStrategParams = this.setPrecisionStrategParams()
getPrecisionStrategyList(precisionStrategParams, res => {
if (res.success) {
this.managementList = res.list;
var params = this.setParams()
console.log("提交" + JSON.stringify(params))
inventoryMoveSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
let showTitle = this.title
if (this.title.indexOf('任务') == this.title.length - 2) {
showTitle = this.title.replace('任务', '')
}
this.showCommitSuccessMessage("提交成功\n生成" + showTitle + "记录\n" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
var params = this.setParams()
console.log("提交" + JSON.stringify(params))
inventoryMoveSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
let showTitle = this.title
if (this.title.indexOf('任务') == this.title.length - 2) {
showTitle = this.title.replace('任务', '')
}
this.showCommitSuccessMessage("提交成功\n生成" + showTitle + "记录\n" + res.data)
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
setPrecisionStrategParams() {

2
src/pages/inventoryMove/job/inventoryMoveJob.vue

@ -119,7 +119,7 @@
if (this.checkedToday) {
filters.push({
column: "create_time",
action: "betweeen",
action: "between",
value: this.todayTime
})
}

2
src/pages/inventoryMove/record/holdToOkRecord.vue

@ -1,6 +1,6 @@
<template>
<view class="page-wraper">
<comMoveRecord :myTitle="title" businessTypeCode='HoldToOk' > </comMoveRecord>
<comMoveRecord :myTitle="title" businessTypeCode='HoldToOk' :showOnePop='true'> </comMoveRecord>
</view>
</template>

3
src/pages/inventoryMove/record/okToHoldRecord.vue

@ -1,6 +1,7 @@
<template>
<view class="page-wraper">
<comMoveRecord :myTitle="title" businessTypeCode='OkToHold' > </comMoveRecord>
<!-- <comMoveRecord :myTitle="title" businessTypeCode='OkToHold' ></comMoveRecord> -->
<comMoveRecord :myTitle="title" businessTypeCode='OkToHold' :showOnePop='true'> </comMoveRecord>
</view>
</template>

83
src/pages/issue/coms/comIssueDetailCardBatch.vue

@ -3,40 +3,30 @@
<!-- <requiredLocation title="需求库位" :locationCode="dataContent.toLocationCode"
:isShowEdit="dataContent.allowModifyLocation==1"></requiredLocation> -->
<view v-for="(item,index) in dataContent.Items">
<view>
<uni-collapse ref="collapse">
<uni-collapse-item :open="true">
<uni-collapse-item :open="true" :class="dataContent.scaned?'scan_view':''">
<template v-slot:title>
<view class="split_line"></view>
<!-- 物品 -->
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="itemCoceClick($event,item,index)"
:right-options="removeOptions">
<item-qty :dataContent="item" :handleQty="item.handleQty"></item-qty>
</uni-swipe-action-item>
</uni-swipe-action>
<!-- <com-issue-request-info :workShopCode="dataContent.workShopCode" :dataContent="dataContent">
</com-issue-request-info> -->
<item-qty :dataContent="dataContent" :handleQty="dataContent.handleQty" :isShowBalanceQty='false'></item-qty>
</template>
<view v-for="(loacation,locatonIndex) in item.Locations">
<view v-if="locatonIndex ==0">
<view class="uni-flex uni-row space-between">
<!-- 推荐库位 -->
<location :locationCode="loacation.fromLocationCode">
</location>
<uni-swipe-action ref="swipeAction" style="margin-top: 10px;"
v-for="(item,index) in dataContent.subList">
<uni-swipe-action-item
:right-options="(item.scaned&&settingParam.allowModifyQty == 'TRUE')?editAndRemoveOptions : item.scaned? removeOptions:[]" @click="itemCoceClick($event,item,index)">
<view class="" :class="item.scaned?'scan_view':''">
<recommend :detail="item" :isShowLocation="false" :isShowFromLocation="true" :isShowToLocation="settingParam.allowModifyLocation=='TRUE'"></recommend>
</view>
<view v-for="(batch,batchIndex) in loacation.Batchs">
<batch :batch="batch.detail.batch" v-if="batchIndex ==0"></batch>
</view>
</view>
</view>
</uni-swipe-action-item>
</uni-swipe-action>
</uni-collapse-item>
</uni-collapse>
</view>
</view>
<balance-qty-edit ref="balanceQtyEdit" @confirm="confirm" :isShowStatus="true"></balance-qty-edit>
<!-- <balance-qty-edit ref="balanceQtyEdit" @confirm="confirm" :isShowStatus="true"></balance-qty-edit> -->
<recommend-qty-edit ref="receiptEdit" :dataContent="editItem" :settingParam="settingParam" @confirm="confirm">
</recommend-qty-edit>
<detail-info-popup ref="detailInfoPopup"></detail-info-popup>
<comMessage ref="message"></comMessage>
</template>
@ -54,6 +44,7 @@
import detailInfoPopup from '@/pages/productionReceipt/coms/detailInfoPopup.vue'
import comIssueRequestInfo from '@/pages/issue/coms/comIssueRequestInfo.vue'
import batch from '@/mycomponents/balance/batch.vue'
import qtyEdit from '@/mycomponents/qty/qtyEdit.vue'
import {
getDetailOption,
getEditRemoveOption,
@ -73,7 +64,7 @@
location,
detailInfoPopup,
comIssueRequestInfo,
batch
batch,
},
props: {
dataContent: {
@ -84,6 +75,10 @@
type: Object,
default: {}
},
isEdit: {
type: Boolean,
default: true
},
},
watch: {
@ -97,7 +92,8 @@
batchItem: {},
detailOptions: [],
scanOptions: [],
removeOptions: []
removeOptions: [],
editAndRemoveOptions:[]
}
},
@ -105,17 +101,18 @@
this.detailOptions = getDetailOption();
this.scanOptions = getEditRemoveOption();
this.removeOptions = getRemoveOption()
this.editAndRemoveOptions = getEditRemoveOption()
console.log(888,this.dataContent)
},
methods: {
resizeCollapse() {
this.$nextTick(r => {
this.$refs.collapse.forEach(r => {
r.childrens.forEach(i => {
this.$refs.collapse.resize()
this.$refs.collapse.childrens.forEach(i => {
i.init();
})
r.resize();
})
});
},
swipeClick(e, batch,
@ -132,18 +129,19 @@
},
itemCoceClick(e, item, index) {
if (e.content.text == "移除") {
this.dataContent.Items.splice(index, 1);
this.$emit('removeItemCode')
if (e.content.text == "编辑") {
this.edit(item)
} else if (e.content.text == "移除") {
// this.dataContent.subList.splice(index, 1);
item.scaned = false
item.handleQty=0
this.$emit('updateData')
}
},
edit(batch, item) {
let that = this;
that.editItem = item;
that.batchItem = batch;
item.balance.balanceQty = item.balance.qty;
that.$refs.balanceQtyEdit.openEditPopup(item.balance, item.qty);
edit(item) {
this.editItem = item;
this.$refs.receiptEdit.openTaskEditPopup(item.qty, item.handleQty, item.labelQty);
},
detail(item) {
@ -167,13 +165,8 @@
});
},
confirm(val) {
this.editItem.qty = val;
this.editItem.handleQty = Number(val);
this.$emit('updateData', this.editItem)
// let qty = 0;
// this.batchItem.Records.forEach(r => {
// qty += Number(r.qty);
// })
// this.batchItem.handleQty = qty;
}
}
}

32
src/pages/issue/coms/comScanIssuePack.vue

@ -55,7 +55,7 @@
<view class="">
<view class="">
<win-com-scan ref="comscan" placeholder="箱标签" @getResult="onScan" :clearResult="true"
headerType="HPQ,HMQ" :isShowHistory="false">
headerType="HPQ,HMQ" :isShowHistory="false" :locationCode='locationCode'>
</win-com-scan>
<view style="width: 100%;">
@ -152,6 +152,10 @@
type: String,
default: ''
},
locationCode:{
type: String,
default: ''
}
},
data() {
return {
@ -179,7 +183,7 @@
fontSize: "100rpx"
},
bussinessCode: 'Issue',
toLocationAreaTypeList: []
toLocationAreaTypeList: [],
}
},
created() {
@ -270,7 +274,7 @@
}
},
queryBalance(result) {
queryBalance(result , managementType ) {
try {
let that = this;
// if (that.fromLocationCode == '') {
@ -281,7 +285,12 @@
// }
let packageInfo = result.package;
let itemCode = result.label.itemCode;
let packingCode = result.label.packingNumber;
let packingCode = '';
if(managementType == 'BY_BATCH' || managementType == 'BY_QUANTITY'){
packingCode = ''
} else{
packingCode = result.label.packingNumber;
}
let lot = result.label.batch;
let item = that.toLocation.Items.find(r => r.itemCode == itemCode);
if (item == undefined) {
@ -401,7 +410,7 @@
},
onScan(result) {
onScan(result, managementType) {
if (!result.package) {
this.showErrorMessage('扫描数据错误[' + result.label.code + "]",
res => {
@ -427,12 +436,12 @@
this.getToLocationBalance(result)
}
}else{
this.queryBalance(result)
this.queryBalance(result, managementType)
}
},
//
getToLocationBalance(result) {
getToLocationBalance(result, managementType) {
uni.showLoading({
title: '查询中',
mask: true
@ -470,7 +479,7 @@
// value: this.toLocationAreaTypeList.join(',')
// })
this.queryBalance(result);
this.queryBalance(result, managementType);
// var params = {
// filters: filters,
// pageNo: 1,
@ -916,9 +925,8 @@
if (item != undefined) {
item.Locations.forEach(l => {
let batch = l.Batchs.find(b => b.packingNumber == record.packingNumber && b
let batch = l.Batchs.find(b => b
.batch == record.batch);
if (batch && batch.Records && batch.Records.length > 0) {
let rIndex = batch.Records.findIndex(r => r.packingNumber == record
.packingNumber && r.batch == record.batch);
@ -931,7 +939,9 @@
}
});
},
clearList(){
this.issueRecord=[]
},
packGetFocus() {
if (this.$refs.comscan) {
this.$refs.comscan.getfocus();

30
src/pages/issue/job/issueDetail.vue

@ -15,18 +15,11 @@
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
<view v-for="(toLocation, index) in detailSource">
<!-- <work-station :workshopCode="jobContent.workShopCode"
:productionLineCode="toLocation.productionLineCode"
:workStationCode="toLocation.workStationCode" :rawLocationCode="toLocation.toLocationCode">
</work-station> -->
<comIssueDetailCardBatch ref='comIssueDetailCard' :dataContent="toLocation" :settingParam="jobContent"
@updateData='updateData' v-if="managementType == 'BY_BATCH'">
</comIssueDetailCardBatch>
<com-issue-detail-card
ref='comIssueDetailCard'
:dataContent="toLocation"
:settingParam="jobContent"
@updateData='updateData' v-else>
@updateData='updateData'>
</com-issue-detail-card>
<view class="split_line"></view>
</view>
@ -230,8 +223,7 @@
getManagementPrecisions(itemCodes, that.fromLocationCode, res => {
if (res.success) {
this.managementList = res.list;
this.managementType = this.managementList.some(item => item.ManagementPrecision ==
'BY_BATCH') ? 'BY_BATCH' : ''
this.managementType = this.managementList&&this.managementList[0]&&this.managementList[0].ManagementPrecision ? this.managementList[0].ManagementPrecision : 'BY_PACKAGING'
}
})
setTimeout(r => {
@ -475,6 +467,24 @@
//
this.$throttle(this.submit, 2000, this)()
} else {
// let record = this.creatRecord(label, balance, packageInfo);
// batch.Records.push(record);
// this.issueRecord.unshift(record)
// this.calcBatchHandleQty(batch);
// this.getfocus();
// this.$emit("afterScan");
this.detailSource.forEach(detail => {
detail.Items.forEach(item => {
taskQty =calc.add(taskQty,item.qty)
item.Locations.forEach(lco => {
lco.Batchs.forEach(batch => {
batch.Records = []
})
})
})
})
this.$refs.comScanIssuePack.clearList()
this.scanPopupGetFocus()
}
});

828
src/pages/issue/job/issueDetailBatch.vue

@ -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>

52
src/pages/issue/job/issueJob.vue

@ -25,7 +25,7 @@
<uni-load-more :status="loadingType" v-if="jobList.length>0" />
</view>
<win-scan-button @goScan='openScanPopup' v-if="jobList.length>0"></win-scan-button>
<win-scan-button @goScan='openScanPopup' v-if="manageModel!='BY_BATCH'&&jobList.length>0"></win-scan-button>
<winComScanBalance ref="scanPopup" @getBalance='getScanResult' :bussinessCode="businessTypeCode">
</winComScanBalance>
<!-- <winScanPackJob ref="scanPopup" @getResult='getScanResult'></winScanPackJob> -->
@ -61,6 +61,11 @@
getDetailGiveupOption,
getDetailCloseOption
} from '@/common/array.js';
import {
getManagementPrecisions
} from '@/common/balance.js';
import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
import jobFilter from '@/mycomponents/job/jobFilter.vue'
@ -109,7 +114,8 @@
businessTypeCode: "Issue",
businessType: null,
timer: null,
productionLineCode:""
productionLineCode:"",
manageModel:import.meta.env.VITE_MANAGE_MODEL
};
},
onLoad(option) {
@ -239,6 +245,9 @@
uni.hideLoading();
if (type === "refresh") {
uni.stopPullDownRefresh();
if(this.manageModel!='BY_BATCH'){
this.openScanPopup()
}
}
var list = res.data.list;
@ -255,9 +264,7 @@
if (type === "refresh") {
uni.stopPullDownRefresh();
}
if(this.jobList.length>0){
this.openScanPopup()
}
}).catch(error => {
if (type === "refresh") {
uni.stopPullDownRefresh();
@ -282,7 +289,7 @@
if (queryParams.creationTime ) {
filterParams.push({
column: "create_time",
action: "betweeen",
action: "between",
value: queryParams.creationTime
})
}
@ -355,8 +362,7 @@
openJobDetail(item, scanMessage = '') {
this.getJobInfoByNumber(item.number, scanMessage)
this.getJobInfoByNumber(item, scanMessage)
},
showItemList(itemList) {
@ -433,7 +439,7 @@
})
},
getJobInfoByNumber(number, scanMessage) {
getJobInfoByNumber(item, scanMessage) {
let that = this;
uni.showLoading({
title: "加载中....",
@ -448,7 +454,7 @@
filters.push({
column: "number",
action: "==",
value: number
value: item.number
})
var params = {
@ -475,11 +481,27 @@
return;
}
uni.navigateTo({
url: './issueDetail?id=' + result.masterId + '&status=' + result.status +
'&scanMessage=' +
scanMessage + '&title=' + this.title
});
getManagementPrecisions([item.itemCode], item.fromLocationCode, res => {
if (res.success) {
this.managementList = res.list;
this.managementType = this.managementList&&this.managementList[0]&&this.managementList[0].ManagementPrecision
if(this.managementType == 'BY_BATCH'||this.managementType == 'BY_QUANTITY'){
uni.navigateTo({
url: './issueDetailBatch?id=' + result.masterId + '&status=' + result.status +
'&scanMessage=' +
scanMessage + '&title=' + this.title
});
}else{
uni.navigateTo({
url: './issueDetail?id=' + result.masterId + '&status=' + result.status +
'&scanMessage=' +
scanMessage + '&title=' + this.title
});
}
}
})
this.scanMessage = ""
}
}).catch(error => {

4
src/pages/issue/job/issueJob0816.vue

@ -234,7 +234,7 @@
if (this.checkedToday) {
filters.push({
column: "create_time",
action: "betweeen",
action: "between",
value: this.todayTime
})
}
@ -333,7 +333,7 @@
// if (this.checkedToday) {
// filters.push({
// column: "create_time",
// action: "betweeen",
// action: "between",
// value: this.todayTime
// })
// }

12
src/pages/issue/record/directIssue.vue

@ -1,7 +1,7 @@
<template>
<view class="page-wraper">
<view class="">
<com-blank-view @goScan='getBusinessType' v-if="detailSource.length==0"></com-blank-view>
<com-blank-view @goScan='showFromLocationPopup' v-if="detailSource.length==0"></com-blank-view>
</view>
<view class="page-wraper" v-if="detailSource.length>0">
@ -177,7 +177,7 @@
this.businessType = res.businessType;
this.fromInventoryStatuses = getDirectoryItemArray(res.fromInventoryStatuses);
this.fromLocationAreaTypeList = res.fromLocationAreaTypeList
this.openScanPopup();
this.showFromLocationPopup();
} else {
this.showErrorMessage(res.message)
}
@ -395,11 +395,11 @@
},
openScanPopup() {
if (this.businessType) {
this.$refs.scanPopup.openScanPopup(this.businessType);
} else {
this.getBusinessType()
if (this.fromLocationCode == "") {
this.showFromLocationPopup();
return
}
this.$refs.scanPopup.openScanPopup(this.businessType);
},
showFromLocationPopup() {

569
src/pages/issue/record/directIssueByBatch.vue

@ -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>

2
src/pages/itemHold/record/recordList.vue

@ -146,7 +146,7 @@
if (this.queryParams.creationTime) {
filterParams.push({
column: "create_time",
action: "betweeen",
action: "between",
value: this.queryParams.creationTime
})
}

391
src/pages/label/record/splitLabel.vue

@ -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>

2
src/pages/login/index.vue

@ -132,7 +132,7 @@
storage.clearStorage()
if (process.env.NODE_ENV === 'development') {
this.username = "admin"
this.password = "win123456";
this.password = "CD_win09";
}
uni.setNavigationBarColor({
frontColor: '#ffffff',

2
src/pages/package/job/overPackageJob.vue

@ -190,7 +190,7 @@
if (queryParams.creationTime ) {
filterParams.push({
column: "create_time",
action: "betweeen",
action: "between",
value: queryParams.creationTime
})
}

2
src/pages/productDismantle/job/productDismantleJob.vue

@ -132,7 +132,7 @@
if (this.checkedToday) {
filters.push({
column: "create_time",
action: "betweeen",
action: "between",
value: this.todayTime
})
}

20
src/pages/productPutaway/job/productPutawayDetail.vue

@ -271,7 +271,7 @@
},
updateData() {
// this.calcHandleQty();
this.calcHandleQty();
},
openDetail(item) {
@ -334,15 +334,20 @@
var locationCode = result.balance.locationCode;
var inventoryStatus = result.balance.inventoryStatus;
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) {
let itemDetail = ''
this.detailSource.find(item => {
const itemDetail1 = item.subList.find(r => {
return r.batch == result.label.batch && r.fromLocationCode == result.fromLocationCode
})
if(itemDetail1){
itemDetail = itemDetail1
}
console.log(99,itemDetail1)
});
if (!itemDetail) {
this.showErrorMessage("批次【" + batch + "】库位【" + result
.fromLocationCode + "】不在列表中")
} else {
@ -379,6 +384,7 @@
}
}
} catch (e) {
console.log(2333,e)
this.showMessage(e.message)
}
},

2
src/pages/productPutaway/job/productPutawayJob.vue

@ -161,7 +161,7 @@
if (this.checkedToday) {
filters.push({
column: "create_time",
action: "betweeen",
action: "between",
value: this.todayTime
})
}

48
src/pages/productPutaway/record/fgDirectPutawayByBatch.vue

@ -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>

651
src/pages/productPutaway/record/productPutawayRecordByBatch.vue

@ -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>

48
src/pages/productPutaway/record/semiDirectPutawayByBatch.vue

@ -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>

114
src/pages/productReceipt/coms/comProductDetailCardBatch.vue

@ -1,31 +1,28 @@
<template>
<view class="" style="background-color: #fff;">
<uni-collapse ref="collapse1" @change="">
<uni-collapse-item :open="true">
<template v-slot:title>
<itemCompareQty :dataContent="dataContent" :handleQty="dataContent.handleQty"></itemCompareQty>
<view class="" v-for="(item,index) in dataContent.subList" :key="index" >
<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,'parent')">
<!-- <div style="display: flex;">
<div style="flex: 1;">
<batch v-if="item.batch" :batch="item.batch"></batch>
<to-location title="目标库位" :locationCode="item.toLocationCode">
</to-location>
</div>
<text style="font-size: 30rpx;color: #2979ff; " @click="copy(item)" v-if="isDevlement()">复制</text>
</div> -->
<recommendBatch :detail="item" :isShowFromLocation="false"
:isShowToLocation="settingParam.allowModifyLocation=='TRUE'"></recommendBatch>
</uni-swipe-action-item>
</uni-swipe-action>
<view v-if="item.fgList!=undefined && item.fgList.length>0" class="card_view " style="margin-left: 20px;"
v-for="(fg, index) in item.fgList" :key="index">
<com-fg-card :detail='fg' class="scan_view"></com-fg-card>
</view>
</view>
</template>
<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?scanOptions:detailOptions">
<recommend :detail="item" :isShowFromLocation="false"
:isShowToLocation="settingParam.allowModifyLocation=='TRUE'"></recommend>
</uni-swipe-action-item>
</uni-swipe-action>
<view v-if="item.fgList!=undefined && item.fgList.length>0" class="card_view "
style="margin-left: 20px;" v-for="(fg, index) in item.fgList" :key="index">
<com-fg-card :detail='fg' class="scan_view"></com-fg-card>
</view>
</view>
</uni-collapse-item>
</uni-collapse>
<recommend-qty-edit ref="receiptEdit" :dataContent="editItem" :settingParam="settingParam" @confirm="confirm">
<recommend-qty-edit ref="receiptEdit" :dataContent="editItem" :settingParam="settingParam" @confirm="confirm" :isNumTips='isNumTips'>
</recommend-qty-edit>
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation'
:locationAreaTypeList="locationAreaTypeList"></win-scan-location>
@ -36,36 +33,27 @@
<script>
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue'
import recommendBatch from '@/mycomponents/recommend/recommendBatch.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import recommendQtyEdit from '@/mycomponents/qty/recommendQtyEdit.vue'
import jobDetailPopup from '@/mycomponents/detail/jobDetailPopup.vue'
import productDetailInfoPopup from '@/pages/productReceipt/coms/productDetailInfoPopup.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import comFgCard from "@/pages/productReceipt/coms/comFgCard.vue"
import pack from '@/mycomponents/balance/pack.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
getDetailOption,
getPurchaseReceiptOption
} from '@/common/array.js';
export default {
components: {
itemCompareQty,
recommendBatch,
recommend,
recommendQtyEdit,
jobDetailPopup,
productDetailInfoPopup,
winScanLocation,
comFgCard,
pack,
location,
toLocation,
batch
comFgCard
},
props: {
dataContent: {
@ -80,7 +68,7 @@
type: Array,
default: null
},
isEdit: {
isNumTips: {
type: Boolean,
default: true
},
@ -112,17 +100,18 @@ isEdit: {
},
locatonItem: {},
detailOptions: [],
scanOptions: [],
options: [],
removeOptions: [],
editAndRemoveOptions: []
scanOptions: []
}
},
mounted() {
this.removeOptions = getRemoveOption();
this.editAndRemoveOptions = getEditRemoveOption()
if (this.detailOptions.length == 0) {
this.detailOptions = getDetailOption();
}
if (this.scanOptions.length == 0) {
this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, this.settingParam
.allowModifyLocation)
}
},
methods: {
@ -161,7 +150,7 @@ isEdit: {
if (res) {
item.scaned = false
item.handleQty = null
item.fgList = []
item.fgList=[]
this.$forceUpdate()
this.$emit('remove', item)
}
@ -170,36 +159,7 @@ isEdit: {
confirm(qty) {
this.editItem.handleQty = qty;
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>

171
src/pages/productReceipt/coms/comProductRecordBatch.vue

@ -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>

2
src/pages/productReceipt/job/ccProductReceiptJob.vue

@ -152,7 +152,7 @@
if (this.checkedToday) {
filters.push({
column: "create_time",
action: "betweeen",
action: "between",
value: this.todayTime
})
}

2
src/pages/productReceipt/job/completeReceiveJob.vue

@ -131,7 +131,7 @@
if (this.checkedToday) {
filters.push({
column: "create_time",
action: "betweeen",
action: "between",
value: this.todayTime
})
}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save