[update] 企标立项、变更流程

This commit is contained in:
lideqin
2023-12-01 17:29:22 +08:00
parent 9cba85a0c7
commit 7189765b73
11 changed files with 1372 additions and 244 deletions
+13
View File
@@ -1,4 +1,6 @@
import { getAction, postAction } from '@/api/manage'
import { UI_CACHE_DB_DICT_DATA } from '@/store/mutation-types'
import Vue from 'vue'
// 单点登录获取用户信息
const getSSOUserInfo = (params) => postAction('/iam/loginByOauth2', params)
@@ -10,6 +12,12 @@ const queryPermissionsByUser = () => getAction('/sys/permission/getUserPermissio
const getFormDictTreeList = (params) => getAction('/sys/dictItem/treeListOption', params)
// 字典标签专用(通过code获取字典数组)
export const ajaxGetDictItems = (code, params) => getAction(`/sys/dict/getDictItems/${code}`, params)
// 从缓存中获取字典配置
function getDictItemsFromCache (dictCode) {
if (Vue.ls.get(UI_CACHE_DB_DICT_DATA) && Vue.ls.get(UI_CACHE_DB_DICT_DATA)[dictCode] && Vue.ls.get(UI_CACHE_DB_DICT_DATA)[dictCode].length > 0) {
return Vue.ls.get(UI_CACHE_DB_DICT_DATA)[dictCode]
}
}
// 重复校验
const duplicateCheck = (params) => getAction('/sys/duplicate/check', params)
@@ -21,6 +29,9 @@ const getFileInfo = (params) => getAction('/sys/oss/file/queryById', params)
// 获取人员信息列表
const getPersonInfoList = (params) => getAction('/process/fb/processFbInfo/getNodeList', params)
// 获取标准左侧树列表(标准体系)
const getTreeList = (params) => getAction('/laws/standard/lawsTreeNode/enterprise', params)
// 标准入库/变更流程------------
// 国内法规标准-获取表单模型
const getDomesticStandardFormModal = (params) => getAction('/laws/standard/domestic/getFormModel', params)
@@ -30,12 +41,14 @@ const queryStandardECProcessData = (params) => getAction('/process/fb/processFbE
export {
queryPermissionsByUser,
getFormDictTreeList,
getDictItemsFromCache,
duplicateCheck,
checkRuleByCode,
getFileInfo,
getSSOUserInfo,
getPersonInfoList,
getTreeList,
getDomesticStandardFormModal,
queryStandardECProcessData
+3 -1
View File
@@ -68,7 +68,9 @@
/deep/ .vertical-form-item {
flex-direction: column;
.van-field__label {
width: 100%;
}
.van-field__value {
margin-top: 0.24rem;
border: 0.02rem solid #C9CDD4;
+45
View File
@@ -26,8 +26,53 @@ module.exports = {
remark: '备注',
clickSelect: '点击选择',
selectUser: '选择人员',
finishDate: '完成日期',
rangeOfApplication: '适用范围',
standardEntryOrChange: {
source: '来源',
operationType: '操作类型'
},
esInitChange: {
applicationType: '申请类型',
standardProjectEstablishment: '标准立项',
change: '变更',
itemCategory: '项目类别',
formulate: '制定',
revise: '修订',
completionTimeChange: '完成时间变更',
terminationOfWork: '工作终止',
dutyDepartChange: '责任部门变更',
merge: '合并',
enterpriseStandardNum: '企标编号',
enterpriseStandardName: '企标名称',
enterpriseStandardCode: '企业标准代号',
enterpriseNameCode: '企业名称代号',
standardCategoryCode: '标准类别代号',
yearNumber: '年代号',
newEnterpriseStandardNum: '新企标编号',
newEnterpriseStandardName: '新企标名称',
standardEnglishName: '标准英文名称',
standardSystem: '标准体系',
standardType: '标准类型',
standardGradeClassification: '标准等级分类',
compilationIllustration: '编制说明',
draftPlanFinishDate: '草稿计划完成日期',
exposureDraftPlanFinishDate: '征求意见稿计划完成日期',
planSubmissionDate: '计划报批日期',
partName: '零部件名称',
authorizationDepart: '授权部门',
principalDrafter: '主起草人',
mainDraftUnit: '主起草单位',
headOfMainDraftingUnit: '起草单位负责人',
standardPusher: '标准推进人',
suitUnit: '配合单位',
projectStatement: '立项说明',
projectApprovalChangeReason: '立项/变更原因',
projectBackground: '立项背景、立项依据',
homogeneousStandardAnalysis: '国际、国家及行业同类标准分析',
standardContrastiveAnalysis: '企业同类标准对比分析',
leadershipAndNecessity: '立项标准的领先性与必要性',
initiatedProject: '立项目的及预期效果等',
uploadAttachment: '上传附件'
}
}
+262
View File
@@ -0,0 +1,262 @@
<template>
<ul class="list-menu" v-if="data.length">
<li v-for="(item, i) in data" :key="i" @click.stop="selectItem(item)" v-show="expandFlag">
<div class="item">
<div class="item-left">
<!-- 展开的图标 -->
<i class='expandIcon'
@click.stop="expandItem(item, i)"
:class="[expandArr.includes(i) ? 'reduce' : 'add',item.children && item.children.length ? '' : 'disabled']">
</i>
<!-- 选项名 -->
<span class=" value-span">{{ item[labelKey] }}</span>
</div>
<!-- 选择的图标 -->
<template v-if="!multiple">
<i class='selectIcon'
:class="[value[valueKey] == item[valueKey] ? 'checked' : 'noChecked']">
</i>
</template>
<template v-else>
<i class='selectIcon multiple-select-icon'
:class="[checkedArr.includes(item[valueKey]) ? 'checked' : 'noChecked']">
</i>
</template>
</div>
<list-menu
v-if='item.children'
@input='input'
:data='item.children'
:valueKey='valueKey'
:labelKey='labelKey'
:value="value"
:toastText='toastText'
:expandFlag='expandArr.includes(i)'
:multiple="multiple"
/>
</li>
</ul>
</template>
<script>
export default {
// 组件名必写
name: 'ListMenu',
props: {
// 选中的值的属性名,必传
valueKey: String,
// 在页面要展示的选项属性名,必传
labelKey: String,
// 选中的值,必传
value: [Object, String, Array],
// 控制展开,不需要传
expandFlag: {
type: Boolean,
default: true
},
// 总数据,必传
data: Array,
// 不可选提示文字,非必传
toastText: String,
// 是否多选
multiple: {
type: Boolean,
default: false
}
},
watch: {
value: {
immediate: true,
deep: true,
handler (val) {
return val
}
}
},
data () {
return {
// 当前级组件已展开的项
expandArr: []
}
},
computed: {
// 已经选中的数据 由key组成
checkedArr () {
return this.value.map(tt => tt[this.valueKey])
}
},
methods: {
// 子组件逐级传递选中项
input (item) {
this.$emit('input', item)
},
// 选择
selectItem (item) {
if (!this.multiple) {
this.$emit('input', item)
} else {
// 多选的时候 想要value值是所有选中的obj组成的数组
// 先判断保存的值中有没有改数据,存在的话删除,不存在的话增加
const eleIndex = this.value.findIndex(a => item[this.valueKey] === a[this.valueKey])
if (eleIndex > -1) {
const arr = [...this.value]
arr.splice(eleIndex, 1)
this.$emit('input', arr)
} else {
this.$emit('input', [...this.value, item])
}
}
},
// 展开
expandItem (item, i) {
if (item.children && item.children.length) {
const index = this.expandArr.indexOf(i)
if (index > -1) {
this.expandArr.splice(index, 1)
} else {
this.expandArr.push(i)
}
}
}
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
.popup-box > ul {
padding-right: @pad-base;
}
ul {
width: 100%;
color: #2a2a2a;
font-size: 0.22rem;
overflow: hidden;
background: #fff;
border-bottom: .8px solid #e1e1e1;
//height: calc(100% - 0.9rem);
//overflow: auto;
li {
padding-right: 0;
.item {
padding: @pad-base;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
font-size: 0.3rem;
&-left {
display: flex;
flex: 1;
}
.expandIcon {
height: 0.4rem;
width: 0.4rem;
font-style: normal;
position: relative;
&:after {
position: absolute;
top: 50%;
left: 50%;
font-size:0.4rem;
transform: translate(-50%, -50%);
}
&.add {
border-color: #2a2a2a;
&:after {
color: #2a2a2a;
content: '';
}
}
&.reduce {
border-color: @primary-color;
&:after {
color: @primary-color;
content: '';
}
}
&.disabled {
border-color: #ddd;
opacity: 0;
&:after {
color: #ddd;
}
}
}
.value-span {
text-align: left;
flex: 1;
}
.selectIcon {
float: right;
height: 0.3rem;
width: 0.3rem;
border: 1.5px solid;
border-radius: 50%;
position: relative;
&:after {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
&.checked {
border-color: @primary-color;
background: @primary-color;;
&:after {
color: #fff;
content: '✓';
}
}
&.noChecked {
border-color: @primary-color;
}
&.disabled {
border-color: #ddd;
}
}
.multiple-select-icon {
border-radius: 0.04rem;
}
}
&:not(:first-child) {
border-top: .8px solid #e1e1e1;
}
> ul {
border-bottom: 0;
padding-left: 0.35rem;
box-sizing: border-box;
li {
.item {
padding-left: 0.35rem;
box-sizing: border-box;
}
.item-left span{
width: 0;
overflow: auto;
}
border-top: .8px solid #e1e1e1;
}
}
}
}
</style>
+21 -21
View File
@@ -23,7 +23,7 @@
</template>
<script>
import {ajaxGetDictItems, getDictItemsFromCache} from '../../api/api'
import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api'
export default {
name: 'PickerDictField',
@@ -55,7 +55,7 @@ export default {
default: false
}
},
data() {
data () {
return {
showPicker: false,
showValue: '',
@@ -69,53 +69,53 @@ export default {
this.initVal()
}
},
dictCode:{
immediate:true,
handler() {
dictCode: {
immediate: true,
handler () {
this.initDictData()
this.initVal()
},
},
}
}
},
computed: {
//透传给下级组件的事件,需要排除本组件使用的change事件
childListeners() {
// 透传给下级组件的事件,需要排除本组件使用的change事件
childListeners () {
// const vm = this
let result = Object.assign({},
this.$listeners,
const result = Object.assign({},
this.$listeners
)
delete result.change
return result
}
},
methods: {
showPickerFunc() {
if(this.readonly) return
showPickerFunc () {
if (this.readonly) return
this.showPicker = true
},
initVal() {
initVal () {
// 防止数据字典的值是0
if (this.value + '') {
let item = this.columnData.find(tt => (tt[this.valueKey] + '') === (this.value + ''))
const item = this.columnData.find(tt => (tt[this.valueKey] + '') === (this.value + ''))
this.showValue = (item || {})[this.showKey]
} else {
this.showValue = ''
}
},
initDictData() {
//优先从缓存中读取字典配置
if(getDictItemsFromCache(this.dictCode)){
initDictData () {
// 优先从缓存中读取字典配置
if (getDictItemsFromCache(this.dictCode)) {
this.columnData = getDictItemsFromCache(this.dictCode)
return
}
//根据字典Code, 初始化字典数组
// 根据字典Code, 初始化字典数组
ajaxGetDictItems(this.dictCode, null).then((res) => {
if (res.success) {
this.columnData = res.result
}
})
},
onConfirm(value) {
onConfirm (value) {
this.showPicker = false
if (!this.valueKey) {
this.$emit('change', value)
@@ -137,4 +137,4 @@ export default {
<style scoped>
</style>
</style>
+264
View File
@@ -0,0 +1,264 @@
<!-- form表单中下拉框样式的组件-->
<template>
<div>
<van-field
readonly
clickable
name="picker"
:value="showValue"
v-bind="$attrs"
v-on="childListeners"
@click="showPickerFunc"
:rules="rules"
/>
<van-popup v-model="showPicker" style="height: 50vh" :class="{'dict-checkbox-field-popup': multiple}" position="bottom">
<!--background="#3074F6"-->
<van-search
v-if="canSearch"
v-model="searchValue"
placeholder="请输入搜索关键词"
input-align="left"
@search="onSearch"
@clear="onClear"
/>
<template v-if="!multiple">
<van-picker
show-toolbar
:columns="columnDataShow"
@confirm="onConfirm"
@cancel="showPicker = false"
:value-key="showKey"
>
</van-picker>
</template>
<template v-if="multiple">
<div class="item-ope">
<span class="van-picker__cancel" @click="onCancel">取消</span>
<span class="van-picker__confirm" @click="onConfirm">确认</span>
</div>
<van-checkbox-group class="dict-checkbox-group" v-model="checkedArr" ref="checkboxGroup">
<van-checkbox
v-for="(item) in columnDataShow"
:key="item[valueKey]"
:name="item[valueKey]"
shape="square"
>
{{ item[showKey] }}
</van-checkbox>
</van-checkbox-group>
</template>
</van-popup>
</div>
</template>
<script>
export default {
name: 'PickerField',
props: {
value: {
type: [String, Number, Object],
required: false
},
columnData: {
type: Array,
required: false,
default: () => {
return [
// {name: '1name', value: '1', text: 3},
// {name: '2name', value: '2', text: 3},
]
}
},
rules: {
type: [Array, null],
required: false,
default: null
},
// 默认是否有其他值
valueKey: {
type: String,
required: false,
default: 'value'
},
// picker中显示的key值
showKey: {
type: String,
required: false,
default: 'name'
},
readonly: {
type: Boolean,
required: false,
default: false
},
// 是否多选
multiple: {
type: Boolean,
required: false,
default: false
},
// 是否可以查询
canSearch: {
type: Boolean,
required: false,
default: true
},
// 当值不存在于下拉框中,是否要回显传的value
needShowValue: {
type: Boolean,
required: false,
default: false
}
},
data () {
return {
showPicker: false,
showValue: '', // 当前显示的input的值
searchValue: '', // 查询的字段
columnDataShow: [], // 当前显示的下拉框数据
checkedArr: [] // 选中的数据,在多选的情况下使用
}
},
watch: {
value: {
immediate: true,
handler: function () {
this.initVal()
// console.log('--------value----------', this.value)
}
},
columnData: {
immediate: true,
handler: function () {
this.columnDataShow = this.columnData
this.initVal()
// console.log('--------columnData----------', this.columnData)
}
},
showPicker (val) {
this.searchValue = ''
if (val) {
this.columnDataShow = [...this.columnData]
}
}
},
computed: {
// 透传给下级组件的事件,需要排除本组件使用的change事件
childListeners () {
// const vm = this
const result = Object.assign({},
this.$listeners
)
delete result.change
return result
}
},
methods: {
showPickerFunc () {
if (this.readonly || this.$attrs.disabled) return
this.showPicker = true
},
initVal () {
if (!this.multiple) {
if (this.value) {
let item
if (this.columnData.length > 0) {
item = this.columnData.find(tt => (tt[this.valueKey] + '') === (this.value + ''))
}
// 如果下拉列表中没有这一项,就回显值
if (!item) {
this.showValue = this.needShowValue ? this.value : ''
} else {
this.showValue = (item || {})[this.showKey]
}
} else {
this.showValue = ''
}
} else {
// 多选下拉框
if (this.value) {
this.checkedArr = this.value.split(',')
const showArr = []
this.checkedArr.map(item => {
const column = this.columnData.find(tt => (tt[this.valueKey] + '') === (item + ''))
if (column) {
showArr.push((column || {})[this.showKey])
}
this.showValue = showArr.join('')
})
} else {
this.showValue = ''
this.checkedArr = []
}
}
},
onConfirm (value) {
console.log('--------------')
if (!value) return
if (this.multiple) {
if (this.checkedArr.length === 0) {
this.$toast('请至少选择一条数据')
return
}
this.showPicker = false
this.$emit('change', this.checkedArr.join())
} else {
if (!this.valueKey) {
this.$emit('change', value)
} else {
this.showValue = value[this.showKey]
this.$emit('change', value[this.valueKey])
}
this.showPicker = false
}
},
onCancel () {
this.showPicker = false
},
onSearch (val) {
if (val) {
this.columnDataShow = this.columnData.filter(tt => tt[this.showKey].indexOf(val) > -1)
} else {
this.columnDataShow = [...this.columnData]
}
},
onClear () {
this.columnDataShow = [...this.columnData]
}
},
model: {
prop: 'value',
event: 'change'
}
}
</script>
<style scoped lang="less">
@import '~@assets/less/common.less';
/deep/ .dict-checkbox-field-popup {
height: 375px;
font-size: 16px;
.item-ope {
display: flex;
align-items: center;
justify-content: space-between;
height: 44px;
line-height: 44px;
}
.dict-checkbox-group {
padding: @pad-base;
height: calc(100% - 44px - 2 * @pad-base - 54px);
overflow: auto;
div + div {
margin-top: @pad-base;
}
}
}
</style>
+98 -73
View File
@@ -1,106 +1,112 @@
<!-- 选择评价人员 -->
<template>
<div class="list-container">
<van-search
v-model="filters.realname"
show-action
:clearable="true"
input-align="center"
label="姓名"
placeholder="请输入姓名"
@search="onSearch"
>
<template #action>
<div @click="onSearch">搜索</div>
</template>
</van-search>
<van-list
v-model="loading"
:finished="listFinished"
:finished-text="listData.length > 0 ? '没有更多了' : '暂无数据'"
@load="onLoadMore"
:immediate-check="false"
>
<van-checkbox-group v-if="type === 'checkbox'" v-model="checkedArr" ref="checkboxGroup">
<van-swipe-cell
v-for="(item, index) in listData"
:key="index"
:name="index"
stop-propagation
:before-close="handleBeforeClose"
>
<div class="item-box">
<van-checkbox :name="item.id" @click="checkboxClick(item)" shape="square" :disabled="readonly"></van-checkbox>
<div>
<div class="item-title">
<span class="title">{{ item.realname }}</span>
<span class="score">工号({{ item.username || '暂无数据' }})</span>
</div>
<div class="item-content">
<van-popup class="history-list-popup" v-model="isShow" position="right" :style="{ width: '100%', height: '100%' }" >
<!-- 增加一个标题-->
<custom-header :title="$t('selectUser')" :leftArrow="true" :handle-left="handleLeft"></custom-header>
<div class="list-container">
<van-search
v-model="filters.realname"
show-action
:clearable="true"
input-align="center"
label="姓名"
placeholder="请输入姓名"
@search="onSearch"
>
<template #action>
<div @click="onSearch">搜索</div>
</template>
</van-search>
<van-list
v-model="loading"
:finished="listFinished"
:finished-text="listData.length > 0 ? '没有更多了' : '暂无数据'"
@load="onLoadMore"
:immediate-check="false"
>
<van-checkbox-group v-if="type === 'checkbox'" v-model="checkedArr" ref="checkboxGroup">
<van-swipe-cell
v-for="(item, index) in listData"
:key="index"
:name="index"
stop-propagation
:before-close="handleBeforeClose"
>
<div class="item-box">
<van-checkbox :name="item.id" @click="checkboxClick(item)" shape="square" :disabled="readonly"></van-checkbox>
<div>
<div class="item-title">
<span class="title">{{ item.realname }}</span>
<span class="score">工号({{ item.username || '暂无数据' }})</span>
</div>
<div class="item-content">
<span>
<span class="label">角色: </span>
<span class="text">{{ item.roleTxt || '暂无数据' }}</span>
</span>
<span>
<span>
<span class="label">岗位: </span>
<span class="text">{{ item.post || '暂无数据' }}</span>
</span>
</div>
</div>
</div>
</div>
</van-swipe-cell>
</van-checkbox-group>
<van-radio-group v-else v-model="checkedArr" ref="checkboxGroup">
<van-swipe-cell
v-for="(item, index) in listData"
:key="index"
:name="index"
stop-propagation
:before-close="handleBeforeClose"
>
<div class="item-box">
<van-radio :name="item.id" @click="checkboxClick(item)" :disabled="readonly"></van-radio>
<div>
<div class="item-title">
<span class="title">{{ item.realname }}</span>
<span class="score">工号({{ item.username || '暂无数据' }})</span>
</div>
<div class="item-content">
</van-swipe-cell>
</van-checkbox-group>
<van-radio-group v-else v-model="checkedArr" ref="checkboxGroup">
<van-swipe-cell
v-for="(item, index) in listData"
:key="index"
:name="index"
stop-propagation
:before-close="handleBeforeClose"
>
<div class="item-box">
<van-radio :name="item.id" @click="checkboxClick(item)" :disabled="readonly"></van-radio>
<div>
<div class="item-title">
<span class="title">{{ item.realname }}</span>
<span class="score">工号({{ item.username || '暂无数据' }})</span>
</div>
<div class="item-content">
<span>
<span class="label">角色: </span>
<span class="text">{{ item.roleTxt || '暂无数据' }}</span>
</span>
<span>
<span>
<span class="label">岗位: </span>
<span class="text">{{ item.post || '暂无数据' }}</span>
</span>
</div>
</div>
</div>
</div>
</van-swipe-cell>
</van-radio-group>
</van-list>
</van-swipe-cell>
</van-radio-group>
</van-list>
<!-- 底部的按钮 -->
<div class="bottom-button-container">
<div class="bottom-btn bottom-justify-div">
<van-button size="small" color="#C6C7CA" native-type="button" plain :disabled="disabled" @click="resetFunc">重置
</van-button>
<van-button v-if="type === 'checkbox'" size="small" color="#E63636" native-type="button" :disabled="disabled" @click="checkAll">全选</van-button>
<van-button size="small" color="#E63636" native-type="button" :disabled="disabled" @click="confirmFunc()">确定
</van-button>
<van-button size="small" color="#C6C7CA" native-type="button" plain :disabled="disabled" @click="$emit('cancel')">取消
</van-button>
<!-- 底部的按钮 -->
<div class="bottom-button-container">
<div class="bottom-btn bottom-justify-div">
<van-button size="small" color="#C6C7CA" native-type="button" plain :disabled="disabled" @click="resetFunc">重置
</van-button>
<van-button v-if="type === 'checkbox'" size="small" color="#E63636" native-type="button" :disabled="disabled" @click="checkAll">全选</van-button>
<van-button size="small" color="#E63636" native-type="button" :disabled="disabled" @click="confirmFunc()">确定
</van-button>
<van-button size="small" color="#C6C7CA" native-type="button" plain :disabled="disabled" @click="hide()">取消
</van-button>
</div>
</div>
</div>
</div>
</van-popup>
</template>
<script>
import ListMixin from '../mixins/ListMixin'
import CustomHeader from '@/components/CustomHeader'
export default {
name: 'SelectUser',
components: { CustomHeader },
mixins: [ListMixin],
props: {
selectedData: {
@@ -141,6 +147,7 @@ export default {
// },
data () {
return {
isShow: false,
loading: false, // 加载数据的标识,
listFinished: false, // 完成加载的标识
refreshing: false, // 下拉刷新的标志
@@ -164,6 +171,11 @@ export default {
}
},
methods: {
open () {
this.isShow = true
this.initData()
this.getListData()
},
checkboxClick (item) {
console.log(item)
if (this.type === 'checkbox') {
@@ -234,9 +246,16 @@ export default {
this.$emit('selected-change', this.checkedArr)
}
this.$emit('selected-change-name', this.selectedDataArr.map(item => item.realname + '(' + item.username + ')').join(','))
this.hide()
},
onSearch () {
this.getListData()
},
handleLeft () {
this.hide()
},
hide () {
this.isShow = false
}
}
@@ -247,6 +266,12 @@ export default {
@import '~@assets/less/list.less';
@import '~@assets/less/common.less';
.history-list-popup{
background: @global-bg;
display: flex;
flex-direction: column;
}
.list-container{
flex: 1;
display: flex;
+11 -130
View File
@@ -12,30 +12,23 @@
>
</van-field>
<van-popup class="history-list-popup" v-model="isShow" position="right" :style="{ width: '100%', height: '100%' }" >
<!-- 增加一个标题-->
<custom-header :title="$t('selectUser')" :leftArrow="true" :handle-left="handleLeft"></custom-header>
<select-user
ref="evaluatePersonSelectedList"
:selected-data="value"
:filter-data="filterData"
@selected-change="selectedChange"
@selected-change-name="selectedChangeName"
@cancel="hide()"
v-bind="$attrs"
:readonly="readonly"
></select-user>
</van-popup>
<select-user
ref="evaluatePersonSelectedList"
:selected-data="value"
:filter-data="filterData"
@selected-change="selectedChange"
@selected-change-name="selectedChangeName"
v-bind="$attrs"
:readonly="readonly"
></select-user>
</div>
</template>
<script>
import SelectUser from './SelectUser'
import CustomHeader from './CustomHeader'
export default {
name: 'SelectUserField',
components: { SelectUser, CustomHeader },
components: { SelectUser },
props: {
// 选中的多个id 以逗号“,”拼接
value: {
@@ -87,7 +80,6 @@ export default {
},
data () {
return {
isShow: false,
selectedDataNames: ''
}
},
@@ -96,22 +88,13 @@ export default {
if (this.readonly) {
return
}
this.isShow = true
this.$nextTick(() => {
this.$refs.evaluatePersonSelectedList.initData()
this.$refs.evaluatePersonSelectedList.getListData()
this.$refs.evaluatePersonSelectedList.open()
})
},
handleLeft () {
this.hide()
},
hide () {
this.isShow = false
},
// 选择人员组件 选择后返回的方法
selectedChange (value) {
this.$emit('select', value)
this.hide()
},
selectedChangeName (value) {
this.selectedDataNames = value
@@ -128,106 +111,4 @@ export default {
<style scoped lang="less">
@import '~@assets/less/common.less';
.history-list-popup{
background: @global-bg;
display: flex;
flex-direction: column;
}
.van-list{
padding: @pad-base;
flex: 1;
overflow: auto;
}
.item-box .item-title.full-width .title{
width: 100%;
}
// 底部按钮
.bottom-justify-div{
display: flex;
align-items: center;
justify-content: space-around;
.van-button{
padding: 0 @pad-base;
}
}
// 中间内容
.item-box{
background: #FFFFFF;
padding: @pad-base;
& + .item-box{
margin-top: 0.24rem;
}
// 左滑后 样式的变化
&.item-box-has-swipe{
border-radius: 0.1rem 0 0 0.1rem;
.item-state{
border-radius: 0 0 0 0.1rem;
}
}
.van-checkbox{
width: 100%;
display: flex;
align-items: center;
/deep/.van-checkbox__label{
flex: 1;
display: flex;
flex-direction: row;
align-items: center;
margin-left: 0;
}
}
.left-img{
display: flex;
flex-direction: row;
flex-basis: 1.5rem;
.van-image{
width: 1.2rem;
height: 1.2rem;
margin: 0 0.24rem;
}
}
.right-content{
width: 0;
flex: 1;
.title{
width: 3.05rem;
font-weight: bold;
}
.item-title{
font-size: 0.28rem;
text-align: left;
display: flex;
align-items: center;
span {
display: inline-block;
text-align: left;
}
}
.item-content{
padding: 0.2rem 0 0;
span {
display: flex;
align-items: baseline;
color: @font-color;
font-size: 0.22rem;
text-align: left;
white-space: pre-wrap;
word-break: break-all;
}
}
}
}
.history-btn{
padding: 0 @pad-base;
}
//.van-cell{
// padding: 0.27rem 0!important;
//}
</style>
+186
View File
@@ -0,0 +1,186 @@
<!--树形结构的多选组件value-所选树形结构体的id的集合 text所选树形结构名字-->
<template>
<div>
<van-field
v-bind="$attrs"
readonly
clearable
@click="showPopup"
v-model="showValue"
/>
<van-popup
v-model="show"
style="height: 60vh"
position="bottom"
safe-area-inset-bottom
:close-on-click-overlay="false"
:close-on-popstate="true"
>
<div class="popup-box">
<div class="operate">
<span @click="cancel">取消</span>
<span @click="handleOk">确认</span>
</div>
<link-menu
:data="list"
value-key="key"
label-key="title"
:value="selectedDepartTemp"
@input="selected"
:multiple="multiple"
></link-menu>
</div>
</van-popup>
</div>
</template>
<script>
import LinkMenu from './LinkMenu'
export default {
name: 'TreeSelectMultiple',
components: {
LinkMenu
},
props: {
value: {
type: [Object, Array],
required: true,
default: () => []
},
list: {
type: Array,
default: () => []
},
readonly: {
type: Boolean,
required: false,
default: false
},
// 是否多选 默认是true
multiple: {
type: Boolean,
required: false,
default: true
}
},
watch: {
value: {
immediate: true,
deep: true,
handler () {
this.handleInitData()
}
},
list: {
immediate: true,
deep: true,
handler () {
this.handleInitData()
}
}
},
computed: {
// 当前显示的部门名称的字符串
showValue () {
if (this.multiple) {
return this.selectedDepart.map(tt => tt.title).join('')
} else {
return this.selectedDepart.title
}
}
},
data () {
return {
show: false, // 控制popup的显示隐藏
selectedDepart: [], // 选中的部门
selectedDepartTemp: [], // 选中的部门暂存 多选的时候是数组,单选的时候是对象
confirm: false // 是否点击了确认
}
},
methods: {
cancel () {
this.show = false
},
handleOk () {
if (this.multiple) {
this.$emit('input', this.selectedDepartTemp.map(tt => tt.key))
} else {
this.$emit('input', [this.selectedDepartTemp.key])
}
this.show = false
},
// 弹出层显示
showPopup () {
if (this.readonly) return
this.selectedDepartTemp = JSON.parse(JSON.stringify(this.selectedDepart))
this.show = true
},
selected (val) {
// 先临时转换
this.selectedDepartTemp = JSON.parse(JSON.stringify(val))
},
// 初始化数据,将id的形式转成所有对象的形式
handleInitData () {
const selectedDepart = []
this.findSelectedItemByKey(this.list, selectedDepart)
if (this.multiple) {
this.selectedDepart = [...selectedDepart]
} else {
this.selectedDepart = selectedDepart.length > 0 ? selectedDepart[0] : {}
}
},
// 循环遍历数据进行 选中的判断
findSelectedItemByKey (arr, result) {
arr.forEach(item => {
if (this.value.includes(item.key)) {
result.push(item)
}
if (item.children && item.children.length > 0) {
this.findSelectedItemByKey(item.children, result)
}
})
}
}
}
</script>
<style scoped lang="less">
@import '~@assets/less/common.less';
.wrap {
display: flex;
flex-direction: column;
padding: 0 @pad-base;
box-sizing: border-box;
height: 100%;
}
// 解决线上滚动条不灵敏的bug
.popup-box{
height: 100%;
position: relative;
/deep/& > .list-menu {
height: calc(100% - 0.8rem);
overflow: auto;
}
}
.operate {
padding: 0 @pad-base;
box-sizing: border-box;
font-size: 0.3rem;
font-weight: 600;
height: 0.8rem;
display: flex;
justify-content: space-between;
align-items: center;
}
.content {
width: 100%;
flex: 1;
}
</style>
+15
View File
@@ -73,3 +73,18 @@ export const ProcessKey = {
// 企标稽查整改
ES_INSPECTION_RECTIFICATION: { text: 'inspect_plan', value: 'inspect_process' }
}
// 企标计划立项/变更流程-申请类型
export const ApplicationCategory = {
INITIATION: { text: '立项', value: '3' },
CHANGE: { text: '变更', value: '4' }
}
// 企标计划立项/变更流程-项目类别
export const ProjectType = {
ENACT: { text: '制定', value: '1' },
MODIFY: { text: '修订', value: '2' },
COMPLETE_TIME_CHANGE: { text: '完成时间变更', value: '3' },
WORK_TERMINATE: { text: '工作中止', value: '4' },
RESPONSIBLE_DEPT_CHANGE: { text: '责任部门变更', value: '5' },
MERGE: { text: '合并', value: '6' }
}
@@ -26,57 +26,486 @@
type="date"
readonly
/>
<select-user-field
class="form-item"
v-model="processInfoForm.appraiserObjArr"
:checked-names="processInfoForm.appraiserObjArr_dictText"
fieldName="appraiserObjArr"
@selectNameChange="selectUserNameChange"
:readonly="false"
type="radio"
/>
<!-- 流程说明 -->
<van-field
v-model="processInfoForm.processDescription"
:label="$t('processExplain')"
type="textarea"
autosize
disabled
rows="2"
:placeholder="$t('pleaseEnter')+$t('processExplain')"
:border="false"
input-align="left"
class="vertical-form-item"/>
</van-form>
</div>
<!-- 业务基本信息 -->
<div class="process-part">
<div class="process-part-title">{{ $t('basicServiceInformation') }}</div>
<van-form
@failed="onFailed"
@submit="onSubmit"
ref="form"
input-align="right"
error-message-align="right"
:readonly="readonly"
>
<!-- 申请类型 -->
<picker-field
:label="$t('esInitChange.applicationType')"
:placeholder="$t('pleaseSelect')+$t('esInitChange.applicationType')"
v-model="baseInfoForm.applicationCategory"
readonly
:columnData="applicationCategoryData"
></picker-field>
<!-- 项目类别 -->
<picker-field
:label="$t('esInitChange.itemCategory')"
:placeholder="$t('pleaseSelect')+$t('esInitChange.itemCategory')"
v-model="baseInfoForm.projectType"
readonly
:columnData="projectTypeData"
></picker-field>
<!-- 制定 -->
<template v-if="baseInfoForm.projectType === ProjectType.ENACT.value">
<!-- 企标编号 -->
<van-field
:label="$t('esInitChange.enterpriseStandardNum')"
:placeholder="$t('pleaseEnter') + $t('esInitChange.enterpriseStandardNum')"
readonly
maxLength="50"
v-model="baseInfoForm.newEnStandardNo" />
<!-- 企标名称 -->
<van-field
:label="$t('esInitChange.enterpriseStandardName')"
:placeholder="$t('pleaseEnter') + $t('esInitChange.enterpriseStandardName')"
readonly
maxLength="50"
v-model="baseInfoForm.newEnStandardName" />
<!-- 企业标准代号 -->
<picker-dict-field
:label="$t('esInitChange.enterpriseStandardCode')"
:placeholder="$t('pleaseEnter') + $t('esInitChange.enterpriseStandardCode')"
dict-code="enterprise_standard_code"
readonly
v-model="baseInfoForm.enStandardCode" />
<!-- 企业名称代号 -->
<picker-dict-field
:label="$t('esInitChange.enterpriseNameCode')"
:placeholder="$t('pleaseEnter') + $t('esInitChange.enterpriseNameCode')"
dict-code="enterprise_name_code"
readonly
v-model="baseInfoForm.enNameCode" />
<!-- 标准类别代号 -->
<picker-dict-field
:label="$t('esInitChange.standardCategoryCode')"
:placeholder="$t('pleaseEnter') + $t('esInitChange.standardCategoryCode')"
dict-code="standard_category_code"
readonly
v-model="baseInfoForm.standardCategoryCode" />
</template>
<!-- 修订 -->
<template v-else-if="baseInfoForm.projectType === ProjectType.MODIFY.value">
<!-- 企标编号 -->
<van-field
:label="$t('esInitChange.enterpriseStandardNum')"
:placeholder="$t('pleaseEnter') + $t('esInitChange.enterpriseStandardNum')"
readonly
maxLength="50"
v-model="baseInfoForm.originEnStandardNo" />
<!-- 企标名称 -->
<van-field
:label="$t('esInitChange.enterpriseStandardName')"
:placeholder="$t('pleaseEnter') + $t('esInitChange.enterpriseStandardName')"
readonly
maxLength="50"
v-model="baseInfoForm.originEnStandardName" />
<!-- 新企标编号 -->
<van-field
:label="$t('esInitChange.newEnterpriseStandardNum')"
:placeholder="$t('pleaseEnter') + $t('esInitChange.newEnterpriseStandardNum')"
readonly
maxLength="50"
v-model="baseInfoForm.newEnStandardNo" />
<!-- 新企标名称 -->
<van-field
:label="$t('esInitChange.newEnterpriseStandardName')"
:placeholder="$t('pleaseEnter') + $t('esInitChange.newEnterpriseStandardName')"
readonly
maxLength="50"
v-model="baseInfoForm.newEnStandardName" />
</template>
<!-- 年代号 -->
<van-field
:label="$t('esInitChange.yearNumber')"
:placeholder="$t('pleaseEnter') + $t('esInitChange.yearNumber')"
readonly
maxLength="50"
v-model="baseInfoForm.decadeCode" />
<!-- 标准英文名称 -->
<van-field
:label="$t('esInitChange.standardEnglishName')"
:placeholder="$t('pleaseEnter') + $t('esInitChange.standardEnglishName')"
readonly
maxLength="50"
v-model="baseInfoForm.enStandardEnglishName" />
<!-- 标准体系 -->
<tree-select-multiple
:label="$t('esInitChange.standardSystem')"
:placeholder="$t('pleaseSelect') + $t('esInitChange.standardSystem')"
:list="standardSystemOptions"
readonly
v-model="baseInfoForm.enStandardSystem"/>
<!-- 标准类型 -->
<picker-dict-field
:label="$t('esInitChange.standardType')"
:placeholder="$t('pleaseEnter') + $t('esInitChange.standardType')"
dict-code="esp_standard_type"
readonly
v-model="baseInfoForm.standardType" />
<!-- 标准等级分类 -->
<picker-dict-field
:label="$t('esInitChange.standardGradeClassification')"
:placeholder="$t('pleaseEnter') + $t('esInitChange.standardGradeClassification')"
dict-code="standard_grade_classify"
readonly
v-model="baseInfoForm.enStandardClassification" />
<!-- 编制说明 -->
<van-field
:label="$t('esInitChange.compilationIllustration')"
:placeholder="$t('pleaseEnter') + $t('esInitChange.compilationIllustration')"
readonly
v-model="baseInfoForm.compilationDescription" >
<template v-slot:input>
<file-display :file-ids="baseInfoForm.compilationDescription" />
</template>
</van-field>
</van-form>
</div>
<!-- 审批意见 -->
<!-- 完成日期 -->
<div class="process-part">
<div class="process-part-title">{{ $t('finishDate') }}</div>
<van-form
@failed="onFailed"
@submit="onSubmit"
ref="form"
input-align="right"
error-message-align="right"
:readonly="readonly"
>
<!-- 草稿计划完成日期 -->
<calendar-field
:label="$t('esInitChange.draftPlanFinishDate')"
v-model="baseInfoForm.draftPlannedCompleteDate"
type="date"
readonly
/>
<!-- 征求意见稿计划完成日期 -->
<calendar-field
:label="$t('esInitChange.exposureDraftPlanFinishDate')"
v-model="baseInfoForm.exposureDraftPlanFinishDate"
type="date"
readonly
/>
<!-- 计划报批日期 -->
<calendar-field
:label="$t('esInitChange.planSubmissionDate')"
v-model="baseInfoForm.planApprovalDate"
type="date"
readonly
/>
</van-form>
</div>
<!-- 适用范围 -->
<div class="process-part">
<div class="process-part-title">{{ $t('rangeOfApplication') }}</div>
<van-form
@failed="onFailed"
@submit="onSubmit"
ref="form"
input-align="right"
error-message-align="right"
:readonly="readonly">
<!-- 零部件名称 -->
<van-field
:label="$t('esInitChange.partName')"
:placeholder="$t('pleaseEnter') + $t('esInitChange.partName')"
readonly
autosize
v-model="baseInfoForm.componentName" />
<!-- 授权部门 -->
<van-field
:label="$t('esInitChange.authorizationDepart')"
:placeholder="$t('pleaseEnter') + $t('esInitChange.authorizationDepart')"
readonly
v-model="baseInfoForm.authDept_dictText" />
<!-- 主起草人 -->
<van-field
:label="$t('esInitChange.principalDrafter')"
:placeholder="$t('pleaseEnter') + $t('esInitChange.principalDrafter')"
readonly
v-model="baseInfoForm.mainDraftingUser_dictText" />
<!-- 主起草单位 -->
<van-field
:label="$t('esInitChange.mainDraftUnit')"
:placeholder="$t('pleaseEnter') + $t('esInitChange.mainDraftUnit')"
readonly
v-model="baseInfoForm.mainDraftingUnit_dictText" />
<!-- 起草单位负责人 -->
<van-field
:label="$t('esInitChange.headOfMainDraftingUnit')"
:placeholder="$t('pleaseEnter') + $t('esInitChange.headOfMainDraftingUnit')"
readonly
v-model="baseInfoForm.mainDraftingUnitResponsiblePerson_dictText" />
<!-- 标准推进人 -->
<van-field
:label="$t('esInitChange.standardPusher')"
:placeholder="$t('pleaseEnter') + $t('esInitChange.standardPusher')"
readonly
v-model="baseInfoForm.standardPromoter_dictText" />
<!-- 配合单位 -->
<van-field
:label="$t('esInitChange.suitUnit')"
:placeholder="$t('pleaseEnter') + $t('esInitChange.suitUnit')"
readonly
v-model="baseInfoForm.cooperationUnit_dictText" />
</van-form>
</div>
<!-- 立项说明 -->
<div class="process-part">
<div class="process-part-title">{{ $t('esInitChange.projectStatement') }}</div>
<van-form
@failed="onFailed"
@submit="onSubmit"
ref="form"
input-align="right"
error-message-align="right"
:readonly="readonly">
<!-- 立项/变更原因 -->
<van-field
v-model="processInfoForm.changeReason"
:label="$t('esInitChange.projectApprovalChangeReason')"
type="textarea"
autosize
disabled
rows="2"
:placeholder="$t('pleaseEnter')+$t('esInitChange.projectApprovalChangeReason')"
:border="false"
input-align="left"
class="vertical-form-item"/>
<!-- 立项背景立项依据 -->
<van-field
v-model="processInfoForm.projectBackground"
:label="$t('esInitChange.projectBackground')"
type="textarea"
autosize
disabled
rows="2"
:placeholder="$t('pleaseEnter')+$t('esInitChange.projectBackground')"
:border="false"
input-align="left"
class="vertical-form-item"/>
<!-- 国际国家及行业同类标准分析 -->
<van-field
v-model="processInfoForm.similarNaStandardsAnalysis"
:label="$t('esInitChange.homogeneousStandardAnalysis')"
type="textarea"
autosize
disabled
rows="2"
:placeholder="$t('pleaseEnter')+$t('esInitChange.homogeneousStandardAnalysis')"
:border="false"
input-align="left"
class="vertical-form-item"/>
<!-- 企业同类标准对比分析 -->
<van-field
v-model="processInfoForm.similarEnStandardsAnalysis"
:label="$t('esInitChange.standardContrastiveAnalysis')"
type="textarea"
autosize
disabled
rows="2"
:placeholder="$t('pleaseEnter')+$t('esInitChange.standardContrastiveAnalysis')"
:border="false"
input-align="left"
class="vertical-form-item"/>
<!-- 立项标准的领先性与必要性 -->
<van-field
v-model="processInfoForm.standardLeadingNecessity"
:label="$t('esInitChange.leadershipAndNecessity')"
type="textarea"
autosize
disabled
rows="2"
:placeholder="$t('pleaseEnter')+$t('esInitChange.leadershipAndNecessity')"
:border="false"
input-align="left"
class="vertical-form-item"/>
<!-- 立项目的及预期效果等 -->
<van-field
v-model="processInfoForm.projectExpectedEffects"
:label="$t('esInitChange.initiatedProject')"
type="textarea"
autosize
disabled
rows="2"
:placeholder="$t('pleaseEnter')+$t('esInitChange.initiatedProject')"
:border="false"
input-align="left"
class="vertical-form-item"/>
<!-- 上传附件 -->
<van-field
:label="$t('esInitChange.uploadAttachment')"
readonly
v-model="baseInfoForm.uploadAttachment" >
<template v-slot:input>
<file-display :file-ids="baseInfoForm.uploadAttachment" />
</template>
</van-field>
</van-form>
</div>
<!-- 流程审批信息 -->
<div class="process-part">
<div class="process-part-title">{{ $t('processApprovalInformation') }}</div>
<van-form
@failed="onFailed"
@submit="onSubmit"
ref="form"
input-align="right"
error-message-align="right"
:readonly="readonly">
<!-- 备注 -->
<van-field
v-model="processInfoForm.commitText"
:label="$t('remark')"
type="textarea"
autosize
rows="2"
:placeholder="$t('pleaseEnter')+$t('remark')"
:border="false"
input-align="left"
class="vertical-form-item"/>
</van-form>
</div>
</template>
<template v-slot:operation>
<van-button icon="revoke" class="operation-common-btn">{{ $t('turnTo') }}</van-button>
<van-button icon="revoke" class="operation-common-btn" type="primary" @click="handleAgree">{{ $t('agree') }}</van-button>
<van-button icon="revoke" class="operation-common-btn light-color-button">{{ $t('reject') }}</van-button>
<van-button class="operation-common-btn">
<template #icon>
<van-icon class="iconfont" class-prefix="icon" name="zhuanban" />
</template>
{{ $t('turnTo') }}
</van-button>
<van-button class="operation-common-btn" type="primary" @click="handleAgree">
<template #icon>
<van-icon class="iconfont" class-prefix="icon" name="check" />
</template>
{{ $t('agree') }}
</van-button>
<van-button class="operation-common-btn light-color-button">
<template #icon>
<van-icon class="iconfont" class-prefix="icon" name="close" />
</template>
{{ $t('reject') }}
</van-button>
</template>
</process-common-layout>
</template>
<script>
import ProcessCommonLayout from '@/components/ProcessCommonLayout'
import { ProcessKey } from '@/enums/commonEnums'
import { ApplicationCategory, ProcessKey, ProjectType } from '@/enums/commonEnums'
import CalendarField from '@/components/CalendarField'
import SelectUserField from '@/components/SelectUserField'
import PickerField from '@/components/PickerField'
import PickerDictField from '@/components/PickerDictField'
import TreeSelectMultiple from '@/components/TreeSelectMultiple'
import FileDisplay from '@/components/FileDisplay'
import { getTreeList } from '@/api/api'
export default {
name: 'EnterpriseStandardInitChange',
components: {
PickerDictField,
PickerField,
ProcessCommonLayout,
CalendarField,
SelectUserField
TreeSelectMultiple,
FileDisplay
},
data () {
return {
ProcessKey,
ProjectType,
readonly: false,
processInfoForm: {
appraiserObjArr: ''
} // 流程信息表单
// 申请类型
applicationCategoryData: [
{ // 标准立项
name: this.$t('esInitChange.standardProjectEstablishment'),
value: ApplicationCategory.INITIATION.value,
text: this.$t('esInitChange.standardProjectEstablishment')
},
{ // 变更
name: this.$t('esInitChange.change'),
value: ApplicationCategory.CHANGE.value,
text: this.$t('esInitChange.change')
}
],
// 项目类别
projectTypeData: [
{ // 制定
name: this.$t('esInitChange.formulate'),
value: ProjectType.ENACT.value,
text: this.$t('esInitChange.formulate')
},
{ // 修订
name: this.$t('esInitChange.revise'),
value: ProjectType.MODIFY.value,
text: this.$t('esInitChange.revise')
},
{ // 完成时间变更
name: this.$t('esInitChange.completionTimeChange'),
value: ProjectType.COMPLETE_TIME_CHANGE.value,
text: this.$t('esInitChange.completionTimeChange')
},
{ // 工作终止
name: this.$t('esInitChange.terminationOfWork'),
value: ProjectType.WORK_TERMINATE.value,
text: this.$t('esInitChange.terminationOfWork')
},
{ // 责任部门变更
name: this.$t('esInitChange.dutyDepartChange'),
value: ProjectType.RESPONSIBLE_DEPT_CHANGE.value,
text: this.$t('esInitChange.dutyDepartChange')
},
{ // 合并
name: this.$t('esInitChange.merge'),
value: ProjectType.MERGE.value,
text: this.$t('esInitChange.merge')
}
],
standardSystemOptions: [], // 标准体系下拉框数据
processInfoForm: {}, // 流程信息表单
baseInfoForm: {
applicationCategory: 3,
projectType: 1,
enStandardCode: '1',
enStandardSystem: 'adb15f66ce174f7295ab51fbc39c15b8',
compilationDescription: '1730504676669747201'
} // 业务基本信息
}
},
created () {
this.initStandardSystemOptions()
},
methods: {
// 获取标准体系下拉框数据
initStandardSystemOptions () {
getTreeList({ option: 1 }).then(res => {
if (res.success) {
this.standardSystemOptions = res.result
}
})
},
selectUserNameChange (value, fieldName) {
this.processInfoForm[fieldName + '_dictText'] = value
},
@@ -86,6 +515,12 @@ export default {
},
handleAgree () {
this.onSubmit()
},
selectUserFinish (value) {
console.log(value)
},
selectUser () {
this.$refs.selectUserRef.open()
}
}
}