performanceVerification.vue 7.7 KB

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