|
@@ -1,966 +1,966 @@
|
|
|
-<template>
|
|
|
- <div class="app-container">
|
|
|
- <!-- 搜索模块 -->
|
|
|
- <div class="filter-container">
|
|
|
- <!-- 零件名称 -->
|
|
|
- <span>
|
|
|
- <span>{{$t("runCenter.searchForm.bomName")}}:</span>
|
|
|
- <el-input v-model="queryParams.model.bomName" :placeholder='$t("common.pleaseEnter")' style="width: 120px;" size="medium"/>
|
|
|
- </span>
|
|
|
- <!-- 订单名称 -->
|
|
|
- <span style="margin-left: 15px;">
|
|
|
- <span>{{$t("runCenter.searchForm.orderName")}}:</span>
|
|
|
- <el-input v-model="queryParams.model.orderName" :placeholder='$t("common.pleaseEnter")' style="width: 120px;" size="medium"/>
|
|
|
- </span>
|
|
|
- <span style="margin-left: 15px;">
|
|
|
- <span>{{$t("runCenter.searchForm.deliveryTime")}}:</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">
|
|
|
- </el-date-picker>
|
|
|
- </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-data-analysis" size="medium" v-has-permission="['order:checkCuttingTool']" @click="checkCuttingTool">{{$t("runCenter.buttons.checkCuttingTool")}}</el-button>
|
|
|
- <!--<el-button type="primary" icon="el-icon-finished" size="medium" v-has-permission="['order:onebtn']" @click="viewPg">{{$t("runCenter.buttons.onebtn")}}</el-button>
|
|
|
- <el-button type="success" icon="el-icon-finished" size="medium" v-has-permission="['order:gostBtn']" @click="editOne">{{$t("runCenter.buttons.gostBtn")}}</el-button>-->
|
|
|
- <!-- 更多 -->
|
|
|
- <el-dropdown v-has-permission="['order:more']" @command="handleCommand" trigger="click">
|
|
|
- <el-button type="primary" size="medium">
|
|
|
- {{$t("table.more")}}<i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
- </el-button>
|
|
|
- <el-dropdown-menu slot="dropdown">
|
|
|
- <el-dropdown-item command="priority" v-has-permission="['order:priority']">{{$t("runCenter.buttons.priority")}}</el-dropdown-item>
|
|
|
- <el-dropdown-item command="production" v-has-permission="['order:production']">{{$t("runCenter.buttons.production")}}</el-dropdown-item>
|
|
|
- <el-dropdown-item command="stop" v-has-permission="['order:pause']">{{$t("common.status.stop")}}</el-dropdown-item>
|
|
|
- <el-dropdown-item command="start" v-has-permission="['order:enable']">{{$t("common.status.valid")}}</el-dropdown-item>
|
|
|
- <el-dropdown-item command="del" v-has-permission="['order:delete']">{{$t("common.delete")}}</el-dropdown-item>
|
|
|
- </el-dropdown-menu>
|
|
|
- </el-dropdown>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
-
|
|
|
- <!-- 列表数据 -->
|
|
|
- <el-table
|
|
|
- :key="tableKey"
|
|
|
- ref="table"
|
|
|
- v-loading="loading"
|
|
|
- :data="tableData.records"
|
|
|
- border
|
|
|
- fit
|
|
|
- row-key="id"
|
|
|
- style="width: 100%;"
|
|
|
- @selection-change="onSelectChange"
|
|
|
- @cell-click="cellClick"
|
|
|
- >
|
|
|
- <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 align="center" type="selection" width="50" :reserve-selection="true" />
|
|
|
- <!-- 订单名称 -->
|
|
|
- <el-table-column prop="orderName" :label='$t("runCenter.table.oder.orderName")' :show-overflow-tooltip="true" width="120px"></el-table-column>
|
|
|
- <!-- 订单编号 -->
|
|
|
- <!--<el-table-column prop="orderNo" :label='$t("runCenter.table.oder.orderNo")' :show-overflow-tooltip="true" width="120px"></el-table-column>-->
|
|
|
- <!-- 交货日期 -->
|
|
|
- <el-table-column prop="deliveryTime" :label='$t("runCenter.table.oder.deliveryTime")' :show-overflow-tooltip="true" width="120px"></el-table-column>
|
|
|
- <!-- 来源 -->
|
|
|
- <el-table-column prop="source" :label='$t("runCenter.table.oder.source")' :show-overflow-tooltip="true" width="80px">
|
|
|
- <template slot-scope="{ row }">
|
|
|
- <el-tag v-if="row.source == '1'">{{$t("runCenter.common.source.self")}}</el-tag>
|
|
|
- <el-tag v-if="row.source == '2'" type="success">{{$t("runCenter.common.source.out")}}</el-tag>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <!-- 零件 -->
|
|
|
- <el-table-column prop="bomName" :label='$t("runCenter.table.oder.bomName")' :show-overflow-tooltip="true" width="120px"></el-table-column>
|
|
|
- <!-- 订单状态 -->
|
|
|
- <el-table-column prop="orderStatus" :label='$t("runCenter.table.oder.orderStatus")' align="center" width="90px">
|
|
|
- <template slot-scope="{ row }">
|
|
|
- <el-tag v-if="row.orderStatus == '0'" type="info">{{$t("runCenter.common.orderStatus.zero")}}</el-tag>
|
|
|
- <el-tag v-if="row.orderStatus == '1'" type="warn">{{$t("runCenter.common.orderStatus.one")}}</el-tag>
|
|
|
- <el-tag v-if="row.orderStatus == '2'" type="success">{{$t("runCenter.common.orderStatus.two")}}</el-tag>
|
|
|
- <el-tag v-if="row.orderStatus == '3'" type="">{{$t("runCenter.common.orderStatus.three")}}</el-tag>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <!-- 生产节拍 -->
|
|
|
- <el-table-column prop="rhythmType" :label='$t("runCenter.table.oder.rhythmType")' :show-overflow-tooltip="true" width="100px">
|
|
|
- <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.oder.zoenDesc")' :show-overflow-tooltip="true" width="100px"></el-table-column>
|
|
|
- <!-- 计划 -->
|
|
|
- <el-table-column prop="planStatus" :label='$t("runCenter.table.oder.planStatus")' :show-overflow-tooltip="true" width="100px">
|
|
|
- <template slot-scope="{ row }">
|
|
|
- <el-tag v-if="row.planStatus == '1'" type="info">{{$t("runCenter.common.orderPlanStatus.noStart")}}</el-tag>
|
|
|
- <el-tag v-if="row.planStatus == '2'">{{$t("runCenter.common.orderPlanStatus.run")}}</el-tag>
|
|
|
- <el-tag v-if="row.planStatus == '3'" type="success">{{$t("runCenter.common.orderPlanStatus.finished")}}</el-tag>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <!-- 排产 -->
|
|
|
- <el-table-column prop="schedulingStatus" :label='$t("runCenter.table.oder.schedulingStatus")' :show-overflow-tooltip="true" width="100px">
|
|
|
- <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.oder.produceStatus")' :show-overflow-tooltip="true" width="100px">
|
|
|
- <template slot-scope="{ row }">
|
|
|
- <el-tag v-if="row.produceStatus == '0'" type="warning">{{$t("runCenter.common.produceStatus.panse")}}</el-tag>
|
|
|
- <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="success">{{$t("runCenter.common.produceStatus.finished")}}</el-tag>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <!-- 生产进度 -->
|
|
|
- <el-table-column prop="percent" :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="priority" :label='$t("runCenter.table.oder.priority")' :show-overflow-tooltip="true" width="80px"></el-table-column>
|
|
|
- <!-- 产品数量 -->
|
|
|
- <el-table-column prop="productNum" :label='$t("runCenter.table.oder.orderNum")' :show-overflow-tooltip="true" width="80px">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div class="pointerCls" @click="view(scope.row)">{{ scope.row.produceNum }}</div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <!-- 生产中(数量) -->
|
|
|
- <el-table-column prop="produceNum" :label='$t("runCenter.table.oder.produceNum")' :show-overflow-tooltip="true" width="80px"></el-table-column>
|
|
|
- <!-- 已完成(数量) -->
|
|
|
- <el-table-column prop="completeNum" :label='$t("runCenter.table.oder.completeNum")' :show-overflow-tooltip="true" width="80px"></el-table-column>
|
|
|
- <!-- 下单日期 -->
|
|
|
- <el-table-column prop="orderTime" :label='$t("runCenter.table.oder.orderTime")' width="160px"></el-table-column>
|
|
|
- <!-- 创建时间 -->
|
|
|
- <el-table-column prop="createTime" :label='$t("runCenter.table.oder.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.buttons.prodView")' effect="dark" placement="top-start">
|
|
|
- <i
|
|
|
- class="el-icon-view table-operation"
|
|
|
- style="color: #2db7f5;"
|
|
|
- @click="view(row)"
|
|
|
- />
|
|
|
- </el-tooltip>
|
|
|
- <!-- 查看排产方案 -->
|
|
|
- <el-tooltip class="item" :content='$t("runCenter.buttons.viewPaich")' effect="dark" placement="top-start">
|
|
|
- <i
|
|
|
- class="el-icon-view table-operation"
|
|
|
- style="color: #87d068;"
|
|
|
- @click="viewPgRow(row)"
|
|
|
- />
|
|
|
- </el-tooltip>
|
|
|
- <!--<el-tooltip class="item" :content='$t("common.delete")' effect="dark" placement="top-start">
|
|
|
- <i
|
|
|
- class="el-icon-delete table-operation"
|
|
|
- style="color: #f50;"
|
|
|
- @click="singleDelete(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"
|
|
|
- />
|
|
|
- <tenant-edit
|
|
|
- ref="edit"
|
|
|
- :dialog-visible="dialog.isVisible"
|
|
|
- :title="dialog.title"
|
|
|
- @close="editClose"
|
|
|
- @success="editSuccess"
|
|
|
- />
|
|
|
- <tenant-view
|
|
|
- ref="view"
|
|
|
- :dialog-visible="tenantViewVisible"
|
|
|
- @close="viewClose"
|
|
|
- />
|
|
|
- <el-dialog
|
|
|
- v-el-drag-dialog
|
|
|
- :close-on-click-modal="false"
|
|
|
- :close-on-press-escape="true"
|
|
|
- :title='$t("common.preview")'
|
|
|
- width="80%"
|
|
|
- top="50px"
|
|
|
- :visible.sync="preview.isVisible"
|
|
|
- >
|
|
|
- <el-scrollbar>
|
|
|
- <div v-html="preview.context" />
|
|
|
- </el-scrollbar>
|
|
|
- </el-dialog>
|
|
|
-
|
|
|
- <!-- 【一键排产】 -->
|
|
|
- <el-dialog
|
|
|
- :close-on-click-modal="false"
|
|
|
- :close-on-press-escape="false"
|
|
|
- :title='$t("runCenter.buttons.onebtn")'
|
|
|
- :visible.sync="dialogVisible"
|
|
|
- width="500px"
|
|
|
- >
|
|
|
- <div class="paichengDiv">
|
|
|
- <p>{{$t("runCenter.tips.tipscom")}}</p>
|
|
|
- <i class="el-icon-loading"></i>
|
|
|
- </div>
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click="viewPg">{{$t("runCenter.buttons.viewPaich")}}</el-button>
|
|
|
- <el-button plain type="warning" @click="dialogVisible = false">{{ $t('common.cancel') }}</el-button>
|
|
|
- </span>
|
|
|
- </el-dialog>
|
|
|
-
|
|
|
- <!-- 【生成排产方案】 -->
|
|
|
- <production-programme
|
|
|
- ref="prodProg"
|
|
|
- :dialog-visible="dialogPP.isVisible"
|
|
|
- :title="dialogPP.title"
|
|
|
- @frashNums="frashNums"
|
|
|
- @close="editPPClose"
|
|
|
- @success="editSuccess"
|
|
|
- ></production-programme>
|
|
|
-
|
|
|
- <!-- 【优先级/生产单元】 -->
|
|
|
- <el-dialog
|
|
|
- :close-on-click-modal="false"
|
|
|
- :close-on-press-escape="false"
|
|
|
- :title="setTitle"
|
|
|
- :visible.sync="dialogMoreVisible"
|
|
|
- :width="moreTitle=='lineCell'? '650px' : '550px'"
|
|
|
- >
|
|
|
- <el-form ref="form" :model="tenant" :rules="rules" label-position="right" label-width="130px">
|
|
|
- <el-form-item v-if="moreTitle=='priority'" :label='$t("runCenter.buttons.priority")+":"' prop="prority">
|
|
|
- <el-input-number v-model="tenant.prority" :min="1" :max="999999999" ></el-input-number>
|
|
|
- <p class="waningP">{{$t("runCenter.tips.numstips")}}</p>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item v-if="moreTitle=='production'" :label='$t("runCenter.common.setProduction")+":"' prop="zoneList">
|
|
|
- <el-select v-model="tenant.zoneList" multiple collapse-tags :placeholder='$t("common.pleaseSelect")' style="width: 100%;">
|
|
|
- <el-option
|
|
|
- v-for="item in areaList"
|
|
|
- :key="item.id"
|
|
|
- :label="item.name"
|
|
|
- :value="item.id">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item v-if="moreTitle=='lineCell'" :label='$t("runCenter.buttons.production")+":"' prop="checkedCities">
|
|
|
- <template>
|
|
|
- <p class="waningP">{{$t("runCenter.tips.lineTips")}}</p>
|
|
|
- <el-checkbox :indeterminate="tenant.isIndeterminate" v-model="tenant.checkAll" @change="handleCheckAllChange">全选</el-checkbox>
|
|
|
- <div style="margin: 15px 0;"></div>
|
|
|
- <el-checkbox-group v-model="tenant.zoneList" @change="handleCheckedCitiesChange">
|
|
|
- <el-checkbox v-for="city in areaList" :label="city.id" :key="city.id">{{city.name}}</el-checkbox>
|
|
|
- </el-checkbox-group>
|
|
|
- </template>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" :disabled="confirmDisabled" @click="submitForm">{{ $t('common.confirm') }}</el-button>
|
|
|
- <el-button plain type="warning" @click="dialogMoreVisible = false">{{ $t('common.cancel') }}</el-button>
|
|
|
- </span>
|
|
|
- </el-dialog>
|
|
|
-
|
|
|
- <!-- 刀具校验对话框-->
|
|
|
- <el-dialog
|
|
|
- :visible.sync="checkCuttingToolsVisible"
|
|
|
- :title='$t("runCenter.common.checkCuttingToolsDialogName")'
|
|
|
- width="80%"
|
|
|
- custom-class="dialogNoTop"
|
|
|
- @close="checkCuttingToolsClose"
|
|
|
- >
|
|
|
- <!--【 刀具校验对话框】 -->
|
|
|
- <checkCuttingTools
|
|
|
- :plan-id="planId"
|
|
|
- @close="checkCuttingToolsClose"
|
|
|
- />
|
|
|
- </el-dialog>
|
|
|
-
|
|
|
- </div>
|
|
|
-</template>
|
|
|
-
|
|
|
-<script>
|
|
|
- // 【分页】组件
|
|
|
- import Pagination from "@/components/Pagination"
|
|
|
- // 【高级排产】组件
|
|
|
- import TenantEdit from "./components/Edit"
|
|
|
- import TenantView from "./components/View"
|
|
|
- // 【生成排产方案】组件
|
|
|
- import ProductionProgramme from "./components/ProductionProgramme"
|
|
|
- // 【区域管理】-API
|
|
|
- import areaMgrApi from "@/api/resourceProductMgr/areaMgr"
|
|
|
- import checkCuttingTools from "@/views/zuihou/runManageCenter/orderMgr/components/runningOrder/components/checkCuttingTools/index"
|
|
|
- // 【订单管理】-API
|
|
|
- import orderMgrApi from "@/api/runManageCenter/orderMgr"
|
|
|
- import elDragDialog from '@/directive/el-drag-dialog'
|
|
|
- import { downloadFile, initEnums, initDicts, initQueryParams } from '@/utils/commons'
|
|
|
- import axios from 'axios'
|
|
|
- export default {
|
|
|
- name: "DraftOrder",
|
|
|
- directives: { elDragDialog },
|
|
|
- components: { Pagination, TenantEdit, TenantView, ProductionProgramme, checkCuttingTools},
|
|
|
- props: {
|
|
|
- },
|
|
|
- data () {
|
|
|
- return {
|
|
|
- tenant: { // 表单对象
|
|
|
- cities: ['A生产单元', 'B生产单元', 'C生产单元', 'D生产单元'],
|
|
|
- isIndeterminate: false,
|
|
|
- checkAll: false,
|
|
|
- zoneList: [],
|
|
|
- },
|
|
|
- areaList: [], // 生产单元
|
|
|
- rules: {
|
|
|
- prority: [
|
|
|
- { required: true, message: this.$t("rules.require"), trigger: 'change' }
|
|
|
- ],
|
|
|
- zoneList: [
|
|
|
- { type: 'array', required: true, message: this.$t("rules.require"), trigger: 'change' }
|
|
|
- ],
|
|
|
- checkedCities: [
|
|
|
- { type: 'array', required: true, message: this.$t("rules.require"), trigger: 'change' }
|
|
|
- ]
|
|
|
- },
|
|
|
- moreTitle: "", // 显示表单的flag
|
|
|
- production: [], // 生产单元
|
|
|
- confirmDisabled: false,
|
|
|
- dialogVisible: false,
|
|
|
- dialogMoreVisible: false,
|
|
|
- // 刀具检验对话框是否展示标志
|
|
|
- planId:"",
|
|
|
- checkCuttingToolsVisible: false,
|
|
|
- dialogPP: {
|
|
|
- isVisible: false,
|
|
|
- title: ""
|
|
|
- },
|
|
|
- dialog: {
|
|
|
- isVisible: false,
|
|
|
- title: ""
|
|
|
- },
|
|
|
- preview: {
|
|
|
- isVisible: false,
|
|
|
- context: ''
|
|
|
- },
|
|
|
- tenantViewVisible: false,
|
|
|
- tableKey: 0,
|
|
|
- queryParams: initQueryParams({}),
|
|
|
- selection: [],
|
|
|
- loading: false,
|
|
|
- tableData: {
|
|
|
- total: 0
|
|
|
- },
|
|
|
- enums: {
|
|
|
- TenantTypeEnum: {},
|
|
|
- TenantStatusEnum: {}
|
|
|
- },
|
|
|
- pickerOptions: {
|
|
|
- shortcuts: [{
|
|
|
- text: this.$t("common.timeArea.lastWeek"),
|
|
|
- onClick(picker) {
|
|
|
- const end = new Date();
|
|
|
- const start = new Date();
|
|
|
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
|
|
- picker.$emit('pick', [start, end]);
|
|
|
- }
|
|
|
- }, {
|
|
|
- text: this.$t("common.timeArea.lastMonth"),
|
|
|
- onClick(picker) {
|
|
|
- const end = new Date();
|
|
|
- const start = new Date();
|
|
|
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
|
|
- picker.$emit('pick', [start, end]);
|
|
|
- }
|
|
|
- }, {
|
|
|
- text: this.$t("common.timeArea.lastThreeMonth"),
|
|
|
- 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()
|
|
|
- // 查询【生产单元-区域管理】
|
|
|
- this.getAreaList()
|
|
|
- },
|
|
|
- computed: {
|
|
|
- jinduNums(){
|
|
|
- let num = Math.random()*100
|
|
|
- return parseFloat(num.toFixed(2))
|
|
|
- },
|
|
|
- setTitle(){
|
|
|
- let title = ''
|
|
|
- if(this.moreTitle == "priority"){
|
|
|
- title = this.$t("runCenter.buttons.priority")
|
|
|
- }
|
|
|
- if(this.moreTitle== "production"){
|
|
|
- title = this.$t("runCenter.common.setProduction")
|
|
|
- }
|
|
|
- if(this.moreTitle== "lineCell"){
|
|
|
- title = this.$t("runCenter.common.lineCell")
|
|
|
- }
|
|
|
- return title
|
|
|
- }
|
|
|
- },
|
|
|
- mounted () {
|
|
|
-
|
|
|
- },
|
|
|
- methods: {
|
|
|
-
|
|
|
- // 【全选】checkbox-事件
|
|
|
- handleCheckAllChange(val) {
|
|
|
- // 全选赋值
|
|
|
- let checked = []
|
|
|
- this.areaList.map(item => {
|
|
|
- checked.push(item.id)
|
|
|
- })
|
|
|
- this.tenant.zoneList = val ? checked : [];
|
|
|
- this.tenant.isIndeterminate = false;
|
|
|
- },
|
|
|
- // checkbox选择-事件
|
|
|
- handleCheckedCitiesChange(value) {
|
|
|
- // console.log("checkbox选择-事件:", value)
|
|
|
- let checkedCount = value.length;
|
|
|
- this.tenant.checkAll = checkedCount === this.areaList.length;
|
|
|
- this.tenant.isIndeterminate = checkedCount > 0 && checkedCount < this.areaList.length;
|
|
|
- },
|
|
|
- // 【一键排产】按钮-事件
|
|
|
- open(){
|
|
|
- if (!this.selection.length) {
|
|
|
- this.$message({
|
|
|
- message: this.$t("tips.noDataSelected"),
|
|
|
- type: "warning"
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- this.dialogVisible = true
|
|
|
- },
|
|
|
- // 【更多】按钮-事件
|
|
|
- handleCommand(command) {
|
|
|
- // console.log('你点击了:', command);
|
|
|
- // 如果是:【优先级】
|
|
|
- if(command == "priority"){
|
|
|
- this.moreTitle = "priority"
|
|
|
- this.priorityBtn()
|
|
|
- }
|
|
|
- // 如果是:【生产单元】
|
|
|
- if(command == "production"){
|
|
|
- this.moreTitle = "production"
|
|
|
- this.productionBtn()
|
|
|
- }
|
|
|
-
|
|
|
- // 如果是:【暂停】
|
|
|
- if(command == "stop"){
|
|
|
- this.panseBtn('0')
|
|
|
- }
|
|
|
-
|
|
|
- // 如果是:【启用】
|
|
|
- if(command == "start"){
|
|
|
- this.panseBtn('1')
|
|
|
- }
|
|
|
-
|
|
|
- // 如果是:【删除】
|
|
|
- if(command == "del"){
|
|
|
- this.orderDelete()
|
|
|
- }
|
|
|
- },
|
|
|
- // 【优先级】按钮-事件
|
|
|
- priorityBtn(){
|
|
|
- if(this.checkData()){
|
|
|
- this.dialogMoreVisible = true
|
|
|
- }
|
|
|
- },
|
|
|
- // 【生产单元】按钮-事件
|
|
|
- productionBtn(){
|
|
|
- if(this.checkData()){
|
|
|
- this.dialogMoreVisible = true
|
|
|
- }
|
|
|
- },
|
|
|
- // 【暂停/启用】按钮-事件
|
|
|
- panseBtn(val){
|
|
|
- if(this.checkData()){
|
|
|
- let obj = {
|
|
|
- id: this.selection[0].id,
|
|
|
- status: val
|
|
|
- }
|
|
|
- if(val == '1'){
|
|
|
- orderMgrApi.orderEnable(obj).then(res => {
|
|
|
- res = res.data
|
|
|
- if (res.isSuccess) {
|
|
|
- this.$message({
|
|
|
- message: this.$t('tips.optionSuccess'),
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
- // 更新列表
|
|
|
- this.search()
|
|
|
- }
|
|
|
- })
|
|
|
- }else{
|
|
|
- orderMgrApi.orderSuspend(obj).then(res => {
|
|
|
- res = res.data
|
|
|
- if (res.isSuccess) {
|
|
|
- this.$message({
|
|
|
- message: this.$t('tips.optionSuccess'),
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
- // 更新列表
|
|
|
- this.search()
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- // 【删除】按钮-事件
|
|
|
- orderDelete(){
|
|
|
- if(this.checkData()){
|
|
|
- this.$confirm(this.$t("runCenter.tips.orderTips"), this.$t("common.tips"), {
|
|
|
- distinguishCancelAndClose: true,
|
|
|
- confirmButtonText: this.$t("common.confirm"),
|
|
|
- cancelButtonText: this.$t("common.cancel"),
|
|
|
- type: "warning"
|
|
|
- }).then(() => {
|
|
|
- let obj = {
|
|
|
- id: this.selection[0].id
|
|
|
- }
|
|
|
- orderMgrApi.delete(obj).then(res => {
|
|
|
- res = res.data
|
|
|
- if (res.isSuccess) {
|
|
|
- this.$message({
|
|
|
- message: this.$t('tips.optionSuccess'),
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
- // 更新列表
|
|
|
- this.search()
|
|
|
- // 清理Table的选择数据
|
|
|
- this.$refs.table.clearSelection()
|
|
|
- }
|
|
|
- })
|
|
|
- }).catch(() => {})
|
|
|
- }
|
|
|
- },
|
|
|
- // 优先级/生产单元的【确定】按钮-事件
|
|
|
- submitForm () {
|
|
|
- this.$refs.form.validate((valid) => {
|
|
|
- if (valid) {
|
|
|
- this.confirmDisabled = true
|
|
|
- console.log("Form数据:", this.tenant)
|
|
|
- // 如果是【优先级】
|
|
|
- if(this.moreTitle == 'priority'){
|
|
|
- this.updateData()
|
|
|
- }
|
|
|
- // 如果是【生产单元】
|
|
|
- if(this.moreTitle == 'production'){
|
|
|
- this.setProductionUnit()
|
|
|
- }
|
|
|
- } else {
|
|
|
- return false
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- // 【优先级】-API
|
|
|
- updateData(){
|
|
|
- let obj = {
|
|
|
- id: this.selection[0].id,
|
|
|
- prority: this.tenant.prority
|
|
|
- }
|
|
|
- orderMgrApi.updateData(obj).then(res => {
|
|
|
- res = res.data
|
|
|
- if (res.isSuccess) {
|
|
|
- this.$message({
|
|
|
- message: this.$t('tips.optionSuccess'),
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
- // 关闭弹出框
|
|
|
- this.dialogMoreVisible = false
|
|
|
- // 更新列表
|
|
|
- this.search()
|
|
|
- }
|
|
|
- }).finally(() => {
|
|
|
- this.confirmDisabled = false
|
|
|
- return true
|
|
|
- })
|
|
|
- },
|
|
|
- // 【生产单元】-API
|
|
|
- setProductionUnit(){
|
|
|
- let obj = {
|
|
|
- planId: this.selection[0].id,
|
|
|
- zoneList: this.tenant.zoneList
|
|
|
- }
|
|
|
- orderMgrApi.setProductionUnit(obj).then(res => {
|
|
|
- res = res.data
|
|
|
- if (res.isSuccess) {
|
|
|
- this.$message({
|
|
|
- message: this.$t('tips.optionSuccess'),
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
- // 关闭弹出框
|
|
|
- this.dialogMoreVisible = false
|
|
|
- // 更新列表
|
|
|
- this.search()
|
|
|
- }
|
|
|
- }).finally(() => {
|
|
|
- this.confirmDisabled = false
|
|
|
- return true
|
|
|
- })
|
|
|
- },
|
|
|
- // 验证是否选中数据-函数
|
|
|
- checkData(){
|
|
|
- let flag = true
|
|
|
- if (!this.selection.length) {
|
|
|
- this.$message({
|
|
|
- message: this.$t("tips.noDataSelected"),
|
|
|
- type: "warning"
|
|
|
- })
|
|
|
- flag = false
|
|
|
- }
|
|
|
- if (this.selection.length > 1) {
|
|
|
- this.$message({
|
|
|
- message: this.$t("tips.mustOne"),
|
|
|
- type: "warning"
|
|
|
- })
|
|
|
- flag = false
|
|
|
- }
|
|
|
- return flag
|
|
|
- },
|
|
|
- // 【提交审核】按钮-事件
|
|
|
- audioStatu(status){
|
|
|
- if (!this.selection.length) {
|
|
|
- this.$message({
|
|
|
- message: this.$t("tips.noDataSelected"),
|
|
|
- type: "warning"
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- if (this.selection.length > 1) {
|
|
|
- this.$message({
|
|
|
- message: this.$t("tips.mustOne"),
|
|
|
- type: "warning"
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- // 确认【提交审核】
|
|
|
- this.$confirm(this.$t("tips.audioTips"), this.$t("common.tips"), {
|
|
|
- distinguishCancelAndClose: true,
|
|
|
- confirmButtonText: this.$t("common.confirm"),
|
|
|
- cancelButtonText: this.$t("common.cancel"),
|
|
|
- type: "warning"
|
|
|
- }).then(() => {
|
|
|
- // 调用API
|
|
|
- this.audio(status)
|
|
|
- }).catch(() => {})
|
|
|
- },
|
|
|
- // 【审核通过/审核不通过】接口-事件
|
|
|
- audio(status){
|
|
|
- if(!status){
|
|
|
- status = this.audioVal
|
|
|
- }
|
|
|
- // 赋值
|
|
|
- this.selection[0].status = status
|
|
|
- let msg = this.$t("common.audio.addAudioTips")
|
|
|
- if(status == "2"){
|
|
|
- msg = this.$t("common.audio.audioOk")+"!"
|
|
|
- }
|
|
|
- if(status == "3"){
|
|
|
- msg = this.$t("common.audio.aduioFail")+"!"
|
|
|
- }
|
|
|
- orderMgrApi.updateStatus({ id: this.selection[0].id, audit_status: status}).then(response => {
|
|
|
- if (response.status == 200) {
|
|
|
- // 如果是审核,成功后,关闭弹出框
|
|
|
- if(status == '2' || status == '3'){
|
|
|
- this.audioIsVisible = false
|
|
|
- // 审核成功后,改成默认值
|
|
|
- this.audioVal = '2'
|
|
|
- }
|
|
|
- this.$message({
|
|
|
- message: msg,
|
|
|
- type: "success"
|
|
|
- })
|
|
|
- // 重新查询列表数据
|
|
|
- this.search()
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- // 【一键排产】按钮后,要刷新订单列表的上的统计数据
|
|
|
- frashNums(val){
|
|
|
- // 更新统计数据
|
|
|
- this.$emit("audioStatus", val)
|
|
|
- },
|
|
|
- viewClose () {
|
|
|
- this.tenantViewVisible = false
|
|
|
- },
|
|
|
- editPPClose () {
|
|
|
- this.dialogPP.isVisible = false
|
|
|
- },
|
|
|
- editClose () {
|
|
|
- this.dialog.isVisible = false
|
|
|
- },
|
|
|
- editSuccess () {
|
|
|
- this.search()
|
|
|
- },
|
|
|
- onSelectChange (selection) {
|
|
|
- this.selection = selection
|
|
|
- },
|
|
|
- search () {
|
|
|
- this.fetch({
|
|
|
- ...this.queryParams
|
|
|
- })
|
|
|
- },
|
|
|
- reset () {
|
|
|
- this.queryParams = initQueryParams({})
|
|
|
- this.$refs.table.clearSort()
|
|
|
- this.$refs.table.clearFilter()
|
|
|
- this.search()
|
|
|
- },
|
|
|
- add () {
|
|
|
- this.$refs.edit.type = "add"
|
|
|
- this.$refs.edit.setTenant(false, this.dicts)
|
|
|
- this.dialog.title = this.$t("common.add")
|
|
|
- this.dialog.isVisible = true
|
|
|
- },
|
|
|
- singleDelete (row) {
|
|
|
- this.$refs.table.clearSelection()
|
|
|
- this.$refs.table.toggleRowSelection(row, true)
|
|
|
- this.batchDelete()
|
|
|
- },
|
|
|
- batchDelete () {
|
|
|
- if (!this.selection.length) {
|
|
|
- this.$message({
|
|
|
- message: this.$t("tips.noDataSelected"),
|
|
|
- type: "warning"
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- this.$confirm(this.$t("lineSide.tips.wareTips"), this.$t("common.tips"), {
|
|
|
- distinguishCancelAndClose: true,
|
|
|
- confirmButtonText: this.$t("common.confirm"),
|
|
|
- cancelButtonText: this.$t("common.cancel"),
|
|
|
- type: "warning"
|
|
|
- }).then(() => {
|
|
|
- const ids = []
|
|
|
- this.selection.forEach(item => {
|
|
|
- ids.push(item.id)
|
|
|
- })
|
|
|
- this.delete(ids)
|
|
|
- }).catch(() => {})
|
|
|
- },
|
|
|
- clearSelections () {
|
|
|
- this.$refs.table.clearSelection()
|
|
|
- },
|
|
|
- delete (ids) {
|
|
|
- orderMgrApi.remove({ ids: ids }).then(response => {
|
|
|
- const res = response.data
|
|
|
- if (res.isSuccess) {
|
|
|
- this.$message({
|
|
|
- message: this.$t("tips.deleteSuccess"),
|
|
|
- type: "success"
|
|
|
- })
|
|
|
- this.search()
|
|
|
- // 清理已经删除的数据
|
|
|
- this.$refs.table.clearSelection()
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- // 生产详情
|
|
|
- view (row) {
|
|
|
- this.$refs.view.setTenant(row)
|
|
|
- this.tenantViewVisible = true
|
|
|
- },
|
|
|
-
|
|
|
- // 【查看排产方案】按钮-事件
|
|
|
- viewPg(){
|
|
|
- if (!this.selection.length) {
|
|
|
- this.$message({
|
|
|
- message: this.$t("tips.noDataSelected"),
|
|
|
- type: "warning"
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- // 把选择的数据,给后台,
|
|
|
- orderMgrApi.oneTouchSchedule({orderList: this.selection}).then(res => {
|
|
|
- res = res.data
|
|
|
- console.log("【查看排产方案】按钮: ", res)
|
|
|
- if(res.isSuccess){
|
|
|
- this.$message({
|
|
|
- message: this.$t('tips.optionSuccess'),
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
- // 先关闭,前一个弹出页面
|
|
|
- this.dialogVisible = false
|
|
|
- // 给页面赋值,带到下一个子组件
|
|
|
- this.tenant = res.data
|
|
|
- this.$refs.prodProg.setTenant(res.data)
|
|
|
- // 给子页面,赋值,订单数据
|
|
|
- this.$refs.prodProg.orderList = this.selection
|
|
|
- this.$refs.prodProg.type = "productProg"
|
|
|
- this.dialogPP.title = this.$t("runCenter.common.prodpg")
|
|
|
- this.dialogPP.isVisible = true
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- viewPgRow(row){
|
|
|
- this.$refs.prodProg.setTenant(row)
|
|
|
- this.$refs.prodProg.type = "view"
|
|
|
- this.dialogPP.title = this.$t("runCenter.common.orderPg")
|
|
|
- this.dialogPP.isVisible = true
|
|
|
- },
|
|
|
- // 【修改】表头上Btn-事件
|
|
|
- editOne() {
|
|
|
- if (!this.selection.length) {
|
|
|
- this.$message({
|
|
|
- message: this.$t("tips.noDataSelected"),
|
|
|
- type: "warning"
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- this.edit(this.selection);
|
|
|
- },
|
|
|
- /*view (row) {
|
|
|
- this.$refs.edit.setTenant(row, this.dicts)
|
|
|
- this.$refs.edit.type = "view"
|
|
|
- this.dialog.title = this.$t("common.view")
|
|
|
- this.dialog.isVisible = true
|
|
|
- },*/
|
|
|
- edit (row) {
|
|
|
- this.$refs.edit.setTenant(row)
|
|
|
- this.$refs.edit.type = "edit"
|
|
|
- this.dialog.title = this.$t("runCenter.buttons.gostBtn")
|
|
|
- this.dialog.isVisible = true
|
|
|
- },
|
|
|
- // 查询【生产单元】下拉数据
|
|
|
- getAreaList(){
|
|
|
- areaMgrApi.getList().then(res => {
|
|
|
- res = res.data
|
|
|
- // console.log("查询【生产单元】: ", res)
|
|
|
- if(res.isSuccess){
|
|
|
- this.areaList = res.data
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- fetch (params = {}) {
|
|
|
- this.loading = true
|
|
|
- if (this.queryParams.timeRange) {
|
|
|
- this.queryParams.map.deliveryTime_st = this.queryParams.timeRange[0]
|
|
|
- this.queryParams.map.deliveryTime_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.orderStatus = '2'
|
|
|
- orderMgrApi.page(this.queryParams).then(response => {
|
|
|
- const res = response.data
|
|
|
- if (res.isSuccess) {
|
|
|
- this.tableData = res.data
|
|
|
- // 给列表设置条数
|
|
|
- this.$emit('setTabNums', res.data.total, 'tab1')
|
|
|
- // 清空用户的选择
|
|
|
- this.$refs.table.clearSelection()
|
|
|
- }
|
|
|
- // eslint-disable-next-line no-return-assign
|
|
|
- }).finally(() => this.loading = false)
|
|
|
-
|
|
|
- },
|
|
|
- cellClick (row, column) {
|
|
|
- if (column['columnKey'] === "operation") {
|
|
|
- return
|
|
|
- }
|
|
|
- let flag = false
|
|
|
- this.selection.forEach((item) => {
|
|
|
- if (item.id === row.id) {
|
|
|
- flag = true
|
|
|
- this.$refs.table.toggleRowSelection(row)
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
- if (!flag) {
|
|
|
- this.$refs.table.toggleRowSelection(row, true)
|
|
|
- }
|
|
|
- },
|
|
|
- checkCuttingTool(row){
|
|
|
- if (!this.selection.length) {
|
|
|
- this.$message({
|
|
|
- message: this.$t("tips.noDataSelected"),
|
|
|
- type: "warning"
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- let planIds = ""
|
|
|
- this.selection.forEach(item => {
|
|
|
- planIds = planIds + item.id + ","
|
|
|
- })
|
|
|
- if(planIds.length > 0){
|
|
|
- planIds = planIds.substr(0,planIds.length -1)
|
|
|
- }
|
|
|
-
|
|
|
- this.planId = planIds
|
|
|
- this.checkCuttingToolsVisible = true
|
|
|
- },
|
|
|
-
|
|
|
- checkCuttingToolsClose(){
|
|
|
- this.checkCuttingToolsVisible = false
|
|
|
- },
|
|
|
- }
|
|
|
- }
|
|
|
-</script>
|
|
|
-<style lang="scss" scoped>
|
|
|
- .paichengDiv{
|
|
|
- padding: 30px 30px 40px;
|
|
|
- text-align: center;
|
|
|
- }
|
|
|
- .paichengDiv .el-icon-loading{
|
|
|
- font-size: 30px;
|
|
|
- }
|
|
|
- .waningP{
|
|
|
- margin: 0;
|
|
|
- color: orange;
|
|
|
- }
|
|
|
- .pointerCls{
|
|
|
- cursor: pointer;
|
|
|
- }
|
|
|
-</style>
|
|
|
+<template>
|
|
|
+ <div class="app-container">
|
|
|
+ <!-- 搜索模块 -->
|
|
|
+ <div class="filter-container">
|
|
|
+ <!-- 零件名称 -->
|
|
|
+ <span>
|
|
|
+ <span>{{$t("runCenter.searchForm.bomName")}}:</span>
|
|
|
+ <el-input v-model="queryParams.model.bomName" :placeholder='$t("common.pleaseEnter")' style="width: 120px;" size="medium"/>
|
|
|
+ </span>
|
|
|
+ <!-- 订单名称 -->
|
|
|
+ <span style="margin-left: 15px;">
|
|
|
+ <span>{{$t("runCenter.searchForm.orderName")}}:</span>
|
|
|
+ <el-input v-model="queryParams.model.orderName" :placeholder='$t("common.pleaseEnter")' style="width: 120px;" size="medium"/>
|
|
|
+ </span>
|
|
|
+ <span style="margin-left: 15px;">
|
|
|
+ <span>{{$t("runCenter.searchForm.deliveryTime")}}:</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">
|
|
|
+ </el-date-picker>
|
|
|
+ </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-data-analysis" size="medium" v-has-permission="['order:checkCuttingTool']" @click="checkCuttingTool">{{$t("runCenter.buttons.checkCuttingTool")}}</el-button>
|
|
|
+ <!--<el-button type="primary" icon="el-icon-finished" size="medium" v-has-permission="['order:onebtn']" @click="viewPg">{{$t("runCenter.buttons.onebtn")}}</el-button>
|
|
|
+ <el-button type="success" icon="el-icon-finished" size="medium" v-has-permission="['order:gostBtn']" @click="editOne">{{$t("runCenter.buttons.gostBtn")}}</el-button>-->
|
|
|
+ <!-- 更多 -->
|
|
|
+ <el-dropdown v-has-permission="['order:more']" @command="handleCommand" trigger="click">
|
|
|
+ <el-button type="primary" size="medium">
|
|
|
+ {{$t("table.more")}}<i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
+ </el-button>
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
+ <el-dropdown-item command="priority" v-has-permission="['order:priority']">{{$t("runCenter.buttons.priority")}}</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="production" v-has-permission="['order:production']">{{$t("runCenter.buttons.production")}}</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="stop" v-has-permission="['order:pause']">{{$t("common.status.stop")}}</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="start" v-has-permission="['order:enable']">{{$t("common.status.valid")}}</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="del" v-has-permission="['order:delete']">{{$t("common.delete")}}</el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </el-dropdown>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <!-- 列表数据 -->
|
|
|
+ <el-table
|
|
|
+ :key="tableKey"
|
|
|
+ ref="table"
|
|
|
+ v-loading="loading"
|
|
|
+ :data="tableData.records"
|
|
|
+ border
|
|
|
+ fit
|
|
|
+ row-key="id"
|
|
|
+ style="width: 100%;"
|
|
|
+ @selection-change="onSelectChange"
|
|
|
+ @cell-click="cellClick"
|
|
|
+ >
|
|
|
+ <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 align="center" type="selection" width="50" :reserve-selection="true" />
|
|
|
+ <!-- 订单名称 -->
|
|
|
+ <el-table-column prop="orderName" :label='$t("runCenter.table.oder.orderName")' :show-overflow-tooltip="true" width="120px"></el-table-column>
|
|
|
+ <!-- 订单编号 -->
|
|
|
+ <!--<el-table-column prop="orderNo" :label='$t("runCenter.table.oder.orderNo")' :show-overflow-tooltip="true" width="120px"></el-table-column>-->
|
|
|
+ <!-- 交货日期 -->
|
|
|
+ <el-table-column prop="deliveryTime" :label='$t("runCenter.table.oder.deliveryTime")' :show-overflow-tooltip="true" width="120px"></el-table-column>
|
|
|
+ <!-- 来源 -->
|
|
|
+ <el-table-column prop="source" :label='$t("runCenter.table.oder.source")' :show-overflow-tooltip="true" width="80px">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <el-tag v-if="row.source == '1'">{{$t("runCenter.common.source.self")}}</el-tag>
|
|
|
+ <el-tag v-if="row.source == '2'" type="success">{{$t("runCenter.common.source.out")}}</el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- 零件 -->
|
|
|
+ <el-table-column prop="bomName" :label='$t("runCenter.table.oder.bomName")' :show-overflow-tooltip="true" width="120px"></el-table-column>
|
|
|
+ <!-- 订单状态 -->
|
|
|
+ <el-table-column prop="orderStatus" :label='$t("runCenter.table.oder.orderStatus")' align="center" width="90px">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <el-tag v-if="row.orderStatus == '0'" type="info">{{$t("runCenter.common.orderStatus.zero")}}</el-tag>
|
|
|
+ <el-tag v-if="row.orderStatus == '1'" type="warn">{{$t("runCenter.common.orderStatus.one")}}</el-tag>
|
|
|
+ <el-tag v-if="row.orderStatus == '2'" type="success">{{$t("runCenter.common.orderStatus.two")}}</el-tag>
|
|
|
+ <el-tag v-if="row.orderStatus == '3'" type="">{{$t("runCenter.common.orderStatus.three")}}</el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- 生产节拍 -->
|
|
|
+ <el-table-column prop="rhythmType" :label='$t("runCenter.table.oder.rhythmType")' :show-overflow-tooltip="true" width="100px">
|
|
|
+ <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.oder.zoenDesc")' :show-overflow-tooltip="true" width="100px"></el-table-column>
|
|
|
+ <!-- 计划 -->
|
|
|
+ <el-table-column prop="planStatus" :label='$t("runCenter.table.oder.planStatus")' :show-overflow-tooltip="true" width="100px">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <el-tag v-if="row.planStatus == '1'" type="info">{{$t("runCenter.common.orderPlanStatus.noStart")}}</el-tag>
|
|
|
+ <el-tag v-if="row.planStatus == '2'">{{$t("runCenter.common.orderPlanStatus.run")}}</el-tag>
|
|
|
+ <el-tag v-if="row.planStatus == '3'" type="success">{{$t("runCenter.common.orderPlanStatus.finished")}}</el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- 排产 -->
|
|
|
+ <el-table-column prop="schedulingStatus" :label='$t("runCenter.table.oder.schedulingStatus")' :show-overflow-tooltip="true" width="100px">
|
|
|
+ <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.oder.produceStatus")' :show-overflow-tooltip="true" width="100px">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <el-tag v-if="row.produceStatus == '0'" type="warning">{{$t("runCenter.common.produceStatus.panse")}}</el-tag>
|
|
|
+ <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="success">{{$t("runCenter.common.produceStatus.finished")}}</el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- 生产进度 -->
|
|
|
+ <el-table-column prop="percent" :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="priority" :label='$t("runCenter.table.oder.priority")' :show-overflow-tooltip="true" width="80px"></el-table-column>
|
|
|
+ <!-- 产品数量 -->
|
|
|
+ <el-table-column prop="productNum" :label='$t("runCenter.table.oder.orderNum")' :show-overflow-tooltip="true" width="80px">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div class="pointerCls" @click="view(scope.row)">{{ scope.row.produceNum }}</div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- 生产中(数量) -->
|
|
|
+ <el-table-column prop="produceNum" :label='$t("runCenter.table.oder.produceNum")' :show-overflow-tooltip="true" width="80px"></el-table-column>
|
|
|
+ <!-- 已完成(数量) -->
|
|
|
+ <el-table-column prop="completeNum" :label='$t("runCenter.table.oder.completeNum")' :show-overflow-tooltip="true" width="80px"></el-table-column>
|
|
|
+ <!-- 下单日期 -->
|
|
|
+ <el-table-column prop="orderTime" :label='$t("runCenter.table.oder.orderTime")' width="160px"></el-table-column>
|
|
|
+ <!-- 创建时间 -->
|
|
|
+ <el-table-column prop="createTime" :label='$t("runCenter.table.oder.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.buttons.prodView")' effect="dark" placement="top-start">
|
|
|
+ <i
|
|
|
+ class="el-icon-view table-operation"
|
|
|
+ style="color: #2db7f5;"
|
|
|
+ @click="view(row)"
|
|
|
+ />
|
|
|
+ </el-tooltip>
|
|
|
+ <!-- 查看排产方案 -->
|
|
|
+ <el-tooltip class="item" :content='$t("runCenter.buttons.viewPaich")' effect="dark" placement="top-start">
|
|
|
+ <i
|
|
|
+ class="el-icon-view table-operation"
|
|
|
+ style="color: #87d068;"
|
|
|
+ @click="viewPgRow(row)"
|
|
|
+ />
|
|
|
+ </el-tooltip>
|
|
|
+ <!--<el-tooltip class="item" :content='$t("common.delete")' effect="dark" placement="top-start">
|
|
|
+ <i
|
|
|
+ class="el-icon-delete table-operation"
|
|
|
+ style="color: #f50;"
|
|
|
+ @click="singleDelete(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"
|
|
|
+ />
|
|
|
+ <tenant-edit
|
|
|
+ ref="edit"
|
|
|
+ :dialog-visible="dialog.isVisible"
|
|
|
+ :title="dialog.title"
|
|
|
+ @close="editClose"
|
|
|
+ @success="editSuccess"
|
|
|
+ />
|
|
|
+ <tenant-view
|
|
|
+ ref="view"
|
|
|
+ :dialog-visible="tenantViewVisible"
|
|
|
+ @close="viewClose"
|
|
|
+ />
|
|
|
+ <el-dialog
|
|
|
+ v-el-drag-dialog
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :close-on-press-escape="true"
|
|
|
+ :title='$t("common.preview")'
|
|
|
+ width="80%"
|
|
|
+ top="50px"
|
|
|
+ :visible.sync="preview.isVisible"
|
|
|
+ >
|
|
|
+ <el-scrollbar>
|
|
|
+ <div v-html="preview.context" />
|
|
|
+ </el-scrollbar>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!-- 【一键排产】 -->
|
|
|
+ <el-dialog
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :close-on-press-escape="false"
|
|
|
+ :title='$t("runCenter.buttons.onebtn")'
|
|
|
+ :visible.sync="dialogVisible"
|
|
|
+ width="500px"
|
|
|
+ >
|
|
|
+ <div class="paichengDiv">
|
|
|
+ <p>{{$t("runCenter.tips.tipscom")}}</p>
|
|
|
+ <i class="el-icon-loading"></i>
|
|
|
+ </div>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="viewPg">{{$t("runCenter.buttons.viewPaich")}}</el-button>
|
|
|
+ <el-button plain type="warning" @click="dialogVisible = false">{{ $t('common.cancel') }}</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!-- 【生成排产方案】 -->
|
|
|
+ <production-programme
|
|
|
+ ref="prodProg"
|
|
|
+ :dialog-visible="dialogPP.isVisible"
|
|
|
+ :title="dialogPP.title"
|
|
|
+ @frashNums="frashNums"
|
|
|
+ @close="editPPClose"
|
|
|
+ @success="editSuccess"
|
|
|
+ ></production-programme>
|
|
|
+
|
|
|
+ <!-- 【优先级/生产单元】 -->
|
|
|
+ <el-dialog
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :close-on-press-escape="false"
|
|
|
+ :title="setTitle"
|
|
|
+ :visible.sync="dialogMoreVisible"
|
|
|
+ :width="moreTitle=='lineCell'? '650px' : '550px'"
|
|
|
+ >
|
|
|
+ <el-form ref="form" :model="tenant" :rules="rules" label-position="right" label-width="130px">
|
|
|
+ <el-form-item v-if="moreTitle=='priority'" :label='$t("runCenter.buttons.priority")+":"' prop="prority">
|
|
|
+ <el-input-number v-model="tenant.prority" :min="1" :max="999999999" ></el-input-number>
|
|
|
+ <p class="waningP">{{$t("runCenter.tips.numstips")}}</p>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item v-if="moreTitle=='production'" :label='$t("runCenter.common.setProduction")+":"' prop="zoneList">
|
|
|
+ <el-select v-model="tenant.zoneList" multiple collapse-tags :placeholder='$t("common.pleaseSelect")' style="width: 100%;">
|
|
|
+ <el-option
|
|
|
+ v-for="item in areaList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item v-if="moreTitle=='lineCell'" :label='$t("runCenter.buttons.production")+":"' prop="checkedCities">
|
|
|
+ <template>
|
|
|
+ <p class="waningP">{{$t("runCenter.tips.lineTips")}}</p>
|
|
|
+ <el-checkbox :indeterminate="tenant.isIndeterminate" v-model="tenant.checkAll" @change="handleCheckAllChange">全选</el-checkbox>
|
|
|
+ <div style="margin: 15px 0;"></div>
|
|
|
+ <el-checkbox-group v-model="tenant.zoneList" @change="handleCheckedCitiesChange">
|
|
|
+ <el-checkbox v-for="city in areaList" :label="city.id" :key="city.id">{{city.name}}</el-checkbox>
|
|
|
+ </el-checkbox-group>
|
|
|
+ </template>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" :disabled="confirmDisabled" @click="submitForm">{{ $t('common.confirm') }}</el-button>
|
|
|
+ <el-button plain type="warning" @click="dialogMoreVisible = false">{{ $t('common.cancel') }}</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!-- 刀具校验对话框-->
|
|
|
+ <el-dialog
|
|
|
+ :visible.sync="checkCuttingToolsVisible"
|
|
|
+ :title='$t("runCenter.common.checkCuttingToolsDialogName")'
|
|
|
+ width="80%"
|
|
|
+ custom-class="dialogNoTop"
|
|
|
+ @close="checkCuttingToolsClose"
|
|
|
+ >
|
|
|
+ <!--【 刀具校验对话框】 -->
|
|
|
+ <checkCuttingTools
|
|
|
+ :plan-id="planId"
|
|
|
+ @close="checkCuttingToolsClose"
|
|
|
+ />
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ // 【分页】组件
|
|
|
+ import Pagination from "@/components/Pagination"
|
|
|
+ // 【高级排产】组件
|
|
|
+ import TenantEdit from "./components/Edit"
|
|
|
+ import TenantView from "./components/View"
|
|
|
+ // 【生成排产方案】组件
|
|
|
+ import ProductionProgramme from "./components/ProductionProgramme"
|
|
|
+ // 【区域管理】-API
|
|
|
+ import areaMgrApi from "@/api/resourceProductMgr/areaMgr"
|
|
|
+ import checkCuttingTools from "@/views/zuihou/runManageCenter/orderMgr/components/runningOrder/components/checkCuttingTools/index"
|
|
|
+ // 【订单管理】-API
|
|
|
+ import orderMgrApi from "@/api/runManageCenter/orderMgr"
|
|
|
+ import elDragDialog from '@/directive/el-drag-dialog'
|
|
|
+ import { downloadFile, initEnums, initDicts, initQueryParams } from '@/utils/commons'
|
|
|
+ import axios from 'axios'
|
|
|
+ export default {
|
|
|
+ name: "DraftOrder",
|
|
|
+ directives: { elDragDialog },
|
|
|
+ components: { Pagination, TenantEdit, TenantView, ProductionProgramme, checkCuttingTools},
|
|
|
+ props: {
|
|
|
+ },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ tenant: { // 表单对象
|
|
|
+ cities: ['A生产单元', 'B生产单元', 'C生产单元', 'D生产单元'],
|
|
|
+ isIndeterminate: false,
|
|
|
+ checkAll: false,
|
|
|
+ zoneList: [],
|
|
|
+ },
|
|
|
+ areaList: [], // 生产单元
|
|
|
+ rules: {
|
|
|
+ prority: [
|
|
|
+ { required: true, message: this.$t("rules.require"), trigger: 'change' }
|
|
|
+ ],
|
|
|
+ zoneList: [
|
|
|
+ { type: 'array', required: true, message: this.$t("rules.require"), trigger: 'change' }
|
|
|
+ ],
|
|
|
+ checkedCities: [
|
|
|
+ { type: 'array', required: true, message: this.$t("rules.require"), trigger: 'change' }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ moreTitle: "", // 显示表单的flag
|
|
|
+ production: [], // 生产单元
|
|
|
+ confirmDisabled: false,
|
|
|
+ dialogVisible: false,
|
|
|
+ dialogMoreVisible: false,
|
|
|
+ // 刀具检验对话框是否展示标志
|
|
|
+ planId:"",
|
|
|
+ checkCuttingToolsVisible: false,
|
|
|
+ dialogPP: {
|
|
|
+ isVisible: false,
|
|
|
+ title: ""
|
|
|
+ },
|
|
|
+ dialog: {
|
|
|
+ isVisible: false,
|
|
|
+ title: ""
|
|
|
+ },
|
|
|
+ preview: {
|
|
|
+ isVisible: false,
|
|
|
+ context: ''
|
|
|
+ },
|
|
|
+ tenantViewVisible: false,
|
|
|
+ tableKey: 0,
|
|
|
+ queryParams: initQueryParams({}),
|
|
|
+ selection: [],
|
|
|
+ loading: false,
|
|
|
+ tableData: {
|
|
|
+ total: 0
|
|
|
+ },
|
|
|
+ enums: {
|
|
|
+ TenantTypeEnum: {},
|
|
|
+ TenantStatusEnum: {}
|
|
|
+ },
|
|
|
+ pickerOptions: {
|
|
|
+ shortcuts: [{
|
|
|
+ text: this.$t("common.timeArea.lastWeek"),
|
|
|
+ onClick(picker) {
|
|
|
+ const end = new Date();
|
|
|
+ const start = new Date();
|
|
|
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
|
|
+ picker.$emit('pick', [start, end]);
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ text: this.$t("common.timeArea.lastMonth"),
|
|
|
+ onClick(picker) {
|
|
|
+ const end = new Date();
|
|
|
+ const start = new Date();
|
|
|
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
|
|
+ picker.$emit('pick', [start, end]);
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ text: this.$t("common.timeArea.lastThreeMonth"),
|
|
|
+ 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()
|
|
|
+ // 查询【生产单元-区域管理】
|
|
|
+ this.getAreaList()
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ jinduNums(){
|
|
|
+ let num = Math.random()*100
|
|
|
+ return parseFloat(num.toFixed(2))
|
|
|
+ },
|
|
|
+ setTitle(){
|
|
|
+ let title = ''
|
|
|
+ if(this.moreTitle == "priority"){
|
|
|
+ title = this.$t("runCenter.buttons.priority")
|
|
|
+ }
|
|
|
+ if(this.moreTitle== "production"){
|
|
|
+ title = this.$t("runCenter.common.setProduction")
|
|
|
+ }
|
|
|
+ if(this.moreTitle== "lineCell"){
|
|
|
+ title = this.$t("runCenter.common.lineCell")
|
|
|
+ }
|
|
|
+ return title
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted () {
|
|
|
+
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+
|
|
|
+ // 【全选】checkbox-事件
|
|
|
+ handleCheckAllChange(val) {
|
|
|
+ // 全选赋值
|
|
|
+ let checked = []
|
|
|
+ this.areaList.map(item => {
|
|
|
+ checked.push(item.id)
|
|
|
+ })
|
|
|
+ this.tenant.zoneList = val ? checked : [];
|
|
|
+ this.tenant.isIndeterminate = false;
|
|
|
+ },
|
|
|
+ // checkbox选择-事件
|
|
|
+ handleCheckedCitiesChange(value) {
|
|
|
+ // console.log("checkbox选择-事件:", value)
|
|
|
+ let checkedCount = value.length;
|
|
|
+ this.tenant.checkAll = checkedCount === this.areaList.length;
|
|
|
+ this.tenant.isIndeterminate = checkedCount > 0 && checkedCount < this.areaList.length;
|
|
|
+ },
|
|
|
+ // 【一键排产】按钮-事件
|
|
|
+ open(){
|
|
|
+ if (!this.selection.length) {
|
|
|
+ this.$message({
|
|
|
+ message: this.$t("tips.noDataSelected"),
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.dialogVisible = true
|
|
|
+ },
|
|
|
+ // 【更多】按钮-事件
|
|
|
+ handleCommand(command) {
|
|
|
+ // console.log('你点击了:', command);
|
|
|
+ // 如果是:【优先级】
|
|
|
+ if(command == "priority"){
|
|
|
+ this.moreTitle = "priority"
|
|
|
+ this.priorityBtn()
|
|
|
+ }
|
|
|
+ // 如果是:【生产单元】
|
|
|
+ if(command == "production"){
|
|
|
+ this.moreTitle = "production"
|
|
|
+ this.productionBtn()
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果是:【暂停】
|
|
|
+ if(command == "stop"){
|
|
|
+ this.panseBtn('0')
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果是:【启用】
|
|
|
+ if(command == "start"){
|
|
|
+ this.panseBtn('1')
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果是:【删除】
|
|
|
+ if(command == "del"){
|
|
|
+ this.orderDelete()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 【优先级】按钮-事件
|
|
|
+ priorityBtn(){
|
|
|
+ if(this.checkData()){
|
|
|
+ this.dialogMoreVisible = true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 【生产单元】按钮-事件
|
|
|
+ productionBtn(){
|
|
|
+ if(this.checkData()){
|
|
|
+ this.dialogMoreVisible = true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 【暂停/启用】按钮-事件
|
|
|
+ panseBtn(val){
|
|
|
+ if(this.checkData()){
|
|
|
+ let obj = {
|
|
|
+ id: this.selection[0].id,
|
|
|
+ status: val
|
|
|
+ }
|
|
|
+ if(val == '1'){
|
|
|
+ orderMgrApi.orderEnable(obj).then(res => {
|
|
|
+ res = res.data
|
|
|
+ if (res.isSuccess) {
|
|
|
+ this.$message({
|
|
|
+ message: this.$t('tips.optionSuccess'),
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ // 更新列表
|
|
|
+ this.search()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ orderMgrApi.orderSuspend(obj).then(res => {
|
|
|
+ res = res.data
|
|
|
+ if (res.isSuccess) {
|
|
|
+ this.$message({
|
|
|
+ message: this.$t('tips.optionSuccess'),
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ // 更新列表
|
|
|
+ this.search()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 【删除】按钮-事件
|
|
|
+ orderDelete(){
|
|
|
+ if(this.checkData()){
|
|
|
+ this.$confirm(this.$t("runCenter.tips.orderTips"), this.$t("common.tips"), {
|
|
|
+ distinguishCancelAndClose: true,
|
|
|
+ confirmButtonText: this.$t("common.confirm"),
|
|
|
+ cancelButtonText: this.$t("common.cancel"),
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ let obj = {
|
|
|
+ id: this.selection[0].id
|
|
|
+ }
|
|
|
+ orderMgrApi.delete(obj).then(res => {
|
|
|
+ res = res.data
|
|
|
+ if (res.isSuccess) {
|
|
|
+ this.$message({
|
|
|
+ message: this.$t('tips.optionSuccess'),
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ // 更新列表
|
|
|
+ this.search()
|
|
|
+ // 清理Table的选择数据
|
|
|
+ this.$refs.table.clearSelection()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }).catch(() => {})
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 优先级/生产单元的【确定】按钮-事件
|
|
|
+ submitForm () {
|
|
|
+ this.$refs.form.validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ this.confirmDisabled = true
|
|
|
+ console.log("Form数据:", this.tenant)
|
|
|
+ // 如果是【优先级】
|
|
|
+ if(this.moreTitle == 'priority'){
|
|
|
+ this.updateData()
|
|
|
+ }
|
|
|
+ // 如果是【生产单元】
|
|
|
+ if(this.moreTitle == 'production'){
|
|
|
+ this.setProductionUnit()
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 【优先级】-API
|
|
|
+ updateData(){
|
|
|
+ let obj = {
|
|
|
+ id: this.selection[0].id,
|
|
|
+ prority: this.tenant.prority
|
|
|
+ }
|
|
|
+ orderMgrApi.updateData(obj).then(res => {
|
|
|
+ res = res.data
|
|
|
+ if (res.isSuccess) {
|
|
|
+ this.$message({
|
|
|
+ message: this.$t('tips.optionSuccess'),
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ // 关闭弹出框
|
|
|
+ this.dialogMoreVisible = false
|
|
|
+ // 更新列表
|
|
|
+ this.search()
|
|
|
+ }
|
|
|
+ }).finally(() => {
|
|
|
+ this.confirmDisabled = false
|
|
|
+ return true
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 【生产单元】-API
|
|
|
+ setProductionUnit(){
|
|
|
+ let obj = {
|
|
|
+ planId: this.selection[0].id,
|
|
|
+ zoneList: this.tenant.zoneList
|
|
|
+ }
|
|
|
+ orderMgrApi.setProductionUnit(obj).then(res => {
|
|
|
+ res = res.data
|
|
|
+ if (res.isSuccess) {
|
|
|
+ this.$message({
|
|
|
+ message: this.$t('tips.optionSuccess'),
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ // 关闭弹出框
|
|
|
+ this.dialogMoreVisible = false
|
|
|
+ // 更新列表
|
|
|
+ this.search()
|
|
|
+ }
|
|
|
+ }).finally(() => {
|
|
|
+ this.confirmDisabled = false
|
|
|
+ return true
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 验证是否选中数据-函数
|
|
|
+ checkData(){
|
|
|
+ let flag = true
|
|
|
+ if (!this.selection.length) {
|
|
|
+ this.$message({
|
|
|
+ message: this.$t("tips.noDataSelected"),
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ flag = false
|
|
|
+ }
|
|
|
+ if (this.selection.length > 1) {
|
|
|
+ this.$message({
|
|
|
+ message: this.$t("tips.mustOne"),
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ flag = false
|
|
|
+ }
|
|
|
+ return flag
|
|
|
+ },
|
|
|
+ // 【提交审核】按钮-事件
|
|
|
+ audioStatu(status){
|
|
|
+ if (!this.selection.length) {
|
|
|
+ this.$message({
|
|
|
+ message: this.$t("tips.noDataSelected"),
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.selection.length > 1) {
|
|
|
+ this.$message({
|
|
|
+ message: this.$t("tips.mustOne"),
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 确认【提交审核】
|
|
|
+ this.$confirm(this.$t("tips.audioTips"), this.$t("common.tips"), {
|
|
|
+ distinguishCancelAndClose: true,
|
|
|
+ confirmButtonText: this.$t("common.confirm"),
|
|
|
+ cancelButtonText: this.$t("common.cancel"),
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ // 调用API
|
|
|
+ this.audio(status)
|
|
|
+ }).catch(() => {})
|
|
|
+ },
|
|
|
+ // 【审核通过/审核不通过】接口-事件
|
|
|
+ audio(status){
|
|
|
+ if(!status){
|
|
|
+ status = this.audioVal
|
|
|
+ }
|
|
|
+ // 赋值
|
|
|
+ this.selection[0].status = status
|
|
|
+ let msg = this.$t("common.audio.addAudioTips")
|
|
|
+ if(status == "2"){
|
|
|
+ msg = this.$t("common.audio.audioOk")+"!"
|
|
|
+ }
|
|
|
+ if(status == "3"){
|
|
|
+ msg = this.$t("common.audio.aduioFail")+"!"
|
|
|
+ }
|
|
|
+ orderMgrApi.updateStatus({ id: this.selection[0].id, audit_status: status}).then(response => {
|
|
|
+ if (response.status == 200) {
|
|
|
+ // 如果是审核,成功后,关闭弹出框
|
|
|
+ if(status == '2' || status == '3'){
|
|
|
+ this.audioIsVisible = false
|
|
|
+ // 审核成功后,改成默认值
|
|
|
+ this.audioVal = '2'
|
|
|
+ }
|
|
|
+ this.$message({
|
|
|
+ message: msg,
|
|
|
+ type: "success"
|
|
|
+ })
|
|
|
+ // 重新查询列表数据
|
|
|
+ this.search()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 【一键排产】按钮后,要刷新订单列表的上的统计数据
|
|
|
+ frashNums(val){
|
|
|
+ // 更新统计数据
|
|
|
+ this.$emit("audioStatus", val)
|
|
|
+ },
|
|
|
+ viewClose () {
|
|
|
+ this.tenantViewVisible = false
|
|
|
+ },
|
|
|
+ editPPClose () {
|
|
|
+ this.dialogPP.isVisible = false
|
|
|
+ },
|
|
|
+ editClose () {
|
|
|
+ this.dialog.isVisible = false
|
|
|
+ },
|
|
|
+ editSuccess () {
|
|
|
+ this.search()
|
|
|
+ },
|
|
|
+ onSelectChange (selection) {
|
|
|
+ this.selection = selection
|
|
|
+ },
|
|
|
+ search () {
|
|
|
+ this.fetch({
|
|
|
+ ...this.queryParams
|
|
|
+ })
|
|
|
+ },
|
|
|
+ reset () {
|
|
|
+ this.queryParams = initQueryParams({})
|
|
|
+ this.$refs.table.clearSort()
|
|
|
+ this.$refs.table.clearFilter()
|
|
|
+ this.search()
|
|
|
+ },
|
|
|
+ add () {
|
|
|
+ this.$refs.edit.type = "add"
|
|
|
+ this.$refs.edit.setTenant(false, this.dicts)
|
|
|
+ this.dialog.title = this.$t("common.add")
|
|
|
+ this.dialog.isVisible = true
|
|
|
+ },
|
|
|
+ singleDelete (row) {
|
|
|
+ this.$refs.table.clearSelection()
|
|
|
+ this.$refs.table.toggleRowSelection(row, true)
|
|
|
+ this.batchDelete()
|
|
|
+ },
|
|
|
+ batchDelete () {
|
|
|
+ if (!this.selection.length) {
|
|
|
+ this.$message({
|
|
|
+ message: this.$t("tips.noDataSelected"),
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ this.$confirm(this.$t("lineSide.tips.wareTips"), this.$t("common.tips"), {
|
|
|
+ distinguishCancelAndClose: true,
|
|
|
+ confirmButtonText: this.$t("common.confirm"),
|
|
|
+ cancelButtonText: this.$t("common.cancel"),
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ const ids = []
|
|
|
+ this.selection.forEach(item => {
|
|
|
+ ids.push(item.id)
|
|
|
+ })
|
|
|
+ this.delete(ids)
|
|
|
+ }).catch(() => {})
|
|
|
+ },
|
|
|
+ clearSelections () {
|
|
|
+ this.$refs.table.clearSelection()
|
|
|
+ },
|
|
|
+ delete (ids) {
|
|
|
+ orderMgrApi.remove({ ids: ids }).then(response => {
|
|
|
+ const res = response.data
|
|
|
+ if (res.isSuccess) {
|
|
|
+ this.$message({
|
|
|
+ message: this.$t("tips.deleteSuccess"),
|
|
|
+ type: "success"
|
|
|
+ })
|
|
|
+ this.search()
|
|
|
+ // 清理已经删除的数据
|
|
|
+ this.$refs.table.clearSelection()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ // 生产详情
|
|
|
+ view (row) {
|
|
|
+ this.$refs.view.setTenant(row)
|
|
|
+ this.tenantViewVisible = true
|
|
|
+ },
|
|
|
+
|
|
|
+ // 【查看排产方案】按钮-事件
|
|
|
+ viewPg(){
|
|
|
+ if (!this.selection.length) {
|
|
|
+ this.$message({
|
|
|
+ message: this.$t("tips.noDataSelected"),
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 把选择的数据,给后台,
|
|
|
+ orderMgrApi.oneTouchSchedule({orderList: this.selection}).then(res => {
|
|
|
+ res = res.data
|
|
|
+ console.log("【查看排产方案】按钮: ", res)
|
|
|
+ if(res.isSuccess){
|
|
|
+ this.$message({
|
|
|
+ message: this.$t('tips.optionSuccess'),
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ // 先关闭,前一个弹出页面
|
|
|
+ this.dialogVisible = false
|
|
|
+ // 给页面赋值,带到下一个子组件
|
|
|
+ this.tenant = res.data
|
|
|
+ this.$refs.prodProg.setTenant(res.data)
|
|
|
+ // 给子页面,赋值,订单数据
|
|
|
+ this.$refs.prodProg.orderList = this.selection
|
|
|
+ this.$refs.prodProg.type = "productProg"
|
|
|
+ this.dialogPP.title = this.$t("runCenter.common.prodpg")
|
|
|
+ this.dialogPP.isVisible = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ viewPgRow(row){
|
|
|
+ this.$refs.prodProg.setTenant(row)
|
|
|
+ this.$refs.prodProg.type = "view"
|
|
|
+ this.dialogPP.title = this.$t("runCenter.common.orderPg")
|
|
|
+ this.dialogPP.isVisible = true
|
|
|
+ },
|
|
|
+ // 【修改】表头上Btn-事件
|
|
|
+ editOne() {
|
|
|
+ if (!this.selection.length) {
|
|
|
+ this.$message({
|
|
|
+ message: this.$t("tips.noDataSelected"),
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.edit(this.selection);
|
|
|
+ },
|
|
|
+ /*view (row) {
|
|
|
+ this.$refs.edit.setTenant(row, this.dicts)
|
|
|
+ this.$refs.edit.type = "view"
|
|
|
+ this.dialog.title = this.$t("common.view")
|
|
|
+ this.dialog.isVisible = true
|
|
|
+ },*/
|
|
|
+ edit (row) {
|
|
|
+ this.$refs.edit.setTenant(row)
|
|
|
+ this.$refs.edit.type = "edit"
|
|
|
+ this.dialog.title = this.$t("runCenter.buttons.gostBtn")
|
|
|
+ this.dialog.isVisible = true
|
|
|
+ },
|
|
|
+ // 查询【生产单元】下拉数据
|
|
|
+ getAreaList(){
|
|
|
+ areaMgrApi.getList().then(res => {
|
|
|
+ res = res.data
|
|
|
+ // console.log("查询【生产单元】: ", res)
|
|
|
+ if(res.isSuccess){
|
|
|
+ this.areaList = res.data
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ fetch (params = {}) {
|
|
|
+ this.loading = true
|
|
|
+ if (this.queryParams.timeRange) {
|
|
|
+ this.queryParams.model.deliveryTime_st = this.queryParams.timeRange[0]
|
|
|
+ this.queryParams.model.deliveryTime_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.orderStatus = '2'
|
|
|
+ orderMgrApi.page(this.queryParams).then(response => {
|
|
|
+ const res = response.data
|
|
|
+ if (res.isSuccess) {
|
|
|
+ this.tableData = res.data
|
|
|
+ // 给列表设置条数
|
|
|
+ this.$emit('setTabNums', res.data.total, 'tab1')
|
|
|
+ // 清空用户的选择
|
|
|
+ this.$refs.table.clearSelection()
|
|
|
+ }
|
|
|
+ // eslint-disable-next-line no-return-assign
|
|
|
+ }).finally(() => this.loading = false)
|
|
|
+
|
|
|
+ },
|
|
|
+ cellClick (row, column) {
|
|
|
+ if (column['columnKey'] === "operation") {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let flag = false
|
|
|
+ this.selection.forEach((item) => {
|
|
|
+ if (item.id === row.id) {
|
|
|
+ flag = true
|
|
|
+ this.$refs.table.toggleRowSelection(row)
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ if (!flag) {
|
|
|
+ this.$refs.table.toggleRowSelection(row, true)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ checkCuttingTool(row){
|
|
|
+ if (!this.selection.length) {
|
|
|
+ this.$message({
|
|
|
+ message: this.$t("tips.noDataSelected"),
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let planIds = ""
|
|
|
+ this.selection.forEach(item => {
|
|
|
+ planIds = planIds + item.id + ","
|
|
|
+ })
|
|
|
+ if(planIds.length > 0){
|
|
|
+ planIds = planIds.substr(0,planIds.length -1)
|
|
|
+ }
|
|
|
+
|
|
|
+ this.planId = planIds
|
|
|
+ this.checkCuttingToolsVisible = true
|
|
|
+ },
|
|
|
+
|
|
|
+ checkCuttingToolsClose(){
|
|
|
+ this.checkCuttingToolsVisible = false
|
|
|
+ },
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+ .paichengDiv{
|
|
|
+ padding: 30px 30px 40px;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ .paichengDiv .el-icon-loading{
|
|
|
+ font-size: 30px;
|
|
|
+ }
|
|
|
+ .waningP{
|
|
|
+ margin: 0;
|
|
|
+ color: orange;
|
|
|
+ }
|
|
|
+ .pointerCls{
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+</style>
|