Bladeren bron

新增上链确权

dev01 5 maanden geleden
bovenliggende
commit
1cc90d027f
5 gewijzigde bestanden met toevoegingen van 190 en 57 verwijderingen
  1. 9 0
      src/api/system/project.js
  2. 9 0
      src/api/system/record.js
  3. 61 18
      src/views/system/project/index.vue
  4. 110 38
      src/views/system/record/index.vue
  5. 1 1
      vue.config.js

+ 9 - 0
src/api/system/project.js

@@ -61,4 +61,13 @@ export function deleteStaff(data) {
     method: 'post',
     data: data
   })
+}
+
+// 项目列表上链确权
+export function saveProjectTaskTianhe(query) {
+  return request({
+    url: '/api/project/saveProjectTaskTianhe',
+    method: 'get',
+    params: query
+  })
 }

+ 9 - 0
src/api/system/record.js

@@ -89,4 +89,13 @@ export function updateUserClockDetails(data) {
     method: 'post',
     data: data
   })
+}
+
+// 项目日志上链确权
+export function saveProjectStaffRecordTianhe(query) {
+  return request({
+    url: '/api/project/saveProjectStaffRecordTianhe',
+    method: 'get',
+    params: query
+  })
 }

+ 61 - 18
src/views/system/project/index.vue

@@ -128,7 +128,6 @@
               icon="el-icon-plus"
               size="mini"
               @click="handleAdd"
-              v-hasPermi="['system:user:add']"
               >新增</el-button
             >
           </el-col>
@@ -139,7 +138,6 @@
               icon="el-icon-upload2"
               size="mini"
               @click="handleImport"
-              v-hasPermi="['system:user:import']"
               >导入</el-button
             >
           </el-col>
@@ -150,10 +148,19 @@
               icon="el-icon-download"
               size="mini"
               @click="handleExport"
-              v-hasPermi="['system:user:export']"
               >导出</el-button
             >
           </el-col>
+          <el-col :span="1.5">
+            <el-button
+              type="primary"
+              size="mini"
+              :disabled="multiple"
+              @click="chainUp"
+              v-hasPermi="[`system:project:chainup`]"
+              >上链确权</el-button
+            >
+          </el-col>
           <right-toolbar
             :showSearch.sync="showSearch"
             @queryTable="getList"
@@ -202,15 +209,34 @@
             align="center"
             key="name"
             prop="name"
+            show-overflow-tooltip
             v-if="columns[3].visible"
-            :show-overflow-tooltip="true"
           />
           <el-table-column
+            label="上链状态"
+            align="center"
+            width="75"
+            key="chainUp"
+            prop="chainUp"
+            v-if="columns[4].visible"
+          >
+            <template slot-scope="scope">
+              <el-tag
+                effect="dark"
+                style="cursor: pointer"
+                @click="goto(scope.row.tianheUrl)"
+                v-show="!!scope.row.tianheUrl"
+              >
+                已上链
+              </el-tag>
+            </template>
+          </el-table-column>
+          <el-table-column
             label="负责人"
             align="center"
             key="adminName"
             prop="adminName"
-            v-if="columns[4].visible"
+            v-if="columns[5].visible"
           />
           <el-table-column
             label="参与研发人员"
@@ -218,7 +244,7 @@
             key="staffName"
             prop="staffName"
             show-overflow-tooltip
-            v-if="columns[5].visible"
+            v-if="columns[6].visible"
           />
           <el-table-column
             label="项目状态"
@@ -226,7 +252,7 @@
             width="80"
             key="projectStatus"
             prop="projectStatus"
-            v-if="columns[6].visible"
+            v-if="columns[7].visible"
           >
             <template slot-scope="scope">
               <dict-tag
@@ -241,7 +267,7 @@
             width="50"
             key="duration"
             prop="duration"
-            v-if="columns[7].visible"
+            v-if="columns[8].visible"
           ></el-table-column>
           <el-table-column
             label="创建年份"
@@ -249,7 +275,7 @@
             width="75"
             key="createYear"
             prop="createYear"
-            v-if="columns[8].visible"
+            v-if="columns[9].visible"
           />
           <el-table-column
             label="起止时间"
@@ -257,7 +283,7 @@
             width="168"
             key="startTime"
             prop="startTime"
