吉安感知网项目-前端
shuishen
2026-01-20 cdca99e982524afae64d400e6351cde9f5abf30c
applications/task-work-order/src/views/orderView/orderManage/orderManage/index.vue
@@ -68,6 +68,8 @@
      </el-form>
      <div class="gd-table-toolbar">
         <el-button color="#F2F3F5" @click="requester = !requester">我是{{ requester ? '需求方' : '服务方' }}</el-button>
         <el-button :icon="Plus" color="#4C34FF" type="primary" @click="openForm('add')">新增</el-button>
         <el-button :icon="Delete" color="#4C34FF" :disabled="!selectedIds.length" @click="handleDelete()">删除</el-button>
      </div>
@@ -84,7 +86,7 @@
                     {{ getDictLabel(row.workOrderType, dictObj.workOrderType) }}
                  </template>
               </el-table-column>
               <el-table-column prop="status" show-overflow-tooltip label="阶段状态" >
               <el-table-column prop="status" show-overflow-tooltip label="阶段状态">
                  <template v-slot="{ row }">
                     {{ getDictLabel(row.workOrderStatus, dictObj.workOrderStatus).split('_')[0] }}
                  </template>
@@ -105,8 +107,8 @@
               <el-table-column prop="createTime" show-overflow-tooltip label="工单创建时间" />
               <el-table-column label="操作" class-name="operation-btns">
                  <template v-slot="{ row }">
                     <el-link @click="openForm('view', row)">查看</el-link>
<!--                     <el-link @click="openForm('edit', row)">编辑</el-link>-->
                     <el-link @click="openFormChange(row)">查看</el-link>
                     <!--                     <el-link @click="openForm('edit', row)">编辑</el-link>-->
                     <el-link @click="handleDelete(row)">删除</el-link>
                  </template>
               </el-table-column>
@@ -133,7 +135,6 @@
import { onMounted, ref } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { getDictionaryByCode } from '@/api/system/dictbiz'
import { getDeptTree } from '@/api/system/dept'
import { dateRangeFormat, getDictLabel } from '@ztzf/utils'
import FormDiaLog from './FormDiaLog.vue'
import { gdWorkOrderPageApi, gdWorkOrderRemoveApi } from './orderManageApi'
@@ -149,6 +150,7 @@
   current: 1, // 当前页
   size: 10, // 每页大小
})
const requester = ref(true)
const searchParams = ref(initSearchParams()) // 查询参数
const dateRange = ref([]) // 执行时间范围
const total = ref(0) // 总条数
@@ -163,14 +165,10 @@
   workOrderType: [], // 工单类型
   workOrderStatus: [], // 工单状态
})
const editStatus = ['11', '24', '25']
provide('dictObj', dictObj)
const deptTree = ref([]) // 部门树
const treeProps = {
   label: 'name',
   children: 'children',
}
provide('deptTree', deptTree)
provide('treeProps', treeProps)
provide('requester', requester)
provide('editStatus', editStatus)
// 获取列表
async function getList() {
@@ -207,6 +205,14 @@
   })
}
function openFormChange(row) {
   dialogVisible.value = true
   nextTick(() => {
      const mode = editStatus.includes(row.workOrderStatus) && requester.value ? 'edit' : 'view'
      dialogRef.value?.open({ mode, row })
   })
}
// 删除
async function handleDelete(row) {
   const tips = row ? '该条' : '选中的项'
@@ -235,17 +241,9 @@
   })
}
// 获取部门树
function getDeptTreeFun() {
   getDeptTree().then(res => {
      deptTree.value = res.data.data
   })
}
onMounted(() => {
   getList()
   getDictList()
   getDeptTreeFun()
})
</script>
<style scoped lang="scss"></style>