From 30175452a6a82ea7d19f81f737e8ec6fcbc42273 Mon Sep 17 00:00:00 2001 From: bb_pan Date: Thu, 5 Jun 2025 18:31:35 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=80=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/toolsBack/toolsAddBack.vue | 764 ++++++++++++++----------- src/pages/toolsBack/toolsBack.vue | 33 +- src/pages/toolsLease/codeOut.vue | 53 +- src/pages/toolsLease/toolsLeaseAdd.vue | 31 +- src/services/back.js | 25 + 5 files changed, 546 insertions(+), 360 deletions(-) diff --git a/src/pages/toolsBack/toolsAddBack.vue b/src/pages/toolsBack/toolsAddBack.vue index 420d964..064d5fd 100644 --- a/src/pages/toolsBack/toolsAddBack.vue +++ b/src/pages/toolsBack/toolsAddBack.vue @@ -1,11 +1,5 @@ + +
+ + + + + + + - - - - - - - - - - + > + + + + + + + + + + + - - - 序号 - 类型名称 - 规格型号 - 在用数 - 退料数 - 损坏价值判定 - 操作 - - - {{ index + 1 }} - {{ item.maTypeName }} - - {{ item.typeName }} - - {{ item.num }} - - - - - - - - - + + + 序号 + 类型名称 + 规格型号 + 在用数 + 退料数 + 损坏价值判定 + 操作 + + + {{ index + 1 }} + {{ item.maTypeName }} + + {{ item.typeName }} + + {{ item.num }} + + + + {{ + item.maCodeList.length == 0 ? '选择编码' : item.maCodeList.length + }} + + + + + + + + - -
+ + diff --git a/src/pages/toolsBack/toolsBack.vue b/src/pages/toolsBack/toolsBack.vue index 72d35fd..706ef1e 100644 --- a/src/pages/toolsBack/toolsBack.vue +++ b/src/pages/toolsBack/toolsBack.vue @@ -48,12 +48,12 @@ -
+
{{ index + 1 }}.
申请时间: {{ item.createTime }}
@@ -116,7 +116,7 @@ const tableList = ref([]) const total = ref(0) const options = ref([ { - text: '提交', + text: '2f8cf0', style: { backgroundColor: '#2f8cf0', }, @@ -159,7 +159,17 @@ const getList = async () => { const res = await getBackListAPI(params) console.log('🚀 ~ getList ~ res:', res) if (res.code == 200) { - tableList.value = res.data.rows + tableList.value = res.data.rows.map((item, index) => { + let options = [ + // { text: '电子签名', style: { backgroundColor: '#c6bf3b' } }, + { text: '编辑', style: { backgroundColor: '#2f8cf0' } }, + { text: '删除', style: { backgroundColor: '#ff4949' } }, + ] + return { + ...item, + options: item.taskStatus == 4 ? [] : options, // 如果任务状态为4,则不显示操作按钮 + } + }) console.log('🚀 ~ getList ~ tableList.value:', tableList.value) total.value = res.data.total } @@ -198,7 +208,7 @@ const onScrollTolower = () => { const onClickSwipe = async (e, item) => { console.log('🚀 ~ onClickSwipe ~ e:', e, item) try { - if (e.index == 0) { + if (e.content.text == '提交') { // 提交 const params = JSON.stringify({ id: item.id, @@ -220,7 +230,18 @@ const onClickSwipe = async (e, item) => { icon: 'error', }) } - } else { + } else if (e.content.text == '编辑') { + // 编辑 + console.log('🚀 ~ 编辑 ~ item:', item) + const params = JSON.stringify({ + id: item.id, + taskId: item.taskId, + isEdit: true, + }) + uni.navigateTo({ + url: `/pages/toolsBack/toolsAddBack?params=${params}`, + }) + } else if (e.content.text == '删除') { // 删除 await deleteItem(item) } diff --git a/src/pages/toolsLease/codeOut.vue b/src/pages/toolsLease/codeOut.vue index 0600c7c..57d7c12 100644 --- a/src/pages/toolsLease/codeOut.vue +++ b/src/pages/toolsLease/codeOut.vue @@ -1,6 +1,6 @@