|
@@ -230,17 +230,19 @@ var _default = {
|
|
|
value: null,
|
|
|
imgArr: [],
|
|
|
type: 2,
|
|
|
- id: null
|
|
|
+ id: null,
|
|
|
+ userId: null
|
|
|
};
|
|
|
},
|
|
|
onLoad: function onLoad(e) {
|
|
|
var _this2 = this;
|
|
|
console.log(e);
|
|
|
this.id = e.id;
|
|
|
+ //this.userId=e.userId
|
|
|
if (e.type == 1) {
|
|
|
this.type = e.type;
|
|
|
console.log(this.id);
|
|
|
- _index.default.getwarningPile(this.id).then(function (res) {
|
|
|
+ _index.default.getpatrolRecord(this.id).then(function (res) {
|
|
|
_this2.form = res;
|
|
|
//this.imgymxs=res.photoList
|
|
|
if (null != res.photoList) {
|
|
@@ -253,15 +255,16 @@ var _default = {
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
- this.getwarningPileInfo(e.value);
|
|
|
+ //this.getwarningPileInfo(e.value)
|
|
|
}
|
|
|
uni.setNavigationBarTitle({
|
|
|
- title: '抢险维修单'
|
|
|
+ title: '警示柱巡查记录'
|
|
|
});
|
|
|
uni.setNavigationBarColor({
|
|
|
frontColor: '#ffffff',
|
|
|
backgroundColor: '#2d95f4'
|
|
|
});
|
|
|
+ this.getUsreName();
|
|
|
},
|
|
|
methods: {
|
|
|
showPhoto: function showPhoto(index) {
|
|
@@ -278,7 +281,7 @@ var _default = {
|
|
|
},
|
|
|
getwarningPileInfo: function getwarningPileInfo(value) {
|
|
|
var _this3 = this;
|
|
|
- _index.default.getwarningPileInfo(value).then(function (res) {
|
|
|
+ _index.default.getpatrolRecord(value).then(function (res) {
|
|
|
_this3.form = res;
|
|
|
if (null != res.photoList) {
|
|
|
//this.imgymxs=res.photoList
|
|
@@ -294,10 +297,18 @@ var _default = {
|
|
|
console.log(_this3.imgymxs);
|
|
|
});
|
|
|
},
|
|
|
+ getUsreName: function getUsreName() {
|
|
|
+ var _this4 = this;
|
|
|
+ _index.default.getUserName().then(function (res) {
|
|
|
+ _this4.userId = res.id;
|
|
|
+ });
|
|
|
+ },
|
|
|
save: function save() {
|
|
|
var _this = this;
|
|
|
this.form.photoList = this.imgArr;
|
|
|
- _index.default.setwarningPile(this.form).then(function (res) {
|
|
|
+ this.form.warningPileId = this.id;
|
|
|
+ this.form.userId = this.userId;
|
|
|
+ _index.default.patrolRecord(this.form).then(function (res) {
|
|
|
console.log(res);
|
|
|
_this.$UTILS.showPrompt('上报成功');
|
|
|
setTimeout(function () {
|
|
@@ -309,7 +320,7 @@ var _default = {
|
|
|
});
|
|
|
},
|
|
|
choose: function choose() {
|
|
|
- var _this4 = this;
|
|
|
+ var _this5 = this;
|
|
|
var _this = this;
|
|
|
uni.showActionSheet({
|
|
|
title: '上传',
|
|
@@ -317,9 +328,9 @@ var _default = {
|
|
|
success: function success(res) {
|
|
|
// console.log(res)
|
|
|
if (res.tapIndex == 0) {
|
|
|
- _this4.chooseimage();
|
|
|
+ _this5.chooseimage();
|
|
|
} else {
|
|
|
- _this4.choosevideo();
|
|
|
+ _this5.choosevideo();
|
|
|
}
|
|
|
}
|
|
|
});
|
|
@@ -330,7 +341,7 @@ var _default = {
|
|
|
uni.chooseImage({
|
|
|
sourceType: ['camera'],
|
|
|
success: function success(resp) {
|
|
|
- var _this5 = this;
|
|
|
+ var _this6 = this;
|
|
|
console.log('res--uni.chooseMedia', resp);
|
|
|
resp.tempFiles.forEach(function (item, index) {
|
|
|
var task = uni.uploadFile({
|
|
@@ -368,7 +379,7 @@ var _default = {
|
|
|
},
|
|
|
fail: function fail(e) {
|
|
|
_this.$UTILS.showPrompt('选取失败!');
|
|
|
- _this5.uploadError(index, e);
|
|
|
+ _this6.uploadError(index, e);
|
|
|
},
|
|
|
complete: function complete(res) {
|
|
|
_this.uploading = false;
|
|
@@ -400,7 +411,7 @@ var _default = {
|
|
|
sourceType: ['camera'],
|
|
|
maxDuration: 30,
|
|
|
success: function success(resp) {
|
|
|
- var _this6 = this;
|
|
|
+ var _this7 = this;
|
|
|
var task = uni.uploadFile({
|
|
|
url: _this.$HTTP.webUrl + "/obs",
|
|
|
filePath: resp.tempFilePath,
|
|
@@ -411,7 +422,7 @@ var _default = {
|
|
|
// 判断是否json字符串,将其转为json格式
|
|
|
var data = _this.$u.test.jsonString(res.data) ? JSON.parse(res.data) : res.data;
|
|
|
if (![200, 201, 204].includes(res.statusCode)) {
|
|
|
- _this6.uploadError(index, data);
|
|
|
+ _this7.uploadError(index, data);
|
|
|
} else {
|
|
|
// 上传成功
|
|
|
// this.lists[index].response = data;
|
|
@@ -436,7 +447,7 @@ var _default = {
|
|
|
},
|
|
|
fail: function fail(e) {
|
|
|
_this.$UTILS.showPrompt('选取失败!');
|
|
|
- _this6.uploadError(index, e);
|
|
|
+ _this7.uploadError(index, e);
|
|
|
},
|
|
|
complete: function complete(res) {
|
|
|
uni.hideLoading();
|
|
@@ -462,15 +473,15 @@ var _default = {
|
|
|
});
|
|
|
},
|
|
|
remove: function remove(index) {
|
|
|
- var _this7 = this;
|
|
|
+ var _this8 = this;
|
|
|
uni.showModal({
|
|
|
title: '提示',
|
|
|
content: '是否删除该图片或视频?',
|
|
|
success: function success(res) {
|
|
|
if (res.confirm) {
|
|
|
- _this7.imgArr.splice(index, 1);
|
|
|
- _this7.imgymxs.splice(index, 1);
|
|
|
- console.log('this.imgarr', _this7.imgArr);
|
|
|
+ _this8.imgArr.splice(index, 1);
|
|
|
+ _this8.imgymxs.splice(index, 1);
|
|
|
+ console.log('this.imgarr', _this8.imgArr);
|
|
|
}
|
|
|
}
|
|
|
});
|