收款单认款加业务日期和条件判断

product
bawei 1 year ago
parent 1c27273fd8
commit 54b65a63e8

@ -2,7 +2,7 @@
server:
tomcat:
uri-encoding: UTF-8 #tomcat编码
port: 30001 #tomcat端口
port: 30000 #tomcat端口
spring:
devtools: #spring开发者工具模块

@ -164,9 +164,9 @@ public class CollectionController {
* @param ids
* @return
*/
@PostMapping("/confirmprice/{ids}")
@PutMapping("/confirmprice/{ids}")
@Transactional
public ActionResult confirmPrice(@PathVariable("ids") String ids) {
public ActionResult confirmPrice(@PathVariable("ids") String ids, @RequestBody @Valid CollectionEntity collectionUpForm) {
String userId=userProvider.get().getUserId();
String detpartment=null;
if (!userProvider.get().getIsAdministrator()) {
@ -241,7 +241,7 @@ public class CollectionController {
// saleordercetEntity.setStatus("3");
saleorderitemService.updateById(saleordercetEntity);
collectionEntity.setStatus("2");
collectionEntity.setBusinessDate(new Date());
collectionEntity.setBusinessDate(collectionUpForm.getBusinessDate());
collectionEntity.setCollectionUserId(userId);
if (StringUtil.isNotNull(detpartment)) {
collectionEntity.setCollectionDept(detpartment);

@ -4,6 +4,8 @@ package jnpf.collection.model.collection;
import jnpf.collection.model.collection.Collection_item0Model;
import lombok.Data;
import java.util.Date;
import java.util.List;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
@ -90,5 +92,8 @@ public class CollectionUpForm{
@JsonProperty("collection_item0List")
private List<Collection_item0Model> collection_item0List;
@JsonProperty("businessDate")
private Date businessDate;
}

@ -0,0 +1,479 @@
<template>
<el-dialog :title="'认款'" :close-on-click-modal="false" append-to-body
:visible.sync="visible" v-if="visible" v-dialogDrag class="JNPF-dialog JNPF-dialog_center" lock-scroll width="600px">
<el-row :gutter="15" class="">
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right">
<template v-if="!loading">
<el-col :span="24">
<el-form-item label="单据编号" prop="documentNo">
<el-input v-model="dataForm.documentNo" placeholder="系统自动生成" readonly>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="业务日期" prop="businessDate">
<el-date-picker v-model="dataForm.businessDate" placeholder="请选择业务日期" clearable :style='{"width":"100%"}'
type="date" format="yyyy-MM-dd" value-format="timestamp">
</el-date-picker>
</el-form-item>
</el-col>
<!-- <el-col :span="24">-->
<!-- <el-form-item label="备注信息" prop="remark">-->
<!-- <el-input v-model="dataForm.remark" placeholder="请输入" clearable :style='{"width":"100%"}'>-->
<!-- </el-input>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
</template>
</el-form>
</el-row>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false"> </el-button>
<el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail" :disabled="submitDisabled"> </el-button>
</span>
<CustomerBox v-if="formVisible2" ref="form2" @refreshDataList="initData2" />
</el-dialog>
</template>
<script>
import request from '@/utils/request'
import CustomerBox from './CustomerBox'
import {
getDataInterfaceRes
} from '@/api/systemData/dataInterface'
import {
getDictionaryDataSelector
} from '@/api/systemData/dictionary'
export default {
components: {CustomerBox},
props: [],
data() {
return {
formVisible2: false,
submitDisabled: false,
paymentType: "0",
currency: "0",
settlementType: "0",
visible: false,
loading: false,
isDetail: false,
dataForm: {
code: '',
customerCode: '',
documentNo: '',
customerName: '',
customerId: '',
contractId: '',
amountCollected: '',
collectionCount: '',
collectionBank: '',
paymentType: "0",
currency: "0",
settlementType: "0",
remark: '',
voucher: [],
status: "0",
creatorUserName: '',
collection_item0List: [],
},
activeojnisi: '0',
rules: {
businessDate: [{
required: true,
message: '请选择业务日期',
trigger: 'change'
},],
},
customerNamecolumnOptions: [{
"label": "客户编码",
"value": "supplier_cd"
}, {
"label": "客户名称",
"value": "supplier_nm"
}, {
"label": "客户地点名称",
"value": "supplier_site_code"
}, {
"label": "客户等级",
"value": "customer_level"
}, {
"label": "银行账号",
"value": "bank_account"
}, {
"label": "开户行",
"value": "bank"
},],
contractNamecolumnOptions: [{
"label": "合同编码",
"value": "contract_code"
}, {
"label": "合同名称",
"value": "contract_name"
} ],
jg_collection_item0deleteTimecolumnOptions: [ {
"label": "销售订单编号",
"value": "document_no"
}, {
"label": "合同编号",
"value": "contract_id"
},
{
"label": "订单金额",
"value": "price"
}, {
"label": "已收款金额",
"value": "amount_collected"
},
{
"label": "重量",
"value": "num"
}, {
"label": "垫资金额",
"value": "advance_amount"
},
{
"label": "税额",
"value": "rate"
}, {
"label": "不含税金额",
"value": "not_price"
}, {
"label": "业务日期",
"value": "creator_time"
},
],
paymentTypeOptions: [{
"fullName": "货款",
"id": "0"
}, {
"fullName": "运费",
"id": "1"
}, {
"fullName": "仓储",
"id": "2"
}],
taxRateOptions: [{
"fullName": "13",
"id": "0"
}, {
"fullName": "9",
"id": "1"
}, {
"fullName": "6",
"id": "2"
}, {
"fullName": "5",
"id": "3"
}, {
"fullName": "3",
"id": "4"
}, {
"fullName": "0",
"id": "5"
}],
}
},
computed: {},
watch: {},
created() {},
mounted() {},
methods: {
paymentTypeChange(e){
this.dataForm.paymentType = e;
},
currencyChange(e){
this.dataForm.currency = e;
},
settlementTypeChange(e){
this.dataForm.settlementType = e;
},
getSummaries(param) {
const { columns, data } = param;
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计';
return;
}
const values = data.map(item => Number(item[column.property]));
if (!values.every(value => isNaN(value)) && (index === 1 || index === 2 || index === 3 || index === 6 || index === 7 || index === 8 || index === 9)) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return this.jnpf.floatAdd(prev, curr);
} else {
return prev;
}
}, 0);
} else {
sums[index] = '';
}
});
return sums;
},
amountSum(){
let sum = 0;
for (let i = 0; i<this.dataForm.collection_item0List.length;i++){
sum = this.jnpf.floatAdd(sum,this.dataForm.collection_item0List[i].amount);
}
this.dataForm.amountCollected = sum;
},
choiceCustomerId(){
this.formVisible2 = true
this.$nextTick(() => {
this.$refs.form2.init()
})
},
initData2(custmer) {
this.dataForm.code = custmer.id;
this.dataForm.customerId = custmer.id;
this.dataForm.customerName = custmer.supplierNm;
this.dataForm.collectionCount = custmer.bankAccount;
this.dataForm.collectionBank = custmer.bank;
this.popupSelect();
},
popupSelect() {
// this.dataForm.code = d.id;
// this.dataForm.collectionCount = d.bank_account;
// this.dataForm.collectionBank = d.bank;
this.dataForm.collection_item0List = [];
let params = {
"param" : this.dataForm.customerId
}
request({
url: '/api/collection/Collection/display',
method: 'get',
data: params
}).then(res => {
let data = res.data;
let amountSum = 0;
this.dataForm.contractId = data.id;
for (let i = 0; i< data.saleorderitemList.length;i++){
this.addcollection_item0List();
this.dataForm.collection_item0List[i].salesorderId = data.saleorderitemList[i].id;
this.dataForm.collection_item0List[i].price = data.saleorderitemList[i].price;
this.dataForm.collection_item0List[i].amountCollected = data.saleorderitemList[i].amountCollected;
this.dataForm.collection_item0List[i].contractId = data.saleorderitemList[i].contractId;
this.dataForm.collection_item0List[i].num = data.saleorderitemList[i].num;
this.dataForm.collection_item0List[i].advanceAmount = data.saleorderitemList[i].advanceAmount;
this.dataForm.collection_item0List[i].rate = data.saleorderitemList[i].rate;
this.dataForm.collection_item0List[i].notPrice = data.saleorderitemList[i].notPrice;
this.dataForm.collection_item0List[i].amount = this.jnpf.floatSub(data.saleorderitemList[i].price,data.saleorderitemList[i].amountCollected);
this.dataForm.collection_item0List[i].creatorTime = new Date().getTime();
amountSum = this.jnpf.floatAdd(amountSum,this.dataForm.collection_item0List[i].amount);
}
this.dataForm.amountCollected = amountSum;
this.loading = false
});
},
contractSelect(){
this.dataForm.collection_item0List = [];
let params = {
"param" : this.dataForm.contractId
}
request({
url: '/api/collection/Collection/show',
method: 'get',
data: params
}).then(res => {
let data = res.data;
let amountSum = 0;
this.dataForm.contractId = data.id;
for (let i = 0; i< data.saleorderitemList.length;i++){
this.addcollection_item0List();
this.dataForm.collection_item0List[i].salesorderId = data.saleorderitemList[i].id;
this.dataForm.collection_item0List[i].price = data.saleorderitemList[i].price;
this.dataForm.collection_item0List[i].amountCollected = data.saleorderitemList[i].amountCollected;
this.dataForm.collection_item0List[i].contractId = data.saleorderitemList[i].contractId;
this.dataForm.collection_item0List[i].num = data.saleorderitemList[i].num;
this.dataForm.collection_item0List[i].advanceAmount = data.saleorderitemList[i].advanceAmount;
this.dataForm.collection_item0List[i].rate = data.saleorderitemList[i].rate;
this.dataForm.collection_item0List[i].notPrice = data.saleorderitemList[i].notPrice;
this.dataForm.collection_item0List[i].amount = this.jnpf.floatSub(data.saleorderitemList[i].price,data.saleorderitemList[i].amountCollected);
this.dataForm.collection_item0List[i].creatorTime = new Date().getTime();
amountSum = this.jnpf.floatAdd(amountSum,this.dataForm.collection_item0List[i].amount);
}
this.dataForm.amountCollected = amountSum;
this.loading = false
});
},
popupSelect2(a, b) {
let amountCollectedSum = 0;
for (let i = 0; i < this.dataForm.collection_item0List.length; i++) {
debugger
if (a == this.dataForm.collection_item0List[i].salesorderId) {
this.dataForm.collection_item0List[i].price = b.price;
this.dataForm.collection_item0List[i].amountCollected = b.amount_collected;
this.dataForm.collection_item0List[i].contractId = b.contract_id;
this.dataForm.collection_item0List[i].num = b.num;
this.dataForm.collection_item0List[i].advanceAmount = b.advance_amount;
this.dataForm.collection_item0List[i].rate = b.rate;
this.dataForm.collection_item0List[i].notPrice = b.not_price;
this.dataForm.collection_item0List[i].amount = this.jnpf.floatSub(b.price,b.amount_collected);
this.dataForm.collection_item0List[i].creatorTime = new Date().getTime();
amountCollectedSum = this.jnpf.floatAdd(amountCollectedSum,this.dataForm.collection_item0List[i].amount);
}
}
this.dataForm.amountCollected = amountCollectedSum;
},
collection_item0Exist() {
let isOk = true;
for (let i = 0; i < this.dataForm.collection_item0List.length; i++) {
const e = this.dataForm.collection_item0List[i];
}
return isOk;
},
clearData(data) {
for (let key in data) {
if (data[key] instanceof Array) {
data[key] = [];
} else if (data[key] instanceof Object) {
this.clearData(data[key]);
} else {
data[key] = "";
}
}
this.dataForm.paymentType = '0'
this.dataForm.currency = '0'
this.dataForm.settlementType = '0'
let params = {
"param" : 'collection'
}
request({
url: '/api/collection/Collection/autoSerialNum',
method: 'get',
data: params
}).then(res => {
this.dataForm.documentNo = res.msg
this.loading = false
});
},
init(id, isDetail) {
this.dataForm.id = id || 0;
this.visible = true;
this.isDetail = isDetail || false;
this.$nextTick(() => {
this.$refs['elForm'].resetFields();
if (this.dataForm.id) {
this.loading = true
request({
url: '/api/collection/Collection/' + this.dataForm.id,
method: 'get'
}).then(res => {
debugger
this.dataInfo(res.data)
this.loading = false
});
} else {
this.clearData(this.dataForm)
}
});
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
},
//
dataFormSubmit() {
this.$refs['elForm'].validate((valid) => {
if (valid) {
if (!this.collection_item0Exist()) return
this.request()
}
})
},
request() {
this.submitDisabled = true;
var _data = this.dataList()
// var saleFlag = false;
// var amountFlag = false;
// for (let i = 0; i < _data.collection_item0List.length; i++) {
// var _list = _data.collection_item0List[i];
// debugger
// if (_list.salesorderId == null){
// saleFlag = true;
// }
// if (_list.amount == null || _list.amount == 0 || _list.amount == ''){
// amountFlag = true;
// }
// }
if (!this.dataForm.id) {
let ids = this.dataForm.id;
request({
url: `/api/collection/Collection/confirmprice/${ids}`,
method: "PUT",
data: _data
}).then((res) => {
this.$message({
type: "success",
message: res.msg,
duration: 2500,
onClose: () => {
this.submitDisabled = false;
this.$emit('refresh', true)
}
});
});
} else {
let ids = this.dataForm.id;
request({
url: `/api/collection/Collection/confirmprice/${ids}`,
method: "PUT",
data: _data
}).then((res) => {
this.$message({
type: "success",
message: res.msg,
duration: 2500,
onClose: () => {
this.submitDisabled = false;
this.$emit('refresh', true)
}
});
});
}
},
addcollection_item0List() {
let item = {
amount: undefined,
price: undefined,
amountCollected: undefined,
salesorderId: undefined,
contractId: undefined,
num: undefined,
advanceAmount: undefined,
rate: undefined,
notPrice: undefined,
}
this.dataForm.collection_item0List.push(item)
},
delcollection_item0List(index) {
this.dataForm.collection_item0List.splice(index, 1);
this.amountSum();
},
dataList() {
var _data = JSON.parse(JSON.stringify(this.dataForm));
_data.voucher = JSON.stringify(_data.voucher)
for (let i = 0; i < _data.collection_item0List.length; i++) {
var _list = _data.collection_item0List[i];
}
return _data;
},
dataInfo(dataAll) {
let _dataAll = dataAll
_dataAll.voucher = JSON.parse(_dataAll.voucher)
for (let i = 0; i < _dataAll.collection_item0List.length; i++) {
var _list = _dataAll.collection_item0List[i];
}
this.dataForm = _dataAll
debugger
},
},
}
</script>

