Browse Source

新文件修改 文件迁移Vue2升级Vue3 10/25-11/8

hella_vue3
王志国 2 weeks ago
parent
commit
a263602deb
  1. 263
      src/api/request2.js
  2. 14
      src/common/balance.js
  3. 40
      src/common/detail.js
  4. 45
      src/common/label.js
  5. 33
      src/common/record.js
  6. 95
      src/mycomponents/detail/comDetailCardBatch.vue
  7. 49
      src/mycomponents/detail/comJobDetailCardBatch.vue
  8. 6
      src/mycomponents/detail/comRecommendDetailCard.vue
  9. 2
      src/mycomponents/item/itemCompareQty.vue
  10. 2
      src/mycomponents/package/packageCard.vue
  11. 2
      src/mycomponents/qty/balanceQtyEdit.vue
  12. 2
      src/mycomponents/qty/packUnit.vue
  13. 8
      src/mycomponents/qty/qtyEdit.vue
  14. 86
      src/mycomponents/qty/recommendHandleQty.vue
  15. 19
      src/mycomponents/qty/recommendQtyEdit.vue
  16. 293
      src/mycomponents/query/fifoQuery.vue
  17. 16
      src/mycomponents/record/recordComDetailCard.vue
  18. 207
      src/mycomponents/record/recordComDetailCardBatch.vue
  19. 12
      src/mycomponents/scan/winComScan.vue
  20. 8
      src/mycomponents/scan/winScanLocation.vue
  21. 10
      src/mycomponents/scan/winScanPack.vue
  22. 11
      src/mycomponents/scan/winScanPackAndLocation.vue
  23. 2
      src/mycomponents/scan/winScanPackJob.vue
  24. 98
      src/pages.json
  25. 502
      src/pages/issue/record/directIssueByBatch.vue
  26. 2
      src/pages/productReceipt/job/semiProductReceiptJob.vue
  27. 447
      src/pages/productReceipt/record/productReceiptRecordByBatch.vue
  28. 41
      src/pages/purchaseReceipt/job/purchaseReceiptDevelop.vue
  29. 42
      src/pages/purchaseReceipt/job/purchaseReceiptTool.vue
  30. 7
      src/pages/putaway/job/putawayJob.vue
  31. 1
      src/pages/putaway/record/putawayRecord.vue
  32. 2
      src/pages/scrap/record/scrapRecord.vue
  33. 346
      src/pages/unPlanned/record/receiptRecordByBatch.vue

263
src/api/request2.js

