综合办公系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item label="项目编号" prop="projectId">
  5. <el-select v-model="queryParams.projectId" clearable filterable remote reserve-keyword placeholder="请输入项目编号"
  6. :remote-method="remoteMethod" :loading="loading" style="width: 400px;">
  7. <el-option v-for="project in projectList" :key="project.projectId"
  8. :label="project.projectNumber + '-' + project.projectName" :value="project.projectId">
  9. </el-option>
  10. </el-select>
  11. </el-form-item>
  12. <el-form-item label="上报人" prop="reporter">
  13. <el-select v-model="queryParams.reporter" filterable clearable @change="handleQuery">
  14. <el-option v-for="item in $store.state.user.userList" :key="item.userId" :label="item.nickName"
  15. :value="item.userId">
  16. </el-option>
  17. </el-select>
  18. </el-form-item>
  19. <el-form-item label="上报日期" prop="reportTime">
  20. <el-date-picker clearable v-model="queryParams.reportTime" type="date" value-format="yyyy-MM-dd"
  21. placeholder="请选择上报日期">
  22. </el-date-picker>
  23. </el-form-item>
  24. <el-form-item>
  25. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  26. </el-form-item>
  27. </el-form>
  28. <el-row :gutter="10" class="mb8">
  29. <!-- <el-col :span="1.5">
  30. <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
  31. v-hasPermi="['oa:settle:add']">新增</el-button>
  32. </el-col>
  33. <el-col :span="1.5">
  34. <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
  35. v-hasPermi="['oa:settle:edit']">修改</el-button>
  36. </el-col>
  37. <el-col :span="1.5">
  38. <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
  39. v-hasPermi="['oa:settle:remove']">删除</el-button>
  40. </el-col> -->
  41. <el-col :span="1.5">
  42. <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
  43. v-hasPermi="['oa:settle:export']">导出</el-button>
  44. </el-col>
  45. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  46. </el-row>
  47. <el-table v-loading="loading" :data="settleList" @selection-change="handleSelectionChange">
  48. <el-table-column type="index" label="序号" width="55" align="center" />
  49. <el-table-column label="项目编号" align="center" prop="project.projectNumber" />
  50. <el-table-column label="项目名称" align="center" prop="project.projectName" />
  51. <el-table-column label="上报人" align="center" prop="reporter">
  52. <template slot-scope="scope">
  53. {{ getUserName(scope.row.reporter) }}
  54. </template>
  55. </el-table-column>
  56. <el-table-column label="上报日期" align="center" prop="reportTime" width="180">
  57. <template slot-scope="scope">
  58. <span>{{ parseTime(scope.row.reportTime, '{y}-{m}-{d}') }}</span>
  59. </template>
  60. </el-table-column>
  61. <!-- <el-table-column label="工作量上报说明" align="center" prop="workloadReport" /> -->
  62. <el-table-column label="结算说明" align="center" prop="settleComment" />
  63. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  64. <template slot-scope="scope">
  65. <el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)"
  66. v-hasPermi="['oa:settle:query']">查看</el-button>
  67. <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
  68. v-hasPermi="['oa:settle:edit']">修改</el-button>
  69. <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
  70. v-hasPermi="['oa:settle:remove']">删除</el-button>
  71. </template>
  72. </el-table-column>
  73. </el-table>
  74. <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
  75. @pagination="getList" />
  76. <!-- 添加或修改cmc结算审批对话框 -->
  77. <el-dialog :title="title" :visible.sync="open" width="65%" append-to-body>
  78. <settle-form :taskForm="taskForm" :taskName="''" :flowDisabled="false" :disabled="true"></settle-form>
  79. </el-dialog>
  80. </div>
  81. </template>
  82. <script>
  83. import { listSettle, getSettle, delSettle, addSettle, updateSettle } from "@/api/oa/settle/settle";
  84. import { listProject } from '@/api/oa/project/project';
  85. import settleForm from '../../flowable/form/settleForm.vue';
  86. export default {
  87. components: { settleForm },
  88. name: "Settle",
  89. data() {
  90. return {
  91. // 遮罩层
  92. loading: true,
  93. // 选中数组
  94. ids: [],
  95. // 非单个禁用
  96. single: true,
  97. // 非多个禁用
  98. multiple: true,
  99. // 显示搜索条件
  100. showSearch: true,
  101. // 总条数
  102. total: 0,
  103. // cmc结算审批表格数据
  104. settleList: [],
  105. // 弹出层标题
  106. title: "",
  107. // 是否显示弹出层
  108. open: false,
  109. // 查询参数
  110. queryParams: {
  111. pageNum: 1,
  112. pageSize: 10,
  113. projectId: null,
  114. workloadReport: null,
  115. reporter: null,
  116. reportTime: null,
  117. settleComment: null,
  118. zhUserId: null,
  119. zhTime: null,
  120. zhComment: null,
  121. jsUserId: null,
  122. jsTime: null,
  123. jsComment: null,
  124. xmUserId: null,
  125. xmTime: null,
  126. xmComment: null,
  127. deptUserId: null,
  128. deptTime: null,
  129. deptComment: null,
  130. jyUserId: null,
  131. jyTime: null,
  132. jyComment: null,
  133. managerUserId: null,
  134. managerTime: null,
  135. managerComment: null,
  136. gmUserId: null,
  137. gmTime: null,
  138. gmComment: null
  139. },
  140. // 表单参数
  141. form: {},
  142. // 表单校验
  143. rules: {
  144. },
  145. projectList: [],
  146. taskForm: {
  147. formId: ''
  148. }
  149. };
  150. },
  151. created() {
  152. this.getList();
  153. },
  154. methods: {
  155. /** 查询cmc结算审批列表 */
  156. getList() {
  157. this.loading = true;
  158. listSettle(this.queryParams).then(response => {
  159. this.settleList = response.rows;
  160. this.total = response.total;
  161. this.loading = false;
  162. });
  163. },
  164. remoteMethod(val) {
  165. listProject({
  166. pageNum: 1,
  167. pageSize: 20,
  168. projectNumber: val
  169. }).then(res => {
  170. this.projectList = res.rows;
  171. })
  172. },
  173. // 取消按钮
  174. cancel() {
  175. this.open = false;
  176. this.reset();
  177. },
  178. // 表单重置
  179. reset() {
  180. this.form = {
  181. settleId: null,
  182. projectId: null,
  183. workloadReport: null,
  184. reporter: null,
  185. reportTime: null,
  186. settleComment: null,
  187. zhUserId: null,
  188. zhTime: null,
  189. zhComment: null,
  190. jsUserId: null,
  191. jsTime: null,
  192. jsComment: null,
  193. xmUserId: null,
  194. xmTime: null,
  195. xmComment: null,
  196. deptUserId: null,
  197. deptTime: null,
  198. deptComment: null,
  199. jyUserId: null,
  200. jyTime: null,
  201. jyComment: null,
  202. managerUserId: null,
  203. managerTime: null,
  204. managerComment: null,
  205. gmUserId: null,
  206. gmTime: null,
  207. gmComment: null
  208. };
  209. this.resetForm("form");
  210. },
  211. /** 搜索按钮操作 */
  212. handleQuery() {
  213. this.queryParams.pageNum = 1;
  214. this.getList();
  215. },
  216. /** 重置按钮操作 */
  217. resetQuery() {
  218. this.resetForm("queryForm");
  219. this.handleQuery();
  220. },
  221. // 多选框选中数据
  222. handleSelectionChange(selection) {
  223. this.ids = selection.map(item => item.settleId)
  224. this.single = selection.length !== 1
  225. this.multiple = !selection.length
  226. },
  227. /** 新增按钮操作 */
  228. handleAdd() {
  229. this.reset();
  230. this.open = true;
  231. this.title = "添加cmc结算审批";
  232. },
  233. // 查看详情
  234. handleView(row) {
  235. this.open = true;
  236. this.taskForm.formId = row.settleId;
  237. },
  238. /** 修改按钮操作 */
  239. handleUpdate(row) {
  240. this.reset();
  241. const settleId = row.settleId || this.ids
  242. getSettle(settleId).then(response => {
  243. this.form = response.data;
  244. this.open = true;
  245. this.title = "修改cmc结算审批";
  246. });
  247. },
  248. /** 提交按钮 */
  249. submitForm() {
  250. this.$refs["form"].validate(valid => {
  251. if (valid) {
  252. if (this.form.settleId != null) {
  253. updateSettle(this.form).then(response => {
  254. this.$modal.msgSuccess("修改成功");
  255. this.open = false;
  256. this.getList();
  257. });
  258. } else {
  259. addSettle(this.form).then(response => {
  260. this.$modal.msgSuccess("新增成功");
  261. this.open = false;
  262. this.getList();
  263. });
  264. }
  265. }
  266. });
  267. },
  268. /** 删除按钮操作 */
  269. handleDelete(row) {
  270. const settleIds = row.settleId || this.ids;
  271. this.$modal.confirm('是否确认删除cmc结算审批编号为"' + settleIds + '"的数据项?').then(function () {
  272. return delSettle(settleIds);
  273. }).then(() => {
  274. this.getList();
  275. this.$modal.msgSuccess("删除成功");
  276. }).catch(() => { });
  277. },
  278. /** 导出按钮操作 */
  279. handleExport() {
  280. this.download('oa/settle/export', {
  281. ...this.queryParams
  282. }, `settle_${new Date().getTime()}.xlsx`)
  283. }
  284. }
  285. };
  286. </script>