lilei преди 3 години
родител
ревизия
ec775ddb28

+ 4 - 4
src/views/common/settleAccount.js

@@ -62,16 +62,16 @@ const SettleAccount = {
     },
     handleChange(value) {
       this.defaultVal = value;
-      const settleStyleName = this.list.find(item => item[this.defValKey] == value).accountName
+      const accountName = this.list.find(item => item[this.defValKey] == value).accountName
       this.$emit('input', value);
-      this.$emit('change', this.value, settleStyleName);
+      this.$emit('change', this.value, accountName);
     },
     // 列表数据
     getList () {
       const _this = this
-      settleAccountList({settleStyleSn: this.settleStyleSn,pageNo:1,pageSize:500}).then(res => {
+      settleAccountList({settleStyleSn: this.settleStyleSn,pageNo:1,pageSize:500,state:'ENABLE'}).then(res => {
         if (res.status == 200) {
-          _this.list = res.data || []
+          _this.list = res.data.list || []
         } else {
           _this.list = []
         }

+ 41 - 19
src/views/financialManagement/companyReceivablePayable/collectionPayment.vue

@@ -121,9 +121,23 @@
                 </a-col>
                 <a-col span="12">
                   <a-form-model-item label="结算方式" prop="settleStyleSn">
-                    <a-select id="collectionPayment-settleStyleSn" v-model="form.settleStyleSn" placeholder="请选择结算方式" allowClear>
-                      <a-select-option v-for="item in settleStyleList" :value="item.settleStyleSn" :key="item.settleStyleSn">{{ item.name }}</a-select-option>
-                    </a-select>
+                    <settleStyle
+                      id="collectionPayment-settleStyleSn"
+                      v-model="form.settleStyleSn"
+                      @change="settleStyleChange"
+                      placeholder="请选择结算方式">
+                    </settleStyle>
+                  </a-form-model-item>
+                </a-col>
+                <a-col span="12">
+                  <a-form-model-item v-if="enableFundAccount" label="结算账户" prop="settleAccountSn">
+                    <settleAccount
+                      id="collectionPayment-settleAccountSn"
+                      v-model="form.settleAccountSn"
+                      :settleStyleSn="form.settleStyleSn"
+                      @change="settleAccountChange"
+                      placeholder="请选择结算账户">
+                    </settleAccount>
                   </a-form-model-item>
                 </a-col>
                 <a-col span="24">
@@ -159,16 +173,18 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import { mapActions } from 'vuex'
 import debounce from 'lodash/debounce'
 import { STable, VSelect } from '@/components'
 import chooseBillModal from './chooseBillModal.vue'
-import { settleStyleQueryAll } from '@/api/settleStyle'
 import { settleUnitSave, settleUnitPrint, settleUnitExport, settleInfoAllList } from '@/api/settle'
 import Print from '@/views/common/print.vue'
+import settleStyle from '@/views/common/settleStyle'
+import settleAccount from '@/views/common/settleAccount'
 import { hdPrint } from '@/libs/JGPrint'
 export default {
   name: 'CollectionPaymentDetail',
-  components: { STable, VSelect, chooseBillModal, Print },
+  components: { STable, VSelect, chooseBillModal, Print, settleStyle, settleAccount },
   mixins: [commonMixin],
   data () {
     this.amountSettledChange = debounce(this.amountSettledChange, 800)
@@ -192,7 +208,6 @@ export default {
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ],
       chooseLoadData: [],
-      settleStyleList: [], //  结算方式
       formItemLayout: {
         labelCol: { span: 6 },
         wrapperCol: { span: 16 }
@@ -202,17 +217,21 @@ export default {
         discountAmount: 0, //  折让金额
         settleStyleSn: undefined,
         settleClientName: '',
+        settleAccountSn: undefined,
+        settleAccountName: undefined,
         remark: ''
       },
       rules: {
         amountSettled: [{ required: true, message: '请输入本次结算金额,系统将自动分配到已选单据上', trigger: 'change' }],
         discountAmount: [{ required: true, message: '请输入折让金额', trigger: 'blur' }],
-        settleStyleSn: [{ required: true, message: '请选择结算方式', trigger: 'change' }]
+        settleStyleSn: [{ required: true, message: '请选择结算方式', trigger: 'change' }],
+        settleAccountSn: [{ required: true, message: '请选择结算账户', trigger: 'change' }]
       },
       openModal: false, //  弹框
       isPositive: true, // 是否是正值
       isChangeAs: false,
-      maxAmountSettled: 0
+      maxAmountSettled: 0,
+      enableFundAccount: false
     }
   },
   computed: {
@@ -247,6 +266,7 @@ export default {
     }
   },
   methods: {
+    ...mapActions(['GetSettleAccountState']),
     // 打印预览/快捷打印
     handlePrint (type, printerType) {
       const _this = this
@@ -261,6 +281,13 @@ export default {
         _this.spinning = false
       })
     },
+    // 选择结算方式
+    settleStyleChange (v, name) {
+      this.form.settleStyleName = name
+    },
+    settleAccountChange (v, name) {
+      this.form.settleAccountName = name
+    },
     // 应结算金额
     amountSettledChange () {
       console.log(this.isChangeAs)
@@ -370,16 +397,6 @@ export default {
       })
       this.amountSettledChange()
     },
-    //  结算方式
-    getSettleStyle () {
-      settleStyleQueryAll({}).then(res => {
-        if (res.status == 200) {
-          this.settleStyleList = res.data
-        } else {
-          this.settleStyleList = []
-        }
-      })
-    },
     // 返回列表
     handleBack () {
       this.$router.push({ path: `/financialManagement/companyReceivablePayable/list` })
@@ -399,7 +416,6 @@ export default {
       })
     },
     pageInit () {
-      this.getSettleStyle()
       this.chooseLoadData = []
       this.getsettleInfoAllList()
     }
@@ -414,6 +430,12 @@ export default {
     if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
       this.pageInit()
     }
+    // 结算账户状态查询
+    this.GetSettleAccountState().then(res => {
+      if (res.status == 200) {
+        this.enableFundAccount = res.data.functionEnableFlag == 1
+      }
+    })
   },
   beforeRouteEnter (to, from, next) {
     next(vm => {})

+ 10 - 6
src/views/financialManagement/expenseManagement/edit.vue

@@ -54,6 +54,7 @@
           <a-form-model-item v-if="enableFundAccount" label="结算账户" prop="settleAccountSn">
             <settleAccount
               id="expenseManagementEdit-settleAccountSn"
+              ref="settleAcount"
               v-model="form.settleAccountSn"
               :settleStyleSn="form.settleStyleSn"
               placeholder="请选择结算账户">
@@ -156,6 +157,9 @@ export default {
         if (res.status == 200) {
           this.form = Object.assign({}, this.form, res.data)
           this.form.costType = [this.form.expensesTypeSn1, this.form.expensesTypeSn2, this.form.expensesTypeSn3]
+          this.$nextTick(() => {
+            this.$refs.settleAcount.getList()
+          })
         } else {
           this.$refs.ruleForm.resetFields()
         }
@@ -205,12 +209,6 @@ export default {
         vm.getDetail()
       }
       vm.getCostTypeList()
-      // 结算账户状态查询
-      vm.GetSettleAccountState().then(res => {
-        if (res.status == 200) {
-          vm.enableFundAccount = res.data.functionEnableFlag
-        }
-      })
     }
   },
   mounted () {
@@ -223,6 +221,12 @@ export default {
     if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
       this.pageInit()
     }
+    // 结算账户状态查询
+    this.GetSettleAccountState().then(res => {
+      if (res.status == 200) {
+        this.enableFundAccount = res.data.functionEnableFlag == 1
+      }
+    })
   },
   beforeRouteEnter (to, from, next) {
     next(vm => {})

+ 58 - 29
src/views/financialManagement/financialCollection/list.vue

@@ -68,7 +68,7 @@
         </div>
       </a-alert>
       <div v-if="$hasPermissions('B_financialCollectionPl')" style="margin-bottom: 10px">
-        <a-button type="primary" id="financialCollectionList-export" :loading="loading" @click="handleCollection">批量收款</a-button>
+        <a-button type="primary" id="financialCollectionList-export" :loading="loading" @click="enableFundAccount ? handleSettleAcountPay(null,1) : handleCollection()">批量收款</a-button>
         <span style="margin-left: 8px" v-if="$hasPermissions('B_financialCollectionPl')">
           <template v-if="rowSelectionInfo&&rowSelectionInfo.selectedRowKeys.length>0">{{ `已选 ${rowSelectionInfo.selectedRowKeys.length} 项` }}</template>
           <template v-if="selectTotalAmount">,合计¥{{ selectTotalAmount }}</template>
@@ -108,7 +108,7 @@
             :loading="loading"
             class="button-error"
             v-if="(record.settleState == 'UNSETTLE' || record.settleState == 'PART_SETTLED')&&record.satelliteFlag!=1 && $hasPermissions('B_financialCollectionSing')"
-            @click="handleCollectionSing(record)"
+            @click="enableFundAccount ? handleSettleAcountPay(record,0) : handleCollectionSing(record)"
             id="financialCollectionList-pay-btn">收款</a-button>
           <span v-if="!(record.settleState == 'SETTLED' && $hasPermissions('B_financialCollectionDetail')) && !((record.settleState == 'UNSETTLE' || record.settleState == 'PART_SETTLED')&&record.satelliteFlag!=1 && $hasPermissions('B_financialCollectionSing'))">--</span>
           <!-- satelliteFlag为1,是卫星仓 -->
@@ -143,13 +143,17 @@
     </a-modal>
     <!-- 散件退货 -->
     <bulkReturnGoods-detail-modal :openModal="openBulkReturnDetailModal" :itemSn="orderSn" @close="handleDetailClose" />
+    <!-- 收付款弹框 -->
+    <settleModal ref="settleModal" @ok="settleAcountPay" :openModal="openSettleModal" @close="openSettleModal=false"></settleModal>
   </a-card>
 </template>
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import { mapActions } from 'vuex'
 import { STable, VSelect } from '@/components'
 import detailModal from './detailModal.vue'
+import settleModal from '../settleModal/settleModal.vue'
 import rangeDate from '@/views/common/rangeDate.vue'
 import salesDetailModal from '@/views/salesManagement/salesQuery/detail.vue'
 // 同步采购退货单详情
@@ -162,7 +166,7 @@ import bulkReturnGoodsDetailModal from '@/views/bulkManagement/bulkReturnGoods/d
 import { settleReceiptQuery, queryByTypeSum, settleReceiptMoney, settleReceiptQuerySum } from '@/api/settleReceipt'
 export default {
   name: 'FinancialCollectionList',
-  components: { STable, VSelect, detailModal, rangeDate, pushOrderDetailModal, pushOrderOutSyncDetailModal, salesDetailModal, chainTransferOutDetailModal, bulkReturnGoodsDetailModal, storeTransferOutDetailModal },
+  components: { STable, VSelect, detailModal, rangeDate, settleModal, pushOrderDetailModal, pushOrderOutSyncDetailModal, salesDetailModal, chainTransferOutDetailModal, bulkReturnGoodsDetailModal, storeTransferOutDetailModal },
   mixins: [commonMixin],
   data () {
     return {
@@ -171,7 +175,9 @@ export default {
       disabled: false, //  查询、重置按钮是否可操作
       openModal: false, // 详情弹框
       openDetailModal: false,
+      openSettleModal: false, // 打开收款弹框
       openBulkReturnDetailModal: false,
+      enableFundAccount: false, // 是否开启资金账户管理
       tableHeight: 0,
       curBizType: 'ALL',
       curBizTitle: '',
@@ -247,6 +253,7 @@ export default {
     }
   },
   methods: {
+    ...mapActions(['GetSettleAccountState']),
     handleDetailClose () {
       this.openDetailModal = false
       this.openBulkReturnDetailModal = false
@@ -300,6 +307,46 @@ export default {
       this.$refs.detailModal.getDetail(row.id)
       this.openModal = true
     },
+    // 开启结算账户功能收款, type:0 单条收款,1 批量收款
+    handleSettleAcountPay (row, type) {
+      this.openSettleModal = true
+      const data = {
+        totalAmount: type ? this.selectTotalAmount : row && row.unsettleAmount || 0,
+        settleClientName: type ? '' : row && row.settleClientName || '',
+        title: '收款',
+        type,
+        row
+      }
+      this.$nextTick(() => {
+        this.$refs.settleModal.setData(data)
+      })
+    },
+    // 去收款
+    settleAcountPay (form, data) {
+      const _this = this
+      const params =
+      {
+        'settleIds': data.type ? _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys : [data.row.id]
+      }
+      // 资金管理开启
+      if (this.enableFundAccount) {
+        params.settleStyleSn = form.settleStyleSn
+        params.settleAccountSn = form.settleAccountSn
+      }
+      _this.loading = true
+      _this.spinning = true
+      settleReceiptMoney(params).then(res => {
+        _this.loading = false
+        if (res.status == 200) {
+          _this.$message.success(res.message)
+          _this.$refs.table.refresh()
+          _this.$refs.table.clearSelected() // 清空表格选中项
+          _this.spinning = false
+        } else {
+          _this.spinning = false
+        }
+      })
+    },
     // 收款
     handleCollectionSing (row) {
       const _this = this
@@ -309,19 +356,7 @@ export default {
         centered: true,
         closable: true,
         onOk () {
-          _this.loading = true
-          _this.spinning = true
-          settleReceiptMoney([row.id]).then(res => {
-            _this.loading = false
-            if (res.status == 200) {
-              _this.$message.success(res.message)
-              _this.$refs.table.refresh()
-              _this.$refs.table.clearSelected() // 清空表格选中项
-              _this.spinning = false
-            } else {
-              _this.spinning = false
-            }
-          })
+          _this.settleAcountPay(null, { type: 0, row: row })
         }
       })
     },
@@ -344,19 +379,7 @@ export default {
         centered: true,
         closable: true,
         onOk () {
-          _this.loading = true
-          _this.spinning = true
-          settleReceiptMoney(_this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys).then(res => {
-            this.loading = false
-            if (res.status == 200) {
-              _this.$message.success(res.message)
-              _this.$refs.table.refresh()
-              _this.$refs.table.clearSelected() // 清空表格选中项
-              _this.spinning = false
-            } else {
-              _this.spinning = false
-            }
-          })
+          _this.settleAcountPay(null, { type: 1, row: null })
         }
       })
     },
@@ -419,6 +442,12 @@ export default {
       }
       this.pageInit()
     }
+    // 结算账户状态查询
+    this.GetSettleAccountState().then(res => {
+      if (res.status == 200) {
+        this.enableFundAccount = res.data.functionEnableFlag == 1
+      }
+    })
   },
   beforeRouteEnter (to, from, next) {
     next(vm => {})

+ 59 - 29
src/views/financialManagement/financialPayment/list.vue

@@ -67,7 +67,7 @@
         </div>
       </a-alert>
       <div v-if="$hasPermissions('B_financialPaymentPl')" style="margin-bottom: 10px">
-        <a-button type="primary" id="finacialPay-export" :loading="loading" @click="handlePayment">批量付款</a-button>
+        <a-button type="primary" id="finacialPay-export" :loading="loading" @click="enableFundAccount ? handleSettleAcountPay(null,1) : handlePayment()">批量付款</a-button>
         <span style="margin-left: 8px" v-if="$hasPermissions('B_financialPaymentPl')">
           <template v-if="rowSelectionInfo&&rowSelectionInfo.selectedRowKeys.length>0">{{ `已选 ${rowSelectionInfo.selectedRowKeys.length} 项` }}</template>
           <template v-if="selectTotalAmount">,合计¥{{ selectTotalAmount }}</template>
@@ -103,7 +103,7 @@
             class="button-error"
             :loading="loading"
             v-else-if="record.settleState != 'SETTLED' && $hasPermissions('B_financialPaymentSing')"
-            @click="handlePay(record)"
+            @click="enableFundAccount ? handleSettleAcountPay(record,0) : handlePay(record)"
             id="finacialPay-pay-btn">付款</a-button>
           <span v-else>--</span>
         </template>
@@ -111,18 +111,22 @@
     </a-spin>
     <!-- 详情 -->
     <detail-modal :openModal="openModal" ref="detailModal" @close="openModal = false" />
+    <!-- 收付款弹框 -->
+    <settleModal ref="settleModal" @ok="settleAcountPay" :openModal="openSettleModal" @close="openSettleModal=false"></settleModal>
   </a-card>
 </template>
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import { mapActions } from 'vuex'
 import { STable, VSelect } from '@/components'
 import detailModal from './detailModal.vue'
+import settleModal from '../settleModal/settleModal.vue'
 import { settlePayQuery, queryByTypeSum, settlePayMoney, settlePayQuerySum } from '@/api/settlePay.js'
 import rangeDate from '@/views/common/rangeDate.vue'
 export default {
   name: 'FinancialPaymentList',
-  components: { STable, VSelect, detailModal, rangeDate },
+  components: { STable, VSelect, detailModal, rangeDate, settleModal },
   mixins: [commonMixin],
   data () {
     return {
@@ -130,6 +134,8 @@ export default {
       advanced: true, //  高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
       openModal: false, // 详情弹框
+      openSettleModal: false, // 打开付款弹框
+      enableFundAccount: false, // 是否开启资金账户管理
       tableHeight: 0,
       curBizType: 'ALL',
       // 查询参数
@@ -202,6 +208,7 @@ export default {
     }
   },
   methods: {
+    ...mapActions(['GetSettleAccountState']),
     // 表格选中项
     rowSelectionFun (obj) {
       console.log(obj)
@@ -239,6 +246,47 @@ export default {
       this.$refs.detailModal.getDetail(row.id)
       this.openModal = true
     },
+    // 开启结算账户功能付款, type:0 单条付款,1 批量付款
+    handleSettleAcountPay (row, type) {
+      this.openSettleModal = true
+      const data = {
+        totalAmount: type ? this.selectTotalAmount : row && row.unsettleAmount || 0,
+        settleClientName: type ? '' : row && row.settleClientName || '',
+        title: '付款',
+        type,
+        row
+      }
+      this.$nextTick(() => {
+        this.$refs.settleModal.setData(data)
+      })
+    },
+    // 去付款
+    settleAcountPay (form, data) {
+      const _this = this
+      const params =
+      {
+        'settleIds': data.type ? _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys : [data.row.id]
+      }
+      // 资金管理开启
+      if (this.enableFundAccount) {
+        params.settleStyleSn = form.settleStyleSn
+        params.settleAccountSn = form.settleAccountSn
+      }
+
+      _this.loading = true
+      _this.spinning = true
+      settlePayMoney(params).then(res => {
+        _this.loading = false
+        if (res.status == 200) {
+          _this.$message.success(res.message)
+          _this.$refs.table.refresh()
+          _this.$refs.table.clearSelected() // 清空表格选中项
+          _this.spinning = false
+        } else {
+          _this.spinning = false
+        }
+      })
+    },
     // 付款
     handlePay (row) {
       const _this = this
@@ -248,19 +296,7 @@ export default {
         centered: true,
         closable: true,
         onOk () {
-          _this.loading = true
-          _this.spinning = true
-          settlePayMoney([row.id]).then(res => {
-            _this.loading = false
-            if (res.status == 200) {
-              _this.$message.success(res.message)
-              _this.$refs.table.refresh()
-              _this.$refs.table.clearSelected() // 清空表格选中项
-              _this.spinning = false
-            } else {
-              _this.spinning = false
-            }
-          })
+          _this.settleAcountPay(null, { type: 0, row: row })
         }
       })
     },
@@ -283,19 +319,7 @@ export default {
         centered: true,
         closable: true,
         onOk () {
-          _this.loading = true
-          _this.spinning = true
-          settlePayMoney(_this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys).then(res => {
-            _this.loading = false
-            if (res.status == 200) {
-              _this.$message.success(res.message)
-              _this.$refs.table.clearSelected() // 清空表格选中项
-              _this.$refs.table.refresh()
-              _this.spinning = false
-            } else {
-              _this.spinning = false
-            }
-          })
+          _this.settleAcountPay(null, { type: 1, row: null })
         }
       })
     },
@@ -358,6 +382,12 @@ export default {
       }
       this.pageInit()
     }
+    // 结算账户状态查询
+    this.GetSettleAccountState().then(res => {
+      if (res.status == 200) {
+        this.enableFundAccount = res.data.functionEnableFlag == 1
+      }
+    })
   },
   beforeRouteEnter (to, from, next) {
     next(vm => {})

+ 153 - 0
src/views/financialManagement/settleModal/settleModal.vue

@@ -0,0 +1,153 @@
+<template>
+  <a-modal
+    centered
+    class="fundAount-basicInfo-modal"
+    :footer="null"
+    :maskClosable="false"
+    :title="'确认'+title"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="600">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-form-model
+        id="fundAount-basicInfo-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol" >
+        <a-form-model-item label="商户名称" style="margin-bottom: 0;" v-if="baseData&&baseData.settleClientName">
+          <span class="ant-form-text">
+            {{ baseData.settleClientName }}
+          </span>
+        </a-form-model-item>
+        <a-form-model-item style="margin-bottom: 10px;" :label="title+'金额'" v-if="baseData">
+          <span class="ant-form-text">
+            ¥{{ baseData.totalAmount }}
+          </span>
+        </a-form-model-item>
+        <a-form-model-item label="结算方式" prop="settleStyleSn">
+          <settleStyle
+            id="expenseManagementEdit-settleStyleSn"
+            v-model="form.settleStyleSn"
+            @change="settleStyleChange"
+            placeholder="请选择结算方式">
+          </settleStyle>
+        </a-form-model-item>
+        <a-form-model-item label="结算账户" prop="settleAccountSn">
+          <settleAccount
+            id="expenseManagementEdit-settleAccountSn"
+            ref="settleAcount"
+            v-model="form.settleAccountSn"
+            :settleStyleSn="form.settleStyleSn"
+            placeholder="请选择结算账户">
+          </settleAccount>
+        </a-form-model-item>
+        <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;">
+          <a-button type="primary" :loading="confirmLoading" @click="handleSubmit" id="chooseCustom-btn-submit">保存</a-button>
+          <a-button @click="isShow=false" style="margin-left: 15px" id="chooseCustom-btn-back">取消</a-button>
+        </a-form-model-item>
+      </a-form-model>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import settleStyle from '@/views/common/settleStyle'
+import settleAccount from '@/views/common/settleAccount'
+export default {
+  name: 'SettleModal',
+  components: { settleStyle, settleAccount },
+  mixins: [commonMixin],
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      confirmLoading: false,
+      isShow: this.openModal, //  是否打开弹框
+      title: '确认',
+      formItemLayout: {
+        labelCol: { span: 4 },
+        wrapperCol: { span: 18 }
+      },
+      form: {
+        settleStyleSn: '',
+        settleStyleName: '',
+        settleAccountSn: ''
+      },
+      rules: {
+        settleStyleSn: [
+          { required: true, message: '请选择结算方式', trigger: 'change' }
+        ],
+        settleAccountSn: [{ required: true, message: '请选择结算账户', trigger: 'change' }]
+      },
+      baseData: null
+    }
+  },
+  methods: {
+    resetForm () {
+      this.$refs.ruleForm.resetFields()
+      this.form = {
+        settleStyleSn: '',
+        settleStyleName: '',
+        settleAccountSn: ''
+      }
+    },
+    settleStyleChange (v, name) {
+      this.form.settleStyleName = name
+    },
+    //  保存
+    handleSubmit (e) {
+      e.preventDefault()
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.isShow = false
+          _this.$emit('ok', this.form, this.baseData)
+        } else {
+          return false
+        }
+      })
+    },
+    // 编辑信息
+    setData (data) {
+      this.title = data.title
+      this.baseData = data
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.resetForm()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .fundAount-basicInfo-modal{
+    .ant-modal-body {
+      padding: 40px 40px 24px;
+    }
+    .radio-s{
+      margin-bottom: 8px;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+  }
+</style>

+ 41 - 1
src/views/salesManagement/salesQuery/edit.vue

@@ -170,15 +170,19 @@
     <choose-custom-modal ref="custModal" :show="openModal" @updateData="updateData" @cancel="openModal=false" />
     <!-- 导入费用明细 -->
     <importGuideModal :openModal="openGuideModal" :params="{salesBillSn: $route.params.sn, salesBillNo:detailData?detailData.salesBillNo:''}" @close="openGuideModal=false" @ok="hanldeImprotOk" />
+    <!-- 收付款弹框 -->
+    <settleModal ref="settleModal" @ok="settleAcountPay" :openModal="openSettleModal" @close="openSettleModal=false"></settleModal>
   </div>
 </template>
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import { mapActions } from 'vuex'
 import { STable, VSelect } from '@/components'
 import queryPart from './queryPart.vue'
 import chooseCustomModal from './chooseCustomModal.vue'
 import importGuideModal from './importGuideModal.vue'
+import settleModal from '@/views/financialManagement/settleModal/settleModal.vue'
 import { stockByProductSn } from '@/api/stock'
 import { salesDetail, salesWriteSubmit, salesWriteDiscount, salesDetailPrint, salesDetailExport, salesDel } from '@/api/sales'
 import { salesDetailList, salesDetailInsert, salesDetailUpdatePrice, salesDetailUpdateQty, salesDetailDel, salesDetailDelAll, salesDetailInsertImport } from '@/api/salesDetail'
@@ -186,7 +190,7 @@ import Print from '@/views/common/print.vue'
 import { hdPrint } from '@/libs/JGPrint'
 export default {
   name: 'SalesEdit',
-  components: { STable, VSelect, queryPart, chooseCustomModal, Print, importGuideModal },
+  components: { STable, VSelect, queryPart, chooseCustomModal, Print, importGuideModal, settleModal },
   mixins: [commonMixin],
   data () {
     return {
@@ -198,6 +202,8 @@ export default {
       isInster: false, // 是否正在添加产品
       openModal: false, // 客户弹框
       openGuideModal: false, // 导入产品弹框
+      openSettleModal: false, // 打开收款弹框
+      enableFundAccount: false, // 是否开启资金账户管理
       delLoading: false,
       detailData: { discountAmount: 0, id: null, salesBillSn: '' }, // 订单基础数据
       dataSource: [],
@@ -256,6 +262,7 @@ export default {
     }
   },
   methods: {
+    ...mapActions(['GetSettleAccountState']),
     // 打印预览/快捷打印
     handlePrint (type, printerType) {
       const _this = this
@@ -589,6 +596,33 @@ export default {
         }
       })
     },
+    // 开启结算账户功能收款, type:0 单条收款,1 批量收款
+    handleSettleAcountPay (row, type) {
+      this.openSettleModal = true
+      const data = {
+        totalAmount: type ? this.selectTotalAmount : row && row.unsettleAmount || 0,
+        settleClientName: type ? '' : row && row.settleClientName || '',
+        title: '收款',
+        type,
+        row
+      }
+      this.$nextTick(() => {
+        this.$refs.settleModal.setData(data)
+      })
+    },
+    // 去收款
+    settleAcountPay (form, data) {
+      const _this = this
+      const params =
+      {
+        'settleIds': data.type ? _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys : [data.row.id]
+      }
+      // 资金管理开启
+      if (this.enableFundAccount) {
+        params.settleStyleSn = form.settleStyleSn
+        params.settleAccountSn = form.settleAccountSn
+      }
+    },
     // 确认导入明细
     hanldeImprotOk (obj) {
       this.spinning = true
@@ -629,6 +663,12 @@ export default {
     if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
       this.pageInit()
     }
+    // 结算账户状态查询
+    this.GetSettleAccountState().then(res => {
+      if (res.status == 200) {
+        this.enableFundAccount = res.data.functionEnableFlag == 1
+      }
+    })
   },
   deactivated () {
     // this.dataSource = []