Browse Source

Fix:账款明细新增修改问题

chris 2 năm trước cách đây
mục cha
commit
49221e5999

+ 8 - 0
src/api/finance.js

@@ -18,6 +18,14 @@ export function getCustomerAccountInfo (params) {
   })
 }
 
+// 客户账款明细详情接口
+export function getCustomerAccountDetail (id) {
+  return request({
+    url: request.adornUrl(`/biz-service/finance/customer/account/info/${id}`),
+    method: 'get'
+  })
+}
+
 // 客户账款开票明细
 export function getCustomerInvoiceInfo (params) {
   return request({

+ 0 - 1
src/views/modules/check/fc-detail.vue

@@ -109,7 +109,6 @@
         this.$emit('onChose')
       },
       async init (id) {
-        console.log('id = ' + id)
         this.visible = true
         this.dataForm = {}
         await getFinishedInspectionDetail(id).then(({data}) => {

+ 0 - 1
src/views/modules/check/pc-detail.vue

@@ -64,7 +64,6 @@
         this.$emit('onChose')
       },
       async init (id) {
-        console.log('id = ' + id)
         this.visible = true
         this.dataForm = {}
         await getProInspectionDetail(id).then(({data}) => {

+ 20 - 45
src/views/modules/finance/customer-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 { getCustomerAccountDetail } from '@/api/finance'
 export default {
   name: 'customer-account-add-or-update',
   components: {
@@ -131,56 +132,30 @@ export default {
   },
   methods: {
     onChose () {
-      console.log(5555)
       this.$emit('onChose')
     },
     async init (id, customerAccount, customerId, formDisable) {
       this.visible = true
+      this.fileList = []
       this.id = id || 0
       this.formDisable = formDisable
-      this.fileList = []
       if (id && customerAccount) {
-        this.dataForm = {
-          customerAccountId: id,
-          customerAccountCode: customerAccount.customerAccountCode,
-          type: customerAccount.type,
-          contractNumber: customerAccount.contractNumber,
-          receivedPaidTime: customerAccount.receivedPaidTime,
-          currency: customerAccount.currency,
-          receivedPaidAmount: customerAccount.receivedPaidAmount,
-          notes: customerAccount.notes
-        }
-        customerAccount.attachList && customerAccount.attachList.forEach((item) => {
-          this.fileList.push({
-            name: item.fileName,
-            url: item.url,
-            id: item.url
-          })
+        getCustomerAccountDetail(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.customerId = customerId
-      // 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)

+ 14 - 16
src/views/modules/finance/customer-account-detail.vue

@@ -31,6 +31,7 @@
   import EDesc from '../common/e-desc'
   import EDescItem from '../common/e-desc-item'
   import uploadComponent from '../common/upload-component'
+  import { getCustomerAccountDetail } from '@/api/finance'
   export default {
     name: 'customer-account-detail',
     components: {
@@ -90,22 +91,19 @@
         this.id = id || 0
         this.fileList = []
         if (id && customerAccount) {
-          this.dataForm = {
-            customerAccountId: id,
-            customerAccountCode: customerAccount.customerAccountCode,
-            type: customerAccount.type,
-            contractNumber: customerAccount.contractNumber,
-            receivedPaidTime: customerAccount.receivedPaidTime,
-            currency: customerAccount.currency,
-            receivedPaidAmount: customerAccount.receivedPaidAmount,
-            notes: customerAccount.notes
-          }
-          customerAccount.attachList && customerAccount.attachList.forEach((item) => {
-            this.fileList.push({
-              name: item.fileName,
-              url: item.url,
-              id: item.url
-            })
+          getCustomerAccountDetail(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.customerId = customerId

+ 2 - 5
src/views/modules/finance/customer-account-list.vue

@@ -7,7 +7,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:customer:save')" type="primary" @click="addOrUpdateHandle(0, false)">新增收付款</el-button>
         </el-form-item>
       </el-form>
       <el-table
@@ -82,7 +82,7 @@
           label="操作">
           <template slot-scope="scope">
             <el-button v-if="true" type="text" size="small"  @click="detailHandle(scope.row.customerAccountId, scope.row)">详情</el-button>
-            <el-button v-if="true" type="text" size="small" @refreshDataList="getDataList" @click="addOrUpdateHandle(scope.row.customerAccountId, scope.row, false)">编辑</el-button>
+            <el-button v-if="isAuth('fin:customer:update')" type="text" size="small" @refreshDataList="getDataList" @click="addOrUpdateHandle(scope.row.customerAccountId, scope.row, false)">编辑</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -157,7 +157,6 @@
     },
     methods: {
       onClose () {
-        console.log(3333)
         this.addOrUpdateVisible = false
         this.detailVisible = false
         this.$emit('changeDetailShow', false)
@@ -169,7 +168,6 @@
       },
       // 获取数据列表
       getDataList () {
-        console.log(this.customerId, 'uuuuu')
         this.dataListLoading = true
         let params = {
           'current': this.pageIndex,
@@ -221,7 +219,6 @@
       },
       // 新增/修改
       addOrUpdateHandle (id, customerAccount, disable) {
-        console.log(customerAccount)
         this.addOrUpdateVisible = true
         this.$nextTick(() => {
           this.$refs.addOrUpdate.init(id, customerAccount, this.customerId, disable)