Browse Source

fix(分账管理):分账字段修改

sufan 7 months ago
parent
commit
aaff819203
2 changed files with 80 additions and 60 deletions
  1. 71 52
      src/views/divideAccountsManage/edit.vue
  2. 9 8
      src/views/divideAccountsManage/index.vue

+ 71 - 52
src/views/divideAccountsManage/edit.vue

@@ -7,8 +7,8 @@
       </el-form-item>
       <el-form-item label="标签">
         <el-radio-group v-model="ledgerAccountBasicInfo.label" disabled>
-          <el-radio :label="1">下游回款</el-radio>
-          <el-radio :label="0">上游回购</el-radio>
+          <el-radio :label="0">下游回款</el-radio>
+          <el-radio :label="1">上游回购</el-radio>
         </el-radio-group>
       </el-form-item>
       <el-form-item label="分账单号">
@@ -29,13 +29,13 @@
           <cy-amount-input v-model="ledgerAccountBasicInfo.discountCharge" disabled placeholder="请输入贴现费用" />
         </el-form-item>
         <el-form-item label="说明" class="two-form-item">
-          <el-input v-model="ruleForm.remark" placeholder="请输入说明" />
+          <el-input v-model="ruleForm.remark" placeholder="请输入说明" :disabled="disabled" />
         </el-form-item>
       </template>
 
       <cy-info-title>
         货款分配
-        <div slot="right">
+        <div v-if="!disabled" slot="right">
           <el-button type="text" @click="oneCalc('click')">一键计算</el-button>
           <el-button type="primary" @click="financingGoods">选择已融资货物</el-button>
           <el-button type="primary" @click="acceptanceGoods">选择已验收货物</el-button>
@@ -75,10 +75,10 @@
         <cy-amount-input v-model="goodsMoney" disabled placeholder="请输入货款金额" />
       </el-form-item>
       <el-form-item v-if="ledgerAccountBasicInfo.ledgerTypeDict.code === 'entryType_bills_discounted'" label="贴现费用" class="one-form-item">
-        <cy-amount-input v-model="ruleForm.name" disabled placeholder="请输入贴现费用" />
+        <cy-amount-input v-model="ledgerAccountBasicInfo.discountCharge" disabled placeholder="请输入贴现费用" />
       </el-form-item>
     </el-form>
-    <div class="submit-btn">
+    <div v-if="!disabled" class="submit-btn">
       <el-button @click="() => { this.$router.go(-1) }">取消</el-button>
       <el-button type="primary" @click="submit">提交</el-button>
     </div>
