|  | @@ -1,12 +1,29 @@
 | 
	
		
			
				|  |  |  <template>
 | 
	
		
			
				|  |  | -  <xc-table :local-data="data" :height="400">
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +  <xc-table :local-data="data" :height="40">
 | 
	
		
			
				|  |  | +    <el-table-column label="质控名称" prop="name"/>
 | 
	
		
			
				|  |  | +    <el-table-column label="时效(小时)" prop="prescription"/>
 | 
	
		
			
				|  |  | +    <el-table-column label="描述" prop="promptStatement"/>
 | 
	
		
			
				|  |  | +    <el-table-column label="是否开启" prop="offOrOnRule">
 | 
	
		
			
				|  |  | +      <template #default="{row}">
 | 
	
		
			
				|  |  | +        <el-switch
 | 
	
		
			
				|  |  | +            v-model="row.offOrOnRule"
 | 
	
		
			
				|  |  | +            :active-value="1"
 | 
	
		
			
				|  |  | +            :inactive-value="0"
 | 
	
		
			
				|  |  | +            @change="onOff(row.id,row.offOrOnRule)"
 | 
	
		
			
				|  |  | +            active-text="开启"
 | 
	
		
			
				|  |  | +            inactive-text="关闭"/>
 | 
	
		
			
				|  |  | +      </template>
 | 
	
		
			
				|  |  | +    </el-table-column>
 | 
	
		
			
				|  |  | +    <el-table-column label="操作">
 | 
	
		
			
				|  |  | +      <template #default="{row}">
 | 
	
		
			
				|  |  | +        <el-button type="danger" @click="deleteQualityControl(row.id)">删除</el-button>
 | 
	
		
			
				|  |  | +        <el-button type="warning">修改</el-button>
 | 
	
		
			
				|  |  | +      </template>
 | 
	
		
			
				|  |  | +    </el-table-column>
 | 
	
		
			
				|  |  |    </xc-table>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    <xc-dialog-v2 v-model="dialog"
 | 
	
		
			
				|  |  |                  title="病历时效限制">
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |      <el-form :label-width="120">
 | 
	
		
			
				|  |  |        <el-form-item label="入参数据元:">
 | 
	
		
			
				|  |  |          <el-select v-model="ruleForm.sql" @change="selectChange" ref="selectRef">
 | 
	
	
		
			
				|  | @@ -84,10 +101,16 @@ import XcDialogV2 from "@/components/xiao-chan/dialog/XcDialogV2.vue";
 | 
	
		
			
				|  |  |  import {
 | 
	
		
			
				|  |  |    getEmrTree,
 | 
	
		
			
				|  |  |  } from "@/api/zhu-yuan-yi-sheng/emr-patient";
 | 
	
		
			
				|  |  | -import {addRule, getAvailableObjects} from '@/api/zhu-yuan-yi-sheng/emr-control-rule'
 | 
	
		
			
				|  |  | +import {
 | 
	
		
			
				|  |  | +  addRule,
 | 
	
		
			
				|  |  | +  getAvailableObjects,
 | 
	
		
			
				|  |  | +  getRuleList,
 | 
	
		
			
				|  |  | +  switchQualityControl
 | 
	
		
			
				|  |  | +} from '@/api/zhu-yuan-yi-sheng/emr-control-rule'
 | 
	
		
			
				|  |  | +import {ElMessageBox} from "element-plus";
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  const data: Ref<Array<any>> = ref([])
 | 
	
		
			
				|  |  | -const dialog: Ref<boolean> = ref(true)
 | 
	
		
			
				|  |  | +const dialog: Ref<boolean> = ref(false)
 | 
	
		
			
				|  |  |  const emrTree = ref([])
 | 
	
		
			
				|  |  |  const ruleDataElement: Ref<Array<any>> = ref([])
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -191,11 +214,31 @@ const confirm = () => {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  const value: Ref<Array<string>> = ref([])
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +const onOff = async (id, val) => {
 | 
	
		
			
				|  |  | +  await switchQualityControl(id, val)
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +const deleteQualityControl = (val) => {
 | 
	
		
			
				|  |  | +  ElMessageBox.confirm('是否要删除该质控!', '提示', {
 | 
	
		
			
				|  |  | +    type: 'warning'
 | 
	
		
			
				|  |  | +  }).then((res) => {
 | 
	
		
			
				|  |  | +    console.log(val)
 | 
	
		
			
				|  |  | +  }).catch((e) => {
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  })
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  onMounted(() => {
 | 
	
		
			
				|  |  |    getEmrTree('hosp').then((res) => {
 | 
	
		
			
				|  |  |      emrTree.value = res.all[0].children
 | 
	
		
			
				|  |  |    })
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +  getRuleList().then((res) => {
 | 
	
		
			
				|  |  | +    console.log(res)
 | 
	
		
			
				|  |  | +    data.value = res
 | 
	
		
			
				|  |  | +  })
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |    getAvailableObjects().then((res) => {
 | 
	
		
			
				|  |  |      ruleDataElement.value = res
 | 
	
		
			
				|  |  |      console.log(res)
 |