|
@@ -62,6 +62,26 @@
|
|
></el-input>
|
|
></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
|
|
+ <el-col :span="8">
|
|
|
|
+ <el-form-item label="排序方式" prop="orderBy">
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="queryParams.orderBy"
|
|
|
|
+ value-key=""
|
|
|
|
+ placeholder="请选择排序方式"
|
|
|
|
+ clearable
|
|
|
|
+ filterable
|
|
|
|
+ @change="handleQuery"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in orderByOptions"
|
|
|
|
+ :key="item.value"
|
|
|
|
+ :label="item.label"
|
|
|
|
+ :value="item.value"
|
|
|
|
+ >
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
<el-col :span="8">
|
|
<el-col :span="8">
|
|
<el-form-item label="账务类型" prop="accountingType">
|
|
<el-form-item label="账务类型" prop="accountingType">
|
|
<el-select
|
|
<el-select
|
|
@@ -368,6 +388,7 @@
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column
|
|
<el-table-column
|
|
|
|
+ fixed="right"
|
|
label="操作"
|
|
label="操作"
|
|
align="center"
|
|
align="center"
|
|
class-name="small-padding fixed-width"
|
|
class-name="small-padding fixed-width"
|
|
@@ -388,19 +409,25 @@
|
|
> -->
|
|
> -->
|
|
|
|
|
|
<!-- v-show="scope.row.accountingType == 3" -->
|
|
<!-- v-show="scope.row.accountingType == 3" -->
|
|
- <el-dropdown-item v-show="scope.row.accountingType == 3"
|
|
|
|
|
|
+ <el-dropdown-item
|
|
|
|
+ v-show="
|
|
|
|
+ scope.row.accountingType == 3 || scope.row.accountingType == 4
|
|
|
|
+ "
|
|
><el-button
|
|
><el-button
|
|
size="mini"
|
|
size="mini"
|
|
type="text"
|
|
type="text"
|
|
- @click="handlerReturn(scope.row)"
|
|
|
|
- >驳 回</el-button
|
|
|
|
|
|
+ @click="handlerReturn(scope.row, scope.$index)"
|
|
|
|
+ >撤销登账</el-button
|
|
></el-dropdown-item
|
|
></el-dropdown-item
|
|
>
|
|
>
|
|
- <el-dropdown-item v-show="scope.row.accountingType != 3"
|
|
|
|
|
|
+ <el-dropdown-item
|
|
|
|
+ v-show="
|
|
|
|
+ scope.row.accountingType != 3 && scope.row.accountingType != 4
|
|
|
|
+ "
|
|
><el-button
|
|
><el-button
|
|
size="mini"
|
|
size="mini"
|
|
type="text"
|
|
type="text"
|
|
- @click="handlerCancel(scope.row)"
|
|
|
|
|
|
+ @click="handlerReturn(scope.row, scope.$index)"
|
|
>撤销登账</el-button
|
|
>撤销登账</el-button
|
|
></el-dropdown-item
|
|
></el-dropdown-item
|
|
>
|
|
>
|
|
@@ -919,6 +946,7 @@ export default {
|
|
open: false,
|
|
open: false,
|
|
// 查询参数
|
|
// 查询参数
|
|
queryParams: {
|
|
queryParams: {
|
|
|
|
+ orderBy: "asc",
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
accountingType: null,
|
|
accountingType: null,
|
|
@@ -953,6 +981,17 @@ export default {
|
|
startTime: null,
|
|
startTime: null,
|
|
endTime: null,
|
|
endTime: null,
|
|
},
|
|
},
|
|
|
|
+ // 排序选项
|
|
|
|
+ orderByOptions: [
|
|
|
|
+ {
|
|
|
|
+ label: "升序",
|
|
|
|
+ value: "asc",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: "降序",
|
|
|
|
+ value: "desc",
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
// 表单参数
|
|
// 表单参数
|
|
form: {},
|
|
form: {},
|
|
// 表单校验
|
|
// 表单校验
|
|
@@ -1010,8 +1049,8 @@ export default {
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
// 撤销登账
|
|
// 撤销登账
|
|
- handlerCancel(row) {
|
|
|
|
- this.$confirm("是否确认驳回?", "提示", {
|
|
|
|
|
|
+ handlerCancel(row, index) {
|
|
|
|
+ this.$confirm("是否确认撤销登账?", "提示", {
|
|
confirmButtonText: "确定",
|
|
confirmButtonText: "确定",
|
|
cancelButtonText: "取消",
|
|
cancelButtonText: "取消",
|
|
type: "warning",
|
|
type: "warning",
|
|
@@ -1026,7 +1065,8 @@ export default {
|
|
// receivedAmount: row.receivedAmount,
|
|
// receivedAmount: row.receivedAmount,
|
|
...row,
|
|
...row,
|
|
};
|
|
};
|
|
- let res = await cancelAccountEntry(payload);
|
|
|
|
|
|
+ // let res = await cancelAccountEntry(payload);
|
|
|
|
+ let res = await rejectHandler(payload);
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
this.$message.success("撤销成功!");
|
|
this.$message.success("撤销成功!");
|
|
this.getList();
|
|
this.getList();
|
|
@@ -1063,8 +1103,8 @@ export default {
|
|
console.log(this.exportColumnsOptions);
|
|
console.log(this.exportColumnsOptions);
|
|
e.stopPropagation();
|
|
e.stopPropagation();
|
|
},
|
|
},
|
|
- // 驳回回调
|
|
|
|
- handlerReturn(row) {
|
|
|
|
|
|
+ // 驳回回调 现在的 撤销登账
|
|
|
|
+ async handlerReturn(row, index) {
|
|
this.$confirm("是否确认驳回?", "提示", {
|
|
this.$confirm("是否确认驳回?", "提示", {
|
|
confirmButtonText: "确定",
|
|
confirmButtonText: "确定",
|
|
cancelButtonText: "取消",
|
|
cancelButtonText: "取消",
|
|
@@ -1082,8 +1122,23 @@ export default {
|
|
};
|
|
};
|
|
let res = await rejectHandler(payload);
|
|
let res = await rejectHandler(payload);
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
- this.$message.success("驳回成功!");
|
|
|
|
- this.getList();
|
|
|
|
|
|
+ this.$message.success("撤销登账成功!");
|
|
|
|
+ if (row.accountingType == 2 || row.accountingType == 4) {
|
|
|
|
+ //2:收款 4:贴息
|
|
|
|
+ let theOtherOne = await this.getThenOtherOne(row, index);
|
|
|
|
+ console.log("theOtherOne", theOtherOne);
|
|
|
|
+ if (theOtherOne) {
|
|
|
|
+ let result = await rejectHandler(theOtherOne);
|
|
|
|
+ if (result.code == 200) {
|
|
|
|
+ this.getList();
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error(res.msg);
|
|
|
|
+ this.getList();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ this.getList();
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
throw new Error(res.msg);
|
|
throw new Error(res.msg);
|
|
}
|
|
}
|
|
@@ -1098,6 +1153,80 @@ export default {
|
|
});
|
|
});
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ // 获取 收款 || 贴息
|
|
|
|
+ async getThenOtherOne(row, index) {
|
|
|
|
+ let { accountingType, customName, accountsReceivableDate } = row;
|
|
|
|
+ if (accountingType == 4) {
|
|
|
|
+ //贴息
|
|
|
|
+ if (index == this.SaleAccountsReceivableDetailList.length - 1) {
|
|
|
|
+ //贴息 且为最后一个,获取下一页第一个数据 收款
|
|
|
|
+ let payload = { ...this.queryParams };
|
|
|
|
+ payload.pageNum = this.queryParams.pageNum + 1;
|
|
|
|
+ let res = await listSaleAccountsReceivableDetail(payload);
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ if (res.rows.length && res.rows[0]) {
|
|
|
|
+ let targetRow = res.rows[0];
|
|
|
|
+ if (
|
|
|
|
+ targetRow.accountingType == 2 &&
|
|
|
|
+ targetRow.customName == customName &&
|
|
|
|
+ targetRow.accountsReceivableDate == accountsReceivableDate
|
|
|
|
+ ) {
|
|
|
|
+ return targetRow;
|
|
|
|
+ } else {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
|
|
+ } else {
|
|
|
|
+ let targetRow = this.SaleAccountsReceivableDetailList[index + 1];
|
|
|
|
+ if (
|
|
|
|
+ targetRow.accountingType == 2 &&
|
|
|
|
+ targetRow.customName == customName &&
|
|
|
|
+ targetRow.accountsReceivableDate == accountsReceivableDate
|
|
|
|
+ ) {
|
|
|
|
+ return targetRow;
|
|
|
|
+ } else {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } else if (accountingType == 2) {
|
|
|
|
+ // 收款
|
|
|
|
+ if (index == 0 && this.queryParams.pageNum != 1) {
|
|
|
|
+ //收款 且为第一个,获取上一页最后一个数据 贴息
|
|
|
|
+ let payload = { ...this.queryParams };
|
|
|
|
+ payload.pageNum = this.queryParams.pageNum - 1;
|
|
|
|
+ let res = await listSaleAccountsReceivableDetail(payload);
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ if (res.rows.length && res.rows[res.rows.length - 1]) {
|
|
|
|
+ let targetRow = res.rows[res.rows.length - 1];
|
|
|
|
+ if (
|
|
|
|
+ targetRow.accountingType == 4 &&
|
|
|
|
+ targetRow.customName == customName &&
|
|
|
|
+ targetRow.accountsReceivableDate == accountsReceivableDate
|
|
|
|
+ ) {
|
|
|
|
+ return targetRow;
|
|
|
|
+ } else {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
|
|
+ } else {
|
|
|
|
+ let targetRow = this.SaleAccountsReceivableDetailList[index - 1];
|
|
|
|
+ if (
|
|
|
|
+ targetRow.accountingType == 4 &&
|
|
|
|
+ targetRow.customName == customName &&
|
|
|
|
+ targetRow.accountsReceivableDate == accountsReceivableDate
|
|
|
|
+ ) {
|
|
|
|
+ return targetRow;
|
|
|
|
+ } else {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
// 确认开票
|
|
// 确认开票
|
|
submitBillingForm() {
|
|
submitBillingForm() {
|
|
this.$refs["billingForm"].validate((valid) => {
|
|
this.$refs["billingForm"].validate((valid) => {
|