@@ -153,7 +153,8 @@ export default {
       selectFinancingGoodsList: [],
       selectAcceptanceGoodsList: [],
       oneCalcStatus: false,
-      incomePlanData: {}
+      incomePlanData: {},
+      disabled: false
     }
   },
   computed: {
@@ -244,7 +245,7 @@ export default {
           prop: 'currentAssignAmount',
           width: '160',
           render: (h, row) => {
-            return <cy-amount-input v-model={row.currentAssignAmount} placeholder='请输入本次分配金额' onBlur={ this.oneCalc }></cy-amount-input>
+            return <cy-amount-input disabled={this.disabled} v-model={row.currentAssignAmount} placeholder='请输入本次分配金额' onBlur={ this.oneCalc }></cy-amount-input>
           }
         },
         {
@@ -253,7 +254,19 @@ export default {
           showTooltip: true,
           width: '80',
           render: (h, row) => {
-            return <el-select v-model={ row.accrual } onChange={() => { this.oneCalc('click') }} placeholder='请选择是否计提'>
+            return <el-select v-model={ row.accrual } disabled={this.disabled} onChange={() => { this.oneCalc('click') }} placeholder='请选择是否计提'>
+              <el-option label='是' value={true}></el-option>
+              <el-option label='否' value={false}></el-option>
+            </el-select>
+          }
+        },
+        {
+          label: '是否分配逾期利息',
+          prop: 'hasAssignOverdueInterest',
+          showTooltip: true,
+          width: '80',
+          render: (h, row) => {
+            return <el-select disabled={this.disabled} v-model={ row.hasAssignOverdueInterest } onChange={() => { this.oneCalc('click') }} placeholder='请选择是否'>
               <el-option label='是' value={true}></el-option>
               <el-option label='否' value={false}></el-option>
             </el-select>
@@ -266,16 +279,19 @@ export default {
           show: this.oneCalcStatus,
           width: '120',
           render: (h, row) => {
-            const data = this.handlerMoneyEmpty(row.financingOverdueInterest)
-            let list = []
-            if (row.financingOverdueInterestList.length) {
-              list = row.financingOverdueInterestList.map(item => {
-                return <el-option label={ item.label } value={ item.value }></el-option>
-              })
-            }
-            return row.financingOverdueInterestList.length ? <el-select v-model={ row.financingOverdueInterest }>
-              { list }
-            </el-select> : data
+            return <span> { this.handlerMoneyEmpty(row.financingOverdueInterest) }</span>
+          }
+        },
+        {
+          label: '是否分配融资利息',
+          prop: 'hasAssignInterest',
+          showTooltip: true,
+          width: '80',
+          render: (h, row) => {
+            return <el-select disabled={this.disabled} v-model={ row.hasAssignInterest } onChange={() => { this.oneCalc('click') }} placeholder='请选择是否'>
+              <el-option label='是' value={true}></el-option>
+              <el-option label='否' value={false}></el-option>
+            </el-select>
           }
         },
         {
@@ -285,16 +301,19 @@ export default {
           show: this.oneCalcStatus,
           width: '120',
           render: (h, row) => {
-            const data = this.handlerMoneyEmpty(row.financingInterest)
-            let list = []
-            if (row.financingInterestList.length) {
-              list = row.financingInterestList.map(item => {
-                return <el-option label={ item.label } value={ item.value }></el-option>
-              })
-            }
-            return row.financingInterestList.length ? <el-select v-model={ row.financingInterest }>
-              { list }
-            </el-select> : data
+            return <span> { this.handlerMoneyEmpty(row.financingInterest) }</span>
+          }
+        },
+        {
+          label: '是否分配管理费',
+          prop: 'hasAssignManagementFee',
+          showTooltip: true,
+          width: '80',
+          render: (h, row) => {
+            return <el-select disabled={this.disabled} v-model={ row.hasAssignManagementFee } onChange={() => { this.oneCalc('click') }} placeholder='请选择是否'>
+              <el-option label='是' value={true}></el-option>
+              <el-option label='否' value={false}></el-option>
+            </el-select>
           }
         },
         {
@@ -304,16 +323,7 @@ export default {
           showTooltip: true,
           show: this.oneCalcStatus,
           render: (h, row) => {
-            const data = this.handlerMoneyEmpty(row.financingManagementFee)
-            let list = []
-            if (row.financingManagementFeeList.length) {
-              list = row.financingManagementFeeList.map(item => {
-                return <el-option label={ item.label } value={ item.value }></el-option>
-              })
-            }
-            return row.financingManagementFeeList.length ? <el-select v-model={ row.financingManagementFee }>
-              { list }
-            </el-select> : data
+            return <span> { this.handlerMoneyEmpty(row.financingManagementFee) }</span>
           }
 
         },
@@ -389,6 +399,7 @@ export default {
         {
           label: '操作',
           width: '100',
+          show: !this.disabled,
           render: (h, row, index) => {
             const btnList = [
               { msg: '删除', icon: 'el-icon-delete', category: 'delete' }
@@ -413,6 +424,10 @@ export default {
   },
   created() {
     this.getDetails()
+    const { type } = this.$route.query
+    if (type === 'see') {
+      this.disabled = true
+    }
   },
   methods: {
     getDetails() {
@@ -487,6 +502,9 @@ export default {
       ]
       this.loanTableData = this.loanTableData.map(item => {
         if (!item.accrual) item.accrual = false
+        if (!item.hasAssignInterest) item.hasAssignInterest = true
+        if (!item.hasAssignManagementFee) item.hasAssignManagementFee = true
+        if (!item.hasAssignOverdueInterest) item.hasAssignOverdueInterest = true
         return item
       })
       this.paymentAccountClick()
@@ -510,22 +528,23 @@ export default {
         const params = {
           Loading: true,
           ledgerAccountBasicInfo: this.ledgerAccountBasicInfo,
-          goodsAssignList: this.loanTableData.map(item => {
-            delete item.financingOverdueInterestList
-            delete item.financingInterestList
-            delete item.financingManagementFeeList
-            return item
-          })
+          goodsAssignList: this.loanTableData
+          // this.loanTableData.map(item => {
+          //   delete item.financingOverdueInterestList
+          //   delete item.financingInterestList
+          //   delete item.financingManagementFeeList
+          //   return item
+          // })
         }
         getCalculateAssign(params).then(({ data }) => {
           const { goodsAssignList } = data
-          const goodsAssignListDeep = goodsAssignList.map(item => {
-            item.financingOverdueInterestList = this.handlerGoodsData(item.financingOverdueInterest)
-            item.financingInterestList = this.handlerGoodsData(item.financingInterest)
-            item.financingManagementFeeList = this.handlerGoodsData(item.financingManagementFee)
-            return item
-          })
-          this.loanTableData = JSON.parse(JSON.stringify(goodsAssignListDeep))
+          // const goodsAssignListDeep = goodsAssignList.map(item => {
+          //   item.financingOverdueInterestList = this.handlerGoodsData(item.financingOverdueInterest)
+          //   item.financingInterestList = this.handlerGoodsData(item.financingInterest)
+          //   item.financingManagementFeeList = this.handlerGoodsData(item.financingManagementFee)
+          //   return item
+          // })
+          this.loanTableData = JSON.parse(JSON.stringify(goodsAssignList))
           this.oneCalcStatus = true
           resolve()
         })

+ 9 - 8
src/views/divideAccountsManage/index.vue

@@ -264,14 +264,15 @@ export default {
       })
     },
     handlerOperate(type, row) {
-      if (type === 'edit') {
-        this.$router.push({
-          name: 'DivideAccountEdit',
-          params: {
-            id: row.id
-          }
-        })
-      }
+      this.$router.push({
+        name: 'DivideAccountEdit',
+        params: {
+          id: row.id
+        },
+        query: {
+          type
+        }
+      })
     }
   }
 }