Files
dvcp_v2_wxcp_app/library/apps/AppWorkOrderXbot/Content.vue

264 lines
7.2 KiB
Vue
Raw Normal View History

2023-08-17 14:22:24 +08:00
<template>
<div class="Transfer">
<div class="contents">
<u-form :model="forms" ref="uForm" label-width="auto" :border-bottom="false">
<u-form-item label="转交给" prop="status" required :border-bottom="false" right-icon="arrow-right" class="first-form" v-if="status == 1">
2023-08-28 09:54:30 +08:00
<AiPagePicker type="deptUser" single :selected.sync="forms.user" nodeKey="id" @select="handleSelectUser" class="select-user">
2023-08-22 14:47:08 +08:00
<span style="margin-left: 4px" v-if="forms.user && forms.user.length">{{ forms.user[0].name }}</span>
<span v-else class="color-999">请选择</span>
</AiPagePicker>
2023-08-17 14:22:24 +08:00
</u-form-item>
2023-08-23 09:25:57 +08:00
<u-form-item label="事件分类" prop="typeName" required :border-bottom="false" right-icon="arrow-right" v-if="status != 1">
2023-08-17 14:22:24 +08:00
<!-- <u-input v-model="forms.groupName" placeholder="请选择事件分类" /> -->
2023-08-23 09:25:57 +08:00
<span @click="show = true" class="right-span" :style="forms.typeName ? '' : 'color:#999;'">{{ forms.typeName || '请选择事件分类' }}</span>
2023-08-17 14:22:24 +08:00
2023-09-06 15:38:15 +08:00
<u-select v-model="show" :list="typeList" value-name="dictValue" label-name="dictName" @confirm="selectStatus"></u-select>
2023-08-17 14:22:24 +08:00
</u-form-item>
<u-form-item :label="status == 3 ? '办结意见' : status == 2 ? '拒绝受理意见' : '办理意见'" prop="content" required :border-bottom="false" label-position="top"
class="contents">
<u-input v-model="forms.content" :placeholder="status == 2 ? '请写下拒绝受理意见…' : '请写下你的办结意见...'" type="textarea" auto-height height="100" maxlength="500"/>
</u-form-item>
<div class="line"></div>
<u-form-item label="图片上传(最多9张)" prop="files" :border-bottom="false" class="avatars" label-position="top">
<AiUploader :def.sync="forms.files" multiple placeholder="上传图片" :limit="9" action="/admin/file/add2"></AiUploader>
</u-form-item>
</u-form>
</div>
<div class="btn" v-if="this.status == 1" @click="confirm">
<span>转交事件</span>
</div>
<div class="btn" v-if="this.status == 2" @click="confirm">
<span>拒绝受理</span>
</div>
<div class="btn" v-if="this.status == 3" @click="confirm">
<span>我已办结</span>
</div>
</div>
</template>
<script>
export default {
name: 'Content',
components: {},
props: {},
data() {
return {
forms: {
groupName: '',
groupId: '',
content: '',
files: [],
2023-08-22 14:47:08 +08:00
name: '',
handleUserId: '',
2023-08-23 09:25:57 +08:00
handleUserName: '',
type: '',
typeName: ''
2023-08-17 14:22:24 +08:00
},
flag: false,
show: false,
status: '', //1转交 2拒绝受理 3我已办结
id: '',
selectUser: {},
2023-09-06 15:38:15 +08:00
titleList: ['', '转交事件', '拒绝受理', '我已办结'],
typeList: []
2023-08-17 14:22:24 +08:00
}
},
onLoad(option) {
2023-09-06 15:38:15 +08:00
this.getTypeList()
2023-08-17 14:22:24 +08:00
this.status = option.status
this.id = option.id
this.forms.groupId = option.groupId
this.forms.groupName = option.groupName
this.typeList()
uni.$on('pagePicker:custom', (res) => {
this.selectUser = res
if (res.name) {
this.forms.name = res.name
} else {
this.forms.name = res.girdName
}
})
},
onShow() {
document.title = this.titleList[this.status]
},
methods: {
2023-09-06 15:38:15 +08:00
getTypeList() {
this.$http.post(`/app/appsessionarchivefeaturelibrary/eventTypeList`).then(res => {
2023-08-17 14:22:24 +08:00
if (res.code == 0) {
2023-09-06 15:38:15 +08:00
res.data.map((item) => {
var i = {dictName: item, dictValue: item}
this.typeList.push(i)
})
2023-08-17 14:22:24 +08:00
}
})
},
2023-08-22 14:47:08 +08:00
handleSelectUser(e) {
2023-08-28 09:54:30 +08:00
console.log(e)
2023-08-22 14:47:08 +08:00
this.forms.user = e
2023-08-28 09:54:30 +08:00
this.forms.handleUserId = e[0].id
2023-08-22 14:47:08 +08:00
this.forms.handleUserName = e[0].name
},
2023-08-17 14:22:24 +08:00
confirm() {
2023-08-22 14:47:08 +08:00
if (this.status == 1 && !this.forms.handleUserName) {
2023-08-17 14:22:24 +08:00
return this.$u.toast('请选择转交对象')
}
2023-08-23 09:25:57 +08:00
if (this.status != 1 && !this.forms.typeName) {
2023-08-17 14:22:24 +08:00
return this.$u.toast('请选择分类')
}
if (this.status != 1 && !this.forms.content) {
return this.$u.toast('请输入意见')
}
this.submit()
},
submit() { //status 1转交 2拒绝受理 3我已办结
2023-08-28 11:45:58 +08:00
if(this.flag) return
2023-08-17 14:22:24 +08:00
var url = '', successText = '', params = ''
if (this.status == 1) {
2023-08-22 10:23:36 +08:00
url = `/app/appsessionarchivereportinfo/transfer`
2023-08-17 14:22:24 +08:00
successText = '转交成功'
params = {
...this.forms,
girdId: this.selectUser.id,
girdName: this.selectUser.girdName,
}
if (this.selectUser.name) { //选择的网格员
params.girdId = this.selectUser.girdId
params.girdMemberId = this.selectUser.id
params.girdMemberName = this.selectUser.name
}
}
if (this.status == 2) {
2023-08-22 10:23:36 +08:00
url = `/app/appsessionarchivereportinfo/finish`
2023-08-17 14:22:24 +08:00
successText = '拒绝成功'
2023-08-23 09:25:57 +08:00
params = {...this.forms, eventStatus: 0}
2023-08-17 14:22:24 +08:00
}
if (this.status == 3) {
2023-08-22 10:23:36 +08:00
url = `/app/appsessionarchivereportinfo/finish`
2023-08-17 14:22:24 +08:00
successText = '办结成功'
2023-08-23 09:25:57 +08:00
params = {...this.forms, eventStatus: 1}
2023-08-17 14:22:24 +08:00
}
params.id = this.id
this.$http.post(url, params).then((res) => {
if (res.code == 0) {
2023-08-28 11:45:58 +08:00
this.flag = true
2023-08-17 14:22:24 +08:00
this.$u.toast(successText)
uni.$emit('updateDeatil')
uni.$emit('getListInit')
setTimeout(() => {
if (this.status == 1) {
uni.navigateBack({delta: 2})
} else {
uni.navigateBack()
}
}, 600)
}
})
},
selectStatus(e) {
2023-08-23 09:25:57 +08:00
this.forms.typeName = e[0].label
this.forms.type = e[0].value
2023-08-17 14:22:24 +08:00
},
toSelectUser() {
2023-08-24 11:02:37 +08:00
uni.navigateTo({url: './SelectDeptUser'})
2023-08-17 14:22:24 +08:00
},
},
}
</script>
<style scoped lang="scss">
.Transfer {
height: 100%;
.contents {
padding-bottom: 140px;
::v-deep .u-form {
.u-form-item {
padding: 0 45px !important;
.u-form-item__body {
.u-form-item--right__content__slot {
padding-bottom: 0;
.u-input {
text-align: right !important;
}
}
}
}
.u-form-item:first-child {
.u-form-item__body {
border-bottom: 1px solid #ddd;
}
}
.line {
height: 24px;
background: #f3f6f9;
}
.contents {
padding-bottom: 20px !important;
.u-form-item__body {
.u-form-item--right__content__slot {
.u-input {
text-align: left !important;
}
}
}
}
.avatars {
padding-bottom: 20px !important;
.u-form-item__body {
2023-08-23 09:25:57 +08:00
// .default {
// width: 160px;
// height: 160px;
// }
2023-08-17 14:22:24 +08:00
}
}
}
}
.btn {
position: fixed;
bottom: 0;
width: 100%;
box-sizing: border-box;
background: #3975c6;
padding: 34px 0;
text-align: center;
font-size: 32px;
font-weight: 500;
color: #ffffff;
}
.right-span {
display: inline-block;
width: 100%;
text-align: right;
}
2023-08-23 09:25:57 +08:00
.select-user {
width: 100%;
span {
display: inline-block;
width: 100%;
text-align: right;
}
}
2023-08-17 14:22:24 +08:00
}
</style>