From 47bae1f938f915206e3934ea960aff975e5738c9 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期五, 12 六月 2026 16:09:49 +0800
Subject: [PATCH] feat(teachingDemo): 新增工艺路线与BOM教学演示模块
---
src/views/collaborativeApproval/sealManagement/index.vue | 94 ++++++++++++++++++++++++++++++-----------------
1 files changed, 60 insertions(+), 34 deletions(-)
diff --git a/src/views/collaborativeApproval/sealManagement/index.vue b/src/views/collaborativeApproval/sealManagement/index.vue
index 9d68848..a06f6d5 100644
--- a/src/views/collaborativeApproval/sealManagement/index.vue
+++ b/src/views/collaborativeApproval/sealManagement/index.vue
@@ -7,7 +7,6 @@
</div>
</template>
-
<!-- 鐢ㄥ嵃鐢宠绠$悊 -->
<div class="tab-content">
<el-row :gutter="20" class="mb-20 ">
@@ -45,7 +44,7 @@
:isShowPagination="true"
@pagination="paginationChange"
/>
- </div>
+ </div>
</el-card>
<!-- 鐢ㄥ嵃鐢宠瀵硅瘽妗� -->
@@ -177,6 +176,7 @@
const sealFormRef = ref()
const userList = ref([])
const sealForm = reactive({
+ id: null,
applicationNum: '',
title: '',
sealType: '',
@@ -241,9 +241,9 @@
// 鐢ㄥ嵃鐢宠琛ㄦ牸鍒楅厤缃紙闇�鍦� getStatusText/getSealTypeText 绛変箣鍚庡畾涔夛級
const sealTableColumn = ref([
- { label: '鐢宠缂栧彿', prop: 'applicationNum',},
+ { label: '鐢宠缂栧彿', prop: 'applicationNum' },
{ label: '鐢宠鏍囬', prop: 'title', showOverflowTooltip: true },
- { label: '鐢宠浜�', prop: 'createUserName', },
+ { label: '鐢宠浜�', prop: 'createUserName' },
{ label: '鎵�灞為儴闂�', prop: 'department', width: 150 },
{
label: '鐢ㄥ嵃绫诲瀷',
@@ -261,34 +261,38 @@
formatData: (v) => getStatusText(v),
formatType: (v) => getStatusType(v)
},
+ { label: '瀹℃壒浜�', prop: 'approveUserName', width: 100 },
{
dataType: 'action',
label: '鎿嶄綔',
- width: 200,
+ width: 250,
fixed: 'right',
align: 'center',
operation: [
{
name: '瀹℃壒',
clickFun: (row) => approveSeal(row),
- showHide: (row) => row.status === 'pending'
+ showHide: (row) => row.status === 'pending' && Number(userStore.id) === row.approveUserId
},
{
name: '鎷掔粷',
clickFun: (row) => rejectSeal(row),
- showHide: (row) => row.status === 'pending'
+ showHide: (row) => row.status === 'pending' && Number(userStore.id) === row.approveUserId
},
- { name: '璇︽儏', clickFun: (row) => viewSealDetail(row) }
+ {
+ name: '閲嶆柊鐢宠',
+ clickFun: (row) => reapplySeal(row),
+ showHide: (row) => row.status === 'rejected' && Number(userStore.id) === row.createUser
+ },
+ { name: '璇︽儏', clickFun: (row) => viewSealDetail(row) }
]
}
])
// 鎼滅储鍗扮珷鐢宠
const searchSealApplications = () => {
- page.current=1
+ page.current = 1
getSealApplicationList()
-
- // ElMessage.success('鎼滅储瀹屾垚')
}
// 閲嶇疆鍗扮珷鐢宠鎼滅储
const resetSealSearch = () => {
@@ -297,37 +301,58 @@
sealSearchForm.applicationNum = ''
searchSealApplications()
}
+
+// 閲嶆柊鐢宠鐢ㄥ嵃
+const reapplySeal = (row) => {
+ // 棰勫~琛ㄥ崟鏁版嵁
+ Object.assign(sealForm, {
+ id: row.id,
+ applicationNum: row.applicationNum,
+ title: row.title,
+ sealType: row.sealType,
+ reason: row.reason,
+ approveUserId: row.approveUserId,
+ urgency: row.urgency || 'normal',
+ status: 'pending',
+ storageBlobDTOs: row.storageBlobVOList || []
+ })
+ showSealApplyDialog.value = true
+}
+
// 鎻愪氦鐢ㄥ嵃鐢宠
const submitSealApplication = async () => {
try {
await sealFormRef.value.validate()
- addSealApplication(sealForm).then(res => {
- if(res.code == 200){
- ElMessage.success('鐢宠鎻愪氦鎴愬姛')
+ const request = sealForm.id ? updateSealApplication : addSealApplication
+ request(sealForm).then(res => {
+ if (res.code == 200) {
+ ElMessage.success(sealForm.id ? '閲嶆柊鐢宠鎴愬姛' : '鐢宠鎻愪氦鎴愬姛')
closeSealApplyDialog()
getSealApplicationList()
Object.assign(sealForm, {
- applicationNum: '',
- title: '',
- sealType: '',
- reason: '',
- approveUserId: '',
- urgency: 'normal',
- status: 'pending',
- storageBlobDTOs: []
- })
+ id: null,
+ applicationNum: '',
+ title: '',
+ sealType: '',
+ reason: '',
+ approveUserId: '',
+ urgency: 'normal',
+ status: 'pending',
+ storageBlobDTOs: []
+ })
}
}).catch(err => {
console.log(err.msg)
})
-
} catch (error) {
}
}
+
// 鍏抽棴鐢ㄥ嵃鐢宠瀵硅瘽妗�
const closeSealApplyDialog = () => {
// 娓呯┖琛ㄥ崟鏁版嵁
Object.assign(sealForm, {
+ id: null,
applicationNum: '',
title: '',
sealType: '',
@@ -383,7 +408,7 @@
}).then(() => {
row.status = 'approved'
updateSealApplication(row).then(res => {
- if(res.code == 200){
+ if (res.code == 200) {
ElMessage.success('瀹℃壒閫氳繃')
getSealApplicationList()
}
@@ -399,8 +424,9 @@
inputErrorMessage: '鎷掔粷鍘熷洜涓嶈兘涓虹┖'
}).then(({ value }) => {
row.status = 'rejected'
+ row.reason = value
updateSealApplication(row).then(res => {
- if(res.code == 200){
+ if (res.code == 200) {
ElMessage.success('宸叉嫆缁濈敵璇�')
getSealApplicationList()
}
@@ -418,13 +444,13 @@
const getSealApplicationList = async () => {
tableLoading.value = true
listSealApplication(page, sealSearchForm)
- .then(res => {
- sealApplications.value = res.data.records
- page.total = res.data.total
- tableLoading.value = false
- }).catch(err => {
- tableLoading.value = false
- })
+ .then(res => {
+ sealApplications.value = res.data.records
+ page.total = res.data.total
+ tableLoading.value = false
+ }).catch(err => {
+ tableLoading.value = false
+ })
}
// 鍒嗛〉鍙樺寲澶勭悊
const paginationChange = (obj) => {
@@ -491,4 +517,4 @@
.attachment-table {
border-radius: 4px;
}
-</style>
+</style>
\ No newline at end of file
--
Gitblit v1.9.3