作者 张晓杰

机器人

import { axios } from '@/utils/request'
export function getRobotCabins() {
return axios({
url: '/robotCabin/tblRobotCabin/queryList',
method: 'get',
})
}
\ No newline at end of file
... ...
import { axios } from '@/utils/request'
export function getRobotPoints() {
return axios({
url: '/robotPoints/tblRobotPoints/queryList',
method: 'get',
})
}
export function getRobotGoCharge() {
return axios({
url: '/robotPoints/tblRobotPoints/getRobotGoCharge',
method: 'get',
})
}
export function returnToCabin() {
return axios({
url: '/robotPoints/tblRobotPoints/returnToCabin',
method: 'get',
})
}
export function cancleRobotMove() {
return axios({
url: '/robotPoints/tblRobotPoints/cancleMove',
method: 'put',
})
}
... ...
... ... @@ -83,6 +83,7 @@ export const JeecgListMixin = {
this.ipagination.current = 1;
}
var params = this.getQueryParams();//查询条件
console.log('params========',params)
this.loading = true;
getAction(this.url.list, params).then((res) => {
if (res.success) {
... ...
... ... @@ -41,6 +41,10 @@
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button @click="callRobot" type="primary" icon="reddit">机器人召唤送物</a-button>
<a-button @click="callRobotReturnToCabin" type="primary" icon="api">机器人返回舱位点</a-button>
<a-button @click="callRobotGoCharge" type="primary" icon="api">机器人返回充电桩</a-button>
<!-- <a-button @click="callRobotMoveShow" type="primary" icon="api">机器人取消任务</a-button> -->
</div>
<!-- table区域-begin -->
... ... @@ -67,12 +71,125 @@
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
<!-- <a-divider type="vertical" />
<a @click="callRobot">召唤机器人</a> -->
</span>
</a-table>
</div>
<tbl-depot-in-modal ref="modalForm" @ok="modalFormOk"></tbl-depot-in-modal>
<!-- 召唤机器人送物 -->
<a-modal v-model="showRobot" title="机器人任务" on-ok="handleOk" width="800px">
<template slot="footer">
<a-button key="back" @click="handleCancel">
取消
</a-button>
<a-button key="submit" type="primary" :loading="loading" @click="handleOk">
确定
</a-button>
</template>
<a-form-model ref="form" :model="model" :rules="validatorRules" >
<a-row>
<a-col :span="24">
<a-form-model-item label="选择机器人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operTime" rule = "{ required: true, message: '请选择机器人!' }">
<a-select size="small" v-model="model.robotName" placeholder="请选择机器人" allowClear>
<a-select-option v-for="(item,index) in robotOptions" :key="index" :value="item.id">
<img :src="item.img" style="float: left; height: 20px; margin-top: 2px; margin-right: 10px;">
<span style="float: left">{{ item.value }}</span>
</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="24" v-if="model.robotName === 'SCSK08C0450100861'">
<a-form-model-item label="选择召唤点" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operTime">
<a-select size="small" v-model="model.via" placeholder="请选择召唤点" allowClear>
<a-select-option v-for="(item,index) in pointOptions" :key="index" :value="item.pointId">
{{ item.pointName }}
</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="选择目标点" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operTime">
<a-select size="small" v-model="model.pointId" placeholder="请选择目标点" allowClear>
<a-select-option v-for="(item,index) in pointOptions" :key="index" :value="item.pointId">
{{ item.pointName }}
</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<!-- <a-col :span="24">
<a-form-model-item label="选择机器人任务流" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operTime">
<a-select size="small" v-model="model.templateId" placeholder="请选择机器人任务流" allowClear style="width: 100%" @change="handleChange">
<a-select-option v-for="(item,index) in templateIdOptions" :key="index" :value="item.id">{{ item.value }}</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
v-if="model.templateId === 'dock_cabin_and_move_target_with_wait_action'"
-->
<a-col :span="24" v-if="model.robotName === 'SCWM00JS48YF01635'">
<a-form-model-item label="输入超时时间(秒)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="overtime">
<a-input-number :min="0" placeholder="请输入超时时间(秒)" style="width: 250px;" v-model="model.overtime"></a-input-number>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</a-modal>
<!-- 机器人返回舱位 -->
<a-modal v-model="showRobot1" title="机器人返回舱位" on-ok="handleOk1" width="800px">
<template slot="footer">
<a-button key="back" @click="handleCancel1">
取消
</a-button>
<a-button key="submit" type="primary" :loading="loading" @click="handleOk1">
确定
</a-button>
</template>
<a-form-model ref="form" :model="model" :rules="validatorRules" >
<a-row>
<a-col :span="24">
<a-form-model-item label="选择机器人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operTime">
<a-select size="small" v-model="model.robotName" placeholder="请选择机器人" allowClear>
<a-select-option v-for="(item,index) in robotOptions" :key="index" :value="item.id">
<img :src="item.img" style="float: left; height: 16px; margin-top: 2px;">
<span style="float: left">{{ item.value }}</span>
</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="选择机器人舱位点" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operTime">
<a-select size="small" v-model="model.cabinId" placeholder="请选择机器人舱位点" allowClear>
<a-select-option v-for="(item,index) in cabinOptions" :key="index" :value="item.cabinId">{{ item.cabinName }}</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</a-modal>
<a-modal v-model="callRobotMoveShowDialog" title="选择机器人动作" on-ok="handleOk2" width="800px">
<template slot="footer">
<a-button key="back" @click="handleCancel2">
取消
</a-button>
<a-button key="submit" type="primary" :loading="loading" @click="handleOk2">
确定
</a-button>
</template>
<a-form-model ref="form" :model="model" :rules="validatorRules" >
<a-row>
<a-col :span="24">
<a-form-model-item label="选择机器人动作" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operTime">
<a-select size="small" v-model="model.option" placeholder="请选择机器人" allowClear>
<a-select-option v-for="(item,index) in cancleMoveOptions" :key="index" :value="item.id">{{ item.value }}</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</a-modal>
</a-card>
</template>
<script>
... ... @@ -81,7 +198,9 @@ import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import TblDepotInModal from './modules/TblDepotInModal'
import { mapGetters } from 'vuex'
import { httpAction} from '@/api/manage'
import {getRobotPoints,getRobotGoCharge} from '@/api/RobotPoints'
import {getRobotCabins} from '@/api/RobotCabin'
export default {
name: 'TblDepotInList',
mixins: [JeecgListMixin, mixinDevice],
... ... @@ -93,6 +212,42 @@ export default {
deleteFlg: false,
description: 'tbl_depot管理页面',
toggleSearchStatus: true,
showRobot:false,
showRobot1:false,
callRobotMoveShowDialog: false,
loading: false,
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
robotOptions:[
{id:"SCWM00JS48YF01635",value:"开放收物上舱",img:require("../../assets/kaifangcang.png")},
{id:"SCSK08C0450100861",value:"送物上舱",img:require("../../assets/songwushangcang.png")}
],
cancleMoveOptions:[
{id:"BACK_DEFAULT_ORIGIN",value:"取消后回充"},
{id:"DONT_BACK_DEFAULT_ORIGIN",value:"取消后停留在原地"}
],
cabinOptions:[],
pointOptions:[],
templateIdOptions:[
{id:"docking_cabin_and_move_target",value:"上舱移动到目的地"},
{id:"dock_cabin_to_move_and_lift_down",value:"上舱移动到目的地并放下上舱"},
{id:"dock_cabin_and_move_target_with_wait_action",value:"上舱移动到目的地,超时返回"},
{id:"docking_cabin_and_docking_down",value:"上舱移动到另外一个舱位并放下"},
{id:"move_target_and_lift_down",value:"上舱移动到目的地并放下上舱"},
],
validatorRules: {
robotName: [{ required: true, message: '请选择机器人!' }],
pointId: [{ required: true, message: '请选择目标点位!' }],
templateId: [{ required: true, message: '请选择机器人任务!' }],
},
model:{},
confirmLoading: false,
// 表头
columns: [
{
... ... @@ -159,6 +314,9 @@ export default {
deleteBatch: '/depot/tblDepot/deleteBatch',
exportXlsUrl: '/depot/tblDepot/exportXls',
importExcelUrl: 'depot/tblDepot/importExcel',
callRobotMove: '/robotPoints/tblRobotPoints/movetoTarget',
callRobotReturnToCabin: '/robotPoints/tblRobotPoints/returnToCabin',
cancleRobotMove: '/robotPoints/tblRobotPoints/cancleMove',
},
dictOptions: {},
superFieldList: [],
... ... @@ -174,6 +332,7 @@ export default {
},
},
methods: {
...mapGetters(["nickname", "avatar", "userInfo"]),
delete() {
if (this.nickname() === '管理员') {
... ... @@ -181,6 +340,11 @@ export default {
}
},
initDictConfig() { },
handleChange(value) {
console.log(this.model.cabinId);
},
getSuperFieldList() {
let fieldList = []
fieldList.push({ type: 'string', value: 'partNumber', text: '零件编号', dictCode: '' })
... ... @@ -192,6 +356,139 @@ export default {
fieldList.push({ type: 'date', value: 'operTime', text: '出入库时间' })
this.superFieldList = fieldList
},
callRobot(){
this.showRobot = true;
this.getRobotPoints()
},
getRobotPoints(){
getRobotPoints().then((res)=>{
if(res.success){
this.pointOptions = res.result
}
});
},
getRobotCabins(){
getRobotCabins().then((res)=>{
console.log(res)
if(res.success){
this.cabinOptions = res.result
}
});
},
callRobotReturnToCabin(){
this.showRobot1 = true
this.getRobotCabins()
},
callRobotGoCharge(){
getRobotGoCharge().then((res)=>{
// console.log('res===',res)
if (res.success) {
this.$message.success(res.message)
this.$emit('ok')
} else {
this.$message.warning(res.message)
}
});
},
callRobotMoveShow(){
this.callRobotMoveShowDialog = true
},
handleOk(e) {
this.$refs.form.validate((valid) => {
if (valid) {
this.model.templateId = 'dock_cabin_and_move_target_with_wait_action'
this.confirmLoading = true
let httpurl = ''
let method = ''
httpurl += this.url.callRobotMove
method = 'post'
console.log(this.model)
// return
httpAction(httpurl, this.model, method)
.then((res) => {
if (res.success) {
this.$message.success(res.message)
this.$emit('ok')
} else {
this.$message.warning(res.message)
}
})
.finally(() => {
this.showRobot = false
this.confirmLoading = false
this.handleCancel()
})
}
})
},
handleCancel(e) {
this.showRobot = false;
this.model = {}
},
handleOk1(e) {
this.$refs.form.validate((valid) => {
if (valid) {
this.confirmLoading = true
let httpurl = ''
let method = ''
httpurl += this.url.callRobotReturnToCabin
method = 'post'
console.log(this.model)
// return
httpAction(httpurl, this.model, method)
.then((res) => {
if (res.success) {
this.$message.success(res.message)
this.$emit('ok')
} else {
this.$message.warning(res.message)
}
})
.finally(() => {
// this.showRobot1 = false
this.confirmLoading = false
this.handleCancel1()
})
}
})
},
handleOk2(e) {
this.$refs.form.validate((valid) => {
if (valid) {
this.confirmLoading = true
let httpurl = ''
let method = ''
httpurl += this.url.cancleRobotMove
method = 'post'
// console.log(this.model)
// return
httpAction(httpurl, this.model, method)
.then((res) => {
if (res.success) {
this.$message.success(res.message)
this.$emit('ok')
} else {
this.$message.warning(res.message)
}
})
.finally(() => {
// this.showRobot1 = false
this.confirmLoading = false
this.handleCancel2()
})
}
})
},
handleCancel1(e) {
this.showRobot1 = false;
this.model ={}
},
handleCancel2(e) {
this.callRobotMoveShowDialog = false;
this.model ={}
},
},
}
</script>
... ...
... ... @@ -46,18 +46,10 @@
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<!-- <a-button type="primary" icon="download" @click="handleExportXls('tbl_depot')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload> -->
<!-- 高级查询区域 -->
<!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> -->
<!-- <a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
</a-dropdown> -->
<a-button @click="callRobot" type="primary" icon="reddit">机器人召唤送物</a-button>
<a-button @click="callRobotReturnToCabin" type="primary" icon="api">机器人返回舱位点</a-button>
<a-button @click="callRobotGoCharge" type="primary" icon="api">机器人返回充电桩</a-button>
<!-- <a-button @click="callRobotMoveShow" type="primary" icon="api">机器人取消任务</a-button> -->
</div>
<!-- table区域-begin -->
... ... @@ -98,6 +90,105 @@
</div>
<tbl-depot-out-modal ref="modalForm" @ok="modalFormOk"></tbl-depot-out-modal>
<a-modal v-model="showRobot" title="机器人任务" on-ok="handleOk" width="800px">
<template slot="footer">
<a-button key="back" @click="handleCancel">
取消
</a-button>
<a-button key="submit" type="primary" :loading="loading" @click="handleOk">
确定
</a-button>
</template>
<!-- 召唤机器人送物 -->
<a-form-model ref="form" :model="model" :rules="validatorRules" >
<a-row>
<a-col :span="24">
<a-form-model-item label="选择机器人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operTime">
<a-select size="small" v-model="model.robotName" placeholder="请选择机器人" allowClear>
<a-select-option v-for="(item,index) in robotOptions" :key="index" :value="item.id">
<img :src="item.img" style="float: left; height: 16px; margin-top: 2px;margin-right: 10px;">
<span style="float: left">{{ item.value }}</span>
</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="24" v-if="model.robotName === 'SCSK08C0450100861'">
<a-form-model-item label="选择召唤点" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operTime">
<a-select size="small" v-model="model.via" placeholder="请选择召唤点" allowClear>
<a-select-option v-for="(item,index) in pointOptions" :key="index" :value="item.pointId">
{{ item.pointName }}
</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="选择目标点" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operTime">
<a-select size="small" v-model="model.pointId" placeholder="请选择目标点" allowClear>
<a-select-option v-for="(item,index) in pointOptions" :key="index" :value="item.pointId">{{ item.pointName }}</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="24" v-if="model.robotName === 'SCWM00JS48YF01635'">
<a-form-model-item label="输入超时时间(秒)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="overtime">
<a-input-number :min="0" placeholder="请输入超时时间(秒)" style="width: 250px;" v-model="model.overtime"></a-input-number>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</a-modal>
<!-- 机器人返回舱位 -->
<a-modal v-model="showRobot1" title="机器人返回舱位" on-ok="handleOk1" width="800px">
<template slot="footer">
<a-button key="back" @click="handleCancel1">
取消
</a-button>
<a-button key="submit" type="primary" :loading="loading" @click="handleOk1">
确定
</a-button>
</template>
<a-form-model ref="form" :model="model" :rules="validatorRules" >
<a-row>
<a-col :span="24">
<a-form-model-item label="选择机器人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operTime">
<a-select size="small" v-model="model.robotName" placeholder="请选择机器人" allowClear>
<a-select-option v-for="(item,index) in robotOptions" :key="index" :value="item.id">
<img :src="item.img" style="float: left; height: 16px; margin-top: 2px;margin-right: 10px;" >
<span style="float: left">{{ item.value }}</span>
</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="选择机器人舱位点" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operTime">
<a-select size="small" v-model="model.cabinId" placeholder="请选择机器人舱位点" allowClear>
<a-select-option v-for="(item,index) in cabinOptions" :key="index" :value="item.cabinId">{{ item.cabinName }}</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</a-modal>
<a-modal v-model="callRobotMoveShowDialog" title="选择机器人动作" on-ok="handleOk2" width="800px">
<template slot="footer">
<a-button key="back" @click="handleCancel2">
取消
</a-button>
<a-button key="submit" type="primary" :loading="loading" @click="handleOk2">
确定
</a-button>
</template>
<a-form-model ref="form" :model="model" :rules="validatorRules" >
<a-row>
<a-col :span="24">
<a-form-model-item label="选择机器人动作" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operTime">
<a-select size="small" v-model="model.option" placeholder="请选择机器人" allowClear>
<a-select-option v-for="(item,index) in cancleMoveOptions" :key="index" :value="item.id">{{ item.value }}</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</a-modal>
</a-card>
</template>
... ... @@ -108,7 +199,9 @@ import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import TblDepotOutModal from './modules/TblDepotOutModal'
import { mapGetters } from 'vuex'
import {getRobotPoints,getRobotGoCharge} from '@/api/RobotPoints'
import {getRobotCabins} from '@/api/RobotCabin'
import { httpAction} from '@/api/manage'
export default {
name: 'TblDepotOutList',
mixins: [JeecgListMixin, mixinDevice],
... ... @@ -206,10 +299,54 @@ export default {
deleteBatch: "/depot/tblDepot/deleteBatch",
exportXlsUrl: "/depot/tblDepot/exportXls",
importExcelUrl: "depot/tblDepot/importExcel",
callRobotMove: '/robotPoints/tblRobotPoints/movetoTarget',
cancleRobotMove: '/robotPoints/tblRobotPoints/cancleMove',
},
dictOptions: {},
superFieldList: [],
model:{},
confirmLoading: false,
showRobot:false,
showRobot1:false,
loading: false,
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
robotOptions:[
{id:"SCWM00JS48YF01635",value:"开放收物上舱",img:require("../../assets/kaifangcang.png")},
{id:"SCSK08C0450100861",value:"送物上舱",img:require("../../assets/kaifangcang.png")}
],
cancleMoveOptions:[
{id:"BACK_DEFAULT_ORIGIN",value:"取消后回充"},
{id:"DONT_BACK_DEFAULT_ORIGIN",value:"取消后停留在原地"}
],
callRobotMoveShowDialog: false,
cabinOptions:[],
pointOptions:[],
// templateIdOptions:[
// {id:"dock_cabin_to_move_and_lift_down",value:"调度底盘去某个上仓举起并移动到另外点位放下"},
// {id:"docking_cabin_and_docking_down",value:"调度底盘移动上舱举起并移动到另外一个舱位放下"},
// {id:"docking_cabin_and_move_target",value:"调度底盘移动上舱举起并移动到目标点"},
// {id:"move_target_and_lift_down",value:"托举上舱移动到目的地并且放下上舱"},
// {id:"dock_cabin_and_move_target_with_wait_action",value:"让某舱到某目的地"}
// ],
templateIdOptions:[
{id:"docking_cabin_and_move_target",value:"上舱移动到目的地"},
{id:"dock_cabin_to_move_and_lift_down",value:"上舱移动到目的地并放下上舱"},
{id:"dock_cabin_and_move_target_with_wait_action",value:"上舱移动到目的地,超时返回"},
{id:"docking_cabin_and_docking_down",value:"上舱移动到另外一个舱位并放下"},
{id:"move_target_and_lift_down",value:"上舱移动到目的地并放下上舱"},
],
validatorRules: {
robotName: [{ required: true, message: '请选择机器人!' }],
pointId: [{ required: true, message: '请选择目标点位!' }],
templateId: [{ required: true, message: '请选择机器人任务!' }],
},
}
},
created() {
... ... @@ -241,7 +378,150 @@ export default {
fieldList.push({ type: 'date', value: 'operTime', text: '出入库时间' })
fieldList.push({ type: 'string', value: 'ling', text: '领料人' })
this.superFieldList = fieldList
},
handleOk2(e) {
this.$refs.form.validate((valid) => {
if (valid) {
this.confirmLoading = true
let httpurl = ''
let method = ''
httpurl += this.url.cancleRobotMove
method = 'post'
// console.log(this.model)
// console.log(httpurl)
// return
httpAction(httpurl, this.model, method)
.then((res) => {
if (res.success) {
this.$message.success(res.message)
this.$emit('ok')
} else {
this.$message.warning(res.message)
}
})
.finally(() => {
this.confirmLoading = false
this.handleCancel2()
})
}
})
},
handleCancel2(e) {
this.callRobotMoveShowDialog = false;
this.model ={}
},
callRobot(){
this.showRobot = true;
this.getRobotPoints()
this.model = {}
},
callRobotReturnToCabin(){
this.showRobot1 = true
this.getRobotCabins()
},
getRobotPoints(){
getRobotPoints().then((res)=>{
// console.log('res===',res)
if(res.success){
this.pointOptions = res.result
}
});
},
getRobotCabins(){
getRobotCabins().then((res)=>{
console.log(res)
if(res.success){
this.cabinOptions = res.result
}
});
},
callRobotGoCharge(){
getRobotGoCharge().then((res)=>{
// console.log('res===',res)
if (res.success) {
this.$message.success(res.message)
this.$emit('ok')
} else {
this.$message.warning(res.message)
}
});
},
handleChange(value) {
console.log(this.model.cabinId);
},
handleOk(e) {
// this.loading = true;
// setTimeout(() => {
// this.showRobot = false;
// this.loading = false;
// }, 3000);
this.$refs.form.validate((valid) => {
if (valid) {
this.model.templateId = 'dock_cabin_and_move_target_with_wait_action'
this.confirmLoading = true
let httpurl = ''
let method = ''
httpurl += this.url.callRobotMove
method = 'post'
console.log(this.model)
// return
httpAction(httpurl, this.model, method)
.then((res) => {
if (res.success) {
this.$message.success(res.message)
this.$emit('ok')
} else {
this.$message.warning(res.message)
}
})
.finally(() => {
// this.showRobot = false
this.confirmLoading = false
this.handleCancel()
})
}
})
},
handleCancel(e) {
this.showRobot = false;
this.model = {}
},
handleOk1(e) {
this.$refs.form.validate((valid) => {
if (valid) {
this.confirmLoading = true
let httpurl = ''
let method = ''
httpurl += this.url.callRobotReturnToCabin
method = 'post'
// console.log(this.model)
// return
httpAction(httpurl, this.model, method)
.then((res) => {
if (res.success) {
this.$message.success(res.message)
this.$emit('ok')
} else {
this.$message.warning(res.message)
}
})
.finally(() => {
// this.showRobot1 = false
this.confirmLoading = false
this.handleCancel1()
})
}
})
},
handleCancel1(e) {
this.showRobot1 = false;
this.model ={}
},
callRobotMoveShow(){
this.callRobotMoveShowDialog = true
},
}
}
</script>
... ...
... ... @@ -3,11 +3,6 @@
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<!-- <a-col :span="24">
<a-form-model-item label="创建人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="createBy">
<a-input v-model="model.createBy" placeholder="请输入创建人"></a-input>
</a-form-model-item>
</a-col> -->
<a-col :span="24">
<a-form-model-item label="编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partNumber">
<a-input v-model="model.partNumber" placeholder="请输入编号" @blur="autoInput" @keyup.enter.native="autoInput"
... ... @@ -53,6 +48,27 @@
<j-date placeholder="请选择入库时间" v-model="model.operTime" style="width: 100%" />
</a-form-model-item>
</a-col>
<!-- <a-col :span="24">
<a-form-model-item label="选择机器人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="robotName">
<a-select size="small" v-model="model.robotName" placeholder="请选择机器人" allowClear>
<a-select-option v-for="(item,index) in robotOptions" :key="index" :value="item.id">{{ item.value }}</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="选择目标点位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pointId">
<a-select size="small" v-model="model.pointId" placeholder="请选择目标点位" allowClear>
<a-select-option v-for="(item,index) in pointOptions" :key="index" :value="item.pointId">{{ item.pointName }}</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="选择机器人任务流" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="templateId">
<a-select size="small" v-model="model.templateId" placeholder="请选择机器人任务流" allowClear style="width: 100%">
<a-select-option v-for="(item,index) in templateIdOptions" :key="index" :value="item.id">{{ item.value }}</a-select-option>
</a-select>
</a-form-model-item>
</a-col> -->
</a-row>
</a-form-model>
</j-form-container>
... ... @@ -62,7 +78,7 @@
<script>
import { httpAction, getAction, getPartNumber } from '@/api/manage'
import { validateDuplicateValue, formatDate } from '@/utils/util'
import {getRobotPoints} from '@/api/RobotPoints'
export default {
name: 'TblDepotInForm',
... ... @@ -99,15 +115,31 @@ export default {
type: [{ required: true, message: '请输入型号!' }],
buyingClassify: [{ required: true, message: '请输入采购性质!' }],
operNumber: [{ required: true, message: '请输入数量!' }],
// createBy:[{ required: true, message: '请输入创建人!' }],
robotName: [{ required: true, message: '请选择机器人!' }],
pointId: [{ required: true, message: '请选择目标点位!' }],
templateId: [{ required: true, message: '请选择机器人任务!' }],
},
robotOptions:[
{id:"SCWM00JS48YF01635",value:"开放收物上舱"},
{id:"SCSK08C0450100861",value:"送物上舱"}
],
pointOptions:[],
templateIdOptions:[
{id:"dock_cabin_to_move_and_lift_down",value:"调度底盘去某个上仓举起并移动到另外点位放下"},
{id:"docking_cabin_and_docking_down",value:"调度底盘移动上舱举起并移动到另外一个舱位放下"},
{id:"docking_cabin_and_move_target",value:"调度底盘移动上舱举起并移动到目标点"},
{id:"move_target_and_lift_down",value:"托举上舱移动到目的地并且放下上舱"},
{id:"dock_cabin_and_move_target_with_wait_action",value:"让某舱到某目的地"}
],
url: {
add: '/depot/tblDepot/add',
edit: '/depot/tblDepot/edit',
queryById: '/depot/tblDepot/queryById',
queryMaterial: '/depot/tblDepot/queryMaterialByPartNum',
queryPartNumber: '/depot/tblDepot/queryPartNumber'
queryPartNumber: '/depot/tblDepot/queryPartNumber',
// queryRobotPoints: '/robotPoints/tblRobotPoints/queryList'
},
}
},
computed: {
... ... @@ -124,8 +156,18 @@ export default {
created() {
//备份model原始值
this.modelDefault = JSON.parse(JSON.stringify(this.model))
// this.getRobotPoints()
},
methods: {
getRobotPoints(){
var that = this;
getRobotPoints().then((res)=>{
console.log('res===',res)
if(res.success){
this.pointOptions = res.result
}
});
},
onClick(val) {
this.model.partNumber = val
this.$emit('partNumber', this.model.partNumber)
... ... @@ -171,6 +213,8 @@ export default {
httpurl += this.url.edit
method = 'put'
}
console.log(this.model)
// return
httpAction(httpurl, this.model, method)
.then((res) => {
if (res.success) {
... ...
... ... @@ -63,6 +63,41 @@
<j-date placeholder="请选择出库时间" v-model="model.operTime" style="width: 100%" />
</a-form-model-item>
</a-col>
<!-- <a-col>
<a-form-model-item label="是否召唤机器人送物" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operTime">
<a-radio-group v-model="model.isCallRobot" @change="onChangeRobot">
<a-radio value="1">
</a-radio>
<a-radio value="2">
</a-radio>
</a-radio-group>
</a-form-model-item>
</a-col> -->
<!-- <div v-if="model.isCallRobot =='1'">
<a-col :span="24">
<a-form-model-item label="选择机器人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="robotName">
<a-select size="small" v-model="model.robotName" placeholder="请选择机器人" allowClear>
<a-select-option v-for="(item,index) in robotOptions" :key="index" :value="item.id">{{ item.value }}</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="选择目标点位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pointId">
<a-select size="small" v-model="model.pointId" placeholder="请选择目标点位" allowClear>
<a-select-option v-for="(item,index) in pointOptions" :key="index" :value="item.pointId">{{ item.pointName }}</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="选择机器人任务流" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="templateId">
<a-select size="small" v-model="model.templateId" placeholder="请选择机器人任务流" allowClear style="width: 100%">
<a-select-option v-for="(item,index) in templateIdOptions" :key="index" :value="item.id">{{ item.value }}</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
</div> -->
</a-row>
</a-form-model>
</j-form-container>
... ... @@ -72,7 +107,7 @@
<script>
import { httpAction, getAction, getPartNumber } from '@/api/manage'
import { validateDuplicateValue, formatDate } from '@/utils/util'
import {getRobotPoints} from '@/api/RobotPoints'
export default {
name: 'TblDepotOutForm',
components: {},
... ... @@ -86,11 +121,13 @@ export default {
},
data() {
return {
// value: 1,
versionList: [],
isShow: false,
flag: false,
model: {
operTime: formatDate(new Date().getTime(), 'yyyy-MM-dd'),
isCallRobot:'1'
},
labelCol: {
xs: { span: 24 },
... ... @@ -111,7 +148,22 @@ export default {
workOrder: [{ required: true, message: '请输入工作令!' }],
ling:[{ required: true, message: '请输入领料人!' }],
lingSysOrgCode:[{ required: true, message: '请输入领料环节!' }],
robotName: [{ required: true, message: '请选择机器人!' }],
pointId: [{ required: true, message: '请选择目标点位!' }],
templateId: [{ required: true, message: '请选择机器人任务!' }],
},
robotOptions:[
{id:"SCWM00JS48YF01635",value:"开放收物上舱"},
{id:"SCSK08C0450100861",value:"送物上舱"}
],
pointOptions:[],
templateIdOptions:[
{id:"dock_cabin_to_move_and_lift_down",value:"调度底盘去某个上仓举起并移动到另外点位放下"},
{id:"docking_cabin_and_docking_down",value:"调度底盘移动上舱举起并移动到另外一个舱位放下"},
{id:"docking_cabin_and_move_target",value:"调度底盘移动上舱举起并移动到目标点"},
{id:"move_target_and_lift_down",value:"托举上舱移动到目的地并且放下上舱"},
{id:"dock_cabin_and_move_target_with_wait_action",value:"让某舱到某目的地"}
],
url: {
add: '/depot/tblDepot/add',
edit: '/depot/tblDepot/edit',
... ... @@ -136,8 +188,22 @@ export default {
created() {
//备份model原始值
this.modelDefault = JSON.parse(JSON.stringify(this.model))
// this.getRobotPoints()
},
methods: {
onChangeRobot(e) {
console.log('radio checked', e.target.value);
console.log('radio checked11', this.model.isCallRobot);
},
getRobotPoints(){
var that = this;
getRobotPoints().then((res)=>{
console.log('res===',res)
if(res.success){
this.pointOptions = res.result
}
});
},
onClickOut(val) {
this.model.partNumber = val
this.$emit('partNumber', this.model.partNumber)
... ...
... ... @@ -465,6 +465,18 @@
scopedSlots: { customRender: 'action' }
}
],
/* 分页参数 */
ipagination:{
current: 1,
pageSize: 30,
pageSizeOptions: ['30', '50', '100'],
showTotal: (total, range) => {
return range[0] + "-" + range[1] + " 共" + total + "条"
},
showQuickJumper: true,
showSizeChanger: true,
total: 0
},
url: {
list: "/trad/tblTradZong/list",
delete: "/trad/tblTradZong/delete",
... ...