# Conflicts: # subPackWork/electronicPatrol/taskDetails.vue # subPackWork/myReport/reportDetail.vuemaster
commit
0b01a5abdb
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.3 KiB |
@ -1,127 +1,131 @@ |
||||
<template> |
||||
<view class="container"> |
||||
<view class="example"> |
||||
<uni-forms ref="form" :model="user" labelWidth="80px"> |
||||
<uni-forms-item label="用户昵称" name="nickName"> |
||||
<uni-easyinput v-model="user.nickName" placeholder="请输入昵称" /> |
||||
</uni-forms-item> |
||||
<uni-forms-item label="手机号码" name="phonenumber"> |
||||
<uni-easyinput v-model="user.phonenumber" placeholder="请输入手机号码" /> |
||||
</uni-forms-item> |
||||
<uni-forms-item label="邮箱" name="email"> |
||||
<uni-easyinput v-model="user.email" placeholder="请输入邮箱" /> |
||||
</uni-forms-item> |
||||
<uni-forms-item label="性别" name="sex" required> |
||||
<uni-data-checkbox v-model="user.sex" :localdata="sexs" /> |
||||
</uni-forms-item> |
||||
</uni-forms> |
||||
<button type="primary" @click="submit">提交</button> |
||||
</view> |
||||
</view> |
||||
<view class="v-page"> |
||||
<uni-forms ref="form" :model="user" labelWidth="80px" class="v-form"> |
||||
<uni-forms-item label="用户昵称" name="nickName"> |
||||
<uni-easyinput v-model="user.nickName" placeholder="请输入昵称" /> |
||||
</uni-forms-item> |
||||
<uni-forms-item label="手机号码" name="phonenumber"> |
||||
<uni-easyinput v-model="user.phonenumber" placeholder="请输入手机号码" /> |
||||
</uni-forms-item> |
||||
<uni-forms-item label="邮箱" name="email"> |
||||
<uni-easyinput v-model="user.email" placeholder="请输入邮箱" /> |
||||
</uni-forms-item> |
||||
<uni-forms-item label="性别" name="sex" required> |
||||
<uni-data-checkbox v-model="user.sex" :localdata="sexs" /> |
||||
</uni-forms-item> |
||||
</uni-forms> |
||||
<view class="v-page-button contain"> |
||||
<button class="v-btn-large" type="primary" @click="submit">提交</button> |
||||
</view> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import { getUserProfile } from "@/api/system/user" |
||||
import { updateUserProfile } from "@/api/system/user" |
||||
import { |
||||
getUserProfile |
||||
} from "@/api/system/user" |
||||
import { |
||||
updateUserProfile |
||||
} from "@/api/system/user" |
||||
|
||||
export default { |
||||
data() { |
||||
return { |
||||
user: { |
||||
nickName: "", |
||||
phonenumber: "", |
||||
email: "", |
||||
sex: "" |
||||
}, |
||||
sexs: [{ |
||||
text: '男', |
||||
value: "0" |
||||
}, { |
||||
text: '女', |
||||
value: "1" |
||||
}], |
||||
rules: { |
||||
nickName: { |
||||
rules: [{ |
||||
required: true, |
||||
errorMessage: '用户昵称不能为空' |
||||
}] |
||||
}, |
||||
phonenumber: { |
||||
rules: [{ |
||||
required: true, |
||||
errorMessage: '手机号码不能为空' |
||||
}, { |
||||
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, |
||||
errorMessage: '请输入正确的手机号码' |
||||
}] |
||||
}, |
||||
email: { |
||||
rules: [{ |
||||
required: true, |
||||
errorMessage: '邮箱地址不能为空' |
||||
}, { |
||||
format: 'email', |
||||
errorMessage: '请输入正确的邮箱地址' |
||||
}] |
||||
} |
||||
} |
||||
} |
||||
}, |
||||
onLoad() { |
||||
this.getUser() |
||||
}, |
||||
onReady() { |
||||
this.$refs.form.setRules(this.rules) |
||||
}, |
||||
methods: { |
||||
getUser() { |
||||
getUserProfile().then(response => { |
||||
this.user = response.data |
||||
}) |
||||
}, |
||||
submit(ref) { |
||||
this.$refs.form.validate().then(res => { |
||||
updateUserProfile(this.user).then(response => { |
||||
this.$modal.msgSuccess("修改成功") |
||||
}) |
||||
}) |
||||
} |
||||
} |
||||
} |
||||
export default { |
||||
data() { |
||||
return { |
||||
user: { |
||||
nickName: "", |
||||
phonenumber: "", |
||||
email: "", |
||||
sex: "" |
||||
}, |
||||
sexs: [{ |
||||
text: '男', |
||||
value: "0" |
||||
}, { |
||||
text: '女', |
||||
value: "1" |
||||
}], |
||||
rules: { |
||||
nickName: { |
||||
rules: [{ |
||||
required: true, |
||||
errorMessage: '用户昵称不能为空' |
||||
}] |
||||
}, |
||||
phonenumber: { |
||||
rules: [{ |
||||
required: true, |
||||
errorMessage: '手机号码不能为空' |
||||
}, { |
||||
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, |
||||
errorMessage: '请输入正确的手机号码' |
||||
}] |
||||
}, |
||||
email: { |
||||
rules: [{ |
||||
required: true, |
||||
errorMessage: '邮箱地址不能为空' |
||||
}, { |
||||
format: 'email', |
||||
errorMessage: '请输入正确的邮箱地址' |
||||
}] |
||||
} |
||||
} |
||||
} |
||||
}, |
||||
onLoad() { |
||||
this.getUser() |
||||
}, |
||||
onReady() { |
||||
this.$refs.form.setRules(this.rules) |
||||
}, |
||||
methods: { |
||||
getUser() { |
||||
getUserProfile().then(response => { |
||||
this.user = response.data |
||||
}) |
||||
}, |
||||
submit(ref) { |
||||
this.$refs.form.validate().then(res => { |
||||
updateUserProfile(this.user).then(response => { |
||||
this.$modal.msgSuccess("修改成功") |
||||
}) |
||||
}) |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss"> |
||||
page { |
||||
background-color: #ffffff; |
||||
} |
||||
page { |
||||
background-color: #ffffff; |
||||
} |
||||
|
||||
.example { |
||||
padding: 15px; |
||||
background-color: #fff; |
||||
} |
||||
.example { |
||||
padding: 15px; |
||||
background-color: #fff; |
||||
} |
||||
|
||||
.segmented-control { |
||||
margin-bottom: 15px; |
||||
} |
||||
.segmented-control { |
||||
margin-bottom: 15px; |
||||
} |
||||
|
||||
.button-group { |
||||
margin-top: 15px; |
||||
display: flex; |
||||
justify-content: space-around; |
||||
} |
||||
.button-group { |
||||
margin-top: 15px; |
||||
display: flex; |
||||
justify-content: space-around; |
||||
} |
||||
|
||||
.form-item { |
||||
display: flex; |
||||
align-items: center; |
||||
flex: 1; |
||||
} |
||||
.form-item { |
||||
display: flex; |
||||
align-items: center; |
||||
flex: 1; |
||||
} |
||||
|
||||
.button { |
||||
display: flex; |
||||
align-items: center; |
||||
height: 35px; |
||||
line-height: 35px; |
||||
margin-left: 10px; |
||||
} |
||||
</style> |
||||
.button { |
||||
display: flex; |
||||
align-items: center; |
||||
height: 35px; |
||||
line-height: 35px; |
||||
margin-left: 10px; |
||||
} |
||||
</style> |
@ -1,203 +1,194 @@ |
||||
<template> |
||||
<view class="detail-container"> |
||||
<view class="g-body"> |
||||
<view class="evan-form-show"> |
||||
<evan-form ref="form" :hide-required-asterisk="hideRequiredAsterisk" :model="info"> |
||||
<view class="body-item"> |
||||
<evan-form-item label="回访人:" prop="userId"> |
||||
<uni-data-picker |
||||
class="tree-pick" |
||||
v-model="info.userId" |
||||
:localdata="classDataTree" |
||||
placeholder="请选择回访人" |
||||
popup-title="请选择" |
||||
@change="onchange" |
||||
@inputclick="inputclick" |
||||
@nodeclick="onnodeclick" |
||||
@popupclosed="onpopupclosed" |
||||
@popupopened="onpopupopened" |
||||
></uni-data-picker> |
||||
</evan-form-item> |
||||
<evan-form-item label="满意度:" prop="satisfactionType"> |
||||
<picker @change="bindPickerChange" :value="index" :range="array" > |
||||
<view class="uni-input">{{ array[index] }}</view> |
||||
</picker> |
||||
</evan-form-item> |
||||
</view> |
||||
<view class="body-item"> |
||||
<evan-form-item label="回访反馈:" prop="returnCallFeedback"> |
||||
<textarea class="area-text" v-model="info.returnCallFeedback" auto-height /> |
||||
</evan-form-item> |
||||
</view> |
||||
<view class="body-item"> |
||||
<evan-form-item label="归档总结:" prop="filingSummary"> |
||||
<textarea class="area-text" v-model="info.filingSummary" auto-height /> |
||||
</evan-form-item> |
||||
</view> |
||||
<view class="v-page"> |
||||
<view class="v-card contain"> |
||||
<view class="v-card-box"> |
||||
<evan-form ref="form" class="v-form" :hide-required-asterisk="hideRequiredAsterisk" :model="info"> |
||||
<evan-form-item label="回访人:" prop="userId"> |
||||
<uni-data-picker class="tree-pick" v-model="info.userId" :localdata="classDataTree" |
||||
placeholder="请选择回访人" popup-title="请选择" @change="onchange" @inputclick="inputclick" |
||||
@nodeclick="onnodeclick" @popupclosed="onpopupclosed" |
||||
@popupopened="onpopupopened"></uni-data-picker> |
||||
</evan-form-item> |
||||
<evan-form-item label="满意度:" prop="satisfactionType"> |
||||
<picker @change="bindPickerChange" :value="index" :range="array"> |
||||
<view class="uni-input">{{ array[index] }}</view> |
||||
</picker> |
||||
</evan-form-item> |
||||
<evan-form-item label="回访反馈:" prop="returnCallFeedback"> |
||||
<textarea class="area-text" v-model="info.returnCallFeedback" auto-height /> |
||||
</evan-form-item> |
||||
<evan-form-item label="归档总结:" prop="filingSummary"> |
||||
<textarea class="area-text" v-model="info.filingSummary" auto-height /> |
||||
</evan-form-item> |
||||
</evan-form> |
||||
|
||||
<button class="evan-form-show__button" @click="save">归档</button> |
||||
<view class="v-page-button contain"> |
||||
<button class="v-btn-large" @click="save">归档</button> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import {getAddressBookData} from '@/api/addressbook/index.js' |
||||
import {industryArchive} from '@/api/word/commandDispatch.js' |
||||
export default { |
||||
data() { |
||||
return { |
||||
hideRequiredAsterisk: false, |
||||
classDataTree: [], |
||||
array: ['非常满意', '满意', '一般', '不满意'], |
||||
index: 0, |
||||
info: { |
||||
userId: '', |
||||
satisfactionType: '1', |
||||
returnCallFeedback: '', |
||||
filingSummary: '', |
||||
status:5 |
||||
}, |
||||
rules: { |
||||
userId: { |
||||
required: true, |
||||
message: '请选择回访人' |
||||
}, |
||||
satisfactionType: { |
||||
required: true, |
||||
message: '请选择满意度' |
||||
import { |
||||
getAddressBookData |
||||
} from '@/api/addressbook/index.js' |
||||
import { |
||||
industryArchive |
||||
} from '@/api/word/commandDispatch.js' |
||||
export default { |
||||
data() { |
||||
return { |
||||
hideRequiredAsterisk: false, |
||||
classDataTree: [], |
||||
array: ['非常满意', '满意', '一般', '不满意'], |
||||
index: 0, |
||||
info: { |
||||
userId: '', |
||||
satisfactionType: '1', |
||||
returnCallFeedback: '', |
||||
filingSummary: '', |
||||
status: 5 |
||||
}, |
||||
returnCallFeedback: { |
||||
required: true, |
||||
message: '请输入回访反馈' |
||||
}, |
||||
filingSummary: { |
||||
required: true, |
||||
message: '请输入归档总结' |
||||
rules: { |
||||
userId: { |
||||
required: true, |
||||
message: '请选择回访人' |
||||
}, |
||||
satisfactionType: { |
||||
required: true, |
||||
message: '请选择满意度' |
||||
}, |
||||
returnCallFeedback: { |
||||
required: true, |
||||
message: '请输入回访反馈' |
||||
}, |
||||
filingSummary: { |
||||
required: true, |
||||
message: '请输入归档总结' |
||||
} |
||||
} |
||||
} |
||||
}; |
||||
}, |
||||
|
||||
onShow() {}, |
||||
onLoad(option) { |
||||
this.id =option.id |
||||
}, |
||||
mounted() { |
||||
this.$refs.form.setRules(this.rules); |
||||
this.getAddressBookData(); |
||||
}, |
||||
methods: { |
||||
bindPickerChange: function (e) { |
||||
console.log('picker发送选择改变,携带值为', e.detail.value) |
||||
|
||||
this.index = e.detail.value |
||||
this.info.satisfactionType = e.detail.value |
||||
|
||||
}; |
||||
}, |
||||
|
||||
onnodeclick(e) { |
||||
console.log('nodeclick', e); |
||||
}, |
||||
onpopupopened(e) { |
||||
console.log('onpopupopened'); |
||||
}, |
||||
onpopupclosed(e) { |
||||
console.log('onpopupclosed'); |
||||
onShow() {}, |
||||
onLoad(option) { |
||||
this.id = option.id |
||||
}, |
||||
onchange(e) { |
||||
console.log('onchange', e.detail.value); |
||||
mounted() { |
||||
this.$refs.form.setRules(this.rules); |
||||
this.getAddressBookData(); |
||||
}, |
||||
inputclick(e) { |
||||
console.log('inputclick'); |
||||
}, |
||||
save() { |
||||
let this_ = this; |
||||
this.info.id = this.id |
||||
console.log(this.info) |
||||
this.$refs.form.validate((res) => { |
||||
if (res) { |
||||
// 事件上报 |
||||
industryArchive(this.info).then((resp) => { |
||||
if (resp.code == 200) { |
||||
uni.showToast({ |
||||
title: '归档成功' |
||||
}); |
||||
uni.navigateBack({ |
||||
delta: 1, |
||||
complete: () => { |
||||
uni.startPullDownRefresh() |
||||
} |
||||
}); |
||||
} |
||||
}); |
||||
} else { |
||||
uni.showToast({ |
||||
title: '请填写完整', |
||||
icon: 'none' |
||||
}); |
||||
} |
||||
}); |
||||
}, |
||||
// |
||||
getAddressBookData(){ |
||||
getAddressBookData().then(res =>{ |
||||
const convert = (data) => { |
||||
return data.map(item => { |
||||
if (item.type === 'department') { |
||||
return { |
||||
text: item.name, |
||||
value: item.id, |
||||
children: convert(item.children) |
||||
} |
||||
} else { |
||||
return { |
||||
text: item.name, |
||||
value: item.id |
||||
} |
||||
} |
||||
}) |
||||
} |
||||
|
||||
const result = convert(res.data); |
||||
this.classDataTree = result |
||||
}) |
||||
}, |
||||
|
||||
} |
||||
}; |
||||
methods: { |
||||
bindPickerChange: function(e) { |
||||
console.log('picker发送选择改变,携带值为', e.detail.value) |
||||
|
||||
this.index = e.detail.value |
||||
this.info.satisfactionType = e.detail.value |
||||
|
||||
}, |
||||
|
||||
onnodeclick(e) { |
||||
console.log('nodeclick', e); |
||||
}, |
||||
onpopupopened(e) { |
||||
console.log('onpopupopened'); |
||||
}, |
||||
onpopupclosed(e) { |
||||
console.log('onpopupclosed'); |
||||
}, |
||||
onchange(e) { |
||||
console.log('onchange', e.detail.value); |
||||
}, |
||||
inputclick(e) { |
||||
console.log('inputclick'); |
||||
}, |
||||
save() { |
||||
let this_ = this; |
||||
this.info.id = this.id |
||||
console.log(this.info) |
||||
this.$refs.form.validate((res) => { |
||||
if (res) { |
||||
// 事件上报 |
||||
industryArchive(this.info).then((resp) => { |
||||
if (resp.code == 200) { |
||||
uni.showToast({ |
||||
title: '归档成功' |
||||
}); |
||||
uni.navigateBack({ |
||||
delta: 1, |
||||
complete: () => { |
||||
uni.startPullDownRefresh() |
||||
} |
||||
}); |
||||
} |
||||
}); |
||||
} else { |
||||
uni.showToast({ |
||||
title: '请填写完整', |
||||
icon: 'none' |
||||
}); |
||||
} |
||||
}); |
||||
}, |
||||
// |
||||
getAddressBookData() { |
||||
getAddressBookData().then(res => { |
||||
const convert = (data) => { |
||||
return data.map(item => { |
||||
if (item.type === 'department') { |
||||
return { |
||||
text: item.name, |
||||
value: item.id, |
||||
children: convert(item.children) |
||||
} |
||||
} else { |
||||
return { |
||||
text: item.name, |
||||
value: item.id |
||||
} |
||||
} |
||||
}) |
||||
} |
||||
|
||||
const result = convert(res.data); |
||||
this.classDataTree = result |
||||
}) |
||||
}, |
||||
|
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.evan-form-show__button { |
||||
position: fixed; |
||||
bottom: 20rpx; |
||||
width: 94%; |
||||
transform: translateX(3%); |
||||
background-color: rgb(54, 127, 255); |
||||
color: #eee; |
||||
} |
||||
.evan-form-show__button { |
||||
position: fixed; |
||||
bottom: 20rpx; |
||||
width: 94%; |
||||
transform: translateX(3%); |
||||
background-color: rgb(54, 127, 255); |
||||
color: #eee; |
||||
} |
||||
|
||||
.uni-input-placeholder { |
||||
font-size: 24rpx; |
||||
} |
||||
.uni-input-placeholder { |
||||
font-size: 24rpx; |
||||
} |
||||
|
||||
.set-position { |
||||
position: absolute; |
||||
right: 20rpx; |
||||
} |
||||
.set-position { |
||||
position: absolute; |
||||
right: 20rpx; |
||||
} |
||||
|
||||
.form-input { |
||||
width: 95%; |
||||
} |
||||
.form-input { |
||||
width: 95%; |
||||
} |
||||
|
||||
.tree-pick { |
||||
width: 95%; |
||||
} |
||||
.tree-pick { |
||||
width: 95%; |
||||
} |
||||
|
||||
.title-pic { |
||||
padding: 10px 21px; |
||||
color: #4d4d4d; |
||||
} |
||||
</style> |
||||
.title-pic { |
||||
padding: 10px 21px; |
||||
color: #4d4d4d; |
||||
} |
||||
</style> |
Loading…
Reference in new issue