|
@@ -1,295 +1,345 @@
|
|
|
-<template>
|
|
|
- <div class="tabDiv">
|
|
|
- <!--<p>共2个订单,5个计划</p>-->
|
|
|
- <el-table
|
|
|
- :key="tableKey"
|
|
|
- ref="table"
|
|
|
- v-loading="loading"
|
|
|
- :data="tableData.records"
|
|
|
- border
|
|
|
- fit
|
|
|
- row-key="id"
|
|
|
- style="width: 100%;"
|
|
|
- >
|
|
|
- <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="orderNo" :label='$t("runCenter.table.plan.orderNo")' :show-overflow-tooltip="true" width="170"></el-table-column>
|
|
|
- <!-- 计划编号 -->
|
|
|
- <el-table-column prop="planNo" :label='$t("runCenter.table.plan.planNo")' :show-overflow-tooltip="true" width="150"></el-table-column>
|
|
|
- <!-- 计划开始日期 -->
|
|
|
- <el-table-column prop="startTime" :label='$t("runCenter.table.plan.planStart")' :show-overflow-tooltip="true" width="160"></el-table-column>
|
|
|
- <!-- 计划完成日期 -->
|
|
|
- <el-table-column prop="endTime" :label='$t("runCenter.table.plan.planEnd")' :show-overflow-tooltip="true" width="160"></el-table-column>
|
|
|
- <!-- 产品 -->
|
|
|
- <el-table-column prop="bomDesc" :label='$t("runCenter.table.plan.bomName")' :show-overflow-tooltip="true" width="150"></el-table-column>
|
|
|
- <!-- 数量 -->
|
|
|
- <el-table-column prop="planBomNum" :label='$t("runCenter.table.plan.planNums")' :show-overflow-tooltip="true" width="120"></el-table-column>
|
|
|
- <!-- 计划状态 -->
|
|
|
- <el-table-column prop="planStatus" :label='$t("runCenter.table.plan.planStatus")' :show-overflow-tooltip="true" width="120" align="center">
|
|
|
- <template slot-scope="{ row }">
|
|
|
- <el-tag v-if="row.planStatus == '1'" type="info">{{$t("runCenter.common.planStatus.one")}}</el-tag>
|
|
|
- <el-tag v-if="row.planStatus == '2'" type="">{{$t("runCenter.common.planStatus.two")}}</el-tag>
|
|
|
- <el-tag v-if="row.planStatus == '3'" type="success">{{$t("runCenter.common.planStatus.three")}}</el-tag>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <!-- 计划进度 -->
|
|
|
- <el-table-column prop="process" :label='$t("runCenter.table.plan.planProgress")' :show-overflow-tooltip="true" width="200">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!--<el-progress v-if="scope.row.jindu <= 25" :text-inside="true" :stroke-width="24" :percentage="scope.row.jindu" status="exception"></el-progress>
|
|
|
- <el-progress v-if="scope.row.jindu > 25 && scope.row.jindu <= 50" :text-inside="true" :stroke-width="24" :percentage="scope.row.jindu" status="warning"></el-progress>-->
|
|
|
- <el-progress :text-inside="true" :stroke-width="24" :percentage="scope.row.process"></el-progress>
|
|
|
- <!--<el-progress v-if="scope.row.jindu > 80" :text-inside="true" :stroke-width="24" :percentage="scope.row.jindu" status="success"></el-progress>-->
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <!-- 排产 -->
|
|
|
- <el-table-column prop="schedulingStatus" :label='$t("runCenter.table.plan.schedulingStatus")' :show-overflow-tooltip="true" width="120" align="center">
|
|
|
- <template slot-scope="{ row }">
|
|
|
- <el-tag v-if="row.schedulingStatus == '1'" type="info">{{$t("runCenter.common.schedulingStatus.noStart")}}</el-tag>
|
|
|
- <el-tag v-if="row.schedulingStatus == '2'">{{$t("runCenter.common.schedulingStatus.run")}}</el-tag>
|
|
|
- <el-tag v-if="row.schedulingStatus == '3'" type="success">{{$t("runCenter.common.schedulingStatus.finished")}}</el-tag>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <!-- 生产 -->
|
|
|
- <el-table-column prop="produceStatus" :label='$t("runCenter.table.plan.produceStatus")' :show-overflow-tooltip="true" width="120" align="center">
|
|
|
- <template slot-scope="{ row }">
|
|
|
- <el-tag v-if="row.produceStatus == '1'" type="info">{{$t("runCenter.common.produceStatus.noStart")}}</el-tag>
|
|
|
- <el-tag v-if="row.produceStatus == '2'">{{$t("runCenter.common.produceStatus.run")}}</el-tag>
|
|
|
- <el-tag v-if="row.produceStatus == '3'" type="warning">{{$t("runCenter.common.produceStatus.panse")}}</el-tag>
|
|
|
- <el-tag v-if="row.produceStatus == '4'" type="success">{{$t("runCenter.common.produceStatus.finished")}}</el-tag>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <!-- 优先级 -->
|
|
|
- <el-table-column prop="prority" :label='$t("runCenter.table.plan.priority")' :show-overflow-tooltip="true" width="120"></el-table-column>
|
|
|
- <!-- 生产节拍 -->
|
|
|
- <el-table-column prop="rhythmType" :label='$t("runCenter.table.plan.rhythmType")' :show-overflow-tooltip="true" width="120" align="center">
|
|
|
- <template slot-scope="{ row }">
|
|
|
- <el-tag v-if="row.rhythmType == '1'" type="success">{{$t("runCenter.common.rhythmType.auto")}}</el-tag>
|
|
|
- <el-tag v-if="row.rhythmType == '2'">{{$t("runCenter.common.rhythmType.myself")}}</el-tag>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <!-- 生产单元 -->
|
|
|
- <el-table-column prop="zoenDesc" :label='$t("runCenter.table.plan.zoenDesc")' :show-overflow-tooltip="true" width="120"></el-table-column>
|
|
|
- <!-- 审核状态 -->
|
|
|
- <el-table-column prop="auditStatus" :label='$t("runCenter.table.plan.auditStatus")' align="center" width="90px">
|
|
|
- <template slot-scope="{ row }">
|
|
|
- <el-tag v-if="row.auditStatus == '1'" type="info">{{$t("common.audio.daiAudio")}}</el-tag>
|
|
|
- <el-tag v-if="row.auditStatus == '2'" type="success">{{$t("common.audio.audioOk")}}</el-tag>
|
|
|
- <el-tag v-if="row.auditStatus == '3'" type="danger">{{$t("common.audio.aduioFail")}}</el-tag>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <!-- 启用状态 -->
|
|
|
- <el-table-column prop="status" :label='$t("runCenter.table.plan.status")' :show-overflow-tooltip="true" width="120" align="center">
|
|
|
- <template slot-scope="{ row }">
|
|
|
- <el-tag v-if="row.status == '1'" type="success">{{$t("common.status.valid")}}</el-tag>
|
|
|
- <el-tag v-if="row.status == '0'" type="danger">{{$t("common.status.stop")}}</el-tag>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <!-- 创建时间 -->
|
|
|
- <el-table-column prop="createTime" :label='$t("runCenter.table.plan.createTime")' width="160px"></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"
|
|
|
- />
|
|
|
- </div>
|
|
|
-</template>
|
|
|
-
|
|
|
-
|
|
|
-<script>
|
|
|
-// 【分页】组件
|
|
|
-import Pagination from "@/components/Pagination"
|
|
|
-// 【仓库类型管理】-API
|
|
|
-import warehouseTypeMgrApi from "@/api/modelingCenter/warehouseTypeMgr"
|
|
|
-// 【订单管理】-API
|
|
|
-import orderMgrApi from "@/api/runManageCenter/orderMgr"
|
|
|
-// 【计划管理】-API
|
|
|
-import planMgrApi from "@/api/runManageCenter/planMgr"
|
|
|
-// 列表查询的共通参数
|
|
|
-import { initQueryParams } from '@/utils/commons'
|
|
|
-export default {
|
|
|
- name: 'PprogTask',
|
|
|
- components: { Pagination },
|
|
|
- props: {
|
|
|
- },
|
|
|
- data () {
|
|
|
- return {
|
|
|
- titleData: [], // table的动态表头数据
|
|
|
- qiyongStatus: [], //状态
|
|
|
- queryParams: initQueryParams({}),
|
|
|
- loading: false,
|
|
|
- tableKey: 0,
|
|
|
- tableData: {
|
|
|
- total: 0
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
|
|
|
- /*created() {
|
|
|
- // 加载表头数据
|
|
|
- this.creatTestData()
|
|
|
- // 加载列表数据
|
|
|
- this.fetch()
|
|
|
- },*/
|
|
|
- // 每次进入,都加载
|
|
|
- activated(){
|
|
|
- // 加载表头数据
|
|
|
- this.creatTestData()
|
|
|
- // 加载列表数据
|
|
|
- this.fetch()
|
|
|
- },
|
|
|
- computed: {
|
|
|
- jinduNums(){
|
|
|
- let num = Math.random()*100
|
|
|
- return parseFloat(num.toFixed(2))
|
|
|
- }
|
|
|
- },
|
|
|
- mounted () {
|
|
|
- },
|
|
|
- methods: {
|
|
|
- // 生产表头数据-函数
|
|
|
- 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 }
|
|
|
- }
|
|
|
- },
|
|
|
- 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
|
|
|
- // 查询必须参数:进行中(当审核完成的时候,同时设置orderstaut=2)
|
|
|
- this.queryParams.model.orderProduceStatus = '1,2'
|
|
|
- planMgrApi.page(this.queryParams).then(response => {
|
|
|
- const res = response.data
|
|
|
- if (res.isSuccess) {
|
|
|
- this.tableData = res.data
|
|
|
- }
|
|
|
- // eslint-disable-next-line no-return-assign
|
|
|
- }).finally(() => this.loading = false)
|
|
|
- },
|
|
|
- }
|
|
|
-}
|
|
|
-</script>
|
|
|
-
|
|
|
-<style lang="scss" scoped>
|
|
|
- .tabDiv{
|
|
|
- margin: 10px;
|
|
|
- }
|
|
|
+<template>
|
|
|
+ <div class="tabDiv">
|
|
|
+ <!--<p>共2个订单,5个计划</p>-->
|
|
|
+ <el-table
|
|
|
+ :key="tableKey"
|
|
|
+ ref="table"
|
|
|
+ v-loading="loading"
|
|
|
+ :data="tableData.records"
|
|
|
+ border
|
|
|
+ fit
|
|
|
+ row-key="id"
|
|
|
+ style="width: 100%;"
|
|
|
+ >
|
|
|
+ <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="orderNo" :label='$t("runCenter.table.plan.orderNo")' :show-overflow-tooltip="true" width="170"></el-table-column>
|
|
|
+ <!-- 计划编号 -->
|
|
|
+ <el-table-column prop="planNo" :label='$t("runCenter.table.plan.planNo")' :show-overflow-tooltip="true" width="150"></el-table-column>
|
|
|
+ <!-- 计划开始日期 -->
|
|
|
+ <el-table-column prop="startTime" :label='$t("runCenter.table.plan.planStart")' :show-overflow-tooltip="true" width="160"></el-table-column>
|
|
|
+ <!-- 计划完成日期 -->
|
|
|
+ <el-table-column prop="endTime" :label='$t("runCenter.table.plan.planEnd")' :show-overflow-tooltip="true" width="160"></el-table-column>
|
|
|
+ <!-- 产品 -->
|
|
|
+ <el-table-column prop="bomDesc" :label='$t("runCenter.table.plan.bomName")' :show-overflow-tooltip="true" width="150"></el-table-column>
|
|
|
+ <!-- 数量 -->
|
|
|
+ <el-table-column prop="planBomNum" :label='$t("runCenter.table.plan.planNums")' :show-overflow-tooltip="true" width="120"></el-table-column>
|
|
|
+ <!-- 计划状态 -->
|
|
|
+ <el-table-column prop="planStatus" :label='$t("runCenter.table.plan.planStatus")' :show-overflow-tooltip="true" width="120" align="center">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <el-tag v-if="row.planStatus == '1'" type="info">{{$t("runCenter.common.planStatus.one")}}</el-tag>
|
|
|
+ <el-tag v-if="row.planStatus == '2'" type="">{{$t("runCenter.common.planStatus.two")}}</el-tag>
|
|
|
+ <el-tag v-if="row.planStatus == '3'" type="success">{{$t("runCenter.common.planStatus.three")}}</el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- 计划进度 -->
|
|
|
+ <el-table-column prop="process" :label='$t("runCenter.table.plan.planProgress")' :show-overflow-tooltip="true" width="200">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <!--<el-progress v-if="scope.row.jindu <= 25" :text-inside="true" :stroke-width="24" :percentage="scope.row.jindu" status="exception"></el-progress>
|
|
|
+ <el-progress v-if="scope.row.jindu > 25 && scope.row.jindu <= 50" :text-inside="true" :stroke-width="24" :percentage="scope.row.jindu" status="warning"></el-progress>-->
|
|
|
+ <el-progress :text-inside="true" :stroke-width="24" :percentage="scope.row.process"></el-progress>
|
|
|
+ <!--<el-progress v-if="scope.row.jindu > 80" :text-inside="true" :stroke-width="24" :percentage="scope.row.jindu" status="success"></el-progress>-->
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- 排产 -->
|
|
|
+ <el-table-column prop="schedulingStatus" :label='$t("runCenter.table.plan.schedulingStatus")' :show-overflow-tooltip="true" width="120" align="center">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <el-tag v-if="row.schedulingStatus == '1'" type="info">{{$t("runCenter.common.schedulingStatus.noStart")}}</el-tag>
|
|
|
+ <el-tag v-if="row.schedulingStatus == '2'">{{$t("runCenter.common.schedulingStatus.run")}}</el-tag>
|
|
|
+ <el-tag v-if="row.schedulingStatus == '3'" type="success">{{$t("runCenter.common.schedulingStatus.finished")}}</el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- 生产 -->
|
|
|
+ <el-table-column prop="produceStatus" :label='$t("runCenter.table.plan.produceStatus")' :show-overflow-tooltip="true" width="120" align="center">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <el-tag v-if="row.produceStatus == '1'" type="info">{{$t("runCenter.common.produceStatus.noStart")}}</el-tag>
|
|
|
+ <el-tag v-if="row.produceStatus == '2'">{{$t("runCenter.common.produceStatus.run")}}</el-tag>
|
|
|
+ <el-tag v-if="row.produceStatus == '3'" type="warning">{{$t("runCenter.common.produceStatus.panse")}}</el-tag>
|
|
|
+ <el-tag v-if="row.produceStatus == '4'" type="success">{{$t("runCenter.common.produceStatus.finished")}}</el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- 优先级 -->
|
|
|
+ <el-table-column prop="prority" :label='$t("runCenter.table.plan.priority")' :show-overflow-tooltip="true" width="120"></el-table-column>
|
|
|
+ <!-- 生产节拍 -->
|
|
|
+ <el-table-column prop="rhythmType" :label='$t("runCenter.table.plan.rhythmType")' :show-overflow-tooltip="true" width="120" align="center">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <el-tag v-if="row.rhythmType == '1'" type="success">{{$t("runCenter.common.rhythmType.auto")}}</el-tag>
|
|
|
+ <el-tag v-if="row.rhythmType == '2'">{{$t("runCenter.common.rhythmType.myself")}}</el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- 生产单元 -->
|
|
|
+ <el-table-column prop="zoenDesc" :label='$t("runCenter.table.plan.zoenDesc")' :show-overflow-tooltip="true" width="120"></el-table-column>
|
|
|
+ <!-- 审核状态 -->
|
|
|
+ <el-table-column prop="auditStatus" :label='$t("runCenter.table.plan.auditStatus")' align="center" width="90px">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <el-tag v-if="row.auditStatus == '1'" type="info">{{$t("common.audio.daiAudio")}}</el-tag>
|
|
|
+ <el-tag v-if="row.auditStatus == '2'" type="success">{{$t("common.audio.audioOk")}}</el-tag>
|
|
|
+ <el-tag v-if="row.auditStatus == '3'" type="danger">{{$t("common.audio.aduioFail")}}</el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- 启用状态 -->
|
|
|
+ <el-table-column prop="status" :label='$t("runCenter.table.plan.status")' :show-overflow-tooltip="true" width="120" align="center">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <el-tag v-if="row.status == '1'" type="success">{{$t("common.status.valid")}}</el-tag>
|
|
|
+ <el-tag v-if="row.status == '0'" type="danger">{{$t("common.status.stop")}}</el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- 创建时间 -->
|
|
|
+ <el-table-column prop="createTime" :label='$t("runCenter.table.plan.createTime")' width="160px"></el-table-column>
|
|
|
+ <!-- 操作 -->
|
|
|
+ <el-table-column
|
|
|
+ :label="$t('table.operation')"
|
|
|
+ fixed="right"
|
|
|
+ align="center"
|
|
|
+ column-key="operation"
|
|
|
+ width="100px"
|
|
|
+ >
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <el-tooltip class="item" :content='$t("runCenter.common.chouqian")' effect="dark" placement="top-start">
|
|
|
+ <a @click="myDraw(row)" style="color: #2db7f5;">{{ $t("runCenter.common.chouqian") }}</a>
|
|
|
+ </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"
|
|
|
+ />
|
|
|
+
|
|
|
+ <!-- [我的抽签]的组件 -->
|
|
|
+ <my-draw
|
|
|
+ ref="edit"
|
|
|
+ :dialog-visible="dialog.isVisible"
|
|
|
+ :title="dialog.title"
|
|
|
+ @close="editClose"
|
|
|
+ @success="editSuccess"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+
|
|
|
+<script>
|
|
|
+ // 选择【我的抽签】组件
|
|
|
+ import MyDraw from "./MyDraw"
|
|
|
+ // 【分页】组件
|
|
|
+ import Pagination from "@/components/Pagination"
|
|
|
+ // 【仓库类型管理】-API
|
|
|
+ import warehouseTypeMgrApi from "@/api/modelingCenter/warehouseTypeMgr"
|
|
|
+ // 【订单管理】-API
|
|
|
+ import orderMgrApi from "@/api/runManageCenter/orderMgr"
|
|
|
+ // 【计划管理】-API
|
|
|
+ import planMgrApi from "@/api/runManageCenter/planMgr"
|
|
|
+ // 列表查询的共通参数
|
|
|
+ import { initQueryParams } from '@/utils/commons'
|
|
|
+export default {
|
|
|
+ name: 'PprogTask',
|
|
|
+ components: { Pagination, MyDraw },
|
|
|
+ props: {
|
|
|
+ },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ dialog: {
|
|
|
+ isVisible: false,
|
|
|
+ title: ""
|
|
|
+ },
|
|
|
+ titleData: [], // table的动态表头数据
|
|
|
+ qiyongStatus: [], //状态
|
|
|
+ queryParams: initQueryParams({}),
|
|
|
+ loading: false,
|
|
|
+ tableKey: 0,
|
|
|
+ tableData: {
|
|
|
+ total: 0
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
|
|
|
+ /*created() {
|
|
|
+ // 加载表头数据
|
|
|
+ this.creatTestData()
|
|
|
+ // 加载列表数据
|
|
|
+ this.fetch()
|
|
|
+ },*/
|
|
|
+ // 每次进入,都加载
|
|
|
+ activated(){
|
|
|
+ // 加载表头数据
|
|
|
+ this.creatTestData()
|
|
|
+ // 加载列表数据
|
|
|
+ this.fetch()
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ jinduNums(){
|
|
|
+ let num = Math.random()*100
|
|
|
+ return parseFloat(num.toFixed(2))
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted () {
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 生产表头数据-函数
|
|
|
+ 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 }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 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
|
|
|
+ // 查询必须参数:进行中(当审核完成的时候,同时设置orderstaut=2)
|
|
|
+ this.queryParams.model.orderProduceStatus = '1,2'
|
|
|
+ planMgrApi.page(this.queryParams).then(response => {
|
|
|
+ const res = response.data
|
|
|
+ if (res.isSuccess) {
|
|
|
+ this.tableData = res.data
|
|
|
+ }
|
|
|
+ // eslint-disable-next-line no-return-assign
|
|
|
+ }).finally(() => this.loading = false)
|
|
|
+ },
|
|
|
+
|
|
|
+ // 【我的抽签】按钮-事件
|
|
|
+ myDraw(row) {
|
|
|
+ this.$refs.edit.type = "edit"
|
|
|
+ this.dialog.title = this.$t("runCenter.common.addBtn")
|
|
|
+ this.dialog.isVisible = true
|
|
|
+ },
|
|
|
+
|
|
|
+ // 【我的抽签-修改】弹出框,关闭
|
|
|
+ editClose () {
|
|
|
+ this.dialog.isVisible = false
|
|
|
+ },
|
|
|
+
|
|
|
+ // 【我的抽签-修改】弹出框,确定事件
|
|
|
+ editSuccess (arr) {
|
|
|
+ console.log("【我的抽签-修改】:", arr);
|
|
|
+ // 合并当前数组,和新增的数组
|
|
|
+ // let list = [...this.tableData, ...arr]
|
|
|
+ // 去除数组中重复的数据
|
|
|
+ // this.tableData = arrReduce(list, "id")
|
|
|
+ },
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+ .tabDiv{
|
|
|
+ margin: 10px;
|
|
|
+ }
|
|
|
</style>
|