|
@@ -141,6 +141,20 @@
|
|
|
>-->
|
|
>-->
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
|
|
+ <template v-slot:isEnabled="{ row }">
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <el-switch
|
|
|
|
|
+ v-model="row.isEnabled"
|
|
|
|
|
+ active-color="#13ce66"
|
|
|
|
|
+ inactive-color="#ff4949"
|
|
|
|
|
+ :active-value="1"
|
|
|
|
|
+ :inactive-value="0"
|
|
|
|
|
+ @change="changeEnable(row)"
|
|
|
|
|
+ >
|
|
|
|
|
+ </el-switch>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+
|
|
|
<template v-slot:componentAttribute="{ row }">
|
|
<template v-slot:componentAttribute="{ row }">
|
|
|
<div>
|
|
<div>
|
|
|
<!-- {{ }} -->
|
|
<!-- {{ }} -->
|
|
@@ -306,7 +320,8 @@
|
|
|
getMaterialList,
|
|
getMaterialList,
|
|
|
removeMaterial,
|
|
removeMaterial,
|
|
|
importCategorySparePart,
|
|
importCategorySparePart,
|
|
|
- exportFile
|
|
|
|
|
|
|
+ exportFile,
|
|
|
|
|
+ changeOnOff
|
|
|
} from '@/api/material/list.js';
|
|
} from '@/api/material/list.js';
|
|
|
|
|
|
|
|
import { getBomGetById } from '@/api/material/BOM.js';
|
|
import { getBomGetById } from '@/api/material/BOM.js';
|
|
@@ -675,7 +690,9 @@
|
|
|
prop: 'isEnabled',
|
|
prop: 'isEnabled',
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
label: '状态',
|
|
label: '状态',
|
|
|
|
|
+ slot: 'isEnabled',
|
|
|
showOverflowTooltip: true,
|
|
showOverflowTooltip: true,
|
|
|
|
|
+ fixed: 'right',
|
|
|
formatter: (row, column) => {
|
|
formatter: (row, column) => {
|
|
|
return row.isEnabled === 0
|
|
return row.isEnabled === 0
|
|
|
? '停用'
|
|
? '停用'
|
|
@@ -736,6 +753,17 @@
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ async changeEnable(row) {
|
|
|
|
|
+ const res = await changeOnOff(row.id);
|
|
|
|
|
+ if (res.code == 0) {
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ type: 'success',
|
|
|
|
|
+ message: '修改成功',
|
|
|
|
|
+ customClass: 'ele-message-border'
|
|
|
|
|
+ });
|
|
|
|
|
+ this.reload();
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
onSortChange(e) {
|
|
onSortChange(e) {
|
|
|
console.log(e, '99999999');
|
|
console.log(e, '99999999');
|
|
|
|
|
|