mainPointsDetail.vue 15 KB

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