吉安感知网项目-前端
张含笑
2026-01-30 6c4bd2467bb6651c6edcf8a9741dcd4e9b1aa6d3
applications/task-work-order/src/views/orderView/orderDataManage/supplyAdd/index.vue
@@ -35,7 +35,7 @@
         </el-form-item>
      </el-form>
      <div class="gd-table-toolbar">
      <div class="gd-table-toolbar" v-if="permissionList.addBtn">
         <el-button :icon="Plus" color="#4C34FF" type="primary" @click="openForm('add')">供需填报新增</el-button>
      </div>
@@ -79,9 +79,8 @@
               <el-table-column label="操作" class-name="operation-btns" width="150">
                  <template v-slot="{ row }">
                     <el-link  type="primary"  @click="openForm('view', row)">查看</el-link>
                     <!-- 只对非审批状态显示编辑和删除按钮 -->
                     <el-link  type="primary"  @click="openForm('edit', row)" v-if="!['1', '2', '3'].includes(row.demandStatus)">编辑</el-link>
                     <el-link  type="primary"  @click="handleDelete(row)" v-if="!['1', '2', '3'].includes(row.demandStatus)">删除</el-link>
                     <el-link  type="primary"  @click="openForm('edit', row)" v-if="!['1', '2', '3'].includes(row.demandStatus) && permissionList.addBtn">编辑</el-link>
                     <el-link  type="primary"  @click="handleDelete(row)" v-if="!['1', '2', '3'].includes(row.demandStatus) && permissionList.deleteBtn">删除</el-link>
                  </template>
               </el-table-column>
            </el-table>
@@ -116,7 +115,9 @@
   gdSupplyDemandPageApi,
   gdSupplyDemandRemoveApi,
} from '@/views/orderView/orderDataManage/supplyAdd/supplyAddApi'
import { useStore } from 'vuex'
const store = useStore()
const permission = computed(() => store.state.user.permission);
// 初始化查询参数
const initSearchParams = () => ({
   demandName: '', // 需求名称
@@ -151,6 +152,17 @@
provide('detailDemandStatus', detailDemandStatus)
const reasonForRejection = ref('') //拒绝原因
provide('reasonForRejection', reasonForRejection)
function validData(value, defaultValue) {
   return value !== undefined ? value : defaultValue
}
const permissionList = computed(() => {
   return {
      addBtn: validData(permission.value.orderData_addDemand, false),
      deleteBtn: validData(permission.value.orderData_delete, false),
   }
})
// 根据部门ID获取部门名称
function getDeptNameById(deptId, deptList) {
   if (!deptId || !Array.isArray(deptList)) return ''