|
@@ -117,9 +117,10 @@
|
|
<el-tag :type="JSON.parse(row.status).value === 'on' ? 'success' : 'info'">{{ JSON.parse(row.status).desc }}</el-tag>
|
|
<el-tag :type="JSON.parse(row.status).value === 'on' ? 'success' : 'info'">{{ JSON.parse(row.status).desc }}</el-tag>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="排序" prop="sort" sortable="custom" align="center" width="140px">
|
|
|
|
-<!-- 排序优先级-->
|
|
|
|
- <el-input-number v-model="sortNum" controls-position="right" :min="0" :max="999" size="small"></el-input-number>
|
|
|
|
|
|
+ <el-table-column label="排序" prop="sortWeight" sortable="custom" align="center" width="140px">
|
|
|
|
+ <template slot-scope="{row, $index}">
|
|
|
|
+ <el-input-number v-model="row.sortWeight" @change="handleSortChange($index,row.sortWeight)" controls-position="right" size="small"></el-input-number>
|
|
|
|
+ </template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column fixed="right" align="center" label="操作" width="140">
|
|
<el-table-column fixed="right" align="center" label="操作" width="140">
|
|
<template slot-scope="{row}">
|
|
<template slot-scope="{row}">
|
|
@@ -136,7 +137,7 @@
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
import { publicFileGetUrl } from "@/api/common"
|
|
import { publicFileGetUrl } from "@/api/common"
|
|
-import { getGoodsList, delGoods, setGoodsStatus } from '@/api/business/goods'
|
|
|
|
|
|
+import { getGoodsList, delGoods, setGoodsStatus, setTableData} from '@/api/business/goods'
|
|
import { goodsCategoryItems } from '@/api/business/category'
|
|
import { goodsCategoryItems } from '@/api/business/category'
|
|
import { goodsTagItems } from '@/api/business/tag'
|
|
import { goodsTagItems } from '@/api/business/tag'
|
|
import { accMul } from '@/utils/util'
|
|
import { accMul } from '@/utils/util'
|
|
@@ -152,7 +153,6 @@ export default {
|
|
total: 0,
|
|
total: 0,
|
|
goodsCategoryItemsList: [],
|
|
goodsCategoryItemsList: [],
|
|
goodsTagItemsList: [],
|
|
goodsTagItemsList: [],
|
|
- sortNum:0,
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
@@ -171,6 +171,16 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ //步进器修改
|
|
|
|
+ handleSortChange(index,sortWeight){
|
|
|
|
+ this.tableData[index].sortWeight = sortWeight
|
|
|
|
+ let data = {
|
|
|
|
+ goodsId: this.tableData[index].goodsId,
|
|
|
|
+ sortWeight: this.tableData[index].sortWeight
|
|
|
|
+ }
|
|
|
|
+ setTableData(data)
|
|
|
|
+ },
|
|
|
|
+
|
|
getGoodsCategoryItems(){
|
|
getGoodsCategoryItems(){
|
|
goodsCategoryItems({}).then(res => {
|
|
goodsCategoryItems({}).then(res => {
|
|
this.goodsCategoryItemsList = res && res.data
|
|
this.goodsCategoryItemsList = res && res.data
|
|
@@ -204,6 +214,7 @@ export default {
|
|
this.loading = false
|
|
this.loading = false
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
this.tableData = res.rows
|
|
this.tableData = res.rows
|
|
|
|
+ // this.tableData.map()
|
|
this.total = res.total
|
|
this.total = res.total
|
|
}
|
|
}
|
|
}).catch(() => {
|
|
}).catch(() => {
|