liuchen 10 months ago
parent
commit
582c17f3de
  1. 16
      api/index.js
  2. 6
      api/request.js
  3. 60
      api/request2.js
  4. 15
      common/balance.js
  5. 6
      common/basic.js
  6. 8
      common/calc.js
  7. 8
      common/classify.data.js
  8. 140
      common/detail.js
  9. 49
      common/directory.js
  10. 36
      common/record.js
  11. 8
      common/scan.js
  12. 4
      common/style/new_style.css
  13. 8
      common/style/pdabasic.css
  14. 6
      mycomponents/balance/handleBalance.vue
  15. 10
      mycomponents/balance/recommendBalance.vue
  16. 2
      mycomponents/detail/comDetailCard.vue
  17. 4
      mycomponents/item/itemDetailInfo.vue
  18. 14
      mycomponents/item/itemQty.vue
  19. 6
      mycomponents/item/itemSelect.vue
  20. 6
      mycomponents/package/packageDetailPopup.vue
  21. 6
      mycomponents/partCode/partCodeSelect.vue
  22. 40
      mycomponents/popup/selectList.vue
  23. 70
      mycomponents/qty/CountQtyEdit.vue
  24. 2
      mycomponents/qty/balanceQty.vue
  25. 24
      mycomponents/qty/balanceQtyEdit.vue
  26. 33
      mycomponents/qty/compareQty.vue
  27. 26
      mycomponents/qty/recommendQtyEdit.vue
  28. 2
      mycomponents/recommend/recommend.vue
  29. 13
      mycomponents/recommend/recommendCount.vue
  30. 10
      mycomponents/record/recordComDetailCard.vue
  31. 33
      mycomponents/scan/winComScan.vue
  32. 99
      mycomponents/scan/winScanItem.vue
  33. 134
      mycomponents/scan/winScanPackAndLocation.vue
  34. 16
      mycomponents/scan/winScanPackAndPosition.vue
  35. 3
      mycomponents/status/balanceStatus.vue
  36. 10
      mycomponents/workStation/workStation.vue
  37. 20
      pages.json
  38. 2
      pages/container/coms/comContainerBindCard.vue
  39. 4
      pages/container/coms/comPalletRecord.vue
  40. 6
      pages/container/record/containerBindRecord.vue
  41. 8
      pages/container/record/containerUnBindRecord.vue
  42. 27
      pages/count/coms/comCountDetailCard.vue
  43. 797
      pages/count/job/countDetail.vue
  44. 43
      pages/count/record/countRecord.vue
  45. 4
      pages/customerReturn/coms/comReturnRecord.vue
  46. 8
      pages/customerReturn/job/returnDetail.vue
  47. 7
      pages/customerReturn/record/returnRecord.vue
  48. 76
      pages/customerReturn/request/customerReturnRequestCreate.vue
  49. 46
      pages/deliver/coms/comDeliverRequestPopup.vue
  50. 97
      pages/deliver/coms/comScanDeliverPack.vue
  51. 59
      pages/deliver/job/deliverDetail.vue
  52. 5
      pages/deliver/record/deliverRecord.vue
  53. 8
      pages/deliver/request/deliverRequestCreate.vue
  54. 12
      pages/demo/demo.vue
  55. 2
      pages/index/index.vue
  56. 34
      pages/inspect/coms/inspectEdit.vue
  57. 22
      pages/inspect/job/inspectDetail.vue
  58. 53
      pages/inspect/job/inspectFullDetail.vue
  59. 8
      pages/inspect/job/inspectResult.vue
  60. 4
      pages/inventoryMove/coms/comMoveRecord.vue
  61. 17
      pages/inventoryMove/coms/comMoveRecordCard.vue
  62. 8
      pages/inventoryMove/job/inventoryMoveDetail.vue
  63. 2
      pages/issue-按批次推荐/coms/comIssueJobCard.vue
  64. 2
      pages/issue-按批次推荐/coms/comScanIssuePack.vue
  65. 12
      pages/issue-按批次推荐/job/issueDetail.vue
  66. 25
      pages/issue/coms/comIssueDetailCard.vue
  67. 37
      pages/issue/coms/comIssueRequestCreator.vue
  68. 271
      pages/issue/coms/comIssueRequestPopup.vue
  69. 38
      pages/issue/coms/comScanIssuePack.vue
  70. 100
      pages/issue/job/issueDetail.vue
  71. 9
      pages/issue/js/issue.js
  72. 140
      pages/issue/record/issueRecord.vue
  73. 65
      pages/issue/request/issueRequestCreate.vue
  74. 2
      pages/package/coms/comOverRecord.vue
  75. 2
      pages/package/coms/comPackageRecord.vue
  76. 10
      pages/package/record/mergePackageRecord.vue
  77. 2
      pages/package/record/overPackageRecord.vue
  78. 20
      pages/package/record/splitPackageRecord.vue
  79. 2
      pages/productDismantle/coms/comProductJobCard.vue
  80. 2
      pages/productDismantle/coms/comProductRecord.vue
  81. 198
      pages/productPutaway/coms/comProductRecord.vue
  82. 4
      pages/productPutaway/coms/comPutawayRequestCard.vue
  83. 6
      pages/productPutaway/job/productPutawayDetail.vue
  84. 2
      pages/productPutaway/record/productPutawayRecord.vue
  85. 2
      pages/productPutaway/request/putawayRequest.vue
  86. 30
      pages/productPutaway/request/putawayRequestCreate.vue
  87. 4
      pages/productPutaway/request/putawayRequestDetail.vue
  88. 2
      pages/productReceipt/coms/comProductRecord.vue
  89. 8
      pages/productReceipt/job/productReceiptDetail.vue
  90. 31
      pages/productReceipt/record/productReceiptRecord.vue
  91. 2
      pages/productionReceipt/coms/comProductionRecord.vue
  92. 35
      pages/productionReceipt/job/productionReceiptDetail.vue
  93. 1
      pages/productionReceipt/record/productionReceiptRecord.vue
  94. 8
      pages/productionReturn/coms/comReturn.vue
  95. 14
      pages/productionReturn/coms/comReturnCommonRequest.vue
  96. 15
      pages/productionReturn/coms/comReturnRecord.vue
  97. 35
      pages/productionReturn/coms/comReturnRequestCreator.vue
  98. 95
      pages/productionReturn/coms/comReturnRequestPopup.vue
  99. 65
      pages/productionReturn/coms/comScanReturnPack.vue
  100. 8
      pages/productionReturn/job/returnDetail.vue

16
api/index.js

