|
@@ -21,10 +21,7 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="商品类型"
|
|
|
prop="type">
|
|
|
- <el-select v-model="form.type"
|
|
|
- clearable
|
|
|
- filterable>
|
|
|
-
|
|
|
+ <el-select v-model="form.type">
|
|
|
<el-option label="乐器"
|
|
|
value="INSTRUMENT"></el-option>
|
|
|
<el-option label="辅件"
|
|
@@ -40,7 +37,6 @@
|
|
|
<el-form-item label="商品分类"
|
|
|
prop="goodsCategoryId">
|
|
|
<el-select v-model="form.goodsCategoryId"
|
|
|
- clearable
|
|
|
filterable>
|
|
|
<el-option v-for="item in categoryList"
|
|
|
:key="item.value"
|
|
@@ -102,7 +98,7 @@ import { categoryListTree, goodsAdd, goodsUpdate, goodsSingleQuery } from '@/api
|
|
|
// import store from '@/store'
|
|
|
import { getToken } from '@/utils/auth'
|
|
|
let validPrice = (rule, value, callback) => {
|
|
|
- if (!value.toString()) {
|
|
|
+ if (!value) {
|
|
|
callback(new Error('请输入金额'))
|
|
|
} else if (value < 0) {
|
|
|
callback(new Error('输入金额必须大于0'))
|
|
@@ -116,7 +112,7 @@ export default {
|
|
|
data () {
|
|
|
return {
|
|
|
categoryList: [],
|
|
|
- pageType: this.$route.query.params.type,
|
|
|
+ pageType: null,
|
|
|
headers: {
|
|
|
Authorization: getToken()
|
|
|
},
|
|
@@ -165,11 +161,17 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
created () {
|
|
|
- if (this.$route.query.search) {
|
|
|
- this.Fsearch = this.$route.query.search;
|
|
|
+ let query = this.$route.query
|
|
|
+ if(query.paramInfo) {
|
|
|
+ let paramInfo = JSON.parse(query.paramInfo)
|
|
|
+ this.pageType = paramInfo.type
|
|
|
+ this.id = paramInfo.id
|
|
|
+ }
|
|
|
+ if (query.search) {
|
|
|
+ this.Fsearch = query.search;
|
|
|
}
|
|
|
- if (this.$route.query.pageInfo) {
|
|
|
- this.Frules = this.$route.query.pageInfo
|
|
|
+ if (query.pageInfo) {
|
|
|
+ this.Frules = query.pageInfo
|
|
|
}
|
|
|
},
|
|
|
mounted () {
|
|
@@ -214,7 +216,7 @@ export default {
|
|
|
},
|
|
|
getList () {
|
|
|
if (this.pageType == 'create') return false
|
|
|
- goodsSingleQuery(this.$route.query.params.id).then(res => {
|
|
|
+ goodsSingleQuery(this.id).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
let result = res.data
|
|
|
this.form = {
|