detail.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383
  1. <template>
  2. <div class="question-edit">
  3. <nav-bar></nav-bar>
  4. <div class="page-container">
  5. <!-- 基本信息 -->
  6. <div class="card" v-if="taskInfo">
  7. <van-panel :title="taskInfo.srcTaskName">
  8. <div class="panel-box">
  9. <!-- <div class="panel-box-item">-->
  10. <!-- <van-row>-->
  11. <!-- <van-col span="8">-->
  12. <!-- <span class="item-label">隐患所在机构:</span>-->
  13. <!-- </van-col>-->
  14. <!-- <van-col span="14">-->
  15. <!-- <span class="item-value">{{taskInfo.orgName}}</span>-->
  16. <!-- </van-col>-->
  17. <!-- </van-row>-->
  18. <!-- </div>-->
  19. <van-cell title="隐患所在机构" :label="taskInfo.orgName" />
  20. <van-cell title="检查项" :label="taskInfo.checkItem" />
  21. <van-cell title="检查内容" :label="taskInfo.checkContent" />
  22. <van-cell title="隐患描述" :label="taskInfo.questionDesc" />
  23. <van-cell title="发现日期" :label="taskInfo.submitTime" />
  24. <van-cell title="提出人" :label="taskInfo.submitorName" />
  25. <van-cell title="整改期限" :label="formatDate(taskInfo.reformDeadline,'YYYY-MM-DD')" />
  26. <van-cell title="隐患图片" :border="false" >
  27. <div v-if="v.img" class="nfc-img" v-for="(v,i) in taskInfo.images" :key="v.img" @click="preViewNFC(i)">
  28. <img :src="imgUrl(v.img)" alt="" >
  29. <span>{{v.checkName}}</span>
  30. </div>
  31. </van-cell>
  32. </div>
  33. </van-panel>
  34. </div>
  35. <div class="card" v-if="taskInfo.confirm" >
  36. <van-panel title="处理">
  37. <div class="panel-box">
  38. <van-cell title="处理意见" :label="taskInfo.confirm.executeStatus === 0 ? '确认' : '提出异议'"></van-cell>
  39. <van-cell v-show="taskInfo.confirm.executeStatus===1" title="异议内容" :label="taskInfo.confirm.description"></van-cell>
  40. <van-cell title="异议人" :label="taskInfo.confirm.executorName"></van-cell>
  41. </div>
  42. </van-panel>
  43. </div>
  44. <div class="card" v-if="taskInfo.confirmDissent" >
  45. <van-panel title="审批">
  46. <div class="panel-box">
  47. <van-cell title="审核结果" :label="taskInfo.confirmDissent.executeStatus === 0 ? '同意' : '不同意'"></van-cell>
  48. <!-- <van-cell title="审核人" :label="taskInfo.confirmDissent.executorName"></van-cell>-->
  49. <van-cell v-show="taskInfo.confirmDissent.executeStatus===1" title="原因" :label="taskInfo.confirmDissent.description"></van-cell>
  50. </div>
  51. </van-panel>
  52. </div>
  53. <div class="card" v-if="taskInfo.reform" >
  54. <van-panel title="整改">
  55. <div class="panel-box">
  56. <van-cell title="整改日期" :label="formatDate(taskInfo.reform.executeTime,'YYYY-MM-DD')"></van-cell>
  57. <!-- <van-cell title="审核结果" :label="taskInfo.reform.executeStatus === 0 ? '已整改' : '未整改'"></van-cell>-->
  58. <van-cell title="整改描述" :label="taskInfo.reform.description"></van-cell>
  59. <div class="upload-box" v-if="taskInfo.reform.images.length > 0">
  60. <van-cell>
  61. <div class="nfc-img van-hairline--surround" v-for="(v,i) in taskInfo.reform.images" :key="v" @click="clickImage(taskInfo.reform.images,i)">
  62. <img :src="imgUrl(v)" alt="" >
  63. </div>
  64. </van-cell>
  65. </div>
  66. </div>
  67. </van-panel>
  68. </div>
  69. <div class="card" v-if="type === 'confirm'">
  70. <van-panel title="确认">
  71. <div class="panel-box">
  72. <van-radio-group v-model="confirmData.status" required>
  73. <van-cell-group>
  74. <van-cell title="确认情况" clickable>
  75. <template #right-icon>
  76. <van-radio :name="0" />
  77. </template>
  78. </van-cell>
  79. <van-cell title="提出异议" clickable>
  80. <template #right-icon>
  81. <van-radio :name="1" />
  82. </template>
  83. </van-cell>
  84. </van-cell-group>
  85. </van-radio-group>
  86. <van-field
  87. v-show="confirmData.status"
  88. v-model="confirmData.description"
  89. rows="1"
  90. autosize
  91. label="异议内容"
  92. type="textarea"
  93. placeholder="请输入"/>
  94. <div class="big-btn-box" v-if="taskInfo.orgId == orgId && taskInfo.confirmStatus==0">
  95. <van-button type="info" size="large" @click="onSubmit('确认')">提交</van-button>
  96. </div>
  97. </div>
  98. </van-panel>
  99. </div>
  100. <div class="card" v-if="type === 'confirmDissent'">
  101. <van-panel title="审批">
  102. <div class="panel-box">
  103. <van-radio-group v-model="confirmDissentData.status" required>
  104. <van-cell-group>
  105. <van-cell title="同意" clickable>
  106. <template #right-icon>
  107. <van-radio :name="0" />
  108. </template>
  109. </van-cell>
  110. <van-cell title="不同意" clickable>
  111. <template #right-icon>
  112. <van-radio :name="1" />
  113. </template>
  114. </van-cell>
  115. </van-cell-group>
  116. </van-radio-group>
  117. <van-field
  118. v-show="confirmDissentData.status"
  119. v-model="confirmDissentData.description"
  120. rows="1"
  121. autosize
  122. label="原因"
  123. type="textarea"
  124. placeholder="请输入"/>
  125. <div class="big-btn-box" v-if="taskInfo.submitorId == id && taskInfo.confirmStatus==1">
  126. <van-button type="info" size="large" @click="onSubmit('审核')">提交</van-button>
  127. </div>
  128. </div>
  129. </van-panel>
  130. </div>
  131. <div class="card" v-if="type === 'reform'">
  132. <van-panel title="整改">
  133. <div class="panel-box">
  134. <date-cell required title="整改日期" v-model="reformData.reformDate" dateType="date" />
  135. <van-field
  136. required
  137. v-model="reformData.description"
  138. rows="1"
  139. autosize
  140. label="整改描述:"
  141. type="textarea"
  142. placeholder="请输入"/>
  143. <div class="upload-box" >
  144. <uploader :maxCount="5" v-model="reformData.images"/>
  145. </div>
  146. <div class="big-btn-box" v-if="taskInfo.orgId==orgId && taskInfo.confirmStatus==2 && taskInfo.reformStatus!=11">
  147. <van-button type="info" size="large" @click="onSubmit('整改')">提交</van-button>
  148. </div>
  149. </div>
  150. </van-panel>
  151. </div>
  152. </div>
  153. </div>
  154. </template>
  155. <script>
  156. import NavBar from '@/components/NavBar';
  157. import SelectCell from '@/components/selectCell';
  158. import DateCell from '@/components/dateCell';
  159. import Uploader from '@/components/upload/uploader';
  160. import {taskDetails,confirm, confirmDissent, reform,} from "./api";
  161. import {formatDate} from "@/filters/filter";
  162. import { ImagePreview } from 'vant';
  163. import {mapGetters} from "vuex";
  164. import {imgUrl} from "@/utils";
  165. export default {
  166. components:{NavBar,SelectCell,DateCell,Uploader},
  167. data(){
  168. return {
  169. //基本信息
  170. taskInfo:[],
  171. formData:{},
  172. //确认
  173. confirmData: {
  174. status: 0,
  175. description: null,
  176. },
  177. //审核
  178. confirmDissentData: {
  179. status: 0,
  180. description: null,
  181. },
  182. //整改
  183. reformData: {
  184. reformDate: null,
  185. description: null,
  186. images: null,
  187. },
  188. type:null,
  189. preViewImages:{},
  190. dicts:['resumption_status','rectification_deadline'],
  191. }
  192. },
  193. mounted() {
  194. console.log('系统信息:'+window.navigator.platform);
  195. this.getData();
  196. },
  197. computed:{
  198. ...mapGetters(['orgId','id','dictionary'])
  199. },
  200. methods:{
  201. formatDate,
  202. //图片预览
  203. clickImage(arr,i){
  204. this.preViewImages.images = arr.map(v=>imgUrl(v));
  205. this.preViewImages.startPosition = i;
  206. ImagePreview(this.preViewImages);
  207. },
  208. //提交
  209. onSubmit(type){
  210. let data,queryMethod;
  211. switch (type){
  212. case '确认':
  213. data = this.confirmData;
  214. queryMethod = confirm;
  215. break;
  216. case '审核':
  217. data = this.confirmDissentData;
  218. queryMethod = confirmDissent;
  219. break
  220. case '整改':
  221. data = this.reformData;
  222. queryMethod = reform;
  223. }
  224. if(type === '确认' || type === '审核'){
  225. if(!data && !data.description) {
  226. return this.$toast("请填写完整信息");
  227. }
  228. }else {
  229. if(!data.reformDate || !data.description){
  230. return this.$toast("请填写完整信息");
  231. }
  232. if(data.images){
  233. let img = data.images.map(v=>{return v.imgPath});
  234. data.images = img.toString();
  235. }
  236. }
  237. data.id = this.taskInfo.id;
  238. queryMethod(data).then((r) => {
  239. if (r.data) {
  240. this.$toast("提交成功");
  241. this.$emit("success");
  242. this.$router.go(-1);
  243. }
  244. });
  245. },
  246. //初始化数据
  247. getData() {
  248. let id = this.$route.query.id;
  249. this.type = this.$route.query.type;
  250. taskDetails(id).then(res=>{
  251. this.taskInfo = res.data;
  252. this.taskInfo.confirm = res.data.flows.find((d) => d.executeStep === 1);
  253. this.taskInfo.confirmDissent = res.data.flows.find((d) => d.executeStep === 2);
  254. this.taskInfo.reform = res.data.flows.find((d) => d.executeStep === 11);
  255. if(this.taskInfo.reform && this.taskInfo.reform.images) {
  256. this.taskInfo.reform.images=this.taskInfo.reform.images.split(",")
  257. }
  258. })
  259. },
  260. //返回
  261. goBack(){
  262. this.$router.go(-1);
  263. this.clearData();
  264. },
  265. //清空数据
  266. clearData(){
  267. this.areaList = [];
  268. this.taskInfo= [];
  269. this.selectArea = [];
  270. this.NFCList = [];
  271. this.checkList = [];
  272. this.checkItemList = [];
  273. this.NFCNum = 0;
  274. this.enable = false;
  275. },
  276. }
  277. }
  278. </script>
  279. <style lang="scss">
  280. //.question-edit{
  281. // .van-panel__header{
  282. // color:red
  283. // }
  284. //}
  285. </style>
  286. <style lang="scss" scoped>
  287. .question-edit{
  288. height: 100%;
  289. overflow: hidden;
  290. }
  291. .page-container{
  292. height: calc(100vh - 194px);
  293. overflow: auto;
  294. padding: 20px;
  295. }
  296. .flex-box{
  297. display: flex;
  298. justify-content: space-between;
  299. align-items: center;
  300. >span{
  301. margin: 0 20px;
  302. }
  303. }
  304. .card{
  305. margin-bottom: 20px;
  306. box-shadow: 0 10px 10px #eaeaea;
  307. }
  308. .card:last-child{
  309. margin-bottom: 0;
  310. }
  311. .panel-box{
  312. padding:0 20px;
  313. }
  314. .panel-box-item{
  315. height: 36px;
  316. line-height: 36px;
  317. }
  318. .item-label{
  319. width: 100%;
  320. display: flex;
  321. justify-content: right;
  322. align-items: center;
  323. }
  324. .item-value{
  325. width: 100%;
  326. display: flex;
  327. justify-content: left;
  328. align-items: center;
  329. }
  330. .upload-box{
  331. margin: 30px;
  332. }
  333. .nfc-img{
  334. display: inline-block;
  335. width: 140px;
  336. height: 140px;
  337. margin: 0 10px;
  338. position: relative;
  339. >img{
  340. width: 100%;
  341. height: 100%;
  342. border: none;
  343. }
  344. >span{
  345. position: absolute;
  346. padding: 0 10px;
  347. bottom: 0;
  348. left: 0;
  349. display: block;
  350. width: 100%;
  351. background-color: rgba(0,0,0,.2 );
  352. color: #eaeaea;
  353. font-size: 20px;
  354. overflow: hidden;
  355. text-overflow: ellipsis;
  356. white-space: nowrap;
  357. line-height: 30px;
  358. height: 30px;
  359. }
  360. }
  361. .big-btn-box{
  362. padding-bottom: 20px;
  363. }
  364. </style>