Merge branch 'gh' of https://e.coding.net/g-cphe0354/yinshoukeguanliduan/management into test
This commit is contained in:
commit
ae82be372d
|
|
@ -64,6 +64,8 @@
|
|||
// import Sortable from 'sortablejs'
|
||||
import addClassify from './components/addClassify'
|
||||
import { tbShopCategoryGet, tbShopCategoryDelete, tbShopCategoryPost, upCategorySort } from '@/api/shop'
|
||||
import { hasPermission } from '@/utils/limits.js'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
addClassify
|
||||
|
|
@ -114,6 +116,9 @@ export default {
|
|||
// },
|
||||
// 状态切换
|
||||
async showChange(e, row) {
|
||||
let res = await hasPermission('允许修改分类');
|
||||
if ( !res) { row.isShow = (e == 0 ? 1 : 0);return; }
|
||||
|
||||
try {
|
||||
await tbShopCategoryPost(row, 'put')
|
||||
this.getTableData()
|
||||
|
|
@ -141,6 +146,8 @@ export default {
|
|||
},
|
||||
// 删除
|
||||
async delHandle(ids) {
|
||||
let res = await hasPermission('允许修改分类');
|
||||
if ( !res) { return; }
|
||||
try {
|
||||
await tbShopCategoryDelete(ids)
|
||||
this.$notify({
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@
|
|||
<script>
|
||||
import Sortable from 'sortablejs'
|
||||
import addGroup from '../components/addGroup'
|
||||
import { hasPermission } from '@/utils/limits.js'
|
||||
import { tbProductGroupGet, tbProductGroupDelete, tbProductGroupPut, upGroupSort } from '@/api/shop'
|
||||
export default {
|
||||
components: {
|
||||
|
|
@ -92,12 +93,15 @@ export default {
|
|||
return a + ' - ' + ciri + b
|
||||
},
|
||||
//表格拖拽
|
||||
tableDrag() {
|
||||
async tableDrag() {
|
||||
|
||||
const el = document.querySelector('#table_drag .el-table__body-wrapper tbody')
|
||||
new Sortable(el, {
|
||||
animation: 150,
|
||||
onEnd: async e => {
|
||||
// console.log('拖拽结束===', e);
|
||||
let res = await hasPermission('允许修改分组');
|
||||
if ( !res) { return; }
|
||||
if (e.oldIndex == e.newIndex) return
|
||||
let oid = this.tableData.list[e.oldIndex].id
|
||||
let nid = this.tableData.list[e.newIndex].id
|
||||
|
|
@ -117,6 +121,9 @@ export default {
|
|||
},
|
||||
// 状态切换
|
||||
async showChange(e, row) {
|
||||
let res = await hasPermission('允许修改分组');
|
||||
if ( !res) { row.isShow = (e == 0 ? 1 : 0);return; }
|
||||
|
||||
try {
|
||||
await tbProductGroupPut(row)
|
||||
this.getTableData()
|
||||
|
|
@ -136,6 +143,8 @@ export default {
|
|||
},
|
||||
// 删除
|
||||
async delHandle(ids) {
|
||||
let res = await hasPermission('允许修改分组');
|
||||
if ( !res) { return; }
|
||||
try {
|
||||
await tbProductGroupDelete(ids)
|
||||
this.$notify({
|
||||
|
|
|
|||
|
|
@ -20,9 +20,9 @@
|
|||
</div>
|
||||
<div class="head-container">
|
||||
<div class="header_wrap">
|
||||
<router-link :to="{ name: 'add_shop' }">
|
||||
<el-button type="primary" icon="el-icon-plus">添加商品</el-button>
|
||||
</router-link>
|
||||
<!-- <router-link :to="{ name: 'add_shop' }" > -->
|
||||
<el-button type="primary" icon="el-icon-plus" @click="toPath( '/product/add_shop')">添加商品</el-button>
|
||||
<!-- </router-link> -->
|
||||
<el-select v-model="tableData.sort" placeholder="排序" @change="getTableData">
|
||||
<el-option value="createdAt,desc" label="创建时间"></el-option>
|
||||
<el-option value="stockNumber,asc" label="数量由低到高"></el-option>
|
||||
|
|
@ -318,7 +318,11 @@ export default {
|
|||
async toPath ( path , row) {
|
||||
let res = await hasPermission('允许修改商品');
|
||||
if ( !res) { return; }
|
||||
this.$router.push({path: path, query: { goods_id: row.id }})
|
||||
let query = {};
|
||||
if ( row ) {
|
||||
query.goods_id = row.id;
|
||||
}
|
||||
this.$router.push({path: path, query: query})
|
||||
},
|
||||
// 显示修改商品警告线
|
||||
showStockWarningHandle() {
|
||||
|
|
@ -431,7 +435,9 @@ export default {
|
|||
}
|
||||
},
|
||||
// 显示绑定耗材
|
||||
showBindCons(item) {
|
||||
async showBindCons(item) {
|
||||
let res = await hasPermission('允许修改商品');
|
||||
if ( !res) { return; }
|
||||
// console.log(item);
|
||||
this.$refs.bindCons.show(item)
|
||||
},
|
||||
|
|
@ -555,6 +561,8 @@ export default {
|
|||
},
|
||||
// 删除商品
|
||||
async delTableHandle(ids) {
|
||||
let res = await hasPermission('允许修改商品');
|
||||
if ( !res) { return; }
|
||||
try {
|
||||
await tbProductDelete(ids)
|
||||
this.getTableData()
|
||||
|
|
|
|||
Loading…
Reference in New Issue