jiangping
2025-03-26 ac0dd084332a6fad4ff7dc15ed4f8984d611a91f
admin/src/views/business/visitOrigin.vue
@@ -25,6 +25,13 @@
      >
        <el-table-column type="selection" width="55"></el-table-column>
        <el-table-column prop="title" label="拜访事由" min-width="200px"></el-table-column>
        <el-table-column prop="constructionType" label="是否施工作业" min-width="200px">
            <template slot-scope="{row}">
              <el-switch @change="changeType($event, row)" v-model="row.constructionType" active-color="#13ce66"
                         inactive-color="#ff4949" :active-value="1" :inactive-value="0">
              </el-switch>
            </template>
          </el-table-column>
        <el-table-column prop="sortnum" label="排序码"  min-width="100px"></el-table-column>
        <el-table-column prop="editDate" label="操作时间" min-width="200px"></el-table-column>
        <el-table-column
@@ -56,12 +63,14 @@
import TableLayout from '@/layouts/TableLayout'
import Pagination from '@/components/common/Pagination'
import OperaVisitreasonWindow from '@/components/business/OperaVisitreasonWindow'
import { updateWorkStatus } from '@/api/business/member'
export default {
  name: 'areaSet',
  extends: BaseTable,
  components: { TableLayout, Pagination, OperaVisitreasonWindow },
  data () {
    return {
      working: false,
      // 搜索
      searchForm: {
        title: ''
@@ -78,6 +87,21 @@
    this.search()
  },
  methods: {
    changeType (e, row) {
      this.working = true
      this.api.updateById({ id: row.id, constructionType: e })
        .then(res => {
          this.$tip.apiSuccess(res || '操作成功')
          this.search()
        })
        .catch(e => {
          this.$tip.apiFailed(e)
        })
        .finally(() => {
          this.working = false
        })
        .catch(() => { })
    }
  }
}
</script>