|
@@ -1,8 +1,8 @@
|
|
<template>
|
|
<template>
|
|
- <div class="patent-articles-patent-field" style="width:300px">
|
|
|
|
|
|
+ <div class="patent-articles-patent-field">
|
|
<el-form label-position="top" class="custom-field-form">
|
|
<el-form label-position="top" class="custom-field-form">
|
|
<template v-for="(item, index) in customField">
|
|
<template v-for="(item, index) in customField">
|
|
- <el-form-item :key="index">
|
|
|
|
|
|
+ <el-form-item :key="item.id">
|
|
<template slot="label">
|
|
<template slot="label">
|
|
<span :title="item.name" class="name">{{ item.name }}</span>
|
|
<span :title="item.name" class="name">{{ item.name }}</span>
|
|
</template>
|
|
</template>
|
|
@@ -12,64 +12,60 @@
|
|
<i class="el-icon-more el-icon--right"></i>
|
|
<i class="el-icon-more el-icon--right"></i>
|
|
</span>
|
|
</span>
|
|
<el-dropdown-menu slot="dropdown">
|
|
<el-dropdown-menu slot="dropdown">
|
|
- <el-dropdown-item @click.native="handleOption(0, item.id, index)">上移</el-dropdown-item>
|
|
|
|
- <el-dropdown-item @click.native="handleOption(1, item.id, index)">下移</el-dropdown-item>
|
|
|
|
|
|
+ <el-dropdown-item @click.native="handleOption(0, item)">上移</el-dropdown-item>
|
|
|
|
+ <el-dropdown-item @click.native="handleOption(1, item)">下移</el-dropdown-item>
|
|
</el-dropdown-menu>
|
|
</el-dropdown-menu>
|
|
</el-dropdown>
|
|
</el-dropdown>
|
|
</div>
|
|
</div>
|
|
<template v-if="item.type === 0 || item.type === 2 || item.type === 1">
|
|
<template v-if="item.type === 0 || item.type === 2 || item.type === 1">
|
|
- <div v-for="(val, i) in selected[item.id]" class="custom-input">
|
|
|
|
- <el-date-picker v-if="item.type === 1" v-model="val.label" value-format="yyyy-MM-dd" type="date" size="small" placeholder="选择日期" class="width_100" @change="onChange($event, item, val)"></el-date-picker>
|
|
|
|
- <el-input v-else type="textarea" v-model="val.label" placeholder="请输入内容" size="small" @blur="onChange($event, item, val)"></el-input>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <el-date-picker v-if="item.type === 1" v-model="item.label" value-format="yyyy-MM-dd" type="date" size="small"
|
|
|
|
+ placeholder="选择日期" class="width_100" @blur="onChange($event, item)"></el-date-picker>
|
|
|
|
+ <el-input v-else type="textarea" v-model="item.label" placeholder="请输入内容" size="small"
|
|
|
|
+ @blur="onChange($event, item)"></el-input>
|
|
</template>
|
|
</template>
|
|
<template v-if="item.type === 4">
|
|
<template v-if="item.type === 4">
|
|
<div class="showValue">
|
|
<div class="showValue">
|
|
<div>
|
|
<div>
|
|
- <div v-for="fieldValue in item.selected" :key="fieldValue" class="value">{{ fieldValue.name }}</div>
|
|
|
|
|
|
+ <div v-for="fieldValue in item.selected" :key="fieldValue.value" class="value">{{ fieldValue.value }}
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
- <el-button size="small" @click="$set(item,'show',!item.show)">{{ item.show?'收起':'修改' }}</el-button>
|
|
|
|
|
|
+ <el-button size="small" @click="$set(item, 'show', !item.show)">{{ item.show ? '收起' : '修改' }}</el-button>
|
|
</div>
|
|
</div>
|
|
- <el-radio-group v-model="item.selectedId" @change="onChange($event, item)" v-show="item.show">
|
|
|
|
- <div v-for="option in item.option">
|
|
|
|
- <el-radio class="custom-radio" :label="option.id" @click.native.prevent="getSelect(item,option.id)">{{ option.name }}</el-radio>
|
|
|
|
|
|
+ <el-radio-group v-model="item.selectedId" v-show="item.show">
|
|
|
|
+ <div v-for="option in item.option" :key="option.id">
|
|
|
|
+ <el-radio class="custom-radio" :label="option.id" @change="onChange($event, item)">{{
|
|
|
|
+ option.name }}</el-radio>
|
|
</div>
|
|
</div>
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
</template>
|
|
</template>
|
|
<template v-if="item.type === 5">
|
|
<template v-if="item.type === 5">
|
|
<div class="showValue">
|
|
<div class="showValue">
|
|
<div>
|
|
<div>
|
|
- <div v-for="fieldValue in item.selected" :key="fieldValue" class="value">{{ fieldValue }}</div>
|
|
|
|
|
|
+ <div v-for="fieldValue in item.selected" :key="fieldValue" class="value">{{ fieldValue.value }}</div>
|
|
</div>
|
|
</div>
|
|
- <el-button size="small" @click="$set(item,'show',!item.show)">{{ item.show?'收起':'修改' }}</el-button>
|
|
|
|
|
|
+ <el-button size="small" @click="$set(item, 'show', !item.show)">{{ item.show ? '收起' : '修改' }}</el-button>
|
|
</div>
|
|
</div>
|
|
- <el-checkbox-group v-model="selected[item.id]" @change="onChange($event, item)" v-show="item.show">
|
|
|
|
- <el-checkbox class="custom-checkbox" v-for="option in item.option" :label="option.id">{{ option.name }}</el-checkbox>
|
|
|
|
|
|
+ <el-checkbox-group v-model="item.selectedValue" v-show="item.show">
|
|
|
|
+ <el-checkbox class="custom-checkbox" v-for="option in item.option" :label="option.id" :key="option.id"
|
|
|
|
+ @change="(val) => onChange(option.id, item, val)">{{ option.name
|
|
|
|
+ }}</el-checkbox>
|
|
</el-checkbox-group>
|
|
</el-checkbox-group>
|
|
</template>
|
|
</template>
|
|
- <template v-if="item.type === 6" >
|
|
|
|
|
|
+ <template v-if="item.type === 6">
|
|
<div class="showValue">
|
|
<div class="showValue">
|
|
<div>
|
|
<div>
|
|
- <div v-for="fieldValue in item.selected" :key="fieldValue" class="value">{{ fieldValue }}</div>
|
|
|
|
|
|
+ <div v-for="fieldValue in item.selected" :key="fieldValue" class="value">{{ fieldValue.value }}</div>
|
|
</div>
|
|
</div>
|
|
- <el-button size="small" @click="$set(item,'show',!item.show)">{{ item.show?'收起':'修改' }}</el-button>
|
|
|
|
|
|
+ <el-button size="small" @click="$set(item, 'show', !item.show)">{{ item.show ? '收起' : '修改' }}</el-button>
|
|
</div>
|
|
</div>
|
|
- <div v-show="item.show">
|
|
|
|
- <el-tree
|
|
|
|
- @check-change="onChange($event, item)"
|
|
|
|
- :ref="item.id"
|
|
|
|
- :data="item.option"
|
|
|
|
- check-strictly
|
|
|
|
- :default-checked-keys="selected[item.id]"
|
|
|
|
- show-checkbox
|
|
|
|
- node-key="id"
|
|
|
|
- default-expand-all
|
|
|
|
- :props="defaultProps"
|
|
|
|
- ></el-tree>
|
|
|
|
- </div>
|
|
|
|
-
|
|
|
|
|
|
+ <div v-show="item.show">
|
|
|
|
+ <el-tree @check-change="(data, checked) => onChange(data, item, checked)" :items="item" :ref="item.id"
|
|
|
|
+ :data="item.option" check-strictly :default-checked-keys="item.selectedValue" show-checkbox node-key="id"
|
|
|
|
+ default-expand-all :props="defaultProps"></el-tree>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
</template>
|
|
</template>
|
|
-
|
|
|
|
|
|
+
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -80,178 +76,303 @@
|
|
<script>
|
|
<script>
|
|
export default {
|
|
export default {
|
|
props: {
|
|
props: {
|
|
- projectId:{
|
|
|
|
- default:0
|
|
|
|
|
|
+ projectId: {
|
|
|
|
+ default: 0
|
|
},
|
|
},
|
|
- taskId:{
|
|
|
|
- default:0
|
|
|
|
|
|
+ taskId: {
|
|
|
|
+ default: null,
|
|
},
|
|
},
|
|
- patentNo:''
|
|
|
|
|
|
+ patentNo: ''
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- customField:[],
|
|
|
|
- selected:[],
|
|
|
|
- defaultProps:{
|
|
|
|
- children:'child'
|
|
|
|
- }
|
|
|
|
|
|
+ customField: [],
|
|
|
|
+ selected: [],//qudiao
|
|
|
|
+ defaultProps: {
|
|
|
|
+ children: 'child',
|
|
|
|
+ label: 'name'
|
|
|
|
+ },
|
|
}
|
|
}
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
- patentNo(){
|
|
|
|
|
|
+ patentNo() {
|
|
this.getOptionsAndSelected()
|
|
this.getOptionsAndSelected()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
this.getCustomField()
|
|
this.getCustomField()
|
|
},
|
|
},
|
|
- methods:{
|
|
|
|
|
|
+ methods: {
|
|
|
|
+ // getShow(item) {
|
|
|
|
+ // this.
|
|
|
|
+ // this.getCustomOption(item)
|
|
|
|
+ // },
|
|
//上移下移
|
|
//上移下移
|
|
- handleOption(type,id,index){
|
|
|
|
|
|
+ handleOption(type, row) {
|
|
|
|
+ if (row.sysOrder == 0) {
|
|
|
|
+ this.$message.error('已是最顶层')
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
|
|
+ if (row.sysOrder == this.customField.length - 1) {
|
|
|
|
+ this.$message.error('已是最后一层')
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
|
|
+ if (type == 0) {//上移
|
|
|
|
+ this.customField.forEach(item => {
|
|
|
|
+ if (item.sysOrder == row.sysOrder - 1) {
|
|
|
|
+ item.sysOrder += 1
|
|
|
|
+ }
|
|
|
|
+ if (item.id == row.id) {
|
|
|
|
+ item.sysOrder -= 1
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ this.customField.forEach(item => {
|
|
|
|
+ if (item.sysOrder == row.sysOrder + 1) {
|
|
|
|
+ item.sysOrder -= 1
|
|
|
|
+ }
|
|
|
|
+ if (item.id == row.id) {
|
|
|
|
+ item.sysOrder += 1
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ let params = {
|
|
|
|
+ taskId: this.taskId,
|
|
|
|
+ projectId: this.projectId,
|
|
|
|
+ allCustomFieldVOs: this.customField
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ this.$api.addAllPatentCustomFieldOrder(params).then(res => {
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ this.$message('移动成功')
|
|
|
|
+ this.getCustomField()
|
|
|
|
+ }
|
|
|
|
+ })
|
|
},
|
|
},
|
|
//切换选择
|
|
//切换选择
|
|
- onChange(){
|
|
|
|
|
|
+ onChange(data, item, checked) {
|
|
|
|
+ console.log(data, item);
|
|
|
|
+ var params = {
|
|
|
|
+ projectId: this.projectId,
|
|
|
|
+ taskId: this.taskId,
|
|
|
|
+ fieldType: item.type,
|
|
|
|
+ fieldId: item.id,
|
|
|
|
+ fieldValue: [data.id || data],
|
|
|
|
+ patentNo: this.patentNo,
|
|
|
|
+ optionType: '',
|
|
|
|
+ }
|
|
|
|
+ if (item.type == 0 || item.type == 1 || item.type == 2) {
|
|
|
|
+ params.fieldValue[0] = item.label
|
|
|
|
+ }
|
|
|
|
+ // 判断optionType 0取消1添加2覆盖
|
|
|
|
+ if (item.type == 6 || item.type == 5) {
|
|
|
|
+ if (checked) {
|
|
|
|
+ item.selectedValue.push(data.id)
|
|
|
|
+ item.selected.push(data.name)
|
|
|
|
+ params.optionType = 1
|
|
|
|
+ } else if (checked == false) {
|
|
|
|
+ let index = item.selectedValue.findIndex(valIndex => {
|
|
|
|
+ return valIndex == data.id
|
|
|
|
+ })
|
|
|
|
+ if (index != -1) {
|
|
|
|
+ item.selectedValue.splice(index, 1)
|
|
|
|
+ item.selected.splice(index, 1)
|
|
|
|
+ }
|
|
|
|
+ params.optionType = 0
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ if (data) {//单选的id
|
|
|
|
+ this.$set(item, 'selectedId', data)
|
|
|
|
+ }
|
|
|
|
+ params.optionType = 2
|
|
|
|
+ }
|
|
|
|
+ this.$api.addCustomFieldValue(params).then(response => {
|
|
|
|
+ if (response.code == 200) {
|
|
|
|
+ this.$message.success('修改成功')
|
|
|
|
+ this.getSelected(item)
|
|
|
|
+ }
|
|
|
|
+ }).catch(error => {
|
|
|
|
|
|
|
|
+ })
|
|
},
|
|
},
|
|
- getCustomField(){
|
|
|
|
|
|
+ // 获取栏位
|
|
|
|
+ getCustomField() {
|
|
var params = {
|
|
var params = {
|
|
- projectId:this.projectId,
|
|
|
|
- taskId:this.taskId
|
|
|
|
|
|
+ projectId: this.projectId,
|
|
|
|
+ taskId: this.taskId
|
|
}
|
|
}
|
|
- this.$api.getAllPatentCustomField(params).then(response=>{
|
|
|
|
- if(response.code == 200){
|
|
|
|
- this.customField = response.data
|
|
|
|
- // this.getOptionsAndSelected()
|
|
|
|
|
|
+ this.$api.getAllPatentCustomField(params).then(response => {
|
|
|
|
+ if (response.code == 200) {
|
|
|
|
+ this.customField = response.data.data
|
|
|
|
+ this.getOptionsAndSelected()
|
|
}
|
|
}
|
|
- }).catch(error=>{
|
|
|
|
|
|
+ }).catch(error => {
|
|
this.customField = [
|
|
this.customField = [
|
|
- {
|
|
|
|
- "id": 10,
|
|
|
|
- "name": "相似度",
|
|
|
|
- "projectId": 101,
|
|
|
|
- "type": 6,
|
|
|
|
- "description": "",
|
|
|
|
- "status": true,
|
|
|
|
- "createId": "328",
|
|
|
|
- "createName": "朱豪",
|
|
|
|
- "createTime": "2023-12-15 14:52:42"
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- "id": 11,
|
|
|
|
- "name": "多选",
|
|
|
|
- "projectId": 101,
|
|
|
|
- "type": 5,
|
|
|
|
- "description": "",
|
|
|
|
- "status": true,
|
|
|
|
- "createId": "328",
|
|
|
|
- "createName": "朱豪",
|
|
|
|
- "createTime": "2023-12-15 14:54:03"
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- "id": 12,
|
|
|
|
- "name": "单选",
|
|
|
|
- "projectId": 101,
|
|
|
|
- "type": 4,
|
|
|
|
- "description": "",
|
|
|
|
- "status": true,
|
|
|
|
- "createId": "328",
|
|
|
|
- "createName": "朱豪",
|
|
|
|
- "createTime": "2023-12-15 14:54:29",
|
|
|
|
- selected:[
|
|
|
|
- {
|
|
|
|
- id:1,
|
|
|
|
- name:'选项'
|
|
|
|
- }
|
|
|
|
- ],
|
|
|
|
- selectedId:1,
|
|
|
|
- option:[
|
|
|
|
- {
|
|
|
|
- id:1,
|
|
|
|
- name:'选项'
|
|
|
|
- }
|
|
|
|
- ]
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- "id": 13,
|
|
|
|
- "name": "文本",
|
|
|
|
- "projectId": 101,
|
|
|
|
- "type": 2,
|
|
|
|
- "description": "",
|
|
|
|
- "status": true,
|
|
|
|
- "createId": "328",
|
|
|
|
- "createName": "朱豪",
|
|
|
|
- "createTime": "2023-12-15 14:54:51"
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- "id": 14,
|
|
|
|
- "name": "日期",
|
|
|
|
- "projectId": 101,
|
|
|
|
- "type": 1,
|
|
|
|
- "description": "",
|
|
|
|
- "status": true,
|
|
|
|
- "createId": "328",
|
|
|
|
- "createName": "朱豪",
|
|
|
|
- "createTime": "2023-12-15 14:54:57"
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- "id": 15,
|
|
|
|
- "name": "数字",
|
|
|
|
- "projectId": 101,
|
|
|
|
- "type": 0,
|
|
|
|
- "description": "",
|
|
|
|
- "status": true,
|
|
|
|
- "createId": "328",
|
|
|
|
- "createName": "朱豪",
|
|
|
|
- "createTime": "2023-12-15 14:55:03"
|
|
|
|
- }
|
|
|
|
|
|
+ {
|
|
|
|
+ "id": 10,
|
|
|
|
+ "name": "相似度",
|
|
|
|
+ "projectId": 101,
|
|
|
|
+ "type": 6,
|
|
|
|
+ "description": "",
|
|
|
|
+ "status": true,
|
|
|
|
+ "createId": "328",
|
|
|
|
+ "createName": "朱豪",
|
|
|
|
+ "createTime": "2023-12-15 14:52:42"
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ "id": 11,
|
|
|
|
+ "name": "多选",
|
|
|
|
+ "projectId": 101,
|
|
|
|
+ "type": 5,
|
|
|
|
+ "description": "",
|
|
|
|
+ "status": true,
|
|
|
|
+ "createId": "328",
|
|
|
|
+ "createName": "朱豪",
|
|
|
|
+ "createTime": "2023-12-15 14:54:03"
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ "id": 12,
|
|
|
|
+ "name": "单选",
|
|
|
|
+ "projectId": 101,
|
|
|
|
+ "type": 4,
|
|
|
|
+ "description": "",
|
|
|
|
+ "status": true,
|
|
|
|
+ "createId": "328",
|
|
|
|
+ "createName": "朱豪",
|
|
|
|
+ "createTime": "2023-12-15 14:54:29",
|
|
|
|
+ selected: [
|
|
|
|
+ {
|
|
|
|
+ id: 1,
|
|
|
|
+ name: '选项'
|
|
|
|
+ }
|
|
|
|
+ ],
|
|
|
|
+ selectedId: 1,
|
|
|
|
+ option: [
|
|
|
|
+ {
|
|
|
|
+ id: 1,
|
|
|
|
+ name: '选项'
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ "id": 13,
|
|
|
|
+ "name": "文本",
|
|
|
|
+ "projectId": 101,
|
|
|
|
+ "type": 2,
|
|
|
|
+ "description": "",
|
|
|
|
+ "status": true,
|
|
|
|
+ "createId": "328",
|
|
|
|
+ "createName": "朱豪",
|
|
|
|
+ "createTime": "2023-12-15 14:54:51"
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ "id": 14,
|
|
|
|
+ "name": "日期",
|
|
|
|
+ "projectId": 101,
|
|
|
|
+ "type": 1,
|
|
|
|
+ "description": "",
|
|
|
|
+ "status": true,
|
|
|
|
+ "createId": "328",
|
|
|
|
+ "createName": "朱豪",
|
|
|
|
+ "createTime": "2023-12-15 14:54:57"
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ "id": 15,
|
|
|
|
+ "name": "数字",
|
|
|
|
+ "projectId": 101,
|
|
|
|
+ "type": 0,
|
|
|
|
+ "description": "",
|
|
|
|
+ "status": true,
|
|
|
|
+ "createId": "328",
|
|
|
|
+ "createName": "朱豪",
|
|
|
|
+ "createTime": "2023-12-15 14:55:03"
|
|
|
|
+ }
|
|
]
|
|
]
|
|
})
|
|
})
|
|
},
|
|
},
|
|
//获取栏位的选项和选项值(0数字,1日期,2文本,4单选,5多选,6树,7产品8产品类别9技术分类)
|
|
//获取栏位的选项和选项值(0数字,1日期,2文本,4单选,5多选,6树,7产品8产品类别9技术分类)
|
|
- getOptionsAndSelected(){
|
|
|
|
|
|
+ getOptionsAndSelected() {
|
|
this.customField.forEach(item => {
|
|
this.customField.forEach(item => {
|
|
- this.getSelected(item)
|
|
|
|
- switch(item.type){
|
|
|
|
- case 4:
|
|
|
|
- case 5:
|
|
|
|
- case 6:
|
|
|
|
- this.getCustomOption(item)
|
|
|
|
- break;
|
|
|
|
- case 7:
|
|
|
|
- break;
|
|
|
|
- case 8:
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
|
|
+ this.getSelected(item)
|
|
|
|
+ switch (item.type) {
|
|
|
|
+ case 4:
|
|
|
|
+ case 5:
|
|
|
|
+ case 6:
|
|
|
|
+ this.getCustomOption(item)
|
|
|
|
+ break;
|
|
|
|
+ case 7:
|
|
|
|
+ this.queryProductCategory(item, 7)
|
|
|
|
+ break;
|
|
|
|
+ case 8:
|
|
|
|
+ this.queryProductCategory(item, 8)
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- //获取选项值
|
|
|
|
- getSelected(item){
|
|
|
|
- this.$api.getCustomFieldValues().then(response=>{
|
|
|
|
- if(response.code == 200){
|
|
|
|
- item.selected = response.data
|
|
|
|
|
|
+ //获取已选中选项值、已添加的值
|
|
|
|
+ getSelected(item) {
|
|
|
|
+ let params = {
|
|
|
|
+ projectId: this.projectId,
|
|
|
|
+ taskId: this.taskId,
|
|
|
|
+ fieldType: item.type,
|
|
|
|
+ fieldId: item.id,
|
|
|
|
+ patentNo: this.patentNo,
|
|
|
|
+ }
|
|
|
|
+ this.$api.getCustomFieldValues(params).then(response => {
|
|
|
|
+ if (response.code == 200) {
|
|
|
|
+ item.selected = response.data.data
|
|
|
|
+
|
|
|
|
+ switch (item.type) {
|
|
|
|
+ case 0://数字,日期,文字
|
|
|
|
+ case 1:
|
|
|
|
+ case 2:
|
|
|
|
+ this.$set(item, 'label', (item.selected && item.selected.length > 0) ? item.selected[0].value : '')
|
|
|
|
+ break;
|
|
|
|
+ case 4://单选
|
|
|
|
+ this.$set(item, 'selectedId', (item.selected && item.selected.length > 0) ? item.selected[0].valueId : '')
|
|
|
|
+ break;
|
|
|
|
+ case 6://多选和树
|
|
|
|
+ case 5:
|
|
|
|
+ item.selectedValue = []
|
|
|
|
+ item.selectedValue = (item.selected && item.selected.length > 0) ? item.selected.map(item => item.valueId) : []
|
|
|
|
+ break;
|
|
|
|
+
|
|
|
|
+ default:
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
- }).catch(error=>{
|
|
|
|
|
|
+ }).catch(error => {
|
|
item.selected = []
|
|
item.selected = []
|
|
})
|
|
})
|
|
},
|
|
},
|
|
//查询自定义栏位选项
|
|
//查询自定义栏位选项
|
|
- getCustomOption(item){
|
|
|
|
|
|
+ getCustomOption(item) {
|
|
var params = {
|
|
var params = {
|
|
- customFieldId:item.id
|
|
|
|
|
|
+ customFieldId: item.id
|
|
}
|
|
}
|
|
- this.$api.queryCustomOption(params).then(response=>{
|
|
|
|
- if(response.code == 200){
|
|
|
|
|
|
+ this.$api.queryCustomOption(params).then(response => {
|
|
|
|
+ if (response.code == 200) {
|
|
this.$set(item, 'option', response.data.data)
|
|
this.$set(item, 'option', response.data.data)
|
|
}
|
|
}
|
|
- }).catch(error=>{
|
|
|
|
|
|
+ }).catch(error => {
|
|
this.$set(item, 'option', [])
|
|
this.$set(item, 'option', [])
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- //获取产品或产品类别架构
|
|
|
|
- getProductCategory(){
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
|
|
+ //获取产品或产品类别架构以及技术分类
|
|
|
|
+ queryProductCategory(item,type) {
|
|
|
|
+ let params = {
|
|
|
|
+ type: type,//类型:1产品类别,2产品,3技术分类,4自定义树
|
|
|
|
+ typeId: item.id,//产品或类别id
|
|
|
|
+ }
|
|
|
|
+ this.$api.queryTreeNodeTree(params).then(res => {
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }).catch(err => {
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ },
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
@@ -266,17 +387,21 @@ export default {
|
|
text-overflow: ellipsis;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
white-space: nowrap;
|
|
}
|
|
}
|
|
|
|
+
|
|
.option {
|
|
.option {
|
|
position: absolute;
|
|
position: absolute;
|
|
right: 0;
|
|
right: 0;
|
|
top: -50px;
|
|
top: -50px;
|
|
color: #1e9fff;
|
|
color: #1e9fff;
|
|
|
|
+
|
|
i {
|
|
i {
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
.el-form-item {
|
|
.el-form-item {
|
|
margin-bottom: 0 !important;
|
|
margin-bottom: 0 !important;
|
|
|
|
+
|
|
.el-form-item__label {
|
|
.el-form-item__label {
|
|
font-size: 16px;
|
|
font-size: 16px;
|
|
border-bottom: 1px solid #d2d2d2;
|
|
border-bottom: 1px solid #d2d2d2;
|
|
@@ -284,20 +409,25 @@ export default {
|
|
color: #EE6666;
|
|
color: #EE6666;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
.custom-input {
|
|
.custom-input {
|
|
margin-bottom: 10px;
|
|
margin-bottom: 10px;
|
|
- .el-input {
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+ .el-input {}
|
|
|
|
+
|
|
.el-button {
|
|
.el-button {
|
|
float: right;
|
|
float: right;
|
|
margin-top: 5px;
|
|
margin-top: 5px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- .custom-checkbox, .custom-radio {
|
|
|
|
|
|
+
|
|
|
|
+ .custom-checkbox,
|
|
|
|
+ .custom-radio {
|
|
width: 100%;
|
|
width: 100%;
|
|
margin-right: 0 !important;
|
|
margin-right: 0 !important;
|
|
line-height: 30px;
|
|
line-height: 30px;
|
|
}
|
|
}
|
|
|
|
+
|
|
.el-form-item__label {
|
|
.el-form-item__label {
|
|
width: 100%;
|
|
width: 100%;
|
|
padding: 0 !important;
|
|
padding: 0 !important;
|
|
@@ -306,20 +436,21 @@ export default {
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
- .showValue{
|
|
|
|
- width:100%;
|
|
|
|
- display: flex;
|
|
|
|
- align-items: center;
|
|
|
|
- &>div{
|
|
|
|
- width:100%;
|
|
|
|
- min-height: 30px;
|
|
|
|
- border:1px solid var(--color1);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- .value{
|
|
|
|
-
|
|
|
|
- padding:5px;
|
|
|
|
- line-height: 20px;
|
|
|
|
- }
|
|
|
|
|
|
+.showValue {
|
|
|
|
+ width: 100%;
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+
|
|
|
|
+ &>div {
|
|
|
|
+ width: 100%;
|
|
|
|
+ min-height: 30px;
|
|
|
|
+ border: 1px solid var(--color1);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .value {
|
|
|
|
+
|
|
|
|
+ padding: 5px;
|
|
|
|
+ line-height: 20px;
|
|
}
|
|
}
|
|
|
|
+}
|
|
</style>
|
|
</style>
|