|
|
@@ -34,9 +34,7 @@
|
|
|
</template>
|
|
|
|
|
|
<template #table-column-inTurn="{scope}">
|
|
|
- <span v-if="!scope.row._inTurn" @click="showSort(scope.row)">{{
|
|
|
- scope.row.inTurn
|
|
|
- }}</span>
|
|
|
+ <span v-if="!sort.status">{{ scope.row.inTurn }}</span>
|
|
|
|
|
|
<el-input-number
|
|
|
ref="sort-input"
|
|
|
@@ -48,6 +46,25 @@
|
|
|
></el-input-number>
|
|
|
</template>
|
|
|
|
|
|
+ <!-- 排序 -->
|
|
|
+ <template #table-header-inTurn>
|
|
|
+ <div class="set-sort">
|
|
|
+ <span>排序</span>
|
|
|
+ <el-button
|
|
|
+ v-if="!sort.status"
|
|
|
+ icon="el-icon-edit-outline"
|
|
|
+ size="small"
|
|
|
+ type="text"
|
|
|
+ @click="showSort"
|
|
|
+ class="show"
|
|
|
+ ></el-button>
|
|
|
+
|
|
|
+ <el-button class="hide" v-else size="mini" @click="hideSort" type="primary"
|
|
|
+ >完成</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
<!-- 添加商品 -->
|
|
|
<template #slot-add-goods-btn="{scope}">
|
|
|
<el-button type="primary" size="mini" @click="addFn">添加</el-button>
|
|
|
@@ -128,7 +145,10 @@ export default {
|
|
|
key: '0'
|
|
|
}
|
|
|
],
|
|
|
- selects: {}
|
|
|
+ selects: {},
|
|
|
+ sort: {
|
|
|
+ status: false
|
|
|
+ }
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -136,7 +156,6 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
handleClick(tab, e) {
|
|
|
- console.log(tab, e);
|
|
|
this.app.refresh({ type: this.tabIndex });
|
|
|
},
|
|
|
// 打开链接
|
|
|
@@ -287,16 +306,14 @@ export default {
|
|
|
},
|
|
|
|
|
|
showSort(e) {
|
|
|
- this.$set(e, '_inTurn', true);
|
|
|
+ this.sort.status = true;
|
|
|
+ },
|
|
|
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs['sort-input'].focus();
|
|
|
- });
|
|
|
+ hideSort(e) {
|
|
|
+ this.sort.status = false;
|
|
|
},
|
|
|
|
|
|
changeSort(d) {
|
|
|
- d._inTurn = false;
|
|
|
-
|
|
|
this.$service.goods
|
|
|
.sort({
|
|
|
inTurn: d.inTurn,
|
|
|
@@ -304,6 +321,7 @@ export default {
|
|
|
})
|
|
|
.then(() => {
|
|
|
this.$message.success('修改成功');
|
|
|
+ this.refresh();
|
|
|
})
|
|
|
.catch(err => {
|
|
|
this.$message.error(err);
|
|
|
@@ -319,4 +337,22 @@ export default {
|
|
|
margin-left: 10px;
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
+
|
|
|
+.set-sort {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+
|
|
|
+ .el-button {
|
|
|
+ margin-left: 10px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .show {
|
|
|
+ font-size: 16px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .hide {
|
|
|
+ padding: 2px 5px;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|