标准法规国家地区清单 新增、编辑页 删除无用代码

This commit is contained in:
Jaunty
2021-07-16 15:53:44 +08:00
parent b55a060ebf
commit 514fb25252
@@ -307,7 +307,7 @@
</div>
<el-table
ref="entryTable"
:data="stahndinfoList"
:data="sarAccessInfoList"
class="un-select"
style="width: 100%"
border
@@ -390,104 +390,6 @@
<el-button type="primary" size="mini" class="common-button-primary" icon="el-icon-check" @click="exportTestItem">提交</el-button>
</span>
</el-dialog>
<div>
<table-tools-bar v-model="isAdvancedSearch" @search="getDomesticStandardTableBtn(sarStandardsSearch)"
@reset="clearAllSearch('sarStandardsSearch')" >
<div slot="content">
<el-form :model="sarStandardsSearch" :inline="true" class="label-input-form table-lattice" style="display: flex;flex-wrap: wrap">
<!-- 标准号-->
<el-form-item :label="$t('m.standardNo')" class="serch-form-item">
<el-input v-model="sarStandardsSearch.standNumber" :placeholder="$t('m.lookUpByStandardNumber')" clearable :maxlength="100"
@keyup.enter.native="getDomesticStandardTableBtn(sarStandardsSearch)"></el-input>
</el-form-item>
<!-- 标准名称-->
<el-form-item :label="$t('m.standName')" class="serch-form-item">
<el-input v-model="sarStandardsSearch.standName" :placeholder="$t('m.searchByStandardName')" clearable :maxlength="500"
@keyup.enter.native="getDomesticStandardTableBtn(sarStandardsSearch)"></el-input>
</el-form-item>
<!-- 标准类别-->
<el-form-item :label="$t('m.standardCategory')" class="serch-form-item">
<search-select
v-model="sarStandardsSearch.standSort"
:placeholder="$t('m.standardCategoryTips')"
@keyup.enter.native="getDomesticStandardTableBtn(sarStandardsSearch)"
:options="standSortOptions"
clearable/>
</el-form-item>
<!-- 文本状态-->
<el-form-item :label="$t('m.standStateShow')" class="serch-form-item">
<el-select v-model="sarStandardsSearch.textStatus" :placeholder="$t('m.lookupByStandardStatus')" clearable
@keyup.enter.native="getDomesticStandardTableBtn(sarStandardsSearch)">
<el-option v-for="opt in standStateOptions" :value="opt.value === undefined ? '' :opt.value" :key="opt.value" :label="opt.label">{{ opt.label}}</el-option>
</el-select>
</el-form-item>
<!-- 代替标准号-->
<el-form-item :label="$t('m.substituteStandardNumber')" class="serch-form-item">
<el-input v-model="sarStandardsSearch.dtbjh" :placeholder="$t('m.lookUpByAlternativeCriteria')" clearable :maxlength="100"
@keyup.enter.native="getDomesticStandardTableBtn(sarStandardsSearch)"></el-input>
</el-form-item>
<!-- 适用车型-->
<el-form-item :label="$t('m.applicableModels')" class="serch-form-item">
<el-select v-model="sarStandardsSearch.cllx" :placeholder="$t('m.searchAccordingToThApplicableModel')" clearable
@keyup.enter.native="getDomesticStandardTableBtn(sarStandardsSearch)">
<el-option v-for="opt in applyArcticOptions" :value="opt.value === undefined ? '' :opt.value" :key="opt.value" :label="opt.label">{{ opt.label}}</el-option>
</el-select>
</el-form-item>
<!-- 适用产品线新增字段-->
<el-form-item :label="$t('m.applicableProductLine')" class="serch-form-item">
<el-select v-model="sarStandardsSearch.nylx" :placeholder="$t('m.searchByApplicableProductLine')" clearable
@keyup.enter.native="getDomesticStandardTableBtn(sarStandardsSearch)">
<el-option v-for="opt in sycpxOptions" :value="opt.value === undefined ? '' :opt.value" :key="opt.value" :label="opt.label">{{ opt.label}}</el-option>
</el-select>
</el-form-item>
<!-- 关联模块新增字段-->
<el-form-item :label="$t('m.associatedModule')" class="serch-form-item">
<el-select v-model="sarStandardsSearch.cycvppsbm" :placeholder="$t('m.SearchByAssociatedModule')" clearable
@keyup.enter.native="getDomesticStandardTableBtn(sarStandardsSearch)">
<el-option v-for="opt in standNatureOptions" :value="opt.value === undefined ? '' :opt.value" :key="opt.value" :label="opt.label">{{ opt.label}}
</el-option>
</el-select>
</el-form-item>
</el-form>
<div style="position:absolute;right: 20px;background-color: white;width: 130px;height: 40px;padding-top: 5px;padding-left: 1px">
<el-button
:loading="searching"
type="primary"
size="mini"
class="common-button-primary"
v-btn-permission="'967c8b1402459951b5f75fcd1c548665'"
@click="searchBtnClick(standCommonlySearch)">
查询
</el-button>
<el-button
size="mini"
class="common-button-default"
v-btn-permission="'d38fea2d0d992615f9e1c4dfb6dc76f3'"
@click="clearAllSearch('standCommonlySearch')">
清空
</el-button>
</div>
</div>
</table-tools-bar>
</div>
<!--导入模态框-->
<el-dialog title="导入信息" :visible.sync="importmodalFlag" width="400px">
<el-upload
@@ -571,68 +473,6 @@ export default {
// }
// }
return {
selectSarMenu: {}, // 用来记录当前选中的二级菜单对象
tableFlag: '',
isAdvancedSearch: false, // 高级检索窗口是否打开
// 一般检索搜索
standCommonlySearch: {
page: 1,
pageSize: this.$store.getters.userInfo.configContent,
standType: 'INLAND',
validFlag: '0',
standSort: '',
standNumber: ''
},
standItemSearch: {
standId: '',
responsibleUnit: '',
orgName: '',
validFlag: '0'
},
standItemList: [],
sarStandardsSearch: {
page: 1,
pageSize: this.$store.getters.userInfo.configContent,
standType: 'INLAND',
validFlag: '0',
menuId: '',
country: '',
standNumber: '',
standName: '',
standState: '',
standNature: '',
issueTime: '',
// applyArctic: '',
replaceStandNum: '',
// replaceStandNumCope: '',
// replaceStandNumList: [],
replacedStandNum: '',
synopsis: '', // 内容摘要
// category: '', // 所属类别
standSort: '' // 标准类别
}, // 分页查询过程中用到的对象
sarConfigStandSearch: {
page: 1,
pageSize: this.$store.getters.userInfo.configContent,
standType: 'INLAND',
validFlag: '0',
menuId: '',
country: '',
standSort: '',
standNumber: '',
standName: '',
standState: '',
standNature: '',
category: '',
issueTime: '',
applyArctic: '',
replaceStandNum: '',
synopsis: '',
// replaceStandNumCope: '',
replacedStandNum: '',
orderBy:''
}, // 分页查询过程中用到的对象
categoryOptions: [], // 所属类别下拉框
selectSearch : [],
// 新增、编辑 基础信息字段
sarAccessEO: {
@@ -701,8 +541,8 @@ export default {
sarAccessInfoSearchList: [], // 数据搜索 table列表数据
importmodalFlag: false, // 导入model 状态
searching: false,
stahndinfoList: [], // 清单条目 技术要求table 数据
stahndinfoListArry: [], // 清单条目 table选中数据
sarAccessInfoList: [], // 清单条目 技术要求table 数据
sarAccessInfoListArry: [], // 清单条目 table选中数据
moreSearchShow: false, // 多属性搜索 状态
loadData: false, // 提交按钮loading效果
drawerPage: 1, // 数据搜索table页码
@@ -911,8 +751,6 @@ export default {
methods: {
// 高级检索
selectMoreBtn () {
this.isAdvancedSearch = true
this.sarStandardsSearch = []
},
// 法规维护人树
getDept () {
@@ -1175,7 +1013,7 @@ export default {
// 追加字段
this.selectedAccInfoSearchList.map(item => {
let addList;
addList = this.stahndinfoList.findIndex(items => {
addList = this.sarAccessInfoList.findIndex(items => {
return items.id == item.id
})
if(addList > -1){
@@ -1184,7 +1022,7 @@ export default {
this.$refs.entryTable.clearSelection()
this.$refs.searchTable.clearSelection()
} else{
this.stahndinfoList.push(item)
this.sarAccessInfoList.push(item)
this.$refs.accessTypeSelect.clearSelection()
this.$refs.entryTable.clearSelection()
this.$refs.searchTable.clearSelection()
@@ -1202,21 +1040,21 @@ export default {
type: 'warning'
})
} else {
let temp = this.stahndinfoList[index - 1]
this.$set(this.stahndinfoList, index - 1, this.stahndinfoList[index])
this.$set(this.stahndinfoList, index, temp)
let temp = this.sarAccessInfoList[index - 1]
this.$set(this.sarAccessInfoList, index - 1, this.sarAccessInfoList[index])
this.$set(this.sarAccessInfoList, index, temp)
}
},
moveDown (index) {
if (index === (this.stahndinfoList.length - 1)) {
if (index === (this.sarAccessInfoList.length - 1)) {
this.$message({
message: '已经是列表中最后一个素材!',
type: 'warning'
})
} else {
let i = this.stahndinfoList[index + 1]
this.$set(this.stahndinfoList, index + 1, this.stahndinfoList[index])
this.$set(this.stahndinfoList, index, i)
let i = this.sarAccessInfoList[index + 1]
this.$set(this.sarAccessInfoList, index + 1, this.sarAccessInfoList[index])
this.$set(this.sarAccessInfoList, index, i)
}
},
// 点击清单条目导入按钮事件
@@ -1235,7 +1073,7 @@ export default {
* 删除不想添加的AccessInfo信息
*/
deleteSelectSarAccessInfo () {
if (this.stahndinfoListArry.length > 0) {
if (this.sarAccessInfoListArry.length > 0) {
this.$confirm('确认删除选中数据?', '确认删除', {
confirmButtonText: '确定',
cancelButtonText: '取消',
@@ -1245,14 +1083,14 @@ export default {
}).then(() => {
// i 全部对象数组的下标
// s 选中对象数组的下标
for (var s in this.stahndinfoListArry) {
for (var i in this.stahndinfoList) {
if (this.stahndinfoListArry[s].uuid === this.stahndinfoList[i].uuid) {
this.stahndinfoList.splice(i, 1)
for (var s in this.sarAccessInfoListArry) {
for (var i in this.sarAccessInfoList) {
if (this.sarAccessInfoListArry[s].uuid === this.sarAccessInfoList[i].uuid) {
this.sarAccessInfoList.splice(i, 1)
}
}
}
this.stahndinfoListArry = []
this.sarAccessInfoListArry = []
this.$refs.entryTable.clearSelection()
}).catch(() => {})
} else {
@@ -1261,8 +1099,8 @@ export default {
},
// 清单条目 table select事件
sarAccessInfoSelect (selectData) {
this.stahndinfoListArry = selectData
let stahndinfoListArryId = []
this.sarAccessInfoListArry = selectData
let sarAccessInfoListArryId = []
for(let i=0; i<this.selectData.length; i++){
}
},
@@ -1277,8 +1115,8 @@ export default {
this.$refs['sarAccessForm'].validate((valid) => {
if (valid) {
let rowlist = []
for (let i = 0; i < this.stahndinfoList.length; i++) {
rowlist.push(this.stahndinfoList[i].id)
for (let i = 0; i < this.sarAccessInfoList.length; i++) {
rowlist.push(this.sarAccessInfoList[i].id)
}
rowlist = rowlist.join(',')
let sarAccessEO = JSON.parse(JSON.stringify(this.sarAccessEO))
@@ -1331,10 +1169,7 @@ export default {
},
// 查询数据搜索 table 数据
selectLawsStands () {
this.$http.get('sarStandardsInfo/sar-standards-info/getSarStandardsInfoPage', {
...this.sarAccessInfoSearch,
...this.sarStandardsSearch
}, {
this.$http.get('sarStandardsInfo/sar-standards-info/getSarStandardsInfoPage', this.sarAccessInfoSearch, {
_this: this
}, res =>{
this.sarAccessInfoSearchList = res.data.list
@@ -1348,6 +1183,7 @@ export default {
// 数据搜索 table select事件
sarAccessInfoSearchSelect (val) {
this.selectedAccInfoSearchList = val
console.log(val)
},
// 数据搜索 清单类型 table select事件
accessSarTypeSelect (selectData) {
@@ -1373,10 +1209,10 @@ export default {
exportTestItem () {
let exportNames = this.exportName
let exportList = []
if (this.stahndinfoListArry.length > 0) {
exportList = this.stahndinfoListArry
if (this.sarAccessInfoListArry.length > 0) {
exportList = this.sarAccessInfoListArry
} else {
exportList = this.stahndinfoList
exportList = this.sarAccessInfoList
}
if (exportList != null && exportList.length > 0) {
let accIdAndrestype = []
@@ -1417,9 +1253,9 @@ export default {
var a
var b = ''
if (response.data) {
for (var sADMIN in this.stahndinfoListADMIN) {
for (var sADMIN in this.sarAccessInfoListADMIN) {
for (var iADMIN in response.data) {
if (this.stahndinfoListADMIN[sADMIN].code === response.data[iADMIN].code) {
if (this.sarAccessInfoListADMIN[sADMIN].code === response.data[iADMIN].code) {
// ('在全部对象中的位置' + i)
response.data.splice(i, 1)
b = '数据重复添加,现已自动清除! '
@@ -1428,7 +1264,7 @@ export default {
}
if (response.data.length > 0) {
for (let i = 0; i < response.data.length; i++) {
this.stahndinfoList.push(response.data[i])
this.sarAccessInfoList.push(response.data[i])
}
}
a = response.data.length
@@ -1537,16 +1373,16 @@ export default {
nowstandinfo.askNature = nowstandinfo.askNature.join(',')
// 判断新增还是编辑
if (this.editAddType === 1) {
this.stahndinfoList.push(nowstandinfo)
this.stahndinfoList[this.stahndinfoList.length - 1].uuid = this.number
this.sarAccessInfoList.push(nowstandinfo)
this.sarAccessInfoList[this.sarAccessInfoList.length - 1].uuid = this.number
this.number++
this.isSubmit = false
this.$message.success('添加成功')
} else {
this.stahndinfoList.map((item, index) => {
this.sarAccessInfoList.map((item, index) => {
if (item.uuid === nowstandinfo.uuid) {
// this.stahndinfoList[index] = nowstandinfo
this.$set(this.stahndinfoList, index, nowstandinfo)
// this.sarAccessInfoList[index] = nowstandinfo
this.$set(this.sarAccessInfoList, index, nowstandinfo)
}
})
this.isSubmit = false
@@ -1742,7 +1578,7 @@ export default {
// 新增、编辑标准时验证标准编号是否重复
validCode (rule, value, callback) {
let find = 0
this.stahndinfoList.map(item => {
this.sarAccessInfoList.map(item => {
if (item.code === value) {
find++
}
@@ -1793,176 +1629,10 @@ export default {
this.$http.get('sarLawsAttrDetailedList/sar-laws-attr-detailed-list/selectLawsById', {id: this.zqaId}, {
_this: this
}, res => {
this.stahndinfoList = res.data
this.sarAccessInfoList = res.data
}, e => {
})
},
treeClick (treeNode) {
this.selectSarMenu = treeNode
this.standCommonlySearch.menuId = treeNode.id
this.sarStandardsSearch.menuId = treeNode.id // 将当前二级菜单的id传回后台做标准的条件查询
this.sarStandardsSearch.page = 1
this.standCommonlySearch.page = 1
this.getDomesticStandardTable(this.tableFlag)
},
// 分页查询国内标准
getDomesticStandardTable (item) {
if (item !== '' && item !== null && item !== undefined) {
item.pageSize = this.$store.getters.userInfo.configContent
}
this.sarStandardsSearch.pageSize = this.$store.getters.userInfo.configContent
const data = item || this.sarStandardsSearch
if (item) {
this.sarStandardsSearch.advanceSearchVOStr = item.advanceSearchVOStr
}
// this.sarStandardsSearch.menuId = this.selectSarMenu.id
const formData = {...data}
if (!item) {
formData.menuId = this.sarStandardsSearch.menuId
} else {
formData.menuId = this.selectSarMenu.id
}
// 排序
formData.orderBy = this.orderBy
// 处理我的收藏和个性化标签传参
if (this.selectSarMenu.id === 'wdsc') {
formData.menuId = undefined
formData.labelMenuId = undefined
formData.collectMenuId = 'wdsc'
} else if (this.selectSarMenu.id === 'gxhbq' || this.selectSarMenu.pId === 'gxhbq') {
formData.menuId = undefined
formData.labelMenuId = this.selectSarMenu.id
formData.collectMenuId = undefined
} else {
formData.labelMenuId = undefined
formData.collectMenuId = undefined
}
formData.standType = 'INLAND'
this.SarExportSearchEo = formData
this.loading = true
this.$http.get('sarStandardsInfo/sar-standards-info/getSarStandardsInfoPage', formData, {
_this: this, loading: 'loading'
}, res => {
this.isAdvancedSearch = false
this.loading = false
if (res.ok) {
for (let i = 0; i < res.data.list.length; i++) {
res.data.list[i].checked = false
if (res.data.list[i].collectId != null && res.data.list[i].collectId !== '') {
res.data.list[i].collectBtn = false
res.data.list[i].cancelCollectBtn = true
} else {
res.data.list[i].collectBtn = true
res.data.list[i].cancelCollectBtn = false
}
res.data.list[i].isSubmit = false
if (res.data.list[i].attrInfoMap && res.data.list[i].attrInfoMap.XCXSSRQ) {
res.data.list[i].XCXSSRQ = res.data.list[i].attrInfoMap.XCXSSRQ
}
if (res.data.list[i].attrInfoMap && res.data.list[i].attrInfoMap.ZCCSSRQ) {
res.data.list[i].ZCCSSRQ = res.data.list[i].attrInfoMap.ZCCSSRQ
}
}
this.stahndinfoList = res.data.list
this.total = res.data.count
if ((this.stahndinfoList.length === 0 || this.stahndinfoList === []) && this.sarStandardsSearch.page !== 1) {
this.pageChange(1)
}
} else {
this.$message.error(res.message)
}
}, e => {
this.loading = false
this.stahndinfoList = []
this.total = 0
})
},
// 点击搜索按钮
searchBtnClick (standCommonlySearch) {
let item = this.standCommonlySearch
this.getDomesticStandardTable(item)
this.isAdvancedSearch = false
this.selectLawsStands()
},
// 搜索
getDomesticStandardTableBtn (item) {
this.tableFlag = item
item.page = 1
item.sarStandardsSearch = ''
this.getDomesticStandardTable(item)
},
// 提交配置搜索项
saveConfigStand () {
let search = {}
search.menuId = this.selectSarMenu.id
if (this.selectConfigStand.length === 0) {
this.$message({
showClose: true,
message: '请至少选择一条标准',
type: 'warning'
})
} else {
search.idlist = this.selectConfigStand
this.$http.postData('sarStandardsInfo/sar-standards-info/saveStandardsMenu', search, {
_this: this,
loading: 'isSubmit'
}, res => {
if (res.ok) {
this.configStandFlag = false
// this.$message({
// showClose: true,
// message: '配置标准成功!',
// type: 'success'
// })
this.getDomesticStandardTable(this.tableFlag)
}
}, e => {
})
}
},
// 清空搜索框
clearAllSearch (flag) {
this.isAdvancedSearch = false
if (flag === 'sarStandardsSearch') {
// 标准搜索
this.sarStandardsSearch.country = ''
this.sarStandardsSearch.standSort = ''
this.sarStandardsSearch.standNumber = ''
this.sarStandardsSearch.standName = ''
this.sarStandardsSearch.standState = ''
this.sarStandardsSearch.standNature = ''
this.sarStandardsSearch.issueTime = ''
this.sarStandardsSearch.applyArctic = ''
this.sarStandardsSearch.replaceStandNum = ''
this.sarStandardsSearch.replacedStandNum = ''
this.sarStandardsSearch.synopsis = ''
this.sarStandardsSearch.category = ''
this.pageChange(1)
this.getDomesticStandardTable(this.sarStandardsSearch)
} else if (flag === 'standCommonlySearch') {
this.standCommonlySearch.standSort = ''
this.standCommonlySearch.standNumber = ''
this.pageChange(1)
this.getDomesticStandardTable(this.standCommonlySearch)
} else if (flag === 2) {
// 标准条目搜索
this.standItemSearch.responsibleUnit = ''
this.standItemSearch.orgName = ''
} else {
this.configPage = 1
// 游离标准搜索清空
this.sarConfigStandSearch.standSort = ''
this.sarConfigStandSearch.standNumber = ''
this.sarConfigStandSearch.standName = ''
this.sarConfigStandSearch.category = ''
this.sarConfigStandSearch.standNature = ''
this.sarConfigStandSearch.synopsis = ''
this.sarConfigStandSearch.applyArctic = ''
this.sarConfigStandSearch.replaceStandNum = ''
this.selectConfiguraStand()
}
},
}
},
watch: {
// 监听 清单类型
@@ -1976,59 +1646,6 @@ export default {
},
computed: {
...mapGetters(['getAccessStandardRegRow']),
created(){
},
async mounted () {
// 进入页面后查询树形结构目录
await this.selectMenu()
// 进入页面后查询标准体系树形结构目录
await this.selectStandardMenu()
this.treeReload = true
// 从数据库中查询各下拉框数据
this.$http.get('sys/dictype/getDicTypeListCode', '', {
_this: this
}, res => {
this.allSelectOptions = res.data || {}
this.standSortOptions = res.data.STANDCLASSIFY // 标准类别
this.standNatureOptions = res.data.SARPROPERTY // 标准性质
this.standStateOptions = res.data.WBZTCLASS // 文本状态
this.standSystemOptions = res.data.BZTXCLASS // 标准体系
this.categoryOptions = res.data.NYLXCLASS // 能源类型
this.applyAuthOptions = res.data.SYRZCLASS // 适用认证
this.cysdOptions = res.data.WSCYSD // 我司参与深度
this.zrbmOptions = res.data.ZRBMCLASS // 责任部门
this.zrgcsOptions = res.data.ZRGCSCLASS // 责任工程师
this.txlbOptions = res.data.TXLBCLASS // 体系类别
this.getGzzOption()
}, e => {
})
this.getDomesticStandardTable(this.tableFlag)
// 加载所有的部门
this.getOrgTreeSource()
// 加载动态表单数据
this.getAddFormFieldList()
this.getDept()
},
destroyed () {
this.allSelectOptions = {}
this.countryOptions = []
this.regionOptions = []
this.standSortOptions = []
this.applyArcticOptions = []
this.standStateOptions = []
this.standNatureOptions = []
this.adoptExtentOptions = []
this.emergyKindOptions = []
this.applyAuthOptions = []
this.categoryOptions = []
this.assemClassOptions = []
this.categoryConfigOptions = []
this.standAttributeList = []
this.zNodesS = []
this.zNodesSItem = []
this.searchInlandNodes = []
this.orgData = []
}
},
mounted () {
this.zqaId =this.$route.query.id;
@@ -2040,8 +1657,7 @@ export default {
}, res => {
this.allSelectOptions = res.data || {}
this.regionOptions = res.data.REGION // 基础信息 区域list
this.applyArcticOptions = res.data.ENERGYTYPES || [] // 基础车型 适用车型list
this.sycpxOptions = res.data.SYCPXCLASS || []// 适用产品线
this.applyArcticOptions = res.data.PRODUCTTYPE || [] // 基础车型 适用车型list
this.energyKindOptions = res.data.ENERGYTYPES || [] // 能源种类list
this.drawerCountryOptions = res.data.COUNTRY // 国家、地区list
this.applyOptions = res.data.COUNTRY //适用区域list
@@ -2152,23 +1768,4 @@ export default {
margin: 2px;
}
}
.label-input-form {
&.table-lattice{
/deep/.el-form-item__label {
width:100px;
height:30px;
border: 1px solid #DCDFE6;
border-right: none;
line-height:30px;
text-align: center;
margin-top: 7px;
background: #F9F9F9;
}
/deep/.el-input__inner {
height: 30px;
line-height: 30px;
border-radius: 0 !important;
}
}
}
</style>