新增接口
This commit is contained in:
@@ -44,7 +44,7 @@
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import {queryArea, queryPointByArea, callTask} from '@/utils/getData0.js'
|
||||
import {queryBusinessProcesses, queryPointByArea, callTask} from '@/utils/getData0.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar
|
||||
@@ -61,48 +61,78 @@
|
||||
options4: [],
|
||||
index4: '',
|
||||
options5: [],
|
||||
index5: ''
|
||||
index5: '',
|
||||
retData: '',
|
||||
descObj: {},
|
||||
dtel: ''
|
||||
};
|
||||
},
|
||||
created () {
|
||||
this._queryArea3('')
|
||||
this._queryArea4('')
|
||||
this._queryBusinessProcesses()
|
||||
},
|
||||
methods: {
|
||||
selectChange1 (e) {
|
||||
if(!e){
|
||||
return
|
||||
}
|
||||
this.index1 = e
|
||||
},
|
||||
selectChange2 (e) {
|
||||
if(!e){
|
||||
return
|
||||
}
|
||||
this.index2 = e
|
||||
},
|
||||
selectChange3 (e) {
|
||||
if(!e){
|
||||
return
|
||||
}
|
||||
this.index3 = e
|
||||
this._queryPointByArea1(e)
|
||||
},
|
||||
selectChange4 (e) {
|
||||
if(!e){
|
||||
return
|
||||
}
|
||||
this.index4 = e
|
||||
this._queryPointByArea2(e)
|
||||
},
|
||||
async _queryArea3 (a) {
|
||||
let res = await queryArea(a)
|
||||
this.options3 = [...res]
|
||||
this.options3.map(el => {
|
||||
this.$set(el, 'value', el.region_code)
|
||||
this.$set(el, 'text', el.region_name)
|
||||
selectChange5 (e) {
|
||||
this.index1 = ''
|
||||
this.index2 = ''
|
||||
this.index3 = ''
|
||||
this.index4 = ''
|
||||
this.options1 = []
|
||||
this.options2 = []
|
||||
this.options3 = []
|
||||
this.options4 = []
|
||||
if(!e){
|
||||
return
|
||||
}
|
||||
this.index5 = e
|
||||
let descObj = this.retData.find(item => item.name == e);
|
||||
let dictArr = descObj.dictDetails
|
||||
dictArr.map(el => {
|
||||
if (el.dictSort == 1) {
|
||||
this.options3.push({'value': el.value, 'text' :el.label})
|
||||
}
|
||||
if (el.dictSort == 2) {
|
||||
this.options4.push({'value': el.value, 'text' :el.label})
|
||||
}
|
||||
})
|
||||
},
|
||||
async _queryArea4 (a) {
|
||||
let res = await queryArea(a)
|
||||
this.options4 = [...res]
|
||||
this.options4.map(el => {
|
||||
this.$set(el, 'value', el.region_code)
|
||||
this.$set(el, 'text', el.region_name)
|
||||
async _queryBusinessProcesses () {
|
||||
let res = await queryBusinessProcesses()
|
||||
console.log(res)
|
||||
this.retData = res.data
|
||||
res.data.map(el => {
|
||||
this.options5.push({'value': el.name, 'text' :el.description})
|
||||
})
|
||||
},
|
||||
/** 点位查询1 */
|
||||
async _queryPointByArea1 (a) {
|
||||
let res = await queryPointByArea(a)
|
||||
this.options1 = [...res]
|
||||
this.options1 = [...res.data]
|
||||
this.options1.map(el => {
|
||||
this.$set(el, 'value', el.device_code)
|
||||
this.$set(el, 'text', el.device_name)
|
||||
@@ -111,7 +141,7 @@
|
||||
/** 点位查询2 */
|
||||
async _queryPointByArea2 (a) {
|
||||
let res = await queryPointByArea(a)
|
||||
this.options2 = [...res]
|
||||
this.options2 = [...res.data]
|
||||
this.options2.map(el => {
|
||||
this.$set(el, 'value', el.device_code)
|
||||
this.$set(el, 'text', el.device_name)
|
||||
@@ -120,6 +150,14 @@
|
||||
toClear () {
|
||||
this.index1 = ''
|
||||
this.index2 = ''
|
||||
this.index3 = ''
|
||||
this.index4 = ''
|
||||
this.index5 = ''
|
||||
this.options1 = []
|
||||
this.options2 = []
|
||||
this.options3 = []
|
||||
this.options4 = []
|
||||
this.options5 = []
|
||||
},
|
||||
async _callTask () {
|
||||
this.disabled = true
|
||||
|
||||
@@ -1,25 +1,37 @@
|
||||
import request from './request.js'
|
||||
|
||||
/**
|
||||
* 公共接口
|
||||
*/
|
||||
// 查询区域
|
||||
|
||||
// 查询区域(用不到)
|
||||
export const queryArea = () => request({
|
||||
url:'api/hand/queryArea',
|
||||
data: {}
|
||||
})
|
||||
|
||||
// 根据区域查询点位
|
||||
export const queryPointByArea = (rcode) => request({
|
||||
url:'api/hand/queryPointByArea',
|
||||
data: {
|
||||
region_code: rcode
|
||||
}
|
||||
})
|
||||
// export const queryPointByArea = (rcode) => request({
|
||||
// url:'api/hand/queryPointByArea',
|
||||
// data: {
|
||||
// region_code: rcode
|
||||
// }
|
||||
// })
|
||||
export const queryPointByArea = () => {
|
||||
let res = {
|
||||
data: [
|
||||
{
|
||||
device_name: "147",
|
||||
device_id: "178a645c3b874818b6c0576e1dc6e616",
|
||||
device_code: "147"
|
||||
}
|
||||
],
|
||||
message: "200"
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
/**
|
||||
* 搬运任务
|
||||
*/
|
||||
|
||||
// PDA任务下发接口
|
||||
export const callTask = (sdcode, ndcode, type, material) => request({
|
||||
url:'api/hand/callTask',
|
||||
@@ -31,3 +43,103 @@ export const callTask = (sdcode, ndcode, type, material) => request({
|
||||
}
|
||||
})
|
||||
|
||||
// 查询任务模式以及每个任务模式下对应的区域名称
|
||||
// export const queryBusinessProcesses = () => request({
|
||||
// url:'api/hand/queryBusinessProcesses',
|
||||
// data: {}
|
||||
// })
|
||||
export const queryBusinessProcesses = () => {
|
||||
let res = {
|
||||
"data": [
|
||||
{
|
||||
"createBy": "System",
|
||||
"updatedBy": "System",
|
||||
"createTime": 1738984469000,
|
||||
"updateTime": 1738984469000,
|
||||
"id": 46,
|
||||
"dictDetails": [
|
||||
{
|
||||
"createBy": "System",
|
||||
"updatedBy": "System",
|
||||
"createTime": 1738984714000,
|
||||
"updateTime": 1738984714000,
|
||||
"id": 320,
|
||||
"dict": {
|
||||
"id": 46
|
||||
},
|
||||
"label": "Ⅵ区空托回流区",
|
||||
"value": "07",
|
||||
"dictSort": 1
|
||||
},
|
||||
{
|
||||
"createBy": "System",
|
||||
"updatedBy": "System",
|
||||
"createTime": 1738984739000,
|
||||
"updateTime": 1738984739000,
|
||||
"id": 321,
|
||||
"dict": {
|
||||
"id": 46
|
||||
},
|
||||
"label": "箱体物料区",
|
||||
"value": "08",
|
||||
"dictSort": 2
|
||||
}
|
||||
],
|
||||
"name": "BusinessProcesses_1",
|
||||
"description": "箱体入库"
|
||||
},
|
||||
{
|
||||
"createBy": "System",
|
||||
"updatedBy": "System",
|
||||
"createTime": 1738984482000,
|
||||
"updateTime": 1738984482000,
|
||||
"id": 47,
|
||||
"dictDetails": [
|
||||
{
|
||||
"createBy": "System",
|
||||
"updatedBy": "System",
|
||||
"createTime": 1738984785000,
|
||||
"updateTime": 1738984785000,
|
||||
"id": 322,
|
||||
"dict": {
|
||||
"id": 47
|
||||
},
|
||||
"label": "Ⅵ区空托回流区",
|
||||
"value": "07",
|
||||
"dictSort": 1
|
||||
},
|
||||
{
|
||||
"createBy": "System",
|
||||
"updatedBy": "System",
|
||||
"createTime": 1738984803000,
|
||||
"updateTime": 1738984803000,
|
||||
"id": 323,
|
||||
"dict": {
|
||||
"id": 47
|
||||
},
|
||||
"label": "箱体物料区",
|
||||
"value": "08",
|
||||
"dictSort": 1
|
||||
},
|
||||
{
|
||||
"createBy": "System",
|
||||
"updatedBy": "System",
|
||||
"createTime": 1738984903000,
|
||||
"updateTime": 1738984903000,
|
||||
"id": 324,
|
||||
"dict": {
|
||||
"id": 47
|
||||
},
|
||||
"label": "模组下线区",
|
||||
"value": "01",
|
||||
"dictSort": 2
|
||||
}
|
||||
],
|
||||
"name": "BusinessProcesses_2",
|
||||
"description": "模组下线"
|
||||
},
|
||||
],
|
||||
"message": "200"
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user