|
|
@@ -83,7 +83,7 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="开票单位" prop="invCorpCnName">
|
|
|
+ <el-form-item label="发票抬头" prop="invCorpCnName">
|
|
|
<search-query
|
|
|
:datalist="invCorpData"
|
|
|
:selectValue="form.invCorpCnName"
|
|
|
@@ -92,7 +92,7 @@
|
|
|
:buttonIf="false"
|
|
|
:remote="true"
|
|
|
:filterable="true"
|
|
|
- placeholder="请选择开票单位"
|
|
|
+ placeholder="请选择发票抬头"
|
|
|
:forParameter="{
|
|
|
key: 'id',
|
|
|
label: 'invoiceHeader',
|
|
|
@@ -212,7 +212,7 @@
|
|
|
v-model="form.vesselVoyno"
|
|
|
size="small"
|
|
|
autocomplete="off"
|
|
|
- :disabled="editSave||form.srcType == '对账'"
|
|
|
+ :disabled="editSave || form.srcType == '对账'"
|
|
|
clearable
|
|
|
placeholder="请输入船名/航次"
|
|
|
>
|
|
|
@@ -227,7 +227,7 @@
|
|
|
style="width: 100%;"
|
|
|
type="date"
|
|
|
size="small"
|
|
|
- :disabled="editSave||form.srcType == '对账'"
|
|
|
+ :disabled="editSave || form.srcType == '对账'"
|
|
|
value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
placeholder="请输入开航日期"
|
|
|
>
|
|
|
@@ -242,7 +242,7 @@
|
|
|
:filterable="true"
|
|
|
:clearable="true"
|
|
|
:remote="true"
|
|
|
- :disabled="editSave||form.srcType == '对账'"
|
|
|
+ :disabled="editSave || form.srcType == '对账'"
|
|
|
:buttonIf="false"
|
|
|
placeholder="请选择装货港"
|
|
|
:forParameter="{
|
|
|
@@ -265,7 +265,7 @@
|
|
|
:filterable="true"
|
|
|
:clearable="true"
|
|
|
:remote="true"
|
|
|
- :disabled="editSave||form.srcType == '对账'"
|
|
|
+ :disabled="editSave || form.srcType == '对账'"
|
|
|
:buttonIf="false"
|
|
|
placeholder="请选择卸货港"
|
|
|
:forParameter="{
|
|
|
@@ -288,7 +288,7 @@
|
|
|
:filterable="true"
|
|
|
:clearable="true"
|
|
|
:remote="true"
|
|
|
- :disabled="editSave||form.srcType == '对账'"
|
|
|
+ :disabled="editSave || form.srcType == '对账'"
|
|
|
:buttonIf="false"
|
|
|
placeholder="请选择目的地"
|
|
|
:forParameter="{
|
|
|
@@ -310,7 +310,7 @@
|
|
|
v-model="form.containers"
|
|
|
size="small"
|
|
|
autocomplete="off"
|
|
|
- :disabled="editSave||form.srcType == '对账'"
|
|
|
+ :disabled="editSave || form.srcType == '对账'"
|
|
|
clearable
|
|
|
placeholder="请输入箱型箱量"
|
|
|
>
|
|
|
@@ -373,7 +373,7 @@
|
|
|
:datalist="corpData"
|
|
|
:selectValue="form.corpCnName"
|
|
|
:clearable="true"
|
|
|
- :disabled="editSave||form.srcType == '对账'"
|
|
|
+ :disabled="editSave || form.srcType == '对账'"
|
|
|
:buttonIf="false"
|
|
|
:remote="true"
|
|
|
:filterable="true"
|
|
|
@@ -439,7 +439,7 @@
|
|
|
style="width: 100%;"
|
|
|
type="date"
|
|
|
size="small"
|
|
|
- :disabled="editSave||form.srcType == '对账'"
|
|
|
+ :disabled="editSave || form.srcType == '对账'"
|
|
|
value-format="yyyy-MM-dd"
|
|
|
placeholder="选择业务日期"
|
|
|
>
|
|
|
@@ -454,7 +454,7 @@
|
|
|
style="width: 100%;"
|
|
|
type="date"
|
|
|
size="small"
|
|
|
- :disabled="editSave||form.srcType == '对账'"
|
|
|
+ :disabled="editSave || form.srcType == '对账'"
|
|
|
value-format="yyyy-MM-dd"
|
|
|
placeholder="选择业务日期"
|
|
|
>
|
|
|
@@ -464,7 +464,7 @@
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="发票汇率" prop="exrate">
|
|
|
<span slot="label">
|
|
|
- <span style="color: #1e9fff" @click="allCLick('发票汇率')">发票汇率</span>
|
|
|
+ <span style="color: #1e9fff" @click="allClick('发票汇率')">发票汇率</span>
|
|
|
</span>
|
|
|
<el-input
|
|
|
style="width: 100%;"
|
|
|
@@ -485,7 +485,7 @@
|
|
|
v-model="form.businessNo"
|
|
|
size="small"
|
|
|
autocomplete="off"
|
|
|
- :disabled="editSave||form.srcType == '对账'"
|
|
|
+ :disabled="editSave || form.srcType == '对账'"
|
|
|
clearable
|
|
|
placeholder="请输入业务编号"
|
|
|
>
|
|
|
@@ -521,7 +521,7 @@
|
|
|
v-model="form.mblno"
|
|
|
size="small"
|
|
|
autocomplete="off"
|
|
|
- :disabled="editSave||form.srcType == '对账'"
|
|
|
+ :disabled="editSave || form.srcType == '对账'"
|
|
|
clearable
|
|
|
placeholder="请输入主单编号"
|
|
|
>
|
|
|
@@ -535,7 +535,7 @@
|
|
|
v-model="form.checkNo"
|
|
|
size="small"
|
|
|
autocomplete="off"
|
|
|
- :disabled="editSave||form.srcType == '对账'"
|
|
|
+ :disabled="editSave || form.srcType == '对账'"
|
|
|
clearable
|
|
|
placeholder="请输入对账单号"
|
|
|
>
|
|
|
@@ -549,7 +549,7 @@
|
|
|
v-model="form.hblno"
|
|
|
size="small"
|
|
|
autocomplete="off"
|
|
|
- :disabled="editSave||form.srcType == '对账'"
|
|
|
+ :disabled="editSave || form.srcType == '对账'"
|
|
|
clearable
|
|
|
placeholder="请输入分单编号"
|
|
|
>
|
|
|
@@ -563,7 +563,7 @@
|
|
|
v-model="form.applyNo"
|
|
|
size="small"
|
|
|
autocomplete="off"
|
|
|
- :disabled="editSave||form.srcType == '对账'"
|
|
|
+ :disabled="editSave || form.srcType == '对账'"
|
|
|
clearable
|
|
|
placeholder="请输入申请单号"
|
|
|
>
|
|
|
@@ -577,7 +577,7 @@
|
|
|
v-model="form.bookingNo"
|
|
|
size="small"
|
|
|
autocomplete="off"
|
|
|
- :disabled="editSave||form.srcType == '对账'"
|
|
|
+ :disabled="editSave || form.srcType == '对账'"
|
|
|
clearable
|
|
|
placeholder="请输入BOOK NO"
|
|
|
>
|
|
|
@@ -597,7 +597,7 @@
|
|
|
:filterable="true"
|
|
|
:multiple="true"
|
|
|
:collapseTags="true"
|
|
|
- :disabled="editSave||form.srcType == '对账'"
|
|
|
+ :disabled="editSave || form.srcType == '对账'"
|
|
|
dataType="string"
|
|
|
></dic-select>
|
|
|
</el-form-item>
|
|
|
@@ -623,7 +623,7 @@
|
|
|
:selectValue="form.curCode"
|
|
|
:filterable="true"
|
|
|
:clearable="true"
|
|
|
- :disabled="editSave||form.srcType == '对账'"
|
|
|
+ :disabled="editSave || form.srcType == '对账'"
|
|
|
:remote="true"
|
|
|
:buttonIf="false"
|
|
|
placeholder="请输入选择币种"
|
|
|
@@ -650,7 +650,7 @@
|
|
|
:filterable="true"
|
|
|
:multiple="true"
|
|
|
:collapseTags="true"
|
|
|
- :disabled="editSave||form.srcType == '对账'"
|
|
|
+ :disabled="editSave || form.srcType == '对账'"
|
|
|
dataType="string"
|
|
|
></dic-select>
|
|
|
</el-form-item>
|
|
|
@@ -737,7 +737,7 @@
|
|
|
<el-button style="margin-left: 10px" :disabled="editSave" size="small" type="warning" @click="invoicingRevokefun"
|
|
|
>撤销开票明细</el-button
|
|
|
>
|
|
|
- <el-button size="small" :disabled="editSave||form.srcType == '对账'" type="danger" @click="batchDeletefun">一键删除</el-button>
|
|
|
+ <el-button size="small" :disabled="editSave || form.srcType == '对账'" type="danger" @click="batchDeletefun">一键删除</el-button>
|
|
|
<span style="font-size: 18px;font-weight: 600;">
|
|
|
<span style="color: #67C23A;margin-right: 10px;"> CNY:¥{{ amountSubSum }}元 </span>
|
|
|
<span style="color: #E6A23C;"> USD:${{ amountSubUsdSum }}元 </span>
|
|
|
@@ -748,20 +748,33 @@
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="开票明细" name="3">
|
|
|
<div style="margin-bottom: 10px;display: flex;">
|
|
|
- <el-button size="small" :disabled="editSave || form.srcType == '对账'" type="danger" @click="invoicingBatchDelete"
|
|
|
- >一键删除</el-button
|
|
|
+ <el-button size="small" type="primary" :disabled="editSave || !form.id" @click="allClick('新增')">新增</el-button>
|
|
|
+ <el-button size="small" :disabled="editSave || !form.id" type="danger" @click="invoicingBatchDelete">一键删除</el-button>
|
|
|
+ <el-button
|
|
|
+ type="success"
|
|
|
+ size="small"
|
|
|
+ :disabled="editSave || invoicingCheckboxData.length == 0 || !form.id"
|
|
|
+ @click="allClick('确认开票')"
|
|
|
+ >确认开票</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="danger"
|
|
|
+ size="small"
|
|
|
+ :disabled="editSave || invoicingCheckboxData.length == 0 || !form.id"
|
|
|
+ @click="allClick('撤销开票')"
|
|
|
+ >撤销开票</el-button
|
|
|
>
|
|
|
- <span style="font-size: 18px;font-weight: 600;margin-left: 100px;">
|
|
|
+ <span style="font-size: 18px;font-weight: 600;margin-left: 20px;">
|
|
|
<span style="color: #67C23A;"> CNY:¥{{ amountSubSum }}元 </span>
|
|
|
</span>
|
|
|
</div>
|
|
|
<fininvoiceitemdetail
|
|
|
+ :form="form"
|
|
|
:tableData="InvoicingList"
|
|
|
:handleSelectionData="invoicingCheckboxData"
|
|
|
@handleSelectionChange="invoicingCheckboxChange"
|
|
|
@deletefun="invoiceDeletionfun"
|
|
|
@savefun="invoiceSavefun"
|
|
|
- :disabled="form.srcType == '对账'"
|
|
|
>
|
|
|
</fininvoiceitemdetail>
|
|
|
</el-tab-pane>
|
|
|
@@ -851,7 +864,9 @@ import {
|
|
|
fininvoicesConfirmFinInvoices,
|
|
|
fininvoicesRevokeFinInvoices,
|
|
|
getParamService,
|
|
|
- updateParamService
|
|
|
+ updateParamService,
|
|
|
+ confirmInvoiceIssuance,
|
|
|
+ revokeInvoiceIssuance
|
|
|
} from "@/api/iosBasicData/fininvoices";
|
|
|
import { generateFinInvoices } from "@/api/iosBasicData/finstlbills";
|
|
|
import { getWorkDicts } from "@/api/system/dictbiz";
|
|
|
@@ -948,7 +963,7 @@ export default {
|
|
|
handleSelectionData: [], // 费用明细选择的数据
|
|
|
invoicingCheckboxData: [], // 开票明细选择的数据
|
|
|
corpData: [], // 结算单位数据
|
|
|
- invCorpData: [], // 开票单位
|
|
|
+ invCorpData: [], // 发票抬头
|
|
|
bankReceiptData: [], // 结算单位银行账号数据
|
|
|
// 业务类型
|
|
|
businessTypesData: [
|
|
|
@@ -1068,7 +1083,17 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- allCLick(name) {
|
|
|
+ allClick(name) {
|
|
|
+ if (name == "新增") {
|
|
|
+ this.InvoicingList.push({
|
|
|
+ pid: this.form.id,
|
|
|
+ number: 1,
|
|
|
+ price: 0,
|
|
|
+ amountRate: 0,
|
|
|
+ amountTax: 0,
|
|
|
+ edit: true
|
|
|
+ });
|
|
|
+ }
|
|
|
if (name == "发票汇率") {
|
|
|
this.$confirm("是否确认修改业务参数配置?", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
@@ -1082,11 +1107,107 @@ export default {
|
|
|
updateParamService(obj);
|
|
|
});
|
|
|
}
|
|
|
- },
|
|
|
- allClick(name) {
|
|
|
if (name == "指示") {
|
|
|
this.$refs.cashier.openDialog(this.form, this.tableData, "auto");
|
|
|
}
|
|
|
+ if (name == "确认开票") {
|
|
|
+ if (this.invoicingCheckboxData.length == 0) {
|
|
|
+ return this.$message.error("请选择开票明细");
|
|
|
+ }
|
|
|
+ for (let item of this.invoicingCheckboxData) {
|
|
|
+ if (!item.id) {
|
|
|
+ return this.$message.error("请保存开票明细");
|
|
|
+ }
|
|
|
+ if (!item.curCode) {
|
|
|
+ return this.$message.error("币别不能为空");
|
|
|
+ }
|
|
|
+ if (!Number(item.exrate)) {
|
|
|
+ return this.$message.error("汇率不能为空或0");
|
|
|
+ }
|
|
|
+ if (Number(item.price ? item.price : 0) <= 0) {
|
|
|
+ return this.$message.error("单价不能为非正数");
|
|
|
+ }
|
|
|
+ if (item.status == 1) {
|
|
|
+ return this.$message.error("请选择未开发票明细");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let obj = {
|
|
|
+ ...this.form,
|
|
|
+ type: "销项",
|
|
|
+ billNoFormat: "XXFP",
|
|
|
+ businessTypeCode: "XXFP",
|
|
|
+ finInvoiceItemDetailList: this.invoicingCheckboxData
|
|
|
+ };
|
|
|
+ this.$confirm("是否确认开票?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: "加载中",
|
|
|
+ spinner: "el-icon-loading",
|
|
|
+ background: "rgba(255,255,255,0.7)"
|
|
|
+ });
|
|
|
+ confirmInvoiceIssuance(obj)
|
|
|
+ .then(res => {
|
|
|
+ this.$message.success("操作成功");
|
|
|
+ this.fininvoicesDetailfun(this.form.id, "finstlbills");
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ loading.close();
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (name == "撤销开票") {
|
|
|
+ if (this.invoicingCheckboxData.length == 0) {
|
|
|
+ return this.$message.error("请选择开票明细");
|
|
|
+ }
|
|
|
+ for (let item of this.invoicingCheckboxData) {
|
|
|
+ if (!item.id) {
|
|
|
+ return this.$message.error("请保存开票明细");
|
|
|
+ }
|
|
|
+ if (!item.curCode) {
|
|
|
+ return this.$message.error("币别不能为空");
|
|
|
+ }
|
|
|
+ if (!Number(item.exrate)) {
|
|
|
+ return this.$message.error("汇率不能为空或0");
|
|
|
+ }
|
|
|
+ if (Number(item.price ? item.price : 0) <= 0) {
|
|
|
+ return this.$message.error("单价不能为非正数");
|
|
|
+ }
|
|
|
+ if (item.status == 0) {
|
|
|
+ return this.$message.error("请选择已开发票明细");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let obj = {
|
|
|
+ ...this.form,
|
|
|
+ type: "销项",
|
|
|
+ billNoFormat: "XXFP",
|
|
|
+ businessTypeCode: "XXFP",
|
|
|
+ finInvoiceItemDetailList: this.invoicingCheckboxData
|
|
|
+ };
|
|
|
+ this.$confirm("是否撤销开票?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: "加载中",
|
|
|
+ spinner: "el-icon-loading",
|
|
|
+ background: "rgba(255,255,255,0.7)"
|
|
|
+ });
|
|
|
+ revokeInvoiceIssuance(obj)
|
|
|
+ .then(res => {
|
|
|
+ this.$message.success("操作成功");
|
|
|
+ this.fininvoicesDetailfun(this.form.id, "finstlbills");
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ loading.close();
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
updateCashier() {
|
|
|
this.fininvoicesDetailfun(this.form.id, "updateCashier");
|
|
|
@@ -1165,9 +1286,15 @@ export default {
|
|
|
},
|
|
|
// 开票明细编辑完成保存
|
|
|
invoiceSavefun(row) {
|
|
|
- row.amountRate = this.form.taxRate;
|
|
|
- // 销售额/(1+税率)×税率
|
|
|
- row.amountTax = ((row.amount / (1 + Number(row.amountRate) / 100)) * (Number(row.amountRate) / 100)).toFixed(2);
|
|
|
+ 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.fininvoicesDetailfun(this.form.id);
|
|
|
@@ -1356,6 +1483,11 @@ export default {
|
|
|
if (this.invoicingCheckboxData.length == 0) {
|
|
|
return this.$message.warning("请选择要删除的数据");
|
|
|
}
|
|
|
+ for (let item of this.invoicingCheckboxData) {
|
|
|
+ if (item.srcId) {
|
|
|
+ return this.$message.warning("系统生成的开票明细不允许删除");
|
|
|
+ }
|
|
|
+ }
|
|
|
this.$confirm("确定将选择数据删除?", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
@@ -1416,7 +1548,7 @@ export default {
|
|
|
this.$set(this.form, "bankReceiptBankName", res.data.data.records[0].accountBank);
|
|
|
}
|
|
|
});
|
|
|
- // 带出开票单位数据
|
|
|
+ // 带出发票抬头数据
|
|
|
corpsinvoiceheaderList(1, 20, {
|
|
|
pid: this.form.corpId
|
|
|
}).then(res => {
|
|
|
@@ -1442,7 +1574,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- // 开票单位
|
|
|
+ // 发票抬头
|
|
|
else if (name == "invCorpCnName") {
|
|
|
this.$set(this.form, "invCorpAccountBankUsd", "");
|
|
|
this.$set(this.form, "invCorpAccountNoUsd", "");
|
|
|
@@ -1558,6 +1690,14 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
submit(type) {
|
|
|
+ for (let item of this.InvoicingList) {
|
|
|
+ if (!item.id) {
|
|
|
+ return this.$message.error("请保存开票木棍西");
|
|
|
+ }
|
|
|
+ if (item.status == 0) {
|
|
|
+ return this.$message.error("开票明细存在未开票的数据");
|
|
|
+ }
|
|
|
+ }
|
|
|
this.$confirm("确定进行确认开票操作?", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
@@ -1588,6 +1728,17 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ for (let item of this.InvoicingList) {
|
|
|
+ if (!item.curCode) {
|
|
|
+ return this.$message.error("币别不能为空");
|
|
|
+ }
|
|
|
+ if (!Number(item.exrate)) {
|
|
|
+ return this.$message.error("汇率不能为空或0");
|
|
|
+ }
|
|
|
+ if (Number(item.price ? item.price : 0) <= 0) {
|
|
|
+ return this.$message.error("单价不能为非正数");
|
|
|
+ }
|
|
|
+ }
|
|
|
this.form.type = "销项";
|
|
|
this.form.billNoFormat = "XXFP";
|
|
|
this.form.businessTypeCode = "XXFP";
|
|
|
@@ -1681,7 +1832,7 @@ export default {
|
|
|
this.$set(this.form, "bankReceiptBankName", res.data.data.records[0].accountBank);
|
|
|
}
|
|
|
});
|
|
|
- // 带出开票单位数据
|
|
|
+ // 带出发票抬头数据
|
|
|
corpsinvoiceheaderList(1, 20, { pid: row.id }).then(res => {
|
|
|
if (res.data.data.records.length != 0) {
|
|
|
this.$set(this.form, "invCorpId", res.data.data.records[0].id);
|
|
|
@@ -2040,7 +2191,7 @@ export default {
|
|
|
this.bankReceiptData = res.data.data.records;
|
|
|
});
|
|
|
},
|
|
|
- // 根据往来单位选择调用获取发票抬头数据 开票单位数据
|
|
|
+ // 根据往来单位选择调用获取发票抬头数据 发票抬头数据
|
|
|
invcorpsinvoiceheaderListfun(cnName) {
|
|
|
corpsinvoiceheaderList(1, 20, {
|
|
|
pid: this.form.corpId,
|