|
|
@ -36,9 +36,9 @@ |
|
|
|
<el-table-column type="index" width="70" label="序号" align="center"></el-table-column> |
|
|
|
<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="tableComment" label="数据表名称" align="center"></el-table-column> |
|
|
|
<el-table-column prop="showName" 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"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
{{scope.row.startTime + ' ~ ' + scope.row.endTime}} |
|
|
|
{{scope.row.startTime.substr(0, 10) + ' ~ ' + scope.row.endTime.substr(0, 10)}} |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="dataTotal" label="数据总量" width="100" align="center"></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-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 :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"> |
|
|
|
<el-table-column v-for="(item,index) in previewHead" :prop="item.field" :key="index" :label="item.oldComment" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template v-if="scope.row.custom"> |
|
|
|
<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> |
|
|
|
<template v-else>{{scope.row[item.field]}}</template> |
|
|
|
<template v-else>{{scope.row[item.field]}}</template> |
|
|
|
</template> |
|
|
|
</template> |
|
|
@ -157,6 +164,7 @@ export default { |
|
|
|
label: 'label' |
|
|
|
label: 'label' |
|
|
|
}, |
|
|
|
}, |
|
|
|
defaultActive: [], |
|
|
|
defaultActive: [], |
|
|
|
|
|
|
|
added: false, |
|
|
|
typeVisible: false, |
|
|
|
typeVisible: false, |
|
|
|
categoryName: '', |
|
|
|
categoryName: '', |
|
|
|
categoryId: '', |
|
|
|
categoryId: '', |
|
|
@ -224,17 +232,20 @@ export default { |
|
|
|
handleId(res) |
|
|
|
handleId(res) |
|
|
|
|
|
|
|
|
|
|
|
this.typeList = res |
|
|
|
this.typeList = res |
|
|
|
if(res[0].children.length){ |
|
|
|
if (!this.added) { |
|
|
|
this.categoryId = res[0].children[0].id |
|
|
|
if(res[0].children.length){ |
|
|
|
this.defaultActive = [res[0].children[0].id] |
|
|
|
this.categoryId = res[0].children[0].id |
|
|
|
}else{ |
|
|
|
this.defaultActive = [res[0].children[0].id] |
|
|
|
this.categoryId = res[0].id |
|
|
|
}else{ |
|
|
|
this.defaultActive = [res[0].id] |
|
|
|
this.categoryId = res[0].id |
|
|
|
|
|
|
|
this.defaultActive = [res[0].id] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 取第一个分类的id |
|
|
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
|
|
this.$refs.type.setCurrentKey(res[0].children[0].id) |
|
|
|
|
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
// 取第一个分类的id |
|
|
|
this.added = false |
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
|
|
this.$refs.type.setCurrentKey(res[0].children[0].id) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.getData() |
|
|
|
this.getData() |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => {}) |
|
|
|
}, |
|
|
|
}, |
|
|
@ -253,6 +264,7 @@ export default { |
|
|
|
this.getData() |
|
|
|
this.getData() |
|
|
|
}, |
|
|
|
}, |
|
|
|
addType(row){ |
|
|
|
addType(row){ |
|
|
|
|
|
|
|
if (row) this.defaultActive = [row.data.id] |
|
|
|
this.typeVisible = true |
|
|
|
this.typeVisible = true |
|
|
|
this.levelId = row ? row.data.id : 0 |
|
|
|
this.levelId = row ? row.data.id : 0 |
|
|
|
}, |
|
|
|
}, |
|
|
@ -266,6 +278,7 @@ export default { |
|
|
|
this.$confirm('确定要删除吗?', '提示', { |
|
|
|
this.$confirm('确定要删除吗?', '提示', { |
|
|
|
type: 'warning' |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
}).then(() => { |
|
|
|
|
|
|
|
this.added = true |
|
|
|
this.$post(`${this.api.deleteCategory}?categoryId=${row.data.id}`).then(res => { |
|
|
|
this.$post(`${this.api.deleteCategory}?categoryId=${row.data.id}`).then(res => { |
|
|
|
this.$message.success('删除成功') |
|
|
|
this.$message.success('删除成功') |
|
|
|
this.getType() |
|
|
|
this.getType() |
|
|
@ -275,6 +288,7 @@ export default { |
|
|
|
confirmType(){ |
|
|
|
confirmType(){ |
|
|
|
if(this.submited) return false |
|
|
|
if(this.submited) return false |
|
|
|
this.submited = true |
|
|
|
this.submited = true |
|
|
|
|
|
|
|
this.added = true |
|
|
|
if(this.id){ |
|
|
|
if(this.id){ |
|
|
|
this.$post(this.api.updateCategory,{ |
|
|
|
this.$post(this.api.updateCategory,{ |
|
|
|
id: this.id, |
|
|
|
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])) |
|
|
|
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 |
|
|
|
this.previewData = data |
|
|
|
if (!isEdit) this.previewVisible = true |
|
|
|
if (!isEdit) this.previewVisible = true |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => {}) |
|
|
|