performanceVerification.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <template>
  2. <div class="performance">
  3. <div class="table">
  4. <el-table :data="tableData" border>
  5. <el-table-column
  6. label="序号"
  7. width="50"
  8. type="index"
  9. />
  10. <el-table-column label="菌落形态" prop="zhenJunXingTai" width="180">
  11. <template slot-scope="{row}">
  12. <template v-if="!readonly && !setDisabled(row,'1') && !shiFouGuoShen">
  13. <el-radio v-model="row.zhenJunXingTai" label="相符">相符</el-radio>
  14. <el-radio v-model="row.zhenJunXingTai" label="不相符">不相符</el-radio>
  15. </template>
  16. <template v-else>
  17. <span>{{ row.zhenJunXingTai||'/' }}</span>
  18. </template>
  19. </template>
  20. </el-table-column>
  21. <el-table-column label="染色性" prop="ranSeXing">
  22. <template slot-scope="{row}">
  23. <el-input v-if="!readonly && !setDisabled(row,'2') && !shiFouGuoShen" v-model="row.ranSeXing" size="mini" placeholder="请输入" />
  24. <span v-else>{{ row.ranSeXing || '/' }}</span>
  25. </template>
  26. </el-table-column>
  27. <el-table-column label="鉴定结果" prop="jianDingJieGuo" width="180">
  28. <template slot-scope="{row}">
  29. <template v-if="!readonly && !setDisabled(row,'3') && !shiFouGuoShen">
  30. <el-radio v-model="row.jianDingJieGuo" label="相符">相符</el-radio>
  31. <el-radio v-model="row.jianDingJieGuo" label="不相符">不相符</el-radio>
  32. </template>
  33. <template v-else>
  34. <span>{{ row.jianDingJieGuo||'/' }}</span>
  35. </template>
  36. </template>
  37. </el-table-column>
  38. <el-table-column label="β内酰胺酶" prop="neiXianAnMei" width="160">
  39. <template slot-scope="{row}">
  40. <template v-if="!readonly && !setDisabled(row,'4') && !shiFouGuoShen">
  41. <el-radio v-model="row.neiXianAnMei" label="阳性">阳性</el-radio>
  42. <el-radio v-model="row.neiXianAnMei" label="阴性">阴性</el-radio>
  43. </template>
  44. <template v-else>
  45. <span>{{ row.neiXianAnMei||'/' }}</span>
  46. </template>
  47. </template>
  48. </el-table-column>
  49. <el-table-column label="药敏质控状态" prop="yaoMinZhiKongZhua" width="180">
  50. <template slot-scope="{row}">
  51. <template v-if="!readonly && !setDisabled(row,'5') && !shiFouGuoShen">
  52. <el-radio v-model="row.yaoMinZhiKongZhua" label="通过">通过</el-radio>
  53. <el-radio v-model="row.yaoMinZhiKongZhua" label="不通过">不通过</el-radio>
  54. </template>
  55. <template v-else>
  56. <span>{{ row.yaoMinZhiKongZhua||'/' }}</span>
  57. </template>
  58. </template>
  59. </el-table-column>
  60. <el-table-column label="验证结果" prop="yanZhengJieGuo" width="180">
  61. <template slot-scope="{row}">
  62. <template v-if="!readonly && !setDisabled(row,'6') && !shiFouGuoShen">
  63. <el-radio v-model="row.yanZhengJieGuo" label="通过">通过</el-radio>
  64. <el-radio v-model="row.yanZhengJieGuo" label="不通过">不通过</el-radio>
  65. </template>
  66. <template v-else>
  67. <span>{{ row.yanZhengJieGuo||'/' }}</span>
  68. </template>
  69. </template>
  70. </el-table-column>
  71. <el-table-column label="备注" prop="beiZhu">
  72. <template slot-scope="{row}">
  73. <el-input v-if="!readonly && !shiFouGuoShen" v-model="row.beiZhu" type="textarea" size="mini" placeholder="请输入" />
  74. <span v-else>{{ row.beiZhu||'/' }}</span>
  75. </template>
  76. </el-table-column>
  77. </el-table>
  78. </div>
  79. </div>
  80. </template>
  81. <script>
  82. export default {
  83. props: {
  84. formData: {
  85. type: Object,
  86. default: () => {}
  87. },
  88. readonly: {
  89. type: Boolean,
  90. default: false
  91. }
  92. },
  93. data () {
  94. return {
  95. tableData: [],
  96. dic: {
  97. '1': '菌落形态',
  98. '2': '染色性',
  99. '3': '鉴定结果',
  100. '4': 'β内酰胺酶',
  101. '5': '药敏质控状态',
  102. '6': '验证结果'
  103. }
  104. }
  105. },
  106. computed: {
  107. shiFouGuoShen () {
  108. return this.formData.shiFouGuoShen === '已编制'
  109. }
  110. },
  111. watch: {
  112. 'formData.xuanZeJunZhu': {
  113. async handler (val) {
  114. if (val) {
  115. const arr = val?.split(',') || []
  116. const sql = `select * from t_zkjzxnyzpzb WHERE id_ in (${arr.map(i => `'${i}'`).join(',')})`
  117. const { variables: { data }} = await this.$common.request('sql', sql)
  118. // console.log('data', data)
  119. const newData = []
  120. data.forEach(item => {
  121. const t = this.tableData.find(i => i.peiZhiId === item.id_)
  122. if (t) {
  123. newData.push(t)
  124. } else {
  125. newData.push({
  126. 'diDian': this.formData.diDian,
  127. 'bianZhiRen': this.formData.bianZhiRen,
  128. 'bianZhiBuMen': this.formData.bianZhiBuMen,
  129. 'bianZhiShiJian': this.formData.bianZhiShiJian,
  130. 'zhenJunXingTai': '',
  131. 'ranSeXing': '',
  132. 'jianDingJieGuo': '',
  133. 'neiXianAnMei': '',
  134. 'yaoMinZhiKongZhua': '',
  135. 'yanZhengJieGuo': '',
  136. 'beiZhu': '',
  137. junZhuId: item.jun_zhu_id_,
  138. junZhuBianHao: item.jun_zhu_bian_hao_,
  139. junZhuMingCheng: item.jun_zhu_ming_chen,
  140. peiZhiId: item.id_,
  141. yanZhengNeiRong: item.yan_zheng_nei_ron
  142. })
  143. }
  144. })
  145. this.tableData = newData
  146. }
  147. }
  148. // immediate: true
  149. },
  150. 'formData.zkjzxnyzxqb': {
  151. handler (val) {
  152. if (val && val.length) {
  153. // console.log(this.formData)
  154. this.tableData = val
  155. }
  156. }
  157. },
  158. tableData: {
  159. handler (val) {
  160. this.$emit('change-data', 'zkjzxnyzxqb', val)
  161. },
  162. deep: true
  163. }
  164. },
  165. methods: {
  166. setDisabled (row, index) {
  167. const arr = row.yanZhengNeiRong?.split(',') || []
  168. return !arr.includes(index)
  169. }
  170. }
  171. }
  172. </script>
  173. <style>
  174. .performance{
  175. padding: 20px 0 0 20px;
  176. }
  177. </style>