接口
This commit is contained in:
@@ -17,26 +17,10 @@
|
|||||||
<uni-data-select v-model="index1" :localdata="options1" @change="selectChange1"></uni-data-select>
|
<uni-data-select v-model="index1" :localdata="options1" @change="selectChange1"></uni-data-select>
|
||||||
</view>
|
</view>
|
||||||
</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">
|
|
||||||
<view class="filter_label_wraper">
|
|
||||||
<span class="filter_label">物料重量</span>
|
|
||||||
</view>
|
|
||||||
<view class="filter_input_wraper">
|
|
||||||
<input type="number" class="filter_input" v-model="val2">
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="submit-bar">
|
<view class="submit-bar">
|
||||||
<button class="submit-button" :class="{'btn-disabled': !index1 || !index2}" :disabled="disabled1" @tap="toSure">确认</button>
|
<button class="submit-button" :class="{'btn-disabled': !val1 || !index1}" :disabled="disabled1" @tap="toSure">确认</button>
|
||||||
<button class="submit-button" @tap="toCancle">取消</button>
|
<button class="submit-button" @tap="toCancle">取消</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -45,7 +29,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import NavBar from '@/components/NavBar.vue'
|
import NavBar from '@/components/NavBar.vue'
|
||||||
import SearchBox from '@/components/SearchBox.vue'
|
import SearchBox from '@/components/SearchBox.vue'
|
||||||
import {deviceInfo, deviceStatus, deviceCheckVerify} from '@/utils/getData2.js'
|
import {getBlendingCode, sendTask} from '@/utils/getData1.js'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
NavBar,
|
NavBar,
|
||||||
@@ -54,16 +38,13 @@
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
val1: '',
|
val1: '',
|
||||||
val2: '',
|
|
||||||
options1: [],
|
options1: [],
|
||||||
index1: '',
|
index1: '',
|
||||||
options2: [],
|
|
||||||
index2: '',
|
|
||||||
disabled1: false
|
disabled1: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
this._deviceInfo()
|
this._getBlendingCode()
|
||||||
this._deviceStatus()
|
this._deviceStatus()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -71,44 +52,23 @@
|
|||||||
selectChange1(e) {
|
selectChange1(e) {
|
||||||
this.index1 = e
|
this.index1 = e
|
||||||
},
|
},
|
||||||
selectChange2(e) {
|
/** 下拉框-混碾位置 */
|
||||||
this.index2 = e
|
async _getBlendingCode () {
|
||||||
},
|
let res = await getBlendingCode()
|
||||||
/** 获取设备下拉框 */
|
|
||||||
async _deviceInfo () {
|
|
||||||
let res = await deviceInfo()
|
|
||||||
this.options1 = [...res]
|
this.options1 = [...res]
|
||||||
},
|
},
|
||||||
/** 获取设备状态下拉框 */
|
|
||||||
async _deviceStatus () {
|
|
||||||
let res = await deviceStatus()
|
|
||||||
this.options2 = [...res]
|
|
||||||
},
|
|
||||||
/** 确定 */
|
/** 确定 */
|
||||||
async toSure () {
|
async toSure () {
|
||||||
this.disabled1 = true
|
this.disabled1 = true
|
||||||
if (!this.index1) {
|
if (this.val1 || !this.index1) {
|
||||||
uni.showToast({
|
|
||||||
title: '混碾位置不能为空',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
this.disabled1 = false
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (!this.index2) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '目的压机不能为空',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
this.disabled1 = false
|
this.disabled1 = false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
let userName = this.$store.getters.userInfo !== '' ? JSON.parse(this.$store.getters.userInfo).username : ''
|
let res = await sendTask(this.val1, this.index1)
|
||||||
let res = await deviceCheckVerify(this.index1, userName, this.index2)
|
|
||||||
this.disabled1 = false
|
this.disabled1 = false
|
||||||
|
this.val1 = ''
|
||||||
this.index1 = ''
|
this.index1 = ''
|
||||||
this.index2 = ''
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.message,
|
title: res.message,
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
@@ -119,8 +79,8 @@
|
|||||||
},
|
},
|
||||||
toCancle () {
|
toCancle () {
|
||||||
this.disabled1 = false
|
this.disabled1 = false
|
||||||
|
this.val1 = ''
|
||||||
this.index1 = ''
|
this.index1 = ''
|
||||||
this.index2 = ''
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,3 +23,20 @@ export const groupmanual = (vcode, vtype, pcode, weight) => request({
|
|||||||
material_weight: weight
|
material_weight: weight
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 混碾搬运
|
||||||
|
*/
|
||||||
|
// 获取混碾机数据
|
||||||
|
export const getBlendingCode = () => request({
|
||||||
|
url:'api/pda/move/getBlendingCode',
|
||||||
|
data: {}
|
||||||
|
})
|
||||||
|
// 确认
|
||||||
|
export const sendTask = (vcode, spcode) => request({
|
||||||
|
url:'api/pda/move/sendTask',
|
||||||
|
data: {
|
||||||
|
vehicle_code: vcode,
|
||||||
|
start_point_code: spcode,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user