Просмотр исходного кода

fix:合同管理批量设置失笑合同

刘恒 1 год назад
Родитель
Сommit
717b2bd489

+ 14 - 11
index.html

@@ -1,13 +1,16 @@
 <!DOCTYPE html>
 <html>
-  <head>
-    <meta charset="utf-8">
-    <meta name="viewport" content="width=device-width,initial-scale=1.0">
-    <script src="//at.alicdn.com/t/c/font_4439599_dea56hl0hs4.js"></script>
-    <title>管理平台</title>
-  </head>
-  <body style="margin: 0;">
-    <div id="app"></div>
-    <!-- built files will be auto injected -->
-  </body>
-</html>
+
+<head>
+  <meta charset="utf-8">
+  <meta name="viewport" content="width=device-width,initial-scale=1.0">
+  <script src="//at.alicdn.com/t/c/font_4439599_nyqfqqzask.js"></script>
+  <title>管理平台</title>
+</head>
+
+<body style="margin: 0;">
+  <div id="app"></div>
+  <!-- built files will be auto injected -->
+</body>
+
+</html>

+ 24 - 1
src/http/moudules/contract.js

@@ -63,6 +63,29 @@ export const supplementContract = (data) => {
     })
 }
 
+//失效状态
+export const checkCopyContract = (data) => {
+    return axios({
+        url: '/fnc/contract/checkCopyContract',
+        method: 'post',
+        data
+    })
+}
 
-
+//关联合同列表
+export const copyContractList = (data) => {
+    return axios({
+        url: '/fnc/contract/copyContractList',
+        method: 'post',
+        data
+    })
+}
+//批量设置失效
+export const updateFileStatus = (data) => {
+    return axios({
+        url: '/fnc/contract/updateFileStatus',
+        method: 'put',
+        data
+    })
+}
 

+ 144 - 98
src/views/FinancialManagement/ContractManagement/ContractManagement.vue

@@ -557,13 +557,13 @@
               >
             </div>
             <vue-office-docx
-              v-show="item.url.includes('.docx')"
+              v-show="item.url != null ? item.url.includes('.docx') : false"
               :src="base + item.url"
               @rendered="renderedHandler"
               @error="errorHandler"
             />
             <vue-office-pdf
-              v-show="item.url.includes('.pdf')"
+              v-show="item.url != null ? item.url.includes('.pdf') : false"
               :src="base + item.url"
               @rendered="renderedHandler"
               @error="errorHandler"
@@ -572,6 +572,43 @@
         </el-carousel>
       </div>
     </el-dialog>
+
+    <el-dialog title="合同列表" :visible.sync="tableDialog" width="50%">
+      <el-table
+        ref="multipleTable"
+        :data="statusTable"
+        tooltip-effect="dark"
+        style="width: 100%"
+        @selection-change="handleSelectionChange"
+      >
+        <el-table-column type="selection" width="55"> </el-table-column>
+        <el-table-column prop="contractCode" label="合同编码">
+        </el-table-column>
+        <el-table-column prop="contractName" label="合同名称">
+        </el-table-column>
+
+        <el-table-column prop="isOpenContract" label="是否顺延">
+          <template slot-scope="scope">
+            <el-tag
+              :type="scope.row.isOpenContract == '0' ? 'success' : 'danger'"
+              effect="dark"
+            >
+              {{ scope.row.isOpenContract == "0" ? "是" : "否" }}
+            </el-tag>
+          </template>
+        </el-table-column>
+        <el-table-column prop="effectiveDate" label="生效日期">
+        </el-table-column>
+        <el-table-column prop="expiringDate" label="失效日期">
+        </el-table-column>
+      </el-table>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="tableDialog = false">取 消</el-button>
+        <el-button type="primary" @click="setContract"
+          >将选中的合同置为无效</el-button
+        >
+      </span>
+    </el-dialog>
   </div>
 </template>
 
@@ -581,6 +618,7 @@ import moment from "moment"; //引入js日期处理类库
 import VueOfficeDocx from "@vue-office/docx";
 import VueOfficePdf from "@vue-office/pdf";
 import "@vue-office/docx/lib/index.css";
