|
@@ -199,6 +199,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { EncryptId } from '@/utils/crypto-js.js'
|
|
|
+import { mapGetters } from 'vuex'
|
|
|
import {
|
|
|
getRequirement,
|
|
|
showRequirementEnum,
|
|
@@ -274,6 +276,14 @@ export default {
|
|
|
data: ''
|
|
|
}
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ ...mapGetters(['bizId'])
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ bizId() {
|
|
|
+ this.getTableData()
|
|
|
+ }
|
|
|
+ },
|
|
|
created() {
|
|
|
this.$store.state.data.status = true
|
|
|
this.showRequirementEnum()
|
|
@@ -285,6 +295,7 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
getTableData() { // 查询
|
|
|
+ if (this.bizId === -1) return
|
|
|
for (const key in this.searchForm) { // 接口不接受空值的处理
|
|
|
if (this.searchForm[key] === '' || this.searchForm[key] === null) {
|
|
|
delete this.searchForm[key]
|
|
@@ -295,16 +306,13 @@ export default {
|
|
|
} else {
|
|
|
this.searchForm.name = ''
|
|
|
}
|
|
|
- this.searchForm.bizId = Number(localStorage.getItem('bizId'))
|
|
|
+ this.searchForm.bizId = this.bizId
|
|
|
this.loading = true
|
|
|
|
|
|
this.searchForm.pageSize = this.pageSize
|
|
|
this.searchForm.curIndex = this.curIndex
|
|
|
|
|
|
- let data = {}
|
|
|
- data = this.searchForm
|
|
|
- // data.rqmtProposer = this.searchForm.rqmtProposer.join()
|
|
|
- getRequirement(data).then(res => {
|
|
|
+ getRequirement(this.searchForm).then(res => {
|
|
|
this.tableData = res.data.list
|
|
|
this.total = res.data.total
|
|
|
this.loading = false
|
|
@@ -315,15 +323,15 @@ export default {
|
|
|
if (res.code === 200) {
|
|
|
this.searchInfo = res.data
|
|
|
}
|
|
|
- const res1 = await projectListProject({ bizId: Number(localStorage.getItem('bizId')) })
|
|
|
+ const res1 = await projectListProject({ bizId: this.bizId })
|
|
|
if (res1.code === 200) {
|
|
|
this.AttributionItems = res1.data
|
|
|
}
|
|
|
- const res2 = await configShowRequireStatusEnum(localStorage.getItem('bizId'))
|
|
|
+ const res2 = await configShowRequireStatusEnum(this.bizId)
|
|
|
if (res2.code === 200) {
|
|
|
this.requiredStatus = res2.data.requirementStatus
|
|
|
}
|
|
|
- const res3 = await settingQueryBizRqmtOrntList(localStorage.getItem('bizId'))
|
|
|
+ const res3 = await settingQueryBizRqmtOrntList(this.bizId)
|
|
|
if (res3.code === 200) { // 需求方向
|
|
|
this.demandDirection = this.getTreeData(res3.data)
|
|
|
}
|
|
@@ -382,7 +390,13 @@ export default {
|
|
|
const saveObj = deepClone(this.searchForm)
|
|
|
delete saveObj.curIndex
|
|
|
delete saveObj.pageSize
|
|
|
- const res = await filterCreateFilter({ name: this.FilterItems.name, content: JSON.stringify(saveObj), bizId: Number(localStorage.getItem('bizId')), filterType: 3, creator: localStorage.getItem('username') })
|
|
|
+ const res = await filterCreateFilter({
|
|
|
+ name: this.FilterItems.name,
|
|
|
+ content: JSON.stringify(saveObj),
|
|
|
+ bizId: this.bizId,
|
|
|
+ filterType: 3,
|
|
|
+ creator: localStorage.getItem('username')
|
|
|
+ })
|
|
|
if (res.code === 200) {
|
|
|
this.$message({ showClose: true, message: '保存成功', type: 'success' })
|
|
|
this.showSaveSearch = false
|
|
@@ -392,7 +406,7 @@ export default {
|
|
|
},
|
|
|
async getFilterList() { // 获取过滤器列表
|
|
|
const params = {
|
|
|
- bizId: Number(localStorage.getItem('bizId')),
|
|
|
+ bizId: this.bizId,
|
|
|
filterType: 3
|
|
|
}
|
|
|
const res = await filtergetFilterList(params)
|
|
@@ -454,11 +468,12 @@ export default {
|
|
|
this.getTableData()
|
|
|
},
|
|
|
getToRequirementDetails(id) { // table点击跳转
|
|
|
+ const bizId_id = EncryptId(`${this.bizId}_${id}`)
|
|
|
if (this.newTabOpen) {
|
|
|
- const newTab = this.$router.resolve({ name: '需求详情', query: { id: id }})
|
|
|
+ const newTab = this.$router.resolve({ name: '需求详情', query: { bizId_id: bizId_id }})
|
|
|
window.open(newTab.href, '_blank')
|
|
|
} else {
|
|
|
- this.$router.push({ name: '需求详情', query: { id: id }})
|
|
|
+ this.$router.push({ name: '需求详情', query: { bizId_id: bizId_id }})
|
|
|
}
|
|
|
}
|
|
|
}
|