160 lines
		
	
	
		
			4.4 KiB
		
	
	
	
		
			Plaintext
		
	
	
			
		
		
	
	
			160 lines
		
	
	
		
			4.4 KiB
		
	
	
	
		
			Plaintext
		
	
	
<template>
 | 
						|
  <box-content>
 | 
						|
    <!-- 搜索框 -->
 | 
						|
    <div class="search">
 | 
						|
      <el-form :inline="true" size="mini" class="base-search-form">
 | 
						|
        <el-form-item label="阅片标准">
 | 
						|
          <el-input v-model="searchData.CriterionName" clearable style="width:120px;" />
 | 
						|
        </el-form-item>
 | 
						|
        <el-form-item>
 | 
						|
          <el-button type="primary" @click="handleReset">重置</el-button>
 | 
						|
          <el-button type="primary" @click="handleSearch">查询</el-button>
 | 
						|
        </el-form-item>
 | 
						|
      </el-form>
 | 
						|
      <!-- <span style="margin-left:auto">
 | 
						|
        <el-button type="primary" size="mini" @click="handleAdd">新增</el-button>
 | 
						|
      </span> -->
 | 
						|
    </div>
 | 
						|
 | 
						|
    <el-table
 | 
						|
      v-loading="loading"
 | 
						|
      v-adaptive="{bottomOffset:45}"
 | 
						|
      :data="list"
 | 
						|
      stripe
 | 
						|
      size="small"
 | 
						|
      height="100"
 | 
						|
    >
 | 
						|
      <el-table-column type="index" width="60" />
 | 
						|
      <el-table-column
 | 
						|
        prop="CriterionName"
 | 
						|
        label="阅片标准"
 | 
						|
        show-overflow-tooltip
 | 
						|
      />
 | 
						|
 | 
						|
      <el-table-column
 | 
						|
        prop="IsCompleteConfig"
 | 
						|
        label="是否配置完成"
 | 
						|
      >
 | 
						|
        <template slot-scope="scope">
 | 
						|
 | 
						|
          <el-switch
 | 
						|
            v-model="scope.row.IsCompleteConfig"
 | 
						|
            :disabled="scope.row.IsBeUsed"
 | 
						|
            @change="changeStatus($event, scope.row)"
 | 
						|
          />
 | 
						|
        </template>
 | 
						|
      </el-table-column>
 | 
						|
 | 
						|
      <el-table-column label="Action" width="200" fixed="right">
 | 
						|
        <template slot-scope="scope">
 | 
						|
          <el-button
 | 
						|
            type="primary"
 | 
						|
            size="mini"
 | 
						|
            :disabled="scope.row.IsCompleteConfig || scope.row.IsBeUsed"
 | 
						|
            @click="handleConfig(scope.row)"
 | 
						|
          >
 | 
						|
            配置
 | 
						|
          </el-button>
 | 
						|
 | 
						|
        </template>
 | 
						|
      </el-table-column>
 | 
						|
    </el-table>
 | 
						|
    <!-- 分页组件 -->
 | 
						|
    <pagination class="page" :total="total" :page.sync="searchData.PageIndex" :limit.sync="searchData.PageSize" @pagination="getList" />
 | 
						|
 | 
						|
    <el-dialog
 | 
						|
      v-if="configVisible"
 | 
						|
      title="阅片问题配置"
 | 
						|
      :visible.sync="configVisible"
 | 
						|
      :close-on-click-modal="false"
 | 
						|
      :fullscreen="true"
 | 
						|
      append-to-body
 | 
						|
      custom-class="base-dialog-wrapper"
 | 
						|
    >
 | 
						|
      <criterions-config :criterion-id="rowData.Id" />
 | 
						|
    </el-dialog>
 | 
						|
 | 
						|
  </box-content>
 | 
						|
</template>
 | 
						|
<script>
 | 
						|
import { getReadingQuestionCriterionSystemList, setSystemReadingQuestionCriterionIsCompleteConfig } from '@/api/dictionary'
 | 
						|
import BoxContent from '@/components/BoxContent'
 | 
						|
import Pagination from '@/components/Pagination'
 | 
						|
import CriterionsConfig from './CriterionsConfig'
 | 
						|
const searchDataDefault = () => {
 | 
						|
  return {
 | 
						|
    CriterionName: '',
 | 
						|
    PageIndex: 1,
 | 
						|
    PageSize: 20
 | 
						|
  }
 | 
						|
}
 | 
						|
export default {
 | 
						|
  name: 'QcQuestions',
 | 
						|
  components: { BoxContent, Pagination, CriterionsConfig },
 | 
						|
  data() {
 | 
						|
    return {
 | 
						|
      searchData: searchDataDefault(),
 | 
						|
      list: [],
 | 
						|
      total: 0,
 | 
						|
      loading: false,
 | 
						|
      rowData: {},
 | 
						|
      configVisible: false
 | 
						|
    }
 | 
						|
  },
 | 
						|
  mounted() {
 | 
						|
    this.getList()
 | 
						|
  },
 | 
						|
  methods: {
 | 
						|
    getList() {
 | 
						|
      this.loading = true
 | 
						|
      getReadingQuestionCriterionSystemList(this.searchData).then(res => {
 | 
						|
        this.loading = false
 | 
						|
        this.list = res.Result.CurrentPageData
 | 
						|
        this.total = res.Result.TotalCount
 | 
						|
      }).catch(() => { this.loading = false })
 | 
						|
    },
 | 
						|
 | 
						|
    changeStatus(callback, row) {
 | 
						|
      var message = ''
 | 
						|
      if (callback) {
 | 
						|
        message = '是否确认更改?'
 | 
						|
        row.IsCompleteConfig = false
 | 
						|
      } else {
 | 
						|
        message = '是否确认更改?'
 | 
						|
        row.IsCompleteConfig = true
 | 
						|
      }
 | 
						|
      this.$confirm(message, {
 | 
						|
        distinguishCancelAndClose: true,
 | 
						|
        type: 'warning'
 | 
						|
      }).then(() => {
 | 
						|
        this.loading = true
 | 
						|
        var params = {
 | 
						|
          id: row.Id,
 | 
						|
          isCompleteConfig: !row.IsCompleteConfig
 | 
						|
        }
 | 
						|
        setSystemReadingQuestionCriterionIsCompleteConfig(params).then(res => {
 | 
						|
          this.loading = false
 | 
						|
          if (res.IsSuccess) {
 | 
						|
            this.$message.success('保存成功!')
 | 
						|
            this.getList()
 | 
						|
          }
 | 
						|
        }).catch(() => { this.loading = false })
 | 
						|
      }).catch(() => {})
 | 
						|
    },
 | 
						|
    handleConfig(row) {
 | 
						|
      this.rowData = { ...row }
 | 
						|
      this.configVisible = true
 | 
						|
    },
 | 
						|
    // 查询
 | 
						|
    handleSearch() {
 | 
						|
      this.getList()
 | 
						|
    },
 | 
						|
    // 重置
 | 
						|
    handleReset() {
 | 
						|
      this.searchData = searchDataDefault()
 | 
						|
      this.getList()
 | 
						|
    }
 | 
						|
  }
 | 
						|
}
 | 
						|
</script>
 |