scorpio 2 years ago
parent
commit
d633b24d8c
1 changed files with 51 additions and 51 deletions
  1. 51 51
      src/views/contract/component/info2.vue

+ 51 - 51
src/views/contract/component/info2.vue

@@ -5,36 +5,36 @@
     </div>
     <div class="ml-20 mr-20 mt-20">
       <avue-crud
-          :option="option"
-          :data="data"
-          ref="crud"
-          v-model="form"
-          :before-open="beforeOpen"
-          @row-del="rowDel"
-          @row-save="handleRowSave"
-          @row-update="rowUpdate"
-          @on-load="onLoad"
+        :option="option"
+        :data="data"
+        ref="crud"
+        v-model="form"
+        :before-open="beforeOpen"
+        @row-del="rowDel"
+        @row-save="handleRowSave"
+        @row-update="rowUpdate"
+        @on-load="onLoad"
       >
         <template #fileIds-form="{ row, type }">
           <div v-if="type === 'view'">
-            <div v-if="form.accountInformationFileList && form.accountInformationFileList.length > 0"
-                 v-for="i in form.accountInformationFileList"
-                 :key="i.id"
-                 class="pointer"
-                 @click="previewFile(i)"
+            <div
+              v-for="i in form.accountInformationFileList"
+              :key="i.id"
+              class="pointer"
+              @click="previewFile(i)"
             >
               {{ i.title }}
               <el-button text type="primary" plain>查看</el-button>
             </div>
           </div>
-          <div v-if="type === 'edit'">
+          <div v-else-if="type === 'edit'">
             <div
-                v-if="
+              v-if="
                 form.accountInformationFileList &&
                 form.accountInformationFileList.length === 0
               "
             >
-              <uploads :max="9" @success="uploadSucc" :auto="true"/>
+              <uploads :max="9" @success="uploadSucc" :auto="true" />
               <div>
                 <div v-for="item in fileList" :key="item.id">
                   {{ item.originalFileName }}
@@ -42,17 +42,17 @@
               </div>
             </div>
             <div
-                v-for="i in form.accountInformationFileList"
-                :key="i.id"
-                class="pointer"
-                @click="removeFile(i)"
+              v-for="i in form.accountInformationFileList"
+              :key="i.id"
+              class="pointer"
+              @click="removeFile(i)"
             >
               {{ i.title }}
               <el-button text type="primary" plain>删除</el-button>
             </div>
           </div>
           <div v-else>
-            <uploads :max="9" @success="uploadSucc" :auto="true"/>
+            <uploads :max="9" @success="uploadSucc" :auto="true" />
             <div>
               <div v-for="item in fileList" :key="item.id">
                 {{ item.originalFileName }}
@@ -63,9 +63,9 @@
       </avue-crud>
     </div>
     <el-image-viewer
-        v-if="showImage"
-        :url-list="preList"
-        @close="showImage = false"
+      v-if="showImage"
+      :url-list="preList"
+      @close="showImage = false"
     />
   </div>
 </template>
@@ -76,7 +76,7 @@ import api from '@/api/index.js'
 
 export default {
   name: 'info',
-  components: {uploads},
+  components: { uploads },
   data() {
     return {
       id: '',
@@ -221,7 +221,7 @@ export default {
   },
   methods: {
     onLoad() {
-      this.$api.contract.ledgerList({contractId: this.id}).then(res => {
+      this.$api.contract.ledgerList({ contractId: this.id }).then(res => {
         if (res.code === 200) {
           this.data = res.data
         }
@@ -240,7 +240,7 @@ export default {
       if (api.offices.includes(item.suffix)) {
         const routeData = this.$router.resolve({
           path: '/home/file_detail',
-          query: {id: item.fileId}
+          query: { id: item.fileId }
         })
         window.open(routeData.href, '_blank')
       } else {
@@ -255,12 +255,12 @@ export default {
       }).then(res => {
         if (res === 'confirm') {
           console.log(item)
-          this.$api.contract.voucherDel({ids: item.id}).then(res => {
+          this.$api.contract.voucherDel({ ids: item.id }).then(res => {
             if (res.code === 200) {
               this.form.accountInformationFileList =
-                  this.form.accountInformationFileList.filter(
-                      sub => sub.id !== item.id
-                  )
+                this.form.accountInformationFileList.filter(
+                  sub => sub.id !== item.id
+                )
             }
           })
         }
@@ -268,31 +268,31 @@ export default {
     },
     rowUpdate(row, index, done, loading) {
       loading()
-      const data = Object.assign(this.form, {contractId: this.id})
+      const data = Object.assign(this.form, { contractId: this.id })
       this.$api.contract.ledgerUpdate(data).then(
-          res => {
-            if (res.code === 200) {
-              this.$message.success(res.msg)
-            } else {
-              this.$message.error(res.msg)
-            }
-            done(row)
-            this.onLoad()
-          },
-          error => {
-            window.console.log(error)
-            loading()
+        res => {
+          if (res.code === 200) {
+            this.$message.success(res.msg)
+          } else {
+            this.$message.error(res.msg)
           }
+          done(row)
+          this.onLoad()
+        },
+        error => {
+          window.console.log(error)
+          loading()
+        }
       )
     },
     handleRowSave(row, done, loading) {
       loading()
-      const data = Object.assign(row, {contractId: this.id})
+      const data = Object.assign(row, { contractId: this.id })
       this.$confirm(
-          '请检查并确认所填写内容是否正确,系统将会根据填写内容,计算合同付款等相关数据!',
-          {
-            type: 'warning'
-          }
+        '请检查并确认所填写内容是否正确,系统将会根据填写内容,计算合同付款等相关数据!',
+        {
+          type: 'warning'
+        }
       ).then(res => {
         if (res === 'confirm') {
           this.$api.contract.ledgerAdd(data).then(res => {
@@ -309,7 +309,7 @@ export default {
         type: 'warning'
       }).then(res => {
         if (res === 'confirm') {
-          this.$api.contract.remove({ids: row.id}).then(res => {
+          this.$api.contract.remove({ ids: row.id }).then(res => {
             if (res.code === 200) {
               this.$message.success(res.msg)
               this.onLoad()