| | |
| | | :customStyle="{marginBottom: '8px'}" |
| | | v-for="(item, index) in list" |
| | | :key="index" |
| | | :label="item.name" |
| | | :name="item.name" |
| | | :label="item.measure" |
| | | :name="item.id" |
| | | > |
| | | </u-checkbox> |
| | | </u-checkbox-group> |
| | |
| | | :maxCount="10" |
| | | style="margin-top: -10px;" |
| | | ></u-upload> |
| | | <view class="pic" v-for="item in nameList" :key="index"> |
| | | <view class="pic" v-for="(item,index) in nameList" :key="index"> |
| | | {{item.name}} |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="measures"> |
| | | <u-button class="measureBtn" type="success">提交</u-button> |
| | | <u-button class="measureBtn" type="primary" @click="submit">提交</u-button> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | import { measureList, submitMeasures, getMeasureDetail } from '@/api/notice.js' |
| | | export default { |
| | | components:{ |
| | | |
| | |
| | | statusBarHeight: [], |
| | | fileList1: [], |
| | | nameList: [], |
| | | checkboxValue1: '', |
| | | checkboxValue1: [], |
| | | measures: "", |
| | | type: 'textarea', |
| | | border: true, |
| | | height: 100, |
| | | autoHeight: true, |
| | | list: [ |
| | | { |
| | | name: '苹果', |
| | | disabled: false |
| | | }, |
| | | { |
| | | name: '香蕉', |
| | | disabled: false |
| | | }, |
| | | { |
| | | name: '橙子', |
| | | disabled: false |
| | | } |
| | | ] |
| | | detailData : {}, |
| | | measureIds : [], |
| | | baseUrl: '', |
| | | list: [], |
| | | showBtn: false |
| | | } |
| | | }, |
| | | onLoad() { |
| | | onLoad(options) { |
| | | let test = options.data && JSON.parse(decodeURIComponent(options.data)); |
| | | console.log("test",test) |
| | | this.detailData = test; |
| | | //获取手机状态栏高度 |
| | | this.statusBarHeight = uni.getSystemInfoSync()['statusBarHeight']; |
| | | uni.hideTabBar(); |
| | | this.getMeasureList(); |
| | | console.log("huan",process.env.NODE_ENV) |
| | | if (process.env.NODE_ENV == 'development') { |
| | | this.baseUrl = 'http://192.168.0.41:8086' |
| | | }else { |
| | | this.baseUrl = 'http://121.239.169.30:13001' |
| | | } |
| | | }, |
| | | methods: { |
| | | getMeasureList() { |
| | | const param = { |
| | | pageIndex: 1, |
| | | pageSize: 10000000, |
| | | } |
| | | measureList(param).then(res => { |
| | | if(res.code == 100){ |
| | | this.list = res.data; |
| | | } |
| | | }).catch(err=>{}) |
| | | }, |
| | | goBack() { |
| | | uni.navigateBack({ |
| | | url:'./detail/detail' |
| | |
| | | }, |
| | | |
| | | checkboxChange(n) { |
| | | console.log('change', n); |
| | | let finalArr = this.list.filter(item => !(n.indexOf(item.id) < 0)); |
| | | this.measureIds = finalArr.map((item) => { |
| | | return {id: item.id, baseMeasureContent: item.measure}; |
| | | }); |
| | | console.log('change', this.measureIds); |
| | | }, |
| | | submit() { |
| | | const param = { |
| | | id: this.detailData.id, |
| | | baseMeasures: this.measureIds, |
| | | responseMeasure: this.measures |
| | | } |
| | | submitMeasures(param).then(res => { |
| | | if(res.code == 100){ |
| | | uni.showToast({ |
| | | icon: "none", |
| | | title: '提交成功' |
| | | }); |
| | | this.goBack(); |
| | | } |
| | | }) |
| | | |
| | | }, |
| | | // 删除图片 |
| | | deletePic(event) { |
| | |
| | | uploadFilePromise(url) { |
| | | return new Promise((resolve, reject) => { |
| | | let a = uni.uploadFile({ |
| | | url: 'http://www.example.com', // 仅为示例,非真实的接口地址 |
| | | url: this.baseUrl + '/attachment/uploadMeasureImage/key', |
| | | filePath: url, |
| | | name: 'file', |
| | | header: { |
| | | 'tk':uni.getStorageSync('tk'), |
| | | 'uid': uni.getStorageSync('uid') |
| | | }, |
| | | formData: { |
| | | user: 'test' |
| | | id: this.detailData.id, |
| | | module: 'naturalDisasterPath' |
| | | }, |
| | | success: (res) => { |
| | | setTimeout(() => { |