接口
This commit is contained in:
@@ -17,26 +17,10 @@
|
||||
<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">
|
||||
<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 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>
|
||||
</view>
|
||||
</view>
|
||||
@@ -45,7 +29,7 @@
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {deviceInfo, deviceStatus, deviceCheckVerify} from '@/utils/getData2.js'
|
||||
import {getBlendingCode, sendTask} from '@/utils/getData1.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
@@ -54,16 +38,13 @@
|
||||
data() {
|
||||
return {
|
||||
val1: '',
|
||||
val2: '',
|
||||
options1: [],
|
||||
index1: '',
|
||||
options2: [],
|
||||
index2: '',
|
||||
disabled1: false
|
||||
};
|
||||
},
|
||||
created () {
|
||||
this._deviceInfo()
|
||||
this._getBlendingCode()
|
||||
this._deviceStatus()
|
||||
},
|
||||
methods: {
|
||||
@@ -71,44 +52,23 @@
|
||||
selectChange1(e) {
|
||||
this.index1 = e
|
||||
},
|
||||
selectChange2(e) {
|
||||
this.index2 = e
|
||||
},
|
||||
/** 获取设备下拉框 */
|
||||
async _deviceInfo () {
|
||||
let res = await deviceInfo()
|
||||
/** 下拉框-混碾位置 */
|
||||
async _getBlendingCode () {
|
||||
let res = await getBlendingCode()
|
||||
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'
|
||||
})
|
||||
if (this.val1 || !this.index1) {
|
||||
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.index2)
|
||||
let res = await sendTask(this.val1, this.index1)
|
||||
this.disabled1 = false
|
||||
this.val1 = ''
|
||||
this.index1 = ''
|
||||
this.index2 = ''
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
@@ -119,8 +79,8 @@
|
||||
},
|
||||
toCancle () {
|
||||
this.disabled1 = false
|
||||
this.val1 = ''
|
||||
this.index1 = ''
|
||||
this.index2 = ''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,3 +23,20 @@ export const groupmanual = (vcode, vtype, pcode, weight) => request({
|
||||
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