测试bug修改
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
<page-meta :page-style="'overflow:'+(show?'hidden':'visible')"></page-meta>
|
||||
<uni-forms :label-width="80">
|
||||
<uni-forms-item label="工程名称">
|
||||
<uni-easyinput type="text" v-model="formData.name" placeholder="请输入工程名称" />
|
||||
<uni-easyinput type="text" v-model="formData.name" placeholder="请输入工程名称"/>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="位置">
|
||||
<!-- <view style="display:flex;">
|
||||
@@ -15,7 +15,8 @@
|
||||
<uni-icons type="location" color="#007aff" size="26" class="ml20"
|
||||
@click="chooseLocation"></uni-icons>
|
||||
</view> -->
|
||||
<uni-data-picker :localdata="localdata" @change="areaChange" v-model="value" @popupopened="show=true" @popupclosed="show=false">
|
||||
<uni-data-picker :localdata="localdata" @change="areaChange" v-model="value"
|
||||
@popupopened="show=true" @popupclosed="show=false">
|
||||
</uni-data-picker>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="描述">
|
||||
@@ -29,15 +30,16 @@
|
||||
</uni-forms>
|
||||
</view>
|
||||
<view class="btn-wrap">
|
||||
<view class="btn-wrap-item" @click="submit"> 提交 </view>
|
||||
<view class="btn-wrap-item" @click="submit"> 提交</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</Cn-page>
|
||||
</template>
|
||||
<script>
|
||||
import { addEngineering, auditEngineering } from '../../common/api/engineering'
|
||||
import {addEngineering, auditEngineering} from '../../common/api/engineering'
|
||||
import area from '../../common/js/area.json'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -52,9 +54,11 @@ export default {
|
||||
},
|
||||
engineering: {},
|
||||
show: false,
|
||||
options: {}
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
this.options = options
|
||||
if (options.engineering) {
|
||||
this.engineering = JSON.parse(decodeURIComponent(options.engineering))
|
||||
console.log(this.engineering)
|
||||
@@ -65,7 +69,7 @@ export default {
|
||||
}
|
||||
this.value = this.engineering.city
|
||||
this.formData.id = this.engineering.id
|
||||
uni.setNavigationBarTitle({ title: '工程编辑' })
|
||||
uni.setNavigationBarTitle({title: '工程编辑'})
|
||||
}
|
||||
uni.getLocation({
|
||||
type: 'wgs84',
|
||||
@@ -79,7 +83,8 @@ export default {
|
||||
console.log(this.$util.prePage())
|
||||
},
|
||||
methods: {
|
||||
toJSON() {},
|
||||
toJSON() {
|
||||
},
|
||||
areaChange(e) {
|
||||
if (e.detail.value.length) {
|
||||
this.formData.province = e.detail.value[0].value
|
||||
@@ -123,9 +128,17 @@ export default {
|
||||
this.$util.toast('工程修改成功')
|
||||
this.$util.refreshPrePage(2)
|
||||
} else {
|
||||
await addEngineering(this.formData)
|
||||
let res = await addEngineering(this.formData)
|
||||
this.$util.toast('工程创建成功')
|
||||
this.$util.refreshPrePage()
|
||||
if (this.options.from === 'index') {
|
||||
uni.setStorageSync('engineering', res.data)
|
||||
uni.redirectTo({
|
||||
url: '/pages/device/new',
|
||||
})
|
||||
return
|
||||
} else {
|
||||
this.$util.refreshPrePage()
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user