mainPointsDetail.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690
  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="checked-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="checked-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="checked-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="checked-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="checked-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" v-if="data.display?data.display:false">完成</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. checkPointId: "",
  225. };
  226. },
  227. mounted() {
  228. this.checkTaskDetail();
  229. this.getPeizhiList();
  230. },
  231. methods: {
  232. checkTaskDetail() {
  233. this.$store.dispatch({
  234. type: "mainPointsDetail/commActions",
  235. payload: {
  236. key: "checkTaskDetail",
  237. data: {
  238. id: this.id,
  239. },
  240. },
  241. }).then((res) => {
  242. if (res) {
  243. this.data = res;
  244. if (res && res.lastResult == "不适用") {
  245. this.lastIndex = 1;
  246. } else if (res && res.lastResult == "无缺失") {
  247. this.lastIndex = 2;
  248. } else if (res && res.lastResult == "主要缺失") {
  249. this.lastIndex = 3;
  250. } else if (res && res.lastResult == "次要缺失") {
  251. this.lastIndex = 4;
  252. } else if (res && res.lastResult == "观察事项") {
  253. this.lastIndex = 5;
  254. } else {
  255. this.lastIndex = 0;
  256. }
  257. }
  258. });
  259. },
  260. getPeizhiList() {
  261. this.$store.dispatch({
  262. type: "configure/commActions",
  263. payload: {
  264. key: "getResultConfig",
  265. },
  266. }).then((res) => {
  267. this.resultConfigList = res ? res : [];
  268. });
  269. },
  270. checkedOne(data) {
  271. this.Index = data;
  272. if (data == 1) {
  273. this.data.checkResult = "不适用";
  274. } else if (data == 2) {
  275. this.data.checkResult = "无缺失";
  276. } else if (data == 3) {
  277. this.data.checkResult = "主要缺失";
  278. } else if (data == 4) {
  279. this.data.checkResult = "次要缺失";
  280. } else if (data == 5) {
  281. this.data.checkResult = "观察事项";
  282. } else {
  283. this.data.checkResult = "";
  284. }
  285. },
  286. changeFilePaths(filePaths, index) {
  287. let _recordList = [...this.recordList];
  288. _recordList[index].filePath = filePaths;
  289. this.filePath = _recordList[0].filePath;
  290. },
  291. insert() {
  292. let list = [...this.talkList];
  293. if (list.length < 10) {
  294. list.push({ talkResult: "", filePath: [] });
  295. this.talkList = list;
  296. }
  297. },
  298. del(index) {
  299. let list = [...this.talkList];
  300. let list2 = [];
  301. for (let i = 0; i < list.length; i++) {
  302. if (i != index) {
  303. list2.push(list[i]);
  304. }
  305. }
  306. this.talkList = list2;
  307. },
  308. changeFilePaths2(filePaths, index) {
  309. for (let j = 0; j < this.talkList.length; j++) {
  310. this.talkList[this.editIndex].filePath = filePaths;
  311. }
  312. },
  313. changeTextarea(e, i) {
  314. for (let j = 0; j < this.talkList.length; j++) {
  315. this.talkList[i].talkResult = e.detail.value;
  316. }
  317. },
  318. changeTextarea2(e) {
  319. this.recordList[0].seeResult = e.target.value;
  320. },
  321. imgClick(i) {
  322. this.editIndex = i;
  323. },
  324. sureDetail(e) {
  325. if (this.Index) {
  326. let params = {
  327. id: this.data.id,
  328. checkResult: this.data.checkResult,
  329. checkResultRequestList: [],
  330. };
  331. if (this.data.checkModelName == "访谈") {
  332. let list = [];
  333. for (let i = 0; i < this.talkList.length; i++) {
  334. let path = "";
  335. for (let j = 0; j < this.talkList[i].filePath.length; j++) {
  336. if (j == 0) {
  337. path += `${this.talkList[i].filePath[j]}`;
  338. } else {
  339. path += `,${this.talkList[i].filePath[j]}`;
  340. }
  341. }
  342. let item = {
  343. checkResultId: i,
  344. checkResultDescribe: this.talkList[i].talkResult,
  345. checkResultUrl: path,
  346. };
  347. list.push(item);
  348. }
  349. params.checkResultRequestList = list;
  350. } else {
  351. let list = [];
  352. let path = "";
  353. for (let j = 0; j < this.recordList[0].filePath.length; j++) {
  354. if (j == 0) {
  355. path += `${this.recordList[0].filePath[j]}`;
  356. } else {
  357. path += `,${this.recordList[0].filePath[j]}`;
  358. }
  359. }
  360. let item = {
  361. checkResultId: 1,
  362. checkResultDescribe: this.recordList[0].seeResult,
  363. checkResultUrl: path,
  364. };
  365. list.push(item);
  366. params.checkResultRequestList = list;
  367. }
  368. this.$store.dispatch({
  369. type: "mainPointsDetail/commActions",
  370. payload: {
  371. key: "saveCheckTaskDetail",
  372. data: {
  373. ...params,
  374. },
  375. },
  376. }).then((res) => {
  377. if (res) {
  378. for (let i = 0; i < this.resultConfigList.length; i++) {
  379. if (
  380. this.resultConfigList[i].name == params.checkResult &&
  381. (this.resultConfigList[i].resultType == 2 ||
  382. this.resultConfigList[i].resultType == 3)
  383. ) {
  384. let param = {
  385. situationId: this.data.situationId,
  386. situationName: this.data.situationName,
  387. checkGroupId: this.data.checkGroupId,
  388. checkGroupName: this.data.checkGroupName,
  389. checkItemId: this.data.checkItemId,
  390. checkItemName: this.data.checkItemName,
  391. checkPointId: this.data.checkPointId,
  392. checkPointName: this.data.checkPointName,
  393. deptName: this.data.deptName,
  394. deptId: this.data.deptId,
  395. appointFlag: false,
  396. desicion: 0,
  397. taskType: "1",
  398. checkId: this.data.checkId,
  399. checkResult: this.resultConfigList[i].id,
  400. receiveEmpId: this.data.receiveEmpId,
  401. receiveEmpName: this.data.receiveEmpName,
  402. checkDetailId: this.data.id,
  403. };
  404. this.$store.dispatch({
  405. type: "mission/commActions",
  406. payload: {
  407. key: "comTaskCirculation",
  408. data: {
  409. ...param,
  410. },
  411. },
  412. }).then(() => {
  413. uni.navigateTo({
  414. url: `/pages/auditItemDetails/auditItemDetails?id=${this.data.id}&checkPointId=${this.checkPointId}`,
  415. });
  416. });
  417. }
  418. }
  419. }
  420. });
  421. } else {
  422. uni.showModal({
  423. title: "检查选项未选择",
  424. showCancel: false,
  425. });
  426. }
  427. },
  428. toTuLi() {
  429. uni.navigateTo({
  430. url: `/pages/legendDetails/legendDetails?checkItemId=${this.data.checkItemId}&checkPointId=${this.checkPointId}`,
  431. });
  432. },
  433. toHistory() {
  434. uni.navigateTo({
  435. url: `/pages/improve-mission-list/improve-mission-list?situationId=${this.data.situationId}`,
  436. });
  437. },
  438. },
  439. onLoad({ id, checkPointId }) {
  440. this.id = id;
  441. this.checkPointId = checkPointId;
  442. },
  443. };
  444. </script>
  445. <style lang="less">
  446. .mainPointsDetailPage {
  447. position: relative;
  448. // min-height: 75rpx;
  449. // overflow-y: auto;
  450. height: 100%;
  451. .scroll-y {
  452. height: calc(100% - 75rpx);
  453. }
  454. .checkItem {
  455. padding-top: 47.5rpx;
  456. width: 100%;
  457. min-height: 450rpx;
  458. background-color: #fff;
  459. position: relative;
  460. .chBg {
  461. position: absolute;
  462. top: 0;
  463. left: 0;
  464. width: 125rpx;
  465. height: 37.5rpx;
  466. .img {
  467. width: 125rpx;
  468. height: 37.5rpx;
  469. }
  470. .title {
  471. position: absolute;
  472. top: 8.75rpx;
  473. left: 25rpx;
  474. font-size: 20rpx;
  475. color: #fff;
  476. font-weight: 500;
  477. line-height: 20rpx;
  478. }
  479. }
  480. .tlImg {
  481. width: 40rpx;
  482. height: 40rpx;
  483. position: absolute;
  484. right: 25rpx;
  485. top: 25rpx;
  486. }
  487. .chContent {
  488. width: 100%;
  489. .checkItemName {
  490. margin-left: 31.25rpx;
  491. font-size: 25rpx;
  492. line-height: 55rpx;
  493. color: #292c33;
  494. }
  495. .checkPointName {
  496. margin-left: 31.25rpx;
  497. font-size: 17.5rpx;
  498. line-height: 17.5rpx;
  499. color: #7a8599;
  500. }
  501. .cont {
  502. height: 135rpx;
  503. .floatLeft {
  504. float: left;
  505. }
  506. .borderLine {
  507. margin-top: 56.25rpx;
  508. width: 0.62rpx;
  509. height: 25rpx;
  510. background-color: #dadee6;
  511. }
  512. .other {
  513. padding: 40rpx 0rpx;
  514. height: 95rpx;
  515. width: 187.18rpx;
  516. text-align: center;
  517. .letterTitle {
  518. font-size: 17.5rpx;
  519. color: #7a8599;
  520. line-height: 17.5rpx;
  521. }
  522. .letterTitle2 {
  523. height: 22.5rpx;
  524. font-size: 22.5rpx;
  525. line-height: 22.5rpx;
  526. color: #292c33;
  527. margin-bottom: 15rpx;
  528. font-weight: 500;
  529. }
  530. }
  531. }
  532. .checked {
  533. margin-bottom: 40rpx;
  534. padding: 0rpx 15.62rpx;
  535. height: 75rpx;
  536. .checked-checkItem {
  537. margin: 0rpx 9.37rpx;
  538. padding: 0;
  539. width: 125rpx;
  540. height: 75rpx;
  541. background: #ebeff7;
  542. float: left;
  543. line-height: 75rpx;
  544. text-align: center;
  545. color: #292c33;
  546. border-radius: 20rpx;
  547. position: relative;
  548. .img {
  549. width: 51.25rpx;
  550. height: 25rpx;
  551. position: absolute;
  552. right: -6.25rpx;
  553. top: -6.25rpx;
  554. }
  555. .lastName {
  556. color: #fff;
  557. font-size: 13.75rpx;
  558. line-height: 13.75rpx;
  559. position: absolute;
  560. right: 5rpx;
  561. top: -1.87rpx;
  562. }
  563. }
  564. }
  565. .more {
  566. margin: 0rpx 25rpx 0rpx 25rpx;
  567. text-align: center;
  568. border-top: 0.62rpx solid #dadee6;
  569. text {
  570. padding: 29.37rpx 0rpx 27.5rpx;
  571. margin-right: 10rpx;
  572. line-height: 22.5rpx;
  573. font-size: 22.5rpx;
  574. color: #3377ff;
  575. display: inline-block;
  576. vertical-align: top;
  577. }
  578. .moreImg {
  579. margin-top: 28.75rpx;
  580. width: 12.37rpx;
  581. height: 21.21rpx;
  582. display: inline-block;
  583. }
  584. .moreImg2 {
  585. width: 12.37rpx;
  586. height: 21.21rpx;
  587. }
  588. }
  589. }
  590. }
  591. .see {
  592. margin-top: 15rpx;
  593. height: 287.5rpx;
  594. background-color: #fff;
  595. // padding-left: 25rpx;
  596. .seeResult {
  597. margin-left: 25rpx;
  598. padding-top: 32.5rpx;
  599. // height: 200rpx;
  600. border-bottom: 1px solid #dadee6;
  601. .seeName {
  602. width: 175rpx;
  603. font-size: 22.5rpx;
  604. color: #525866;
  605. line-height: 22.5rpx;
  606. display: inline-block;
  607. }
  608. .seeTextarea {
  609. width: 531.25rpx;
  610. height: 155rpx;
  611. display: inline-block;
  612. font-size: 22.5rpx;
  613. line-height: 27.5rpx;
  614. }
  615. }
  616. .seeImg {
  617. min-height: 87.5rpx;
  618. .seeName2 {
  619. width: 175rpx;
  620. font-size: 22.5rpx;
  621. color: #525866;
  622. line-height: 87.5rpx;
  623. display: inline-block;
  624. }
  625. }
  626. }
  627. .talk {
  628. .talkTitle {
  629. padding: 25rpx 25rpx 15rpx;
  630. font-size: 22.5rpx;
  631. line-height: 22.5rpx;
  632. color: #666f80;
  633. .del {
  634. float: right;
  635. color: #3377ff;
  636. }
  637. }
  638. .talkResult {
  639. padding-left: 25rpx;
  640. padding-top: 32.5rpx;
  641. border-bottom: 1px solid #dadee6;
  642. background-color: #fff;
  643. .seeName {
  644. width: 175rpx;
  645. font-size: 22.5rpx;
  646. color: #525866;
  647. line-height: 22.5rpx;
  648. display: inline-block;
  649. }
  650. .seeTextarea {
  651. width: 531.25rpx;
  652. height: 155rpx;
  653. display: inline-block;
  654. font-size: 22.5rpx;
  655. line-height: 27.5rpx;
  656. }
  657. }
  658. .talkImg {
  659. min-height: 87.5rpx;
  660. .seeName2 {
  661. width: 175rpx;
  662. font-size: 22.5rpx;
  663. color: #525866;
  664. line-height: 87.5rpx;
  665. display: inline-block;
  666. }
  667. }
  668. }
  669. .insert {
  670. background-color: #fff;
  671. font-size: 22.5rpx;
  672. line-height: 22.5rpx;
  673. color: #3377ff;
  674. padding: 26.25rpx;
  675. }
  676. .sureDetail {
  677. width: 100%;
  678. height: 75rpx;
  679. font-size: 22.5rpx;
  680. background-color: #3377ff;
  681. line-height: 75rpx;
  682. position: absolute;
  683. bottom: 0rpx;
  684. }
  685. }
  686. </style>