-            v-if="columns[9].visible"
+            v-if="columns[10].visible"
           >
             <template slot-scope="scope">
               <div style="font-size: 12px">
@@ -498,6 +524,7 @@ import {
   addStaff,
   listStaff,
   deleteStaff,
+  saveProjectTaskTianhe,
 } from "@/api/system/project";
 import { selectName, deptTreeSelect } from "@/api/system/user";
 import { getToken } from "@/utils/auth";
@@ -505,7 +532,7 @@ import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 
 export default {
-  name: "User",
+  name: "Project",
   dicts: ["sys_normal_disable", "sys_user_sex", "sys_project_status"],
   components: { Treeselect },
   data() {
@@ -588,12 +615,13 @@ export default {
         { key: 1, label: `项目年份`, visible: true },
         { key: 2, label: `是否跨年`, visible: true },
         { key: 3, label: `项目名称`, visible: true },
-        { key: 4, label: `负责人`, visible: true },
-        { key: 5, label: `参与研发人员`, visible: true },
-        { key: 6, label: `项目状态`, visible: true },
-        { key: 7, label: `累积工时`, visible: true },
-        { key: 8, label: `创建年份`, visible: true },
-        { key: 9, label: `起止时间`, visible: true },
+        { key: 4, label: `上链状态`, visible: true },
+        { key: 5, label: `负责人`, visible: true },
+        { key: 6, label: `参与研发人员`, visible: true },
+        { key: 7, label: `项目状态`, visible: true },
+        { key: 8, label: `累积工时`, visible: true },
+        { key: 9, label: `创建年份`, visible: true },
+        { key: 10, label: `起止时间`, visible: true },
       ],
       // 表单校验
       rules: {
@@ -725,7 +753,7 @@ export default {
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
-      this.ids = selection.map((item) => item.userId);
+      this.ids = selection.map((item) => item.id);
       this.single = selection.length != 1;
       this.multiple = !selection.length;
     },
@@ -756,6 +784,18 @@ export default {
       this.dateRange1 = [row.startTime || "", row.endTime || ""];
       this.superiorName1 = row.adminName;
     },
+    /** 上链确权 */
+    chainUp() {
+      let data = {
+        id: this.ids.toString(),
+      };
+      this.$modal.loading("上链中...");
+      saveProjectTaskTianhe(data).then((response) => {
+        this.$modal.closeLoading();
+        this.$modal.msgSuccess("操作成功");
+        this.getList();
+      });
+    },
     /** 导出按钮操作 */
     handleExport() {
       this.download(
@@ -887,6 +927,9 @@ export default {
         });
       }
     },
+    goto(url) {
+      window.open(url);
+    },
   },
 };
 </script>

+ 110 - 38
src/views/system/record/index.vue

@@ -172,7 +172,7 @@
               icon="el-icon-upload2"
               size="mini"
               @click="handleImport"
-              v-hasPermi="['system:user:import']"
+              v-hasPermi="['system:record:import']"
               >导入</el-button
             >
           </el-col>
@@ -183,7 +183,7 @@
               icon="el-icon-download"
               size="mini"
               @click="handleExport"
-              v-hasPermi="['system:user:export']"
+              v-hasPermi="['system:record:export']"
               >导出</el-button
             >
           </el-col>
@@ -195,7 +195,7 @@
               size="mini"
               :disabled="multiple"
               @click="handleDownload"
-              v-hasPermi="['system:user:export']"
+              v-hasPermi="['system:record:export']"
               >下载附件</el-button
             >
           </el-col>
@@ -217,13 +217,23 @@
               type="primary"
               size="mini"
               @click="handleImports"
-              v-hasPermi="['system:user:import']"
+              v-hasPermi="['system:record:import']"
               >导入考勤</el-button
             >
           </el-col>
           <el-col :span="1.5">
             <el-button type="primary" size="mini" @click="mateHours">匹配工时</el-button>
           </el-col>
+          <el-col :span="1.5">
+            <el-button
+              type="primary"
+              size="mini"
+              :disabled="multiple"
+              @click="chainUp"
+              v-hasPermi="[`system:record:chainup`]"
+              >上链确权</el-button
+            >
+          </el-col>
           <right-toolbar
             :showSearch.sync="showSearch"
             @queryTable="getList"
