|
|
|
@ -36,9 +36,9 @@ |
|
|
|
|
<el-table-column type="index" width="70" label="序号" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="tableComment" label="数据表名称" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="showName" label="产品表名称" align="center"></el-table-column> |
|
|
|
|
<el-table-column label="起止日期" align="center"> |
|
|
|
|
<el-table-column label="起止日期" width="160" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{scope.row.startTime + ' ~ ' + scope.row.endTime}} |
|
|
|
|
{{scope.row.startTime.substr(0, 10) + ' ~ ' + scope.row.endTime.substr(0, 10)}} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="dataTotal" label="数据总量" width="100" align="center"></el-table-column> |
|
|
|
@ -130,11 +130,18 @@ |
|
|
|
|
|
|
|
|
|
<el-dialog title="自定义表头" :visible.sync="headVisible" width="60%" center :close-on-click-modal="false"> |
|
|
|
|
<el-table :data="previewData" class="table" stripe header-align="center" row-key="id" :key="editIndex"> |
|
|
|
|
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column> |
|
|
|
|
<el-table-column type="index" width="100" label="序号" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<template v-if="scope.row.custom"> |
|
|
|
|
<el-input placeholder="请输入" size="medium" v-model="curComment[0].comment"></el-input> |
|
|
|
|
</template> |
|
|
|
|
<template v-else>{{ scope.$index }}</template> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column v-for="(item,index) in previewHead" :prop="item.field" :key="index" :label="item.oldComment" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<template v-if="scope.row.custom"> |
|
|
|
|
<el-input placeholder="请输入" v-model="item.comment"></el-input> |
|
|
|
|
<el-input placeholder="请输入" size="medium" v-model="item.comment"></el-input> |
|
|
|
|
</template> |
|
|
|
|
<template v-else>{{scope.row[item.field]}}</template> |
|
|
|
|
</template> |
|
|
|
@ -157,6 +164,7 @@ export default { |
|
|
|
|
label: 'label' |
|
|
|
|
}, |
|
|
|
|
defaultActive: [], |
|
|
|
|
added: false, |
|
|
|
|
typeVisible: false, |
|
|
|
|
categoryName: '', |
|
|
|
|
categoryId: '', |
|
|
|
@ -224,17 +232,20 @@ export default { |
|
|
|
|
handleId(res) |
|
|
|
|
|
|
|
|
|
this.typeList = res |
|
|
|
|
if(res[0].children.length){ |
|
|
|
|
this.categoryId = res[0].children[0].id |
|
|
|
|
this.defaultActive = [res[0].children[0].id] |
|
|
|
|
}else{ |
|
|
|
|
this.categoryId = res[0].id |
|
|
|
|
this.defaultActive = [res[0].id] |
|
|
|
|
if (!this.added) { |
|
|
|
|
if(res[0].children.length){ |
|
|
|
|
this.categoryId = res[0].children[0].id |
|
|
|
|
this.defaultActive = [res[0].children[0].id] |
|
|
|
|
}else{ |
|
|
|
|
this.categoryId = res[0].id |
|
|
|
|
this.defaultActive = [res[0].id] |
|
|
|
|
} |
|
|
|
|
// 取第一个分类的id |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
this.$refs.type.setCurrentKey(res[0].children[0].id) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
// 取第一个分类的id |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
this.$refs.type.setCurrentKey(res[0].children[0].id) |
|
|
|
|
}) |
|
|
|
|
this.added = false |
|
|
|
|
this.getData() |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}, |
|
|
|
@ -253,6 +264,7 @@ export default { |
|
|
|
|
this.getData() |
|
|
|
|
}, |
|
|
|
|
addType(row){ |
|
|
|
|
if (row) this.defaultActive = [row.data.id] |
|
|
|
|
this.typeVisible = true |
|
|
|
|
this.levelId = row ? row.data.id : 0 |
|
|
|
|
}, |
|
|
|
@ -266,6 +278,7 @@ export default { |
|
|
|
|
this.$confirm('确定要删除吗?', '提示', { |
|
|
|
|
type: 'warning' |
|
|
|
|
}).then(() => { |
|
|
|
|
this.added = true |
|
|
|
|
this.$post(`${this.api.deleteCategory}?categoryId=${row.data.id}`).then(res => { |
|
|
|
|
this.$message.success('删除成功') |
|
|
|
|
this.getType() |
|
|
|
@ -275,6 +288,7 @@ export default { |
|
|
|
|
confirmType(){ |
|
|
|
|
if(this.submited) return false |
|
|
|
|
this.submited = true |
|
|
|
|
this.added = true |
|
|
|
|
if(this.id){ |
|
|
|
|
this.$post(this.api.updateCategory,{ |
|
|
|
|
id: this.id, |
|
|
|
@ -330,7 +344,6 @@ export default { |
|
|
|
|
if(typeof n[i] == 'string' && n[i].endsWith('+0000')) n[i] = this.formatDate('yyyy-MM-dd hh:mm:ss',new Date(n[i])) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
console.log(11, data) |
|
|
|
|
this.previewData = data |
|
|
|
|
if (!isEdit) this.previewVisible = true |
|
|
|
|
}).catch(res => {}) |
|
|
|
|