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

+ 43 - 37
src/views/FinancialManagement/ContractManagement/ContractManagement.vue

@@ -11,7 +11,7 @@
           <el-form-item label="合同信息">
             <el-input
               v-model="formInline.contractCode"
-              placeholder="请输入合同信息"
+              placeholder="请输入合同编码或者合同名称"
               size="small"
               style="width: 220px"
               clearable
@@ -29,6 +29,7 @@
                 children: 'children',
               }"
               clearable
+              filterable
               v-model="formInline.supplierId"
             ></el-cascader>
             <!-- <el-select
@@ -84,6 +85,8 @@
               size="small"
               v-model="formInline.contractType"
               style="width: 220px"
+              clearable
+              filterable
             >
               <el-option
                 v-for="item in contractTypeList"
@@ -102,6 +105,7 @@
               size="small"
               filterable
               style="width: 220px"
+              clearable
             >
               <el-option value="all" label="全部">全部</el-option>
               <el-option value="1" label="失效">失效</el-option>
@@ -140,6 +144,8 @@
       }"
       highlight-current-row
     >
+      <el-table-column type="index" width="50" label="序号"> </el-table-column>
+
       <el-table-column prop="contractCode" label="合同编码" width="180">
       </el-table-column>
       <el-table-column prop="contractName" label="合同名称" width="180">
@@ -186,6 +192,16 @@
           </el-tooltip>
         </template>
       </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-column prop="shouldPostponed" label="是否顺延">
@@ -198,6 +214,8 @@
           </el-tag>
         </template>
       </el-table-column>
+      <!-- <el-table-column prop="expiringDate" label="顺延时间"> </el-table-column> -->
+
       <el-table-column
         prop="shouldPostponedEffectiveDate"
         label="顺延后失效日期"
@@ -268,7 +286,7 @@
       :page-sizes="[10, 20, 30, 50]"
       :page-size="pageInfo.pageSize"
       layout=" sizes, prev, pager, next, jumper"
-      :total="0"
+      :total="pageInfo.total"
     >
     </el-pagination>
     <el-dialog
@@ -393,13 +411,11 @@
               ></el-input>
             </el-form-item>
           </el-col>
-          <el-col :span="24">
-            <el-form-item
-              label="供应商"
-              label-width="130px"
-              class="supplier"
-              prop="supplierIdList"
-            >
+          <el-col
+            :span="24"
+            v-show="form.contractType == '1' || form.contractType == '2'"
+          >
+            <el-form-item label="供应商" label-width="130px" class="supplier">
               <!-- <treeSelect :options="esmInsCompanyList" @getValue="getValue" /> -->
               <treeselect
                 v-model="form.supplierIdList"
@@ -449,8 +465,9 @@
             <el-form-item
               label="失效日期"
               label-width="130px"
-              :rules="isRequired('expiringDate')"
+              :prop="form.isOpenContract == '0' ? 'expiringDate' : '1'"
             >
+              <!-- {{ form.contractType }} -->
               <el-date-picker
                 size="small"
                 v-model="form.expiringDate"
@@ -796,13 +813,6 @@
                   label-width="130px"
                   prop="isOpenContract"
                 >
-                  <!-- <treeSelect :options="data" /> -->
-                  <!-- <el-switch
-                v-model="item.isOpenContract"
-                active-text="是"
-                inactive-text="否"
-              >
-              </el-switch> -->
                   <el-radio v-model="item.isOpenContract" label="0"
                     >是</el-radio
                   >
@@ -828,11 +838,7 @@
                 </el-form-item>
               </el-col>
               <el-col :span="12">
-                <el-form-item
-                  label="失效日期"
-                  label-width="130px"
-                  :rules="isRequired('expiringDate')"
-                >
+                <el-form-item label="失效日期" label-width="130px">
                   <el-date-picker
                     size="small"
                     v-model="item.expiringDate"
@@ -1048,6 +1054,13 @@ export default {
             trigger: "change",
           },
         ],
