|
@@ -80,20 +80,58 @@
|
|
|
<el-button type="primary" @click="getnextdata(1)">查询</el-button>
|
|
|
</div>
|
|
|
<div style="margin-top: 10px">
|
|
|
- <el-button type="primary">新增</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ @click="addproject"
|
|
|
+ v-hasPermi="['filemanager.project.add']"
|
|
|
+ >新增</el-button
|
|
|
+ >
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<div>
|
|
|
- <el-table :data="tableData" border style="width: 100%;height:70vh">
|
|
|
+ <el-table
|
|
|
+ :data="tableData"
|
|
|
+ border
|
|
|
+ style="width: 100%; height: 70vh"
|
|
|
+ :row-class-name="tableRowClassName"
|
|
|
+ >
|
|
|
<el-table-column prop="date" label="区域" width="80">
|
|
|
<template #default="scope">
|
|
|
<dict-tag :options="sys_area" :value="scope.row.area" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="ecode" label="电子档案编号" width="120" />
|
|
|
- <el-table-column prop="qiuquan" label="丘权号" width="180" />
|
|
|
+ <el-table-column prop="ecode" label="电子档案编号" width="190">
|
|
|
+ <template #default="scope">
|
|
|
+ <div style="display: flex; justify-content: space-between">
|
|
|
+ <span>{{ scope.row.ecode }}</span>
|
|
|
+ <el-tooltip
|
|
|
+ class="box-item"
|
|
|
+ effect="dark"
|
|
|
+ :content="
|
|
|
+ scope.row.ext1 != null ? JSON.parse(scope.row.ext1).projectreson : ''
|
|
|
+ "
|
|
|
+ placement="top-start"
|
|
|
+ :disabled="scope.row.status != '4'"
|
|
|
+ >
|
|
|
+ <el-tag
|
|
|
+ :type="`${
|
|
|
+ scope.row.status == '4'
|
|
|
+ ? 'danger'
|
|
|
+ : scope.row.status == '3'
|
|
|
+ ? 'success'
|
|
|
+ : 'warning'
|
|
|
+ }`"
|
|
|
+ v-if="scope.row.status != '1'"
|
|
|
+ >
|
|
|
+ <dict-tag :options="sys_project_status" :value="scope.row.status"
|
|
|
+ /></el-tag>
|
|
|
+ </el-tooltip>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="qiuquan" label="丘权号" width="160" />
|
|
|
<el-table-column prop="buildUnit" label="建设单位" width="200" />
|
|
|
<el-table-column prop="achievementDate" label="建档日期" width="110" />
|
|
|
<el-table-column prop="saveAddr" label="存储位置" width="100" />
|
|
@@ -111,23 +149,51 @@
|
|
|
flex-direction: row;
|
|
|
"
|
|
|
>
|
|
|
- <div>
|
|
|
- <el-button type="text" size="small">编辑</el-button>
|
|
|
+ <div v-if="scope.row.status == '3' || scope.row.status == '4'">
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ @click="updatecurrent(scope.row.id, 2)"
|
|
|
+ >提交</el-button
|
|
|
+ >
|
|
|
</div>
|
|
|
- <div>
|
|
|
- <el-button type="text" size="small">删除</el-button>
|
|
|
+ <div
|
|
|
+ v-if="scope.row.status != '2'"
|
|
|
+ v-hasPermi="['filemanager.project.edit']"
|
|
|
+ >
|
|
|
+ <el-button type="text" size="small" @click="editproject(scope.row)"
|
|
|
+ >编辑</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div v-hasPermi="['filemanager.project.remove']">
|
|
|
+ <el-popconfirm
|
|
|
+ width="220"
|
|
|
+ title="是否删除项目(项目下的文件也会一并删除)?"
|
|
|
+ @confirm="deleteitem(scope.row.id)"
|
|
|
+ >
|
|
|
+ <template #reference>
|
|
|
+ <el-button type="text" size="small">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-popconfirm>
|
|
|
</div>
|
|
|
<div>
|
|
|
<el-button type="text" size="small">文件查看</el-button>
|
|
|
</div>
|
|
|
- <div>
|
|
|
- <el-button type="text" size="small">审核</el-button>
|
|
|
+ <div v-if="scope.row.status == '2'">
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ v-hasPermi="['filemanager.project.sh']"
|
|
|
+ @click="shproject(scope.row)"
|
|
|
+ >审核</el-button
|
|
|
+ >
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
- <div style="display:flex;justify-content: flex-end;">
|
|
|
+ <div style="display: flex; justify-content: flex-end">
|
|
|
<el-pagination
|
|
|
small
|
|
|
background
|
|
@@ -138,49 +204,243 @@
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
+ <el-dialog v-model="shvisable" :title="`项目审核`" width="40vw">
|
|
|
+ <el-input
|
|
|
+ v-model="projectreson"
|
|
|
+ type="textarea"
|
|
|
+ :autosize="{ minRows: 4 }"
|
|
|
+ placeholder="请输入意见"
|
|
|
+ />
|
|
|
+
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer">
|
|
|
+ <el-button @click="dialogVisible = false">取消</el-button>
|
|
|
+ <el-button type="danger" @click="updatecurrent(currentitem.id, 4)">
|
|
|
+ 不通过
|
|
|
+ </el-button>
|
|
|
+ <el-button type="primary" @click="updatecurrent(currentitem.id, 1)">
|
|
|
+ 通过
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog
|
|
|
+ v-model="dialogVisible"
|
|
|
+ :title="`${currenttype == 1 ? '新增' : '编辑'}项目`"
|
|
|
+ width="40vw"
|
|
|
+ >
|
|
|
+ <el-form :model="currentitem" label-width="auto">
|
|
|
+ <el-form-item label="区域:" required>
|
|
|
+ <el-select v-model="currentitem.area" clearable placeholder="请选择">
|
|
|
+ <el-option
|
|
|
+ v-for="item in sys_area"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="电子档案编号:" required>
|
|
|
+ <el-input v-model="currentitem.ecode" placeholder="请输入" />
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="丘权号:" required>
|
|
|
+ <el-input v-model="currentitem.qiuquan" placeholder="请输入" />
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="建设单位:" required>
|
|
|
+ <el-input v-model="currentitem.buildUnit" placeholder="请输入" />
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="建档日期:">
|
|
|
+ <el-input v-model="currentitem.achievementDate" placeholder="请输入" />
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="存储位置:" required>
|
|
|
+ <el-input v-model="currentitem.saveAddr" placeholder="请输入" />
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="地址:">
|
|
|
+ <el-input type="textarea" v-model="currentitem.addr" placeholder="请输入" />
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="备注:">
|
|
|
+ <el-input type="textarea" v-model="currentitem.remark" placeholder="请输入" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer">
|
|
|
+ <el-button @click="dialogVisible = false">取消</el-button>
|
|
|
+ <el-button type="primary" @click="savecurrent"> 保存 </el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { ref } from 'vue'
|
|
|
-import { listArchives } from "@/api/archives/index";
|
|
|
+import { ref } from "vue";
|
|
|
+import {
|
|
|
+ listArchives,
|
|
|
+ addArchives,
|
|
|
+ updateArchives,
|
|
|
+ delArchives,
|
|
|
+} from "@/api/archives/index";
|
|
|
+import _ from "lodash";
|
|
|
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
-const { sys_area } = toRefs < any > (proxy?.useDict("sys_area"));
|
|
|
+const { sys_area, sys_project_status } = toRefs<any>(
|
|
|
+ proxy?.useDict("sys_area", "sys_project_status")
|
|
|
+);
|
|
|
+
|
|
|
+const shvisable = ref(false);
|
|
|
|
|
|
const searchForm = ref({
|
|
|
- area: "",
|
|
|
- qiuquan: "",
|
|
|
- buildUnit: "",
|
|
|
- addr: "",
|
|
|
- saveAddr: ""
|
|
|
-})
|
|
|
+ area: "",
|
|
|
+ qiuquan: "",
|
|
|
+ buildUnit: "",
|
|
|
+ addr: "",
|
|
|
+ saveAddr: "",
|
|
|
+});
|
|
|
|
|
|
const reset = () => {
|
|
|
- searchForm.value = ({
|
|
|
+ searchForm.value = {
|
|
|
area: "",
|
|
|
qiuquan: "",
|
|
|
buildUnit: "",
|
|
|
addr: "",
|
|
|
- saveAddr: ""
|
|
|
- })
|
|
|
+ saveAddr: "",
|
|
|
+ };
|
|
|
getnextdata(1);
|
|
|
-}
|
|
|
+};
|
|
|
|
|
|
const tableData = ref([]);
|
|
|
const currentpage = ref(0);
|
|
|
const totalnum = ref(0);
|
|
|
|
|
|
-
|
|
|
const getnextdata = (page: number) => {
|
|
|
currentpage.value = page;
|
|
|
- listArchives({pageSize:10,pageNum:page,...searchForm.value}).then(res => {
|
|
|
+ listArchives({ pageSize: 10, pageNum: page, ...searchForm.value }).then((res) => {
|
|
|
tableData.value = res.rows;
|
|
|
totalnum.value = res.total;
|
|
|
- })
|
|
|
-}
|
|
|
+ });
|
|
|
+};
|
|
|
getnextdata(1);
|
|
|
|
|
|
+const dialogVisible = ref(false);
|
|
|
+const currenttype = ref(1);
|
|
|
+const currentitem = ref({
|
|
|
+ id: "",
|
|
|
+ area: "",
|
|
|
+ qiuquan: "",
|
|
|
+ buildUnit: "",
|
|
|
+ addr: "",
|
|
|
+ community: "",
|
|
|
+ achievementDate: "",
|
|
|
+ saveAddr: "",
|
|
|
+ remark: "",
|
|
|
+ ecode: "",
|
|
|
+});
|
|
|
+
|
|
|
+const addproject = () => {
|
|
|
+ currentitem.value = {
|
|
|
+ id: "",
|
|
|
+ area: "",
|
|
|
+ qiuquan: "",
|
|
|
+ buildUnit: "",
|
|
|
+ addr: "",
|
|
|
+ community: "",
|
|
|
+ achievementDate: "",
|
|
|
+ saveAddr: "",
|
|
|
+ remark: "",
|
|
|
+ ecode: "",
|
|
|
+ };
|
|
|
+ dialogVisible.value = true;
|
|
|
+ currenttype.value = 1;
|
|
|
+};
|
|
|
+
|
|
|
+const savecurrent = () => {
|
|
|
+ if (currentitem.value.id == "") {
|
|
|
+ // 新增
|
|
|
+ var dd = _.cloneDeep(currentitem.value);
|
|
|
+ delete dd.id;
|
|
|
+ addArchives(dd)
|
|
|
+ .then((res) => {
|
|
|
+ dialogVisible.value = false;
|
|
|
+ ElMessage.success("新增成功");
|
|
|
+ getnextdata(1);
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ // dialogVisible.value = false;
|
|
|
+ // console.log(e);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ // 编辑
|
|
|
+ updateArchives(currentitem.value)
|
|
|
+ .then((res) => {
|
|
|
+ dialogVisible.value = false;
|
|
|
+ ElMessage.success("编辑成功");
|
|
|
+ getnextdata(1);
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ dialogVisible.value = false;
|
|
|
+ console.log(e);
|
|
|
+ });
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const editproject = (item) => {
|
|
|
+ dialogVisible.value = true;
|
|
|
+ currenttype.value = 2;
|
|
|
+ currentitem.value = item;
|
|
|
+};
|
|
|
+
|
|
|
+const projectreson = ref("");
|
|
|
+
|
|
|
+const updatecurrent = (id, status: number) => {
|
|
|
+ if (status == 4 && projectreson.value == "") {
|
|
|
+ ElMessage.warning("请输入不同意原因");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ updateArchives({
|
|
|
+ id: id,
|
|
|
+ status: status + "",
|
|
|
+ ...(status == 4
|
|
|
+ ? { ext1: JSON.stringify({ projectreson: projectreson.value }) }
|
|
|
+ : {}),
|
|
|
+ }).then((res) => {
|
|
|
+ ElMessage.success("保存成功");
|
|
|
+ shvisable.value = false;
|
|
|
+ getnextdata(1);
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+const shproject = (item) => {
|
|
|
+ shvisable.value = true;
|
|
|
+ currentitem.value = item;
|
|
|
+};
|
|
|
+
|
|
|
+const tableRowClassName = ({ row, rowIndex }: { row: any; rowIndex: number }) => {
|
|
|
+ console.log(row);
|
|
|
+ if (row.status == "2") {
|
|
|
+ return "warning-row";
|
|
|
+ } else if (row.status == "3") {
|
|
|
+ return "success-row";
|
|
|
+ } else if (row.status == "4") {
|
|
|
+ return "danger-row";
|
|
|
+ }
|
|
|
+ return "";
|
|
|
+};
|
|
|
+
|
|
|
+const deleteitem = (id: any) => {
|
|
|
+ delArchives(id).then((res) => {
|
|
|
+ ElMessage.success("删除成功");
|
|
|
+ getnextdata(1);
|
|
|
+ });
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style type="scss" scoped>
|
|
@@ -200,5 +460,25 @@ getnextdata(1);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ .formitem {
|
|
|
+ display: flex;
|
|
|
+ gap: 20px;
|
|
|
+ align-items: center;
|
|
|
+ font-size: 14px;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|
|
|
+
|
|
|
+<style>
|
|
|
+.el-table .warning-row {
|
|
|
+ --el-table-tr-bg-color: var(--el-color-warning-light-9);
|
|
|
+}
|
|
|
+
|
|
|
+.el-table .success-row {
|
|
|
+ --el-table-tr-bg-color: var(--el-color-success-light-9);
|
|
|
+}
|
|
|
+
|
|
|
+.el-table .danger-row {
|
|
|
+ --el-table-tr-bg-color: var(--el-color-danger-light-9);
|
|
|
}
|
|
|
</style>
|