退料签名

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" custom-style="successStyle"
/> />
</div> </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>
</div> </div>
</uni-swipe-action-item> </uni-swipe-action-item>
@ -146,14 +154,21 @@ const getList = async () => {
console.log('🚀 ~ getList ~ res:', res) console.log('🚀 ~ getList ~ res:', res)
if (res.code == 200) { if (res.code == 200) {
tableList.value = res.data.rows.map((item, index) => { tableList.value = res.data.rows.map((item, index) => {
let options = [ let options = []
// { text: '', style: { backgroundColor: '#c6bf3b' } }, if (item.taskStatus != 2) {
{ text: '编辑', style: { backgroundColor: '#2f8cf0' } }, options = [
{ text: '删除', style: { backgroundColor: '#ff4949' } }, { text: '编辑', style: { backgroundColor: '#2f8cf0' } },
] { text: '删除', style: { backgroundColor: '#ff4949' } },
]
} else {
options = []
}
if (item.isElectronicSign == 1) {
options.unshift({ text: '电子签名', style: { backgroundColor: '#c6bf3b' } })
}
return { return {
...item, ...item,
options: item.taskStatus == 2 ? [] : options, // 4 options,
} }
}) })
console.log('🚀 ~ getList ~ tableList.value:', tableList.value) console.log('🚀 ~ getList ~ tableList.value:', tableList.value)
@ -202,6 +217,14 @@ const onClickSwipe = async (e, item) => {
} else if (e.content.text == '删除') { } else if (e.content.text == '删除') {
// //
await deleteItem(item) 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() swipeRef.value.closeAll()
} catch (error) { } catch (error) {

View File

@ -24,7 +24,7 @@ import {
updateLeaseApplyInfoSign, updateLeaseApplyInfoSign,
updateSignById, updateSignById,
} from '@/services/signature.js' } from '@/services/signature.js'
import { toolsLeaseApplyInfoSign, updateLeaseApplyInfoSignApi } from '@/services/materialsStation' import { toolsLeaseApplyInfoSign, updateLeaseApplyInfoSignApi, updateSignByIdApi } from '@/services/materialsStation'
import { baseURL } from '@/utils/http' import { baseURL } from '@/utils/http'
import { uploadImgSignUrl } from '@/utils/bnsBase' import { uploadImgSignUrl } from '@/utils/bnsBase'
@ -57,7 +57,7 @@ onLoad((opt) => {
}) })
onMounted(() => { onMounted(() => {
if (opts.isLease || opts.isBack || opts.isAuthorize || opts.isToolsLease) return if (opts.isLease || opts.isBack || opts.isAuthorize || opts.isToolsLease || opts.isToolsBack) return
getSignData() getSignData()
}) })
@ -240,6 +240,23 @@ const uploadSignUrl = async (url) => {
}, 1000) }, 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) { } else if (opts.isAuthorize) {
const params = { const params = {
parentId: opts.id, parentId: opts.id,

View File

@ -425,4 +425,13 @@ export const getSafeDetailsListApi = (data) => {
url: '/material/material_maMachine/getSafeDetailsList', url: '/material/material_maMachine/getSafeDetailsList',
data, data,
}) })
}
// 退料签名
export const updateSignByIdApi = (data) => {
return http({
method: 'POST',
url: '/material/material_back_apply_info/updateSignById',
data,
})
} }