@ -140,14 +140,14 @@ export const getBalancesAsync = (params) => promise(
});
//根据零件、箱码、托码、批次、库位类型、库存状态查询库存
//根据物料、箱码、托码、批次、库位类型、库存状态查询库存
export const getBalancesByFilter = (params) => request(
devUrl + "/api/pda/inventory/balances/by-balances-request-many-parameter", {
method: 'post',
data: params
});
//根据零件、箱码、托码、批次、库位类型、库存状态查询库存
//根据物料、箱码、托码、批次、库位类型、库存状态查询库存
export const getBalancesByFilterAsync = (params) => promise(
devUrl + "/api/pda/inventory/balances/by-balances-request-many-parameter", {
method: 'post',
@ -170,7 +170,7 @@ export const getBalancesByStatus = (params) => request(
data: params
});
//根据库位和零件号查询库存
//根据库位和物料号查询库存
export const getBalancesByLocationAndItem = (params) => request(
devUrl + "/api/pda/inventory/balances/get-by-location-and-item?locationCode=" + params.locationCode +
"&itemCode=" + params.itemCode, {
@ -179,7 +179,7 @@ export const getBalancesByLocationAndItem = (params) => request(
});
//根据库位和零件号查询库存
//根据库位和物料号查询库存
export const getBalancesByLocationAndItemAsync = (params) => promise(
devUrl + "/api/pda/inventory/balances/get-by-location-and-item?locationCode=" + params.locationCode +
"&itemCode=" + params.itemCode, {
@ -203,15 +203,15 @@ export const summary = (params) => request(
data: params
});
//零件
//查询零件信息
//物料
//查询物料信息
export const getitems = (code) => request(
devUrl + "/api/pda/item/" + code, {
method: 'get',
data: code
});
//根据库位查询零件
//根据库位查询物料
export const getItemsByLocation = (params) => promise(
devUrl + "/api/pda/inventory/balances/get-item-by-location", {
method: 'get',
@ -427,7 +427,7 @@ export const locationByType = (type) => request(
data: type
});
//根据库位查询零件
//根据库位查询物料
export const getLocationByItem = (params) => promise(
devUrl + "/api/pda/inventory/balances/get-location-by-item", {
method: 'get',

6
api/request.js

@ -481,7 +481,7 @@ export function getPurchaseReturnRequestList(params) {
/**
* 原料上架
* 采购上架
* @param {*}
* status 任务状态
* CreationTimeStart 开始日期
@ -500,7 +500,7 @@ export function getPutawayJobList(params) {
/**
*
* @param {*} id 任务id
* 原料上架获取任务明细
* 采购上架获取任务明细
*/
export function putawayGetJobDetail(id) {
return request({
@ -511,7 +511,7 @@ export function putawayGetJobDetail(id) {
}
/**
/**
*
* @param {*} number 任务编号
* 按任务编号查询任务

60
api/request2.js

@ -96,6 +96,19 @@ export function updateUserPwd(oldPassword, newPassword) {
})
}
/**
* 获取仓库代码
* @param {*}
*
*/
export function getWarehouseCodeList(pageNo,pageSize) {
return request({
url: baseApi + "/wms/warehouse/page?pageNo="+pageNo+"&pageSize="+pageSize,
method: "get",
data: {},
});
}
/**
* 获取消息列表
* @param {*}
@ -375,7 +388,7 @@ export function getBasicLocationByCode(code) {
/**
* 校验库位零件关系
* 校验库位物料关系
* @param {*}
*
*/
@ -968,7 +981,7 @@ export function inspectJobSubmit(params) {
/**
* 原料上架 任务
* 采购上架 任务
* status 任务状态
* 开始日期
* 结束日期
@ -984,7 +997,7 @@ export function getPutawayJobList(params) {
}
/**
* 原料上架 获取任务明细
* 采购上架 获取任务明细
* @param {*} id 任务id
*
*/
@ -997,7 +1010,7 @@ export function getPutawayJobDetail(id) {
}
/**
* 原料上架 承接任务
* 采购上架 承接任务
* @param {*} id
*
*/
@ -1010,7 +1023,7 @@ export function takePutawayJob(id) {
}
/**
* 原料上架 放弃承接
* 采购上架 放弃承接
* @param {*} id
*
*/
@ -1023,7 +1036,7 @@ export function cancleTakePutawayJob(id) {
}
/**
* 原料上架 任务提交
* 采购上架 任务提交
* @param {*} params
*/
export function putawayJobSubmit(params) {
@ -1035,7 +1048,7 @@ export function putawayJobSubmit(params) {
}
/**
* 原料上架申请 获取任务列表
* 采购上架申请 获取任务列表
* 任务状态
* 开始日期
* 结束日期
@ -1051,7 +1064,7 @@ export function getPutawayRequestList(params) {
}
/**
* 原料上架申请 获取任务明细
* 采购上架申请 获取任务明细
* @param {*} id 任务id
*
*/
@ -1064,7 +1077,7 @@ export function getPutawayRequestDetail(id) {
}
/**
* 原料上架申请 提交
* 采购上架申请 提交
* @param {*} params
*/
export function putawayRequestSubmit(params) {
@ -1076,7 +1089,7 @@ export function putawayRequestSubmit(params) {
}
/**
* 原料上架申请 关闭任务
* 采购上架申请 关闭任务
* @param {*} params
*/
export function putawayRequestClose(id) {
@ -1088,7 +1101,7 @@ export function putawayRequestClose(id) {
}
/**
* 原料上架申请 提交审批
* 采购上架申请 提交审批
* @param {*} params
*/
export function putawayRequestApprove(id) {
@ -1100,7 +1113,7 @@ export function putawayRequestApprove(id) {
}
/**
* 原料上架申请 提交审批通过
* 采购上架申请 提交审批通过
* @param {*} params
*/
export function putawayRequestApproveAgree(id) {
@ -1112,7 +1125,7 @@ export function putawayRequestApproveAgree(id) {
}
/**
* 原料上架申请 审批驳回
* 采购上架申请 审批驳回
* @param {*} params
*/
export function putawayRequestApproveRefused(id) {
@ -1124,7 +1137,7 @@ export function putawayRequestApproveRefused(id) {
}
/**
* 原料上架申请 处理
* 采购上架申请 处理
* @param {*} params
*/
export function putawayRequestHandle(id) {
@ -1136,7 +1149,7 @@ export function putawayRequestHandle(id) {
}
/**
* 原料上架申请 重新添加
* 采购上架申请 重新添加
* @param {*} params
*/
export function putawayRequestAddAgain(id) {
@ -1150,7 +1163,7 @@ export function putawayRequestAddAgain(id) {
/**
* 原料上架记录 提交
* 采购上架记录 提交
* @param {*} params
*/
export function putawayRecordSubmit(params) {
@ -3509,7 +3522,7 @@ export function getBalanceByFilter(param) {
}
/**
* 查询管理精度多个零件多个库位
* 查询管理精度多个物料多个库位
* @param {*}
*
*/
@ -3537,6 +3550,19 @@ export function deleteFileById(id) {
});
}
/**
* 删除文件(多个文件)
* @param {*}
*
*/
export function deleteFileByTable(tableName, tableId) {
return request({
url: baseApi + "/infra/file/deleteByTable?tableName=" + tableName + "&tableId=" + tableId,
method: "delete",
data: {},
});
}
/**
* 获取文件列表

15
common/balance.js

@ -263,6 +263,11 @@ export function byBatch(label, locationCode, fromInventoryStatuses, callback) {
action: "==",
value: label.batch
})
filters.push({
column: "packingNumber",
action: "==",
value: null
})
filters.push({
column: "locationCode",
action: "==",
@ -325,6 +330,16 @@ export function byQuantity(label, locationCode, fromInventoryStatuses, callback)
action: "==",
value: label.itemCode
})
filters.push({
column: "packingNumber",
action: "==",
value: null
})
filters.push({
column: "batch",
action: "==",
value: null
})
filters.push({
column: "locationCode",
action: "==",

6
common/basic.js

@ -476,7 +476,7 @@ export function getInspectReasonList(value) {
// else return '其他'
// }
// //零件状态
// //物料状态
// export function getItemStatusStyle(val) {
// if (val == "wpztUNK") return 'item_unk'
// else if (val == "wpztENABLE") return 'item_active'
@ -498,7 +498,7 @@ export function getInspectReasonList(value) {
// }
// //零件状态描述
// //物料状态描述
// export function getItemStatusDesc(val) {
// if (val == "wpztUNK") return '未知'
// else if (val == "wpztENABLE") return '可用'
@ -541,7 +541,7 @@ export function getInspectReasonList(value) {
// if (val == 0) return '未知'
// else if (val == 1) return '库位盘点'
// else if (val == 2) return '物品盘点'
// else if (val == 3) return '库位零件盘点'
// else if (val == 3) return '库位物料盘点'
// else return '其他'
// }

8
common/calc.js

@ -2,16 +2,16 @@
import { Decimal } from 'decimal.js';//引入
class Calc {
add(num1,num2) {
return new Decimal(num1).add(new Decimal(num2))
return new Decimal(num1).add(new Decimal(num2)).toNumber()
}
sub(num1,num2) {
return new Decimal(num1).sub(new Decimal(num2))
return new Decimal(num1).sub(new Decimal(num2)).toNumber()
}
mul(num1,num2) {
return new Decimal(num1).mul(new Decimal(num2))
return new Decimal(num1).mul(new Decimal(num2)).toNumber()
}
div(num1,num2) {
return new Decimal(num1).div(new Decimal(num2))
return new Decimal(num1).div(new Decimal(num2)).toNumber()
}
}
export const calc = new Calc();

8
common/classify.data.js

@ -1,7 +1,7 @@
export default [{
"name": "库存查询",
"children": [{
"name": "按零件查询库存",
"name": "按物料查询库存",
"icon": "/static/menus/menu_search_lj.svg",
"url": "pages/query/item",
"index": 1,
@ -55,13 +55,13 @@ export default [{
},
{
"name": "原料上架任务",
"name": "采购上架任务",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/putaway/job/putawayJob",
"index": 3,
},
{
"name": "原料上架记录",
"name": "采购上架记录",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/putaway/record/putawayRecord",
"index": 3,
@ -309,7 +309,7 @@ export default [{
"index": 8,
},
{
"name": "原料上架申请",
"name": "采购上架申请",
"icon": "/static/menus/menu_search_lj.svg",
"url": "/pages/putaway/request/putawayRequest",
"index": 8,

140
common/detail.js

@ -1,77 +1,83 @@
import { calc } from '@/common/calc'
export function getDataSource(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;
}
import {
calc
} from '@/common/calc'
export function createItemInfo(detail) {
let item = {
itemCode: detail.itemCode,
itemName: detail.itemName,
stdPackQty: Number(detail.stdPackQty)||undefined,
stdPackUnit: detail.stdPackUnit,
qty: Number(detail.qty),
handleQty: 0,
uom: detail.uom,
subList: []
import { Decimal } from 'decimal.js';//引入
export function getDataSource(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;
}
export function createItemInfo(detail) {
let item = {
itemCode: detail.itemCode,
itemName: detail.itemName,
stdPackQty: Number(detail.stdPackQty) || undefined,
stdPackUnit: detail.stdPackUnit,
qty: Number(detail.qty),
handleQty: 0,
uom: detail.uom,
subList: []
}
return item;
}
return item;
}
export function createDetailInfo(data) {
data.scaned = false;
// data.record = {};
let detail = data;
return detail;
}
export function createDetailInfo(data) {
data.scaned = false;
// data.record = {};
let detail = data;
return detail;
}
//根据明细创建记录
export function createRecordInfo(detail, balance) {
var record = {}
// let record = JSON.parse(JSON.stringify(detail));
//克隆对象,深度克隆,防止双向绑定同一个变量
Object.assign(record, detail)
detail.scaned = true;
detail.balance = balance;
detail.recommendInventoryStatus = detail.inventoryStatus;
detail.inventoryStatus = balance.inventoryStatus;
record.qty = Number(balance.qty);
return record;
}
//根据明细创建记录
export function createRecordInfo(detail, balance) {
var record = {}
// let record = JSON.parse(JSON.stringify(detail));
//克隆对象,深度克隆,防止双向绑定同一个变量
Object.assign(record, detail)
detail.scaned = true;
detail.balance = balance;
detail.recommendInventoryStatus = detail.inventoryStatus;
detail.inventoryStatus = balance.inventoryStatus;
record.qty = Number(balance.qty);
return record;
}
//计算实际数量
export function calcHandleQty(detailSource) {
for (let item of detailSource) {
item.handleQty = 0;
for (let detail of item.subList) {
if (detail != undefined && detail.scaned) {
item.handleQty += Number(detail.handleQty)
//计算实际数量
export function calcHandleQty(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 && detail.scaned) {
item.handleQty = calc.add(item.handleQty,detail.handleQty);
item.qty = calc.add(item.qty,detail.qty);
}
}
}
}
}
export function getScanCount(subList) {
let items = subList.filter(r => {
if (r.scaned) {
return r;
}
})
let scanCount = items != null ? items.length : 0;
return scanCount;
}
export function getScanCount(subList) {
let items = subList.filter(r => {
if (r.scaned) {
return r;
}
})
let scanCount = items != null ? items.length : 0;
return scanCount;
}

49
common/directory.js

@ -1,5 +1,6 @@
let jobStatusList = [];
let itemStatusList = [];
let itemTypeList =[];
let locationTypeList = [];
let uomList = [];
let inventoryStatusList = [];
@ -39,6 +40,7 @@ export function getBusinessTypeDesc(type) {
export function clearCacheData() {
jobStatusList = [];
itemStatusList = [];
itemTypeList =[];
locationTypeList = [];
uomList = [];
inventoryStatusList = [];
@ -143,16 +145,57 @@ export function getJobStateStyle(value) {
}
}
//获取库位描述
export function getListLocationTypeDesc(lst) {
//获取库位描述(多个库位)
export function getListLocationTypeDesc(list) {
let desc = '';
lst.forEach(res => {
list.forEach(res => {
desc += getLocationTypeInfo(res).label + ","
})
desc = desc.slice(0, -1);
return desc;
}
//获取物品状态(多个状态)
export function getListItemStateDesc(list) {
let desc = '';
list.forEach(res => {
desc += getItemStateInfo(res).label + ","
})
desc = desc.slice(0, -1);
return desc;
}
//获取物品类型(多个)
export function getListItemTypeDesc(list) {
let desc = '';
list.forEach(res => {
desc += getItemTypeInfo(res).label + ","
})
desc = desc.slice(0, -1);
return desc;
}
//获取物品类型
export function getItemTypeInfo(value) {
var resultInfo = "";
if (itemTypeList.length == 0) {
itemTypeList = getDirectoryInfo("item_type")
}
if (itemTypeList.length > 0) {
for (let item of itemTypeList) {
if (item.value == value) {
resultInfo = item
break;
}
}
}
return resultInfo
}
//获取物品状态
export function getItemStateInfo(value) {
var resultInfo = "";

36
common/record.js

@ -6,6 +6,10 @@ import {
getDirectoryItemArray,
} from '@/common/directory.js';
import { calc } from '@/common/calc'
import { Decimal } from 'decimal.js';//引入
import {
deepCopyData
} from '@/common/basic.js';
export function createItemInfo(balance, pack) {
let item = {
@ -13,24 +17,24 @@ export function createItemInfo(balance, pack) {
itemName: pack.itemName,
stdPackQty: pack.stdPackQty,
stdPackUnit: pack.stdPackUnit,
qty: Number(balance.qty),
handleQty: 0,
qty: new Decimal(balance.qty).toNumber(),
handleQty:new Decimal(0).toNumber(),
uom: pack.uom,
subList: []
}
return item;
}
export function createDetailInfo(data, pack) {
data.scaned = true;
export function createDetailInfo(balance, pack) {
balance.scaned = true;
// data.toInventoryStatus = this.toInventoryStatus == "" ? data.inventoryStatus : this.toInventoryStatus;
// data.inventoryStatus = data.inventoryStatus;
let detail = {};
Object.assign(detail, data)
detail.balanceQty = Number(detail.qty)
detail.stdPackQty = Number(pack.stdPackQty)
let detail = deepCopyData(balance);
detail.balanceQty = new Decimal(detail.qty).toNumber()
detail.qty = new Decimal(detail.qty).toNumber();
detail.stdPackQty = new Decimal(pack.stdPackQty).toNumber()
detail.stdPackUnit = pack.stdPackUnit
detail.handleQty =0;
detail.handleQty = new Decimal(detail.qty).toNumber() ;
detail.package = pack;
return detail;
@ -39,10 +43,14 @@ export function createDetailInfo(data, pack) {
//计算实际数量
export function calcHandleQty(detailSource) {
for (let item of detailSource) {
item.qty = 0;
item.handleQty = new Decimal(0).toNumber();
item.qty = new Decimal(0).toNumber();
for (let detail of item.subList) {
if (detail != undefined && detail.scaned) {
item.qty = calc.add(item.qty,detail.qty);
if(detail!=undefined){
if(detail.scaned){
item.handleQty = calc.add(item.handleQty,detail.handleQty);
}
item.qty = calc.add(item.qty,detail.qty);
}
}
}
@ -54,6 +62,8 @@ export function getBusinessType(typeCode, callback) {
businessType: '',
fromlocationTypeList: '',
tolocationTypeList: '',
itemCodeTypeList:"",
useOnTheWay:"FALSE",
fromInventoryStatuses: '',
toInventoryStatuses: '',
message: ''
@ -63,8 +73,10 @@ export function getBusinessType(typeCode, callback) {
result.businessType = res.data.list[0];
result.fromlocationTypeList = getDirectoryItemArray(res.data.list[0].outLocationTypes)
result.tolocationTypeList = getDirectoryItemArray(res.data.list[0].inLocationTypes)
result.itemCodeTypeList = getDirectoryItemArray(res.data.list[0].itemTypes)
result.fromInventoryStatuses = res.data.list[0].outInventoryStatuses;
result.toInventoryStatuses = res.data.list[0].inInventoryStatuses;
result.useOnTheWay =res.data.list[0].useOnTheWay
callback(result)
} else {
result.success = false;

8
common/scan.js

@ -125,7 +125,7 @@ export function analyseScanInfo(scanMsg) {
//解析完工收货标签
//P2250229RAA;L220408;Q100;N62840610;SB0000107;UEA;DU571LS;FA;E2022-4-8
//P零件号,L批次,Q数量,N生产计划号,S箱码,U计量单位,D生产线,F班次,E日期,M零件名称(待添加)
//P物料号,L批次,Q数量,N生产计划号,S箱码,U计量单位,D生产线,F班次,E日期,M物料名称(待添加)
//解析规则
//P:itemCode 物料号
//L:lot批次
@ -240,7 +240,7 @@ export function analyseProductLabelInfo(scanMsg) {
//解析天津mes标签
//1#2546319FL#254FL003#202207110009:
//1.序号1,2.生产号2546311FL,3.零件号254FL004,4.批序号202207110009
//1.序号1,2.生产号2546311FL,3.物料号254FL004,4.批序号202207110009
export function analyseTJMesQRCode(scanMsg) {
let scanResult = {
success: false,
@ -269,7 +269,7 @@ export function analyseTJMesQRCode(scanMsg) {
seq: datas[0], //序号
produceNo: datas[1], //生产号
// projectNo: datas[2], //项目号
itemCode: itemCode, //配置码(零件号)
itemCode: itemCode, //配置码(物料号)
lot: datas[3], //批次
position: location //上层、下层
}
@ -282,7 +282,7 @@ export function analyseTJMesQRCode(scanMsg) {
seq: seq, //序号
produceNo: 'N', //生产号
projectNo: 'N', //项目号
itemCode: 'N', //配置码(零件号)
itemCode: 'N', //配置码(物料号)
lot: 'N', //批次
position: ''
}

4
common/style/new_style.css

@ -115,7 +115,7 @@ uni-page-head .uni-page-head__title {
}
/*
零件状态
物料状态
未知可用隔离新增规划禁用
*/
@ -2439,7 +2439,7 @@ button[disabled] {
font-size: 38rpx;
}
.text_stock {
.text_balance {
font-size: 36rpx;
}

8
common/style/pdabasic.css

@ -417,7 +417,7 @@
/* //零件状态
/* //物料状态
export function getItemTypeStyle(val) {
if (val == 0) return 'active'
else if (val == 1) return 'hold'
@ -428,7 +428,7 @@ export function getItemTypeStyle(val) {
}
*/
/* 零件状态 */
/* 物料状态 */
.active {
background-color: #5FCB94;
color: #FFFFFF;
@ -460,7 +460,7 @@ export function getItemTypeStyle(val) {
font-weight: bolder;
}
/* 零件编号字体 */
/* 物料编号字体 */
.text-itemcode {
/* font-size: 26rpx; */
color: #000;
@ -472,7 +472,7 @@ export function getItemTypeStyle(val) {
/* font-size: 22rpx; */
}
/* 零件编号字体 */
/* 物料编号字体 */
.text-bolder {
color: #000;
font-weight: bolder;

6
mycomponents/balance/handleBalance.vue

@ -1,12 +1,12 @@
<template>
<view :class="detail.scaned?'scan_view':''" style="background-color: #ffffff;">
<view class="space_between">
<view >
<view class="space_between center" >
<view style="word-break: break-all;width: 60%;">
<pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack>
<batch v-if="isShowBatch" :batch="detail.batch"></batch>
<location v-if="isShowLocation" :locationCode="detail.fromLocationCode"></location>
</view>
<view >
<view style="word-break: break-all;">
<recommend-qty v-if="detail.record==null || detail.record==undefined" :dataContent="detail"
:isShowStdPack="false"></recommend-qty>

10
mycomponents/balance/recommendBalance.vue

@ -1,17 +1,17 @@
<template>
<view :class="detail.scaned?'scan_view':''" style="background-color: #ffffff;">
<view :class="detail.scaned?'scan_view':''" style="background-color: #fff;">
<view class="uni-flex uni-row space-between center ">
<view class="uni-flex uni-row center ">
<view style=" width: 20px;color: #32C1E8;">
<view class="uni-flex uni-row " style="width: 60%;margin-left: 30rpx;" >
<view style=" width: 25rpx;color: #32C1E8;">
推荐
</view>
<view >
<view style="word-break: break-all">
<pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack>
<batch v-if="isShowBatch" :batch="detail.batch"></batch>
<location v-if="isShowLocation" :locationCode="detail.fromLocationCode"></location>
</view>
</view>
<view >
<view style="word-break: break-all">
<recommend-qty v-if="detail.Records==null || detail.Records.length==0" :dataContent="detail"
:isShowStdPack="false" :isShowStatus="false"></recommend-qty>
<compare-qty v-else :dataContent="detail" :recommendQty="Number( detail.qty)"

2
mycomponents/detail/comDetailCard.vue

@ -3,7 +3,7 @@
<uni-collapse ref="collapse1" @change="">
<uni-collapse-item :open="true">
<template v-slot:title>
<item-compare-qty :dataContent="dataContent" :handleQty="Number(dataContent.handleQty)" :isShowStdPack="false">
<item-compare-qty :dataContent="dataContent" :handleQty="dataContent.handleQty" :isShowStdPack="false">
</item-compare-qty>
</template>
<u-line></u-line>

4
mycomponents/item/itemDetailInfo.vue

@ -2,11 +2,11 @@
<uni-popup ref="popup">
<view class="uni-flex uni-column" style="background-color: white;width: 200px; height:60%;">
<view class="uni-flex">
<text>零件</text>
<text>物料</text>
<text>{{dataContent.code}}</text>
</view>
<view class="uni-flex">
<text>零件名称</text>
<text>物料名称</text>
<text>{{dataContent.name}}</text>
</view>
<view class="uni-flex">

14
mycomponents/item/itemQty.vue

@ -4,9 +4,11 @@
<item :dataContent="dataContent"></item>
</view>
<view>
<balanceQty v-if="showItemQty" :dataContent="dataContent"></balanceQty>
<!-- showBalanceQty -->
<balanceQty v-if="isShowBalanceQty" :dataContent="dataContent"></balanceQty>
<compare-qty v-else :dataContent="dataContent" :recommendQty="Number(dataContent.qty)"
:handleQty="Number(handleQty)" :isShowStatus="false">
:handleQty="dataContent.handleQty" :isShowStatus="false" :isShowStdPack="showStdPack">
</compare-qty>
</view>
<!-- <view v-else>
@ -43,10 +45,14 @@
type: Number,
default: 0
},
showItemQty: {
isShowBalanceQty: {
type: Boolean,
default: true
}
},
showStdPack: {
type: Boolean,
default: false
},
},
watch: {

6
mycomponents/item/itemSelect.vue

@ -1,9 +1,9 @@
<template>
<view class="" style="background-color:#fff;">
<view class="uni-flex uni-row" style="display: flex;align-items: center;">
零件
物料
<uni-easyinput ref='scanInput' v-model="partCode" @confirm="confirmPartCode" @clear="clear"
style='font-size: 18px;padding: 10rpx 20rpx;' placeholder="请输入零件号" @iconClick="">
style='font-size: 18px;padding: 10rpx 20rpx;' placeholder="请输入物料号" @iconClick="">
</uni-easyinput>
</view>
<view class="">
@ -39,7 +39,7 @@
confirmPartCode() {
if (this.partCode == '') {
uni.showToast({
title: "请扫描零件"
title: "请扫描物料"
})
return;
}

6
mycomponents/package/packageDetailPopup.vue

@ -61,13 +61,13 @@
this.dataList.length = 0;
this.dataList.push(...[{
item_title: '包装号',
text_wrap: this.dataContent.number
content: this.dataContent.number
}, {
item_title: '物料代码',
text_wrap: this.dataContent.itemCode
content: this.dataContent.itemCode
}, {
item_title: '物品名称',
text_wrap: this.dataContent.itemName
content: this.dataContent.itemName
}, {
item_title: '物品描述1',
content: this.dataContent.itemDesc1

6
mycomponents/partCode/partCodeSelect.vue

@ -1,9 +1,9 @@
<template>
<view class="" style="background-color:#fff;">
<view class="uni-flex uni-row" style="display: flex;align-items: center;">
零件
物料
<uni-easyinput ref='scanInput' v-model="partCode" @confirm="confirmPartCode" @clear="clear"
style='font-size: 18px;padding: 10rpx 20rpx;' placeholder="请输入零件号" @iconClick="">
style='font-size: 18px;padding: 10rpx 20rpx;' placeholder="请输入物料号" @iconClick="">
</uni-easyinput>
</view>
<view class="">
@ -39,7 +39,7 @@
confirmPartCode() {
if (this.partCode == '') {
uni.showToast({
title: "请扫描零件"
title: "请扫描物料"
})
return;
}

40
mycomponents/popup/selectList.vue

@ -1,28 +1,31 @@
<template>
<uni-popup ref="popupItems">
<com-popup @onClose="closePopup">
<view class="">
<view class="uni-center" style="font-size: 40rpx;margin-top: 10rpx;margin-bottom: 10rpx;">
选择零件
<view class="uni-center" style="position: relative;height:900rpx ;">
<view class="" style="position: absolute;font-size: 38rpx;height: 50rpx; margin-top: 10rpx;margin-bottom: 10rpx;left: 0;top: 0;right: 0;">
选择物料
</view>
<u-line/>
<view style="margin: 20rpx;" v-for="(item, index) in showList" :key="index" >
<view class="" style="padding: 10rpx;" @click="selectItem(item)">
零件: {{item.itemCode}}
<view class="" style="position: absolute;height: 720rpx; font-size: 40rpx;top: 70rpx;bottom: 80rpx;left: 0;right: 0;">
<view style="margin: 15rpx;text-align: left;" v-for="(item, index) in showList" :key="index" >
<view class="" style="padding: 10rpx;font-size: 30rpx; " @click="selectItem(item)">
({{index+1}}) 物料: {{item.itemCode}}
</view>
<u-line/>
</view>
<u-line/>
</view>
</view>
<view class="flex uni-center" style="width: 100%;justify-content: center;margin-top: 10rpx;margin-bottom: 10rpx;" >
<view class="">
当前页{{ pageCurrent }}数据总量{{ total }}每页数据{{ pageSize }}
<view class="" style="position: absolute; height:80rpx ;left: 0;bottom: 0;right: 0;">
<view class="flex uni-center" style="width: 100%;justify-content: center;margin-top: 10rpx;margin-bottom: 10rpx;" >
<view class="">
当前页{{ pageCurrent }}数据总量{{ total }}每页数据{{ pageSize }}
</view>
</view>
<view class="">
<uni-pagination :page-size="pageSize" :current="pageCurrent" :total="total" @change="change" />
</view>
</view>
</view>
<view class="">
<uni-pagination :page-size="pageSize" :current="pageCurrent" :total="total" @change="change" />
</view>
</com-popup>
</uni-popup>
@ -31,7 +34,6 @@
<script>
import {
getProductionlineItem,
getCustomerItemList
} from '@/api/request2.js';
import comPopup from '@/mycomponents/common/comPopup.vue'
@ -73,8 +75,8 @@
this.$forceUpdate()
this.$refs['popupItems'].open("center");
} else {
//线
// this.showErrorMessage('线' + lineCode + '');
//线
// this.showErrorMessage('线' + lineCode + '');
this.$refs['popupItems'].open("center");
}
}).catch(error => {

70
mycomponents/qty/CountQtyEdit.vue

@ -16,7 +16,7 @@
<view class="uni-flex uni-row space-between padding title ">
<text>标包个数 : </text>
<view class="uni-flex uni-row u-col-center">
<uni-number-box @change="calcQty($event,stdCount)" :value="stdCount">
<uni-number-box @change="calcQty($event,stdCount)" :value="stdCount" :focus="false">
</uni-number-box>
<view class="std_pack">
{{getStdPackUnitInfo(dataContent.stdPackUnit)}}
@ -38,12 +38,13 @@
<text>数量 : </text>
<view class="uni-flex uni-row uni-center" style="align-items: center;">
<input class="qty_input" v-model="allQty" :focus="true" type="number"
@mousedown="mousedown" />
@mousedown="mousedown" @input="checkNum" :maxlength="maxlength" />
<uom :uom="dataContent.uom"></uom>
</view>
</view>
<u-line />
<view v-if="isShowBalance" class="uni-flex uni-row space-between padding title u-col-center">
<view v-if="isShowBalance"
class="uni-flex uni-row space-between padding title u-col-center">
<text>库存数量 : </text>
<view class="uni-flex uni-row uni-center" style="align-items: center;">
<text class="text_recommend">{{Number(dataContent.balanceQty)}}</text>
@ -55,7 +56,7 @@
style="align-items: center; padding-left: 30rpx;">
<text>库存状态 : </text>
<view class="uni-flex uni-row uni-center" style="align-items: center;">
<balanceStatus ref="balanceStatus" :status="inventoryStatus" :allowEdit='false'
<balanceStatus ref="balanceStatus" :status="inventoryStatus" :allowEdit='true'
@updateStatus="updateStatus" @onOpen="clickState">
</balanceStatus>
</view>
@ -107,7 +108,9 @@
seconds: 0,
timer: {},
showConfirmCountdown: false,
detaiList: []
detailList: [],
maxlength: 10,
mode: 'add' //add edit
}
},
watch: {
@ -140,26 +143,52 @@
},
},
methods: {
openEditPopup(item, detaiList) {
this.dataContent = item
this.inventoryStatus = this.dataContent.inventoryStatus;
this.allQty = Number(this.dataContent.qty)
checkNum(e) {
let value = e.detail.value;
let dot = value.indexOf('.'); //
let reg = /^[0-9]+$/; //
if (dot > -1) {
this.maxlength = dot + 7; //
if (value.length > dot + 7) {
}
}
if (reg.test(value)) { //
this.maxlength = 10;
}
},
//
openEditPopup(item, detailList) {
this.initData(item, detailList);
// this.dataContent = item
// this.inventoryStatus = this.dataContent.inventoryStatus;
// this.allQty = Number(this.dataContent.qty)
// this.stdCount = Math.ceil(this.allQty / this.dataContent.stdPackQty);
// this.detailList = detailList
this.showConfirmCountdown = false;
this.detaiList = detaiList
this.mode = 'edit';
this.$refs.popup.open('bottom')
clearInterval(this.timer)
},
openEditPopupShowSeconds(item, detaiList) {
this.dataContent = item;
this.inventoryStatus = this.dataContent.inventoryStatus;
this.allQty = Number(this.dataContent.qty);
//
openEditPopupShowSeconds(item, detailList) {
this.initData(item, detailList);
this.showConfirmCountdown = true;
this.detaiList = detaiList;
this.mode = 'add';
this.$refs.popup.open('bottom')
this.startTimer()
},
initData(item, detailList) {
this.dataContent = item;
this.inventoryStatus = this.dataContent.inventoryStatus;
this.allQty = Number(this.dataContent.handleQty);
this.stdCount = Math.ceil(this.allQty / this.dataContent.stdPackQty);
this.detailList = detailList;
},
mousedown() {
this.showConfirmCountdown = false;
clearInterval(this.timer)
@ -172,6 +201,7 @@
closeEditPopup() {
clearInterval(this.timer)
this.$emit("close");
this.$refs.popup.close()
},
confirm() {
@ -186,26 +216,28 @@
this.timer = setInterval(() => {
this.seconds--
if (this.seconds <= 0) {
this.cancel()
this.confirm();
// this.cancel()
return
}
}, 1000)
},
calcQty(val) {
if(val>0){
if (val > 0) {
this.allQty = val * Number(this.dataContent.stdPackQty);
}
},
setValue() {
this.dataContent.handleQty = Number(this.allQty)
this.$emit("confirm");
this.$emit("confirm", Number(this.allQty), this.inventoryStatus, this.mode);
this.closeEditPopup();
},
updateStatus(value) {
this.inventoryStatus = value
console.log(this.inventoryStatus)
},
getStdPackUnitInfo(value) {
return getStdPackUnitInfo(value).name
}

2
mycomponents/qty/balanceQty.vue

@ -1,7 +1,7 @@
<template>
<view>
<view class="center">
<view class="uni-flex uni-row" style="font-size: 40rpx;">
<view class="uni-flex uni-row text_balance">
<text>
{{Number(dataContent.qty)}}
</text>

24
mycomponents/qty/balanceQtyEdit.vue

@ -36,7 +36,7 @@
<text>数量 : </text>
<view class="uni-flex uni-row uni-center" style="align-items: center;">
<input class="qty_input" v-model="allQty" :focus="true" type="number"
@confirm="confirm()" />
@confirm="confirm()" @input="checkNum" :maxlength="maxlength" />
<uom :uom="dataContent.uom"></uom>
</view>
</view>
@ -77,7 +77,7 @@
import StdUom from '@/mycomponents/qty/StdUom.vue'
import balanceStatus from '@/mycomponents/status/balanceStatus.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
export default {
components: {
uom,
@ -94,7 +94,8 @@
inventoryStatus: "",
originalInventoryStatus: "",
dataContent: {},
handleQty: 0
handleQty: 0,
maxlength: 10
}
},
watch: {
@ -123,11 +124,26 @@
}
},
methods: {
checkNum(e) {
let value = e.detail.value;
let dot = value.indexOf('.'); //
let reg = /^[0-9]+$/; //
if (dot > -1) {
this.maxlength = dot + 7; //
if (value.length > dot + 7) {
}
}
if (reg.test(value)) { //
this.maxlength = 10;
}
},
openEditPopup(item, handleQty) {
this.dataContent = item
this.inventoryStatus = this.dataContent.inventoryStatus
this.originalInventoryStatus =this.dataContent.inventoryStatus;
this.toInventoryStatus = this.dataContent.toInventoryStatus
this.allQty = Number(handleQty)
this.allQty = handleQty
setTimeout(res => {
this.$refs.popup.open('bottom')
}, 500)

33
mycomponents/qty/compareQty.vue

@ -3,25 +3,35 @@
<view class="uni-flex uni-row ">
<status v-show="isShowStatus" :status='dataContent.inventoryStatus'></status>
<view class="uni-flex uni-row center">
<view v-if ="Number(handleQty)!=0">
<view v-if="Number(recommendQty)>Number(handleQty)" class="text_greater">
<view v-if="Number(handleQty)!=0">
<view v-if="isShowRecommendQty">
<view v-if="Number(recommendQty)>Number(handleQty)" class="text_greater">
{{Number(handleQty)}}
</view>
<view v-else-if="Number(recommendQty)<Number(handleQty)" class="text_less">
</view>
<view v-else-if="Number(recommendQty)<Number(handleQty)" class="text_less">
{{Number(handleQty)}}
</view>
<view v-else-if="Number(recommendQty) ==Number(handleQty)" class="text_equal">
{{Number(handleQty)}}
</view>
</view>
<view v-else-if="Number(recommendQty) ==Number( handleQty)" class="text_equal">
<view v-else>
<view class="text_balance">
{{Number(handleQty)}}
</view>
</view>
</view>
<view class="center" v-if="isShowRecommendQty">
<view v-if="Number(handleQty)!=0" class="std_split">/</view>
<view v-if="isShowRecommendQty" class="text_recommend center">
{{Number(recommendQty)}}
<view class="text_recommend ">
{{Number(recommendQty)}}
</view>
</view>
</view>
<uom v-show="Number(handleQty)!=0||(isShowRecommendQty&&Number(recommendQty)>0)" :uom="dataContent.uom"></uom>
<uom v-show="!isShowStdPack" :uom="dataContent.uom">
</uom>
<!-- <uom v-show="Number(handleQty)!=0||(isShowRecommendQty&&Number(recommendQty)>0)" :uom="dataContent.uom">
</uom> -->
</view>
<view>
<std-pack-qty v-show="isShowStdPack" :dataContent="dataContent"></std-pack-qty>
@ -81,8 +91,7 @@
},
watch: {
handleQty: {
handler(newName, oldName) {
},
handler(newName, oldName) {},
immediate: true,
deep: true
}

26
mycomponents/qty/recommendQtyEdit.vue

@ -31,12 +31,13 @@
</view>
</view>
<u-line />
<view class="uni-flex uni-row space-between padding title u-col-center">
<text>总数量 : </text>
<view class="uni-flex uni-row uni-center" style="align-items: center;">
<input class="qty_input" v-model="allQty" :focus="false" type="number"
@confirm="confirm()" />
@input="checkNum" @confirm="confirm()" :maxlength="maxlength" />
<uom :uom="dataContent.uom"></uom>
</view>
</view>
@ -69,7 +70,8 @@
allQty: 0,
stdCount: 0,
labelQty: 0,
recommendQty: 0
recommendQty: 0,
maxlength: 10
}
},
watch: {
@ -104,6 +106,20 @@
},
},
methods: {
checkNum(e) {
let value = e.detail.value;
let dot = value.indexOf('.'); //
let reg = /^[0-9]+$/; //
if (dot > -1) {
this.maxlength = dot + 7; //
if (value.length > dot + 7) {
}
}
if (reg.test(value)) { //
this.maxlength = 10;
}
},
openEditPopup() {
this.$refs.popup.open('bottom')
},
@ -148,7 +164,8 @@
} else {
if (this.recommendQty != 0) {
if (this.allQty > this.recommendQty) {
if (this.settingParam.allowBiggerQty != null && this.settingParam.allowBiggerQty == "TRUE") {
if (this.settingParam.allowBiggerQty != null && this.settingParam.allowBiggerQty ==
"TRUE") {
this.callback();
} else {
this.$refs.comMessage.showErrorMessage('数量[' + this.allQty + ']不允许大于推荐数量[' +
@ -159,7 +176,8 @@
})
}
} else if (this.allQty < this.recommendQty) {
if (this.settingParam.allowSmallerQty != null && this.settingParam.allowSmallerQty == "TRUE") {
if (this.settingParam.allowSmallerQty != null && this.settingParam.allowSmallerQty ==
"TRUE") {
this.callback();
} else {
this.$refs.comMessage.showErrorMessage('数量[' + this.allQty + ']不允许小于推荐数量[' +

2
mycomponents/recommend/recommend.vue

@ -2,7 +2,7 @@
<view :class="detail.scaned?'scan_view':''" style="background-color: #ffffff; border-bottom: 1upx solid #EEEEEE;">
<view class="uni-flex uni-row space-between" style="align-items: center">
<!-- uni-inline-item 暂时拿掉-->
<view style="word-break: break-all;width: 50%;">
<view style="word-break: break-all;">
<pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack>
<batch v-if="isShowBatch" :batch="detail.batch"></batch>
<location v-if="isShowFromLocation" title="来源库位" :locationCode="detail.fromLocationCode">

13
mycomponents/recommend/recommendCount.vue

@ -10,15 +10,16 @@
<location v-if="isShowToLocation" title="目标库位" :locationCode="detail.toLocationCode">
</location>
</view>
<view>
<view class="uni-flex uni-row center">
<!-- <recommend-qty v-if="detail.handleQty==null || detail.handleQty==undefined" :dataContent="detail"
:isShowStdPack="false"></recommend-qty> -->
<compare-qty :dataContent="detail" :recommendQty="Number(detail.qty)" :isShowRecommendQty="isShowRecommendQty"
<!-- {{detail.scaned}} -->
<compare-qty :dataContent="detail" :recommendQty="Number(detail.qty)"
:isShowRecommendQty="isShowRecommendQty" :isShowStatus="isShowRecommendQty || detail.scaned==true"
:handleQty="Number(detail.handleQty)" :isShowStdPack="false">
</compare-qty>
<view class="uni-flex uni-row" style="vertical-align:center" v-if="isDevlement()">
<text style="font-size: 30rpx;color: #2979ff; "
@click="copy">复制采购</text>
<text style="font-size: 30rpx;color: #2979ff; " @click="copy">复制采购</text>
<text style="font-size: 30rpx;color: #2979ff;" @click="copyPro">|制品</text>
</view>
</view>
@ -73,7 +74,7 @@
type: String,
default: '库位'
},
isShowRecommendQty:{
isShowRecommendQty: {
type: Boolean,
default: true
}
@ -109,7 +110,7 @@
}
)
},
isDevlement(){
isDevlement() {
return getApp().globalData.isDevelopment;
}
}

10
mycomponents/record/recordComDetailCard.vue

@ -6,7 +6,7 @@
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="removeItem($event,dataContent)" :right-options="removeOptions">
<item-qty :dataContent="dataContent" :handleQty="dataContent.handleQty"
:isShowBalance="true" :showItemQty="isShowItemQty"></item-qty>
:isShowBalance="true" :isShowBalanceQty="isShowBalanceQty"></item-qty>
</uni-swipe-action-item>
</uni-swipe-action>
</template>
@ -86,9 +86,9 @@
default: true
},
isShowItemQty: {
isShowBalanceQty: {
type: Boolean,
default: true
default: false
},
},
watch: {
@ -129,7 +129,7 @@
methods: {
removeItem(e, dataContent) {
if (e.content.text == "清空") {
this.$refs.comMessage.showQuestionMessage("确定清空零件及箱码信息?",
this.$refs.comMessage.showQuestionMessage("确定清空物料及箱码信息?",
res => {
if (res) {
this.$emit('removeItem')
@ -150,7 +150,7 @@
edit(item) {
this.editItem = item;
this.$refs.balanceQtyEdit.openEditPopup(this.editItem, this.editItem.qty);
this.$refs.balanceQtyEdit.openEditPopup(this.editItem, this.editItem.handleQty);
},
detail(item) {

33
mycomponents/scan/winComScan.vue

@ -10,7 +10,7 @@
@input="handelScanMsg" :cursor="cursorIndex"></textarea>
</view>
<view class="uni-flex uni-row space-between u-col-center" >
<view class="uni-flex uni-row space-between u-col-center">
<!-- <view class="paizhao" @click="scanQRCode()" v-if="true">
<image src="/static/icons/icons_camera.svg" alt="" />
</view> -->
@ -84,7 +84,7 @@
type: Boolean,
default: true
},
headerType:{
headerType: {
type: String,
default: 'HPQ' //HLB HMQ HCQ HPQ
}
@ -103,7 +103,7 @@
}
},
mounted() {
if(document.querySelector('textarea')!=null){
if (document.querySelector('textarea') != null) {
document.querySelector('textarea').setAttribute('inputmode', 'none')
}
// if (this.$el.querySelector('textarea') != null) {
@ -134,31 +134,34 @@
this.handelScanMsg();
},
handelScanMsg() {
let that = this;
//
// uni.showLoading({
// title: '...',
// mask: true
// })
let that = this;
let index = that.scanMsg.indexOf('\n');
if (index > 0) {
if (index >= 0) {
// that.scanMsg = 'HPQ;V1.0;ICE115F11161AG;PP20230427000027;B20230427002;Q50';
setTimeout(() => {
that.losefocus();
let content = uni.$u.trim(that.scanMsg)
if (content == "") {
//
// this.$refs.comMessage.showErrorMessage('', res => {
// if (res) {
// that.getfocus();
// }
// })
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 => {
getLabelInfo(content, this.headerType, callback => {
// uni.hideLoading();
let scanResult = callback;
if (scanResult.success) {
that.clear();

99
mycomponents/scan/winScanItem.vue

@ -13,26 +13,40 @@
</view>
<view class="">
<view class="">
<win-com-scan ref="scan" @getResult="getScanResult" :placeholder='title' :clearResult="false">
<win-com-scan ref="scan" @getResult="getScanResult" :placeholder='title' :clearResult="false"
headerType="HMQ,HPQ">
</win-com-scan>
</view>
</view>
</view>
</uni-popup>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import {
getBasicItemByCode
} from '@/api/request2.js';
import {
checkDirectoryItemExist,
getListItemTypeDesc,
getItemTypeInfo
} from '@/common/directory.js';
import winComScan from '@/mycomponents/scan/winComScan.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
export default {
name: 'winScanItem',
components: {
winComScan
winComScan,
comMessage
},
emits: ["getScanCode"],
emits: ["getScanCode", 'getScanResult'],
props: {
title: {
type: String,
@ -41,11 +55,16 @@
isShowRecord: {
type: Boolean,
default: true
}
},
itemCodeTypeList: {
type: Array,
default: []
},
},
data() {
return {
code: '',
result: {},
isShow: false,
expand: false,
scanList: [],
@ -76,20 +95,76 @@
this.$refs.scan.clearScanValue();
},
getScanResult(result) {
if (result.label.barType == "QRCode") {
this.code = result.label.itemCode;
} else if (result.label.barType == "BarCode") {
this.code = result.label.code;
uni.showLoading({
title: '扫描中...',
mask: true
});
var scanResult = result;
if (scanResult.label.barType == "QRCode") {
this.code = scanResult.label.itemCode;
} else if (scanResult.label.barType == "BarCode") {
this.code = scanResult.label.code;
}
if (this.code == undefined) {
uni.hideLoading();
this.showErrorMessage("扫描物料[" + this.code + "]为空,请输入正确的物料")
return
}
this.callBack();
getBasicItemByCode(this.code).then(res => {
uni.hideLoading();
if (res.data != null && res.data.list.length > 0) {
var result =res.data.list[0];
var status =result.status;
var type = result.type;
var itemCode = result.code
var itemName =result.name
var uom = result.uom
var std = result.uom
result.package = scanResult.package
if(status=="ENABLE"){
if(checkDirectoryItemExist(this.itemCodeTypeList,type)){
this.result =result;
this.callBack()
}else {
var hint = getListItemTypeDesc(this.itemCodeTypeList);
this.showErrorMessage("扫描物料[" + this.code + "]是[" +
getItemTypeInfo(type).label + "],需要的物料类型是[" + hint + "]")
}
}else {
this.showErrorMessage('物料【' + this.code + '】不可用');
}
} else {
this.showErrorMessage('未查找到物料【' + this.code + '】');
}
}).catch(error => {
uni.hideLoading();
this.showErrorMessage(error)
})
},
callBack() {
this.closeScanPopup();
this.$refs.scan.clear();
this.$emit("getScanCode", this.code);
// this.$emit("getScanCode", this.code);
this.$emit("getScanResult", this.code, this.result);
},
change(e) {
this.isShow = e.show
}
},
showErrorMessage(message) {
this.losefocus();
this.$refs.comMessage.showErrorMessage(message, res => {
this.code = '';
this.getfocus();
})
},
getfocus() {
this.$refs.scan.getfocus();
},
losefocus() {
this.$refs.scan.losefocus();
},
}
}
</script>

134
mycomponents/scan/winScanPackAndLocation.vue

@ -28,14 +28,13 @@
<view v-if='allowModifyLocation'>
<uni-combox :candidates="fromLocationList" v-model="fromLocationCode" placeholder="请扫描来源库位"
@confirm="scanLocation" style='height: 30rpx;border:1px solid #fff ;'></uni-combox>
@confirm="" style='height: 30rpx;border:1px solid #fff ;'></uni-combox>
</view>
<view v-else>
<text style="padding: 5px">
{{fromLocationCode}}
</text>
</view>
</view>
</view>
<view class="">
@ -72,7 +71,7 @@
} from '@/common/directory.js';
export default {
name: 'winScanPack',
emits: ["getResult", "close"],
emits: ["getResult", "close", "getCountScanResult"],
components: {
winComScan,
comMessage,
@ -91,6 +90,11 @@
type: Boolean,
default: false
},
//
noShowBalanceMessage: {
type: Boolean,
default: false
},
//
allowModifyLocation: {
type: Boolean,
@ -117,7 +121,8 @@
businessType: {},
inventoryStatus: [],
managementPrecision: '',
fromInventoryStatuses: ""
fromInventoryStatuses: "",
isCheck:false
}
},
created() {
@ -163,20 +168,30 @@
this.$emit("close", '');
},
scanLocation() {
scanLocation(scanResult) {
var isCheck = false;
if (this.fromLocationCode == '') {
this.showMessage('来源库位不能为空', callback => {
this.showErrorMessage('来源库位不能为空', callback => {
this.locationGetFocus();
})
return;
}
if(this.fromLocationList.length>0){
if(!this.isInLocationList(this.fromLocationCode)){
this.showErrorMessage("扫描库位【"+this.fromLocationCode+'】不在任务来源库位中', callback => {
this.locationGetFocus();
})
return;
}
}
uni.showLoading({
title: '扫描中...',
mask: true
});
getBasicLocationByCode(this.fromLocationCode).then(res => {
uni.hideLoading();
if (res.data.total > 0) {
let result = res.data.list[0];
var type = result.type;
@ -184,8 +199,10 @@
if (available == "TRUE") {
if (checkDirectoryItemExist(this.fromLocationTypeArray, type)) {
this.location = result;
this.packGetFocus();
// this.packGetFocus();
this.checkPackage(scanResult);
} else {
uni.hideLoading();
var hint = getListLocationTypeDesc(this.fromLocationTypeArray);
this.showErrorMessage("库位[" + this.fromLocationCode + "]是" +
getLocationTypeName(type) + ",<br>需要的库位类型是[" + hint + "]", callback => {
@ -193,11 +210,13 @@
})
}
} else {
uni.hideLoading();
this.showErrorMessage("扫描库位[" + this.fromLocationCode + "]不可用", res => {
this.locationGetFocus();
})
}
} else {
uni.hideLoading();
this.showErrorMessage('未查询到库位[' + this.fromLocationCode + ']', res => {
this.locationGetFocus();
})
@ -210,35 +229,50 @@
})
},
getScanResult(result) {
console.log("扫描", result)
if (this.fromLocationCode == '' || this.fromLocationCode == null) {
this.showMessage('请先扫描来源库位', callback => {
this.locationGetFocus();
})
return;
} else {
if (result.label != null) {
this.scanResult = result;
getBalanceByManagementPrecision(result.label, this.fromLocationCode, this.fromInventoryStatuses,
res => {
if (res.success) {
this.managementPrecision = res.managementPrecision
this.afterQueryBalance(res.data.list);
} else {
this.showErrorMessage(res.message, res => {
this.packGetFocus();
})
}
});
}
getScanResult(result) {
// console.log("", result)
// if (this.fromLocationCode == '' || this.fromLocationCode == null) {
// this.showMessage('', callback => {
// this.locationGetFocus();
// })
// return;
// } else
this.scanLocation(result);
// debugger
// if(this.isCheck){
// this.checkPackage(result);
// }
},
checkPackage(result){
if (result.label != null) {
this.scanResult = result;
// uni.showLoading({
// title: '...',
// mask: true
// })
getBalanceByManagementPrecision(result.label, this.fromLocationCode, this.fromInventoryStatuses,
res => {
uni.hideLoading();
if (res.success) {
this.managementPrecision = res.managementPrecision
this.afterQueryBalance(res.data.list);
} else {
this.showErrorMessage(res.message, res => {
this.packGetFocus();
})
}
// uni.hideLoading();
});
}
},
afterQueryBalance(datas) {
if (this.allowNullBalance) {
this.allowNoneBalance(datas);
} else if (this.noShowBalanceMessage) {
this.countCallBack(datas);
} else {
this.mustHavaBalance(datas);
}
@ -267,7 +301,7 @@
this.packCallBack(balance);
// 20231228
// if (balance.qty > 0) {
// this.packCallBack(balance);
// } else {
@ -298,6 +332,20 @@
// }
},
//
countCallBack(datas) {
this.$refs.comscan.clear();
//
let data = {
label: this.scanResult.label,
package: this.scanResult.package,
balance: datas,
fromLocationCode: this.fromLocationCode,
}
this.packGetFocus();
this.$emit("getCountScanResult", data);
},
packCallBack(item) {
this.$refs.comscan.clear();
//
@ -334,22 +382,22 @@
let status = getInventoryStatusDesc(this.inventoryStatus);
switch (this.managementPrecision) {
case 'BY_PACKAGING':
condition = condition + '零件号=[' + label.itemCode + ']<br>箱码=[' + label.packingNumber +
condition = condition + '物料号=[' + label.itemCode + ']<br>箱码=[' + label.packingNumber +
']<br>批次=[' +
label.batch +
']<br>库位=[' + this.fromLocationCode + ']'
break;
case 'BY_BATCH':
condition = condition + '零件号=[' + label.itemCode + ']<br>批次=[' +
condition = condition + '物料号=[' + label.itemCode + ']<br>批次=[' +
label.batch +
']<br>库位=[' + this.fromLocationCode + ']'
break;
case 'BY_QUANTITY':
condition = condition + '零件号=[' + label.itemCode + ']<br>库位=[' + this.fromLocationCode + ']'
condition = condition + '物料号=[' + label.itemCode + ']<br>库位=[' + this.fromLocationCode + ']'
break;
case 'BY_UNIQUEID':
condition = condition + '零件号=[' + label.itemCode + ']'
condition = condition + '物料号=[' + label.itemCode + ']'
break;
}
if (this.inventoryStatus.length > 0) {
@ -376,6 +424,20 @@
change(e) {
this.show = e.show
},
isInLocationList(location) {
var item = this.fromLocationList.find(res => res == location)
if (item = undefined) {
return false
}
return true
},
addLocationCode(code) {
if (!this.isInLocationList(code)) {
this.fromLocationList.push(code)
}
}
}
}
</script>

16
mycomponents/scan/winScanPackAndPosition.vue

@ -94,7 +94,6 @@
},
methods: {
openScanPopup() {
if (this.positionList.length == 0) {
uni.showLoading({
title: "数据加载中....",
@ -111,6 +110,21 @@
this.$refs.popup.open('bottom');
},
initData(){
this.positionInfo = "请选择位置";
this.positionList = [];
this.productionLineCode = '';
this.rawLocationCode = "";
this.fgLocationCode = "";
this.workshopCode = "";
this.workStationCode ="";
this.workShopName = "";
this.productionLineName="";
this.workStationName="";
this.show = false;
this.isEditPosition = true
},
closeScanPopup() {
this.$refs.popup.close();

3
mycomponents/status/balanceStatus.vue

@ -3,7 +3,8 @@
<status :status='status' style='font-size: 70rpx;'></status>
<text :class="statusStyle(status)" style='font-size: 38rpx;margin-right: 15rpx;'>
{{statusDesc(status) }}</text>
<image style="width: 40rpx; height:40rpx" src="/static/icons/icons_edit.svg" v-show="allowEdit" @click="open">
<!-- v-show="allowEdit" -->
<image v-if="allowEdit" style="width: 40rpx; height:40rpx" src="/static/icons/icons_edit.svg" @click="open">
</image>
</view>
<status-edit :status='status' ref="statusEdit" @updateStatus="updateStatus"></status-edit>

10
mycomponents/workStation/workStation.vue

@ -2,6 +2,11 @@
<view class="header_job_top">
<view class="cen_card">
<view class="cell_box uni-flex uni-row">
<view class="cell_info" v-if="fromWarehouseCode!=''">
<view class="text_lightblue">仓库</view>
<view>{{fromWarehouseCode}}</view>
</view>
<view class="cell_info">
<view class="text_lightblue">车间</view>
<view>{{workshopCode}}</view>
@ -37,6 +42,11 @@
watch: {},
props: {
fromWarehouseCode:{
type: String,
default: ""
},
workshopCode: {
type: String,
default: ""

20
pages.json

@ -263,7 +263,7 @@
{
"path": "pages/putaway/job/putawayJob",
"style": {
"navigationBarTitleText": "原料上架",
"navigationBarTitleText": "采购上架",
"enablePullDownRefresh": false,
"titleNView": {
// "autoBackButton": "true",
@ -292,21 +292,21 @@
{
"path": "pages/putaway/job/putawayDetail",
"style": {
"navigationBarTitleText": "原料上架详情",
"navigationBarTitleText": "采购上架详情",
"enablePullDownRefresh": false
}
},
{
"path": "pages/putaway/record/putawayRecord",
"style": {
"navigationBarTitleText": "原料上架记录",
"navigationBarTitleText": "采购上架记录",
"enablePullDownRefresh": false
}
},
{
"path": "pages/putaway/request/putawayRequest",
"style": {
"navigationBarTitleText": "原料上架申请",
"navigationBarTitleText": "采购上架申请",
"enablePullDownRefresh": true,
"titleNView": {
// "autoBackButton": "true",
@ -333,14 +333,14 @@
{
"path": "pages/putaway/request/putawayRequestDetail",
"style": {
"navigationBarTitleText": "原料上架申请详情",
"navigationBarTitleText": "采购上架申请详情",
"enablePullDownRefresh": false
}
},
{
"path": "pages/putaway/request/putawayRequestCreate",
"style": {
"navigationBarTitleText": "原料上架申请创建",
"navigationBarTitleText": "采购上架申请创建",
"enablePullDownRefresh": false
}
},
@ -466,7 +466,7 @@
{
"path": "pages/issue/record/issueRecord",
"style": {
"navigationBarTitleText": "直接发料",
"navigationBarTitleText": "直接发料记录",
"enablePullDownRefresh": true,
"titleNView": {
"autoBackButton": "true"
@ -561,14 +561,14 @@
{
"path": "pages/productionReturn/record/returnToStore",
"style": {
"navigationBarTitleText": "合格退料",
"navigationBarTitleText": "合格退料记录",
"enablePullDownRefresh": false
}
},
{
"path": "pages/productionReturn/record/returnToHold",
"style": {
"navigationBarTitleText": "隔离退料",
"navigationBarTitleText": "隔离退料记录",
"enablePullDownRefresh": false
}
},
@ -671,7 +671,7 @@
"path": "pages/query/item",
"style": {
"enablePullDownRefresh": false, //
"navigationBarTitleText": "按零件查询库存",
"navigationBarTitleText": "按物料查询库存",
"titleNView": {
"autoBackButton": "true",
"buttons": [{}]

2
pages/container/coms/comContainerBindCard.vue

@ -131,7 +131,7 @@
methods: {
removeData(e, dataContent) {
if (e.content.text == "清空") {
this.$refs.comMessage.showQuestionMessage("确定清空零件及箱码信息?",
this.$refs.comMessage.showQuestionMessage("确定清空物料及箱码信息?",
res => {
if (res) {
this.$emit('removeItem')

4
pages/container/coms/comPalletRecord.vue

@ -5,7 +5,7 @@
<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"
<item-qty :dataContent="dataContent"
:isShowBalance="true"></item-qty>
</uni-swipe-action-item>
</uni-swipe-action>
@ -123,7 +123,7 @@
methods: {
removeData(e, dataContent) {
if (e.content.text == "清空") {
this.$refs.comMessage.showQuestionMessage("确定清空零件及箱码信息?",
this.$refs.comMessage.showQuestionMessage("确定清空物料及箱码信息?",
res => {
if (res) {
this.$emit('removeItem')

6
pages/container/record/containerBindRecord.vue

@ -57,6 +57,10 @@
getDirectoryItemArray
} from '@/common/directory.js';
import {
calc
} from '@/common/calc.js';
import {
getBusinessType,
createItemInfo,
@ -226,7 +230,7 @@
item.subList.push(newDetail);
items.push(item)
} else {
item.qty += detail.qty
item.qty = calc.add(item.qty,detail.qty)
let newDetail = this.createDetailInfo(detail); //
item.subList.push(newDetail);
}

8
pages/container/record/containerUnBindRecord.vue

@ -51,6 +51,10 @@
import {
goHome
} from '@/common/basic.js';
import {
calc
} from '@/common/calc.js';
import {
getDirectoryItemArray
@ -171,7 +175,7 @@
item.subList.push(newDetail);
items.push(item)
} else {
item.qty += detail.qty
item.qty = calc.add(item.qty,detail.qty)
let newDetail = this.createDetailInfo(detail); //
item.subList.push(newDetail);
}
@ -297,7 +301,7 @@
detail.itemCode = detail.itemCode;
detail.batch = detail.batch;
detail.inventoryStatus = detail.inventoryStatus;
detail.qty =detail.handleQty;
detail.package = null;
subList.push(detail)
}

27
pages/count/coms/comCountDetailCard.vue

@ -5,19 +5,25 @@
<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"></item-qty>
<item-qty v-if="settingParam.isOpenCount=='TRUE'" :dataContent="dataContent"
:handleQty="dataContent.handleQty" :isShowBalanceQty="false">
</item-qty>
<item-qty v-else :dataContent="dataContent" :handleQty="dataContent.handleQty"
:isShowBalanceQty="true" :showRecommendQty="false" :showStdPack="true">
</item-qty>
</uni-swipe-action-item>
</uni-swipe-action>
</template>
<u-line />
<view class="" v-for="(item,index) in dataContent.subList">
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item)"
:right-options="item.scaned?scanOptions:detailOptions">
<recommendCount :detail="item" :isShowFromLocation="false" :isShowRecommendQty="settingParam.isOpenCount=='TRUE'"></recommendCount>
<recommend-count :detail="item" :isShowFromLocation="false" style='margin:1px 0px;'
:isShowRecommendQty="settingParam.isOpenCount=='TRUE'">
</recommend-count>
<u-line />
</uni-swipe-action-item>
</uni-swipe-action>
<u-line color="#D8D8D8"></u-line>
</view>
</uni-collapse-item>
</uni-collapse>
@ -28,6 +34,7 @@
<script>
import itemQty from '@/mycomponents/item/itemQty.vue'
import item from '@/mycomponents/item/item.vue'
import recommendCount from '@/mycomponents/recommend/recommendCount.vue'
import detailInfoPopup from '@/pages/count/coms/detailInfoPopup.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
@ -40,6 +47,7 @@
export default {
components: {
item,
itemQty,
recommendCount,
detailInfoPopup,
@ -97,10 +105,16 @@
methods: {
removeData(e, dataContent) {
if (e.content.text == "清空") {
this.$refs.comMessage.showQuestionMessage("确定清空零件及箱码信息?",
this.$refs.comMessage.showQuestionMessage("确定清空该物料下面扫描的信息吗?",
res => {
if (res) {
this.$emit('removeItem')
dataContent.handleQty = 0;
dataContent.subList.forEach(res=>{
res.scaned = false;
res.handleQty= 0
})
this.$emit('clear')
// this.$emit('removeItem', this.dataContent)
}
});
@ -120,7 +134,6 @@
this.$emit("editItem", detail)
},
detail(item) {
this.showItem = item;
this.$refs.detailInfoPopup.openPopup(item);

797
pages/count/job/countDetail.vue

@ -48,10 +48,12 @@
</view>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult'></win-scan-pack-and-location>
<count-qty-edit ref="countQtyEdit" @confirm="editConfirm" :isShowStatus="true" :allowEditStatus="false"
:isShowBalance="jobContent.isOpenCount=='TRUE'">
<win-scan-pack-and-location ref="scanPopup" :noShowBalanceMessage="true" @getCountScanResult='getScanResult'>
</win-scan-pack-and-location>
<count-qty-edit ref="countQtyEdit" @confirm="editConfirm" @close="editClose" :isShowStatus="true"
:allowEditStatus="editInventoryStatus" :isShowBalance="jobContent.isOpenCount=='TRUE'">
</count-qty-edit>
<balance-select ref="balanceSelect" @onSelectItem='selectBalanceItem'></balance-select>
<com-message ref="comMessage"></com-message>
</view>
</template>
@ -63,6 +65,9 @@
cancleTakeCountJob,
countJobSubmit
} from '@/api/request2.js';
import {
calc
} from '@/common/calc.js';
import {
goHome,
@ -72,7 +77,7 @@
import {
getCountStageName
} from '@/common/directory.js';
import { calc } from '@/common/calc'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
@ -82,6 +87,7 @@
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import countQtyEdit from '@/mycomponents/qty/countQtyEdit.vue'
import jobTop from '@/mycomponents/job/jobTop.vue'
import balanceSelect from '@/mycomponents/balance/balanceSelect.vue'
export default {
name: 'receipt_detail',
@ -93,20 +99,25 @@
comMessage,
winScanPackAndLocation,
countQtyEdit,
jobTop
jobTop,
balanceSelect
},
data() {
return {
id: '',
receiptJob: {},
received: false,
fromLocationCode: '',
isShowPackingCode: true,
scanCount: 0,
jobContent: {}, //
subList: [], //subList
detailSource: [], //
itemEditInfo: {}
balance: {}, //
editInventoryStatus: false,
package: {}, //
label: {}, //
currentEditItem: {},
jobStatus: ""
};
},
onLoad(option) {
@ -115,7 +126,6 @@
//
if (option.status == "1") {
this.receive((callback => {
this.received = true;
this.getDetail();
}));
} else {
@ -133,7 +143,7 @@
onBackPress(e) {
//
if (e.from === 'backbutton') {
if (this.received) {
if (this.jobStatus == "2") {
//
cancleTakeCountJob(this.id).then(res => {
uni.navigateBack();
@ -143,7 +153,6 @@
} else {
uni.navigateBack();
}
return true;
}
},
@ -180,6 +189,7 @@
that.showMessage('未获取到详情');
} else {
that.jobContent = res.data;
that.jobStatus = res.data.status;
that.fromLocationCode = that.jobContent.locationCode;
that.subList = res.data.subList;
that.detailSource = that.getDataSource(that.subList)
@ -203,8 +213,8 @@
item.subList.push(newDetail);
items.push(item)
} else {
console.log("数量",item.qty)
item.qty = calc.add(item.qty,detail.qty)
console.log("数量", item.qty)
item.qty = calc.add(item.qty, detail.qty)
let newDetail = this.createDetailInfo(detail); //
item.subList.push(newDetail);
}
@ -250,354 +260,551 @@
calcHandleQty() {
for (let item of this.detailSource) {
item.handleQty = 0;
item.handleQty = new Decimal(0).toNumber();
item.qty = new Decimal(0).toNumber();
for (let detail of item.subList) {
if (detail != undefined && detail.scaned) {
item.handleQty = calc.add(item.handleQty,detail.qty)
if (detail!= undefined) {
if (detail.scaned) {
item.handleQty = calc.add(item.handleQty, detail.handleQty);
}
item.qty = calc.add(item.qty, detail.qty);
}
}
this.$forceUpdate();
},
updateData() {
this.calcHandleQty();
},
}
this.$forceUpdate();
},
editConfirm() {
this.calcHandleQty();
this.scanPopupGetFocus();
},
updateData() {
this.calcHandleQty();
},
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;
}
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);
},
closeScanPopup() {
if(this.$refs.scanPopup!=undefined){
this.$refs.scanPopup.closeScanPopup();
}
},
}
})
}
this.$refs.scanPopup.openScanPopupForJob(fromlocationCode, fromlocationList, this.jobContent);
},
scanPopupGetFocus() {
if(this.$refs.scanPopup!=undefined){
this.$refs.scanPopup.packGetFocus();
}
},
closeScanPopup() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.closeScanPopup();
}
},
getScanResult(result) {
try {
var packingNumber = result.balance.packingNumber;
var batch = result.balance.batch;
var balanceQty = result.balance.qty;
var itemCode = result.balance.itemCode;
var inventoryStatus = result.balance.inventoryStatus;
var detail = this.detailSource.find(r => r.itemCode == itemCode);
var itemEditInfo;
//
if (detail == undefined) {
//
this.addNewItemCodeToList(result)
} else {
//
scanPopupGetFocus() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.packGetFocus();
}
},
itemEditInfo = detail.subList.find(item => {
if (item.packingNumber == packingNumber &&
item.batch == batch &&
item.inventoryStatus == inventoryStatus) {
return item;
}
})
scanPopupLoseFocus() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.packLoseFocus();
}
},
if (itemEditInfo == undefined) {
//
this.addExistItemCodeToList(detail, result);
//
getScanResult(result) {
if (this.jobContent.isOpenCount) {
this.getOpenCountResult(result);
} else {
this.getUnOpenCountResult(result);
}
},
getOpenCountResult(result) {
try {
let that = this;
that.package = result.package;
that.label = result.label;
var item = this.detailSource.find(r => r.itemCode == that.package.itemCode);
if (item == undefined) {
that.scanByBalance(result);
} else {
// let subItem = item.subList.find(item => {
// if (item.packingNumber == that.label.packingNumber &&
// item.batch == that.label.batch && item.scaned == true) {
// return item;
// }
// })
let subItems = item.subList.filter(item => {
if (item.packingNumber == that.label.packingNumber &&
item.batch == that.label.batch) {
return item;
}
})
//
if (subItems.length > 1) {
let subItem = subItems.find(r => r.scaned == false)
if (subItem == undefined) {
subItem = subItems[0];
that.editCountResult(item, subItem);
} else {
//
if (itemEditInfo.scaned) {
this.$refs.comMessage.showSelectMessageModal("箱码【" + packingNumber +
"】已经完成盘点,是否要编辑数量",
res => {
if (res) {
this.$refs.countQtyEdit.openEditPopup(itemEditInfo,
detail.subList);
} else {
this.scanPopupGetFocus();
}
})
that.scanByBalance(result);
}
} else if (subItems.length == 1) {
let subItem = subItems[0];
if (subItem.scaned) {
that.editCountResult(item, subItem);
// this.$refs.comMessage.showQuestionMessage("" + that.label.packingNumber +
// ",?",
// res => {
// if (res) {
// this.currentEditItem = subItem;
// this.$refs.countQtyEdit.openEditPopup(subItem,
// item.subList);
// // this.$refs.countQtyEdit.openEditPopupShowSeconds(subItem,
// // item.subList);
// } else {
// this.scanPopupGetFocus();
// }
// })
} else {
that.scanByBalance(result);
}
} else if (subItems.length == 0) {
that.scanByBalance(result);
}
}
} catch (e) {
this.showErrorMessage(e.message)
}
},
//
editCountResult(item, subItem) {
let that = this;
this.$refs.comMessage.showQuestionMessage("箱码【" + that.label.packingNumber +
"】已经完成盘点,是否要编辑盘点结果?",
res => {
if (res) {
this.currentEditItem = subItem;
this.$refs.countQtyEdit.openEditPopup(subItem,
item.subList);
// this.$refs.countQtyEdit.openEditPopupShowSeconds(subItem,
// item.subList);
} else {
this.scanPopupGetFocus();
}
})
},
getUnOpenCountResult(result) {
try {
let that = this;
that.package = result.package;
that.label = result.label;
var item = this.detailSource.find(r => r.itemCode == that.package.itemCode);
if (item == undefined) {
this.$refs.comMessage.showQuestionMessage("没有物料【" + that.package.itemCode +
"】的盘点明细,是否继续盘点?",
res => {
if (res) {
that.scanByLabel(result);
} else {
itemEditInfo.scaned = true;
itemEditInfo.handleQty = balanceQty;
itemEditInfo.balanceQty = balanceQty;
itemEditInfo.stdPackQty = result.package.stdPackQty;
itemEditInfo.stdPackUnit = result.package.stdPackUnit;
this.$refs.countQtyEdit.openEditPopupShowSeconds(itemEditInfo, detail
.subList);
this.updateData()
this.scanPopupGetFocus();
}
})
} else {
let subItem = item.subList.find(item => {
if (item.packingNumber == that.label.packingNumber &&
item.batch == that.label.batch && item.scaned == true) {
return item;
}
})
if (subItem != undefined) {
this.$refs.comMessage.showQuestionMessage("箱码【" + that.label.packingNumber +
"】已经完成盘点,是否要编辑盘点结果?",
res => {
if (res) {
this.currentEditItem = subItem;
this.$refs.countQtyEdit.openEditPopup(subItem,
item.subList);
} else {
this.scanPopupGetFocus();
}
})
} else {
that.scanByLabel(result);
}
} catch (e) {
this.showErrorMessage(e.message)
}
},
} catch (e) {
this.showErrorMessage(e.message)
}
},
addNewItemCodeToList(result) {
this.$refs.comMessage.showSelectMessageModal("物料[" + result.balance.itemCode + "]不在列表中,是否添加到列表?",
//
scanByBalance(result) {
let that = this;
if (result.balance.length == 0) {
that.scanPopupLoseFocus()
that.$refs.comMessage.showQuestionMessage("该包装在来源库位[" + that.fromLocationCode +
"],未查找到库存,是否继续盘点?",
res => {
if (res) {
var item = this.createAddItemInfo(result.balance, result.package);
let newDetail = this.createAddDetailInfo(result.balance, result.package); //
item.subList.push(newDetail);
this.detailSource.push(item)
this.updateData()
that.editInventoryStatus = true;
let item = that.package;
item.packingNumber = that.label.packingNumber;
item.qty = 0
item.handleQty = Number(that.label.qty);
item.balanceQty = 0;
item.inventoryStatus = "OK";
that.balance = item;
that.$refs.countQtyEdit.openEditPopupShowSeconds(item,
null);
} else {
//
that.scanPopupGetFocus();
}
})
} else if (result.balance.length == 1) {
this.countByBalance(result.balance[0]);
} else {
//
this.$refs.balanceSelect.openPopup(result.balance);
}
},
},
//
scanByLabel(result) {
let that = this;
that.scanPopupLoseFocus()
let item = that.package;
item.packingNumber = that.label.packingNumber;
item.qty = 0
item.handleQty = Number(that.label.qty);
item.balanceQty = 0;
item.inventoryStatus = "OK";
that.balance = item;
that.$refs.countQtyEdit.openEditPopupShowSeconds(item,
null);
},
addExistItemCodeToList(detail, result) {
this.$refs.comMessage.showSelectMessageModal("箱码[" + result.balance.packingNumber +
"]不在列表中,是否添加到列表?",
res => {
if (res) {
detail.qty += Number(detail.qty)
let newDetail = this.createAddDetailInfo(result.balance, result.package); //
detail.subList.push(newDetail);
this.updateData()
selectBalanceItem(balance) {
this.countByBalance(balance);
},
countByBalance(balance) {
this.balance = balance;
// this.balance.qty = 0
this.balance.handleQty = Number(this.label.qty);
this.balance.balanceQty = this.balance.qty;
this.balance.stdPackQty = this.package.stdPackQty;
this.balance.stdPackUnit = this.package.stdPackUnit;
this.$refs.countQtyEdit.openEditPopupShowSeconds(this.balance,
null);
},
editConfirm(qty, inventoryStatus, mode) {
let that = this;
//
if (mode == 'edit') {
this.currentEditItem.handleQty = qty;
this.currentEditItem.inventoryStatus = inventoryStatus;
} else {
//
//
var detail = that.detailSource.find(r => r.itemCode == that.label.itemCode);
if (detail == undefined) {
//
that.addNewItemCodeToList(qty, inventoryStatus)
} else {
var itemEditInfo = detail.subList.find(item => {
if (item.packingNumber == that.label.packingNumber &&
item.batch == that.label.batch &&
item.inventoryStatus == inventoryStatus) {
return item;
}
})
},
createAddItemInfo(balance, pack) {
let item = {
itemCode: balance.itemCode,
itemName: pack.itemName,
stdPackQty: pack.stdPackQty,
stdPackUnit: pack.stdPackUnit,
qty: Number(balance.qty),
handleQty: 0,
uom: pack.uom,
subList: [],
if (itemEditInfo == undefined) {
//
that.addExistItemCodeToList(detail, qty, inventoryStatus);
} else { //
itemEditInfo.scaned = true;
itemEditInfo.handleQty = qty;
itemEditInfo.inventoryStatus = inventoryStatus;
itemEditInfo.balanceQty = that.balance.qty;
itemEditInfo.stdPackQty = that.package.stdPackQty;
itemEditInfo.stdPackUnit = that.package.stdPackUnit;
}
}
return item;
},
createAddDetailInfo(balance, pack) {
var detail = {
id: "0",
scaned: true,
countDetailNumber: "",
ownerCode: balance.ownerCode,
packingNumber: balance.packingNumber,
containerNumber: pack.containerNumber,
batch: balance.batch,
inventoryStatus: balance.inventoryStatus,
itemCode: pack.itemCode,
itemName: pack.itemName,
itemDesc1: pack.itemDesc1,
itemDesc2: pack.itemDesc2,
projectCode: "",
qty: 0,
handleQty: balance.qty,
uom: balance.uom,
number: this.jobContent.number,
remark: "",
countQty: balance.qty,
balanceQty: balance.qty,
fromLocationCode: balance.locationCode,
stdPackQty: pack.stdPackQty,
stdPackUnit: pack.stdPackUnit,
creator:this.$store.state.user.id
}
setTimeout(r => {
this.calcHandleQty();
this.scanPopupGetFocus();
}, 100)
}
return detail;
},
},
scanLocationCode(location, code) {
this.$refs.comMessage.showQuestionMessage("是否把所有的目标库位都变成默认库位[" + code + "]", res => {
this.toLocationCode = code
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = code
})
})
})
openEditConfirm() {
},
},
getScanCount() {
var scanCount = 0;
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
scanCount = scanCount + 1;
}
})
unOpenEditConfirm() {
},
editClose() {
this.scanPopupGetFocus();
},
addNewItemCodeToList(qty, inventoryStatus) {
this.$refs.comMessage.showQuestionMessage("物料[" + this.package.itemCode + "]不在列表中,是否添加到列表?",
res => {
if (res) {
var item = this.createAddItemInfo(this.balance, this.package);
let newDetail = this.createAddDetailInfo(qty, inventoryStatus); //
item.subList.push(newDetail);
this.detailSource.push(item)
this.showMessage('添加成功');
this.updateData()
this.scanPopupGetFocus();
}
})
return scanCount;
},
},
addExistItemCodeToList(detail, qty, inventoryStatus) {
let that = this;
that.scanPopupLoseFocus();
this.$refs.comMessage.showQuestionMessage("盘点结果不在明细列表中,是否添加到列表?",
res => {
if (res) {
// detail.qty = calc.add(qty, qty)
let newDetail = that.createAddDetailInfo(qty, inventoryStatus); //
detail.subList.push(newDetail);
this.showMessage('添加成功');
that.updateData()
}
that.scanPopupGetFocus();
})
},
createAddItemInfo() {
let item = {
itemCode: this.package.itemCode,
itemName: this.package.itemName,
stdPackQty: this.package.stdPackQty,
stdPackUnit: this.package.stdPackUnit,
// qty: Number(qty),
qty: 0,
handleQty: 0,
uom: this.package.uom,
subList: [],
}
return item;
},
//
createAddDetailInfo(qty, inventoryStatus) {
var detail = {
id: "0", //
scaned: true,
countDetailNumber: "",
ownerCode: this.balance.ownerCode,
packingNumber: this.package.number,
containerNumber: this.balance.containerNumber,
batch: this.package.batch,
inventoryStatus: inventoryStatus,
itemCode: this.package.itemCode,
itemName: this.package.itemName,
itemDesc1: this.package.itemDesc1,
itemDesc2: this.package.itemDesc2,
stdPackQty: this.package.stdPackQty,
stdPackUnit: this.package.stdPackUnit,
projectCode: "",
qty: 0,
handleQty: qty,
uom: this.package.uom,
number: this.jobContent.number,
remark: "",
countQty: qty,
balanceQty: this.balance.qty,
fromLocationCode: this.balance.locationCode,
creator: this.$store.state.user.id
}
return detail;
},
getTotalCount() {
var totalCount = 0;
scanLocationCode(location, code) {
this.$refs.comMessage.showQuestionMessage("是否把所有的目标库位都变成默认库位[" + code + "]", res => {
this.toLocationCode = code
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
totalCount = totalCount + 1;
detail.toLocationCode = code
})
})
return totalCount;
},
})
},
commit() {
this.scanCount = this.getScanCount();
getScanCount() {
var scanCount = 0;
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
scanCount = scanCount + 1;
}
})
})
return scanCount;
},
if (this.scanCount == this.getTotalCount()) {
this.submitJob();
} else if (this.scanCount < this.getTotalCount()) {
//
if (this.jobContent.allowPartialComplete == "TRUE") {
//
this.$refs.comMessage.showQuestionMessage("已经扫描[" + this.scanCount +
"]总共[" + this
.getTotalCount() + "],是否把未扫描的盘点数量设置为0?",
res => {
if (res) {
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (!detail.scaned) {
detail.countQty = 0;
}
})
getTotalCount() {
var totalCount = 0;
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
totalCount = totalCount + 1;
})
})
return totalCount;
},
commit() {
this.scanCount = this.getScanCount();
if (this.scanCount == this.getTotalCount()) {
this.submitJob();
} else if (this.scanCount < this.getTotalCount()) {
//
if (this.jobContent.allowPartialComplete == "TRUE") {
//
this.$refs.comMessage.showQuestionMessage("已经扫描[" + this.scanCount +
"]总共[" + this
.getTotalCount() + "],是否把未扫描的盘点数量设置为0?",
res => {
if (res) {
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (!detail.scaned) {
detail.countQty = 0;
}
})
this.submitJob();
}
});
})
this.submitJob();
}
});
} else {
//
this.$refs.comMessage.showErrorMessage('请完成扫描后,再进行提交<br>' + "已经扫描[" + this.scanCount +
"]总共[" + this
.getTotalCount() + "]", res => {
if (res) {
this.openScanPopup();
}
});
}
} else {
//
this.$refs.comMessage.showErrorMessage('请完成扫描后,再进行提交<br>' + "已经扫描[" + this.scanCount +
"]总共[" + this
.getTotalCount() + "]", res => {
if (res) {
this.openScanPopup();
}
});
}
}
},
},
submitJob() {
uni.showLoading({
title: "提交中....",
mask: true
});
var params = this.setParams()
console.log("提交参数", JSON.stringify(params));
countJobSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成盘点记录<br>" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
submitJob() {
uni.showLoading({
title: "提交中....",
mask: true
});
var params = this.setParams()
console.log("提交参数", JSON.stringify(params));
countJobSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成盘点记录<br>" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
},
setParams() {
var subList = []
var creator = this.$store.state.user.id
setParams() {
var subList = []
var creator = this.$store.state.user.id
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
detail.countQty = detail.handleQty;
}
subList.push(detail)
})
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
detail.countQty = detail.handleQty;
}
subList.push(detail)
})
this.jobContent.subList = subList
this.jobContent.creator = creator;
return this.jobContent;
},
})
this.jobContent.subList = subList
this.jobContent.creator = creator;
return this.jobContent;
},
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);
},
showMessage(message) {
this.$refs.comMessage.showMessage(message, res => {
if (res) {
this.afterCloseMessage()
}
});
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
this.afterCloseMessage()
}
});
},
afterCloseMessage() {
this.scanPopupGetFocus();
},
showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message);
},
closeScanMessage() {
this.scanPopupGetFocus();
},
afterCloseMessage() {
this.scanPopupGetFocus();
},
editItem(item) {
var detail = this.detailSource.find(r => r.itemCode == item.itemCode);
this.$refs.countQtyEdit.openEditPopup(item,
detail.subList);
},
closeScanMessage() {
this.scanPopupGetFocus();
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
navigateBack(1);
})
},
getCountStageName(value) {
return getCountStageName(value)
},
isOpenCount(value) {
return value == "TRUE" ? "明盘" : "盲盘"
}
editItem(item) {
this.currentEditItem = item;
var detail = this.detailSource.find(r => r.itemCode == item.itemCode);
this.$refs.countQtyEdit.openEditPopup(item,
detail.subList);
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
navigateBack(1);
})
},
getCountStageName(value) {
return getCountStageName(value)
},
isOpenCount(value) {
return value == "TRUE" ? "明盘" : "盲盘"
}
}
}
</script>
<style scoped lang="scss">

43
pages/count/record/countRecord.vue

@ -34,7 +34,7 @@
</view>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
</view>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult'></win-scan-pack-and-location>
<win-scan-location ref="scanFromLocationCode" title="盘点库位" @getLocation='getLocation'
:locationTypeList="fromLocationTypeArray"></win-scan-location>
@ -50,11 +50,15 @@
getDataSource,
navigateBack
} from '@/common/basic.js';
import {
calc
} from '@/common/calc.js';
import {
getDirectoryItemArray
} from '@/common/directory.js';
import {
getBusinessType,
} from '@/common/record.js';
@ -119,7 +123,7 @@
this.showErrorMessage(res.message)
}
});
},
//
onNavigationBarButtonTap(e) {
@ -136,8 +140,7 @@
uni.stopPullDownRefresh();
},
mounted() {
},
mounted() {},
methods: {
calcScanCount(closeScan) {
let items = this.subList.filter(r => {
@ -153,10 +156,14 @@
calcHandleQty() {
for (let item of this.detailSource) {
item.handleQty = 0;
item.handleQty = new Decimal(0).toNumber();
item.qty = new Decimal(0).toNumber();
for (let detail of item.subList) {
if (item.scaned) {
item.handleQty += Number(detail.qty)
if(detail!=undefined){
if(detail.scaned){
item.handleQty = calc.add(item.handleQty,detail.handleQty);
}
item.qty = calc.add(item.qty,detail.qty);
}
}
}
@ -195,7 +202,7 @@
balanceByLocation(this.fromLocationCode, res => {
this.subList = res.data.list;
this.detailSource = getDataSource(this.subList);
});
},
@ -218,13 +225,13 @@
},
closeScanPopup() {
if(this.$refs.scanPopup!=undefined){
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.closeScanPopup();
}
},
scanPopupGetFocus() {
if(this.$refs.scanPopup!=undefined){
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.packGetFocus();
}
},
@ -237,12 +244,12 @@
var itemCode = result.balance.itemCode;
var inventoryStatus = result.balance.inventoryStatus;
var detail = this.detailSource.find(r => r.itemCode == itemCode);
//
//
if (detail == undefined) {
//
//
this.addNewItemCodeToList(result)
} else {
//
//
this.itemEditInfo = detail.subList.find(item => {
if (item.packingNumber == packingNumber &&
@ -263,9 +270,7 @@
if (res) {
this.$refs.CountQtyEdit.openEditPopup(this.itemEditInfo,
detail.subList);
}
else
{
} else {
this.scanPopupGetFocus();
}
})
@ -303,7 +308,7 @@
return record;
},
addExistItemCodeToList(detail, result) {
detail.qty += detail.qty
detail.qty = calc.add(detail.qty,detail.qty)
let newDetail = this.createAddDetailInfo(result.balance, result.package); //
detail.subList.push(newDetail);
},

4
pages/customerReturn/coms/comReturnRecord.vue

@ -5,7 +5,7 @@
<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"
<item-qty :dataContent="dataContent"
:isShowBalance="true"></item-qty>
</uni-swipe-action-item>
</uni-swipe-action>
@ -102,7 +102,7 @@
methods: {
removeData(e, dataContent) {
if (e.content.text == "清空") {
this.$refs.comMessage.showQuestionMessage("确定清空零件及箱码信息?",
this.$refs.comMessage.showQuestionMessage("确定清空物料及箱码信息?",
res => {
if (res) {
this.$emit('removeItem')

8
pages/customerReturn/job/returnDetail.vue

@ -82,7 +82,6 @@
data() {
return {
id: '',
received: false,
scanCount: 0,
jobContent: {}, //
subList: [], //subList
@ -92,6 +91,7 @@
toLocationCode: "",
toLocationInfo: {},
tolocationTypeList: [],
jobStatus:""
};
},
onLoad(option) {
@ -100,7 +100,6 @@
//
if (option.status == "1") {
this.receive((callback => {
this.received = true;
this.getDetail();
}));
} else {
@ -118,7 +117,7 @@
onBackPress(e) {
//
if (e.from == 'backbutton') {
if (this.received) {
if (this.jobStatus=="2") {
//
cancleTakeCustomerReturnJob(this.id).then(res => {
uni.navigateBack();
@ -167,8 +166,9 @@
if (res.data.subList.length > 0) {
that.jobContent = res.data;
that.subList = res.data.subList;
that.jobStatus = res.data.status
that.detailSource = getDataSource(that.subList)
that.fromLocationCode = that.subList[0].fromLocationCode
that.toLocationCode = that.subList[0].toLocationCode
that.tolocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes)

7
pages/customerReturn/record/returnRecord.vue

@ -1,7 +1,7 @@
<template>
<view class="page-wraper">
<view class="">
<com-blank-view @goScan='getLocation' 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">
<view class="page-main">
@ -149,8 +149,10 @@
}
})
if (item == undefined) {
var itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack); //
itemp.subList.push(newDetail);
this.detailSource.push(itemp)
} else {
@ -316,7 +318,6 @@
},
setParams() {
var subList = []
var creator = this.$store.state.user.id
this.detailSource.forEach(item => {
@ -346,7 +347,7 @@
submitItem.fromLocationCode = detail.locationCode;
submitItem.toLocationCode = detail.toLocationCode;
submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty;
submitItem.qty = detail.handleQty;
submitItem.package ="";
subList.push(submitItem)

76
pages/customerReturn/request/customerReturnRequestCreate.vue

@ -1,13 +1,13 @@
<template>
<view class="page-wraper">
<view class="">
<com-blank-view @goScan='getLocation' 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">
<view class="uni-flex uni-row padding title u-col-center" @click="showSelect">
<text>客户 : </text>
<view class="uni-flex uni-row padding title u-col-center" @click="showSelect" style="font-size: 35rpx;">
<text style="font-size: 32rpx;">客户 : </text>
<view class="uni-flex u-col-center uni-row" @click="showSelect">
<view class="" style="margin-left: 20rpx;">
<view class="" style="margin-left: 20rpx;font-size: 32rpx;">
{{customerName}}
</view>
<u-select v-model="showCustomer" mode="single-column" :list="customerList" @confirm="confirmSelect">
@ -17,13 +17,12 @@
<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" :isShowLocation="true"
:isShowToLocation="false" @removeItem="removeItem(index,item)" @updateData="updateData"
@removePack="removePack">
:isShowBalanceQty="false" :isShowToLocation="false" @removeItem="removeItem(index,item)"
@updateData="updateData" @removePack="removePack">
</record-com-detail-card>
</view>
</view>
@ -56,6 +55,9 @@
</template>
<script>
import {
calc
} from '@/common/calc'
import {
customerReturnRequestSubmit,
getBasicCustomerList
@ -71,6 +73,7 @@
import {
goHome,
updateTitle,
deepCopyData,
getPackingNumberAndBatchByList
} from '@/common/basic.js';
@ -210,7 +213,7 @@
});
},
calcHandleQty() {
calcHandleQty(this.detailSource)
calcHandleQty(this.detailSource);
this.$forceUpdate();
},
@ -269,10 +272,10 @@
},
commit() {
// if (this.toLocationCode == "") {
// this.showMessage("")
// return;
// }
if (this.customerName == ""||this.customerName == "请选择退货客户") {
this.showErrorMessage("请选择退货客户")
return;
}
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) {
//
uni.showLoading({
@ -328,40 +331,47 @@
setParams() {
var subList = []
var creator = this.$store.state.user.id
this.dataContent.subList = subList;
this.dataContent.creator = creator;
this.dataContent.customerCode = 'CF';
this.dataContent.fromWarehouseCode = this.fromLocation.warehouseCode;
this.dataContent.toWarehouseCode = this.toWarehouseCode;
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
detail.itemCode = detail.itemCode;
detail.itemName = detail.package.itemName;
detail.itemDesc1 = detail.package.itemDesc1;
detail.itemDesc2 = detail.package.itemDesc2;
var submitItem = deepCopyData(detail)
submitItem.itemCode = detail.itemCode;
submitItem.itemName = detail.package.itemName;
submitItem.itemDesc1 = detail.package.itemDesc1;
submitItem.itemDesc2 = detail.package.itemDesc2;
detail.inventoryStatus = detail.inventoryStatus;
detail.toInventoryStatus = 'HOLD';
submitItem.inventoryStatus = detail.inventoryStatus;
submitItem.toInventoryStatus = 'HOLD';
detail.fromPackingNumber = detail.packingNumber;
detail.toPackingNumber = detail.packingNumber;
submitItem.fromPackingNumber = detail.packingNumber;
submitItem.toPackingNumber = detail.packingNumber;
detail.fromContainerNumber = detail.containerNumber;
detail.toContainerNumber = detail.containerNumber
submitItem.fromContainerNumber = detail.containerNumber;
submitItem.toContainerNumber = detail.containerNumber
detail.fromBatch = detail.batch;
detail.toBatch = detail.batch;
submitItem.fromBatch = detail.batch;
submitItem.toBatch = detail.batch;
detail.fromLocationCode = detail.locationCode;
detail.toLocationCode = 'HOLD';
submitItem.qty = detail.handleQty;
subList.push(detail)
submitItem.fromLocationCode = detail.locationCode;
submitItem.toLocationCode = 'HOLD';
submitItem.package = ""
subList.push(submitItem)
}
})
})
this.dataContent.subList = subList;
this.dataContent.creator = creator;
this.dataContent.customerCode = this.customerCode;
this.dataContent.fromWarehouseCode = this.fromLocation.warehouseCode;
this.dataContent.toWarehouseCode = this.toWarehouseCode;
return this.dataContent;
},
@ -414,6 +424,8 @@
this.toLocationCode = '';
this.dataContent = {}
this.toWarehouseCode = ""
this.customerName ="请选择退货客户"
this.customerCode =""
},
updateData() {

46
pages/deliver/coms/comDeliverRequestPopup.vue

@ -26,10 +26,10 @@
<u-line />
<view class="uni-flex uni-row padding title u-col-center">
<text>零件 : </text>
<text>物料 : </text>
<view class="uni-flex u-col-center uni-row">
<u-input v-model="itemCode" :focus="itemCodeFocus" :border="true"
placeholder="请输入需求零件" @confirm="itemCodeConfirm" />
placeholder="请输入需求物料" @confirm="itemCodeConfirm" />
<image src="/static/search.svg" mode=""
style=" width: 40rpx;height: 40rpx;margin-left: 10rpx;" @click="itemCodeClick">
</image>
@ -42,10 +42,13 @@
<text>数量 : </text>
<view class="uni-flex uni-row uni-center"
style="align-items: center;margin-left: 20rpx;">
<uni-number-box :value="counQty" @change="change" style='margin-left: 10rpx;'
:focus="numberFocus" @blur='numberFocus = false'>
</uni-number-box>
<input style="text-align: center;" class="qty_input" v-model="counQty" type="number"
@confirm="confirm()" :focus="numberFocus" @input="checkNum" :maxlength="maxlength" />
<uom :uom="uom"></uom>
<!-- <view class="" v-if="stdPackInfo!=undefined" style="display: flex;flex-direction: row;margin-left: 10rpx;">
(<stdPackQty :dataContent="stdPackInfo"></stdPackQty>)
</view> -->
</view>
</view>
@ -101,7 +104,7 @@
requestInfo: null,
itemCodeList: [],
isCheckItemCode: false,
counQty: 0,
counQty: undefined,
editPosition: true,
numberFocus: false,
uom: "",
@ -109,7 +112,9 @@
isModifiedPosition: true,
customerList: [],
customerName: "请选择客户",
customerCode:""
customerCode:"",
maxlength:10,
stdPackInfo:undefined
}
},
props: {
@ -119,6 +124,21 @@
},
},
methods: {
checkNum(e) {
let value = e.detail.value;
let dot = value.indexOf('.'); //
let reg = /^[0-9]+$/; //
if (dot > -1) {
this.maxlength = dot + 7; //
if (value.length > dot + 7) {
}
}
if (reg.test(value)) { //
this.maxlength = 10;
}
this.change(value)
},
openRequestPopup(editPosition) {
if (this.customerList.length == 0) {
getBasicCustomerList().then(res => {
@ -142,6 +162,7 @@
this.itemCode = "";
this.uom = ""
this.qty = 0
this.counQty =undefined;
this.itemCodeGetFocus();
}
@ -176,9 +197,14 @@
confirm() {
if (this.itemCode == "" || !this.isCheckItemCode) {
this.showErrorMessage("请输入零件", "itemCode")
this.showErrorMessage("请输入物料", "itemCode")
return
}
if (this.counQty == undefined) {
this.showErrorMessage("请输入数量")
return
}
if (this.qty == 0) {
this.showErrorMessage("数量必须大于0")
return
@ -194,7 +220,7 @@
},
checkItemCode() {
//
//
getBasicItemByCode(this.itemCode).then(res => {
uni.hideLoading();
if (res.data != null && res.data.list.length > 0) {
@ -204,7 +230,7 @@
this.numberFocus = true
this.uom = res.data.list[0].uom
} else {
this.showErrorMessage('未查找到零件【' + this.itemCode + '】', "itemCode");
this.showErrorMessage('未查找到物料【' + this.itemCode + '】', "itemCode");
}
}).catch(error => {

97
pages/deliver/coms/comScanDeliverPack.vue

@ -3,10 +3,17 @@
<uni-popup ref="popup" :maskClick='false'>
<view class="">
<view class="popup_box">
<view class="pop_title">
扫描箱码
<text class="fr" @click="closeScanPopup()">关闭</text>
<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;
background-color: #fff;
margin-left: 20rpx;
@ -45,8 +52,8 @@
<view class="">
<view class="">
<win-com-scan ref="comscan" placeholder="箱标签" @getResult="onScan" :clearResult="true" :headerType="headerType"
:isShowHistory="false">
<win-com-scan ref="comscan" placeholder="箱标签" @getResult="onScan" :clearResult="true"
:headerType="headerType" :isShowHistory="false">
</win-com-scan>
<view style="width: 100%;">
@ -102,6 +109,11 @@
getDetailOption,
getDetailEditRemoveOption
} from '@/common/array.js';
import {
calc
} from '@/common/calc.js';
import {
getWorkShopLineStation
} from '@/api/request2.js';
@ -128,7 +140,7 @@
type: String,
default: "HPQ,HMQ"
},
},
data() {
@ -150,9 +162,9 @@
positionInfo: "请选择位置",
positionList: [],
defaultValueList: [],
label:{},
fromInventoryStatuses :"",
packageInfo:{}
label: {},
fromInventoryStatuses: "",
packageInfo: {}
}
},
created() {
@ -185,14 +197,14 @@
let that = this;
that.fromLocationList = [];
if (that.dataContent != null) {
that.fromInventoryStatuses =this.jobContent.outInventoryStatuses
that.fromInventoryStatuses = this.jobContent.outInventoryStatuses
that.toLocation = that.dataContent[0];
that.toLocationCode = that.dataContent[0].toLocationCode;
that.fromLocationList = that.getFromLocationList();
}
},
showBalanceSelect(items,packageInfo) {
showBalanceSelect(items, packageInfo) {
this.packageInfo = packageInfo;
this.$refs.balanceSelect.openPopup(items);
},
@ -238,7 +250,7 @@
let lot = result.label.batch;
let item = that.toLocation.Items.find(r => r.itemCode == itemCode);
if (item == undefined) {
that.showErrorMessage('未查找到零件【' + itemCode + '】的发货明细',
that.showErrorMessage('未查找到物料【' + itemCode + '】的发货明细',
res => {
that.getfocus();
}
@ -250,38 +262,39 @@
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);
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);
}
} else {
this.label =result.label;
this.showBalanceSelect(balanceRes.data.list,packageInfo);
this.showErrorMessage(balanceRes.message.message);
}
} else {
this.showErrorMessage(balanceRes.message.message);
}
uni.hideLoading();
});
uni.hideLoading();
});
}
} catch (e) {
this.showErrorMessage(e.stack)
uni.hideLoading();
}
},
selectBalanceItem(balance) {
this.afterGetBalance(this.label, balance,this.packageInfo);
this.afterGetBalance(this.label, balance, this.packageInfo);
},
afterGetBalance(label, balance,packageInfo) {
afterGetBalance(label, balance, packageInfo) {
try {
let that = this;
let itemCode = label.itemCode;
@ -302,11 +315,11 @@
if (batch.Recommends.length > 0) {
let recommend = batch.Recommends.find(r => r.packingNumber == packingCode);
if (recommend != undefined) {
that.addRecord(batch, label, balance,packageInfo)
that.addRecord(batch, label, balance, packageInfo)
} else {
//
if (this.jobContent.allowModifyPackingNumber == 'TRUE') {
that.addRecord(batch, label, balance,packageInfo);
that.addRecord(batch, label, balance, packageInfo);
} else {
that.showErrorMessage('未查找到该箱码【' + packingCode + '】的明细',
res => {
@ -316,7 +329,7 @@
}
}
} else {
that.addRecord(batch, label, balance,packageInfo)
that.addRecord(batch, label, balance, packageInfo)
}
} else {
that.showErrorMessage('箱码【' + packingCode + '】已经扫描,请继续扫描下一箱',
@ -371,14 +384,14 @@
return batch;
},
creatRecord(label, balance,packageInfo) {
creatRecord(label, balance, packageInfo) {
balance.stdPackQty = packageInfo.stdPackQty
balance.stdPackUnit = packageInfo.stdPackUnit
let record = {
itemCode: label.itemCode,
packingNumber: label.packingNumber,
batch: label.batch,
qty: Number(label.qty)>Number(balance.qty)?Number(balance.qty):Number(label.qty),
qty: Number(label.qty) > Number(balance.qty) ? Number(balance.qty) : Number(label.qty),
uom: balance.uom,
inventoryStatus: balance.inventoryStatus,
balance: balance,
@ -391,13 +404,13 @@
calcBatchHandleQty(batch) {
let handleQty = 0;
batch.Records.forEach(res => {
handleQty += Number(res.qty)
handleQty = calc.add(handleQty,res.qty)
})
batch.handleQty = handleQty;
},
addRecord(batch, label, balance,packageInfo) {
let record = this.creatRecord(label, balance,packageInfo);
addRecord(batch, label, balance, packageInfo) {
let record = this.creatRecord(label, balance, packageInfo);
batch.Records.push(record);
this.issueRecord.unshift(record)
this.calcBatchHandleQty(batch);

59
pages/deliver/job/deliverDetail.vue

@ -2,9 +2,9 @@
<view class="page-wraper">
<view class="page-header">
<view class="header_job_top">
<job-top :dataContent="jobContent" ></job-top>
<job-top :dataContent="jobContent"></job-top>
</view>
<view class="header_item" >
<view class="header_item">
申请单号{{jobContent.requestNumber}}
</view>
<u-line color="#D8D8D8"></u-line>
@ -22,7 +22,7 @@
<u-line />
</view>
</view>
<view class="page-main">
<scroll-view scroll-y="true" class="">
<view v-for="(toLocation, index) in detailSource">
@ -55,6 +55,10 @@
deliverJobSubmit
} from '@/api/request2.js';
import {
calc
} from '@/common/calc.js';
import {
goHome,
updateTitle,
@ -80,7 +84,7 @@
import comScanDeliverPack from '@/pages/deliver/coms/comScanDeliverPack.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import jobTop from '@/mycomponents/job/jobTop.vue'
export default {
name: 'issueDetail',
components: {
@ -99,9 +103,9 @@
detailSource: [], //
detailOptions: [],
scanOptions: [],
status:"",
received :false,
toLocationCode:""
status: "",
toLocationCode: "",
jobStatus:""
};
},
@ -115,7 +119,6 @@
//
if (option.status == "1") {
this.receive((callback => {
this.received = true;
this.getDetail();
}));
} else {
@ -133,12 +136,21 @@
//
onBackPress(e) {
//
if (this.received) {
//
cancleTakeDeliverJob(this.id).then(res => {}).catch(error => {
this.showMessage(err);
})
if (e.from == 'backbutton') {
if (this.jobStatus=="2") {
//
cancleTakeDeliverJob(this.id).then(res => {
uni.navigateBack();
}).catch(error => {
uni.navigateBack();
})
} else {
uni.navigateBack();
}
return true;
}
},
methods: {
@ -166,9 +178,11 @@
} else {
if (res.data.subList.length > 0) {
that.jobContent = res.data;
that.jobStatus = res.data.status;
that.subList = res.data.subList;
that.detailSource = getDataSource(that.detailSource, that.subList)
that.toLocationCode =that.subList[0].toLocationCode
that.toLocationCode = that.subList[0].toLocationCode
that.resizeCollapse();
} else {
that.showMessage('列表数据为0');
@ -192,7 +206,7 @@
});
},
submit() {
uni.showLoading({
@ -204,13 +218,13 @@
var itemCodes = []
let locationCode = this.detailSource[0].toLocationCode
this.detailSource.forEach(toLocationCode => {
toLocationCode.Items.forEach(item=>{
toLocationCode.Items.forEach(item => {
itemCodes.push(item.itemCode)
})
})
//使
if (this.jobContent.useOnTheWayLocation == 'TRUE') {
if (locationCode == null) {
this.submitJob();
} else {
//
@ -235,7 +249,7 @@
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成发货记录" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg+"]")
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
@ -266,8 +280,7 @@
record.supplierCode = r.supplierCode;
//使
if (this.jobContent.useOnTheWayLocation ==
'TRUE') {
if (this.toLocationCode ==null) {
record.toPackingNumber = r
.packingNumber;
record.toBatch = r.batch;
@ -298,7 +311,7 @@
cancel() {
let that = this;
this.$refs.comMessage.showQuestionMessage('是否要清空已扫描的零件和目标库位信息?', res => {
this.$refs.comMessage.showQuestionMessage('是否要清空已扫描的物料和目标库位信息?', res => {
if (res) {
that.clearInfo();
}
@ -338,10 +351,10 @@
let handleQty = 0;
if (batch != undefined) {
batch.Records.forEach(res => {
handleQty += Number(res.qty)
handleQty = calc.add(handleQty, res.qty)
})
batch.handleQty = handleQty;
itemHandleQty += handleQty;
itemHandleQty = calc.add(itemHandleQty, handleQty)
}
})
}

5
pages/deliver/record/deliverRecord.vue

@ -172,9 +172,8 @@
}
})
if (item == undefined) {
var itemp = createItemInfo(balance.qty, pack);
var itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack); //
if(labelQty)
itemp.subList.push(newDetail);
this.detailSource.push(itemp)
} else {
@ -380,7 +379,7 @@
submitItem.fromLocationCode = detail.locationCode;
submitItem.toLocationCode = detail.toLocationCode;
submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty;
submitItem.qty = detail.handleQty;
submitItem.package ="";
subList.push(submitItem)

8
pages/deliver/request/deliverRequestCreate.vue

@ -28,6 +28,10 @@
deliverRequestSubmit,
issueRecordSubmit
} from '@/api/request2.js';
import {
calc
} from '@/common/calc.js';
import {
goHome,
@ -123,7 +127,7 @@
} else {
//
result[0].qty += item.qty
result[0].qty = calc.add(result[0].qty,item.qty)
}
}
@ -136,7 +140,7 @@
caclcQty() {
var totalQty = 0;
this.detailSource.subList.forEach(res => {
totalQty += res.qty
totalQty = calc.add(totalQty,res.qty)
})
this.detailSource.totalQty = totalQty;
},

12
pages/demo/demo.vue

@ -178,25 +178,25 @@
</view>
<u-gap height="5" bg-color="#bbb"></u-gap>
<!-- 零件组件 -->
<!-- 物料组件 -->
<view>
<view class="title-1">
零件组件
物料组件
</view>
<view class="">
<view class="title-2">零件 item</view>
<view class="title-2">物料 item</view>
<view class="view-com">
<view class="uni-flex uni-row ">
<item :dataContent="detailDataContent"></item>
</view>
</view>
<view class="title-2">零件数量 itemQty</view>
<view class="title-2">物料数量 itemQty</view>
<view class="view-com">
<item-qty :dataContent="detailDataContent" :handleQty="recordDataContent.qty"></item-qty>
</view>
<view class="title-2">零件数量 itemQty</view>
<view class="title-2">物料数量 itemQty</view>
<view class="view-com">
<partCodeSelect :list="list"></partCodeSelect>
</view>
@ -309,7 +309,7 @@
</view>
<view class="">
<view class="title-1">
零件状态组件-itemStatus
物料状态组件-itemStatus
</view>
<view class="uni-flex uni-row space-between" style="margin:20rpx">

2
pages/index/index.vue

@ -317,7 +317,7 @@
},
getDictory() {
var params = {
types: ["job_status", "location_type", "item_status", "uom",
types: ["job_status", "location_type", "item_status","item_type","uom",
"inventory_status", "container_type", "pack_unit", "unplanned_receipt_reason",
"unplanned_issue_reason", "scrap_reason", "inspect_failed_reason",
"request_status", "inspect_type", "next_action", "sample_method", "transfer_mode",

34
pages/inspect/coms/inspectEdit.vue

@ -17,7 +17,7 @@
<view class="list_cell uni-flex uni-row space-between">
<view class="title">不合格数量</view>
<view class="uni-flex uni-row u-col-center" style="">
<input class="qty_inspect_input" v-model="dataContent.failedQty" :focus="true" type="number" />
<input class="qty_inspect_input" v-model="dataContent.failedQty" :focus="true" type="number" @input="checkNum" :maxlength="maxlength" />
<uom :uom="dataContent.uom"></uom>
</view>
@ -25,7 +25,7 @@
<view class="list_cell uni-flex uni-row space-between">
<view class="title">报废数量</view>
<view class="uni-flex uni-row u-col-center" style="">
<input class="qty_inspect_input" v-model="dataContent.crackQty" :focus="true" type="number" />
<input class="qty_inspect_input" v-model="dataContent.crackQty" :focus="true" type="number" @input="checkNum" :maxlength="maxlength" />
<uom :uom="dataContent.uom"></uom>
</view>
@ -68,9 +68,13 @@
} from '@/common/directory.js';
import {
deepCopyData
deepCopyData,
} from '@/common/basic.js';
import {
calc,
} from '@/common/calc.js';
import {
uploadFile,
getFileList,
@ -94,7 +98,8 @@
failedReasonArray: [],
dataContent: {},
inspectResultArray: [],
picInfoList: []
picInfoList: [],
maxlength: 10
}
},
props: {
@ -110,6 +115,20 @@
},
methods: {
checkNum(e) {
let value = e.detail.value;
let dot = value.indexOf('.'); //
let reg = /^[0-9]+$/; //
if (dot > -1) {
this.maxlength = dot + 7; //
if (value.length > dot + 7) {
}
}
if (reg.test(value)) { //
this.maxlength = 10;
}
},
openEditPopup(item) {
this.failedReasonArray = getInspectFailedReasonList();
this.inspectResultArray =getInspectResultList()
@ -222,8 +241,8 @@
var failedQty = Number(this.dataContent.failedQty);
var crackQty = Number(this.dataContent.crackQty);
var qty = Number(this.dataContent.qty);
if (crackQty + failedQty > qty) {
var total = crackQty + failedQty;
if (calc.add(crackQty,failedQty)> qty) {
var total = calc.add(crackQty,failedQty)
this.showMessage("不合格数[" + failedQty + "]+报废数量[" + crackQty + "]等于[" + total + "]大于收货数量[" +
qty + "]")
return
@ -242,7 +261,8 @@
this.dataContent.failedQty = failedQty;
this.dataContent.crackQty = crackQty
this.dataContent.goodQty = this.dataContent.handleQty - failedQty - crackQty
var temp=calc.sub(this.dataContent.handleQty,failedQty);
this.dataContent.goodQty =calc.sub(temp,failedQty,crackQty);
this.afterSave()

22
pages/inspect/job/inspectDetail.vue

@ -40,8 +40,8 @@
cancleTakeInspectJob,
getInspectJobDetail,
inspectJobSubmit,
deleteFileById,
getFileList
getFileList,
deleteFileByTable
} from '@/api/request2.js';
import {
goHome,
@ -147,25 +147,15 @@
},
methods: {
deleteFileById(id) {
deleteFileById(id).then(res => {
})
},
getFileList(id) {
getFileList("jobInspectDetail", id).then(res => {
if (res.data) {
res.data.forEach(res => {
this.deleteFileById(res.id)
})
}
deleteFileByTable(id) {
debugger
deleteFileByTable("jobInspectDetail", id).then(res=>{
})
},
clearPicList(subList) {
subList.forEach(item => {
this.getFileList(item.id)
this.deleteFileByTable(item.id)
})
},

53
pages/inspect/job/inspectFullDetail.vue

@ -41,7 +41,8 @@
getInspectJobDetail,
inspectJobSubmit,
deleteFileById,
getFileList
getFileList,
deleteFileByTable
} from '@/api/request2.js';
import {
goHome,
@ -59,6 +60,10 @@
getManagementPrecisions
} from '@/common/balance.js';
import {
calc
} from '@/common/calc.js';
import {
getDataSource,
createRecordInfo,
@ -87,7 +92,6 @@
data() {
return {
id: '',
received: false,
scanCount: 0,
jobContent: {}, //
subList: [], //subList
@ -96,6 +100,7 @@
fromInventoryStatuses: "",
managementList: [],
selectedItem: {},
jobStatus:""
};
},
onLoad(option) {
@ -104,7 +109,6 @@
// //
if (option.status == "1") {
this.receive((callback => {
this.received = true;
this.getDetail();
}));
} else {
@ -123,7 +127,7 @@
onBackPress(e) {
//
if (e.from == 'backbutton') {
if (this.received) {
if (this.jobStatus=="2") {
//
cancleTakeInspectJob(this.id).then(res => {
uni.navigateBack();
@ -148,27 +152,17 @@
},
methods: {
deleteFileById(id) {
deleteFileById(id).then(res => {
deleteFileByTable(id) {
deleteFileByTable("jobInspectDetail", id).then(res=>{
})
},
getFileList(id) {
getFileList("jobInspectDetail", id).then(res => {
if (res.data) {
res.data.forEach(res => {
this.deleteFileById(res.id)
})
}
})
},
clearPicList(subList) {
subList.forEach(item => {
this.getFileList(item.id)
this.deleteFileByTable(item.id)
})
},
//
receive(callback) {
uni.showLoading({
@ -200,6 +194,7 @@
} else {
if (res.data.subList.length > 0) {
that.jobContent = res.data;
that.jobStatus = res.data.status
this.jobContent.failedQty = 0;
this.jobContent.crackQty = 0;
this.jobContent.notPassedQty = 0;
@ -254,8 +249,8 @@
for (let item of this.detailSource) {
for (let detail of item.subList) {
if (detail != undefined && detail.scaned) {
failedQty += Number(detail.failedQty)
crackQty += Number(detail.crackQty)
failedQty= calc.add(failedQty,detail.failedQty)
crackQty= calc.add(crackQty,detail.crackQty)
}
}
}
@ -325,8 +320,9 @@
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 +
if (this.jobContent.allowModifyInventoryStatus == "TRUE") {
this.showQuestionMessage('任务中允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' +
itemStatus +
']不一致,是否继续检验?', res => {
if (res) {
itemDetail.scaned = true;
@ -337,13 +333,14 @@
this.scanPopupGetFocus();
}
});
}else {
this.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus +
} else {
this.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' +
itemStatus +
']不一致,不允许转移!', res => {
this.scanPopupGetFocus();
});
}
} else {
itemDetail.scaned = true;
itemDetail.balance = result.balance;
@ -467,7 +464,8 @@
detail.failedQty = detail.failedQty;
detail.crackQty = detail.crackQty;
detail.notPassedQty = detail.failedQty;
detail.goodQty = detail.handleQty - detail.failedQty - detail.crackQty;
var tempQty = calc.sub(detail.handleQt,detail.failedQty)
detail.goodQty = calc.sub(tempQty,detail.crackQty) ;
detail.inspectUser = this.$store.state.user.id
//==
@ -522,7 +520,6 @@
height: 100%;
background-color: #fff;
}
.page-wraper {
display: flex;
flex-direction: column;

8
pages/inspect/job/inspectResult.vue

@ -12,7 +12,7 @@
</view>
<view class="pda-list-cell">
<view class="pda-list-cell-left">
<view class="uni-label">零件</view>
<view class="uni-label">物料</view>
</view>
<view class="pda-list-cell-db">
<view class="uni-flex space-between">
@ -173,7 +173,6 @@
failedReasonArray: [],
nextStep: '',
submitting: false,
received: false,
locations: [],
value: ['0'],
jobContent: {}, //
@ -181,6 +180,7 @@
detailSource: [], //
nextActionList: [],
nextAction: null,
jobStatus:""
}
},
@ -199,7 +199,6 @@
// //
if (option.status == "1") {
this.receive((callback => {
this.received = true;
this.getDetail();
}));
} else {
@ -210,7 +209,7 @@
onBackPress(e) {
//
if (e.from == 'backbutton') {
if (this.received) {
if (this.jobStatus=="2") {
//
cancleTakeInspectJob(this.id).then(res => {
uni.navigateBack();
@ -257,6 +256,7 @@
if (res.data.subList.length > 0) {
that.jobContent = res.data;
that.detailList = res.data.subList;
that.jobStatus = res.data.status
that.inspectType = that.jobContent.inspectType;
that.jobContent.goodQty = null, //
that.jobContent.failedQty = null, //

4
pages/inventoryMove/coms/comMoveRecord.vue

@ -247,7 +247,7 @@
if (r.packingNumber == balance.packingNumber &&
r.batch == balance.batch &&
r.fromLocationCode == balance.locationCode &&
r.inventoryStatus == balance.inventoryStatus &&
r.toInventoryStatus == balance.inventoryStatus &&
r.scaned == true) {
return r;
}
@ -421,7 +421,7 @@
submitItem.package = null;
submitItem.Records = null;
submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty;
submitItem.qty = detail.handleQty;
subList.push(submitItem)
}

17
pages/inventoryMove/coms/comMoveRecordCard.vue

@ -5,7 +5,8 @@
<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"
<item-qty :dataContent="dataContent"
:isShowBalanceQty="false"
:isShowBalance="true"></item-qty>
</uni-swipe-action-item>
</uni-swipe-action>
@ -86,7 +87,19 @@
},
watch: {
dataContent: {
handler(newName, oldName) {
if (this.dataContent.subList.length > 0) {
if (this.$refs.collapse1 != undefined && this.$refs.collapse1 != null) {
this.$nextTick(res => {
this.$refs.collapse1.resize()
})
}
}
},
immediate: true,
deep: true
}
},
data() {

8
pages/inventoryMove/job/inventoryMoveDetail.vue

@ -92,7 +92,6 @@
data() {
return {
id: '',
received: false,
scanCount: 0,
jobContent: {}, //
subList: [], //subList
@ -103,7 +102,8 @@
managementList: [],
businessTypeCode: '',
toLocationCode: '',
toInventoryStatus: ''
toInventoryStatus: '',
jobStatus:""
};
},
props: {
@ -116,7 +116,6 @@
// //
if (option.status == "1") {
this.receive((callback => {
this.received = true;
this.getDetail();
}));
} else {
@ -135,7 +134,7 @@
onBackPress(e) {
//
if (e.from == 'backbutton') {
if (this.received) {
if (this.jobStatus=="2") {
//
cancleTakeInventoryMoveJob(this.id).then(res => {
uni.navigateBack();
@ -223,6 +222,7 @@
} else {
if (res.data.subList.length > 0) {
that.jobContent = res.data;
that.jobStatus = res.data.status
that.subList = res.data.subList;
that.detailSource = getDataSource(that.subList)
} else {

2
pages/issue-按批次推荐/coms/comIssueJobCard.vue

@ -5,7 +5,7 @@
<view class="task_item">
<view class="task_text">
需求零件 : {{dataContent.itemCode}}
需求物料 : {{dataContent.itemCode}}
</view>
<view class="task_text">
需求库位 : {{dataContent.toLocationCode}}

2
pages/issue-按批次推荐/coms/comScanIssuePack.vue

@ -195,7 +195,7 @@
let item = that.requestLocation.Items.find(r => r.itemCode == itemCode);
if (item == undefined) {
that.showErrorMessage('未查找到零件【' + itemCode + '】的发料明细',
that.showErrorMessage('未查找到物料【' + itemCode + '】的发料明细',
res => {
that.getfocus();
}

12
pages/issue-按批次推荐/job/issueDetail.vue

@ -196,7 +196,7 @@
return list;
},
//: -> Items -> Locations-> Batchs -> Records
//: -> Items -> Locations-> Batchs -> Records
createDetailInfo(location, detail) {
let that = this;
var item = location.Items.find(r =>
@ -206,7 +206,7 @@
location.Items.push(item)
} else {
item.qty += detail.qty
//
//
let location = item.Locations.find(r => r.fromLocationCode == detail.fromLocationCode);
if (location == undefined) {
location = that.createLocationInfo(detail);
@ -353,7 +353,7 @@
} else {
let item = location.Items.find(r => r.itemCode == result.label.itemCode);
if (item == undefined || item == null) {
this.showErrorMessage('未查找到零件【' + result.label.itemCode + '】的发料需求', callback => {
this.showErrorMessage('未查找到物料【' + result.label.itemCode + '】的发料需求', callback => {
})
} else {
@ -365,7 +365,7 @@
let bacth = this.createBatchInfo(result);
item.Batchs.push(bacth);
} else {
this.showErrorMessage('未查找到零件【' + result.label.itemCode + '】对应的批次【' + result.label.batch +
this.showErrorMessage('未查找到物料【' + result.label.itemCode + '】对应的批次【' + result.label.batch +
'】需求', callback => {
})
@ -399,7 +399,7 @@
mask: true
})
let that = this;
//
//
let params = {
pageSize: 100,
pageIndex: 1,
@ -554,7 +554,7 @@
cancel() {
let that = this;
showConfirmMsg('是否要清空已扫描的零件和目标库位信息?', confirm => {
showConfirmMsg('是否要清空已扫描的物料和目标库位信息?', confirm => {
if (confirm) {
that.clearInfo();
}

25
pages/issue/coms/comIssueDetailCard.vue

@ -8,7 +8,12 @@
<uni-collapse-item :open="true">
<template v-slot:title>
<!-- 物品 -->
<item-qty :dataContent="item" :handleQty="item.handleQty"></item-qty>
<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> -->
</template>
@ -21,7 +26,7 @@
</location>
</view>
<view v-for="(batch,index) in loacation.Batchs">
<recommend-balance style='margin-left: 20px;' :detail="batch" :isShowLocation="false"
<recommend-balance style='margin-left: 0rpx;' :detail="batch" :isShowLocation="false"
:isShowPack="batch.packingNumber!=null && batch.packingNumber!=''">
</recommend-balance>
<view class="uni-flex uni-row " v-if='batch.Records.length>0'>
@ -68,11 +73,12 @@
import comIssueRequestInfo from '@/pages/issue/coms/comIssueRequestInfo.vue'
import {
getDetailOption,
getEditRemoveOption
getEditRemoveOption,
getRemoveOption
} from '@/common/array.js';
export default {
emits: ['updateData'],
emits: ['updateData',"removeItemCode"],
components: {
itemQty,
recommend,
@ -107,13 +113,15 @@
editItem: {},
batchItem: {},
detailOptions: [],
scanOptions: []
scanOptions: [],
removeOptions:[]
}
},
mounted() {
this.detailOptions = getDetailOption();
this.scanOptions = getEditRemoveOption();
this.removeOptions = getRemoveOption()
},
methods: {
@ -135,6 +143,13 @@
this.remove(batch, record, index)
}
},
itemCoceClick(e,item,index){
if (e.content.text == "移除") {
this.dataContent.Items.splice(index, 1);
this.$emit('removeItemCode')
}
},
edit(batch, item) {
let that = this;

37
pages/issue/coms/comIssueRequestCreator.vue

@ -3,12 +3,12 @@
<view class="uni-flex uni-column">
<!-- <com-issue-request-info :workShopCode="dataContent.workshopCode" :dataContent="dataContent">
</com-issue-request-info> -->
<work-station :workshopCode="dataContent.workShopCode" :productionLineCode="dataContent.productionLineCode"
<work-station :fromWarehouseCode="dataContent.fromWarehouseCode" :workshopCode="dataContent.workshopCode" :productionLineCode="dataContent.productionLineCode"
:workStationCode="dataContent.workStationCode" :rawLocationCode="dataContent.toLocationCode"></work-station>
<uni-swipe-action ref="swipeAction">
<view v-for="(item, index) in dataContent.subList" :key="index">
<uni-swipe-action-item @click="swipeClick($event,item)" :right-options="detailOptions">
<uni-swipe-action-item @click="swipeClick($event,item,index)" :right-options="options">
<item-qty :dataContent="item" :isShowStdPack="false">
</item-qty>
<u-line />
@ -76,13 +76,6 @@
},
},
watch: {
dataContent: {
handler(newval, oldval) {
this.requestItem = this.dataContent.subList[0];
},
immediate: true,
deep: true
}
},
data() {
@ -94,9 +87,9 @@
}
},
requestItem: {},
detailOptions: [],
scanOptions: []
scanOptions: [],
options:[]
}
},
@ -105,26 +98,27 @@
this.detailOptions = getDetailOption();
}
if (this.scanOptions.length == 0) {
this.scanOptions = getDetailEditRemoveOption();
this.scanOptions = getDetailRemoveOption();
// if (this.dataContent.allowModifyQty == 1) {
// this.scanOptions = getDetailEditRemoveOption();
// } else {
// this.scanOptions = getDetailRemoveOption();
// }
}
if(!this.isSwipe){
this.detailOptions=[]
}
this.options =this.scanOptions
// if(!this.isSwipe){
// this.detailOptions=[]
// }
},
methods: {
swipeClick(e, item) {
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)
this.remove(item,index)
}
},
edit(item) {
@ -138,17 +132,12 @@
// // this.showItem = item;
// // this.$refs.jobDetailPopup.openPopup(item)
},
remove(item) {
remove(item,index) {
this.$refs.message.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
item.scaned = false
item.record = {}
item.balance = {}
item.inventoryStatus = item.RecommendInventoryStatus
// item.record.qty = 0;
this.dataContent.subList.splice(index, 1)
this.$forceUpdate()
this.$emit('remove', item)
}
});
},

271
pages/issue/coms/comIssueRequestPopup.vue

@ -13,6 +13,18 @@
<u-line />
<view class="uni-flex uni-column" style="background-color: white; ">
<view class="uni-flex uni-column ">
<view class="uni-flex uni-row padding title u-col-center">
<text>从仓库代码</text>
<view class="uni-flex u-col-center uni-row" @click="showWarseHouseSelect">
<view class="" style="margin-left: 20rpx;width: 100% ">
{{fromWarehouseCode}}
</view>
<u-select v-model="showWareHouse" mode="single-column" :list="wareHouseList"
@confirm="confirmWareHouse"></u-select>
</view>
</view>
<u-line />
<view class="uni-flex uni-row padding title u-col-center">
<text>位置</text>
<view class="uni-flex u-col-center uni-row" @click="showSelect">
@ -36,16 +48,22 @@
</image>
</view>
</view>
<u-line />
<u-line />
<view class="uni-flex uni-row padding title u-col-center">
<text>数量 </text>
<view class="uni-flex uni-row uni-center"
style="align-items: center;margin-left: 20rpx;">
<uni-number-box :value="counQty" @change="change" style='margin-left: 10rpx;'
:focus="numberFocus" @blur='numberFocus = false'>
</uni-number-box>
style="display: flex; align-items: center;margin-left: 20rpx;justify-content: center;">
<input style="text-align: center;" class="qty_input" v-model="counQty" type="number"
@confirm="confirm()" :focus="numberFocus" @input="checkNum"
:maxlength="maxlength" />
<uom :uom="uom"></uom>
<view class="" v-if="stdPackInfo!=undefined"
style="display: flex;flex-direction: row;margin-left: 10rpx;">
(<stdPackQty :dataContent="stdPackInfo"></stdPackQty>)
</view>
</view>
</view>
<u-line />
@ -58,7 +76,8 @@
</view>
</view>
</uni-popup>
<win-scan-item ref="scanPopup" title='物料代码' @getScanCode='getScanCode'>
<win-scan-item ref="scanPopup" title='物料代码' @getScanResult='getItemScanResult'
:itemCodeTypeList="itemCodeTypeList">
</win-scan-item>
<comMessage ref="comMessage"></comMessage>
</view>
@ -69,7 +88,8 @@
getBasicLocationByCode,
getBasicItemByCode,
getProductionlineItem,
getWorkShopLineStation
getWorkShopLineStation,
getWarehouseCodeList
} from '@/api/request2.js';
import {
getLocationTypeName,
@ -77,21 +97,21 @@
checkDirectoryItemExist
} from '@/common/directory.js';
import uom from '@/mycomponents/qty/uom.vue'
import stdPackQty from '@/mycomponents/qty/stdPackQty.vue'
import balanceStatus from '@/mycomponents/status/balanceStatus.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import winScanItem from '@/mycomponents/scan/winScanItem.vue'
export default {
components: {
uom,
balanceStatus,
comMessage,
winScanItem
winScanItem,
stdPackQty,
},
data() {
return {
// itemCode: 'CE115F11161AG',
workshopCode: "", //
workShopName: "",
productionLineCode: "", //线
@ -99,6 +119,7 @@
workStationCode: "", //
workStationName: "",
itemCode: '请扫描物料信息',
fromWarehouseCode: "请选择仓库代码",
itemName: "",
qty: 0,
rawLocationCode: "",
@ -106,8 +127,7 @@
itemCodeFocus: false,
requestInfo: null,
itemCodeList: [],
isCheckItemCode: false,
counQty: 0,
counQty: undefined,
editPosition: true,
numberFocus: false,
uom: "",
@ -115,70 +135,11 @@
show: false,
isModifiedPosition: true,
positionList: [],
list: [{
value: 1,
label: '车间1',
children: [{
value: 2,
label: '生产线1',
children: [{
value: 3,
label: '工位1'
},
{
value: 4,
label: '工位2'
}
]
},
{
value: 5,
label: '生产线2',
children: [{
value: 6,
label: '工位1'
},
{
value: 7,
label: '工位2'
}
]
}
]
},
{
value: 8,
label: '车间2',
children: [{
value: 9,
label: '生产线1',
children: [{
value: 10,
label: '工位1'
},
{
value: 10,
label: '工位2'
}
]
}, {
value: 9,
label: '生产线2',
children: [{
value: 10,
label: '工位1'
},
{
value: 10,
label: '工位2'
}
]
},
]
}
]
stdQty: 0, //
maxlength: 10,
stdPackInfo: undefined,
wareHouseList: [],
showWareHouse: false
}
},
props: {
@ -186,29 +147,82 @@
type: String,
default: '需求信息'
},
itemCodeTypeList: {
type: Array,
default: []
},
},
methods: {
checkNum(e) {
let value = e.detail.value;
let dot = value.indexOf('.'); //
let reg = /^[0-9]+$/; //
if (dot > -1) {
this.maxlength = dot + 7; //
if (value.length > dot + 7) {
}
}
if (reg.test(value)) { //
this.maxlength = 10;
}
this.change(value)
},
openRequestPopup(editPosition) {
if (this.positionList.length == 0) {
getWorkShopLineStation().then(res => {
this.positionList = res.data
}).catch(error => {
if (res.data != null && res.data.length > 0) {
this.positionList = res.data
} else {
this.showErrorMessage('未查找到位置信息');
}
}).catch(error => {
this.showErrorMessage(error);
})
}
this.editPosition = editPosition;
if (this.isModifiedPosition) {
this.isModifiedPosition = false
} else {
this.itemCode = "";
this.itemCode = "请扫描物料信息";
this.show = false
this.showWareHouse = false
this.uom = ""
this.qty = 0
this.qty = 0;
this.stdPackInfo = undefined;
this.counQty = undefined;
this.numberFocus = false
this.itemCodeGetFocus();
}
this.$refs.popup.open('bottom')
},
initData() {
this.positionList = [];
this.wareHouseList= [],
this.showWareHouse = false
this.editPosition =true;
this.itemCode = "请扫描物料信息";
this.rawLocationCode = ""
this.positionInfo = "请选择位置"
this.fromWarehouseCode = "请选择仓库代码"
this.workshopCode = "" //
this.workShopName = ""
this.productionLineCode = "" //线
this.productionLineName = ""
this.workStationCode = "" //
this.workStationName = ""
this.show = false
this.uom = ""
this.qty = 0;
this.stdPackInfo = undefined;
this.counQty = undefined;
this.numberFocus = false
},
closeRequestPopup() {
this.$refs.popup.close()
},
@ -226,16 +240,28 @@
itemCodeLoseFocus() {
this.itemCodeFocus = false;
},
selectedItem(item) {
this.itemCode = item.itemCode;
this.checkItemCode();
},
confirm() {
if (this.itemCode == "" || !this.isCheckItemCode) {
if (this.positionInfo == "请选择位置") {
this.showErrorMessage("请选择位置")
return
}
if (this.fromWarehouseCode == "请选择仓库代码") {
this.showErrorMessage("请选择仓库代码")
return
}
if (this.itemCode == "请扫描物料信息") {
this.showErrorMessage("请输入物料", "itemCode")
return
}
if (this.counQty == undefined) {
this.showErrorMessage("请输入数量")
return
}
if (this.qty == 0) {
this.showErrorMessage("数量必须大于0")
return
@ -248,28 +274,6 @@
this.callback('add');
},
checkItemCode(itemCode) {
//
getBasicItemByCode(itemCode).then(res => {
uni.hideLoading();
this.$refs.scanPopup.closeScanPopup();
if (res.data != null && res.data.list.length > 0) {
this.itemCode = res.data.list[0].code;
this.itemName = res.data.list[0].name
this.isCheckItemCode = true;
this.numberFocus = true
this.uom = res.data.list[0].uom
} else {
this.showErrorMessage('未查找到物料【' + itemCode + '】', "itemCode");
}
}).catch(error => {
uni.hideLoading();
this.showErrorMessage(error, "itemCode");
})
},
callback(action) {
let item = {
positionInfo: this.positionInfo,
@ -281,6 +285,8 @@
workStationName: this.workStationName,
rawLocationCode: this.rawLocationCode,
fgLocationCode: this.fgLocationCode,
fromWarehouseCode: this.fromWarehouseCode,
toWarehouseCode: this.fromWarehouseCode,
itemCode: this.itemCode,
itemName: this.itemName,
uom: this.uom,
@ -300,8 +306,7 @@
}
})
if (type == "itemCode") {
this.itemCode = ""
this.isCheckItemCode = false;
this.itemCode = "请扫描物料信息"
}
})
},
@ -315,8 +320,14 @@
if (this.editPosition) {
this.show = true
}
},
showWarseHouseSelect() {
if (this.editPosition) {
this.wareHouseClick();
}
},
confirmSelect(e) {
this.positionInfo = e[0].label + "-" + e[1].label + "-" + e[2].label
console.log("位置", this.positionInfo)
@ -347,14 +358,42 @@
}
},
getScanCode(code) {
if (code == "") {
this.showErrorMessage('物料号不能为空')
return;
}
this.itemCode = "";
this.checkItemCode(code)
getItemScanResult(code, scanResult) {
this.itemCode = code;
this.itemName = scanResult.name
this.uom = scanResult.uom
this.stdPackInfo = scanResult.package;
this.numberFocus = true
},
wareHouseClick() {
uni.showLoading({
title: "查询中....",
mask: true
});
getWarehouseCodeList(1, 100).then(res => {
uni.hideLoading()
if (res.data != null && res.data.list.length > 0) {
res.data.list.forEach(item => {
item.value = item.code;
item.label = item.name;
})
this.wareHouseList = res.data.list
this.showWareHouse = true
} else {
this.showErrorMessage('未查找到仓库代码');
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error);
})
},
confirmWareHouse(e) {
this.fromWarehouseCode = e[0].value;
},
}
}

38
pages/issue/coms/comScanIssuePack.vue

@ -3,9 +3,16 @@
<uni-popup ref="popup" :maskClick='false'>
<view class="">
<view class="popup_box">
<view class="pop_title">
扫描箱码
<text class="fr" @click="closeScanPopup()">关闭</text>
<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;
background-color: #fff;
@ -45,8 +52,8 @@
<view class="">
<view class="">
<win-com-scan ref="comscan" placeholder="箱标签" @getResult="onScan" :clearResult="true" headerType ="HPQ,HMQ"
:isShowHistory="false">
<win-com-scan ref="comscan" placeholder="箱标签" @getResult="onScan" :clearResult="true"
headerType="HPQ,HMQ" :isShowHistory="false">
</win-com-scan>
<view style="width: 100%;">
@ -106,6 +113,10 @@
getWorkShopLineStation
} from '@/api/request2.js';
import {
calc
} from '@/common/calc.js';
import {
getBalanceByManagementPrecision
} from '@/common/balance.js';
@ -234,7 +245,7 @@
let lot = result.label.batch;
let item = that.toLocation.Items.find(r => r.itemCode == itemCode);
if (item == undefined) {
that.showErrorMessage('未查找到零件【' + itemCode + '】的发料明细',
that.showErrorMessage('未查找到物料【' + itemCode + '】的发料明细',
res => {
that.getfocus();
}
@ -325,9 +336,9 @@
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){
if (fromLocation.Batchs.length > 0) {
batch.detail = fromLocation.Batchs[0].detail;
}
fromLocation.Batchs.unshift(batch);
@ -356,7 +367,7 @@
}
},
createBatchInfo(data, balance,packageInfo) {
createBatchInfo(data, balance, packageInfo) {
let batch = {
batch: data.batch,
qty: 0,
@ -364,7 +375,7 @@
handleQty: Number(data.qty),
Records: []
}
let record = this.creatRecord(data, balance,packageInfo);
let record = this.creatRecord(data, balance, packageInfo);
batch.Records.push(record);
this.issueRecord.unshift(record)
return batch;
@ -374,11 +385,12 @@
balance.stdPackQty = packageInfo.stdPackQty
balance.stdPackUnit = packageInfo.stdPackUnit
let record = {
scaned:true,
scaned: true,
itemCode: label.itemCode,
packingNumber: label.packingNumber,
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),
uom: balance.uom,
inventoryStatus: balance.inventoryStatus,
balance: balance,
@ -391,7 +403,7 @@
calcBatchHandleQty(batch) {
let handleQty = 0;
batch.Records.forEach(res => {
handleQty += Number(res.qty)
handleQty = calc.add(handleQty,res.qty)
})
batch.handleQty = handleQty;

100
pages/issue/job/issueDetail.vue

@ -10,23 +10,28 @@
</view>
<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>
<view v-for="(toLocation, index) in detailSource">
<work-station :workshopCode="jobContent.workShopCode"
:productionLineCode="toLocation.productionLineCode"
:workStationCode="toLocation.workStationCode" :rawLocationCode="toLocation.toLocationCode">
</work-station>
<com-issue-detail-card ref='comIssueDetailCard' :dataContent="toLocation" @updateData='updateData'>
</com-issue-detail-card>
</view>
</scroll-view>
</view>
<div class="btn_bottom">
<view class="" style="display: flex;flex-direction: row;">
<view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
<view class="">
<!-- <button class="btn_commit" hover-class="btn_commit_after" @click="resizeCollapse()">刷新UI</button> -->
<button class="btn_commit" hover-class="btn_commit_after" @click="submit()">提交</button>
</view>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="submit()">提交</button>
</view>
</view>
</div>
</view>
<win-scan-button @goScan='openScanDetailPopup'></win-scan-button>
<com-scan-issue-pack ref="comScanIssuePack" @closeScan='closeScan' @updateData='updateData'>
</com-scan-issue-pack>
@ -59,6 +64,10 @@
import {
getManagementPrecisions
} from '@/common/balance.js';
import {
calc
} from '@/common/calc.js';
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
import comIssueDetailCard from '@/pages/issue/coms/comIssueDetailCard.vue'
@ -88,7 +97,8 @@
subList: [], //subList
detailSource: [], //
detailOptions: [],
scanOptions: []
scanOptions: [],
jobStatus:""
};
},
@ -102,7 +112,6 @@
//
if (option.status == "1") {
this.receive((callback => {
this.received = true;
this.getDetail();
}));
} else {
@ -120,12 +129,21 @@
//
onBackPress(e) {
//
if (this.received) {
//
cancleTakeIssueJob(this.id).then(res => {}).catch(error => {
this.showMessage(err);
})
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: {
@ -176,6 +194,7 @@
} else {
if (res.data.subList.length > 0) {
that.jobContent = res.data;
that.jobStatus = res.data.status
that.subList = res.data.subList;
that.detailSource = getDataSource(that.detailSource, that.subList)
@ -266,9 +285,9 @@
issueJobSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成发料记录" + res.data)
this.showCommitSuccessMessage("提交成功<br>生成发料记录<br>" + res.data)
} else {
this.showErrorMessage("提交失败" + res.msg)
this.showErrorMessage("提交失败[" + res.msg+"]")
}
}).catch(error => {
uni.hideLoading()
@ -277,7 +296,7 @@
},
setParams() {
var commitSubList = []
var subList = []
var createTime = getCurrDateTime();
var creator = this.$store.state.user.id
this.detailSource.forEach(toLocationCode => {
@ -285,19 +304,19 @@
item.Locations.forEach(fromLocation => {
fromLocation.Batchs.forEach(batch => {
let subItem = batch.detail;
if(subItem!=undefined){
if (subItem != undefined) {
subItem.recordList = [];
if (batch.Records.length > 0) {
subItem.recordList = [];
batch.Records.forEach(r => {
let record = {};
record.handleQty = r.qty;
record.fromPackingNumber = r
.packingNumber;
record.fromBatch = r.batch;
record.fromContainerNumber = r
.ContainerNumber;
record.toContainerNumber = r
.ContainerNumber;
record.toInventoryStatus = r
@ -305,33 +324,44 @@
record.toLocationCode = subItem
.toLocationCode;
record.supplierCode = r.supplierCode;
let single_price = r.balance
.singlePrice == null ? 0 : r
.balance
.singlePrice;
record.singlePrice = single_price;
record.amount = single_price * r.qty;
//使
if (this.jobContent.useOnTheWayLocation ==
if (this.jobContent
.useOnTheWayLocation ==
'TRUE') {
record.toPackingNumber = r
.packingNumber;
record.toBatch = r.batch;
} else {
var info = getPackingNumberAndBatch(
this.managementList, r
.itemCode,
r.packingNumber, r
.batch);
var info =
getPackingNumberAndBatch(
this.managementList, r
.itemCode,
r.packingNumber, r
.batch);
record.toPackingNumber = info
.packingNumber;
record.toBatch = info.batch;
}
subItem.recordList.push(record);
})
commitSubList.push(subItem);
subList.push(subItem);
}
}
})
})
})
})
this.jobContent.subList = commitSubList
this.jobContent.subList = subList
this.jobContent.createTime = createTime;
this.jobContent.creator = creator;
return this.jobContent;
@ -339,7 +369,7 @@
cancel() {
let that = this;
this.$refs.comMessage.showQuestionMessage('是否要清空已扫描的零件和目标库位信息?', res => {
this.$refs.comMessage.showQuestionMessage('是否要清空已扫描的物料和目标库位信息?', res => {
if (res) {
that.clearInfo();
}
@ -379,10 +409,10 @@
let handleQty = 0;
if (batch != undefined) {
batch.Records.forEach(res => {
handleQty += Number(res.qty)
handleQty = calc.add(handleQty,res.qty)
})
batch.handleQty = handleQty;
itemHandleQty += handleQty;
itemHandleQty = calc.add(itemHandleQty,handleQty)
}
})
}

9
pages/issue/js/issue.js

@ -1,3 +1,6 @@
import {
calc
} from '@/common/calc.js';
export function getDataSource(list, subList) {
for (var i = 0; i < subList.length; i++) {
let detail = subList[i];
@ -17,7 +20,7 @@ export function getDataSource(list, subList) {
return list;
}
//树形结构:需求库位 -> 零件Items -> 库位 Locations-> 批次Batchs -> 记录Records
//树形结构:需求库位 -> 物料Items -> 库位 Locations-> 批次Batchs -> 记录Records
export function createDetailInfo(location, detail) {
var item = location.Items.find(r =>
r.itemCode == detail.itemCode)
@ -25,8 +28,8 @@ export function createDetailInfo(location, detail) {
item = createItemInfo(detail);
location.Items.push(item)
} else {
item.qty += detail.qty
//在零件下查找库位
item.qty = calc.add(item.qty,detail.qty)
//在物料下查找库位
let location = item.Locations.find(r => r.fromLocationCode == detail.fromLocationCode);
if (location == undefined) {
location = createLocationInfo(detail);

140
pages/issue/record/issueRecord.vue

@ -8,33 +8,44 @@
<scroll-view scroll-y="true" class="">
<view v-for="(toLocation, index) in detailSource">
<view class="uni-row uni-flex">
<!-- <com-issue-request-info :workShopCode="workShopCode" :dataContent="toLocation">
<!-- <com-issue-request-info :workShopCode="workShopCode" :dataContent="toLocation">
</com-issue-request-info> -->
<work-station :workshopCode="workShopCode" :productionLineCode="toLocation.productionLineCode"
:workStationCode="toLocation.workStationCode" :rawLocationCode="toLocation.toLocationCode"></work-station>
<work-station :workshopCode="workShopCode"
:productionLineCode="toLocation.productionLineCode"
:workStationCode="toLocation.workStationCode"
:rawLocationCode="toLocation.toLocationCode"></work-station>
</view>
<com-issue-detail-card ref='comIssueDetailCard' :dataContent="toLocation"
@updateData='updateData'>
@updateData='updateData'
@removeItemCode ="removeItemCode"
>
</com-issue-detail-card>
</view>
</scroll-view>
<button class="btn_add" @click="goScan(true)">+去添加</button>
<button class="btn_add" @click="goScan(false)">+去添加</button>
</view>
<div class="btn_bottom">
<view class="" style="display: flex;flex-direction: row;">
<view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
<view class="">
<button class="btn_commit" hover-class="btn_commit_after" @click="submit()">提交</button>
</view>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="submit()">提交</button>
</view>
</view>
</div>
</view>
</view>
</view>
<com-message ref="comMessage"></com-message>
<com-issue-request-popup ref="comIssueRequestPopup" @confirm='requestConfirm'></com-issue-request-popup>
<com-issue-request-popup ref="comIssueRequestPopup" @confirm='requestConfirm' :itemCodeTypeList="itemCodeTypeList"></com-issue-request-popup>
<win-scan-button v-if='detailSource.length>0' @goScan='openScanDetailPopup'></win-scan-button>
<com-scan-issue-pack ref="comScanIssuePack" @closeScan='closeScan' @updateData='updateData'>
</com-scan-issue-pack>
<comMessage ref="comMessage"></comMessage>
</template>
<script>
@ -58,7 +69,10 @@
import {
getBusinessType,
} from '@/common/record.js';
import {
calc
} from '@/common/calc.js';
import {
getManagementPrecisions
} from '@/common/balance.js';
@ -73,7 +87,7 @@
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import comScanIssuePack from '@/pages/issue/coms/comScanIssuePack.vue'
import workStation from '@/mycomponents/workStation/workStation.vue'
export default {
name: '',
components: {
@ -98,19 +112,25 @@
fromInventoryStatuses: "",
toInventoryStatuses: "",
requestList: [],
dataContent:{},
managementList:[]
dataContent: {},
managementList: [],
itemCodeTypeList: []
}
},
mounted() {
},
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
}
},
onLoad(option) {
var typeCode = "Issue"
getBusinessType(typeCode, res => {
if (res.success) {
this.businessType = res.businessType;
this.fromlocationTypeList = res.fromlocationTypeList;
this.itemCodeTypeList = res.itemCodeTypeList;
this.tolocationTypeList = res.tolocationTypeList;
this.fromInventoryStatuses = res.fromInventoryStatuses
this.toInventoryStatuses = res.toInventoryStatuses
@ -133,6 +153,7 @@
});
},
goScan(editPosition) {
this.$refs.comIssueRequestPopup.openRequestPopup(editPosition);
},
@ -147,7 +168,7 @@
this.getRecommendInfo(item);
} else {
this.$refs.comMessage.showQuestionMessage('已经存在零件[' + item.itemCode + ']的需求信息,是否要修改?', res => {
this.$refs.comMessage.showQuestionMessage('已经存在物料[' + item.itemCode + ']的需求信息,是否要修改?', res => {
if (res) {
request.qty = item.qty;
that.detailSource.forEach(detail => {
@ -172,7 +193,6 @@
if (res.data == null) {
that.showMessage('未获取到推荐信息');
} else {
if (res.data.length > 0) {
that.workShopCode = item.workshopCode;
res.data.forEach(r => {
@ -180,7 +200,8 @@
r.productionLineCode = item.productionLineCode;
r.workStationCode = item.workStationCode;
// r.itemCode = item.itemCode;
// r.uom = item.uom;
r.itemName = item.itemName
r.uom = item.uom;
that.subList.push(r);
})
that.detailSource = getDataSource(that.detailSource, that.subList)
@ -209,7 +230,7 @@
caclcQty() {
var totalQty = 0;
this.detailSource.subList.forEach(res => {
totalQty += res.qty
totalQty = calc.add(totalQty, res.qty);
})
this.detailSource.totalQty = totalQty;
},
@ -241,10 +262,10 @@
let handleQty = 0;
if (batch != undefined) {
batch.Records.forEach(res => {
handleQty += Number(res.qty)
handleQty = calc.add(handleQty, res.qty);
})
batch.handleQty = handleQty;
itemHandleQty += handleQty;
itemHandleQty = calc.add(itemHandleQty, handleQty)
}
})
}
@ -252,6 +273,14 @@
// item.handleQty=itemHandleQty;
// this.closeScan();
},
removeItemCode(){
var isClear =this.detailSource[0].Items.length==0
if(isClear){
this.clearData();
this.$refs.comIssueRequestPopup.initData()
}
},
setParams() {
var subList = []
@ -267,31 +296,39 @@
batch.Records.forEach(r => {
let record = {};
record.handleQty = r.qty;
record.fromPackingNumber = r
.packingNumber;
record.fromBatch = r.batch;
record.fromContainerNumber = r
.ContainerNumber;
record.toContainerNumber = r
.ContainerNumber;
record.toInventoryStatus = r
.inventoryStatus;
record.toLocationCode = subItem
.toLocationCode;
record.fromLocationCode = fromLocation.fromLocationCode
record.fromLocationCode = fromLocation
.fromLocationCode
record.supplierCode = r.supplierCode;
let single_price = r.singlePrice == null ?
0 : r.singlePrice;
record.singlePrice = single_price;
record.amount = single_price * r.qty;
//使
var info = getPackingNumberAndBatch(
this.managementList, r
.itemCode,
r.packingNumber, r
.batch);
record.toPackingNumber = info
.packingNumber;
record.toBatch = info.batch;
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(subItem);
@ -300,7 +337,7 @@
})
})
})
this.dataContent.subList = subList
this.dataContent.createTime = createTime;
this.dataContent.creator = creator;
@ -311,7 +348,7 @@
title: "提交中....",
mask: true
});
//
var itemCodes = []
let locationCode = this.detailSource[0].toLocationCode
@ -320,7 +357,7 @@
itemCodes.push(item.itemCode)
})
})
//
getManagementPrecisions(itemCodes, locationCode, res => {
if (res.success) {
@ -333,37 +370,42 @@
});
},
submitJob() {
var params = this.setParams()
console.log("提交参数", JSON.stringify(params));
issueRecordSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成发料记录<br>" + res.data)
} else {
this.showErrorMessage("提交失败:" + res.msg)
this.showErrorMessage("提交失败:" + res.msg+"】")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
this.clearData();
this.$refs.comIssueRequestPopup.initData()
})
},
clearData(){
this.detailSource =[];
this.requestList=[];
this.dataContent ={}
this.managementList=[]
clearData() {
this.subList= [], //subList
this.detailSource=[], //
this.detailOptions=[],
this.scanOptions= [],
this.workShopCode="",
this.requestList= [],
this.dataContent= {},
this.managementList= []
},
showMessage(message) {
this.$refs.comMessage.showMessage(message, res => {
if (res) {
@ -380,7 +422,7 @@
},
// this.$refs.comMessage.showQuestionMessage('?', res => {
// this.$refs.comMessage.showQuestionMessage('?', res => {
// if (res) {
// that.clearInfo();
// }

65
pages/issue/request/issueRequestCreate.vue

@ -5,25 +5,27 @@
</view>
<view v-else class="page-wraper">
<view class="page-main">
<comIssueRequestCreator ref="issueRequest" :dataContent="detailSource" :isSwipe ="false">
<comIssueRequestCreator ref="issueRequest" :dataContent="detailSource" :isSwipe="false">
</comIssueRequestCreator>
<button class="btn_add" @click="goScan(false)">+去添加</button>
</view>
<div class="btn_bottom">
<view class="" style="display: flex;flex-direction: row;">
<view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
<view class="">
<button class="btn_commit" hover-class="btn_commit_after" @click="submit()">提交</button>
</view>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="submit()">提交</button>
</view>
</view>
</div>
</view>
<com-scan-issue-pack ref="comScanIssuePack">
</com-scan-issue-pack>
<comMessage ref="comMessage"></comMessage>
</view>
</view>
<com-issue-request-popup ref="comIssueRequestPopup" @confirm='requestConfirm'></com-issue-request-popup>
<com-issue-request-popup ref="comIssueRequestPopup" @confirm='requestConfirm' :itemCodeTypeList="itemCodeTypeList" ></com-issue-request-popup>
</template>
<script>
@ -31,10 +33,19 @@
issueRequestSubmit,
} from '@/api/request2.js';
import {
calc
} from '@/common/calc.js';
import {
getBusinessType,
} from '@/common/record.js';
import {
goHome,
updateTitle,
getRemoveOption,
navigateBack,
getCurrDateOneMonthsTimes
} from '@/common/basic.js';
@ -69,14 +80,27 @@
detailOptions: [],
scanOptions: [],
requestList: [], //
itemCodeTypeList:[],
useOnTheWay:"FALSE"
}
},
mounted() {
this.goScan(true)
},
onLoad(option) {
var typeCode = "Issue"
getBusinessType(typeCode, res => {
if (res.success) {
this.itemCodeTypeList = res.itemCodeTypeList;
this.tolocationTypeList = res.tolocationTypeList;
this.useOnTheWay = res.useOnTheWay;
this.fromInventoryStatuses = res.fromInventoryStatuses
this.toInventoryStatuses = res.toInventoryStatuses
this.goScan(true)
} else {
this.showErrorMessage(res.message)
}
});
},
methods: {
@ -89,22 +113,26 @@
if (this.detailSource.subList.length == 0) {
this.detailSource = {
workShopCode: item.workshopCode,
workshopCode: item.workshopCode,
workShopName: item.workShopName,
productionLineCode: item.productionLineCode,
productionLineName: item.productionLineName,
workStationCode: item.workStationCode,
workStationName: item.workStationName, //
toLocationCode:item.rawLocationCode,
toLocationCode: item.rawLocationCode,
fromWarehouseCode:item.fromWarehouseCode,
useOnTheWay:this.useOnTheWay,
totalQty: 0,
subList: []
}
var subItem = {
productionLineCode: item.productionLineCode,
workStationCode: item.workStationCode,
itemCode: item.itemCode,
itemName: item.itemName,
toWarehouseCode:item.toWarehouseCode,
fromWarehouseCode:item.fromWarehouseCode,
qty: item.qty,
uom: item.uom
}
@ -123,6 +151,8 @@
workStationCode: item.workStationCode,
itemCode: item.itemCode,
itemName: item.itemName,
toWarehouseCode:item.toWarehouseCode,
fromWarehouseCode:item.fromWarehouseCode,
qty: item.qty,
uom: item.uom
}
@ -131,18 +161,17 @@
} else {
//
result[0].qty += item.qty
result[0].qty = calc.add(result[0].qty,item.qty)
}
}
this.caclcQty();
},
caclcQty() {
var totalQty = 0;
this.detailSource.subList.forEach(res => {
totalQty += res.qty
totalQty = calc.add(totalQty,res.qty)
})
this.detailSource.totalQty = totalQty;
},
@ -173,9 +202,7 @@
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
uni.navigateTo({
url: './issueRequest'
})
navigateBack(1)
})
},
showErrorMessage(message) {

2
pages/package/coms/comOverRecord.vue

@ -123,7 +123,7 @@
methods: {
removeItem(e, dataContent) {
if (e.content.text == "清空") {
this.$refs.comMessage.showQuestionMessage("确定清空零件及箱码信息?",
this.$refs.comMessage.showQuestionMessage("确定清空物料及箱码信息?",
res => {
if (res) {
this.$emit('removeItem')

2
pages/package/coms/comPackageRecord.vue

@ -124,7 +124,7 @@
methods: {
removeItem(e, dataContent) {
if (e.content.text == "清空") {
this.$refs.comMessage.showQuestionMessage("确定清空零件及箱码信息?",
this.$refs.comMessage.showQuestionMessage("确定清空物料及箱码信息?",
res => {
if (res) {
this.$emit('removeItem')

10
pages/package/record/mergePackageRecord.vue

@ -146,8 +146,8 @@
})
if (item == undefined) {
if (this.currentItemCode != "" && this.currentItemCode != balance.itemCode) {
this.showErrorMessage("合包当前零件号[" + this.currentItemCode + "与扫描零件号[" + balance.itemCode +
"]不一致,请扫描相同零件号")
this.showErrorMessage("合包当前物料号[" + this.currentItemCode + "与扫描物料号[" + balance.itemCode +
"]不一致,请扫描相同物料号")
return;
}
var itemp = createItemInfo(balance, pack);
@ -271,7 +271,7 @@
detail.fromInventoryStatus = detail.inventoryStatus;
detail.toInventoryStatus = detail.inventoryStatus;
detail.fromQty = detail.qty
detail.fromQty = detail.handleQty
detail.fromPackingNumber = detail.packingNumber;
detail.toPackingNumber = this.toPackingNumber;
@ -345,8 +345,8 @@
},
getToPackingNumber(result) {
if(this.currentItemCode!=result.label.itemCode){
this.showErrorMessage("合包当前零件号[" + this.currentItemCode + "与目标零件号[" + result.label.itemCode +
"]不一致,请扫描相同零件号")
this.showErrorMessage("合包当前物料号[" + this.currentItemCode + "与目标物料号[" + result.label.itemCode +
"]不一致,请扫描相同物料号")
return;
}
this.toPackingNumber = result.label.packingNumber;

2
pages/package/record/overPackageRecord.vue

@ -262,7 +262,7 @@
subItem.itemDesc2 = detail.package.itemDesc2;
subItem.fromInventoryStatus = detail.inventoryStatus;
subItem.fromQty = detail.qty
subItem.fromQty = detail.handleQty
subItem.fromPackingNumber = detail.packingNumber;
subItem.fromBatch = detail.batch;
subItem.fromLocationCode = detail.locationCode;

20
pages/package/record/splitPackageRecord.vue

@ -48,6 +48,10 @@
splitPackageRecordSubmit
} from '@/api/request2.js';
import {
calc
} from '@/common/calc.js';
import {
getInventoryStatusDesc,
getDirectoryItemArray
@ -180,9 +184,9 @@
var sumQty = 0;
item.subList[0].Records.forEach(function(item1, index) {
sumQty += item1.qty;
sumQty = calc.add(sumQty,item1.qty)
});
if ((Number(qty) + sumQty) > item.subList[0].qty) {
if (calc.add(qty,sumQty)> item.subList[0].qty) {
this.showErrorMessage("扫描数量总和【" + (Number(qty) + sumQty) + "】(当前输入数量【" + qty + "】+已添加数量【" +
sumQty +
"】)已超过拆包箱码的数量【" + Number(item.subList[0].qty) + "】!");
@ -200,7 +204,7 @@
if (detail.Records.length > 0) {
detail.Records.forEach(r => {
hQty += Number(r.qty)
hQty = calc.add(hQty,r.qty)
})
}
detail.handleQty = hQty;
@ -292,21 +296,21 @@
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 = record.qty
subItem.fromPackingNumber = subItem.packingNumber;
subItem.toPackingNumber = record.packingNumber;
subItem.fromBatch = subItem.batch;
subItem.toBatch = record.batch;
subItem.fromLocationCode = subItem.fromLocationCode;
subItem.package = ""
subItem.Records=""
subItem.Records = ""
subList.push(subItem)
}

2
pages/productDismantle/coms/comProductJobCard.vue

@ -9,7 +9,7 @@
<view class="task_text">
<view class="">
零件 : {{dataContent.itemCode}}
物料 : {{dataContent.itemCode}}
</view>
</view>

2
pages/productDismantle/coms/comProductRecord.vue

@ -115,7 +115,7 @@
methods: {
removeItem(e, dataContent) {
if (e.content.text == "清空") {
this.$refs.comMessage.showQuestionMessage("确定清空零件及箱码信息?",
this.$refs.comMessage.showQuestionMessage("确定清空物料及箱码信息?",
res => {
if (res) {
this.$emit('removeItem')

198
pages/productPutaway/coms/comProductRecord.vue

@ -1,198 +0,0 @@
<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="removeItem($event,dataContent)" :right-options="removeOptions">
<item-qty :dataContent="dataContent" :handleQty="dataContent.handleQty"
:isShowBalance="true"></item-qty>
</uni-swipe-action-item>
</uni-swipe-action>
</template>
<u-line />
<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" :isShowPack="true"
:isShowLocation="true"></balance> -->
<purchase-label :dataContent="item" :packageContent="item.package" :isShowStdPack="false">
</purchase-label>
</uni-swipe-action-item>
</uni-swipe-action>
<u-line color="#D8D8D8"></u-line>
</view>
</uni-collapse-item>
</uni-collapse>
<balanceQtyEdit ref="balanceQtyEdit" @confirm="confirm"></balanceQtyEdit>
<job-detail-popup ref="winHint" :dataContent="showItem"></job-detail-popup>
<com-message ref="comMessage"></com-message>
</view>
</template>
<script>
import itemQty from '@/mycomponents/item/itemQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
import purchaseLabel from '@/mycomponents/balance/purchaseLabel.vue'
import record from '@/mycomponents/record/record.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import {
getDetailOption,
getDetailEditRemoveOption,
getClearOption
} from '@/common/array.js';
export default {
components: {
itemQty,
recommend,
jobDetailPopup,
purchaseLabel,
balanceQtyEdit,
record,
comMessage
},
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: {
removeItem(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)
} 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.qty);
},
remove(item, index) {
this.$refs.comMessage.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
this.dataContent.subList.splice(index, 1)
this.$emit('updateData')
}
});
},
confirm(qty) {
this.editItem.qty = qty;
this.$emit('updateData')
},
detail(item) {
this.showItem = item;
this.dataList = [{
title: "箱码",
content: item.packingNumber
},
{
title: "批次",
content: item.batch
},
{
title: "库位",
content: item.locationCode
},
{
title: "数量",
content: item.qty
},
{
title: "单位",
content: item.uom
}
]
this.$refs.winHint.openScanPopup()
},
remove(item, index) {
this.$refs.comMessage.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
this.dataContent.subList.splice(index, 1)
this.$emit('removePack')
}
});
},
confirm(qty) {
this.editItem.qty = qty;
this.$emit('updateData')
}
}
}
</script>
<style>
</style>

4
pages/productPutaway/coms/comPutawayRequestCard.vue

@ -1,9 +1,9 @@
<template>
<request-com-main-card :dataContent="dataContent">
<view class="task_item">
<view class="task_text">
<!-- <view class="task_text">
供应商代码 : {{dataContent.supplierCode}}
</view>
</view> -->
</view>
</request-com-main-card>
</template>

6
pages/productPutaway/job/productPutawayDetail.vue

@ -102,7 +102,6 @@
data() {
return {
id: '',
received: false,
scanCount: 0,
jobContent: {}, //
subList: [], //subList
@ -112,6 +111,7 @@
toLocationCode: "",
toLocationInfo: {},
tolocationTypeList: [],
jobStatus:""
};
},
onLoad(option) {
@ -120,7 +120,6 @@
//
if (option.status == "1") {
this.receive((callback => {
this.received = true;
this.getDetail();
}));
} else {
@ -138,7 +137,7 @@
onBackPress(e) {
//
if (e.from == 'backbutton') {
if (this.received) {
if (this.jobStatus=="2") {
//
cancleTakeProductPutawayJob(this.id).then(res => {
uni.navigateBack();
@ -183,6 +182,7 @@
if (res.data.subList.length > 0) {
that.jobContent = res.data;
that.subList = res.data.subList;
that.jobStatus = res.data.status
that.fromLocationCode = that.subList[0].fromLocationCode
that.toLocationCode = that.subList[0].toLocationCode
that.tolocationTypeList = getLocationTypeArray(that.jobContent.toLocationTypes)

2
pages/productPutaway/record/productPutawayRecord.vue

@ -335,7 +335,7 @@
submitItem.fromLocationCode = detail.locationCode;
submitItem.toLocationCode = detail.toLocationCode;
submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty;
submitItem.qty = detail.handleQty;
submitItem.package ="";
subList.push(submitItem)
}

2
pages/productPutaway/request/putawayRequest.vue

@ -88,7 +88,7 @@
this.addAgainOption = getAddAgainOption();
this.detailAndApproveOptions = getDetailAndApproveOption()
this.detailAndApprovePassAndApproveNoOption = getDetailAndApprovePassAndApproveNoOption(),
this.detailAndHandleOption = getDetailAndHandleOption()
this.detailAndHandleOption = getDetailAndHandleOption()
this.detailAndAddAndCloseOption = getDetailAndAddAndCloseOption()
},

30
pages/productPutaway/request/putawayRequestCreate.vue

@ -53,6 +53,7 @@
import {
goHome,
updateTitle,
deepCopyData,
getCurrDateTime,
getPackingNumberAndBatchByList
} from '@/common/basic.js';
@ -61,6 +62,10 @@
getDirectoryItemArray
} from '@/common/directory.js';
import {
calc
} from '@/common/calc.js';
import {
getBusinessType,
createItemInfo,
@ -144,6 +149,17 @@
let balance = result.balance;
let label = result.label;
let pack = result.package;
if(label.batch==""){
this.showErrorMessage("扫描标签批次为空")
return;
}
if(label.packingNumber==""){
this.showErrorMessage("扫描标签箱码为空")
return;
}
if (this.supplierCode == '') {
this.supplierCode = result.package.supplierCode
} else {
@ -206,14 +222,7 @@
},
calcHandleQty() {
for (let item of this.detailSource) {
item.qty = 0;
for (let detail of item.subList) {
if (detail != undefined) {
item.qty += Number(detail.qty)
}
}
}
calcHandleQty(this.detailSource)
this.$forceUpdate();
},
@ -279,7 +288,7 @@
productPutawayRequestSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成制品上架申请<br>" + res.data, )
this.showCommitSuccessMessage("提交成功<br>生成制品上架申请<br>" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
@ -301,8 +310,7 @@
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
var subItem = {};
Object.assign(subItem, detail)
var subItem = deepCopyData(detail)
subItem.fromLocationCode = detail.locationCode;
subItem.qty = detail.handleQty;
subItem.package = null;

4
pages/productPutaway/request/putawayRequestDetail.vue

@ -4,9 +4,9 @@
<view class="header_job_top">
<request-top :dataContent="requestContent"></request-top>
</view>
<view class="header_item">
<!-- <view class="header_item">
供应商 : {{requestContent.supplierCode}}
</view>
</view> -->
<u-line color="#D8D8D8" />
</view>
<view class="page-main">

2
pages/productReceipt/coms/comProductRecord.vue

@ -121,7 +121,7 @@
methods: {
removeData(e, dataContent) {
if (e.content.text == "清空") {
this.$refs.comMessage.showQuestionMessage("确定清空零件及箱码信息?",
this.$refs.comMessage.showQuestionMessage("确定清空物料及箱码信息?",
res => {
if (res) {
this.$emit('removeItem')

8
pages/productReceipt/job/productReceiptDetail.vue

@ -97,7 +97,6 @@
return {
id: '',
receiptJob: {},
received: false,
toLocationCode: '',
isShowPackingCode: true,
scanCount: 0,
@ -105,7 +104,8 @@
subList: [], //subList
detailSource: [], //
toLocationTypeList: [],
managementList: []
managementList: [],
jobStatus:""
};
},
@ -115,7 +115,6 @@
//
if (option.status == "1") {
this.receive((callback => {
this.received = true;
this.getDetail();
}));
} else {
@ -134,7 +133,7 @@
onBackPress(e) {
//
if (e.from == 'backbutton') {
if (this.received) {
if (this.jobStatus=="2") {
//
cancleTakeProductReceiptJob(this.id).then(res => {
uni.navigateBack();
@ -184,6 +183,7 @@
if (res.data.subList.length > 0) {
that.jobContent = res.data;
that.subList = res.data.subList;
that.jobStatus = res.data.status
that.toLocationCode = that.subList[0].toLocationCode
that.toLocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes)
that.detailSource = getDataSource(that.subList)

31
pages/productReceipt/record/productReceiptRecord.vue

@ -61,6 +61,12 @@
deepCopyData
} from '@/common/basic.js';
import {
calc
} from '@/common/calc.js';
import { Decimal } from 'decimal.js';//
import {
getInventoryStatusDesc,
getDirectoryItemArray
@ -182,8 +188,8 @@
itemName: pack.itemName,
stdPackQty: pack.stdPackQty,
stdPackUnit: pack.stdPackUnit,
qty: Number(label.qty),
handleQty: 0,
qty: new Decimal(label.qty).toNumber(),
handleQty: new Decimal(0).toNumber(),
uom: pack.uom,
subList: []
}
@ -191,11 +197,10 @@
},
createDetailInfo(label, pack) {
let detail = {};
Object.assign(detail, label)
let detail = deepCopyData(label);
detail.scaned = true;
detail.qty = Number(label.qty);
detail.handleQty = 0;
detail.qty = new Decimal(label.qty).toNumber();
detail.handleQty = new Decimal(label.qty).toNumber();
detail.inventoryStatus = "OK"
detail.stdPackQty = pack.stdPackQty;
detail.stdPackUnit = pack.stdPackUnit;
@ -207,10 +212,10 @@
calcHandleQty() {
for (let item of this.detailSource) {
item.qty = 0;
item.handleQty = new Decimal(0).toNumber();
for (let detail of item.subList) {
if (detail != undefined) {
item.qty += Number(detail.qty)
item.handleQty = calc.add(item.handleQty,detail.handleQty)
}
}
}
@ -326,10 +331,10 @@
submitItem.productionlineCode = this.productionLineCode;
submitItem.workStationCode = this.workStationCode;
submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty;
submitItem.package ="";
submitItem.qty = detail.handleQty;
submitItem.package = "";
subList.push(submitItem)
}
})
@ -392,7 +397,7 @@
this.clearData();
})
},
clearData(){
clearData() {
this.subList = [];
this.detailSource = [];
this.toLocationCode = '';

2
pages/productionReceipt/coms/comProductionRecord.vue

@ -113,7 +113,7 @@
methods: {
removeItem(e,dataContent){
if (e.content.text == "清空") {
this.$refs.comMessage.showQuestionMessage("确定清空零件及箱码信息?",
this.$refs.comMessage.showQuestionMessage("确定清空物料及箱码信息?",
res => {
if (res) {
this.$emit('removeItem')

35
pages/productionReceipt/job/productionReceiptDetail.vue

@ -100,7 +100,6 @@
data() {
return {
id: '',
received: false,
scanCount: 0,
jobContent: {}, //
subList: [], //subList
@ -109,6 +108,7 @@
fromLocationCode: "",
toLocationCode: "",
tolocationTypeList: [],
jobStatus:""
};
},
onLoad(option) {
@ -117,7 +117,6 @@
//
if (option.status == "1") {
this.receive((callback => {
this.received = true;
this.getDetail();
}));
} else {
@ -135,7 +134,7 @@
onBackPress(e) {
//
if (e.from == 'backbutton') {
if (this.received) {
if (this.jobStatus=="2") {
//
cancleTakeProductionReceiptJob(this.id).then(res => {
uni.navigateBack();
@ -179,6 +178,7 @@
} else {
if (res.data.subList.length > 0) {
that.jobContent = res.data;
that.jobStatus = res.data.status
that.subList = res.data.subList;
that.fromLocationCode = that.subList[0].fromLocationCode
that.toLocationCode = that.subList[0].toLocationCode
@ -247,7 +247,11 @@
getScanResult(result) {
try {
var supplierCode = result.package.supplierCode
var supplierCode = result.label.supplierCode;
if (supplierCode == '' || supplierCode == undefined) {
this.showErrorMessage("标签中未解析到供应商信息,请重新扫描")
return;
}
var packingNumber = result.balance.packingNumber;
var batch = result.balance.batch;
var qty = result.balance.qty;
@ -275,37 +279,39 @@
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 +
if (this.jobContent.allowModifyInventoryStatus == "TRUE") {
this.showQuestionMessage('任务中允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' +
itemStatus +
']不一致,是否继续上架?', res => {
if (res) {
itemDetail.scaned = true;
itemDetail.supplierCode = supplierCode
itemDetail.handleQty = Number(result.balance.qty)
itemDetail.handleQty = Number(result.balance.qty)
itemDetail.toInventoryStatus = result.balance.inventoryStatus;
itemDetail.balance = result.balance;
itemDetail.balance.balanceQty = Number(result.balance.qty)
itemDetail.balance.stdPackQty = Number(result.package.stdPackQty)
itemDetail.balance.balanceQty = Number(result.balance.qty)
itemDetail.balance.stdPackQty = Number(result.package.stdPackQty)
itemDetail.balance.stdPackUnit = result.package.stdPackUnit
this.calcHandleQty();
} else {
this.scanPopupGetFocus();
}
});
}else {
this.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus +
} else {
this.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' +
itemStatus +
']不一致,不允许转移!', res => {
this.scanPopupGetFocus();
});
}
} else {
itemDetail.scaned = true;
itemDetail.supplierCode = supplierCode
itemDetail.handleQty = Number(result.balance.qty)
itemDetail.handleQty = Number(result.balance.qty)
itemDetail.toInventoryStatus = result.balance.inventoryStatus;
itemDetail.balance = result.balance;
itemDetail.balance.balanceQty = Number(result.balance.qty)
itemDetail.balance.balanceQty = Number(result.balance.qty)
itemDetail.balance.stdPackQty = Number(result.package.stdPackQty)
itemDetail.balance.stdPackUnit = result.package.stdPackUnit
this.calcHandleQty();
@ -428,7 +434,6 @@
detail.toBatch = info.batch;
detail.toContainerNumber = "";
detail.toLocationCode = this.toLocationCode;
subList.push(detail)
}
})

1
pages/productionReceipt/record/productionReceiptRecord.vue

@ -316,6 +316,7 @@
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
this.fromLocationCode = '';
this.toLocationCode =""
})
},

8
pages/productionReturn/coms/comReturn.vue

@ -57,6 +57,10 @@
getPackingNumberAndBatchByList
} from '@/common/basic.js';
import {
calc
} from '@/common/calc.js';
import {
getDirectoryItemArray
} from '@/common/directory.js';
@ -237,7 +241,7 @@
item.qty = 0;
for (let detail of item.subList) {
if (detail != undefined) {
item.qty += Number(detail.qty)
item.qty = calc.add(item.qty, detail.qty)
}
}
}
@ -431,7 +435,7 @@
this.clearData();
})
},
clearData(){
clearData() {
this.subList = [];
this.detailSource = [];
this.toLocationCode = '';

14
pages/productionReturn/coms/comReturnCommonRequest.vue

@ -109,7 +109,7 @@
this.addAgainOption = getAddAgainOption();
this.detailAndApproveOptions = getDetailAndApproveOption()
this.detailAndApprovePassAndApproveNoOption = getDetailAndApprovePassAndApproveNoOption(),
this.detailAndHandleOption = getDetailAndHandleOption()
this.detailAndHandleOption = getDetailAndHandleOption()
this.detailAndAddAndCloseOption = getDetailAndAddAndCloseOption()
this.updateTitle();
this.getList('refresh');
@ -241,25 +241,25 @@
swipeClick(e, dataContent) {
var text = clearTirmAndWrap(e.content.text)
if (e.content.text == "详情") {
if (text == "详情") {
this.openRequestInfoPopup(dataContent);
} else if (e.content.text == "处理") {
} else if (text == "处理") {
this.showQuestionMessage("确定要处理当前申请吗?", res => {
this.productionReturnRequestHandle(dataContent.id)
})
} else if (e.content.text == "审批") {
} else if (text == "提交审批") {
this.showQuestionMessage("确定要审批当前申请吗?", res => {
this.productionReturnRequestSubmitApprove(dataContent.id)
})
} else if (e.content.text == "审批通过") {
} else if (text == "审批通过") {
this.showQuestionMessage("确定要审批通过当前申请吗?", res => {
this.productionReturnRequestSubmitApproveAgree(dataContent.id)
})
} else if (e.content.text == "审批驳回") {
} else if (text == "审批驳回") {
this.showQuestionMessage("确定要审批驳回当前申请吗?", res => {
this.productionReturnRequestSubmitApproveRefused(dataContent.id)
})
} else if (e.content.text == "关闭") {
} else if (text == "关闭") {
this.showQuestionMessage("确定要关闭当前申请吗?", res => {
this.productionReturnRequestClose(dataContent.id)
})

15
pages/productionReturn/coms/comReturnRecord.vue

@ -5,8 +5,7 @@
<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>
<item-qty :dataContent="dataContent" :isShowBalanceQty="false" :isShowBalance="true"></item-qty>
</uni-swipe-action-item>
</uni-swipe-action>
@ -17,7 +16,7 @@
<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" :isShowToLocation="isShowToLocation"></balance>
:isShowFromLocation="isShowFromLocation" :isShowToLocation="isShowToLocation"></balance>
<!-- <production-label :dataContent="item" :packageContent="item.package"
:isShowLocation="false">
</production-label> -->
@ -86,6 +85,10 @@
isShowToLocation: {
type: Boolean,
default: true
},
isShowFromLocation: {
type: Boolean,
default: true
}
},
watch: {
@ -126,7 +129,7 @@
methods: {
removeData(e, dataContent) {
if (e.content.text == "清空") {
this.$refs.comMessage.showQuestionMessage("确定清空零件及箱码信息?",
this.$refs.comMessage.showQuestionMessage("确定清空物料及箱码信息?",
res => {
if (res) {
this.$emit('removeItem')
@ -147,7 +150,7 @@
edit(item) {
this.editItem = item;
this.$refs.recommendQtyEdit.openRecordEditPopup(item.qty);
this.$refs.recommendQtyEdit.openRecordEditPopup(item.handleQty);
// this.$refs.recommendQtyEdit.openEditPopup(item.qty);
},
@ -165,7 +168,7 @@
});
},
confirm(qty) {
this.editItem.qty = qty;
this.editItem.handleQty = qty;
this.$emit('updateData')
}
}

35
pages/productionReturn/coms/comReturnRequestCreator.vue

@ -5,7 +5,7 @@
</comReturnRequestInfo>
<uni-swipe-action ref="swipeAction">
<view v-for="(item, index) in dataContent.subList" :key="index">
<uni-swipe-action-item @click="swipeClick($event,item)" :right-options="detailOptions">
<uni-swipe-action-item @click="swipeClick($event,item,index)" :right-options="options">
<item-qty :dataContent="item" :isShowStdPack="false">
</item-qty>
<!-- <view v-if="item.batch!=''" style="margin-left: 10rpx;">
@ -36,7 +36,7 @@
import {
getDetailOption,
getDetailEditRemoveOption,
getDetailRemoveOption
getDetailRemoveOption,
} from '@/common/array.js';
export default {
@ -79,7 +79,6 @@
},
watch: {
dataContent(newVal) {
this.requestItem = newVal.subList[0];
},
},
@ -92,9 +91,9 @@
}
},
requestItem: {},
detailOptions: [],
scanOptions: []
scanOptions: [],
options:[]
}
},
@ -103,26 +102,30 @@
this.detailOptions = getDetailOption();
}
if (this.scanOptions.length == 0) {
this.scanOptions = getDetailEditRemoveOption();
this.scanOptions = getDetailRemoveOption();
// if (this.dataContent.allowModifyQty == 1) {
// this.scanOptions = getDetailEditRemoveOption();
// } else {
// this.scanOptions = getDetailRemoveOption();
// }
}
if(!this.isSwipe){
this.detailOptions=[]
}
this.options =this.scanOptions
// if(!this.isSwipe){
// this.options=[]
// }else {
// this.options =this.scanOptions
// }
},
methods: {
swipeClick(e, item) {
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)
this.remove(item,index)
}
},
edit(item) {
@ -136,17 +139,13 @@
// // this.showItem = item;
// // this.$refs.jobDetailPopup.openPopup(item)
},
remove(item) {
remove(item,index) {
this.$refs.message.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
item.scaned = false
item.record = {}
item.balance = {}
item.inventoryStatus = item.RecommendInventoryStatus
// item.record.qty = 0;
this.dataContent.subList.splice(index, 1)
this.$forceUpdate()
this.$emit('remove', item)
// this.$emit('remove', item)
}
});
},

95
pages/productionReturn/coms/comReturnRequestPopup.vue

@ -28,7 +28,7 @@
<view class="title padding" style="display: flex;">
<text style=" flex-shrink: 0;">箱码</text>
<text style=" flex-shrink: 0;">物料</text>
<view class="" style="width: 100% ;">
{{itemCode}}
</view>
@ -46,10 +46,13 @@
<text>数量 : </text>
<view class="uni-flex uni-row uni-center"
style="align-items: center;margin-left: 20rpx;">
<uni-number-box :value="counQty" @change="change" style='margin-left: 10rpx;'
:focus="numberFocus" @blur='numberFocus = false'>
</uni-number-box>
<input style="text-align: center;" class="qty_input" v-model="counQty" type="number"
@confirm="confirm()" :focus="numberFocus" @input="checkNum" :maxlength="maxlength" />
<uom :uom="uom"></uom>
<view class="" v-if="stdPackInfo!=undefined" style="display: flex;flex-direction: row;margin-left: 10rpx;">
(<stdPackQty :dataContent="stdPackInfo"></stdPackQty>)
</view>
</view>
</view>
@ -63,7 +66,7 @@
</view>
</view>
</uni-popup>
<win-scan-item ref="scanPopup" title='物料代码' @getScanCode='getScanCode'>
<win-scan-item ref="scanPopup" title='物料代码' @getScanResult='getItemScanResult' :itemCodeTypeList="itemCodeTypeList">
</win-scan-item>
<comMessage ref="comMessage"></comMessage>
</view>
@ -82,6 +85,7 @@
checkDirectoryItemExist
} from '@/common/directory.js';
import uom from '@/mycomponents/qty/uom.vue'
import stdPackQty from '@/mycomponents/qty/stdPackQty.vue'
import balanceStatus from '@/mycomponents/status/balanceStatus.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import winScanItem from '@/mycomponents/scan/winScanItem.vue'
@ -90,6 +94,7 @@
export default {
components: {
uom,
stdPackQty,
balanceStatus,
comMessage,
winScanItem
@ -111,8 +116,7 @@
itemCodeFocus: false,
requestInfo: null,
itemCodeList: [],
isCheckItemCode: false,
counQty: 0,
counQty: undefined,
editPosition: true,
numberFocus: false,
uom: "",
@ -120,6 +124,8 @@
show: false,
isModifiedPosition: true,
positionList: [],
maxlength:10,
stdPackInfo:undefined,
list: [{
value: 1,
label: '车间1',
@ -191,8 +197,27 @@
type: String,
default: '需求信息'
},
itemCodeTypeList: {
type: Array,
default: []
},
},
methods: {
checkNum(e) {
let value = e.detail.value;
let dot = value.indexOf('.'); //
let reg = /^[0-9]+$/; //
if (dot > -1) {
this.maxlength = dot + 7; //
if (value.length > dot + 7) {
}
}
if (reg.test(value)) { //
this.maxlength = 10;
}
this.change(value)
},
openRequestPopup(editPosition) {
if (this.positionList.length == 0) {
getWorkShopLineStation().then(res => {
@ -206,9 +231,11 @@
if (this.isModifiedPosition) {
this.isModifiedPosition = false
} else {
this.itemCode = "";
this.itemCode = "请扫描物料信息";
this.uom = ""
this.qty = 0
this.qty = 0;
this.counQty = undefined
this.numberFocus = false
this.itemCodeGetFocus();
}
@ -231,16 +258,18 @@
itemCodeLoseFocus() {
this.itemCodeFocus = false;
},
selectedItem(item) {
this.itemCode = item.itemCode;
this.checkItemCode();
},
confirm() {
if (this.itemCode == "" || !this.isCheckItemCode) {
if (this.itemCode == "请扫描物料信息" ) {
this.showErrorMessage("请输入物料", "itemCode")
return
}
if (this.counQty == undefined) {
this.showErrorMessage("请输入数量")
return
}
if (this.qty == 0) {
this.showErrorMessage("数量必须大于0")
return
@ -253,28 +282,6 @@
this.callback('add');
},
checkItemCode(itemCode) {
//
getBasicItemByCode(itemCode).then(res => {
uni.hideLoading();
this.$refs.scanPopup.closeScanPopup();
if (res.data != null && res.data.list.length > 0) {
this.itemCode = res.data.list[0].code;
this.itemName = res.data.list[0].name
this.isCheckItemCode = true;
this.numberFocus = true
this.uom = res.data.list[0].uom
} else {
this.showErrorMessage('未查找到物料【' + this.itemCode + '】', "itemCode");
}
}).catch(error => {
uni.hideLoading();
this.showErrorMessage(error, "itemCode");
})
},
callback(action) {
let item = {
positionInfo: this.positionInfo,
@ -305,8 +312,7 @@
}
})
if (type == "itemCode") {
this.itemCode = ""
this.isCheckItemCode = false;
this.itemCode = "请扫描物料信息"
}
})
},
@ -352,13 +358,12 @@
}
},
getScanCode(code) {
if (code == "") {
this.showErrorMessage('物料号不能为空')
return;
}
this.itemCode = "";
this.checkItemCode(code)
getItemScanResult(code, scanResult) {
this.itemCode = code;
this.itemName = scanResult.name
this.uom =scanResult.uom
this.stdPackInfo = scanResult.package;
this.numberFocus = true
},
}

65
pages/productionReturn/coms/comScanReturnPack.vue

@ -7,7 +7,7 @@
扫描箱码
<text class="fr" @click="closeScanPopup()">关闭</text>
</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;
@ -106,6 +106,10 @@
getWorkShopLineStation
} from '@/api/request2.js';
import {
calc
} from '@/common/calc.js';
import {
getBalanceByManagementPrecision
} from '@/common/balance.js';
@ -145,7 +149,7 @@
positionInfo: "请选择位置",
positionList: [],
defaultValueList: [],
fromInventoryStatuses :"",
fromInventoryStatuses: "",
}
},
created() {
@ -157,8 +161,8 @@
this.scanOptions = getDetailEditRemoveOption();
},
methods: {
openScanPopup(content, jobcontent) {
this.issueRecord = [];
this.dataContent = content;
@ -231,7 +235,7 @@
let lot = result.label.batch;
let item = that.toLocation.Items.find(r => r.itemCode == itemCode);
if (item == undefined) {
that.showErrorMessage('未查找到零件【' + itemCode + '】的发料明细',
that.showErrorMessage('未查找到物料【' + itemCode + '】的发料明细',
res => {
that.getfocus();
}
@ -243,24 +247,25 @@
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);
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.showBalanceSelect(balanceRes.data.list);
}
} else {
this.showBalanceSelect(balanceRes.data.list);
this.showErrorMessage(balanceRes.message.message);
}
} else {
this.showErrorMessage(balanceRes.message.message);
}
uni.hideLoading();
});
uni.hideLoading();
});
}
} catch (e) {
this.showErrorMessage(e.stack)
@ -271,7 +276,7 @@
this.afterGetBalance(this.label, balance);
},
afterGetBalance(label, balance,packageInfo) {
afterGetBalance(label, balance, packageInfo) {
try {
let that = this;
let itemCode = label.itemCode;
@ -292,11 +297,11 @@
if (batch.Recommends.length > 0) {
let recommend = batch.Recommends.find(r => r.packingNumber == packingCode);
if (recommend != undefined) {
that.addRecord(batch, label, balance,packageInfo)
that.addRecord(batch, label, balance, packageInfo)
} else {
//
if (this.jobContent.allowModifyPackingNumber == 'TRUE') {
that.addRecord(batch, label, balance,packageInfo);
that.addRecord(batch, label, balance, packageInfo);
} else {
that.showErrorMessage('未查找到该箱码【' + packingCode + '】的明细',
res => {
@ -306,7 +311,7 @@
}
}
} else {
that.addRecord(batch, label, balance,packageInfo)
that.addRecord(batch, label, balance, packageInfo)
}
} else {
that.showErrorMessage('箱码【' + packingCode + '】已经扫描,请继续扫描下一箱',
@ -361,14 +366,14 @@
return batch;
},
creatRecord(label, balance,packageInfo) {
creatRecord(label, balance, packageInfo) {
balance.stdPackQty = packageInfo.stdPackQty
balance.stdPackUnit = packageInfo.stdPackUnit
let record = {
itemCode: label.itemCode,
packingNumber: label.packingNumber,
batch: label.batch,
qty: Number(label.qty)>Number(balance.qty)?Number(balance.qty):Number(label.qty),
qty: Number(label.qty) > Number(balance.qty) ? Number(balance.qty) : Number(label.qty),
uom: balance.uom,
inventoryStatus: balance.inventoryStatus,
balance: balance,
@ -381,13 +386,13 @@
calcBatchHandleQty(batch) {
let handleQty = 0;
batch.Records.forEach(res => {
handleQty += Number(res.qty)
handleQty = calc.add(handleQty,res.qty)
})
batch.handleQty = handleQty;
},
addRecord(batch, label, balance,packageInfo) {
let record = this.creatRecord(label, balance,packageInfo);
addRecord(batch, label, balance, packageInfo) {
let record = this.creatRecord(label, balance, packageInfo);
batch.Records.push(record);
this.issueRecord.unshift(record)
this.calcBatchHandleQty(batch);

8
pages/productionReturn/job/returnDetail.vue

@ -104,7 +104,6 @@
return {
id: '',
jobContent: {},
received: false,
toLocationCode: '',
scanCount: 0,
jobContent: {}, //
@ -115,7 +114,8 @@
toLocationTypeList: [],
toLocationInfo: {},
businessTypeInfo: {},
titleInfo: ""
titleInfo: "",
jobStatus:""
};
},
onLoad(option) {
@ -124,7 +124,6 @@
// //
if (option.status == "1") {
this.receive((callback => {
this.received = true;
this.getDetail();
}));
} else {
@ -142,7 +141,7 @@
onBackPress(e) {
//
if (e.from == 'backbutton') {
if (this.received) {
if (this.jobStatus=="2") {
//
cancleTakeProductionReturnJob(this.id).then(res => {
uni.navigateBack();
@ -190,6 +189,7 @@
} else {
if (res.data.subList.length > 0) {
that.jobContent = res.data;
that.jobStatus = res.data.status
that.subList = res.data.subList;
that.detailSource = getDataSource(that.subList)

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

Loading…
Cancel
Save