Browse Source

Fix: 供应商收付款

chris 2 years ago
parent
commit
b27f9c06ec

+ 8 - 0
src/api/finance.js

@@ -53,6 +53,14 @@ export function getSupplierAccountInfo (params) {
   })
 }
 
+// 供应商账款明细详情接口
+export function getSupplierAccountDetail (id) {
+  return request({
+    url: request.adornUrl(`/biz-service/finance/supplier/account/info/${id}`),
+    method: 'get'
+  })
+}
+
 // 供应商开票明细
 export function getSupplierInvoiceInfo (params) {
   return request({

+ 19 - 45
src/views/modules/finance/supplier-account-add-or-update.vue

@@ -58,11 +58,11 @@
         <el-row class="my-row">
           <el-col :span="15">
             <el-form-item label="备注说明" prop="notes">
-              <el-input type="textarea" 
-                v-model="dataForm.notes" 
-                :rows="4" 
+              <el-input type="textarea"
+                v-model="dataForm.notes"
+                :rows="4"
                 maxlength="300"
-                show-word-limit 
+                show-word-limit
                 placeholder="备注说明"></el-input>
             </el-form-item>
           </el-col>
@@ -70,7 +70,7 @@
         <el-row class="my-row">
           <upload-component :title="'附件'" :accept="'*'" :file-obj-list="fileList" @uploadSuccess="uploadSuccess"/>
         </el-row>
-         
+
       </el-form>
       <span slot="footer" class="dialog-footer">
         <el-button @click="onChose">取消</el-button>
@@ -81,6 +81,7 @@
 
 <script>
 import uploadComponent from '../common/upload-component'
+import { getSupplierAccountDetail } from '@/api/finance'
 export default {
   name: 'supplier-account-add-or-update',
   components: {
@@ -131,7 +132,6 @@ export default {
   },
   methods: {
     onChose () {
-      console.log(5555)
       this.$emit('onChose')
     },
     async init (id, supplierAccount, supplierId, formDisable) {
@@ -140,47 +140,22 @@ export default {
       this.formDisable = formDisable
       this.fileList = []
       if (id && supplierAccount) {
-        this.dataForm = {
-          supplierAccountId: id,
-          supplierAccountCode: supplierAccount.supplierAccountCode,
-          type: supplierAccount.type,
-          contractNumber: supplierAccount.contractNumber,
-          receivedPaidTime: supplierAccount.receivedPaidTime,
-          currency: supplierAccount.currency,
-          receivedPaidAmount: supplierAccount.receivedPaidAmount,
-          notes: supplierAccount.notes
-        }
-        supplierAccount.attachList && supplierAccount.attachList.forEach((item) => {
-          this.fileList.push({
-            name: item.fileName,
-            url: item.url,
-            id: item.url
-          })
+        getSupplierAccountDetail(id).then(({ data }) => {
+          if (data && data.code === '200') {
+            this.dataForm = data.data
+          }
+          if (data.data.attachList) {
+            data.data.attachList.forEach((item) => {
+              this.fileList.push({
+                name: item.fileName,
+                url: item.url,
+                id: item.url
+              })
+            })
+          }
         })
       }
       this.dataForm.supplierId = supplierId
-      // await getCustomer().then(({data}) => {
-      //   if (data && data.code === '200') {
-      //     this.optionsCus = data.data
-      //   }
-      // })
-      // if (!id) return
-      // await getSaleInvoiceDetail(this.id).then(({data}) => {
-      //   if (data && data.code === '200') {
-      //     this.dataForm = data.data
-      //     // 文件列表
-      //     this.fileList = []
-      //     if (data.data.attachList) {
-      //       data.data.attachList.forEach((item) => {
-      //         this.fileList.push({
-      //           name: item.fileName,
-      //           url: item.url,
-      //           id: item.url
-      //         })
-      //       })
-      //     }
-      //   }
-      // })
     },
     validateField (type) {
       this.$refs.dataForm.validateField(type)
@@ -203,7 +178,6 @@ export default {
             this.$message.error('请上传文件')
             return
           }
-          // let finSalesInvoice = {finSalesInvoice: this.dataForm}
           this.$http({
             url: !this.id ? this.$http.adornUrl(`/biz-service/finance/supplier/account/save`) : this.$http.adornUrl(`/biz-service/finance/supplier/account/update`),
             method: 'post',

+ 14 - 21
src/views/modules/finance/supplier-account-detail.vue

@@ -1,9 +1,4 @@
 <template>
-  <!-- <el-dialog
-    title="查看"
-    width="70%"
-    :close-on-click-modal="false"
-    :visible.sync="visible"> -->
   <div>
     <div class="my-title">查看</div>
     <div style="margin-left: 20px;margin-right: 20px">
@@ -30,6 +25,7 @@
   import EDesc from '../common/e-desc'
   import EDescItem from '../common/e-desc-item'
   import uploadComponent from '../common/upload-component'
+  import { getSupplierAccountDetail } from '@/api/finance'
   export default {
     name: 'supplier-account-detail',
     components: {
@@ -89,22 +85,19 @@
         this.id = id || 0
         this.fileList = []
         if (id && supplierAccount) {
-          this.dataForm = {
-            supplierAccountId: id,
-            supplierAccountCode: supplierAccount.supplierAccountCode,
-            type: supplierAccount.type,
-            contractNumber: supplierAccount.contractNumber,
-            receivedPaidTime: supplierAccount.receivedPaidTime,
-            currency: supplierAccount.currency,
-            receivedPaidAmount: supplierAccount.receivedPaidAmount,
-            notes: supplierAccount.notes
-          }
-          supplierAccount.attachList && supplierAccount.attachList.forEach((item) => {
-            this.fileList.push({
-              name: item.fileName,
-              url: item.url,
-              id: item.url
-            })
+          getSupplierAccountDetail(id).then(({ data }) => {
+            if (data && data.code === '200') {
+              this.dataForm = data.data
+            }
+            if (data.data.attachList) {
+              data.data.attachList.forEach((item) => {
+                this.fileList.push({
+                  name: item.fileName,
+                  url: item.url,
+                  id: item.url
+                })
+              })
+            }
           })
         }
         this.dataForm.supplierId = supplierId

+ 3 - 5
src/views/modules/finance/supplier-account-list.vue

@@ -1,3 +1,4 @@
+<-- 供应商账款 -->
 <template>
   <div class="supplier-account-list">
     <template v-if="!detailVisible && !addOrUpdateVisible">
@@ -7,7 +8,7 @@
         </el-form-item>
         <el-form-item>
           <el-button @click="search()">查询</el-button>
-          <el-button v-if="isAuth('finance:purchase-invoice:save')" type="primary" @click="addOrUpdateHandle(0, false)">新增收付款</el-button>
+          <el-button v-if="isAuth('fin:supplier:save')" type="primary" @click="addOrUpdateHandle(0, false)">新增收付款</el-button>
         </el-form-item>
       </el-form>
       <el-table
@@ -82,7 +83,7 @@
           label="操作">
           <template slot-scope="scope">
             <el-button v-if="true" type="text" size="small" @refreshDataList="getDataList" @click="detailHandle(scope.row.supplierAccountId, scope.row)">详情</el-button>
-            <el-button v-if="true" type="text" size="small" @refreshDataList="getDataList" @click="addOrUpdateHandle(scope.row.supplierAccountId, scope.row, false)">编辑</el-button>
+            <el-button v-if="isAuth('fin:supplier:update')" type="text" size="small" @refreshDataList="getDataList" @click="addOrUpdateHandle(scope.row.supplierAccountId, scope.row, false)">编辑</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -148,7 +149,6 @@
     },
     methods: {
       onClose () {
-        console.log(3333)
         this.addOrUpdateVisible = false
         this.detailVisible = false
         this.$emit('changeDetailShow', false)
@@ -160,7 +160,6 @@
       },
       // 获取数据列表
       getDataList () {
-        console.log(this.supplierId, 'uuuuu')
         this.dataListLoading = true
         let params = {
           'current': this.pageIndex,
@@ -211,7 +210,6 @@
       },
       // 新增/修改
       addOrUpdateHandle (id, supplierAccount, disable) {
-        console.log(supplierAccount)
         this.addOrUpdateVisible = true
         this.$nextTick(() => {
           this.$refs.addOrUpdate.init(id, supplierAccount, this.supplierId, disable)

+ 1 - 3
src/views/modules/finance/supplier-detail.vue

@@ -11,7 +11,7 @@
   <account-list v-if="activeName === 'account' && supplierId" ref="accountList" :supplier-id="supplierId" @changeDetailShow="changeDetailShow"/>
   <invoice-list v-if="activeName === 'invoice' && supplierId" ref="InvoiceList" :supplier-id="supplierId" @changeDetailShow="changeDetailShow"/>
   </div>
-  
+
 </template>
 
 <script>
@@ -31,7 +31,6 @@
     },
     methods: {
       onChose () {
-        console.log(1111)
         this.$emit('onChose')
       },
       async init (supplierId) {
@@ -41,7 +40,6 @@
         // console.log(tab, event)
       },
       changeDetailShow (flag) {
-        console.log(flag)
         this.detailShow = flag
       }
     }