@@ -238,27 +248,49 @@
         >
           <el-table-column type="selection" width="50" align="center" />
           <el-table-column
+            label="日志上链"
+            align="center"
+            width="75"
+            key="tianheUrl"
+            prop="tianheUrl"
+            show-overflow-tooltip
+            v-if="columns[0].visible"
+          >
+            <template slot-scope="scope">
+              <el-tag
+                type="danger"
+                effect="dark"
+                style="cursor: pointer"
+                @click="goto(scope.row.tianheUrl)"
+                v-show="!!scope.row.tianheUrl"
+              >
+                已上链
+              </el-tag>
+            </template>
+          </el-table-column>
+          <el-table-column
             label="员工工号"
             align="center"
-            width="90"
+            width="75"
             key="jobNumber"
             prop="jobNumber"
-            v-if="columns[0].visible"
+            v-if="columns[1].visible"
           />
           <el-table-column
             label="员工姓名"
             align="center"
             key="name"
             prop="name"
-            v-if="columns[1].visible"
+            v-if="columns[2].visible"
             :show-overflow-tooltip="true"
           />
           <el-table-column
             label="部门编号"
             align="center"
+            width="75"
             key="deptId"
             prop="deptId"
-            v-if="columns[2].visible"
+            v-if="columns[3].visible"
             :show-overflow-tooltip="true"
           />
           <el-table-column
@@ -266,7 +298,7 @@
             align="center"
             key="deptName"
             prop="deptName"
-            v-if="columns[3].visible"
+            v-if="columns[4].visible"
           />
           <el-table-column
             label="打卡时间"
@@ -274,7 +306,7 @@
             align="center"
             key="recordTime"
             prop="recordTime"
-            v-if="columns[4].visible"
+            v-if="columns[5].visible"
           />
           <el-table-column
             label="工时"
@@ -282,7 +314,7 @@
             width="50"
             key="duration"
             prop="duration"
-            v-if="columns[5].visible"
+            v-if="columns[6].visible"
           />
           <el-table-column
             label="打卡月份"
@@ -290,7 +322,7 @@
             width="50"
             key="createMonth"
             prop="createMonth"
-            v-if="columns[6].visible"
+            v-if="columns[7].visible"
           />
           <el-table-column
             label="初始时长"
@@ -298,7 +330,7 @@
             width="50"
             key="initDuration"
             prop="initDuration"
-            v-if="columns[7].visible"
+            v-if="columns[8].visible"
           />
           <el-table-column
             label="考勤"
@@ -306,28 +338,49 @@
             width="50"
             key="checkDuration"
             prop="checkDuration"
-            v-if="columns[8].visible"
+            v-if="columns[9].visible"
           />
           <el-table-column
             label="项目编号"
             align="center"
             key="projectNumber"
             prop="projectNumber"
-            v-if="columns[9].visible"
+            v-if="columns[10].visible"
           />
           <el-table-column
             label="项目名称"
             align="center"
             key="projectName"
             prop="projectName"
-            v-if="columns[10].visible"
+            show-overflow-tooltip
+            v-if="columns[11].visible"
           />
           <el-table-column
+            label="项目上链"
+            align="center"
+            width="75"
+            key="projectTianheUrl"
+            prop="projectTianheUrl"
+            show-overflow-tooltip
+            v-if="columns[12].visible"
+          >
+            <template slot-scope="scope">
+              <el-tag
+                effect="dark"
+                style="cursor: pointer"
+                @click="goto(scope.row.projectTianheUrl)"
+                v-show="scope.row.tianheType == 1"
+              >
+                已上链
+              </el-tag>
+            </template>
+          </el-table-column>
+          <el-table-column
             label="研发阶段"
             align="center"
             key="projectStatus"
             prop="projectStatus"
-            v-if="columns[11].visible"
+            v-if="columns[13].visible"
           >
             <template slot-scope="scope">
               <dict-tag
@@ -341,16 +394,17 @@
             align="center"
             key="content"
             prop="content"
-            v-if="columns[12].visible"
+            v-if="columns[14].visible"
             :show-overflow-tooltip="true"
           />
           <!-- :show-overflow-tooltip="true" -->
           <el-table-column
             label="审核状态"
             align="center"
