|
@@ -0,0 +1,352 @@
|
|
|
+<template>
|
|
|
+ <el-dialog
|
|
|
+ :title='$t("common.view")'
|
|
|
+ width="80%"
|
|
|
+ :append-to-body="true"
|
|
|
+ :visible.sync="isVisible"
|
|
|
+ class="tenant-view"
|
|
|
+ >
|
|
|
+ <div class="boxDiv">
|
|
|
+ <!-- 任务信息 -->
|
|
|
+ <el-steps :active="active" finish-status="success" simple style="margin:20px 0;">
|
|
|
+ <el-step title="申请上料" ></el-step>
|
|
|
+ <el-step title="上料处理" ></el-step>
|
|
|
+ </el-steps>
|
|
|
+
|
|
|
+ <el-row v-show="this.active==1">
|
|
|
+ <p style="margin-top:0;text-align:center;font-size:18px;">{{$t("runCenter.form.viewSched.name")}}
|
|
|
+ <span style="float:right;margin-right:20px;font-size:14px;">{{$t("runCenter.form.viewSched.bomNo")+":"}}{{tenant.no}}</span>
|
|
|
+ </p>
|
|
|
+ <table class="comtable" border="0" cellspacing="0" cellpadding="6">
|
|
|
+ <tr>
|
|
|
+ <td class="blodTd" align="center" width="120">{{$t("runCenter.form.viewSched.procedureNo")+":"}}</td>
|
|
|
+ <td width="200">{{tenant.taskNo}}</td>
|
|
|
+ <td class="blodTd" align="center" width="120">{{$t("runCenter.form.viewSched.status")+":"}}</td>
|
|
|
+ <td width="120">
|
|
|
+ <el-tag v-if="tenant.status == 0" type="info">{{$t("runCenter.common.schedulStatus.noStart")}}</el-tag>
|
|
|
+ <el-tag v-if="tenant.status == 1" type="">{{$t("runCenter.common.schedulStatus.run")}}</el-tag>
|
|
|
+ <el-tag v-if="tenant.status == 2" type="success">{{$t("runCenter.common.schedulStatus.finished")}}</el-tag>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td class="blodTd" align="center">{{$t("runCenter.form.viewSched.procedureDesc")+":"}}</td>
|
|
|
+ <td>{{tenant.taskName}}</td>
|
|
|
+ <td class="blodTd" align="center">{{$t("runCenter.form.viewSched.content")+":"}}</td>
|
|
|
+ <td width="200">{{tenant.content}}</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td class="blodTd" align="center">{{$t("runCenter.form.viewSched.prepareWorkHours")+":"}}</td>
|
|
|
+ <td>{{tenant.time}}分钟</td>
|
|
|
+ <td class="blodTd" align="center">{{$t("runCenter.form.viewSched.procedurePosition")+":"}}</td>
|
|
|
+ <td>{{tenant.currentStationName}}</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td class="blodTd" align="center">{{$t("runCenter.form.viewSched.startTime")+":"}}</td>
|
|
|
+ <td>{{tenant.startTime}}</td>
|
|
|
+ <td class="blodTd" align="center">{{$t("runCenter.form.viewSched.endTime")+":"}}</td>
|
|
|
+ <td>{{tenant.endTime}}</td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <!-- 安装夹具 -->
|
|
|
+ <el-row v-show="this.active==1">
|
|
|
+ <p class="titleP" style="margin-top:15px;color:#000;font-size:18px;" >ST1: 等待工装 <span style="color:red;margin-left:5px;font-size:14px;"></span></p>
|
|
|
+ <!-- Table数据 -->
|
|
|
+ <el-table
|
|
|
+ ref="table"
|
|
|
+ v-loading="loading"
|
|
|
+ :data="tableData.records"
|
|
|
+ border
|
|
|
+ fit
|
|
|
+ style="width: 100%;"
|
|
|
+ >
|
|
|
+ <!-- 编号 -->
|
|
|
+ <el-table-column prop="no" :label='$t("prepare.table.tools.no")' align="center" ></el-table-column>
|
|
|
+ <!-- 编号 -->
|
|
|
+ <el-table-column prop="type" :label='$t("prepare.table.tools.type")' align="center" ></el-table-column>
|
|
|
+ <!-- 名称 -->
|
|
|
+ <el-table-column prop="name" :label='$t("prepare.table.tools.name")' align="center"></el-table-column>
|
|
|
+
|
|
|
+ </el-table>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <!-- 装夹物料 -->
|
|
|
+ <el-row v-show="this.active>1">
|
|
|
+ <p class="titleP" style="margin-top:15px;color:#000;font-size:18px;" >ST2: 装夹物料</p>
|
|
|
+ <!-- Table数据 -->
|
|
|
+ <el-table
|
|
|
+ ref="table1"
|
|
|
+ v-loading="loading"
|
|
|
+ :data="tableData1.records"
|
|
|
+ border
|
|
|
+ fit
|
|
|
+ style="width: 100%;"
|
|
|
+ >
|
|
|
+ <!-- 材料编码 -->
|
|
|
+ <el-table-column prop="meterialCode" :label='$t("prepare.table.tools.no")' align="center" ></el-table-column>
|
|
|
+ <!-- 材料牌号 -->
|
|
|
+ <el-table-column prop="tradeMark" :label='$t("prepare.table.tools.type")' align="center" ></el-table-column>
|
|
|
+ <!-- 材料名称 -->
|
|
|
+ <el-table-column prop="equipmentName" :label='$t("prepare.table.tools.name")' align="center"></el-table-column>
|
|
|
+ <!-- 装夹方式 -->
|
|
|
+ <el-table-column prop="clampImg" :label='$t("prepare.table.tools.clampImg")' align="center">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <div class="block">
|
|
|
+ <el-image
|
|
|
+ style="width: 60px; height: 60px"
|
|
|
+ :src="row.armorPic"
|
|
|
+ fit="fill"></el-image>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <!-- 输入唯一码 -->
|
|
|
+ <el-row v-show="this.active>1">
|
|
|
+ <p class="titleP" style="margin-top:15px;color:#000;font-size:18px;" >输入零件编码 <el-button size="small" type="primary" @click.native="confirmCode" round>扫码确认</el-button></p>
|
|
|
+ <el-input v-model="uniqueCode" placeholder="输入零件编码"></el-input>
|
|
|
+
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click.native="apply" v-show="this.confirmDisabled" >申请上料</el-button>
|
|
|
+ <el-button type="primary" :disabled="confirmDisabled" @click.native="next" v-show="this.active==1">已完成,下一步</el-button>
|
|
|
+ <el-button type="primary" :disabled="confirmDisabled2" @click.native="submitForm" v-show="this.active>1">上料完成</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </template>
|
|
|
+ <script>
|
|
|
+ // 【分页】组件
|
|
|
+ import taskMgrApi from "@/api/runManageCenter/taskMgr";
|
|
|
+ import machiningClientApi from "@/api/machiningClient/machiningClient"
|
|
|
+ // 列表查询的共通参数
|
|
|
+ import { initQueryParams } from '@/utils/commons'
|
|
|
+ export default {
|
|
|
+ name: 'TaskView',
|
|
|
+ components: { },
|
|
|
+ props: {
|
|
|
+ dialogVisible: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ active: 1,
|
|
|
+ screenWidth: 0,
|
|
|
+ confirmDisabled: true,
|
|
|
+ confirmDisabled2: true,
|
|
|
+ width: this.initWidth(),
|
|
|
+ tenant: {},
|
|
|
+ queryParams: initQueryParams({}),
|
|
|
+ loading: false,
|
|
|
+ uniqueCode: '',
|
|
|
+ tenantViewVisible: false,
|
|
|
+ tableKey: 0,
|
|
|
+ tableData: {
|
|
|
+ total: 0
|
|
|
+ },
|
|
|
+ tableData1: {
|
|
|
+ total: 0
|
|
|
+ },
|
|
|
+ tableData2: [],
|
|
|
+ currentRow: null, // 当前选择的行
|
|
|
+ currentIndex: 0, //上下料站默认序号
|
|
|
+ spanArr: [], // 【组序】合并单元格
|
|
|
+ spanArr2: [], // 【优先级】合并单元格
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
|
|
|
+ created() {
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ isVisible: {
|
|
|
+ get () {
|
|
|
+ return this.dialogVisible
|
|
|
+ },
|
|
|
+ set () {
|
|
|
+ this.close()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted () {
|
|
|
+ window.onresize = () => {
|
|
|
+ return (() => {
|
|
|
+ this.width = this.initWidth()
|
|
|
+ })()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ apply(){
|
|
|
+ let that = this
|
|
|
+ this.loading = true
|
|
|
+ this.confirmDisabled = true
|
|
|
+ taskMgrApi.updateTaskStatus({ "id" : this.tenant.id, "taskNodeId": this.tenant.taskNodeId, "updateType" : "end", "processType" : "4", "updateUser" : this.$store.state.account.user.id}).then((res) => {
|
|
|
+ if (res.isSuccess) {
|
|
|
+ that.loading = false
|
|
|
+ that.confirmDisabled = false
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ next(){
|
|
|
+ // TODO 写入rfid内容(子盘信息和夹具信息)
|
|
|
+ taskMgrApi.procesRfid({ "id" : this.tenant.id, "clampId" : this.tenant.clampId,rfidType: "write" }).then((res) => {
|
|
|
+ res = res.data;
|
|
|
+ if (res.isSuccess) {
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (this.active++ > 1) this.active = 0;
|
|
|
+ },
|
|
|
+ submitForm(){
|
|
|
+ // 更新改任务的开始时间
|
|
|
+ // TODO 写入rfid内容,工件信息、原材料R
|
|
|
+ this.confirmDisabled2 = true
|
|
|
+ let valid = this.uniqueCode!=''? true: false;
|
|
|
+ if(!valid){
|
|
|
+ this.$message({
|
|
|
+ message: "零件编码" + this.$t("rules.require"),
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ this.confirmDisabled2 = false
|
|
|
+ return false
|
|
|
+ }
|
|
|
+
|
|
|
+ taskMgrApi.updateTaskStatus({ "id" : this.tenant.id,"meterialId":this.tenant.meterialId, "uniqueCode":this.uniqueCode, "taskNodeId": this.tenant.taskNodeId, "updateType" : "end", "processType" : "1", "updateUser" : this.$store.state.account.user.id, "positionIndex": this.currentIndex}).then((res) => {
|
|
|
+ res = res.data;
|
|
|
+ if (res.isSuccess) {
|
|
|
+ // 通知列表
|
|
|
+ this.$emit("success");
|
|
|
+ // 通知列表-并关闭弹出框
|
|
|
+ this.$emit("close");
|
|
|
+ }
|
|
|
+ }).finally(()=>{
|
|
|
+ this.confirmDisabled2 = false
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // table的当前行值变化后
|
|
|
+ handleCurrentChange(val) {
|
|
|
+ // 设置当前行
|
|
|
+ this.currentRow = val;
|
|
|
+ },
|
|
|
+ initWidth () {
|
|
|
+ this.screenWidth = document.body.clientWidth
|
|
|
+ if (this.screenWidth < 550) {
|
|
|
+ return '95%'
|
|
|
+ } else if (this.screenWidth < 990) {
|
|
|
+ return '580px'
|
|
|
+ } else if (this.screenWidth < 1400) {
|
|
|
+ return '600px'
|
|
|
+ } else {
|
|
|
+ return '650px'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ setTenant (val) {
|
|
|
+ this.tenant = { ...val }
|
|
|
+ this.currentIndex = this.tenant.currentStationName.substr(-1)
|
|
|
+ this.loading = false
|
|
|
+ if(this.tenant.nodeName == '热处理上料'){
|
|
|
+ this.confirmDisabled = false
|
|
|
+ }else{
|
|
|
+ this.confirmDisabled = true
|
|
|
+ }
|
|
|
+ // 添加数据
|
|
|
+ this.tableData.records = []
|
|
|
+ // 添加数据
|
|
|
+ this.tableData.records.push({
|
|
|
+ no: this.tenant.clampNo,
|
|
|
+ name: this.tenant.clampName
|
|
|
+ })
|
|
|
+
|
|
|
+ this.tableData1.records = []
|
|
|
+ // 添加数据
|
|
|
+ this.tableData1.records.push({
|
|
|
+ meterialCode: this.tenant.meterialCode,
|
|
|
+ equipmentName: this.tenant.equipmentName,
|
|
|
+ tradeMark: this.tenant.tradeMark,
|
|
|
+ armorPic: this.tenant.armorPic,
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
+ close () {
|
|
|
+ this.$emit('close')
|
|
|
+ },
|
|
|
+
|
|
|
+ confirmCode(){
|
|
|
+ taskMgrApi.confirmCode({ "uniqueCode" : this.uniqueCode}).then((res) => {
|
|
|
+ res = res.data;
|
|
|
+ if (res.isSuccess) {
|
|
|
+ //this.uniqueCode = res.data.uniqueCode
|
|
|
+ this.confirmDisabled2 = false
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // this.uniqueCode = this.uuid(32,16)
|
|
|
+ this.confirmDisabled2 = true
|
|
|
+ },
|
|
|
+
|
|
|
+ uuid(len, radix) {
|
|
|
+ var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
|
|
|
+ var uuid = [], i;
|
|
|
+ radix = radix || chars.length;
|
|
|
+ if (len) {
|
|
|
+ // Compact form
|
|
|
+ for (i = 0; i < len; i++) uuid[i] = chars[0 | Math.random()*radix];
|
|
|
+ } else {
|
|
|
+ // rfc4122, version 4 form
|
|
|
+ var r;
|
|
|
+
|
|
|
+ // rfc4122 requires these characters
|
|
|
+ uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
|
|
|
+ uuid[14] = '4';
|
|
|
+
|
|
|
+ // Fill in random data. At i==19 set the high bits of clock sequence as
|
|
|
+ // per rfc4122, sec. 4.1.5
|
|
|
+ for (i = 0; i < 36; i++) {
|
|
|
+ if (!uuid[i]) {
|
|
|
+ r = 0 | Math.random()*16;
|
|
|
+ uuid[i] = chars[(i == 19) ? (r & 0x3) | 0x8 : r];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return uuid.join('').toLowerCase();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ </script>
|
|
|
+ <style lang="scss" scoped>
|
|
|
+ .dialog-footer{
|
|
|
+ text-align: center;
|
|
|
+ padding: 30px;
|
|
|
+ }
|
|
|
+ .titleP{
|
|
|
+ position: relative;
|
|
|
+ font-size: 16px;
|
|
|
+ padding-left: 15px;
|
|
|
+ }
|
|
|
+ .titleP:before{
|
|
|
+ content: '';
|
|
|
+ position: absolute;
|
|
|
+ left: 0;
|
|
|
+ top: 3px;
|
|
|
+ width: 5px;
|
|
|
+ height: 80%;
|
|
|
+ background: #0F79DC;
|
|
|
+ }
|
|
|
+ .comtable{
|
|
|
+ width: 100%;
|
|
|
+ border-left: 1px solid #CCCCCC;
|
|
|
+ border-top: 1px solid #CCCCCC;
|
|
|
+ }
|
|
|
+ .comtable td{
|
|
|
+ border-right: 1px solid #CCCCCC;
|
|
|
+ border-bottom: 1px solid #CCCCCC;
|
|
|
+ }
|
|
|
+ .blodTd{
|
|
|
+ background: #EEEEEE;
|
|
|
+ color: #333333;
|
|
|
+ }
|
|
|
+ </style>
|
|
|
+
|