diff --git a/src/pages/materialsStation/toolsBack/toolsBack.vue b/src/pages/materialsStation/toolsBack/toolsBack.vue
index 0d35fd2..65cd9e1 100644
--- a/src/pages/materialsStation/toolsBack/toolsBack.vue
+++ b/src/pages/materialsStation/toolsBack/toolsBack.vue
@@ -85,6 +85,14 @@
custom-style="successStyle"
/>
+
+ 是否签名:
+
+
@@ -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' } },
- { text: '编辑', style: { backgroundColor: '#2f8cf0' } },
- { text: '删除', style: { backgroundColor: '#ff4949' } },
- ]
+ 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) {
diff --git a/src/pages/my/signature.vue b/src/pages/my/signature.vue
index e7ef33a..c61729d 100644
--- a/src/pages/my/signature.vue
+++ b/src/pages/my/signature.vue
@@ -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,
diff --git a/src/services/materialsStation.js b/src/services/materialsStation.js
index 6b03272..aeb66e7 100644
--- a/src/services/materialsStation.js
+++ b/src/services/materialsStation.js
@@ -425,4 +425,13 @@ export const getSafeDetailsListApi = (data) => {
url: '/material/material_maMachine/getSafeDetailsList',
data,
})
+}
+
+// 退料签名
+export const updateSignByIdApi = (data) => {
+ return http({
+ method: 'POST',
+ url: '/material/material_back_apply_info/updateSignById',
+ data,
+ })
}
\ No newline at end of file