接口地址

This commit is contained in:
2023-12-11 10:50:37 +08:00
parent e1e8bdf414
commit 60fcc3b878
6 changed files with 168 additions and 616 deletions

View File

@@ -1,235 +0,0 @@
<template>
<view class="zd_container">
<nav-bar title="呼叫管理"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper grid-wraper">
<view class="locate_block" v-for="e in areaArr" :key="e.region_code">
<view class="locate_name" @click="getPonit (e)">
<view class="title_1">{{e.region_name}}</view>
<view class="iconfont open_icon" :class="{'is_reverse': e.checked === true}"></view>
</view>
<view v-show="e.checked === true" class="site_block" ref="liCon">
<view class="site_item" v-for="(el, i) in e.pointArr" :key="i">
<view class="site_item_box">
<text class="title_2">站点</text>
<view class="site_item_box_inner_r" @click="setcode(el)">
<text>{{el.device_name}}</text>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="submit-bar">
<view class="dot_item">
<view class="p1">起始点</view>
<view class="p2">设备号{{sObj.device_name}}</view>
</view>
<view class="dot_item">
<view class="p1">目标点</view>
<view class="p2">设备号{{nObj.device_name}}</view>
</view>
<view class="btn_block">
<button class="submit-button" :class="{'btn-disabled': JSON.stringify(sObj) === '{}' && JSON.stringify(nObj) === '{}'}" @click="cancle">清空</button>
<button class="submit-button" :class="{'btn-disabled': JSON.stringify(sObj) === '{}' || JSON.stringify(nObj) === '{}'}" :disabled="disabled1" @click="toSure">确认</button>
</view>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import {queryArea, queryPointByArea, callTask} from '@/utils/getData2.js'
export default {
components: {
NavBar
},
data() {
return {
// interTime: this.$store.getters.setTime,
// timer: null,
areaArr: [],
pointArr: [],
regobj: {},
disabled1: false,
sObj: {},
nObj: {},
isS: false
};
},
created () {
this.initArea()
},
// beforeDestroy () {
// clearInterval(this.timer)
// },
methods: {
// refresh (e) {
// this.timer = setInterval(() => {
// this.initPonit(e)
// }, this.interTime)
// },
async initArea () {
let res = await queryArea()
this.areaArr = [...res.result]
this.areaArr.map(el => {
this.$set(el, 'checked', false)
this.$set(el, 'pointArr', [])
})
if (this.areaArr.length > 0) {
this.getPonit(this.areaArr[0])
}
},
async initPonit (e) {
let res = await queryPointByArea(e.region_code)
this.regobj = e
this.areaArr.map(el => {
if (el.region_code === e.region_code) {
this.$set(el, 'pointArr', [...res.result])
}
})
},
getPonit (e) {
// clearInterval(this.timer)
this.areaArr.map(el => {
if (el.region_code !== e.region_code) {
el.checked = false
}
if (el.region_code === e.region_code) {
e.checked = !e.checked
}
})
if (e.checked) {
this.initPonit(e)
// this.refresh(e)
}
},
setcode (el) {
if (this.isS === false) {
this.sObj = el
this.isS = true
} else if (this.isS) {
this.nObj = el
this.isS = false
}
},
/** 清空点位选择 */
cancle () {
this.sObj = {}
this.nObj = {}
this.disabled1 = false
},
toSure () {
this.disabled1 = true
if (JSON.stringify(this.sObj) === '{}' || JSON.stringify(this.nObj) === '{}') {
this.disabled1 = false
return
}
this._callTask()
},
async _callTask () {
try {
let res = await callTask(this.sObj.device_code, this.nObj.device_code)
this.cancle()
uni.showToast({
title: res.desc,
icon: 'none'
})
// clearInterval(this.timer)
// this.timer = null
// setTimeout(() => {
// this.refresh()
// this.cancle()
// }, 2000)
} catch (err) {
this.disabled1 = false
}
}
}
}
</script>
<style lang="stylus">
@import '../../common/style/mixin.styl';
.zd_content
padding-bottom 152rpx
.locate_block
width 100%
.locate_name
position relative
_wh(100%,48rpx)
.title_1
_font(32rpx,48rpx,#000,500)
.open_icon
position absolute
right 0
top 0
_wh(48rpx,48rpx)
_font(40rpx,48rpx,$red,,right)
transition all .3s
transform rotateZ(-90deg)
&:before
content: "\e6db";
.is_reverse
transform rotateZ(90deg)
.site_block
_wh(100%,auto)
overflow hidden
transition height .3s
_fj(flex-start,,,wrap)
padding-bottom 10rpx
.site_item
_wh(32%,100rpx)
padding 0 10rpx
margin-top 12rpx
background-color #e5e5e5
border-radius 5px
overflow hidden
_fj(center)
&:nth-child(3n+2)
margin-left 2%
margin-right 2%
.site_item_box
_wh(100%, 80rpx)
_fj()
.title_2
width 36rpx
_font(28rpx,40rpx,#000,500)
.site_item_box_inner_r
_fj(center)
_wh(calc(100% - 36rpx), 100%)
background-color #fff
border-radius 3px
padding 0 5rpx
overflow hidden
text
_font(28rpx,40rpx,#999,,center)
.submit-bar
justify-content space-between
padding 10rpx
.dot_item
width 35%
background-color #e5e5e5
_fj(center,,column)
.p1
_wh(100%, 52rpx)
_font(30rpx,52rpx,,,center)
border-bottom 1rpx solid #fff
overflow hidden
.p2
_wh(100%, 80rpx)
_fj(center)
padding 0 5rpx
_font(30rpx,40rpx,,,center)
overflow hidden
word-break break-all
.btn_block
_fj(,,column)
align-content: flex-end
.submit-button
line-height 56rpx
margin 0
&:nth-child(1)
margin-bottom 10rpx
</style>

View File

@@ -1,126 +0,0 @@
<template>
<view class="zd_container">
<nav-bar title="任务管理"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper grid-wraper">
<view class="slide_new">
<table>
<thead>
<tr>
<th>任务号</th>
<th>起点</th>
<th>终点</th>
<th>状态</th>
<th>托盘号</th>
<th>物料类型</th>
<th>优先级</th>
<th>时间</th>
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.task_uuid === pkId}">
<td>{{e.task_no}}</td>
<td>{{e.start_devicecode}}</td>
<td>{{e.next_devicecode}}</td>
<td>{{e.task_status_name}}</td>
<td>{{e.vehicle_code}}</td>
<td>{{e.material_type_name}}</td>
<td>{{e.priority}}</td>
<td>{{e.create_time}}</td>
</tr>
</tbody>
</table>
</view>
</view>
</view>
<view class="submit-bar">
<button class="submit-button" :class="{'btn-disabled': !pkId}" :disabled="disabled1" @tap="toSure1('1')">重新生成</button>
<button class="submit-button" :class="{'btn-disabled': !pkId}" :disabled="disabled2" @tap="toSure2('2')">强制完成</button>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import {queryTask, taskOperation} from '@/utils/getData2.js'
export default {
components: {
NavBar
},
data() {
return {
keyword: '',
startPoint: '',
endPoint: '',
dataList: [],
disabled1: false,
disabled2: false,
disabled3: false,
pkId: ''
};
},
created () {
this._queryTask(this.keyword, this.startPoint, this.endPoint)
},
methods: {
async _queryTask () {
let res = await queryTask(this.keyword, this.startPoint, this.endPoint)
if (res.code === '1') {
this.dataList = [...res.result]
} else {
uni.showToast({
title: res.desc,
icon: 'none'
})
}
},
async _taskOperation (type) {
try {
let res = await taskOperation(this.pkId, type)
if (res.code === '1') {
this.disabled1 = false
this.disabled2 = false
this.pkId = ''
this._queryTask()
uni.showToast({
title: res.desc,
icon: 'none'
})
} else {
uni.showToast({
title: res.desc,
icon: 'none'
})
this.disabled1 = false
this.disabled2 = false
}
} catch (err) {
this.disabled1 = false
this.disabled2 = false
}
},
toCheck (e) {
this.pkId = this.pkId === e.task_uuid ? '' : e.task_uuid
},
toSure1 (type) {
this.disabled1 = true
if (!this.pkId) {
this.disabled1 = false
return
}
this._taskOperation(type)
},
toSure2 (type) {
this.disabled2 = true
if (!this.pkId) {
this.disabled2 = false
return
}
this._taskOperation(type)
}
}
}
</script>
<style lang="stylus">
</style>

View File

@@ -1,19 +1,124 @@
<template>
<view>
<view class="zd_container">
<nav-bar title="涂板线下料"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
<view class="filter_item">
<view class="filter_label">区域</view>
<view class="filter_input_wraper">
<uni-data-select v-model="index1" :localdata="options1" @change="selectChange1"></uni-data-select>
</view>
</view>
<view class="filter_item">
<view class="filter_label_wraper">
<span class="filter_label">点位</span>
</view>
<view class="filter_input_wraper">
<uni-data-select v-model="index2" :localdata="options2" @change="selectChange2"></uni-data-select>
</view>
</view>
<view class="filter_item filter_item_1">
<view class="filter_label">载具编码</view>
<view class="filter_input_wraper">
<search-box v-model="val1" @handleChange="handleChange1"/>
</view>
</view>
</view>
</view>
<view class="submit-bar">
<button class="submit-button" :class="{'btn-disabled': !index1 || !index2}" :disabled="disabled1" @tap="toSure">确认</button>
<button class="submit-button" @tap="toCancle">取消</button>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {deviceInfo, deviceStatus, deviceCheckVerify} from '@/utils/getData2.js'
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
options1: [],
index1: '',
options2: [],
index2: '',
remark: '',
disabled1: false
};
},
created () {
this._deviceInfo()
this._deviceStatus()
},
methods: {
/** 选择器 */
selectChange1(e) {
this.index1 = e
},
selectChange2(e) {
this.index2 = e
},
/** 获取设备下拉框 */
async _deviceInfo () {
let res = await deviceInfo()
this.options1 = [...res]
},
/** 获取设备状态下拉框 */
async _deviceStatus () {
let res = await deviceStatus()
this.options2 = [...res]
},
/** 确定 */
async toSure () {
this.disabled1 = true
if (!this.index1) {
uni.showToast({
title: '设备号不能为空',
icon: 'none'
})
this.disabled1 = false
return
}
if (!this.index2) {
uni.showToast({
title: '状态不能为空',
icon: 'none'
})
this.disabled1 = false
return
}
try {
let userName = this.$store.getters.userInfo !== '' ? JSON.parse(this.$store.getters.userInfo).username : ''
let res = await deviceCheckVerify(this.index1, userName,this.remark, this.index2)
this.disabled1 = false
this.index1 = ''
this.index2 = ''
this.remark = ''
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
this.disabled1 = false
}
},
toCancle () {
this.disabled1 = false
this.index1 = ''
this.index2 = ''
this.remark = ''
}
}
}
</script>
<style lang="stylus">
<style lang="stylus" scoped>
.filter_item_1, .filter_input_wraper_1
align-items: flex-start
height 210rpx
</style>

