|
@@ -9,9 +9,10 @@
|
|
|
<el-button size="mini" @click="filterDatas">确认</el-button>
|
|
|
<el-button size="mini" @click="uploadClick">导入</el-button>
|
|
|
<input type="file" name="uploadfile " id="upFile" @change="uploadFile($event)" accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet">
|
|
|
- <router-link to="/admin/LT-YXSJWH-TJBM" style="margin:0 10px">
|
|
|
+ <!-- <router-link to="/admin/LT-YXSJWH-TJBM" style="margin:0 10px">
|
|
|
<el-button size="mini" type="warning">添加别名</el-button>
|
|
|
- </router-link>
|
|
|
+ </router-link> -->
|
|
|
+ <el-button size="mini" type="warning" style="margin:0 10px" @click="addName">添加别名</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</crumbs>
|
|
@@ -40,7 +41,7 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
:resizable = "false"
|
|
|
- prop="questionType"
|
|
|
+ prop="typeName"
|
|
|
label="归属"
|
|
|
show-overflow-tooltip>
|
|
|
</el-table-column>
|
|
@@ -112,17 +113,39 @@
|
|
|
pays:[],
|
|
|
filter: {
|
|
|
proName: ''
|
|
|
- }
|
|
|
+ },
|
|
|
+ optionList:[]
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
+ this.getOptions();
|
|
|
this.getDataList();
|
|
|
},
|
|
|
methods: {
|
|
|
+ getOptions(){//归属枚举
|
|
|
+ api.getDropList().then((res)=>{
|
|
|
+ const list = res.data;
|
|
|
+ if(list.code==0){
|
|
|
+ this.optionList = list.data[1];
|
|
|
+ }else{
|
|
|
+ /*this.$message({
|
|
|
+ message:list.msg || '获取归属类型失败',
|
|
|
+ type:'warning'
|
|
|
+ });*/
|
|
|
+ console.log(list.msg);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ addName(){
|
|
|
+ this.$router.push({
|
|
|
+ name:'AddSimilarName',
|
|
|
+ params:{optionList:this.optionList}
|
|
|
+ })
|
|
|
+ },
|
|
|
toEditProduct(row){
|
|
|
this.$router.push({
|
|
|
name:'AddSimilarName',
|
|
|
- params: {id:row.questionId,name:row.questionName}
|
|
|
+ params: {id:row.questionId,name:row.questionName,optionList:this.optionList}
|
|
|
})
|
|
|
},
|
|
|
filterDatas(){
|
|
@@ -134,8 +157,22 @@
|
|
|
api.similarName(param).then((res) => {
|
|
|
if (res.data.code == '0') {
|
|
|
const data = res.data.data;
|
|
|
- this.list = data.records;
|
|
|
- this.cacheData[param.current] = data.records;
|
|
|
+ // 将questionType转文字
|
|
|
+ let datas = data.records;
|
|
|
+ const lists = this.optionList;
|
|
|
+ if(lists.length>0){
|
|
|
+ for(let i=0; i<datas.length; i++){
|
|
|
+ for(let j=0; j<lists.length;j++){
|
|
|
+ if(datas[i].questionType== +lists[j].val){
|
|
|
+ datas[i].typeName=lists[j].name;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // this.list = data.records;
|
|
|
+ // this.cacheData[param.current] = data.records;
|
|
|
+ this.list = datas;
|
|
|
+ this.cacheData[param.current] = datas;
|
|
|
this.total = data.total;
|
|
|
}
|
|
|
}).catch((error) => {
|