checkMainPoints.vue 38 KB

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