|
@@ -1,16 +1,17 @@
|
|
<template>
|
|
<template>
|
|
<view>
|
|
<view>
|
|
-
|
|
|
|
- <form action="" >
|
|
|
|
- <view style="height:30rpx"></view>
|
|
|
|
- <view class="form-item ">
|
|
|
|
|
|
+
|
|
|
|
+ <form action="">
|
|
|
|
+ <view style='height:30rpx'></view>
|
|
|
|
+
|
|
|
|
+ <view class="form-item">
|
|
<view class="title">
|
|
<view class="title">
|
|
<text class="necessary">*</text>
|
|
<text class="necessary">*</text>
|
|
上报名称:
|
|
上报名称:
|
|
</view>
|
|
</view>
|
|
- <input type="text">
|
|
|
|
|
|
+ <input type="text" v-model="reportName">
|
|
</view>
|
|
</view>
|
|
-
|
|
|
|
|
|
+
|
|
<view class="form-item margin-top">
|
|
<view class="form-item margin-top">
|
|
<view class="title">
|
|
<view class="title">
|
|
<text class="necessary">*</text>
|
|
<text class="necessary">*</text>
|
|
@@ -18,10 +19,10 @@
|
|
</view>
|
|
</view>
|
|
<radio-group name="gender" @change="radioChange">
|
|
<radio-group name="gender" @change="radioChange">
|
|
<label class="margin-right-xs">
|
|
<label class="margin-right-xs">
|
|
- <radio value="2" checked /><text>正常</text>
|
|
|
|
|
|
+ <radio value="0" checked /><text>正常</text>
|
|
</label>
|
|
</label>
|
|
<label class="margin-right-xs">
|
|
<label class="margin-right-xs">
|
|
- <radio value="3" /><text>异常</text>
|
|
|
|
|
|
+ <radio value="1" /><text>异常</text>
|
|
</label>
|
|
</label>
|
|
<label class="margin-right-xs">
|
|
<label class="margin-right-xs">
|
|
<radio value="2" /><text>故障</text>
|
|
<radio value="2" /><text>故障</text>
|
|
@@ -30,20 +31,23 @@
|
|
<radio value="3" /><text>其他</text>
|
|
<radio value="3" /><text>其他</text>
|
|
</label>
|
|
</label>
|
|
</radio-group>
|
|
</radio-group>
|
|
-
|
|
|
|
|
|
+
|
|
</view>
|
|
</view>
|
|
-
|
|
|
|
|
|
+
|
|
<view class="form-item margin-top">
|
|
<view class="form-item margin-top">
|
|
<view class="title">
|
|
<view class="title">
|
|
<text class="necessary">*</text>
|
|
<text class="necessary">*</text>
|
|
上传图片:
|
|
上传图片:
|
|
</view>
|
|
</view>
|
|
-
|
|
|
|
|
|
+
|
|
<view style="width:500rpx">
|
|
<view style="width:500rpx">
|
|
- <view class="cu-form-group">
|
|
|
|
|
|
+ <view ref="input" class="input">
|
|
|
|
+ </view>
|
|
|
|
+ <!-- <view class="cu-form-group">
|
|
<view class="grid col-4 grid-square flex-sub">
|
|
<view class="grid col-4 grid-square flex-sub">
|
|
- <view class="bg-img" v-for="(item,index) in imgList" :key="index" @tap="ViewImage" :data-url="imgList[index]">
|
|
|
|
- <image :src="imgList[index]" mode="aspectFill"></image>
|
|
|
|
|
|
+ <view class="bg-img" v-for="(item,index) in imgList" :key="index" @tap="ViewImage"
|
|
|
|
+ :data-url="imgList[index]">
|
|
|
|
+ <image :src="imgList[index]" mode="aspectFill"></image>
|
|
<view class="cu-tag bg-red" @tap.stop="DelImg" :data-index="index">
|
|
<view class="cu-tag bg-red" @tap.stop="DelImg" :data-index="index">
|
|
<text class='cuIcon-close'></text>
|
|
<text class='cuIcon-close'></text>
|
|
</view>
|
|
</view>
|
|
@@ -52,25 +56,25 @@
|
|
<text class='cuIcon-cameraadd'></text>
|
|
<text class='cuIcon-cameraadd'></text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- </view>
|
|
|
|
|
|
+ </view> -->
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
-
|
|
|
|
|
|
+
|
|
<view class="form-item margin-top">
|
|
<view class="form-item margin-top">
|
|
<view class="title">
|
|
<view class="title">
|
|
<text class="necessary">*</text>
|
|
<text class="necessary">*</text>
|
|
维保描述:
|
|
维保描述:
|
|
</view>
|
|
</view>
|
|
- <textarea maxlength="-1" @input="textareaAInput" placeholder="" width="250"></textarea>
|
|
|
|
|
|
+ <textarea maxlength="-1" @input="textareaAInput" placeholder="" v-model="msg" width="250"></textarea>
|
|
</view>
|
|
</view>
|
|
-
|
|
|
|
|
|
+
|
|
<view class="btn-area submitBottomBtn padding-lr-sm">
|
|
<view class="btn-area submitBottomBtn padding-lr-sm">
|
|
<button class="bg-blue round margin-top" @click="addSubmit">提 交 </button>
|
|
<button class="bg-blue round margin-top" @click="addSubmit">提 交 </button>
|
|
</view>
|
|
</view>
|
|
-
|
|
|
|
|
|
+
|
|
</form>
|
|
</form>
|
|
|
|
|
|
-
|
|
|
|
|
|
+
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -78,17 +82,111 @@
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
-
|
|
|
|
imgList: [],
|
|
imgList: [],
|
|
|
|
+ msg: '',
|
|
|
|
+ id: '',
|
|
|
|
+ reportName: '',
|
|
|
|
+ radioOne: 0,
|
|
|
|
+ zb_id:0
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
|
|
|
|
+ onLoad: function(option) {
|
|
|
|
+ this.id = option.id;
|
|
|
|
+ this.zb_id=option.zb_id
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ mounted() {
|
|
|
|
+ // 创建附件上传
|
|
|
|
+ var _self = this;
|
|
|
|
+ var input = document.createElement('input'); //创建元素
|
|
|
|
+ input.type = 'file' //添加file类型
|
|
|
|
+ input.onchange = (event) => {
|
|
|
|
+ _self.upFile(input, event)
|
|
}
|
|
}
|
|
|
|
+ this.$refs.input.$el.appendChild(input)
|
|
|
|
+
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
radioChange(e) {
|
|
radioChange(e) {
|
|
console.log('type:' + e.detail.value);
|
|
console.log('type:' + e.detail.value);
|
|
this.radioOne = e.detail.value;
|
|
this.radioOne = e.detail.value;
|
|
},
|
|
},
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ upFile(input, event) {
|
|
|
|
+ var _self = this;
|
|
|
|
+ uni.uploadFile({
|
|
|
|
+ url: 'https://qhome.usky.cn/USKYZHAF/USKYZHAF.php/Home/Inspection/setUpload',
|
|
|
|
+ files: [{
|
|
|
|
+ file: input.files[0],
|
|
|
|
+ uri: event.srcElement.value
|
|
|
|
+ }],
|
|
|
|
+ success: (uploadFileRes) => {
|
|
|
|
+ var data = JSON.parse(uploadFileRes.data)
|
|
|
|
+ this.img = data.img_url;
|
|
|
|
+ console.log(this.img)
|
|
|
|
+ },
|
|
|
|
+ fail: (err) => {
|
|
|
|
+
|
|
|
|
+ console.log(err)
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ addSubmit() {
|
|
|
|
+ if (!this.reportName) {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: "请输入上报名称",
|
|
|
|
+ icon: "none"
|
|
|
|
+ });
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (!this.msg) {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: "请输入维保描述",
|
|
|
|
+ icon: "none"
|
|
|
|
+ });
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (!this.img) {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: "请上传图片",
|
|
|
|
+ icon: "none"
|
|
|
|
+ });
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ this.powerSubmitRes({
|
|
|
|
+ "zb_id": this.zb_id,
|
|
|
|
+ // "zb_id":600,
|
|
|
|
+ "spot_id": this.id,
|
|
|
|
+ "report_name": this.reportName,
|
|
|
|
+ "spot_abnormal": this.radioOne,
|
|
|
|
+ "img": this.img,
|
|
|
|
+ "dwsb_remarks": this.msg,
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ async powerSubmitRes(params = {}) {
|
|
|
|
+ const res = await this.$myRequest({
|
|
|
|
+ url: 'Maintenance/setMaintenance',
|
|
|
|
+ data: params
|
|
|
|
+ })
|
|
|
|
+ if (res.data.flag) {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: "提交成功",
|
|
|
|
+ });
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url: '/pages/weiBao/planInnerList/planInnerList?id=' + this.id,
|
|
|
|
+ });
|
|
|
|
+ }, 1000);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+
|
|
ChooseImage() {
|
|
ChooseImage() {
|
|
uni.chooseImage({
|
|
uni.chooseImage({
|
|
count: 4, //默认9
|
|
count: 4, //默认9
|
|
@@ -103,7 +201,7 @@
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
-
|
|
|
|
|
|
+
|
|
ViewImage(e) {
|
|
ViewImage(e) {
|
|
uni.previewImage({
|
|
uni.previewImage({
|
|
urls: this.imgList,
|
|
urls: this.imgList,
|
|
@@ -123,14 +221,16 @@
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
-
|
|
|
|
|
|
+ textareaAInput(e) {
|
|
|
|
+ this.textareaAValue = e.detail.value
|
|
|
|
+ },
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
<style lang="scss">
|
|
-
|
|
|
|
|
|
|
|
-
|
|
|
|
-</style>
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
+</style>
|