Browse Source

【增加】app2.2.0 增加党员自评、党小组长评分;

yanshi
dyy 3 years ago
parent
commit
efe6ef7e47
9 changed files with 1223 additions and 63 deletions
  1. +2
    -2
      Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/config/config.js
  2. +56
    -59
      Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/partyevaluatzp/partyevaluatzp.js
  3. +4
    -1
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/components/learun-app/customlist-action.vue
  4. +1
    -1
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/config.js
  5. +26
    -0
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages.json
  6. +355
    -0
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/partyevaluatxz/list.vue
  7. +218
    -0
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/partyevaluatxz/single.vue
  8. +343
    -0
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/partyevaluatzp/list.vue
  9. +218
    -0
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/partyevaluatzp/single.vue

+ 2
- 2
Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/config/config.js View File

@@ -13,8 +13,8 @@


var config = {
webapi: 'http://localhost:31173/',
web: "http://localhost:20472/"//web地址,用于配置logo
webapi: 'http://localhost:8088/',
web: "http://localhost:8087/"//web地址,用于配置logo
};
// var config = {
// webapi: 'http://123.57.209.16:31173/',


+ 56
- 59
Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/partyevaluatzp/partyevaluatzp.js View File

@@ -25,7 +25,7 @@
return page.rowRender(_index, _item, _$item, $page);
},
click: function (item, $item, $et) {// 列表行点击事件
//提交
//提交
if ($et.hasClass('lr-btn-blue')) {
page.btnClick(item, $item, $page);
}
@@ -62,15 +62,15 @@
},
queryJson: '{}'
};
var account = learun.storage.get('logininfo').account;
_postParam.queryJson=JSON.stringify({ account:account });
var account = learun.storage.get('logininfo').account;
_postParam.queryJson = JSON.stringify({ account: account });
if (param.multipleData) {
_postParam.queryJson = JSON.stringify(multipleData);
}
if (param.begin && param.end) {
_postParam.queryJson = JSON.stringify({ StartTime: param.begin, EndTime: param.end });
}
learun.httpget(config.webapi + 'learun/adms/evaluatingindicator/gezplist', _postParam, (data) => {
$page.find('.lr-badge').text('0');
if (data) {
@@ -83,24 +83,23 @@
});
},
rowRender: function (_index, _item, _$item, $page) {// 渲染列表行数据
var status=_item.Status;
var statusname='';
if (status == '-1')
{
statusname='未打分';
}
else if (status == '0') {
statusname= '草稿';
}
else if (status == '1') {
statusname= '已提交';
}
// else if (status == '2') {
// statusname= '审核通过';
// }
// else if (status == '3') {
// statusname= '审核未通过';
// }
var status = _item.Status;
var statusname = '';
if (status == '-1') {
statusname = '未打分';
}
else if (status == '0') {
statusname = '草稿';
}
else if (status == '1') {
statusname = '已提交';
}
// else if (status == '2') {
// statusname= '审核通过';
// }
// else if (status == '3') {
// statusname= '审核未通过';
// }
_$item.addClass('lr-list-item lr-list-item-multi');
_$item.append($('<p class="lr-ellipsis"><span>年度:</span></p>').dataFormatter({ value: _item.ScoreYear }));
_$item.append($('<p class="lr-ellipsis"><span>季度:</span></p>').dataFormatter({ value: _item.ScoreQuarter }));
@@ -112,42 +111,40 @@
// learun.nav.go({ path: 'PersonnelManagement/CommunityInfo/form', title: '详情', type: 'right', param: { keyValue: item.Id } });
// },
btnClick: function (item, $item, $page) {// 左滑按钮点击事件
var status=item.Status;
if(status == '-1')
{
learun.layer.toast("当前项目未打分,无法提交!");
return;
}
else if(status != '0')
{
learun.layer.toast("当前项目已提交!");
return;
}
learun.layer.confirm('确定要提交该项数据吗?', function (_index) {
if (_index === '1') {
learun.layer.loading(true, '正在提交...');
learun.httppost(config.webapi + 'learun/adms/evaluatingindicator/submitevaluationforzp', {Assessed:item.BeAssessed,Status:1}, (data) => {
if (data) {// 提交数据成功
page.grid.reload();
}
learun.layer.loading(false);
});
}
}, '智慧校园提示', ['取消', '确定']);
var status = item.Status;
if (status == '-1') {
learun.layer.toast("当前项目未打分,无法提交!");
return;
}
else if (status != '0') {
learun.layer.toast("当前项目已提交!");
return;
}
learun.layer.confirm('确定要提交该项数据吗?', function (_index) {
if (_index === '1') {
learun.layer.loading(true, '正在提交...');
learun.httppost(config.webapi + 'learun/adms/evaluatingindicator/submitevaluationforzp', { Assessed: item.BeAssessed, Status: 1 }, (data) => {
if (data) {// 提交数据成功
page.grid.reload();
}
learun.layer.loading(false);
});
}
}, '智慧校园提示', ['取消', '确定']);
},
btnPJClick: function (item, $item, $page) {// 左滑按钮点击事件
var status=item.Status;
if(status == '1')
{
learun.layer.toast("当前项目已提交!");
return;
}
learun.nav.closeCurrent();
learun.nav.go({
path: 'PartyevaluatQuestionsZP',
title: '党员评价',
type: 'right',
param: { ScoreYear: item.ScoreYear ,ScoreQuarter:item.ScoreQuarter} });
var status = item.Status;
if (status == '1') {
learun.layer.toast("当前项目已提交!");
return;
}
learun.nav.closeCurrent();
learun.nav.go({
path: 'PartyevaluatQuestionsZP',
title: '党员评价',
type: 'right',
param: { ScoreYear: item.ScoreYear, ScoreQuarter: item.ScoreQuarter }
});
// learun.layer.confirm('确定要自评打分吗?', function (_index) {
// if (_index === '1') {
// learun.nav.go({ path: 'partyevaluate', title: '党员自评', type: 'right' });
@@ -155,9 +152,9 @@
// }, '智慧校园提示', ['取消', '确定']);
},
rowBtns: [
'<a class="lr-btn-blue">提交</a>',
'<a class="lr-btn-green">自评打分</a>',
] // 列表行左滑按钮
'<a class="lr-btn-blue">提交</a>',
'<a class="lr-btn-green">自评打分</a>',
] // 列表行左滑按钮
};
return page;
})();

