|
@@ -25,14 +25,17 @@
|
|
|
permission="'goods/update'"
|
|
|
@click="onShopComAdd">添加组合商品</el-button>
|
|
|
<!-- 搜索类型 -->
|
|
|
- <el-form :inline="true"
|
|
|
+ <save-form :inline="true"
|
|
|
class="searchForm"
|
|
|
- v-model.trim="searchForm">
|
|
|
- <el-form-item>
|
|
|
- <el-input v-model.trim="searchForm.search"
|
|
|
+ ref="searchForm"
|
|
|
+ @submit="onSearch"
|
|
|
+ @reset="onReset"
|
|
|
+ :model="searchForm">
|
|
|
+ <el-form-item prop="search">
|
|
|
+ <el-input v-model.trim="searchForm.search" clearable
|
|
|
placeholder="商品编号/货号/商品名称"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item>
|
|
|
+ <el-form-item prop="type">
|
|
|
<el-select v-model.trim="searchForm.type"
|
|
|
clearable
|
|
|
placeholder="商品类型">
|
|
@@ -42,7 +45,7 @@
|
|
|
:value="item.value"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item>
|
|
|
+ <el-form-item prop="goodsCategoryId">
|
|
|
<el-select v-model.trim="searchForm.goodsCategoryId"
|
|
|
clearable
|
|
|
placeholder="商品分类">
|
|
@@ -52,7 +55,7 @@
|
|
|
:value="item.value"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item>
|
|
|
+ <el-form-item prop="status">
|
|
|
<el-select v-model.trim="searchForm.status"
|
|
|
clearable
|
|
|
placeholder="是否是上架">
|
|
@@ -62,7 +65,7 @@
|
|
|
value="0"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item>
|
|
|
+ <el-form-item prop="groupGoods">
|
|
|
<el-select v-model.trim="searchForm.groupGoods"
|
|
|
clearable
|
|
|
placeholder="是否是组合商品">
|
|
@@ -72,7 +75,7 @@
|
|
|
value="0"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item>
|
|
|
+ <el-form-item prop="clientShow">
|
|
|
<el-select v-model.trim="searchForm.clientShow"
|
|
|
clearable
|
|
|
placeholder="学生端是否是展示">
|
|
@@ -82,7 +85,7 @@
|
|
|
value="0"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item>
|
|
|
+ <el-form-item prop="educationalShow">
|
|
|
<el-select v-model.trim="searchForm.educationalShow"
|
|
|
clearable
|
|
|
placeholder="教务端是否是展示">
|
|
@@ -92,7 +95,7 @@
|
|
|
value="0"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item>
|
|
|
+ <el-form-item prop="musicGroupShow">
|
|
|
<el-select v-model.trim="searchForm.musicGroupShow"
|
|
|
clearable
|
|
|
placeholder="乐团是否是展示">
|
|
@@ -108,12 +111,10 @@
|
|
|
end-placeholder="结束日期"></el-date-picker>
|
|
|
</el-form-item> -->
|
|
|
<el-form-item>
|
|
|
- <el-button type="danger"
|
|
|
- @click="onSearch">搜索</el-button>
|
|
|
- <el-button type="primary"
|
|
|
- @click="onReset">重置</el-button>
|
|
|
+ <el-button type="danger" native-type="submit">搜索</el-button>
|
|
|
+ <el-button type="primary" native-type="reset">重置</el-button>
|
|
|
</el-form-item>
|
|
|
- </el-form>
|
|
|
+ </save-form>
|
|
|
<!-- 列表 -->
|
|
|
<div class="tableWrap">
|
|
|
<el-table :data='tableList'
|
|
@@ -300,7 +301,7 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
- <pagination :total="pageInfo.total"
|
|
|
+ <pagination sync :total.sync="pageInfo.total"
|
|
|
:page.sync="pageInfo.page"
|
|
|
:limit.sync="pageInfo.limit"
|
|
|
:page-sizes="pageInfo.page_size"
|
|
@@ -728,28 +729,14 @@ export default {
|
|
|
selectGoodsList: []
|
|
|
}
|
|
|
},
|
|
|
- created () {
|
|
|
- this.init()
|
|
|
- },
|
|
|
- activated () {
|
|
|
- this.init()
|
|
|
- },
|
|
|
mounted () {
|
|
|
-
|
|
|
+ this.init()
|
|
|
},
|
|
|
methods: {
|
|
|
permission (str) {
|
|
|
return permission(str);
|
|
|
},
|
|
|
init () {
|
|
|
- if (this.$route.query.searchForm) {
|
|
|
- this.$route.query.searchForm instanceof Object ? this.searchForm = this.$route.query.searchForm : this.searchForm =
|
|
|
- JSON.parse(this.$route.query.searchForm);
|
|
|
- }
|
|
|
- if (this.$route.query.pageInfo) {
|
|
|
- this.$route.query.pageInfo instanceof Object ? this.pageInfo = this.$route.query.pageInfo : this.pageInfo =
|
|
|
- JSON.parse(this.$route.query.pageInfo);
|
|
|
- }
|
|
|
this.getList()
|
|
|
this.getCategory()
|
|
|
},
|
|
@@ -789,15 +776,11 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
onPurchaseList (row) {
|
|
|
- let pageInfo = JSON.stringify(this.pageInfo)
|
|
|
- let search = JSON.stringify(this.searchForm)
|
|
|
this.$router.push({
|
|
|
path: '/shopManager/purchaseLlist',
|
|
|
query: {
|
|
|
name: row.name,
|
|
|
- goodsId: row.id,
|
|
|
- pageInfo,
|
|
|
- search
|
|
|
+ goodsId: row.id
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -860,15 +843,7 @@ export default {
|
|
|
this.getList()
|
|
|
},
|
|
|
onReset () { // 重置
|
|
|
- this.searchForm = {
|
|
|
- search: null,
|
|
|
- groupGoods: null,
|
|
|
- type: null,
|
|
|
- status: null,
|
|
|
- goodsCategoryId: null,
|
|
|
- startTime: null,
|
|
|
- endTime: null
|
|
|
- }
|
|
|
+ this.$refs.searchForm.resetFields()
|
|
|
this.getList()
|
|
|
},
|
|
|
onShopComAdd () {
|
|
@@ -925,8 +900,6 @@ export default {
|
|
|
if (row) {
|
|
|
params.id = row.id
|
|
|
}
|
|
|
- let pageInfo = JSON.stringify(this.pageInfo)
|
|
|
- let searchForm = JSON.stringify(this.searchForm)
|
|
|
let paramInfo = JSON.stringify(params)
|
|
|
this.addType = type
|
|
|
this.addDisabled = type == 'look' ? true : false
|
|
@@ -951,13 +924,19 @@ export default {
|
|
|
this.onValidGoodsStatus()
|
|
|
this.getAllGoodsList()
|
|
|
} else {
|
|
|
+ let pageTitle = '添加'
|
|
|
+ if(type == 'update') {
|
|
|
+ pageTitle = '修改'
|
|
|
+ } else if(type == 'look') {
|
|
|
+ pageTitle = '查看'
|
|
|
+ }
|
|
|
this.$router.push({
|
|
|
path: '/shopManager/shopOperation',
|
|
|
query: {
|
|
|
- searchForm,
|
|
|
- paramInfo,
|
|
|
- pageInfo
|
|
|
+ paramInfo
|
|
|
}
|
|
|
+ }, (route) => {
|
|
|
+ route.meta.title = pageTitle + '商品'
|
|
|
})
|
|
|
}
|
|
|
},
|