+import { set } from "shelljs";
 export default {
   components: {
     treeSelect,
@@ -599,6 +637,9 @@ export default {
         externalCompaniesId: "",
         internalCompanyId: "",
       },
+      tableDialog: false,
+      multipleSelection: [],
+
       base: process.env.BASE_URL,
       form: {
         contractCode: "",
@@ -670,63 +711,8 @@ export default {
       title: "",
       dialogVisible: false,
       tableData: [],
-      data: [
-        {
-          title: "一级 1",
-          children: [
-            {
-              title: "二级 1-1",
-              children: [
-                {
-                  title: "三级 1-1-1",
-                },
-              ],
-            },
-          ],
-        },
-        {
-          title: "一级 2",
-          children: [
-            {
-              title: "二级 2-1",
-              children: [
-                {
-                  title: "三级 2-1-1",
-                },
-              ],
-            },
-            {
-              title: "二级 2-2",
-              children: [
-                {
-                  title: "三级 2-2-1",
-                },
-              ],
-            },
-          ],
-        },
-        {
-          title: "一级 3",
-          children: [
-            {
-              title: "二级 3-1",
-              children: [
-                {
-                  title: "三级 3-1-1",
-                },
-              ],
-            },
-            {
-              title: "二级 3-2",
-              children: [
-                {
-                  title: "三级 3-2-1",
-                },
-              ],
-            },
-          ],
-        },
-      ],
+      statusTable: [],
+      data: [],
       date: "",
       time: "",
 
@@ -769,54 +755,114 @@ export default {
       this.pageInfo.pageNum = val;
       this.getList();
     },
-    //更多操作
-    handleCommand(commad, row) {
-      this.operation = commad;
+    //表格选中
+    handleSelectionChange(val) {
+      this.multipleSelection = val.map((v, i) => {
+        return v.id;
+      });
+    },
+    setContract() {
       this.$api.contract
-        .editorShow({
-          id: row.id,
+        .updateFileStatus({
+          idList: this.multipleSelection,
         })
         .then((res) => {
-          if (res.code === 200) {
-            this.showFileList = [...res.data.contractFileEntityList];
-            this.form = {
-              contractCode: res.data.contractCode,
-              contractType: res.data.contractType,
-              // contractName: res.data.contractName,
-              externalCompaniesId: res.data.externalCompaniesId,
-              internalCompanyId: res.data.internalCompanyId,
-              supplierIdList: res.data.supplierIdList,
-              // isOpenContract: res.data.isOpenContract,
-              // effectiveDate: res.data.effectiveDate,
-              // expiringDate: res.data.expiringDate,
-              shouldPostponed: res.data.shouldPostponed,
-              shouldPostponedEffectiveDate:
-                res.data.shouldPostponedEffectiveDate,
-              externType: res.data.externType,
-              internalType: res.data.internalType,
-              id: res.data.id,
+          if (res.code == 200) {
+            this.tableDialog = false;
+            this.$message.success(res.msg);
+          } else {
+            this.$message.error(res.msg);
+          }
+        });
+    },
+    //更多操作
+    handleCommand(commad, row) {
+      this.operation = commad;
+      if (commad != "error") {
+        this.$api.contract
+          .editorShow({
+            id: row.id,
+          })
+          .then((res) => {
+            if (res.code === 200) {
+              this.showFileList = [...res.data.contractFileEntityList];
+              this.form = {
+                contractCode: res.data.contractCode,
+                contractType: res.data.contractType,
+                // contractName: res.data.contractName,
+                externalCompaniesId: res.data.externalCompaniesId,
+                internalCompanyId: res.data.internalCompanyId,
+                supplierIdList: res.data.supplierIdList,
+                // isOpenContract: res.data.isOpenContract,
+                // effectiveDate: res.data.effectiveDate,
+                // expiringDate: res.data.expiringDate,
+                shouldPostponed: res.data.shouldPostponed,
+                shouldPostponedEffectiveDate:
+                  res.data.shouldPostponedEffectiveDate,
+                externType: res.data.externType,
+                internalType: res.data.internalType,
+                id: res.data.id,
 
-              filePathIdList:
+                filePathIdList:
+                  res.data.contractFileEntityList != null
+                    ? res.data.contractFileEntityList.map((v, i) => {
+                        return { name: v.fileName, url: v.url };
+                      })
+                    : [],
+              };
+              this.fileIdList =
                 res.data.contractFileEntityList != null
                   ? res.data.contractFileEntityList.map((v, i) => {
-                      return { name: v.fileName, url: v.url };
+                      return v.fileId;
                     })
-                  : [],
-            };
-            this.fileIdList =
-              res.data.contractFileEntityList != null
-                ? res.data.contractFileEntityList.map((v, i) => {
-                    return v.fileId;
-                  })
-                : [];
-            if (commad == "supplement") {
-              this.dialogVisible = true;
+                  : [];
+              if (commad == "supplement") {
+                this.dialogVisible = true;
+              }
+              if (commad == "watch") {
+                this.fileDialog = true;
+              }
             }
-            if (commad == "watch") {
-              this.fileDialog = true;
+          });
+      } else {
+        this.$api.contract
+          .checkCopyContract({
+            id: row.id,
+          })
+          .then((res) => {
+            // console.log(res);
+            if (res.code === 200) {
+              if (res.data.failStatus == "0") {
+                this.$confirm("确认将该合同置为失效状态吗?", "提示", {
+                  type: "warning",
+                }).then(() => {
+                  this.$api.contract
+                    .constractSave({ id: row.id, contractStatus: 1 })
+                    .then((res) => {
+                      if (res.code == 200) {
+                        this.$message.success(res.msg);
+                        this.getList();
+                      } else {
+                        this.$message.error(res.msg);
+                      }
+                    });
+                });
+              } else {
+                this.multipleSelection = [];
+                this.tableDialog = true;
+                this.$api.contract
+                  .copyContractList({
+                    id: row.id,
+                  })
+                  .then((res) => {
+                    if (res.code === 200) {
+                      this.statusTable = [...res.data];
+                    }
+                  });
+              }
             }
-          }
-        });
+          });
+      }
     },
     //获取合同列表
     getList() {