|
@@ -14,21 +14,21 @@
|
|
|
</template>
|
|
|
<!-- 单选 -->
|
|
|
<div v-if="item.type == 4" style="padding-left: 15px;">
|
|
|
- <div v-for="radio in item.options" :key="radio.id" style="width: 100%;">
|
|
|
+ <div v-for="radio in item.option" :key="radio.id" style="width: 100%;">
|
|
|
<span>{{ radio.name }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 多选 -->
|
|
|
<div v-if="item.type == 5" style="padding-left: 15px;">
|
|
|
<div class="source-checkbox">
|
|
|
- <div v-for="source in item.options" :key="source.id">
|
|
|
+ <div v-for="source in item.option" :key="source.id">
|
|
|
<span class="source-checkbox-label">{{ source.name }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 树类型 -->
|
|
|
<el-tree v-if="item.type == 6" @check-change="onChangeTree($event, item.id)" :ref="item.id"
|
|
|
- :data="item.child" show-checkbox node-key="id" check-strictly default-expand-all
|
|
|
+ :data="item.option" show-checkbox node-key="id" check-strictly default-expand-all
|
|
|
:props="{ children: 'child', label: 'name' }">
|
|
|
<div class="custom-filter-tree-node" slot-scope="{ node, data }">
|
|
|
<span class="name">{{ data.name }}</span>
|
|
@@ -121,14 +121,14 @@ export default {
|
|
|
// 查询自定义栏位数据
|
|
|
getList() {
|
|
|
var params = {
|
|
|
- ...this.queryParams,
|
|
|
- searchQuery: `projectId=${this.projectId}`,
|
|
|
- orderDTOList: [],
|
|
|
+ projectId: this.projectId,
|
|
|
+ taskId: this.taskId
|
|
|
}
|
|
|
this.loading = true
|
|
|
- this.$api.queryCustomField(params).then(response => {
|
|
|
+ this.$api.getAllPatentCustomField(params).then(response => {
|
|
|
if (response.code == 200) {
|
|
|
let data = response.data.data
|
|
|
+ this.field = data
|
|
|
this.handleFiled(data)
|
|
|
this.loading = false
|
|
|
}
|
|
@@ -138,30 +138,80 @@ export default {
|
|
|
},
|
|
|
handleFiled(data) {
|
|
|
data.forEach(item => {
|
|
|
- this.queryCustomOption(item)
|
|
|
+ this.getOption(item)
|
|
|
})
|
|
|
},
|
|
|
- // 查询自定义栏位选项数据
|
|
|
- queryCustomOption(row) {
|
|
|
|
|
|
- let params = {
|
|
|
- customFieldId: row.id,
|
|
|
+ getOption(item) {
|
|
|
+ switch (item.type) {
|
|
|
+ case 4:
|
|
|
+ case 5:
|
|
|
+ this.getCustomOption(item)
|
|
|
+ break;
|
|
|
+ case 6:
|
|
|
+ this.queryProductCategory(item, 4)
|
|
|
+ break;
|
|
|
+ case 7://接口传值类型:1产品类别,2产品,3技术分类,4自定义树
|
|
|
+ this.queryProductCategory(item, 2)
|
|
|
+ break;
|
|
|
+ case 8:
|
|
|
+ this.queryProductCategory(item, 1)
|
|
|
+ break;
|
|
|
+ case 9:
|
|
|
+ this.queryProductCategory(item, 3)
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //查询自定义栏位选项
|
|
|
+ getCustomOption(item) {
|
|
|
+ var params = {
|
|
|
+ customFieldId: item.id
|
|
|
}
|
|
|
this.$api.queryCustomOption(params).then(response => {
|
|
|
if (response.code == 200) {
|
|
|
- if (row.type == 6) {//树类型
|
|
|
- row.child = response.data.data
|
|
|
- } else if (row.type == 5) {
|
|
|
- row.options = response.data.data
|
|
|
- } else if (row.type == 4) {
|
|
|
- row.options = response.data.data
|
|
|
- }
|
|
|
- this.field.push(row)
|
|
|
+ this.$set(item, 'option', response.data.data)
|
|
|
}
|
|
|
}).catch(error => {
|
|
|
-
|
|
|
+ this.$set(item, 'option', [])
|
|
|
})
|
|
|
},
|
|
|
+ //获取产品或产品类别架构以及技术分类
|
|
|
+ queryProductCategory(item, type) {
|
|
|
+ let params = {
|
|
|
+ projectId: this.projectId,
|
|
|
+ taskId: this.taskId,
|
|
|
+ type: type,//类型:1产品类别,2产品,3技术分类,4自定义树
|
|
|
+ typeId: item.id,//产品或类别id
|
|
|
+ }
|
|
|
+ this.$api.queryTreeNodeTree(params).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$set(item, 'option', res.data.data)
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ this.$set(item, 'option', [])
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 查询自定义栏位选项数据
|
|
|
+ // queryCustomOption(row) {
|
|
|
+
|
|
|
+ // let params = {
|
|
|
+ // customFieldId: row.id,
|
|
|
+ // }
|
|
|
+ // this.$api.queryCustomOption(params).then(response => {
|
|
|
+ // if (response.code == 200) {
|
|
|
+ // if (row.type == 6) {//树类型
|
|
|
+ // row.child = response.data.data
|
|
|
+ // } else if (row.type == 5) {
|
|
|
+ // row.options = response.data.data
|
|
|
+ // } else if (row.type == 4) {
|
|
|
+ // row.options = response.data.data
|
|
|
+ // }
|
|
|
+ // this.field.push(row)
|
|
|
+ // }
|
|
|
+ // }).catch(error => {
|
|
|
+
|
|
|
+ // })
|
|
|
+ // },
|
|
|
|
|
|
// 点击节点发生的变化
|
|
|
onChangeTree(filed, filedId) {//当前节点的数据,当前栏位的数据
|