| | |
| | | 生产数量:<span>{{ taskData.Order.amount || 0 }}</span> |
| | | </div> |
| | | </div> |
| | | <div class="title-auto-box"> |
| | | <template v-if="messageError"> |
| | | <div class="error-t"> |
| | | <img src="../../public/error.png" /> |
| | | </div> |
| | | <div class="error-m"> |
| | | {{ messageError }} |
| | | </div> |
| | | <div class="font_size_20 color_fff" style="text-align:center;width:100%;margin:10px 0;">请重试</div> |
| | | </template> |
| | | <template v-else> |
| | | <div class="title-auto-box"> |
| | | <div class="title-box margin_bottom_20"> |
| | | <div class="title-item"> |
| | | 订单编号:{{ taskData.Order.orderId || "" }} |
| | |
| | | margin-top: 10px; |
| | | " |
| | | > |
| | | 请确认生产安全! |
| | | {{ message }} |
| | | </div> |
| | | <div class="progress-item"> |
| | | <span>{{ parseInt(num/60*100) }}%</span> |
| | |
| | | ></el-progress> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <!-- <div class="circel-text"> |
| | | <div class="circel-text-b"> |
| | | 生产数量:<span>{{ Order.amount||0 }}</span>{{ Order.unit||'' }} |
| | |
| | | </div> |
| | | </div> |
| | | <div slot="footer" class="dialog-footer tac" style="overflow: hidden"> |
| | | <template v-if="messageError"> |
| | | <div class="btn" style="margin-left:220px;" @click="confirmClick2"> |
| | | <img src="../../public/confirm3.png" /> |
| | | </div> |
| | | </template> |
| | | <template v-else> |
| | | <div class="btn" @click="closeClick"> |
| | | <img src="../../public/btn1.png" /> |
| | | </div> |
| | |
| | | <div class="btn" v-if="showBtn==3" @click="onSubmit()"> |
| | | <img src="../../public/confirm1.png" /> |
| | | </div> |
| | | </template> |
| | | |
| | | </div> |
| | | <!-- <ErrorIssue ref="error" :messageError="messageError" @shutdown="shutdown"/> --> |
| | | </div> |
| | | </el-dialog> |
| | | |
| | | </template> |
| | | |
| | | <script> |
| | | import { startTask, setProductNumber,sendProcessParams } from "@/api/home/index"; // 产线 |
| | | // import ErrorIssue from "@/components/ErrorIssue"; |
| | | export default { |
| | | components: {}, |
| | | props: { |
| | |
| | | showBtn:1, |
| | | num:0, |
| | | timer:null, |
| | | |
| | | message:'请确认生产安全!', |
| | | messageError:'', |
| | | resParams:{}, |
| | | }; |
| | | }, |
| | | mounted() { |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | confirmClick2(){ |
| | | this.messageError='' |
| | | }, |
| | | confirmClick1(){ |
| | | |
| | | this.num=0; |
| | | this.showBtn=2; |
| | | this.message='请确认生产安全!', |
| | | this.timer=setInterval(()=>{ |
| | | this.num=this.num+1; |
| | | },1000) |
| | |
| | | this.showBtn= 1; |
| | | this.islook=true; |
| | | }else{ |
| | | this.islook=false; |
| | | this.islook=true; |
| | | } |
| | | }, |
| | | getDateObj(date, fmt) { |
| | |
| | | return ""; |
| | | } |
| | | }, |
| | | |
| | | onSubmit() { |
| | | if(this.taskData.Procedure.ID){ |
| | | this.message='参数下发中...', |
| | | this.num=0 |
| | | this.timer=setInterval(()=>{ |
| | | this.num=this.num+1; |
| | | if(this.num==60||this.resParams){ |
| | | this.num=60 |
| | | this.getCode(this.resParams) |
| | | |
| | | } |
| | | },1000) |
| | | |
| | | sendProcessParams({id:this.taskData.Procedure.ID}).then(res=>{ |
| | | if(res.code==200){ |
| | | setProductNumber().then((res) => { |
| | | if (res.code == 200) { |
| | | this.$message.success("下发成功!"); |
| | | // this.$message.success("下发生产数量成功!"); |
| | | this.$emit("getSetProductNumber"); |
| | | this.shutdown(); |
| | | } |
| | | this.resParams=res; |
| | | |
| | | }); |
| | | }else{ |
| | | this.resParams=res; |
| | | } |
| | | }) |
| | | |
| | | } |
| | | |
| | | }, |
| | | getCode(res){ |
| | | if (res.code == 200) { |
| | | if(this.num==60){ |
| | | this.messageError='下发成功!' |
| | | clearInterval(this.timer) |
| | | this.num=60; |
| | | this.showBtn=2; |
| | | this.message='请确认生产安全!' |
| | | // this.$message.success("下发生产数量成功!"); |
| | | } |
| | | }else{ |
| | | this.messageError=res.msg?res.msg:'抱歉,工序下发失败!' |
| | | clearInterval(this.timer) |
| | | this.num=60; |
| | | this.showBtn=2; |
| | | this.message='请确认生产安全!' |
| | | } |
| | | }, |
| | | shutdown() { |
| | | this.islook = false; |
| | |
| | | .color_4efefa { |
| | | color: #4efefa !important; |
| | | } |
| | | .color_fff{ |
| | | color:#fff; |
| | | } |
| | | .font_size_20 { |
| | | font-size: 20px !important; |
| | | } |
| | |
| | | width: 55%; |
| | | } |
| | | } |
| | | |
| | | .title-bng { |
| | | height: 42px; |
| | | line-height: 42px; |
| | |
| | | width: 100% !important; |
| | | } |
| | | } |
| | | .error-t{ |
| | | width:120px; |
| | | margin:50px auto 40px; |
| | | img{ |
| | | width:100%; |
| | | display:inline-block; |
| | | } |
| | | } |
| | | .error-m{ |
| | | line-height:35px; |
| | | font-size:26px; |
| | | color:#fff; |
| | | margin-bottom:20px; |
| | | text-align:center; |
| | | } |
| | | ::v-deep .el-dialog { |
| | | background: transparent; |
| | | } |