WholeProcessManagement.vue 8.7 KB

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