退料签名

This commit is contained in:
bb_pan 2025-09-23 19:49:43 +08:00
parent 2cbb446286
commit e369203df9
3 changed files with 57 additions and 8 deletions

View File

@ -85,6 +85,14 @@
custom-style="successStyle"
/>
</div>
<div style="line-height: 1.8; display: flex; align-items: center">
<span style="margin-right: 5px">是否签名:</span>
<uni-tag
:text="item.isElectronicSign == 1 ? '未签名' : '已签名'"
:inverted="true"
:type="item.isElectronicSign == 1 ? 'error' : 'success'"
/>
</div>
</div>
</div>
</uni-swipe-action-item>
@ -146,14 +154,21 @@ const getList = async () => {
console.log('🚀 ~ getList ~ res:', res)
if (res.code == 200) {
tableList.value = res.data.rows.map((item, index) => {
let options = [
// { text: '', style: { backgroundColor: '#c6bf3b' } },
let options = []
if (item.taskStatus != 2) {
options = [
{ text: '编辑', style: { backgroundColor: '#2f8cf0' } },
{ text: '删除', style: { backgroundColor: '#ff4949' } },
]
} else {
options = []
}
if (item.isElectronicSign == 1) {
options.unshift({ text: '电子签名', style: { backgroundColor: '#c6bf3b' } })
}
return {
...item,
options: item.taskStatus == 2 ? [] : options, // 4
options,
}
})
console.log('🚀 ~ getList ~ tableList.value:', tableList.value)
@ -202,6 +217,14 @@ const onClickSwipe = async (e, item) => {
} else if (e.content.text == '删除') {
//
await deleteItem(item)
} else if (e.content.text == '电子签名') {
const params = {
id: item.id,
isToolsBack: true,
}
uni.navigateTo({
url: `/pages/my/signature?params=${JSON.stringify(params)}`,
})
}
swipeRef.value.closeAll()
} catch (error) {

View File

@ -24,7 +24,7 @@ import {
updateLeaseApplyInfoSign,
updateSignById,
} from '@/services/signature.js'
import { toolsLeaseApplyInfoSign, updateLeaseApplyInfoSignApi } from '@/services/materialsStation'
import { toolsLeaseApplyInfoSign, updateLeaseApplyInfoSignApi, updateSignByIdApi } from '@/services/materialsStation'
import { baseURL } from '@/utils/http'
import { uploadImgSignUrl } from '@/utils/bnsBase'
@ -57,7 +57,7 @@ onLoad((opt) => {
})
onMounted(() => {
if (opts.isLease || opts.isBack || opts.isAuthorize || opts.isToolsLease) return
if (opts.isLease || opts.isBack || opts.isAuthorize || opts.isToolsLease || opts.isToolsBack) return
getSignData()
})
@ -240,6 +240,23 @@ const uploadSignUrl = async (url) => {
}, 1000)
},
})
} else if (opts.isToolsBack) {
const params = {
id: opts.id,
backSignUrl: signUrl,
backSignType: signType.value
}
const res = await updateSignByIdApi(params)
console.log('🚀 ~ 退料签名 ~ res:', res)
uni.showToast({
title: '签名成功',
mask: true,
success: () => {
setTimeout(() => {
uni.navigateBack()
}, 1000)
},
})
} else if (opts.isAuthorize) {
const params = {
parentId: opts.id,

View File

@ -426,3 +426,12 @@ export const getSafeDetailsListApi = (data) => {
data,
})
}
// 退料签名
export const updateSignByIdApi = (data) => {
return http({
method: 'POST',
url: '/material/material_back_apply_info/updateSignById',
data,
})
}