detail.vue 12 KB

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