hisAgenda.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
  4. <el-form-item label="回顾/截止日期" prop="deadlineTime">
  5. <el-date-picker clearable size="small" style="width: 200px"
  6. v-model="queryParams.deadlineTime"
  7. type="date"
  8. value-format="yyyy-MM-dd"
  9. placeholder="请选择回顾/截止日期" @change="handleQuery">
  10. </el-date-picker>
  11. </el-form-item>
  12. <el-form-item label="类型" prop="workType" label-width="50px">
  13. <el-select v-model="queryParams.workType" placeholder="请选择类型" clearable size="small"
  14. style="width: 100%;" @change="handleQuery">
  15. <el-option
  16. v-for="dict in workTypeOptions"
  17. :key="dict.dictValue"
  18. :label="dict.dictLabel"
  19. :value="dict.dictValue"
  20. />
  21. </el-select>
  22. </el-form-item>
  23. <el-form-item label="状态" prop="status" label-width="50px">
  24. <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small"
  25. style="width: 100%;" @change="handleQuery">
  26. <el-option
  27. v-for="dict in agendaStatusOptions"
  28. :key="dict.dictValue"
  29. :label="dict.dictLabel"
  30. :value="dict.dictValue"
  31. />
  32. </el-select>
  33. </el-form-item>
  34. <el-form-item label="跟踪人" prop="responsible" label-width="70px">
  35. <el-input v-model="queryParams.responsible" placeholder="请输入跟踪人"/>
  36. </el-form-item>
  37. <el-form-item>
  38. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  39. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  40. </el-form-item>
  41. </el-form>
  42. <el-row :gutter="10" class="mb8">
  43. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  44. </el-row>
  45. <el-table :data="agendaList" :height="clientHeight" border>
  46. <el-table-column label="主题" align="center" prop="subject"/>
  47. <el-table-column label="会议编号" align="center" prop="meetingNo"/>
  48. <el-table-column label="会议时间" align="center" prop="meetingDate">
  49. <template slot-scope="scope">
  50. <span>{{ parseTime(scope.row.meetingDate, '{y}-{m}-{d}') }}</span>
  51. </template>
  52. </el-table-column>
  53. <el-table-column label="内容" align="center" prop="agendaContent">
  54. <template slot-scope="scope">
  55. <el-input type="textarea" v-model="scope.row.agendaContent" placeholder="请输入行动项内容"
  56. v-if="scope.row.isEdit&&scope.row.workType==='P'"/>
  57. <span v-else>{{ scope.row.agendaContent }}</span>
  58. </template>
  59. </el-table-column>
  60. <el-table-column label="类型" align="center" prop="workType"/>
  61. <el-table-column label="跟踪人" align="center" prop="responsible"/>
  62. <el-table-column label="回顾/截止时间" align="center" prop="deadlineTime" width="180">
  63. <template slot-scope="scope">
  64. <span>{{ parseTime(scope.row.deadlineTime, '{y}-{m}-{d}') }}</span>
  65. </template>
  66. </el-table-column>
  67. <el-table-column label="状态" align="center" prop="status">
  68. <template slot-scope="scope">
  69. <el-select v-if="scope.row.isEdit" v-model="scope.row.status" placeholder="请选择状态"
  70. clearable
  71. size="small" style="width: 100%;">
  72. <el-option
  73. v-for="dict in agendaStatusOptions"
  74. :key="dict.dictValue"
  75. :label="dict.dictLabel"
  76. :value="dict.dictValue"
  77. />
  78. </el-select>
  79. <span v-else>{{ scope.row.status }}</span>
  80. </template>
  81. </el-table-column>
  82. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  83. <template slot-scope="scope">
  84. <el-button
  85. v-if="!scope.row.isEdit&&scope.row.workType!=='I'"
  86. size="mini"
  87. type="text"
  88. icon="el-icon-edit"
  89. @click="handleUpdateRecord(scope.row)"
  90. v-hasPermi="['plant:agenda:edit']"
  91. >修改
  92. </el-button>
  93. <el-button v-if="scope.row.isEdit"
  94. size="mini"
  95. type="text"
  96. icon="el-icon-check"
  97. @click="save(scope.row)"
  98. >保存
  99. </el-button>
  100. <el-button v-if="scope.row.isEdit"
  101. size="mini"
  102. type="text"
  103. icon="el-icon-close"
  104. @click="cancelRecord(scope.row,scope.$index)"
  105. >取消
  106. </el-button>
  107. </template>
  108. </el-table-column>
  109. </el-table>
  110. <pagination
  111. v-show="total>0"
  112. :total="total"
  113. :page.sync="queryParams.pageNum"
  114. :limit.sync="queryParams.pageSize"
  115. @pagination="getList"
  116. />
  117. </div>
  118. </template>
  119. <script>
  120. import {listAgenda2, updateAgenda} from "@/api/plant/agenda";
  121. export default {
  122. name: "hisAgenda",
  123. data() {
  124. return {
  125. // 页面高度
  126. clientHeight: 300,
  127. // 遮罩层
  128. loading: true,
  129. // 选中数组
  130. ids: [],
  131. // 非单个禁用
  132. single: true,
  133. // 非多个禁用
  134. multiple: true,
  135. // 显示搜索条件
  136. showSearch: false,
  137. // 总条数
  138. total: 0,
  139. // 装置会议议程表格数据
  140. agendaList: [],
  141. // 弹出层标题
  142. title: "",
  143. // 是否显示弹出层
  144. open: false,
  145. // 查询参数
  146. queryParams: {
  147. pageNum: 1,
  148. pageSize: 10,
  149. meetingId: null,
  150. agendaType: null,
  151. agendaContent: null,
  152. workType: null,
  153. planType: null,
  154. responsible: null,
  155. status: null,
  156. createrCode: null,
  157. createdate: null,
  158. updaterCode: null,
  159. updatedate: null,
  160. deptId: null,
  161. remarks: null,
  162. presided: null,
  163. isHis: 1,
  164. },
  165. // 表单参数
  166. form: {},
  167. // 表单校验
  168. rules: {
  169. agendaContent: [
  170. {required: true, message: '议程内容不能为空', trigger: "blur"}
  171. ],
  172. },
  173. workTypeOptions: [],
  174. agendaStatusOptions: [],
  175. };
  176. },
  177. created() {
  178. this.getList();
  179. //设置表格高度对应屏幕高度
  180. this.$nextTick(() => {
  181. this.clientHeight = (document.body.clientHeight - 130) * 0.8
  182. });
  183. this.getDicts("agenda_type").then(res => {
  184. this.workTypeOptions = res.data;
  185. });
  186. this.getDicts("agenda_status").then(res => {
  187. this.agendaStatusOptions = res.data;
  188. });
  189. },
  190. methods: {
  191. save(row) {
  192. let data = {
  193. id: row.id,
  194. status: row.status
  195. }
  196. updateAgenda(data).then(res => {
  197. this.$modal.msgSuccess("修改成功");
  198. row.isEdit = false;
  199. this.getList();
  200. })
  201. },
  202. handleUpdateRecord(row) {
  203. // 备份原始数据
  204. row['oldRow'] = JSON.parse(JSON.stringify(row));
  205. this.$nextTick(() => {
  206. row.isEdit = true;
  207. })
  208. },
  209. cancelRecord(row, index) {
  210. // 如果是新增的数据
  211. if (row.isAdd) {
  212. this.record.dataList.splice(index, 1)
  213. } else {
  214. // 不是新增的数据 还原数据
  215. for (const i in row.oldRow) {
  216. row[i] = row.oldRow[i]
  217. }
  218. row.isEdit = false
  219. }
  220. },
  221. /** 查询装置会议议程列表 */
  222. getList() {
  223. this.loading = true;
  224. listAgenda2(this.queryParams).then(response => {
  225. this.total = response.total;
  226. this.loading = false;
  227. response.rows.forEach(item => {
  228. item["isEdit"] = false;
  229. })
  230. this.agendaList = response.rows;
  231. });
  232. }, /** 搜索按钮操作 */
  233. handleQuery() {
  234. console.log(this.queryParams)
  235. this.$emit('queryParams', this.queryParams)
  236. this.queryParams.pageNum = 1;
  237. this.getList();
  238. },
  239. /** 重置按钮操作 */
  240. resetQuery() {
  241. this.resetForm("queryForm");
  242. this.handleQuery();
  243. },
  244. }
  245. }
  246. </script>
  247. <style scoped>
  248. </style>