scorpio 2 سال پیش
والد
کامیت
09d462bc6c
3فایلهای تغییر یافته به همراه55 افزوده شده و 25 حذف شده
  1. 11 0
      src/api/contract/index.js
  2. 23 4
      src/views/contract/detail.vue
  3. 21 21
      src/views/contract/index.vue

+ 11 - 0
src/api/contract/index.js

@@ -12,5 +12,16 @@ export default {
       params,
       'post'
     )
+  },
+  /**
+   * 详情
+   * @param params
+   */
+  detail(params) {
+    return fetch(
+      '/blade-project-manage-v2/contracts-manage/v2/detail',
+      params,
+      'post'
+    )
   }
 }

+ 23 - 4
src/views/contract/detail.vue

@@ -5,21 +5,21 @@
       class="mb-20"
       style="min-height: 430px; padding: 0; width: 99%"
     >
-      <info :info="info"></info>
+      <info :info="detail"></info>
     </el-card>
     <el-card
       shadow="hover"
       class="mb-20"
       style="min-height: 430px; padding: 0; width: 99%"
     >
-      <info2 :info="info"></info2>
+      <info2 :info="detail"></info2>
     </el-card>
     <el-card
       shadow="hover"
       class="mb-20"
       style="min-height: 430px; padding: 0; width: 99%"
     >
-      <info3 :info="info"></info3>
+      <info3 :info="detail"></info3>
     </el-card>
   </div>
 </template>
@@ -35,7 +35,26 @@ import info2 from '@/views/contract/component/info2.vue'
 import info3 from '@/views/contract/component/info3.vue'
 
 export default {
-  components: { info, info2, info3 }
+  components: { info, info2, info3 },
+  data() {
+    return {
+      id: '',
+      detail: null
+    }
+  },
+  created() {
+    this.id = this.$route.query.id
+    this.getDetail()
+  },
+  methods: {
+    getDetail() {
+      this.$api.contract.detail({ id: this.id }).then(res => {
+        if (res.code === 200) {
+          this.detail = res.data
+        }
+      })
+    }
+  }
 }
 </script>
 

+ 21 - 21
src/views/contract/index.vue

@@ -58,7 +58,7 @@
 
 <route>
 {
-name: '合同信息',
+name: '合同管理',
 meta: { layout: 'empty'}
 }
 </route>
@@ -71,12 +71,7 @@ export default {
     return {
       projectId: '',
       form: {},
-      data: [
-        {
-          id: 3,
-          prop: 'ooooo'
-        }
-      ],
+      data: [],
       option: {
         align: 'center',
         menuAlign: 'center',
@@ -93,43 +88,48 @@ export default {
         column: [
           {
             label: '合同名称',
-            prop: 'noticeType'
+            prop: 'title'
           },
           {
             label: '合同编号',
-            prop: 'noticeType'
+            prop: 'number'
           },
           {
             label: '合同金额',
-            prop: 'noticeType'
+            prop: 'amount'
           },
           {
             label: '已付金额',
-            prop: 'noticeType'
+            prop: 'paymentAmount'
           },
           {
             label: '未付金额',
-            prop: 'noticeType'
+            prop: 'notPaymentAmount'
           },
           {
-            label: '合同类型',
-            prop: 'noticeType'
+            label: '合同类别',
+            prop: 'type',
+            dicUrl: '/api/blade-system/dict-biz/dictionary?code=contract-type',
+            props: {
+              label: 'dictValue',
+              value: 'dictKey'
+            }
           },
           {
-            label: '签订对方',
-            prop: 'noticeType'
+            label: '签订方',
+            prop: 'partyB'
           },
           {
             label: '签订日期',
-            prop: 'noticeType'
+            prop: 'signTime'
           },
           {
             label: '合同状态',
-            prop: 'noticeType'
+            prop: 'contractsStatus'
           },
           {
             label: '到期日期',
-            prop: 'noticeType'
+            prop: 'expireTime'
           }
         ]
       },
@@ -170,7 +170,7 @@ export default {
       this.$api.contract
         .contractList(Object.assign(this.page, data))
         .then(res => {
-          console.log(res)
+          this.data = res.data.records
         })
         .finally(() => {
           this.loading = false
@@ -180,7 +180,7 @@ export default {
       if (type === 'view') {
         const data = this.$router.resolve({
           path: '/contract/detail',
-          query: { id: this.form.projectId }
+          query: { id: this.form.id }
         })
         window.open(data.href, '_blank')
       }