| | |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="分公司" prop="deptId"> |
| | | <el-select |
| | | v-model="queryParams.deptId" |
| | | placeholder="请选择分公司" |
| | | clearable |
| | | filterable |
| | | style="width: 200px" |
| | | > |
| | | <el-option |
| | | v-for="dept in branchList" |
| | | :key="dept.deptId" |
| | | :label="dept.deptName" |
| | | :value="dept.deptId" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="车牌号" prop="vehicleNo"> |
| | | <el-input |
| | | v-model="queryParams.vehicleNo" |
| | | placeholder="请输入车牌号" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="计划开始时间"> |
| | | <el-date-picker |
| | | v-model="dateRange" |
| | |
| | | |
| | | <el-table v-loading="loading" :data="taskList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="任务编号" align="center" prop="taskCode"> |
| | | <el-table-column label="任务编号" align="center" prop="showTaskCode" min-width="120"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | type="text" |
| | | @click="handleView(scope.row)" |
| | | v-hasPermi="['task:general:query']" |
| | | >{{ scope.row.taskCode }}</el-button> |
| | | style="font-family: 'Courier New', monospace; font-size: 13px;" |
| | | >{{ scope.row.showTaskCode }}</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="任务类型" align="center" prop="taskType" width="120"> |
| | | <template slot-scope="scope"> |
| | | <dict-tag :options="dict.type.sys_task_type" :value="scope.row.taskType"/> |
| | | <el-tag v-if="scope.row.taskType === 'EMERGENCY_TRANSFER'" type="danger" size="mini" style="margin-left: 5px;"> |
| | | <i class="el-icon-warning"></i> |
| | | </el-tag> |
| | | |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column label="任务状态" align="center" prop="taskStatus"> |
| | | <template slot-scope="scope"> |
| | | <dict-tag :options="dict.type.sys_task_status" :value="scope.row.taskStatus"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="出发地址" align="center" prop="departureAddress" show-overflow-tooltip /> |
| | | <el-table-column label="目的地址" align="center" prop="destinationAddress" show-overflow-tooltip /> |
| | | <el-table-column label="车牌号" align="center" prop="vehicleNo" width="120"> |
| | | <template slot-scope="scope"> |
| | | <span v-if="scope.row.vehicleNo">{{ scope.row.vehicleNo }}</span> |
| | | <span v-else style="color: #C0C4CC;">--</span> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <!-- <el-table-column label="目的地址" align="center" prop="destinationAddress" show-overflow-tooltip /> --> |
| | | <el-table-column label="预计公里数" align="center" prop="estimatedDistance" width="120"> |
| | | <template slot-scope="scope"> |
| | | <span v-if="scope.row.estimatedDistance">{{ scope.row.estimatedDistance }} km</span> |
| | | <span v-else style="color: #C0C4CC;">--</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="计划开始时间" align="center" prop="plannedStartTime" width="180"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ parseTime(scope.row.plannedStartTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="计划结束时间" align="center" prop="plannedEndTime" width="180"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ parseTime(scope.row.plannedEndTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | |
| | | <el-table-column label="创建人" align="center" prop="creatorName" /> |
| | | <el-table-column label="执行人" align="center" prop="assigneeName" /> |
| | | |
| | | <el-table-column label="创建时间" align="center" prop="createTime" width="180"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span> |
| | |
| | | @click="handleView(scope.row)" |
| | | v-hasPermi="['task:general:query']" |
| | | >查看</el-button> |
| | | <el-button |
| | | <!-- <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)" |
| | | v-hasPermi="['task:general:edit']" |
| | | >修改</el-button> |
| | | <el-button |
| | | >修改</el-button> --> |
| | | <!-- <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-user" |
| | | @click="handleAssign(scope.row)" |
| | | v-hasPermi="['task:general:assign']" |
| | | >分配</el-button> |
| | | <el-button |
| | | >分配</el-button> --> |
| | | <!-- <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-refresh" |
| | | @click="handleStatusChange(scope.row)" |
| | | v-hasPermi="['task:general:status']" |
| | | >状态</el-button> |
| | | >状态</el-button> --> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | |
| | | <script> |
| | | import { listTask, getTask, delTask, addTask, updateTask, assignTask, changeTaskStatus } from "@/api/task"; |
| | | import { listUser } from "@/api/system/user"; |
| | | import { listBranchByOa } from "@/api/system/dept"; |
| | | |
| | | export default { |
| | | name: "Task", |
| | |
| | | total: 0, |
| | | // 任务管理表格数据 |
| | | taskList: [], |
| | | // 是否有急救转运任务(用于控制同步状态列显示) |
| | | hasEmergencyTask: false, |
| | | // 弹出层标题 |
| | | title: "", |
| | | // 是否显示弹出层 |
| | |
| | | taskCode: null, |
| | | taskType: null, |
| | | taskStatus: null, |
| | | deptId: null, |
| | | vehicleNo: null, |
| | | plannedStartTimeBegin: null, |
| | | plannedStartTimeEnd: null, |
| | | }, |
| | |
| | | statusForm: {}, |
| | | // 用户列表 |
| | | userList: [], |
| | | // 分公司列表 |
| | | branchList: [], |
| | | // 表单校验 |
| | | rules: { |
| | | taskType: [ |
| | |
| | | created() { |
| | | this.getList(); |
| | | this.getUserList(); |
| | | this.getBranchList(); |
| | | }, |
| | | methods: { |
| | | /** 查询任务管理列表 */ |
| | |
| | | listTask(this.queryParams).then(response => { |
| | | this.taskList = response.rows; |
| | | this.total = response.total; |
| | | // 检查是否有急救转运任务,用于控制同步状态相关列的显示 |
| | | this.hasEmergencyTask = this.taskList.some(task => task.taskType === 'EMERGENCY_TRANSFER'); |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | |
| | | this.userList = response.rows; |
| | | }); |
| | | }, |
| | | /** 查询分公司列表 */ |
| | | getBranchList() { |
| | | listBranchByOa().then(response => { |
| | | this.branchList = response.data || []; |
| | | }).catch(() => { |
| | | this.branchList = []; |
| | | }); |
| | | }, |
| | | // 取消按钮 |
| | | cancel() { |
| | | this.open = false; |