Commit 1972f16f by lixiaomin

修改店铺商品限制

parent 029a3a72
...@@ -167,3 +167,10 @@ export function testStart(shopId){ ...@@ -167,3 +167,10 @@ export function testStart(shopId){
}); });
} }
// 店铺是否绑定机器
export function checkMachine(id) {
return request({
url: "/system/machine/bind/check/" + id,
method: "get",
});
}
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
</el-button> </el-button>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-button type="primary" @click="openSelectGoos" plain icon="el-icon-plus" size="small">添加商品 <el-button type="primary" @click="openSelectGoos" plain icon="el-icon-plus" size="small" :disabled="showButton">添加商品
</el-button> </el-button>
<el-button type="danger" @click="soldOutGoos" plain icon="el-icon-minus" size="small">下架商品</el-button> <el-button type="danger" @click="soldOutGoos" plain icon="el-icon-minus" size="small">下架商品</el-button>
</el-col> </el-col>
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
</template> </template>
<script> <script>
import { getCategoryGoods, addGoods ,offGoods,turnList} from "@/api/system/shop"; import { getCategoryGoods, addGoods ,offGoods,turnList,checkMachine} from "@/api/system/shop";
import SelectGoods from '@/components/SelectGoods'; import SelectGoods from '@/components/SelectGoods';
import AddRecommend from './addRecommend.vue' import AddRecommend from './addRecommend.vue'
import Preferential from './preferential.vue'; import Preferential from './preferential.vue';
...@@ -115,7 +115,8 @@ export default { ...@@ -115,7 +115,8 @@ export default {
btnId: '', btnId: '',
outIds: '', outIds: '',
total: null, total: null,
goodsList:[] goodsList:[],
showButton:true
} }
}, },
mounted() { mounted() {
...@@ -154,6 +155,9 @@ export default { ...@@ -154,6 +155,9 @@ export default {
}, },
getList() { getList() {
if (!this.shopId) return; if (!this.shopId) return;
checkMachine(this.shopId).then(({ data }) => {
if(data){
this.showButton=false;
this.list=[]; this.list=[];
getCategoryGoods(this.shopId).then(({ data }) => { getCategoryGoods(this.shopId).then(({ data }) => {
if (data && data.length > 0) { if (data && data.length > 0) {
...@@ -175,6 +179,12 @@ export default { ...@@ -175,6 +179,12 @@ export default {
this.options=[]; this.options=[];
} }
}) })
}else{
this.$message.error('请先绑定店铺机器!');
this.showButton=true;
}
})
}, },
// 多选框选中数据 // 多选框选中数据
handleSelectionChange(selection) { handleSelectionChange(selection) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment