|
@@ -13,6 +13,7 @@
|
|
<el-step title="刀具装夹" ></el-step>
|
|
<el-step title="刀具装夹" ></el-step>
|
|
</el-steps>
|
|
</el-steps>
|
|
|
|
|
|
|
|
+ <!-- 刀具信息 -->
|
|
<el-row v-show="this.active==1">
|
|
<el-row v-show="this.active==1">
|
|
<p style="margin-top:0;text-align:center;font-size:18px;">刀具信息
|
|
<p style="margin-top:0;text-align:center;font-size:18px;">刀具信息
|
|
<span style="float:right;margin-right:20px;font-size:14px;">库位编号:{{tenant.code}}</span>
|
|
<span style="float:right;margin-right:20px;font-size:14px;">库位编号:{{tenant.code}}</span>
|
|
@@ -61,35 +62,50 @@
|
|
<p class="titleP" style="margin-top:15px;color:#000;font-size:18px;" >ST2: 装夹刀具</p>
|
|
<p class="titleP" style="margin-top:15px;color:#000;font-size:18px;" >ST2: 装夹刀具</p>
|
|
<!-- Table数据 -->
|
|
<!-- Table数据 -->
|
|
<el-table
|
|
<el-table
|
|
- ref="table1"
|
|
|
|
- v-loading="loading"
|
|
|
|
- :data="tableData1.records"
|
|
|
|
- border
|
|
|
|
- fit
|
|
|
|
- style="width: 100%;"
|
|
|
|
- >
|
|
|
|
- <!-- 材料编码 -->
|
|
|
|
- <el-table-column prop="brandName" label='刀具产品' align="center" ></el-table-column>
|
|
|
|
- <!-- 材料牌号 -->
|
|
|
|
- <el-table-column prop="brandNo" label='RFID值' align="center" ></el-table-column>
|
|
|
|
- <!-- 材料名称 -->
|
|
|
|
- <el-table-column prop="goodsId" label='产品ID' align="center"></el-table-column>
|
|
|
|
-
|
|
|
|
- <el-table-column prop="pointId" label='产品ID' 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"
|
|
|
|
|
|
+ ref="table1"
|
|
|
|
+ v-loading="loading"
|
|
|
|
+ :data="tableData1.records"
|
|
|
|
+ border
|
|
|
|
+ fit
|
|
|
|
+ style="width: 100%;"
|
|
|
|
+ >
|
|
|
|
+
|
|
|
|
+ <el-table-column prop="brandNo" label='刀柄号' align="center" ></el-table-column>
|
|
|
|
+ <el-table-column prop="brandName" label='刀具名称' align="center" ></el-table-column>
|
|
|
|
+ <el-table-column prop="pointId" label='起始位置' align="center"></el-table-column>
|
|
|
|
+ <el-table-column prop="goalType" label='目的设备' align="center">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-select v-model="scope.row.goalType" placeholder="选择设备类型" @change="choose">
|
|
|
|
+ <el-option v-for="device in cutToolDeviceList" :label="device.name" :value="device.code" :key="device.code" ></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="targetPointId" label='目的位置' align="center">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-select v-model="scope.row.targetPointId" placeholder="选择目标位">
|
|
|
|
+ <el-option v-for="position in cutToolStorgeList" :label="position.name" :value="position.pointId" :key="position.pointId"></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="cutGoalNo" label='目的刀位号' align="center">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-input-number v-model="scope.row.cutGoalNo" :min="0" :max="40"></el-input-number>
|
|
|
|
+ </template>
|
|
|
|
+ </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"
|
|
:preview-src-list="[row.armorPic]"
|
|
:preview-src-list="[row.armorPic]"
|
|
- fit="fill"></el-image>
|
|
|
|
- </div>
|
|
|
|
|
|
+ fit="fill"></el-image>
|
|
|
|
+ </div>
|
|
</template>
|
|
</template>
|
|
- </el-table-column>
|
|
|
|
- -->
|
|
|
|
- </el-table>
|
|
|
|
|
|
+ </el-table-column>
|
|
|
|
+ -->
|
|
|
|
+ </el-table>
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
|
<!-- 输入唯一码 -->
|
|
<!-- 输入唯一码 -->
|
|
@@ -107,12 +123,19 @@
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
// 【分页】组件
|
|
// 【分页】组件
|
|
- import taskMgrApi from "@/api/runManageCenter/taskMgr";
|
|
|
|
- import machiningClientApi from "@/api/machiningClient/machiningClient"
|
|
|
|
- import stationMgrApi from "@/api/machiningClient/stationMgr"
|
|
|
|
- import bomMgrApi from "@/api/prepareProductMgr/bomMgr"
|
|
|
|
- // 列表查询的共通参数
|
|
|
|
- import { initQueryParams } from '@/utils/commons'
|
|
|
|
|
|
+import taskMgrApi from "@/api/runManageCenter/taskMgr";
|
|
|
|
+import machiningClientApi from "@/api/machiningClient/machiningClient"
|
|
|
|
+import stationMgrApi from "@/api/machiningClient/stationMgr"
|
|
|
|
+import bomMgrApi from "@/api/prepareProductMgr/bomMgr"
|
|
|
|
+// 列表查询的共通参数
|
|
|
|
+import { initQueryParams } from '@/utils/commons'
|
|
|
|
+
|
|
|
|
+import equipmentMgrApi from "@/api/resourceProductMgr/equipmentMgr"
|
|
|
|
+
|
|
|
|
+import toolbarApi from "@/api/systemMgr/toolbar"
|
|
|
|
+
|
|
|
|
+import qs from 'qs'
|
|
|
|
+
|
|
export default {
|
|
export default {
|
|
name: 'TaskView',
|
|
name: 'TaskView',
|
|
components: { },
|
|
components: { },
|
|
@@ -157,10 +180,15 @@ export default {
|
|
currentIndex: 0, //上下料站默认序号
|
|
currentIndex: 0, //上下料站默认序号
|
|
spanArr: [], // 【组序】合并单元格
|
|
spanArr: [], // 【组序】合并单元格
|
|
spanArr2: [], // 【优先级】合并单元格
|
|
spanArr2: [], // 【优先级】合并单元格
|
|
|
|
+ cutToolDeviceList: [],
|
|
|
|
+ cutToolStorgeList: [{"name":"请选择","pointId":""}],
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
|
|
// 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
|
|
created() {
|
|
created() {
|
|
|
|
+
|
|
|
|
+ // 加载列表数据
|
|
|
|
+ this.fetch()
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
isVisible: {
|
|
isVisible: {
|
|
@@ -189,6 +217,75 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ fetch () {
|
|
|
|
+ equipmentMgrApi.getList({})
|
|
|
|
+ .then((response) => {
|
|
|
|
+ const res = response.data;
|
|
|
|
+ if (res.isSuccess) {
|
|
|
|
+ // 赋值
|
|
|
|
+ this.cutToolDeviceList = res.data.filter(item=> {
|
|
|
|
+ return item.modeSpecification!=null || item.name.indexOf("刀具") > -1
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ .finally(() => (this.loading = false));
|
|
|
|
+ },
|
|
|
|
+ choose(val){
|
|
|
|
+ console.log("传参:"+val +"-tableData1.records-"+this.tableData1.records);
|
|
|
|
+ this.tableData1.records.forEach(item => {
|
|
|
|
+ this.$set(item, 'targetPointId', '');
|
|
|
|
+ this.$set(item, 'cutGoalNo', '0');
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ let data = this.tableData1.records[0];
|
|
|
|
+
|
|
|
|
+ if(data.pointId!=null || data.pointId!=""){
|
|
|
|
+ //判断起始设备和目的设备是否一致
|
|
|
|
+ let params = {"pointId": data.pointId.replace("CT_","")}
|
|
|
|
+ toolbarApi.getCutToolDevice(qs.stringify(params)).then(response=>{
|
|
|
|
+ const res = response.data
|
|
|
|
+ if(res.data == null){
|
|
|
|
+ this.$message({
|
|
|
|
+ message: "没有查询到设备",
|
|
|
|
+ type: 'warning'
|
|
|
|
+ })
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(res.isSuccess){
|
|
|
|
+ let item = this.cutToolDeviceList.filter(item=>item.code==val);
|
|
|
|
+ let resourceId = res.data.resourceId
|
|
|
|
+ if(resourceId == item[0].id){
|
|
|
|
+ this.$message({
|
|
|
|
+ message: "起始设备和目的设备不能一样",
|
|
|
|
+ type: 'warning'
|
|
|
|
+ })
|
|
|
|
+ this.cutToolStorgeList = [];
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //
|
|
|
|
+ let params2 = {"code":val}
|
|
|
|
+ toolbarApi.cutToolPositionList(qs.stringify(params2)).then(response2=>{
|
|
|
|
+ const res2 = response2.data
|
|
|
|
+ this.cutToolStorgeList = [{"name":"请选择","pointId":""}]
|
|
|
|
+ if(res2.isSuccess){
|
|
|
|
+ let tempList = res2.data
|
|
|
|
+ this.cutToolStorgeList = tempList.map(item=>{
|
|
|
|
+ item.pointId = "CT_"+item.pointId
|
|
|
|
+ return item;
|
|
|
|
+ })
|
|
|
|
+ //console.log(this.cutToolStorgeList)
|
|
|
|
+ }
|
|
|
|
+ }).finally(()=>{
|
|
|
|
+ return true
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }).finally(()=>{
|
|
|
|
+ return true
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
getBomList(){
|
|
getBomList(){
|
|
bomMgrApi.list({}).then(res => {
|
|
bomMgrApi.list({}).then(res => {
|
|
res = res.data
|
|
res = res.data
|
|
@@ -239,51 +336,76 @@ export default {
|
|
}
|
|
}
|
|
console.log(this.tenant)
|
|
console.log(this.tenant)
|
|
//RFID读取校验
|
|
//RFID读取校验
|
|
- /*
|
|
|
|
- taskMgrApi.confirmProcedure({ "taskNodeId":this.tenant.taskNodeId, "trayId": this.tenant.trayId, "clampNo": this.tenant.clampNo}).then((res) => {
|
|
|
|
|
|
+
|
|
|
|
+ let rfidCutterT = "";
|
|
|
|
+ taskMgrApi.cutterRfidConfirmProcedure({ "taskNodeId":this.tenant.taskNodeId, "trayId": this.tenant.trayId, "clampNo": this.tenant.clampNo, "code": this.tenant.code , "zoneId": this.tenant.zoneId})
|
|
|
|
+ .then((res) => {
|
|
res = res.data
|
|
res = res.data
|
|
if (res.isSuccess) {
|
|
if (res.isSuccess) {
|
|
- this.existed = res.data.existed
|
|
|
|
- this.matched = res.data.matched
|
|
|
|
- this.confirmDisabled = false
|
|
|
|
- this.xbkValid = res.data.xbkValid
|
|
|
|
- this.locked = res.data.locked
|
|
|
|
|
|
+ this.addCutToolStockInfo(res.data.rfidCutterT)
|
|
}
|
|
}
|
|
- }); */
|
|
|
|
|
|
+ }).catch((e)=>{
|
|
|
|
+ console.log("异常"+e);
|
|
|
|
+ this.$message({
|
|
|
|
+ message: e,
|
|
|
|
+ type: "error"
|
|
|
|
+ })
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ addCutToolStockInfo(rfidCutterT){
|
|
|
|
+ if(rfidCutterT == null || rfidCutterT ===""){
|
|
|
|
+ this.$message({
|
|
|
|
+ message: "rfid数据读取为空",
|
|
|
|
+ type: "error"
|
|
|
|
+ })
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ console.log("rfidCutterT不为空的时候才能往下执行:"+rfidCutterT);
|
|
|
|
+
|
|
this.existed = 1
|
|
this.existed = 1
|
|
this.matched = true
|
|
this.matched = true
|
|
this.confirmDisabled = false
|
|
this.confirmDisabled = false
|
|
this.locked = false
|
|
this.locked = false
|
|
this.xbkValid = true
|
|
this.xbkValid = true
|
|
- this.addFlag = true
|
|
|
|
-
|
|
|
|
- stationMgrApi.addCutToolStockInfo({ deviceId: this.tenant.id, RFID:"27"}).then((res) => {
|
|
|
|
|
|
+ this.addFlag = true
|
|
|
|
+
|
|
|
|
+ stationMgrApi.addCutToolStockInfo({ deviceId: this.tenant.id, rfid:rfidCutterT}).then((res) => {
|
|
res = res.data;
|
|
res = res.data;
|
|
- if (res.isSuccess) {
|
|
|
|
|
|
+ if (res.isSuccess) {
|
|
let dataInfo = res.data[0]
|
|
let dataInfo = res.data[0]
|
|
this.tableData1.records = []
|
|
this.tableData1.records = []
|
|
this.tableData1.records.push({
|
|
this.tableData1.records.push({
|
|
brandName: dataInfo.brandName,
|
|
brandName: dataInfo.brandName,
|
|
brandNo: dataInfo.brandNo,
|
|
brandNo: dataInfo.brandNo,
|
|
pointId: dataInfo.pointId,
|
|
pointId: dataInfo.pointId,
|
|
- goodsId: dataInfo.goodsId
|
|
|
|
|
|
+ goodsId: dataInfo.goodsId,
|
|
|
|
+ goalType: '',
|
|
|
|
+ targetPointId: '',
|
|
|
|
+ cutGoalNo:'0'
|
|
|
|
+
|
|
})
|
|
})
|
|
this.active++
|
|
this.active++
|
|
}
|
|
}
|
|
}).catch(()=>{});
|
|
}).catch(()=>{});
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
|
|
+ } ,
|
|
prev(){
|
|
prev(){
|
|
if (this.active-- < 0) this.active = 0;
|
|
if (this.active-- < 0) this.active = 0;
|
|
},
|
|
},
|
|
next(){
|
|
next(){
|
|
|
|
+ console.log("---"+this.tableData1);
|
|
|
|
+ this.tableData1.records = this.tableData1
|
|
|
|
+ this.tableData1.records.forEach(item => {
|
|
|
|
+ this.$set(item, 'goalType', '');
|
|
|
|
+ this.$set(item, 'targetPointId', '');
|
|
|
|
+ this.$set(item, 'cutGoalNo', '0');
|
|
|
|
+ });
|
|
|
|
+
|
|
// TODO 写入rfid内容(子盘信息和夹具信息)
|
|
// TODO 写入rfid内容(子盘信息和夹具信息)
|
|
- /*
|
|
|
|
- taskMgrApi.procesRfid({ "id" : this.tenant.id, "clampId" : this.tenant.clampId,rfidType: "write" }).then((res) => {
|
|
|
|
- res = res.data;
|
|
|
|
- }); */
|
|
|
|
|
|
+
|
|
|
|
+ // taskMgrApi.procesRfid({ "id" : this.tenant.id, "clampId" : this.tenant.clampId,rfidType: "write" }).then((res) => {
|
|
|
|
+ // res = res.data;
|
|
|
|
+ // });
|
|
if (this.active++ > 1) this.active = 0;
|
|
if (this.active++ > 1) this.active = 0;
|
|
/*
|
|
/*
|
|
taskMgrApi.getReloadStatus({ "taskNodeId" : this.tenant.taskNodeId}).then((res) => {
|
|
taskMgrApi.getReloadStatus({ "taskNodeId" : this.tenant.taskNodeId}).then((res) => {
|
|
@@ -298,10 +420,14 @@ export default {
|
|
// 更新改任务的开始时间
|
|
// 更新改任务的开始时间
|
|
// TODO 写入rfid内容,工件信息、原材料R
|
|
// TODO 写入rfid内容,工件信息、原材料R
|
|
this.confirmDisabled = true
|
|
this.confirmDisabled = true
|
|
- let valid = this.bBomId != '' && this.orderName != '' ? true: false;
|
|
|
|
|
|
+ let valid = this.tableData1.records[0].pointId != '' &&
|
|
|
|
+ this.tableData1.records[0].goodsId != '' &&
|
|
|
|
+ this.tableData1.records[0].goalType != '' &&
|
|
|
|
+ this.tableData1.records[0].targetPointId != '' ? true: false;
|
|
|
|
+
|
|
if(!valid){
|
|
if(!valid){
|
|
this.$message({
|
|
this.$message({
|
|
- message: "零件编码" + this.$t("rules.require"),
|
|
|
|
|
|
+ message: "目标设备、目的位置、目的刀位号" + this.$t("rules.require"),
|
|
type: "warning"
|
|
type: "warning"
|
|
})
|
|
})
|
|
this.confirmDisabled = false
|
|
this.confirmDisabled = false
|
|
@@ -332,19 +458,30 @@ export default {
|
|
}, 500);
|
|
}, 500);
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- addMaterial(that){
|
|
|
|
- let params = {"orderName":that.orderName,"zoneId":that.tenant.zoneId,"bomId":that.bBomId,"materialId": that.materialId, "start":that.tenant.code}
|
|
|
|
- stationMgrApi.addCutToolTask(params).then((res) => {
|
|
|
|
|
|
+ addMaterial(that){
|
|
|
|
+ let data = that.tableData1.records[0];
|
|
|
|
+ let params = {"brandName":data.brandName,
|
|
|
|
+ "brandNo":data.brandNo,
|
|
|
|
+ "goodsId":data.goodsId,
|
|
|
|
+ "start": "CT_"+ data.pointId,
|
|
|
|
+ "goalType":data.goalType,
|
|
|
|
+ "goal":data.targetPointId,
|
|
|
|
+ "cutStartNo":'0',
|
|
|
|
+ "cutGoalNo":data.cutGoalNo}
|
|
|
|
+
|
|
|
|
+ stationMgrApi.addCutToolTask(params).then((res) => {
|
|
res = res.data;
|
|
res = res.data;
|
|
if (res.isSuccess) {
|
|
if (res.isSuccess) {
|
|
- //写入RFID
|
|
|
|
that.loading = false
|
|
that.loading = false
|
|
that.$emit("success");
|
|
that.$emit("success");
|
|
//通知列表-并关闭弹出框
|
|
//通知列表-并关闭弹出框
|
|
that.$emit("close");
|
|
that.$emit("close");
|
|
}
|
|
}
|
|
- }).finally(()=>{
|
|
|
|
|
|
+ }).catch((e)=>{
|
|
|
|
+ console.log("错误"+ e)
|
|
|
|
+ }).finally(()=>{
|
|
that.confirmDisabled = false
|
|
that.confirmDisabled = false
|
|
|
|
+ that.loading = false
|
|
});
|
|
});
|
|
},
|
|
},
|
|
// table的当前行值变化后
|
|
// table的当前行值变化后
|