[update] 修改UAT问题:企标制修订流程征求意见对象填写意见后面的几个节点,增加有无意见的查询条件,主起草人汇总节点增加批量设置处理意见按钮

This commit is contained in:
lideqin
2024-09-04 15:54:25 +08:00
parent 30de1d410e
commit 8102a3215d
7 changed files with 390 additions and 28 deletions
+2 -1
View File
@@ -167,7 +167,8 @@ module.exports = {
confirmIsInsertSignatureCancelText: '确认签章页无误并提交',
haveNoOpinion: '有无意见',
have: '有',
noHave: '无'
noHave: '无',
batchSetHandleAdvice: '批量设置处理意见'
},
// 企标更改流程
enStandardChange: {
+6
View File
@@ -612,3 +612,9 @@ export const EnterpriseNameCode = {
JC: { text: 'JC', value: 'JC' },
JHK: { text: 'JHK', value: 'JHK' }
}
// 企标制修订-有无意见
export const HaveNoOpinion = {
HAVE: { text: '有', value: '1' },
NO: { text: '无', value: '0' }
}
@@ -0,0 +1,87 @@
<template>
<j-modal
:title="title"
:maskClosable="true"
:width="500"
:closable="true"
switchFullscreen
@cancel="handleCancel"
@ok="handleOk"
:visible="visible">
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('workCenter.enStandardRevision.handlingSuggestion')">
<a-select v-decorator.trim="[ 'handleAdvice', validatorRules.handleAdvice ]"
:placeholder="$t('pleaseEnter') + $t('workCenter.enStandardRevision.handlingSuggestion')"
:options="handlingSuggestionOption"
/>
</a-form-item>
</a-form>
</a-spin>
</j-modal>
</template>
<script>
export default {
name: 'BatchSetHandleAdviceModal',
data () {
return {
title: this.$t('workCenter.enStandardRevision.batchSetHandleAdvice'),
visible: false,
confirmLoading: false,
form: this.$form.createForm(this),
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 6 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 }
},
handlingSuggestionOption: [
{ value: '1', label: '采纳' },
{ value: '2', label: '部分采纳' },
{ value: '3', label: '不采纳' }
],
validatorRules: {
handleAdvice: {
rules: [
{ required: true, message: this.$t('pleaseSelect') + this.$t('workCenter.enStandardRevision.handlingSuggestion') }
],
validateTrigger: 'change'
}
}
}
},
methods: {
show () {
this.form.resetFields()
this.visible = true
},
close () {
this.visible = false
},
handleOk () {
// 触发表单验证
this.form.validateFields((err, values) => {
if (!err) {
this.confirmLoading = true
this.$emit('ok', values.handleAdvice)
this.close()
this.confirmLoading = false
}
})
},
handleCancel () {
this.close()
}
}
}
</script>
<style scoped>
</style>
@@ -27,10 +27,10 @@
</div>
<a-form-model-item class="item-model" prop="haveNoOpinion">
<a-radio-group v-model="formInline.haveNoOpinion" :disabled="disabled" @change="reviewMeetingFlagChange">
<a-radio value="1">
<a-radio :value="HaveNoOpinion.HAVE.value">
{{ $t('workCenter.enStandardRevision.have') }}
</a-radio>
<a-radio value="0">
<a-radio :value="HaveNoOpinion.NO.value">
{{ $t('workCenter.enStandardRevision.noHave') }}
</a-radio>
</a-radio-group>
@@ -77,6 +77,7 @@
import BaseInfoForm from './BaseInfoForm'
import JTable from '@/components/jero/JTable'
import CommentModal from './CommentModal'
import { HaveNoOpinion } from '../../../../enums/commonEnums'
import Vue from 'vue'
import { kkFilePreview } from '@/utils/kkFilePreview'
import { ACCESS_TOKEN } from '@/store/mutation-types'
@@ -95,6 +96,7 @@ export default {
},
data () {
return {
HaveNoOpinion,
loading: false,
formInline: {},
rules: {
@@ -16,6 +16,32 @@
</a-form-model-item>
</div>
<!-- 搜索区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<!-- 有无意见 -->
<a-col :span="8" class="search-col">
<a-form-item :label="$t('workCenter.enStandardRevision.haveNoOpinion')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
:placeholder="$t('pleaseSelect')+$t('workCenter.enStandardRevision.haveNoOpinion')"
v-model="queryParam.haveNoOpinion">
<a-select-option value="">{{ $t('pleaseSelect') }}</a-select-option>
<a-select-option :value="HaveNoOpinion.HAVE.value">{{ $t('workCenter.enStandardRevision.have') }}</a-select-option>
<a-select-option :value="HaveNoOpinion.NO.value">{{ $t('workCenter.enStandardRevision.noHave') }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<div style="float: right;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search" style="margin-left: 8px">{{ $t('query') }}</a-button>
<a-button type="primary" ghost @click="searchReset" icon="reload" style="margin-left: 8px">{{ $t('reset') }}</a-button>
</div>
</a-row>
</a-form>
</div>
<!-- 操作区域 -->
<div v-if="!disabled" class="table-operator">
<!-- 新增 -->
@@ -77,11 +103,7 @@ import BaseInfoForm from './BaseInfoForm'
import JTable from '@/components/jero/JTable'
import CommentModal from './CommentModal'
import UserSelection from '@/components/selection/UserSelection'
import Vue from 'vue'
import { kkFilePreview } from '@/utils/kkFilePreview'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import { queryFileInfoByEditId } from '../../../../api/workCenter'
import { Base64 } from 'js-base64'
import { HaveNoOpinion } from '../../../../enums/commonEnums'
export default {
name: 'DepartLiaisonCollectBaseInfo',
@@ -95,7 +117,15 @@ export default {
},
data () {
return {
HaveNoOpinion,
loading: false,
labelCol: {
span: 12
},
wrapperCol: {
span: 12
},
queryParam: {},
/* 分页参数 */
ipagination: {
current: 1,
@@ -155,6 +185,7 @@ export default {
}
],
dataSource: [],
dataList: [], // 全部数据,防止查询后数据丢失
formInline: {},
rules: {
// 部门联络人主管级领导
@@ -182,6 +213,7 @@ export default {
...item
}
})
this.dataList = JSON.parse(JSON.stringify(this.dataSource))
this.formInline = Object.assign({}, data)
this.onEditFile = data.onEditFile
// 给表单赋值
@@ -193,7 +225,7 @@ export default {
getData () {
// 把数据抛出,在线编辑不知道要不要抛
const data = Object.assign({}, this.formInline)
data.advices = this.dataSource
data.advices = this.dataList
// 在线编辑文件id
data.onEditFile = this.onEditFile
return data
@@ -203,9 +235,9 @@ export default {
let data = {} // 需要返回的数据
await this.$refs.ruleForm.validate(valid => {
if (valid) {
if (this.dataSource && this.dataSource.length > 0) {
if (this.dataList && this.dataList.length > 0) {
data = Object.assign({}, this.formInline)
data.advices = this.dataSource
data.advices = this.dataList
} else {
this.$message.warning(this.$t('addAtLeastOneRowOfData'))
data = false
@@ -216,6 +248,23 @@ export default {
})
return data
},
searchQuery () {
if (this.queryParam.haveNoOpinion === HaveNoOpinion.HAVE.value) {
this.dataSource = this.dataList.filter(item => {
return item.haveNoOpinion === HaveNoOpinion.HAVE.value
})
} else if (this.queryParam.haveNoOpinion === HaveNoOpinion.NO.value) {
this.dataSource = this.dataList.filter(item => {
return item.haveNoOpinion === HaveNoOpinion.NO.value
})
} else {
this.dataSource = JSON.parse(JSON.stringify(this.dataList))
}
},
searchReset () {
this.dataSource = JSON.parse(JSON.stringify(this.dataList))
this.queryParam = {}
},
handleTableChange (pagination) {
this.ipagination = pagination
},
@@ -241,6 +290,8 @@ export default {
onOk: () => {
const dataIndex = this.dataSource.findIndex(item => item.uid === uid)
this.dataSource.splice(dataIndex, 1)
const dataIndexTwo = this.dataList.findIndex(item => item.uid === uid)
this.dataList.splice(dataIndexTwo, 1)
}
})
},
@@ -253,13 +304,21 @@ export default {
this.$set(this.dataSource[dataIndex], 'clauseNum', value.clauseNum)
this.$set(this.dataSource[dataIndex], 'clauseName', value.clauseName)
this.$set(this.dataSource[dataIndex], 'editAdvice', value.editAdvice)
const dataIndexTwo = this.dataList.findIndex(item => item.uid === uid)
this.$set(this.dataList[dataIndexTwo], 'clauseNum', value.clauseNum)
this.$set(this.dataList[dataIndexTwo], 'clauseName', value.clauseName)
this.$set(this.dataList[dataIndexTwo], 'editAdvice', value.editAdvice)
// this.dataSource.splice(index, 1, value)
} else {
// 没有下标, 是新增
const uidGenerator = () => {
return '-' + parseInt(Math.random() * 10000 + 1, 10)
}
this.dataSource.push({ uid: uidGenerator(), ...value })
if (!this.queryParam.haveNoOpinion || this.queryParam.haveNoOpinion === HaveNoOpinion.HAVE.value) {
// 有意见或者没有筛选项的时候dataSource才增加
this.dataSource.push({ uid: uidGenerator(), ...value, haveNoOpinion: HaveNoOpinion.HAVE.value })
}
this.dataList.push({ uid: uidGenerator(), ...value, haveNoOpinion: HaveNoOpinion.HAVE.value })
}
},
// 选择用户得到用户名
@@ -296,4 +355,18 @@ export default {
.title-text-long {
width: 180px !important;
}
.table-page-search-wrapper {
padding: 0 20px;
}
.search-col {
/deep/ .ant-form-item-label {
width: 128px !important;
text-align: right !important;
padding-right: 16px !important;
}
/deep/ .ant-form-item-control-wrapper {
padding-right: 12px !important;
}
}
</style>
@@ -15,6 +15,32 @@
</div>
</a-form-model-item>
</div>
<!-- 搜索区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<!-- 有无意见 -->
<a-col :span="8" class="search-col">
<a-form-item :label="$t('workCenter.enStandardRevision.haveNoOpinion')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
:placeholder="$t('pleaseSelect')+$t('workCenter.enStandardRevision.haveNoOpinion')"
v-model="queryParam.haveNoOpinion">
<a-select-option value="">{{ $t('pleaseSelect') }}</a-select-option>
<a-select-option :value="HaveNoOpinion.HAVE.value">{{ $t('workCenter.enStandardRevision.have') }}</a-select-option>
<a-select-option :value="HaveNoOpinion.NO.value">{{ $t('workCenter.enStandardRevision.noHave') }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<div style="float: right;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search" style="margin-left: 8px">{{ $t('query') }}</a-button>
<a-button type="primary" ghost @click="searchReset" icon="reload" style="margin-left: 8px">{{ $t('reset') }}</a-button>
</div>
</a-row>
</a-form>
</div>
<!-- 操作区域 -->
<div v-if="!disabled" class="table-operator">
<!-- 新增 -->
@@ -52,11 +78,7 @@
import BaseInfoForm from './BaseInfoForm'
import JTable from '@/components/jero/JTable'
import CommentModal from './CommentModal'
import Vue from 'vue'
import { kkFilePreview } from '@/utils/kkFilePreview'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import { queryFileInfoByEditId } from '../../../../api/workCenter'
import { Base64 } from 'js-base64'
import { HaveNoOpinion } from '../../../../enums/commonEnums'
export default {
name: 'DepartLiaisonLeaderApproveBaseInfo',
@@ -70,7 +92,15 @@ export default {
},
data () {
return {
HaveNoOpinion,
loading: false,
labelCol: {
span: 12
},
wrapperCol: {
span: 12
},
queryParam: {},
/* 分页参数 */
ipagination: {
current: 1,
@@ -130,6 +160,7 @@ export default {
}
],
dataSource: [],
dataList: [], // 全部数据,防止查询后数据丢失
onEditFile: '' // 在线编辑的文件id
}
},
@@ -146,6 +177,7 @@ export default {
...item
}
})
this.dataList = JSON.parse(JSON.stringify(this.dataSource))
this.onEditFile = data.onEditFile
// 给表单赋值
this.$nextTick(() => {
@@ -156,7 +188,7 @@ export default {
getData () {
// 把数据抛出,在线编辑不知道要不要抛
const data = {}
data.advices = this.dataSource
data.advices = this.dataList
data.businessJson = JSON.stringify(this.$refs.baseInfoForm.getData())
// 在线编辑文件id
data.onEditFile = this.onEditFile
@@ -164,15 +196,32 @@ export default {
},
// 外层获取数据要过校验,返回false表示没有通过校验
getDataValidate () {
if (this.dataSource && this.dataSource.length > 0) {
if (this.dataList && this.dataList.length > 0) {
const data = {}
data.advices = this.dataSource
data.advices = this.dataList
return data
} else {
this.$message.warning(this.$t('addAtLeastOneRowOfData'))
return false
}
},
searchQuery () {
if (this.queryParam.haveNoOpinion === HaveNoOpinion.HAVE.value) {
this.dataSource = this.dataList.filter(item => {
return item.haveNoOpinion === HaveNoOpinion.HAVE.value
})
} else if (this.queryParam.haveNoOpinion === HaveNoOpinion.NO.value) {
this.dataSource = this.dataList.filter(item => {
return item.haveNoOpinion === HaveNoOpinion.NO.value
})
} else {
this.dataSource = JSON.parse(JSON.stringify(this.dataList))
}
},
searchReset () {
this.dataSource = JSON.parse(JSON.stringify(this.dataList))
this.queryParam = {}
},
handleTableChange (pagination) {
this.ipagination = pagination
},
@@ -198,6 +247,8 @@ export default {
onOk: () => {
const dataIndex = this.dataSource.findIndex(item => item.uid === uid)
this.dataSource.splice(dataIndex, 1)
const dataIndexTwo = this.dataList.findIndex(item => item.uid === uid)
this.dataList.splice(dataIndexTwo, 1)
}
})
},
@@ -210,13 +261,21 @@ export default {
this.$set(this.dataSource[dataIndex], 'clauseNum', value.clauseNum)
this.$set(this.dataSource[dataIndex], 'clauseName', value.clauseName)
this.$set(this.dataSource[dataIndex], 'editAdvice', value.editAdvice)
const dataIndexTwo = this.dataList.findIndex(item => item.uid === uid)
this.$set(this.dataList[dataIndexTwo], 'clauseNum', value.clauseNum)
this.$set(this.dataList[dataIndexTwo], 'clauseName', value.clauseName)
this.$set(this.dataList[dataIndexTwo], 'editAdvice', value.editAdvice)
// this.dataSource.splice(index, 1, value)
} else {
// 没有下标, 是新增
const uidGenerator = () => {
return '-' + parseInt(Math.random() * 10000 + 1, 10)
}
this.dataSource.push({ uid: uidGenerator(), ...value })
if (!this.queryParam.haveNoOpinion || this.queryParam.haveNoOpinion === HaveNoOpinion.HAVE.value) {
// 有意见或者没有筛选项的时候dataSource才增加
this.dataSource.push({ uid: uidGenerator(), ...value, haveNoOpinion: HaveNoOpinion.HAVE.value })
}
this.dataList.push({ uid: uidGenerator(), ...value, haveNoOpinion: HaveNoOpinion.HAVE.value })
}
},
// 在线编辑的查看
@@ -243,4 +302,18 @@ export default {
margin-right: 20px;
}
}
.table-page-search-wrapper {
padding: 0 20px;
}
.search-col {
/deep/ .ant-form-item-label {
width: 128px !important;
text-align: right !important;
padding-right: 16px !important;
}
/deep/ .ant-form-item-control-wrapper {
padding-right: 12px !important;
}
}
</style>
@@ -16,12 +16,42 @@
</div>
</a-form-model-item>
</div>
<!-- 搜索区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<!-- 有无意见 -->
<a-col :span="8" class="search-col">
<a-form-item :label="$t('workCenter.enStandardRevision.haveNoOpinion')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
:placeholder="$t('pleaseSelect')+$t('workCenter.enStandardRevision.haveNoOpinion')"
v-model="queryParam.haveNoOpinion">
<a-select-option value="">{{ $t('pleaseSelect') }}</a-select-option>
<a-select-option :value="HaveNoOpinion.HAVE.value">{{ $t('workCenter.enStandardRevision.have') }}</a-select-option>
<a-select-option :value="HaveNoOpinion.NO.value">{{ $t('workCenter.enStandardRevision.noHave') }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<div style="float: right;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search" style="margin-left: 8px">{{ $t('query') }}</a-button>
<a-button type="primary" ghost @click="searchReset" icon="reload" style="margin-left: 8px">{{ $t('reset') }}</a-button>
</div>
</a-row>
</a-form>
</div>
<!-- 操作区域 -->
<div v-if="!disabled" class="table-operator">
<!-- 新增 -->
<a-button icon="plus" type="primary" @click="handleAdd" :disabled="disabled">
{{ $t('newlyAdded') }}
</a-button>
<!-- 批量设置处理意见 -->
<a-button icon="setting" type="primary" ghost @click="batchSetHandleAdvice" :disabled="disabled">
{{ $t('workCenter.enStandardRevision.batchSetHandleAdvice') }}
</a-button>
</div>
<div>
@@ -34,6 +64,7 @@
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<template slot="customTitleHandlingSuggestion">
@@ -44,6 +75,8 @@
</j-table>
</div>
<comment-modal ref="commentModal" @ok="modalFormOk"></comment-modal>
<!-- 批量设置处理意见 -->
<batch-set-handle-advice-modal ref="batchSetHandleAdviceModal" @ok="batchSetHandleAdviceOk"/>
</div>
</template>
@@ -55,11 +88,12 @@ import { USER_INFO } from '@/store/mutation-types'
import Vue from 'vue'
import { onlineEditor } from '../../../../utils/onlyOfficeUtils'
import { getStandardEditFileByNo } from '../../../../api/workCenter'
import { ProjectType } from '../../../../enums/commonEnums'
import { ProjectType, HaveNoOpinion } from '../../../../enums/commonEnums'
import BatchSetHandleAdviceModal from './BatchSetHandleAdviceModal'
export default {
name: 'MainDrafterCollectBaseInfo',
components: { CommentModal, BaseInfoForm, JTable },
components: { CommentModal, BaseInfoForm, JTable, BatchSetHandleAdviceModal },
props: {
disabled: {
type: Boolean,
@@ -69,7 +103,17 @@ export default {
},
data () {
return {
HaveNoOpinion,
loading: false,
labelCol: {
span: 12
},
wrapperCol: {
span: 12
},
queryParam: {},
selectedRowKeys: [],
selectionRows: [],
/* 分页参数 */
ipagination: {
current: 1,
@@ -132,6 +176,10 @@ export default {
children: <a-select v-model={row.handleAdvice} disabled={this.disabled}
placeholder={this.$t('pleaseSelect')} class={'handle-suggest-select'}
options={this.handlingSuggestionOption}
onChange={ value => {
const listIndex = this.dataList.findIndex(item => item.uid === row.uid)
this.dataList[listIndex].handleAdvice = value
} }
/>,
attrs: {}
}
@@ -150,6 +198,8 @@ export default {
onChange={ e => {
e.target.value = e.target.value.trim()
row.reason = e.target.value.trim()
const listIndex = this.dataList.findIndex(item => item.uid === row.uid)
this.dataList[listIndex].reason = e.target.value.trim()
} }
/>,
attrs: {}
@@ -159,6 +209,7 @@ export default {
}
],
dataSource: [],
dataList: [], // 全部数据,防止查询后数据丢失
handlingSuggestionOption: [
{ value: '1', label: '采纳' },
{ value: '2', label: '部分采纳' },
@@ -182,6 +233,7 @@ export default {
handleAdvice: item.handleAdvice ? item.handleAdvice : undefined
}
})
this.dataList = JSON.parse(JSON.stringify(this.dataSource))
this.onEditFile = data.onEditFile
// 给表单赋值
this.$nextTick(() => {
@@ -192,7 +244,7 @@ export default {
getData () {
// 把数据抛出,在线编辑不知道要不要抛
const data = {}
data.advices = this.dataSource
data.advices = this.dataList
data.businessJson = JSON.stringify(this.$refs.baseInfoForm.getData())
data.onEditFile = this.onEditFile
return data
@@ -200,7 +252,7 @@ export default {
// 外层获取数据要过校验,返回false表示没有通过校验
getDataValidate () {
let hasErr = false
for (const item of this.dataSource) {
for (const item of this.dataList) {
// 处理意见必填,不采纳,部分采纳必填理由
if (!item.handleAdvice || ((item.handleAdvice === '2' || item.handleAdvice === '3') && !item.reason)) {
console.log(item.handleAdvice)
@@ -213,7 +265,7 @@ export default {
this.$message.warning(this.$t('pleaseCompleteTableInfo'))
data = false
} else {
data.advices = this.dataSource
data.advices = this.dataList
data.onEditFile = this.onEditFile
}
return data
@@ -227,6 +279,44 @@ export default {
}
})
},
searchQuery () {
if (this.queryParam.haveNoOpinion === HaveNoOpinion.HAVE.value) {
this.dataSource = this.dataList.filter(item => {
return item.haveNoOpinion === HaveNoOpinion.HAVE.value
})
} else if (this.queryParam.haveNoOpinion === HaveNoOpinion.NO.value) {
this.dataSource = this.dataList.filter(item => {
return item.haveNoOpinion === HaveNoOpinion.NO.value
})
} else {
this.dataSource = JSON.parse(JSON.stringify(this.dataList))
}
},
searchReset () {
this.dataSource = JSON.parse(JSON.stringify(this.dataList))
this.queryParam = {}
},
// 点击批量设置处理意见
batchSetHandleAdvice () {
if (this.selectedRowKeys.length <= 0) {
// 请选择要分发的数据
this.$message.warning(this.$t('selectAtLeastOne'))
return
}
this.$refs.batchSetHandleAdviceModal.show()
},
// 批量设置处理意见确认回调
batchSetHandleAdviceOk (value) {
for (const i of this.selectedRowKeys) {
const dataIndex = this.dataSource.findIndex(item => item.uid === i)
this.dataSource[dataIndex].handleAdvice = value
const dataIndexTwo = this.dataList.findIndex(item => item.uid === i)
this.dataList[dataIndexTwo].handleAdvice = value
}
this.dataSource = JSON.parse(JSON.stringify(this.dataSource))
this.dataList = JSON.parse(JSON.stringify(this.dataList))
this.selectedRowKeys = []
},
// 制修订类型改变
typeOfRevisionChange (val, originStandardNum) {
if (val === ProjectType.ENACT.value) {
@@ -238,6 +328,11 @@ export default {
handleTableChange (pagination) {
this.ipagination = pagination
},
// 表格选中
onSelectChange (selectedRowKeys, selectionRows) {
this.selectedRowKeys = selectedRowKeys
this.selectionRows = selectionRows
},
// 新增征求意见
handleAdd () {
// 不知道左侧要预览哪个文件
@@ -269,7 +364,14 @@ export default {
if (uid || uid === 0) {
// 有下标,说明是编辑
const dataIndex = this.dataSource.findIndex(item => item.uid === uid)
this.dataSource.splice(dataIndex, 1, value)
// 有下标,说明是编辑
this.$set(this.dataSource[dataIndex], 'clauseNum', value.clauseNum)
this.$set(this.dataSource[dataIndex], 'clauseName', value.clauseName)
this.$set(this.dataSource[dataIndex], 'editAdvice', value.editAdvice)
const dataIndexTwo = this.dataList.findIndex(item => item.uid === uid)
this.$set(this.dataList[dataIndexTwo], 'clauseNum', value.clauseNum)
this.$set(this.dataList[dataIndexTwo], 'clauseName', value.clauseName)
this.$set(this.dataList[dataIndexTwo], 'editAdvice', value.editAdvice)
} else {
// 没有下标, 是新增
const currentUser = Vue.ls.get(USER_INFO)
@@ -277,7 +379,11 @@ export default {
const uidGenerator = () => {
return '-' + parseInt(Math.random() * 10000 + 1, 10)
}
this.dataSource.push({ ...value, createUserId_dictText: currentUserId, uid: uidGenerator() })
if (!this.queryParam.haveNoOpinion || this.queryParam.haveNoOpinion === HaveNoOpinion.HAVE.value) {
// 有意见或者没有筛选项的时候dataSource才增加
this.dataSource.push({ ...value, createUserId_dictText: currentUserId, uid: uidGenerator(), haveNoOpinion: HaveNoOpinion.HAVE.value })
}
this.dataList.push({ ...value, createUserId_dictText: currentUserId, uid: uidGenerator(), haveNoOpinion: HaveNoOpinion.HAVE.value })
}
},
/**
@@ -322,4 +428,18 @@ export default {
.handle-suggest-select {
width: 100%;
}
.table-page-search-wrapper {
padding: 0 20px;
}
.search-col {
/deep/ .ant-form-item-label {
width: 128px !important;
text-align: right !important;
padding-right: 16px !important;
}
/deep/ .ant-form-item-control-wrapper {
padding-right: 12px !important;
}
}
</style>