This commit is contained in:
bb_pan 2025-06-03 16:15:00 +08:00
parent b06e465791
commit d1160bc07b
5 changed files with 52 additions and 20 deletions

View File

@ -48,7 +48,7 @@
class="flex"
v-if="!queryParams.isAddCode"
>
<span class="form-view">{{ queryParams.outNum }}</span>
<span class="form-view">{{ queryParams.isAddCode }}</span>
</uni-forms-item>
</uni-forms>
</view>
@ -196,14 +196,13 @@ onLoad((opt) => {
queryParamsTemp.value = opt.params ? JSON.parse(opt.params) : {}
queryParamsTemp.value.id = queryParamsTemp.value.parentId
console.log('xxxxxxxx', queryParamsTemp.value)
queryParams.value.isAddCode = queryParamsTemp.value.isAddCode
queryCodeParams.value.typeId = queryParamsTemp.value.typeId
getDetailsById()
// getDetailsById()
// console.log('🚀 ~ onLoad ~ queryParams.value:', queryParams.value)
})
onShow(() => {
getDetailsById()
// getDetailsById()
// getCodeDetailData(queryParams.value.id, queryParams.value.publishTask, queryParams.value.typeId) //
})
@ -219,6 +218,7 @@ const getDetailsById = async () => {
queryParams.value = res.data[0]
queryParams.value.projectName = queryParamsTemp.value.projectName
queryParams.value.teamName = queryParamsTemp.value.teamName
queryParams.value.isAddCode = queryParamsTemp.value.isAddCode
} catch (error) {
console.log('🚀 ~ getDetailsById ~ error:', error)
}
@ -249,6 +249,7 @@ const getCodeDetailData = async (id, publishTask, typeId) => {
//
const getCodeDeviceListData = async () => {
console.log('🚀 ~ getCodeDeviceListData ~ queryCodeParams.value:', queryCodeParams.value)
const res = await getCodeDeviceListAPI(queryCodeParams.value)
console.log('🚀 ~ getCodeDeviceListData ~ res:', res)
codeDeviceList.value.push(...res.data)
@ -308,6 +309,24 @@ const onHandleOutbound = async () => {
// })
// return
// }
if (codeDeviceList.value.length == 0) {
uni.showToast({
title: '请添加出库设备',
icon: 'none',
})
return
}
//
const { confirm } = await uni.showModal({
title: '提示',
content: '是否确认出库',
confirmText: '确定',
cancelText: '取消',
})
console.log('🚀 ~ onHandleOutbound ~ confirm:', confirm)
if (!confirm) {
return
}
//
const { typeId, parentId, publishTask } = queryParams.value
//
@ -334,13 +353,20 @@ const onHandleOutbound = async () => {
})
})
console.log('mmmmmmmmmmmmmmmm', paramsList)
const res = await setOutboundNumAPI({ leaseOutDetailsList: paramsList })
if (res.code === 200) {
uni.showToast({
title: '出库成功!',
icon: 'none',
})
back()
try {
const res = await setOutboundNumAPI({ leaseOutDetailsList: paramsList })
if (res.code === 200) {
uni.showToast({
title: '出库成功!',
icon: 'none',
})
setTimeout(() => {
back()
}, 1000)
}
console.log('🚀 ~ onHandleOutbound ~ res:', res)
} catch (error) {
console.log('🚀 ~ onHandleOutbound ~ error:', error)
}
}

View File

@ -59,7 +59,6 @@
justify-content: center;
background: #67c23a;
"
size="mini"
type="primary"
@click="submit"
>
@ -116,7 +115,10 @@ const submit = () => {
icon: 'none',
title: '出库成功',
})
back()
setTimeout(() => {
//
back()
}, 1000)
} catch (error) {
console.log('🚀 ~ submit ~ error:', error)
}

View File

@ -127,6 +127,7 @@ const add = () => {
const params = JSON.stringify({
isOut: opts.value.isOut,
isNew: opts.value.isNew,
title: opts.value.isOut ? '工器具出库' : '工器具领料',
})
uni.navigateTo({
url: '/pages/toolsLease/toolsLeaseAdd?params=' + params,
@ -160,10 +161,12 @@ const getList = async () => {
{ text: '编辑', style: { backgroundColor: '#2f8cf0' } },
{ text: '删除', style: { backgroundColor: '#ff4949' } },
]
if (!opts.value.isOut) {
console.log('🚀 ~ tableList.value=res.data.rows.map ~ item.taskStatus:', item.taskStatus)
if (!opts.value.isOut && item.taskStatus != 4) {
options = options.filter((option) => option.text !== '提交')
}
if (item.taskStatus != 1) {
if (item.taskStatus == 1 || item.taskStatus == 5) {
//
options = options.filter((option) => option.text !== '编辑' && option.text !== '删除')
} else if (item.taskStatus == 4) {
@ -205,7 +208,7 @@ const onScrollTolower = () => {
//
const onClickSwipe = async (e, item) => {
console.log('🚀 ~ onClickSwipe ~ e:', e, item)
if (e.index == 0) {
if (e.content.text == '电子签名') {
//
console.log('电子签名-e', e)
console.log('电子签名-item', item)
@ -218,7 +221,7 @@ const onClickSwipe = async (e, item) => {
uni.navigateTo({
url: `/pages/my/signature?params=${JSON.stringify(params)}`,
})
} else if (e.index == 1) {
} else if (e.content.text == '提交') {
//
try {
let paramsOne = {
@ -308,7 +311,7 @@ const onClickSwipe = async (e, item) => {
icon: 'none',
})
}
} else if (e.index == 2) {
} else if (e.content.text == '编辑') {
//
const params = JSON.stringify({
id: item.id,
@ -318,7 +321,7 @@ const onClickSwipe = async (e, item) => {
uni.navigateTo({
url: `/pages/toolsLease/toolsLeaseAdd?params=${params}`,
})
} else {
} else if (e.content.text == '删除') {
//
deleteItem(item)
}

View File

@ -384,7 +384,7 @@ const back = () => {
onLoad((opt) => {
console.log('onLoad', opt)
opts.value = opt.params ? JSON.parse(opt.params) : {}
title.value = opts.value.isEdit && opts.value.isNew != 0 ? '编辑工器具领料' : '新增工器具领料'
title.value = opts.value.title
if (opts.value.isNew == 0) {
console.log('🚀 ~ onLoad ~ opts.value.isNew:', opts.value.isNew)
formData.teamId = opts.value.teamId

View File

@ -110,6 +110,7 @@ const addLeaseNum = () => {
projectName: opts.value.projectName,
parentId: tableList.value[0].parentId,
isEdit: true,
title: '数量出库',
}
uni.navigateTo({
url: '/pages/toolsLease/toolsLeaseAdd?params=' + JSON.stringify(params),