+ 4
- 1
Learun.Framework.Ultimate V7/LearunApp-2.2.0/components/learun-app/customlist-action.vue View File

@@ -26,9 +26,10 @@
style="border: currentColor 1px solid"
>
<l-icon type="edit" />
编辑
{{ editText ?editText:"编辑" }}
</view>
<view
v-if="!hideView"
@click="$emit('view')"
class="customlist-banner-action-btn line-blue text-sm"
style="border: currentColor 1px solid; min-width: 160rpx"
@@ -49,6 +50,8 @@ export default {
showButton: {},
buttonText: "",
icontype: "",
editText:"",
hideView:{},
},
};
</script>


+ 1
- 1
Learun.Framework.Ultimate V7/LearunApp-2.2.0/config.js View File

@@ -16,7 +16,7 @@ export default {
// "http://localhost:8088/"
// ],
"apiHost": [
"http://192.168.2.98:8088/"
"http://localhost:8088/"
],
// 开发环境下自动填充登录账号密码,与接口地址一一对应,只在开发环境下显示
"devAccount": [


+ 26
- 0
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages.json View File

@@ -998,6 +998,32 @@
"style": {
"navigationBarTitleText": "会议扫码签到"
}
},
//党员自评
{
"path": "pages/partyevaluatzp/list",
"style": {
"navigationBarTitleText": "党员自评"
}
},
{
"path": "pages/partyevaluatzp/single",
"style": {
"navigationBarTitleText": "党员评价"
}
},
//党小组长评分
{
"path": "pages/partyevaluatxz/list",
"style": {
"navigationBarTitleText": "党小组长评分"
}
},
{
"path": "pages/partyevaluatxz/single",
"style": {
"navigationBarTitleText": "党员评价"
}
}



+ 355
- 0
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/partyevaluatxz/list.vue View File

@@ -0,0 +1,355 @@
<template>
<view class="page">
<!-- 主列表页 -->
<view :class="sideOpen ? 'show' : ''" class="mainpage" style="padding-top: 80rpx;">
<!-- 顶部条目/分页信息栏 -->
<l-customlist-banner @buttonClick="sideOpen = false">{{ tips }}</l-customlist-banner>
<!-- 滚动列表,跨端支持上拉/下拉 -->
<l-scroll-list v-if="ready" @pullDown="pullDown" @toBottom="fetchList()" ref="list">
<l-customlist :tips="loadState" showTips>
<!-- 单条记录 -->
<view class="customlist-item" v-for="item of list" :key="item.Id">
<view class="customlist-item-field">
<text class="customlist-item-field-title">姓名:</text>
{{ displayListItem(item, 'empname') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">党员编号:</text>
{{ displayListItem(item, 'empno') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">年度:</text>
{{ displayListItem(item, 'ScoreYear') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">季度:</text>
{{ displayListItem(item, 'ScoreQuarter') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">分值:</text>
{{ displayListItem(item, 'Score') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">状态:</text>
{{ displayListItem(item, 'Status') }}
</view>
<l-customlist-action showButton icontype='friendaddfill' buttonText='提交' @join="action('submit', item.Id,item)" showEdit editText='打分' @edit="action('edit', item.Id,item)" hideView/>
</view>
</l-customlist>
</l-scroll-list>
</view>
<!-- 关闭侧边抽屉按钮 -->
<view @click="sideOpen = false" :class="sideOpen ? 'show' : ''" class="sideclose">
<l-icon type="pullright" color="blue" />
</view>
<!-- 侧边栏,用于设置查询条件 -->
<scroll-view :class="sideOpen ? 'show' : ''" class="sidepage" scroll-y>
<view v-if="ready" class="padding">
<l-customlist-sidepage-datefilter
v-model="dateRange"
@change="searchChange"
title="按时间日期查询: "
ref="datefilter"
class="margin-bottom"
/>
<l-select
v-model="queryData.ScoreYear"
@change="searchChange"
:range="dataSource.ScoreYear"
title ="年度"
placeholder="按年度查询"
/>
<l-select
v-model="queryData.ScoreQuarter"
@change="searchChange"
:range="dataSource.ScoreQuarter"
title ="季度"
placeholder="按季度查询"
/>
<!-- 重置查询条件按钮 -->
<view class="padding-tb">
<l-button @click="reset" line="orange" class="block" block>重置查询条件</l-button>
</view>
</view>
</scroll-view>
<!-- <l-customlist-add v-if="!sideOpen" @click="action('add')" /> -->
</view>
</template>
<script>
/*
* 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn)
* Copyright (c) 2013-2020 上海力软信息技术有限公司
* 创建人:超级管理员
* 日 期:2020-10-20 09:37
* 描 述:班级工作记事
*/
/**
* 本段代码由移动端代码生成器输出,移动端须 2.2.0 版本及以上可以使用
* 请在移动端 /pages.json 中的 pages 字段中添加一条记录:
* { "path": "pages/partyevaluatxz/list", "style": { "navigationBarTitleText": "表单列表页" } }
*
* (navigationBarTitleText 字段为本页面的标题文本,可以修改)
* (必须自行操作该步骤,力软代码生成器不会自动帮您修改 /pages.json 文件)
*/
import moment from 'moment'
import get from 'lodash/get'
import set from 'lodash/set'
import pickBy from 'lodash/pickBy'
import mapValues from 'lodash/mapValues'
export default {
data() {
return {
// 数据项的数据类型、结构
scheme: {
empname: { type: 'text'},
empno: { type: 'text'},
ScoreYear: { type: 'text'},
ScoreQuarter: { type: 'text' },
Score: { type: 'text' },
Status: { type: 'needFormat'},
},
// 查询条件
searchData: {},
defaultQueryData: {},
queryData: {
ScoreYear: '',
ScoreQuarter: '',
},
// 数据源
dataSource: {
ScoreYear: [],
ScoreQuarter: [],
},
// 时间查询参数
dateRange: null,
// 页面相关参数
ready: false,
tips: '加载中...',
loadState: '向下翻以加载更多',
sideOpen: false,
// 列表与分页信息
page: 1,
total: 2,
list: []
}
},
async onLoad() {
await this.init()
},
onUnload() {
this.OFF('partyevaluatxz-list-change')
},
methods: {
// 页面初始化
async init() {
this.ON('partyevaluatxz-list-change', this.refreshList)
// 拉取加载列表和数据源
await Promise.all([
// this.FETCH_DATASOURCE('bjsj').then(result => {
// this.dataSource.ClassNo = result.data.map(t => ({ text: t.classname, value: t.classno }))
// }),
() => {}
])
await this.fetchList()
// 初始化查询条件
this.defaultQueryData = this.COPY(this.queryData)
this.ready = true
},
// 拉取列表
async fetchList() {
if (this.page > this.total) { return }
const result = await this.HTTP_GET(
'learun/adms/evaluatingindicator/GetEvaluationListForXZ',
{
// 这里 sidx 表示排序字段,sord 表示排序方式(DESC=降序,ASC=升序)
// 代码生成器生成时默认按照主键排序,您可以修改成按创建时间的字段降序
pagination: { rows: 10, page: this.page, sidx: 'ScoreYear desc,ScoreQuarter desc,empno asc', sord: 'DESC' },
queryJson: JSON.stringify({ account: this.GET_GLOBAL('loginUser').account })
},
'加载数据时出错'
)
if (!result) { return }
this.total = result.total
this.page = result.page + 1
this.list = this.list.concat(result.rows)
this.tips = `已加载 ${Math.min(result.page, result.total)} / ${result.total} 页,共 ${result.records} 项`
this.loadState = result.page >= result.total ? '已加载所有项目' : '向下翻以加载更多'
},
// 刷新清空列表
async refreshList() {
this.page = 1
this.total = 2
this.list = []
await this.fetchList()
},
// 列表下拉
pullDown() {
this.refreshList().then(() => {
this.$refs.list.stopPullDown()
})
},
// 设置搜索条件
async searchChange() {
const result = {}
// 时间查询相关参数
if (this.dateRange) {
result.StartTime = this.dateRange.start
result.EndTime = this.dateRange.end
}
// 将其他查询项添加到查询 JSON 中
const queryObj = pickBy(this.queryData, t => (Array.isArray(t) ? t.length > 0 : t))
Object.assign(result, mapValues(queryObj, t => (Array.isArray(t) ? t.join(',') : t)))
this.searchData = result
await this.refreshList()
},
// 点击「清空查询条件」按钮
reset() {
this.$refs.datefilter.changeDateRange('all')
this.queryData = this.COPY(this.defaultQueryData)
this.searchChange()
},
// 点击「编辑」、「查看」、「添加」、「删除」按钮
async action(type, id = '',item) {
var status = item.Status;
switch (type) {
case 'view':
this.NAV_TO(`./single?type=view&id=${id}`)
return
case 'add':
this.NAV_TO('./single?type=create')
return
case 'edit':
if (status == '1') {
this.TOAST("当前项目已提交!");
return;
}
//todo:进入党员评价页面
//、、、、
// this.NAV_TO(`./single?type=edit&id=${id}`)
return
case 'delete':
if (!(await this.CONFIRM('删除项目', '确定要删除该项吗?', true))) {
return
}
this.HTTP_POST('learun/adms/PersonnelManagement/ClassWork/delete', id, '删除失败').then(success => {
if(!success) { return }
this.TOAST('删除成功', 'success')
this.refreshList()
})
return
case 'submit':
if (status == '-1') {
this.TOAST("当前项目未打分,无法提交!");
return;
}
else if (status != '0') {
this.TOAST("当前项目已提交!");
return;
}
if (!(await this.CONFIRM('提交项目', '确定要提交该项数据吗?', true))) {
return
}
this.HTTP_POST('learun/adms/evaluatingindicator/submitevaluationforxz',{Id:item.Id,Status:1}, '提交失败').then(success => {
if(!success) { return }
this.TOAST('提交成功', 'success')
this.refreshList()
})
return
default:
return
}
},
// 显示列表中的标题项
displayListItem(item, field) {
const fieldItem = this.scheme[field]
const value = item[field]
switch (fieldItem.type) {
case 'currentInfo':
case 'organize':
return fieldItem.dataType === 'time' ? value : get(this.GET_GLOBAL(fieldItem.dataType), `${value}.name`, '')
case 'radio':
case 'select':
const selectItem = this.dataSource[field].find(t => t.value === String(value))
return get(selectItem, 'text', '')
case 'checkbox':
if (!value || value.split(',').length <= 0) { return '' }
const checkboxItems = value.split(',')
return this.dataSource[field].filter(t => checkboxItems.includes(t.value)).map(t => t.text).join(',')
case 'datetime':
if (!value) { return '' }
return moment(value).format(Number(fieldItem.dateformat) === 0 ? 'YYYY年 M月 D日' : 'YYYY-MM-DD HH:mm')
case 'needFormat':
return value=='-1'?'未打分':(value=='0'?'草稿':(value=='1'?'已提交':''))
default: return value === null || value === undefined ? '' : value
}
}
}
}
</script>
<style lang="less" scoped>
@import '~@/common/css/sidepage.less';
@import '~@/common/css/customlist.less';
</style>

+ 218
- 0
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/partyevaluatxz/single.vue View File

@@ -0,0 +1,218 @@
<template>
<view class="page">
<view v-if="ready">
<l-select
@input="setValue('ClassWork.ClassNo', $event)"
:value="getValue('ClassWork.ClassNo')"
:disabled="!edit"
:range="dataSource.ClassWork.ClassNo"
title="班级"
/>
<l-date-picker
@input="setValue('ClassWork.Date', $event)"
:value="getValue('ClassWork.Date')"
:disabled="!edit"
title="日期"
/>
<l-input
@input="setValue('ClassWork.Title', $event)"
:value="getValue('ClassWork.Title')"
:disabled="!edit"
title="标题"
/>
<l-textarea
@input="setValue('ClassWork.Content', $event)"
:value="getValue('ClassWork.Content')"
:readonly="!edit"
title="工作内容"
/>
</view>
<view v-if="ready" class="bg-white margin-tb padding" style="padding-top: 0; overflow: hidden;">
<l-button v-if="edit" @click="action('save')" size="lg" color="green" class="block margin-top" block>
提交保存
</l-button>
<l-button v-if="!edit && mode !== 'create'" @click="action('edit')" size="lg" line="orange" class="block margin-top" block>
编辑本页
</l-button>
<l-button v-if="edit && mode !== 'create'" @click="action('reset')" size="lg" line="red" class="block margin-top" block>
取消编辑
</l-button>
<l-button v-if="!edit && mode !== 'create'" @click="action('delete')" size="lg" line="red" class="block margin-top" block>
删除
</l-button>
</view>
</view>
</template>
<script>
/*
* 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn)
* Copyright (c) 2013-2020 上海力软信息技术有限公司
* 创建人:超级管理员
* 日 期:2020-10-20 09:37
* 描 述:班级工作记事
*/
/**
* 本段代码由移动端代码生成器输出,移动端须 2.2.0 版本及以上可以使用
* 请在移动端 /pages.json 中的 pages 字段中添加一条记录:
* { "path": "pages/partyevaluatxz/single", "style": { "navigationBarTitleText": "表单详情页" } }
*
* (navigationBarTitleText 字段为本页面的标题文本,可以修改)
* (必须自行操作该步骤,力软代码生成器不会自动帮您修改 /pages.json 文件)
*/
import get from 'lodash/get'
import set from 'lodash/set'
import moment from 'moment'
import customPageMixins from '@/common/custompage.js'
export default {
mixins: [customPageMixins],
data() {
return {
// 页面相关参数
id: null,
mode: null,
edit: null,
ready: false,
// 表单数据
current: {},
origin: {},
// 表单项数据结构
scheme: {
ClassWork: {
ClassNo: { type: 'select', title: '班级', dataSource: '1', dataSourceId: 'bjsj,classname,classno' },
Date: { type: 'datetime', title: '日期', dateformat: '0' },
Title: { type: 'text', title: '标题' },
Content: { type: 'textarea', title: '工作内容' },
},
},
// 数据源
dataSource: {
ClassWork: {
ClassNo: [],
},
}
}
},
async onLoad({ type, id }) {
await this.init(type, id)
},
methods: {
// 页面初始化
async init(type, id) {
this.LOADING('加载数据中...')
this.id = id
this.mode = type
this.edit = ['create', 'edit'].includes(this.mode)
// 拉取表单数据,同时拉取所有来自数据源的选单数据
await Promise.all([
this.FETCH_DATASOURCE('bjsj').then(result => {
this.dataSource.ClassWork.ClassNo = result.data.map(t => ({ text: t.classname, value: t.classno }))
}),
() => {}
])
await this.fetchForm()
this.ready = true
this.HIDE_LOADING()
},
// 加载表单数据
async fetchForm() {
if (this.mode === 'create') {
this.origin = await this.getDefaultForm()
} else {
const result = await this.HTTP_GET('learun/adms/PersonnelManagement/ClassWork/form', this.id)
this.origin = await this.formatFormData(result)
}
this.current = this.COPY(this.origin)
},
// 点击 「编辑」、「重置」、「保存」、「删除」 按钮
async action(type) {
switch (type) {
case 'edit':
this.edit = true
break
case 'reset':
this.current = this.COPY(this.origin)
this.edit = false
break
case 'save':
const verifyResult = this.verifyForm()
if (verifyResult.length > 0) {
this.CONFIRM('表单验证失败', verifyResult.join('\n'))
return
}
if (!(await this.CONFIRM('提交确认', '确定要提交本页表单内容吗?', true))) {
return
}
this.LOADING('正在提交...')
const postData = await this.getPostData(this.id)
this.HTTP_POST('learun/adms/PersonnelManagement/ClassWork/save', postData, '表单提交保存失败').then(success => {
this.HIDE_LOADING()
if (!success) {
return
}
this.EMIT('PersonnelManagementClassWork-list-change')
this.NAV_BACK()
this.TOAST('提交保存成功')
})
break
case 'delete':
if (!(await this.CONFIRM('删除项目', '确定要删除本项吗?', true))) {
return
}
this.LOADING('提交删除中...')
this.HTTP_POST('learun/adms/PersonnelManagement/ClassWork/delete', this.id, '删除失败').then(success => {
this.HIDE_LOADING()
if (!success) {
return
}
this.EMIT('PersonnelManagementClassWork-list-change')
this.NAV_BACK()
this.this.TOAST('删除成功', 'success')
})
break
default: break
}
},
// 获取表单值
getValue(path) {
return get(this.current, path)
},
// 设置表单值
setValue(path, val) {
set(this.current, path, val)
}
}
}
</script>

+ 343
- 0
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/partyevaluatzp/list.vue View File

@@ -0,0 +1,343 @@
<template>
<view class="page">
<!-- 主列表页 -->
<view :class="sideOpen ? 'show' : ''" class="mainpage" style="padding-top: 80rpx;">
<!-- 顶部条目/分页信息栏 -->
<l-customlist-banner @buttonClick="sideOpen = false">{{ tips }}</l-customlist-banner>
<!-- 滚动列表,跨端支持上拉/下拉 -->
<l-scroll-list v-if="ready" @pullDown="pullDown" @toBottom="fetchList()" ref="list">
<l-customlist :tips="loadState" showTips>
<!-- 单条记录 -->
<view class="customlist-item" v-for="item of list" :key="item.Id">
<view class="customlist-item-field">
<text class="customlist-item-field-title">年度:</text>
{{ displayListItem(item, 'ScoreYear') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">季度:</text>
{{ displayListItem(item, 'ScoreQuarter') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">自评分值:</text>
{{ displayListItem(item, 'ScoreZP') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">状态:</text>
{{ displayListItem(item, 'Status') }}
</view>
<l-customlist-action showButton icontype='friendaddfill' buttonText='提交' @join="action('submit', item.Id,item)" showEdit editText='自评打分' @edit="action('edit', item.Id,item)" hideView/>
</view>
</l-customlist>
</l-scroll-list>
</view>
<!-- 关闭侧边抽屉按钮 -->
<view @click="sideOpen = false" :class="sideOpen ? 'show' : ''" class="sideclose">
<l-icon type="pullright" color="blue" />
</view>
<!-- 侧边栏,用于设置查询条件 -->
<scroll-view :class="sideOpen ? 'show' : ''" class="sidepage" scroll-y>
<view v-if="ready" class="padding">
<l-customlist-sidepage-datefilter
v-model="dateRange"
@change="searchChange"
title="按时间日期查询: "
ref="datefilter"
class="margin-bottom"
/>
<l-select
v-model="queryData.ScoreYear"
@change="searchChange"
:range="dataSource.ScoreYear"
title ="年度"
placeholder="按年度查询"
/>
<l-select
v-model="queryData.ScoreQuarter"
@change="searchChange"
:range="dataSource.ScoreQuarter"
title ="季度"
placeholder="按季度查询"
/>
<!-- 重置查询条件按钮 -->
<view class="padding-tb">
<l-button @click="reset" line="orange" class="block" block>重置查询条件</l-button>
</view>
</view>
</scroll-view>
<!-- <l-customlist-add v-if="!sideOpen" @click="action('add')" /> -->
</view>
</template>
<script>
/*
* 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn)
* Copyright (c) 2013-2020 上海力软信息技术有限公司
* 创建人:超级管理员
* 日 期:2020-10-20 09:37
* 描 述:班级工作记事
*/
/**
* 本段代码由移动端代码生成器输出,移动端须 2.2.0 版本及以上可以使用
* 请在移动端 /pages.json 中的 pages 字段中添加一条记录:
* { "path": "pages/partyevaluatzp/list", "style": { "navigationBarTitleText": "表单列表页" } }
*
* (navigationBarTitleText 字段为本页面的标题文本,可以修改)
* (必须自行操作该步骤,力软代码生成器不会自动帮您修改 /pages.json 文件)
*/
import moment from 'moment'
import get from 'lodash/get'
import set from 'lodash/set'
import pickBy from 'lodash/pickBy'
import mapValues from 'lodash/mapValues'
export default {
data() {
return {
// 数据项的数据类型、结构
scheme: {
ScoreYear: { type: 'text'},
ScoreQuarter: { type: 'text' },
ScoreZP: { type: 'text' },
Status: { type: 'needFormat'},
},
// 查询条件
searchData: {},
defaultQueryData: {},
queryData: {
ScoreYear: '',
ScoreQuarter: '',
},
// 数据源
dataSource: {
ScoreYear: [],
ScoreQuarter: [],
},
// 时间查询参数
dateRange: null,
// 页面相关参数
ready: false,
tips: '加载中...',
loadState: '向下翻以加载更多',
sideOpen: false,
// 列表与分页信息
page: 1,
total: 2,
list: []
}
},
async onLoad() {
await this.init()
},
onUnload() {
this.OFF('partyevaluatzp-list-change')
},
methods: {
// 页面初始化
async init() {
this.ON('partyevaluatzp-list-change', this.refreshList)
// 拉取加载列表和数据源
await Promise.all([
// this.FETCH_DATASOURCE('bjsj').then(result => {
// this.dataSource.ClassNo = result.data.map(t => ({ text: t.classname, value: t.classno }))
// }),
() => {}
])
await this.fetchList()
// 初始化查询条件
this.defaultQueryData = this.COPY(this.queryData)
this.ready = true
},
// 拉取列表
async fetchList() {
if (this.page > this.total) { return }
const result = await this.HTTP_GET(
'learun/adms/evaluatingindicator/gezplist',
{
// 这里 sidx 表示排序字段,sord 表示排序方式(DESC=降序,ASC=升序)
// 代码生成器生成时默认按照主键排序,您可以修改成按创建时间的字段降序
pagination: { rows: 10, page: this.page, sidx: 'ScoreYear desc,ScoreQuarter desc', sord: 'DESC' },
queryJson: JSON.stringify({ account: this.GET_GLOBAL('loginUser').account })
},
'加载数据时出错'
)
if (!result) { return }
this.total = result.total
this.page = result.page + 1
this.list = this.list.concat(result.rows)
this.tips = `已加载 ${Math.min(result.page, result.total)} / ${result.total} 页,共 ${result.records} 项`
this.loadState = result.page >= result.total ? '已加载所有项目' : '向下翻以加载更多'
},
// 刷新清空列表
async refreshList() {
this.page = 1
this.total = 2
this.list = []
await this.fetchList()
},
// 列表下拉
pullDown() {
this.refreshList().then(() => {
this.$refs.list.stopPullDown()
})
},
// 设置搜索条件
async searchChange() {
const result = {}
// 时间查询相关参数
if (this.dateRange) {
result.StartTime = this.dateRange.start
result.EndTime = this.dateRange.end
}
// 将其他查询项添加到查询 JSON 中
const queryObj = pickBy(this.queryData, t => (Array.isArray(t) ? t.length > 0 : t))
Object.assign(result, mapValues(queryObj, t => (Array.isArray(t) ? t.join(',') : t)))
this.searchData = result
await this.refreshList()
},
// 点击「清空查询条件」按钮
reset() {
this.$refs.datefilter.changeDateRange('all')
this.queryData = this.COPY(this.defaultQueryData)
this.searchChange()
},
// 点击「编辑」、「查看」、「添加」、「删除」按钮
async action(type, id = '',item) {
var status = item.Status;
switch (type) {
case 'view':
this.NAV_TO(`./single?type=view&id=${id}`)
return
case 'add':
this.NAV_TO('./single?type=create')
return
case 'edit':
if (status == '1') {
this.TOAST("当前项目已提交!");
return;
}
//todo:进入党员评价页面
//、、、、
// this.NAV_TO(`./single?type=edit&id=${id}`)
return
case 'delete':
if (!(await this.CONFIRM('删除项目', '确定要删除该项吗?', true))) {
return
}
this.HTTP_POST('learun/adms/PersonnelManagement/ClassWork/delete', id, '删除失败').then(success => {
if(!success) { return }
this.TOAST('删除成功', 'success')
this.refreshList()
})
return
case 'submit':
if (status == '-1') {
this.TOAST("当前项目未打分,无法提交!");
return;
}
else if (status != '0') {
this.TOAST("当前项目已提交!");
return;
}
if (!(await this.CONFIRM('提交项目', '确定要提交该项数据吗?', true))) {
return
}
this.HTTP_POST('learun/adms/evaluatingindicator/submitevaluationforzp', { Assessed: item.BeAssessed, Status: 1 }, '提交失败').then(success => {
if(!success) { return }
this.TOAST('提交成功', 'success')
this.refreshList()
})
return
default:
return
}
},
// 显示列表中的标题项
displayListItem(item, field) {
const fieldItem = this.scheme[field]
const value = item[field]
switch (fieldItem.type) {
case 'currentInfo':
case 'organize':
return fieldItem.dataType === 'time' ? value : get(this.GET_GLOBAL(fieldItem.dataType), `${value}.name`, '')
case 'radio':
case 'select':
const selectItem = this.dataSource[field].find(t => t.value === String(value))
return get(selectItem, 'text', '')
case 'checkbox':
if (!value || value.split(',').length <= 0) { return '' }
const checkboxItems = value.split(',')
return this.dataSource[field].filter(t => checkboxItems.includes(t.value)).map(t => t.text).join(',')
case 'datetime':
if (!value) { return '' }
return moment(value).format(Number(fieldItem.dateformat) === 0 ? 'YYYY年 M月 D日' : 'YYYY-MM-DD HH:mm')
case 'needFormat':
return value=='-1'?'未打分':(value=='0'?'草稿':(value=='1'?'已提交':''))
default: return value === null || value === undefined ? '' : value
}
}
}
}
</script>
<style lang="less" scoped>
@import '~@/common/css/sidepage.less';
@import '~@/common/css/customlist.less';
</style>

+ 218
- 0
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/partyevaluatzp/single.vue View File

@@ -0,0 +1,218 @@
<template>
<view class="page">
<view v-if="ready">
<l-select
@input="setValue('ClassWork.ClassNo', $event)"
:value="getValue('ClassWork.ClassNo')"
:disabled="!edit"
:range="dataSource.ClassWork.ClassNo"
title="班级"
/>
<l-date-picker
@input="setValue('ClassWork.Date', $event)"
:value="getValue('ClassWork.Date')"
:disabled="!edit"
title="日期"
/>
<l-input
@input="setValue('ClassWork.Title', $event)"
:value="getValue('ClassWork.Title')"
:disabled="!edit"
title="标题"
/>
<l-textarea
@input="setValue('ClassWork.Content', $event)"
:value="getValue('ClassWork.Content')"
:readonly="!edit"
title="工作内容"
/>
</view>
<view v-if="ready" class="bg-white margin-tb padding" style="padding-top: 0; overflow: hidden;">
<l-button v-if="edit" @click="action('save')" size="lg" color="green" class="block margin-top" block>
提交保存
</l-button>
<l-button v-if="!edit && mode !== 'create'" @click="action('edit')" size="lg" line="orange" class="block margin-top" block>
编辑本页
</l-button>
<l-button v-if="edit && mode !== 'create'" @click="action('reset')" size="lg" line="red" class="block margin-top" block>
取消编辑
</l-button>
<l-button v-if="!edit && mode !== 'create'" @click="action('delete')" size="lg" line="red" class="block margin-top" block>
删除
</l-button>
</view>
</view>
</template>
<script>
/*
* 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn)
* Copyright (c) 2013-2020 上海力软信息技术有限公司
* 创建人:超级管理员
* 日 期:2020-10-20 09:37
* 描 述:班级工作记事
*/
/**
* 本段代码由移动端代码生成器输出,移动端须 2.2.0 版本及以上可以使用
* 请在移动端 /pages.json 中的 pages 字段中添加一条记录:
* { "path": "pages/partyevaluatzp/single", "style": { "navigationBarTitleText": "表单详情页" } }
*
* (navigationBarTitleText 字段为本页面的标题文本,可以修改)
* (必须自行操作该步骤,力软代码生成器不会自动帮您修改 /pages.json 文件)
*/
import get from 'lodash/get'
import set from 'lodash/set'
import moment from 'moment'
import customPageMixins from '@/common/custompage.js'
export default {
mixins: [customPageMixins],
data() {
return {
// 页面相关参数
id: null,
mode: null,
edit: null,
ready: false,
// 表单数据
current: {},
origin: {},
// 表单项数据结构
scheme: {
ClassWork: {
ClassNo: { type: 'select', title: '班级', dataSource: '1', dataSourceId: 'bjsj,classname,classno' },
Date: { type: 'datetime', title: '日期', dateformat: '0' },
Title: { type: 'text', title: '标题' },
Content: { type: 'textarea', title: '工作内容' },
},
},
// 数据源
dataSource: {
ClassWork: {
ClassNo: [],
},
}
}
},
async onLoad({ type, id }) {
await this.init(type, id)
},
methods: {
// 页面初始化
async init(type, id) {
this.LOADING('加载数据中...')
this.id = id
this.mode = type
this.edit = ['create', 'edit'].includes(this.mode)
// 拉取表单数据,同时拉取所有来自数据源的选单数据
await Promise.all([
this.FETCH_DATASOURCE('bjsj').then(result => {
this.dataSource.ClassWork.ClassNo = result.data.map(t => ({ text: t.classname, value: t.classno }))
}),
() => {}
])
await this.fetchForm()
this.ready = true
this.HIDE_LOADING()
},
// 加载表单数据
async fetchForm() {
if (this.mode === 'create') {
this.origin = await this.getDefaultForm()
} else {
const result = await this.HTTP_GET('learun/adms/PersonnelManagement/ClassWork/form', this.id)
this.origin = await this.formatFormData(result)
}
this.current = this.COPY(this.origin)
},
// 点击 「编辑」、「重置」、「保存」、「删除」 按钮
async action(type) {
switch (type) {
case 'edit':
this.edit = true
break
case 'reset':
this.current = this.COPY(this.origin)
this.edit = false
break
case 'save':
const verifyResult = this.verifyForm()
if (verifyResult.length > 0) {
this.CONFIRM('表单验证失败', verifyResult.join('\n'))
return
}
if (!(await this.CONFIRM('提交确认', '确定要提交本页表单内容吗?', true))) {
return
}
this.LOADING('正在提交...')
const postData = await this.getPostData(this.id)
this.HTTP_POST('learun/adms/PersonnelManagement/ClassWork/save', postData, '表单提交保存失败').then(success => {
this.HIDE_LOADING()
if (!success) {
return
}
this.EMIT('PersonnelManagementClassWork-list-change')
this.NAV_BACK()
this.TOAST('提交保存成功')
})
break
case 'delete':
if (!(await this.CONFIRM('删除项目', '确定要删除本项吗?', true))) {
return
}
this.LOADING('提交删除中...')
this.HTTP_POST('learun/adms/PersonnelManagement/ClassWork/delete', this.id, '删除失败').then(success => {
this.HIDE_LOADING()
if (!success) {
return
}
this.EMIT('PersonnelManagementClassWork-list-change')
this.NAV_BACK()
this.this.TOAST('删除成功', 'success')
})
break
default: break
}
},
// 获取表单值
getValue(path) {
return get(this.current, path)
},
// 设置表单值
setValue(path, val) {
set(this.current, path, val)
}
}
}
</script>

Loading…
Cancel
Save