|
|
@@ -70,6 +70,21 @@
|
|
|
|
|
|
</el-table>
|
|
|
</el-row>
|
|
|
+
|
|
|
+ <el-row v-show="this.active==1">
|
|
|
+ <p v-if="this.existed==0" class="titleP" style="margin-top:15px;color:#000;font-size:18px;">
|
|
|
+ ST1: 请申请托盘工装
|
|
|
+ </p>
|
|
|
+ <p v-if="this.existed==3" class="titleP" style="margin-top:15px;color:#000;font-size:18px;">
|
|
|
+ 零件下料未完成,请耐心等待
|
|
|
+ </p>
|
|
|
+ <p v-if="this.locked" class="titleP" style="margin-top:15px;color:#000;font-size:18px;">
|
|
|
+ 前序任务执行未结束,请耐心等待
|
|
|
+ </p>
|
|
|
+ <p v-if="this.existed==2 && !this.matched" class="titleP" style="margin-top:15px;color:#000;font-size:18px;">
|
|
|
+ 当前工装与零件不匹配
|
|
|
+ </p>
|
|
|
+ </el-row>
|
|
|
|
|
|
<!-- 装夹物料 -->
|
|
|
<el-row v-show="this.active>1">
|
|
|
@@ -96,6 +111,7 @@
|
|
|
<el-image
|
|
|
style="width: 60px; height: 60px"
|
|
|
:src="row.armorPic"
|
|
|
+ :preview-src-list="[row.armorPic]"
|
|
|
fit="fill"></el-image>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -111,9 +127,9 @@
|
|
|
</el-row>
|
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click.native="callRobot" v-show="!this.matched || this.existed==0" >申请上料</el-button>
|
|
|
+ <el-button type="primary" :disabled="callRobotFlag" @click.native="apply" v-show="(!this.matched || this.existed==0) && !this.locked" >申请上料</el-button>
|
|
|
<el-button type="primary" :disabled="confirmDisabled" @click.native="next" v-show="this.active==1 && this.existed==2">已完成,下一步</el-button>
|
|
|
- <el-button type="primary" :disabled="confirmDisabled2" @click.native="submitForm" v-show="this.active>1">上料完成</el-button>
|
|
|
+ <el-button type="primary" :disabled="confirmDisabled2" @click.native="submitForm" v-show="this.active>1 && !this.locked ">上料完成</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
@@ -140,6 +156,8 @@
|
|
|
confirmDisabled: true,
|
|
|
confirmDisabled2: true,
|
|
|
callRobotFlag: false,
|
|
|
+ xbkValid: true,
|
|
|
+ locked: false,
|
|
|
unFeedingCount: 0, //未上料零件数
|
|
|
existed: 0,
|
|
|
matched: false, //工装是否匹配
|
|
|
@@ -184,28 +202,20 @@
|
|
|
})()
|
|
|
}
|
|
|
},
|
|
|
- methods: {
|
|
|
- /*
|
|
|
- apply(){
|
|
|
- let that = this
|
|
|
+ methods: {
|
|
|
+ apply(){
|
|
|
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
|
|
|
+ //that.confirmDisabled = false
|
|
|
+ this.$emit("success");
|
|
|
+ // 通知列表-并关闭弹出框
|
|
|
+ this.$emit("close");
|
|
|
}
|
|
|
- });
|
|
|
- setTimeout(function(){
|
|
|
- //通知列表
|
|
|
- that.loading = false
|
|
|
- that.confirmDisabled = false
|
|
|
- that.$emit("success");
|
|
|
- //通知列表-并关闭弹出框
|
|
|
- that.$emit("close");
|
|
|
- }, 2000);
|
|
|
-
|
|
|
- }, */
|
|
|
+ })
|
|
|
+ },
|
|
|
confirmProcedure(){
|
|
|
let valid = this.tenant.taskNodeId!=''? true: false;
|
|
|
if(!valid){
|
|
|
@@ -224,6 +234,8 @@
|
|
|
this.existed = res.data.existed
|
|
|
this.matched = res.data.matched
|
|
|
this.confirmDisabled = false
|
|
|
+ this.locked = res.data.locked
|
|
|
+ this.xbkValid = res.data.xbkValid
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
@@ -256,32 +268,75 @@
|
|
|
});
|
|
|
if (this.active++ > 1) this.active = 0;
|
|
|
},
|
|
|
- submitForm(){
|
|
|
+ submitForm(){
|
|
|
// 更新改任务的开始时间
|
|
|
// TODO 写入rfid内容,工件信息、原材料R
|
|
|
- this.confirmDisabled2 = true
|
|
|
- let valid = this.uniqueCode!=''? true: false;
|
|
|
+ this.confirmDisabled = true
|
|
|
+ let valid = this.uniqueCode!=''? true: false;
|
|
|
if(!valid){
|
|
|
this.$message({
|
|
|
message: "零件编码" + this.$t("rules.require"),
|
|
|
type: "warning"
|
|
|
})
|
|
|
- this.confirmDisabled2 = false
|
|
|
+ this.confirmDisabled = 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) => {
|
|
|
+ if(!this.xbkValid){
|
|
|
+ this.$message({
|
|
|
+ message: "产线线边库资源不够,请等待资源释放后再上料",
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ this.confirmDisabled = false
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ //this.$confirm('确认?')
|
|
|
+ let that = this
|
|
|
+ this.$confirm(
|
|
|
+ '确定上料已完成并且舱门已关闭?',
|
|
|
+ this.$t("common.tips"),
|
|
|
+ {
|
|
|
+ distinguishCancelAndClose: true,
|
|
|
+ confirmButtonText: this.$t("common.confirm"),
|
|
|
+ cancelButtonText: this.$t("common.cancel"),
|
|
|
+ type: "warning",
|
|
|
+ }).then(() => {
|
|
|
+ //上料处理
|
|
|
+ this.addMaterial(that)
|
|
|
+ }).catch(()=>{})
|
|
|
+ },
|
|
|
+ addMaterial(that){
|
|
|
+ taskMgrApi.updateTaskStatus({ "id" : that.tenant.id,"meterialId":that.tenant.meterialId, "uniqueCode":that.uniqueCode, "taskNodeId": that.tenant.taskNodeId, "updateType" : "end", "processType" : "5", "updateUser" : that.$store.state.account.user.id, "positionIndex": that.currentIndex}).then((res) => {
|
|
|
res = res.data;
|
|
|
- if (res.isSuccess) {
|
|
|
- // 通知列表
|
|
|
- this.$emit("success");
|
|
|
- // 通知列表-并关闭弹出框
|
|
|
- this.$emit("close");
|
|
|
+ if (res.isSuccess) {
|
|
|
+ //写入RFID
|
|
|
+ that.RFIDParams.taskId = that.tenant.id
|
|
|
+ that.RFIDParams.taskNodeId = that.tenant.taskNodeId
|
|
|
+ that.RFIDParams.data.positionIndex = that.currentIndex
|
|
|
+ //写入空值
|
|
|
+ machiningClientApi.write(that.RFIDParams).then(res2 => {
|
|
|
+ if(res2.data.result){
|
|
|
+ console.log("空值写入成功")
|
|
|
+ }
|
|
|
+ });
|
|
|
+ that.RFIDParams.data.content = that.uniqueCode
|
|
|
+ //写入新值
|
|
|
+ machiningClientApi.write(that.RFIDParams).then(res2 => {
|
|
|
+ if(res2.data.result){
|
|
|
+ console.log("rfid写入成功")
|
|
|
+ }
|
|
|
+ setTimeout(function(){
|
|
|
+ //通知列表
|
|
|
+ that.$emit("success");
|
|
|
+ //通知列表-并关闭弹出框
|
|
|
+ that.$emit("close");
|
|
|
+ }, 1000);
|
|
|
+
|
|
|
+ });
|
|
|
}
|
|
|
}).finally(()=>{
|
|
|
- this.confirmDisabled2 = false
|
|
|
+ that.confirmDisabled = false
|
|
|
});
|
|
|
- },
|
|
|
+ },
|
|
|
// table的当前行值变化后
|
|
|
handleCurrentChange(val) {
|
|
|
// 设置当前行
|
|
|
@@ -333,15 +388,24 @@
|
|
|
},
|
|
|
|
|
|
confirmCode(){
|
|
|
- taskMgrApi.confirmCode({ "uniqueCode" : this.uniqueCode, "orderId":this.tenant.orderId}).then((res) => {
|
|
|
- res = res.data;
|
|
|
- if (res.isSuccess) {
|
|
|
- //this.uniqueCode = res.data.uniqueCode
|
|
|
+ let valid = this.tenant.completeBatchNo!=''? true: false;
|
|
|
+ if(!valid){
|
|
|
+ this.$message({
|
|
|
+ message: "零件编码" + this.$t("rules.require"),
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
this.confirmDisabled2 = false
|
|
|
+ return false
|
|
|
}
|
|
|
- });
|
|
|
- // this.uniqueCode = this.uuid(32,16)
|
|
|
- this.confirmDisabled2 = true
|
|
|
+ taskMgrApi.confirmCode({ "completeBatchNo" : this.tenant.completeBatchNo, "orderId":this.tenant.orderId, "procedureSort": this.tenant.procedureSort}).then((res) => {
|
|
|
+ res = res.data;
|
|
|
+ if (res.isSuccess) {
|
|
|
+ this.confirmDisabled2 = false
|
|
|
+ this.uniqueCode = res.data.uniqueCode
|
|
|
+ }else{
|
|
|
+ this.confirmDisabled2 = true
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
}
|