|
@@ -29,13 +29,15 @@ export default {
|
|
|
return {
|
|
|
//表单配置项
|
|
|
fields: [
|
|
|
+ { label: '供货单位', model: 'mech_name', readonly: true },
|
|
|
{ label: '商品类型', model: 'type_name', type: 'select' },
|
|
|
{ label: '商品名称', model: 'name' },
|
|
|
- { label: '商品简介', model: 'brief', type: 'textarea' },
|
|
|
{ label: '商品价格', model: 'money' },
|
|
|
+ { label: '商品简介', model: 'brief', type: 'textarea' },
|
|
|
{ label: '商品图片', model: 'img_url', custom: true },
|
|
|
],
|
|
|
rules: {
|
|
|
+ mech_name: [{ required: true, message: '请输入供货单位' }],
|
|
|
type_name: [{ required: true, message: '请输入商品类型' }],
|
|
|
name: [{ required: true, message: '请输入商品名称' }],
|
|
|
brief: [{ required: true, message: '请输入商品简介' }],
|
|
@@ -44,8 +46,14 @@ export default {
|
|
|
},
|
|
|
};
|
|
|
},
|
|
|
- created() {},
|
|
|
+ async created() {
|
|
|
+ await this.search();
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ //查询数据
|
|
|
+ async search() {
|
|
|
+ if (this.user) this.form.mech_name = this.user.name;
|
|
|
+ },
|
|
|
toSave({ data }) {
|
|
|
this.$emit('toSave', { data: data });
|
|
|
},
|