checkMainPoints.vue 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290
  1. <template>
  2. <view class="checkMainPoints">
  3. <u-navbar :title="ifSearchMod?'':'查核要点'" title-color="#292C33">
  4. <view v-if="ifSearchMod" class="slot-wrap" back-icon-size="25rpx">
  5. <input confirm-type="search" class="searchBar" type="text" v-model="searchKey" @input="filterFromName"
  6. placeholder-class="searchBarHolder" placeholder="搜索查核要点或查核项" />
  7. <image @click="clearSearch" v-if="searchKey" class="clearIcon" src="../../static/text-clear.png"
  8. mode=""></image>
  9. </view>
  10. <view v-if="ifSearchMod" class="navbar-right" slot="right">
  11. <text @click="cancelSearchMod" class="searchActiveBtn">取消</text>
  12. </view>
  13. </u-navbar>
  14. <uni-popup ref="popup" type="center" :maskClick="true" @change="onMaskChange"></uni-popup>
  15. <tm-top-menu v-if="!ifSearchMod" class="tm-top-menu">
  16. <template v-if="situationType != 2">
  17. <view class="top-search">
  18. <view class="search">
  19. <input confirm-type="search" @input="filterFromName" placeholder="搜索查核要点或查核项" />
  20. <image src="../../static/search.png"></image>
  21. </view>
  22. <view class="btnGroup">
  23. <image @click="toBindPeople(true)" class="searchBtn" src="../../static/bindPeople.png" mode="">
  24. </image>
  25. <image @click="openFilter" class="filterBtn" src="../../static/filterIcon.png" mode="">
  26. </image>
  27. </view>
  28. </view>
  29. </template>
  30. <!-- 查核分页模式下// -->
  31. <template v-if="situationType == 2">
  32. <view class="top-search-two">
  33. <view class="rowOne" v-if="nowPermission == 3 && situationType == 2">
  34. <view class="selectPeople" @click="toSelectVisiter">
  35. <template v-if="investigationUsers.length>0">
  36. <image
  37. v-if="currentSelectedInvestigationUser&&currentSelectedInvestigationUser['investigationStatus'] != 1"
  38. class="completePeopleIcon" src="../../static/peopleIcon.png" mode=""></image>
  39. <image
  40. v-if="currentSelectedInvestigationUser&&currentSelectedInvestigationUser['investigationStatus'] == 1"
  41. class="completePeopleIcon" src="../../static/completePeopleIcon.png" mode="">
  42. </image>
  43. <text
  44. class="peopleName">{{currentSelectedInvestigationUser?currentSelectedInvestigationUser['contentVOs'][0].value:''}}</text>
  45. <image class="fullArrow" src="../../static/close-icon.png" mode=""></image>
  46. </template>
  47. <template v-if="investigationUsers.length==0">
  48. <image @click="toSelectVisiter" class="addPeopleBtn" src="../../static/icon-add.png"
  49. mode=""></image>
  50. </template>
  51. </view>
  52. <view class="btnGroup">
  53. <image @click="toSearch" class="searchBtn" src="../../static/search.png" mode=""></image>
  54. <image @click="openFilter" class="filterBtn" src="../../static/filterIcon.png" mode="">
  55. </image>
  56. </view>
  57. </view>
  58. </view>
  59. </template>
  60. <!-- 只有当查核者进入才展示 -->
  61. <view ref="rowTwoWraper">
  62. <view class="rowTwo"v-if="nowPermission == 3||nowPermission == 1" :animation="animationData" v-for="(v,i) in btnArr">
  63. <text class="rowTwoName">{{v.key}}</text>
  64. <view class="filterBtnWrap" :style="{paddingBottom:i==2?'20px':0}">
  65. <com-button v-for="(item, index) in v.list" :btnText="item.label" :width="`${32}%`" :height="80" :marginBottom="20"
  66. :marginRight="(index+1)%3==0?0:`2%`"
  67. :type="setFilterBtnType(item.value,v.key)" v-on:btnClick="btnClick(item.value,v.key)" />
  68. </view>
  69. </view>
  70. </view>
  71. </tm-top-menu>
  72. <tm-modal v-show="showModal" v-on:click="toggleModal(false)">
  73. <view class="content-list">
  74. <view class="list-item" v-for="(item, index) in point"
  75. :class="{active: checkPointId === item.checkPointId}" @click="checkPointHandle(item.checkPointId)">
  76. <text>{{item.checkPointName}}</text>
  77. <image class="check-img" v-if="checkPointId === item.checkPointId"
  78. src="../../static/checkStatus.png"></image>
  79. </view>
  80. </view>
  81. </tm-modal>
  82. <view class="contentContainer">
  83. <image class="dataEmptyimg" v-if="detailList.length==0" src="../../static/no-data.png"></image>
  84. <scroll-view @scroll="scrollHandle" scroll-y="true"
  85. v-if="detailList.length>0"
  86. :class="(detailList.length>0&&active != 2&&finishedStatus != 1)?'scroll-Y':'scroll-Y noBtn'">
  87. <view class="list" v-for="(item, index) in detailList" :key="index">
  88. <view class="title" v-if="item.responseList.length > 0">查核要点:{{item.checkPointName}}</view>
  89. <view class="item" v-for="(child, n) in item.responseList"
  90. @click="childClick(child,item.checkPointId)" :key="n">
  91. <view class="top-box">
  92. <view class="top-box-left">
  93. <view :class="[child.completeFlag?'index-icon done':'index-icon']">{{n + 1}}</view>
  94. <text>{{child.checkItemName}}</text>
  95. <!-- <text>ICU病房查看危重病人的抢救全过程(访谈)ICU病房查看危重病人的抢救全过程(访谈)ICU病房查看危重病人的抢救全过程(访谈)的抢救全过程(访谈)</text> -->
  96. </view>
  97. <view class="topRightGroup">
  98. <!-- showNotApplicable==0展示,1不展示 -->
  99. <view class="checkStatus" v-if="!child.showNotApplicable"
  100. @click.stop="checkNoApplicable(child)">
  101. <image v-if="child.isNoApplicable&&!notApplicableList.includes(child.id)"
  102. class="checkIcon" src="../../static/check-no.png" mode=""></image>
  103. <image v-if="notApplicableList.includes(child.id)||!child.isNoApplicable"
  104. class="checkIcon" src="../../static/check-checkbox.png" mode=""></image>
  105. <text class="checkStatusText">{{child.notApplicableName}}</text>
  106. </view>
  107. <image src="../../static/tuli.png"
  108. @tap.stop="goLegendDetails($event ,child.checkItemId, item.checkPointId)"></image>
  109. </view>
  110. </view>
  111. <view class="children">
  112. <view class="child">
  113. <text>{{child.deptName || '--'}}</text>
  114. <text>查核单位</text>
  115. </view>
  116. <view class="child">
  117. <text>{{child.checkModelName || '--'}}</text>
  118. <text>查核方式</text>
  119. </view>
  120. <view class="child">
  121. <text :style="{color:`#${child.lastResultColor}`}">{{child.lastResult || '--'}}</text>
  122. <text>上次结果</text>
  123. </view>
  124. <view class="child">
  125. <text :style="{color:`#${child.checkResultColor}`}">{{child.checkResult || '--'}}</text>
  126. <text>本次结果</text>
  127. </view>
  128. </view>
  129. </view>
  130. </view>
  131. </scroll-view>
  132. </view>
  133. <tm-callback-listpage />
  134. <view class="bottomBtnGroup" v-if="!ifSearchMod">
  135. <view v-if="!isShowSubtotal" class="score">
  136. <view class="box">
  137. <text class="label">得分</text>
  138. <text class="currentScore">{{currentScore}}</text>
  139. </view>
  140. <view class="midLine"></view>
  141. <view class="box">
  142. <text class="label">总分</text>
  143. <text class="totalScore">{{totalScore}}</text>
  144. </view>
  145. </view>
  146. <view v-if="isShowSubtotal" class="score scoreTypeTwo">
  147. <view class="box">
  148. <view class="rowOne">
  149. <text class="currentScore">{{currentScore}}</text>
  150. <text class="subLabel">得分</text>
  151. </view>
  152. <view class="rowTwo">
  153. <text class="label">总分:</text>
  154. <text class="currentScore">{{totalScore}}</text>
  155. </view>
  156. </view>
  157. <view class="midLine"></view>
  158. <view class="box">
  159. <view class="rowOne">
  160. <text class="currentScore xiaoji">{{subtotalScore}}</text>
  161. <text class="subLabel">小计</text>
  162. </view>
  163. <view class="rowTwo">
  164. <text class="label">总分:</text>
  165. <text class="currentScore">{{totalSubtotalScore}}</text>
  166. </view>
  167. </view>
  168. </view>
  169. <!--查核列表为空&&dang q -->
  170. <view v-if="detailList.length>0&&active != 2&&finishedStatus != 1" @click="onkeyCheckHandle"
  171. :class="[subtotalScore != null&&subtotalScore>=0?'botOneKeyCheck typeTwo':'botOneKeyCheck']">完成</view>
  172. </view>
  173. </view>
  174. </template>
  175. <script>
  176. import {
  177. mapState
  178. } from 'vuex';
  179. import {
  180. _stopPropagation
  181. } from "../../utils/compatible.js";
  182. export default {
  183. data() {
  184. return {
  185. btnArr: [],
  186. showModal: false,
  187. detailList: [],
  188. copyDetailList: [],
  189. point: [{
  190. checkPointId: 'all',
  191. checkPointName: '全部要点'
  192. }],
  193. checkPointId: 'all',
  194. nowPermission: uni.getStorageSync('nowPermission'),
  195. active:{
  196. result:['全部'],
  197. checkStatus:'全部',
  198. other:'全部'
  199. }, //筛选tab下标
  200. checkId: '',
  201. deptId: '',
  202. currentScrollHeight: 0,
  203. finishedStatus: 0, //所有计划里的查核项是否都以完成
  204. totalScore: 0,
  205. currentScore: 0,
  206. subtotalScore: 0, //小计得分
  207. totalSubtotalScore: 0, //小计总分
  208. isShowSubtotal:false,//是否展示小计
  209. animationData: {}, //动画对象
  210. ifOpenFilter: false,
  211. searchKey: '', //搜索关键字
  212. ifSearchMod: false, //搜索模式
  213. applicable: true, //是否适用
  214. situationType: null, //情境类型
  215. notApplicableList: [], //保存本次check的查核项id
  216. };
  217. },
  218. computed: {
  219. ...mapState({
  220. investigationUsers: state => state.checkMainPoints.investigationUsers,
  221. currentSelectedInvestigationUser: state => state.checkMainPoints.currentSelectedInvestigationUser,
  222. ifReloadPageData: state => state.checkMainPoints.ifReloadPageData,
  223. }),
  224. getCheckPointName() {
  225. let item = this.point.find((item) => item.checkPointId === this.checkPointId);
  226. return item ? item.checkPointName : '';
  227. }
  228. },
  229. watch: {
  230. currentSelectedInvestigationUser(newVal, oldVal) {
  231. if (this.situationType == 2) {
  232. //更换受访对象时拉取新数据
  233. if (newVal && newVal.investigationUserName == '') {
  234. //已删除所有访查对象
  235. this.$store.commit('checkMainPoints/comChangeState', {
  236. key: 'detailList',
  237. data: []
  238. });
  239. this.detailList = [];
  240. } else {
  241. this.loadItemData();
  242. }
  243. }
  244. },
  245. ifReloadPageData(newVal){
  246. if(newVal){
  247. this.loadItemData();
  248. }
  249. }
  250. },
  251. onBackPress() {
  252. this.$store.commit('checkList/comChangeState', { //刷新前一页数据
  253. key: 'ifReloadPageData',
  254. data: true
  255. });
  256. this.$store.commit('todayCheck/comChangeState', { //刷新todayCheck页面计划
  257. key: 'isReloadPageData',
  258. data: true
  259. });
  260. },
  261. onLoad: function({
  262. checkId,
  263. deptId,
  264. finishedStatus,
  265. situationType,
  266. pageTemplateId
  267. }) {
  268. this.deptId = deptId;
  269. this.checkId = checkId;
  270. this.finishedStatus = finishedStatus;
  271. this.situationType = situationType;
  272. this.pageTemplateId = pageTemplateId;
  273. if (situationType == 2) {
  274. this.getInvestigationUsers();
  275. }
  276. //非分页情况下
  277. if (situationType != 2) {
  278. this.loadItemData();
  279. }
  280. if(this.currentSelectedInvestigationUser){
  281. this.getFilterList(checkId,deptId,this.currentSelectedInvestigationUser.investigationId);
  282. }else{
  283. this.getFilterList(checkId,deptId);
  284. }
  285. },
  286. onShow: function() {
  287. if (this.ifReloadPageData) {
  288. //页面重新拉取数据
  289. this.loadItemData();
  290. }
  291. //创建动画实例
  292. const animation = uni.createAnimation({
  293. duration: 100,
  294. timingFunction: 'ease',
  295. })
  296. this.animation = animation;
  297. },
  298. onUnload() {
  299. this.$store.commit('checkMainPoints/comChangeState', {
  300. key: 'ifReloadPageData',
  301. data: false
  302. });
  303. this.$store.commit('todayCheck/comChangeState', { //刷新todayCheck页面计划
  304. key: 'isReloadPageData',
  305. data: true
  306. });
  307. },
  308. methods: {
  309. /**
  310. * @param {number} checkId 查核id
  311. * @param {number} deptId 部门id
  312. * @param {number} responsibleUserId 责任对象id 非必传
  313. */
  314. getFilterList(checkId,deptId,responsibleUserId){
  315. this.$store.dispatch({
  316. type: 'checkMainPoints/commActions',
  317. key: 'getPointConditions',
  318. data: {
  319. checkId:checkId,
  320. responsibleUserId,
  321. deptId:deptId
  322. }
  323. }).then(data=>{
  324. const {checkResults=[],checkStatuses=[],others=[]} = data;
  325. const _checkResults = checkResults.map(t=>({label:`${t.value}(${t.num})`,id:Math.random(),value:t.value}));
  326. const _checkStatuses = checkStatuses.map(t=>({label:`${t.value}(${t.num})`,id:Math.random(),value:t.value}));
  327. const _others = others.map(t=>({label:`${t.value}(${t.num})`,id:Math.random(),value:t.value}));
  328. this.btnArr = [
  329. {key:'查核状态',list:_checkStatuses},
  330. {key:'查核结果',list:_checkResults},
  331. {key:'其他',list:_others},
  332. ];
  333. })
  334. },
  335. //绑定当事人
  336. /**
  337. * @param {Boolean} bool true直接执行设置当事人,忽略本地以缓存的deptTd
  338. */
  339. toBindPeople(bool) {
  340. if (this.isBindResponsible && bool) {
  341. uni.showToast({
  342. icon: 'none',
  343. title: '已绑定过当事人!',
  344. duration: 2000
  345. });
  346. return;
  347. };
  348. let notNowBindPeopledeptIds = uni.getStorageSync('notNowBindPeopledeptIds');
  349. if (!notNowBindPeopledeptIds) {
  350. notNowBindPeopledeptIds = []
  351. } else {
  352. notNowBindPeopledeptIds = JSON.parse(notNowBindPeopledeptIds);
  353. }
  354. if (!notNowBindPeopledeptIds.includes(this.deptId) || bool) {
  355. const nowPermission = JSON.parse(uni.getStorageSync('nowPermission'));
  356. // console.log(this.isBindResponsible,this.checkDetailMapResponses.length,nowPermission)
  357. if (!this.isBindResponsible && this.checkDetailMapResponses.length > 0 && nowPermission == 3) {
  358. //当是否已绑定当事人状态为false,可查核项大于0且当前角色是查核组员时
  359. //只有从查核列表进来才提示
  360. uni.showModal({
  361. title: '提示',
  362. content: '目前未批量分配当事人,是否前往选择?',
  363. confirmText: '前往设置',
  364. cancelText: '暂不设置',
  365. success: (res) => {
  366. if (res.confirm) {
  367. uni.navigateTo({
  368. url: `/pages/responsibleList/responsibleList?deptId=${this.deptId}&isFromCheckMainPoints=true`,
  369. });
  370. } else if (res.cancel) {
  371. //将当前病区保存,之后不在提示
  372. notNowBindPeopledeptIds.push(this.deptId);
  373. uni.setStorageSync('notNowBindPeopledeptIds', JSON.stringify(
  374. notNowBindPeopledeptIds));
  375. }
  376. }
  377. });
  378. }else{
  379. uni.showModal({
  380. title: '提示',
  381. content: '你目前无法批量分配当事人',
  382. confirmText: '确定',
  383. showCancel:false
  384. });
  385. }
  386. }
  387. },
  388. loadItemData() {
  389. if(this.situationType == 2&&!this.currentSelectedInvestigationUser){
  390. //分页模式下且未选择访谈对象时拒绝请求数据同时清空历史数据
  391. this.$store.commit('checkMainPoints/comChangeState', {
  392. key: 'detailList',
  393. data:[]
  394. });
  395. this.detailList = [];
  396. this.isBindResponsible = false;
  397. this.copyDetailList = [];
  398. this.currentScore =0;
  399. this.totalScore = 0;
  400. this.subtotalScore = 0;
  401. this.totalSubtotalScore = 0;
  402. this.checkDetailMapResponses = [];
  403. this.point = [];
  404. return false
  405. }
  406. this.checkTaskDetailList({
  407. 'deptId': this.deptId,
  408. 'checkId': this.checkId,
  409. 'situationType': this.situationType,
  410. 'investigationId': this.currentSelectedInvestigationUser && this
  411. .currentSelectedInvestigationUser.investigationId
  412. })
  413. },
  414. //不适用回调
  415. checkNoApplicable({
  416. id,
  417. isNoApplicable
  418. }) {
  419. this.$store.dispatch({
  420. type: 'checkMainPoints/commActions',
  421. key: 'oneKeyNotApplicable',
  422. data: id
  423. }).then(data => {
  424. if (data) {
  425. //重新拉去列表数据
  426. this.loadItemData();
  427. }
  428. })
  429. },
  430. toSelectVisiter() {
  431. //更新受访对象状态,可能已经是进行中了
  432. this.$store.dispatch({
  433. type: 'checkMainPoints/commActions',
  434. key: 'getInvestigationUsers',
  435. data: {
  436. checkId: this.checkId,
  437. situationType: this.situationType,
  438. deptId: this.deptId
  439. }
  440. }).then(data => {
  441. this.$store.commit('checkMainPoints/comChangeState', {
  442. key: 'investigationUsers',
  443. data: data.map((t,index)=>({...t,id:t.investigationId}))
  444. });
  445. uni.navigateTo({
  446. url: `/pages/selectVisitPerson/selectVisitPerson?checkId=${this.checkId}&situationType=${this.situationType}&deptId=${this.deptId}&pageTemplateId=${this.pageTemplateId}`
  447. });
  448. });
  449. },
  450. toSearch() {
  451. this.ifSearchMod = true;
  452. this.detailList = [];
  453. },
  454. cancelSearchMod() {
  455. this.ifSearchMod = false;
  456. this.detailList = [...this.copyDetailList];
  457. },
  458. onMaskChange({
  459. show
  460. }) {
  461. if (!show) {
  462. this.ifOpenFilter = false;
  463. this.animation.height(0).step();
  464. this.animationData = this.animation.export()
  465. }
  466. },
  467. openFilter() {
  468. const status = this.ifOpenFilter;
  469. // console.log(this.$refs.rowTwoWraper.$el.offsetHeight)
  470. if (!status) {
  471. this.$refs.popup.open();
  472. this.ifOpenFilter = true;
  473. this.animation.height('100%').step();
  474. } else {
  475. this.$refs.popup.close();
  476. this.ifOpenFilter = false;
  477. this.animation.height(0).step();
  478. }
  479. this.animationData = this.animation.export()
  480. },
  481. //滚动监听事件,记录滚动高度
  482. scrollHandle(e) {
  483. this.currentScrollHeight = e.detail.scrollTop;
  484. },
  485. //一键查核
  486. onkeyCheckHandle() {
  487. if(this.situationType == 2&&!this.currentSelectedInvestigationUser){
  488. //当分页模式且未添加/选择受访对象时
  489. uni.showToast({
  490. title: '请先选择或添加受访对象!',
  491. duration: 2000,
  492. icon:'none'
  493. });
  494. return;
  495. }
  496. uni.showModal({
  497. title: '注意',
  498. content: '确定所有未填写查核结果项默认无缺失结果吗?',
  499. success: (res) => {
  500. if (res.confirm) {
  501. console.log('用户点击确定');
  502. this.oneKeyCheckCommit();
  503. } else if (res.cancel) {
  504. console.log('用户点击取消');
  505. }
  506. }
  507. });
  508. },
  509. oneKeyCheckCommit() {
  510. let ids = [];
  511. this.detailList.forEach(item => {
  512. //筛选掉已查核项
  513. const temp = item.responseList.filter(v => !v.checkResult);
  514. const arr = temp.map(v => v.id);
  515. ids = ids.concat(arr);
  516. });
  517. this.$store.dispatch({
  518. type: 'checkMainPoints/commActions',
  519. key: 'oneKeyCheck',
  520. data: ids
  521. }).then(data => {
  522. if (data) {
  523. uni.showModal({
  524. title: '查核完成!',
  525. content: '',
  526. showCancel: false,
  527. success: function(res) {
  528. if (res.confirm) {
  529. console.log('用户点击确定');
  530. uni.navigateBack({
  531. delta: 1
  532. });
  533. }
  534. }
  535. });
  536. }
  537. });
  538. },
  539. setFilterBtnType(val,key){
  540. if(key == '查核结果'){
  541. const index = this.active.result.findIndex(t=>val==t);
  542. return index>=0?'pramary':'default'
  543. }
  544. if(key == '查核状态'){
  545. return this.active.checkStatus == val?'pramary':'default'
  546. }
  547. if(key == '其他'){
  548. return this.active.other == val?'pramary':'default'
  549. }
  550. },
  551. btnClick(val,key) {
  552. const _active = this.active;
  553. if(key == '查核结果'){
  554. const index = _active.result.findIndex(t=>t == val);
  555. if(index >= 0){
  556. //当前已存在该id
  557. _active.result.splice(index,1);
  558. }else{
  559. _active.result.push(val);
  560. console.log({_active});
  561. }
  562. }
  563. if(key == '查核状态'){
  564. _active.checkStatus = val
  565. }
  566. if(key == '其他'){
  567. _active.other = val
  568. }
  569. this.active = _active;
  570. //更新列表
  571. this.loadItemData();
  572. },
  573. //获取访查对象列表
  574. getInvestigationUsers() {
  575. this.$store.dispatch({
  576. type: 'checkMainPoints/commActions',
  577. key: 'getInvestigationUsers',
  578. data: {
  579. checkId: this.checkId,
  580. situationType: this.situationType,
  581. deptId: this.deptId
  582. }
  583. }).then(data => {
  584. if(data.length==0){
  585. //当不存在访查对象时
  586. uni.showModal({
  587. title: '提示',
  588. content: '你目前还未添加访谈对象!',
  589. confirmText: '确定',
  590. showCancel:false
  591. });
  592. }
  593. this.$store.commit('checkMainPoints/comChangeState', {
  594. key: 'investigationUsers',
  595. data: data
  596. });
  597. this.$store.commit('checkMainPoints/comChangeState', {
  598. key: 'currentSelectedInvestigationUser',
  599. data: data[0]
  600. })
  601. });
  602. },
  603. checkTaskDetailList({
  604. checkId,
  605. deptId,
  606. situationType,
  607. investigationId,
  608. }) {
  609. const params = {
  610. checkId,
  611. deptId,
  612. situationType,
  613. checkStatus:this.active.checkStatus,
  614. checkResult:this.active.result.join(','),
  615. other:this.active.other
  616. }
  617. //增加受访人
  618. if (situationType == 2) params['investigationId'] = investigationId;
  619. this.dispatch('checkTaskDetailList', {
  620. ...params
  621. }).then((data) => {
  622. if (data) {
  623. const renderList = data.checkDetailMapResponses?data.checkDetailMapResponses:[];
  624. this.$store.commit('checkMainPoints/comChangeState', {
  625. key: 'detailList',
  626. data: renderList
  627. });
  628. this.isBindResponsible = data.isBindResponsible;
  629. this.detailList = renderList;
  630. this.copyDetailList = renderList;
  631. this.currentScore = data.getScore;
  632. this.totalScore = data.totalScore;
  633. this.subtotalScore = data.subtotalScore;
  634. this.isShowSubtotal = data.isShowSubtotal;
  635. this.totalSubtotalScore = data.totalSubtotalScore;
  636. this.checkDetailMapResponses = renderList;
  637. renderList.map(({
  638. checkPointId,
  639. checkPointName
  640. }) => {
  641. this.point.push({
  642. checkPointId,
  643. checkPointName
  644. });
  645. });
  646. //检查是否需要弹绑定当事人弹窗
  647. this.toBindPeople();
  648. }
  649. });
  650. },
  651. childClick(child, checkPointId) {
  652. // 查核者,管理员
  653. if (this.nowPermission == 1 || this.nowPermission == 3) {
  654. let str = '',
  655. that = this;
  656. if (child.checkResult && !child.allowEdit) {
  657. // 当存在查核结果且不允许再修改时 跳转到查核项详情
  658. str = 'auditItemDetails/auditItemDetails';
  659. } else {
  660. if (this.nowPermission == 1) {
  661. uni.showModal({
  662. title: '提示',
  663. content: '请切换至查核者角色再进行查核操作!',
  664. showCancel: false
  665. });
  666. return;
  667. } else {
  668. // 跳转到查核结果提交
  669. str = 'mainPointsDetail/mainPointsDetail';
  670. }
  671. }
  672. uni.navigateTo({
  673. url: `/pages/${str}?id=${child.id}&checkPointId=${checkPointId}&checkItemId=${child.checkItemId}&situationType=${this.situationType}`,
  674. success: function(res) {
  675. const currentGroup = that.detailList.filter(item => item.checkPointId ==
  676. checkPointId);
  677. // 通过eventChannel向被打开页面传送数据
  678. res.eventChannel.emit('acceptDataFromOpenerPage', {
  679. data: currentGroup
  680. });
  681. }
  682. });
  683. }
  684. },
  685. toggleModal(flage) {
  686. this.showModal = flage;
  687. },
  688. checkPointHandle(id) {
  689. this.checkPointId = id;
  690. if (id === 'all') {
  691. this.detailList = [...this.copyDetailList];
  692. } else {
  693. this.detailList = this.copyDetailList
  694. .filter((item) => item.checkPointId === id);
  695. }
  696. },
  697. clearSearch() {
  698. this.searchKey = '';
  699. this.detailList = [...this.copyDetailList];
  700. },
  701. filterFromName(e) {
  702. const {
  703. value
  704. } = e.detail;
  705. this.searchKey = value;
  706. if (value === '') {
  707. this.detailList = [...this.copyDetailList];
  708. } else {
  709. this.detailList = [];
  710. this.copyDetailList.map((item) => {
  711. let responseList = item.responseList
  712. .filter((child) => child.checkItemName.indexOf(value) >= 0);
  713. if (item.checkPointName.indexOf(value) >= 0) {
  714. this.detailList.push({
  715. ...item
  716. });
  717. } else if (responseList.length > 0) {
  718. this.detailList.push({
  719. ...item,
  720. responseList
  721. });
  722. }
  723. });
  724. }
  725. },
  726. goLegendDetails(e, checkItemId, checkPointId) {
  727. _stopPropagation(e);
  728. //跳转到图例详情
  729. uni.navigateTo({
  730. url: `/pages/legendDetails/legendDetails?checkItemId=${checkItemId}&checkPointId=${checkPointId}`
  731. });
  732. },
  733. dispatch(key, data) {
  734. return this.$store.dispatch({
  735. type: 'checkList/commActions',
  736. key,
  737. data
  738. });
  739. },
  740. }
  741. }
  742. </script>
  743. <style lang="less">
  744. .checkMainPoints {
  745. position: relative;
  746. height: 100%;
  747. display: flex;
  748. flex-direction: column;
  749. background-color: #F5F6FA;
  750. .slot-wrap {
  751. display: flex;
  752. flex: 1;
  753. justify-content: center;
  754. align-items: center;
  755. background: #F0F2F7;
  756. border-radius: 44px;
  757. padding-left: 20rpx;
  758. .searchBar {
  759. flex: 1;
  760. width: 100%;
  761. height: 55rpx;
  762. font-size: 22.5rpx;
  763. }
  764. .clearIcon {
  765. width: 25rpx;
  766. height: 25rpx;
  767. margin: 0 20.5rpx;
  768. }
  769. .searchBarHolder {
  770. font-size: 22.5rpx;
  771. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  772. font-weight: 400;
  773. color: #A1A7B3;
  774. }
  775. }
  776. .navbar-right {
  777. display: flex;
  778. justify-content: center;
  779. align-items: center;
  780. padding: 0 25rpx;
  781. .searchActiveBtn {
  782. font-size: 22.5rpx;
  783. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  784. font-weight: 400;
  785. color: #292C33;
  786. }
  787. }
  788. .botOneKeyCheck {
  789. text-align: center;
  790. height: 75rpx;
  791. width: 100%;
  792. line-height: 75rpx;
  793. font-size: 22.5rpx;
  794. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  795. font-weight: 400;
  796. color: #FFFFFF;
  797. background: #3377FF;
  798. }
  799. .bottomBtnGroup {
  800. // position: fixed;
  801. width: 100%;
  802. // left:0;
  803. // bottom: 0;
  804. display: flex;
  805. flex-direction: row;
  806. border-top: 1px solid #DADEE6;
  807. background-color: #fff;
  808. .score {
  809. display: flex;
  810. width: 50%;
  811. flex-direction: row;
  812. justify-content: center;
  813. align-items: center;
  814. height: 75rpx;
  815. .box {
  816. width: 50%;
  817. text-align: center;
  818. white-space: nowrap;
  819. vertical-align: bottom;
  820. .label {
  821. color: #666E80;
  822. font-size: 17.5rpx;
  823. margin-right: 10rpx;
  824. }
  825. .currentScore {
  826. font-size: 30rpx;
  827. font-weight: bold;
  828. color: #3377FF;
  829. &.xiaoji {
  830. color: #19BE6B;
  831. }
  832. }
  833. .totalScore {
  834. font-size: 30rpx;
  835. font-weight: bold;
  836. color: #292C33;
  837. }
  838. }
  839. .midLine {
  840. height: 17.5rpx;
  841. border-left: 0.62rpx solid #DADEE6;
  842. }
  843. &.scoreTypeTwo {
  844. height: 100rpx;
  845. .box {
  846. .rowOne {
  847. .subLabel {
  848. font-size: 10rpx;
  849. color: #82848A;
  850. margin-left: 10rpx;
  851. }
  852. }
  853. .rowTwo {
  854. .currentScore {
  855. font-size: 20rpx;
  856. font-weight: bold;
  857. color: #666E80;
  858. }
  859. }
  860. }
  861. .midLine {
  862. height: 25rpx;
  863. }
  864. }
  865. }
  866. .botOneKeyCheck {
  867. display: flex;
  868. justify-content: center;
  869. align-items: center;
  870. height: 100%;
  871. flex-grow: 1;
  872. font-size: 22.5rpx;
  873. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  874. font-weight: 400;
  875. color: #FFFFFF;
  876. background: #3377FF;
  877. &.typeTwo {
  878. font-size: 32.5rpx;
  879. }
  880. }
  881. }
  882. .tm-top-menu {
  883. .rowTwo {
  884. display: flex;
  885. width: 100%;
  886. height: 0;
  887. overflow: hidden;
  888. flex-direction: column;
  889. box-sizing: border-box;
  890. padding: 0 25rpx;
  891. overflow: hidden;
  892. .rowTwoName {
  893. font-size: 22.5rpx;
  894. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  895. font-weight: 400;
  896. color: #666F80;
  897. margin-bottom: 12.5rpx;
  898. padding-top: 35rpx;
  899. }
  900. .filterBtnWrap {
  901. display: flex;
  902. flex-direction: row;
  903. flex-wrap: wrap;
  904. justify-content: flex-start;
  905. }
  906. }
  907. }
  908. .top-search {
  909. display: flex;
  910. flex-direction: row;
  911. align-items: center;
  912. justify-content: space-between;
  913. padding: 25rpx;
  914. background-color: #fff;
  915. box-shadow: 0 3.75rpx 12.5rpx 0 rgba(0, 13, 51, 0.1);
  916. .search {
  917. position: relative;
  918. width: 70%;
  919. height: 55rpx;
  920. line-height: 55rpx;
  921. background-color: #F0F2F7;
  922. input {
  923. padding: 0 45rpx 0 15rpx;
  924. height: 55rpx;
  925. line-height: 55rpx;
  926. font-size: 22.5rpx;
  927. }
  928. image {
  929. position: absolute;
  930. top: 16.87rpx;
  931. right: 15rpx;
  932. width: 21.25rpx;
  933. height: 21.25rpx;
  934. }
  935. }
  936. .btnGroup {
  937. display: flex;
  938. flex-direction: row;
  939. justify-content: center;
  940. align-items: center;
  941. .searchBtn {
  942. width: 30rpx;
  943. height: 30rpx;
  944. margin-right: 30rpx;
  945. }
  946. .filterBtn {
  947. width: 30rpx;
  948. height: 27.5rpx;
  949. }
  950. }
  951. .top-btn-wrap {
  952. padding-left: 25rpx;
  953. .btn-list {
  954. display: flex;
  955. flex-direction: row;
  956. .com-button {
  957. margin-left: 5rpx;
  958. &:first-child {
  959. margin-left: 0;
  960. }
  961. }
  962. }
  963. .select-wrap {
  964. display: flex;
  965. flex-direction: row;
  966. align-items: center;
  967. white-space: nowrap;
  968. image {
  969. margin-left: 9.37rpx;
  970. width: 12.5rpx;
  971. height: 12.5rpx;
  972. }
  973. }
  974. }
  975. }
  976. .top-search-two {
  977. display: flex;
  978. flex-direction: column;
  979. align-items: flex-start;
  980. justify-content: center;
  981. padding: 25rpx;
  982. background-color: #fff;
  983. box-shadow: 0 3.75rpx 12.5rpx 0 rgba(0, 13, 51, 0.1);
  984. .rowOne {
  985. display: flex;
  986. width: 100%;
  987. flex-direction: row;
  988. justify-content: space-between;
  989. align-items: center;
  990. .selectPeople {
  991. display: flex;
  992. flex-direction: row;
  993. justify-content: space-between;
  994. align-items: center;
  995. .completePeopleIcon {
  996. width: 50rpx;
  997. height: 50rpx;
  998. margin-right: 15rpx;
  999. }
  1000. .peopleName {
  1001. font-size: 25rpx;
  1002. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  1003. font-weight: 400;
  1004. color: #292C33;
  1005. }
  1006. .fullArrow {
  1007. width: 11.25rpx;
  1008. height: 7.5rpx;
  1009. margin-left: 15rpx;
  1010. }
  1011. .addPeopleBtn {
  1012. width: 30rpx;
  1013. height: 30rpx;
  1014. margin-right: 12.5rpx;
  1015. }
  1016. }
  1017. .btnGroup {
  1018. .searchBtn {
  1019. width: 30rpx;
  1020. height: 30rpx;
  1021. margin-right: 50rpx;
  1022. }
  1023. .filterBtn {
  1024. width: 30rpx;
  1025. height: 27.5rpx;
  1026. }
  1027. }
  1028. }
  1029. }
  1030. .content-list {
  1031. // padding-top: 105rpx;
  1032. width: 100%;
  1033. background-color: #fff;
  1034. .list-item {
  1035. display: flex;
  1036. flex-direction: row;
  1037. justify-content: space-between;
  1038. align-items: center;
  1039. border-bottom: 1px solid #DADEE6;
  1040. padding: 0 25rpx;
  1041. width: 100%;
  1042. height: 87.5rpx;
  1043. font-size: 22.5rpx;
  1044. line-height: 33.75rpx;
  1045. color: #292C33;
  1046. .check-img {
  1047. float: right;
  1048. width: 19.37rpx;
  1049. height: 14.37rpx;
  1050. }
  1051. &.active {
  1052. color: #3377FF;
  1053. }
  1054. }
  1055. }
  1056. .contentContainer {
  1057. display: flex;
  1058. flex: 1;
  1059. height: 100%;
  1060. overflow: hidden;
  1061. .dataEmptyimg {
  1062. display: block;
  1063. width:200rpx;
  1064. height:230rpx;
  1065. margin: 0 auto;
  1066. margin-top: 200rpx;
  1067. }
  1068. .scroll-Y {
  1069. height: 100%;
  1070. &.noBtn {
  1071. height: 100%;
  1072. }
  1073. }
  1074. }
  1075. .list {
  1076. .title {
  1077. padding-left: 25rpx;
  1078. width: 100%;
  1079. height: 62.5rpx;
  1080. line-height: 62.5rpx;
  1081. color: #666F80;
  1082. }
  1083. .item {
  1084. margin-top: 15rpx;
  1085. padding: 25rpx 0;
  1086. min-height: 167.5rpx;
  1087. background-color: #fff;
  1088. &:nth-child(2) {
  1089. margin-top: 0;
  1090. }
  1091. .top-box {
  1092. display: flex;
  1093. flex-direction: row;
  1094. justify-content: space-between;
  1095. align-items: center;
  1096. .top-box-left {
  1097. display: flex;
  1098. flex-direction: row;
  1099. width: calc(100% - 55rpx);
  1100. .index-icon {
  1101. margin-right: 15rpx;
  1102. border-radius: 0 62.5rpx 62.5rpx 0;
  1103. width: 50rpx;
  1104. height: 35rpx;
  1105. line-height: 35rpx;
  1106. text-align: center;
  1107. color: #fff;
  1108. background-color: #66B2FE;
  1109. &.done {
  1110. background-color: rgba(195, 202, 217, 1);
  1111. }
  1112. }
  1113. >text {
  1114. display: -webkit-box;
  1115. overflow: hidden;
  1116. width: calc(100% - 65rpx);
  1117. text-overflow: ellipsis;
  1118. -webkit-line-clamp: 2;
  1119. /*! autoprefixer: off */
  1120. -webkit-box-orient: vertical;
  1121. }
  1122. }
  1123. .topRightGroup {
  1124. display: flex;
  1125. flex-direction: row;
  1126. .checkStatus {
  1127. display: flex;
  1128. flex-direction: row;
  1129. justify-content: center;
  1130. align-items: center;
  1131. width: 125rpx;
  1132. height: 40rpx;
  1133. margin-right: 15rpx;
  1134. background: #F2F4F7;
  1135. border-radius: 20rpx;
  1136. .checkIcon {
  1137. width: 25rpx;
  1138. height: 25rpx;
  1139. margin-right: 10rpx;
  1140. }
  1141. .checkStatusText {
  1142. font-size: 20rpx;
  1143. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  1144. font-weight: 400;
  1145. color: #292C33;
  1146. }
  1147. }
  1148. image {
  1149. margin-right: 15rpx;
  1150. width: 40rpx;
  1151. height: 40rpx;
  1152. }
  1153. }
  1154. }
  1155. .children {
  1156. display: flex;
  1157. flex-direction: row;
  1158. align-items: center;
  1159. margin-top: 18.75rpx;
  1160. .child {
  1161. display: flex;
  1162. flex-direction: column;
  1163. justify-content: center;
  1164. align-items: center;
  1165. flex: 1;
  1166. border-right: 1px solid #DADEE6;
  1167. text {
  1168. width: 150rpx;
  1169. font-weight: 500;
  1170. text-align: center;
  1171. overflow: hidden;
  1172. text-overflow: ellipsis;
  1173. white-space: nowrap;
  1174. &:last-child {
  1175. font-size: 17.5rpx;
  1176. line-height: 26.25rpx;
  1177. color: #7A8599;
  1178. text-align: center;
  1179. font-weight: 400;
  1180. }
  1181. }
  1182. &:last-child {
  1183. border-right: 0;
  1184. }
  1185. }
  1186. }
  1187. }
  1188. }
  1189. }
  1190. </style>