|
|
@@ -11,6 +11,9 @@
|
|
|
<u-cell icon="account" :iconStyle="{color: '#FD4B09'}" title="客户" :value="form.corpName" :isLink="true"
|
|
|
@click="selectCustomer">
|
|
|
</u-cell>
|
|
|
+ <u-cell icon="home" :iconStyle="{color: '#FD4B09'}" title="业务员" :value="form.sales" :isLink="true"
|
|
|
+ @click="filterAll(['sales','salesName'])">
|
|
|
+ </u-cell>
|
|
|
<u-cell icon="calendar" :iconStyle="{color: '#FD4B09'}" title="日期"
|
|
|
:value="form.businesDate?form.businesDate.slice(0,10):''" :isLink="true" @click="show = true">
|
|
|
</u-cell>
|
|
|
@@ -79,49 +82,53 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <u-popup zIndex="10070" :closeOnClickOverlay="false" :show="openPopup" @close="openPopup = false,mask = false" mode="center" closeable
|
|
|
- round="10rpx">
|
|
|
+ <u-popup zIndex="10070" :closeOnClickOverlay="false" :show="openPopup" @close="openPopup = false,mask = false"
|
|
|
+ mode="center" closeable round="10rpx">
|
|
|
<u--form labelPosition="left" :labelStyle="{color: '#fd4b09'}" :model="formTwo" ref="formTwo"
|
|
|
labelWidth="150rpx">
|
|
|
<view style="width: calc(700rpx - 20px);margin: 10px;">
|
|
|
<text>收款台</text>
|
|
|
<view>
|
|
|
- <!-- <u-form-item label="订单金额" prop="cname" borderBottom>
|
|
|
- <u-input type="number" v-model="formTwo.purchaseAmount" border="none" inputAlign="right" placeholder="请输入"
|
|
|
- disabled disabledColor="#ffffff" />
|
|
|
- </u-form-item> -->
|
|
|
- <!-- <u-form-item label="优惠金额" prop="cname" borderBottom>
|
|
|
- <u-input type="number" v-model="formTwo.thisUsedProfit" border="none" inputAlign="right" placeholder="请输入" disabledColor="#ffffff" @blur="discount(0)"/>
|
|
|
- </u-form-item> -->
|
|
|
- <u-form-item label="应收金额" prop="cname" borderBottom>
|
|
|
- <u-input type="number" v-model="formTwo.orderAmount" border="none" inputAlign="right" placeholder="请输入"
|
|
|
- disabled disabledColor="#ffffff" />
|
|
|
- </u-form-item>
|
|
|
- <u-form-item label="已收金额" prop="cname" borderBottom>
|
|
|
- <u-input type="number" v-model="formTwo.settlmentAmount" border="none" inputAlign="right" placeholder="请输入" disabled disabledColor="#ffffff" />
|
|
|
- </u-form-item>
|
|
|
- <u-form-item label="溢付款" prop="cname" borderBottom>
|
|
|
- <u-input type="number" v-model="formTwo.overPayment" border="none" inputAlign="right" disabled disabledColor="#ffffff" />
|
|
|
- </u-form-item>
|
|
|
- <u-form-item label="本次收款" prop="cname" borderBottom>
|
|
|
- <u-input type="number" clearable v-model="formTwo.currentAmount" border="none" inputAlign="right" placeholder="请输入" disabledColor="#ffffff" @blur="discount(1)" />
|
|
|
- </u-form-item>
|
|
|
- <u-form-item label="收款日期" labelWidth="190rpx" prop="cname" borderBottom
|
|
|
- @click="filterAll(['advanceCollectionDate','advanceCollectionDate'])">
|
|
|
- <view style="width: 100%;text-align: right;">
|
|
|
- {{formTwo.advanceCollectionDate?formTwo.advanceCollectionDate.slice(0,10):''}}
|
|
|
- </view>
|
|
|
- </u-form-item>
|
|
|
- <u-form-item label="收款账户" prop="cname" borderBottom @click="filterAll(['account','account'])">
|
|
|
- <u-input v-model="formTwo.account" border="none" inputAlign="right" placeholder="请选择"
|
|
|
- disabled disabledColor="#ffffff">
|
|
|
- <template slot="suffix" style="text-align: center;">
|
|
|
- <u-icon name="plus-circle" size="18" @click.native.stop="newCompany()"></u-icon>
|
|
|
- </template>
|
|
|
- </u-input>
|
|
|
+ <!-- <u-form-item label="订单金额" prop="cname" borderBottom>
|
|
|
+ <u-input type="number" v-model="formTwo.purchaseAmount" border="none" inputAlign="right" placeholder="请输入"
|
|
|
+ disabled disabledColor="#ffffff" />
|
|
|
+ </u-form-item> -->
|
|
|
+ <!-- <u-form-item label="优惠金额" prop="cname" borderBottom>
|
|
|
+ <u-input type="number" v-model="formTwo.thisUsedProfit" border="none" inputAlign="right" placeholder="请输入" disabledColor="#ffffff" @blur="discount(0)"/>
|
|
|
+ </u-form-item> -->
|
|
|
+ <u-form-item label="应收金额" prop="cname" borderBottom>
|
|
|
+ <u-input type="number" v-model="formTwo.orderAmount" border="none" inputAlign="right"
|
|
|
+ placeholder="请输入" disabled disabledColor="#ffffff" />
|
|
|
+ </u-form-item>
|
|
|
+ <u-form-item label="已收金额" prop="cname" borderBottom>
|
|
|
+ <u-input type="number" v-model="formTwo.settlmentAmount" border="none" inputAlign="right"
|
|
|
+ placeholder="请输入" disabled disabledColor="#ffffff" />
|
|
|
+ </u-form-item>
|
|
|
+ <u-form-item label="溢付款" prop="cname" borderBottom>
|
|
|
+ <u-input type="number" v-model="formTwo.overPayment" border="none" inputAlign="right"
|
|
|
+ disabled disabledColor="#ffffff" />
|
|
|
+ </u-form-item>
|
|
|
+ <u-form-item label="本次收款" prop="cname" borderBottom>
|
|
|
+ <u-input type="number" clearable v-model="formTwo.currentAmount" border="none"
|
|
|
+ inputAlign="right" placeholder="请输入" disabledColor="#ffffff" @blur="discount(1)" />
|
|
|
+ </u-form-item>
|
|
|
+ <u-form-item label="收款日期" labelWidth="190rpx" prop="cname" borderBottom
|
|
|
+ @click="filterAll(['advanceCollectionDate','advanceCollectionDate'])">
|
|
|
+ <view style="width: 100%;text-align: right;">
|
|
|
+ {{formTwo.advanceCollectionDate?formTwo.advanceCollectionDate.slice(0,10):''}}
|
|
|
+ </view>
|
|
|
+ </u-form-item>
|
|
|
+ <u-form-item label="收款账户" prop="cname" borderBottom @click="filterAll(['account','account'])">
|
|
|
+ <u-input v-model="formTwo.account" border="none" inputAlign="right" placeholder="请选择"
|
|
|
+ disabled disabledColor="#ffffff">
|
|
|
+ <template slot="suffix" style="text-align: center;">
|
|
|
+ <u-icon name="plus-circle" size="18" @click.native.stop="newCompany()"></u-icon>
|
|
|
+ </template>
|
|
|
+ </u-input>
|
|
|
</u-form-item>
|
|
|
<view style="display: flex;margin-top: 20rpx;">
|
|
|
- <u-button text="取消" style="width: 45%;" @click="openPopup = false,mask = false,uni.navigateBack()"></u-button>
|
|
|
+ <u-button text="取消" style="width: 45%;"
|
|
|
+ @click="openPopup = false,mask = false,uni.navigateBack()"></u-button>
|
|
|
<u-button type="primary" text="收款" color="#FD4B09" style="width: 45%;"
|
|
|
@click="collectionConfirm"></u-button>
|
|
|
</view>
|
|
|
@@ -130,8 +137,8 @@
|
|
|
</u--form>
|
|
|
</u-popup>
|
|
|
<u-datetime-picker :show="show" v-model="timeValue" mode="date" @confirm="confirm" @cancel="show = false">
|
|
|
- </u-datetime-picker>
|
|
|
- <u-datetime-picker :show="timeOpen" v-model="datetime" mode="date" @cancel="timeOpen = false,mask = false"
|
|
|
+ </u-datetime-picker>
|
|
|
+ <u-datetime-picker :show="timeOpen" v-model="datetime" mode="date" @cancel="timeOpen = false,mask = false"
|
|
|
@confirm="confirmTiem"></u-datetime-picker>
|
|
|
<u-picker :show="showWarehouse" :columns="columns" :keyName="keyName" @confirm="confirmWarehouse"
|
|
|
@cancel="showWarehouse = false"></u-picker>
|
|
|
@@ -143,10 +150,11 @@
|
|
|
import {
|
|
|
customerList,
|
|
|
quickBilling,
|
|
|
- typeSave
|
|
|
- } from '@/api/views/sale/index.js'
|
|
|
- import {
|
|
|
- collectPayment
|
|
|
+ typeSave,
|
|
|
+ gainUser
|
|
|
+ } from '@/api/views/sale/index.js'
|
|
|
+ import {
|
|
|
+ collectPayment
|
|
|
} from '@/api/views/sale/salesOrderDetails.js'
|
|
|
import {
|
|
|
dateFormat
|
|
|
@@ -154,11 +162,11 @@
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- show: false,
|
|
|
+ show: false,
|
|
|
timeOpen: false,
|
|
|
openPopup: false,
|
|
|
showWarehouse: false,
|
|
|
- timeValue: Number(new Date()),
|
|
|
+ timeValue: Number(new Date()),
|
|
|
datetime: Number(new Date()),
|
|
|
columns: [],
|
|
|
dataList: [],
|
|
|
@@ -191,74 +199,74 @@
|
|
|
this.form.businesDate = new Date((new Date()).getTime() + 8 * 60 * 60 * 1000).toJSON().split('T').join(' ')
|
|
|
.substr(0, 19)
|
|
|
},
|
|
|
- methods: {
|
|
|
- newCompany() {
|
|
|
- uni.$u.route('/pages/views/product/createCompany',{
|
|
|
- code:"account",
|
|
|
- title:"收款账户"
|
|
|
- });
|
|
|
+ methods: {
|
|
|
+ newCompany() {
|
|
|
+ uni.$u.route('/pages/views/product/createCompany', {
|
|
|
+ code: "account",
|
|
|
+ title: "收款账户"
|
|
|
+ });
|
|
|
},
|
|
|
//时间确认选择
|
|
|
confirmTiem(e) {
|
|
|
this.formTwo[this.screen[1]] = dateFormat(new Date(e.value), "YYYY-MM-DD HH:mm:ss")
|
|
|
- this.timeOpen = false
|
|
|
+ this.timeOpen = false
|
|
|
this.mask = false
|
|
|
- },
|
|
|
- collectionConfirm(){
|
|
|
- if(!this.formTwo.thisUsedProfit){
|
|
|
- return uni.showToast({
|
|
|
- icon: "none",
|
|
|
- title: '优惠金额不能为空',
|
|
|
- mask: true
|
|
|
- });
|
|
|
- }
|
|
|
- if(!this.formTwo.orderAmount){
|
|
|
- return uni.showToast({
|
|
|
- icon: "none",
|
|
|
- title: '合同金额不能为空',
|
|
|
- mask: true
|
|
|
- });
|
|
|
- }
|
|
|
- if(!this.formTwo.currentAmount){
|
|
|
- return uni.showToast({
|
|
|
- icon: "none",
|
|
|
- title: '本次收款金额不能为空',
|
|
|
- mask: true
|
|
|
- });
|
|
|
- }
|
|
|
- if(!this.formTwo.account){
|
|
|
- return uni.showToast({
|
|
|
- icon: "none",
|
|
|
- title: '收款帐户不能为空',
|
|
|
- mask: true
|
|
|
- });
|
|
|
- }
|
|
|
- let this_ = this
|
|
|
- uni.showModal({
|
|
|
- title: '是否确认收款',
|
|
|
- content: '本次收款金额'+this_.formTwo.currentAmount,
|
|
|
- success: function(rest) {
|
|
|
- if (rest.confirm == true) {
|
|
|
- uni.showLoading({
|
|
|
- title: '加载中',
|
|
|
- mask: true
|
|
|
- });
|
|
|
- collectPayment(this_.formTwo).then(res=>{
|
|
|
- uni.showToast({
|
|
|
- icon: "none",
|
|
|
- title: '收款成功',
|
|
|
- mask: true,
|
|
|
- duration:2000
|
|
|
- });
|
|
|
- this.openPopup = false
|
|
|
+ },
|
|
|
+ collectionConfirm() {
|
|
|
+ if (!this.formTwo.thisUsedProfit) {
|
|
|
+ return uni.showToast({
|
|
|
+ icon: "none",
|
|
|
+ title: '优惠金额不能为空',
|
|
|
+ mask: true
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (!this.formTwo.orderAmount) {
|
|
|
+ return uni.showToast({
|
|
|
+ icon: "none",
|
|
|
+ title: '合同金额不能为空',
|
|
|
+ mask: true
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (!this.formTwo.currentAmount) {
|
|
|
+ return uni.showToast({
|
|
|
+ icon: "none",
|
|
|
+ title: '本次收款金额不能为空',
|
|
|
+ mask: true
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (!this.formTwo.account) {
|
|
|
+ return uni.showToast({
|
|
|
+ icon: "none",
|
|
|
+ title: '收款帐户不能为空',
|
|
|
+ mask: true
|
|
|
+ });
|
|
|
+ }
|
|
|
+ let this_ = this
|
|
|
+ uni.showModal({
|
|
|
+ title: '是否确认收款',
|
|
|
+ content: '本次收款金额' + this_.formTwo.currentAmount,
|
|
|
+ success: function(rest) {
|
|
|
+ if (rest.confirm == true) {
|
|
|
+ uni.showLoading({
|
|
|
+ title: '加载中',
|
|
|
+ mask: true
|
|
|
+ });
|
|
|
+ collectPayment(this_.formTwo).then(res => {
|
|
|
+ uni.showToast({
|
|
|
+ icon: "none",
|
|
|
+ title: '收款成功',
|
|
|
+ mask: true,
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ this.openPopup = false
|
|
|
setTimeout(function() {
|
|
|
uni.hideLoading();
|
|
|
- uni.navigateBack();
|
|
|
- }, 2000);
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
+ uni.navigateBack();
|
|
|
+ }, 2000);
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
//集合筛选条件
|
|
|
filterAll(screen) {
|
|
|
@@ -270,9 +278,9 @@
|
|
|
this.keyName = "dictValue"
|
|
|
this.showWarehouse = true
|
|
|
})
|
|
|
- break;
|
|
|
- case "advanceCollectionDate":
|
|
|
- this.timeOpen = true
|
|
|
+ break;
|
|
|
+ case "advanceCollectionDate":
|
|
|
+ this.timeOpen = true
|
|
|
this.mask = true
|
|
|
break;
|
|
|
case "storageId":
|
|
|
@@ -284,12 +292,19 @@
|
|
|
size: request.data.total,
|
|
|
current: 1
|
|
|
}).then(res => {
|
|
|
- this.columns = [res.data.records]
|
|
|
+ this.columns = [res.data.records]
|
|
|
this.keyName = 'cname'
|
|
|
this.showWarehouse = true
|
|
|
})
|
|
|
})
|
|
|
break;
|
|
|
+ case "salesName":
|
|
|
+ gainUser().then(res => {
|
|
|
+ this.columns = [res.data]
|
|
|
+ this.keyName = 'name'
|
|
|
+ this.showWarehouse = true
|
|
|
+ })
|
|
|
+ break;
|
|
|
}
|
|
|
},
|
|
|
discount(type) {
|
|
|
@@ -326,10 +341,10 @@
|
|
|
deleteProduct(index) {
|
|
|
this.amount = Number(this.amount) - Number(this.dataList[index].amount)
|
|
|
this.amount.toFixed(2)
|
|
|
- this.dataList.splice(index, 1)
|
|
|
- this.numberAll = 0
|
|
|
- for (let item of this.dataList) {
|
|
|
- this.numberAll += Number(item.storageInQuantity)
|
|
|
+ this.dataList.splice(index, 1)
|
|
|
+ this.numberAll = 0
|
|
|
+ for (let item of this.dataList) {
|
|
|
+ this.numberAll += Number(item.storageInQuantity)
|
|
|
}
|
|
|
},
|
|
|
//客户选择返回触发
|
|
|
@@ -379,6 +394,10 @@
|
|
|
if (this.screen[1] == "account") {
|
|
|
this.formTwo.account = e.value[0].dictValue
|
|
|
this.showWarehouse = false
|
|
|
+ } else if(this.screen[1] == "salesName") {
|
|
|
+ this.form.sales = e.value[0].name
|
|
|
+ this.form.salesName = e.value[0].id
|
|
|
+ this.showWarehouse = false
|
|
|
} else {
|
|
|
this.form.storageName = e.value[0].cname
|
|
|
this.form.storageId = e.value[0].id
|
|
|
@@ -422,8 +441,9 @@
|
|
|
mask: true
|
|
|
});
|
|
|
this.openPopup = true
|
|
|
- this.formTwo = res.data
|
|
|
- this.formTwo.currentAmount = (this.formTwo.orderAmount - this.formTwo.settlmentAmount).toFixed(2)
|
|
|
+ this.formTwo = res.data
|
|
|
+ this.formTwo.currentAmount = (this.formTwo.orderAmount - this.formTwo.settlmentAmount).toFixed(
|
|
|
+ 2)
|
|
|
this.formTwo.advanceCollectionDate = dateFormat(new Date(), "YYYY-MM-DD HH:mm:ss")
|
|
|
})
|
|
|
},
|
|
|
@@ -457,7 +477,7 @@
|
|
|
title: '加载中',
|
|
|
mask: true
|
|
|
});
|
|
|
- // typeSave(暂存方法)
|
|
|
+ // typeSave(暂存方法)
|
|
|
quickBilling(form).then(res => {
|
|
|
uni.showToast({
|
|
|
icon: "none",
|