feat: 心路历程功能提交。
This commit is contained in:
168
src/pages/work/heartJourney/addEdit.vue
Normal file
168
src/pages/work/heartJourney/addEdit.vue
Normal file
@@ -0,0 +1,168 @@
|
||||
<template>
|
||||
<view class="container" style="paddingBottom:1rpx;">
|
||||
<uni-navbar title="心路历程"></uni-navbar>
|
||||
<view class="section">
|
||||
<view class="section-title">心路历程</view>
|
||||
<view class="form-view">
|
||||
<u--form labelPosition="left" :model="form" :rules="rules" ref="uForm" label-width="auto"
|
||||
:labelStyle="{ color: '#333333', fontSize: '30rpx' }">
|
||||
<u-form-item label="标题" prop="name" required >
|
||||
<u--input v-model="form.name" placeholder="请填写标题"
|
||||
inputAlign="right" border="none"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="类型" prop="typeName" required @click="handleShowTeam">
|
||||
<u--input v-model="form.typeName" disabled disabledColor="#ffffff" placeholder="请选择类型"
|
||||
inputAlign="right" border="none"></u--input>
|
||||
<u-icon slot="right" name="arrow-down"></u-icon>
|
||||
</u-form-item>
|
||||
<u-form-item label="记录时间" prop="createTime" required @click="selectDate()">
|
||||
<u--input v-model="form.createTime" disabled disabledColor="#ffffff" placeholder="请选择记录时间" inputAlign="right" border="none"></u--input>
|
||||
<u-icon slot="right" name="arrow-right"></u-icon>
|
||||
</u-form-item>
|
||||
<u-form-item label="内容" prop="remark" required labelPosition="top">
|
||||
<u--textarea v-model="form.remark" placeholder="请填写内容" border="none" autoHeight inputAlign="right" count
|
||||
maxlength="20000" style="padding:18rpx 0;"></u--textarea>
|
||||
</u-form-item>
|
||||
</u--form>
|
||||
<view class="form-btn">
|
||||
<u-button type="primary" text="提交" @click="submit"></u-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-toast ref="uToast"></u-toast>
|
||||
<u-picker itemHeight="88" :show="showTeam" :columns="journeyTypeList" keyName="dictLabel" @cancel="handleCancel"
|
||||
@confirm="handleConfirm"></u-picker>
|
||||
<u-datetime-picker
|
||||
:show="datePickShow"
|
||||
mode="datetime"
|
||||
ref="createTimeRef"
|
||||
@cancel="datePickShow=false"
|
||||
@confirm="datePickConfirm"
|
||||
itemHeight="88"
|
||||
></u-datetime-picker>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listHeartJourney, getHeartJourney, delHeartJourney, addHeartJourney, updateHeartJourney } from '@/api/invest/heartJourney'
|
||||
import { getDicts } from '@/api/system/dict/data.js'
|
||||
import dayjs from 'dayjs'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
createTime: '',
|
||||
name: '',
|
||||
remark: '',
|
||||
type: '',
|
||||
createTime: '',
|
||||
typeName: '',
|
||||
id: '',
|
||||
},
|
||||
rules: {
|
||||
name: [{ type: 'string', required: true, message: '请输入标题', trigger: ['change', 'blur'] }],
|
||||
createTime: [{ type: 'string', required: true, message: '请选择记录时间', trigger: ['change', 'blur'] }],
|
||||
type: [{ type: 'string', required: true, message: '请选择类型', trigger: ['change', 'blur'] }],
|
||||
remark: [{ type: 'string', required: true, message: '请输入内容', trigger: ['change', 'blur'] }],
|
||||
},
|
||||
datePickShow: false,
|
||||
id: '',
|
||||
showTeam: false,
|
||||
journeyTypeList: []
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
this.form.id = option.id
|
||||
this.getDict()
|
||||
},
|
||||
onReady() {
|
||||
this.$refs.uForm.setRules(this.rules)
|
||||
},
|
||||
methods: {
|
||||
getDict() {
|
||||
// 工单状态
|
||||
getDicts('journey_type').then(res => {
|
||||
this.journeyTypeList =[res.data]
|
||||
})
|
||||
if(this.form.id!=null){
|
||||
getHeartJourney(this.form.id).then(res => {
|
||||
this.form = res.data
|
||||
})
|
||||
}
|
||||
},
|
||||
handleShowTeam() {
|
||||
if (this.journeyTypeList[0].length === 0) {
|
||||
this.$refs.uToast.show({
|
||||
message: '类型为空 ', type: 'warning'
|
||||
})
|
||||
} else {
|
||||
this.showTeam = true
|
||||
}
|
||||
},
|
||||
handleConfirm(e) {
|
||||
this.form.typeName = e.value[0].dictLabel
|
||||
this.form.type = e.value[0].dictValue
|
||||
this.showTeam = false
|
||||
},
|
||||
handleCancel() {
|
||||
this.showTeam = false
|
||||
},
|
||||
selectDate() {
|
||||
this.datePickShow = true
|
||||
this.$refs.createTimeRef.innerValue = new Date().getTime()
|
||||
},
|
||||
datePickConfirm(e) {
|
||||
this.form.createTime = dayjs(e.value).format("YYYY-MM-DD HH:mm:ss")
|
||||
this.datePickShow = false
|
||||
},
|
||||
submit() {
|
||||
this.$refs.uForm.validate().then(() => {
|
||||
if (this.form.id != null) {
|
||||
updateHeartJourney({ ...this.form}).then(res => {
|
||||
this.$refs.uToast.show({
|
||||
message: '修改成功', complete() {
|
||||
uni.navigateTo({ url: `/pages/work/heartJourney/list` })
|
||||
}
|
||||
})
|
||||
})
|
||||
}else {
|
||||
addHeartJourney({ ...this.form}).then(res => {
|
||||
this.$refs.uToast.show({
|
||||
message: '新增成功', complete() {
|
||||
uni.navigateTo({ url: `/pages/work/heartJourney/list` })
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.section {
|
||||
margin: 24rpx;
|
||||
padding: 16rpx 24rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 8rpx;
|
||||
|
||||
.section-title {
|
||||
width: 160rpx;
|
||||
color: #333333;
|
||||
line-height: 44rpx;
|
||||
font-size: 30rpx;
|
||||
border-left: 6rpx solid #2681FF;
|
||||
padding-left: 26rpx;
|
||||
}
|
||||
|
||||
.form-view {
|
||||
padding: 20rpx 0rpx 0 10rpx;
|
||||
|
||||
.form-btn {
|
||||
padding-top: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
76
src/pages/work/heartJourney/details.vue
Normal file
76
src/pages/work/heartJourney/details.vue
Normal file
@@ -0,0 +1,76 @@
|
||||
<template>
|
||||
<view class="container" style="paddingBottom:1rpx;">
|
||||
<!-- <uni-navbar title="心路历程详情"></uni-navbar> -->
|
||||
<view class="section">
|
||||
<view class="section-title">{{ detailInfo.name }}</view>
|
||||
<!-- <uni-cellItem title="标题:" :value="detailInfo.name"></uni-cellItem>
|
||||
<uni-cellItem title="记录时间:" :value="detailInfo.createTime"></uni-cellItem>
|
||||
<uni-cellItem title="内容:"></uni-cellItem> -->
|
||||
<view class="content">{{ detailInfo.remark }}</view>
|
||||
</view>
|
||||
<u-toast ref="uToast"></u-toast>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getHeartJourney} from '@/api/invest/heartJourney'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
detailInfo: {},
|
||||
id: '',
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
this.id = option.id
|
||||
this.getInfo()
|
||||
},
|
||||
methods: {
|
||||
getInfo() {
|
||||
getHeartJourney(this.id).then(res => {
|
||||
this.detailInfo = res.data
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.section {
|
||||
margin: 24rpx;
|
||||
padding: 16rpx 24rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 8rpx;
|
||||
|
||||
.section-title {
|
||||
width: 280rpx;
|
||||
color: #333333;
|
||||
line-height: 44rpx;
|
||||
font-size: 30rpx;
|
||||
border-left: 6rpx solid #2681FF;
|
||||
padding-left: 26rpx;
|
||||
}
|
||||
|
||||
.content {
|
||||
width: 647rpx;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
line-height: 40rpx;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.img-con {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 20rpx
|
||||
}
|
||||
.form-view {
|
||||
padding: 20rpx 0rpx 0 10rpx;
|
||||
|
||||
.form-btn {
|
||||
padding-top: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,8 +0,0 @@
|
||||
<template>
|
||||
<view class="work-container">
|
||||
心路历程
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
</template>
|
||||
378
src/pages/work/heartJourney/list.vue
Normal file
378
src/pages/work/heartJourney/list.vue
Normal file
@@ -0,0 +1,378 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<u-sticky offsetTop="8rpx" customNavHeight="8rpx">
|
||||
<view class="search-view">
|
||||
<u--input v-model="queryParams.name" border="false" placeholder="请输入标题" class="search-input"
|
||||
@blur="searchBlur">
|
||||
<template slot="prefix">
|
||||
<u-icon name="search" color="#B8B8B8" size="48"></u-icon>
|
||||
</template>
|
||||
</u--input>
|
||||
<u-icon :name="filterPanel ? 'arrow-up-fill' : 'arrow-down-fill'" color="#666666" size="28" label="筛选"
|
||||
labelPos="left" labelSize="32rpx" labelColor="#666666" @click="filterPanel = !filterPanel"></u-icon>
|
||||
<u-icon name="plus-circle-fill" color="#666666" size="28" style="margin-left:10px" label="新增"
|
||||
labelPos="left" labelSize="32rpx" labelColor="#666666" @click="handleAdd()"></u-icon>
|
||||
<u-transition :show="filterPanel" mode="fade">
|
||||
<view class="filter-panel" :style="{ height: `${windowHeight - 42}px` }">
|
||||
<view class="filter-panel-content">
|
||||
<view class="filter-title">类型</view>
|
||||
<view class="state-list">
|
||||
<view v-for="item in journeyTypeList" :key="item.id" class="state-item"
|
||||
:class="item.selected ? 'active' : ''" @click="selectStatus(item)">{{ item.dictLabel }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="btn-box">
|
||||
<u-button text="重置" style="margin-right:20rpx" @click="resetQuery()"></u-button>
|
||||
<u-button type="primary" text="确定" @click="searchSubmit()"></u-button>
|
||||
</view>
|
||||
</view>
|
||||
</u-transition>
|
||||
</view>
|
||||
</u-sticky>
|
||||
<u-list @scrolltolower="loadmore" :spaceHeight="116" lowerThreshold="100">
|
||||
<u-list-item v-for="(item, index) in listData" :key="index">
|
||||
<view class="list-item">
|
||||
<view class="item-header" @click="enterDetails(item)">
|
||||
<u--text suffixIcon="arrow-right" lines="1" iconStyle="font-size: 18px; color: #333333; font-weight:bold"
|
||||
:text="item.name" size="36rpx" color="#333333" :bold="true"></u--text>
|
||||
</view>
|
||||
<view class="item-row">
|
||||
<text class="row-label">类型:</text>
|
||||
<text class="row-value">{{ dictStr(item.type, journeyTypeList) }}</text>
|
||||
</view>
|
||||
<view class="item-row">
|
||||
<text class="row-label">记录时间:</text>
|
||||
<text class="row-value">{{ item.createTime }}</text>
|
||||
</view>
|
||||
<view class="item-row">
|
||||
<text class="row-label">内容:</text>
|
||||
<text class="row-value">{{ item.remark }}</text>
|
||||
</view>
|
||||
<view class="operate" >
|
||||
<view class="btn filling" @click="enterDetails(item)">查看</view>
|
||||
<view class="btn filling" @click="handleEdit(item)">修改</view>
|
||||
<view class="btn filling" @click="handleDelete(item)">删除</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-list-item>
|
||||
<view>
|
||||
</view>
|
||||
<u-loadmore :status="status" loadingIcon="semicircle" height="88" fontSize="32rpx" @loadmore="loadmore" />
|
||||
</u-list>
|
||||
<u-picker itemHeight="88" :show="settingPickShow" :columns="settingColumns" keyName="settingName"
|
||||
@confirm="settingConfirm" @cancel="settingCancel"></u-picker>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listHeartJourney, delHeartJourney } from '@/api/invest/heartJourney'
|
||||
import { getDicts } from '@/api/system/dict/data.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
filterPanel: false,
|
||||
listData: [],
|
||||
pageNum: 1,
|
||||
queryParams: {
|
||||
name: '',
|
||||
type: '',
|
||||
},
|
||||
status: 'loadmore',
|
||||
journeyTypeList: [],
|
||||
settingPickShow: false,
|
||||
settingColumns: [],
|
||||
columns: [],
|
||||
isShow: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
windowHeight() {
|
||||
return uni.getSystemInfoSync().windowHeight - 50
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getDict()
|
||||
this.getList()
|
||||
},
|
||||
onShow() {
|
||||
if (this.isShow) {
|
||||
this.getList()
|
||||
this.isShow = false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
loadmore() {
|
||||
this.pageNum += 1
|
||||
if (this.status == 'loadmore') {
|
||||
this.getList()
|
||||
}
|
||||
},
|
||||
getList() {
|
||||
this.status = 'loading'
|
||||
listHeartJourney({ pageSize: 10, pageNum: this.pageNum, ...this.queryParams }).then(res => {
|
||||
this.listData = this.listData.concat(res.rows)
|
||||
if (this.listData.length < res.total) {
|
||||
this.status = 'loadmore'
|
||||
} else {
|
||||
this.status = 'nomore'
|
||||
}
|
||||
}).catch(() => {
|
||||
this.status = 'nomore'
|
||||
})
|
||||
},
|
||||
getDict() {
|
||||
// 工单状态
|
||||
getDicts('journey_type').then(res => {
|
||||
this.journeyTypeList = res.data
|
||||
})
|
||||
},
|
||||
settingConfirm(e) {
|
||||
this.queryParams.settingId = e.value[0].settingId
|
||||
this.queryParams.settingName = e.value[0].settingName
|
||||
this.settingPickShow = false
|
||||
},
|
||||
settingCancel() {
|
||||
this.settingPickShow = false
|
||||
},
|
||||
dictStr(val, arr) {
|
||||
let str = ''
|
||||
arr.map(item => {
|
||||
if (item.dictValue === val) {
|
||||
str = item.dictLabel
|
||||
}
|
||||
})
|
||||
return str
|
||||
},
|
||||
selectStatus(item) {
|
||||
this.queryParams.type = item.dictValue
|
||||
this.journeyTypeList.map(ele => {
|
||||
if (ele.dictValue == item.dictValue) {
|
||||
ele.selected = true
|
||||
this.$set(ele, 'selected', true)
|
||||
} else {
|
||||
this.$set(ele, 'selected', false)
|
||||
}
|
||||
})
|
||||
},
|
||||
searchSubmit() {
|
||||
this.pageNum = 1
|
||||
this.listData = []
|
||||
this.getList()
|
||||
this.filterPanel = false
|
||||
},
|
||||
searchBlur() {
|
||||
this.pageNum = 1
|
||||
this.listData = []
|
||||
this.getList()
|
||||
},
|
||||
resetQuery() {
|
||||
this.queryParams.name = '',
|
||||
this.queryParams.type = ''
|
||||
this.journeyTypeList.map(ele => {
|
||||
this.$set(ele, 'selected', false)
|
||||
})
|
||||
},
|
||||
enterDetails(item) {
|
||||
uni.navigateTo({ url: `/pages/work/heartJourney/details?id=${item.id}` })
|
||||
},
|
||||
handleEdit(item) {
|
||||
uni.navigateTo({ url: `/pages/work/heartJourney/addEdit?id=${item.id}` })
|
||||
this.isShow = true
|
||||
},
|
||||
handleAdd() {
|
||||
uni.navigateTo({ url: `/pages/work/heartJourney/addEdit` })
|
||||
this.isShow = true
|
||||
},
|
||||
handleDelete(item) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '你确定要删除吗',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
delHeartJourney(item.id)
|
||||
uni.navigateTo({ url: `/pages/work/heartJourney/list` })
|
||||
} else if (res.cancel) {
|
||||
console.log('取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.btnAdd {
|
||||
width: 146rpx;
|
||||
height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
border-radius: 8rpx;
|
||||
display:float;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.search-view {
|
||||
padding: 12rpx 32rpx;
|
||||
background-color: #ffffff;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
margin-bottom: 24rpx;
|
||||
|
||||
.search-input {
|
||||
background: #F5F5F5;
|
||||
color: #333333;
|
||||
margin-right: 36rpx;
|
||||
}
|
||||
|
||||
.filter-panel {
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 96rpx;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
|
||||
.filter-panel-content {
|
||||
background-color: #ffff;
|
||||
padding: 0 30rpx 30rpx;
|
||||
|
||||
.filter-title {
|
||||
color: #000000;
|
||||
font-size: 30rpx;
|
||||
font-weight: 500;
|
||||
padding: 30rpx 0;
|
||||
}
|
||||
|
||||
.state-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-start;
|
||||
|
||||
.state-item {
|
||||
width: 210rpx;
|
||||
height: 72rpx;
|
||||
border: 1rpx solid rgba(0, 0, 0, 0.25);
|
||||
border-radius: 72rpx;
|
||||
text-align: center;
|
||||
line-height: 72rpx;
|
||||
margin: 0 20rpx 20rpx 0;
|
||||
font-size: 28rpx;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.active {
|
||||
background-color: rgba(222, 241, 255, 1);
|
||||
border: 1rpx solid rgba(22, 119, 255, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.btn-box {
|
||||
display: flex;
|
||||
padding: 24rpx 30rpx;
|
||||
background-color: #fff;
|
||||
box-shadow: 0rpx -10rpx 20rpx #EEEEEE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.list-item {
|
||||
margin: 0 24rpx 24rpx;
|
||||
padding: 32rpx;
|
||||
background-color: #fff;
|
||||
|
||||
.item-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding-bottom: 16rpx;
|
||||
|
||||
.status {
|
||||
.status-item {
|
||||
width: 120rpx;
|
||||
height: 44rpx;
|
||||
text-align: center;
|
||||
line-height: 44rpx;
|
||||
border-radius: 4rpx;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.status1 {
|
||||
background: #F0F0F0;
|
||||
color: #8C8C8C;
|
||||
}
|
||||
|
||||
.status2 {
|
||||
background: rgba(38, 129, 255, 0.2);
|
||||
color: #2681FF;
|
||||
}
|
||||
|
||||
.status3 {
|
||||
background: #F7F7F7;
|
||||
color: #2681FF;
|
||||
}
|
||||
|
||||
.status4 {
|
||||
background: rgba(255, 85, 51, 0.2);
|
||||
color: #FF5533;
|
||||
}
|
||||
|
||||
.status5 {
|
||||
background: #F7F7F7;
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
}
|
||||
|
||||
.status7 {
|
||||
background: rgba(255, 129, 51, 0.2);
|
||||
color: #FF8133;
|
||||
}
|
||||
|
||||
.status8 {
|
||||
background: rgba(65, 217, 165, 0.2);
|
||||
color: #41D9A5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.item-row {
|
||||
padding: 16rpx 0;
|
||||
|
||||
.row-label {
|
||||
color: rgba(0, 0, 0, 0.55);
|
||||
}
|
||||
|
||||
.row-value {
|
||||
color: rgba(0, 0, 0, 0.85)
|
||||
}
|
||||
}
|
||||
|
||||
.operate {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
|
||||
.btn {
|
||||
width: 146rpx;
|
||||
height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
border-radius: 8rpx;
|
||||
margin-left: 5rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.circulation {
|
||||
background: rgba(0, 0, 0, 0.04);
|
||||
margin-right: 24rpx;
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
}
|
||||
|
||||
.filling {
|
||||
background: #2681FF;
|
||||
border-radius: 8rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -87,7 +87,7 @@ import auth from "@/plugins/auth"; // 建议使用auth进行鉴权操作
|
||||
{ path: '/pages/page1/page1', text: '账户交易记录', icon: 'paperclip', permission: 'invest:accountDealRecord:list' }
|
||||
])
|
||||
const heartJourneyGridList=ref([
|
||||
{ path: '/pages/work/heartJourney/index', text: '心路历程', icon: 'heart', permission: 'invest:heartJourney:list' }
|
||||
{ path: '/pages/work/heartJourney/list', text: '心路历程', icon: 'heart', permission: 'invest:heartJourney:list' }
|
||||
])
|
||||
function navigateTo(path) {
|
||||
uni.navigateTo({
|
||||
|
||||
Reference in New Issue
Block a user