performanceVerification.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. <template>
  2. <div class="performance">
  3. <div class="table">
  4. <el-table :data="showPaperList" border>
  5. <el-table-column
  6. label="序号"
  7. width="50"
  8. type="index"
  9. :index="showIndex"
  10. />
  11. <el-table-column label="菌株名称" prop="junZhuMingCheng" width="180">
  12. <template slot-scope="{row}">
  13. <template>
  14. <span>{{ row.junZhuMingCheng+' '+row.junZhuBianHao }}</span>
  15. </template>
  16. </template>
  17. </el-table-column>
  18. <el-table-column label="菌落形态" prop="zhenJunXingTai" width="180">
  19. <template slot-scope="{row}">
  20. <template v-if="!readonly && !setDisabled(row,'1') && !shiFouGuoShen">
  21. <el-radio v-model="row.zhenJunXingTai" label="相符">相符</el-radio>
  22. <el-radio v-model="row.zhenJunXingTai" label="不相符">不相符</el-radio>
  23. </template>
  24. <template v-else>
  25. <span>{{ row.zhenJunXingTai||'/' }}</span>
  26. </template>
  27. </template>
  28. </el-table-column>
  29. <el-table-column label="染色性" prop="ranSeXing">
  30. <template slot-scope="{row}">
  31. <el-input v-if="!readonly && !setDisabled(row,'2') && !shiFouGuoShen" v-model="row.ranSeXing" size="mini" placeholder="请输入" />
  32. <span v-else>{{ row.ranSeXing || '/' }}</span>
  33. </template>
  34. </el-table-column>
  35. <el-table-column label="鉴定结果" prop="jianDingJieGuo" width="180">
  36. <template slot-scope="{row}">
  37. <template v-if="!readonly && !setDisabled(row,'3') && !shiFouGuoShen">
  38. <el-radio v-model="row.jianDingJieGuo" label="相符">相符</el-radio>
  39. <el-radio v-model="row.jianDingJieGuo" label="不相符">不相符</el-radio>
  40. </template>
  41. <template v-else>
  42. <span>{{ row.jianDingJieGuo||'/' }}</span>
  43. </template>
  44. </template>
  45. </el-table-column>
  46. <el-table-column label="β内酰胺酶" prop="neiXianAnMei" width="160">
  47. <template slot-scope="{row}">
  48. <template v-if="!readonly && !setDisabled(row,'4') && !shiFouGuoShen">
  49. <el-radio v-model="row.neiXianAnMei" label="阳性">阳性</el-radio>
  50. <el-radio v-model="row.neiXianAnMei" label="阴性">阴性</el-radio>
  51. </template>
  52. <template v-else>
  53. <span>{{ row.neiXianAnMei||'/' }}</span>
  54. </template>
  55. </template>
  56. </el-table-column>
  57. <el-table-column label="药敏质控状态" prop="yaoMinZhiKongZhua" width="180">
  58. <template slot-scope="{row}">
  59. <template v-if="!readonly && !setDisabled(row,'5') && !shiFouGuoShen">
  60. <el-radio v-model="row.yaoMinZhiKongZhua" label="通过">通过</el-radio>
  61. <el-radio v-model="row.yaoMinZhiKongZhua" label="不通过">不通过</el-radio>
  62. </template>
  63. <template v-else>
  64. <span>{{ row.yaoMinZhiKongZhua||'/' }}</span>
  65. </template>
  66. </template>
  67. </el-table-column>
  68. <el-table-column label="验证结果" prop="yanZhengJieGuo" width="180">
  69. <template slot-scope="{row}">
  70. <template v-if="!readonly && !setDisabled(row,'6') && !shiFouGuoShen">
  71. <el-radio v-model="row.yanZhengJieGuo" label="通过">通过</el-radio>
  72. <el-radio v-model="row.yanZhengJieGuo" label="不通过">不通过</el-radio>
  73. </template>
  74. <template v-else>
  75. <span>{{ row.yanZhengJieGuo||'/' }}</span>
  76. </template>
  77. </template>
  78. </el-table-column>
  79. <el-table-column label="备注" prop="beiZhu">
  80. <template slot-scope="{row}">
  81. <el-input v-if="!readonly && !shiFouGuoShen" v-model="row.beiZhu" type="textarea" size="mini" placeholder="请输入" />
  82. <span v-else>{{ row.beiZhu||'/' }}</span>
  83. </template>
  84. </el-table-column>
  85. </el-table>
  86. <el-pagination
  87. style="margin-top: 5px; padding-bottom: 10px"
  88. :current-page="pagination.currentPage"
  89. :page-sizes="[10, 20,30, 50]"
  90. :page-size="pagination.pageSize"
  91. layout="prev,pager,next,jumper,sizes,->,total"
  92. :total="tableData.length"
  93. @size-change="handleSizeChange"
  94. @current-change="handleCurrentChange"
  95. />
  96. </div>
  97. </div>
  98. </template>
  99. <script>
  100. export default {
  101. props: {
  102. formData: {
  103. type: Object,
  104. default: () => {}
  105. },
  106. readonly: {
  107. type: Boolean,
  108. default: false
  109. }
  110. },
  111. data () {
  112. return {
  113. pagination: {
  114. pageSize: 10,
  115. currentPage: 1
  116. },
  117. tableData: [],
  118. dic: {
  119. '1': '菌落形态',
  120. '2': '染色性',
  121. '3': '鉴定结果',
  122. '4': 'β内酰胺酶',
  123. '5': '药敏质控状态',
  124. '6': '验证结果'
  125. }
  126. }
  127. },
  128. computed: {
  129. shiFouGuoShen () {
  130. return this.formData.shiFouGuoShen === '已编制'
  131. },
  132. showPaperList () {
  133. const start = (this.pagination.currentPage - 1) * this.pagination.pageSize
  134. const end = start + this.pagination.pageSize
  135. return this.tableData.slice(start, end)
  136. }
  137. },
  138. watch: {
  139. 'formData.xuanZeJunZhu': {
  140. async handler (val) {
  141. if (val) {
  142. // const sql = `select * from t_zkjzxnyzpzb WHERE find_in_set(id_, '${val}')`
  143. const { variables: { data }} = await this.$common.request('query', {
  144. key: 'getStrainPvConfig',
  145. params: [val]
  146. })
  147. // console.log('data', data)
  148. const newData = []
  149. data.forEach(item => {
  150. const t = this.tableData.find(i => i.peiZhiId === item.id_)
  151. if (t) {
  152. newData.push(t)
  153. } else {
  154. newData.push({
  155. 'diDian': this.formData.diDian,
  156. 'bianZhiRen': this.formData.bianZhiRen,
  157. 'bianZhiBuMen': this.formData.bianZhiBuMen,
  158. 'bianZhiShiJian': this.formData.bianZhiShiJian,
  159. 'zhenJunXingTai': '',
  160. 'ranSeXing': '',
  161. 'jianDingJieGuo': '',
  162. 'neiXianAnMei': '',
  163. 'yaoMinZhiKongZhua': '',
  164. 'yanZhengJieGuo': '',
  165. 'beiZhu': '',
  166. junZhuId: item.jun_zhu_id_,
  167. junZhuBianHao: item.jun_zhu_bian_hao_,
  168. junZhuMingCheng: item.jun_zhu_ming_chen,
  169. peiZhiId: item.id_,
  170. yanZhengNeiRong: item.yan_zheng_nei_ron
  171. })
  172. }
  173. })
  174. this.tableData = newData
  175. }
  176. },
  177. immediate: true
  178. },
  179. 'formData.zkjzxnyzxqb': {
  180. handler (val) {
  181. if (val && val.length) {
  182. // console.log(this.formData)
  183. this.tableData = val
  184. }
  185. },
  186. immediate: true
  187. },
  188. tableData: {
  189. handler (val) {
  190. this.$emit('change-data', 'zkjzxnyzxqb', val)
  191. },
  192. deep: true
  193. }
  194. },
  195. methods: {
  196. setDisabled (row, index) {
  197. const arr = row.yanZhengNeiRong?.split(',') || []
  198. return !arr.includes(index)
  199. },
  200. // 选择器切换
  201. onSelectorChange () {
  202. this.pagination = {
  203. pageSize: 10,
  204. currentPage: 1
  205. }
  206. },
  207. // 当前页码改变
  208. handleCurrentChange (val) {
  209. this.pagination.currentPage = val
  210. },
  211. // 页码选择器改变
  212. handleSizeChange (val) {
  213. this.pagination.pageSize = val
  214. this.pagination.currentPage = 1
  215. },
  216. // 分页连续序号
  217. showIndex (index) {
  218. return index + 1 + (this.pagination.currentPage - 1) * this.pagination.pageSize
  219. }
  220. }
  221. }
  222. </script>
  223. <style>
  224. .performance{
  225. padding: 20px 0 0 20px;
  226. }
  227. </style>