82 行
3.2 KiB
HTML
可执行文件
82 行
3.2 KiB
HTML
可执行文件
<!--[1.7.90]-->
|
|
<div id="manageSet" style="padding-bottom: 80px" v-loading="loading"
|
|
element-loading-text="数据加载中,请等待"
|
|
element-loading-spinner="el-icon-loading">
|
|
<el-form id="forms" label-width="68px">
|
|
<div>
|
|
<el-alert title="未勾选的门店将关闭" type="warning" :show-icon="false"></el-alert>
|
|
<el-form-item label="门店选择">
|
|
<el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">全选
|
|
</el-checkbox>
|
|
<el-checkbox-group v-model="checkedStore" @change="handleCheckedStoreChange">
|
|
<div v-for="(item,index) in stores" :key="index">
|
|
<el-checkbox :label="item.id">{{item.storetag}}</el-checkbox>
|
|
</div>
|
|
</el-checkbox-group>
|
|
</el-form-item>
|
|
</div>
|
|
</el-form>
|
|
<div class="footer-button-box">
|
|
<el-button type="primary" @click="sureSetManage">确 定</el-button>
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
var manageSet = new Vue({
|
|
el: "#manageSet",
|
|
data: {
|
|
loading: false,
|
|
checkAll: false,
|
|
checkedStore: {$store_id},
|
|
isIndeterminate: true,
|
|
stores: {$stores},
|
|
allStoreId: []
|
|
},
|
|
methods: {
|
|
handleCheckAllChange(val) {
|
|
this.checkedStore = val ? this.allStoreId : [];
|
|
this.isIndeterminate = false;
|
|
},
|
|
handleCheckedStoreChange(value) {
|
|
let checkedCount = value.length;
|
|
this.checkAll = checkedCount === this.stores.length;
|
|
this.isIndeterminate = checkedCount > 0 && checkedCount < this.stores.length;
|
|
},
|
|
sureSetManage () {
|
|
this.$confirm('确认对门店进行此操作吗?', '温馨提示', {
|
|
confirmButtonText: '确定',
|
|
cancelButtonText: '取消',
|
|
type: 'warning'
|
|
}).then(() => {
|
|
$.ajax({
|
|
url: "{:U('manageSet')}",
|
|
type: "POST",
|
|
data: {
|
|
storeIds: this.checkedStore
|
|
},
|
|
success: (res)=> {
|
|
if (res.status == 1) {
|
|
this.$message({
|
|
type: 'success',
|
|
message: res.msg,
|
|
duration: 1000,
|
|
onClose: ()=> {
|
|
MenuApp.backPreview();
|
|
}
|
|
});
|
|
} else {
|
|
this.$message.error(res.msg);
|
|
}
|
|
}
|
|
})
|
|
}).catch(() => {
|
|
});
|
|
}
|
|
},
|
|
mounted () {
|
|
for (var i = 0; i < this.stores.length; i++) {
|
|
this.allStoreId.push(this.stores[i].id);
|
|
}
|
|
}
|
|
});
|
|
</script>
|