View File

@@ -1,142 +0,0 @@
<template>
<view class="zd_container">
<nav-bar title="指令管理"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper grid-wraper">
<view class="slide_new">
<table>
<thead>
<tr>
<th>任务号</th>
<th>指令号</th>
<th>起点</th>
<th>终点</th>
<th>状态</th>
<th>托盘号</th>
<th>agv车号</th>
<th>物料类型</th>
<th>优先级</th>
<th>时间</th>
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.inst_uuid === pkId}">
<td>{{e.task_no}}</td>
<td>{{e.inst_no}}</td>
<td>{{e.start_devicecode}}</td>
<td>{{e.next_devicecode}}</td>
<td>{{e.inst_status_name}}</td>
<td>{{e.vehicle_code}}</td>
<td>{{e.carno}}</td>
<td>{{e.material_type_name}}</td>
<td>{{e.priority}}</td>
<td>{{e.create_time}}</td>
</tr>
</tbody>
</table>
</view>
</view>
</view>
<view class="submit-bar">
<button class="submit-button" :class="{'btn-disabled': !pkId}" :disabled="disabled1" @tap="toSure1('1')">指令撤销</button>
<button class="submit-button" :class="{'btn-disabled': !pkId}" :disabled="disabled2" @tap="toSure2('2')">重新下发</button>
<button class="submit-button" :class="{'btn-disabled': !pkId}" :disabled="disabled3" @tap="toSure3('3')">强制完成</button>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import {queryInstraction, instOperation} from '@/utils/getData2.js'
export default {
components: {
NavBar
},
data() {
return {
keyword: '',
startPoint: '',
endPoint: '',
dataList: [],
disabled1: false,
disabled2: false,
disabled3: false,
pkId: ''
};
},
created () {
this._queryInstraction(this.keyword, this.startPoint, this.endPoint)
},
methods: {
async _queryInstraction () {
let res = await queryInstraction(this.keyword, this.startPoint, this.endPoint)
if (res.code === '1') {
this.dataList = [...res.result]
} else {
uni.showToast({
title: res.desc,
icon: 'none'
})
}
},
async _instOperation (type) {
try {
let res = await instOperation(this.pkId, type)
if (res.code === '1') {
this.disabled1 = false
this.disabled2 = false
this.disabled3 = false
this.pkId = ''
this._queryInstraction()
uni.showToast({
title: res.desc,
icon: 'none'
})
} else {
uni.showToast({
title: res.desc,
icon: 'none'
})
this.disabled1 = false
this.disabled2 = false
this.disabled3 = false
}
} catch (err) {
this.disabled1 = false
this.disabled2 = false
this.disabled3 = false
}
},
toCheck (e) {
this.pkId = this.pkId === e.inst_uuid ? '' : e.inst_uuid
},
toSure1 (type) {
this.disabled1 = true
if (!this.pkId) {
this.disabled1 = false
return
}
this._instOperation(type)
},
toSure2 (type) {
this.disabled2 = true
if (!this.pkId) {
this.disabled2 = false
return
}
this._instOperation(type)
},
toSure3 (type) {
this.disabled3 = true
if (!this.pkId) {
this.disabled3 = false
return
}
this._instOperation(type)
}
}
}
</script>
<style lang="stylus">
</style>