项目清单
This commit is contained in:
@@ -189,14 +189,14 @@
|
||||
<div class="standards-drawer-table standards-drawer-table-one" v-if="!showTableFlag">
|
||||
<el-table
|
||||
v-show="!isListType"
|
||||
ref="searchTable"
|
||||
@selection-change="sarAccessInfoSearchSelect"
|
||||
:data="sarAccessInfoSearchList"
|
||||
style="width: 100%"
|
||||
border
|
||||
height="300px"
|
||||
:header-cell-style="{background: '#e8e8e8', color: '#333333', fontSize: '16px',
|
||||
fontWeight: 'bold', height: '48px'}"
|
||||
@selection-change="sarAccessInfoSearchSelect"
|
||||
ref="searchTable"
|
||||
>
|
||||
<el-table-column
|
||||
type="selection"
|
||||
@@ -253,7 +253,7 @@
|
||||
:header-cell-style="{background: '#e8e8e8', color: '#333333', fontSize: '16px',
|
||||
fontWeight: 'bold', height: '48px'}"
|
||||
@selection-change="accessSarTypeSelect"
|
||||
ref="searchTable"
|
||||
ref="accessTypeSelect"
|
||||
>
|
||||
<el-table-column
|
||||
type="selection"
|
||||
@@ -293,15 +293,6 @@
|
||||
<div class="list-entry">
|
||||
<el-divider content-position="left">清单条目</el-divider>
|
||||
<div class="action-bar">
|
||||
<el-button
|
||||
class="common-button-default"
|
||||
size="small" @click="moveUp" v-if="!disabledFlag"
|
||||
>上移</el-button>
|
||||
<el-button
|
||||
class="common-button-default"
|
||||
size="small" @click="moveDown"
|
||||
v-if="!disabledFlag"
|
||||
>下移</el-button>
|
||||
<el-button
|
||||
class="common-button-default export-button"
|
||||
size="mini" @click="exportAccessInfo('apart')"
|
||||
@@ -315,7 +306,7 @@
|
||||
><i class="iconfont"></i>删除</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
ref="entryTable"
|
||||
ref="entryTable"
|
||||
:data="sarAccessInfoList"
|
||||
class="un-select"
|
||||
style="width: 100%"
|
||||
@@ -366,6 +357,22 @@
|
||||
width="120px"
|
||||
label="文本状态">
|
||||
</el-table-column>
|
||||
<el-table-column>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
class="common-button-default"
|
||||
type="primary"
|
||||
size="small" @click="moveUp(scope.$index, scope.row)"
|
||||
v-if="!disabledFlag"
|
||||
>上移</el-button>
|
||||
<el-button
|
||||
class="common-button-default"
|
||||
type="danger"
|
||||
size="small" @click="moveDown(scope.$index, scope.row)"
|
||||
v-if="!disabledFlag"
|
||||
>下移</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="footer">
|
||||
@@ -1011,73 +1018,45 @@ export default {
|
||||
})
|
||||
if(addList > -1){
|
||||
this.$message.warning('请勿添加重复数据')
|
||||
} else(
|
||||
this.$refs.accessTypeSelect.clearSelection()
|
||||
this.$refs.entryTable.clearSelection()
|
||||
this.$refs.searchTable.clearSelection()
|
||||
} else{
|
||||
this.sarAccessInfoList.push(item)
|
||||
)
|
||||
this.$refs.accessTypeSelect.clearSelection()
|
||||
this.$refs.entryTable.clearSelection()
|
||||
this.$refs.searchTable.clearSelection()
|
||||
}
|
||||
})
|
||||
this.selectedAccInfoSearchList = []
|
||||
this.$refs.entryTable.clearSelection()
|
||||
this.$refs.searchTable.clearSelection()
|
||||
} else {
|
||||
this.$message.error('请选中需要添加到 清单条目 的(标准号/政策编号)')
|
||||
}
|
||||
},
|
||||
|
||||
// 上移 事件
|
||||
moveUp () {
|
||||
// i 全部对象数组的下标
|
||||
// s 选中对象数组的下标
|
||||
let sarAccessInfoListArry = JSON.parse(JSON.stringify(this.sarAccessInfoListArry))
|
||||
if (sarAccessInfoListArry.length === 1) {
|
||||
//数组交换下标
|
||||
console.log('s', sarAccessInfoListArry);
|
||||
console.log('i',this.sarAccessInfoList);
|
||||
for (var s in sarAccessInfoListArry) {
|
||||
for (var i in this.sarAccessInfoList) {
|
||||
if (sarAccessInfoListArry[s].resId === this.sarAccessInfoList[i].resId) {
|
||||
if (Number(i) !== 0) {
|
||||
let tempOption = this.sarAccessInfoList[i - 1]
|
||||
this.$set(this.sarAccessInfoList, i - 1, this.sarAccessInfoList[i])
|
||||
this.$set(this.sarAccessInfoList, i, tempOption)
|
||||
// this.sarAccessInfoListArry = []
|
||||
return
|
||||
} else {
|
||||
this.$message.error('数据已经是第一个,请选择其他数据上移!')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (this.sarAccessInfoListArry.length === 0) {
|
||||
this.$message.error('请选择需要移动的数据!')
|
||||
} else {
|
||||
this.$message.error('请选择单一数据进行移动!')
|
||||
}
|
||||
moveUp (index, row) {
|
||||
if (index === 0) {
|
||||
this.$message({
|
||||
message: '已经是列表中第一个素材!',
|
||||
type: 'warning'
|
||||
})
|
||||
} else {
|
||||
let temp = this.sarAccessInfoList[index - 1]
|
||||
this.$set(this.sarAccessInfoList, index - 1, this.sarAccessInfoList[index])
|
||||
this.$set(this.sarAccessInfoList, index, temp)
|
||||
}
|
||||
},
|
||||
// 下移事件
|
||||
moveDown () {
|
||||
// y 全部对象数组的下标
|
||||
// t 选中对象数组的下标
|
||||
if (this.sarAccessInfoListArry.length === 1) {
|
||||
for (var t in this.sarAccessInfoListArry) {
|
||||
for (var y in this.sarAccessInfoList) {
|
||||
if (this.sarAccessInfoListArry[t].resId === this.sarAccessInfoList[y].resId) {
|
||||
var ass = this.sarAccessInfoList.length - 1
|
||||
if (Number(y) !== Number(ass)) {
|
||||
var s = parseInt(y) + 1
|
||||
var tempOption = this.sarAccessInfoList[parseInt(s)]
|
||||
this.$set(this.sarAccessInfoList, parseInt(s), this.sarAccessInfoList[parseInt(y)])
|
||||
this.$set(this.sarAccessInfoList, parseInt(y), tempOption)
|
||||
return
|
||||
} else {
|
||||
this.$message.error('数据已经是最后一个,请选择其他数据进行移动!')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (this.sarAccessInfoListArry.length === 0) {
|
||||
this.$message.error('请选择需要移动的数据!')
|
||||
} else {
|
||||
this.$message.error('请选择单一数据进行移动!')
|
||||
}
|
||||
moveDown (index) {
|
||||
if (index === (this.sarAccessInfoList.length - 1)) {
|
||||
this.$message({
|
||||
message: '已经是列表中最后一个素材!',
|
||||
type: 'warning'
|
||||
})
|
||||
} else {
|
||||
let i = this.sarAccessInfoList[index + 1]
|
||||
this.$set(this.sarAccessInfoList, index + 1, this.sarAccessInfoList[index])
|
||||
this.$set(this.sarAccessInfoList, index, i)
|
||||
}
|
||||
},
|
||||
// 点击清单条目导入按钮事件
|
||||
importmodalFlags () {
|
||||
@@ -1120,12 +1099,8 @@ export default {
|
||||
}
|
||||
},
|
||||
// 清单条目 table select事件
|
||||
sarAccessInfoSelect (data) {
|
||||
let sarAccessInfoListArry = [];
|
||||
for(let i = 0; i< data.length; i++){
|
||||
this.sarAccessInfoListArry.push(data[i].id)
|
||||
}
|
||||
console.log(this.sarAccessInfoListArry);
|
||||
sarAccessInfoSelect (selectData) {
|
||||
this.sarAccessInfoListArry = selectData
|
||||
},
|
||||
// 点击取消按钮 返回事件
|
||||
backCancal () {
|
||||
@@ -1207,12 +1182,9 @@ export default {
|
||||
return row.isRelateAccess === '1'
|
||||
},
|
||||
// 数据搜索 table select事件
|
||||
sarAccessInfoSearchSelect (selectData) {
|
||||
this.selectedAccInfoSearchList = selectData
|
||||
this.selectSearch = []
|
||||
for(let i = 0; i <selectData.length; i++) {
|
||||
this.selectSearch.push(selectData[i].id)
|
||||
}
|
||||
sarAccessInfoSearchSelect (val) {
|
||||
this.selectedAccInfoSearchList = val
|
||||
console.log(val)
|
||||
},
|
||||
// 数据搜索 清单类型 table select事件
|
||||
accessSarTypeSelect (selectData) {
|
||||
|
||||
+46
-68
@@ -238,7 +238,7 @@
|
||||
:header-cell-style="{background: '#e8e8e8', color: '#333333', fontSize: '16px',
|
||||
fontWeight: 'bold', height: '48px'}"
|
||||
@selection-change="accessSarTypeSelect"
|
||||
ref="searchTable"
|
||||
ref="accessTypeSelect"
|
||||
>
|
||||
<el-table-column
|
||||
type="selection"
|
||||
@@ -278,15 +278,6 @@
|
||||
<div class="list-entry">
|
||||
<el-divider content-position="left">清单条目</el-divider>
|
||||
<div class="action-bar">
|
||||
<el-button
|
||||
class="common-button-default"
|
||||
size="small" @click="moveUp" v-if="!disabledFlag"
|
||||
>上移</el-button>
|
||||
<el-button
|
||||
class="common-button-default"
|
||||
size="small" @click="moveDown"
|
||||
v-if="!disabledFlag"
|
||||
>下移</el-button>
|
||||
<el-button
|
||||
class="common-button-default export-button"
|
||||
size="mini" @click="exportAccessInfo('apart')"
|
||||
@@ -351,6 +342,22 @@
|
||||
width="120px"
|
||||
label="文本状态">
|
||||
</el-table-column>
|
||||
<el-table-column>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
class="common-button-default"
|
||||
type="primary"
|
||||
size="small" @click="moveUp(scope.$index, scope.row)"
|
||||
v-if="!disabledFlag"
|
||||
>上移</el-button>
|
||||
<el-button
|
||||
class="common-button-default"
|
||||
type="danger"
|
||||
size="small" @click="moveDown(scope.$index, scope.row)"
|
||||
v-if="!disabledFlag"
|
||||
>下移</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="footer">
|
||||
@@ -996,9 +1003,15 @@ export default {
|
||||
})
|
||||
if(addList > -1){
|
||||
this.$message.warning('请勿添加重复数据')
|
||||
} else(
|
||||
this.$refs.accessTypeSelect.clearSelection()
|
||||
this.$refs.entryTable.clearSelection()
|
||||
this.$refs.searchTable.clearSelection()
|
||||
} else{
|
||||
this.sarAccessInfoList.push(item)
|
||||
)
|
||||
this.$refs.accessTypeSelect.clearSelection()
|
||||
this.$refs.entryTable.clearSelection()
|
||||
this.$refs.searchTable.clearSelection()
|
||||
}
|
||||
})
|
||||
this.selectedAccInfoSearchList = []
|
||||
this.$refs.entryTable.clearSelection()
|
||||
@@ -1008,60 +1021,28 @@ export default {
|
||||
}
|
||||
},
|
||||
// 上移 事件
|
||||
moveUp () {
|
||||
// i 全部对象数组的下标
|
||||
// s 选中对象数组的下标
|
||||
let sarAccessInfoListArry = JSON.parse(JSON.stringify(this.sarAccessInfoListArry))
|
||||
if (sarAccessInfoListArry.length === 1) {
|
||||
//数组交换下标
|
||||
console.log('s', sarAccessInfoListArry);
|
||||
console.log('i',this.sarAccessInfoList);
|
||||
for (var s in sarAccessInfoListArry) {
|
||||
for (var i in this.sarAccessInfoList) {
|
||||
if (sarAccessInfoListArry[s].resId === this.sarAccessInfoList[i].resId) {
|
||||
if (Number(i) !== 0) {
|
||||
let tempOption = this.sarAccessInfoList[i - 1]
|
||||
this.$set(this.sarAccessInfoList, i - 1, this.sarAccessInfoList[i])
|
||||
this.$set(this.sarAccessInfoList, i, tempOption)
|
||||
// this.sarAccessInfoListArry = []
|
||||
return
|
||||
} else {
|
||||
this.$message.error('数据已经是第一个,请选择其他数据上移!')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (this.sarAccessInfoListArry.length === 0) {
|
||||
this.$message.error('请选择需要移动的数据!')
|
||||
moveUp (index, row) {
|
||||
if (index === 0) {
|
||||
this.$message({
|
||||
message: '已经是列表中第一个素材!',
|
||||
type: 'warning'
|
||||
})
|
||||
} else {
|
||||
this.$message.error('请选择单一数据进行移动!')
|
||||
let temp = this.sarAccessInfoList[index - 1]
|
||||
this.$set(this.sarAccessInfoList, index - 1, this.sarAccessInfoList[index])
|
||||
this.$set(this.sarAccessInfoList, index, temp)
|
||||
}
|
||||
},
|
||||
// 下移事件
|
||||
moveDown () {
|
||||
// y 全部对象数组的下标
|
||||
// t 选中对象数组的下标
|
||||
if (this.sarAccessInfoListArry.length === 1) {
|
||||
for (var t in this.sarAccessInfoListArry) {
|
||||
for (var y in this.sarAccessInfoList) {
|
||||
if (this.sarAccessInfoListArry[t].resId === this.sarAccessInfoList[y].resId) {
|
||||
var ass = this.sarAccessInfoList.length - 1
|
||||
if (Number(y) !== Number(ass)) {
|
||||
var s = parseInt(y) + 1
|
||||
var tempOption = this.sarAccessInfoList[parseInt(s)]
|
||||
this.$set(this.sarAccessInfoList, parseInt(s), this.sarAccessInfoList[parseInt(y)])
|
||||
this.$set(this.sarAccessInfoList, parseInt(y), tempOption)
|
||||
return
|
||||
} else {
|
||||
this.$message.error('数据已经是最后一个,请选择其他数据进行移动!')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (this.sarAccessInfoListArry.length === 0) {
|
||||
this.$message.error('请选择需要移动的数据!')
|
||||
moveDown (index) {
|
||||
if (index === (this.sarAccessInfoList.length - 1)) {
|
||||
this.$message({
|
||||
message: '已经是列表中最后一个素材!',
|
||||
type: 'warning'
|
||||
})
|
||||
} else {
|
||||
this.$message.error('请选择单一数据进行移动!')
|
||||
let i = this.sarAccessInfoList[index + 1]
|
||||
this.$set(this.sarAccessInfoList, index + 1, this.sarAccessInfoList[index])
|
||||
this.$set(this.sarAccessInfoList, index, i)
|
||||
}
|
||||
},
|
||||
// 点击清单条目导入按钮事件
|
||||
@@ -1188,12 +1169,9 @@ export default {
|
||||
return row.isRelateAccess === '1'
|
||||
},
|
||||
// 数据搜索 table select事件
|
||||
sarAccessInfoSearchSelect (selectData) {
|
||||
this.selectedAccInfoSearchList = selectData
|
||||
this.selectSearch = []
|
||||
for(let i = 0; i <selectData.length; i++) {
|
||||
this.selectSearch.push(selectData[i].id)
|
||||
}
|
||||
sarAccessInfoSearchSelect (val) {
|
||||
this.selectedAccInfoSearchList = val
|
||||
console.log(val)
|
||||
},
|
||||
// 数据搜索 清单类型 table select事件
|
||||
accessSarTypeSelect (selectData) {
|
||||
|
||||
+208
-666
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user