index.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. <template>
  2. <div class="app-container">
  3. <el-form
  4. :model="queryParams"
  5. ref="queryForm"
  6. size="small"
  7. :inline="true"
  8. v-show="showSearch"
  9. label-width="68px"
  10. >
  11. <el-form-item label="项目名称" prop="atvName">
  12. <el-input
  13. v-model="queryParams.atvName"
  14. placeholder="请输入项目名称"
  15. ></el-input>
  16. </el-form-item>
  17. <el-form-item>
  18. <el-button
  19. type="primary"
  20. icon="el-icon-search"
  21. size="mini"
  22. @click="handleQuery"
  23. >搜索</el-button
  24. >
  25. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
  26. >重置</el-button
  27. >
  28. </el-form-item>
  29. </el-form>
  30. <el-row :gutter="10" class="mb8">
  31. <el-col :span="1.5">
  32. <el-button
  33. type="primary"
  34. plain
  35. icon="el-icon-plus"
  36. size="mini"
  37. @click="handleAdd"
  38. v-hasPermi="['business:ARTICLE:add']"
  39. >新增</el-button
  40. >
  41. </el-col>
  42. <el-col :span="1.5">
  43. <el-button
  44. type="danger"
  45. size="mini"
  46. icon="el-icon-delete"
  47. :disabled="multiple"
  48. @click="handleDelete"
  49. v-hasPermi="['business:ARTICLE:remove']"
  50. >删除</el-button
  51. >
  52. </el-col>
  53. <right-toolbar
  54. :showSearch.sync="showSearch"
  55. @queryTable="getList"
  56. ></right-toolbar>
  57. </el-row>
  58. <el-table :data="ARTICLEList" @selection-change="handleSelectionChange">
  59. <el-table-column type="selection"></el-table-column>
  60. <el-table-column label="保税区名称" align="center" prop="deptName">
  61. <template slot-scope="scope">
  62. {{ scope.row.deptName }}
  63. </template>
  64. </el-table-column>
  65. <el-table-column label="项目名称" align="center" prop="atvName">
  66. <template slot-scope="scope">
  67. {{ scope.row.atvName }}
  68. </template>
  69. </el-table-column>
  70. <el-table-column label="建设规模" align="center" prop="scale">
  71. <template slot-scope="scope">
  72. <el-tag v-if="scope.row.scale == 1" type="success">小型</el-tag>
  73. <el-tag v-else-if="scope.row.scale == 2" type="success">中型</el-tag>
  74. <el-tag v-else-if="scope.row.scale == 3" type="success">大型</el-tag>
  75. </template>
  76. </el-table-column>
  77. <el-table-column label="年度投资计划(万)" align="center" prop="plan">
  78. <template slot-scope="scope">
  79. {{ scope.row.plan }}
  80. </template>
  81. </el-table-column>
  82. <el-table-column
  83. label="实际完成投资额(万)"
  84. align="center"
  85. prop="reality"
  86. width="130px"
  87. >
  88. <template slot-scope="scope">
  89. {{ scope.row.reality }}
  90. </template>
  91. </el-table-column>
  92. <el-table-column label="年度投资完成百分比" align="center" prop="retio">
  93. <template slot-scope="scope">
  94. {{ scope.row.retio }}
  95. </template>
  96. </el-table-column>
  97. <el-table-column label="形象进度" align="center" prop="schedule">
  98. <template slot-scope="scope">
  99. {{ scope.row.schedule }}
  100. </template>
  101. </el-table-column>
  102. <el-table-column label="项目审核状态" align="center" prop="status">
  103. <template slot-scope="scope">
  104. <el-tag v-if="scope.row.status == 0">草稿</el-tag>
  105. <el-tag v-else-if="scope.row.status == 1" type="info">审核中</el-tag>
  106. <el-tag v-else-if="scope.row.status == 2" type="danger"
  107. >审核拒绝</el-tag
  108. >
  109. <el-tag v-else-if="scope.row.status == 3" type="success"
  110. >已审核</el-tag
  111. >
  112. </template>
  113. </el-table-column>
  114. <el-table-column
  115. label="操作"
  116. align="center"
  117. class-name="small-padding fixed-width"
  118. >
  119. <template slot-scope="scope">
  120. <el-button
  121. size="mini"
  122. type="text"
  123. @click="handleUpdate(scope.row)"
  124. v-hasPermi="['business:ARTICLE:edit']"
  125. v-if="scope.row.status == 0 || scope.row.status == 2"
  126. >修改</el-button
  127. >
  128. <el-button
  129. size="mini"
  130. type="text"
  131. @click="handleTask(scope.row)"
  132. v-hasPermi="['business:ARTICLE:edit']"
  133. v-if="scope.row.status == 0 || scope.row.status == 2"
  134. >提交审核</el-button
  135. >
  136. <el-button
  137. size="mini"
  138. type="text"
  139. @click="showDetail(scope.row)"
  140. v-hasPermi="['business:ARTICLE:edit']"
  141. >详情</el-button
  142. >
  143. <el-button
  144. size="mini"
  145. type="text"
  146. v-if="scope.row.status == 3"
  147. @click="showEnterData(scope.row)"
  148. v-hasPermi="['business:ARTICLE:edit']"
  149. >数据填报</el-button
  150. >
  151. </template>
  152. </el-table-column>
  153. </el-table>
  154. <pagination
  155. v-show="total > 0"
  156. :total="total"
  157. :page.sync="queryParams.pageNum"
  158. :limit.sync="queryParams.pageSize"
  159. @pagination="getList"
  160. />
  161. </div>
  162. </template>
  163. <script>
  164. import {
  165. listARTICLE,
  166. getARTICLE,
  167. delARTICLE,
  168. addARTICLE,
  169. updateARTICLE,
  170. getUserInfo
  171. } from "@/api/portal/ARTICLE/ARTICLE.js";
  172. import edit from "./edit.vue";
  173. import enterData from "./enterData.vue";
  174. import detail from "./detail.vue";
  175. export default {
  176. name: "ARTICLE",
  177. data() {
  178. return {
  179. statusList: [
  180. { label: "已保存", value: 0 },
  181. { label: "审核中", value: 1 },
  182. { label: "审核驳回", value: 2 },
  183. { label: "已审核", value: 3 },
  184. ],
  185. // 根路径
  186. baseURL: process.env.VUE_APP_BASE_API,
  187. // 遮罩层
  188. loading: true,
  189. // 选中数组
  190. ids: [],
  191. // 非单个禁用
  192. single: true,
  193. // 非多个禁用
  194. multiple: true,
  195. // 显示搜索条件
  196. showSearch: true,
  197. // 总条数
  198. total: 0,
  199. // 重点项目管理表格数据
  200. ARTICLEList: [],
  201. // 弹出层标题
  202. title: "",
  203. // 是否显示弹出层
  204. open: false,
  205. // 查询参数
  206. queryParams: {
  207. pageNum: 1,
  208. pageSize: 10,
  209. id: null,
  210. createTime: null,
  211. createBy: null,
  212. updateTime: null,
  213. updateBy: null,
  214. delFlag: null,
  215. deptId: null,
  216. preview: null,
  217. atvName: null,
  218. scale: null,
  219. unit: null,
  220. content: null,
  221. plan: null,
  222. reality: null,
  223. retio: null,
  224. schedule: null,
  225. },
  226. deptId:'',
  227. };
  228. },
  229. created() {
  230. this.getList();
  231. this.getDeptId()
  232. },
  233. methods: {
  234. getDeptId(){
  235. getUserInfo().then(res=>{
  236. this.deptId = res.user.deptId
  237. })
  238. },
  239. showDetail(row){
  240. const id = row.id || this.ids;
  241. this.iframe({
  242. obj: detail,
  243. param: { id: id },
  244. title: "详情",
  245. width: "1050px",
  246. height: "80%",
  247. });
  248. },
  249. showEnterData(param) {
  250. this.iframe({
  251. obj: enterData,
  252. param: { param:param,deptId:this.deptId },
  253. title: "数据填报",
  254. width: "500px",
  255. height: "350px",
  256. });
  257. },
  258. // 多选框选中数据
  259. handleSelectionChange(selection) {
  260. this.ids = selection.map((item) => item.id);
  261. this.single = selection.length !== 1;
  262. this.multiple = !selection.length;
  263. },
  264. /** 查询重点项目管理列表 */
  265. getList() {
  266. this.loading = true;
  267. listARTICLE(this.queryParams).then((response) => {
  268. this.ARTICLEList = response.rows;
  269. this.total = response.total;
  270. this.loading = false;
  271. });
  272. },
  273. // 取消按钮
  274. cancel() {
  275. this.open = false;
  276. this.reset();
  277. },
  278. /** 搜索按钮操作 */
  279. handleQuery() {
  280. this.queryParams.pageNum = 1;
  281. this.getList();
  282. },
  283. /** 重置按钮操作 */
  284. resetQuery() {
  285. this.resetForm("queryForm");
  286. this.handleQuery();
  287. },
  288. /** 新增按钮操作 */
  289. handleAdd() {
  290. this.iframe({
  291. obj: edit,
  292. param: {},
  293. title: "添加重点项目",
  294. width: "1050px",
  295. height: "80%",
  296. });
  297. },
  298. /** 修改按钮操作 */
  299. handleUpdate(row) {
  300. const id = row.id || this.ids;
  301. this.iframe({
  302. obj: edit,
  303. param: { id: id },
  304. title: "修改重点项目",
  305. width: "1050px",
  306. height: "80%",
  307. });
  308. },
  309. handleTask(row) {
  310. row.status = 1;
  311. addARTICLE(row).then((response) => {
  312. if (response.code == 200) {
  313. this.$modal.msgSuccess("提交审核成功");
  314. this.getList();
  315. }
  316. });
  317. },
  318. /** 删除按钮操作 */
  319. handleDelete(row) {
  320. const ids = row.id || this.ids;
  321. this.$modal
  322. .confirm("是否确认删除?")
  323. .then(function () {
  324. return delARTICLE(ids);
  325. })
  326. .then(() => {
  327. this.getList();
  328. this.$modal.msgSuccess("删除成功");
  329. })
  330. .catch(() => {});
  331. },
  332. },
  333. };
  334. </script>