aaa
nidapeng
2024-03-14 8b46c471e28fbf0b71efbe363facf0bf05d8f6f8
company/src/views/business/solutions.vue
@@ -11,6 +11,12 @@
                    <el-option label="禁用" value="1"></el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="类型" prop="type" >
                <el-select v-model="searchForm.type" placeholder="请选择" @keypress.enter.native="search">
                    <el-option label="直保" value="0"></el-option>
                    <el-option label="委托投保" value="1"></el-option>
                </el-select>
            </el-form-item>
            <section>
                <el-button type="primary" @click="search">搜索</el-button>
                <el-button @click="reset">重置</el-button>
@@ -55,6 +61,12 @@
                        <span v-if="row.timeUnit === 3">年</span>
                    </template>
                </el-table-column>
                <el-table-column label="委托类型" min-width="100px">
                    <template slot-scope="{row}">
                        <span v-if="row.type === 0">直保</span>
                        <span v-if="row.type === 1">委托:<span style="color: blue" >{{row.shopName||'-'}}</span></span>
                    </template>
                </el-table-column>
                <el-table-column prop="status" label="启用状态" min-width="100px" v-if="userInfo.type !== 1">
                    <template slot-scope="{row}">
                        <el-switch
@@ -97,54 +109,55 @@
</template>
<script>
    import BaseTable from '@/components/base/BaseTable'
    import TableLayout from '@/layouts/TableLayout'
    import Pagination from '@/components/common/Pagination'
    import OperaSolutionsWindow from '@/components/business/OperaSolutionsWindow'
    import OperaSolutionsDescWindow from '@/components/business/OperaSolutionsDescWindow'
    import { updateStatus } from '@/api/business/solutions'
    import { mapState } from 'vuex'
    export default {
        name: 'Solutions',
        extends: BaseTable,
        components: { TableLayout, Pagination, OperaSolutionsWindow, OperaSolutionsDescWindow },
        data () {
            return {
                // 搜索
                searchForm: {
                    name: '',
                    status: ''
                }
            }
        },
        computed: {
            ...mapState(['userInfo'])
        },
        created () {
            this.config({
                module: '保险方案信息表',
                api: '/business/solutions',
                'field.id': 'id',
                'field.main': 'id'
            })
            if (this.userInfo.type === 1) {
                this.searchForm.status = '0'
            } else {
                this.searchForm.status = ''
            }
            this.search()
        },
        methods: {
            // 修改状态
            changeStatus(status, row) {
                updateStatus({ id: row.id, status })
                    .then(res => {
                        this.search()
                    })
                    .catch(err => {
                        row.status = row.status === 0 ? 1 : 0
                    })
            }
        }
import BaseTable from '@/components/base/BaseTable'
import TableLayout from '@/layouts/TableLayout'
import Pagination from '@/components/common/Pagination'
import OperaSolutionsWindow from '@/components/business/OperaSolutionsWindow'
import OperaSolutionsDescWindow from '@/components/business/OperaSolutionsDescWindow'
import { updateStatus } from '@/api/business/solutions'
import { mapState } from 'vuex'
export default {
  name: 'Solutions',
  extends: BaseTable,
  components: { TableLayout, Pagination, OperaSolutionsWindow, OperaSolutionsDescWindow },
  data () {
    return {
      // 搜索
      searchForm: {
        name: '',
        status: '',
        type: ''
      }
    }
  },
  computed: {
    ...mapState(['userInfo'])
  },
  created () {
    this.config({
      module: '保险方案信息表',
      api: '/business/solutions',
      'field.id': 'id',
      'field.main': 'id'
    })
    if (this.userInfo.type === 1) {
      this.searchForm.status = '0'
    } else {
      this.searchForm.status = ''
    }
    this.search()
  },
  methods: {
    // 修改状态
    changeStatus (status, row) {
      updateStatus({ id: row.id, status })
        .then(res => {
          this.search()
        })
        .catch(err => {
          row.status = row.status === 0 ? 1 : 0
        })
    }
  }
}
</script>