|
|
|
|
@ -4,15 +4,15 @@
|
|
|
|
|
<u-form-item label="反馈科室" label-position="top" prop="type">
|
|
|
|
|
<u-input placeholder="请选择反馈科室" v-model="depName" type="select" :border="true" @click="depshow = true" />
|
|
|
|
|
<!-- <u-picker :show="typeShow" keyName="name" :columns="rainArr.rainTypes" @confirm="confirmType"></u-picker> -->
|
|
|
|
|
<u-select v-model="depshow" mode="single-column" value-name="id" label-name="name" :list="rainArr.depList"
|
|
|
|
|
@confirm="confirmDepType"></u-select>
|
|
|
|
|
<u-select v-model="depshow" mode="single-column" value-name="id" label-name="name"
|
|
|
|
|
:list="rainArr.depList" @confirm="confirmDepType"></u-select>
|
|
|
|
|
</u-form-item>
|
|
|
|
|
<u-form-item label="工单标题" label-position="top" prop="name" required>
|
|
|
|
|
<u-input v-model="form.name" type="text" :border="true" placeholder="请填写标题"/>
|
|
|
|
|
<u-input v-model="form.name" type="text" :border="true" placeholder="请填写标题" />
|
|
|
|
|
</u-form-item>
|
|
|
|
|
<u-form-item label="地址" label-position="top" required>
|
|
|
|
|
<!-- <text>{{form.address}}</text> -->
|
|
|
|
|
<u-input v-model="form.address" disabled type='text'/>
|
|
|
|
|
<u-input v-model="form.address" disabled type='text' />
|
|
|
|
|
<u-button shape="square" slot='right' size="mini" @click="chooseLocation" type="info">重新获取</u-button>
|
|
|
|
|
</u-form-item>
|
|
|
|
|
<u-form-item label-position="top" label="内容" prop="content" required>
|
|
|
|
|
@ -20,44 +20,42 @@
|
|
|
|
|
</u-form-item>
|
|
|
|
|
<u-form-item label-position="top" label="现场照片">
|
|
|
|
|
<u-upload ref="uUpload" multiple :maxCount="10" :action="action" upload-text="选择附件"
|
|
|
|
|
:previewFullImage="true" @on-progress="onprogress" @on-success="tosuccess" :file-list="filesList" :form-data="otherData" :show-tips="false" @on-uploaded="function(lists, name) {return toupload(lists, name,'filesList')}"
|
|
|
|
|
:previewFullImage="true" @on-progress="onprogress" @on-success="tosuccess" :file-list="filesList"
|
|
|
|
|
:form-data="otherData" :show-tips="false"
|
|
|
|
|
@on-uploaded="function(lists, name) {return toupload(lists, name,'filesList')}"
|
|
|
|
|
@on-remove="function(index, lists, name) {return toremove(index, lists, name,'filesList')}">
|
|
|
|
|
</u-upload>
|
|
|
|
|
</u-form-item>
|
|
|
|
|
<u-form-item label-position="top" label="异常处置建议" prop="tip">
|
|
|
|
|
<u-input v-model="form.tip" placeholder="请填写异常处置建议" type='textarea' height='100' :border="true" />
|
|
|
|
|
</u-form-item>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<u-form-item labelWidth="240" label-position="left" label="是否隶属于雨管科">
|
|
|
|
|
<u-radio-group v-model="form.is_rain">
|
|
|
|
|
<u-radio
|
|
|
|
|
v-for="(item, index) in rainArr.rains" :key="index"
|
|
|
|
|
:name="item.id"
|
|
|
|
|
>
|
|
|
|
|
<u-radio v-for="(item, index) in rainArr.rains" :key="index" :name="item.id">
|
|
|
|
|
{{item.name}}
|
|
|
|
|
</u-radio>
|
|
|
|
|
</u-radio-group>
|
|
|
|
|
</u-form-item>
|
|
|
|
|
<u-form-item labelWidth="240" label-position="left" label="是否现场处理">
|
|
|
|
|
<u-radio-group v-model="form.is_scene" @change="radioGroupChange">
|
|
|
|
|
<u-radio
|
|
|
|
|
v-for="(item, index) in rainArr.scenes" :key="index"
|
|
|
|
|
:name="item.id"
|
|
|
|
|
>
|
|
|
|
|
<u-radio v-for="(item, index) in rainArr.scenes" :key="index" :name="item.id">
|
|
|
|
|
{{item.name}}
|
|
|
|
|
</u-radio>
|
|
|
|
|
</u-radio-group>
|
|
|
|
|
</u-form-item>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div v-if="form.is_scene==1">
|
|
|
|
|
<u-form-item label-position="top" label="现场处理结果" prop="result">
|
|
|
|
|
<u-input v-model="form.result" type='textarea' height='100' :border="true" />
|
|
|
|
|
</u-form-item>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<u-form-item label-position="top" label="处理后照片">
|
|
|
|
|
<u-upload ref="uUpload" multiple :maxCount="10" :action="action" upload-text="选择附件"
|
|
|
|
|
:previewFullImage="true" @on-progress="onprogress" @on-success="tosuccess" :file-list="dealFilesList" :form-data="otherData" :show-tips="false" @on-uploaded="function(lists, name) {return toupload(lists, name,'dealFilesList')}"
|
|
|
|
|
:previewFullImage="true" @on-progress="onprogress" @on-success="tosuccess"
|
|
|
|
|
:file-list="dealFilesList" :form-data="otherData" :show-tips="false"
|
|
|
|
|
@on-uploaded="function(lists, name) {return toupload(lists, name,'dealFilesList')}"
|
|
|
|
|
@on-remove="function(index, lists, name) {return toremove(index, lists, name,'dealFilesList')}">
|
|
|
|
|
</u-upload>
|
|
|
|
|
</u-form-item>
|
|
|
|
|
@ -75,44 +73,44 @@
|
|
|
|
|
otherData: {
|
|
|
|
|
token: ""
|
|
|
|
|
},
|
|
|
|
|
depshow:false,
|
|
|
|
|
depName:"",
|
|
|
|
|
rainArr:{
|
|
|
|
|
depList:[],
|
|
|
|
|
rains:[{
|
|
|
|
|
id:0,
|
|
|
|
|
name:"否"
|
|
|
|
|
},{
|
|
|
|
|
id:1,
|
|
|
|
|
name:"是"
|
|
|
|
|
depshow: false,
|
|
|
|
|
depName: "",
|
|
|
|
|
rainArr: {
|
|
|
|
|
depList: [],
|
|
|
|
|
rains: [{
|
|
|
|
|
id: 0,
|
|
|
|
|
name: "否"
|
|
|
|
|
}, {
|
|
|
|
|
id: 1,
|
|
|
|
|
name: "是"
|
|
|
|
|
}],
|
|
|
|
|
scenes:[{
|
|
|
|
|
id:0,
|
|
|
|
|
name:"否"
|
|
|
|
|
},{
|
|
|
|
|
id:1,
|
|
|
|
|
name:"是"
|
|
|
|
|
scenes: [{
|
|
|
|
|
id: 0,
|
|
|
|
|
name: "否"
|
|
|
|
|
}, {
|
|
|
|
|
id: 1,
|
|
|
|
|
name: "是"
|
|
|
|
|
}]
|
|
|
|
|
},
|
|
|
|
|
action: "",
|
|
|
|
|
infoId:"",
|
|
|
|
|
|
|
|
|
|
filesList:[],
|
|
|
|
|
dealFilesList:[],
|
|
|
|
|
changeResult:"",
|
|
|
|
|
changedealFilesList:[],
|
|
|
|
|
infoId: "",
|
|
|
|
|
|
|
|
|
|
filesList: [],
|
|
|
|
|
dealFilesList: [],
|
|
|
|
|
changeResult: "",
|
|
|
|
|
changedealFilesList: [],
|
|
|
|
|
form: {
|
|
|
|
|
feedback_department_id:"",
|
|
|
|
|
name:"",
|
|
|
|
|
content:"",
|
|
|
|
|
status:0,
|
|
|
|
|
is_rain:"",
|
|
|
|
|
is_scene:"",
|
|
|
|
|
tip:"",
|
|
|
|
|
result:"",
|
|
|
|
|
address:"",
|
|
|
|
|
files_list:"",
|
|
|
|
|
files_end_list:""
|
|
|
|
|
feedback_department_id: "",
|
|
|
|
|
name: "",
|
|
|
|
|
content: "",
|
|
|
|
|
status: 0,
|
|
|
|
|
is_rain: "",
|
|
|
|
|
is_scene: "",
|
|
|
|
|
tip: "",
|
|
|
|
|
result: "",
|
|
|
|
|
address: "",
|
|
|
|
|
files_list: "",
|
|
|
|
|
files_end_list: ""
|
|
|
|
|
},
|
|
|
|
|
width: 300,
|
|
|
|
|
height: 300,
|
|
|
|
|
@ -134,12 +132,12 @@
|
|
|
|
|
},
|
|
|
|
|
onLoad(options) {
|
|
|
|
|
var that = this;
|
|
|
|
|
if(options.id){
|
|
|
|
|
if (options.id) {
|
|
|
|
|
this.infoId = options.id;
|
|
|
|
|
this.showInfo(this.infoId);
|
|
|
|
|
}
|
|
|
|
|
this.loadDep();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.action = this.util.HOST + "/api/mobile/upload-file";
|
|
|
|
|
this.otherData.token = uni.getStorageSync("userInfo_token").access_token;
|
|
|
|
|
},
|
|
|
|
|
@ -148,17 +146,34 @@
|
|
|
|
|
let that = this;
|
|
|
|
|
uni.getLocation({
|
|
|
|
|
type: "gcj02",
|
|
|
|
|
geocode:true,
|
|
|
|
|
geocode: true,
|
|
|
|
|
success(res) {
|
|
|
|
|
|
|
|
|
|
const url = "https://apis.map.qq.com/ws/geocoder/v1/?key=EUQBZ-MJALU-WZFVR-2HFNW-TIK2K-TNBJI&location="+res.latitude+","+res.longitude+"&output=jsonp"
|
|
|
|
|
var loc = null
|
|
|
|
|
console.log(typeof(window.android))
|
|
|
|
|
if (typeof(window.android) != undefined && typeof(window.android) != "undefined") {
|
|
|
|
|
loc = window.android.getLocInfo();
|
|
|
|
|
}
|
|
|
|
|
let latitude = "";
|
|
|
|
|
let longitude = "";
|
|
|
|
|
if (loc) {
|
|
|
|
|
latitude = JSON.parse(loc).lat;
|
|
|
|
|
longitude = JSON.parse(loc).lon;
|
|
|
|
|
} else {
|
|
|
|
|
latitude = res.latitude;
|
|
|
|
|
longitude = res.longitude;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const url =
|
|
|
|
|
"https://apis.map.qq.com/ws/geocoder/v1/?key=EUQBZ-MJALU-WZFVR-2HFNW-TIK2K-TNBJI&location=" +
|
|
|
|
|
latitude + "," + longitude + "&output=jsonp"
|
|
|
|
|
that.$jsonp(
|
|
|
|
|
url
|
|
|
|
|
).then(re => {
|
|
|
|
|
url
|
|
|
|
|
).then(re => {
|
|
|
|
|
that.form.address = re.result.formatted_addresses.recommend
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
uni.getSystemInfo({
|
|
|
|
|
complete(res) {
|
|
|
|
|
@ -169,13 +184,13 @@
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
loadDep(){
|
|
|
|
|
loadDep() {
|
|
|
|
|
var that = this
|
|
|
|
|
that.util.request({
|
|
|
|
|
api: '/api/mobile/other/department-list',
|
|
|
|
|
method: "get",
|
|
|
|
|
data: {
|
|
|
|
|
is_tree:0
|
|
|
|
|
is_tree: 0
|
|
|
|
|
},
|
|
|
|
|
utilSuccess: function(res) {
|
|
|
|
|
that.rainArr.depList = res
|
|
|
|
|
@ -185,41 +200,41 @@
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
radioGroupChange(e){
|
|
|
|
|
console.log(e)
|
|
|
|
|
if(e==0){
|
|
|
|
|
radioGroupChange(e) {
|
|
|
|
|
console.log(e)
|
|
|
|
|
if (e == 0) {
|
|
|
|
|
this.form.result = "";
|
|
|
|
|
this.dealFilesList = [];
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
this.form.result = this.changeResult;
|
|
|
|
|
this.dealFilesList = this.changedealFilesList;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
confirmDepType(val){
|
|
|
|
|
confirmDepType(val) {
|
|
|
|
|
var that = this
|
|
|
|
|
console.log(val)
|
|
|
|
|
that.form.feedback_department_id = val[0].value
|
|
|
|
|
that.depName = val[0].label
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
toremove(index, lists, name,whatfile) {
|
|
|
|
|
if(whatfile=="filesList"){
|
|
|
|
|
this.filesList.splice(index,1)
|
|
|
|
|
toremove(index, lists, name, whatfile) {
|
|
|
|
|
if (whatfile == "filesList") {
|
|
|
|
|
this.filesList.splice(index, 1)
|
|
|
|
|
// this.form.files_list = list;
|
|
|
|
|
}
|
|
|
|
|
if(whatfile=="dealFilesList"){
|
|
|
|
|
this.dealFilesList.splice(index,1)
|
|
|
|
|
if (whatfile == "dealFilesList") {
|
|
|
|
|
this.dealFilesList.splice(index, 1)
|
|
|
|
|
// this.form.files_end_list = list;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onprogress(res){
|
|
|
|
|
onprogress(res) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: "none",
|
|
|
|
|
title: "上传中",
|
|
|
|
|
duration: 2000
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
tosuccess(){
|
|
|
|
|
tosuccess() {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: "none",
|
|
|
|
|
title: "上传成功",
|
|
|
|
|
@ -229,36 +244,36 @@
|
|
|
|
|
toupload(lists, name, whatfile) {
|
|
|
|
|
var that = this;
|
|
|
|
|
let list = [];
|
|
|
|
|
if(whatfile=="filesList"){
|
|
|
|
|
if (whatfile == "filesList") {
|
|
|
|
|
that.filesList = lists
|
|
|
|
|
// this.form.files_list = list;
|
|
|
|
|
}
|
|
|
|
|
if(whatfile=="dealFilesList"){
|
|
|
|
|
if (whatfile == "dealFilesList") {
|
|
|
|
|
that.dealFilesList = lists;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
submit() {
|
|
|
|
|
let that = this;
|
|
|
|
|
let list = [];
|
|
|
|
|
let deallist=[];
|
|
|
|
|
for(var mod of that.filesList){
|
|
|
|
|
if( mod.response){
|
|
|
|
|
let deallist = [];
|
|
|
|
|
for (var mod of that.filesList) {
|
|
|
|
|
if (mod.response) {
|
|
|
|
|
list.push({
|
|
|
|
|
upload_id: mod.response.id
|
|
|
|
|
})
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
list.push({
|
|
|
|
|
upload_id:mod.id
|
|
|
|
|
upload_id: mod.id
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
for(var mod of that.dealFilesList){
|
|
|
|
|
if( mod.response){
|
|
|
|
|
for (var mod of that.dealFilesList) {
|
|
|
|
|
if (mod.response) {
|
|
|
|
|
deallist.push({
|
|
|
|
|
upload_id: mod.response.id
|
|
|
|
|
})
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
deallist.push({
|
|
|
|
|
upload_id: mod.id
|
|
|
|
|
})
|
|
|
|
|
@ -268,13 +283,13 @@
|
|
|
|
|
that.form.files_end_list = deallist;
|
|
|
|
|
that.changeResult = that.form.result
|
|
|
|
|
that.changedealFilesList = that.deallist
|
|
|
|
|
console.log("form",that.form)
|
|
|
|
|
console.log("form", that.form)
|
|
|
|
|
// return;
|
|
|
|
|
// return;
|
|
|
|
|
this.$refs.uForm.validate(valid => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
console.log('验证通过');
|
|
|
|
|
if(that.infoId){
|
|
|
|
|
if (that.infoId) {
|
|
|
|
|
that.util.request({
|
|
|
|
|
api: '/api/mobile/mobile-worksheet/save',
|
|
|
|
|
method: "POST",
|
|
|
|
|
@ -293,7 +308,7 @@
|
|
|
|
|
that.util.alert(res);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
that.util.request({
|
|
|
|
|
api: '/api/mobile/mobile-worksheet/store',
|
|
|
|
|
method: "POST",
|
|
|
|
|
@ -313,7 +328,7 @@
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
console.log('验证失败');
|
|
|
|
|
}
|
|
|
|
|
@ -324,18 +339,18 @@
|
|
|
|
|
url: "../orderList/orderList"
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
showInfo(id){
|
|
|
|
|
showInfo(id) {
|
|
|
|
|
var that = this;
|
|
|
|
|
that.util.request({
|
|
|
|
|
api: '/api/mobile/mobile-worksheet/show',
|
|
|
|
|
method: "get",
|
|
|
|
|
data: {
|
|
|
|
|
id:id
|
|
|
|
|
id: id
|
|
|
|
|
},
|
|
|
|
|
utilSuccess: function(result) {
|
|
|
|
|
that.form = result;
|
|
|
|
|
for(var m of that.rainArr.depList){
|
|
|
|
|
if(result.feedback_department_id==m.id){
|
|
|
|
|
for (var m of that.rainArr.depList) {
|
|
|
|
|
if (result.feedback_department_id == m.id) {
|
|
|
|
|
console.log(m)
|
|
|
|
|
that.depName = m.name
|
|
|
|
|
}
|
|
|
|
|
@ -343,19 +358,19 @@
|
|
|
|
|
let _files = [];
|
|
|
|
|
let _dealfiles = [];
|
|
|
|
|
for (var mod of result.worksheet_files) {
|
|
|
|
|
let m = Object.assign({}, mod);
|
|
|
|
|
m.url = mod.files.url;
|
|
|
|
|
m.id = mod.files.id;
|
|
|
|
|
m.name = mod.files.original_name;
|
|
|
|
|
_files.push(m);
|
|
|
|
|
let m = Object.assign({}, mod);
|
|
|
|
|
m.url = mod.files.url;
|
|
|
|
|
m.id = mod.files.id;
|
|
|
|
|
m.name = mod.files.original_name;
|
|
|
|
|
_files.push(m);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (var mod of result.worksheet_end_files) {
|
|
|
|
|
let m = Object.assign({}, mod);
|
|
|
|
|
m.url = mod.files.url;
|
|
|
|
|
m.id = mod.files.id;
|
|
|
|
|
m.name = mod.files.original_name;
|
|
|
|
|
_dealfiles.push(m);
|
|
|
|
|
let m = Object.assign({}, mod);
|
|
|
|
|
m.url = mod.files.url;
|
|
|
|
|
m.id = mod.files.id;
|
|
|
|
|
m.name = mod.files.original_name;
|
|
|
|
|
_dealfiles.push(m);
|
|
|
|
|
}
|
|
|
|
|
that.filesList = _files
|
|
|
|
|
that.dealFilesList = _dealfiles
|
|
|
|
|
@ -368,7 +383,7 @@
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
chooseLocation(e) { //打开地图选择位置
|
|
|
|
|
var that = this;
|
|
|
|
|
uni.chooseLocation({
|
|
|
|
|
@ -394,4 +409,4 @@
|
|
|
|
|
color: #fff;
|
|
|
|
|
padding: 20rpx 30rpx;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
</style>
|
|
|
|
|
|