|
@@ -4,15 +4,14 @@
|
|
|
<block v-if="!$util.isEmpty(list.data)">
|
|
<block v-if="!$util.isEmpty(list.data)">
|
|
|
<div class="list" v-for="(item, index) in list.data" :key="index">
|
|
<div class="list" v-for="(item, index) in list.data" :key="index">
|
|
|
<div class="list-index">{{ item.id }}</div>
|
|
<div class="list-index">{{ item.id }}</div>
|
|
|
- <div class="list-det">
|
|
|
|
|
|
|
+ <div class="list-det" @click="editItem(item)">
|
|
|
<div class="app-size-28 app-color-0">{{ item.name || '' }}</div>
|
|
<div class="app-size-28 app-color-0">{{ item.name || '' }}</div>
|
|
|
<div class="list-operate">
|
|
<div class="list-operate">
|
|
|
<div class="operate-det">
|
|
<div class="operate-det">
|
|
|
<span>序号:{{ item.inTurn }}</span>
|
|
<span>序号:{{ item.inTurn }}</span>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="operate-icon" @click="editItem(item)">
|
|
|
|
|
- <i class="iconfont" :class="[ index == operateIndex ? 'iconbianji' : 'iconbianji']" style="font-size:38upx;"></i>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <view class="operate-icon"><i class="iconfont iconbianji" style="font-size:38upx;"></i></view>
|
|
|
|
|
+ <view class="operate-icon" @click.stop="delClass(item)"><i class="iconfont iconshanchu1" style="font-size:38upx;"></i></view>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -52,11 +51,7 @@ import AppUploader from '@/components/app-uploader'
|
|
|
import OperateModule from '@/admin/home/components/module/operate'
|
|
import OperateModule from '@/admin/home/components/module/operate'
|
|
|
import AppWrapperEmpty from '@/components/app-wrapper-empty'
|
|
import AppWrapperEmpty from '@/components/app-wrapper-empty'
|
|
|
import { list } from '@/mixins'
|
|
import { list } from '@/mixins'
|
|
|
-import { getList,addClass,updateClass} from '@/api/item-class'
|
|
|
|
|
-import { allProduct } from "@/api/product/index";
|
|
|
|
|
-// #ifdef APP-PLUS
|
|
|
|
|
-const plug= uni.requireNativePlugin('Html5app-Gprinter')
|
|
|
|
|
-// #endif
|
|
|
|
|
|
|
+import { getList,addClass,updateClass,delClass} from '@/api/item-class'
|
|
|
export default {
|
|
export default {
|
|
|
name: 'item-class-list',
|
|
name: 'item-class-list',
|
|
|
components: {
|
|
components: {
|
|
@@ -110,13 +105,13 @@ export default {
|
|
|
},
|
|
},
|
|
|
onPullDownRefresh() {
|
|
onPullDownRefresh() {
|
|
|
this.resetList()
|
|
this.resetList()
|
|
|
- this._list().then(res => {
|
|
|
|
|
|
|
+ this.getClassList().then(res => {
|
|
|
uni.stopPullDownRefresh()
|
|
uni.stopPullDownRefresh()
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
onReachBottom() {
|
|
onReachBottom() {
|
|
|
if (!this.list.finished) {
|
|
if (!this.list.finished) {
|
|
|
- this._list().then(res => {
|
|
|
|
|
|
|
+ this.getClassList().then(res => {
|
|
|
uni.stopPullDownRefresh()
|
|
uni.stopPullDownRefresh()
|
|
|
})
|
|
})
|
|
|
} else {
|
|
} else {
|
|
@@ -126,6 +121,17 @@ export default {
|
|
|
onLoad() {
|
|
onLoad() {
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ delClass(item){
|
|
|
|
|
+ let that = this
|
|
|
|
|
+ that.$util.confirmModal({content:'确认删除?此分类若还有花材将到移到默认分类'},() => {
|
|
|
|
|
+ delClass({id:item.id}).then(res=>{
|
|
|
|
|
+ if(res.code == 1){
|
|
|
|
|
+ that.$msg('删除成功')
|
|
|
|
|
+ that.getClassList()
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
editItem(item){
|
|
editItem(item){
|
|
|
this.modifyModal = true
|
|
this.modifyModal = true
|
|
|
this.modifyTitle = '编辑'
|
|
this.modifyTitle = '编辑'
|
|
@@ -149,9 +155,9 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
async init() {
|
|
async init() {
|
|
|
- this._list()
|
|
|
|
|
|
|
+ this.getClassList()
|
|
|
},
|
|
},
|
|
|
- _list() {
|
|
|
|
|
|
|
+ getClassList() {
|
|
|
return getList({page: this.list.page}).then(res => {
|
|
return getList({page: this.list.page}).then(res => {
|
|
|
this.completes(res)
|
|
this.completes(res)
|
|
|
})
|
|
})
|
|
@@ -171,7 +177,7 @@ export default {
|
|
|
this.operateCancle()
|
|
this.operateCancle()
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
this.resetList()
|
|
this.resetList()
|
|
|
- this._list()
|
|
|
|
|
|
|
+ this.getClassList()
|
|
|
}, 1000)
|
|
}, 1000)
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
@@ -284,7 +290,7 @@ export default {
|
|
|
margin-left:10upx;
|
|
margin-left:10upx;
|
|
|
}
|
|
}
|
|
|
.operate-icon{
|
|
.operate-icon{
|
|
|
- margin-left:30upx;
|
|
|
|
|
|
|
+ margin-left:5upx;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|