|
@@ -149,29 +149,31 @@
|
|
|
<u-form-item label="应收金额" prop="mailbox" borderBottom>
|
|
|
<u-input v-model="form.orderAmount" inputAlign="right" border="none" placeholder="请输入" disabled
|
|
|
disabledColor="#ffffff" />
|
|
|
- </u-form-item>
|
|
|
- <view v-if="form.confirmStatus == 1">
|
|
|
- <u-form-item label="已收金额" @click="filterAll(['settlmentAmount','settlmentAmount'])" prop="mailbox"
|
|
|
- borderBottom>
|
|
|
- <u-input v-model="form.settlmentAmount" inputAlign="right" border="none" placeholder="请输入"
|
|
|
- disabled disabledColor="#ffffff" />
|
|
|
- </u-form-item>
|
|
|
- <u-form-item label="本次收款" prop="mailbox" borderBottom>
|
|
|
- <u-input type="number" clearable v-model="form.currentAmount" inputAlign="right" border="none" placeholder="请输入"
|
|
|
- :disabled="form.confirmStatus == 0 || (form.orderAmount - form.settlmentAmount) == 0" disabledColor="#ffffff" />
|
|
|
- </u-form-item>
|
|
|
- <u-form-item label="收款账户" prop="mailbox" borderBottom @click="filterAll(['account','account'])">
|
|
|
- <u-input v-model="form.account" inputAlign="right" border="none" 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>
|
|
|
- <u-form-item label="收款单号" prop="mailbox" borderBottom>
|
|
|
- <u-input v-model="form.receiptNo" inputAlign="right" border="none" disabled
|
|
|
- disabledColor="#ffffff" />
|
|
|
- </u-form-item>
|
|
|
+ </u-form-item>
|
|
|
+ <view v-if="form.confirmStatus == 1">
|
|
|
+ <u-form-item label="已收金额" @click="filterAll(['settlmentAmount','settlmentAmount'])"
|
|
|
+ prop="mailbox" borderBottom>
|
|
|
+ <u-input v-model="form.settlmentAmount" inputAlign="right" border="none" placeholder="请输入"
|
|
|
+ disabled disabledColor="#ffffff" />
|
|
|
+ </u-form-item>
|
|
|
+ <u-form-item label="本次收款" prop="mailbox" borderBottom>
|
|
|
+ <u-input type="number" clearable v-model="form.currentAmount" inputAlign="right"
|
|
|
+ border="none" placeholder="请输入"
|
|
|
+ :disabled="form.confirmStatus == 0 || (form.orderAmount - form.settlmentAmount) == 0"
|
|
|
+ disabledColor="#ffffff" />
|
|
|
+ </u-form-item>
|
|
|
+ <u-form-item label="收款账户" prop="mailbox" borderBottom @click="filterAll(['account','account'])">
|
|
|
+ <u-input v-model="form.account" inputAlign="right" border="none" 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>
|
|
|
+ <u-form-item label="收款单号" prop="mailbox" borderBottom>
|
|
|
+ <u-input v-model="form.receiptNo" inputAlign="right" border="none" disabled
|
|
|
+ disabledColor="#ffffff" />
|
|
|
+ </u-form-item>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -179,20 +181,18 @@
|
|
|
style="width: calc(96%);margin: 0 auto;background-color: #fff;border-radius: 20rpx;margin-top: 20rpx;">
|
|
|
<u-cell-group :border="false">
|
|
|
<u-cell :border="false" center title="图片信息" arrow-direction="down">
|
|
|
- <view slot="icon" style="width: 10rpx;height: 35rpx;background-color: #fd4b09;"></view>
|
|
|
- <view slot="value">
|
|
|
- <view
|
|
|
- v-if="form.confirmStatus == 1"
|
|
|
- @click.stop="saveAttachment"
|
|
|
- style="padding: 2rpx 20rpx;border:1rpx solid #FD4B09;border-radius: 100rpx;color: #FD4B09;">
|
|
|
- 保存
|
|
|
- </view>
|
|
|
+ <view slot="icon" style="width: 10rpx;height: 35rpx;background-color: #fd4b09;"></view>
|
|
|
+ <view slot="value">
|
|
|
+ <view v-if="form.confirmStatus == 1" @click.stop="saveAttachment"
|
|
|
+ style="padding: 2rpx 20rpx;border:1rpx solid #FD4B09;border-radius: 100rpx;color: #FD4B09;">
|
|
|
+ 保存
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</u-cell>
|
|
|
</u-cell-group>
|
|
|
<view style="padding: 0 10rpx;">
|
|
|
- <u-upload :fileList="fileList1" @afterRead="afterRead"
|
|
|
- @delete="deletePic" name="1" multiple :maxCount="10"></u-upload>
|
|
|
+ <u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple
|
|
|
+ :maxCount="10"></u-upload>
|
|
|
</view>
|
|
|
</view>
|
|
|
</u--form>
|
|
@@ -222,22 +222,26 @@
|
|
|
style="width: 20%;background-color: #fd4b09;display: grid;justify-items: center;">
|
|
|
<u-icon name="close" color="#fff"></u-icon>
|
|
|
<view style="color: #fff;">撤销提交</view>
|
|
|
- </view>
|
|
|
- <view v-if="form.confirmStatus == 1" style="width: 40%;">
|
|
|
- <view @click="confirmReceipt" v-if="(form.orderAmount - form.settlmentAmount) > 0"
|
|
|
- style="background-color: #5ac725;display: grid;justify-items: center;height: 100%;">
|
|
|
- <u-icon name="checkmark" color="#fff"></u-icon>
|
|
|
- <view style="color: #fff;">确认收款</view>
|
|
|
- </view>
|
|
|
- <view v-else
|
|
|
- style="background-color: #b3b3b3;display: grid;justify-items: center;height: 100%;">
|
|
|
- <u-icon name="checkmark" color="#fff"></u-icon>
|
|
|
- <view style="color: #fff;">已全部收款</view>
|
|
|
- </view>
|
|
|
</view>
|
|
|
-
|
|
|
+ <view v-if="form.confirmStatus == 1" style="width: 40%;">
|
|
|
+ <view @click="confirmReceipt" v-if="(form.orderAmount - form.settlmentAmount) > 0"
|
|
|
+ style="background-color: #5ac725;display: grid;justify-items: center;height: 100%;">
|
|
|
+ <u-icon name="checkmark" color="#fff"></u-icon>
|
|
|
+ <view style="color: #fff;">确认收款</view>
|
|
|
+ </view>
|
|
|
+ <view v-else style="background-color: #b3b3b3;display: grid;justify-items: center;height: 100%;">
|
|
|
+ <u-icon name="checkmark" color="#fff"></u-icon>
|
|
|
+ <view style="color: #fff;">已全部收款</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <view v-if="choice" class="choice" @touchmove.stop.prevent="moveHandle">
|
|
|
+ <u-cell-group>
|
|
|
+ <u-cell icon="setting-fill" title="未连接"></u-cell>
|
|
|
+ <u-cell icon="integral-fill" title="保存图片"></u-cell>
|
|
|
+ </u-cell-group>
|
|
|
+ </view>
|
|
|
<u-datetime-picker :show="timeOpen" v-model="datetime" mode="date" @cancel="timeOpen = false"
|
|
|
@confirm="confirmTiem"></u-datetime-picker>
|
|
|
<u-picker :show="showOpen" :columns="columns" keyName="dictValue" @cancel="showOpen = false"
|
|
@@ -255,8 +259,9 @@
|
|
|
revoke,
|
|
|
removeItem,
|
|
|
removeId,
|
|
|
- copyOrder,
|
|
|
- collectPayment,saveAtta
|
|
|
+ copyOrder,
|
|
|
+ collectPayment,
|
|
|
+ saveAtta
|
|
|
} from '@/api/views/sale/salesOrderDetails.js'
|
|
|
import http from '@/http/api.js'
|
|
|
import {
|
|
@@ -266,6 +271,9 @@
|
|
|
import {
|
|
|
dateFormat
|
|
|
} from '@/common/dateFormat'
|
|
|
+ // #ifdef APP-PLUS
|
|
|
+ const HanyinPlugin = uni.requireNativePlugin('Hanyin-Plugin'); //汉印
|
|
|
+ // #endif
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
@@ -277,6 +285,7 @@
|
|
|
fileList1: [],
|
|
|
screen: [],
|
|
|
showOpen: false,
|
|
|
+ choice: false,
|
|
|
columns: [],
|
|
|
amountNumber: {
|
|
|
deliveryAll: 0,
|
|
@@ -290,13 +299,26 @@
|
|
|
},
|
|
|
onLoad(data) {
|
|
|
this.refresh(data.id)
|
|
|
+ // #ifdef APP-PLUS
|
|
|
+ HanyinPlugin.IsOpened(res => {
|
|
|
+ console.log(res.state)
|
|
|
+ if (res.state == true) {
|
|
|
+ console.log(Bluetooth)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // #endif
|
|
|
+ },
|
|
|
+ onNavigationBarButtonTap(e) {
|
|
|
+ this.choice = !this.choice
|
|
|
+ // uni.$u.route('/pages/views/bluetooth/index',{data:JSON.stringify(this.form)});
|
|
|
},
|
|
|
methods: {
|
|
|
- newCompany() {
|
|
|
- uni.$u.route('/pages/views/product/createCompany',{
|
|
|
- code:"account",
|
|
|
- title:"收款账户"
|
|
|
- });
|
|
|
+ moveHandle(){},
|
|
|
+ newCompany() {
|
|
|
+ uni.$u.route('/pages/views/product/createCompany', {
|
|
|
+ code: "account",
|
|
|
+ title: "收款账户"
|
|
|
+ });
|
|
|
},
|
|
|
calculationContract() {
|
|
|
let data = {
|
|
@@ -350,11 +372,14 @@
|
|
|
}
|
|
|
for (let item of this_.form.orderItemsList) {
|
|
|
this_.amountNumber.saleAll += Number(item.storageInQuantity)
|
|
|
- this_.amountNumber.cost += Number(item.storageInQuantity) * Number(item.purchasePrice)
|
|
|
+ this_.amountNumber.cost += Number(item.storageInQuantity) * Number(
|
|
|
+ item.purchasePrice)
|
|
|
this_.amountNumber.delivery += Number(item.actualQuantity)
|
|
|
this_.amountNumber.deliveryAll += Number(item.actualQuantity)
|
|
|
this_.amountNumber.amount += Number(item.amount)
|
|
|
- this_.amountNumber.grossProfit += Number(item.amount) - (item.purchasePrice ? Number(item.storageInQuantity) * Number(item.purchasePrice) : 0)
|
|
|
+ this_.amountNumber.grossProfit += Number(item.amount) - (item
|
|
|
+ .purchasePrice ? Number(item.storageInQuantity) * Number(
|
|
|
+ item.purchasePrice) : 0)
|
|
|
}
|
|
|
this.form.purchaseAmount = this.amountNumber.amount
|
|
|
})
|
|
@@ -364,13 +389,13 @@
|
|
|
},
|
|
|
deleteDoc() {
|
|
|
if (this.form.id) {
|
|
|
- let this_ = this
|
|
|
- if(this_.form.confirmStatus == 1){
|
|
|
- return uni.showToast({
|
|
|
- icon: "none",
|
|
|
- title: '禁止删除',
|
|
|
- mask: true
|
|
|
- });
|
|
|
+ let this_ = this
|
|
|
+ if (this_.form.confirmStatus == 1) {
|
|
|
+ return uni.showToast({
|
|
|
+ icon: "none",
|
|
|
+ title: '禁止删除',
|
|
|
+ mask: true
|
|
|
+ });
|
|
|
}
|
|
|
uni.showModal({
|
|
|
title: '提示',
|
|
@@ -443,7 +468,7 @@
|
|
|
this.showOpen = false
|
|
|
},
|
|
|
//集合筛选条件
|
|
|
- filterAll(screen) {
|
|
|
+ filterAll(screen) {
|
|
|
if (screen[1] == "account") {
|
|
|
if (this.form.confirmStatus == 0) {
|
|
|
return uni.showToast({
|
|
@@ -451,22 +476,22 @@
|
|
|
title: '禁止操作',
|
|
|
mask: true
|
|
|
});
|
|
|
- }else if((this.form.orderAmount - this.form.settlmentAmount) == 0){
|
|
|
- return uni.showToast({
|
|
|
- icon: "none",
|
|
|
- title: '禁止操作',
|
|
|
- mask: true
|
|
|
- });
|
|
|
+ } else if ((this.form.orderAmount - this.form.settlmentAmount) == 0) {
|
|
|
+ return uni.showToast({
|
|
|
+ icon: "none",
|
|
|
+ title: '禁止操作',
|
|
|
+ mask: true
|
|
|
+ });
|
|
|
}
|
|
|
- } else {
|
|
|
- if(screen[1] !== "settlmentAmount"){
|
|
|
- if (this.form.confirmStatus == 1) {
|
|
|
- return uni.showToast({
|
|
|
- icon: "none",
|
|
|
- title: '禁止操作',
|
|
|
- mask: true
|
|
|
- });
|
|
|
- }
|
|
|
+ } else {
|
|
|
+ if (screen[1] !== "settlmentAmount") {
|
|
|
+ if (this.form.confirmStatus == 1) {
|
|
|
+ return uni.showToast({
|
|
|
+ icon: "none",
|
|
|
+ title: '禁止操作',
|
|
|
+ mask: true
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
this.screen = screen
|
|
@@ -515,90 +540,91 @@
|
|
|
this.amountNumber.delivery += Number(item.actualQuantity)
|
|
|
this.amountNumber.deliveryAll += Number(item.actualQuantity)
|
|
|
this.amountNumber.amount += Number(item.amount)
|
|
|
- this.amountNumber.grossProfit += Number(item.amount) - (item.purchasePrice ? Number(item.storageInQuantity) * Number(item.purchasePrice) : 0)
|
|
|
+ this.amountNumber.grossProfit += Number(item.amount) - (item.purchasePrice ? Number(item
|
|
|
+ .storageInQuantity) * Number(item.purchasePrice) : 0)
|
|
|
}
|
|
|
- this.form.purchaseAmount = this.amountNumber.amount
|
|
|
- setTimeout(function() {
|
|
|
- uni.hideLoading();
|
|
|
+ this.form.purchaseAmount = this.amountNumber.amount
|
|
|
+ setTimeout(function() {
|
|
|
+ uni.hideLoading();
|
|
|
}, 500);
|
|
|
})
|
|
|
},
|
|
|
//确认收款
|
|
|
- confirmReceipt() {
|
|
|
- let this_ = this
|
|
|
- let form = {
|
|
|
- ...this_.form,
|
|
|
- orderFilesList: this_.fileList1
|
|
|
- }
|
|
|
- if (form.orderFilesList.length > 0) {
|
|
|
- form.orderFilesList.forEach(item => delete item.status)
|
|
|
- }
|
|
|
- if(!form.currentAmount){
|
|
|
- return uni.showToast({
|
|
|
- icon: "none",
|
|
|
- title: '本次收款金额不能为空',
|
|
|
- mask: true,
|
|
|
- duration:2000
|
|
|
- });
|
|
|
- }
|
|
|
- if(!form.account){
|
|
|
- return uni.showToast({
|
|
|
- icon: "none",
|
|
|
- title: '未选择收款账户',
|
|
|
- mask: true,
|
|
|
- duration:2000
|
|
|
- });
|
|
|
+ confirmReceipt() {
|
|
|
+ let this_ = this
|
|
|
+ let form = {
|
|
|
+ ...this_.form,
|
|
|
+ orderFilesList: this_.fileList1
|
|
|
+ }
|
|
|
+ if (form.orderFilesList.length > 0) {
|
|
|
+ form.orderFilesList.forEach(item => delete item.status)
|
|
|
+ }
|
|
|
+ if (!form.currentAmount) {
|
|
|
+ return uni.showToast({
|
|
|
+ icon: "none",
|
|
|
+ title: '本次收款金额不能为空',
|
|
|
+ mask: true,
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (!form.account) {
|
|
|
+ return uni.showToast({
|
|
|
+ icon: "none",
|
|
|
+ title: '未选择收款账户',
|
|
|
+ mask: true,
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
}
|
|
|
uni.showModal({
|
|
|
title: '是否确认收款',
|
|
|
- content: '本次收款金额'+form.currentAmount,
|
|
|
+ content: '本次收款金额' + form.currentAmount,
|
|
|
success: function(rest) {
|
|
|
- if (rest.confirm == true) {
|
|
|
- uni.showLoading({
|
|
|
- title: '加载中',
|
|
|
- mask: true
|
|
|
- });
|
|
|
- collectPayment(form).then(res=>{
|
|
|
- uni.showToast({
|
|
|
- icon: "none",
|
|
|
- title: '收款成功',
|
|
|
- mask: true,
|
|
|
- duration:2000
|
|
|
- });
|
|
|
- setTimeout(function() {
|
|
|
- uni.hideLoading();
|
|
|
- this_.refresh(res.data.id)
|
|
|
- }, 1000);
|
|
|
- })
|
|
|
+ if (rest.confirm == true) {
|
|
|
+ uni.showLoading({
|
|
|
+ title: '加载中',
|
|
|
+ mask: true
|
|
|
+ });
|
|
|
+ collectPayment(form).then(res => {
|
|
|
+ uni.showToast({
|
|
|
+ icon: "none",
|
|
|
+ title: '收款成功',
|
|
|
+ mask: true,
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ setTimeout(function() {
|
|
|
+ uni.hideLoading();
|
|
|
+ this_.refresh(res.data.id)
|
|
|
+ }, 1000);
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
- },
|
|
|
- //保存附件
|
|
|
- saveAttachment(){
|
|
|
- let form = {
|
|
|
- pid:this.form.id,
|
|
|
- orderFilesList: this.fileList1
|
|
|
- }
|
|
|
- if (form.orderFilesList.length > 0) {
|
|
|
- form.orderFilesList.forEach(item => delete item.status)
|
|
|
- }
|
|
|
- uni.showLoading({
|
|
|
- title: '加载中',
|
|
|
- mask: true
|
|
|
- });
|
|
|
- saveAtta(form).then(res => {
|
|
|
- uni.showToast({
|
|
|
- icon: "none",
|
|
|
- title: '保存成功',
|
|
|
- mask: true
|
|
|
- });
|
|
|
- let _this = this
|
|
|
- setTimeout(function() {
|
|
|
- uni.hideLoading();
|
|
|
- _this.refresh(res.data.id)
|
|
|
- }, 1000);
|
|
|
- })
|
|
|
+ },
|
|
|
+ //保存附件
|
|
|
+ saveAttachment() {
|
|
|
+ let form = {
|
|
|
+ pid: this.form.id,
|
|
|
+ orderFilesList: this.fileList1
|
|
|
+ }
|
|
|
+ if (form.orderFilesList.length > 0) {
|
|
|
+ form.orderFilesList.forEach(item => delete item.status)
|
|
|
+ }
|
|
|
+ uni.showLoading({
|
|
|
+ title: '加载中',
|
|
|
+ mask: true
|
|
|
+ });
|
|
|
+ saveAtta(form).then(res => {
|
|
|
+ uni.showToast({
|
|
|
+ icon: "none",
|
|
|
+ title: '保存成功',
|
|
|
+ mask: true
|
|
|
+ });
|
|
|
+ let _this = this
|
|
|
+ setTimeout(function() {
|
|
|
+ uni.hideLoading();
|
|
|
+ _this.refresh(res.data.id)
|
|
|
+ }, 1000);
|
|
|
+ })
|
|
|
},
|
|
|
//保存
|
|
|
conserve() {
|
|
@@ -814,4 +840,19 @@
|
|
|
::v-deep .u-cell__body {
|
|
|
padding: 20rpx 10rpx;
|
|
|
}
|
|
|
+
|
|
|
+ .choice {
|
|
|
+ // position: fixed;
|
|
|
+ // top: calc(var(--status-bar-height) + 44px);
|
|
|
+ // right: 0;
|
|
|
+ // border: 1rpx solid #000;
|
|
|
+ // background-color: #fff;
|
|
|
+
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ position: fixed;
|
|
|
+ top: 0;
|
|
|
+ bottom: 0;
|
|
|
+ background-color: rgba(1, 1, 1, 0.3);
|
|
|
+ }
|
|
|
</style>
|