+            width="75"
             key="processStatus"
             prop="processStatus"
-            v-if="columns[13].visible"
+            v-if="columns[15].visible"
           >
             <template slot-scope="scope">
               <dict-tag
@@ -364,7 +418,7 @@
             align="center"
             key="examineName"
             prop="examineName"
-            v-if="columns[14].visible"
+            v-if="columns[16].visible"
           />
           <el-table-column
             label="审核时间"
@@ -372,12 +426,12 @@
             align="center"
             key="examineTime"
             prop="examineTime"
-            v-if="columns[15].visible"
+            v-if="columns[17].visible"
           />
           <el-table-column
             label="附件"
             align="center"
-            width="70"
+            width="55"
             class-name="small-padding fixed-width"
           >
             <template slot-scope="scope" v-if="scope.row.userId !== 1">
@@ -622,6 +676,7 @@ import {
   updateUserRecord,
   UserClockDetails,
   updateUserClockDetails,
+  saveProjectStaffRecordTianhe,
 } from "@/api/system/record";
 import { deptTreeSelect } from "@/api/system/user";
 import { getToken } from "@/utils/auth";
@@ -736,22 +791,24 @@ export default {
       },
       // 列信息
       columns: [
-        { key: 0, label: `员工工号`, visible: true },
-        { key: 1, label: `员工姓名`, visible: true },
-        { key: 2, label: `部门编号`, visible: true },
-        { key: 3, label: `部门`, visible: true },
-        { key: 4, label: `打卡时间`, visible: true },
-        { key: 5, label: `工时`, visible: true },
-        { key: 6, label: `打卡月份`, visible: true },
-        { key: 7, label: `初始时长`, visible: true },
-        { key: 8, label: `考勤`, visible: true },
-        { key: 9, label: `项目编号`, visible: true },
-        { key: 10, label: `项目名称`, visible: true },
-        { key: 11, label: `创建任务`, visible: true },
-        { key: 12, label: `日报内容`, visible: true },
-        { key: 13, label: `审核状态`, visible: true },
-        { key: 14, label: `审核人员`, visible: true },
-        { key: 15, label: `审核时间`, visible: true },
+        { key: 0, label: `日志上链`, visible: true },
+        { key: 1, label: `员工工号`, visible: true },
+        { key: 2, label: `员工姓名`, visible: true },
+        { key: 3, label: `部门编号`, visible: true },
+        { key: 4, label: `部门`, visible: true },
+        { key: 5, label: `打卡时间`, visible: true },
+        { key: 6, label: `工时`, visible: true },
+        { key: 7, label: `打卡月份`, visible: true },
+        { key: 8, label: `初始时长`, visible: true },
+        { key: 9, label: `考勤`, visible: true },
+        { key: 10, label: `项目编号`, visible: true },
+        { key: 11, label: `项目名称`, visible: true },
+        { key: 12, label: `项目上链`, visible: true },
+        { key: 13, label: `创建任务`, visible: true },
+        { key: 14, label: `日报内容`, visible: true },
+        { key: 15, label: `审核状态`, visible: true },
+        { key: 16, label: `审核人员`, visible: true },
+        { key: 17, label: `审核时间`, visible: true },
       ],
     };
   },
@@ -839,6 +896,18 @@ export default {
       this.srcList = row.annexUrl;
       this.open = true;
     },
+    /** 上链确权 */
+    chainUp() {
+      let data = {
+        id: this.ids.toString(),
+      };
+      this.$modal.loading("上链中...");
+      saveProjectStaffRecordTianhe(data).then((response) => {
+        this.$modal.closeLoading();
+        this.$modal.msgSuccess("操作成功");
+        this.getList();
+      });
+    },
     /** 批量审核 */
     toExamine() {
       // if (!this.examineTime) {
@@ -1098,6 +1167,9 @@ export default {
         }
       });
     },
+    goto(url) {
+      window.open(url);
+    },
   },
 };
 </script>

+ 1 - 1
vue.config.js

@@ -35,7 +35,7 @@ module.exports = {
     proxy: {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
-        target: `http://172.16.0.255:8888`,
+        target: `http://172.16.1.199:8888`,
         // target: `https://yanfa.jishutao.com/prod-api`,
         changeOrigin: true,
         pathRewrite: {