| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416 |
- <template>
- <div>
- <div class="customer-head">
- <div class="customer-back">
- <el-button type="danger" style="border: none; background: none; color: red" icon="el-icon-arrow-left" @click="goBack()">返回列表 </el-button>
- <el-button v-if="form.id && pageIds.length" type="text" @click="lastPage">上一票</el-button>
- <el-button v-if="form.id && pageIds.length" type="text" @click="nextPage">下一票</el-button>
- </div>
- <div class="customer-title">{{ form.operatingType }}</div>
- <div class="add-customer-btn">
- <el-button size="small" :disabled="!form.id" @click="$refs.print.openDialog()">预 览 </el-button>
- <el-button v-if="roleName.includes('admin')" size="small" :disabled="!form.id" @click="$refs.report.openDialog()">报表设计 </el-button>
- <el-button v-if="form.operatingType == '付费申请'" size="small" type="success" @click="allClick('查看指示')">查看指示</el-button>
- <el-button type="success" size="small" v-if="form.operatingType == '销账'" @click="allClick('预付款')">预付款</el-button>
- <el-button size="small" type="danger" plain :disabled="editButton" v-if="form.status == 3" @click="allClick('撤销完成')">撤销完成 </el-button>
- <el-button
- size="small"
- type="success"
- plain
- :disabled="editButton"
- v-if="form.operatingStatus == 3 && form.status == 2"
- @click="allClick('确认完成')"
- >确认完成
- </el-button>
- <el-button
- v-if="form.operatingStatus == 1 || form.operatingStatus == 2 || form.operatingStatus == 3"
- size="small"
- type="danger"
- plain
- :disabled="editButton || form.status == 3"
- @click="allClick('撤销操作')"
- >撤销操作
- </el-button>
- <el-dropdown v-if="form.operatingStatus == 0" trigger="click" @command="moreClick">
- <el-button type="success" size="small" style="margin: 0 8px" :disabled="editButton || form.status == 3"
- >更多操作<i class="el-icon-arrow-down el-icon--right"></i>
- </el-button>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item v-if="form.dc == 'C'" command="付费申请">付费申请</el-dropdown-item>
- <el-dropdown-item v-if="!roleName.includes('财务') && isOffsetting" command="收付相抵">收付相抵</el-dropdown-item>
- <el-dropdown-item v-if="!roleName.includes('财务') && isWriteOff" command="挂账销账">挂账销账</el-dropdown-item>
- <el-dropdown-item v-if="isApplication" command="发票申请">发票申请</el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- <el-button class="el-button--small-yh" type="primary" size="small" v-if="editButton" @click="inEdit">编 辑 </el-button>
- <el-button v-else class="el-button--small-yh" type="primary" size="small" :disabled="editButton || form.status == 3" @click="submit"
- >保 存
- </el-button>
- </div>
- </div>
- <div style="margin-top: 50px">
- <el-card class="box-card">
- <avue-form :option="optionForm" v-model="form" ref="avueForm">
- <tempalte slot="corpCnName">
- <dic-select
- v-model="form.corpCnName"
- placeholder="对账单位"
- label="cnName"
- res="records"
- url="/blade-los/bcorps/listByType?current=1&size=10"
- :filterable="true"
- :remote="true"
- dataName="cnName"
- @selectChange="dicChange('corpCnName', $event)"
- :disabled="editDisabled || form.finStlBillsItemsList.length"
- :slotRight="true"
- rightLabel="shortName"
- ></dic-select>
- </tempalte>
- <tempalte slot="corpIsSigned">
- <div style="display: flex">
- <el-checkbox :true-label="1" :false-label="0" size="small" v-model="form.corpIsSigned" disabled>已签约 </el-checkbox>
- <el-input v-model="form.isSignedPersonName" placeholder="请输入 签约人" size="small" disabled></el-input>
- </div>
- </tempalte>
- </avue-form>
- <avue-form v-show="show" class="form2" :option="optionForm2" v-model="form" ref="avueForm2">
- <tempalte slot="dc">
- <el-select v-model="form.dc" placeholder="请选择 收付" :disabled="editDisabled || form.finStlBillsItemsList.length">
- <el-option v-for="item in dcOptions" :key="item.value" :label="item.label" :value="item.value"> </el-option>
- </el-select>
- </tempalte>
- <tempalte slot="operatorName">
- <dic-select
- v-model="form.operatorName"
- placeholder="操作员"
- label="name"
- res="records"
- url="/blade-user/page?current=1&size=10"
- :filterable="true"
- :remote="true"
- dataName="account"
- @selectChange="dicChange('operatorName', $event)"
- :disabled="editDisabled"
- ></dic-select>
- </tempalte>
- <tempalte slot="srcCnName">
- <dic-select
- v-model="form.srcCnName"
- placeholder="业务员"
- label="cname"
- res="records"
- url="/blade-los/bstaffinformation/list?current=1&size=10&positionType=业务员&status=0&whetherEmployedOrNot=1"
- :filterable="true"
- :remote="true"
- dataName="cname"
- @selectChange="dicChange('srcCnName', $event)"
- :disabled="editDisabled"
- ></dic-select>
- </tempalte>
- <tempalte slot="businessDate">
- <date-range
- :start-date.sync="form.businessDateStart"
- :end-date.sync="form.businessDateEnd"
- :defaultTime="['00:00:00', '00:00:00']"
- :disabled="editDisabled"
- ></date-range>
- </tempalte>
- <tempalte slot="auditDate">
- <date-range
- :start-date.sync="form.auditDateFrom"
- :end-date.sync="form.auditDateTo"
- :defaultTime="['00:00:00', '00:00:00']"
- :disabled="editDisabled"
- ></date-range>
- </tempalte>
- <tempalte slot="signForDate">
- <date-range
- :start-date.sync="form.signForDateStart"
- :end-date.sync="form.signForDateEnd"
- :defaultTime="['00:00:00', '00:00:00']"
- :disabled="editDisabled"
- ></date-range>
- </tempalte>
- <tempalte slot="Btn" style="display: flex; justify-content: flex-end">
- <el-button type="primary" size="mini" icon="el-icon-search" @click="allClick('检索')" :disabled="editDisabled">检索</el-button>
- <el-button size="mini" @click="allClick('重置条件')" :disabled="editDisabled || form.finStlBillsItemsList.length">重置条件</el-button>
- </tempalte>
- </avue-form>
- <div style="display: flex; justify-content: center; font-size: 14px" @click="show = !show" @mouseenter="enter" @mouseleave="leave">
- <div v-show="show" style="height: 16px; cursor: pointer">
- <span class="el-button--text"><i class="el-icon-caret-top" /><span v-show="showSpan">隐藏</span></span>
- </div>
- <div v-show="!show" style="height: 16px; cursor: pointer">
- <span class="el-button--text"><i class="el-icon-caret-bottom" /><span v-show="showSpan">显示</span></span>
- </div>
- </div>
- </el-card>
- <el-tabs style="margin-top: 2px" class="box-tabs" type="border-card" v-model="activeName" @tab-click="handleClick">
- <el-tab-pane label="查询结果" name="1">
- <query-data ref="queryData" :form="form" :tableData="form.finStlBillsItemsList" @update="update" :disabled="editDisabled"></query-data>
- </el-tab-pane>
- <el-tab-pane label="选定数据" name="2">
- <picked-data ref="pickedData" :form="form" :tableData="form.finStlBillsItemsList" @update="update" :disabled="editButton"></picked-data>
- </el-tab-pane>
- <el-tab-pane label="开票明细" name="3">
- <fininvoiceitemdetail :form="form" :data="form.finInvoiceItemDetailList" @update="update" :disabled="form.operatingStatus != 0">
- </fininvoiceitemdetail
- ></el-tab-pane>
- </el-tabs>
- <!--选择数据弹窗-->
- <el-dialog title="选择数据" class="el-dialogDeep" :visible.sync="retrievePopupsType" append-to-body width="70%" :close-on-click-modal="false">
- <div>
- <avue-crud :option="retrievePopupsOption" :data="retrievePopupsData">
- <template slot="menu" slot-scope="{ row }">
- <el-button type="text" icon="" size="small" @click.stop="retrievePopupsSelect(row)">选择 </el-button>
- </template>
- </avue-crud>
- </div>
- </el-dialog>
- <cashier-item ref="cashier" @update="update" :disabled="form.operatingType == '付费申请'"></cashier-item>
- <advance-payment ref="advance" @apData="apData" :disabled="form.status == 3"></advance-payment>
- <fee-info ref="feeInfo"></fee-info>
- <business-reports :id="form.id" ref="print" businessValue="DZZX" :type="true"></business-reports>
- <reports :id="form.id" :assemblyForm="form" businessValue="DZZX" ref="report"></reports>
- </div>
- </div>
- </template>
- <script>
- import dicSelect from "@/components/dicSelect/main";
- import dateRange from "@/components/dateRange/main.vue";
- import queryData from "./components/queryData.vue";
- import pickedData from "./components/pickedData.vue";
- import cashierItem from "./components/cashierItem.vue";
- import fininvoiceitemdetail from "./components/fininvoiceitemdetail.vue";
- import advancePayment from "./components/advancePayment.vue";
- import { dateFormat } from "@/util/date";
- import {
- finstlbillsConfirmReconciliation,
- finstlbillsDetail,
- finstlbillsRevokeReconciliation,
- finstlbillsSubmit,
- revokeSettlementApprove,
- confirmOffset,
- revokeOffset,
- finInvoicesApprove,
- revokeFinInvoicesApprove,
- agreementListAll,
- finstlbillslistAccBillByCorp,
- settlementApprove,
- } from "@/api/iosBasicData/finstlbills";
- import { confirmWriteOff, revokeWriteOff } from "@/api/iosBasicData/writeOff.js";
- import { getListAllDetail } from "@/api/iosBasicData/cashier.js";
- import businessReports from "@/components/iosbasic-data/businessReportsTS.vue";
- import reports from "@/components/iosbasic-data/reportsTS.vue";
- import _ from "lodash";
- export default {
- name: "detailsPage",
- data() {
- return {
- show: true,
- showSpan: false,
- editButton: false,
- editDisabled: false,
- activeName: "1",
- form: {
- billDate: dateFormat(new Date(), "yyyy-MM-dd") + " 00:00:00", // 对账日期 默认 当天
- isApproved: 2,
- isSignfor: 2,
- isChecked: 2,
- isCleared: 2,
- isInvoice: 2,
- finStlBillsItemsList: [],
- finInvoiceItemDetailList: [],
- advancePaymentRecordList: [],
- },
- optionForm: {
- menuBtn: false,
- span: 5,
- disabled: false,
- labelWidth: 70,
- column: [
- {
- label: "对账单号",
- prop: "billNo",
- placeholder: "系统生成对账单号",
- disabled: true,
- },
- {
- label: "对账日期",
- prop: "billDate",
- type: "date",
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd 00:00:00",
- disabled: false,
- },
- {
- label: "限定金额",
- prop: "limitedAmount",
- disabled: true,
- },
- {
- label: "备注",
- prop: "remarks",
- disabled: false,
- },
- {
- label: "对账单位",
- prop: "corpCnName",
- disabled: false,
- },
- {
- label: "简称/编码",
- prop: "corpShortName",
- disabled: true,
- span: 3,
- },
- {
- label: "",
- labelWidth: 0,
- prop: "corpCode",
- disabled: true,
- span: 2,
- },
- {
- label: "账期备注",
- prop: "corpAccRemarks",
- disabled: true,
- },
- {
- label: "",
- labelWidth: 0,
- prop: "corpIsSigned",
- disabled: true,
- },
- {
- label: "预收账款",
- prop: "advanceFromCustomers",
- disabled: true,
- span: 4,
- },
- ],
- },
- optionForm2: {
- menuBtn: false,
- span: 5,
- disabled: false,
- labelWidth: 70,
- column: [
- {
- label: "收/付",
- prop: "dc",
- type: "select",
- dicData: [
- {
- label: "收",
- value: "D",
- },
- {
- label: "付",
- value: "C",
- },
- ],
- disabled: false,
- span: 3,
- },
- {
- label: "币别",
- labelWidth: 40,
- prop: "curCode",
- type: "select",
- dicUrl: "/api/blade-los/bcurrency/page?current=1&size=10&code={{key}}",
- props: {
- label: "code",
- value: "code",
- res: "data.records",
- },
- disabled: false,
- span: 2,
- },
- {
- label: "操作/业务",
- prop: "operatorName",
- disabled: false,
- span: 3,
- },
- {
- label: "",
- labelWidth: 0,
- prop: "srcCnName",
- disabled: false,
- span: 2,
- },
- {
- label: "对账号",
- prop: "duizhangNo",
- disabled: false,
- },
- {
- label: "业务类型",
- prop: "businessTypes",
- type: "select",
- dicData: [
- {
- label: "海运出口",
- value: "SE",
- },
- {
- label: "海运进口",
- value: "SI",
- },
- ],
- filterable: true,
- multiple: true,
- dataType: "string",
- tags: true,
- disabled: false,
- },
- {
- label: "审核",
- prop: "isApproved",
- labelWidth: 40,
- type: "select",
- clearable: false,
- dicData: [
- {
- label: "全部",
- value: 2,
- },
- {
- label: "是",
- value: 1,
- },
- {
- label: "否",
- value: 0,
- },
- ],
- disabled: false,
- value: 2,
- span: 2,
- },
- {
- label: "发票",
- prop: "isInvoice",
- labelWidth: 40,
- clearable: false,
- type: "select",
- dicData: [
- {
- label: "全部",
- value: 2,
- },
- {
- label: "是",
- value: 1,
- },
- {
- label: "否",
- value: 0,
- },
- ],
- disabled: false,
- span: 2,
- },
- {
- label: "业务编号",
- prop: "businessNo",
- disabled: false,
- },
- {
- label: "主单号",
- prop: "mblno",
- disabled: false,
- },
- {
- label: "分单号",
- prop: "hblno",
- disabled: false,
- },
- {
- label: "订舱号",
- prop: "bookingNumber",
- disabled: false,
- },
- {
- label: "对账",
- prop: "isChecked",
- labelWidth: 40,
- clearable: false,
- type: "select",
- dicData: [
- {
- label: "全部",
- value: 2,
- },
- {
- label: "是",
- value: 1,
- },
- {
- label: "否",
- value: 0,
- },
- ],
- disabled: false,
- span: 2,
- },
- {
- label: "签收",
- prop: "isSignfor",
- labelWidth: 40,
- type: "select",
- clearable: false,
- dicData: [
- {
- label: "全部",
- value: 2,
- },
- {
- label: "是",
- value: 1,
- },
- {
- label: "否",
- value: 0,
- },
- ],
- disabled: false,
- span: 2,
- },
- {
- label: "ETD期间",
- prop: "businessDate", // businessDate只是插槽值 字段为 businessDateStart businessDateEnd
- disabled: false,
- },
- {
- label: "审核日期",
- prop: "auditDate", //auditDate只是插槽值 字段为 auditDateFrom auditDateTo
- disabled: false,
- },
- {
- label: "签收日期",
- prop: "signForDate", //signForDate只是插槽值 字段为 signForDateStart signForDateEnd
- disabled: false,
- },
- {
- label: "费用名称",
- prop: "feeCnName",
- type: "select",
- dicUrl: "/api/blade-los/bfees/listAll",
- props: {
- label: "cnName",
- value: "cnName",
- },
- filterable: true,
- multiple: true,
- dataType: "string",
- tags: true,
- disabled: false,
- },
- {
- label: "销账",
- prop: "isCleared",
- labelWidth: 40,
- clearable: false,
- type: "select",
- dicData: [
- {
- label: "全部",
- value: 2,
- },
- {
- label: "是",
- value: 1,
- },
- {
- label: "否",
- value: 0,
- },
- ],
- disabled: false,
- span: 2,
- },
- {
- label: "船名",
- prop: "vesselCnName",
- disabled: false,
- },
- {
- label: "航次",
- prop: "voyageNo",
- disabled: false,
- },
- {
- label: "发票号",
- prop: "invoiceNo",
- disabled: false,
- },
- {
- label: "查询金额",
- prop: "checkBalance",
- disabled: false,
- },
- {
- label: "",
- prop: "Btn",
- labelWidth: 0,
- span: 4,
- },
- ],
- },
- dcOptions: [
- {
- label: "收",
- value: "D",
- },
- {
- label: "付",
- value: "C",
- },
- ],
- retrievePopupsType: false, // 弹窗开启关闭
- retrievePopupsData: [], // 选择弹窗数据
- retrievePopupsOption: {
- border: true,
- calcHeight: 30,
- tip: false,
- height: 500,
- index: true,
- addBtn: false,
- viewBtn: false,
- delBtn: false,
- editBtn: false,
- refreshBtn: false,
- columnBtn: false,
- menuWidth: "60",
- column: [
- {
- label: "客户中文名",
- prop: "cnName",
- overHidden: true,
- },
- {
- label: "客户英文文名",
- prop: "cnEame",
- overHidden: true,
- },
- ],
- },
- roleName: localStorage.getItem("roleName").split(","),
- saberUserInfo: JSON.parse(localStorage.getItem("saber-userInfo")).content, // 当前登录人个人信息
- };
- },
- components: {
- dicSelect,
- queryData,
- pickedData,
- dateRange,
- cashierItem,
- fininvoiceitemdetail,
- advancePayment,
- businessReports,
- reports,
- },
- props: {
- detailData: Object,
- pageIds: {
- type: Array, // 指定 prop 的类型为 Array
- default: () => [], // 提供一个默认值,这里使用函数形式返回一个空数组
- },
- },
- async created() {
- if (this.detailData && this.detailData.id) {
- this.editButton = true;
- this.editDisabled = true;
- this.optionForm.disabled = true;
- this.optionForm2.disabled = true;
- this.getDetail(this.detailData.id);
- }
- },
- methods: {
- compareSizes() {
- if (this.form.finStlBillsItemsList.length == 0) {
- return "不比较";
- }
- if (this.form.finStlBillsItemsList.length == this.form.finStlBillsItemsList.filter((item) => item.dc == "D").length) {
- return "全收";
- }
- if (this.form.finStlBillsItemsList.length == this.form.finStlBillsItemsList.filter((item) => item.dc == "C").length) {
- return "全付";
- }
- let DSUM = 0;
- let CSUM = 0;
- for (let item of this.form.finStlBillsItemsList) {
- if (item.dc == "D") {
- if (item.currentStlCurCode == "CNY") {
- DSUM += Number(item.currentStlAmountRMB);
- } else {
- DSUM += Number(item.currentStlAmountUSD) * item.currentStlExrate;
- }
- }
- if (item.dc == "C") {
- if (item.currentStlCurCode == "CNY") {
- CSUM += Number(item.currentStlAmountRMB);
- } else {
- CSUM += Number(item.currentStlAmountUSD) * item.currentStlExrate;
- }
- }
- }
- if (DSUM > CSUM) {
- return "D";
- }
- if (DSUM < CSUM) {
- return "C";
- }
- if (DSUM == CSUM) {
- return "相等";
- }
- },
- enter() {
- this.showSpan = true;
- },
- leave() {
- this.showSpan = false;
- },
- lastPage() {
- if (this.pageIds.length) {
- const index = this.pageIds.indexOf(this.form.id);
- if (index == 0) {
- return this.$message.error("没有上一票了");
- }
- const lastIndex = index - 1;
- this.getDetail(this.pageIds[lastIndex]);
- }
- },
- nextPage() {
- if (this.pageIds.length) {
- const index = this.pageIds.indexOf(this.form.id);
- if (this.pageIds[this.pageIds.length - 1] == this.form.id) {
- return this.$message.error("没有下一票了");
- }
- const nextIndex = index + 1;
- this.getDetail(this.pageIds[nextIndex]);
- }
- },
- inEdit() {
- this.editButton = false;
- //管理员 允许修改他人业务 本人单据可以编辑
- if (this.form.status != 3 && this.form.operatingStatus != 3) {
- if (this.roleName.includes("admin") || this.roleName.includes("允许修改他人业务") || this.saberUserInfo.user_id == this.form.createUser) {
- this.editDisabled = false;
- this.optionForm.disabled = false;
- this.optionForm2.disabled = false;
- }
- }
- },
- moreClick(name) {
- if (this.form.finStlBillsItemsList.length == 0) {
- return this.$message.error("选定数据不能为空");
- }
- for (let item of this.form.finStlBillsItemsList) {
- if (item.isChecked == 0) {
- return this.$message.error("选定数据存在未对账的数据,请维护");
- }
- if (item.isSignfor == 0) {
- return this.$message.error("选定数据存在未签收的数据,请维护");
- }
- }
- let obj = {
- ...this.form,
- billNoFormat: "HYDZ",
- businessTypeCode: "HYDZ",
- businessType: "CHK",
- url: "/iosBasicData/financialManagement/finstlbills/index",
- pageLabel: "对账中心(J)",
- };
- if (name == "付费申请") {
- if (this.form.finStlBillsItemsList.filter((item) => item.dc == "C").length == 0) {
- return this.$message.error("费用明细没有付费数据");
- }
- this.$refs.cashier.openDialog(this.form, this.form.finStlBillsItemsList, "auto");
- // const loading = this.$loading({
- // lock: true,
- // text: "加载中",
- // spinner: "el-icon-loading",
- // background: "rgba(255,255,255,0.7)"
- // });
- // settlementApprove(obj)
- // .then(res => {
- // this.$message.success("操作成功");
- // this.getDetail(this.form.id);
- // })
- // .finally(() => {
- // loading.close();
- // });
- }
- if (name == "收付相抵") {
- const loading = this.$loading({
- lock: true,
- text: "加载中",
- spinner: "el-icon-loading",
- background: "rgba(255,255,255,0.7)",
- });
- confirmOffset(obj)
- .then((res) => {
- this.$message.success("操作成功");
- this.getDetail(this.form.id);
- })
- .finally(() => {
- loading.close();
- });
- }
- if (name == "挂账销账") {
- this.$refs.advance.openDialog(this.form);
- }
- if (name == "发票申请") {
- if (this.form.finInvoiceItemDetailList.length == 0) {
- return this.$message.error("开票明细不能为空");
- }
- for (let item of this.form.finInvoiceItemDetailList) {
- if (!item.invoiceCompanyId) {
- 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("单价不能为非正数");
- }
- }
- const loading = this.$loading({
- lock: true,
- text: "加载中",
- spinner: "el-icon-loading",
- background: "rgba(255,255,255,0.7)",
- });
- finInvoicesApprove(obj)
- .then((res) => {
- this.$message.success("操作成功");
- this.getDetail(this.form.id);
- })
- .finally(() => {
- loading.close();
- });
- }
- },
- dicChange(name, row) {
- if (name == "corpCnName") {
- if (row) {
- this.form.corpId = row.id;
- this.form.corpEnName = row.enName;
- this.form.corpCode = row.code;
- this.form.corpShortName = row.shortName;
- this.form.corpArgreementNo = row.enName;
- this.form.limitedAmount = null;
- this.form.corpAccRemarks = null;
- this.form.corpIsSigned = 0;
- this.form.isSignedPersonId = null;
- this.form.isSignedPersonName = null;
- let obj = {
- corpId: row.id,
- validDate: dateFormat(new Date(), "yyyy-MM-dd"),
- };
- agreementListAll(obj).then((res) => {
- if (res.data.data.length) {
- let obj = res.data.data[0];
- let USDTEXT = obj.amountUsd ? "USD:" + Number(obj.amountUsd) : "";
- let CNYTEXT = obj.amountCny ? "RMB:" + Number(obj.amountCny) : "";
- //USD有值是 中间要加空格
- this.form.limitedAmount = (USDTEXT ? USDTEXT + " " : "") + CNYTEXT;
- this.form.corpAccRemarks = obj.accountPeriodRemarks;
- this.form.corpIsSigned = 1;
- this.form.isSignedPersonId = obj.createUser;
- this.form.isSignedPersonName = obj.createUserName;
- }
- });
- } else {
- this.form.corpId = null;
- this.form.corpCode = null;
- this.form.corpShortName = null;
- this.form.corpEnName = null;
- this.form.corpCnName = null;
- this.form.corpArgreementNo = null;
- this.form.limitedAmount = null;
- this.form.corpAccRemarks = null;
- this.form.corpIsSigned = 0;
- this.form.isSignedPersonId = null;
- this.form.isSignedPersonName = null;
- }
- }
- if (name == "operatorName") {
- if (row) {
- this.form.operatorId = row.id;
- } else {
- this.form.operatorId = null;
- this.form.operatorName = null;
- }
- }
- if (name == "srcCnName") {
- if (row) {
- this.form.srcId = row.id;
- this.form.srcEnName = row.ename;
- } else {
- this.form.srcId = null;
- this.form.srcCnName = null;
- this.form.srcEnName = null;
- }
- }
- },
- async allClick(name) {
- if (name == "预付款") {
- this.$refs.advance.openDialog(this.form);
- }
- if (name == "检索") {
- if (this.form.duizhangNo) {
- this.activeName = "2";
- //查对账号
- this.$refs.pickedData.search(name);
- } else {
- this.activeName = "1";
- //直接检索
- this.$refs.queryData.search(name);
- }
- }
- if (name == "重置条件") {
- let obj = {
- ...this.$options.data().form,
- id: this.form.id,
- version: this.form.version,
- tenantId: this.form.tenantId,
- branchId: this.form.branchId,
- createUser: this.form.createUser,
- createUserName: this.form.createUserName,
- createTime: this.form.createTime,
- updateUser: this.form.updateUser,
- updateUserName: this.form.updateUserName,
- updateTime: this.form.updateTime,
- billNo: this.form.billNo,
- };
- await this.$refs.avueForm.resetForm();
- await this.$refs.avueForm2.resetForm();
- this.form = obj;
- }
- if (name == "查看指示") {
- this.$refs.cashier.openDialog(this.form, this.form.finStlBillsItemsList, "view");
- }
- if (name == "确认完成") {
- if (this.form.finStlBillsItemsList.length == 0) {
- return this.$message.error("选定数据不能为空");
- }
- if (this.form.operatingType == "付费申请") {
- getListAllDetail({ srcId: this.form.id }).then((res) => {
- if (
- Number(this.form.amountSub) != Number(this.form.actualAmountCr) ||
- Number(this.form.amountSubUsd) != Number(this.form.actualAmountCrUsd)
- ) {
- this.$confirm("对账金额与实际支付金额不相等,是否确认对账?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }).then(() => {
- this.confirm();
- });
- } else {
- this.$confirm("确定进行确认完成操作?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }).then(() => {
- this.confirm();
- });
- }
- });
- }
- if (this.form.operatingType != "付费申请") {
- this.$confirm("确定进行确认完成操作?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }).then(() => {
- this.confirm();
- });
- }
- }
- if (name == "撤销完成") {
- this.$confirm("确定进行撤销对账操作?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }).then(() => {
- let obj = {
- ...this.form,
- billNoFormat: "HYDZ",
- businessTypeCode: "HYDZ",
- businessType: "CHK",
- };
- const loading = this.$loading({
- lock: true,
- text: "加载中",
- spinner: "el-icon-loading",
- background: "rgba(255,255,255,0.7)",
- });
- finstlbillsRevokeReconciliation(obj)
- .then((res) => {
- this.$message.success("操作成功");
- this.editButton = true;
- this.getDetail(this.form.id);
- })
- .finally(() => {
- loading.close();
- });
- });
- }
- if (name == "撤销操作") {
- this.$confirm("确定进行撤销申请操作?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }).then(() => {
- let obj = {
- ...this.form,
- billNoFormat: "HYDZ",
- businessTypeCode: "HYDZ",
- businessType: "CHK",
- };
- if (this.form.operatingType == "付费申请") {
- const loading = this.$loading({
- lock: true,
- text: "加载中",
- spinner: "el-icon-loading",
- background: "rgba(255,255,255,0.7)",
- });
- revokeSettlementApprove(obj)
- .then((res) => {
- this.$message.success("操作成功");
- this.editButton = true;
- this.getDetail(this.form.id);
- })
- .finally(() => {
- loading.close();
- });
- }
- if (this.form.operatingType == "收付相抵") {
- const loading = this.$loading({
- lock: true,
- text: "加载中",
- spinner: "el-icon-loading",
- background: "rgba(255,255,255,0.7)",
- });
- revokeOffset(obj)
- .then((res) => {
- this.$message.success("操作成功");
- this.getDetail(this.form.id);
- })
- .finally(() => {
- loading.close();
- });
- }
- if (this.form.operatingType == "销账") {
- const loading = this.$loading({
- lock: true,
- text: "加载中",
- spinner: "el-icon-loading",
- background: "rgba(255,255,255,0.7)",
- });
- revokeWriteOff(obj)
- .then((res) => {
- this.$message.success("操作成功");
- this.getDetail(this.form.id);
- })
- .finally(() => {
- loading.close();
- });
- }
- if (this.form.operatingType == "发票申请") {
- const loading = this.$loading({
- lock: true,
- text: "加载中",
- spinner: "el-icon-loading",
- background: "rgba(255,255,255,0.7)",
- });
- revokeFinInvoicesApprove(obj)
- .then((res) => {
- this.$message.success("操作成功");
- this.getDetail(this.form.id);
- })
- .finally(() => {
- loading.close();
- });
- }
- });
- }
- },
- otherSearch() {
- let obj = {
- type: 1,
- isReview: this.form.isApproved, // 审核状态
- isSignfor: this.form.isSignfor, // 是否已签收(0 否 1是)
- dc: this.form.dc, // 收付 D=收 C=付
- curCode: this.form.curCode, // 币别
- srcId: this.form.srcId, // 业务员id
- isCleared: this.form.isCleared, // 是否销账(0 未销账 3 部分销账 9 销账)
- // accBillNo: this.form.accountNo, // 账单编号 ACCT NO
- billNo: this.form.businessNo, // 单据编号 JOB NO
- mblno: this.form.mblno, // 主单号
- hblno: this.form.hblno, // 分单号
- isChecked: this.form.isChecked, // 是否对账(0 未对账 1 已对账)
- queryAmount: this.form.queryAmount, // 查询金额
- businessType: this.form.businessTypes, // 业务类型
- invoiceStatus: this.form.isInvoice, // 发票状态 0 = 未开 9=已开 2 待开 3 不开
- vesselCnName: this.form.vesselCnName, // 中文船名
- invoiceNo: this.form.invoiceNo, // 发票号
- bookingNo: this.form.bookingNo, // 订舱号 BKNO
- createUserName: this.form.updateUser ? this.form.updateUser : "", // 操作员id
- voyageNo: this.form.voyageNo, // 航次
- businessDateStart: this.form.businessDateStart, // 业务开始日期
- businessDateEnd: this.form.businessDateEnd, // 业务结束日期
- approvedDateStart: this.form.auditDateFrom, // 审核开始日期
- approvedDateEnd: this.form.auditDateTo, // 审核结束日期
- signForDateStart: this.form.signForDateStart,
- signForDateEnd: this.form.signForDateEnd,
- feeCnName: this.form.feeCnName,
- };
- finstlbillslistAccBillByCorp(obj).then((res) => {
- this.retrievePopupsType = true;
- this.retrievePopupsData = res.data.data;
- });
- },
- retrievePopupsSelect(row) {
- this.$set(this.form, "corpId", row.id);
- this.$set(this.form, "corpCnName", row.cnName);
- this.$set(this.form, "corpEnName", row.enName);
- this.$set(this.form, "corpArgreementNo", row.enName);
- this.form.limitedAmount = null;
- this.form.corpAccRemarks = null;
- this.form.corpIsSigned = 0;
- this.form.isSignedPersonId = null;
- this.form.isSignedPersonName = null;
- let obj = {
- corpId: row.id,
- validDate: dateFormat(new Date(), "yyyy-MM-dd"),
- };
- agreementListAll(obj).then((res) => {
- if (res.data.data.length) {
- let obj = res.data.data[0];
- let USDTEXT = obj.amountUsd ? "USD:" + Number(obj.amountUsd) : "";
- let CNYTEXT = obj.amountCny ? "RMB:" + Number(obj.amountCny) : "";
- //USD有值是 中间要加空格
- this.form.limitedAmount = (USDTEXT ? USDTEXT + " " : "") + CNYTEXT;
- this.form.corpAccRemarks = obj.accountPeriodRemarks;
- this.form.corpIsSigned = 1;
- this.form.isSignedPersonId = obj.createUser;
- this.form.isSignedPersonName = obj.createUserName;
- }
- });
- this.retrievePopupsType = false;
- this.$refs.queryData.search("检索");
- },
- //确认对账
- confirm() {
- let obj = {
- ...this.form,
- billNoFormat: "HYDZ",
- businessTypeCode: "HYDZ",
- businessType: "CHK",
- url: "/iosBasicData/financialManagement/finstlbills/index",
- pageLabel: "对账中心(J)",
- };
- const loading = this.$loading({
- lock: true,
- text: "加载中",
- spinner: "el-icon-loading",
- background: "rgba(255,255,255,0.7)",
- });
- finstlbillsConfirmReconciliation(obj)
- .then((res) => {
- this.getDetail(this.form.id);
- })
- .finally(() => {
- loading.close();
- });
- },
- // application() {
- // },
- update(id, type) {
- this.getDetail(id, type);
- },
- apData(list) {
- this.form.advancePaymentRecordList = list;
- let obj = {
- ...this.form,
- billNoFormat: "HYDZ",
- businessTypeCode: "HYDZ",
- businessType: "CHK",
- url: "/iosBasicData/financialManagement/finstlbills/index",
- pageLabel: "对账中心(J)",
- };
- const loading = this.$loading({
- lock: true,
- text: "加载中",
- spinner: "el-icon-loading",
- background: "rgba(255,255,255,0.7)",
- });
- confirmWriteOff(obj)
- .then((res) => {
- this.$message.success("操作成功");
- this.getDetail(this.form.id);
- })
- .finally(() => {
- loading.close();
- });
- },
- submit() {
- // if (!this.form.corpId) {
- // return this.$message.error("请选择对账单位");
- // }
- for (let item of this.form.finInvoiceItemDetailList) {
- if (!item.invoiceCompanyId) {
- 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("单价不能为非正数");
- }
- }
- this.form.finStlBillsItemsList.forEach((item, index) => {
- if (item.currentStlCurCode == "CNY") {
- item.currentStlAmount = item.currentStlAmountRMB;
- } else {
- item.currentStlAmount = item.currentStlAmountUSD;
- }
- });
- let obj = {
- ...this.form,
- billNoFormat: "HYDZ",
- businessTypeCode: "HYDZ",
- businessType: "CHK",
- };
- const loading = this.$loading({
- lock: true,
- text: "加载中",
- spinner: "el-icon-loading",
- background: "rgba(255,255,255,0.7)",
- });
- finstlbillsSubmit(obj)
- .then((res) => {
- this.$message.success("操作成功");
- this.getDetail(res.data.data.id);
- })
- .finally(() => {
- loading.close();
- });
- },
- getDetail(id, type) {
- //生成发票跳转到开票明细
- if (type == "finstlbills") {
- this.activeName = "3";
- } else {
- //其他时候默认显示选定数据tabs
- this.activeName = "2";
- }
- const loading = this.$loading({
- lock: true,
- text: "加载中",
- spinner: "el-icon-loading",
- background: "rgba(255,255,255,0.7)",
- });
- finstlbillsDetail(id)
- .then((res) => {
- res.data.data.finStlBillsItemsList.forEach((item) => {
- item.customSelected = false;
- if (item.curCode == "CNY") {
- this.$set(item, "amountRMB", item.amount);
- // this.$set(item, "currentInvoiceAmountRMB", Number(item.appliedInvoiceAmount ? item.appliedInvoiceAmount : 0));
- this.$set(item, "unsettledAmountRMB", Number(item.amount ? item.amount : 0));
- this.$set(item, "currentStlAmountRMB", Number(item.currentStlAmount ? item.currentStlAmount : 0));
- this.$set(item, "currentStlAmountUSD", Number(0));
- this.$set(item, "stlAmountDr", Number(item.stlTtlAmount ? item.stlTtlAmount : 0));
- this.$set(item, "stlAmountDrUSD", Number(0));
- } else {
- this.$set(item, "amountUSD", item.amount);
- // this.$set(item, "currentInvoiceAmountUSD", Number(item.appliedInvoiceAmount ? item.appliedInvoiceAmount : 0));
- this.$set(item, "unsettledAmountUSD", Number(item.amount ? item.amount : 0));
- this.$set(item, "currentStlAmountUSD", Number(item.currentStlAmount ? item.currentStlAmount : 0));
- this.$set(item, "currentStlAmountRMB", Number(0));
- this.$set(item, "stlAmountDr", Number(0));
- this.$set(item, "stlAmountDrUSD", Number(item.stlTtlAmount ? item.stlTtlAmount : 0));
- }
- });
- if (res.data.data.status == 3 || res.data.data.operatingStatus == 3) {
- this.editDisabled = true;
- this.optionForm.disabled = true;
- this.optionForm2.disabled = true;
- }
- this.form = res.data.data;
- if (type == "query") {
- //再次查询是为了避免已选定的数据不能再次出现查询结果里面
- this.$refs.queryData.search();
- }
- setTimeout(() => {
- this.$refs.pickedData.refreshData();
- this.$refs.pickedData.resetTotal();
- }, 100);
- })
- .finally(() => {
- loading.close();
- });
- },
- // 更改表格颜色
- headerClassName(tab) {
- //颜色间隔
- let back = "";
- if (tab.columnIndex >= 0 && tab.column.level === 1) {
- if (tab.columnIndex % 2 === 0) {
- back = "back-one";
- } else if (tab.columnIndex % 2 === 1) {
- back = "back-two";
- }
- }
- return back;
- },
- goBack(type) {
- this.$emit("goBack");
- },
- },
- watch: {},
- computed: {
- // 收 1.只有收费明细-发票申请,挂账销账,
- // 2.收付明细都有
- // 1).收付金额相等-收付相抵
- // 2).收大于付-发票申请(金额取差额),收付相抵,挂账销账(销账金额取差额)
- // 付 1.只有付费-付费申请
- // 2.收付明细都有且付大于收-付费申请(指示金额取差额),收付相抵
- //收付相抵
- isOffsetting() {
- if (this.form.id) {
- if (this.form.finStlBillsItemsList.length != this.form.finStlBillsItemsList.filter((item) => item.dc == "D").length) {
- if (this.form.dc == "C" && this.compareSizes() == "C") {
- return true;
- }
- if (this.form.dc == "D" && this.compareSizes() == "D") {
- return true;
- }
- if (this.form.dc == "D" && this.compareSizes() == "相等") {
- return true;
- }
- } else {
- return false;
- }
- } else {
- return false;
- }
- },
- //挂账销账
- isWriteOff() {
- if (this.form.id && this.form.dc == "D" && (this.compareSizes() == "D" || this.compareSizes() == "全收")) {
- return true;
- } else {
- return false;
- }
- },
- //发票申请
- isApplication() {
- if (this.form.id && this.form.dc == "D" && (this.compareSizes() == "D" || this.compareSizes() == "全收")) {
- return true;
- } else {
- return false;
- }
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- ::v-deep .el-form-item__error {
- display: none !important;
- }
- ::v-deep .el-form-item {
- margin-bottom: 2px !important;
- }
- ::v-deep .el-table .cell {
- padding: 0 2px !important;
- .el-form-item {
- margin-bottom: 0px !important;
- }
- }
- ::v-deep .avue-crud .el-table .el-form-item__label {
- left: -1px;
- }
- // ::v-deep#out-table .back-one {
- // background: #ecf5ff !important;
- // }
- // ::v-deep#out-table .back-two {
- // background: #ecf5ff !important;
- // }
- ::v-deep #out-table .back-one {
- background: #ecf5ff !important;
- text-align: center;
- padding: 4px 0;
- }
- ::v-deep #out-table .back-two {
- background: #ecf5ff !important;
- text-align: center;
- padding: 4px 0;
- }
- ::v-deep .el-table--small td,
- .el-table--small th {
- padding: 2px !important;
- }
- ::v-deep .box-card .el-card__body {
- padding: 2px !important;
- }
- ::v-deep .form2 .el-collapse-item__wrap {
- background-color: #ecf5ff !important;
- }
- ::v-deep .box-tabs .el-tabs__item {
- height: 30px;
- line-height: 30px;
- }
- ::v-deep .box-tabs .el-tabs__content {
- padding: 2px !important;
- }
- ::v-deep .el-checkbox__input.is-disabled + span.el-checkbox__label {
- color: #606266;
- }
- .disabledBox {
- display: flex;
- align-items: center;
- }
- .meetSize {
- font-size: 16px;
- color: #54bcbd;
- }
- .customer-title {
- position: absolute;
- top: 12px;
- z-index: 1000;
- left: calc(50% - 175px);
- color: #67c23a;
- }
- </style>
|