|
@@ -11,6 +11,7 @@
|
|
|
:size="size"
|
|
|
@page-curr-change="handlePageChange"
|
|
|
@page-size-change="handleSizeChange"
|
|
|
+ @selection-change="(list) => (selected = list)"
|
|
|
@screen-reset="
|
|
|
pageInfo.curr = 1;
|
|
|
parmValue.page = 1;
|
|
@@ -90,6 +91,30 @@
|
|
|
</el-button></el-col
|
|
|
>
|
|
|
</el-row>
|
|
|
+
|
|
|
+ <el-row style="margin-top:10px">
|
|
|
+ <el-button
|
|
|
+ v-if="powers.some((i) => i == '004')"
|
|
|
+ type="danger"
|
|
|
+ class="fr"
|
|
|
+ style="margin: 0 0 0 10px"
|
|
|
+ :size="searchSize"
|
|
|
+ @click="batchUpdateStatus('0')"
|
|
|
+ >
|
|
|
+ 批量禁用
|
|
|
+ </el-button>
|
|
|
+
|
|
|
+ <el-button
|
|
|
+ v-if="powers.some((i) => i == '004')"
|
|
|
+ type="success"
|
|
|
+ class="fr"
|
|
|
+ style="margin: 0 0 0 10px"
|
|
|
+ :size="searchSize"
|
|
|
+ @click="batchUpdateStatus('1')"
|
|
|
+ >
|
|
|
+ 批量启用
|
|
|
+ </el-button>
|
|
|
+ </el-row>
|
|
|
</div>
|
|
|
</template>
|
|
|
<template #status="{ scope }">
|
|
@@ -103,28 +128,7 @@
|
|
|
</template>
|
|
|
|
|
|
<template #operation="{ scope }">
|
|
|
- <!-- <el-tooltip
|
|
|
- effect="dark"
|
|
|
- content="详情"
|
|
|
- v-if="powers.some((i) => i == '007')"
|
|
|
- placement="top"
|
|
|
- >
|
|
|
- <i
|
|
|
- class="el-icon-view tb-icon"
|
|
|
- @click="openModal(scope.row.id, 'view')"
|
|
|
- ></i>
|
|
|
- </el-tooltip>
|
|
|
<el-tooltip
|
|
|
- effect="dark"
|
|
|
- content="修改"
|
|
|
- v-if="powers.some((i) => i == '005') && scope.row.status + '' === '0'"
|
|
|
- placement="top"
|
|
|
- >
|
|
|
- <i
|
|
|
- class="el-icon-edit tb-icon"
|
|
|
- @click="openModal(scope.row.id, 'edit')"
|
|
|
- ></i> </el-tooltip > -->
|
|
|
- <el-tooltip
|
|
|
v-if="powers.some((i) => i == '004') && scope.row.status + '' === '1'"
|
|
|
effect="dark"
|
|
|
content="禁用"
|
|
@@ -208,6 +212,7 @@ export default {
|
|
|
{ id: "0", name: "禁用" },
|
|
|
{ id: "1", name: "启用" },
|
|
|
],
|
|
|
+ selected:[],
|
|
|
showModel: false,
|
|
|
modelSitem: null,
|
|
|
modelId: "",
|
|
@@ -251,6 +256,37 @@ export default {
|
|
|
this.searchList();
|
|
|
},
|
|
|
methods: {
|
|
|
+ async batchUpdateStatus(status){
|
|
|
+ if(this.selected.length == 0){
|
|
|
+ this.$message.warning("请选择至少一条记录");
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ const id = this.selected.map(item => item.id);
|
|
|
+ const params = { id, status }
|
|
|
+
|
|
|
+ try{
|
|
|
+ this.loading = true;
|
|
|
+ const res = await asyncRequest.status(params);
|
|
|
+ if (res && res.code === 0) {
|
|
|
+ this.loading = false;
|
|
|
+ this.$notify.success({
|
|
|
+ title: "状态修改成功!",
|
|
|
+ message: "",
|
|
|
+ });
|
|
|
+ await this.searchList();
|
|
|
+ } else if (res && res.code >= 100 && res.code <= 104) {
|
|
|
+ await this.logout();
|
|
|
+ } else {
|
|
|
+ this.loading = false;
|
|
|
+ this.$message.warning(res.message);
|
|
|
+ }
|
|
|
+ } catch(err){
|
|
|
+ console.log(err)
|
|
|
+ } finally {
|
|
|
+ this.loading = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
supplierChange(e){
|
|
|
const { code } = e;
|
|
|
this.parmValue.supplierNo = code ? [code] : [];
|
|
@@ -299,7 +335,8 @@ export default {
|
|
|
.then(async () => {
|
|
|
this.loading = true;
|
|
|
const model = {
|
|
|
- id: id, status: status + '' === "1" ? "0" : "1",
|
|
|
+ id: [id],
|
|
|
+ status: status + '' === "1" ? "0" : "1",
|
|
|
};
|
|
|
const res = await asyncRequest.status(model);
|
|
|
if (res && res.code === 0) {
|