|
@@ -1,396 +1,410 @@
|
|
|
-<template>
|
|
|
- <div class="tabDiv">
|
|
|
- <!-- 搜索模块 -->
|
|
|
- <!--<div class="filter-container">
|
|
|
- <span>
|
|
|
- <span>{{$t("runCenter.searchForm.runStatus")}}:</span>
|
|
|
- <el-radio-group v-model="status" size="medium">
|
|
|
- <el-radio-button label="1,2">进行中</el-radio-button>
|
|
|
- <el-radio-button label="3">已完成</el-radio-button>
|
|
|
- </el-radio-group>
|
|
|
- </span>
|
|
|
- <span style="margin-left: 15px;">
|
|
|
- <span>{{$t("runCenter.searchForm.order")}}:</span>
|
|
|
- <el-input v-model="queryParams.model.orderNo" :placeholder='$t("common.pleaseEnter")' style="width: 160px;" size="medium"/>
|
|
|
- </span>
|
|
|
- <span style="margin-left: 15px;">
|
|
|
- <span>{{$t("runCenter.searchForm.plan")}}:</span>
|
|
|
- <el-input v-model="queryParams.model.planNo" :placeholder='$t("common.pleaseEnter")' style="width: 160px;" size="medium"/>
|
|
|
- </span>
|
|
|
- </div>-->
|
|
|
- <div class="filter-container">
|
|
|
- <!--<span>
|
|
|
- <span>{{$t("runCenter.searchForm.yujStatus")}}:</span>
|
|
|
- <el-radio-group v-model="queryParams.model.name4" size="medium">
|
|
|
- <el-radio-button label="" >全部</el-radio-button>
|
|
|
- <el-radio-button label="1">正常</el-radio-button>
|
|
|
- <el-radio-button label="0">异常</el-radio-button>
|
|
|
- </el-radio-group>
|
|
|
- </span>
|
|
|
- <span style="margin-left: 15px;">
|
|
|
- <span>{{$t("runCenter.searchForm.taskFinished")}}:</span>
|
|
|
- <el-date-picker
|
|
|
- v-model="queryParams.timeRange"
|
|
|
- type="daterange"
|
|
|
- :picker-options="pickerOptions"
|
|
|
- :range-separator='$t("common.separator")'
|
|
|
- :start-placeholder='$t("common.startTime")'
|
|
|
- :end-placeholder='$t("common.endTime")'
|
|
|
- format="yyyy-MM-dd"
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
- align="right"
|
|
|
- style="width: 260px;"
|
|
|
- >
|
|
|
- </el-date-picker>
|
|
|
- </span>-->
|
|
|
- <span>
|
|
|
- <span>零件名称:</span>
|
|
|
- <el-input v-model="queryParams.model.orderNo" :placeholder='$t("common.pleaseEnter")' style="width: 160px;" size="medium"/>
|
|
|
- </span>
|
|
|
- <span style="margin-left: 15px;">
|
|
|
- <el-button plain type="primary" icon="el-icon-search" size="medium" @click="search">
|
|
|
- {{ $t("table.search") }}
|
|
|
- </el-button>
|
|
|
- <el-button plain type="warning" icon="el-icon-refresh" size="medium" @click="reset">
|
|
|
- {{ $t("table.reset") }}
|
|
|
- </el-button>
|
|
|
- </span>
|
|
|
- </div>
|
|
|
-
|
|
|
- <!-- 功能按钮 -->
|
|
|
- <!--<el-row class="filter-container">
|
|
|
- <el-col>
|
|
|
- <el-button type="primary" icon="el-icon-refresh" size="medium" @click="changeBtn">{{$t("runCenter.buttons.changeBtn")}}</el-button>
|
|
|
- <el-button type="primary" icon="el-icon-video-pause" size="medium" @click="">{{$t("common.status.stop")}}</el-button>
|
|
|
- <el-button type="success" icon="el-icon-video-play" size="medium" @click="">{{$t("common.status.start")}}</el-button>
|
|
|
- <el-button type="danger" icon="el-icon-delete" size="medium" @click="">{{$t("common.toViod")}}</el-button>
|
|
|
- </el-col>
|
|
|
- </el-row>-->
|
|
|
-
|
|
|
- <el-table
|
|
|
- :key="tableKey"
|
|
|
- ref="table"
|
|
|
- v-loading="loading"
|
|
|
- :data="tableData.records"
|
|
|
- border
|
|
|
- fit
|
|
|
- row-key="id"
|
|
|
- style="width: 100%;"
|
|
|
- highlight-current-row
|
|
|
- @current-change="handleCurrentChange"
|
|
|
- >
|
|
|
- <!-- 序号 -->
|
|
|
- <el-table-column :label='$t("common.serialNo")' width="55px" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div>
|
|
|
- {{scope.$index+(queryParams.current - 1) * queryParams.size + 1}}
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <!-- 零件 -->
|
|
|
- <el-table-column prop="bomDesc" label='零件' :show-overflow-tooltip="true" width="120px"></el-table-column>
|
|
|
- <!-- 工序号 -->
|
|
|
- <el-table-column prop="procedureNo" label='工序号' align="center" width="90px"></el-table-column>
|
|
|
- <!-- 工序名称 -->
|
|
|
- <el-table-column prop="procedureDesc" label='工序名称' :show-overflow-tooltip="true" width="120px"></el-table-column>
|
|
|
- <!-- 任务状态 -->
|
|
|
- <el-table-column prop="status" :label='$t("runCenter.table.schedul.status")' :show-overflow-tooltip="true" width="120px">
|
|
|
- <template slot-scope="{ row }">
|
|
|
- <el-tag v-if="row.status == '1'" type="info">{{$t("runCenter.common.schedulStatus.noStart")}}</el-tag>
|
|
|
- <el-tag v-if="row.status == '2'" type="">{{$t("runCenter.common.schedulStatus.run")}}</el-tag>
|
|
|
- <el-tag v-if="row.status == '3'" type="success">{{$t("runCenter.common.schedulStatus.finished")}}</el-tag>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <!-- 执行位置 -->
|
|
|
- <el-table-column prop="resourceDesc" label='执行位置' :show-overflow-tooltip="true"></el-table-column>
|
|
|
- <!-- 执行者 -->
|
|
|
- <el-table-column prop="executorName" label='执行者' :show-overflow-tooltip="true" width="120px"></el-table-column>
|
|
|
- <!-- 计划时间 -->
|
|
|
- <el-table-column prop="expectStartTime" :label='$t("runCenter.table.schedul.planTime")' :show-overflow-tooltip="true" width="150px"></el-table-column>
|
|
|
- <!-- 额定工时 -->
|
|
|
- <el-table-column prop="procedureName" label='额定工时' :show-overflow-tooltip="true" width="120px"></el-table-column>
|
|
|
- <!-- 开始时间 -->
|
|
|
- <el-table-column prop="startTime" :label='$t("runCenter.table.schedul.actualTime")' width="150px"></el-table-column>
|
|
|
- <!-- 订单名称 -->
|
|
|
- <el-table-column prop="orderName" label='订单名称' :show-overflow-tooltip="true" width="150px"></el-table-column>
|
|
|
- <!-- 操作 -->
|
|
|
- <el-table-column
|
|
|
- :label="$t('table.operation')"
|
|
|
- fixed="right"
|
|
|
- align="center"
|
|
|
- column-key="operation"
|
|
|
- width="60px"
|
|
|
- >
|
|
|
- <template slot-scope="{ row }">
|
|
|
- <el-tooltip class="item" :content='$t("runCenter.common.viewTask")' effect="dark" placement="top-start">
|
|
|
- <i
|
|
|
- class="el-icon-view table-operation"
|
|
|
- style="color: #87d068;"
|
|
|
- @click="view(row)"
|
|
|
- />
|
|
|
- </el-tooltip>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
-
|
|
|
- <!-- 【分页】组件 -->
|
|
|
- <pagination
|
|
|
- v-show="tableData.total > 0"
|
|
|
- :limit.sync="queryParams.size"
|
|
|
- :page.sync="queryParams.current"
|
|
|
- :total="Number(tableData.total)"
|
|
|
- @pagination="fetch"
|
|
|
- />
|
|
|
-
|
|
|
- <!-- 【查看】组件 -->
|
|
|
- <task-view
|
|
|
- ref="view"
|
|
|
- :dialog-visible="tenantViewVisible"
|
|
|
- @close="viewClose"
|
|
|
- />
|
|
|
- </div>
|
|
|
-</template>
|
|
|
-
|
|
|
-
|
|
|
-<script>
|
|
|
-// 【分页】组件
|
|
|
-import Pagination from "@/components/Pagination"
|
|
|
-// 【查看】组件
|
|
|
-import TaskView from "./View"
|
|
|
-// 【任务管理】-API
|
|
|
-import taskMgrApi from "@/api/runManageCenter/taskMgr"
|
|
|
-// 列表查询的共通参数
|
|
|
-import { initQueryParams } from '@/utils/commons'
|
|
|
-export default {
|
|
|
- name: 'PprogTask',
|
|
|
- components: { Pagination, TaskView },
|
|
|
- props: {
|
|
|
- },
|
|
|
- data () {
|
|
|
- return {
|
|
|
- status:'1,2',
|
|
|
- titleData: [], // table的动态表头数据
|
|
|
- qiyongStatus: [], //状态
|
|
|
- queryParams: initQueryParams({}),
|
|
|
- loading: false,
|
|
|
- tenantViewVisible: false,
|
|
|
- tableKey: 0,
|
|
|
- tableData: {
|
|
|
- total: 0,
|
|
|
- records: []
|
|
|
- },
|
|
|
- currentRow: null, // 当前选择的行
|
|
|
- pickerOptions: {
|
|
|
- shortcuts: [{
|
|
|
- text: '最近一周',
|
|
|
- onClick(picker) {
|
|
|
- const end = new Date();
|
|
|
- const start = new Date();
|
|
|
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
|
|
- picker.$emit('pick', [start, end]);
|
|
|
- }
|
|
|
- }, {
|
|
|
- text: '最近一个月',
|
|
|
- onClick(picker) {
|
|
|
- const end = new Date();
|
|
|
- const start = new Date();
|
|
|
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
|
|
- picker.$emit('pick', [start, end]);
|
|
|
- }
|
|
|
- }, {
|
|
|
- text: '最近三个月',
|
|
|
- onClick(picker) {
|
|
|
- const end = new Date();
|
|
|
- const start = new Date();
|
|
|
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
|
|
- picker.$emit('pick', [start, end]);
|
|
|
- }
|
|
|
- }]
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
|
|
|
- created() {
|
|
|
- // 加载列表数据
|
|
|
- this.fetch()
|
|
|
- },
|
|
|
- // 每次进入,都加载
|
|
|
- activated(){
|
|
|
- // 加载列表数据
|
|
|
- this.fetch()
|
|
|
- },
|
|
|
- computed: {
|
|
|
- },
|
|
|
- mounted () {
|
|
|
- },
|
|
|
- methods: {
|
|
|
- view (row) {
|
|
|
- this.$refs.view.setTenant(row)
|
|
|
- this.tenantViewVisible = true
|
|
|
- },
|
|
|
- viewClose () {
|
|
|
- this.tenantViewVisible = false
|
|
|
- },
|
|
|
- // table的当前行值变化后
|
|
|
- handleCurrentChange(val) {
|
|
|
- // 设置当前行
|
|
|
- this.currentRow = val;
|
|
|
- },
|
|
|
- // 【切换列表样式】按钮-事件
|
|
|
- changeBtn(){
|
|
|
- this.$emit("success")
|
|
|
- },
|
|
|
- // 生产表头数据-函数
|
|
|
- creatTestData(){
|
|
|
- /*this.titleData = [
|
|
|
- {id: '100', text: '2020-10',
|
|
|
- children: [
|
|
|
- {id: '10001' text: '1', weekObj: {id: '100001', field: 'week', text: '日'}},
|
|
|
- {id: '10002', text: '2', weekObj: {id: '100002', field: 'week2', text: '一'}},
|
|
|
- {id: '10003', text: '3', weekObj: {id: '100003', field: 'week3', text: '二'}},
|
|
|
- {id: '10004', text: '4', weekObj: {id: '100004', field: 'week4', text: '三'}},
|
|
|
- {id: '10005', text: '5', weekObj: {id: '100005', field: 'week5', text: '四'}},
|
|
|
- {id: '10006', text: '6', weekObj: {id: '100006', field: 'week6', text: '五'}},
|
|
|
- {id: '10007', text: '7', weekObj: {id: '100007', field: 'week7', text: '六'}},
|
|
|
- {id: '10008', text: '8', weekObj: {id: '100008', field: 'week8', text: '一'}},
|
|
|
- {id: '10009', text: '9', weekObj: {id: '100009', field: 'week9', text: '二'}},
|
|
|
- {id: '100010', text: '10', weekObj: {id: '1000010', field: 'week10', text: '三'}},
|
|
|
- {id: '100011', text: '11', weekObj: {id: '1000011', field: 'week11', text: '四'}},
|
|
|
- {id: '100012', text: '12', weekObj: {id: '1000012', field: 'week12', text: '五'}}
|
|
|
- ]
|
|
|
- },
|
|
|
- {id: '102', text: '2020-11',
|
|
|
- children: [
|
|
|
- {id: '10201' text: '1', weekObj: {id: '102001', field: 'week', text: '日'}},
|
|
|
- {id: '10202', text: '2', weekObj: {id: '102002', field: 'week2', text: '一'}},
|
|
|
- {id: '10203', text: '3', weekObj: {id: '102003', field: 'week3', text: '二'}},
|
|
|
- {id: '10204', text: '4', weekObj: {id: '102004', field: 'week4', text: '三'}},
|
|
|
- {id: '10205', text: '5', weekObj: {id: '102005', field: 'week5', text: '四'}},
|
|
|
- {id: '10206', text: '6', weekObj: {id: '102006', field: 'week6', text: '五'}},
|
|
|
- {id: '10207', text: '7', weekObj: {id: '102007', field: 'week7', text: '六'}},
|
|
|
- {id: '10208', text: '8', weekObj: {id: '102008', field: 'week8', text: '一'}},
|
|
|
- {id: '10209', text: '9', weekObj: {id: '102009', field: 'week9', text: '二'}},
|
|
|
- {id: '102010', text: '10', weekObj: {id: '1020010', field: 'week10', text: '三'}},
|
|
|
- {id: '102011', text: '11', weekObj: {id: '1020011', field: 'week11', text: '四'}},
|
|
|
- {id: '102012', text: '12', weekObj: {id: '1020012', field: 'week12', text: '五'}}
|
|
|
- ]
|
|
|
- },
|
|
|
- {id: '103', text: '2020-12',
|
|
|
- children: [
|
|
|
- {id: '10301' text: '1', weekObj: {id: '103001', field: 'week', text: '日'}},
|
|
|
- {id: '10302', text: '2', weekObj: {id: '103002', field: 'week2', text: '一'}},
|
|
|
- {id: '10303', text: '3', weekObj: {id: '103003', field: 'week3', text: '二'}},
|
|
|
- {id: '10304', text: '4', weekObj: {id: '103004', field: 'week4', text: '三'}},
|
|
|
- {id: '10305', text: '5', weekObj: {id: '103005', field: 'week5', text: '四'}},
|
|
|
- {id: '10306', text: '6', weekObj: {id: '103006', field: 'week6', text: '五'}},
|
|
|
- {id: '10307', text: '7', weekObj: {id: '103007', field: 'week7', text: '六'}},
|
|
|
- {id: '10308', text: '8', weekObj: {id: '103008', field: 'week8', text: '一'}},
|
|
|
- {id: '10309', text: '9', weekObj: {id: '103009', field: 'week9', text: '二'}},
|
|
|
- {id: '103010', text: '10', weekObj: {id: '1030010', field: 'week10', text: '三'}},
|
|
|
- {id: '103011', text: '11', weekObj: {id: '1030011', field: 'week11', text: '四'}},
|
|
|
- {id: '103012', text: '12', weekObj: {id: '1030012', field: 'week12', text: '五'}}
|
|
|
- ]
|
|
|
- },
|
|
|
- ],*/
|
|
|
- // 生产30条数据
|
|
|
- let list = []
|
|
|
- for(let i = 0; i < 3; i++){
|
|
|
- list.push({
|
|
|
- id: '100' + i,
|
|
|
- text: "2020-1" + i,
|
|
|
- children: []
|
|
|
- })
|
|
|
- for(let j = 1; j < 25; j++){
|
|
|
- let week = ""
|
|
|
- if(j == 1 || j%7 == 0){
|
|
|
- week = "日"
|
|
|
- }
|
|
|
- if(j == 2 || j%7 == 1){
|
|
|
- week = "一"
|
|
|
- }
|
|
|
- if(j == 3 || j%7 == 2){
|
|
|
- week = "二"
|
|
|
- }
|
|
|
- if(j == 4 || j%7 == 3){
|
|
|
- week = "三"
|
|
|
- }
|
|
|
- if(j == 5 || j%7 == 4){
|
|
|
- week = "四"
|
|
|
- }
|
|
|
- if(j == 6 || j%7 == 5){
|
|
|
- week = "五"
|
|
|
- }
|
|
|
- if(j == 7 || j%7 == 6){
|
|
|
- week = "六"
|
|
|
- }
|
|
|
- list[i].children.push({
|
|
|
- id: '1000'+ j,
|
|
|
- text: ''+ j,
|
|
|
- weekObj: {
|
|
|
- id: '10000'+ j,
|
|
|
- field: 'week'+ j,
|
|
|
- text: week
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- // 赋值
|
|
|
- this.titleData = list
|
|
|
- console.log("表头数据:", this.titleData)
|
|
|
- },
|
|
|
- // tab点击-事件
|
|
|
- tabClick(e){
|
|
|
- // console.log("被选择的tab:", e.index)
|
|
|
- },
|
|
|
- setTenant (val) {
|
|
|
- if(val){
|
|
|
- this.tenant = { ...val }
|
|
|
- }
|
|
|
- },
|
|
|
- search () {
|
|
|
- this.fetch({
|
|
|
- ...this.queryParams
|
|
|
- })
|
|
|
- },
|
|
|
- reset () {
|
|
|
- this.queryParams = initQueryParams({})
|
|
|
- this.$refs.table.clearSort()
|
|
|
- this.$refs.table.clearFilter()
|
|
|
- this.search()
|
|
|
- },
|
|
|
- fetch (params = {}) {
|
|
|
- this.loading = true
|
|
|
- if (this.queryParams.timeRange) {
|
|
|
- this.queryParams.map.createTime_st = this.queryParams.timeRange[0]
|
|
|
- this.queryParams.map.createTime_ed = this.queryParams.timeRange[1]
|
|
|
- }
|
|
|
-
|
|
|
- this.queryParams.current = params.current ? params.current : this.queryParams.current
|
|
|
- this.queryParams.size = params.size ? params.size : this.queryParams.size
|
|
|
-
|
|
|
- this.queryParams.model.status = this.status
|
|
|
- // 固定参数
|
|
|
- this.queryParams.model.mulPlanStatus = '2';
|
|
|
- taskMgrApi.page(this.queryParams).then(response => {
|
|
|
- const res = response.data
|
|
|
- console.log("查看列表数据122:", res)
|
|
|
- if (res.isSuccess) {
|
|
|
- this.tableData = res.data
|
|
|
- }
|
|
|
- // eslint-disable-next-line no-return-assign
|
|
|
- }).finally(() => this.loading = false)
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-</script>
|
|
|
-<style type="text/css">
|
|
|
- .el-date-editor .el-range-separator{
|
|
|
- width: 10%;
|
|
|
- }
|
|
|
-</style>
|
|
|
-<style lang="scss" scoped>
|
|
|
- .tabDiv{
|
|
|
- margin: 10px;
|
|
|
- }
|
|
|
-</style>
|
|
|
+<template>
|
|
|
+ <div class="tabDiv">
|
|
|
+ <!-- 搜索模块 -->
|
|
|
+ <!--<div class="filter-container">
|
|
|
+ <span>
|
|
|
+ <span>{{$t("runCenter.searchForm.runStatus")}}:</span>
|
|
|
+ <el-radio-group v-model="status" size="medium">
|
|
|
+ <el-radio-button label="1,2">进行中</el-radio-button>
|
|
|
+ <el-radio-button label="3">已完成</el-radio-button>
|
|
|
+ </el-radio-group>
|
|
|
+ </span>
|
|
|
+ <span style="margin-left: 15px;">
|
|
|
+ <span>{{$t("runCenter.searchForm.order")}}:</span>
|
|
|
+ <el-input v-model="queryParams.model.orderNo" :placeholder='$t("common.pleaseEnter")' style="width: 160px;" size="medium"/>
|
|
|
+ </span>
|
|
|
+ <span style="margin-left: 15px;">
|
|
|
+ <span>{{$t("runCenter.searchForm.plan")}}:</span>
|
|
|
+ <el-input v-model="queryParams.model.planNo" :placeholder='$t("common.pleaseEnter")' style="width: 160px;" size="medium"/>
|
|
|
+ </span>
|
|
|
+ </div>-->
|
|
|
+ <div class="filter-container">
|
|
|
+ <!--<span>
|
|
|
+ <span>{{$t("runCenter.searchForm.yujStatus")}}:</span>
|
|
|
+ <el-radio-group v-model="queryParams.model.name4" size="medium">
|
|
|
+ <el-radio-button label="" >全部</el-radio-button>
|
|
|
+ <el-radio-button label="1">正常</el-radio-button>
|
|
|
+ <el-radio-button label="0">异常</el-radio-button>
|
|
|
+ </el-radio-group>
|
|
|
+ </span>
|
|
|
+ <span style="margin-left: 15px;">
|
|
|
+ <span>{{$t("runCenter.searchForm.taskFinished")}}:</span>
|
|
|
+ <el-date-picker
|
|
|
+ v-model="queryParams.timeRange"
|
|
|
+ type="daterange"
|
|
|
+ :picker-options="pickerOptions"
|
|
|
+ :range-separator='$t("common.separator")'
|
|
|
+ :start-placeholder='$t("common.startTime")'
|
|
|
+ :end-placeholder='$t("common.endTime")'
|
|
|
+ format="yyyy-MM-dd"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ align="right"
|
|
|
+ style="width: 260px;"
|
|
|
+ >
|
|
|
+ </el-date-picker>
|
|
|
+ </span>-->
|
|
|
+ <span>
|
|
|
+ <span>零件名称:</span>
|
|
|
+ <el-input v-model="queryParams.model.orderNo" :placeholder='$t("common.pleaseEnter")' style="width: 160px;" size="medium"/>
|
|
|
+ </span>
|
|
|
+ <span style="margin-left: 15px;">
|
|
|
+ <el-button plain type="primary" icon="el-icon-search" size="medium" @click="search">
|
|
|
+ {{ $t("table.search") }}
|
|
|
+ </el-button>
|
|
|
+ <el-button plain type="warning" icon="el-icon-refresh" size="medium" @click="reset">
|
|
|
+ {{ $t("table.reset") }}
|
|
|
+ </el-button>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 功能按钮 -->
|
|
|
+ <!--<el-row class="filter-container">
|
|
|
+ <el-col>
|
|
|
+ <el-button type="primary" icon="el-icon-refresh" size="medium" @click="changeBtn">{{$t("runCenter.buttons.changeBtn")}}</el-button>
|
|
|
+ <el-button type="primary" icon="el-icon-video-pause" size="medium" @click="">{{$t("common.status.stop")}}</el-button>
|
|
|
+ <el-button type="success" icon="el-icon-video-play" size="medium" @click="">{{$t("common.status.start")}}</el-button>
|
|
|
+ <el-button type="danger" icon="el-icon-delete" size="medium" @click="">{{$t("common.toViod")}}</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>-->
|
|
|
+
|
|
|
+ <el-table
|
|
|
+ :key="tableKey"
|
|
|
+ ref="table"
|
|
|
+ v-loading="loading"
|
|
|
+ :data="tableData.records"
|
|
|
+ border
|
|
|
+ fit
|
|
|
+ row-key="id"
|
|
|
+ style="width: 100%;"
|
|
|
+ highlight-current-row
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ >
|
|
|
+ <!-- 序号 -->
|
|
|
+ <el-table-column :label='$t("common.serialNo")' width="55px" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>
|
|
|
+ {{scope.$index+(queryParams.current - 1) * queryParams.size + 1}}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- 零件 -->
|
|
|
+ <el-table-column prop="bomDesc" label='零件' :show-overflow-tooltip="true" width="120px"></el-table-column>
|
|
|
+ <!-- 工序号 -->
|
|
|
+ <el-table-column prop="procedureNo" label='工序号' align="center" width="90px"></el-table-column>
|
|
|
+ <!-- 工序名称 -->
|
|
|
+ <el-table-column prop="procedureDesc" label='工序名称' :show-overflow-tooltip="true" width="120px"></el-table-column>
|
|
|
+ <!-- 任务状态 -->
|
|
|
+ <el-table-column prop="status" :label='$t("runCenter.table.schedul.status")' :show-overflow-tooltip="true" width="120px">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <el-tag v-if="row.status == '1'" type="info">{{$t("runCenter.common.schedulStatus.noStart")}}</el-tag>
|
|
|
+ <el-tag v-if="row.status == '2'" type="">{{$t("runCenter.common.schedulStatus.run")}}</el-tag>
|
|
|
+ <el-tag v-if="row.status == '3'" type="success">{{$t("runCenter.common.schedulStatus.finished")}}</el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- 执行位置 -->
|
|
|
+ <el-table-column prop="resourceDesc" label='执行位置' :show-overflow-tooltip="true"></el-table-column>
|
|
|
+ <!-- 执行者 -->
|
|
|
+ <el-table-column prop="executorName" label='执行者' :show-overflow-tooltip="true" width="120px"></el-table-column>
|
|
|
+ <!-- 计划时间 -->
|
|
|
+ <el-table-column prop="expectStartTime" :label='$t("runCenter.table.schedul.planTime")' :show-overflow-tooltip="true" width="150px"></el-table-column>
|
|
|
+ <!-- 额定工时 -->
|
|
|
+ <el-table-column prop="procedureName" label='额定工时' :show-overflow-tooltip="true" width="120px"></el-table-column>
|
|
|
+ <!-- 开始时间 -->
|
|
|
+ <el-table-column prop="startTime" :label='$t("runCenter.table.schedul.actualTime")' width="150px"></el-table-column>
|
|
|
+ <!-- 订单名称 -->
|
|
|
+ <el-table-column prop="orderName" label='订单名称' :show-overflow-tooltip="true" width="150px"></el-table-column>
|
|
|
+ <!-- 操作 -->
|
|
|
+ <el-table-column
|
|
|
+ :label="$t('table.operation')"
|
|
|
+ fixed="right"
|
|
|
+ align="center"
|
|
|
+ column-key="operation"
|
|
|
+ width="75px"
|
|
|
+ >
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <el-tooltip class="item" :content='$t("runCenter.common.viewTask")' effect="dark" placement="top-start">
|
|
|
+ <i
|
|
|
+ class="el-icon-view table-operation"
|
|
|
+ style="color: #87d068;"
|
|
|
+ @click="view(row)"
|
|
|
+ />
|
|
|
+ </el-tooltip>
|
|
|
+ <el-tooltip class="item" :content='$t("runCenter.common.viewTaskNode")' effect="dark" placement="top-start">
|
|
|
+ <i
|
|
|
+ class="el-icon-view table-operation"
|
|
|
+ style="color: #87d068;"
|
|
|
+ @click="viewTaskNode(row)"
|
|
|
+ />
|
|
|
+ </el-tooltip>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <!-- 【分页】组件 -->
|
|
|
+ <pagination
|
|
|
+ v-show="tableData.total > 0"
|
|
|
+ :limit.sync="queryParams.size"
|
|
|
+ :page.sync="queryParams.current"
|
|
|
+ :total="Number(tableData.total)"
|
|
|
+ @pagination="fetch"
|
|
|
+ />
|
|
|
+
|
|
|
+ <!-- 【查看】组件 -->
|
|
|
+ <task-view
|
|
|
+ ref="view"
|
|
|
+ :dialog-visible="tenantViewVisible"
|
|
|
+ @close="viewClose"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+
|
|
|
+<script>
|
|
|
+// 【分页】组件
|
|
|
+import Pagination from "@/components/Pagination"
|
|
|
+// 【查看】组件
|
|
|
+import TaskView from "./View"
|
|
|
+// 【任务管理】-API
|
|
|
+import taskMgrApi from "@/api/runManageCenter/taskMgr"
|
|
|
+// 列表查询的共通参数
|
|
|
+import { initQueryParams } from '@/utils/commons'
|
|
|
+export default {
|
|
|
+ name: 'PprogTask',
|
|
|
+ components: { Pagination, TaskView },
|
|
|
+ props: {
|
|
|
+ },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ status:'1,2',
|
|
|
+ titleData: [], // table的动态表头数据
|
|
|
+ qiyongStatus: [], //状态
|
|
|
+ queryParams: initQueryParams({}),
|
|
|
+ loading: false,
|
|
|
+ tenantViewVisible: false,
|
|
|
+ showTaskNode: false,
|
|
|
+ tableKey: 0,
|
|
|
+ tableData: {
|
|
|
+ total: 0,
|
|
|
+ records: []
|
|
|
+ },
|
|
|
+ currentRow: null, // 当前选择的行
|
|
|
+ pickerOptions: {
|
|
|
+ shortcuts: [{
|
|
|
+ text: '最近一周',
|
|
|
+ onClick(picker) {
|
|
|
+ const end = new Date();
|
|
|
+ const start = new Date();
|
|
|
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
|
|
+ picker.$emit('pick', [start, end]);
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ text: '最近一个月',
|
|
|
+ onClick(picker) {
|
|
|
+ const end = new Date();
|
|
|
+ const start = new Date();
|
|
|
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
|
|
+ picker.$emit('pick', [start, end]);
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ text: '最近三个月',
|
|
|
+ onClick(picker) {
|
|
|
+ const end = new Date();
|
|
|
+ const start = new Date();
|
|
|
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
|
|
+ picker.$emit('pick', [start, end]);
|
|
|
+ }
|
|
|
+ }]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
|
|
|
+ created() {
|
|
|
+ // 加载列表数据
|
|
|
+ this.fetch()
|
|
|
+ },
|
|
|
+ // 每次进入,都加载
|
|
|
+ activated(){
|
|
|
+ // 加载列表数据
|
|
|
+ this.fetch()
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ },
|
|
|
+ mounted () {
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ view (row) {
|
|
|
+ this.$refs.view.setTenant(row)
|
|
|
+ this.tenantViewVisible = true
|
|
|
+ this.showTaskNode = false;
|
|
|
+ },
|
|
|
+ viewTaskNode (row) {
|
|
|
+ this.$refs.view.setTenant(row)
|
|
|
+ this.tenantViewVisible = true
|
|
|
+ this.showTaskNode = true;
|
|
|
+ },
|
|
|
+ viewClose () {
|
|
|
+ this.tenantViewVisible = false
|
|
|
+ },
|
|
|
+ // table的当前行值变化后
|
|
|
+ handleCurrentChange(val) {
|
|
|
+ // 设置当前行
|
|
|
+ this.currentRow = val;
|
|
|
+ },
|
|
|
+ // 【切换列表样式】按钮-事件
|
|
|
+ changeBtn(){
|
|
|
+ this.$emit("success")
|
|
|
+ },
|
|
|
+ // 生产表头数据-函数
|
|
|
+ creatTestData(){
|
|
|
+ /*this.titleData = [
|
|
|
+ {id: '100', text: '2020-10',
|
|
|
+ children: [
|
|
|
+ {id: '10001' text: '1', weekObj: {id: '100001', field: 'week', text: '日'}},
|
|
|
+ {id: '10002', text: '2', weekObj: {id: '100002', field: 'week2', text: '一'}},
|
|
|
+ {id: '10003', text: '3', weekObj: {id: '100003', field: 'week3', text: '二'}},
|
|
|
+ {id: '10004', text: '4', weekObj: {id: '100004', field: 'week4', text: '三'}},
|
|
|
+ {id: '10005', text: '5', weekObj: {id: '100005', field: 'week5', text: '四'}},
|
|
|
+ {id: '10006', text: '6', weekObj: {id: '100006', field: 'week6', text: '五'}},
|
|
|
+ {id: '10007', text: '7', weekObj: {id: '100007', field: 'week7', text: '六'}},
|
|
|
+ {id: '10008', text: '8', weekObj: {id: '100008', field: 'week8', text: '一'}},
|
|
|
+ {id: '10009', text: '9', weekObj: {id: '100009', field: 'week9', text: '二'}},
|
|
|
+ {id: '100010', text: '10', weekObj: {id: '1000010', field: 'week10', text: '三'}},
|
|
|
+ {id: '100011', text: '11', weekObj: {id: '1000011', field: 'week11', text: '四'}},
|
|
|
+ {id: '100012', text: '12', weekObj: {id: '1000012', field: 'week12', text: '五'}}
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {id: '102', text: '2020-11',
|
|
|
+ children: [
|
|
|
+ {id: '10201' text: '1', weekObj: {id: '102001', field: 'week', text: '日'}},
|
|
|
+ {id: '10202', text: '2', weekObj: {id: '102002', field: 'week2', text: '一'}},
|
|
|
+ {id: '10203', text: '3', weekObj: {id: '102003', field: 'week3', text: '二'}},
|
|
|
+ {id: '10204', text: '4', weekObj: {id: '102004', field: 'week4', text: '三'}},
|
|
|
+ {id: '10205', text: '5', weekObj: {id: '102005', field: 'week5', text: '四'}},
|
|
|
+ {id: '10206', text: '6', weekObj: {id: '102006', field: 'week6', text: '五'}},
|
|
|
+ {id: '10207', text: '7', weekObj: {id: '102007', field: 'week7', text: '六'}},
|
|
|
+ {id: '10208', text: '8', weekObj: {id: '102008', field: 'week8', text: '一'}},
|
|
|
+ {id: '10209', text: '9', weekObj: {id: '102009', field: 'week9', text: '二'}},
|
|
|
+ {id: '102010', text: '10', weekObj: {id: '1020010', field: 'week10', text: '三'}},
|
|
|
+ {id: '102011', text: '11', weekObj: {id: '1020011', field: 'week11', text: '四'}},
|
|
|
+ {id: '102012', text: '12', weekObj: {id: '1020012', field: 'week12', text: '五'}}
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {id: '103', text: '2020-12',
|
|
|
+ children: [
|
|
|
+ {id: '10301' text: '1', weekObj: {id: '103001', field: 'week', text: '日'}},
|
|
|
+ {id: '10302', text: '2', weekObj: {id: '103002', field: 'week2', text: '一'}},
|
|
|
+ {id: '10303', text: '3', weekObj: {id: '103003', field: 'week3', text: '二'}},
|
|
|
+ {id: '10304', text: '4', weekObj: {id: '103004', field: 'week4', text: '三'}},
|
|
|
+ {id: '10305', text: '5', weekObj: {id: '103005', field: 'week5', text: '四'}},
|
|
|
+ {id: '10306', text: '6', weekObj: {id: '103006', field: 'week6', text: '五'}},
|
|
|
+ {id: '10307', text: '7', weekObj: {id: '103007', field: 'week7', text: '六'}},
|
|
|
+ {id: '10308', text: '8', weekObj: {id: '103008', field: 'week8', text: '一'}},
|
|
|
+ {id: '10309', text: '9', weekObj: {id: '103009', field: 'week9', text: '二'}},
|
|
|
+ {id: '103010', text: '10', weekObj: {id: '1030010', field: 'week10', text: '三'}},
|
|
|
+ {id: '103011', text: '11', weekObj: {id: '1030011', field: 'week11', text: '四'}},
|
|
|
+ {id: '103012', text: '12', weekObj: {id: '1030012', field: 'week12', text: '五'}}
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ ],*/
|
|
|
+ // 生产30条数据
|
|
|
+ let list = []
|
|
|
+ for(let i = 0; i < 3; i++){
|
|
|
+ list.push({
|
|
|
+ id: '100' + i,
|
|
|
+ text: "2020-1" + i,
|
|
|
+ children: []
|
|
|
+ })
|
|
|
+ for(let j = 1; j < 25; j++){
|
|
|
+ let week = ""
|
|
|
+ if(j == 1 || j%7 == 0){
|
|
|
+ week = "日"
|
|
|
+ }
|
|
|
+ if(j == 2 || j%7 == 1){
|
|
|
+ week = "一"
|
|
|
+ }
|
|
|
+ if(j == 3 || j%7 == 2){
|
|
|
+ week = "二"
|
|
|
+ }
|
|
|
+ if(j == 4 || j%7 == 3){
|
|
|
+ week = "三"
|
|
|
+ }
|
|
|
+ if(j == 5 || j%7 == 4){
|
|
|
+ week = "四"
|
|
|
+ }
|
|
|
+ if(j == 6 || j%7 == 5){
|
|
|
+ week = "五"
|
|
|
+ }
|
|
|
+ if(j == 7 || j%7 == 6){
|
|
|
+ week = "六"
|
|
|
+ }
|
|
|
+ list[i].children.push({
|
|
|
+ id: '1000'+ j,
|
|
|
+ text: ''+ j,
|
|
|
+ weekObj: {
|
|
|
+ id: '10000'+ j,
|
|
|
+ field: 'week'+ j,
|
|
|
+ text: week
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 赋值
|
|
|
+ this.titleData = list
|
|
|
+ console.log("表头数据:", this.titleData)
|
|
|
+ },
|
|
|
+ // tab点击-事件
|
|
|
+ tabClick(e){
|
|
|
+ // console.log("被选择的tab:", e.index)
|
|
|
+ },
|
|
|
+ setTenant (val) {
|
|
|
+ if(val){
|
|
|
+ this.tenant = { ...val }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ search () {
|
|
|
+ this.fetch({
|
|
|
+ ...this.queryParams
|
|
|
+ })
|
|
|
+ },
|
|
|
+ reset () {
|
|
|
+ this.queryParams = initQueryParams({})
|
|
|
+ this.$refs.table.clearSort()
|
|
|
+ this.$refs.table.clearFilter()
|
|
|
+ this.search()
|
|
|
+ },
|
|
|
+ fetch (params = {}) {
|
|
|
+ this.loading = true
|
|
|
+ if (this.queryParams.timeRange) {
|
|
|
+ this.queryParams.map.createTime_st = this.queryParams.timeRange[0]
|
|
|
+ this.queryParams.map.createTime_ed = this.queryParams.timeRange[1]
|
|
|
+ }
|
|
|
+
|
|
|
+ this.queryParams.current = params.current ? params.current : this.queryParams.current
|
|
|
+ this.queryParams.size = params.size ? params.size : this.queryParams.size
|
|
|
+
|
|
|
+ this.queryParams.model.status = this.status
|
|
|
+ // 固定参数
|
|
|
+ this.queryParams.model.mulPlanStatus = '2';
|
|
|
+ taskMgrApi.page(this.queryParams).then(response => {
|
|
|
+ const res = response.data
|
|
|
+ console.log("查看列表数据122:", res)
|
|
|
+ if (res.isSuccess) {
|
|
|
+ this.tableData = res.data
|
|
|
+ }
|
|
|
+ // eslint-disable-next-line no-return-assign
|
|
|
+ }).finally(() => this.loading = false)
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+<style type="text/css">
|
|
|
+ .el-date-editor .el-range-separator{
|
|
|
+ width: 10%;
|
|
|
+ }
|
|
|
+</style>
|
|
|
+<style lang="scss" scoped>
|
|
|
+ .tabDiv{
|
|
|
+ margin: 10px;
|
|
|
+ }
|
|
|
+</style>
|