|
@@ -53,6 +53,15 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</template>
|
|
|
+ <template slot="remark">
|
|
|
+ <el-input type="textarea"
|
|
|
+ v-model="form.remark"
|
|
|
+ size="small"
|
|
|
+ rows="2"
|
|
|
+ autocomplete="off"
|
|
|
+ placeholder="">
|
|
|
+ </el-input>
|
|
|
+ </template>
|
|
|
</avue-form>
|
|
|
</basic-container>
|
|
|
<basic-container>
|
|
@@ -64,14 +73,13 @@
|
|
|
@search-reset="searchReset"
|
|
|
@row-update="rowUpdate"
|
|
|
@selection-change="selectionChange"
|
|
|
- @current-change="currentChange"
|
|
|
- @size-change="sizeChange"
|
|
|
- @refresh-change="refreshChange">
|
|
|
+ >
|
|
|
<template slot="menuLeft">
|
|
|
<el-button type="primary"
|
|
|
size="small"
|
|
|
:loading="buttonLoading"
|
|
|
icon="el-icon-shopping-cart-2"
|
|
|
+ :disabled="!financeButton"
|
|
|
@click="selectPurchase">选择采购合同
|
|
|
</el-button>
|
|
|
</template>
|
|
@@ -80,6 +88,7 @@
|
|
|
type="text"
|
|
|
size="small"
|
|
|
icon="el-icon-edit"
|
|
|
+ :disabled="!financeButton"
|
|
|
@click.stop="rowCell(scope.row,scope.index)"
|
|
|
> {{ scope.row.$cellEdit ? '修改完成' : '修改' }}
|
|
|
</el-button>
|
|
@@ -87,10 +96,10 @@
|
|
|
type="text"
|
|
|
size="small"
|
|
|
icon="el-icon-delete"
|
|
|
+ :disabled="!financeButton"
|
|
|
@click.stop="rowDel(scope.row,scope.index)"
|
|
|
>删除
|
|
|
</el-button>
|
|
|
-<!-- :disabled="!financeDisabled || financeButton"-->
|
|
|
</template>
|
|
|
<template slot-scope="{ row }" slot="currency">
|
|
|
<el-select v-if="row.$cellEdit" v-model="row.currency" size="small" placeholder="请选择 币别" clearable filterable>
|
|
@@ -99,9 +108,11 @@
|
|
|
<span v-else>{{ row.currency }}</span>
|
|
|
</template>
|
|
|
<template slot="thisAmount" slot-scope="{ row }">
|
|
|
+ <span v-if="row.$cellEdit" class="required_fields">*</span>
|
|
|
<el-input
|
|
|
v-if="row.$cellEdit"
|
|
|
v-model="row.thisAmount"
|
|
|
+ style="width: 90%"
|
|
|
placeholder="请输入"
|
|
|
size="small"
|
|
|
oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
|
|
@@ -354,6 +365,7 @@
|
|
|
})
|
|
|
}else{
|
|
|
this.form.financeStatus = "待结算"
|
|
|
+ this.oldForm.financeStatus = "待结算"
|
|
|
}
|
|
|
|
|
|
if(this.detailData.params){
|
|
@@ -411,16 +423,11 @@
|
|
|
item.accId = item.id;
|
|
|
item.srcOrderno = item.accSysNo
|
|
|
item.billNo = item.srcBillNo
|
|
|
- item.thisAmount = _.subtract(item.amount, item.settlementAmount) //设置本次结算最大限度
|
|
|
- item.maxThisAmount = item.thisAmount
|
|
|
delete item.id;
|
|
|
|
|
|
this.$refs.crud.rowCellAdd(item);
|
|
|
})
|
|
|
- //明细列表金额总和等于form总金额
|
|
|
- // this.form.amount = _.sum(this.dataList.map(item =>{ return parseFloat(item.amount)}));
|
|
|
- // this.form.srcOrderno = this.dataList.map(item =>{return item.srcOrderno}).join(",")
|
|
|
-
|
|
|
+ this.$set(this.form,'srcOrderno',Array.from(new Set(this.dataList.map(item =>{ return item.srcOrderno}))).join(','))
|
|
|
this.billDetailDialog = false;
|
|
|
},
|
|
|
rowUpdate(row, index, done) {
|
|
@@ -439,32 +446,21 @@
|
|
|
selectionChange() {
|
|
|
console.log('1')
|
|
|
},
|
|
|
- currentChange() {
|
|
|
- console.log('1')
|
|
|
- },
|
|
|
- sizeChange() {
|
|
|
- console.log('1')
|
|
|
- },
|
|
|
- refreshChange() {
|
|
|
- console.log('1')
|
|
|
- },
|
|
|
confirmSettlement(status){
|
|
|
this.$refs["form"].validate((valid,done) => {
|
|
|
done();
|
|
|
- if(valid){
|
|
|
+ if(valid && this.verificationData()){
|
|
|
this.$confirm("是否确认付费?", "提示", {
|
|
|
confirmButtonText: "确认",
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning",
|
|
|
}).then(()=>{
|
|
|
for (let i = 0; i < this.dataList.length; i++) {
|
|
|
- if (this.dataList[i].thisAmount == null) {
|
|
|
+ if (this.dataList[i].thisAmount == null || this.dataList[i].thisAmount == 0) {
|
|
|
return this.$message.error(`第${i + 1}行的本次金额不能为空`);
|
|
|
}
|
|
|
- if (this.dataList[i].thisAmount === 0) {
|
|
|
- return this.$message.error(`第${i + 1}行的本次金额不能为0`);
|
|
|
- }
|
|
|
}
|
|
|
+
|
|
|
this.buttonLoading = true
|
|
|
this.form.billNo = this.dataList.map(item =>{return item.billNo}).join(",")
|
|
|
|
|
@@ -499,6 +495,12 @@
|
|
|
saveSettlement(){
|
|
|
this.$refs["form"].validate((valid,done) => {
|
|
|
if(valid){
|
|
|
+ for (let i = 0; i < this.dataList.length; i++) {
|
|
|
+ if (this.dataList[i].thisAmount == (null || "")) {
|
|
|
+ return this.$message.error(`第输入${i + 1}行的本次金额`);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
this.buttonLoading = true
|
|
|
this.form.billNo = this.dataList.map(item =>{return item.billNo}).join(",")
|
|
|
|
|
@@ -552,6 +554,22 @@
|
|
|
this.oldDataList = this.deepClone(data.itemsList)
|
|
|
}
|
|
|
},
|
|
|
+ verificationData(){
|
|
|
+ if(contrastObj(this.form,this.oldForm) || contrastList(this.dataList,this.oldDataList)
|
|
|
+ ){
|
|
|
+ this.$confirm("数据发生变化,请先提交保存!", "提示", {
|
|
|
+ confirmButtonText: "保存",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ }).then(() => {
|
|
|
+ this.saveSettlement()
|
|
|
+ }).catch(()=>{
|
|
|
+ return false
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ },
|
|
|
backToList() {
|
|
|
if(contrastObj(this.form,this.oldForm) || contrastList(this.dataList,this.oldDataList)
|
|
|
){
|
|
@@ -560,7 +578,7 @@
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning",
|
|
|
}).then(() => {
|
|
|
- this.editCustomer(true)
|
|
|
+ this.saveSettlement()
|
|
|
}).catch(()=>{
|
|
|
this.$emit("goBack");
|
|
|
})
|
|
@@ -580,7 +598,11 @@
|
|
|
.trading-form ::v-deep .el-form-item {
|
|
|
margin-bottom: 8px !important;
|
|
|
}
|
|
|
-
|
|
|
+ .required_fields{
|
|
|
+ color: #F56C6C;
|
|
|
+ display:inline-block;
|
|
|
+ width: 7%
|
|
|
+ }
|
|
|
.upper_right_button{
|
|
|
display: flex;
|
|
|
position: fixed;
|