mainPointsDetail.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688
  1. <template>
  2. <view class="mainPointsDetailPage">
  3. <scroll-view scroll-y="true" class="scroll-y">
  4. <view class="checkItem">
  5. <view class="chBg">
  6. <image
  7. src="../../static/chahexiang-bg.png"
  8. mode=""
  9. class="img"
  10. ></image>
  11. <text class="title">查核项</text>
  12. </view>
  13. <image
  14. src="../../static/tuli.png"
  15. mode=""
  16. class="tlImg"
  17. @click="toTuLi"
  18. ></image>
  19. <view class="chContent">
  20. <view class="checkItemName">{{ data.checkItemName ? data.checkItemName : "" }}</view>
  21. <view class="checkPointName">{{ data.checkPointName ? data.checkPointName : "" }}</view>
  22. <view class="cont">
  23. <view class="floatLeft other">
  24. <view class="letterTitle2">{{ data.deptName ? data.deptName : "" }}</view>
  25. <view class="letterTitle">查核单位</view>
  26. </view>
  27. <view class="floatLeft borderLine"></view>
  28. <view class="floatLeft other">
  29. <view class="letterTitle2">{{ data.checkModelName ? data.checkModelName : "" }}</view>
  30. <view class="letterTitle">查核方式</view>
  31. </view>
  32. <view class="floatLeft borderLine"></view>
  33. <view class="floatLeft other">
  34. <view class="letterTitle2">{{ data.lastResult ? data.lastResult : "" }}</view>
  35. <view class="letterTitle">上次结果</view>
  36. </view>
  37. <view class="floatLeft borderLine"></view>
  38. <view class="floatLeft other">
  39. <view class="letterTitle2">{{ data.checkResult ? data.checkResult : "" }}</view>
  40. <view class="letterTitle">本次结果</view>
  41. </view>
  42. </view>
  43. <view class="checked">
  44. <view
  45. class="checkItem"
  46. @click="checkedOne(1)"
  47. :style="
  48. Index == 1
  49. ? { backgroundColor: '#3377FF', color: '#fff' }
  50. : { backgroundColor: '#EBEFF7' }
  51. "
  52. >不适用
  53. <view v-if="lastIndex == 1"
  54. ><image
  55. src="../../static/shangci.png"
  56. mode=""
  57. class="img"
  58. ></image>
  59. <text class="lastName">上次</text></view
  60. >
  61. </view>
  62. <view
  63. class="checkItem"
  64. @click="checkedOne(2)"
  65. :style="
  66. Index == 2
  67. ? { backgroundColor: '#3377FF', color: '#fff' }
  68. : { backgroundColor: '#EBEFF7' }
  69. "
  70. >无缺失
  71. <view v-if="lastIndex == 2"
  72. ><image
  73. src="../../static/shangci.png"
  74. mode=""
  75. class="img"
  76. ></image>
  77. <text class="lastName">上次</text></view
  78. >
  79. </view>
  80. <view
  81. class="checkItem"
  82. @click="checkedOne(3)"
  83. :style="
  84. Index == 3
  85. ? { backgroundColor: '#3377FF', color: '#fff' }
  86. : { backgroundColor: '#EBEFF7' }
  87. "
  88. >主要缺失
  89. <view v-if="lastIndex == 3"
  90. ><image
  91. src="../../static/shangci.png"
  92. mode=""
  93. class="img"
  94. ></image>
  95. <text class="lastName">上次</text></view
  96. >
  97. </view>
  98. <view
  99. class="checkItem"
  100. @click="checkedOne(4)"
  101. :style="
  102. Index == 4
  103. ? { backgroundColor: '#3377FF', color: '#fff' }
  104. : { backgroundColor: '#EBEFF7' }
  105. "
  106. >次要缺失
  107. <view v-if="lastIndex == 4"
  108. ><image
  109. src="../../static/shangci.png"
  110. mode=""
  111. class="img"
  112. ></image>
  113. <text class="lastName">上次</text></view
  114. >
  115. </view>
  116. <view
  117. class="checkItem"
  118. @click="checkedOne(5)"
  119. :style="
  120. Index == 5
  121. ? { backgroundColor: '#3377FF', color: '#fff' }
  122. : { backgroundColor: '#EBEFF7' }
  123. "
  124. >观察事项
  125. <view v-if="lastIndex == 5"
  126. ><image
  127. src="../../static/shangci.png"
  128. mode=""
  129. class="img"
  130. ></image>
  131. <text class="lastName">上次</text></view
  132. >
  133. </view>
  134. </view>
  135. <view class="more" @click="toHistory">
  136. <text>查看改善历史</text>
  137. <view class="moreImg">
  138. <image
  139. src="../../static/blue-arrow.png"
  140. mode=""
  141. class="moreImg2"
  142. ></image>
  143. </view>
  144. </view>
  145. </view>
  146. </view>
  147. <view v-if="data.checkModelName == '访谈'" class="talk">
  148. <view v-for="(item, i) in talkList">
  149. <view class="talkTitle">
  150. <text
  151. >访谈内容{{ i + 1 }}{{ i == 0 ? "" : "(访谈人员:护士、医生)" }}</text
  152. >
  153. <text v-if="i != 0" class="del" @click="del(i)">删除</text>
  154. </view>
  155. <view>
  156. <view class="talkResult">
  157. <text class="seeName">查核结果</text>
  158. <textarea
  159. maxlength="300"
  160. class="seeTextarea"
  161. value=""
  162. placeholder="请输入"
  163. :value="item.talkResult"
  164. @blur="changeTextarea($event, i)"
  165. ></textarea>
  166. </view>
  167. <view class="talkImg" @click="imgClick(i)">
  168. <tm-upload-img
  169. label="上传图片"
  170. :filePaths="item.filePath"
  171. :isMultiple="true"
  172. @changeFilePaths="changeFilePaths2"
  173. />
  174. </view>
  175. </view>
  176. </view>
  177. </view>
  178. <view v-else class="see">
  179. <view class="seeResult">
  180. <text class="seeName">查核结果</text>
  181. <textarea
  182. maxlength="300"
  183. class="seeTextarea"
  184. value=""
  185. placeholder="请输入"
  186. :value="recordList[0].talkResult"
  187. @blur="changeTextarea2"
  188. ></textarea>
  189. </view>
  190. <view class="seeImg">
  191. <tm-upload-img
  192. label="上传图片"
  193. :filePaths="filePath"
  194. :isMultiple="true"
  195. @changeFilePaths="changeFilePaths"
  196. />
  197. </view>
  198. </view>
  199. <button
  200. class="insert"
  201. @click="insert"
  202. v-if="data.checkModelName == '访谈'"
  203. >
  204. + 增加一条记录
  205. </button>
  206. </scroll-view>
  207. <button type="primary" class="sureDetail" @click="sureDetail">完成</button>
  208. </view>
  209. </template>
  210. <script>
  211. export default {
  212. data() {
  213. return {
  214. data: {}, //详情数据
  215. lastIndex: null, //上次选中的结果
  216. Index: null, //点击修改本次选中样式
  217. filePath: [],
  218. recordList: [{ seeResult: "", filePath: [] }],
  219. talkLength: 1,
  220. talkList: [{ talkResult: "", filePath: [] }],
  221. editIndex: null,
  222. resultConfigList: [],
  223. id: "",
  224. };
  225. },
  226. mounted() {
  227. this.checkTaskDetail();
  228. this.getPeizhiList();
  229. },
  230. methods: {
  231. checkTaskDetail() {
  232. this.$store.dispatch({
  233. type: "mainPointsDetail/commActions",
  234. payload: {
  235. key: "checkTaskDetail",
  236. data: {
  237. id: this.id,
  238. },
  239. },
  240. }).then((res) => {
  241. if (res) {
  242. this.data = res;
  243. if (res && res.lastResult == "不适用") {
  244. this.lastIndex = 1;
  245. } else if (res && res.lastResult == "无缺失") {
  246. this.lastIndex = 2;
  247. } else if (res && res.lastResult == "主要缺失") {
  248. this.lastIndex = 3;
  249. } else if (res && res.lastResult == "次要缺失") {
  250. this.lastIndex = 4;
  251. } else if (res && res.lastResult == "观察事项") {
  252. this.lastIndex = 5;
  253. } else {
  254. this.lastIndex = 0;
  255. }
  256. }
  257. });
  258. },
  259. getPeizhiList() {
  260. this.$store.dispatch({
  261. type: "configure/commActions",
  262. payload: {
  263. key: "getResultConfig",
  264. },
  265. }).then((res) => {
  266. this.resultConfigList = res ? res : [];
  267. });
  268. },
  269. checkedOne(data) {
  270. this.Index = data;
  271. if (data == 1) {
  272. this.data.checkResult = "不适用";
  273. } else if (data == 2) {
  274. this.data.checkResult = "无缺失";
  275. } else if (data == 3) {
  276. this.data.checkResult = "主要缺失";
  277. } else if (data == 4) {
  278. this.data.checkResult = "次要缺失";
  279. } else if (data == 5) {
  280. this.data.checkResult = "观察事项";
  281. } else {
  282. this.data.checkResult = "";
  283. }
  284. },
  285. changeFilePaths(filePaths, index) {
  286. let _recordList = [...this.recordList];
  287. _recordList[index].filePath = filePaths;
  288. this.filePath = _recordList[0].filePath;
  289. },
  290. insert() {
  291. let list = [...this.talkList];
  292. if (list.length < 10) {
  293. list.push({ talkResult: "", filePath: [] });
  294. this.talkList = list;
  295. }
  296. },
  297. del(index) {
  298. let list = [...this.talkList];
  299. let list2 = [];
  300. for (let i = 0; i < list.length; i++) {
  301. if (i != index) {
  302. list2.push(list[i]);
  303. }
  304. }
  305. this.talkList = list2;
  306. },
  307. changeFilePaths2(filePaths, index) {
  308. for (let j = 0; j < this.talkList.length; j++) {
  309. this.talkList[this.editIndex].filePath = filePaths;
  310. }
  311. },
  312. changeTextarea(e, i) {
  313. for (let j = 0; j < this.talkList.length; j++) {
  314. this.talkList[i].talkResult = e.detail.value;
  315. }
  316. },
  317. changeTextarea2(e) {
  318. this.recordList[0].seeResult = e.target.value;
  319. },
  320. imgClick(i) {
  321. this.editIndex = i;
  322. },
  323. sureDetail(e) {
  324. if (this.Index) {
  325. let params = {
  326. id: this.data.id,
  327. checkResult: this.data.checkResult,
  328. checkResultRequestList: [],
  329. };
  330. if (this.data.checkModelName == "访谈") {
  331. let list = [];
  332. for (let i = 0; i < this.talkList.length; i++) {
  333. let path = "";
  334. for (let j = 0; j < this.talkList[i].filePath.length; j++) {
  335. if (j == 0) {
  336. path += `${this.talkList[i].filePath[j]}`;
  337. } else {
  338. path += `,${this.talkList[i].filePath[j]}`;
  339. }
  340. }
  341. let item = {
  342. checkResultId: i,
  343. checkResultDescribe: this.talkList[i].talkResult,
  344. checkResultUrl: path,
  345. };
  346. list.push(item);
  347. }
  348. params.checkResultRequestList = list;
  349. } else {
  350. let list = [];
  351. let path = "";
  352. for (let j = 0; j < this.recordList[0].filePath.length; j++) {
  353. if (j == 0) {
  354. path += `${this.recordList[0].filePath[j]}`;
  355. } else {
  356. path += `,${this.recordList[0].filePath[j]}`;
  357. }
  358. }
  359. let item = {
  360. checkResultId: 1,
  361. checkResultDescribe: this.recordList[0].seeResult,
  362. checkResultUrl: path,
  363. };
  364. list.push(item);
  365. params.checkResultRequestList = list;
  366. }
  367. this.$store.dispatch({
  368. type: "mainPointsDetail/commActions",
  369. payload: {
  370. key: "saveCheckTaskDetail",
  371. data: {
  372. ...params,
  373. },
  374. },
  375. }).then((res) => {
  376. if (res) {
  377. for (let i = 0; i < this.resultConfigList.length; i++) {
  378. if (
  379. this.resultConfigList[i].name == params.checkResult &&
  380. (this.resultConfigList[i].resultType == 2 ||
  381. this.resultConfigList[i].resultType == 3)
  382. ) {
  383. let param = {
  384. situationId: this.data.situationId,
  385. situationName: this.data.situationName,
  386. checkGroupId: this.data.checkGroupId,
  387. checkGroupName: this.data.checkGroupName,
  388. checkItemId: this.data.checkItemId,
  389. checkItemName: this.data.checkItemName,
  390. checkPointId: this.data.checkPointId,
  391. checkPointName: this.data.checkPointName,
  392. deptName: this.data.deptName,
  393. deptId: this.data.deptId,
  394. appointFlag: false,
  395. desicion: 0,
  396. taskType: "1",
  397. checkId: this.data.checkId,
  398. checkResult: this.resultConfigList[i].id,
  399. receiveEmpId: this.data.receiveEmpId,
  400. receiveEmpName: this.data.receiveEmpName,
  401. checkDetailId: this.data.id,
  402. };
  403. this.$store.dispatch({
  404. type: "mission/commActions",
  405. payload: {
  406. key: "comTaskCirculation",
  407. data: {
  408. ...param,
  409. },
  410. },
  411. }).then(() => {
  412. uni.navigateTo({
  413. url: `/pages/auditItemDetails/auditItemDetails?id=${this.data.id}`,
  414. });
  415. });
  416. }
  417. }
  418. }
  419. });
  420. } else {
  421. uni.showModal({
  422. title: "检查选项未选择",
  423. showCancel: false,
  424. });
  425. }
  426. },
  427. toTuLi() {
  428. uni.navigateTo({
  429. url: `/pages/legendDetails/legendDetails?checkItemId=${this.data.checkItemId}`,
  430. });
  431. },
  432. toHistory() {
  433. uni.navigateTo({
  434. url: `/pages/improve-mission-list/improve-mission-list?situationId=${this.data.situationId}`,
  435. });
  436. },
  437. },
  438. onLoad({ id }) {
  439. this.id = id;
  440. },
  441. };
  442. </script>
  443. <style lang="less">
  444. .mainPointsDetailPage {
  445. position: relative;
  446. // min-height: 75rpx;
  447. // overflow-y: auto;
  448. height: 100%;
  449. .scroll-y {
  450. height: calc(100% - 75rpx);
  451. }
  452. .checkItem {
  453. padding-top: 47.5rpx;
  454. width: 100%;
  455. height: 450rpx;
  456. background-color: #fff;
  457. position: relative;
  458. .chBg {
  459. position: absolute;
  460. top: 0;
  461. left: 0;
  462. width: 125rpx;
  463. height: 37.5rpx;
  464. .img {
  465. width: 125rpx;
  466. height: 37.5rpx;
  467. }
  468. .title {
  469. position: absolute;
  470. top: 8.75rpx;
  471. left: 25rpx;
  472. font-size: 20rpx;
  473. color: #fff;
  474. font-weight: 500;
  475. line-height: 20rpx;
  476. }
  477. }
  478. .tlImg {
  479. width: 40rpx;
  480. height: 40rpx;
  481. position: absolute;
  482. right: 25rpx;
  483. top: 25rpx;
  484. }
  485. .chContent {
  486. width: 100%;
  487. .checkItemName {
  488. margin-left: 31.25rpx;
  489. font-size: 25rpx;
  490. line-height: 55rpx;
  491. color: #292c33;
  492. }
  493. .checkPointName {
  494. margin-left: 31.25rpx;
  495. font-size: 17.5rpx;
  496. line-height: 17.5rpx;
  497. color: #7a8599;
  498. }
  499. .cont {
  500. height: 135rpx;
  501. .floatLeft {
  502. float: left;
  503. }
  504. .borderLine {
  505. margin-top: 56.25rpx;
  506. width: 0.62rpx;
  507. height: 25rpx;
  508. background-color: #dadee6;
  509. }
  510. .other {
  511. padding: 40rpx 0rpx;
  512. height: 95rpx;
  513. width: 187.18rpx;
  514. text-align: center;
  515. .letterTitle {
  516. font-size: 17.5rpx;
  517. color: #7a8599;
  518. line-height: 17.5rpx;
  519. }
  520. .letterTitle2 {
  521. height: 22.5rpx;
  522. font-size: 22.5rpx;
  523. line-height: 22.5rpx;
  524. color: #292c33;
  525. margin-bottom: 15rpx;
  526. font-weight: 500;
  527. }
  528. }
  529. }
  530. .checked {
  531. margin-bottom: 40rpx;
  532. padding: 0rpx 15.62rpx;
  533. height: 75rpx;
  534. .checkItem {
  535. margin: 0rpx 9.37rpx;
  536. padding: 0;
  537. width: 125rpx;
  538. height: 75rpx;
  539. background: #ebeff7;
  540. float: left;
  541. line-height: 75rpx;
  542. text-align: center;
  543. color: #292c33;
  544. border-radius: 20rpx;
  545. position: relative;
  546. .img {
  547. width: 51.25rpx;
  548. height: 25rpx;
  549. position: absolute;
  550. right: -6.25rpx;
  551. top: -6.25rpx;
  552. }
  553. .lastName {
  554. color: #fff;
  555. font-size: 13.75rpx;
  556. line-height: 13.75rpx;
  557. position: absolute;
  558. right: 5rpx;
  559. top: -1.87rpx;
  560. }
  561. }
  562. }
  563. .more {
  564. margin: 0rpx 25rpx 0rpx 25rpx;
  565. text-align: center;
  566. border-top: 0.62rpx solid #dadee6;
  567. text {
  568. padding: 29.37rpx 0rpx 27.5rpx;
  569. margin-right: 10rpx;
  570. line-height: 22.5rpx;
  571. font-size: 22.5rpx;
  572. color: #3377ff;
  573. display: inline-block;
  574. vertical-align: top;
  575. }
  576. .moreImg {
  577. margin-top: 28.75rpx;
  578. width: 12.37rpx;
  579. height: 21.21rpx;
  580. display: inline-block;
  581. }
  582. .moreImg2 {
  583. width: 12.37rpx;
  584. height: 21.21rpx;
  585. }
  586. }
  587. }
  588. }
  589. .see {
  590. margin-top: 15rpx;
  591. height: 287.5rpx;
  592. background-color: #fff;
  593. // padding-left: 25rpx;
  594. .seeResult {
  595. margin-left: 25rpx;
  596. padding-top: 32.5rpx;
  597. // height: 200rpx;
  598. border-bottom: 1px solid #dadee6;
  599. .seeName {
  600. width: 175rpx;
  601. font-size: 22.5rpx;
  602. color: #525866;
  603. line-height: 22.5rpx;
  604. display: inline-block;
  605. }
  606. .seeTextarea {
  607. width: 531.25rpx;
  608. height: 155rpx;
  609. display: inline-block;
  610. font-size: 22.5rpx;
  611. line-height: 27.5rpx;
  612. }
  613. }
  614. .seeImg {
  615. min-height: 87.5rpx;
  616. .seeName2 {
  617. width: 175rpx;
  618. font-size: 22.5rpx;
  619. color: #525866;
  620. line-height: 87.5rpx;
  621. display: inline-block;
  622. }
  623. }
  624. }
  625. .talk {
  626. .talkTitle {
  627. padding: 25rpx 25rpx 15rpx;
  628. font-size: 22.5rpx;
  629. line-height: 22.5rpx;
  630. color: #666f80;
  631. .del {
  632. float: right;
  633. color: #3377ff;
  634. }
  635. }
  636. .talkResult {
  637. padding-left: 25rpx;
  638. padding-top: 32.5rpx;
  639. border-bottom: 1px solid #dadee6;
  640. background-color: #fff;
  641. .seeName {
  642. width: 175rpx;
  643. font-size: 22.5rpx;
  644. color: #525866;
  645. line-height: 22.5rpx;
  646. display: inline-block;
  647. }
  648. .seeTextarea {
  649. width: 531.25rpx;
  650. height: 155rpx;
  651. display: inline-block;
  652. font-size: 22.5rpx;
  653. line-height: 27.5rpx;
  654. }
  655. }
  656. .talkImg {
  657. min-height: 87.5rpx;
  658. .seeName2 {
  659. width: 175rpx;
  660. font-size: 22.5rpx;
  661. color: #525866;
  662. line-height: 87.5rpx;
  663. display: inline-block;
  664. }
  665. }
  666. }
  667. .insert {
  668. background-color: #fff;
  669. font-size: 22.5rpx;
  670. line-height: 22.5rpx;
  671. color: #3377ff;
  672. padding: 26.25rpx;
  673. }
  674. .sureDetail {
  675. width: 100%;
  676. height: 75rpx;
  677. font-size: 22.5rpx;
  678. background-color: #3377ff;
  679. line-height: 75rpx;
  680. position: absolute;
  681. bottom: 0rpx;
  682. }
  683. }
  684. </style>