瀏覽代碼

销售付款

lilei 3 年之前
父節點
當前提交
fbfb394dfa

+ 3 - 1
src/views/common/settleAccount.js

@@ -48,7 +48,9 @@ const SettleAccount = {
     },
     settleStyleSn(a,b){
       console.log(a)
-      this.getList()
+      if(a){
+        this.getList()
+      }
     }
   },
   mounted() {

+ 6 - 22
src/views/salesManagement/salesQuery/chooseCustomModal.vue

@@ -126,18 +126,12 @@
                 </a-row>
               </a-form-model-item>
             </a-col>
-            <!-- <a-col :span="8">
-              <a-form-model-item label="支付方式" prop="payType">
-                <v-select code="PAY_TYPE" id="chooseCustom-payType" v-model="form.payType" allowClear placeholder="请选择支付方式" />
-              </a-form-model-item>
-            </a-col> -->
             <a-col :span="8">
               <a-form-model-item label="收款方式" prop="settleStyleSn">
-                <a-select placeholder="请选择收款方式" allowClear v-model="form.settleStyleSn">
-                  <a-select-option v-for="item in settleStyleList" :key="item.settleStyleSn" :value="item.settleStyleSn">
-                    {{ item.name }}
-                  </a-select-option>
-                </a-select>
+                <settleStyle
+                  v-model="form.settleStyleSn"
+                  placeholder="请选择收款方式">
+                </settleStyle>
               </a-form-model-item>
             </a-col>
             <a-col :span="8">
@@ -203,13 +197,13 @@ import { getArea } from '@/api/data'
 import { custFindById, updateByCustomerSn } from '@/api/customer'
 import { salesSave } from '@/api/sales'
 import { employeeAllList } from '@/api/salesman'
-import { settleStyleQueryAll } from '@/api/settleStyle'
+import settleStyle from '@/views/common/settleStyle'
 import { VSelect } from '@/components'
 import custList from '@/views/common/custList.vue'
 import CustomerManagementEdit from '@/views/customerManagement/customerInfo/edit.vue'
 export default {
   name: 'ChooseCustomModal',
-  components: { VSelect, CustomerManagementEdit, custList },
+  components: { VSelect, CustomerManagementEdit, custList, settleStyle },
   props: {
     show: [Boolean]
   },
@@ -280,7 +274,6 @@ export default {
       addrCityList: [], //  市下拉
       addrDistrictList: [], //  区下拉
       userList: [], // 业务员 下拉
-      settleStyleList: [], // 收款方式
       custId: undefined, // 客户id
       isEdit: false, //  是否编辑状态
       priceTypeDisabled: false, // 价格类型可编辑
@@ -554,14 +547,6 @@ export default {
           }
         }
       })
-    },
-    // 获取收款方式
-    getSettleStyle () {
-      settleStyleQueryAll().then(res => {
-        if (res.status == 200) {
-          this.settleStyleList = res.data
-        }
-      })
     }
   },
   watch: {
@@ -570,7 +555,6 @@ export default {
       if (newValue) {
         this.getArea('province')
         this.getUserAllList()
-        this.getSettleStyle()
       }
     }
   }

+ 10 - 11
src/views/salesManagement/salesQuery/edit.vue

@@ -91,7 +91,7 @@
                   type="primary"
                   :disabled="spinning"
                   class="button-primary"
-                  @click="handleSubmit()"
+                  @click="enableFundAccount && tbForm.length == 3 ? handleSettleAcountPay(null,0) : handleSubmit({})"
                   id="productInfoList-handleSubmit">提交</a-button>
                 <a-button
                   type="default"
@@ -583,14 +583,15 @@ export default {
       })
     },
     // 提交销售单
-    handleSubmit () {
+    handleSubmit (params) {
       this.spinning = true
       const submitTypes = this.tbForm.join(',')
-      salesWriteSubmit({ id: this.orderId, submitTypes: submitTypes }).then(res => {
+      salesWriteSubmit({ id: this.orderId, submitTypes: submitTypes, ...params }).then(res => {
+        console.log(res)
         if (res.status == 200) {
           this.handleBack()
           this.$message.success(res.message)
-          this.spinning = false
+          // this.spinning = false
         } else {
           this.spinning = false
         }
@@ -600,8 +601,8 @@ export default {
     handleSettleAcountPay (row, type) {
       this.openSettleModal = true
       const data = {
-        totalAmount: type ? this.selectTotalAmount : row && row.unsettleAmount || 0,
-        settleClientName: type ? '' : row && row.settleClientName || '',
+        totalAmount: this.detailData.discountedAmount,
+        settleClientName: '',
         title: '收款',
         type,
         row
@@ -612,16 +613,14 @@ export default {
     },
     // 去收款
     settleAcountPay (form, data) {
-      const _this = this
-      const params =
-      {
-        'settleIds': data.type ? _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys : [data.row.id]
-      }
+      const params = {}
       // 资金管理开启
       if (this.enableFundAccount) {
         params.settleStyleSn = form.settleStyleSn
         params.settleAccountSn = form.settleAccountSn
       }
+      this.spinning = true
+      this.handleSubmit(params)
     },
     // 确认导入明细
     hanldeImprotOk (obj) {

+ 7 - 17
src/views/salesManagement/salesQuery/list.vue

@@ -28,11 +28,11 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="收款方式">
-                  <a-select placeholder="请选择收款方式" allowClear v-model="queryParam.settleStyleSn">
-                    <a-select-option v-for="item in settleStyleList" :key="item.settleStyleSn" :value="item.settleStyleSn">
-                      {{ item.name }}
-                    </a-select-option>
-                  </a-select>
+                  <settleStyle
+                    id="salesManagementList-settleStyleSn"
+                    v-model="queryParam.settleStyleSn"
+                    placeholder="请选择收款方式">
+                  </settleStyle>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -197,14 +197,14 @@ import { STable, VSelect } from '@/components'
 import chooseCustomModal from './chooseCustomModal.vue'
 import auditModal from '@/views/common/auditModal.vue'
 import { salesList, salesDel, salesWriteAudit, salesWriteStockOut, salesCount, salesExport } from '@/api/sales'
-import { settleStyleQueryAll } from '@/api/settleStyle'
+import settleStyle from '@/views/common/settleStyle'
 import rangeDate from '@/views/common/rangeDate.vue'
 import custList from '@/views/common/custList.vue'
 import { downloadExcel } from '@/libs/JGPrint.js'
 import stateIcon from '@/views/common/stateIcon'
 export default {
   name: 'SalesList',
-  components: { STable, VSelect, chooseCustomModal, rangeDate, auditModal, custList, stateIcon },
+  components: { STable, VSelect, chooseCustomModal, rangeDate, auditModal, custList, stateIcon, settleStyle },
   mixins: [commonMixin],
   data () {
     return {
@@ -214,7 +214,6 @@ export default {
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false, // 导出loading
       openModal: false, // 选择客户弹框是否显示
-      settleStyleList: [], // 收款方式
       time: [
         getDate.getCurrMonthDays().starttime,
         getDate.getCurrMonthDays().endtime
@@ -427,14 +426,6 @@ export default {
         }
       })
     },
-    // 获取收款方式
-    getSettleStyle () {
-      settleStyleQueryAll().then(res => {
-        if (res.status == 200) {
-          this.settleStyleList = res.data
-        }
-      })
-    },
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 265
@@ -444,7 +435,6 @@ export default {
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
-      _this.getSettleStyle()
     }
   },
   mounted () {