@ -170,6 +170,14 @@ export function getExpectinByItemcode(params) {
export function getExpectoutByItemcode(params) {
return http.post("/wms/expectout/senior",params)
}
/**
* 查询库存事务
* @param {*}
*
*/
export function getTransaction(params) {
return http.post("/wms/transaction/senior",params);
}
/**
* 按库位查询库存汇总
* @param {*}
@ -369,6 +377,24 @@ export function getBasicItemByCode(itemCode) {
}
return http.get("/wms/itembasic/page",{params})
}
/**
* 查询物品信息接口
* @param {*} code 物品代码
*
*/
export function getBasicItemByCodeSenior(itemCode) {
var params = {
filters: [{
column: "code",
action: "like",
value: itemCode
}],
pageNo: 1,
pageSize: 1000
}
return http.post('/wms/itembasic/senior',params);
}
/**
* 按物品查询库存汇总
* @param {*} itemCode
@ -795,6 +821,31 @@ export function cancleTakePutawayJob(id) {
export function putawayJobSubmit(params) {
return http.put("/wms/putaway-job-main/execute", params)
}
/**
* 采购上架 全部承接任务
* @param {*} id
*
*/
export function takeAllPutawayJob(data) {
return http.put("/wms/putaway-job-main/acceptBatch", data)
}
/**
* 采购上架 全部放弃承接任务
* @param {*} id
*
*/
export function cancleAllTakePutawayJob(data) {
return http.put("/wms/putaway-job-main/abandonBatch", data)
}
/**
* 采购上架 任务全部提交
* @param {*} data
*/
export function putawayJobAllExecute(data) {
return http.put("/wms/putaway-job-main/executeBatch", data)
}
/**
* 采购上架申请 获取任务列表
* 任务状态
@ -887,7 +938,7 @@ export function getIssueJobList(params) {
* 发料生产线查询
*/
export function getIssueJobByProductionline() {
return http.get("/issue-job-mwmsain/getIssueJobByProductionline")
return http.get("/wms/issue-job-main/getIssueJobByProductionline")
}
/**
* 发料接收生产线查询
@ -1075,6 +1126,18 @@ export function getFuzzyCountJobList(data) {
export function getCountJobDetail(id) {
return http.get("/wms/count-job-main/getCountJobById?id=" + id)
}
/**
* 盘点 获取任务明细
* @param {*} id 任务id
*
*/
export function getFuuzyCountJobDetail(id) {
return request({
url: baseApi + "/wms/count-job-main/getCountJobById-pda?id=" + id,
method: "get",
data: {},
});
}
/**
* 盘点任务 任务承接
* @param {*} id
@ -1604,6 +1667,13 @@ export function deliverRequestSubmit(params) {
export function deliverRequestClose(id) {
return http.put("/wms/deliver-request-main/close?id=" + id)
}
/**
* 翻包任务 关闭任务
* @param {*} params
*/
export function packageoverRequestClose(id) {
return http.put("/wms/packageover-job-main/close?id=" + id)
}
/**
* 制品发货申请 提交审批
* @param {*} params
@ -1830,6 +1900,41 @@ export function customerReturnRequestAddAgain(id) {
export function customerReturnRecordSubmit(params) {
return http.put("/wms/customerreturn-record-main/create",params)
}
/**
* 客户退货 记录列表
* @param {*} params
*/
export function getCustomerReturnRecordList(params) {
return http.post("/wms/customerreturn-record-detail/senior",params)
}
/**
* 客户退货 记录详情
* @param {*} params
*/
export function getCustomerReturnRecordDetail(id) {
return http.get("/wms/customerreturn-record-detail/page?masterId=" + id)
}
/**
* 客户退货 拒收
* @param {*} params
*/
export function customerReturnRecordRefuse(id) {
return http.put("/wms/customerreturn-record-main/refuse?id=" + id)
}
/**
* 客户退货 接收
* @param {*} params
*/
export function customerReturnRecordReceive(id) {
return http.put("/wms/customerreturn-record-main/receive?id=" + id)
}
/**
* 调拨入库 任务
* status 任务状态
@ -2093,6 +2198,29 @@ export function issueRecordSubmit(params) {
export function getProductionreturnJobList(params) {
return http.post("/wms/productionreturn-job-detail/senior",params)
}
/**
* 生产隔离退料 任务获取任务列表
* 任务状态
* 开始日期
* 结束日期
* 获取日期任务列表
* @param {*}
*/
export function getProductionHoldReturnJobList(params) {
return http.post("/wms/productionreturn-job-detail-hold/senior",params)
}
/**
* 生产合格退料 任务获取任务列表
* 任务状态
* 开始日期
* 结束日期
* 获取日期任务列表
* @param {*}
*/
export function getProductionOkReturnJobList(params) {
return http.post("/wms/productionreturn-job-detail-store/senior",params)
}
/**
* 生产退料任务 获取任务明细
* @param {*} id 任务id
@ -2213,6 +2341,40 @@ export function productionReturnRecordSubmit(params) {
return http.post("/wms/productionreturn-record-main/create",params)
}
/**
* 生产隔离退料 记录列表
* @param {*} params
*/
export function getProductionReturnRecordList(params) {
return http.post("/wms/productionreturn-record-detail-hold/senior",params)
}
/**
* 生产隔离退料 记录详情
* @param {*} params
*/
export function getProductionReturnRecordDetail(id) {
return http.get("/wms/productionreturn-record-detail/page?masterId=" + id)
}
/**
* 生产隔离退料 拒收
* @param {*} params
*/
export function productionReturnRecordRefuse(id) {
return http.put("/wms/productionreturn-record-main/refuse?id=" + id)
}
/**
* 生产隔离退料 接收
* @param {*} params
*/
export function productionReturnRecordReceive(id) {
return http.put("/wms/productionreturn-record-main/receive?id=" + id)
}
/**
* 计划外出库申请
* 任务状态
@ -2386,7 +2548,40 @@ export function scrapRequestAddAgain(id) {
export function scrapRecordSubmit(params) {
return http.post("/wms/scrap-record-main/create",params)
}
/**
* 隔离收货 记录列表
* @param {*} params
*/
export function getProductreceiptRecordList(params) {
return http.post("/wms/productreceipt-record-detail/senior",params)
}
/**
* 隔离收货 记录详情
* @param {*} params
*/
export function getProductreceiptRecordDetail(id) {
return http.get("/wms/productreceipt-record-detail/page?masterId=" + id)
}
/**
* 隔离收货 拒收
* @param {*} params
*/
export function productreceiptRecordRefuse(id) {
return http.put("/wms/productreceipt-record-main/refuse?id=" + id)
}
/**
* 隔离收货 接收
* @param {*} params
*/
export function productreceiptRecordReceive(id) {
return http.put("/wms/productreceipt-record-main/receive?id=" + id)
}
/**
* 补料任务 列表
@ -2531,6 +2726,14 @@ export function batchPrintingLable(params) {
export function getBalanceByFilter(params) {
return http.post("/wms/balance/senior" ,params)
}
/**
* 查询库存事务
* @param {*}
*
*/
export function getTransactionByFilter(param) {
return http.post("/wms/transaction/senior" ,param)
}
/**
* 查询管理精度多个物料多个库位
* @param {*}
@ -2724,7 +2927,14 @@ export function getPlaneInfoByproductLine(productionLine,planDate) {
export function planReceiptSubmit(data) {
return http.post( "/wms/productreceipt-record-main/createByPlan",data)
}
/**
* 按计划完工提交 李达明
* @param {*}
*/
export function createByPlanSubmit(params) {
return http.post("/wms/productreceipt-record-main/createByPlanToSenior",params);
}
/**
* @param {Object} params 创建计划完工后调用上架申请 number
*/
@ -2779,5 +2989,54 @@ export function getProductreceiptDetailbByPackingNumber(packingNumber ) {
* 物料变更
*/
export function fgChangeCommit(data) {
return http.post("/wms/relegate-request-main/bind",data)
return http.post("/wms/relegate-request-main/bind",data)
}
/**
* 查询物料与库位关系
*/
export function checkItemCodeAndLocation(params) {
return http.post("/wms/location/checkRecommendLocation",params)
}
/**
* 库存余额根据业务类型汇总接口
*/
export function getBalanceByBusinessType(params) {
return http.get("/wms/balance/summaryByBusinessType",params)
}
/**
* 物料隔离 记录列表
* @param {*} params
*/
export function getInventoryMoveRecordList(params) {
return http.post("/wms/inventorymove-record-detail/senior",params)
}
/**
* 物料隔离 记录详情
* @param {*} params
*/
export function getInventoryMoveRecordDetail(id) {
return http.get("/wms/inventorymove-record-detail/page?masterId=" + id)
}
/**
* 物料隔离 拒收
* @param {*} params
*/
export function inventoryMoveRecordRefuse(id) {
return http.put("/wms/inventorymove-record-main/refuse?id=" + id)
}
/**
* 物料隔离 接收
* @param {*} params
*/
export function inventoryMoveRecordReceive(id) {
return http.put("/wms/inventorymove-record-main/receive?id=" + id)
}

14
src/common/balance.js

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

40
src/common/detail.js

@ -44,7 +44,47 @@ export function getTreeDataSource(dataList) {
return items;
}
export function getThreeDataSource(data) {
let items = []
// let obj ={
// ...data.subList[0]
// }
// console.log(12)
// data.subList.forEach((item)=>{
// item.threeList = [{
// fromLocationCode:item.fromLocationCode,
// batch:item.batch,
// handleQty:0,
// qty:item.qty,
// inventoryStatus:item.inventoryStatus,
// toLocationCode:item.toLocationCode,
// }]
// item.packList=[{
// scaned : false,
// scanDate: new Date()
// }]
// })
// obj.subList = data.subList
// items.push(obj)
// return items;
data.subList.forEach((item)=>{
item.subList = [{
fromLocationCode:item.fromLocationCode,
batch:item.batch,
handleQty:0,
qty:item.qty,
inventoryStatus:item.inventoryStatus,
toLocationCode:item.toLocationCode,
// packList:[{
// scaned : false,
// scanDate: new Date()
// }]
}]
})
items = data.subList
return items;
}
export function getDataSource(subList) {
let items = [];
subList.forEach(detail => {

45
src/common/label.js

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

33
src/common/record.js

@ -42,7 +42,23 @@ export function createDetailInfo(balance, pack) {
return detail;
}
export function createDetailInfoForLabel(balance, pack,label) {
balance.scaned = true;
// data.toInventoryStatus = this.toInventoryStatus == "" ? data.inventoryStatus : this.toInventoryStatus;
// data.inventoryStatus = data.inventoryStatus;
let detail = deepCopyData(balance);
detail.balanceQty = new Decimal(detail.qty).toNumber()
detail.qty = new Decimal(detail.qty).toNumber();
detail.packQty = pack.packQty ? new Decimal(pack.packQty).toNumber() : 0
detail.packUnit = pack.packUnit
console.log(988,label.qty)
detail.handleQty = new Decimal(label.qty).toNumber();
detail.package = pack;
detail.productionlineCode = pack.productionLineCode; // 制品回收记录需要加的
detail.toInventoryStatus = balance.inventoryStatus; // 制品回收记录需要加的
return detail;
}
export function createDetailByPackInfo(pack) {
// data.toInventoryStatus = this.toInventoryStatus == "" ? data.inventoryStatus : this.toInventoryStatus;
@ -75,7 +91,22 @@ export function calcHandleQty(detailSource) {
}
}
}
//添加数量
export function calcHandleQtyAdd(detailSource,label) {
for (let item of detailSource) {
item.handleQty = item.handleQty || new Decimal(0).toNumber();
item.qty = item.qty|| new Decimal(0).toNumber();
item.handleQty = calc.add(item.handleQty, label.qty);
for (let detail of item.subList) {
if (detail != undefined) {
if (detail.scaned) {
detail.handleQty = calc.add(detail.handleQty, label.qty);
}
// item.qty = calc.add(item.qty, detail.qty);
}
}
}
}
export function calcTreeHandleQty(detailSource) {
for (let item of detailSource) {
item.handleQty = new Decimal(0).toNumber();

95
src/mycomponents/detail/comDetailCardBatch.vue

@ -1,21 +1,26 @@
<template>
<view style="background-color: #fff;">
<item-compare-qty :dataContent="dataContent" :handleQty="dataContent.handleQty" :isShowStdPack="false">
</item-compare-qty>
<view class="" v-for="(item,index) in dataContent.subList" :key="index" :class="item.scaned?'scan_view':''">
<u-swipe-action ref="swipeAction"
:options="(item.scaned&&isEdit)?editAndRemoveOptions : item.scaned? removeOptions:options"
@click="(...event)=>swipeClick(event,item,'parent')"
v-if='index==0'>
<div style="display: flex;">
<div style="flex: 1;">
<batch v-if="item.batch" :batch="item.batch"></batch>
<location title="来源库位" v-if="item.fromLocationCode" :locationCode="item.fromLocationCode"></location>
</div>
<text style="font-size: 30rpx;color: #2979ff; " @click="copy(item)" v-if="isDevlement()">复制</text>
</div>
</u-swipe-action>
</view>
<u-collapse ref="collapse1Ref" @change="">
<u-collapse-item :open="true">
<template #title>
<item-compare-qty :dataContent="dataContent"
:handleQty="dataContent.handleQty" :isShowStdPack="false">
</item-compare-qty>
</template>
<view class="" v-for="(item,index) in dataContent.subList" :key="index">
<u-swipe-action ref="swipeAction"
:options="item.scaned?scanOptions:detailOptions"
@click="(...event)=>swipeClick(event,item,'parent')"
v-if='index==0'>
<recommend :detail="item" :isShowFromLocation="isShowFromLocation"
:isShowStatus="isShowStatus" :isShowToLocation="isShowToLocation">
</recommend>
</u-swipe-action>
</view>
</u-collapse-item>
</u-collapse>
<balance-qty-edit ref="qtyEdit" :settingParam="settingParam" :queryBalance="queryBalance"
@confirm="confirm"></balance-qty-edit>
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation'
@ -26,19 +31,14 @@
<script setup>
import config from '@/static/config.js'
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import location from '@/mycomponents/balance/location.vue'
import toLocation from '@/mycomponents/balance/toLocation.vue'
import batch from '@/mycomponents/balance/batch.vue'
import ItemCompareQty from '@/mycomponents/item/itemCompareQty.vue'
import Recommend from '@/mycomponents/recommend/recommend.vue'
import BalanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import WinScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import {
getDetailOption,
getPurchaseReceiptOption,
getRemoveOption,
getEditRemoveOption
} from '@/common/array.js';
@ -65,6 +65,14 @@ const props = defineProps({
type: Boolean,
default: true
},
isShowFromLocation: {
type: Boolean,
default: true
},
isShowToLocation: {
type: Boolean,
default: false
},
locationAreaTypeList: {
type: Array,
default: null
@ -77,22 +85,15 @@ const props = defineProps({
type: Boolean,
default: true
},
isEdit: {
type: Boolean,
default: true
}
});
const emit = defineEmits(['openDetail', 'remove', 'updateData']);
const option = ref([]);
const showItem = ref({});
const locatonItem = ref({});
const editItem = ref({});
const detailOptions = ref([]);
const scanOptions = ref([]);
const options = ref([]);
const removeOptions = ref([]);
const editAndRemoveOptions = ref([]);
const collapse1Ref = ref(null);
const qtyEditRef = ref(null);
@ -118,8 +119,6 @@ onMounted(() => {
if (scanOptions.value.length === 0) {
scanOptions.value = getPurchaseReceiptOption(props.settingParam.allowModifyQty, false);
}
removeOptions.value = getRemoveOption();
editAndRemoveOptions.value = getEditRemoveOption();
});
const swipeClick = (e, item) => {
@ -168,34 +167,6 @@ const getLocation = (location, code) => {
locatonItem.value.toLocationCode = code;
emit('updateData');
};
const isDevlement = () => {
return config.isDevelopment;
};
const copy = (detail) => {
console.log(detail);
const content = `HPQ;V1.0;I${detail.itemCode};P${detail.packingNumber};B${detail.batch};Q${detail.qty}`;
// #ifdef H5
uni.copyText(content).then(() => {
uni.showToast({
title: '复制采购标签成功',
icon: 'none'
});
});
// #endif
// #ifndef H5
uni.setClipboardData({
data: content,
success: () => {
uni.showToast({
title: '复制采购标签成功'
});
}
});
// #endif
};
</script>
<style>

49
src/mycomponents/detail/comJobDetailCardBatch.vue

@ -1,17 +1,22 @@
<!-- 采购上架任务详情按批次显示详情的组件 -->
<template>
<view class="" style="background-color: #fff;">
<u-swipe-action
@click="(...event)=>swipeClick(event,dataContent,'parent')"
:options="(dataContent.scaned&&isEdit)?editAndRemoveOptions : dataContent.scaned? removeOptions:options">
<itemCompareQty :dataContent="dataContent" :handleQty="dataContent.handleQty" :isShowPackUnit="true">
</itemCompareQty>
<batch v-if="dataContent.subList[0].batch" :batch="dataContent.subList[0].batch"></batch>
<location title="来源库位" v-if="dataContent.subList[0].fromLocationCode"
:locationCode="dataContent.subList[0].fromLocationCode">
</location>
</u-swipe-action>
<u-collapse ref="collapseRef">
<u-collapse-item :open="true">
<template #title>
<itemCompareQty :dataContent="dataContent" :handleQty="dataContent.handleQty"
:isShowPackUnit="true"></itemCompareQty>
</template>
<package-list :dataContent="dataContent.subList"
:isEdit="settingParam.allowModifyQty=='TRUE'"
:settingParam="settingParam"
@collapseChange="collapseChange"
@updateData="updateData"
:isShowStatus="isShowStatus"
:isShowPackListStatus="isShowPackListStatus"
></package-list>
</u-collapse-item>
</u-collapse>
<recommend-qty-edit ref="receiptEditRef" :dataContent="editItem" :settingParam="settingParam" @confirm="confirm">
</recommend-qty-edit>
<comMessage ref="messageRef"></comMessage>
@ -27,13 +32,7 @@
import pack from '@/mycomponents/balance/pack.vue'
import detailList from '@/mycomponents/detail/detailList.vue'
import packageList from '@/mycomponents/package/packageList.vue'
import location from '@/mycomponents/balance/location.vue'
import toLocation from '@/mycomponents/balance/toLocation.vue'
import batch from '@/mycomponents/balance/batch.vue'
import {
getRemoveOption,
getEditRemoveOption
} from '@/common/array.js';
import {
getDetailOption,
getPurchaseReceiptOption
@ -62,10 +61,6 @@ const props = defineProps({
type: Boolean,
default: true
},
isEdit: {
type: Boolean,
default: true
}
});
const showItem = ref({});
@ -74,8 +69,6 @@ const locatonItem = ref({});
const detailOptions = ref([]);
const scanOptions = ref([]);
const options = ref([]);
const removeOptions = ref([]);
const editAndRemoveOptions = ref([]);
const collapseRef = ref(null);
const receiptEditRef = ref(null);
@ -89,8 +82,6 @@ onMounted(() => {
if (scanOptions.value.length === 0) {
scanOptions.value = getPurchaseReceiptOption(props.settingParam.allowModifyQty, props.settingParam.allowModifyLocation);
}
removeOptions.value = getRemoveOption();
editAndRemoveOptions.value = getEditRemoveOption();
});
@ -103,7 +94,7 @@ const collapseChange = () => {
const resizeCollapse = () => {
nextTick(() => {
if (collapseRef.value) {
collapseRef.value.resize();
collapseRef.value.init();
}
});
};
@ -115,13 +106,13 @@ const refreshCollapse = () => {
r.childrens.forEach(i => {
i.init();
});
r.resize();
r.init();
});
}
});
};
const swipeClick = (e, item, type) => {
const swipeClick = (e, item) => {
if (e.content.text === "编辑") {
edit(item);
} else if (e.content.text === "移除") {

6
src/mycomponents/detail/comRecommendDetailCard.vue

@ -16,7 +16,8 @@
<view class="" style="font-size: 32rpx; color: black; font-weight: bold; text-align: center;">
</view>
<recommend :detail="item" :isShowStatus="isShowStatus" :isShowToLocation="false">
<recommend :detail="item" :isShowStatus="isShowStatus"
:isShowToLocation="false" style="flex: 1">
</recommend>
</view>
<view v-else class="uni-flex" style="flex-direction: row; align-items: center;background-color: antiquewhite; margin-top: 5rpx;">
@ -24,7 +25,8 @@
</view>
<recommend :detail="item" :isShowStatus="isShowStatus" :isShowToLocation="false">
<recommend :detail="item" :isShowStatus="isShowStatus"
:isShowToLocation="false" style="flex: 1">
</recommend>
</view>
</u-swipe-action>

2
src/mycomponents/item/itemCompareQty.vue

@ -15,7 +15,7 @@
<script setup lang="ts">
import { ref, getCurrentInstance, watch } from 'vue'
import item from '@/mycomponents/item/item.vue'
import recommendQty from '@/mycomponents/qty/recommendQty.vue'
import RecommendQty from '@/mycomponents/qty/recommendHandleQty.vue'
import compareQty from '@/mycomponents/qty/compareQty.vue'
const { proxy } = getCurrentInstance()

2
src/mycomponents/package/packageCard.vue

@ -6,7 +6,7 @@
<view style="word-break: break-all">
<!-- <container v-if="isShowContainer&&dataContent.containerNumber!=null" :container="dataContent.containerNumber">
</container> -->
<pack v-if="isShowPack && dataContent.packingNumber" :packingCode="dataContent.packingNumber"> </pack>
<pack :packingCode="dataContent.packingNumber"> </pack>
<batch v-if="isShowBatch && dataContent.batch != null" :batch="dataContent.batch"></batch>
<location v-if="isShowFromLocation" title="来源库位" :locationCode="dataContent.fromLocationCode"> </location>
<!-- <to-location></to-location> -->

2
src/mycomponents/qty/balanceQtyEdit.vue

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

2
src/mycomponents/qty/packUnit.vue

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

8
src/mycomponents/qty/qtyEdit.vue

@ -60,7 +60,11 @@ const props = defineProps({
allowEditStatus: {
type: Boolean,
default: false
}
},
allowBiggerQty: {
type: String,
default: 'TRUE'
},
});
const emit = defineEmits(['confirm']);
@ -107,7 +111,7 @@ const setValue = () => {
comMessageRef.value.showConfirmWarningModal('数量必须大于0', () => {
allQty.value = balanceQtyValue;
});
} else if (allQty.value > balanceQtyValue) {
} else if (allQty.value > balanceQtyValue && props.allowBiggerQty == 'FALSE') {
comMessageRef.value.showConfirmWarningModal(`数量[${allQty.value}]不允许大于库存数量[${balanceQtyValue}]`, () => {
allQty.value = balanceQtyValue;
});

86
src/mycomponents/qty/recommendHandleQty.vue

@ -0,0 +1,86 @@
<template>
<view>
<status v-if="isShowStatus" :status='dataContent.inventoryStatus'></status>
<view class="uni-flex uni-row center">
<view class="text_recommend " v-if="Number(recommendQty)">
{{ Number(recommendQty) }}/
</view>
<view class="text_recommend ">
{{ Number(dataContent.qty) }}
</view>
</view>
<view>
<pack-unit :dataContent="dataContent"></pack-unit>
<!-- <std-pack-qty v-show="isShowStdPack" :dataContent="dataContent"></std-pack-qty> -->
</view>
</view>
</template>
<script setup>
import packUnit from '@/mycomponents/qty/packUnit.vue'
import uom from '@/mycomponents/qty/uom.vue'
import status from '@/mycomponents/status/status.vue'
import { ref, watch } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
const props = defineProps({
type: {
type: String,
default: 'default' // recommend: compare:
},
dataContent: {
type: Object,
default: () => ({})
},
recommendQty: {
type: Number,
default: 0
},
handleQty: {
type: Number,
default: 0
},
isShowStatus: {
type: Boolean,
default: true
},
isShowStdPack: {
type: Boolean,
default: true
},
objTextStyle: {
type: Object,
default: null
},
isShowPackCount: {
type: Boolean,
default: true
},
isShowCount: {
type: Boolean,
default: true
}
});
const calc = (qty, packQty) => {
if (qty && packQty) {
return Math.ceil(Number(qty) / Number(packQty));
} else {
return 0;
}
};
watch(() => props.type, (newVal) => {
//
});
onLoad(() => {
//
});
</script>
<style lang="scss">
</style>

19
src/mycomponents/qty/recommendQtyEdit.vue

@ -38,6 +38,13 @@
</view>
</view>
<view class="split_line"></view>
<view class="uni-flex uni-row space-between padding title u-col-center" v-if="showBalanceQty">
<text>库存数量 : </text>
<view class="uni-flex uni-row uni-center" style="align-items: center;">
<text class="text_recommend">{{Number(dataContent.balanceQty)}}</text>
<uom :uom="dataContent.uom"></uom>
</view>
</view>
</view>
</view>
</view>
@ -74,7 +81,15 @@ const props = defineProps({
settingParam: {
type: Object,
default: null
}
},
isNumTips: {
type: Boolean,
default: true
},
showBalanceQty: {
type: Boolean,
default: false
},
})
const allQty = ref(0)
const stdCount = ref(0)
@ -144,7 +159,7 @@ const calcQty = (e) => {
const setValue = () => {
// var recommendQty = Number(this.dataContent.qty);
// var labelQty = Number(this.dataContent.record.label.qty);
if (allQty.value > labelQty.value) {
if (allQty.value > labelQty.value && props.isNumTips) {
comMessageRef.value.showErrorMessage(`数量[${allQty.value}]不允许大于标签数量[${labelQty.value}]`, (res) => {
allQty.value = labelQty.value
})

293
src/mycomponents/query/fifoQuery.vue

@ -0,0 +1,293 @@
<template>
<view style=" ">
<u-popup ref="showRight" mode="left" length="80%">
<view style="height:100vh;display:flex;flex-direction:column;">
<view class="" style=" display:flex; background-color:#007AFF ;
flex-direction: row;
align-items: center;
justify-content: center;
">
<view class="uni-flex" style="
color: #fff;
padding: 20rpx;
font-size: 35rpx;">
先进先出查询
</view>
<view class="" @click="closeDrawer"
style="position: fixed; color: #fff; font-size: 35rpx;right: 0; padding-right: 15rpx;">
关闭
</view>
</view>
<scroll-view v-if="true" style="height: calc(100vh - 180rpx)" scroll-y="true">
<!-- <button @click="closeDrawer" type="primary">关闭Drawer</button> -->
<!-- <view v-for="item in 110" :key="item">可滚动内容 {{ item }}</view> -->
<view class="" style="margin: 10rpx; font-size: 35rpx;">
物料号
</view>
<view style=" margin: 10rpx; display: flex; align-items: center;">
<u-input class="uni-mt-5" prefixIcon="search" v-model="itemCode" placeholder="请输入物料号"
@clear="clearItemCode"></u-input>
<!-- <view>查询</view> -->
<!-- <button style="height: 80rpx; align-items: center; text-align: center;" type="primary" size="mini" >查询</button> -->
</view>
<view class="" style="margin: 10rpx; margin-top: 20rpx; font-size: 35rpx;">
仓库
</view>
<view style=" margin: 10rpx; display: flex; align-items: center;">
<u-input class="uni-mt-5" prefixIcon="search" v-model="warehouseCode" placeholder="请输入仓库"
></u-input>
</view>
<view v-for="(item, index) in itemCodeResult" :key="index" @click="selectItemCode(item)">
<view class="" style="font-size: 30rpx; margin: 20rpx;">
<view class="">
({{ index + 1 }}) 物料代码 : {{ item.code }}
</view>
<view class="">
名称 : {{ item.name }}
</view>
<view class="">
描述1 : {{ item.desc1 }}
</view>
<view class="">
描述2 : {{ item.desc1 }}
</view>
</view>
<view class="split_line"></view>
</view>
<scroll-view v-if="tableData.length>0"
:scroll-x="true"
:scroll-y="true"
style=" width: 340px; display: flex; align-items: center; justify-content: center; ">
<u-table border stripe emptyText="暂无更多数据">
<!-- 表头行 -->
<u-tr>
<!-- <uni-th align="left">批次</uni-th>
<uni-th align="left">库位</uni-th>
<uni-th align="left">状态</uni-th>
<uni-th align="left">数量</uni-th>
<uni-th align="left">单位</uni-th> -->
<u-th width="60" align="left">批次</u-th>
<u-th width="60" align="left">库位</u-th>
<u-th width="60" align="left">状态</u-th>
<u-th width="100" align="left">数量</u-th>
<u-th width="60" align="left">单位</u-th>
</u-tr>
<!-- 表格数据行 -->
<u-tr v-for="(item, index) in tableData" :key="index">
<u-td>{{ item.batch }}</u-td>
<u-td>{{ item.locationCode }}</u-td>
<u-td>{{ statusDesc(item.inventoryStatus) }}</u-td>
<u-td>{{ item.totalQty }}</u-td>
<u-td>
<uom :uom="uom"></uom>
</u-td>
</u-tr>
</u-table>
<!-- <view class="uni-flex" style=" flex-direction: column; position: fixed; bottom: 0; margin-bottom: 100rpx; background-color: #fff; width: 100%; align-items: center;" >
<view class="" style="width: 100%; display: flex; justify-content: center; font-size: 32rpx;margin-top: 10rpx;margin-bottom: 10rpx;">
<view class="" >当前页{{ current }}总数{{ total }}每页{{ pageSize }}
</view>
</view>
<uni-pagination :current="current" :total="total" :show-icon="true"
@change="change" />
</view> -->
</scroll-view>
</scroll-view>
<button @click="query" type="primary" style="padding-left: 20rpx; width: 100%;">查询</button>
</view>
</u-popup>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script setup>
import {
getBasicItemByCodeSenior,
getBalanceByBusinessType,
getBasicItemByCode
} from '@/api/request2.js';
import {
getInventoryStatusStyle,
getInventoryStatusName
} from '@/common/directory.js';
import Uom from '@/mycomponents/qty/uom.vue'
import {ref, watch} from 'vue';
const itemCode = ref('');
const itemCodeResult = ref([]);
const current = ref(1);
const total = ref(18);
const tableData = ref([]);
const warehouseCode = ref('');
const areaCode = ref('');
const uom = ref('');
const props = defineProps({
businessTypeCode: {
type: String,
default: ''
}
});
const comMessage = ref(null);
const showRight = ref();
const statusStyle = (val) => {
return getInventoryStatusStyle(val);
};
const statusDesc = (value) => {
return getInventoryStatusName(value);
};
const change = () => {
};
const showErrorMessage = (message) => {
comMessage.value.showErrorMessage(message, (res) => {
if (res) {
}
});
};
const selectItemCode = (item) => {
itemCode.value = item.code;
itemCodeResult.value = [];
getBalanceByBusiness(itemCode.value, props.businessTypeCode);
};
const clearItemCode = () => {
itemCode.value = '';
itemCodeResult.value = [];
tableData.value = [];
};
const onConfirmItemCode = () => {
if (!itemCode.value) {
showErrorMessage('物料号为空,请先输入物料号');
return;
}
tableData.value = [];
uni.showLoading({
title: '加载中',
mask: true
});
getBasicItemByCodeSenior(itemCode.value).then((res) => {
if (res.data && res.data.list.length > 0) {
if (res.data.list.length === 1) {
itemCode.value = res.data.list[0].code;
getBalanceByBusiness(itemCode.value, props.businessTypeCode);
} else {
uni.hideLoading();
itemCodeResult.value = res.data.list;
}
} else {
uni.hideLoading();
showErrorMessage(`未查找到物料[${itemCode.value}]`);
}
}).catch((error) => {
uni.hideLoading();
showErrorMessage(error);
});
};
const getBalanceByBusiness = (itemCode, businessType) => {
const params = {
itemCode,
businessType,
inOrOut: 'out'
};
getBalanceByBusinessType(params).then((res) => {
uni.hideLoading();
if (res.data && res.data.length > 0) {
tableData.value = res.data;
} else {
showErrorMessage(`系统异常:按${res.msg}未查找到库存`);
}
}).catch((error) => {
uni.hideLoading();
showErrorMessage(error);
});
};
const showDrawer = () => {
showRight.value.open();
};
const closeDrawer = () => {
showRight.value.close();
};
const query = () => {
if (itemCode.value === '') {
showErrorMessage('物料代码为空,请输入物料代码');
return;
}
if (warehouseCode.value === '') {
showErrorMessage('仓库代码为空,请输入仓库代码');
return;
}
uni.showLoading({
title: '查询中',
mask: true
});
getBasicItemByCode(itemCode.value).then((res) => {
if (res.data && res.data.list.length === 1) {
uom.value = res.data.list[0].uom;
queryBalance();
} else {
uni.hideLoading();
showErrorMessage(`未查询到物料号${itemCode.value}的信息`);
}
}).catch((error) => {
uni.hideLoading();
showErrorMessage(error);
});
};
const queryBalance = () => {
const params = {
itemCode: itemCode.value,
warehouseCode: warehouseCode.value,
businessType: props.businessTypeCode,
inOrOut: 'out'
};
getBalanceByBusinessType(params).then((res) => {
uni.hideLoading();
if (res.data && res.data.length > 0) {
tableData.value = res.data;
} else {
showErrorMessage(`系统异常:按${res.msg}未查找到库存`);
}
}).catch((error) => {
uni.hideLoading();
showErrorMessage(error);
});
};
defineExpose({
showDrawer
})
</script>
<style>
</style>

16
src/mycomponents/record/recordComDetailCard.vue

@ -3,7 +3,7 @@
<u-collapse ref="collapse1">
<u-collapse-item :open="true">
<template v-slot:title>
<u-swipe-action :show="false" style="width: 90%" :options="removeOptions" bg-color="rgba(255,255,255,0)" @click="(...event) => removeItem(event, dataContent)">
<u-swipe-action :show="false" style="width: 90%" :options="scanOptions" bg-color="rgba(255,255,255,0)" @click="(...event) => removeItem(event, dataContent)">
<item-qty :dataContent="dataContent" :isShowBalance="true"
:isShowBalanceQty="isShowBalanceQty" :isShowRecommendQty="false">
</item-qty>
@ -21,7 +21,7 @@
</u-swipe-action>
</u-collapse-item>
</u-collapse>
<balance-qty-edit ref="balanceQtyEditRef" @confirm="confirm"></balance-qty-edit>
<balance-qty-edit ref="balanceQtyEditRef" @confirm="confirm" :queryBalance="queryBalance"></balance-qty-edit>
<record-detail-popup ref="recordDetailPopupRef"></record-detail-popup>
<com-message ref="comMessageRef" />
</view>
@ -74,18 +74,26 @@ const props = defineProps({
type: Boolean,
default: true
},
isShowHandleQty: {
type: Boolean,
default: true
},
isShowModifedLocation: {
type: Boolean,
default: false
},
allowModifyQty: {
type: Boolean,
default: false
default: true
},
allowModifyLocation: {
type: Boolean,
default: false
}
},
queryBalance: {
type: Boolean,
default: true
},
})
const collapse1 = ref()
//

207
src/mycomponents/record/recordComDetailCardBatch.vue

@ -0,0 +1,207 @@
<template>
<view class="" style="background-color: #fff;">
<uni-collapse ref="collapse1">
<uni-collapse-item :open="true">
<template v-slot:title>
<uni-swipe-action>
<uni-swipe-action-item @click="removeItem($event,dataContent)" :right-options="removeOptions">
<item-qty :dataContent="dataContent" :isShowBalance="true"
:isShowBalanceQty="isShowBalanceQty"
:isShowRecommendQty="false"
></item-qty>
<view style="margin-left: 10px; margin-top: 5px;">
<pack title='父包装' v-if="dataContent.containerNumber"
:packingCode='dataContent.containerNumber'></pack>
<location v-if="isShowParentToLocation" title='目标库位'
:locationCode='dataContent.toLocationCode'></location>
</view>
</uni-swipe-action-item>
</uni-swipe-action>
</template>
<view class='split_line'></view>
<view class="" v-for="(detail,index) in dataContent.subList" :key="index">
<uni-swipe-action>
<uni-swipe-action-item @click="swipeClick($event,detail,index)"
:right-options="detail.scaned?scanOptions:detailOptions">
<balance :dataContent="detail" :isShowStdPack="false" :isShowStatus="isShowStatus"
:isShowPack="true" :isShowFromLocation="isShowFromLocation"
:isShowToLocation="isShowToLocation" :isShowParentPack="isShowParentPack">
</balance>
</uni-swipe-action-item>
</uni-swipe-action>
<!-- <view class='split_line'></view> -->
</view>
</uni-collapse-item>
</uni-collapse>
<balance-qty-edit ref="balanceQtyEdit" @confirm="confirm"></balance-qty-edit>
<record-detail-popup ref="recordDetailPopup"></record-detail-popup>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script setup>
import itemQty from '@/mycomponents/item/itemQty.vue'
import balance from '@/mycomponents/balance/balance.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import balanceDetailPopup from '@/mycomponents/balance/balanceDetailPopup.vue'
import purchaseLabel from '@/mycomponents/balance/purchaseLabel.vue'
import location from '@/mycomponents/balance/location.vue'
import recordDetailPopup from '@/mycomponents/detail/recordDetailPopup.vue'
import pack from '@/mycomponents/balance/pack.vue'
import PackageAndItemCard from '@/mycomponents/package/PackageAndItemCard.vue'
import {
getDetailOption,
getDetailEditRemoveOption,
getClearOption,
getEditLocationRemoveOption,
getRecordOption
} from '@/common/array.js';
import {ref, watch, onMounted, nextTick} from 'vue';
const props = defineProps({
dataContent: {
type: Object,
default: () => ({})
},
settingParam: {
type: Object,
default: () => ({})
},
isShowStatus: {
type: Boolean,
default: true
},
isShowFromLocation: {
type: Boolean,
default: true
},
isShowToLocation: {
type: Boolean,
default: true
},
isShowParentToLocation: {
type: Boolean,
default: true
},
isShowBalanceQty: {
type: Boolean,
default: false
},
isShowParentPack: {
type: Boolean,
default: true
},
isShowModifedLocation: {
type: Boolean,
default: false
},
allowModifyQty: {
type: Boolean,
default: true
},
allowModifyLocation: {
type: Boolean,
default: false
}
});
const emit = defineEmits(['removeItem', 'removePack', 'editLocation', 'updateData']);
const option = ref([]);
const title = ref("推荐详情");
const showItem = ref({});
const editItem = ref({});
const detailOptions = ref([]);
const scanOptions = ref([]);
const removeOptions = ref([]);
const dataList = ref([]);
watch(() => props.dataContent, (newDataContent, oldDataContent) => {
if (newDataContent.subList.length > 0) {
nextTick(() => {
setTimeout(() => {
const collapse1 = ref(null);
if (collapse1.value) {
collapse1.value.init();
}
}, 500);
});
}
}, {immediate: true, deep: true});
onMounted(() => {
detailOptions.value = getDetailOption();
scanOptions.value = getRecordOption(props.allowModifyQty, props.allowModifyLocation);
removeOptions.value = props.isShowModifedLocation ? getEditLocationRemoveOption() : getClearOption();
});
const removeItem = (e, dataContent) => {
if (e.content.text === "移除") {
uni.showModal({
title: "提示",
content: "确定清空物料及箱码信息?",
success: (res) => {
if (res.confirm) {
emit('removeItem', dataContent);
}
}
});
} else {
editLocation(dataContent);
}
};
const swipeClick = (e, item, index) => {
if (e.content.text === "详情") {
detail(item);
} else if (e.content.text === "编辑") {
edit(item);
} else if (e.content.text === "移除") {
remove(item, index);
}
};
const edit = (item) => {
editItem.value = item;
const balanceQtyEdit = ref(null);
if (balanceQtyEdit.value) {
balanceQtyEdit.value.openEditPopup(editItem.value, editItem.value.handleQty);
}
};
const detail = (item) => {
showItem.value = item;
const recordDetailPopup = ref(null);
if (recordDetailPopup.value) {
recordDetailPopup.value.openPopup(item);
}
};
const remove = (item, index) => {
uni.showModal({
title: "提示",
content: "确定移除扫描信息?",
success: (res) => {
if (res.confirm) {
props.dataContent.subList.splice(index, 1);
emit('removePack');
}
}
});
};
const editLocation = (item) => {
editItem.value = item;
emit('editLocation', item);
};
const confirm = (qty) => {
editItem.value.handleQty = qty;
emit('updateData');
};
</script>
<style>
</style>

12
src/mycomponents/scan/winComScan.vue

@ -51,8 +51,10 @@
<script setup lang="ts">
import { ref, getCurrentInstance, onMounted, nextTick, watch } from 'vue'
import { getLabelInfo } from '../../common/label.js'
import { getLabelInfo } from '@/common/label.js'
import {
getManagementPrecisions
} from '@/common/balance.js';
const props = defineProps({
placeholder: {
type: String,
@ -73,6 +75,10 @@ const props = defineProps({
headerType: {
type: String,
default: 'HPQ' // HLB HMQ HCQ HPQ
},
locationCode:{
type: String,
default: ''
}
})
@ -162,7 +168,7 @@ const handelScanMsg = () => {
}
})
}
})
},props.locationCode)
}, 200)
}
}

