235 lines
7.0 KiB
Vue
235 lines
7.0 KiB
Vue
<template>
|
||
<view style="background-color:white">
|
||
<u-navbar back-text="返回" title="车辆出入厂" :background="background"></u-navbar>
|
||
<u-form ref="testForm">
|
||
<u-form-item :border-bottom="false">
|
||
<label>选择车牌:</label>
|
||
<zxzUniDataSelect filterable v-model="carNum" :localdata="carNumList" @change="change">
|
||
</zxzUniDataSelect>
|
||
</u-form-item>
|
||
<u-form-item :border-bottom="false">
|
||
<label>入厂地磅:</label>
|
||
<uni-number-box :max="999999999" :step="0.1" v-model="enterWeight"/>
|
||
</u-form-item>
|
||
<u-form-item :border-bottom="false">
|
||
<label>出厂地磅:</label>
|
||
<uni-number-box :max="999999999" :step="0.1" v-model="exitWeight"/>
|
||
</u-form-item>
|
||
</u-form>
|
||
<u-row>
|
||
<u-col span="3"><label>入厂类型:</label> </u-col>
|
||
<u-col span="3"><label>{{model.efType_dictText}}</label> </u-col>
|
||
<u-col span="3"><label>排队数:</label> </u-col>
|
||
<u-col span="3"><label>{{model.lineUpCount}}</label> </u-col>
|
||
</u-row>
|
||
<u-row>
|
||
<u-col span="3"><label>物流公司:</label> </u-col>
|
||
<u-col span="3"><label>{{model.logistics}}</label> </u-col>
|
||
<u-col span="3"><label>司机姓名:</label> </u-col>
|
||
<u-col span="3"><label>{{model.driverName}}</label> </u-col>
|
||
</u-row>
|
||
<u-row>
|
||
<u-col span="3"><label>司机电话:</label> </u-col>
|
||
<u-col span="3"><label>{{model.driverTel}}</label> </u-col>
|
||
<u-col span="3"><label>司机身份证:</label> </u-col>
|
||
<u-col span="2"><label>{{model.driverIdCard}}</label> </u-col>
|
||
</u-row>
|
||
<u-row>
|
||
<u-col span="3"><label>进厂门:</label> </u-col>
|
||
<u-col span="3"><label>{{model.enterFactoryDoor}}</label> </u-col>
|
||
<u-col span="3"><label>出厂门:</label> </u-col>
|
||
<u-col span="2"><label>{{model.exitFactoryDoor}}</label> </u-col>
|
||
</u-row>
|
||
<u-row>
|
||
<u-col span="3"><label>当前状态:</label> </u-col>
|
||
<u-col span="3"><label>{{model.currentStatus_dictText}}</label> </u-col>
|
||
</u-row>
|
||
<u-row >
|
||
<uni-file-picker
|
||
v-model="imageValue"
|
||
fileMediatype="image"
|
||
mode="grid"
|
||
@select="select"
|
||
@progress="progress"
|
||
@success="success"
|
||
@fail="fail"
|
||
@delete="deleteImage"
|
||
/>
|
||
</u-row>
|
||
<br />
|
||
<u-row>
|
||
<!-- <u-col span="3"><u-button @click="handleConfirm('1')" type="primary" size="mini">对接人确认</u-button></u-col> -->
|
||
<u-col span="3"><u-button @click="handleConfirm('3')" type="primary" size="mini">审核入厂</u-button></u-col>
|
||
<u-col span="3"><u-button @click="handleConfirm('4')" type="primary" size="mini">审核出厂</u-button></u-col>
|
||
<u-col span="3"><u-button @click="handleConfirm('5')" type="primary" size="mini">地磅确认</u-button></u-col>
|
||
<u-col span="3"><u-button type="primary" size="mini" @click="onSubmit">提交</u-button></u-col>
|
||
</u-row>
|
||
</view>
|
||
</template>
|
||
|
||
<script>
|
||
import zxzUniDataSelect from "@/components/zxz-uni-data-select/zxz-uni-data-select.vue"
|
||
import uniNumberBox from "@/components/uni-number-box/uni-number-box.vue"
|
||
|
||
export default {
|
||
components: {
|
||
zxzUniDataSelect,
|
||
uniNumberBox
|
||
},
|
||
data() {
|
||
return {
|
||
title: 'Hello',
|
||
background: {
|
||
backgroundImage: 'linear-gradient(45deg, rgb(28, 187, 180), rgb(141, 198, 63))'
|
||
},
|
||
model:{},
|
||
carNum: '',
|
||
enterWeight: '',
|
||
exitWeight: '',
|
||
carNumList: [],
|
||
vehicleList: [],
|
||
imageValue:[{url:'https://pic.rmb.bdstatic.com/bjh/3f11932d2831/250307/2453145db3c360f31c67372e9b24e49e.jpeg'}],
|
||
fileList:[],
|
||
baseUrl: 'http://localhost:9001/tms',
|
||
url: {
|
||
getCarNum: '/vehicleinout/vehicleInOut/getCarNum',
|
||
handleConfirm: '/vehicleinout/vehicleInOut/handleConfirm',
|
||
upload: '/sys/common/upload?biz=temp',
|
||
}
|
||
}
|
||
|
||
},
|
||
mounted() {
|
||
this.getCarNum();
|
||
},
|
||
methods: {
|
||
getCarNum(){
|
||
this.getRequest(this.url.getCarNum,{},'GET').then(res => {
|
||
if (res.success) {
|
||
this.vehicleList = res.result.records;
|
||
this.carNumList = res.result.records.map(item => ({
|
||
text: item.carNum,
|
||
value: item.id,
|
||
}));
|
||
}
|
||
})
|
||
},
|
||
change(){
|
||
this.model = this.vehicleList.filter(item => item.id == this.carNum)[0]
|
||
},
|
||
handleConfirm(currentStatus){
|
||
if (this.carNum == '') {
|
||
this.$showMessage('请选择车牌');
|
||
return;
|
||
}
|
||
let param = {
|
||
id: this.model.id,
|
||
}
|
||
if (currentStatus != '5') {
|
||
param.currentStatus = currentStatus;
|
||
} else {
|
||
|
||
param.enterWeight = this.enterWeight;
|
||
param.exitWeight = this.exitWeight;
|
||
}
|
||
this.getRequest(this.url.handleConfirm,param).then(res => {
|
||
if (res.success) {
|
||
this.$showMessage(res.result);
|
||
this.model = {}
|
||
this.carNum = ''
|
||
this.enterWeight = ''
|
||
this.exitWeight = ''
|
||
} else {
|
||
this.$showMessage(res.message);
|
||
}
|
||
})
|
||
},
|
||
// 获取上传状态
|
||
select(e){
|
||
console.log('选择文件:',e)
|
||
this.imageValue = [...e.tempFiles, ...this.imageValue]
|
||
uni.uploadFile({
|
||
url: this.baseUrl + this.url.upload,
|
||
filePath: e.tempFilePaths[0],
|
||
name: 'file',
|
||
success: (uploadFileRes) => {
|
||
let data = JSON.parse(uploadFileRes.data)
|
||
console.log('data:',data)
|
||
this.fileList.push({
|
||
tempFilePath: e.tempFilePaths[0],
|
||
message: data.message
|
||
})
|
||
console.log('fileList:',this.fileList)
|
||
console.log('imageValue:',this.imageValue)
|
||
},
|
||
});
|
||
console.log("===========")
|
||
},
|
||
deleteImage(e){
|
||
console.log('删除文件:',e)
|
||
this.imageValue = this.imageValue.filter(x => x.path!=e.tempFile.path)
|
||
this.fileList = this.fileList.filter(x => x.tempFilePath!=e.tempFilePath)
|
||
console.log('imageValue:',this.imageValue)
|
||
console.log('this.fileList:',this.fileList)
|
||
},
|
||
// 获取上传进度
|
||
progress(e){
|
||
console.log('上传进度:',e)
|
||
},
|
||
|
||
// 上传成功
|
||
success(e){
|
||
console.log('上传成功')
|
||
},
|
||
|
||
// 上传失败
|
||
fail(e){
|
||
console.log('上传失败:',e)
|
||
},
|
||
onSubmit(){
|
||
console.log('imageValue:',this.imageValue[0])
|
||
console.log(this.baseUrl + this.url.upload);
|
||
uni.uploadFile({
|
||
url: this.baseUrl + this.url.upload,
|
||
filePath: this.imageValue[0].path,
|
||
name: 'file',
|
||
success: (uploadFileRes) => {
|
||
let data = JSON.parse(uploadFileRes.data)
|
||
console.log('data:',data)
|
||
},
|
||
fail: (err) => {
|
||
console.error('上传失败:', err);
|
||
uni.showToast({ title: '上传失败', icon: 'none' });
|
||
}
|
||
});
|
||
},
|
||
getRequest(url='',data={},method='',){
|
||
return new Promise((resolve, reject) => {
|
||
uni.request({
|
||
url: this.baseUrl + url, //请求的地址是拼接后的真正地址
|
||
method: method||'POST',
|
||
header: {
|
||
'Content-type': 'application/json;charset=utf-8',
|
||
}, //请求头会把数据转为Json格式
|
||
'timeout': 600000,
|
||
data:data,//调用此方法时的传进来的参数
|
||
success:(res)=>{
|
||
// console.log(res)
|
||
resolve(res.data)//把数据返回出去
|
||
},
|
||
fail:(err)=>{
|
||
// console.log(res)
|
||
resolve(err)
|
||
}
|
||
})
|
||
})
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style scoped>
|
||
::v-deep .uni-numbox__value{
|
||
width: 80px;
|
||
}
|
||
</style> |