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