8
src/mycomponents/scan/winScanLocation.vue

@ -77,7 +77,7 @@ const getScanResult = (result) => {
}
if (code.value == undefined) {
proxy.$modal.closeLoading()
showErrorMessage(`扫描库位[${code.value}]为空,请输入正确的库位`)
showErrorMessage(`扫描库位为空,请输入正确的库位`)
return
}
getBasicLocationByCode(code.value)
@ -87,6 +87,7 @@ const getScanResult = (result) => {
const result = res.data.list[0]
if (result.code != code.value) {
showErrorMessage(`未查询到库位[${code.value}]`)
emit('clearFromLocation',code.value)
return
}
const { type } = result
@ -105,10 +106,11 @@ const getScanResult = (result) => {
}
} else {
showErrorMessage(`未查询到库位[${code.value}]`)
emit('clearFromLocation',code.value)
}
})
.catch((error) => {
proxy.$modal.closeLoading()
uni.hideLoading();
showErrorMessage(error)
})
}
@ -155,7 +157,7 @@ const showErrorMessage = (message) => {
}
//
const emit = defineEmits(['getLocation'])
const emit = defineEmits(['getLocation','clearFromLocation'])
defineExpose({ openScanPopup, openScanPopupSimulate })
</script>

10
src/mycomponents/scan/winScanPack.vue

