Commit 984dc955 authored by xinzhedeai's avatar xinzhedeai

保存测量记录

parent c5661756
...@@ -8,7 +8,7 @@ export function getSelectList(data) { // 获取下拉列表数据 ...@@ -8,7 +8,7 @@ export function getSelectList(data) { // 获取下拉列表数据
}) })
} }
export function getDetailInfo(data) { // 获取下拉列表数据 export function getDetailInfo(data) { // 获取测量记录详情
console.log('data', data) console.log('data', data)
return request({ return request({
url: '/product/getExpectedDepth', url: '/product/getExpectedDepth',
...@@ -17,15 +17,15 @@ console.log('data', data) ...@@ -17,15 +17,15 @@ console.log('data', data)
}) })
} }
export function saveData(data) { // 获取下拉列表数据 export function saveData(data) { // 保存测量记录
return request({ return request({
url: '/product/getList', url: '/records/add',
method: 'post', method: 'post',
data data
}) })
} }
export function getDict(data) { // 获取下拉列表数据 export function getDict(data) { // 获取装药字典
return request({ return request({
url: '/system/dict/data/type/'+data.type, url: '/system/dict/data/type/'+data.type,
method: 'get', method: 'get',
......
...@@ -51,6 +51,7 @@ uni.addInterceptor("request", { ...@@ -51,6 +51,7 @@ uni.addInterceptor("request", {
}) })
} }
}); });
return
} }
if (code !== 200) { if (code !== 200) {
showCustomModal({ showCustomModal({
......
This diff is collapsed.
...@@ -131,10 +131,11 @@ ...@@ -131,10 +131,11 @@
"mp-weixin" : { "mp-weixin" : {
// "appid" : "wx6238adc0d70b28d6", // 比萨列 // "appid" : "wx6238adc0d70b28d6", // 比萨列
"aGETDATAppid" : "wx41f6d06aca0687c3", // 矿山智行 "aGETDATAppid" : "wx41f6d06aca0687c3", // 矿山智行
"setting" : { "setting" : {
"urlCheck" : false, "urlCheck" : false,
"es6" : true "es6" : true,
"minified" : true,
"postcss" : true
}, },
"usingComponents" : true, "usingComponents" : true,
"permission" : {}, "permission" : {},
......
...@@ -34,13 +34,6 @@ ...@@ -34,13 +34,6 @@
"navigationBarTitleText" : "导入文件数据预览" "navigationBarTitleText" : "导入文件数据预览"
} }
}, },
{
"path" : "pages/home/blueTest",
"style" :
{
"navigationBarTitleText" : "设备测试"
}
},
{ {
"path" : "pages/home/blueSearch", "path" : "pages/home/blueSearch",
"style" : "style" :
...@@ -140,24 +133,7 @@ ...@@ -140,24 +133,7 @@
"iconPath": "static/template.png", "iconPath": "static/template.png",
"selectedIconPath": "static/templateHL.png", "selectedIconPath": "static/templateHL.png",
"text": "模板" "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 @@ ...@@ -36,7 +36,7 @@
</uni-col> </uni-col>
</uni-row> </uni-row>
</view> </view>
<view class="demo-uni-row"> <view class="demo-uni-row unboder">
<uni-row class="demo-uni-row mb-10"> <uni-row class="demo-uni-row mb-10">
<uni-col :span="7" class="_title"> <uni-col :span="7" class="_title">
<view>炮孔编号</view> <view>炮孔编号</view>
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
</uni-row> </uni-row>
</view> </view>
<view class="only-read-row"> <view class="only-read-row unboder">
<uni-row class="demo-uni-row mb-10"> <uni-row class="demo-uni-row mb-10">
<uni-col :span="7" class="_title"> <uni-col :span="7" class="_title">
<view>设计孔深</view> <view>设计孔深</view>
...@@ -60,18 +60,18 @@ ...@@ -60,18 +60,18 @@
</uni-col> </uni-col>
</uni-row> </uni-row>
</view> </view>
<view class="demo-uni-row"> <view class="demo-uni-row unboder">
<uni-row class="demo-uni-row mb-10"> <uni-row class="demo-uni-row mb-10">
<uni-col :span="7" class="_title"> <uni-col :span="7" class="_title">
<view>装药选择</view> <view>装药选择</view>
</uni-col> </uni-col>
<uni-col :span="15"> <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> :clear="false"></uni-data-select>
</uni-col> </uni-col>
</uni-row> </uni-row>
</view> </view>
<view class="only-read-row"> <view class="only-read-row unboder">
<uni-row class="demo-uni-row mb-10"> <uni-row class="demo-uni-row mb-10">
<uni-col :span="7" class="_title"> <uni-col :span="7" class="_title">
<view>测量孔深度</view> <view>测量孔深度</view>
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
</uni-row> </uni-row>
</view> </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-row class="demo-uni-row mb-10 demo-uni-row-unborder">
<uni-col :span="7" class="_title"> <uni-col :span="7" class="_title">
<view>测量孔水位</view> <view>测量孔水位</view>
...@@ -96,25 +96,40 @@ ...@@ -96,25 +96,40 @@
</uni-col> </uni-col>
</uni-row> </uni-row>
</view> </view>
<view class="demo-uni-row"> <view class="demo-uni-row unboder">
<uni-row class="demo-uni-row mb-10"> <uni-row class="demo-uni-row mb-10">
<uni-col :span="7" class="_title"> <uni-col :span="7" class="_title">
<view>备注</view> <view>备注</view>
</uni-col> </uni-col>
<uni-col :span="15"> <uni-col :span="15">
<input class="uni-input inputEle" placeholder="请输入" /> <input class="uni-input inputEle" v-model="form.remark" placeholder="请输入" />
</uni-col> </uni-col>
</uni-row> </uni-row>
</view> </view>
</view> </view>
<view class="footer-wrapper" v-show="connected"> <view class="footer-wrapper">
<view class="funcBtn end" @tap="resetForm"> <view class="funcBtn end" @tap="resetForm">
取消 取消
</view> </view>
<view class="funcBtn end" @tap="saveData"> <view class="funcBtn save" @tap="saveData">
保存 保存
</view> </view>
</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> </view>
</template> </template>
...@@ -134,7 +149,9 @@ ...@@ -134,7 +149,9 @@
getDict getDict
} from '../../api/blueToothMeasure.js' } from '../../api/blueToothMeasure.js'
import { mapState } from "vuex"; import {
mapState
} from "vuex";
export default { export default {
components: { components: {
CustomNavbar, CustomNavbar,
...@@ -150,10 +167,11 @@ ...@@ -150,10 +167,11 @@
'artilleryAreaName': '', 'artilleryAreaName': '',
'cannonHoleArrayNum': '', 'cannonHoleArrayNum': '',
'cannonHoleNum': '', 'cannonHoleNum': '',
'status': '', 'status': '0',
'expectedDepth': '', 'expectedDepth': '',
'actualDepth': '', 'actualDepth': '',
'actualWaterLevel': '' 'actualWaterLevel': '',
remark: ''
}, },
dataList: [], dataList: [],
selectListLv1: [], selectListLv1: [],
...@@ -172,27 +190,39 @@ ...@@ -172,27 +190,39 @@
this.resetForm() this.resetForm()
this.getDictInfo() this.getDictInfo()
}, },
computed:{ computed: {
...mapState(['actualDepth', 'actualWaterLevel']) ...mapState(['actualDepth', 'actualWaterLevel'])
}, },
methods: { 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() { resetForm() {
for (let key in this.form) { for (let key in this.form) {
this.form[key] = '' this.form[key] = ''
} }
this['form']['status'] = '0'
this.$store.commit('setMeasureVal', { // 清空测量值 this.$store.commit('setMeasureVal', { // 清空测量值
actualDepth: '', actualDepth: '',
actualWaterLevel: '' actualWaterLevel: ''
}) })
}, },
gobackDeal(){ gobackDeal() {
pager.relaunchTo('/pages/home/home') pager.relaunchTo('/pages/home/home')
}, },
async getDictInfo() { async getDictInfo() {
let res = await getDict({ let res = await getDict({
type: 'zhuangyao_type' type: 'zhuangyao_type'
}) })
if(res){ if (res) {
this.zhuangyaoDict = res.map((item) => { this.zhuangyaoDict = res.map((item) => {
return { return {
text: item.dictLabel, text: item.dictLabel,
...@@ -209,13 +239,13 @@ ...@@ -209,13 +239,13 @@
let formFieldArr = [ let formFieldArr = [
'productName', 'artilleryAreaName', 'cannonHoleArrayNum', 'productName', 'artilleryAreaName', 'cannonHoleArrayNum',
'cannonHoleNum', 'status', 'cannonHoleNum',
] ]
let dataListSelectArr = [ let dataListSelectArr = [
'selectListLv1', 'selectListLv2', 'selectListLv3', 'selectListLv1', 'selectListLv2', 'selectListLv3',
'selectListLv4', 'zhuangyaoDict' 'selectListLv4'
] ]
// [1, 2, 3, 4, 5]; lvNum:2 => [3, 4, 5] // [1, 2, 3, 4, 5]; lvNum:2 => [3, 4, 5]
...@@ -223,6 +253,9 @@ ...@@ -223,6 +253,9 @@
newFildArr.forEach((key) => { newFildArr.forEach((key) => {
this['form'][key] = '' this['form'][key] = ''
}); });
this['form']['status'] = '0'
newDataListSelectArr = dataListSelectArr.slice(lvNum); newDataListSelectArr = dataListSelectArr.slice(lvNum);
newDataListSelectArr.forEach((key) => { newDataListSelectArr.forEach((key) => {
this[key] = [] this[key] = []
...@@ -322,7 +355,8 @@ ...@@ -322,7 +355,8 @@
productName: this.form.productName, productName: this.form.productName,
artilleryAreaName: this.form.artilleryAreaName, artilleryAreaName: this.form.artilleryAreaName,
cannonHoleArrayNum: this.form.cannonHoleArrayNum, cannonHoleArrayNum: this.form.cannonHoleArrayNum,
cannonHoleNum: prevLvVal cannonHoleNum: prevLvVal || this.form.cannonHoleNum,
status: this.form.status
}) })
if (res) { if (res) {
this.form['expectedDepth'] = res['expectedDepth'] this.form['expectedDepth'] = res['expectedDepth']
...@@ -335,6 +369,7 @@ ...@@ -335,6 +369,7 @@
showCustomToast({ showCustomToast({
title: '暂无详情信息' title: '暂无详情信息'
}) })
}, },
async saveData() { // 保存当前表单数据到本地 async saveData() { // 保存当前表单数据到本地
let formFieldArr = [ let formFieldArr = [
...@@ -356,7 +391,7 @@ ...@@ -356,7 +391,7 @@
return return
} }
if(!this.actualDepth || !this.actualWaterLevel){ if (!this.actualDepth || !this.actualWaterLevel) {
showCustomModal({ showCustomModal({
content: `孔深水位不能为空` content: `孔深水位不能为空`
}) })
...@@ -371,9 +406,10 @@ ...@@ -371,9 +406,10 @@
...this.form ...this.form
}) })
if (res) { if (res) {
showCustomToast({ // showCustomToast({
title: '保存成功', // title: '保存成功',
}) // })
this.openPopup()
this.resetForm() this.resetForm()
} }
}, },
...@@ -382,28 +418,76 @@ ...@@ -382,28 +418,76 @@
</script> </script>
<style lang="scss"> <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; font-size: 30rpx !important;
} }
.inputEle{
.inputEle {
height: 110rpx; height: 110rpx;
display: flex; display: flex;
align-items: center; align-items: center;
} }
.uni-col-7{
.uni-col-7 {
font-size: 32rpx; font-size: 32rpx;
font-weight: bold; font-weight: bold;
color: #000000; color: #000000;
line-height: 110rpx; line-height: 110rpx;
} }
.demo-uni-row{
.demo-uni-row {
line-height: 70rpx; line-height: 70rpx;
padding-left: 15rpx; padding-left: 15rpx;
.uni-select{
.uni-select {
height: 108rpx; height: 108rpx;
} }
} }
.only-read-row{
.unboder {
.uni-row::after {
border-bottom: none;
}
}
.only-read-row {
background: #E3E6EC !important; background: #E3E6EC !important;
height: 108rpx; height: 108rpx;
align-items: center; align-items: center;
...@@ -411,6 +495,7 @@ ...@@ -411,6 +495,7 @@
line-height: 70rpx; line-height: 70rpx;
position: relative; position: relative;
padding-left: 13rpx; padding-left: 13rpx;
&:after { &:after {
content: '米'; content: '米';
width: 70rpx; width: 70rpx;
...@@ -425,6 +510,7 @@ ...@@ -425,6 +510,7 @@
color: #000000; color: #000000;
} }
} }
::v-deep .uni-row::after { ::v-deep .uni-row::after {
clear: both; clear: both;
width: 608rpx; width: 608rpx;
...@@ -448,6 +534,7 @@ ...@@ -448,6 +534,7 @@
padding-right: 15rpx; padding-right: 15rpx;
background: #FFFFFF; background: #FFFFFF;
border-radius: 10rpx; border-radius: 10rpx;
.sumary-title { .sumary-title {
position: relative; position: relative;
padding-left: 50rpx; padding-left: 50rpx;
...@@ -485,8 +572,9 @@ ...@@ -485,8 +572,9 @@
// border: 1px solid lightgray; // border: 1px solid lightgray;
height: 110rpx; height: 110rpx;
line-height: 110rpx; line-height: 110rpx;
padding-left: 20rpx; padding-left: 50rpx;
position: relative; position: relative;
font-size: 29rpx;
} }
.funcBtn { .funcBtn {
...@@ -502,9 +590,12 @@ ...@@ -502,9 +590,12 @@
&.end { &.end {
background: #FFFFFF; background: #FFFFFF;
;
color: #007AFF; color: #007AFF;
} }
&.save {
background: #007AFF;
color: #fff;
}
&.loading { &.loading {
opacity: 0.5; 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