调整工程目录
This commit is contained in:
225
src/sass/AppInterview/AppInterview.vue
Normal file
225
src/sass/AppInterview/AppInterview.vue
Normal file
@@ -0,0 +1,225 @@
|
||||
<template>
|
||||
<div class="AppInterview">
|
||||
<AiTopFixed>
|
||||
<div flex>
|
||||
<AiDate placeholder="日期选择" mode="range" @change="handleDateSearch"/>
|
||||
<u-search placeholder="请输入标题" :show-action="false" v-model="search.title" @search="current=1,getList()"/>
|
||||
</div>
|
||||
</AiTopFixed>
|
||||
<template v-if="list.length>0">
|
||||
<AiCard :ref="'aiCard' + index" v-for="(e,index) in list" :key="index" @click.native="goDetail(e.id,1)">
|
||||
<template #custom>
|
||||
<div flex>
|
||||
<b class="fill">{{ e.title }}</b>
|
||||
</div>
|
||||
<div flex v-if="!!e.fileList" class="wrap" @click.stop>
|
||||
<AiImage v-for="(op,i) in e.fileList.slice(0,3)" :src="op.accessUrl" preview :key="i"/>
|
||||
</div>
|
||||
<div class="bottom">{{ e.createTime }}</div>
|
||||
</template>
|
||||
<template #menu>
|
||||
<div class="menu" @tap.stop="goDetail(e.id,false,index)">编辑</div>
|
||||
<div class="menu" @tap.stop="handleDelete(e.id, index)">删除</div>
|
||||
</template>
|
||||
</AiCard>
|
||||
<u-loadmore :status="loadmore" color="#999" font-size="24"
|
||||
margin-top="32" margin-bottom="80"/>
|
||||
</template>
|
||||
<div class="no-message" v-else>
|
||||
<image src="https://cdn.cunwuyun.cn/wxAdmin/img/message.png"/>
|
||||
<p>您还未添加过入户调查走访<br>点击<b>新增按钮</b>试试吧~</p>
|
||||
</div>
|
||||
<AiFixedBtn>
|
||||
<div class="addBtn iconfont iconfont-iconfangda" @tap="gotoAdd()"/>
|
||||
</AiFixedBtn>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import qs from "query-string"
|
||||
|
||||
export default {
|
||||
name: "AppInterview",
|
||||
appName: "调查走访",
|
||||
inject: {
|
||||
root: {}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
search: {title: ""},
|
||||
list: [],
|
||||
current: 1,
|
||||
pages: 0,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
loadmore() {
|
||||
return this.pages <= this.current ? 'loading ' : 'nomore'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.$http.post('/app/appinterview/list-xcx', null, {
|
||||
params: {
|
||||
current: this.current,
|
||||
size: 10,
|
||||
...this.search
|
||||
}
|
||||
}).then(res => {
|
||||
if (res?.data) {
|
||||
this.list = this.current > 1 ? [...this.list, ...res.data.records] : res.data.records
|
||||
this.pages = res.data.pages
|
||||
}
|
||||
})
|
||||
},
|
||||
goDetail(id, readonly, index) {
|
||||
let query = {id}
|
||||
readonly && (query.detail = 1)
|
||||
index > -1 && this.$refs[`aiCard${index}`][0].handleClose()
|
||||
uni.navigateTo({url: `./interviewDetail?${qs.stringify(query)}`})
|
||||
},
|
||||
gotoAdd() {
|
||||
uni.navigateTo({url: `./interviewDetail`})
|
||||
},
|
||||
handleDelete(ids, index) {
|
||||
this.$refs[`aiCard${index}`][0].handleClose()
|
||||
this.$confirm("是否要删除该调查走访").then(() => {
|
||||
this.$http.post("/app/appinterview/delete", null, {
|
||||
params: {ids}
|
||||
}).then(res => {
|
||||
if (res?.code == 0) {
|
||||
this.$u.toast("删除成功!")
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
handleDateSearch(v) {
|
||||
this.search.startTime = v?.startDate
|
||||
this.search.endTime = v?.endDate || v?.startDate
|
||||
this.current = 1
|
||||
this.getList()
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
document.title = "调查走访"
|
||||
this.current = 1;
|
||||
this.getList()
|
||||
},
|
||||
onReachBottom() {
|
||||
this.current++;
|
||||
this.getList()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.AppInterview {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
position: absolute;
|
||||
background: #fff;
|
||||
|
||||
.no-message {
|
||||
margin-top: 140px;
|
||||
text-align: center;
|
||||
color: #888;
|
||||
font-size: 30px;
|
||||
|
||||
b {
|
||||
font-size: 32px;
|
||||
color: $uni-color-primary;
|
||||
padding: 0 8px;
|
||||
}
|
||||
|
||||
image {
|
||||
width: 320px;
|
||||
height: 240px;
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep .AiCard {
|
||||
width: 100%;
|
||||
min-height: 160px;
|
||||
background: #FFFFFF;
|
||||
padding: 32px 32px 0;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: relative;
|
||||
|
||||
b {
|
||||
display: block;
|
||||
width: 100%;
|
||||
font-size: 30px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
color: #333;
|
||||
margin-right: 60px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.iconfont-iconMore {
|
||||
color: #666;
|
||||
position: absolute;
|
||||
right: 32px;
|
||||
top: 32px;
|
||||
}
|
||||
|
||||
.bottom {
|
||||
font-size: 24px;
|
||||
color: #999999;
|
||||
padding: 24px 0;
|
||||
border-bottom: 1px solid rgba(221, 221, 221, .4);
|
||||
}
|
||||
|
||||
.AiImage {
|
||||
width: 30%;
|
||||
margin-bottom: 8px;
|
||||
margin-right: 8px;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 218px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.addBtn {
|
||||
width: 96px;
|
||||
height: 96px;
|
||||
flex-shrink: 0;
|
||||
background: $uni-color-primary;
|
||||
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
|
||||
font-size: 48px;
|
||||
color: #fff;
|
||||
border-radius: 50%;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.menu {
|
||||
text-align: center;
|
||||
line-height: 80px;
|
||||
width: 192px;
|
||||
height: 80px;
|
||||
font-size: 28px;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
::v-deep .u-search {
|
||||
margin-bottom: 0 !important;
|
||||
padding-left: 146px;
|
||||
box-shadow: none;
|
||||
|
||||
.u-content {
|
||||
padding-left: 50px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
177
src/sass/AppInterview/interviewDetail.vue
Normal file
177
src/sass/AppInterview/interviewDetail.vue
Normal file
@@ -0,0 +1,177 @@
|
||||
<template>
|
||||
<div class="interviewDetail">
|
||||
<template v-if="isEdit">
|
||||
<u-form ref="interviewForm" label-position="top" :model="form">
|
||||
<u-form-item label="调查走访事项" prop="title" required>
|
||||
<u-input v-model="form.title" placeholder="请输入,最多30字" maxlength="30"/>
|
||||
</u-form-item>
|
||||
<u-form-item label="调查走访内容" prop="content">
|
||||
<AiTextarea v-model="form.content" placeholder="请输入,最多500字" :maxlength="500"/>
|
||||
</u-form-item>
|
||||
<u-form-item label="图片(最多9张)">
|
||||
<AiUploader multiple :limit="9" :def.sync="form.fileList" action="/admin/file/add2"/>
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
<div bottom>
|
||||
<u-button type="primary" @tap="submitForm">保存</u-button>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div class="headerPane">
|
||||
<b>{{ form.title }}</b>
|
||||
<div>记录时间:{{ form.createTime }}</div>
|
||||
</div>
|
||||
<div class="contentPane">
|
||||
<div v-html="form.content"/>
|
||||
<div flex class="wrap">
|
||||
<AiImage v-for="(op,i) in form.fileList" :src="op.accessUrl" preview :key="i"/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<AiBack/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: 'interviewDetail',
|
||||
inject: {root: {}},
|
||||
computed: {
|
||||
isEdit() {
|
||||
return this.$route.query?.detail != 1
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
fileList: []
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
created() {
|
||||
this.searchDetail();
|
||||
},
|
||||
methods: {
|
||||
submitForm() {
|
||||
if (!this.form.title) {
|
||||
return this.$u.toast("请输入调查走访事项")
|
||||
}
|
||||
|
||||
this.$refs.interviewForm?.validate(v => {
|
||||
if (v) {
|
||||
this.$http.post(`/app/appinterview/add-xcx`, {
|
||||
...this.form
|
||||
}).then(res => {
|
||||
if (res?.code == 0) {
|
||||
this.$u.toast("提交成功!")
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({})
|
||||
}, 1000)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
searchDetail() {
|
||||
let {id} = this.$route.query
|
||||
id && this.$http.post(`/app/appinterview/queryDetailById`, null, {
|
||||
params: {id}
|
||||
}).then(res => {
|
||||
if (res?.data) {
|
||||
this.form = {...res.data};
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.interviewDetail {
|
||||
background: #F3F6F9;
|
||||
height: 100%;
|
||||
|
||||
.u-form {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
background-color: #f3f6f9;
|
||||
position: relative;
|
||||
padding: 0 0 188px;
|
||||
box-sizing: border-box;
|
||||
font-size: 30px;
|
||||
|
||||
::v-deep textarea {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
::v-deep .u-form-item {
|
||||
margin-bottom: 16px;
|
||||
|
||||
.u-form-item--left__content__label {
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
div[flex] {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
div[bottom] {
|
||||
z-index: 99;
|
||||
padding: 0;
|
||||
height: 112px;
|
||||
|
||||
.u-btn {
|
||||
height: 100%;
|
||||
border-radius: 0;
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep .headerPane {
|
||||
width: 100%;
|
||||
background: #3975C6;
|
||||
color: #fff;
|
||||
padding: 24px 32px 32px;
|
||||
box-sizing: border-box;
|
||||
font-size: 28px;
|
||||
|
||||
b {
|
||||
display: block;
|
||||
font-size: 40px;
|
||||
line-height: 64px;
|
||||
letter-spacing: 2px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep .contentPane {
|
||||
padding: 32px;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
font-size: 32px;
|
||||
font-weight: 400;
|
||||
color: #666;
|
||||
line-height: 56px;
|
||||
|
||||
.wrap {
|
||||
margin-top: 32px;
|
||||
}
|
||||
|
||||
.AiImage {
|
||||
width: 31%;
|
||||
margin-bottom: 16px;
|
||||
margin-right: 16px;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 218px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user