@ -11,7 +11,10 @@
</view>
<view class="">
<view class="">
<win-com-scan ref="comscan" :placeholder="title" @getResult="getScanResult" :headerType="headerType" :isShowHistory="isShowHistory" :clearResult="true"></win-com-scan>
<win-com-scan ref="comscan" :placeholder="title"
@getResult="getScanResult" :headerType="headerType"
:isShowHistory="isShowHistory" :clearResult="true"
:locationCode='locationCode'></win-com-scan>
</view>
</view>
</view>
@ -43,7 +46,7 @@ const props = defineProps({
const show = ref(false)
const comMessageRef = ref()
const comscan = ref()
const comscansimulate = ref()
const locationCode = ref('')
//
const simulateScan = (scanMessage) => {
getLabelInfo(scanMessage, props.headerType, (callback) => {
@ -54,9 +57,10 @@ const simulateScan = (scanMessage) => {
}
})
}
const openScanPopup = () => {
const openScanPopup = (locationCode1) => {
setTimeout((res) => {
show.value = true
locationCode.value = locationCode1
getfocus()
}, 500)
}

11
src/mycomponents/scan/winScanPackAndLocation.vue

@ -191,6 +191,9 @@ const closeScanPopup = (content) => {
emit('close', '')
}
const scanLocation = (scanResult) => {
if(scanResult.fromLocationCode){
fromLocationCode.value = scanResult.fromLocationCode
}
const isCheck = false
if (fromLocationCode.value == '') {
showErrorMessage('来源库位不能为空', (callback) => {
@ -281,6 +284,11 @@ const checkPackage = async (result) => {
})
}
chooseWhich.value = '2'
if(!result.label.itemCode){
showErrorMessage('扫描标签不对,请重新扫描')
emit('clearItemCode',result.label)
return
}
if (res.data && res.data.list && res.data.list.length > 1) {
showBalanceSelect(res.data.list);
} else {
@ -330,6 +338,7 @@ const allowNoneBalance = async (datas) => {
const mustHavaBalance = (datas) => {
if (datas.length == 0) {
showErrorMessage(`${getQueryCondition()}\n未查找到库存记录`, (res) => {
emit('clearItemCode',scanResult.value)
packGetFocus()
})
} else if (datas.length == 1) {
@ -481,7 +490,7 @@ const addLocationCode = (code) => {
}
}
//
const emit = defineEmits(['close', 'getCountScanResult', 'getResult', 'confirm'])
const emit = defineEmits(['close', 'getCountScanResult', 'getResult', 'confirm','clearItemCode'])
defineExpose({ openScanPopupForType, openScanPopupForJob, packGetFocus, packLoseFocus, closeScanPopup })
</script>

2
src/mycomponents/scan/winScanPackJob.vue

@ -46,8 +46,8 @@ const comMessageRef = ref(null)
const show = ref(false)
//
const openScanPopup = () => {
show.value = true
setTimeout(()=>{
show.value = true
packGetFocus()
},500)
}

98
src/pages.json

@ -258,6 +258,62 @@
}
}
},
{
"path": "pages/purchaseReceipt/job/purchaseReceiptTool",
"style": {
"navigationBarTitleText": "协定品收货",
"enablePullDownRefresh": true,
"titleNView": {
// "autoBackButton": "true",
"buttons": [
//
{
"float": "right",
"fontSize": "58rpx", //
"text": "\ue696",
"fontSrc": "/static/ali_icon/iconfont.ttf"
},
{
"float": "right",
"fontSize": "52rpx", //
"text": "\ue6e2",
"fontSrc": "/static/ali_icon/iconfont.ttf"
}
]
}
}
},
{
"path": "pages/purchaseReceipt/job/purchaseReceiptDevelop",
"style": {
"navigationBarTitleText": "号试品收货",
"enablePullDownRefresh": true,
"titleNView": {
// "autoBackButton": "true",
"buttons": [
//
{
"float": "right",
"fontSize": "58rpx", //
"text": "\ue696",
"fontSrc": "/static/ali_icon/iconfont.ttf"
},
{
"float": "right",
"fontSize": "52rpx", //
"text": "\ue6e2",
"fontSrc": "/static/ali_icon/iconfont.ttf"
}
]
}
}
},
{
"path": "pages/purchaseReceipt/job/purchaseReject",
"style": {
@ -709,6 +765,34 @@
}
}
},
{
"path": "pages/issue/record/directIssueByBatch",
"style": {
"navigationBarTitleText": "直接发料",
"enablePullDownRefresh": false,
"titleNView": {
"autoBackButton": "true",
"buttons": [
//
{
"float": "right",
"fontSize": "58rpx", //
"text": "\ue696",
"fontSrc": "/static/ali_icon/iconfont.ttf"
},
{
"float": "right",
"fontSize": "52rpx", //
"text": "\ue6e2",
"fontSrc": "/static/ali_icon/iconfont.ttf"
}
]
}
}
},
{
"path": "pages/issue/record/directIssue0816",
"style": {
@ -1407,6 +1491,13 @@
"enablePullDownRefresh": false
}
},
{
"path": "pages/productReceipt/record/productReceiptRecordByBatch",
"style": {
"navigationBarTitleText": "制品收货记录",
"enablePullDownRefresh": false
}
},
{
"path": "pages/productPutaway/job/productPutawayJob",
"style": {
@ -2501,6 +2592,13 @@
"enablePullDownRefresh": false
}
},
{
"path": "pages/unPlanned/record/receiptRecordByBatch",
"style": {
"navigationBarTitleText": "计划外入库记录",
"enablePullDownRefresh": false
}
},
{
"path": "pages/unPlanned/record/issueRecord",
"style": {

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

@ -0,0 +1,502 @@
<template>
<view class="page-wraper">
<view class="">
<com-blank-view @goScan='showFromLocationPopup' v-if="detailSource.length==0"></com-blank-view>
</view>
<view class="page-wraper" v-if="detailSource.length>0">
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent"
:isShowFromLocation="true" @removeItem="removeItem(index,item)"
:isShowToLocation="false" :isShowParentToLocation="false" @updateData="updateData"
:allowModifyQty="true"
@removePack="removePack">
</record-com-detail-card>
</view>
</view>
</scroll-view>
</view>
<view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
<view class="uni-row uni-flex">
<text>生产线:</text>
<view class="uni-flex u-col-center uni-row" @click="showSelect">
<view class="" style="margin-left: 20rpx;">
{{positionInfo}}
</view>
<u-select v-model="show" mode="mutil-column-auto" :list="positionList"
@confirm="confirmSelect"></u-select>
</view>
</view>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
</view>
</view>
</view>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
</view>
<win-scan-location ref="scanFromLocationCode" title="来源库位" @getLocation='getFromLocation'
:locationAreaTypeList="fromLocationAreaTypeList"></win-scan-location>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' :title="'箱码'">
</win-scan-pack-and-location>
<!-- <winComScanBalance ref="scanPopup" @getBalance='getScanResult' :bussinessCode="businessTypeCode">
</winComScanBalance> -->
<fifoQuery ref="refFifoQuery" :businessTypeCode="businessTypeCode"></fifoQuery>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script setup>
import {
issueRecordSubmit,
getWorkShopLineStation,
getBalanceByFilter
} from '@/api/request2.js';
import {
goHome,
getPackingNumberAndBatchByList,
deepCopyData,
getSwitchInfoByCode
} from '@/common/basic.js';
import {
calc
} from '@/common/calc.js';
import {
getInventoryStatusDesc,
getDirectoryItemArray
} from '@/common/directory.js';
import {
getBusinessType,
createItemInfo,
createDetailInfo,
calcHandleQty,
createDetailInfoForLabel
} from '@/common/record.js';
import {
getManagementPrecisions,
getPrecisionStrategyList,
getPrecisionStrategyParams
} from '@/common/balance.js';
import {
Decimal
} from 'decimal.js'; //
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue'
import recordDetailCard from '@/mycomponents/record/recordDetailCard.vue'
import balanceSelect from '@/mycomponents/balance/balanceSelect.vue'
import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue'
import fifoQuery from '@/mycomponents/query/fifoQuery.vue'
import { ref, onMounted ,nextTick} from 'vue';
import { onLoad, onNavigationBarButtonTap, onBackPress, onPullDownRefresh } from '@dcloudio/uni-app';
const businessTypeCode = ref('');
const businessType = ref('');
const fromInventoryStatuses = ref([]);
const fromLocationAreaTypeList = ref([]);
const positionList = ref([]);
const fifoSwitch = ref(false);
const detailSource = ref([]);
const workshopCode = ref('');
const productionLineCode = ref('');
const workStationCode = ref('');
const workShopName = ref('');
const productionLineName = ref('');
const workStationName = ref('');
const rawLocationCode = ref('');
const fgLocationCode = ref('');
const positionInfo = ref('请选择生产线');
const fromLocationCode = ref('');
const fromLocationInfo = ref({});
const fromWarehouseCode = ref('');
const toWarehouseCode = ref('');
const dataContent = ref({ subList: [] });
const managementType = ref('');
const managementList = ref([]);
const itemCode = ref('')
const refFifoQuery = ref(null);
const comMessage = ref(null);
const scanPopup = ref(null);
const scanFromLocationCode = ref(null);
const show = ref(false)
onLoad((option) => {
uni.setNavigationBarTitle({
title: option.title
});
clearData();
getBusinessTypeFun();
fifoSwitch.value = getSwitchInfoByCode("directIssueFifoSwitch");
getWorkShopLineStation().then((res) => {
if (res.data && res.data.length > 0) {
positionList.value = res.data;
} else {
showErrorMessage('未查找到位置信息');
}
}).catch((error) => {
showErrorMessage(error);
});
});
onNavigationBarButtonTap((e) => {
if (e.index === 0) {
goHome();
} else if (e.index === 1) {
refFifoQuery.value.showDrawer();
closeScanPopup();
}
});
onBackPress(() => {});
onPullDownRefresh(() => {});
onMounted(() => {});
const getBusinessTypeFun = () => {
getBusinessType(businessTypeCode.value, (res) => {
if (res.success) {
businessType.value = res.businessType;
fromInventoryStatuses.value = getDirectoryItemArray(res.fromInventoryStatuses);
fromLocationAreaTypeList.value = res.fromLocationAreaTypeList;
showFromLocationPopup();
} else {
showErrorMessage(res.message);
}
});
};
const getScanResult = (result, managementTypeParams) => {
managementType.value = managementTypeParams;
if (managementTypeParams === "BY_BATCH" || managementTypeParams === "BY_QUANTITY") {
setDataBatch(result);
} else {
setData(result);
}
};
const setData = async (result) => {
const balance = result.balance;
const label = result.label;
const pack = result.package;
const item = detailSource.value.find((res) => res.itemCode === balance.itemCode);
if (!item) {
const itemp = createItemInfo(balance, pack);
const newDetail = createDetailInfo(balance, pack);
itemp.subList.push(newDetail);
detailSource.value.push(itemp);
} else {
const detail = item.subList.find((r) => r.packingNumber === balance.packingNumber &&
r.batch === balance.batch &&
r.locationCode === balance.locationCode &&
r.inventoryStatus === balance.inventoryStatus);
if (!detail) {
const newDetail = createDetailInfo(balance, pack);
item.subList.push(newDetail);
} else {
if (detail.scaned) {
showErrorMessage(`箱码[${balance.packingNumber}]批次[${balance.batch}]重复扫描`);
}
}
}
calcHandleQty(detailSource.value);
};
const setDataBatch = (result) => {
const balance = result.balance;
const label = result.label;
const pack = result.package;
const item = detailSource.value.find((res) => res.itemCode === balance.itemCode);
if (!item) {
const itemp = createItemInfo(balance, pack);
const newDetail = createDetailInfoForLabel(balance, pack, label);
itemp.subList.push(newDetail);
detailSource.value.push(itemp);
} else {
const detail = item.subList.find((r) => r.batch === balance.batch &&
r.locationCode === balance.locationCode &&
r.inventoryStatus === balance.inventoryStatus);
if (!detail) {
const newDetail = createDetailInfoForLabel(balance, pack, label);
item.subList.push(newDetail);
} else {
detail.handleQty = calc.add(detail.handleQty, result.label.qty);
}
}
calcHandleQty(detailSource.value);
};
const showErrorMessage = (message) => {
comMessage.value.showErrorMessage(message, (res) => {
if (res) {
scanPopupGetFocus();
}
});
};
const showSelect = () => {
show.value = true;
};
const confirmSelect = (e) => {
positionInfo.value = e[0].label + "-" + e[1].label + "-" + e[2].label;
console.log("位置", positionInfo.value);
workshopCode.value = e[0].value;
productionLineCode.value = e[1].value;
workStationCode.value = e[2].value;
workShopName.value = e[0].label;
productionLineName.value = e[1].label;
workStationName.value = e[2].label;
const shop = positionList.value.find((shop) => shop.value === workshopCode.value);
if (shop && shop.children) {
const prodLine = shop.children.find((line) => line.value === productionLineCode.value);
if (prodLine && prodLine.children) {
const station = prodLine.children.find((r) => r.value === workStationCode.value);
if (!station.rawLocationCode) {
showErrorMessage(`${workStationName.value}的原材料库位为空,请重新选择`);
return;
} else {
rawLocationCode.value = station.rawLocationCode;
fgLocationCode.value = station.fgLocationCode;
}
} else {
showErrorMessage("生产线-工位基础信息维护错误");
}
} else {
showErrorMessage("车间-生产线基础信息维护错误");
}
let toLocationCode = '';
positionList.value.forEach((item) => {
if (workshopCode.value === item.value) {
item.children.find((child) => {
if (productionLineCode.value === child.value) {
toLocationCode = child.children.find((subChild) => workStationCode.value === subChild.value).rawLocationCode;
}
});
}
});
detailSource.value.forEach((item) => {
item.subList.forEach((detail) => {
detail.toLocationCode = toLocationCode;
detail.productionLineCode = productionLineCode.value;
detail.workStationCode = workStationCode.value;
});
});
};
const removeItem = (index) => {
detailSource.value.splice(index, 1);
};
const removePack = () => {
for (let i = 0; i < detailSource.value.length; i++) {
const item = detailSource.value[i];
if (item.subList.length === 0) {
detailSource.value.splice(i, 1);
}
}
updateData();
};
const openScanPopup = () => {
if (businessType.value) {
if (fromLocationCode.value === '') {
showFromLocationPopup();
return;
}
scanPopup.value.openScanPopupForType(fromLocationCode.value, businessType.value);
} else {
getBusinessTypeFun();
}
};
const showFromLocationPopup = () => {
nextTick(() => {
scanFromLocationCode.value.openScanPopup();
});
};
const closeScanPopup = () => {
if (scanFromLocationCode.value) {
scanFromLocationCode.value.closeScanPopup();
}
};
const scanPopupGetFocus = () => {
if (scanPopup.value) {
scanPopup.value.getfocus();
}
};
const commit = () => {
if (positionInfo.value === '请选择生产线' || !positionInfo.value) {
showErrorMessage("请选择生产线");
return;
}
uni.showLoading({
title: "提交中....",
mask: true
});
const precisionStrategyParams = getPrecisionStrategyParams(detailSource.value);
getPrecisionStrategyList(precisionStrategyParams, (res) => {
if (res.success) {
managementList.value = res.list;
const params = setRecordParams();
console.log("提交参数", JSON.stringify(params));
const isHaveItem = params.subList.find((item) => item.handleQty > item.balanceQty);
if (isHaveItem) {
showErrorMessage(`物料号${isHaveItem.itemCode}`);
comMessage.value.showConfirmWarningModal(`物料号${isHaveItem.itemCode}数量[${isHaveItem.handleQty}]不允许大于库存数量[${isHaveItem.balanceQty}]`);
uni.hideLoading();
return;
}
issueRecordSubmit(params).then((res) => {
uni.hideLoading();
if (res.data) {
showCommitSuccessMessage(`提交成功\n生成直接发料记录\n${res.data}`);
} else {
showErrorMessage(`提交失败[${res.msg}]`);
}
}).catch((error) => {
uni.hideLoading();
showErrorMessage(error);
});
} else {
uni.hideLoading();
showErrorMessage(res.message);
}
});
};
const setRecordParams = () => {
const subList = [];
const creator = store.state.user.id;
detailSource.value.forEach((item) => {
item.subList.forEach((detail) => {
if (detail.scaned) {
const info = getPackingNumberAndBatchByList(managementList.value, detail.itemCode, detail.packingNumber, detail.toLocationCode, detail.batch);
const submitItem = deepCopyData(detail);
submitItem.toPackingNumber = info.packingNumber;
submitItem.toBatch = info.batch;
submitItem.toContainerNumber = detail.containerNumber;
submitItem.fromPackingNumber = info.packingNumber;
submitItem.fromBatch = info.batch;
submitItem.fromContainerNumber = detail.containerNumber;
submitItem.fromLocationCode = detail.locationCode;
submitItem.toLocationCode = detail.toLocationCode;
submitItem.qty = detail.handleQty;
submitItem.package = '';
submitItem.balanceQty = detail.balanceQty;
submitItem.recordList = [{
toInventoryStatus: detail.inventoryStatus,
fromParentPackingNumber: detail.parentNumber,
fromPackingNumber: info.packingNumber,
fromBatch: info.batch,
toPackingNumber: info.packingNumber,
toBatch: info.batch,
fromLocationCode: detail.locationCode,
toLocationCode: detail.toLocationCode,
handleQty: detail.handleQty,
fromPackUnit: detail.packUnit,
toPackUnit: detail.packUnit,
fromPackQty: detail.packQty,
toPackQty: detail.packQty
}];
subList.push(submitItem);
}
});
});
if (subList.length > 0) {
dataContent.value.toWarehouseCode = subList[0].toWarehouseCode;
}
dataContent.value.subList = subList;
dataContent.value.creator = creator;
dataContent.value.fromWarehouseCode = fromWarehouseCode.value;
return dataContent.value;
};
const showMessage = (message) => {
comMessage.value.showMessage(message, (res) => {});
};
const showScanMessage = (message) => {
comMessage.value.showScanMessage(message);
};
const afterCloseMessage = () => {
scanPopupGetFocus();
};
const closeScanMessage = () => {
scanPopupGetFocus();
};
const getLocation = (location, code) => {
getFromLocationCode(location, code);
};
const getFromLocationCode = (location, code) => {
fromLocationInfo.value = location;
fromLocationCode.value = code;
openScanPopup();
};
const showCommitSuccessMessage = (hint) => {
comMessage.value.showSuccessMessage(hint, (res) => {
clearData();
});
};
const updateData = () => {
calcHandleQty(detailSource.value);
for (let i = 0; i < detailSource.value.length; i++) {
const item = detailSource.value[i];
if (item.qty === 0) {
detailSource.value.splice(i, 1);
}
}
};
const getFromLocation = (location) => {
fromLocationCode.value = location.code;
fromLocationInfo.value = location;
openScanPopup();
};
const clearData = () => {
fromLocationInfo.value = {};
fromLocationCode.value = '';
fromWarehouseCode.value = '';
toWarehouseCode.value = '';
detailSource.value = [];
positionInfo.value = "请选择生产线";
itemCode.value = '';
};
</script>
<style scoped lang="scss">
</style>

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

@ -21,7 +21,7 @@ import productReceiptJob from '@/pages/productReceipt/job/productReceiptJob.vue'
const productreceiptjobRef = ref()
const title = ref('')
onShow(() => {
nextTick(() => {
setTimeout(()=>{
if (productreceiptjobRef.value) {
productreceiptjobRef.value.timerRefresh()
}

447
src/pages/productReceipt/record/productReceiptRecordByBatch.vue

@ -0,0 +1,447 @@
<template>
<view class="page-wraper">
<view class="">
<com-blank-view @goScan='openScanPopup' v-if="detailSource.length==0"></com-blank-view>
</view>
<view class="page-wraper" v-if="detailSource.length>0">
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<com-product-record :dataContent="item" :index="index" @removeItem="removeItem(index,item)"
@updateData="updateData" @removePack="removePack">
</com-product-record>
</view>
<view class='split_line'></view>
</view>
</scroll-view>
</view>
<view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
<view class="">
<view class="uni-flex uni-row u-col-center">
<text style="font-size: 32rpx;">位置 :</text>
<view class="uni-flex u-col-center uni-row" @click="showSelect">
<view class="" style="margin-left: 20rpx;">
{{ positionInfo }}
</view>
<u-select v-model="show" mode="mutil-column-auto" :list="positionList"
@confirm="confirmSelect"></u-select>
</view>
</view>
</view>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
</view>
</view>
</view>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
</view>
<win-scan-pack ref="scanPopup" @getResult='getScanResult' title="制品标签" headerType="HMQ"></win-scan-pack>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script setup>
import {
productionReceiptRecordSubmit,
getWorkShopLineStation
} from '@/api/request2.js';
import {
getPrecisionStrategyList
} from '@/common/balance.js';
import {
goHome,
getPackingNumberAndBatchByList,
deepCopyData
} from '@/common/basic.js';
import {
calc
} from '@/common/calc.js';
import {Decimal} from 'decimal.js';//
import {
getInventoryStatusDesc,
getDirectoryItemArray
} from '@/common/directory.js';
import {
getBusinessType,
} from '@/common/record.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import comProductRecord from '@/pages/productReceipt/coms/comProductRecord.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import {ref, onMounted} from 'vue';
import {useCountStore} from '@/store';
import {onLoad,onNavigationBarButtonTap,onBackPress,onPullDownRefresh} from '@dcloudio/uni-app'
const store = useCountStore();
//
const detailSource = ref([]);
const toLocationCode = ref("");
const fromLocationTypeList = ref([]);
const fromLocationCode = ref("");
const businessType = ref({});
const dataContent = ref({});
const managementList = ref([]);
const show = ref(false);
const positionInfo = ref("请选择位置");
const positionList = ref([]);
const productionLineCode = ref('');
const rawLocationCode = ref("");
const fgLocationCode = ref("");
const workshopCode = ref("");
const workStationCode = ref("");
const workShopName = ref("");
const productionLineName = ref("");
const workStationName = ref("");
const scanPopup = ref(null);
const comMessage = ref(null);
onLoad((option) => {
uni.setNavigationBarTitle({
title: option.title
});
const typeCode = "ProductReceipt";
getBusinessType(typeCode, (res) => {
if (res.success) {
businessType.value = res.businessType;
openScanPopup();
} else {
showErrorMessage(res.message);
}
});
getWorkShopLineStation().then((res) => {
positionList.value = res.data;
}).catch((error) => {
});
});
onNavigationBarButtonTap((e) => {
if (e.index === 0) {
goHome();
}
})
onBackPress((e) => {
})
onPullDownRefresh((e) => {
})
const getScanResult = (result) => {
const label = result.label;
const pack = result.package;
if (!result.label.itemCode) {
showErrorMessage('扫描标签不对,请重新扫描');
emit('clearItemCode', result.label);
return;
}
const item = detailSource.value.find((res) => res.itemCode === label.itemCode);
if (item === undefined) {
const itemp = createItemInfo(label, pack);
const newDetail = createDetailInfo(label, pack);
itemp.subList.push(newDetail);
detailSource.value.push(itemp);
} else {
const detail = item.subList.find((r) => r.packingNumber === label.packingNumber && r.batch === label.batch);
if (detail === undefined) {
const newDetail = createDetailInfo(label, pack);
item.subList.push(newDetail);
} else {
if (detail.scaned) {
showErrorMessage(`箱码[${label.packingNumber}]批次[${label.batch}]重复扫描`);
}
}
}
calcHandleQty();
};
const createItemInfo = (label, pack) => {
return {
itemCode: label.itemCode,
itemName: pack.itemName,
packQty: pack.packQty,
packUnit: pack.packUnit,
qty: new Decimal(label.qty).toNumber(),
handleQty: new Decimal(0).toNumber(),
uom: pack.uom,
subList: []
};
};
const createDetailInfo = (label, pack) => {
const detail = deepCopyData(label);
detail.scaned = true;
detail.qty = new Decimal(label.qty).toNumber();
detail.handleQty = new Decimal(label.qty).toNumber();
detail.inventoryStatus = "OK";
detail.packQty = pack.packQty;
detail.packUnit = pack.packUnit;
detail.package = pack;
detail.label = label;
return detail;
};
const calcHandleQty = () => {
detailSource.value.forEach((item) => {
item.handleQty = new Decimal(0).toNumber();
item.subList.forEach((detail) => {
if (detail !== undefined) {
item.handleQty = calc.add(item.handleQty, detail.handleQty);
}
});
});
scanPopupGetFocus();
};
const openScanPopup = () => {
scanPopup.value.openScanPopup();
};
const commit = () => {
if (positionInfo.value === "请选择位置") {
showMessage("请先选择位置");
return;
}
if (detailSource.value.length > 0 && detailSource.value[0].subList.length > 0) {
uni.showLoading({
title: "提交中....",
mask: true
});
managementList.value = [];
const precisionStrategParams = setPrecisionStrategParams();
getPrecisionStrategyList(precisionStrategParams, (res) => {
if (res.success) {
managementList.value = res.list;
const params = setParams();
console.log("提交" + JSON.stringify(params));
productionReceiptRecordSubmit(params).then((res) => {
uni.hideLoading();
if (res.data) {
showCommitSuccessMessage(`提交成功\n生成制品收货记录\n${res.data}`);
} else {
showErrorMessage(`提交失败[${res.msg}]`);
}
}).catch((error) => {
uni.hideLoading();
showErrorMessage(error);
});
} else {
uni.hideLoading();
showErrorMessage(res.message);
}
});
} else {
showErrorMessage("没有要提交的数据,请先扫描");
}
};
const setPrecisionStrategParams = () => {
const itemList = [];
detailSource.value.forEach((item) => {
item.subList.forEach((detail) => {
if (detail.scaned) {
detail.toLocationCode = fgLocationCode.value;
const filterResult = itemList.filter((res) => res.itemCode === item.itemCode && detail.toLocationCode === res.locationCode);
if (filterResult.length === 0) {
itemList.push({itemCode: item.itemCode, locationCode: detail.toLocationCode});
}
}
});
});
return itemList;
};
const setParams = () => {
const subList = [];
const creator = store.state.user.id;
detailSource.value.forEach((item) => {
item.subList.forEach((detail) => {
if (detail.scaned) {
const submitItem = deepCopyData(detail);
const info = getPackingNumberAndBatchByList(managementList.value, detail.itemCode, detail.packingNumber, detail.toLocationCode, detail.batch);
submitItem.itemCode = detail.itemCode;
submitItem.itemName = detail.package.itemName;
submitItem.itemDesc1 = detail.package.itemDesc1;
submitItem.itemDesc2 = detail.package.itemDesc2;
submitItem.inventoryStatus = detail.inventoryStatus;
submitItem.fromPackingNumber = info.packingNumber;
submitItem.toPackingNumber = info.packingNumber;
submitItem.fromContainerNumber = detail.containerNumber;
submitItem.toContainerNumber = detail.containerNumber;
submitItem.fromBatch = info.batch;
submitItem.toBatch = info.batch;
submitItem.fromLocationCode = detail.locationCode;
submitItem.toLocationCode = detail.toLocationCode;
submitItem.productionlineCode = productionLineCode.value;
submitItem.workStationCode = workStationCode.value;
submitItem.qty = detail.handleQty;
submitItem.package = "";
subList.push(submitItem);
}
});
});
dataContent.value.subList = subList;
dataContent.value.creator = creator;
dataContent.value.type = "predict";
dataContent.value.workshopCode = workshopCode.value;
return dataContent.value;
};
const showMessage = (message) => {
setTimeout(() => {
scanPopupLoseFocus();
comMessage.value.showMessage(message, (res) => {
if (res) {
scanPopupGetFocus();
}
});
});
};
const showErrorMessage = (message) => {
setTimeout(() => {
scanPopupLoseFocus();
comMessage.value.showErrorMessage(message, (res) => {
if (res) {
scanPopupGetFocus();
}
});
});
};
const closeScanPopup = () => {
scanPopup.value.closeScanPopup();
};
const scanPopupGetFocus = () => {
if (scanPopup.value !== undefined) {
scanPopup.value.getfocus();
}
};
const scanPopupLoseFocus = () => {
if (scanPopup.value !== undefined) {
scanPopup.value.losefocus();
}
};
const afterCloseMessage = () => {
scanPopupGetFocus();
};
const closeScanMessage = () => {
scanPopupGetFocus();
};
const showCommitSuccessMessage = (hint) => {
comMessage.value.showSuccessMessage(hint, (res) => {
clearData();
});
};
const clearData = () => {
detailSource.value = [];
toLocationCode.value = '';
dataContent.value = {};
positionInfo.value = "请选择位置";
fgLocationCode.value = "";
};
const removePack = () => {
detailSource.value = detailSource.value.filter((item) => item.subList.length > 0);
updateData();
};
const removeItem = (index) => {
detailSource.value.splice(index, 1);
};
const updateData = () => {
calcHandleQty();
};
const showSelect = () => {
show.value = !show.value;
};
const confirmSelect = (e) => {
positionInfo.value = `${e[0].label}-${e[1].label}-${e[2].label}`;
workshopCode.value = e[0].value;
productionLineCode.value = e[1].value;
workStationCode.value = e[2].value;
workShopName.value = e[0].label;
productionLineName.value = e[1].label;
workStationName.value = e[2].label;
const shop = positionList.value.find((shop) => shop.value === workshopCode.value);
if (shop !== undefined && shop.children !== undefined) {
const prodLine = shop.children.find((line) => line.value === productionLineCode.value);
if (prodLine !== undefined && prodLine.children !== undefined) {
const station = prodLine.children.find((r) => r.value === workStationCode.value);
if (station.rawLocationCode === '' || station.rawLocationCode === null) {
showErrorMessage(`${workStationName.value}的原材料库位为空,请重新选择`);
return;
} else {
rawLocationCode.value = station.rawLocationCode;
fgLocationCode.value = station.fgLocationCode;
}
} else {
showErrorMessage("生产线-工位基础信息维护错误");
}
} else {
showErrorMessage("车间-生产线基础信息维护错误");
}
};
</script>
<style scoped lang="scss">
page {
width: 100%;
height: 100%;
}
.page-wraper {
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
}
.page-main {
flex: 1;
position: relative;
}
.page-main-scroll {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
}
.page-main-list {
/* height: 80rpx;
line-height: 80rpx; */
text-align: center;
background: #e0e0e0;
}
</style>

41
src/pages/purchaseReceipt/job/purchaseReceiptDevelop.vue

@ -0,0 +1,41 @@
<template>
<view class="">
<receipt-job :title="title" source_type="Develop" scanTitle="箱标签/ASN单号" :isShowAsn="false" :isShowJob="false"
ref="receiptjob" operation='receipt'></receipt-job>
</view>
</template>
<script setup lang="ts">
import ReceiptJob from '@/pages/purchaseReceipt/job/receiptJob.vue'
import {ref} from 'vue'
import {onShow, onLoad, onPullDownRefresh, onReachBottom, onNavigationBarButtonTap} from '@dcloudio/uni-app'
const title = ref('')
const receiptjob = ref(null)
onShow(() => {
if (receiptjob.value != undefined) {
receiptjob.value.refresh()
}
})
onLoad((option) => {
title.value = option.title
})
onPullDownRefresh(() => {
receiptjob.value.refresh()
})
onReachBottom(() => {
receiptjob.value.onReach()
})
onNavigationBarButtonTap((e) => {
if (e.index === 0) {
receiptjob.value.goHome1();
// receiptjob.value.refresh();
} else if (e.index == 1) {
receiptjob.value.openFilter();
}
})
</script>
<style scoped lang="scss">
</style>

42
src/pages/purchaseReceipt/job/purchaseReceiptTool.vue

@ -0,0 +1,42 @@
<template>
<view class="">
<receipt-job :title="title" source_type="TOOL" scanTitle="箱标签/ASN单号" :isShowAsn="false" :isShowJob="false"
ref="receiptjob" operation='receipt'></receipt-job>
</view>
</template>
<script lang="ts" setup>
import ReceiptJob from '@/pages/purchaseReceipt/job/receiptJob.vue'
import {ref} from 'vue'
import {onShow, onLoad, onPullDownRefresh, onReachBottom, onNavigationBarButtonTap} from '@dcloudio/uni-app'
const title = ref('')
const receiptjob = ref(null)
onShow(() => {
if (receiptjob.value != undefined) {
receiptjob.value.refresh()
}
})
onLoad((option) => {
title.value = option.title
})
onPullDownRefresh(() => {
receiptjob.value.refresh()
})
onReachBottom(() => {
receiptjob.value.onReach()
})
onNavigationBarButtonTap((e) => {
if (e.index === 0) {
receiptjob.value.goHome1();
// receiptjob.value.refresh();
} else if (e.index == 1) {
receiptjob.value.openFilter();
}
})
</script>
<style scoped lang="scss">
</style>

7
src/pages/putaway/job/putawayJob.vue

@ -11,7 +11,7 @@
<putaway-job-list-popup ref="jobListPopup" @selectedItem="selectedItem"></putaway-job-list-popup>
<u-loadmore :status="loadingType" v-if="jobList.length > 0" />
</view>
<win-scan-button @goScan="openScanPopup" v-if="jobList.length > 0"></win-scan-button>
<win-scan-button @goScan="openScanPopup" v-if="manageModel!='BY_BATCH'&&jobList.length>0"></win-scan-button>
<winScanPackJob ref="scanPopup" @getResult="getScanResult"></winScanPackJob>
<jobListCom ref="jobListRef" @selectItem="selectItem"></jobListCom>
<com-message ref="comMessageRef" />
@ -57,6 +57,7 @@ const scanPopup = ref()
const jobListRef = ref()
const jobInfoPopup = ref()
const checkedWaitTask = ref(null)
const manageModel = import.meta.env.VITE_MANAGE_MODEL
onShow(() => {
setTimeout(()=>{
getList('refresh')
@ -138,7 +139,9 @@ const getList = (type) => {
uni.hideLoading()
if (type === 'refresh') {
uni.stopPullDownRefresh()
openScanPopup()
if(manageModel.value!='BY_BATCH'){
openScanPopup()
}
}
const { list } = res.data

1
src/pages/putaway/record/putawayRecord.vue

@ -501,7 +501,6 @@ const clear = () => {
page {
width: 100%;
height: 100%;
background-color: #fff;
}
.page-wraper {

2
src/pages/scrap/record/scrapRecord.vue

@ -78,6 +78,7 @@ const scanPopup = ref()
const scanLocationCode = ref()
const managementList = ref([])
const show = ref(false)
const reasonCode = ref('')
onLoad((option) => {
uni.setNavigationBarTitle({
title: option.title
@ -284,7 +285,6 @@ const updateData = () => {
page {
width: 100%;
height: 100%;
background-color: #fff;
}
.page-wraper {

346
src/pages/unPlanned/record/receiptRecordByBatch.vue

@ -0,0 +1,346 @@
<template>
<view class="page-wraper">
<view class="">
<com-blank-view @goScan='openScanPopup' v-if="detailSource.length==0"></com-blank-view>
</view>
<view class="page-wraper" v-if="detailSource.length>0">
<view class='split_line'></view>
<view class="page-main">
<uni-data-picker v-if="detailSource.length>0" style="padding: 20rpx; background-color:#fff;"
class='uni-data-picker' placeholder="请选择入库原因" popup-title="入库原因" :localdata="reasonList"
@change="reasonChange">
</uni-data-picker>
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<com-receipt-record
:dataContent="item" @removeItem="removeItem(index,item)"
@updateData="updateData"
:queryBalance="false"
:allowModifyQty="true"
:isShowLocation="false" @removePack="removePack">
</com-receipt-record>
</view>
<view class='split_line'></view>
</view>
</scroll-view>
</view>
<view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
<view class="">
<requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode'
:locationAreaTypeList="toLocationAreaTypeList"></requiredLocation>
</view>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
</view>
</view>
</view>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
</view>
<win-scan-pack ref="scanPopupRef" @getResult='getScanResult' :title="'箱码'" headerType="HPQ,HMQ"></win-scan-pack>
<comMessage ref="comMessageRef"></comMessage>
</view>
</template>
<script setup>
import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import comReceiptRecord from '@/pages/unPlanned/coms/comReceiptRecord.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import winScanPack from "@/mycomponents/scan/winScanPack.vue"
import {
unPlannedReceiptRecordbSubmit
} from '@/api/request2.js';
import {
getDirectoryItemArray,
getUnPlannedReceiptReasonList
} from '@/common/directory.js';
import {
getBusinessType,
} from '@/common/record.js';
import {
calc
} from '@/common/calc.js';
import {
Decimal
} from 'decimal.js'; //
import {
goHome,
deepCopyData,
getPackingNumberAndBatchByList
} from '@/common/basic.js';
import {
getPrecisionStrategyList
} from '@/common/balance.js';
import { ref, onMounted } from 'vue';
const toLocationCode = ref("");
const toInventoryStatus = ref([]);
const businessType = ref({});
const detailSource = ref([]);
const businessTypeCode = ref("UnplannedReceipt");
const reasonText = ref("");
const reasonCode = ref("");
const reasonList = ref([]);
const dataContent = ref({});
const managementList = ref([]);
const toLocationAreaTypeList = ref([]);
const scanPopupRef = ref(null);
const comMessageRef = ref(null);
onMounted(() => {
reasonList.value = getUnPlannedReceiptReasonList();
getBusinessType(businessTypeCode.value, res => {
if (res.success) {
businessType.value = res.businessType;
toLocationAreaTypeList.value = res.toLocationAreaTypeList;
openScanPopup();
} else {
showErrorMessage(res.message);
}
});
});
const openScanPopup = () => {
scanPopupRef.value.openScanPopup();
};
const getToLocationCode = (location, code) => {
toLocationCode.value = code;
};
const getScanResult = (result) => {
setDataBatch(result);
};
const setDataBatch = (result) => {
const label = result.label;
const pack = result.package;
const item = detailSource.value.find(res => res.itemCode === label.itemCode);
if (item === undefined) {
const itemp = createItemInfo(label, pack);
const newDetail = createDetailInfo(label, pack);
itemp.subList.push(newDetail);
detailSource.value.push(itemp);
getfocus();
} else {
const detail = item.subList.find(r => r.packingNumber === pack.number && r.batch === pack.batch);
if (detail === undefined) {
const newDetail = createDetailInfo(label, pack);
item.subList.push(newDetail);
getfocus();
} else {
detail.handleQty = calc.add(detail.handleQty, result.label.qty);
}
}
calcHandleQty();
};
const getfocus = () => {
if (scanPopupRef.value) {
scanPopupRef.value.getfocus();
}
};
const createItemInfo = (label, pack) => {
return {
itemCode: pack.itemCode,
itemName: pack.itemName,
packQty: pack.packQty,
packUnit: pack.packUnit,
qty: new Decimal(label.qty).toNumber(),
handleQty: new Decimal(0).toNumber(),
uom: label.uom,
subList: []
};
};
const createDetailInfo = (label, pack) => {
const detail = deepCopyData(label);
detail.scaned = true;
detail.qty = new Decimal(label.qty).toNumber();
detail.handleQty = new Decimal(label.qty).toNumber();
detail.inventoryStatus = "OK";
detail.packQty = pack.packQty;
detail.packUnit = pack.packUnit;
label.inventoryStatus = "OK";
detail.package = pack;
detail.label = label;
detail.label.scaned = true;
return detail;
};
const calcHandleQty = () => {
detailSource.value.forEach(item => {
item.handleQty = new Decimal(0).toNumber();
item.qty = new Decimal(0).toNumber();
item.subList.forEach(detail => {
if (detail !== undefined) {
item.handleQty = calc.add(item.handleQty, detail.handleQty);
item.qty = calc.add(item.qty, detail.qty);
}
});
});
};
const showErrorMessage = (message) => {
comMessageRef.value.showErrorMessage(message, res => {
if (res) {
getfocus();
}
});
};
const updateData = () => {
calcHandleQty();
};
const removePack = () => {
detailSource.value = detailSource.value.filter(item => item.subList.length > 0);
updateData();
};
const removeItem = (index) => {
detailSource.value.splice(index, 1);
};
const commit = () => {
if (toLocationCode.value === "") {
showErrorMessage("请先选择目标库位");
return;
}
if (reasonText.value === '') {
showErrorMessage("请选择入库原因");
return;
}
if (detailSource.value.length > 0 && detailSource.value[0].subList.length > 0) {
uni.showLoading({ title: "提交中....", mask: true });
managementList.value = [];
const precisionStrategParams = setPrecisionStrategParams();
getPrecisionStrategyList(precisionStrategParams, res => {
if (res.success) {
managementList.value = res.list;
const params = setParams();
console.log("提交" + JSON.stringify(params));
unPlannedReceiptRecordbSubmit(params).then(res => {
uni.hideLoading();
if (res.data) {
showCommitSuccessMessage("提交成功\n生成计划外入库记录\n" + res.data);
} else {
showErrorMessage("提交失败[" + res.msg + "]");
}
}).catch(error => {
uni.hideLoading();
showErrorMessage(error);
});
} else {
uni.hideLoading();
showErrorMessage(res.message);
}
});
} else {
showErrorMessage("没有要提交的数据,请先扫描");
}
};
const setPrecisionStrategParams = () => {
const itemList = [];
detailSource.value.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
detail.toLocationCode = toLocationCode.value;
const filterResult = itemList.filter(res => res.itemCode === item.itemCode && detail.toLocationCode === res.locationCode);
if (filterResult.length === 0) {
itemList.push({ itemCode: item.itemCode, locationCode: detail.toLocationCode });
}
}
});
});
return itemList;
};
const setParams = () => {
const subList = [];
const creator = store.state.user.id;
detailSource.value.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
const submitItem = deepCopyData(detail);
const info = getPackingNumberAndBatchByList(managementList.value, detail.label.itemCode, detail.label.packingNumber, detail.toLocationCode, detail.label.batch);
submitItem.itemCode = detail.package.itemCode;
submitItem.itemName = detail.package.itemName;
submitItem.itemDesc1 = detail.package.itemDesc1;
submitItem.itemDesc2 = detail.package.itemDesc2;
submitItem.inventoryStatus = detail.inventoryStatus;
submitItem.fromPackingNumber = info.packingNumber;
submitItem.toPackingNumber = info.packingNumber;
submitItem.fromBatch = info.batch;
submitItem.toBatch = info.batch;
submitItem.fromLocationCode = "";
submitItem.toLocationCode = detail.toLocationCode;
submitItem.reason = reasonCode.value;
submitItem.qty = detail.handleQty;
submitItem.package = "";
subList.push(submitItem);
}
});
});
dataContent.value.subList = subList;
dataContent.value.creator = creator;
return dataContent.value;
};
const reasonChange = (e) => {
if (e.detail.value.length === 0) {
reasonCode.value = "";
reasonText.value = "";
} else {
reasonCode.value = e.detail.value[0].value;
reasonText.value = e.detail.value[0].text;
}
};
const showCommitSuccessMessage = (hint) => {
comMessageRef.value.showSuccessMessage(hint, res => {
clearData();
});
};
const clearData = () => {
reasonCode.value = "";
reasonText.value = "";
detailSource.value = [];
managementList.value = [];
dataContent.value = {};
toLocationCode.value = "";
};
</script>
<style scoped lang="scss">
.page-main {
flex: 1;
position: relative;
}
.page-main-scroll {
position: relative;
margin-top: 2px;
}
</style>
Loading…
Cancel
Save