Commit 984dc955 authored by xinzhedeai's avatar xinzhedeai

保存测量记录

parent c5661756
......@@ -8,7 +8,7 @@ export function getSelectList(data) { // 获取下拉列表数据
})
}
export function getDetailInfo(data) { // 获取下拉列表数据
export function getDetailInfo(data) { // 获取测量记录详情
console.log('data', data)
return request({
url: '/product/getExpectedDepth',
......@@ -17,15 +17,15 @@ console.log('data', data)
})
}
export function saveData(data) { // 获取下拉列表数据
export function saveData(data) { // 保存测量记录
return request({
url: '/product/getList',
url: '/records/add',
method: 'post',
data
})
}
export function getDict(data) { // 获取下拉列表数据
export function getDict(data) { // 获取装药字典
return request({
url: '/system/dict/data/type/'+data.type,
method: 'get',
......
......@@ -51,6 +51,7 @@ uni.addInterceptor("request", {
})
}
});
return
}
if (code !== 200) {
showCustomModal({
......
This diff is collapsed.
......@@ -131,10 +131,11 @@
"mp-weixin" : {
// "appid" : "wx6238adc0d70b28d6", // 比萨列
"aGETDATAppid" : "wx41f6d06aca0687c3", // 矿山智行
"setting" : {
"urlCheck" : false,
"es6" : true
"es6" : true,
"minified" : true,
"postcss" : true
},
"usingComponents" : true,
"permission" : {},
......
......@@ -34,13 +34,6 @@
"navigationBarTitleText" : "导入文件数据预览"
}
},
{
"path" : "pages/home/blueTest",
"style" :
{
"navigationBarTitleText" : "设备测试"
}
},
{
"path" : "pages/home/blueSearch",
"style" :
......@@ -140,24 +133,7 @@
"iconPath": "static/template.png",
"selectedIconPath": "static/templateHL.png",
"text": "模板"
}/*,
{
"pagePath": "pages/home/home",
"iconPath": "static/api.png",
"selectedIconPath": "static/apiHL.png",
"text": "首页"
} ,
{
"pagePath": "pages/home/home",
"iconPath": "static/api.png",
"selectedIconPath": "static/apiHL.png",
"text": "首页"
} *//* , {
"pagePath": "pages/tabBar/extUI/extUI",
"iconPath": "static/extui.png",
"selectedIconPath": "static/extuiHL.png",
"text": "扩展组件"
} */
}
]
}
}
......@@ -36,7 +36,7 @@
</uni-col>
</uni-row>
</view>
<view class="demo-uni-row">
<view class="demo-uni-row unboder">
<uni-row class="demo-uni-row mb-10">
<uni-col :span="7" class="_title">
<view>炮孔编号</view>
......@@ -48,7 +48,7 @@
</uni-row>
</view>
<view class="only-read-row">
<view class="only-read-row unboder">
<uni-row class="demo-uni-row mb-10">
<uni-col :span="7" class="_title">
<view>设计孔深</view>
......@@ -60,18 +60,18 @@
</uni-col>
</uni-row>
</view>
<view class="demo-uni-row">
<view class="demo-uni-row unboder">
<uni-row class="demo-uni-row mb-10">
<uni-col :span="7" class="_title">
<view>装药选择</view>
</uni-col>
<uni-col :span="15">
<uni-data-select v-model="form['status']" :localdata="zhuangyaoDict"
<uni-data-select v-model="form['status']" :localdata="zhuangyaoDict" @change="change"
:clear="false"></uni-data-select>
</uni-col>
</uni-row>
</view>
<view class="only-read-row">
<view class="only-read-row unboder">
<uni-row class="demo-uni-row mb-10">
<uni-col :span="7" class="_title">
<view>测量孔深度</view>
......@@ -84,7 +84,7 @@
</uni-row>
</view>
<view class="only-read-row">
<view class="only-read-row unboder">
<uni-row class="demo-uni-row mb-10 demo-uni-row-unborder">
<uni-col :span="7" class="_title">
<view>测量孔水位</view>
......@@ -96,25 +96,40 @@
</uni-col>
</uni-row>
</view>
<view class="demo-uni-row">
<view class="demo-uni-row unboder">
<uni-row class="demo-uni-row mb-10">
<uni-col :span="7" class="_title">
<view>备注</view>
</uni-col>
<uni-col :span="15">
<input class="uni-input inputEle" placeholder="请输入" />
<input class="uni-input inputEle" v-model="form.remark" placeholder="请输入" />
</uni-col>
</uni-row>
</view>
</view>
<view class="footer-wrapper" v-show="connected">
<view class="footer-wrapper">
<view class="funcBtn end" @tap="resetForm">
取消
</view>
<view class="funcBtn end" @tap="saveData">
<view class="funcBtn save" @tap="saveData">
保存
</view>
</view>
<uni-popup ref="popup" background-color="#fff">
<view class="popup-content">
<image src="../../static/image/paokong/close.png" mode="" class="closeBtn" @click="closePopup"></image>
<view class="_body">
<view class="popup-content">
<image src="../../static/image/paokong/success.png" mode=""></image>
<p>保存成功</p>
</view>
</view>
<view class="funcBtn _btn" @click="closePopup">
关闭
</view>
</view>
</uni-popup>
</view>
</template>
......@@ -134,7 +149,9 @@
getDict
} from '../../api/blueToothMeasure.js'
import { mapState } from "vuex";
import {
mapState
} from "vuex";
export default {
components: {
CustomNavbar,
......@@ -150,10 +167,11 @@
'artilleryAreaName': '',
'cannonHoleArrayNum': '',
'cannonHoleNum': '',
'status': '',
'status': '0',
'expectedDepth': '',
'actualDepth': '',
'actualWaterLevel': ''
'actualWaterLevel': '',
remark: ''
},
dataList: [],
selectListLv1: [],
......@@ -172,27 +190,39 @@
this.resetForm()
this.getDictInfo()
},
computed:{
computed: {
...mapState(['actualDepth', 'actualWaterLevel'])
},
methods: {
openPopup() {
// 通过组件定义的ref调用uni-popup方法 ,如果传入参数 ,type 属性将失效 ,仅支持 ['top','left','bottom','right','center']
this.$refs.popup.open('center');
},
closePopup() {
this.$refs.popup.close();
},
change(e) { // 是否装药获取详情
console.log("e:", e);
this.getDetailInfo()
},
resetForm() {
for (let key in this.form) {
this.form[key] = ''
}
this['form']['status'] = '0'
this.$store.commit('setMeasureVal', { // 清空测量值
actualDepth: '',
actualWaterLevel: ''
})
},
gobackDeal(){
gobackDeal() {
pager.relaunchTo('/pages/home/home')
},
async getDictInfo() {
let res = await getDict({
type: 'zhuangyao_type'
})
if(res){
if (res) {
this.zhuangyaoDict = res.map((item) => {
return {
text: item.dictLabel,
......@@ -209,13 +239,13 @@
let formFieldArr = [
'productName', 'artilleryAreaName', 'cannonHoleArrayNum',
'cannonHoleNum', 'status',
'cannonHoleNum',
]
let dataListSelectArr = [
'selectListLv1', 'selectListLv2', 'selectListLv3',
'selectListLv4', 'zhuangyaoDict'
'selectListLv4'
]
// [1, 2, 3, 4, 5]; lvNum:2 => [3, 4, 5]
......@@ -223,6 +253,9 @@
newFildArr.forEach((key) => {
this['form'][key] = ''
});
this['form']['status'] = '0'
newDataListSelectArr = dataListSelectArr.slice(lvNum);
newDataListSelectArr.forEach((key) => {
this[key] = []
......@@ -322,7 +355,8 @@
productName: this.form.productName,
artilleryAreaName: this.form.artilleryAreaName,
cannonHoleArrayNum: this.form.cannonHoleArrayNum,
cannonHoleNum: prevLvVal
cannonHoleNum: prevLvVal || this.form.cannonHoleNum,
status: this.form.status
})
if (res) {
this.form['expectedDepth'] = res['expectedDepth']
......@@ -335,6 +369,7 @@
showCustomToast({
title: '暂无详情信息'
})
},
async saveData() { // 保存当前表单数据到本地
let formFieldArr = [
......@@ -356,7 +391,7 @@
return
}
if(!this.actualDepth || !this.actualWaterLevel){
if (!this.actualDepth || !this.actualWaterLevel) {
showCustomModal({
content: `孔深水位不能为空`
})
......@@ -371,9 +406,10 @@
...this.form
})
if (res) {
showCustomToast({
title: '保存成功',
})
// showCustomToast({
// title: '保存成功',
// })
this.openPopup()
this.resetForm()
}
},
......@@ -382,28 +418,76 @@
</script>
<style lang="scss">
::v-deep .uni-select__input-placeholder{ // placeholder样式调整
::v-deep .uni-popup .uni-popup__wrapper{
display: block;
position: relative;
width: 80vw;
border-radius: 10rpx;
.closeBtn{
position: absolute;
top: 30rpx;
right: 30rpx;
width: 23rpx !important;
height: 23rpx !important;
}
.popup-content{
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
padding-top: 40rpx;
image{
width: 390rpx;
height: 308rpx;
}
p{
font-family: Source Han Sans SC;
font-weight: 400;
font-size: 32rpx;
color: #007AFF;
}
}
._btn{
margin-top: 40rpx;
margin-bottom: 40rpx;
}
}
::v-deep .uni-select__input-placeholder {
// placeholder样式调整
font-size: 30rpx !important;
}
.inputEle{
.inputEle {
height: 110rpx;
display: flex;
align-items: center;
}
.uni-col-7{
.uni-col-7 {
font-size: 32rpx;
font-weight: bold;
color: #000000;
line-height: 110rpx;
}
.demo-uni-row{
.demo-uni-row {
line-height: 70rpx;
padding-left: 15rpx;
.uni-select{
.uni-select {
height: 108rpx;
}
}
.only-read-row{
.unboder {
.uni-row::after {
border-bottom: none;
}
}
.only-read-row {
background: #E3E6EC !important;
height: 108rpx;
align-items: center;
......@@ -411,6 +495,7 @@
line-height: 70rpx;
position: relative;
padding-left: 13rpx;
&:after {
content: '米';
width: 70rpx;
......@@ -425,6 +510,7 @@
color: #000000;
}
}
::v-deep .uni-row::after {
clear: both;
width: 608rpx;
......@@ -448,6 +534,7 @@
padding-right: 15rpx;
background: #FFFFFF;
border-radius: 10rpx;
.sumary-title {
position: relative;
padding-left: 50rpx;
......@@ -485,8 +572,9 @@
// border: 1px solid lightgray;
height: 110rpx;
line-height: 110rpx;
padding-left: 20rpx;
padding-left: 50rpx;
position: relative;
font-size: 29rpx;
}
.funcBtn {
......@@ -502,9 +590,12 @@
&.end {
background: #FFFFFF;
;
color: #007AFF;
}
&.save {
background: #007AFF;
color: #fff;
}
&.loading {
opacity: 0.5;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment