| | |
| | | " |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="关联项目" prop="projectId"> |
| | | <el-select |
| | | v-model="form.projectId" |
| | | filterable |
| | | clearable |
| | | placeholder="请选择" |
| | | style="width: 340px;" |
| | | :disabled=" |
| | | form.approvalStatus == dictGoOutAgree || |
| | | form.approvalStatus == dictGoOutReturn |
| | | " |
| | | > |
| | | <el-option |
| | | v-for="item in projects" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="出差分类" prop="category"> |
| | | <el-select |
| | | v-model="form.category" |
| | |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | prop="category" |
| | | label="出差分类" |
| | | width="80" |
| | | show-overflow-tooltip |
| | | > |
| | | <template slot-scope="scope"> |
| | | {{ dict.label[dictBusinessTravelCategory][scope.row.category] }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="approvalStatus" |
| | | label="审批状态" |
| | | width="80" |
| | |
| | | <script> |
| | | import crudAttendanceBusinessTravel from '@/api/attendance/attendanceBusinessTravel' |
| | | import CRUD, { presenter, header, form, crud } from '@crud/crud' |
| | | import crudProject from '@/api/project/project' |
| | | import rrOperation from '@crud/RR.operation' |
| | | import crudUser from '@/api/system/user' |
| | | import { mapGetters } from 'vuex' |
| | |
| | | departureCity: null, |
| | | arrivalCity: null, |
| | | category: null, |
| | | projectId: null, |
| | | approvalStatus: null, |
| | | approvalDescription: null, |
| | | remarks: null, |
| | |
| | | ], |
| | | approvalStatus: [ |
| | | { required: true, message: '审批状态不能为空', trigger: 'change' } |
| | | ], |
| | | projectId: [ |
| | | { required: true, message: '请选择项目', trigger: 'change' } |
| | | ] |
| | | }, |
| | | users: [], |
| | | approvalUsers: [], |
| | | // 项目列表 |
| | | projects: [], |
| | | dictBussinessStatus: constant.BUSSINESS_APPROVE_STATUS, |
| | | dictGoOutAppRev: constant.BUSSINESS_APPROVE_STATUS_REVIEWED, |
| | | dictGoOutAgree: constant.BUSSINESS_APPROVE_STATUS_AGREE, |
| | |
| | | const userRolesLevel = this.user.roles.map(({ level }) => level) |
| | | // 用户最大角色级别 |
| | | this.userRolesLevelMin = Math.min(...userRolesLevel) |
| | | // 获取项目列表 |
| | | this.getProjects() |
| | | return true |
| | | }, |
| | | // 钩子:新建 - 之前 |
| | |
| | | return true |
| | | } |
| | | }, |
| | | // 获取项目列表 |
| | | getProjects() { |
| | | // 获取项目列表 |
| | | crudProject.getRelevant({ |
| | | 'projectStatusIn': ['project_status_not_started', 'project_status_under_way'], |
| | | 'approve_status': 'approve_status_acknowledged' |
| | | }).then(res => { |
| | | // 项目列表 |
| | | this.projects = res |
| | | }) |
| | | }, |
| | | // 查询员工 |
| | | getUsers() { |
| | | crudUser.getAll().then(res => { |