|
@@ -18,7 +18,7 @@
|
|
|
<template #handleUsers="{ row }">
|
|
<template #handleUsers="{ row }">
|
|
|
<div v-if="row.handleUsers && row.handleUsers.length">
|
|
<div v-if="row.handleUsers && row.handleUsers.length">
|
|
|
<span class="mr-1 text-gray-500">({{ getCompletedCount(row.handleUsers) }}/{{ row.handleUsers.length
|
|
<span class="mr-1 text-gray-500">({{ getCompletedCount(row.handleUsers) }}/{{ row.handleUsers.length
|
|
|
- }})</span>
|
|
|
|
|
|
|
+ }})</span>
|
|
|
<span v-for="(user, index) in row.handleUsers" :key="user.id">
|
|
<span v-for="(user, index) in row.handleUsers" :key="user.id">
|
|
|
<span :class="{ 'text-green-600 font-medium': user.status === 2 }">{{ user.userName }}</span>
|
|
<span :class="{ 'text-green-600 font-medium': user.status === 2 }">{{ user.userName }}</span>
|
|
|
<span v-if="user.status === 2" class="text-green-600 ml-0.5">✓</span>
|
|
<span v-if="user.status === 2" class="text-green-600 ml-0.5">✓</span>
|
|
@@ -33,18 +33,18 @@
|
|
|
<div class="flex justify-center space-x-2">
|
|
<div class="flex justify-center space-x-2">
|
|
|
<!-- Logic: Creator -->
|
|
<!-- Logic: Creator -->
|
|
|
<template v-if="isCreator(row)">
|
|
<template v-if="isCreator(row)">
|
|
|
- <template v-if="[1, 2].includes(row.status)"> <!-- Pending, Processing -->
|
|
|
|
|
|
|
+ <template v-if="[1, 2, 3].includes(row.status)"> <!-- Pending, Processing -->
|
|
|
<el-button link type="danger" @click="handleVoid(row)">作废</el-button>
|
|
<el-button link type="danger" @click="handleVoid(row)">作废</el-button>
|
|
|
<el-button link type="primary" @click="handleEdit(row)">编辑</el-button>
|
|
<el-button link type="primary" @click="handleEdit(row)">编辑</el-button>
|
|
|
<el-button link type="success" @click="handleComplete(row)">完成</el-button>
|
|
<el-button link type="success" @click="handleComplete(row)">完成</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
- <template v-else-if="[3, 4].includes(row.status)"> <!-- Completed, Void -->
|
|
|
|
|
|
|
+ <template v-else-if="[4, 5].includes(row.status)"> <!-- Completed, Void -->
|
|
|
<el-button link type="warning" @click="handleReopen(row)">重开</el-button>
|
|
<el-button link type="warning" @click="handleReopen(row)">重开</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
</template>
|
|
</template>
|
|
|
<!-- Logic: Assignee -->
|
|
<!-- Logic: Assignee -->
|
|
|
<template v-else-if="isAssignee(row)">
|
|
<template v-else-if="isAssignee(row)">
|
|
|
- <template v-if="[1, 2].includes(row.status)">
|
|
|
|
|
|
|
+ <template v-if="[1, 2, 3].includes(row.status)">
|
|
|
<el-button link type="success" @click="handleComplete(row)">完成</el-button>
|
|
<el-button link type="success" @click="handleComplete(row)">完成</el-button>
|
|
|
<el-button link type="primary" @click="handleEdit(row)">编辑</el-button>
|
|
<el-button link type="primary" @click="handleEdit(row)">编辑</el-button>
|
|
|
</template>
|
|
</template>
|
|
@@ -59,7 +59,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
-import { ref, reactive, computed, onMounted } from 'vue'
|
|
|
|
|
|
|
+import { ref, reactive, computed, onMounted, getCurrentInstance } from 'vue'
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
import CommonTable from '@/components/CommonPage/CommonTable.vue'
|
|
import CommonTable from '@/components/CommonPage/CommonTable.vue'
|
|
|
import PageSearch from './components/page-search.vue'
|
|
import PageSearch from './components/page-search.vue'
|
|
@@ -67,6 +67,7 @@ import EditDialog from './components/edit-dialog.vue'
|
|
|
import { useUserStore } from '@/store/modules/user'
|
|
import { useUserStore } from '@/store/modules/user'
|
|
|
import { Plus, Check } from '@element-plus/icons-vue'
|
|
import { Plus, Check } from '@element-plus/icons-vue'
|
|
|
|
|
|
|
|
|
|
+const { proxy } = getCurrentInstance();
|
|
|
const userStore = useUserStore()
|
|
const userStore = useUserStore()
|
|
|
const currentUserId = computed(() => userStore.info?.userId || userStore.info?.id)
|
|
const currentUserId = computed(() => userStore.info?.userId || userStore.info?.id)
|
|
|
|
|
|
|
@@ -99,22 +100,6 @@ const columns = ref([
|
|
|
{ columnKey: 'action', label: '操作', width: 150, fixed: 'right', align: 'center', slot: 'action' }
|
|
{ columnKey: 'action', label: '操作', width: 150, fixed: 'right', align: 'center', slot: 'action' }
|
|
|
])
|
|
])
|
|
|
|
|
|
|
|
-// Helpers
|
|
|
|
|
-const getTaskTypeName = (type) => {
|
|
|
|
|
- const map = { 1: '仓库缺货', 2: '部分发货', 3: '书单不符' }
|
|
|
|
|
- return map[type] || '未知'
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-const getStatusName = (status) => {
|
|
|
|
|
- const map = { 1: '待处理', 2: '处理中', 3: '已完成', 4: '已作废' }
|
|
|
|
|
- return map[status] || '未知'
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-const getStatusType = (status) => {
|
|
|
|
|
- const map = { 1: 'primary', 2: 'warning', 3: 'success', 4: 'info' }
|
|
|
|
|
- return map[status] || 'info'
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
const getCompletedCount = (handleUsers) => {
|
|
const getCompletedCount = (handleUsers) => {
|
|
|
if (!handleUsers) return 0
|
|
if (!handleUsers) return 0
|
|
|
return handleUsers.filter(u => u.status === 2).length
|
|
return handleUsers.filter(u => u.status === 2).length
|
|
@@ -142,7 +127,7 @@ const handleAdd = () => {
|
|
|
|
|
|
|
|
const handleBatchComplete = () => {
|
|
const handleBatchComplete = () => {
|
|
|
const selectedRows = tableRef.value?.getSelections()
|
|
const selectedRows = tableRef.value?.getSelections()
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
tableRef.value?.operatBatch({
|
|
tableRef.value?.operatBatch({
|
|
|
method: 'post',
|
|
method: 'post',
|
|
|
url: '/workorder/workorderinfo/finish',
|
|
url: '/workorder/workorderinfo/finish',
|