| | |
| | | <template slot-scope="{ row }"> |
| | | <el-switch v-if="row.type==1" |
| | | v-model="row.status" |
| | | @change="handleStatusChange($event, row)" |
| | | active-color="green" |
| | | inactive-color="#ff4949" |
| | | active-value="1" |
| | | inactive-value="0"> |
| | | :active-value="1" |
| | | :inactive-value="0"> |
| | | </el-switch> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | import BaseTable from '@/components/base/BaseTable' |
| | | import TableLayout from '@/layouts/TableLayout' |
| | | import Pagination from '@/components/common/Pagination' |
| | | import { listByParentId } from '@/api/business/areas' |
| | | import { listByParentId,updateStatus } from '@/api/business/areas' |
| | | import OperaCityPriceRuleWindow from '@/components/business/OperaCityPriceRuleWindow' |
| | | import OperaAreasWindow from '@/components/business/OperaAreasWindow' |
| | | export default { |
| | |
| | | }) |
| | | return array |
| | | }, |
| | | handleStatusChange (val, row) { |
| | | updateStatus({ id: row.id, status: val }).then(res => { |
| | | this.$tip.apiSuccess(res || '修改成功') |
| | | }).catch(e => { |
| | | row.status = val === 1 ? 0 : 1 |
| | | this.$tip.apiFailed(e) |
| | | }) |
| | | }, |
| | | load (tree, treeNode, resolve) { |
| | | this.treeMaps.set(tree.id, { tree, treeNode, resolve }) |
| | | listByParentId({ parentId: tree.id, type: tree.type + 1 }) |