177 lines
		
	
	
		
			4.8 KiB
		
	
	
	
		
			Plaintext
		
	
	
			
		
		
	
	
			177 lines
		
	
	
		
			4.8 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.QuestionName" clearable style="width:120px;" />
 | 
						|
        </el-form-item>
 | 
						|
        <el-form-item label="类型:">
 | 
						|
          <el-input v-model="searchData.Type" 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="QuestionName"
 | 
						|
        label="审核问题"
 | 
						|
        show-overflow-tooltip
 | 
						|
      />
 | 
						|
      <el-table-column
 | 
						|
        prop="Type"
 | 
						|
        label="类型"
 | 
						|
        show-overflow-tooltip
 | 
						|
      >
 | 
						|
        <template slot-scope="scope">
 | 
						|
          {{ scope.row.Type=== 'radio'?'单选框':scope.row.Type=== 'select'?'下拉框':scope.row.Type=== 'input'?'文本框':scope.row.Type=== 'textarea'?'多行文本框':'' }}
 | 
						|
        </template>
 | 
						|
      </el-table-column>
 | 
						|
      <el-table-column
 | 
						|
        prop="TypeValue"
 | 
						|
        label="选项"
 | 
						|
        show-overflow-tooltip
 | 
						|
        min-width="110"
 | 
						|
      />
 | 
						|
      <el-table-column
 | 
						|
        prop="ShowOrder"
 | 
						|
        label="序号"
 | 
						|
        min-width="70"
 | 
						|
      />
 | 
						|
      <el-table-column
 | 
						|
        prop="IsRequired"
 | 
						|
        label="是否必填"
 | 
						|
        min-width="90"
 | 
						|
      >
 | 
						|
        <template slot-scope="scope">
 | 
						|
          {{ scope.row.IsRequired?'是':'否' }}
 | 
						|
        </template>
 | 
						|
      </el-table-column>
 | 
						|
      <el-table-column
 | 
						|
        prop="IsEnable"
 | 
						|
        label="启用状态"
 | 
						|
        min-width="120"
 | 
						|
      >
 | 
						|
        <template slot-scope="scope">
 | 
						|
          {{ scope.row.IsEnable?'启用':'停用' }}
 | 
						|
        </template>
 | 
						|
      </el-table-column>
 | 
						|
 | 
						|
      <el-table-column label="Action" width="200" fixed="right">
 | 
						|
        <template slot-scope="scope">
 | 
						|
          <el-button
 | 
						|
            type="primary"
 | 
						|
            size="mini"
 | 
						|
            @click="handleEdit(scope.row)"
 | 
						|
          >
 | 
						|
            编辑
 | 
						|
          </el-button>
 | 
						|
          <el-button
 | 
						|
            type="danger"
 | 
						|
            size="mini"
 | 
						|
            @click="handleDelete(scope.row)"
 | 
						|
          >
 | 
						|
            删除
 | 
						|
          </el-button>
 | 
						|
 | 
						|
        </template>
 | 
						|
      </el-table-column>
 | 
						|
    </el-table>
 | 
						|
    <MedicalAuditForm ref="medicalAuditForm" @getList="getList" />
 | 
						|
 | 
						|
  </box-content>
 | 
						|
</template>
 | 
						|
<script>
 | 
						|
import { getReadingMedicineSystemQuestionList, deleteReadingMedicineSystemQuestion } from '@/api/dictionary'
 | 
						|
 | 
						|
import BoxContent from '@/components/BoxContent'
 | 
						|
import MedicalAuditForm from './MedicalAuditForm'
 | 
						|
 | 
						|
const searchDataDefault = () => {
 | 
						|
  return {
 | 
						|
    QuestionName: '',
 | 
						|
    Type: ''
 | 
						|
  }
 | 
						|
}
 | 
						|
export default {
 | 
						|
  name: 'MedicalAudit',
 | 
						|
  components: { BoxContent, MedicalAuditForm },
 | 
						|
  data() {
 | 
						|
    return {
 | 
						|
      searchData: searchDataDefault(),
 | 
						|
      list: [],
 | 
						|
      loading: false,
 | 
						|
      rowData: {},
 | 
						|
      model_cfg: { visible: false, showClose: true, width: '600px', title: '' }
 | 
						|
    }
 | 
						|
  },
 | 
						|
  mounted() {
 | 
						|
    this.getList()
 | 
						|
  },
 | 
						|
  methods: {
 | 
						|
    // 获取受试者列表信息
 | 
						|
    getList() {
 | 
						|
      this.loading = true
 | 
						|
      getReadingMedicineSystemQuestionList(this.searchData).then(res => {
 | 
						|
        this.loading = false
 | 
						|
        this.list = res.Result
 | 
						|
      }).catch(() => { this.loading = false })
 | 
						|
    },
 | 
						|
    // 新增受试者
 | 
						|
    handleAdd() {
 | 
						|
      this.$nextTick(() => {
 | 
						|
        this.$refs['medicalAuditForm'].openDialog('新增', {})
 | 
						|
      })
 | 
						|
    },
 | 
						|
    // 编辑受试者信息
 | 
						|
    handleEdit(row) {
 | 
						|
      this.$nextTick(() => {
 | 
						|
        this.$refs['medicalAuditForm'].openDialog('编辑', row)
 | 
						|
      })
 | 
						|
    },
 | 
						|
    // 删除受试者
 | 
						|
    handleDelete(row) {
 | 
						|
      this.$confirm('是否确认删除?', {
 | 
						|
        type: 'warning',
 | 
						|
        distinguishCancelAndClose: true
 | 
						|
      })
 | 
						|
        .then(() => {
 | 
						|
          this.loading = true
 | 
						|
          deleteReadingMedicineSystemQuestion(row.Id)
 | 
						|
            .then(res => {
 | 
						|
              this.loading = false
 | 
						|
              if (res.IsSuccess) {
 | 
						|
                this.getList()
 | 
						|
                this.$message.success('删除成功!')
 | 
						|
              }
 | 
						|
            }).catch(() => { this.loading = false })
 | 
						|
        })
 | 
						|
    },
 | 
						|
    // 查询
 | 
						|
    handleSearch() {
 | 
						|
      this.getList()
 | 
						|
    },
 | 
						|
    // 重置
 | 
						|
    handleReset() {
 | 
						|
      this.searchData = searchDataDefault()
 | 
						|
      this.getList()
 | 
						|
    }
 | 
						|
  }
 | 
						|
}
 | 
						|
</script>
 |