+        expiringDate: [
+          {
+            required: true,
+            message: "请选择失效日期",
+            trigger: "change",
+          },
+        ],
       },
       pickerOptionsEnd: {
         disabledDate: (time) => {
@@ -1313,6 +1326,9 @@ export default {
                   this.$nextTick(() => {
                     this.$refs.ruleForm.clearValidate();
                   });
+                  this.getList();
+                } else {
+                  this.$message.success(res.msg);
                 }
               });
           } else {
@@ -1332,6 +1348,9 @@ export default {
                   this.$nextTick(() => {
                     this.$refs.ruleForm.clearValidate();
                   });
+                  this.getList();
+                } else {
+                  this.$message.success(res.msg);
                 }
               });
           }
@@ -1415,21 +1434,7 @@ export default {
         }
       });
     },
-    //必填项
-    isRequired() {
-      if (this.form.isOpenContract == "0") {
-        return {
-          type: "date",
-          required: true,
-          message: "请选择失效日期",
-          trigger: "change",
-        };
-      } else {
-        return {};
-      }
 
-      // return true;
-    },
     timeChange(type) {
       if (type == "year") {
         this.form.shouldPostponedEffectiveDate = moment(this.form.expiringDate)
@@ -1454,7 +1459,8 @@ export default {
       this.title = "新增";
       this.operation = "add";
       this.form = { ...this.resetForm };
-
+      this.form.filePathIdList = [];
+      this.fileIdList = [];
       this.$nextTick(() => {
         this.$refs.ruleForm.clearValidate();
       });

+ 22 - 9
src/views/FinancialManagement/ContractManagement/ContractStatement.vue

@@ -10,7 +10,7 @@
         <el-col :span="6">
           <el-form-item label="合同信息">
             <el-input
-              v-model="formInline.user"
+              v-model="formInline.contractCode"
               placeholder="请输入合同信息"
               size="small"
               style="width: 220px"
@@ -46,6 +46,8 @@
               size="small"
               v-model="formInline.contractType"
               style="width: 220px"
+              clearable
+              filterable
             >
               <el-option
                 v-for="item in contractTypeList"
@@ -59,8 +61,8 @@
 
         <el-col :span="6">
           <el-form-item label="   ">
-            <el-button type="primary" size="small" @click="getList"
-              >查询</el-button
+            <kt-button type="primary" size="small" @click="getList" label="查询"
+              >查询</kt-button
             >
             <!-- <el-button type="primary" size="small" @click="addContract"
               >新增</el-button
@@ -162,9 +164,13 @@
       </el-table-column>
       <el-table-column prop="operation" label="操作" width="180">
         <template slot-scope="scope">
-          <el-button size="small" type="primary" @click="watch(scope.row)"
-            >查看附件</el-button
-          >
+          <kt-button
+            size="small"
+            type="primary"
+            @click="watch(scope.row)"
+            label="查看附件"
+            perms="fnc:contract:reportFile"
+          ></kt-button>
         </template>
       </el-table-column>
     </el-table>
@@ -175,7 +181,7 @@
       :page-sizes="[10, 20, 30, 50]"
       :page-size="pageInfo.pageSize"
       layout=" sizes, prev, pager, next, jumper"
-      :total="0"
+      :total="pageInfo.total"
     >
     </el-pagination>
     <el-dialog title="附件" :visible.sync="fileDialog" width="50%">
@@ -193,8 +199,13 @@
                 margin-bottom: 10px;
               "
             >
-              <el-button type="primary" icon="el-icon-download" size="small"
-                >下载</el-button
+              <kt-button
+                type="primary"
+                icon="el-icon-download"
+                size="small"
+                label="下载"
+                perms="fnc:contract:reportDownloadFile"
+                >下载</kt-button
               >
             </div>
             <vue-office-docx
@@ -219,11 +230,13 @@ import VueOfficeDocx from "@vue-office/docx";
 import VueOfficePdf from "@vue-office/pdf";
 import "@vue-office/docx/lib/index.css";
 import { set } from "shelljs";
+import KtButton from "@/views/Core/KtButton";
 export default {
   components: {
     treeSelect,
     VueOfficeDocx,
     VueOfficePdf,
+    KtButton,
   },
   data() {
     return {