[update] 企标详情页进入前判断权限,增加企标更改流程,把a-input去掉前后空格
This commit is contained in:
@@ -0,0 +1,417 @@
|
||||
<template>
|
||||
<a-form-model :model="formInline" class="form-add" :rules="rules" ref="ruleForm">
|
||||
<div class="collapsible-panel-form">
|
||||
<div class="form-flex-box collapsible-panel-form-content collapsible-content-no-head">
|
||||
<!-- 制修订类型 -->
|
||||
<div class="box-title-text form-flex-item">
|
||||
<div class="title-text">
|
||||
<span class="required">*</span>
|
||||
<span class="title-text-text" :title="$t('workCenter.enterpriseInitChangePlan.typeOfRevision')">
|
||||
{{ $t('workCenter.enterpriseInitChangePlan.typeOfRevision') }}
|
||||
</span>
|
||||
</div>
|
||||
<a-form-model-item class="item-model">
|
||||
<a-input class="box-input"
|
||||
:maxLength="50"
|
||||
defaultValue="更改"
|
||||
disabled
|
||||
@change="event => event.target.value = event.target.value.trim()"
|
||||
:placeholder="$t('pleaseEnter')+$t('workCenter.enterpriseInitChangePlan.typeOfRevision')" />
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
<!-- 企标编号 -->
|
||||
<div class="box-title-text form-flex-item">
|
||||
<div class="title-text">
|
||||
<span class="required">*</span>
|
||||
<span class="title-text-text" :title="$t('workCenter.enterpriseInitChangePlan.enterpriseStandardNum')">
|
||||
{{ $t('workCenter.enterpriseInitChangePlan.enterpriseStandardNum') }}
|
||||
</span>
|
||||
</div>
|
||||
<a-form-model-item class="item-model" prop="enStandardNo">
|
||||
<standard-selection :source="StandardSource.ENTERPRISE.value"
|
||||
:disabled="disabled"
|
||||
:disabledSourceSearch="true"
|
||||
type="radio"
|
||||
v-model="formInline.enStandardNo"
|
||||
@listChange="listChange" />
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
<!-- 企标名称 -->
|
||||
<div class="box-title-text form-flex-item">
|
||||
<div class="title-text">
|
||||
<span class="title-text-text" :title="$t('workCenter.enterpriseInitChangePlan.enterpriseStandardName')">
|
||||
{{ $t('workCenter.enterpriseInitChangePlan.enterpriseStandardName') }}
|
||||
</span>
|
||||
</div>
|
||||
<a-form-model-item class="item-model" prop="enStandardName">
|
||||
<a-input class="box-input"
|
||||
v-model="formInline.enStandardName"
|
||||
:maxLength="50"
|
||||
@change="event => event.target.value = event.target.value.trim()"
|
||||
:placeholder="$t('pleaseEnter')+$t('workCenter.enterpriseInitChangePlan.enterpriseStandardName')" />
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
<!-- 标准等级分类 -->
|
||||
<div class="box-title-text form-flex-item">
|
||||
<div class="title-text">
|
||||
<span class="required">*</span>
|
||||
<span class="title-text-text" :title="$t('workCenter.enterpriseInitChangePlan.standardGradeClassification')">
|
||||
{{ $t('workCenter.enterpriseInitChangePlan.standardGradeClassification') }}
|
||||
</span>
|
||||
</div>
|
||||
<a-form-model-item class="item-model" prop="enStandardClassification">
|
||||
<j-dict-select-tag class="box-input"
|
||||
:disabled="disabled"
|
||||
v-model="formInline.enStandardClassification"
|
||||
:placeholder="$t('pleaseSelect')+$t('workCenter.enterpriseInitChangePlan.standardGradeClassification')"
|
||||
:type="'select'"
|
||||
:triggerChange="false"
|
||||
dictCode="standard_grade_classify" />
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
<!-- 标准体系 -->
|
||||
<div class="box-title-text form-flex-item">
|
||||
<div class="title-text">
|
||||
<span class="required">*</span>
|
||||
<span class="title-text-text" :title="$t('workCenter.enterpriseInitChangePlan.standardSystem')">
|
||||
{{ $t('workCenter.enterpriseInitChangePlan.standardSystem') }}
|
||||
</span>
|
||||
</div>
|
||||
<a-form-model-item class="item-model" prop="enStandardSystem">
|
||||
<a-tree-select
|
||||
v-model="formInline.enStandardSystem"
|
||||
:getPopupContainer="triggerNode=> triggerNode.parentNode"
|
||||
style="width: 100%"
|
||||
:disabled="disabled"
|
||||
:tree-data="standardSystemOptions"
|
||||
tree-checkable
|
||||
treeCheckStrictly
|
||||
:placeholder="$t('pleaseSelect')+$t('workCenter.enterpriseInitChangePlan.standardSystem')" />
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
<!-- 标准英文名称 -->
|
||||
<div class="box-title-text form-flex-item">
|
||||
<div class="title-text">
|
||||
<span class="title-text-text" :title="$t('workCenter.enterpriseInitChangePlan.standardEnglishName')">
|
||||
{{ $t('workCenter.enterpriseInitChangePlan.standardEnglishName') }}
|
||||
</span>
|
||||
</div>
|
||||
<a-form-model-item class="item-model" prop="enStandardEnglishName">
|
||||
<a-input class="box-input"
|
||||
:disabled="disabled"
|
||||
v-model="formInline.enStandardEnglishName"
|
||||
:maxLength="50"
|
||||
@change="event => event.target.value = event.target.value.trim()"
|
||||
:placeholder="$t('pleaseEnter')+$t('workCenter.enterpriseInitChangePlan.standardEnglishName')" />
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
<!-- 发布日期 -->
|
||||
<div class="box-title-text form-flex-item">
|
||||
<div class="title-text title-text-long">
|
||||
<span class="required">*</span>
|
||||
<span class="title-text-text" :title="$t('workCenter.enStandardChange.releaseDate')">
|
||||
{{ $t('workCenter.enStandardChange.releaseDate') }}
|
||||
</span>
|
||||
</div>
|
||||
<a-form-model-item class="item-model" prop="releaseDate">
|
||||
<a-date-picker
|
||||
v-model="formInline.releaseDate"
|
||||
:showTime="false"
|
||||
:disabled="disabled"
|
||||
value-format="YYYY-MM-DD">
|
||||
</a-date-picker>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
<!-- 实施日期 -->
|
||||
<div class="box-title-text form-flex-item">
|
||||
<div class="title-text title-text-long">
|
||||
<span class="required">*</span>
|
||||
<span class="title-text-text" :title="$t('workCenter.enStandardChange.materialDate')">
|
||||
{{ $t('workCenter.enStandardChange.materialDate') }}
|
||||
</span>
|
||||
</div>
|
||||
<a-form-model-item class="item-model" prop="materialDate">
|
||||
<a-date-picker
|
||||
v-model="formInline.materialDate"
|
||||
:showTime="false"
|
||||
:disabled="disabled"
|
||||
value-format="YYYY-MM-DD">
|
||||
</a-date-picker>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
<!-- 是否试行 -->
|
||||
<div class="box-title-text form-flex-item">
|
||||
<div class="title-text">
|
||||
<span class="title-text-text" :title="$t('workCenter.enStandardChange.isTry')">
|
||||
{{ $t('workCenter.enStandardChange.isTry') }}
|
||||
</span>
|
||||
</div>
|
||||
<a-form-model-item class="item-model" prop="isTry">
|
||||
<j-dict-select-tag class="box-input"
|
||||
:disabled="disabled"
|
||||
v-model="formInline.isTry"
|
||||
:placeholder="$t('pleaseSelect')+$t('workCenter.enStandardChange.isTry')"
|
||||
:type="'select'"
|
||||
:triggerChange="false"
|
||||
dictCode="is_trial" />
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
<!-- 试行周期 -->
|
||||
<div class="box-title-text form-flex-item">
|
||||
<div class="title-text">
|
||||
<span class="title-text-text" :title="$t('workCenter.enStandardChange.trialPeriod')">
|
||||
{{ $t('workCenter.enStandardChange.trialPeriod') }}
|
||||
</span>
|
||||
</div>
|
||||
<a-form-model-item class="item-model" prop="trialPeriod">
|
||||
<j-dict-select-tag class="box-input"
|
||||
:disabled="disabled"
|
||||
v-model="formInline.trialPeriod"
|
||||
:placeholder="$t('pleaseSelect')+$t('workCenter.enStandardChange.trialPeriod')"
|
||||
:type="'select'"
|
||||
:triggerChange="false"
|
||||
dictCode="trial_period" />
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
<!-- 零部件名称 -->
|
||||
<div class="box-title-text form-flex-item">
|
||||
<div class="title-text">
|
||||
<span class="required">*</span>
|
||||
<span class="title-text-text" :title="$t('workCenter.enterpriseInitChangePlan.partName')">
|
||||
{{ $t('workCenter.enterpriseInitChangePlan.partName') }}
|
||||
</span>
|
||||
</div>
|
||||
<a-form-model-item class="item-model" prop="componentName">
|
||||
<a-tree-select v-model="formInline.componentName"
|
||||
:disabled="disabled"
|
||||
:getPopupContainer="triggerNode=> triggerNode.parentNode"
|
||||
style="width: 100%"
|
||||
:tree-data="partNameOptions"
|
||||
:label-in-value="false"
|
||||
:placeholder="$t('pleaseSelect')+$t('workCenter.enterpriseInitChangePlan.partName')" />
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
<!-- 主起草人 -->
|
||||
<div class="box-title-text form-flex-item">
|
||||
<div class="title-text">
|
||||
<span class="title-text-text" :title="$t('workCenter.enterpriseInitChangePlan.principalDrafter')">
|
||||
{{ $t('workCenter.enterpriseInitChangePlan.principalDrafter') }}
|
||||
</span>
|
||||
</div>
|
||||
<a-form-model-item class="item-model" prop="mainDraftingUser">
|
||||
<user-selection :placeholder="$t('pleaseSelect')+$t('workCenter.enterpriseInitChangePlan.principalDrafter')"
|
||||
v-model="formInline.mainDraftingUser"
|
||||
:disabled="disabled"
|
||||
filedName="mainDraftingUser"
|
||||
@nameChange="userSelectNameChange"
|
||||
:nameStr="formInline.mainDraftingUser_dictText"
|
||||
type="radio" />
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
<!-- 主起草单位 -->
|
||||
<div class="box-title-text form-flex-item">
|
||||
<div class="title-text">
|
||||
<span class="title-text-text" :title="$t('workCenter.enterpriseInitChangePlan.mainDraftUnit')">
|
||||
{{ $t('workCenter.enterpriseInitChangePlan.mainDraftUnit') }}
|
||||
</span>
|
||||
</div>
|
||||
<a-form-model-item class="item-model" prop="mainDraftingUnit">
|
||||
<j-select-depart v-model="formInline.mainDraftingUnit"
|
||||
:disabled="disabled"
|
||||
:backDepart="true" />
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
<!-- 标准适用范围 -->
|
||||
<div class="box-title-text form-flex-item">
|
||||
<div class="title-text title-text-long">
|
||||
<span class="title-text-text" :title="$t('workCenter.enStandardChange.scopeOfApplication')">
|
||||
{{ $t('workCenter.enStandardChange.scopeOfApplication') }}
|
||||
</span>
|
||||
</div>
|
||||
<a-form-model-item class="item-model" prop="scopeOfApplication">
|
||||
<a-textarea :placeholder="$t('pleaseEnter')+$t('workCenter.enStandardChange.scopeOfApplication')"
|
||||
:maxLength="500"
|
||||
:disabled="disabled"
|
||||
v-model="formInline.scopeOfApplication" :rows="4" />
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
<!-- 代替标准号 -->
|
||||
<div class="box-title-text form-flex-item">
|
||||
<div class="title-text">
|
||||
<span class="required">*</span>
|
||||
<span class="title-text-text" :title="$t('workCenter.enStandardChange.substituteStandardNumber')">
|
||||
{{ $t('workCenter.enStandardChange.substituteStandardNumber') }}
|
||||
</span>
|
||||
</div>
|
||||
<a-form-model-item class="item-model" prop="substitute_standard_number">
|
||||
<standard-selection :source="StandardSource.ENTERPRISE.value"
|
||||
:disabled="disabled"
|
||||
:disabledSourceSearch="true"
|
||||
type="radio"
|
||||
v-model="formInline.substitute_standard_number" />
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
<!-- 引用标准 -->
|
||||
<div class="box-title-text form-flex-item">
|
||||
<div class="title-text">
|
||||
<span class="required">*</span>
|
||||
<span class="title-text-text" :title="$t('workCenter.enStandardChange.quotedStandard')">
|
||||
{{ $t('workCenter.enStandardChange.quotedStandard') }}
|
||||
</span>
|
||||
</div>
|
||||
<a-form-model-item class="item-model" prop="quoted_standard">
|
||||
<standard-selection :source="StandardSource.ENTERPRISE.value"
|
||||
:disabled="disabled"
|
||||
:disabledSourceSearch="true"
|
||||
type="radio"
|
||||
v-model="formInline.quoted_standard" />
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
<!-- 关联文件 -->
|
||||
<div class="box-title-text form-flex-item">
|
||||
<div class="title-text title-text-long">
|
||||
<span class="title-text-text" :title="$t('workCenter.enStandardChange.relevantFile')">
|
||||
{{ $t('workCenter.enStandardChange.relevantFile') }}
|
||||
</span>
|
||||
</div>
|
||||
<a-form-model-item class="item-model" prop="associated_file">
|
||||
<a-button type="primary" class="button-text" style="width: 200px" @click="clickButtonToUpload('associated_file')">
|
||||
{{
|
||||
(formInline.associated_file === 'null' || formInline.associated_file === ''
|
||||
|| formInline.associated_file === null || formInline.associated_file === undefined)
|
||||
? $t('uploadFile.clickUpload')
|
||||
: $t('uploadFile.viewUploadedFiles')
|
||||
}}
|
||||
</a-button>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
<!-- 采标程度 -->
|
||||
<div class="box-title-text form-flex-item">
|
||||
<div class="title-text">
|
||||
<span class="title-text-text" :title="$t('workCenter.enStandardChange.degreeOfBidAcquisition')">
|
||||
{{ $t('workCenter.enStandardChange.degreeOfBidAcquisition') }}
|
||||
</span>
|
||||
</div>
|
||||
<a-form-model-item class="item-model" prop="acquisition_degree">
|
||||
<j-dict-select-tag class="box-input"
|
||||
:disabled="disabled"
|
||||
v-model="formInline.acquisition_degree"
|
||||
:placeholder="$t('pleaseSelect')+$t('workCenter.enStandardChange.degreeOfBidAcquisition')"
|
||||
:type="'select'"
|
||||
:triggerChange="false"
|
||||
dictCode="degree_bid_acquisition" />
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
<!-- 采用国际标准号 -->
|
||||
<div class="box-title-text form-flex-item">
|
||||
<div class="title-text">
|
||||
<span class="required">*</span>
|
||||
<span class="title-text-text" :title="$t('workCenter.enStandardChange.adoptInternationalStandardNumber')">
|
||||
{{ $t('workCenter.enStandardChange.adoptInternationalStandardNumber') }}
|
||||
</span>
|
||||
</div>
|
||||
<a-form-model-item class="item-model" prop="international_standard_num">
|
||||
<a-input class="box-input"
|
||||
v-model="formInline.international_standard_num"
|
||||
:disabled="disabled"
|
||||
:maxLength="50"
|
||||
@change="event => event.target.value = event.target.value.trim()"
|
||||
:placeholder="$t('pleaseEnter')+$t('workCenter.enStandardChange.adoptInternationalStandardNumber')" />
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 上传文件弹框 -->
|
||||
<upload-file ref="uploadFile" @change="uploadFileChange" :return-url="false" :disabled="disabled"></upload-file>
|
||||
</a-form-model>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { StandardSource } from '@/enums/commonEnums'
|
||||
import { getTreeList } from '@/api/enterpriseStandardLibraryApi'
|
||||
import { getFormDictTreeList } from '@/api/api'
|
||||
import StandardSelection from '@/components/selection/StandardSelection'
|
||||
import UserSelection from '@/components/selection/UserSelection'
|
||||
|
||||
export default {
|
||||
name: 'BaseInfoForm',
|
||||
components: {
|
||||
StandardSelection,
|
||||
UserSelection
|
||||
},
|
||||
props: {
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
StandardSource,
|
||||
standardSystemOptions: [], // 标准体系下拉框数据
|
||||
partNameOptions: [], // 零部件名称下拉框数据
|
||||
formInline: {}
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
// 获取标准体系下拉框数据
|
||||
this.initStandardSystemOptions()
|
||||
// 获取零部件名称下拉框数据
|
||||
this.initPartNameOptions()
|
||||
},
|
||||
methods: {
|
||||
// 获取标准体系下拉框数据
|
||||
initStandardSystemOptions () {
|
||||
getTreeList({ option: 1 }).then(res => {
|
||||
if (res.success) {
|
||||
this.standardSystemOptions = res.result
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取零部件名称下拉框数据
|
||||
initPartNameOptions () {
|
||||
getFormDictTreeList({ dictId: '1696821512600637441' }).then(res => {
|
||||
if (res.success) {
|
||||
this.partNameOptions = res.result
|
||||
}
|
||||
})
|
||||
},
|
||||
// 选完企标编号了,需要回显内容
|
||||
listChange (value) {
|
||||
console.log(value)
|
||||
},
|
||||
// 选择用户得到用户名
|
||||
userSelectNameChange (value, fieldName) {
|
||||
this.formInline[fieldName + '_dictText'] = value
|
||||
},
|
||||
// 点击文件上传
|
||||
clickButtonToUpload (fieldName) {
|
||||
this.$refs.uploadFile.open(this.formInline[fieldName])
|
||||
this.uploadName = fieldName
|
||||
},
|
||||
// 文件上传改变后的回调
|
||||
uploadFileChange (data) {
|
||||
const attIdList = []
|
||||
if (data && data.length > 0) {
|
||||
data.map(item => {
|
||||
attIdList.push(item.id)
|
||||
})
|
||||
}
|
||||
/** 赋值给当前对应的表单文件 */
|
||||
this.formInline[this.uploadName] = attIdList.join(',')
|
||||
this.formInline = { ...this.formInline }
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
@import '~@assets/less/common.less';
|
||||
|
||||
.collapsible-content-no-head {
|
||||
border-top: 1px solid #E5E6EB;
|
||||
border-radius: 8px 8px 8px 8px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,162 @@
|
||||
<template>
|
||||
<div>
|
||||
<base-info-form :disabled="disabled"></base-info-form>
|
||||
<!-- 标准文本 -->
|
||||
<div class="box-title-text form-flex-item">
|
||||
<div class="title-text">
|
||||
<span class="title-text-text" :title="$t('workCenter.enStandardRevision.standardText')">
|
||||
{{ $t('workCenter.enStandardRevision.standardText') }}
|
||||
</span>
|
||||
</div>
|
||||
<a-form-model-item class="item-model">
|
||||
<div class="online-edit-wrapper">
|
||||
<!-- todo: 还不确定这里展示的是什么 -->
|
||||
<p>企业标准</p>
|
||||
<a-button type="primary">{{ $t('workCenter.enStandardRevision.onLineEditing') }}</a-button>
|
||||
</div>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
|
||||
<!-- 操作区域 -->
|
||||
<div v-if="!disabled" class="table-operator">
|
||||
<!-- 新增 -->
|
||||
<a-button icon="plus" type="primary" @click="handleAdd" :disabled="disabled">
|
||||
{{ $t('newlyAdded') }}
|
||||
</a-button>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<j-table
|
||||
:can-drag="true"
|
||||
:scroll="{x: '100%'}"
|
||||
ref="table"
|
||||
rowKey="enterpriseStandardPlanId"
|
||||
:columns="columns"
|
||||
:dataSource="dataSource"
|
||||
:pagination="false"
|
||||
:loading="loading">
|
||||
|
||||
<!-- 企标编号/企标名称 -->
|
||||
<template v-slot:toDetail="{text, record}">
|
||||
<a-tooltip overlay-class-name="tooltip-style">
|
||||
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
|
||||
<a v-if="text" class="link-a" @click="handleGoDetail(record)">{{ text }}</a>
|
||||
<div v-else class="table-text">{{ global.emptyLine }}</div>
|
||||
</a-tooltip>
|
||||
</template>
|
||||
|
||||
<!-- 操作栏 -->
|
||||
<div slot="action" slot-scope="{record, index}" class="action-span-cell">
|
||||
<a @click="handleEdit(record, index)" class="table-ope-btn" :disabled="disabled">{{ $t('edit') }}</a>
|
||||
<a-divider type="vertical" />
|
||||
<a @click="handleDelete(record.id, index)" class="table-ope-btn" :disabled="disabled">{{ $t('delete') }}</a>
|
||||
</div>
|
||||
|
||||
</j-table>
|
||||
</div>
|
||||
|
||||
<comment-modal ref="commentModal" @ok="modalFormOk"></comment-modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import BaseInfoForm from './BaseInfoForm'
|
||||
import CommentModal from '../../enterpriseStandardRevision/modules/CommentModal'
|
||||
|
||||
export default {
|
||||
name: 'MainDrafterInitBaseInfo',
|
||||
components: { BaseInfoForm, CommentModal },
|
||||
props: {
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('serialNumber'),
|
||||
dataIndex: '',
|
||||
key: 'rowIndex',
|
||||
align: 'center',
|
||||
width: 80,
|
||||
customRender: function (t, r, index) {
|
||||
return parseInt(index) + 1
|
||||
}
|
||||
},
|
||||
{ // 条款号
|
||||
title: this.$t('workCenter.enStandardRevision.clauseNumber'),
|
||||
align: 'center',
|
||||
width: 180,
|
||||
dataIndex: 'clauseNumber',
|
||||
scopedSlots: { customRender: 'text' }
|
||||
},
|
||||
{ // 条款名称
|
||||
title: this.$t('workCenter.enStandardRevision.clauseName'),
|
||||
align: 'center',
|
||||
width: 180,
|
||||
dataIndex: 'clauseName',
|
||||
scopedSlots: { customRender: 'text' }
|
||||
},
|
||||
{ // 修改意见内容
|
||||
title: this.$t('workCenter.enStandardRevision.contentOfRevisedOpinion'),
|
||||
children: [
|
||||
{ // 修改前
|
||||
title: this.$t('workCenter.enStandardRevision.clauseName'),
|
||||
align: 'center',
|
||||
width: 180,
|
||||
dataIndex: 'clauseName',
|
||||
scopedSlots: { customRender: 'text' }
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
title: this.$t('operation'),
|
||||
scopedSlots: { customRender: 'action' },
|
||||
align: 'center',
|
||||
width: 200
|
||||
}
|
||||
],
|
||||
dataSource: [],
|
||||
loading: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 新增征求意见
|
||||
handleAdd () {
|
||||
// 不知道左侧要预览哪个文件
|
||||
const file = ''
|
||||
this.$refs.commentModal.title = this.$t('newlyAdded')
|
||||
this.$refs.commentModal.add(file)
|
||||
},
|
||||
// 征求意见的编辑
|
||||
handleEdit (record, index) {
|
||||
// 不知道左侧要预览哪个文件
|
||||
const file = ''
|
||||
this.$refs.commentModal.title = this.$t('edit')
|
||||
this.$refs.commentModal.edit(file, record, index)
|
||||
},
|
||||
// 征求意见的删除
|
||||
handleDelete (index) {
|
||||
this.dataSource.splice(index, 1)
|
||||
},
|
||||
// 征求意见新增编辑完成
|
||||
modalFormOk (value, index) {
|
||||
console.log(value, index)
|
||||
if (index || index === 0) {
|
||||
// 有下标,说明是编辑
|
||||
this.dataSource.splice(index, 1, value)
|
||||
} else {
|
||||
// 没有下标, 是新增
|
||||
this.dataSource.push(value)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user