AddDiagBase.vue 58 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716
  1. <template>
  2. <div style="min-height:100%" ref="viewBox">
  3. <crumbs :title="title" :param="$route.params" linkTo="ZskDiagBase"></crumbs>
  4. <div class="contents">
  5. <el-form
  6. :inline="true"
  7. ref="form"
  8. :label-position="labelPosition"
  9. class="add-new-form"
  10. label-width="100px"
  11. :model="form"
  12. :rules="rules"
  13. >
  14. <div class="content">
  15. <el-form-item label="疾病名称:" class="item" prop="conceptId" :rules="rules.conceptId">
  16. <el-select
  17. clearable
  18. remote
  19. filterable
  20. :remote-method="searchDiag"
  21. v-model.trim="form.conceptId"
  22. >
  23. <el-option
  24. v-for="item in conceptList"
  25. :key="item.conceptId"
  26. :label="item.conceptName"
  27. :value="item.conceptId"
  28. ></el-option>
  29. </el-select>
  30. </el-form-item>
  31. <el-form-item label="诊断依据描述:" prop="description" class="item">
  32. <el-input
  33. class="inps"
  34. maxlength="200"
  35. placeholder="请输入诊断依据描述"
  36. v-model.trim="form.description"
  37. ></el-input>
  38. </el-form-item>
  39. </div>
  40. <div class="content content-2">
  41. <div class="content-2-header">
  42. <p class="title1">
  43. <span class="star">*</span>诊断依据内容
  44. </p>
  45. <p class="title2">注:1、选择诊断依据类型后才能展示基础依据类型。2、医学内容可输入升高、降低、阴性、阳性等~</p>
  46. </div>
  47. <el-table
  48. size="mini"
  49. :span-method="dataSpanMethod"
  50. :data="form.klDiagnoseTypeVO"
  51. border
  52. ref="tableList"
  53. style="min-height: 200px"
  54. height="calc(100vh - 450px)"
  55. :header-cell-style="{background:'#E3EAF4'}"
  56. >
  57. <el-table-column label="依据" width="100" fixed>
  58. <template slot="header" slot-scope="scope">
  59. <span class="name">依据</span>
  60. </template>
  61. <template slot-scope="scope">
  62. <el-form-item>
  63. <img
  64. src="../../images/icon-copy.png"
  65. height="18"
  66. width="18"
  67. class="icon"
  68. @click="copyDiag(scope.row.depart_id)"
  69. />
  70. <img
  71. src="../../images/icon-add.png"
  72. height="18"
  73. width="18"
  74. class="icon"
  75. @click="addDiag(scope.row.depart_id)"
  76. />
  77. <img
  78. src="../../images/icon-delete.png"
  79. height="18"
  80. width="18"
  81. class="icon"
  82. @click="delDiag(scope.row.depart_id,scope.$index)"
  83. v-show="dest.length>1"
  84. />
  85. </el-form-item>
  86. </template>
  87. </el-table-column>
  88. <el-table-column label="诊断依据类型" width="130">
  89. <template slot="header" slot-scope="scope">
  90. <span class="star">*</span>
  91. <span class="name">诊断依据类型</span>
  92. </template>
  93. <template slot-scope="scope">
  94. <el-form-item
  95. class="is-request"
  96. :prop="'klDiagnoseTypeVO.'+scope.$index+'.conditionType'"
  97. :rules="rules.conditionType"
  98. >
  99. <el-select
  100. ref="aa"
  101. v-model="form.klDiagnoseTypeVO[scope.$index].conditionType"
  102. @change="(val)=>basTypeChange(val,scope.$index)"
  103. >
  104. <el-option
  105. v-for="item in baseTypes"
  106. :key="item.ruleType"
  107. :label="item.name"
  108. :value="item.ruleType"
  109. ></el-option>
  110. </el-select>
  111. </el-form-item>
  112. </template>
  113. </el-table-column>
  114. <el-table-column label="组" width="130">
  115. <template slot="header" slot-scope="scope">
  116. <span class="star">*</span>
  117. <span class="name">组</span>
  118. </template>
  119. <template slot-scope="scope">
  120. <el-form-item>
  121. <img
  122. src="../../images/icon-add.png"
  123. height="18"
  124. width="18"
  125. class="icon"
  126. @click="addGroup(scope.$index)"
  127. />
  128. <img
  129. src="../../images/icon-delete.png"
  130. height="18"
  131. width="18"
  132. class="icon"
  133. @click="delGroup(scope.row.depart_id,scope.$index)"
  134. v-show="isMax(scope.row.depart_id)"
  135. />
  136. </el-form-item>
  137. </template>
  138. </el-table-column>
  139. <el-table-column label="符合条件数量" width="150">
  140. <template slot="header" slot-scope="scope">
  141. <span class="star">*</span>
  142. <span class="name">符合条件数量</span>
  143. </template>
  144. <template slot-scope="scope">
  145. <el-form-item
  146. :prop="'klDiagnoseTypeVO.'+scope.$index+'.groupVO.'+0+'.fitNo'"
  147. :rules="rules.fitNo"
  148. >
  149. <el-select v-model="scope.row.groupVO[0].fitNo">
  150. <el-option
  151. v-for="item in numArr[scope.$index].num[0]"
  152. :key="item.id"
  153. :label="item.name"
  154. :value="item.id"
  155. ></el-option>
  156. </el-select>
  157. </el-form-item>
  158. </template>
  159. </el-table-column>
  160. <el-table-column v-for="(v,i) in columns" :width="v.width" :key="i">
  161. <template slot="header" slot-scope="scope">
  162. <span class="star" v-if="v.istar">*</span>
  163. <span class="name">{{v.title}}</span>
  164. </template>
  165. <template slot-scope="scope">
  166. <div v-for="(item,index) in scope.row.groupVO" :key="index">
  167. <div v-for="(items,i) in item.klDiagnoseDetail" :key="i">
  168. <div v-if="v.title == '基础依据'">
  169. <el-form-item>
  170. <img
  171. src="../../images/icon-add.png"
  172. height="18"
  173. width="18"
  174. class="icon"
  175. @click="addRule(scope.row,scope.$index,index,i)"
  176. />
  177. <img
  178. src="../../images/icon-delete.png"
  179. height="18"
  180. width="18"
  181. class="icon"
  182. @click="delRule(scope.row,scope.$index,index,i)"
  183. v-show="item.klDiagnoseDetail.length>1"
  184. />
  185. </el-form-item>
  186. </div>
  187. <div class="box-2" v-if="v.title == '基础依据名称'">
  188. <el-form-item
  189. :prop="'klDiagnoseTypeVO.' +
  190. scope.$index +
  191. '.groupVO.' +
  192. index +
  193. '.klDiagnoseDetail.'+i+'.basDescription'"
  194. :rules="rules.basDescription"
  195. >
  196. <el-input
  197. class="inp-name"
  198. placeholder="请输入基础依据名称"
  199. maxlength="100"
  200. v-model.trim="items.basDescription"
  201. ></el-input>
  202. </el-form-item>
  203. </div>
  204. <div class="box-2" v-if="v.title == '基础依据类型'">
  205. <el-form-item
  206. :prop="'klDiagnoseTypeVO.' +
  207. scope.$index +
  208. '.groupVO.' +
  209. index +
  210. '.klDiagnoseDetail.'+i+'.basType'"
  211. :rules="rules.basType"
  212. >
  213. <el-select
  214. v-model="items.basType"
  215. @change="(val)=>baseTermTypeChange(val,scope.$index,index,i)"
  216. >
  217. <el-option
  218. v-for="item in baseTermTypeList"
  219. :key="item.id"
  220. :label="item.name"
  221. :value="item.type"
  222. ></el-option>
  223. </el-select>
  224. </el-form-item>
  225. </div>
  226. <el-form-item
  227. :prop="'klDiagnoseTypeVO.' +
  228. scope.$index +
  229. '.groupVO.' +
  230. index +
  231. '.klDiagnoseDetail.'+i+'.basLibType'"
  232. v-if="!items.basNameType && v.title == '基础依据术语类型'"
  233. :rules="rules.basLibType"
  234. >
  235. <el-select
  236. v-model="items.basLibType"
  237. @change="(val)=>basLibTypeChange(val,scope.$index,index,i)"
  238. >
  239. <el-option
  240. v-for="item in items.basLibTypeList"
  241. :key="item.id"
  242. :label="item.name"
  243. :value="Number(item.code)"
  244. ></el-option>
  245. </el-select>
  246. </el-form-item>
  247. <el-form-item v-if="items.basNameType && v.title == '基础依据术语类型'">
  248. <el-input disabled v-model="items.basTypeName"></el-input>
  249. </el-form-item>
  250. <div
  251. v-if="v.title == '医学标准术语'"
  252. class="box-2"
  253. :class="items.basType===3 || items.basType===4|| items.basType===5 || items.basType===6? 'tmall' : 'taobao'"
  254. >
  255. <el-form-item
  256. v-if="items.basType==1 || items.basType==2 || items.basType==''"
  257. :prop="'klDiagnoseTypeVO.' +
  258. scope.$index +
  259. '.groupVO.' +
  260. index +
  261. '.klDiagnoseDetail.'+i+'.basConceptId'"
  262. :rules="rules.subConceptId"
  263. >
  264. <el-select
  265. class="searchselect"
  266. v-model.trim="items.basConceptId"
  267. multiple
  268. filterable
  269. remote
  270. reserve-keyword
  271. placeholder="请输入关键词"
  272. :remote-method="(val)=>searchConcept(val,scope.$index,index,i)"
  273. @change="(val)=>conceptChange(val,scope.$index,index,i)"
  274. >
  275. <el-option
  276. v-for="item in items.conceptList"
  277. :key="item.conceptId"
  278. :label="item.conceptName"
  279. :value="item.conceptId"
  280. ></el-option>
  281. </el-select>
  282. <!-- <el-select
  283. clearable
  284. remote
  285. filterable
  286. :remote-method="(val)=>searchConcept(val,scope.$index,index,i)"
  287. v-model.trim="items.basConceptId"
  288. @change="(val)=>conceptChange(val,scope.$index,index,i)"
  289. >
  290. <el-option
  291. v-for="item in items.conceptList"
  292. :key="item.conceptId"
  293. :label="item.conceptName"
  294. :value="item.conceptId"
  295. ></el-option>
  296. </el-select>-->
  297. </el-form-item>
  298. </div>
  299. <div class="last-box" v-if="v.title == '依据具体内容'">
  300. <el-form-item
  301. :prop="'klDiagnoseTypeVO.' +
  302. scope.$index +
  303. '.groupVO.' +
  304. index +
  305. '.klDiagnoseDetail.'+i+'.dataType'"
  306. v-if="items.basType===2&&!items.onlyNumType&&!items.onlyTxtType"
  307. :rules="rules.dataType"
  308. >
  309. <el-select
  310. class="box-1"
  311. :class="items.basType===2&&!items.onlyNumType&&!items.onlyTxtType? 'taobao' : 'tmall'"
  312. v-model="items.dataType"
  313. @change="(val)=>dataTypeChange(val,scope.$index,index,i)"
  314. placeholder="请选择"
  315. size="small"
  316. >
  317. <el-option
  318. v-for="item in dataTypes"
  319. :key="item.id"
  320. :label="item.name"
  321. :value="item.id"
  322. ></el-option>
  323. </el-select>
  324. </el-form-item>
  325. <el-form-item
  326. v-if="(!items.onlyNumType&&items.dataType==='1')||items.onlyNumType"
  327. label="最大值:"
  328. label-width="60px"
  329. >
  330. <div class="last-box-1">
  331. <el-form-item
  332. :prop="'klDiagnoseTypeVO.' +
  333. scope.$index +
  334. '.groupVO.' +
  335. index +
  336. '.klDiagnoseDetail.'+i+'.maxOperator'"
  337. :rules="[
  338. {
  339. validator: (rule, value, callback) => {
  340. maxOperator(items, rule, value, callback);
  341. },
  342. trigger: ['change']
  343. }
  344. ]"
  345. >
  346. <el-select
  347. v-model="items.maxOperator"
  348. placeholder="请选择"
  349. size="small"
  350. clearable
  351. >
  352. <el-option
  353. v-for="item in operMaxList"
  354. :key="item.key"
  355. :label="item.name"
  356. :value="item.key"
  357. ></el-option>
  358. </el-select>
  359. </el-form-item>
  360. <el-form-item
  361. class="num"
  362. :prop="'klDiagnoseTypeVO.' +
  363. scope.$index +
  364. '.groupVO.' +
  365. index +
  366. '.klDiagnoseDetail.'+i+'.maxVal'"
  367. :rules="[
  368. {
  369. validator: (rule, value, callback) => {
  370. maxVal(items, rule, value, callback);
  371. },
  372. trigger: ['blur']
  373. }
  374. ]"
  375. >
  376. <el-input v-model="items.maxVal" placeholder="填写数值"></el-input>
  377. </el-form-item>
  378. <el-form-item prop="minUnit">
  379. <el-input v-model.trim="items.maxUnit" placeholder="填写单位"></el-input>
  380. </el-form-item>
  381. </div>
  382. </el-form-item>
  383. <el-form-item
  384. v-if="(!items.onlyNumType&&items.dataType==='1')||items.onlyNumType"
  385. label="最小值:"
  386. label-width="60px"
  387. >
  388. <div class="last-box-1 last-box-s">
  389. <el-form-item
  390. :prop="'klDiagnoseTypeVO.' +
  391. scope.$index +
  392. '.groupVO.' +
  393. index +
  394. '.klDiagnoseDetail.'+i+'.minOperator'"
  395. :rules="[
  396. {
  397. validator: (rule, value, callback) => {
  398. minOperator(items, rule, value, callback);
  399. },
  400. trigger: ['change']
  401. }
  402. ]"
  403. >
  404. <el-select
  405. v-model="items.minOperator"
  406. placeholder="请选择"
  407. size="small"
  408. clearable
  409. >
  410. <el-option
  411. v-for="item in operMinList"
  412. :key="item.key"
  413. :label="item.name"
  414. :value="item.key"
  415. ></el-option>
  416. </el-select>
  417. </el-form-item>
  418. <el-form-item
  419. class="minnum"
  420. :prop="'klDiagnoseTypeVO.' +
  421. scope.$index +
  422. '.groupVO.' +
  423. index +
  424. '.klDiagnoseDetail.'+i+'.minVal'"
  425. :rules="[
  426. {
  427. validator: (rule, value, callback) => {
  428. minVal(items, rule, value, callback);
  429. },
  430. trigger: ['blur']
  431. }
  432. ]"
  433. >
  434. <el-input v-model="items.minVal" placeholder="填写数值"></el-input>
  435. </el-form-item>
  436. <el-form-item prop="minUnit">
  437. <el-input v-model.trim="items.minUnit" placeholder="填写单位"></el-input>
  438. </el-form-item>
  439. </div>
  440. </el-form-item>
  441. <div>
  442. <el-form-item
  443. :prop="'klDiagnoseTypeVO.' +
  444. scope.$index +
  445. '.groupVO.' +
  446. index +
  447. '.klDiagnoseDetail.'+i+'.eqValue'"
  448. v-if="items.basType===4 || items.basType===3||items.basType===6 || items.basType===5"
  449. maxlength="200"
  450. label="正则表达式:"
  451. class="discDesc"
  452. :rules="[
  453. {
  454. required: true,
  455. message: '请输入正则表达式',
  456. trigger: 'blur'
  457. },
  458. ]"
  459. >
  460. <el-input class="inp" placeholder="请输入正则表达式" v-model.trim="items.eqValue"></el-input>
  461. </el-form-item>
  462. </div>
  463. <div>
  464. <el-form-item
  465. :prop="'klDiagnoseTypeVO.' +
  466. scope.$index +
  467. '.groupVO.' +
  468. index +
  469. '.klDiagnoseDetail.'+i+'.eqValue'"
  470. maxlength="200"
  471. v-if="(!items.onlyNumType&&!items.basNameType&&(items.basType===2 || items.basType===1)&&items.dataType==='2')||items.onlyTxtType"
  472. label="医学内容:"
  473. class="discDesc"
  474. :rules="[
  475. {
  476. required: true,
  477. message: '请输入医学内容',
  478. trigger: 'blur'
  479. }
  480. ]"
  481. >
  482. <el-input v-model.trim="items.eqValue" class="inp" placeholder="请输入医学内容"></el-input>
  483. </el-form-item>
  484. </div>
  485. </div>
  486. </div>
  487. </div>
  488. </template>
  489. </el-table-column>
  490. </el-table>
  491. </div>
  492. </el-form>
  493. <div class="Butn">
  494. <el-button class="disclButn" size="small" type="primary" @click="confirm">确定</el-button>
  495. </div>
  496. </div>
  497. </div>
  498. </template>
  499. <script type="text/javascript">
  500. import util from '../../api/utils.js';
  501. import api from '@api/zskDiagBase.js';
  502. import { tableRules } from './rules';
  503. export default {
  504. name: 'AddZskDiagBase',
  505. data() {
  506. return {
  507. columns: [
  508. { title: '基础依据', width: 90, istar: true },
  509. { title: '基础依据名称', width: 160, istar: true },
  510. { title: '基础依据类型', width: 130, istar: true },
  511. { title: '基础依据术语类型', width: 160, istar: true },
  512. { title: '医学标准术语', width: 180, istar: true },
  513. { title: '依据具体内容', width: 850 }
  514. ],
  515. dicts: {},
  516. baseTypes: [], //诊断数据类型
  517. baseTermTypeList: [], //基础依据类型
  518. basLibTypeList: [], //基础术语依据类型
  519. numTypes: '', //只有数值类型的类型id
  520. labelPosition: 'left',
  521. isCopy: false,
  522. title: '诊断依据维护-添加诊断依据',
  523. conceptName: '',
  524. conceptList: [],
  525. form: {
  526. description: '',
  527. conceptId: '',
  528. klDiagnoseTypeVO: [
  529. {
  530. conditionType: '',
  531. depart_id: 0,
  532. groupVO: [
  533. {
  534. baseGroup: '',
  535. conditionGroup: '',
  536. fitNo: '',
  537. klDiagnoseDetail: [
  538. {
  539. dataType: '',
  540. basNameType: false,
  541. onlyNumType: false,
  542. onlyTxtType: false,
  543. basTypeName: '',
  544. basConceptId: [],
  545. basDescription: '',
  546. basLename: '',
  547. basLibName: '',
  548. basLibType: null,
  549. basType: '',
  550. eqOperator: '',
  551. eqUnit: '',
  552. eqValue: '',
  553. maxOperator: '',
  554. maxUnit: '',
  555. maxVal: '',
  556. minOperator: '',
  557. minUnit: '',
  558. minVal: ''
  559. }
  560. ]
  561. }
  562. ]
  563. }
  564. ]
  565. },
  566. id: null,
  567. rules: tableRules,
  568. dataTypes: [
  569. { id: '1', name: '数值类型' },
  570. { id: '2', name: '文本类型' }
  571. ],
  572. operMaxList: [
  573. { name: '<=', key: '<=' },
  574. { name: '<', key: '<' }
  575. ],
  576. operMinList: [
  577. { name: '>', key: '>' },
  578. { name: '>=', key: '>=' }
  579. ],
  580. basType: '',
  581. dataType: '',
  582. spanArr: [],
  583. list: [], //提交数据数组,
  584. i: 1,
  585. onshow: true
  586. };
  587. },
  588. created() {
  589. const param = this.$route.params;
  590. this.baseTypes = JSON.parse(localStorage.getItem('zskDiagList') || '[]');
  591. this.dicts = JSON.parse(localStorage.getItem('zskDiagDicts') || '{}');
  592. let info = param.data;
  593. if (info) {
  594. this.id = info.id;
  595. this.isCopy = param.copy;
  596. this.title =
  597. '诊断依据维护-' + (this.isCopy ? '复制' : '修改') + '诊断依据';
  598. this.conceptList = [
  599. { conceptId: info.conceptId, conceptName: info.conceptName }
  600. ];
  601. for (let i = 0; i < info.klDiagnoseTypeVO.length; i++) {
  602. info.klDiagnoseTypeVO[i].depart_id = i;
  603. }
  604. this.form = Object.assign({}, this.form, this.formatData(info));
  605. if (this.isCopy) {
  606. this.conceptList = [];
  607. delete this.form.conceptName;
  608. delete this.form.conceptId;
  609. delete this.form.description;
  610. delete this.form.id;
  611. }
  612. var index2 = this.baseTypes.findIndex(
  613. item => item.ruleType === this.form.klDiagnoseTypeVO[0].conditionType
  614. );
  615. this.baseTermTypeList = this.baseTypes[index2].subMenuList;
  616. <<<<<<< HEAD
  617. const klDiagnoseTypeVO =this.form.klDiagnoseTypeVO;
  618. let groupVOi,klDiagnoseDetailj;
  619. for (let i = 0; i < klDiagnoseTypeVO.length; i++) {
  620. groupVOi = klDiagnoseTypeVO[i].groupVO;
  621. for (let j = 0; j < groupVOi.length; j++) {
  622. klDiagnoseDetailj = groupVOi[j].klDiagnoseDetail;
  623. for (let k = 0;k <groupVOi[j].klDiagnoseDetail.length;k++) {
  624. =======
  625. let arr = [];
  626. for (let i = 0; i < this.form.klDiagnoseTypeVO.length; i++) {
  627. for (let j = 0; j < this.form.klDiagnoseTypeVO[i].groupVO.length; j++) {
  628. for (
  629. let k = 0;
  630. k <
  631. this.form.klDiagnoseTypeVO[i].groupVO[j].klDiagnoseDetail.length;
  632. k++
  633. ) {
  634. >>>>>>> termLink0615
  635. var index2 = this.baseTermTypeList.findIndex(
  636. item =>item.type ===klDiagnoseDetailj[k].basType
  637. );
  638. klDiagnoseDetailj[k].basLibTypeList = this.baseTermTypeList[index2].subMenuList;
  639. this.form.klDiagnoseTypeVO[i].groupVO[j].klDiagnoseDetail[
  640. k
  641. ].conceptList = this.formatData2(this.form.klDiagnoseTypeVO[i].groupVO[
  642. j
  643. ].klDiagnoseDetail[k].libNameList)
  644. this.form.klDiagnoseTypeVO[i].groupVO[j].klDiagnoseDetail[
  645. k
  646. ].libNameList.forEach(item => {
  647. arr.push(item.basConceptId);
  648. });
  649. this.form.klDiagnoseTypeVO[i].groupVO[j].klDiagnoseDetail[
  650. k
  651. ].basConceptId = arr;
  652. if (
  653. this.form.klDiagnoseTypeVO[i].groupVO[j].klDiagnoseDetail[k]
  654. .maxOperator ||
  655. this.form.klDiagnoseTypeVO[i].groupVO[j].klDiagnoseDetail[k]
  656. .minOperator
  657. ) {
  658. this.form.klDiagnoseTypeVO[i].groupVO[j].klDiagnoseDetail[
  659. k
  660. ].dataType = '1';
  661. } else if (
  662. klDiagnoseDetailj[k].eqValue) {
  663. klDiagnoseDetailj[k].dataType = '2';
  664. }
  665. if (klDiagnoseDetailj[k].basType == 3 || klDiagnoseDetailj[k].basType == 4||klDiagnoseDetailj[k].basType == 5 || klDiagnoseDetailj[k].basType == 6) {
  666. klDiagnoseDetailj[k].basTypeName = klDiagnoseDetailj[k].basLibTypeList[0].name;
  667. klDiagnoseDetailj[k].basNameType = true;
  668. } else {
  669. klDiagnoseDetailj[k].basTypeName = '';
  670. klDiagnoseDetailj[k].basNameType = false;
  671. }
  672. const onlyNum = this.dicts['onlyNum'] || '&';
  673. const onlyTxt = this.dicts['onlyTxt'] || '&';
  674. const codes = onlyNum + ',';
  675. const code = onlyTxt + ',';
  676. let type = klDiagnoseDetailj[k].basLibType;
  677. let a = klDiagnoseDetailj[k].basLibType;
  678. klDiagnoseDetailj[k].onlyNumType = type && codes.indexOf(a + ',') > -1;
  679. klDiagnoseDetailj[k].onlyTxtType = type && code.indexOf(a + ',') > -1;
  680. }
  681. }
  682. }
  683. this.i = this.form.klDiagnoseTypeVO.slice(-1)[0].depart_id + 1;
  684. }
  685. },
  686. computed: {
  687. numArr() {
  688. let arr = [];
  689. let num = [];
  690. for (let i = 0; i < this.form.klDiagnoseTypeVO.length; i++) {
  691. arr.push({ num: [] });
  692. for (let j = 0; j < this.form.klDiagnoseTypeVO[i].groupVO.length; j++) {
  693. arr[i].num.push([]);
  694. for (
  695. let k = 0;
  696. k <
  697. this.form.klDiagnoseTypeVO[i].groupVO[j].klDiagnoseDetail.length;
  698. k++
  699. ) {
  700. arr[i].num[j].push({ id: k + 1, name: k + 1 });
  701. }
  702. }
  703. }
  704. return arr;
  705. },
  706. dest() {
  707. const formData = JSON.parse(JSON.stringify(this.form));
  708. let map = {},
  709. dest = [];
  710. for (let i = 0; i < formData.klDiagnoseTypeVO.length; i++) {
  711. let ai = formData.klDiagnoseTypeVO[i];
  712. if (!map[ai.depart_id]) {
  713. dest.push({
  714. depart_id: ai.depart_id,
  715. conditionType: ai.conditionType,
  716. groupVO: ai.groupVO
  717. });
  718. map[ai.depart_id] = ai;
  719. } else {
  720. for (let j = 0; j < dest.length; j++) {
  721. var dj = dest[j];
  722. if (dj.depart_id == ai.depart_id) {
  723. dj.groupVO = dj.groupVO.concat(ai.groupVO);
  724. break;
  725. }
  726. }
  727. }
  728. }
  729. return dest;
  730. }
  731. },
  732. methods: {
  733. // 最大值 选择rule
  734. maxOperator(items, rule, value, callback) {
  735. const { maxVal, minOperator, minVal } = items;
  736. const val = value + minOperator + minVal + maxVal;
  737. if (!val || (!value && maxVal !== '')) {
  738. callback(new Error('最大值和最小值至少完整填写一个,单位不必填'));
  739. } else {
  740. callback();
  741. }
  742. },
  743. // 最大值 数值rule
  744. maxVal(items, rule, value, callback) {
  745. const { maxOperator, minOperator, minVal } = items;
  746. const val = value + maxOperator + minOperator + minVal;
  747. const isNum = /^(\-|\+)?\d+(\.\d+)?$/.test(value);
  748. if (!val || (value == '' && maxOperator)) {
  749. callback(new Error('最大值和最小值至少完整填写一个,单位不必填'));
  750. } else if (value !== '' && !isNum) {
  751. callback(new Error('只能输入数字'));
  752. } else {
  753. callback();
  754. }
  755. },
  756. // 最小值 选择rule
  757. minOperator(items, rule, value, callback) {
  758. const { maxVal, maxOperator, minVal } = items;
  759. const val = value + maxVal + maxOperator + minVal;
  760. if (!val || (!value && minVal !== '')) {
  761. callback(new Error('最大值和最小值至少完整填写一个,单位不必填'));
  762. } else {
  763. callback();
  764. }
  765. },
  766. // 最小值 数值rule
  767. minVal(items, rule, value, callback) {
  768. const { maxVal, minOperator, maxOperator } = items;
  769. const val = value + maxVal + minOperator + maxOperator;
  770. const isNum = /^(\-|\+)?\d+(\.\d+)?$/.test(value);
  771. if (!val || (value == '' && minOperator)) {
  772. callback(new Error('最大值和最小值至少完整填写一个,单位不必填'));
  773. } else if (value !== '' && !isNum) {
  774. callback(new Error('只能输入数字'));
  775. } else {
  776. callback();
  777. }
  778. },
  779. isMax(id) {
  780. const typeNum = this.form.klDiagnoseTypeVO.filter(
  781. item => item.depart_id === id
  782. ).length;
  783. return typeNum > 1;
  784. },
  785. getData(data) {
  786. let arr = data;
  787. let str = [];
  788. let newArr = [];
  789. arr.filter((value, index, array) => {
  790. if (value.groupVO.length > 1 && value.groupVO.length != 0) {
  791. for (let j = 0; j < value.groupVO.length; j++) {
  792. var db = {
  793. conditionType: value.conditionType,
  794. depart_id: value.depart_id,
  795. groupVO: [value.groupVO[j]]
  796. };
  797. str.push(db);
  798. }
  799. value.groupVO = [];
  800. arr.splice(index, 1);
  801. arr.splice(index, 0, ...str);
  802. newArr = str;
  803. } else {
  804. newArr = arr;
  805. }
  806. });
  807. // console.log(newArr)
  808. // this.$set(this, 'form.klDiagnoseTypeVO', newArr);
  809. this.getSpanArr(newArr);
  810. },
  811. getSpanArr(data) {
  812. this.spanArr = [];
  813. for (var i = 0; i < data.length; i++) {
  814. if (i === 0) {
  815. this.spanArr.push(1);
  816. this.pos = 0;
  817. } else {
  818. if (data[i].depart_id === data[i - 1].depart_id) {
  819. this.spanArr[this.pos] += 1;
  820. this.spanArr.push(0);
  821. } else {
  822. this.spanArr.push(1);
  823. this.pos = i;
  824. }
  825. }
  826. }
  827. },
  828. dataSpanMethod({ row, column, rowIndex, columnIndex }) {
  829. if (columnIndex === 0 || columnIndex === 1) {
  830. //合并行的行为只在第一列进行
  831. const _row = this.spanArr[rowIndex];
  832. const _col = _row > 0 ? 1 : 0;
  833. return {
  834. rowspan: _row,
  835. colspan: _col
  836. };
  837. }
  838. },
  839. getInitData() {
  840. this.i++;
  841. return {
  842. conditionType: '',
  843. depart_id: this.i,
  844. groupVO: [
  845. {
  846. baseGroup: '',
  847. conditionGroup: '',
  848. fitNo: '',
  849. klDiagnoseDetail: [
  850. {
  851. dataType: '',
  852. basNameType: false,
  853. onlyNumType: false,
  854. onlyTxtType: false,
  855. basTypeName: '',
  856. basConceptId: [],
  857. basDescription: '',
  858. basLename: '',
  859. basLibName: '',
  860. basLibType: null,
  861. basType: '',
  862. eqOperator: '',
  863. eqUnit: '',
  864. eqValue: '',
  865. maxOperator: '',
  866. maxUnit: '',
  867. maxVal: '',
  868. minOperator: '',
  869. minUnit: '',
  870. minVal: ''
  871. }
  872. ]
  873. }
  874. ]
  875. };
  876. },
  877. //新增依据
  878. addDiag(id) {
  879. let temp = this.getInitData();
  880. var i = -1;
  881. this.form.klDiagnoseTypeVO.forEach((item, inx) => {
  882. if (item.depart_id == id) {
  883. i = inx;
  884. }
  885. });
  886. this.$nextTick(() => {
  887. this.$refs.tableList.bodyWrapper.scrollLeft = 0;
  888. });
  889. this.form.klDiagnoseTypeVO.splice(i + 1, 0, temp);
  890. },
  891. //复制依据
  892. copyDiag(id) {
  893. this.i++;
  894. const formData = JSON.parse(JSON.stringify(this.form));
  895. let i = -1;
  896. let arr = [];
  897. formData.klDiagnoseTypeVO.forEach((item, inx) => {
  898. if (item.depart_id == id) {
  899. arr.push(item);
  900. i = inx;
  901. }
  902. });
  903. arr.forEach((item, index) => {
  904. item.depart_id = this.i;
  905. this.form.klDiagnoseTypeVO.splice(i + index + 1, 0, item);
  906. });
  907. // console.log(this.form.klDiagnoseTypeVO);
  908. // let map = {},
  909. // dest = [];
  910. // for (let i = 0; i < formData.klDiagnoseTypeVO.length; i++) {
  911. // let ai = formData.klDiagnoseTypeVO[i];
  912. // if (!map[ai.depart_id]) {
  913. // dest.push({
  914. // depart_id: ai.depart_id,
  915. // conditionType: ai.conditionType,
  916. // groupVO: ai.groupVO
  917. // });
  918. // map[ai.depart_id] = ai;
  919. // } else {
  920. // for (let j = 0; j < dest.length; j++) {
  921. // var dj = dest[j];
  922. // if (dj.depart_id == ai.depart_id) {
  923. // dj.groupVO = dj.groupVO.concat(ai.groupVO);
  924. // break;
  925. // }
  926. // }
  927. // }
  928. // }
  929. // var index = dest.findIndex(item => {
  930. // return item.depart_id == id;
  931. // });
  932. // JSON.parse(JSON.stringify(dest[index])).depart_id=this.i
  933. // dest.splice(index + 1, 0, JSON.parse(JSON.stringify(dest[index])));
  934. // dest.forEach((item, i) => {
  935. // item.depart_id = i;
  936. // });
  937. // this.form.klDiagnoseTypeVO = JSON.parse(JSON.stringify(dest));
  938. },
  939. //删除依据
  940. delDiag(id, inx) {
  941. this.form.klDiagnoseTypeVO = this.form.klDiagnoseTypeVO.filter(
  942. item => item.depart_id !== id
  943. );
  944. this.form.klDiagnoseTypeVO.forEach((item, index) => {
  945. if (item.depart_id > id) {
  946. item.depart_id = item.depart_id - 1;
  947. }
  948. });
  949. },
  950. //新增组
  951. addGroup(i) {
  952. const temp = {
  953. baseGroup: '',
  954. conditionGroup: '',
  955. fitNo: '',
  956. klDiagnoseDetail: [
  957. {
  958. dataType: '',
  959. basNameType: false,
  960. onlyNumType: false,
  961. onlyTxtType: false,
  962. basTypeName: '',
  963. basConceptId: [],
  964. basDescription: '',
  965. basLename: '',
  966. basLibName: '',
  967. basLibType: null,
  968. basType: '',
  969. eqOperator: '',
  970. eqUnit: '',
  971. eqValue: '',
  972. maxOperator: '',
  973. maxUnit: '',
  974. maxVal: '',
  975. minOperator: '',
  976. minUnit: '',
  977. minVal: ''
  978. }
  979. ]
  980. };
  981. this.form.klDiagnoseTypeVO[i].groupVO.splice(i + 1, 0, temp);
  982. },
  983. delGroup(id, i) {
  984. this.form.klDiagnoseTypeVO.splice(i, 1);
  985. },
  986. //新增基础依据
  987. addRule(row, index, inx,i) {
  988. let temp = {
  989. dataType: '',
  990. basNameType: false,
  991. basTypeName: '',
  992. basConceptId: [],
  993. basDescription: '',
  994. basLename: '',
  995. basLibName: '',
  996. basLibType: null,
  997. basType: '',
  998. eqOperator: '',
  999. eqUnit: '',
  1000. eqValue: '',
  1001. maxOperator: '',
  1002. maxUnit: '',
  1003. maxVal: '',
  1004. minOperator: '',
  1005. minUnit: '',
  1006. minVal: '',
  1007. };
  1008. this.form.klDiagnoseTypeVO[index].groupVO[inx].klDiagnoseDetail.splice(i + 1, 0, temp);
  1009. this.form.klDiagnoseTypeVO = JSON.parse(JSON.stringify(this.form.klDiagnoseTypeVO)) //8525更新对象触发滚动条更新
  1010. },
  1011. delRule(row, inx, index, i) {
  1012. const klDiagnoseDetail = this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail;
  1013. if (klDiagnoseDetail.length === 1) {
  1014. return;
  1015. } else {
  1016. klDiagnoseDetail.splice(i,1);
  1017. const numArr = this.numArr[inx].num[0];
  1018. const fitNo=this.form.klDiagnoseTypeVO[inx].groupVO[0].fitNo;
  1019. if(numArr[numArr.length-1].name<fitNo){
  1020. this.form.klDiagnoseTypeVO[inx].groupVO[0].fitNo="";
  1021. }
  1022. }
  1023. },
  1024. //诊断依据类型修改
  1025. basTypeChange(val, inx) {
  1026. if (!val) {
  1027. this.baseTermTypeList = [];
  1028. return;
  1029. }
  1030. var index2 = this.baseTypes.findIndex(item => item.ruleType === val);
  1031. this.baseTermTypeList = this.baseTypes[index2].subMenuList;
  1032. },
  1033. //基础依据类型修改
  1034. baseTermTypeChange(val, inx, index, i) {
  1035. if (!val) {
  1036. return;
  1037. }
  1038. this.basType = val;
  1039. this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
  1040. i
  1041. ].basType = val;
  1042. this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
  1043. i
  1044. ].basLibType = '';
  1045. this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
  1046. i
  1047. ].dataType = '';
  1048. this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
  1049. i
  1050. ].conceptList = [];
  1051. this.clearConcept(val, inx, index, i); //清空医学标准术语
  1052. this.clearNumText(val, inx, index, i); //清空数值、医学内容
  1053. var index2 = this.baseTermTypeList.findIndex(item => item.type === val);
  1054. this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
  1055. i
  1056. ].basLibTypeList = this.baseTermTypeList[index2].subMenuList;
  1057. this.form.klDiagnoseTypeVO[inx].groupVO[
  1058. index
  1059. ].baseTermTypeList = this.baseTermTypeList;
  1060. if (val == 3 || val == 4||val == 5 || val == 6) {
  1061. this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
  1062. i
  1063. ].basTypeName = this.form.klDiagnoseTypeVO[inx].groupVO[
  1064. index
  1065. ].klDiagnoseDetail[i].basLibTypeList[0].name;
  1066. this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
  1067. i
  1068. ].basNameType = true;
  1069. this.$refs['form'].clearValidate([
  1070. 'klDiagnoseTypeVO.' +
  1071. inx +
  1072. '.groupVO.' +
  1073. index +
  1074. '.klDiagnoseDetail.' +
  1075. i +
  1076. '.basLibType'
  1077. ]);
  1078. } else {
  1079. this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
  1080. i
  1081. ].basTypeName = '';
  1082. this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
  1083. i
  1084. ].basNameType = false;
  1085. }
  1086. },
  1087. //基础依据术语类型修改
  1088. basLibTypeChange(val, inx, index, i) {
  1089. this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
  1090. i
  1091. ].basLibType = val;
  1092. // this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
  1093. // i
  1094. // ].dataType = '';
  1095. this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
  1096. i
  1097. ].basConceptId = [];
  1098. if ((this.numTypes + ',').indexOf(val + ',') > -1) {
  1099. this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
  1100. i
  1101. ].dataType = '1';
  1102. } else {
  1103. this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
  1104. i
  1105. ].dataType = '';
  1106. }
  1107. const onlyNum = this.dicts['onlyNum'] || '&';
  1108. const onlyTxt = this.dicts['onlyTxt'] || '&';
  1109. const codes = onlyNum + ',';
  1110. const code = onlyTxt + ',';
  1111. let type = this.form.klDiagnoseTypeVO[inx].groupVO[index]
  1112. .klDiagnoseDetail[i].basLibType;
  1113. let a = this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[i]
  1114. .basLibType;
  1115. this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
  1116. i
  1117. ].onlyNumType = type && codes.indexOf(a + ',') > -1;
  1118. this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
  1119. i
  1120. ].onlyTxtType = type && code.indexOf(a + ',') > -1;
  1121. this.clearConcept(val, inx, index, i);
  1122. this.clearNumText2(val, inx, index, i);
  1123. },
  1124. //医学标准术语
  1125. conceptChange(val, inx, index, i) {
  1126. this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
  1127. i
  1128. ].basConceptId = val;
  1129. console.log(val);
  1130. // if (val) {
  1131. // this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
  1132. // i
  1133. // ].basLibName = this.form.klDiagnoseTypeVO[inx].groupVO[
  1134. // index
  1135. // ].klDiagnoseDetail[i].conceptList.find(
  1136. // it => it.conceptId === val
  1137. // ).conceptName;
  1138. // } else {
  1139. // this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
  1140. // i
  1141. // ].basLibName = '';
  1142. // }
  1143. },
  1144. searchConcept(val, inx, index, i) {
  1145. const formData = JSON.parse(JSON.stringify(this.form));
  1146. const param = {
  1147. excludedConceptIds: [
  1148. formData.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[i]
  1149. .basType
  1150. ],
  1151. libType:
  1152. formData.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[i]
  1153. .basLibType,
  1154. name: val
  1155. };
  1156. api
  1157. .searchConcept(param)
  1158. .then(res => {
  1159. if (res.data.code == '0') {
  1160. const data = res.data.data;
  1161. this.$nextTick(() => {
  1162. // dom元素更新后执行,因此这里能正确打印更改之后的值
  1163. formData.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
  1164. i
  1165. ].conceptList = data; // 改变了的值
  1166. });
  1167. this.form = formData;
  1168. }
  1169. })
  1170. .catch(error => {
  1171. console.log(error);
  1172. });
  1173. },
  1174. dataTypeChange(val, inx, index, i) {
  1175. this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
  1176. i
  1177. ].dataType = val;
  1178. this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
  1179. i
  1180. ].eqOperator = val === '2' ? '=' : '';
  1181. },
  1182. clearConcept(val, inx, index, i) {
  1183. this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
  1184. i
  1185. ].basConceptId = [];
  1186. this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
  1187. i
  1188. ].basLibName = '';
  1189. this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
  1190. i
  1191. ].conceptList = [];
  1192. },
  1193. clearNumText2(val, inx, index, i) {
  1194. this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
  1195. i
  1196. ].maxOperator = '';
  1197. this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
  1198. i
  1199. ].maxVal = '';
  1200. this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
  1201. i
  1202. ].maxUnit = '';
  1203. this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
  1204. i
  1205. ].minOperator = '';
  1206. this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
  1207. i
  1208. ].minVal = '';
  1209. this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
  1210. i
  1211. ].minUnit = '';
  1212. this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
  1213. i
  1214. ].eqValue = '';
  1215. this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
  1216. i
  1217. ].eqOperator = '';
  1218. },
  1219. clearNumText(val, inx, index, i) {
  1220. this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
  1221. i
  1222. ].maxOperator = '';
  1223. this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
  1224. i
  1225. ].maxVal = '';
  1226. this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
  1227. i
  1228. ].maxUnit = '';
  1229. this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
  1230. i
  1231. ].minOperator = '';
  1232. this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
  1233. i
  1234. ].minVal = '';
  1235. this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
  1236. i
  1237. ].minUnit = '';
  1238. this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
  1239. i
  1240. ].eqValue = '';
  1241. this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
  1242. i
  1243. ].eqOperator = '';
  1244. this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
  1245. i
  1246. ].onlyNumType = false;
  1247. this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
  1248. i
  1249. ].onlyTxtType = false;
  1250. },
  1251. formatData(data) {
  1252. //转换字段名
  1253. let str = JSON.stringify(data)
  1254. .replace(/byIdDTO/g, 'groupVO')
  1255. .replace(/klDiagnoseByIdDTO/g, 'klDiagnoseDetail');
  1256. //console.log(JSON.parse(str))
  1257. return JSON.parse(str);
  1258. },
  1259. formatData2(data) {
  1260. //转换字段名
  1261. let str = JSON.stringify(data)
  1262. .replace(/basLibName/g, 'conceptName')
  1263. .replace(/basConceptId/g, 'conceptId');
  1264. //console.log(JSON.parse(str))
  1265. return JSON.parse(str);
  1266. },
  1267. searchDiag(val) {
  1268. const param = {
  1269. diseaseName: val
  1270. };
  1271. api
  1272. .searchDiag(param)
  1273. .then(res => {
  1274. if (res.data.code == '0') {
  1275. const data = res.data.data;
  1276. this.conceptList = data;
  1277. }
  1278. })
  1279. .catch(error => {
  1280. console.log(error);
  1281. });
  1282. },
  1283. setInitGroupData() {
  1284. let temp = this.getInitData();
  1285. this.form.klDiagnoseTypeVO = [temp];
  1286. },
  1287. setRules() {
  1288. let that = this;
  1289. let list = this.form.klDiagnoseTypeVO;
  1290. if (list && list.length > 0) {
  1291. list.forEach((item, i) => {
  1292. let list1 = list[i].groupVO;
  1293. list1.forEach((it, x) => {
  1294. let list2 = list1[x].klDiagnoseDetail;
  1295. list2.forEach((t, j) => {
  1296. let grandeObj = this.form.klDiagnoseTypeVO[i].groupVO[x]
  1297. .klDiagnoseDetail[j];
  1298. if (grandeObj) {
  1299. const keyTxt =
  1300. 'klDiagnoseTypeVO.' +
  1301. i +
  1302. '.groupVO.' +
  1303. x +
  1304. '.klDiagnoseDetail.' +
  1305. j;
  1306. that.rules[keyTxt + '.dataType'] = [
  1307. {
  1308. required: true,
  1309. message: '请选择类型',
  1310. trigger: ['change']
  1311. }
  1312. ];
  1313. that.rules[keyTxt + '.maxOperator'] = [
  1314. {
  1315. validator: (rule, value, callback) => {
  1316. const { maxVal, minOperator, minVal } = grandeObj;
  1317. const val = value + minOperator + minVal + maxVal;
  1318. if (!val || (!value && maxVal !== '')) {
  1319. callback(
  1320. new Error(
  1321. '最大值和最小值至少完整填写一个,单位不必填'
  1322. )
  1323. );
  1324. } else {
  1325. callback();
  1326. }
  1327. },
  1328. trigger: 'change'
  1329. }
  1330. ];
  1331. that.rules[keyTxt + '.minOperator'] = [
  1332. {
  1333. validator: (rule, value, callback) => {
  1334. const { maxVal, maxOperator, minVal } = grandeObj;
  1335. const val = value + maxOperator + minVal + maxVal;
  1336. if (!val || (!value && minVal !== '')) {
  1337. callback(
  1338. new Error(
  1339. '最大值和最小值至少完整填写一个,单位不必填'
  1340. )
  1341. );
  1342. } else {
  1343. callback();
  1344. }
  1345. },
  1346. trigger: 'change'
  1347. }
  1348. ];
  1349. that.rules[keyTxt + '.maxVal'] = [
  1350. {
  1351. validator: (rule, value, callback) => {
  1352. const { maxOperator, minOperator, minVal } = grandeObj;
  1353. const val = value + maxOperator + minVal + minOperator;
  1354. const isNum = /^(\-|\+)?\d+(\.\d+)?$/.test(value);
  1355. if (!val || (value === '' && maxOperator)) {
  1356. callback(
  1357. new Error(
  1358. '最大值和最小值至少完整填写一个,单位不必填'
  1359. )
  1360. );
  1361. } else if (value !== '' && !isNum) {
  1362. callback(new Error('只能输入数字'));
  1363. } else {
  1364. callback();
  1365. }
  1366. },
  1367. trigger: 'blur'
  1368. }
  1369. ];
  1370. that.rules[keyTxt + '.minVal'] = [
  1371. {
  1372. validator: (rule, value, callback) => {
  1373. const { maxVal, minOperator, maxOperator } = grandeObj;
  1374. const val = value + maxOperator + maxVal + minOperator;
  1375. const isNum = /^(\-|\+)?\d+(\.\d+)?$/.test(value);
  1376. if (!val || (value === '' && minOperator)) {
  1377. callback(
  1378. new Error(
  1379. '最大值和最小值至少完整填写一个,单位不必填'
  1380. )
  1381. );
  1382. } else if (value !== '' && !isNum) {
  1383. callback(new Error('只能输入数字'));
  1384. } else {
  1385. callback();
  1386. }
  1387. },
  1388. trigger: 'blur'
  1389. }
  1390. ];
  1391. }
  1392. });
  1393. });
  1394. });
  1395. }
  1396. },
  1397. saveDiagBase(params) {
  1398. api.saveDiagBase(params).then(res => {
  1399. if (res.data.code == 0) {
  1400. this.$message({
  1401. message: '操作成功',
  1402. type: 'success'
  1403. });
  1404. this.$router.push({
  1405. name: 'ZskDiagBase',
  1406. params: this.$route.params
  1407. });
  1408. } else {
  1409. this.$message({
  1410. message: res.data.msg,
  1411. type: 'warning'
  1412. });
  1413. }
  1414. });
  1415. },
  1416. validateForms(callBack) {
  1417. this.$refs['form'].validate(valid => {
  1418. if (valid) {
  1419. callBack();
  1420. } else {
  1421. return false;
  1422. }
  1423. });
  1424. },
  1425. confirm() {
  1426. const formData = JSON.parse(JSON.stringify(this.form));
  1427. const _this = this;
  1428. for (let i = 0; i < formData.klDiagnoseTypeVO.length; i++) {
  1429. for (let j = 0; j < formData.klDiagnoseTypeVO[i].groupVO.length; j++) {
  1430. delete formData.klDiagnoseTypeVO[i].groupVO[j].baseTermTypeList;
  1431. for (
  1432. let k = 0;
  1433. k < formData.klDiagnoseTypeVO[i].groupVO[j].klDiagnoseDetail.length;
  1434. k++
  1435. ) {
  1436. delete formData.klDiagnoseTypeVO[i].groupVO[j].klDiagnoseDetail[k]
  1437. .basLibTypeList;
  1438. delete formData.klDiagnoseTypeVO[i].groupVO[j].klDiagnoseDetail[k]
  1439. .conceptList;
  1440. }
  1441. }
  1442. }
  1443. let map = {},
  1444. dest = [];
  1445. for (let i = 0; i < formData.klDiagnoseTypeVO.length; i++) {
  1446. let ai = formData.klDiagnoseTypeVO[i];
  1447. if (!map[ai.depart_id]) {
  1448. dest.push({
  1449. depart_id: ai.depart_id,
  1450. conditionType: ai.conditionType,
  1451. groupVO: ai.groupVO
  1452. });
  1453. map[ai.depart_id] = ai;
  1454. } else {
  1455. for (let j = 0; j < dest.length; j++) {
  1456. var dj = dest[j];
  1457. if (dj.depart_id == ai.depart_id) {
  1458. dj.groupVO = dj.groupVO.concat(ai.groupVO);
  1459. break;
  1460. }
  1461. }
  1462. }
  1463. }
  1464. formData.klDiagnoseTypeVO = dest;
  1465. this.validateForms(function() {
  1466. let params = formData;
  1467. _this.saveDiagBase(params);
  1468. });
  1469. }
  1470. },
  1471. watch: {
  1472. form: {
  1473. handler: function(newQuestion, oldQuestion) {
  1474. this.getData(this.form.klDiagnoseTypeVO);
  1475. },
  1476. deep: true,
  1477. immediate: true
  1478. }
  1479. }
  1480. };
  1481. </script>
  1482. <style lang="less" scoped>
  1483. @import '../../less/admin.less';
  1484. /deep/ .searchselect{
  1485. .el-input{
  1486. height: 100%!important;
  1487. }
  1488. }
  1489. .contents {
  1490. height: 100%;
  1491. .content {
  1492. background: #fff;
  1493. padding: 20px 20px;
  1494. color: #545455;
  1495. min-width: 980px;
  1496. position: relative;
  1497. .tip-text {
  1498. color: #f56c6c;
  1499. margin-left: 10px;
  1500. }
  1501. .conceptItem {
  1502. padding: 0 10px;
  1503. cursor: pointer;
  1504. height: 32px;
  1505. line-height: 32px;
  1506. &:hover {
  1507. background: #ebedf1;
  1508. }
  1509. }
  1510. .el-table--scrollable-y .el-table__body-wrapper {
  1511. height: calc(100vh - 370px);
  1512. }
  1513. /deep/ .el-input {
  1514. height: 24px;
  1515. line-height: 24px;
  1516. .el-input__inner {
  1517. height: 24px;
  1518. line-height: 24px;
  1519. font-size: 12px;
  1520. border-radius: 2px;
  1521. border-color: #c9c9c9;
  1522. }
  1523. }
  1524. /deep/ .el-select .el-input .el-icon-arrow-up{
  1525. line-height: 25px;
  1526. }
  1527. .inps {
  1528. width: 500px !important;
  1529. font-size: 14px;
  1530. /deep/ .el-input__inner {
  1531. width: 500px !important;
  1532. font-size: 14px;
  1533. }
  1534. }
  1535. .item {
  1536. /deep/.el-form-item__label {
  1537. font-size: 14px;
  1538. }
  1539. /deep/.el-input__inner {
  1540. font-size: 14px;
  1541. }
  1542. }
  1543. }
  1544. /deep/.is-error .el-form-item__error{
  1545. top:30px;
  1546. }
  1547. .content-2 {
  1548. margin-top: 10px;
  1549. padding: 20px 20px;
  1550. height: calc(100vh - 370px);
  1551. .cell {
  1552. overflow: initial;
  1553. }
  1554. .content-2-header {
  1555. padding: 20px 0;
  1556. .title1 {
  1557. font-size: 14px;
  1558. font-weight: 400;
  1559. color: #333333;
  1560. line-height: 20px;
  1561. }
  1562. .title2 {
  1563. font-size: 12px;
  1564. font-weight: 400;
  1565. color: #ff545b;
  1566. line-height: 17px;
  1567. }
  1568. }
  1569. .el-form-item {
  1570. margin-top: 8px;
  1571. margin-right: 0;
  1572. }
  1573. .discDesc {
  1574. margin-bottom: 20px;
  1575. /deep/ .el-form-item__error {
  1576. top: 38px;
  1577. left: 100px !important;
  1578. white-space: nowrap;
  1579. }
  1580. }
  1581. .el-popper[x-placement^='bottom'] {
  1582. width: 100px !important;
  1583. }
  1584. .disclButn {
  1585. position: absolute;
  1586. right: calc(50% - 60px);
  1587. bottom: 10px;
  1588. }
  1589. .el-table .cell.el-tooltip {
  1590. position: relative;
  1591. }
  1592. .box-2 {
  1593. position: relative;
  1594. .tips {
  1595. left: 3px;
  1596. }
  1597. }
  1598. .box-3 {
  1599. position: relative;
  1600. }
  1601. .tips {
  1602. width: 12px;
  1603. height: 12px;
  1604. position: absolute;
  1605. left: 15px;
  1606. top: 15px;
  1607. }
  1608. .title {
  1609. position: absolute;
  1610. z-index: -1;
  1611. }
  1612. .last-box {
  1613. display: flex;
  1614. height: 50px;
  1615. margin-bottom: 10px;
  1616. position: relative;
  1617. /deep/ .el-input,
  1618. .el-input__inner {
  1619. width: 85px;
  1620. font-size: 12px;
  1621. margin-right: 15px;
  1622. }
  1623. /deep/ .el-form-item__content {
  1624. position: inherit !important;
  1625. }
  1626. .last-box-1 {
  1627. display: flex;
  1628. /deep/ .el-form-item__error {
  1629. top: 38px;
  1630. left: 10px;
  1631. white-space: nowrap;
  1632. width: 360px;
  1633. }
  1634. }
  1635. .last-box-s {
  1636. position: absolute;
  1637. /deep/ .el-form-item__error {
  1638. top: 38px;
  1639. left: 0px;
  1640. white-space: nowrap;
  1641. width: 260px;
  1642. }
  1643. }
  1644. /deep/ .el-form-item__error {
  1645. top: 38px;
  1646. left: 10px;
  1647. white-space: nowrap;
  1648. }
  1649. /deep/ .inp {
  1650. width: 600px !important;
  1651. .el-input__inner {
  1652. width: 600px !important;
  1653. }
  1654. }
  1655. .el-form-item {
  1656. margin: 0;
  1657. overflow: hidden;
  1658. display: flex;
  1659. }
  1660. }
  1661. .tmall {
  1662. visibility: hidden;
  1663. height: 60px;
  1664. }
  1665. .medical {
  1666. margin-right: 26px;
  1667. }
  1668. .group {
  1669. border-bottom: 1px solid red;
  1670. padding: 30px 0;
  1671. .group-row {
  1672. padding: 10px 0;
  1673. border-bottom: 1px solid red;
  1674. }
  1675. }
  1676. .group:last-child {
  1677. border-bottom: none;
  1678. }
  1679. .icon {
  1680. padding: 0 3px;
  1681. cursor: pointer;
  1682. vertical-align: middle;
  1683. }
  1684. .star {
  1685. color: #ff545b;
  1686. }
  1687. }
  1688. .Butn {
  1689. display: flex;
  1690. justify-content: center;
  1691. background: #fff;
  1692. .el-button {
  1693. margin: 15px 0;
  1694. }
  1695. }
  1696. .name {
  1697. font-size: 14px;
  1698. font-weight: 400;
  1699. color: #333333;
  1700. line-height: 20px;
  1701. }
  1702. }
  1703. </style>