StepsMyBox.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  1. <template>
  2. <!-- 全流程管理组件 -->
  3. <div class="StepsMyBox">
  4. <div style="padding: 10px">
  5. <el-button type="primary" icon="el-icon-arrow-left" @click="backEvent()">返回上级</el-button>
  6. </div>
  7. <!-- 全流程管理主题 -->
  8. <div class="StepsMyBox_main">
  9. <!-- 左侧项目明细 -->
  10. <div class="StepsMyBox_main_left">
  11. <div class="StepsMyBox_main_left_main">
  12. <div class="StepsMyBox_main_left_main_title">{{ clickData.c_project_name ? clickData.c_project_name : "--" }}</div>
  13. <div class="StepsMyBox_main_left_main_info">基本信息</div>
  14. <div class="StepsMyBox_main_left_main_info">
  15. <div>创建日期:</div>
  16. <div>{{ clickData.c_create_date ? $dayjs(clickData.c_create_date).format("YYYY-MM-DD") : "--" }}</div>
  17. </div>
  18. <div class="StepsMyBox_main_left_main_info">
  19. <div>项目类型:</div>
  20. <div>{{ clickData.c_task_type_str ? clickData.c_task_type_str : "" }}</div>
  21. </div>
  22. <div class="StepsMyBox_main_left_main_info">
  23. <div>涉及街镇:</div>
  24. <div>{{ clickData.c_owning_street_town_str ? clickData.c_owning_street_town_str : "" }}</div>
  25. </div>
  26. <div class="StepsMyBox_main_left_main_info">
  27. <div>参与人员:</div>
  28. <div>{{ countUser }}个</div>
  29. </div>
  30. <div class="StepsMyBox_main_left_main_info">
  31. <div>追踪问题:</div>
  32. <div>5个</div>
  33. </div>
  34. </div>
  35. </div>
  36. <!-- 右侧流程明细 -->
  37. <div class="StepsMyBox_main_right">
  38. <div>
  39. <el-steps :active="stepsIndex" style="margin: 40px 40px 40px 80px">
  40. <el-step v-for="(item, index) in stepsList" :key="index">
  41. <template slot="title">
  42. <div
  43. class="stepsTitle"
  44. :style="{ background: stepsIndex == index + 1 ? '#00aaff' : '' }"
  45. @click="changeStepsIndex(index + 1)"
  46. >
  47. {{ item.title }}
  48. </div>
  49. </template>
  50. </el-step>
  51. </el-steps>
  52. </div>
  53. <div class="stepsInfoBox">
  54. <!-- 流程明细文字描述 -->
  55. <div>{{ stepsList[stepsIndex - 1].info.text }}</div>
  56. <!-- 流程明细文件预览(通知和报告会用到文件预览) -->
  57. <FilePreView ref="filePreview" v-show="fileView" />
  58. <!-- 流程明细-实施列表 -->
  59. <div v-if="stepsList[stepsIndex - 1].info.infos">
  60. <div v-for="item in stepsList[stepsIndex - 1].info.infos" :key="item.id" style="padding-bottom: 1rem">
  61. <span>{{ item.title }}</span
  62. ><el-button size="mini" type="primary" class="infoBut" style="margin-left: 2rem" @click="getInfoById(item.id)"
  63. >查看详情</el-button
  64. >
  65. </div>
  66. </div>
  67. <!-- 流程明细-整改表格 -->
  68. <div v-if="stepsList[stepsIndex - 1].info.tableData">
  69. <div class="flexBox">
  70. <div v-for="(value, key) in stepsList[stepsIndex - 1].info.props" :key="key">
  71. <div class="tableTitle">{{ value }}</div>
  72. </div>
  73. </div>
  74. <div
  75. v-for="(item, index) in stepsList[stepsIndex - 1].info.tableData"
  76. :key="item.id"
  77. class="flexBox"
  78. style="padding: 0.5rem 0"
  79. >
  80. <div v-for="(value, key) in stepsList[stepsIndex - 1].info.props" :key="key">
  81. <span v-if="key != 'opt'">{{ stepsList[stepsIndex - 1].info.tableData[index][key] }}</span>
  82. <el-button
  83. v-else
  84. size="mini"
  85. type="primary"
  86. class="infoBut"
  87. @click="getInfoById(stepsList[stepsIndex - 1].info.tableData[index].id)"
  88. >
  89. 查看详情
  90. </el-button>
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. </div>
  96. </div>
  97. </div>
  98. </template>
  99. <script>
  100. /**
  101. * 头部菜单(全流程管理)组件
  102. * @author: LiuMengxiang
  103. * @Date: 2022年11月21-25日
  104. */
  105. import FilePreView from "./FilePreView.vue";
  106. export default {
  107. name: "StepsMyBox",
  108. components: { FilePreView },
  109. data() {
  110. return {
  111. // 当前或默认选中的步骤条下标加一
  112. stepsIndex: 1,
  113. // 是否显示在线文档预览
  114. fileView: false,
  115. // 该项目关联任务列表
  116. tableData: [],
  117. // 参与人员
  118. countUser: 0,
  119. // 步骤条列表
  120. stepsList: [
  121. { title: "立项", info: { text: "--" } },
  122. {
  123. title: "通知",
  124. info: { text: "2018年张江基本农田审计项目审计通知书.pdf", filePath: "./static/word/test.pdf" }
  125. },
  126. {
  127. title: "实施",
  128. info: {
  129. infos: [
  130. { title: "用户A 完成张江镇xxx片区的审计", id: "1" },
  131. { title: "用户B 完成张江镇xxx片区的审计", id: "2" },
  132. { title: "用户C 完成张江镇xxx片区的审计", id: "3" }
  133. ]
  134. }
  135. },
  136. {
  137. title: "报告",
  138. // info: { text: "2018年张江基本农田审计项目审计通知书.pdf", filePath: "/upload/20221128/20221128230553I6Nf00TN.docx" }
  139. info: { text: "2018年张江基本农田审计项目审计通知书.docx", filePath: "./static/word/test.docx" }
  140. },
  141. {
  142. title: "整改",
  143. info: {
  144. tableData: [
  145. {
  146. id: "1",
  147. desc: "xxxxx问题",
  148. status: "已完成",
  149. endTime: "2023-01-12"
  150. },
  151. {
  152. id: "2",
  153. desc: "xxxxx问题",
  154. status: "未开始",
  155. endTime: "2023-01-12"
  156. },
  157. {
  158. id: "3",
  159. desc: "xxxxx问题",
  160. status: "已完成",
  161. endTime: "2023-01-12"
  162. }
  163. ],
  164. props: { desc: "问题描述", status: "当前状态", endTime: "整改期限", opt: "操作" }
  165. }
  166. }
  167. ]
  168. };
  169. },
  170. props: ["clickData"],
  171. mounted() {},
  172. watch: {
  173. clickData: {
  174. handler(newValue, oldValue) {
  175. if (newValue != oldValue) {
  176. this.$nextTick(() => {
  177. // 获取项目基本信息
  178. this.stepsList[0].info.text =
  179. this.$dayjs(this.clickData.check_time).format("YYYY-MM-DD") +
  180. ": " +
  181. this.clickData.c_project_name +
  182. "(通过立项!)";
  183. // 获取项目关联任务信息
  184. this.getAllTasks();
  185. // 获取项目流程数据
  186. // console.log("全流程管理详情", newValue, oldValue);
  187. });
  188. }
  189. },
  190. deep: true,
  191. immediate: false
  192. }
  193. },
  194. methods: {
  195. // 流程管理【实施】节点,根据id查看详情
  196. getInfoById(id) {
  197. console.log("流程管理【实施】节点,根据id查看详情id:", id);
  198. },
  199. // 返回上级
  200. backEvent() {
  201. this.$emit("hideStepsMyBoxState");
  202. },
  203. // 切换步骤条
  204. changeStepsIndex(index) {
  205. this.stepsIndex = index;
  206. if (this.fileView) {
  207. this.$refs.filePreview.cancel();
  208. this.fileView = false;
  209. }
  210. // 判断流程明细是否存在文件,存在的话自动请求文件并渲染
  211. if (this.stepsList[this.stepsIndex - 1].info.filePath) {
  212. this.fileView = true;
  213. this.$refs.filePreview.showView(this.stepsList[this.stepsIndex - 1].info.filePath);
  214. }
  215. },
  216. // 查询事件
  217. getAllTasks() {
  218. let params = new FormData();
  219. this.countUser = 0;
  220. params.append("columnId", "61");
  221. params.append("states", "2,3");
  222. params.append("pageSize", 999);
  223. params.append("page", 0);
  224. let searchParam = [];
  225. if (this.clickData.id) {
  226. let param1 = {
  227. field: "c_associated_item_ids",
  228. searchType: "2",
  229. content: {
  230. value: this.clickData.id
  231. }
  232. };
  233. searchParam.push(param1);
  234. }
  235. params.append("search", JSON.stringify(searchParam));
  236. this.$Post(this.urlsCollection.selectContentList, params).then(
  237. res => {
  238. if (res.code === 200 && res.content.data.length > 0) {
  239. this.tableData = res.content.data;
  240. if (this.tableData.length > 0) {
  241. let usersList = [];
  242. this.tableData.forEach(item => {
  243. if (usersList.indexOf(item.author_id) < 0) {
  244. usersList.push(item.author_id);
  245. this.countUser++;
  246. }
  247. });
  248. }
  249. } else {
  250. this.tableData = [];
  251. this.countUser = 0;
  252. }
  253. },
  254. error => {
  255. this.tableData = [];
  256. this.countUser = 0;
  257. }
  258. );
  259. }
  260. }
  261. };
  262. </script>
  263. <style lang="less" scoped>
  264. .StepsMyBox {
  265. padding: 0;
  266. position: absolute;
  267. display: flex;
  268. background: #001220 !important;
  269. z-index: 999;
  270. width: 100%;
  271. height: 100%;
  272. -moz-user-select: none;
  273. -webkit-user-select: none;
  274. -ms-user-select: none;
  275. -khtml-user-select: none;
  276. user-select: none;
  277. overflow: hidden;
  278. flex-direction: column;
  279. &_main {
  280. padding: 10px;
  281. width: calc(100% - 20px);
  282. height: calc(100% - 20px);
  283. display: flex;
  284. justify-content: space-between;
  285. &_left {
  286. width: calc(25% - 5px);
  287. height: 100%;
  288. background: #00274d !important;
  289. &_main {
  290. margin: 20px 30px;
  291. display: flex;
  292. flex-direction: column;
  293. &_title {
  294. font-size: 20px;
  295. font-family: pingfangSC;
  296. font-weight: 400;
  297. color: #4dc3ff;
  298. line-height: 58px;
  299. }
  300. &_info {
  301. display: flex;
  302. padding: 10px 0;
  303. font-size: 18px;
  304. font-family: pingfangSC;
  305. font-weight: bold;
  306. color: #ffffff;
  307. line-height: 60px;
  308. div {
  309. font-size: 16px;
  310. font-family: pingfangSC;
  311. font-weight: 400;
  312. color: #ffffff;
  313. line-height: 50px;
  314. width: 50%;
  315. }
  316. }
  317. }
  318. }
  319. &_right {
  320. width: calc(75% - 5px);
  321. height: 100%;
  322. background: #00274d !important;
  323. .stepsTitle {
  324. margin-top: 10px;
  325. transform: translate(-30%, 0%);
  326. width: 2rem;
  327. cursor: pointer;
  328. padding: 0px 20px;
  329. border: 1px solid #00aaff;
  330. border-radius: 3px;
  331. color: #ffffff;
  332. font-weight: bold;
  333. }
  334. .stepsInfoBox {
  335. width: calc(100% - 80px);
  336. height: calc(100% - 200px);
  337. margin: 40px;
  338. margin-top: 0px;
  339. font-size: 18px;
  340. font-weight: bold;
  341. font-family: pingfangSC;
  342. line-height: 30px;
  343. color: #ffffff;
  344. .flexBox {
  345. display: flex;
  346. width: 100%;
  347. justify-content: space-evenly;
  348. align-items: center;
  349. align-content: space-around;
  350. flex-wrap: nowrap;
  351. flex-direction: row;
  352. .tableTitle {
  353. font-size: 20px;
  354. font-family: pingfangSC;
  355. font-weight: 400;
  356. color: #4dc3ff;
  357. padding-bottom: 0.5rem;
  358. }
  359. & > div {
  360. width: 100%;
  361. }
  362. }
  363. }
  364. }
  365. }
  366. }
  367. </style>