|
@@ -39,7 +39,8 @@
|
|
|
</table>
|
|
|
<!-- 下部-货架名称编号 -->
|
|
|
<div class="footerDiv">{{item.name}}({{item.no}})</div>
|
|
|
- <el-button class="el-button--primary generateTask" @click="saveToolTask()">确定</el-button>
|
|
|
+ <span style="font-size: 18px;">还需要换出 <span style="color: red;font-size: 30px;">{{ remainingToolCount }}</span> 把刀</span>
|
|
|
+ <el-button class="el-button--primary generateTask" @click="saveToolTask()">生成任务</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -87,6 +88,7 @@
|
|
|
import axios from 'axios'
|
|
|
// 加载动态数字组件
|
|
|
import countTo from 'vue-count-to'
|
|
|
+ import orderMgrApi from "@/api/runManageCenter/orderMgr";
|
|
|
export default {
|
|
|
name: "LineSideEmulate",
|
|
|
directives: { elDragDialog },
|
|
@@ -100,6 +102,7 @@
|
|
|
type: String,
|
|
|
default:''
|
|
|
},
|
|
|
+ toolCategory:[]
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
@@ -137,7 +140,7 @@
|
|
|
TenantTypeEnum: {},
|
|
|
TenantStatusEnum: {}
|
|
|
},
|
|
|
- cellSelections: {},
|
|
|
+ cellSelections: [],
|
|
|
}
|
|
|
},
|
|
|
// 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
|
|
@@ -159,7 +162,12 @@
|
|
|
},
|
|
|
nationList() {
|
|
|
return convertEnum(this.dicts.NATION)
|
|
|
- }
|
|
|
+ },
|
|
|
+ remainingToolCount() {
|
|
|
+ const count = this.toolCategory.length - this.cellSelections.length;
|
|
|
+ console.log('remainingToolCount:', count);
|
|
|
+ return count;
|
|
|
+ },
|
|
|
},
|
|
|
mounted () {
|
|
|
|
|
@@ -257,12 +265,23 @@
|
|
|
},
|
|
|
selectCell(objTd) {
|
|
|
objTd.selected = !objTd.selected;
|
|
|
+ const count = this.toolCategory.length - this.cellSelections.length;
|
|
|
if(objTd.selected){
|
|
|
+ if(count <= 0){
|
|
|
+ return
|
|
|
+ }
|
|
|
objTd.tdBackground=true;
|
|
|
+ this.cellSelections.push(objTd.id)
|
|
|
+
|
|
|
}else{
|
|
|
objTd.tdBackground=false;
|
|
|
+ const index = this.cellSelections.indexOf(objTd.id);
|
|
|
+ if (index !== -1) {
|
|
|
+ this.cellSelections.splice(index, 1);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+
|
|
|
},
|
|
|
edit (row) {
|
|
|
console.log("row:",)
|
|
@@ -341,7 +360,21 @@
|
|
|
})
|
|
|
},
|
|
|
saveToolTask(){
|
|
|
- console.log("this.detailPlanId:"+this.detailPlanId)
|
|
|
+ console.log("this.toolCategory:"+this.toolCategory)
|
|
|
+ let requestParam={
|
|
|
+ id: this.deviceId,
|
|
|
+ planId: this.detailPlanId,
|
|
|
+ list: this.toolCategory,
|
|
|
+ storgeId: this.cellSelections
|
|
|
+ }
|
|
|
+ console.log(requestParam)
|
|
|
+ orderMgrApi.saveDetailToolTask(requestParam).then(response => {
|
|
|
+ const res = response.data
|
|
|
+ if(res.isSuccess){
|
|
|
+ this.viewClose()
|
|
|
+ }
|
|
|
+ }).finally(() => this.loading = false)
|
|
|
+
|
|
|
},
|
|
|
}
|
|
|
}
|
|
@@ -609,7 +642,7 @@
|
|
|
color: white;
|
|
|
}
|
|
|
.generateTask{
|
|
|
- margin-left: 45% !important;
|
|
|
+ margin-left: 18% !important;
|
|
|
margin-top: 2%;
|
|
|
}
|
|
|
|