|
@@ -699,6 +699,39 @@
|
|
|
</template>
|
|
</template>
|
|
|
</finstlbillsitems>
|
|
</finstlbillsitems>
|
|
|
</el-tab-pane>
|
|
</el-tab-pane>
|
|
|
|
|
+ <el-tab-pane label="开票明细" name="3">
|
|
|
|
|
+ <div style="margin-bottom: 10px;display: flex;">
|
|
|
|
|
+ <el-button style="margin-left: 10px" :disabled="!form.id" size="small" type="primary" @click="addRow">新增</el-button>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ style="margin-left: 10px"
|
|
|
|
|
+ :disabled="!form.id || invoicingCheckboxData.length == 0"
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ type="success"
|
|
|
|
|
+ @click="invoicingfun"
|
|
|
|
|
+ >生成发票单</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ style="margin-left: 10px"
|
|
|
|
|
+ :disabled="!form.id || invoicingCheckboxData.length == 0"
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ type="danger"
|
|
|
|
|
+ @click="invoicingRevokefun"
|
|
|
|
|
+ >撤销生成发票单</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-button :disabled="!form.id || invoicingCheckboxData.length == 0" size="small" type="danger" @click="invoicingBatchDelete"
|
|
|
|
|
+ >一键删除</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <fininvoiceitemdetail
|
|
|
|
|
+ :form="form"
|
|
|
|
|
+ :tableData="InvoicingList"
|
|
|
|
|
+ :handleSelectionData="invoicingCheckboxData"
|
|
|
|
|
+ @handleSelectionChange="invoicingCheckboxChange"
|
|
|
|
|
+ @deletefun="invoiceDeletionfun"
|
|
|
|
|
+ @savefun="invoiceSavefun"
|
|
|
|
|
+ >
|
|
|
|
|
+ </fininvoiceitemdetail>
|
|
|
|
|
+ </el-tab-pane>
|
|
|
</el-tabs>
|
|
</el-tabs>
|
|
|
</el-card>
|
|
</el-card>
|
|
|
</div>
|
|
</div>
|
|
@@ -755,6 +788,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
|
+import fininvoiceitemdetail from "@/views/iosBasicData/finstlbills/assembly/fininvoiceitemdetail.vue";
|
|
|
import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
|
|
import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
|
|
|
import { getWorkDicts } from "@/api/system/dictbiz";
|
|
import { getWorkDicts } from "@/api/system/dictbiz";
|
|
|
import { getRateList } from "@/api/iosBasicData/rateManagement";
|
|
import { getRateList } from "@/api/iosBasicData/rateManagement";
|
|
@@ -775,7 +809,9 @@ import {
|
|
|
finstlbillsConfirmInvoicing,
|
|
finstlbillsConfirmInvoicing,
|
|
|
finstlbillsRevokeInvoicing,
|
|
finstlbillsRevokeInvoicing,
|
|
|
batchConfirmReconciliation,
|
|
batchConfirmReconciliation,
|
|
|
- batchRevokeReconciliation
|
|
|
|
|
|
|
+ batchRevokeReconciliation,
|
|
|
|
|
+ generateInvoice,
|
|
|
|
|
+ revokeInvoice
|
|
|
} from "@/api/iosBasicData/finstlbills";
|
|
} from "@/api/iosBasicData/finstlbills";
|
|
|
import expand from "@/components/basic-container/expand.vue";
|
|
import expand from "@/components/basic-container/expand.vue";
|
|
|
import queryfinstlbillsitems from "@/views/iosBasicData/finstlbills/assembly/finstlbillsitems.vue";
|
|
import queryfinstlbillsitems from "@/views/iosBasicData/finstlbills/assembly/finstlbillsitems.vue";
|
|
@@ -788,8 +824,20 @@ import { getList as getreportsList, reportsGetReportData } from "@/api/iosBasicD
|
|
|
import dicSelect from "@/components/dicSelect/main";
|
|
import dicSelect from "@/components/dicSelect/main";
|
|
|
import cashierItem from "./assembly/cashierItem.vue";
|
|
import cashierItem from "./assembly/cashierItem.vue";
|
|
|
import { getListAllDetail } from "@/api/iosBasicData/cashier.js";
|
|
import { getListAllDetail } from "@/api/iosBasicData/cashier.js";
|
|
|
|
|
+import { fininvoiceitemdetailRemove, fininvoiceitemdetailSubmit } from "@/api/iosBasicData/fininvoices";
|
|
|
export default {
|
|
export default {
|
|
|
- components: { reportContainer, reportformsList, reports, SearchQuery, expand, finstlbillsitems, dicSelect, queryfinstlbillsitems, cashierItem },
|
|
|
|
|
|
|
+ components: {
|
|
|
|
|
+ reportContainer,
|
|
|
|
|
+ reportformsList,
|
|
|
|
|
+ reports,
|
|
|
|
|
+ SearchQuery,
|
|
|
|
|
+ expand,
|
|
|
|
|
+ finstlbillsitems,
|
|
|
|
|
+ dicSelect,
|
|
|
|
|
+ queryfinstlbillsitems,
|
|
|
|
|
+ cashierItem,
|
|
|
|
|
+ fininvoiceitemdetail
|
|
|
|
|
+ },
|
|
|
props: {
|
|
props: {
|
|
|
// 编辑还是保存
|
|
// 编辑还是保存
|
|
|
editSave: {
|
|
editSave: {
|
|
@@ -803,6 +851,8 @@ export default {
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ InvoicingList: [], // 开票明细数据
|
|
|
|
|
+ invoicingCheckboxData: [],
|
|
|
amountDSubSum: 0,
|
|
amountDSubSum: 0,
|
|
|
amountDSubUsdSum: 0,
|
|
amountDSubUsdSum: 0,
|
|
|
amountCSubSum: 0,
|
|
amountCSubSum: 0,
|
|
@@ -915,6 +965,15 @@ export default {
|
|
|
this.invoiceWorkDictsfun(); // 获取 发票的数据
|
|
this.invoiceWorkDictsfun(); // 获取 发票的数据
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ addRow() {
|
|
|
|
|
+ this.InvoicingList.push({
|
|
|
|
|
+ pid: this.form.id,
|
|
|
|
|
+ number: 1,
|
|
|
|
|
+ price: 0,
|
|
|
|
|
+ amountRate: 0,
|
|
|
|
|
+ edit: true
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
lastPage() {
|
|
lastPage() {
|
|
|
if (this.pageIds.length) {
|
|
if (this.pageIds.length) {
|
|
|
const index = this.pageIds.indexOf(this.form.id);
|
|
const index = this.pageIds.indexOf(this.form.id);
|
|
@@ -1072,6 +1131,165 @@ export default {
|
|
|
this.$set(this.form, name, value);
|
|
this.$set(this.form, name, value);
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ invoicingCheckboxChange(arr) {
|
|
|
|
|
+ this.invoicingCheckboxData = arr;
|
|
|
|
|
+ },
|
|
|
|
|
+ // 开票明细单个删除
|
|
|
|
|
+ invoiceDeletionfun(id, index) {
|
|
|
|
|
+ this.$confirm("确定将选择数据删除?", {
|
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
|
+ type: "warning"
|
|
|
|
|
+ }).then(() => {
|
|
|
|
|
+ if (id) {
|
|
|
|
|
+ fininvoiceitemdetailRemove(id).then(res => {
|
|
|
|
|
+ this.$message.success("操作成功");
|
|
|
|
|
+ this.InvoicingList.splice(index, 1);
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ // 开票明细编辑完成保存
|
|
|
|
|
+ invoiceSavefun(row) {
|
|
|
|
|
+ if (!row.invoiceCompanyId) {
|
|
|
|
|
+ return this.$message.error("开票单位不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!row.curCode) {
|
|
|
|
|
+ return this.$message.error("币别不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!Number(row.exrate)) {
|
|
|
|
|
+ return this.$message.error("汇率不能为空或0");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (Number(row.price ? row.price : 0) <= 0) {
|
|
|
|
|
+ return this.$message.error("单价不能为非正数");
|
|
|
|
|
+ }
|
|
|
|
|
+ fininvoiceitemdetailSubmit(row).then(res => {
|
|
|
|
|
+ this.$message.success("操作成功");
|
|
|
|
|
+ this.finstlbillsDetailfun(this.form.id, "finstlbills");
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ // 开票一键删除
|
|
|
|
|
+ invoicingBatchDelete() {
|
|
|
|
|
+ if (this.invoicingCheckboxData.length == 0) {
|
|
|
|
|
+ return this.$message.warning("请选择要删除的数据");
|
|
|
|
|
+ }
|
|
|
|
|
+ for (let item of this.invoicingCheckboxData) {
|
|
|
|
|
+ if (item.invoiceStatus == 1) {
|
|
|
|
|
+ return this.$message.error("请选择未开开票明细");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$confirm("确定将选择数据删除?", {
|
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
|
+ type: "warning"
|
|
|
|
|
+ }).then(() => {
|
|
|
|
|
+ // 获取有id 的数据
|
|
|
|
|
+ const itemsWithId = this.invoicingCheckboxData.filter(item => item.hasOwnProperty("id"));
|
|
|
|
|
+ let arrIds = itemsWithId.map(item => item.id); // 获取id 数据
|
|
|
|
|
+ // 把选中的删除掉
|
|
|
|
|
+ this.invoicingCheckboxData.forEach(item => {
|
|
|
|
|
+ for (let index in this.InvoicingList) {
|
|
|
|
|
+ if (item.id == this.InvoicingList[index].id) {
|
|
|
|
|
+ this.InvoicingList.splice(Number(index), 1);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ // 有id 的处理
|
|
|
|
|
+ if (itemsWithId.length != 0) {
|
|
|
|
|
+ fininvoiceitemdetailRemove(arrIds.join(",")).then(res => {
|
|
|
|
|
+ this.$message.success("操作成功");
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ // 确认开票信息
|
|
|
|
|
+ invoicingfun() {
|
|
|
|
|
+ if (this.invoicingCheckboxData.length == 0) {
|
|
|
|
|
+ this.$message.error("请选择数据");
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ for (let item of this.invoicingCheckboxData) {
|
|
|
|
|
+ if (!item.id) {
|
|
|
|
|
+ return this.$message.error("请保存开票明细");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (item.invoiceStatus == 1) {
|
|
|
|
|
+ return this.$message.error("请选择未开开票明细");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ this.form.billNoFormat = "HYDZ";
|
|
|
|
|
+ this.form.businessTypeCode = "HYDZ";
|
|
|
|
|
+ this.form.businessType = "CHK"; // 对账单
|
|
|
|
|
+ this.form.accountDateFrom = this.form.accountDateFrom ? this.form.accountDateFrom.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
|
|
|
|
|
+ this.form.accountDateTo = this.form.accountDateTo ? this.form.accountDateTo.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
|
|
|
|
|
+ this.form.auditDateFrom = this.form.auditDateFrom ? this.form.auditDateFrom.slice(0, 10) + " 00:00:00" : null;
|
|
|
|
|
+ this.form.auditDateTo = this.form.auditDateTo ? this.form.auditDateTo.slice(0, 10) + " 00:00:00" : null;
|
|
|
|
|
+ this.form.businessDateEnd = this.form.businessDateEnd ? this.form.businessDateEnd.slice(0, 10) + " 00:00:00" : null;
|
|
|
|
|
+ this.form.businessDateStart = this.form.businessDateStart ? this.form.businessDateStart.slice(0, 10) + " 00:00:00" : null;
|
|
|
|
|
+ this.form.billDate = this.form.billDate ? this.form.billDate.slice(0, 10) + " 00:00:00" : null;
|
|
|
|
|
+ // 保留id
|
|
|
|
|
+ this.form.finStlBillsItemsList = this.tableData;
|
|
|
|
|
+ let obj = {
|
|
|
|
|
+ ...this.form,
|
|
|
|
|
+ finInvoiceItemDetailList: this.invoicingCheckboxData
|
|
|
|
|
+ };
|
|
|
|
|
+ this.$confirm("是否生成发票单?", "提示", {
|
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
|
+ type: "warning"
|
|
|
|
|
+ }).then(() => {
|
|
|
|
|
+ // 开票项目
|
|
|
|
|
+ generateInvoice(obj).then(res => {
|
|
|
|
|
+ this.$message.warning("操作成功");
|
|
|
|
|
+ this.finstlbillsDetailfun(this.form.id, "finstlbills");
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ // 撤销开票信息
|
|
|
|
|
+ invoicingRevokefun() {
|
|
|
|
|
+ if (this.invoicingCheckboxData.length == 0) {
|
|
|
|
|
+ this.$message.warning("请选择数据");
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.invoicingCheckboxData.length == 0) {
|
|
|
|
|
+ this.$message.error("请选择数据");
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ for (let item of this.invoicingCheckboxData) {
|
|
|
|
|
+ if (!item.id) {
|
|
|
|
|
+ return this.$message.error("请保存开票明细");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (item.invoiceStatus == 0) {
|
|
|
|
|
+ return this.$message.error("请选择已开开票明细");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ this.form.billNoFormat = "HYDZ";
|
|
|
|
|
+ this.form.businessTypeCode = "HYDZ";
|
|
|
|
|
+ this.form.businessType = "CHK"; // 对账单
|
|
|
|
|
+ this.form.accountDateFrom = this.form.accountDateFrom ? this.form.accountDateFrom.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
|
|
|
|
|
+ this.form.accountDateTo = this.form.accountDateTo ? this.form.accountDateTo.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
|
|
|
|
|
+ this.form.auditDateFrom = this.form.auditDateFrom ? this.form.auditDateFrom.slice(0, 10) + " 00:00:00" : null;
|
|
|
|
|
+ this.form.auditDateTo = this.form.auditDateTo ? this.form.auditDateTo.slice(0, 10) + " 00:00:00" : null;
|
|
|
|
|
+ this.form.businessDateEnd = this.form.businessDateEnd ? this.form.businessDateEnd.slice(0, 10) + " 00:00:00" : null;
|
|
|
|
|
+ this.form.businessDateStart = this.form.businessDateStart ? this.form.businessDateStart.slice(0, 10) + " 00:00:00" : null;
|
|
|
|
|
+ this.form.billDate = this.form.billDate ? this.form.billDate.slice(0, 10) + " 00:00:00" : null;
|
|
|
|
|
+ // 保留id
|
|
|
|
|
+ this.form.finStlBillsItemsList = this.tableData;
|
|
|
|
|
+ let obj = {
|
|
|
|
|
+ ...this.form,
|
|
|
|
|
+ finInvoiceItemDetailList: this.invoicingCheckboxData
|
|
|
|
|
+ };
|
|
|
|
|
+ this.$confirm("是否撤销生成发票单?", "提示", {
|
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
|
+ type: "warning"
|
|
|
|
|
+ }).then(() => {
|
|
|
|
|
+ // 撤销开票项目
|
|
|
|
|
+ revokeInvoice(this.form).then(res => {
|
|
|
|
|
+ this.$message.warning("操作成功");
|
|
|
|
|
+ this.finstlbillsDetailfun(this.form.id, "finstlbills");
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
// 编辑
|
|
// 编辑
|
|
|
editHandle() {
|
|
editHandle() {
|
|
|
if (this.form.status != 3) {
|
|
if (this.form.status != 3) {
|
|
@@ -1131,6 +1349,21 @@ export default {
|
|
|
}
|
|
}
|
|
|
return item;
|
|
return item;
|
|
|
});
|
|
});
|
|
|
|
|
+ for (let row of this.InvoicingList) {
|
|
|
|
|
+ if (!row.invoiceCompanyId) {
|
|
|
|
|
+ return this.$message.error("开票单位不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!row.curCode) {
|
|
|
|
|
+ return this.$message.error("币别不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!Number(row.exrate)) {
|
|
|
|
|
+ return this.$message.error("汇率不能为空或0");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (Number(row.price ? row.price : 0) <= 0) {
|
|
|
|
|
+ return this.$message.error("单价不能为非正数");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ this.form.finInvoiceItemDetailList = this.InvoicingList;
|
|
|
this.saveLoading = true; // 加载动画
|
|
this.saveLoading = true; // 加载动画
|
|
|
this.pageLoading = true;
|
|
this.pageLoading = true;
|
|
|
// 判断是单独点击保存还是点击确认对账
|
|
// 判断是单独点击保存还是点击确认对账
|
|
@@ -1251,7 +1484,11 @@ export default {
|
|
|
},
|
|
},
|
|
|
// 详情接口
|
|
// 详情接口
|
|
|
finstlbillsDetailfun(id, type) {
|
|
finstlbillsDetailfun(id, type) {
|
|
|
- this.activeName = "2";
|
|
|
|
|
|
|
+ if (type == "finstlbills") {
|
|
|
|
|
+ this.activeName = "3";
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.activeName = "2";
|
|
|
|
|
+ }
|
|
|
this.pageLoading = true;
|
|
this.pageLoading = true;
|
|
|
finstlbillsDetail(id)
|
|
finstlbillsDetail(id)
|
|
|
.then(res => {
|
|
.then(res => {
|
|
@@ -1293,6 +1530,10 @@ export default {
|
|
|
this.$set(item, "costDate", []);
|
|
this.$set(item, "costDate", []);
|
|
|
return item;
|
|
return item;
|
|
|
});
|
|
});
|
|
|
|
|
+ this.InvoicingList = this.form.finInvoiceItemDetailList.map(item => {
|
|
|
|
|
+ item.edit = false;
|
|
|
|
|
+ return item;
|
|
|
|
|
+ });
|
|
|
this.form.isSignfor = this.form.isSignfor + "";
|
|
this.form.isSignfor = this.form.isSignfor + "";
|
|
|
this.form.isApproved = this.form.isApproved + "";
|
|
this.form.isApproved = this.form.isApproved + "";
|
|
|
this.form.isCleared = this.form.isCleared + "";
|
|
this.form.isCleared = this.form.isCleared + "";
|
|
@@ -1328,7 +1569,7 @@ export default {
|
|
|
this.$set(this.form, "corpEnName", row.enName);
|
|
this.$set(this.form, "corpEnName", row.enName);
|
|
|
this.$set(this.form, "corpArgreementNo", row.enName);
|
|
this.$set(this.form, "corpArgreementNo", row.enName);
|
|
|
this.retrievePopupsType = false;
|
|
this.retrievePopupsType = false;
|
|
|
- this.finstlbillslistAccBillV1fun('检索');
|
|
|
|
|
|
|
+ this.finstlbillslistAccBillV1fun("检索");
|
|
|
},
|
|
},
|
|
|
// 检索
|
|
// 检索
|
|
|
retrievalfun() {
|
|
retrievalfun() {
|
|
@@ -1342,7 +1583,7 @@ export default {
|
|
|
return this.$message.warning("请填写对账单位");
|
|
return this.$message.warning("请填写对账单位");
|
|
|
}
|
|
}
|
|
|
console.log("原来的接口");
|
|
console.log("原来的接口");
|
|
|
- this.finstlbillslistAccBillV1fun('检索');
|
|
|
|
|
|
|
+ this.finstlbillslistAccBillV1fun("检索");
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
// 检索出的弹窗
|
|
// 检索出的弹窗
|
|
@@ -1455,7 +1696,7 @@ export default {
|
|
|
this.queryData.push(item);
|
|
this.queryData.push(item);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if (this.queryData.length == 0&&type=='检索') {
|
|
|
|
|
|
|
+ if (this.queryData.length == 0 && type == "检索") {
|
|
|
this.$message.warning("当前检索暂无数据!");
|
|
this.$message.warning("当前检索暂无数据!");
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|