华西海圻ELN前端工程
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1166 lines
34 KiB

  1. <template>
  2. <div class="step-container">
  3. <el-button v-if="isShowAddStep()" type="primary" @click="addStep" icon="el-icon-plus">添加步骤</el-button>
  4. <div class="step-list">
  5. <draggable v-model="steps" ghost-class="ghost" handle=".drag-handle" @end="onDragEnd" :animation="200">
  6. <div v-for="(step, index) in steps" :key="step.id" class="step-list-item">
  7. <div class="step-content">
  8. <i class="el-icon-rank drag-handle" v-if="templateFillType === 'preFill'" style="cursor: move; margin-right: 10px; margin-top: 6px;"></i>
  9. <span class="step-title">{{ index + 1 }}</span>
  10. <HandleFormItem type="select" placeholder="请选择" class="step-type-select" :item="stepSelectConfig"
  11. v-model="step.type" @change="onTypeChange(index)" />
  12. <!-- 根据步骤类型显示对应的表单 -->
  13. <component class="flex1" :sn="step.type" :is="getStepComponent(step.type)" :formData="step.formData"
  14. @update="onFormUpdate(index, $event)" :stepIndex = "prefixKey + index" :ref="'stepCompRef_' + index">
  15. </component>
  16. <div v-if="templateFillType === 'preFill'" class="step-header-item">
  17. <el-popconfirm
  18. @confirm="removeStep(index)"
  19. title="确定删除当前步骤吗?"
  20. >
  21. <el-button type="text" slot="reference" icon="el-icon-delete"
  22. class="delete-btn"></el-button>
  23. </el-popconfirm>
  24. </div>
  25. </div>
  26. </div>
  27. </draggable>
  28. </div>
  29. </div>
  30. </template>
  31. <script>
  32. import draggable from 'vuedraggable';
  33. import { duplicateResource,justUpdateFilledFormData } from '@/utils/index.js';
  34. import HandleFormItem from './HandleFormItem.vue';
  35. import Czdd from './StepComponents/ry/czdd.vue';//溶液-操作地点
  36. import Czhj from './StepComponents/ry/czhj.vue';//溶液-操作方法
  37. import Xzrq from './StepComponents/ry/xzrq.vue';//溶液-选择容器
  38. import Jrry from './StepComponents/ry/jrry.vue';//溶液-加入溶液
  39. import Tpjydd from './StepComponents/ry/tpjydd.vue';//溶液-天平校验(单点)
  40. import Tpjysd from './StepComponents/ry/tpjysd.vue';//溶液-天平校验(双点)
  41. import Qywz from './StepComponents/ry/qywz.vue';//溶液-取用物质
  42. import Clfcz from './StepComponents/ry/clfcz.vue';//溶液-称量(非传值)
  43. import Clcz from './StepComponents/ry/clcz.vue';//溶液-称量(传值)
  44. import Bdtj from './StepComponents/ry/bdtj.vue';//溶液-标定(体积)
  45. import Bdzl from './StepComponents/ry/bdzl.vue';//溶液-标定(质量)
  46. import Tjphcz from './StepComponents/ry/tjphcz.vue';//溶液-调节PH(传值)
  47. import Tjphfcz from './StepComponents/ry/tjphfcz.vue';//溶液-调节PH(非传值)
  48. import Lx from './StepComponents/ry/lx.vue';//溶液-离心
  49. import Hwhy from './StepComponents/ry/hwhy.vue';//溶液-恒温混匀
  50. import Zyhy from './StepComponents/ry/zyhy.vue';//溶液-振摇混匀
  51. import Wxhy from "./StepComponents/ry/wxhy.vue";//溶液-涡旋混匀
  52. import Ddhy from "./StepComponents/ry/ddhy.vue";//溶液-颠倒混匀
  53. import Ym from "./StepComponents/ry/ym.vue";//溶液-研磨
  54. import Jb from "./StepComponents/ry/jb.vue";//溶液-搅拌
  55. import Jrjb from "./StepComponents/ry/jrjb.vue";//溶液-加热搅拌
  56. import Cs from "./StepComponents/ry/cs.vue";//溶液-超声
  57. import Sy from "./StepComponents/ry/sy.vue";//溶液-水浴
  58. import Zy from "./StepComponents/ry/zy.vue";//溶液-正压
  59. import Dc from "./StepComponents/ry/dc.vue";//溶液-氮吹
  60. import Jd from "./StepComponents/ry/jd.vue";//溶液-解冻
  61. import Jz from "./StepComponents/ry/jz.vue";//溶液-静置
  62. import Glzd from "./StepComponents/ry/glzd.vue";//溶液-过滤(自动)
  63. import Glsd from "./StepComponents/ry/glsd.vue";//溶液-过滤(手动)
  64. import Fy from "./StepComponents/ry/fy.vue";//溶液-孵育
  65. import Qcyy from "./StepComponents/ry/qcyy.vue";//溶液-取出原药
  66. import Frdrq from "./StepComponents/ry/frdrq.vue";//溶液-复溶(多容器)
  67. import Fr from "./StepComponents/ry/fr.vue";//溶液-复溶
  68. import Hb from "./StepComponents/ry/hb.vue";//溶液-合并
  69. import Rs from "./StepComponents/ry/rs.vue";//溶液-染色
  70. import Js from "./StepComponents/ry/js.vue";//溶液-计数
  71. import Mj from "./StepComponents/ry/mj.vue";//溶液-灭菌
  72. import Fs from "./StepComponents/ry/fs.vue";//溶液-复苏
  73. import Fb from "./StepComponents/ry/fb.vue";//溶液-封板
  74. import Zlfz from "./StepComponents/ry/zlfz.vue";//溶液-质量分装
  75. //罗开凡新增
  76. import kbyq from "./StepComponents/ry/kbyq.vue";//溶液-空白仪器
  77. import kbsjgsp from "./StepComponents/ry/kbsjgsp.vue";//溶液-空白(试剂/供试品)
  78. import kb from "./StepComponents/ry/kb.vue";//溶液-空白
  79. import jr from "./StepComponents/ry/jr.vue";//溶液-加热
  80. import fz from "./StepComponents/ry/fz.vue";//溶液-分装
  81. //罗开凡新增
  82. //表配制
  83. import jrry_b from './StepComponents/b/jrry_b.vue';//表配制-加入溶液
  84. //表配制-离心:使用溶液-离心
  85. import cl from './StepComponents/b/cl.vue';//表配制-称量
  86. //表配制-超声:使用溶液-超声
  87. //表配制-恒温混匀:使用溶液-恒温混匀
  88. //表配制-振摇混匀:使用溶液-振摇混匀
  89. //表配制-涡旋混匀:使用溶液-涡旋混匀
  90. //表配制-颠倒混匀:使用溶液-颠倒混匀
  91. //表配制-搅拌:使用溶液-搅拌
  92. //表配制-加热搅拌:使用溶液-加热搅拌
  93. //表配制-水浴:使用溶液-水浴
  94. //表配制-正压:使用溶液-正压
  95. //表配制-氮吹:使用溶液-氮吹
  96. //表配制-过滤(自动):使用溶液-过滤(自动)
  97. //表配制-过滤(手动):使用溶液-过滤(手动)
  98. //表配制-静置:使用溶液-静置
  99. //表配制-解冻:使用溶液-解冻
  100. //表配制-孵育:使用溶液-孵育
  101. //表配制-复溶:使用溶液-复溶
  102. //生物样品分析
  103. //生物样品分析-解冻:使用溶液-解冻
  104. //生物样品分析-涡旋混匀:使用溶液-涡旋混匀
  105. //生物样品分析-选择容器:使用溶液-选择容器
  106. import jryp from './StepComponents/swypfx/jryp.vue';//生物样品分析-加入样品
  107. //生物样品分析-衍生反应:使用溶液-离心
  108. import hhspe from './StepComponents/swypfx/hhspe.vue';//生物样品分析-活化(SPE)
  109. //生物样品分析-平衡(SPE):使用溶液-活化(SPE)
  110. //生物样品分析-上样(SPE):使用溶液-活化(SPE)
  111. //生物样品分析-淋洗(SPE):使用溶液-活化(SPE)
  112. //生物样品分析-洗脱(SPE):使用溶液-活化(SPE)
  113. import zyfc from './StepComponents/swypfx/zyfc.vue';//生物样品分析-转移(分层)
  114. //生物样品分析-氮吹:使用溶液-氮吹
  115. //生物样品分析-正压:使用溶液-正压
  116. //生物样品分析-孵育:使用溶液-孵育
  117. //生物样品分析-复溶:使用溶液-复溶
  118. //色谱匀浆组织表
  119. import jszz from './StepComponents/spyjzzb/jszz.vue';//色谱匀浆组织表-剪碎组织
  120. //色谱匀浆组织表-称取组织:使用色谱匀浆组织表-剪碎组织
  121. import jryjry from './StepComponents/spyjzzb/jryjry.vue';//色谱匀浆组织表-加入匀浆溶液
  122. import ymyj from './StepComponents/spyjzzb/ymyj.vue';//色谱匀浆组织表-研磨匀浆
  123. import yjyfz2 from './StepComponents/spyjzzb/yjyfz2.vue';//色谱匀浆组织表-匀浆液分装2
  124. //色谱匀浆组织表-匀浆液分装3:使用色谱匀浆组织表-匀浆液分装2
  125. import yjbc from './StepComponents/spyjzzb/yjbc.vue';//色谱匀浆组织表-匀浆保存
  126. //色谱匀浆组织表-匀浆液混合:使用色谱匀浆组织表-剪碎组织
  127. //色谱匀浆组织表-加入溶液:使用溶液-加入溶液
  128. import fy_spyjzzb from './StepComponents/spyjzzb/fy_spyjzzb.vue';//色谱匀浆组织表-孵育
  129. //色谱匀浆组织表-天平校验双点:使用溶液-天平校验双点
  130. //色谱匀浆组织表-天平校验单点:使用溶液-天平校验单点
  131. //色谱匀浆组织表-离心:使用溶液-离心
  132. import jz_spyjzzb from './StepComponents/spyjzzb/jz_spyjzzb.vue';//色谱匀浆组织表-静置
  133. //全血稳定性
  134. //全血稳定性-颠倒混匀:使用溶液-颠倒混匀
  135. //全血稳定性-恒温平衡:使用溶液-恒温混匀
  136. import qxfz from './StepComponents/qxwdx/qxfz.vue';//全血稳定性-全血分装
  137. import qxjz from './StepComponents/qxwdx/qxjz.vue';//全血稳定性-全血静置
  138. import qxlx from './StepComponents/qxwdx/qxlx.vue';//全血稳定性-全血离心
  139. //全血稳定性-全血取样:使用全血稳定性-全血静置
  140. //全血稳定性-静置后离心:使用全血稳定性-全血离心
  141. //样品分取
  142. import fq2 from './StepComponents/ypfq/fq2.vue';//样品分取-分取2
  143. //样品分取-分取3:使用样品分取-分取2
  144. import hh from './StepComponents/ypfq/hh.vue';//样品分取-混合
  145. //组织清洗
  146. import qx from './StepComponents/zzqx/qx.vue';//组织清洗-清洗
  147. import zc from './StepComponents/zzqx/zc.vue';//组织清洗-暂存
  148. import qy from './StepComponents/zzqx/qy.vue';//组织清洗-弃液
  149. //PCR
  150. import sjjy from './StepComponents/pcr/sjjy.vue';//PCR-试剂加样
  151. import jryp_pcr from './StepComponents/pcr/jryp_pcr.vue';//PCR-加入样品
  152. import bzyp from './StepComponents/pcr/bzyp.vue';//PCR-补足样品
  153. import jz_pcr from './StepComponents/pcr/jz_pcr.vue';//PCR-静置
  154. import nscyp from './StepComponents/pcr/nscyp.vue';//PCR-NSC样品
  155. import qrhy from './StepComponents/pcr/qrhy.vue';//PCR-轻柔混匀
  156. //PCR-PE板位放置:使用PCR-轻柔混匀
  157. import tgbwfz from './StepComponents/pcr/tgbwfz.vue';//PCR-天根板位放置
  158. //PCR-罗氏板位放置:使用PCR-轻柔混匀
  159. import tqsj from './StepComponents/pcr/tqsj.vue';//PCR-提取上机
  160. import lssj from './StepComponents/pcr/lssj.vue';//PCR-罗氏上机
  161. import yqzt from './StepComponents/pcr/yqzt.vue';//PCR-仪器暂停
  162. import ecsj from './StepComponents/pcr/ecsj.vue';//PCR-二次上机
  163. import czclcl from './StepComponents/pcr/czclcl.vue';//PCR-磁珠残留处理
  164. import ypzy from './StepComponents/pcr/ypzy.vue';//PCR-样品转移
  165. import hsypfz from './StepComponents/pcr/hsypfz.vue';//PCR-核酸样品分装
  166. import ypbc from './StepComponents/pcr/ypbc.vue';//PCR-样品保存
  167. import jd_pcr from './StepComponents/pcr/jd_pcr.vue';//PCR-解冻
  168. import sjjyst from './StepComponents/pcr/sjjyst.vue';//PCR-试剂加样(手提)
  169. import ddhy_pcr from './StepComponents/pcr/ddhy_pcr.vue';//PCR-颠倒混匀
  170. import wxhy_pcr from './StepComponents/pcr/wxhy_pcr.vue';//PCR-涡旋混匀
  171. import sy_pcr from './StepComponents/pcr/sy_pcr.vue';//PCR-水浴
  172. import sslx from './StepComponents/pcr/sslx.vue';//PCR-瞬时离心
  173. import xfzcl from './StepComponents/pcr/xfzcl.vue';//PCR-吸附柱处理
  174. import lxdy from './StepComponents/pcr/lxdy.vue';//PCR-离心(倒液)
  175. import xfzzysjg from './StepComponents/pcr/xfzzysjg.vue';//PCR-吸附柱转移(收集管)
  176. import xfzzylxg from './StepComponents/pcr/xfzzylxg.vue';//PCR-吸附柱转移(离心管)
  177. import xt from './StepComponents/pcr/xt.vue';//PCR-洗脱
  178. import ecxt from './StepComponents/pcr/ecxt.vue';//PCR-二次洗脱
  179. import lx_pcr from './StepComponents/pcr/lx.vue';//PCR-离心
  180. //PCR分析核酸提取浓度测定表
  181. import ndcd from './StepComponents/pcrfx/ndcd.vue';//PCR分析核酸提取浓度测定表-浓度测定
  182. //PCR采集管称重记录表
  183. import jrry_pcrcjg from './StepComponents/pcrcjg/jrry_pcrcjg.vue';//PCR采集管称重记录表-加入溶液
  184. //PCR匀浆表(知管重、知组织重、常规)
  185. import jszz_pcryj from './StepComponents/pcryj/jszz_pcryj.vue';//PCR采集管称重记录表-剪碎组织
  186. import cqzz_pcryj from './StepComponents/pcryj/cqzz_pcryj.vue';//PCR采集管称重记录表-称取组织
  187. import jryjry_pcryj from './StepComponents/pcryj/jryjry_pcryj.vue';//PCR采集管称重记录表-加入匀浆溶液
  188. //PCR采集管称重记录表-研磨匀浆:使用色谱匀浆组织表-研磨匀浆
  189. //PCR采集管称重记录表-水浴:使用PCR分析核酸提取样品处理表-水浴
  190. //PCR采集管称重记录表-离心:使用PCR分析核酸提取样品处理表-水浴
  191. //PCR采集管称重记录表-天平校验(双点):使用溶液-天平校验(双点)
  192. //PCR采集管称重记录表-天平校验(单点):使用溶液-天平校验(单点)
  193. //PCR分析样品处理表
  194. import xs from './StepComponents/pcrfxyp/xs.vue';//PCR分析样品处理表-稀释
  195. //PCR分析样品处理表-操作环境:使用溶液-操作环境
  196. import sjjy_pcrfxyp from './StepComponents/pcrfxyp/sjjy_pcrfxyp.vue';//PCR分析样品处理表-试剂加样
  197. import jryp_pcrfxyp from './StepComponents/pcrfxyp/jryp_pcrfxyp.vue';//PCR分析样品处理表-加入样品
  198. import fmlx from './StepComponents/pcrfxyp/fmlx.vue';//PCR分析样品处理表-封膜离心
  199. import pcrsj from './StepComponents/pcrfxyp/pcrsj.vue';//PCR分析样品处理表-PCR上机
  200. import pbsz from './StepComponents/pcrfxyp/pbsz.vue';//PCR分析样品处理表-排版设置
  201. import cbygxz from './StepComponents/pcrfxyp/cbygxz.vue';//PCR分析样品处理表-参比荧光选择
  202. import yxpcry from './StepComponents/pcrfxyp/yxpcry.vue';//PCR分析样品处理表-运行PCR仪
  203. import cdnsypfz from './StepComponents/pcrfxyp/cdnsypfz.vue';//PCR分析样品处理表-cDNA样品分装
  204. //检测板配制
  205. import bb from './StepComponents/jcb/bb.vue';//检测板配制-包被
  206. //检测板配制-洗板:使用检测板配制-包被
  207. //检测板配制-封闭:使用检测板配制-包被
  208. import jy from './StepComponents/jcb/jy.vue';//检测板配制-加样
  209. //检测板配制-中和:使用检测板配制-包被
  210. //检测板配制-加检测试剂:使用检测板配制-包被
  211. //检测板配制-酸解:使用检测板配制-包被
  212. import sjjy_jcb from './StepComponents/jcb/sjjy_jcb.vue';//检测板配制-酸解加样
  213. import zhfy from './StepComponents/jcb/zhfy.vue';//检测板配制-中和孵育
  214. //检测板配制-二次酸解:使用检测板配制-包被
  215. import xs_jcb from './StepComponents/jcb/xs_jcb.vue';//检测板配制-显色
  216. //检测板配制-终止:使用检测板配制-包被
  217. //检测板配制-检测:使用检测板配制-包被
  218. import dbmby from './StepComponents/jcb/dbmby.vue';//检测板配制-读板(酶标仪)
  219. //检测板配制-读板(化学发光系统):使用检测板配制-读板(酶标仪)
  220. import dbdhxfgxt from './StepComponents/jcb/dbdhxfgxt.vue';//检测板配制-读板(电化学发光系统)
  221. import dbygxt from './StepComponents/jcb/dbygxt.vue';//检测板配制-读板(荧光系统)
  222. import dzacl from './StepComponents/jcb/dzacl.vue';//检测板配制-读值(ACL)
  223. import qb from './StepComponents/jcb/qb.vue';//检测板配制-取板
  224. import jzks from './StepComponents/jcb/jzks.vue';//检测板配制-静置开始
  225. import fyxks from './StepComponents/jcb/fyxks.vue';//检测板配制-孵育箱开始
  226. import ycfyks from './StepComponents/jcb/ycfyks.vue';//检测板配制-摇床孵育开始
  227. import ycks from './StepComponents/jcb/ycks.vue';//检测板配制-摇床开始
  228. import js_jcb from './StepComponents/jcb/js_jcb.vue';//检测板配制-结束
  229. //检测板配制-覆膜:使用检测板配制-读值(ACL)
  230. //检测板配制-拍干:使用检测板配制-读值(ACL)
  231. import czqx from './StepComponents/jcb/czqx.vue';//检测板配制-磁珠清洗
  232. import czzx from './StepComponents/jcb/czzx.vue';//检测板配制-磁珠重悬
  233. import ychy from './StepComponents/jcb/ychy.vue';//检测板配制-摇床混匀
  234. import czzy from './StepComponents/jcb/czzy.vue';//检测板配制-磁珠转移
  235. import sjbj from './StepComponents/jcb/sjbj.vue';//检测板配制-试剂标记
  236. //细胞/菌株配制
  237. import qxb from './StepComponents/xbjzpz/qxb.vue';//细胞/菌株配制-取细胞
  238. import qjz from './StepComponents/xbjzpz/qjz.vue';//细胞/菌株配制-取菌株
  239. import fr_xbjzpz from './StepComponents/xbjzpz/fr_xbjzpz.vue';//细胞/菌株配制-复溶
  240. import lxqy from './StepComponents/xbjzpz/lxqy.vue';//细胞/菌株配制-离心(弃液)
  241. import cd from './StepComponents/xbjzpz/cd.vue';//细胞/菌株配制-吹打
  242. import xbzy from './StepComponents/xbjzpz/xbzy.vue';//细胞/菌株配制-细胞转移
  243. import jzzy from './StepComponents/xbjzpz/jzzy.vue';//细胞/菌株配制-菌株转移
  244. import dypyy from './StepComponents/xbjzpz/dypyy.vue';//细胞/菌株配制-倒原培养液
  245. import xd from './StepComponents/xbjzpz/xd.vue';//细胞/菌株配制-洗涤
  246. //细胞/菌株配制-消化:使用细胞/菌株配制-洗涤
  247. //细胞/菌株配制-终止消化:使用细胞/菌株配制-洗涤
  248. import copy from './StepComponents/xbjzpz/copy.vue';//细胞/菌株配制-CO2培养
  249. import gc from './StepComponents/xbjzpz/gc.vue';//细胞/菌株配制-观察
  250. import cdmd from './StepComponents/xbjzpz/cdmd.vue';//细胞/菌株配制-测定密度
  251. //细胞/菌株配制-低渗:使用细胞/菌株配制-洗涤
  252. //细胞/菌株配制-固定:使用细胞/菌株配制-洗涤
  253. import cdxs from './StepComponents/xbjzpz/cdxs.vue';//细胞/菌株配制-传代/稀释
  254. //细胞表单
  255. import gc_xb from './StepComponents/xb/gc_xb.vue';//细胞表单-观察
  256. import xdlc from './StepComponents/xb/xdlc.vue';//细胞表单-洗涤(2次)
  257. import bzpyy from './StepComponents/xb/bzpyy.vue';//细胞表单-补足培养液
  258. import xh_xb from './StepComponents/xb/xh_xb.vue';//细胞表单-消化
  259. import jrrydh from './StepComponents/xb/jrrydh.vue';//细胞表单-加入溶液(多行)
  260. //细胞表单-固定:使用细胞表单-消化
  261. import rs_xb from './StepComponents/xb/rs_xb.vue';//细胞表单-染色
  262. import bpqr from './StepComponents/xb/bpqr.vue';//细胞表单-破片确认
  263. import dp from './StepComponents/xb/dp.vue';//细胞表单-滴片
  264. import bprs from './StepComponents/xb/bprs.vue';//细胞表单-破片染色
  265. import cx from './StepComponents/xb/cx.vue';//细胞表单-冲洗
  266. import lg from './StepComponents/xb/lg.vue';//细胞表单-晾干
  267. //Ames表单
  268. import hygh from './StepComponents/ames/hygh.vue';//Ames表单-混匀固化
  269. import hwzd from './StepComponents/ames/hwzd.vue';//Ames表单-恒温振荡
  270. import jbcpyj from './StepComponents/ames/jbcpyj.vue';//Ames表单-加表层培养基
  271. //配体结合分析样品/MRD稀释记录表
  272. import xs_ptjhfxyp from './StepComponents/ptjhfxyp/xs_ptjhfxyp.vue';//体结合分析样品/MRD稀释记录表-稀释
  273. import { public_templateStepList } from '@/api/business/public/public';
  274. // const stepTypes = [
  275. // { label: '操作地点', value: 'czdd' },
  276. // { label: '操作方法', value: 'czhj' },
  277. // { label: '选择容器', value: 'xzrq' },
  278. // { label: '加入溶液', value: 'jrry' },
  279. // { label: '天平校验(单点)', value: 'tpjydd' },
  280. // { label: '天平校验(双点)', value: 'tpjysd' },
  281. // { label: '取用物质', value: 'qywz' },
  282. // { label: '称量(非传值)', value: 'clfcz' },
  283. // { label: '称量(传值)', value: 'clcz' },
  284. // { label: '标定(体积)', value: 'bdtj' },
  285. // { label: '标定(质量)', value: 'bdzl' },
  286. // { label: '调节PH(传值)', value: 'tjphcz' },
  287. // { label: '调节PH(非传值)', value: 'tjphfcz' },
  288. // { label: '离心', value: 'lx' },
  289. // { label: '恒温混匀', value: 'hwhy' },
  290. // { label: '振摇混匀', value: 'zyhy' },
  291. // { label: '涡旋混匀', value: 'wxhy' },
  292. // { label: '颠倒混匀', value: 'ddhy' },
  293. // { label: '研磨', value: 'ym' },
  294. // { label: '搅拌', value: 'jb' },
  295. // { label: '加热搅拌', value: 'jrjb' },
  296. // { label: '超声', value: 'cs' },
  297. // { label: '水浴', value: 'sy' },
  298. // { label: '正压', value: 'zy' },
  299. // { label: '氮吹', value: 'dc' },
  300. // { label: '解冻', value: 'jd' },
  301. // { label: '静置', value: 'jz' },
  302. // { label: '过滤(自动)', value: 'glzd' },
  303. // { label: '过滤(手动)', value: 'glsd' },
  304. // { label: '孵育', value: 'fy' },
  305. // { label: '取出原药', value: 'qcyy' },
  306. // { label: '复溶(多容器)', value: 'frdrq' },
  307. // { label: '复溶', value: 'fr' },
  308. // { label: '合并', value: 'hb' },
  309. // { label: '染色', value: 'rs' },
  310. // { label: '计数', value: 'js' },
  311. // { label: '灭菌', value: 'mj' },
  312. // { label: '复苏', value: 'fs' },
  313. // { label: '封板', value: 'fb' },
  314. // { label: '质量分装', value: 'zlfz' },
  315. // ];
  316. export default {
  317. inject: ['templateFillType','templateData'],
  318. name: 'Step',
  319. props: {
  320. formData: {
  321. type: Array,
  322. default: () => []
  323. },
  324. prefixKey: {
  325. type: String,
  326. default: ''
  327. }
  328. },
  329. data() {
  330. return {
  331. stepSelectConfig: {
  332. options: [],
  333. fillType: "preFill",
  334. placeholder: "请选择步骤类型"
  335. },
  336. steps: [],
  337. stepId: 1,
  338. componentMap: null
  339. }
  340. },
  341. components: {
  342. draggable,
  343. HandleFormItem,
  344. Czdd,
  345. Czhj,
  346. Xzrq,
  347. Jrry,
  348. Tpjydd,
  349. Tpjysd,
  350. Qywz,
  351. Clfcz,
  352. Clcz,
  353. Bdtj,
  354. Bdzl,
  355. Tjphcz,
  356. Tjphfcz,
  357. Lx,
  358. Hwhy,
  359. Zyhy,
  360. Wxhy,
  361. Ddhy,
  362. Ym,
  363. Jb,
  364. Jrjb,
  365. Cs,
  366. Sy,
  367. Zy,
  368. Dc,
  369. Jd,
  370. Jz,
  371. Glzd,
  372. Glsd,
  373. Fy,
  374. Qcyy,
  375. Frdrq,
  376. Fr,
  377. Hb,
  378. Rs,
  379. Js,
  380. Mj,
  381. Fs,
  382. Fb,
  383. Zlfz,
  384. //罗开凡新增
  385. kbyq,
  386. kbsjgsp,
  387. kb,
  388. jr,
  389. fz,
  390. //罗开凡新增
  391. //表配制
  392. jrry_b,
  393. cl,
  394. //生物样品分析
  395. jryp,
  396. hhspe,
  397. zyfc,
  398. //色谱匀浆组织表
  399. jszz,
  400. jryjry,
  401. ymyj,
  402. yjyfz2,
  403. yjbc,
  404. fy_spyjzzb,
  405. jz_spyjzzb,
  406. //全血稳定性
  407. qxfz,
  408. qxjz,
  409. qxlx,
  410. //样品分取
  411. fq2,
  412. hh,
  413. //组织清洗
  414. qx,
  415. zc,
  416. qy,
  417. //PCR
  418. sjjy,
  419. jryp_pcr,
  420. bzyp,
  421. jz_pcr,
  422. nscyp,
  423. qrhy,
  424. tgbwfz,
  425. tqsj,
  426. lssj,
  427. yqzt,
  428. ecsj,
  429. czclcl,
  430. ypzy,
  431. hsypfz,
  432. ypbc,
  433. jd_pcr,
  434. sjjyst,
  435. ddhy_pcr,
  436. wxhy_pcr,
  437. sy_pcr,
  438. sslx,
  439. xfzcl,
  440. lxdy,
  441. xfzzysjg,
  442. xfzzylxg,
  443. xt,
  444. ecxt,
  445. lx_pcr,
  446. //PCR分析核酸提取浓度测定表
  447. ndcd,
  448. //PCR采集管称重记录表
  449. jrry_pcrcjg,
  450. //PCR匀浆表(知管重、知组织重、常规)
  451. jszz_pcryj,
  452. cqzz_pcryj,
  453. jryjry_pcryj,
  454. //PCR分析样品处理表
  455. xs,
  456. sjjy_pcrfxyp,
  457. jryp_pcrfxyp,
  458. fmlx,
  459. pcrsj,
  460. pbsz,
  461. cbygxz,
  462. yxpcry,
  463. cdnsypfz,
  464. //检测板配制
  465. bb,
  466. jy,
  467. sjjy_jcb,
  468. zhfy,
  469. xs_jcb,
  470. dbmby,
  471. dbdhxfgxt,
  472. dbygxt,
  473. dzacl,
  474. qb,
  475. jzks,
  476. fyxks,
  477. ycfyks,
  478. ycks,
  479. js_jcb,
  480. czqx,
  481. czzx,
  482. ychy,
  483. czzy,
  484. sjbj,
  485. //细胞/菌株配制
  486. qxb,
  487. qjz,
  488. fr_xbjzpz,
  489. lxqy,
  490. cd,
  491. xbzy,
  492. jzzy,
  493. dypyy,
  494. xd,
  495. copy,
  496. gc,
  497. cdmd,
  498. cdxs,
  499. //细胞表单
  500. gc_xb,
  501. xdlc,
  502. bzpyy,
  503. xh_xb,
  504. jrrydh,
  505. rs_xb,
  506. bpqr,
  507. dp,
  508. bprs,
  509. cx,
  510. lg,
  511. //Ames表单
  512. hygh,
  513. hwzd,
  514. jbcpyj,
  515. //配体结合分析样品/MRD稀释记录表
  516. xs_ptjhfxyp,
  517. },
  518. computed: {
  519. stepComponentMap() {
  520. if (!this.componentMap) {
  521. this.componentMap = {
  522. 'czdd': 'Czdd',
  523. 'czhj': 'Czhj',
  524. 'xzrq': 'Xzrq',
  525. 'jrry': 'Jrry',
  526. 'tpjydd': 'Tpjydd',
  527. 'tpjysd': 'Tpjysd',
  528. 'qywz': 'Qywz',
  529. 'clfcz': 'Clfcz',
  530. 'clcz': 'Clcz',
  531. 'bdtj': 'Bdtj',
  532. 'bdzl': 'Bdzl',
  533. 'tjphcz': 'Tjphcz',
  534. 'tjphfcz': 'Tjphfcz',
  535. 'lx': 'Lx',
  536. 'hwhy': 'Hwhy',
  537. 'zyhy': 'Zyhy',
  538. 'wxhy': 'Wxhy',
  539. 'ddhy': 'Ddhy',
  540. 'ym': 'Ym',
  541. 'jb': 'Jb',
  542. 'jrjb': 'Jrjb',
  543. 'sy': 'Sy',
  544. 'zy': 'Zy',
  545. 'cs': 'Cs',
  546. 'dc': 'Dc',
  547. 'jd': 'Jd',
  548. 'jz': 'Jz',
  549. 'glzd': 'Glzd',
  550. 'glsd': 'Glsd',
  551. 'fy': 'Fy',
  552. 'qcyy': 'Qcyy',
  553. 'frdrq': 'Frdrq',
  554. 'fr': 'Fr',
  555. 'hb': 'Hb',
  556. 'rs': 'Rs',
  557. 'js': 'Js',
  558. 'mj': 'Mj',
  559. 'fs': 'Fs',
  560. 'fb': 'Fb',
  561. 'zlfz': 'Zlfz',
  562. //罗开凡新增
  563. 'kbyq': 'kbyq',
  564. 'kbsjgsp': 'kbsjgsp',
  565. 'kb': 'kb',
  566. 'jr': 'jr',
  567. 'fz': 'fz',
  568. //罗开凡新增
  569. //标配配制
  570. 'jrry_b': 'jrry_b',
  571. 'cl': 'cl',
  572. 'lx_b': 'Lx',
  573. 'cs_b': 'Cs',
  574. 'hwhy_b': 'Hwhy',
  575. 'zyhy_b': 'Zyhy',
  576. 'wxhy_b': 'Wxhy',
  577. 'ddhy_b': 'Ddhy',
  578. 'jb_b': 'Jb',
  579. 'jrjb_b': 'Jrjb',
  580. 'sy_b': 'Sy',
  581. 'zy_b': 'Zy',
  582. 'dc_b': 'Dc',
  583. 'glzd_b': 'Glzd',
  584. 'glsd_b': 'Glsd',
  585. 'jz_b': 'Jz',
  586. 'jd_b': 'Jd',
  587. 'fy_b': 'Fy',
  588. 'fr_b': 'Fr',
  589. //生物样品分析
  590. 'jd_swypfx': 'Jd',
  591. 'jryp': 'jryp',
  592. 'ysfy': 'Lx',
  593. 'hhspe': 'hhspe',
  594. 'phspe': 'hhspe',
  595. 'syspe': 'hhspe',
  596. 'lxspe': 'hhspe',
  597. 'xtspe': 'hhspe',
  598. 'zyfc': 'zyfc',
  599. //色谱匀浆组织表
  600. 'jszz':'jszz',
  601. 'cqzz':'jszz',
  602. 'jryjry':'jryjry',
  603. 'ymyj':'ymyj',
  604. 'yjyfz2':'yjyfz2',
  605. 'yjyfz3':'yjyfz2',
  606. 'yjbc':'yjbc',
  607. 'yjyhh':'jszz',
  608. 'fy_spyjzzb':'fy_spyjzzb',
  609. 'jz_spyjzzb':'jz_spyjzzb',
  610. //全血稳定性
  611. 'ddhy_qxwdx': 'Ddhy',
  612. 'hwph':'Hwhy',
  613. 'qxfz':'qxfz',
  614. 'qxjz':'qxjz',
  615. 'qxlx':'qxlx',
  616. 'qxqy':'qxjz',
  617. 'jzhlx':'qxlx',
  618. //样品分取
  619. 'fq2':'fq2',
  620. 'fq3':'fq2',
  621. 'hh':'hh',
  622. //组织清洗
  623. 'qx':'qx',
  624. 'zc':'zc',
  625. 'qy':'qy',
  626. //PCR
  627. 'sjjy':'sjjy',
  628. 'jryp_pcr':'jryp_pcr',
  629. 'bzyp':'bzyp',
  630. 'jz_pcr':'jz_pcr',
  631. 'nscyp':'nscyp',
  632. 'qrhy':'qrhy',
  633. 'pebwfz':'qrhy',
  634. 'tgbwfz':'tgbwfz',
  635. 'lsbwfz':'qrhy',
  636. 'tqsj':'tqsj',
  637. 'lssj':'lssj',
  638. 'yqzt':'yqzt',
  639. 'ecsj':'ecsj',
  640. 'czclcl':'czclcl',
  641. 'ypzy':'ypzy',
  642. 'hsypfz':'hsypfz',
  643. 'ypbc':'ypbc',
  644. 'jd_pcr':'jd_pcr',
  645. 'sjjyst':'sjjyst',
  646. 'ddhy_pcr':'ddhy_pcr',
  647. 'wxhy_pcr':'wxhy_pcr',
  648. 'sy_pcr':'sy_pcr',
  649. 'sslx':'sslx',
  650. 'xfzcl':'xfzcl',
  651. 'lxdy':'lxdy',
  652. 'xfzzysjg':'xfzzysjg',
  653. 'xfzzylxg':'xfzzylxg',
  654. 'xt':'xt',
  655. 'ecxt':'ecxt',
  656. 'lx_pcr':'lx_pcr',
  657. //PCR分析核酸提取浓度测定表
  658. 'ndcd':'ndcd',
  659. //PCR采集管称重记录表
  660. 'jrry_pcrcjg':'jrry_pcrcjg',
  661. //PCR匀浆表(知管重、知组织重、常规)
  662. 'jszz_pcryj':'jszz_pcryj',
  663. 'cqzz_pcryj':'cqzz_pcryj',
  664. 'jryjry_pcryj':'jryjry_pcryj',
  665. //PCR分析样品处理表
  666. 'xs':'xs',
  667. 'sjjy_pcrfxyp':'sjjy_pcrfxyp',
  668. 'jryp_pcrfxyp':'jryp_pcrfxyp',
  669. 'fmlx':'fmlx',
  670. 'pcrsj':'pcrsj',
  671. 'pbsz':'pbsz',
  672. 'cbygxz':'cbygxz',
  673. 'yxpcry':'yxpcry',
  674. 'cdnsypfz':'cdnsypfz',
  675. //检测板配制
  676. 'bb':'bb',
  677. 'xb':'bb',
  678. 'fb_jcb':'bb',
  679. 'jy':'jy',
  680. 'zh':'bb',
  681. 'jjcsj':'bb',
  682. 'sj':'bb',
  683. 'sjjy_jcb':'sjjy_jcb',
  684. 'zhfy':'zhfy',
  685. 'ecsj_jcb':'bb',
  686. 'xs_jcb':'xs_jcb',
  687. 'zz':'bb',
  688. 'jc':'bb',
  689. 'dbmby':'dbmby',
  690. 'dbhxfgxt':'dbmby',
  691. 'dbdhxfgxt':'dbdhxfgxt',
  692. 'dbygxt':'dbygxt',
  693. 'dzacl':'dzacl',
  694. 'qb':'qb',
  695. 'jzks':'jzks',
  696. 'fyxks':'fyxks',
  697. 'ycfyks':'ycfyks',
  698. 'ycks':'ycks',
  699. 'js_jcb':'js_jcb',
  700. 'fm':'dzacl',
  701. 'pg':'dzacl',
  702. 'czqx':'czqx',
  703. 'czzx':'czzx',
  704. 'ychy':'ychy',
  705. 'czzy':'czzy',
  706. 'sjbj':'sjbj',
  707. //细胞/菌株配制
  708. 'qxb':'qxb',
  709. 'qjz':'qjz',
  710. 'fr_xbjzpz':'fr_xbjzpz',
  711. 'lxqy':'lxqy',
  712. 'cd':'cd',
  713. 'xbzy':'xbzy',
  714. 'jzzy':'jzzy',
  715. 'dypyy':'dypyy',
  716. 'xd':'xd',
  717. 'xh':'xd',
  718. 'zzxh':'xd',
  719. 'copy':'copy',
  720. 'gc':'gc',
  721. 'cdmd':'cdmd',
  722. 'ds':'xd',
  723. 'gd':'xd',
  724. 'cdxs':'cdxs',
  725. //细胞表单
  726. 'gc_xb':'gc_xb',
  727. 'xdlc':'xdlc',
  728. 'bzpyy':'bzpyy',
  729. 'xh_xb':'xh_xb',
  730. 'jrrydh':'jrrydh',
  731. 'gd_xb':'xh_xb',
  732. 'rs_xb':'rs_xb',
  733. 'bpqr':'bpqr',
  734. 'dp':'dp',
  735. 'bprs':'bprs',
  736. 'cx':'cx',
  737. 'lg':'lg',
  738. //Ames表单
  739. 'hygh':'hygh',
  740. 'hwzd':'hwzd',
  741. 'jbcpyj':'jbcpyj',
  742. //配体结合分析样品/MRD稀释记录表
  743. 'xs_ptjhfxyp':'xs_ptjhfxyp',
  744. }
  745. }
  746. return this.componentMap
  747. }
  748. },
  749. created() {
  750. // // 初始化步骤数据
  751. // if (this.value && this.value.length > 0) {
  752. // this.steps = this.value.map((step) => ({
  753. // id: this.stepId++,
  754. // type: step.type || '',
  755. // formData: step.formData || {}
  756. // }))
  757. // } else {
  758. // // 默认添加一个步骤
  759. // this.addStep()
  760. // }
  761. this.getStepList()
  762. },
  763. watch: {
  764. // steps: {
  765. // handler(newVal) {
  766. // this.$emit('input', newVal);
  767. // },
  768. // deep: true
  769. // },
  770. formData: {
  771. handler(newVal) {
  772. if (!newVal || newVal.length === 0) return
  773. this.steps = newVal;
  774. },
  775. deep: true,
  776. immediate: true
  777. }
  778. },
  779. methods: {
  780. onDragEnd(evt) {
  781. justUpdateFilledFormData();
  782. },
  783. getStepList(){
  784. public_templateStepList({templateId:this.templateData.templateId}).then(response => {
  785. let options = []
  786. _.forEach(response.data,(item)=>{
  787. options.push({ label: item.name, value: item.sn })
  788. })
  789. this.stepSelectConfig.options = options
  790. });
  791. },
  792. isShowAddStep() {
  793. return this.templateFillType === 'preFill';
  794. },
  795. addStep() {
  796. try {
  797. this.steps.push({
  798. id: this.stepId++,
  799. type: '',
  800. formData: {}
  801. })
  802. justUpdateFilledFormData();
  803. this.$emit('step-added', this.steps.length)
  804. } catch (error) {
  805. console.error('添加步骤失败:', error)
  806. this.$message.error('添加步骤失败,请重试')
  807. }
  808. },
  809. removeStep(index) {
  810. if (this.steps.length > 1) {
  811. const removedStep = this.steps.splice(index, 1)[0]
  812. justUpdateFilledFormData();
  813. this.$emit('step-removed', { index, step: removedStep, remaining: this.steps.length })
  814. } else {
  815. this.$message.warning('至少需要保留一个步骤')
  816. }
  817. },
  818. onTypeChange(index) {
  819. // 切换步骤类型时重置表单数据,并确保数据更新
  820. const oldType = this.steps[index].type
  821. this.$set(this.steps[index], 'formData', {})
  822. // 可选:添加类型变化的回调
  823. this.$emit('step-type-changed', {
  824. index,
  825. newType: this.steps[index].type,
  826. oldType
  827. })
  828. },
  829. onFormUpdate(stepIndex, formData) {
  830. this.steps[stepIndex].formData = formData
  831. },
  832. getStepComponent(type) {
  833. // 使用计算属性中的映射,提高性能
  834. return this.stepComponentMap[type]
  835. },
  836. // 公共方法:获取所有步骤数据
  837. getFormData() {
  838. return new Promise(async (resolve, reject) => {
  839. // 检查是否有步骤数据
  840. if (this.steps.length === 0) {
  841. // this.$message.error(this.$t('template.common.addStepError'))
  842. reject({ errorType: "step" });
  843. return
  844. }
  845. try {
  846. const stepData = await Promise.all(
  847. this.steps.map(async (step, index) => {
  848. const stepComponentRef = this.$refs[`stepCompRef_${index}`];
  849. if (stepComponentRef && stepComponentRef.length > 0) {
  850. try {
  851. const stepFormData = await stepComponentRef[0].getFormData();
  852. return { type: step.type, formData: stepFormData }
  853. } catch (error) {
  854. // 如果某个步骤的getFormData方法失败,抛出错误
  855. throw error;
  856. }
  857. } else {
  858. // 如果没有找到组件引用,返回原始数据
  859. return { type: step.type, formData: step.formData }
  860. }
  861. })
  862. );
  863. resolve({ stepData });
  864. } catch (error) {
  865. reject(error);
  866. }
  867. })
  868. },
  869. getStepResource(){
  870. const sj = [];
  871. let yq = [];
  872. this.steps.map((step, index) => {
  873. const stepComponentRef = this.$refs[`stepCompRef_${index}`];
  874. if(stepComponentRef && stepComponentRef.length > 0){
  875. const {sjResource,yqResource} = this.$refs[`stepCompRef_${index}`][0]?.getSjResource();
  876. if(sjResource && sjResource.length > 0){
  877. sj.push(...sjResource);
  878. }
  879. if(yqResource && yqResource.length > 0){
  880. yq.push(...yqResource);
  881. }
  882. }
  883. })
  884. const resource = duplicateResource(sj, yq);
  885. return { sjResource: resource.sj, yqResource: resource.yq };
  886. },
  887. // 直接获取表单数据,不做校验
  888. getFilledFormData() {
  889. const stepData = this.steps.map((step, index) => {
  890. const stepComponentRef = this.$refs[`stepCompRef_${index}`];
  891. if(stepComponentRef && stepComponentRef.length > 0){
  892. const stepFormData = this.$refs[`stepCompRef_${index}`][0]?.getFilledFormData();
  893. return { type: step.type, formData: stepFormData }
  894. }else{
  895. return { type: step.type, formData: step.formData }
  896. }
  897. })
  898. return { stepData }
  899. },
  900. // 公共方法:设置步骤数据
  901. setStepData(data) {
  902. if (Array.isArray(data)) {
  903. this.steps = data.map(step => ({
  904. id: this.stepId++,
  905. type: step.type || '',
  906. formData: step.formData || {}
  907. }))
  908. }
  909. },
  910. // 公共方法:重置所有步骤
  911. resetSteps() {
  912. this.steps = [{
  913. id: this.stepId++,
  914. type: '',
  915. formData: {}
  916. }]
  917. this.$emit('steps-reset')
  918. },
  919. // 公共方法:获取指定步骤的数据
  920. getStepDataByIndex(index) {
  921. if (index >= 0 && index < this.steps.length) {
  922. return {
  923. type: this.steps[index].type,
  924. formData: this.steps[index].formData
  925. }
  926. }
  927. return null
  928. },
  929. // 公共方法:验证所有步骤
  930. async validateSteps() {
  931. const errors = []
  932. for (let index = 0; index < this.steps.length; index++) {
  933. const step = this.steps[index];
  934. if (!step.type) {
  935. errors.push(`步骤 ${index + 1}: 请选择步骤类型`)
  936. continue;
  937. }
  938. // 获取当前步骤的组件实例
  939. const stepComponentRef = this.$refs[`stepCompRef_${index}`];
  940. if (stepComponentRef && stepComponentRef.length > 0) {
  941. try {
  942. // 调用子组件的getFormData方法进行验证(不抛出错误,只验证)
  943. await stepComponentRef[0].validateAndMarkRed();
  944. } catch (error) {
  945. // validateAndMarkRed方法不应该抛出错误,但如果有的话捕获它
  946. console.error(`步骤 ${index + 1} 验证时出错:`, error);
  947. }
  948. }
  949. }
  950. return {
  951. isValid: errors.length === 0,
  952. errors
  953. }
  954. },
  955. // 公共方法:批量导入步骤数据
  956. importSteps(stepDataArray) {
  957. if (Array.isArray(stepDataArray)) {
  958. this.steps = stepDataArray.map((step, index) => ({
  959. id: this.stepId++,
  960. type: step.type || '',
  961. formData: step.formData || {}
  962. }))
  963. this.$emit('steps-imported', this.steps.length)
  964. }
  965. },
  966. // 公共方法:获取步骤统计信息
  967. getStepStatistics() {
  968. const stats = {
  969. total: this.steps.length,
  970. byType: {},
  971. filled: 0
  972. }
  973. this.steps.forEach(step => {
  974. // 统计各类型数量
  975. if (step.type) {
  976. stats.byType[step.type] = (stats.byType[step.type] || 0) + 1
  977. }
  978. // 统计已填写的步骤
  979. if (step.type && Object.keys(step.formData).length > 0) {
  980. stats.filled++
  981. }
  982. })
  983. return stats
  984. }
  985. },
  986. }
  987. </script>
  988. <style lang="scss" scoped>
  989. .step-container {
  990. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  991. margin-top: 24px;
  992. padding: 24px;
  993. border-radius: 5px 5px;
  994. .step-header {
  995. margin-bottom: 20px;
  996. padding: 15px;
  997. background: #f5f7fa;
  998. border-radius: 6px;
  999. }
  1000. .flex1 {
  1001. flex:1
  1002. }
  1003. .step-list {
  1004. padding-top: 10px;
  1005. .step-list-item {
  1006. page-break-inside: avoid;
  1007. padding-top: 10px;
  1008. border-radius: 6px;
  1009. overflow: hidden;
  1010. transition: background-color 0.2s;
  1011. &:hover {
  1012. // background-color: #f5f7fa;
  1013. }
  1014. &.ghost {
  1015. background-color: transparent !important;
  1016. }
  1017. .drag-handle {
  1018. color: #909399;
  1019. transition: color 0.2s;
  1020. &:hover {
  1021. color: #409eff;
  1022. }
  1023. }
  1024. .step-title {
  1025. margin-right: 10px;
  1026. margin-top: 6px;
  1027. }
  1028. .step-type-select {
  1029. width: 200px;
  1030. margin-right: 10px;
  1031. max-width: 200px;
  1032. }
  1033. .delete-btn {
  1034. color: #f56c6c;
  1035. &:hover {
  1036. color: #f78989;
  1037. }
  1038. &:disabled {
  1039. color: #c0c4cc;
  1040. }
  1041. }
  1042. .step-content {
  1043. display: flex;
  1044. align-items: flex-start;
  1045. }
  1046. }
  1047. }
  1048. }
  1049. </style>