WholeProcessManagement.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. <template>
  2. <!-- 全流程管理列表组件 -->
  3. <div id="WholeProcessManagement">
  4. <el-form :inline="true" ref="myTaskForm" :model="formInline" style="padding: 10px">
  5. <el-form-item label="项目类型">
  6. <el-select size="mini" v-model="formInline.c_task_type" placeholder="项目类型" clearable filterable>
  7. <el-option
  8. v-for="item in selectSelectDataMap['projectType']"
  9. :key="item.index"
  10. :label="item.name"
  11. :value="item.index"
  12. ></el-option>
  13. </el-select>
  14. </el-form-item>
  15. <el-form-item label="所属街镇">
  16. <el-select size="mini" v-model="formInline.c_owning_street_town" placeholder="所属街镇" clearable filterable>
  17. <el-option
  18. v-for="item in selectSelectDataMap['associatedItems']"
  19. :key="item.index"
  20. :label="item.name"
  21. :value="item.index"
  22. >
  23. </el-option>
  24. </el-select>
  25. </el-form-item>
  26. <el-form-item label="年份">
  27. <el-date-picker size="mini" v-model="formInline.c_create_date" value-format="yyyy" type="year" placeholder="选择年">
  28. </el-date-picker>
  29. </el-form-item>
  30. <el-form-item style="float: right">
  31. <el-button type="primary" @click="onSubmit">查询</el-button>
  32. <el-button @click="resetForm()">重置</el-button>
  33. </el-form-item>
  34. </el-form>
  35. <el-table
  36. v-loading="tableInitLoading"
  37. :data="tableData"
  38. style="width: calc(100% - 20px); padding: 0 10px"
  39. height="calc(80vh - 400px)"
  40. stripe
  41. :row-class-name="tableRowClassName"
  42. @row-click="rowClick"
  43. >
  44. <el-table-column type="index" width="50"> </el-table-column>
  45. <el-table-column prop="c_project_id" label="项目编号"> </el-table-column>
  46. <el-table-column prop="c_project_name" label="项目名称"> </el-table-column>
  47. <el-table-column prop="c_task_type_str" label="项目类型"> </el-table-column>
  48. <el-table-column prop="c_owning_street_town_str" label="所属街镇"> </el-table-column>
  49. <el-table-column prop="c_create_date" label="创建时间">
  50. <template slot-scope="scope">
  51. {{ $dayjs(scope.row.c_create_date).format("YYYY-MM-DD HH:mm:ss") }}
  52. </template>
  53. </el-table-column>
  54. <el-table-column prop="c_year" label="年份"> </el-table-column>
  55. </el-table>
  56. <div id="WholeProcessManagement-footer">
  57. <Pagination :paginationData="paginationData" />
  58. </div>
  59. <!-- 全流程管理流程组件 -->
  60. <StepsMyBox
  61. id="stepsBox"
  62. :clickData="clickData"
  63. v-show="StepsMyBoxShowState"
  64. @hideStepsMyBoxState="StepsMyBoxShowState = false"
  65. />
  66. </div>
  67. </template>
  68. <script>
  69. /**
  70. * 头部菜单(全流程管理列表)组件
  71. * @author: LiuMengxiang
  72. * @Date: 2022年11月21-25日
  73. */
  74. import StepsMyBox from "./StepsMyBox.vue";
  75. import Pagination from "@/components/common/Pagination.vue";
  76. export default {
  77. name: "WholeProcessManagement",
  78. components: { StepsMyBox, Pagination },
  79. data() {
  80. return {
  81. tableInitLoading: true,
  82. // 数据字典暂存对象
  83. selectSelectDataMap: {
  84. projectType: [],
  85. associatedItems: []
  86. },
  87. StepsMyBoxShowState: false,
  88. // 查询条件
  89. formInline: {
  90. c_task_type: "",
  91. c_owning_street_town: "",
  92. c_create_date: ""
  93. },
  94. // 我的任务form表单
  95. tableData: [],
  96. paginationData: {
  97. pageSize: 10,
  98. currentPage: 1,
  99. pageSizes: [10, 20, 50],
  100. total: 0,
  101. currentChange: val => {
  102. this.handleCurrentChange(val);
  103. },
  104. handleSizeChange: val => {
  105. this.handleSizeChange(val);
  106. }
  107. },
  108. clickData: {}
  109. };
  110. },
  111. props: {},
  112. mounted() {
  113. // 首先获取数据字典中的下拉框数据
  114. this.selectSelectData("0", "c_task_type", "projectType");
  115. this.selectSelectData("0", "浦东新区行政区划", "associatedItems");
  116. this.onSubmit();
  117. },
  118. watch: {},
  119. methods: {
  120. // 数据字典查询
  121. selectSelectData(type, cName, keyName) {
  122. let params = new FormData();
  123. params.append("type", type);
  124. params.append("cName", cName);
  125. this.$Post(this.urlsCollection.selectByCNameAType, params).then(
  126. res => {
  127. if (res.code === 200 && res.content.length > 0) {
  128. this.selectSelectDataMap[keyName] = res.content;
  129. }
  130. },
  131. error => {
  132. this.$message.error(error);
  133. console.log(error);
  134. }
  135. );
  136. },
  137. // 数据字典对照显示
  138. getSelectByIndex(selectName, index) {
  139. let slotValue = "";
  140. if (this.selectSelectDataMap[selectName] && this.selectSelectDataMap[selectName].length > 0) {
  141. this.selectSelectDataMap[selectName].forEach(item => {
  142. if (item.index == index) {
  143. slotValue = item.name;
  144. }
  145. });
  146. }
  147. return slotValue;
  148. },
  149. // 切换条数
  150. handleSizeChange(val) {
  151. this.paginationData.pageSize = val;
  152. this.onSubmit();
  153. },
  154. // 切换页
  155. handleCurrentChange(val) {
  156. this.paginationData.currentPage = val;
  157. this.onSubmit();
  158. },
  159. // 查询事件
  160. onSubmit() {
  161. if (!this.tableInitLoading) {
  162. this.tableInitLoading = true;
  163. }
  164. let params = new FormData();
  165. params.append("columnId", "60");
  166. params.append("states", "2,3");
  167. params.append("pageSize", this.paginationData.pageSize);
  168. params.append("page", this.paginationData.currentPage - 1);
  169. let searchParam = [];
  170. if (this.formInline.c_task_type) {
  171. let param1 = {
  172. field: "c_task_type",
  173. searchType: "1",
  174. content: {
  175. value: this.formInline.c_task_type
  176. }
  177. };
  178. searchParam.push(param1);
  179. }
  180. if (this.formInline.c_owning_street_town) {
  181. let param1 = {
  182. field: "c_owning_street_town",
  183. searchType: "1",
  184. content: {
  185. value: this.formInline.c_owning_street_town
  186. }
  187. };
  188. searchParam.push(param1);
  189. }
  190. if (this.formInline.c_create_date) {
  191. let param1 = {
  192. field: "c_year",
  193. searchType: "1",
  194. content: {
  195. value: this.formInline.c_create_date - 0
  196. }
  197. };
  198. searchParam.push(param1);
  199. }
  200. params.append("search", JSON.stringify(searchParam));
  201. let sortparam = [{ field: "c_create_date", orderByType: 2 }];
  202. params.append("orderBy", JSON.stringify(sortparam));
  203. this.$Post(this.urlsCollection.selectContentList, params).then(
  204. res => {
  205. if (res.code === 200 && res.content.data.length > 0) {
  206. this.tableData = res.content.data;
  207. if (this.tableData.length > 0) {
  208. this.tableData.forEach(item => {
  209. item.c_task_type_str = this.getSelectByIndex("projectType", item.c_task_type);
  210. item.c_owning_street_town_str = this.getSelectByIndex("associatedItems", item.c_owning_street_town);
  211. });
  212. }
  213. this.tableInitLoading = false;
  214. this.paginationData.total = res.content.count;
  215. } else {
  216. this.tableData = [];
  217. this.tableInitLoading = false;
  218. this.$message.error(res.message);
  219. }
  220. },
  221. error => {
  222. this.tableData = [];
  223. this.tableInitLoading = false;
  224. this.$message.error(error);
  225. }
  226. );
  227. },
  228. // 查询条件重置
  229. resetForm() {
  230. this.formInline = {
  231. c_task_type: "",
  232. c_owning_street_town: "",
  233. c_create_date: ""
  234. };
  235. this.onSubmit();
  236. },
  237. // 给每一行row的数据对象里添加index属性
  238. tableRowClassName({ row, rowIndex }) {
  239. row.index = rowIndex;
  240. },
  241. // 用户单击某行时触发操作
  242. rowClick(row, column, event) {
  243. // console.log(row,column,event);
  244. this.ToView(row.index);
  245. },
  246. // 查看
  247. ToView(index) {
  248. this.StepsMyBoxShowState = true;
  249. this.clickData = this.tableData[index];
  250. }
  251. }
  252. };
  253. </script>
  254. <style lang="less" scoped>
  255. #WholeProcessManagement {
  256. position: absolute;
  257. display: flex;
  258. background: #00274d;
  259. z-index: 999;
  260. margin-top: 60px;
  261. width: 100%;
  262. height: calc(100% - 60px);
  263. -moz-user-select: none;
  264. -webkit-user-select: none;
  265. -ms-user-select: none;
  266. -khtml-user-select: none;
  267. user-select: none;
  268. overflow: hidden;
  269. flex-direction: column;
  270. &-footer {
  271. width: 99%;
  272. margin: 0 auto;
  273. height: 10%;
  274. position: absolute;
  275. bottom: 10px;
  276. display: flex;
  277. align-items: center;
  278. justify-content: flex-end;
  279. }
  280. }
  281. </style>