|
@@ -60,6 +60,7 @@ export default {
|
|
|
selectionList: [],
|
|
|
dealerOptions: [],
|
|
|
brandOptions: [],
|
|
|
+ categoryOptions: [], // 添加分类选项数组
|
|
|
option: {
|
|
|
height: 'auto',
|
|
|
calcHeight: 30,
|
|
@@ -88,6 +89,18 @@ export default {
|
|
|
}]
|
|
|
},
|
|
|
{
|
|
|
+ label: "客户编号",
|
|
|
+ prop: "customerCode",
|
|
|
+ type: "text",
|
|
|
+ span: 12,
|
|
|
+ search: true,
|
|
|
+ rules: [{
|
|
|
+ required: true,
|
|
|
+ message: "请输入客户编号",
|
|
|
+ trigger: "blur"
|
|
|
+ }]
|
|
|
+ },
|
|
|
+ {
|
|
|
label: "发布时间",
|
|
|
prop: "publishTime",
|
|
|
type: "datetime",
|
|
@@ -140,6 +153,40 @@ export default {
|
|
|
}]
|
|
|
},
|
|
|
{
|
|
|
+ label: "分类",
|
|
|
+ prop: "categoryId",
|
|
|
+ type: "select",
|
|
|
+ dicData: [], // 初始为空,通过loadCategoryOptions方法动态加载
|
|
|
+ props: {
|
|
|
+ label: "categoryName", // 根据后端返回的字段名调整
|
|
|
+ value: "id"
|
|
|
+ },
|
|
|
+ search: true,
|
|
|
+ span: 12,
|
|
|
+ rules: [{
|
|
|
+ required: true,
|
|
|
+ message: "请选择分类",
|
|
|
+ trigger: "change"
|
|
|
+ }]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "角色",
|
|
|
+ prop: "roleType",
|
|
|
+ type: "select",
|
|
|
+ dicData: [
|
|
|
+ { label: "工厂", value: "factory" },
|
|
|
+ { label: "经销商", value: "dealer" },
|
|
|
+ { label: "零售商", value: "retailer" }
|
|
|
+ ],
|
|
|
+ search: true,
|
|
|
+ span: 12,
|
|
|
+ rules: [{
|
|
|
+ required: true,
|
|
|
+ message: "请选择角色",
|
|
|
+ trigger: "change"
|
|
|
+ }]
|
|
|
+ },
|
|
|
+ {
|
|
|
label: "详情",
|
|
|
prop: "detail",
|
|
|
slot: true,
|
|
@@ -209,8 +256,31 @@ export default {
|
|
|
created() {
|
|
|
this.loadDealerOptions();
|
|
|
this.loadBrandOptions();
|
|
|
+ this.loadCategoryOptions(); // 添加分类加载
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 加载分类选项
|
|
|
+ loadCategoryOptions() {
|
|
|
+ getCategoryList().then(res => {
|
|
|
+ this.categoryOptions = res.data.data || [];
|
|
|
+ const categoryColumn = this.option.column.find(col => col.prop === 'categoryId');
|
|
|
+ if (categoryColumn) {
|
|
|
+ categoryColumn.dicData = this.categoryOptions;
|
|
|
+ }
|
|
|
+ }).catch(() => {
|
|
|
+ // 如果接口不存在,使用模拟数据
|
|
|
+ this.categoryOptions = [
|
|
|
+ { id: 1, categoryName: '系统公告', value: 1, label: '系统公告' },
|
|
|
+ { id: 2, categoryName: '产品公告', value: 2, label: '产品公告' },
|
|
|
+ { id: 3, categoryName: '活动公告', value: 3, label: '活动公告' },
|
|
|
+ { id: 4, categoryName: '维护公告', value: 4, label: '维护公告' }
|
|
|
+ ];
|
|
|
+ const categoryColumn = this.option.column.find(col => col.prop === 'categoryId');
|
|
|
+ if (categoryColumn) {
|
|
|
+ categoryColumn.dicData = this.categoryOptions;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
// 查看详情
|
|
|
viewDetail(row) {
|
|
|
this.currentDetail = row;
|