[update] 企标新增和详情页修改

This commit is contained in:
lideqin
2023-09-19 15:11:37 +08:00
parent ab4469aed8
commit 74301d1419
12 changed files with 934 additions and 65 deletions
@@ -17,6 +17,32 @@
:get-form-func="getFormFunc"
:get-document-info-func="getDocumentInfoFunc"
@submitFormData="submitFormData" />
<div class="header-text-btn">
<p class="header-text">稽查内容</p>
<a-button icon="plus" type="primary" @click="handleAdd">{{ $t('newlyAdded') }}</a-button>
</div>
<div>
<a-table
:scroll="{x: 500}"
:columns="columns"
:dataSource="dataSource"
:pagination="false"
rowKey="id">
<template slot="text" slot-scope="text">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
<div class="table-text">{{ text || text === 0 ? text : global.emptyLine }}</div>
</a-tooltip>
</template>
<!-- 操作栏 -->
<template slot="action" slot-scope="text, record, index" class="action-span-cell">
<a @click="handleEdit(record, index)" class="table-ope-btn">{{ $t('edit') }}</a>
<a @click="handleDelete(index)" class="table-ope-btn" style="margin-left: 8px">{{ $t('delete') }}</a>
</template>
</a-table>
</div>
</div>
<div class="custom-drawer-style-bottom-btn">
<a-button @click="handleOk" type="primary" style="margin-bottom: 0;">
@@ -25,6 +51,7 @@
<a-button @click="handleCancel" style="margin-bottom: 0;">{{ $t('close') }}</a-button>
</div>
</a-spin>
<check-content-modal ref="checkContentModal" @ok="checkContentOk"></check-content-modal>
</a-drawer>
</template>
@@ -33,10 +60,11 @@ import '@assets/less/common.less'
import AddForm from '@/components/customField/AddForm'
import { getEnterpriseStandardAddForm, getEnterpriseStandardInfoById } from '@/api/enterpriseStandardLibraryApi'
import { postAction } from '@/api/manage'
import CheckContentModal from './CheckContentModal'
export default {
name: 'EnterpriseStandardModal',
components: { AddForm },
components: { CheckContentModal, AddForm },
data () {
return {
visible: false,
@@ -47,6 +75,29 @@ export default {
confirmLoading: false,
getFormFunc: getEnterpriseStandardAddForm,
getDocumentInfoFunc: getEnterpriseStandardInfoById,
columns: [
{
title: this.$t('enterpriseStandardLibrary.standard.subjectToClause'),
align: 'center',
width: 180,
dataIndex: 'subjectToClause',
scopedSlots: { customRender: 'text' }
},
{
title: this.$t('enterpriseStandardLibrary.standard.standardContentOrRequirements'),
align: 'center',
width: 180,
dataIndex: 'standardContentOrRequirements',
scopedSlots: { customRender: 'text' }
},
{
title: this.$t('operation'),
scopedSlots: { customRender: 'action' },
align: 'center',
width: 200
}
],
dataSource: [],
url: {
add: '/laws/standard/enterprise/commonAdd',
edit: '/laws/standard/enterprise/commonEdit'
@@ -66,6 +117,32 @@ export default {
this.$refs.addForm.edit(record)
})
},
// 稽查内容的添加
handleAdd () {
this.$refs.checkContentModal.title = this.$t('newlyAdded')
this.$refs.checkContentModal.add()
},
// 稽查内容的编辑
handleEdit (record, index) {
console.log(record, index)
this.$refs.checkContentModal.title = this.$t('edit')
this.$refs.checkContentModal.edit(record, index)
},
// 稽查内容的删除
handleDelete (index) {
this.dataSource.splice(index, 1)
},
// 稽查内容新增编辑完成
checkContentOk (value, index) {
console.log(value, index)
if (index || index === 0) {
// 有下标,说明是编辑
this.dataSource.splice(index, 1, value)
} else {
// 没有下标, 是新增
this.dataSource.push(value)
}
},
handleOk () {
this.$refs.addForm.submit()
},
@@ -104,6 +181,14 @@ export default {
}
</script>
<style scoped>
<style scoped lang="less">
.header-text-btn {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 16px;
.header-text {
margin-bottom: 0;
}
}
</style>