361 lines
11 KiB
Vue
361 lines
11 KiB
Vue
<template>
|
|
<!--政策入库手动查找代替文件-->
|
|
<div>
|
|
<el-form-item
|
|
:label="label"
|
|
:prop="prop"
|
|
:label-width="labelWidth"
|
|
class="add-form-item form-item-disabled"
|
|
>
|
|
<el-input
|
|
:value="value"
|
|
:placeholder="placeholder"
|
|
:disabled="disabled"
|
|
clearable
|
|
@input="handleChange"
|
|
></el-input>
|
|
<el-button
|
|
type="primary"
|
|
class="common-button-primary"
|
|
size="mini"
|
|
style="position:absolute;top: 10px;right: 0;"
|
|
:disabled="disabled"
|
|
@click="selectLaws"
|
|
>手动查找</el-button>
|
|
</el-form-item>
|
|
<el-dialog
|
|
:title="label"
|
|
:visible.sync="replaceLawsNumModel"
|
|
width="875px"
|
|
:close-on-click-modal="false"
|
|
@close="replaceLawsNumModelCancel"
|
|
:append-to-body="true"
|
|
>
|
|
<div class="search-area">
|
|
<div class="left">
|
|
<el-form :modal="replaceLawsNumForm" :inline="true" class="label-input-form" @keyup.enter.native="getReplaceLawsNumRowSearch">
|
|
<!-- <el-form-item label="数据来源" class="search-item">-->
|
|
<!-- <el-select v-model="replaceLawsNumForm.dataSource" filterable>-->
|
|
<!-- <el-option-->
|
|
<!-- v-for="item in dataSourceOptions"-->
|
|
<!-- :key="item.value"-->
|
|
<!-- :value="item.value"-->
|
|
<!-- :label="item.label"-->
|
|
<!-- >-->
|
|
<!-- </el-option>-->
|
|
<!-- </el-select>-->
|
|
<!-- </el-form-item>-->
|
|
<el-form-item label="政策文号" class="search-item input-width">
|
|
<el-input
|
|
v-model="replaceLawsNumForm.lawsNo"
|
|
placeholder="根据政策文号查找"
|
|
clearable
|
|
:maxlength="100"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="政策名称" class="search-item input-width">
|
|
<el-input
|
|
v-model="replaceLawsNumForm.lawsName"
|
|
placeholder="根据政策名称查找"
|
|
clearable
|
|
:maxlength="100"></el-input>
|
|
</el-form-item>
|
|
<el-form-item class="search-item btn-box">
|
|
<el-button
|
|
type="primary"
|
|
class="common-button-primary"
|
|
size="small"
|
|
@click="getReplaceLawsNumRowSearch">
|
|
查询
|
|
</el-button>
|
|
</el-form-item>
|
|
<el-form-item class="search-item btn-box">
|
|
<el-button
|
|
class="common-button-default"
|
|
size="small"
|
|
@click="getResetLawsNumRow">清空
|
|
</el-button>
|
|
</el-form-item>
|
|
</el-form>
|
|
</div>
|
|
</div>
|
|
<el-table
|
|
ref="selections"
|
|
:data="replaceLawsNumRow"
|
|
tooltip-effect="dark"
|
|
style="width: 100%;overflow-y: auto;overflow-x: hidden;"
|
|
border
|
|
:height="300"
|
|
:header-cell-style="{background: '#e8e8e8', color: '#333333', fontSize: '16px',
|
|
fontWeight: 'bold', height: '48px'}"
|
|
@selection-change="selectReplaceStandNumRowChange">
|
|
<el-table-column
|
|
type="selection"
|
|
width="55"
|
|
align="center">
|
|
</el-table-column>
|
|
<el-table-column
|
|
type="index"
|
|
width="55"
|
|
label="序号"
|
|
align="center">
|
|
<template slot-scope="{scope, column, $index}">
|
|
{{ ($index + 1) + (replaceLawsNumForm.page - 1) * replaceLawsNumForm.pageSize }}
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column
|
|
label="政策文号"
|
|
min-width="130">
|
|
<template slot-scope="scope">
|
|
<span>
|
|
<a v-if="scope.row.lawsNo" class="table-jump" @click="handlePreview(scope.row)">{{ scope.row.lawsNo }}</a>
|
|
</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column
|
|
prop="lawsName"
|
|
label="政策名称"
|
|
min-width="130">
|
|
</el-table-column>
|
|
<el-table-column
|
|
prop="lawsEnName"
|
|
label="英文名称"
|
|
min-width="130">
|
|
</el-table-column>
|
|
<el-table-column
|
|
prop="issueTime"
|
|
label="发文日期"
|
|
width="130">
|
|
<template slot-scope="scope">{{ $moment(scope.row.issueTime).format('YYYY-MM-DD') }}</template>
|
|
</el-table-column>
|
|
<el-table-column
|
|
prop="standStatusShow"
|
|
label="标准状态"
|
|
width="130">
|
|
</el-table-column>
|
|
</el-table>
|
|
<loading :loading="replaceLoading">{{$t('m.dataAcquisition')}}</loading>
|
|
<!--分页-->
|
|
<pagination
|
|
style="position: relative;"
|
|
:auto-size="true"
|
|
:page-size="replaceLawsNumForm.pageSize"
|
|
:page="replacePage"
|
|
:total="replaceTotal"
|
|
@pageChange="pageChangeReplace"
|
|
@pageSizeChange="pageSizeChangeReplace"></pagination>
|
|
<div slot="footer" class="demo-drawer-footer">
|
|
<el-button class="common-button-default" round icon="el-icon-close" @click="replaceLawsNumModel = false">取消</el-button>
|
|
<el-button type="primary" round class="common-button-primary" icon="el-icon-check" @click="replaceLawsNumModelBt">提交</el-button>
|
|
</div>
|
|
</el-dialog>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
name: "InputForStandardsForLaws",
|
|
props: {
|
|
label: {
|
|
type: String,
|
|
required: true
|
|
},
|
|
prop: {
|
|
type: String,
|
|
},
|
|
value: {
|
|
required: true
|
|
},
|
|
disabled: {
|
|
type: Boolean,
|
|
default: false
|
|
},
|
|
// 栅格比例
|
|
span: {
|
|
type: Number,
|
|
default: 24
|
|
},
|
|
// label宽度
|
|
labelWidth: {
|
|
type: String,
|
|
}
|
|
},
|
|
data () {
|
|
return {
|
|
replaceLawsNumModel: false,
|
|
// 代替标准号
|
|
replaceLawsNumForm: {
|
|
// dataSource: 'BUSINESS', // 数据来源
|
|
lawsNo: '',
|
|
lawsName: '', // 政策名称
|
|
page: 1,
|
|
pageSize: 20,
|
|
total: 0,
|
|
},
|
|
replaceLawsNumRow: [], // 代替政策号 数组内容
|
|
replaceTotal: 0,
|
|
selectedListRep: [],
|
|
replaceLoading: true,
|
|
replacePage: 1,
|
|
// 数据搜索 数据来源list
|
|
dataSourceOptions: [
|
|
{value: 'INLAND_STAND', label: '国内标准法规'},
|
|
{value: 'FOREIGN_STAND', label: '海外标准法规'},
|
|
{value: 'BUSINESS', label: '企业标准 '},
|
|
{value: 'LAWS_STAND', label: '国内外政策'}
|
|
],
|
|
dataSource: 'LAWS_STAND'
|
|
}
|
|
},
|
|
computed: {
|
|
placeholder () {
|
|
return `请输入${this.label}`
|
|
},
|
|
showMessage () {
|
|
return `${this.label}不能为空`
|
|
},
|
|
},
|
|
methods: {
|
|
getReplaceLawsNumRowSearch () {
|
|
this.replaceLawsNumForm.page = 1
|
|
this.replacePage = 1
|
|
this.getReplaceLawsNumRow()
|
|
},
|
|
handleChange (event) {
|
|
// const value = event.target.value
|
|
const value = event
|
|
this.$emit('input', value)
|
|
},
|
|
selectLaws () {
|
|
this.replaceLawsNumModel = true
|
|
this.getReplaceLawsNumRow()
|
|
},
|
|
// 代替政策号 请求数据
|
|
getReplaceLawsNumRow () {
|
|
const formData = {
|
|
...this.replaceLawsNumForm
|
|
}
|
|
let url = 'lawss/sarLawsInfo/page'
|
|
this.$http.get(url, formData, {
|
|
_this: this,
|
|
loading: 'replaceLoading'
|
|
}, res => {
|
|
this.replaceLawsNumRow = res.data.list
|
|
this.replaceTotal = res.data.count
|
|
if (this.selectedListRep.length !== 0) {
|
|
this.selectedListRep.map((list) => {
|
|
this.replaceLawsNumRow.map((item) => {
|
|
if (list.id === item.id) {
|
|
item._checked = true
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}, e => {
|
|
})
|
|
},
|
|
// 代替政策编号-取消
|
|
replaceLawsNumModelCancel () {
|
|
this.$refs.selections.clearSelection()
|
|
},
|
|
// 代替政策号 table选择事件
|
|
selectReplaceStandNumRowChange (row) {
|
|
this.selectedListRep = row
|
|
},
|
|
// 代替政策分页
|
|
pageChangeReplace (page) {
|
|
this.replacePage = page
|
|
this.replaceLawsNumForm.page = page
|
|
this.getReplaceLawsNumRow()
|
|
},
|
|
pageSizeChangeReplace (pageSize) {
|
|
// this.replaceRows = pageSize
|
|
this.replaceLawsNumForm.pageSize = pageSize
|
|
this.getReplaceLawsNumRow()
|
|
},
|
|
// 代替政策编号确定
|
|
replaceLawsNumModelBt () {
|
|
let textArr = []
|
|
|
|
if (this.selectedListRep.length === 0) {
|
|
return this.$message({
|
|
message: '请先选择数据',
|
|
type: 'warning'
|
|
})
|
|
}
|
|
if (this.selectedListRep.length + textArr.length > 20) {
|
|
return this.$message({
|
|
message: '代替文件号最多选择20项',
|
|
type: 'warning'
|
|
})
|
|
}
|
|
this.selectedListRep.map((item) => {
|
|
let texts = ''
|
|
// 判断数据是国内外法规标准还是企业标准
|
|
if (this.dataSource === 'LAWS_STAND') {
|
|
texts = item.lawsNo
|
|
}
|
|
textArr.push(texts)
|
|
textArr = [...new Set(textArr)]
|
|
this.replaceLawsNumModel = false
|
|
})
|
|
this.$emit('input', textArr.join(','))
|
|
this.$refs.selections.clearSelection()
|
|
},
|
|
// 点击查看
|
|
handlePreview (item) {
|
|
let name = ''
|
|
let pageType = ''
|
|
switch (this.dataSource) {
|
|
case 'INLAND_STAND':
|
|
name = 'OtherStandardDetails'
|
|
pageType = 'INLAND_STAND'
|
|
break
|
|
case 'FOREIGN_STAND':
|
|
name = 'OtherStandardDetails'
|
|
pageType = 'FOREIGN_STAND'
|
|
break
|
|
case 'BUSINESS':
|
|
name = 'OtherBussStandardDetails'
|
|
pageType = 'BUSINESS_STAND'
|
|
break
|
|
case 'LAWS_STAND':
|
|
name = 'OtherLawsStandDetails'
|
|
pageType = 'LAWS_STAND'
|
|
break
|
|
}
|
|
let routeUrl = this.$router.resolve({
|
|
name: name,
|
|
params: {
|
|
id: item.id,
|
|
pageType: pageType
|
|
}
|
|
})
|
|
window.open(routeUrl.href, '_blank')
|
|
|
|
},
|
|
getResetLawsNumRow () {
|
|
this.replaceLawsNumForm = {
|
|
lawsNo: '',
|
|
lawsName: '', // 政策名称
|
|
page: 1,
|
|
pageSize: this.$store.getters.userInfo.configContent,
|
|
total: 0,
|
|
}
|
|
this.getReplaceLawsNumRow()
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="less">
|
|
/deep/.el-dialog__body {
|
|
padding: 0 20px 0;
|
|
}
|
|
/deep/.el-dialog__footer {
|
|
padding: 0 20px 20px;
|
|
}
|
|
/deep/.input-width input.el-input__inner {
|
|
width: 220px;
|
|
}
|
|
</style>
|