@ -274,6 +274,7 @@
</div>
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh" />
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" />
<JNPF-Form3 v-if="formVisible3" ref="JNPFForm3" @refresh="refresh3" />
<Detail
v-if="detailVisible"
ref="Detail"
@ -289,12 +290,15 @@ import JNPFForm from "./Form";
import ExportBox from "./ExportBox";
import { getDataInterfaceRes } from "@/api/systemData/dataInterface";
import Detail from "./Detail";
import JNPFForm2 from "@/views/scm/basicInformation/purchaseorder/InvoicesForm";
import JNPFForm3 from "./Form3";
export default {
components: {
JNPFForm,
ExportBox,
Detail,
JNPFForm3,
},
data() {
return {
@ -321,6 +325,7 @@ export default {
},
formVisible: false,
exportBoxVisible: false,
formVisible3: false,
columnList: [
{
prop: "documentNo",
@ -622,6 +627,38 @@ export default {
});
}
},
// confirmprice() {
// if (!this.multipleSelection.length) {
// this.$message({
// type: "error",
// message: "",
// duration: 2500,
// });
// return;
// }
// let ids = this.multipleSelection.join();
// if (this.multipleSelection.length === 1) {
// request({
// url: `/api/collection/Collection/confirmprice/${ids}`,
// method: "POST",
// }).then((res) => {
// this.$message({
// type: "success",
// message: res.msg,
// onClose: () => {
// this.initData();
// },
// });
// });
// if (this.multipleSelection.length > 1) {
// this.$message({
// type: "error",
// message: "",
// duration: 2500,
// });
// }
// }
// },
confirmprice() {
if (!this.multipleSelection.length) {
this.$message({
@ -631,29 +668,38 @@ export default {
});
return;
}
let ids = this.multipleSelection.join();
if (this.multipleSelection.length === 1) {
request({
url: `/api/collection/Collection/confirmprice/${ids}`,
method: "POST",
}).then((res) => {
this.$message({
type: "success",
message: res.msg,
onClose: () => {
this.initData();
},
});
this.multipleSelectionItem.forEach((item, index) => {
console.log("没有进去")
if (item.status == 2) {
this.$message({
type: "error",
message: "单据状态为已认款",
duration: 2500,
});
if (this.multipleSelection.length > 1) {
this.$message({
type: "error",
message: "请选择单条数据",
duration: 2500,
console.log("ok")
return;
} else {
if (this.multipleSelection.length === 1) {
var id = undefined;
id= this.multipleSelectionItem[0].id
this.formVisible3 = true;
this.$nextTick(() => {
this.$refs.JNPFForm3.init(id);
});
if (this.multipleSelection.length > 1) {
this.$message({
type: "error",
message: "请选择单条数据",
duration: 2500,
});
}
}
}
});
},
addOrUpdateHandle(row, isDetail) {
var id = undefined;
if (row) {
@ -716,6 +762,10 @@ export default {
this.formVisible = false;
if (isrRefresh) this.reset();
},
refresh3(isrRefresh) {
this.formVisible3 = false;
if (isrRefresh) this.reset();
},
reset() {
// for (let key in this.query) {
// this.query[key] = undefined

Loading…
Cancel
Save