Browse Source

解决403

myd
qb 1 year ago
parent
commit
831b9a1063
  1. 12
      api/user.js
  2. 37
      pagesHome/pages/loadingRetention/loadingRetention.vue
  3. 48
      pagesTask/pages/checkTaskList/checkTaskList.vue
  4. 290
      pagesTask/pages/dynamicCheckDetails/dynamicCheckDetails.vue

12
api/user.js

@ -1737,6 +1737,18 @@ export function pgetContractList(data) {
});
}
/**
* 获取商城
* @param {Object} data
*/
export function pgetgetMaterialName(data) {
return request({
url: `logpm-warehouse/api/WarehouseTask/getMaterialName`,
method: "get",
data
});
}
/**
* 合同盘点页面初始化
* @param {Object} data

37
pagesHome/pages/loadingRetention/loadingRetention.vue

@ -73,15 +73,14 @@
</view>
<view>
<u-icon name="grid" top='5'></u-icon> <text
class="title">订单自编号</text><text>{{item.orderCode}}</text>
<u-icon name="grid" top='5'></u-icon> <text class="title"></text><text>{{item.orderCode}}</text>
</view>
<view>
<u-icon name="tags" top='5'></u-icon> <text
class="title">预约单号</text><text>{{item.reservationCode}}</text>
</view>
<u-button v-if='item.parameter' @click="RemoveData(item,index)" class="uni-Btn" type="primary"
icon="close" text="移除"></u-button>
<u-button v-if='item.parameter' @click="RemoveData(item,index)" class="uni-Btn" type="primary" icon="close"
text="移除"></u-button>
</view>
<view v-if='!DataList1.length'>
@ -105,15 +104,14 @@
</view>
<view>
<u-icon name="grid" top='5'></u-icon> <text
class="title">订单自编号</text><text>{{item.orderCode}}</text>
<u-icon name="grid" top='5'></u-icon> <text class="title"></text><text>{{item.orderCode}}</text>
</view>
<view>
<u-icon name="tags" top='5'></u-icon> <text
class="title">预约单号</text><text>{{item.reservationCode}}</text>
</view>
<u-button v-if='item.parameter' @click="RemoveData(item,index)" class="uni-Btn" type="primary"
icon="close" text="移除"></u-button>
<u-button v-if='item.parameter' @click="RemoveData(item,index)" class="uni-Btn" type="primary" icon="close"
text="移除"></u-button>
</view>
<view v-if='!DataList2.length'>
@ -134,16 +132,14 @@
<view class="InfoMax" v-for="(item ,index) in DataList3" :key='index'>
<view class="InfoList InfoListTP">
<view>
<u-icon name="car" top='5'></u-icon> <text
class="title">托盘码</text><text>{{item[0].trayCode}}</text>
<u-icon name="car" top='5'></u-icon> <text class="title"></text><text>{{item[0].trayCode}}</text>
</view>
<view>
<u-icon name="scan" top='5'></u-icon> <text
class="title">托盘名称</text><text>{{item[0].trayName?item[0].trayName:'暂无名称'}}</text>
</view>
<view>
<u-icon name="scan" top='5'></u-icon> <text
class="title">托盘数量</text><text>{{item.length}}</text>
<u-icon name="scan" top='5'></u-icon> <text class="title"></text><text>{{item.length}}</text>
</view>
<u-button v-if='item[0].parameter' @click="RemoveData(item,index)" class="uni-Btn" type="primary"
icon="close" text="移除"></u-button>
@ -362,7 +358,7 @@
// }
})
})
} else {
//
@ -389,8 +385,8 @@
item.warehosueId = res.data.data.warehosueId;
item.warehosueName = res.data.data.warehosueName;
})
//
const groupedData = res.data.data.goodsList.reduce((acc, obj) => {
const key = obj.trayCode;
@ -400,9 +396,9 @@
acc[key].push(obj);
return acc;
}, {});
DataList3.value.unshift(...Object.values(groupedData))
console.log(DataList3.value, '处理好的托盘');
}
})
@ -414,10 +410,15 @@
const tpArray = DataList3.value.reduce((acc, array) => acc.concat(array), []); //
const mergedArray = [...DataList1.value, ...DataList2.value, ...tpArray];
console.log(mergedArray, '提交处理好的数据');
let loadingId = uni.getStorageSync('checkvehicle').id
// StatusUpdate===
if (StatusUpdate.value) {
$_saveRetentionList({
deliveryId: details.items.id,
trainNumber: details.items.trainNumber,
loadingId: loadingId,
assembleCarPersonId: details.items.driverId,// ID
assembleCarPersonName: details.items.driverName,//
warehouseRetentionScanDTOS: mergedArray
}).then(res => {
console.log(res, '保存成功之后的返回值');
@ -442,7 +443,7 @@
console.log(DataList3.value, '移除之后的参数');
};
//
function RemoveData(val, indexs,index) {
function RemoveData(val, indexs, index) {
// if (OrType.value == 1) {
// removeItem(DataList1.value, indexs)
// }

48
pagesTask/pages/checkTaskList/checkTaskList.vue

@ -70,7 +70,7 @@
</view>
<input @input="handleInputChange" type="text" v-model="details.scancode"
:placeholder="selectedValue.placeholder" class="main_top_search htselect" />
<view class="button" @click="ContractSearch">搜索</view>
<view class="button" @click="scandata">搜索</view>
</view>
<!-- 表格 -->
@ -155,7 +155,8 @@
getWarehouseTrayList,
getWarehouseTaskAllocationDetailByStrip,
postqueryContractList,
pgetContractList
pgetContractList,
getWarehouseTaskgetTaskConInfo
} from '@/api/user.js';
import utils from '@/utils/utils.js';
import useSystemSettingsStore from '@/store/useSystemSettingsStore';
@ -392,16 +393,27 @@
//
if (details.pageType === 2) {
getWarehouseTaskAllocationDetailByStrip({
getWarehouseTaskAllocationList({
questId: details.id,
allocationId: details.scancode,
questNum: details.questNum
}).then(res => {
console.log(res);
if (res.code != 403) {
console.log('跳转')
const { code, data } = res
console.log('res :>> ', res);
if (code === 200 && data) {
const info = {
allocationId: data[0].allocationId,
questId: details.id,
positionCode: data[0].positionCode,
type: data[0].goodsType,
marketName: details.marketName,
questNum: details.questNum,
pageType: details.pageType,
title: details.title
}
console.log('info :>> ', info);
uni.navigateTo({
url: `/pagesTask/pages/storageLocationCheckDetails/storageLocationCheckDetails?allocationId=${details.scancode}&questId=${details.id}&marketName=${JSON.stringify(details.marketName)}&questNum=${details.questNum}`
url: `/pagesTask/pages/dynamicCheckDetails/dynamicCheckDetails?info=${JSON.stringify(info)}`
})
}
})
@ -409,8 +421,8 @@
}
if (details.pageType == 3) {
postqueryContractList({
taskId: details.id,
pgetContractList({
questId: details.id,
goodsType: selectedValue.value.value,
warehouseId: details.warehouseId,
type: '1',
@ -419,9 +431,23 @@
}).then(res => {
console.log(res, 'res===');
utils.ttsspke(res.audio)
if (res.code != 3001) {
details.renderList = res.data
if (res.code !== 200) return
details.renderList = res.data.records
const data = res.data.records
const info = {
orderCode: data[0].orderCode,
questId: details.id,
orderId: data[0].orderId,
type: data[0].goodsType,
marketName: details.marketName,
questNum: details.questNum,
pageType: details.pageType,
title: details.title
}
console.log('info :>> ', info);
uni.navigateTo({
url: `/pagesTask/pages/dynamicCheckDetails/dynamicCheckDetails?info=${JSON.stringify(info)}`
})
})
return
}

290
pagesTask/pages/dynamicCheckDetails/dynamicCheckDetails.vue

@ -61,13 +61,13 @@
</template>
<!-- 按库位盘点 -->
<template v-else-if="details.pageType === 2">
<text>订单:</text>
<text>{{details.scanNum + '/' + details.totalNum}}</text>
<text>库位:</text>
<text>{{details.pageInfos.positionCode}}</text>
</template>
<!-- 按合同号盘点 -->
<template v-else-if="details.pageType === 3">
<text>合同号:</text>
<text>{{details.scanNum + '/' + details.totalNum}}</text>
<text>{{details.pageInfos.orderCode}}</text>
</template>
<!-- 按托盘盘点 -->
<template v-else-if="details.pageType === 4">
@ -143,7 +143,7 @@
<view class="main_render_item">
<view>
库位: {{item.positionCode || '暂无数据'}}
库位: {{item.allocation || '暂无数据'}}
</view>
<template v-if="tabBarCode !== 1">
<view>
@ -231,8 +231,17 @@
<view class="popUp_row_title">{{item.title}}</view>
</view>
<!-- 输入框 -->
<input v-show="tabBarCode === 2" class="input" type="text" :disabled="item.disabled"
v-model="item.value" />
<template v-if="tabBarCode === 2 && item.code !== 10">
<input class="input" type="number" @blur="inputNum(item)" :disabled="item.disabled"
v-model="item.value" />
</template>
<!-- 在库数 -->
<template v-else-if="tabBarCode === 2 && item.code === 10">
<view class="input">
{{item.value - details.stateArr[2].value - details.stateArr[4].value - details.stateArr[5].value}}
</view>
</template>
</view>
</block>
</view>
@ -263,10 +272,51 @@
<!-- 弹出层 -- 新增库存品 -->
<PopUp ref="popUp_AddStock">
<input class="popUpInput" v-model="details.addInfo.orderCode" type="text" placeholder="请输入运单号" />
<input class="popUpInput" v-model="details.addInfo.orderCode" type="text" placeholder="请输入合同号" />
<input class="popUpInput" v-model="details.addInfo.orderCode" type="text" placeholder="请输入物料名称" />
<input class="popUpInput" v-model="details.addInfo.orderCode" type="text" placeholder="请输入数量" />
<view class="popUp_Add_row">
<view>合同号:</view>
<input class="popUpInput" v-model="details.addInfo.orderCode" type="text" placeholder="请输入合同号" />
</view>
<view class="popUp_Add_row">
<view>批次号:</view>
<input class="popUpInput" v-model="details.addInfo.incomingBatch" type="text" placeholder="请输入批次号" />
</view>
<view class="popUp_Add_row">
<view>物料名称:</view>
<input class="popUpInput" v-model="details.addInfo.materialName" @blur="handleShowMaterial" type="text"
placeholder="请输入物料编码或物料名称" />
<template v-if="details.showList.showMaterial">
<view class="select_content">
<view @click="()=>{
details.addInfo.materialName = val.materialName
details.addInfo.materialCode = val.materialCode
details.showList.showMaterial = false
}" v-for="val in details.materialNameList" :key="val">
{{val.materialName}}
</view>
</view>
</template>
</view>
<view class="popUp_Add_row">
<view>商城:</view>
<input class="popUpInput" v-model="details.addInfo.marketName" @blur="handleShowMarket" type="text"
placeholder="请选择商城" />
<template v-if="details.showList.showMarket">
<view :class="{'select_content': true, 'show': details.showMarket}">
<view v-for="val in details.marketNameList" :key="val" @click="()=>{
details.addInfo.marketName = val.clientName
details.addInfo.clientName = val.clientName
details.addInfo.marketId = val.id
details.showList.showMarket = false
}">
{{val.clientName}}
</view>
</view>
</template>
</view>
<view class="popUp_Add_row">
<view>在库数量:</view>
<input class="popUpInput" v-model="details.addInfo.quantity" type="number" placeholder="请输入在库数量" />
</view>
</PopUp>
<!-- 弹出层 -- 新增零担 -->
@ -307,7 +357,9 @@
getWarehouseTaskgetTaskConInfo,
postWarehouseTaskSelectPackageInfo,
postWarehouseTaskQuestDetailAllocation,
postWarehouseTaskAddDataInfo
postWarehouseTaskAddDataInfo,
postqueryfindMaterialList,
pgetgetMaterialName
} from '@/api/user.js';
import useSystemSettingsStore from '@/store/useSystemSettingsStore';
import { storeToRefs } from 'pinia';
@ -442,6 +494,15 @@
addInfo: {
/** 合同号 */
orderCode: ''
},
/** 商城名称数组 */
marketNameList: [],
/** 物料名称数组 */
materialNameList: [{ materialName: 1 }],
/** 是否显示下拉框 */
showList: {
showMarket: false,
showMaterial: false
}
})
@ -522,6 +583,9 @@
questId: details.pageInfos.questId,
questNum: details.pageInfos.questNum,
}
if (details.pageType === 2) queryData.code = details.pageInfos.allocationId
else if (details.pageType === 3) queryData.code = details.pageInfos.orderCode
else if (details.pageType === 4) queryData.code = details.pageInfos.trayCode
const res = await getWarehouseTaskgetTaskConInfo(queryData)
const { code, data } = res
if (code !== 200) return
@ -549,6 +613,9 @@
questId: details.pageInfos.questId,
questNum: details.pageInfos.questNum,
}
if (details.pageType === 2) queryData.code = details.pageInfos.allocationId
else if (details.pageType === 3) queryData.code = details.pageInfos.orderCode
else if (details.pageType === 4) queryData.code = details.pageInfos.trayCode
const res = await getWarehouseTaskgetTaskConInfo(queryData)
const { code, data } = res
if (code !== 200) return
@ -617,6 +684,18 @@
details.scanNum++
val.isNew = true
if (!val.cargoName) val.cargoName = 10
if (details.pageType === 2) {
val.allocationId = details.pageInfos.allocationId
val.allocation = details.pageInfos.positionCode
}
else if (details.pageType === 3) {
val.orderCode = details.pageInfos.orderCode
val.orderId = details.pageInfos.orderId
}
else if (details.pageType === 4) {
val.trayCode = details.pageInfos.trayCode
val.trayId = details.pageInfos.trayId
}
details.orderList.push(val)
})
// #ifdef APP
@ -633,7 +712,7 @@
orderPackageCode: details.scancode,
questStatus: 1,
orderCode: details.addInfo.orderCode,
positionCode: '',
allocation: '',
cargoName: 10,
isChoose: false,
/** 为手动添加 */
@ -641,7 +720,14 @@
/** 物料类型 */
questTarget: 1
}
if (details.pageType === 2) _order.allocationId = details.pageInfos.allocationId
if (details.pageType === 2) {
_order.allocationId = details.pageInfos.allocationId
_order.allocation = details.pageInfos.positionCode
}
else if (details.pageType === 3) {
_order.orderCode = details.pageInfos.orderCode
_order.orderId = details.pageInfos.orderId
}
else if (details.pageType === 4) {
_order.trayCode = details.pageInfos.trayCode
_order.trayId = details.pageInfos.trayId
@ -821,12 +907,13 @@
})
}
} else {
if (cargoName.questChildVOList) {
cargoName.questChildVOList.forEach((val, index) => {
details.stateArr[index].isCheck = val.questNum === 0 ? false : true
details.stateArr[index].value = val.questNum
})
} else {
if (
cargoName.stockNum
|| cargoName.wornNum
|| cargoName.lossNum
|| cargoName.noRepairNum
|| cargoName.deliveNum
|| cargoName.noReceivedNum) {
details.stateArr.forEach((val) => {
const _value = cargoName[val.name]
console.log('val.name :>> ', val.name);
@ -834,8 +921,13 @@
if (_value > 0 && _value) val.value = _value
else val.value = 0
})
}
} else {
cargoName.questChildVOList.forEach((val, index) => {
details.stateArr[index].isCheck = val.questNum === 0 ? false : true
details.stateArr[index].value = val.questNum
})
}
}
}
@ -901,6 +993,24 @@
})
}
/** 显示物料 */
const handleShowMaterial = async () => {
const res = await postqueryfindMaterialList({ materialCode: details.addInfo.materialName })
const { code } = res
if (code !== 200 || res.data.length === 0) return
details.materialNameList = res.data
details.showList.showMaterial = true
}
/** 显示商城 */
const handleShowMarket = async () => {
const res = await pgetgetMaterialName({ code: details.addInfo.marketName, size: 500 })
const { code } = res
if (code !== 200 || res.data.records.length === 0) return
details.marketNameList = res.data.records
details.showList.showMarket = true
}
/** 批量上架 */
const batchUp = () => {
//
@ -1022,6 +1132,8 @@
} else {
console.log('details.stateArr[0].value :>> ', details.stateArr[0].value);
//
if (_item.title === '在库') return
// 0,
if (details.stateArr[0].value === 0 && _item.title === '破损' || details.stateArr[0].value === 0 && _item.title === '不可修复') return
@ -1050,9 +1162,10 @@
if (val.isCheck && Number(val.value) !== 0) _item[val.name] = Number(val.value)
})
}
console.log('_item :>> ', _item);
if (_item.questStatus !== 1) details.scanNum++
_item.questStatus = 1
//
details.scanNum++
//
popUp_EditState.value.details.showPopUp = false
}
@ -1140,7 +1253,14 @@
/** 物料类型 */
questTarget: 2
}
if (details.pageType === 2) _order.allocationId = details.pageInfos.allocationId
if (details.pageType === 2) {
_order.allocationId = details.pageInfos.allocationId
_order.allocation = details.pageInfos.positionCode
}
else if (details.pageType === 3) {
_order.orderCode = details.pageInfos.orderCode
_order.orderId = details.pageInfos.orderId
}
else if (details.pageType === 4) {
_order.trayCode = details.pageInfos.trayCode
_order.trayId = details.pageInfos.trayId
@ -1160,20 +1280,87 @@
}
/** 新增库存品 */
const handleAddStock = () => { }
/** 左侧返回按钮 */
const leftClick = () => {
popUp_Handle.value.setDetails({
title: '有数据未提交, 是否返回',
const handleAddStock = () => {
popUp_AddStock.value.setDetails({
title: '新增零担',
showPopUp: true,
confirmText: '确认返回 ',
success() {
uni.navigateBack()
if (!details.addInfo.orderCode) return uni.showToast({
title: '请输入合同号',
icon: 'none'
})
if (!details.addInfo.incomingBatch) return uni.showToast({
title: '请输入批次号',
icon: 'none'
})
if (!details.addInfo.clientName) return uni.showToast({
title: '请输入正确的商场',
icon: 'none'
})
if (!details.addInfo.materialName) return uni.showToast({
title: '请输入物料名称',
icon: 'none'
})
const _number = Number(details.addInfo.quantity)
if (_number !== _number || _number <= 0) return uni.showToast({
title: '数量为大于0的数字',
icon: 'none'
})
const _order = {
questStatus: 1,
orderCode: details.addInfo.orderCode,
incomingBatch: details.addInfo.incomingBatch,
positionCode: '',
quantity: _number,
materialName: details.addInfo.materialName,
clientName: details.addInfo.clientName,
cargoName: 10,
stockNum: _number,
isChoose: false,
/** 为手动添加 */
isManuallyAdd: true,
/** 物料类型 */
questTarget: 3
}
if (details.pageType === 2) {
_order.allocationId = details.pageInfos.allocationId
_order.allocation = details.pageInfos.positionCode
}
else if (details.pageType === 3) {
_order.orderCode = details.pageInfos.orderCode
_order.orderId = details.pageInfos.orderId
}
else if (details.pageType === 4) {
_order.trayCode = details.pageInfos.trayCode
_order.trayId = details.pageInfos.trayId
}
details.stockList.push(_order)
details.scanNum++
//
details.addInfo = {}
//
popUp_AddStock.value.details.showPopUp = false
},
close() {
details.addInfo = {}
popUp_AddStock.value.details.showPopUp = false
}
})
}
/** 左侧返回按钮 */
const leftClick = () => {
/* popUp_Handle.value.setDetails({
title: '有数据未提交, 是否返回',
showPopUp: true,
confirmText: '确认返回 ',
success() {
uni.navigateBack()
}
}) */
uni.navigateBack()
}
/** 确认 */
const handleConFirm = () => {
switch (details.handleType) {
@ -1195,6 +1382,17 @@
}
}
/** 输入 */
const inputNum = (_item) => {
let _maxNum = details.stateArr[0].value - details.stateArr[2].value - details.stateArr[4].value - details.stateArr[5].value
let _number = Number(_item.value)
if (_number !== _number) return _item.value = 0
else if (_number <= 0) return _item.value = 0
else if (_maxNum < 0) _item.value = 0
else _item.value = _number
}
/** 提交盘点*/
const submitCheck = async () => {
try {
@ -1452,8 +1650,9 @@
display: flex;
color: #666;
// checkInfo_item
&_item {
width: 40%;
word-break: break-all;
display: inline-flex;
align-items: center;
@ -1613,8 +1812,12 @@
}
.input {
width: 50%;
width: 40%;
height: 32upx;
border: 1upx solid #eee;
margin-right: 20upx;
padding: 5upx;
border-radius: 5upx;
}
}
@ -1624,11 +1827,34 @@
justify-content: space-between;
font-size: 28upx;
align-items: center;
position: relative;
.popUpInput {
width: 70%;
margin-top: 0;
}
.select_content {
position: absolute;
z-index: 99;
top: 120%;
left: 50%;
transform: translateX(-50%);
background: #fff;
border: 1upx solid #eee;
width: 100%;
overflow: hidden;
view {
text-align: center;
padding: 20upx 0;
border-bottom: 1upx solid #000;
&:last-child {
border-bottom: 0;
}
}
}
}
//

Loading…
Cancel
Save