12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364 |
- <template>
- <div class="app-container">
- <el-form
- :model="queryParams"
- ref="queryForm"
- :inline="true"
- v-show="showSearch"
- :rules="rules"
- label-width="80px"
- >
- <el-form-item label="客户名称" prop="fToCorpid">
- <el-select
- v-model="queryParams.fToCorpid"
- filterable
- remote
- clearable
- size="small"
- style="width: 200px"
- @keyup.enter.native="handleQuery"
- :remote-method="corpsRemoteMethod"
- placeholder="请输入客户名称"
- >
- <el-option
- v-for="(dict, index) in fMblnoOptions"
- :key="index.fId"
- :label="dict.fName"
- :value="dict.fId"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="结算单位" prop="fCorpid">
- <el-select
- v-model="queryParams.fCorpid"
- filterable
- remote
- clearable
- :disabled="doNot"
- size="small"
- style="width: 200px"
- @keyup.enter.native="handleQuery"
- :remote-method="corpsRemoteMethod"
- placeholder="请输入结算单位"
- >
- <el-option
- v-for="(dict, index) in fMblnoOptions"
- :key="index.fId"
- :label="dict.fName"
- :value="dict.fId"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="提单号" prop="fMblno">
- <el-input
- type="daterange"
- size="small"
- style="width: 200px"
- v-model="queryParams.fMblno"
- >
- </el-input>
- </el-form-item>
- <el-form-item label="应收/付" prop="fDc">
- <el-select
- type="daterange"
- size="small"
- style="width: 200px"
- v-model="queryParams.fDc"
- >
- <el-option label="应收" value="D"/>
- <el-option label="应付" value="C"/>
- </el-select>
- </el-form-item>
- <el-form-item label="费用名称" prop="fFeeid">
- <el-select
- v-model="queryParams.fFeeid"
- filterable
- remote
- clearable
- size="small"
- style="width: 200px">
- <el-option
- v-for="(dict, index) in fDNameOptions"
- :key="index.fId"
- :label="dict.fName"
- :value="dict.fId"
- ></el-option>
- </el-select>
- </el-form-item>
- <!-- <el-form-item label="业务类型" prop="fBusinessType">-->
- <!-- <el-select-->
- <!-- v-model="queryParams.fBusinessType"-->
- <!-- filterable-->
- <!-- remote-->
- <!-- size="small"-->
- <!-- style="width: 200px"-->
- <!-- placeholder="请选择业务类型"-->
- <!-- multiple-->
- <!-- >-->
- <!-- <el-option-->
- <!-- v-for="dict in businessTypeOptions"-->
- <!-- :key="dict.dictValue"-->
- <!-- :label="dict.dictLabel"-->
- <!-- :value="dict.dictValue"-->
- <!-- ></el-option>-->
- <!-- </el-select>-->
- <!-- </el-form-item>-->
- <el-form-item label="是否对账" prop="fReconciliation">
- <el-select
- size="small"
- style="width: 200px"
- v-model="queryParams.fReconciliation"
- >
- <el-option label="是" value="1"/>
- <el-option label="否" value="0"/>
- </el-select>
- </el-form-item>
- <el-form-item label="单据类型" prop="fBilltype" v-if="typevalue == 1 || typevalue == 3">
- <el-select
- v-model="queryParams.fBilltype"
- size="small"
- style="width: 200px"
- placeholder="请选择单据类型"
- >
- <el-option label="入库" value="SJRK"></el-option>
- <el-option label="出库" value="SJCK"></el-option>
- <el-option label="货权转移" value="HQZY"></el-option>
- <el-option label="内贸" value="KHDD"></el-option>
- <el-option label="开票申请" value="ApplyFP"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="作业类型" prop="fBusinessType" v-if="typevalue == 1 || typevalue == 3">
- <el-select
- v-model="queryParams.fBusinessType"
- filterable
- remote
- size="small"
- style="width: 200px"
- placeholder="作业类型"
- multiple
- >
- <el-option
- v-for="(dict, index) in businessTypeOption"
- :key="index.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="船名" prop="fVslid" v-if="typevalue == 1 || typevalue == 3">
- <el-select
- filterable
- v-model="queryParams.fVslid"
- size="small"
- style="width: 200px"
- placeholder="请选择仓储业务"
- >
- <el-option
- v-for="item in vesselOptions"
- :key="item.fId"
- :label="item.fName"
- :value="item.fId"/>
- </el-select>
- </el-form-item>
- <el-form-item label="航次" prop="fVoyid" v-if="typevalue == 1 || typevalue == 3">
- <el-input
- v-model="queryParams.fVoyid"
- size="small"
- style="width: 200px"
- placeholder="请输入航次"
- >
- </el-input>
- </el-form-item>
- <el-form-item label="业务类型" prop="fSystemType">
- <el-select
- v-model="queryParams.fSystemType"
- placeholder="请选择业务类型"
- size="small"
- disabled
- style="width: 200px"
- >
- <el-option
- v-for="item in typeoptions"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item
- label="审核日期"
- prop="timeExamine"
- v-if="typevalue == 1 || typevalue == 3"
- >
- <el-date-picker
- v-model="queryParams.timeExamine"
- type="daterange"
- range-separator="至"
- @change="timeMethods"
- value-format="yyyy-MM-dd"
- style="width: 250px"
- start-placeholder="开始日期"
- end-placeholder="结束日期">
- </el-date-picker>
- </el-form-item>
- <el-form-item label="业务区间" prop="createTimeList">
- <el-date-picker
- v-model="queryParams.createTimeList"
- type="daterange"
- range-separator="至"
- style="width: 250px"
- value-format="yyyy-MM-dd"
- @change="changeTime"
- start-placeholder="开始日期"
- end-placeholder="结束日期">
- </el-date-picker>
- </el-form-item>
- </el-form>
- <el-row :gutter="10" class="mb8">
- <el-col :span="1.5">
- <el-dropdown @command="handleCommand">
- <el-button
- type="cyan"
- icon="el-icon-search"
- size="mini"
- >搜索</el-button
- >
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item command="SF">收费</el-dropdown-item>
- <el-dropdown-item command="FF">付费</el-dropdown-item>
- <el-dropdown-item command="DZ">对账</el-dropdown-item>
- <el-dropdown-item command="invoiceFP">确认发票</el-dropdown-item>
- <el-dropdown-item command="ApplyFP">申请发票</el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- </el-col>
- <el-col :span="1.5">
- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
- >重置</el-button
- >
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="primary"
- icon="el-icon-plus"
- size="mini"
- @click="Submit"
- :disabled="queryParams.billsType != 'DZ'"
- v-hasPermi="['finance:charge:add']"
- >对账确认
- </el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="success"
- icon="el-icon-edit"
- size="mini"
- @click="Submit"
- :disabled="queryParams.billsType != 'SF'"
- v-hasPermi="['finance:charge:edit']"
- >收款确认
- </el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="danger"
- icon="el-icon-delete"
- size="mini"
- @click="Submit"
- :disabled="queryParams.billsType != 'FF' || multiple"
- v-hasPermi="['finance:charge:remove']"
- >付款确认
- </el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="warning"
- icon="el-icon-download"
- size="mini"
- @click="Submit"
- v-hasPermi="['finance:charge:export']"
- >付款申请
- </el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="info"
- icon="el-icon-download"
- size="mini"
- :disabled="queryParams.billsType != 'ApplyFP' || multiple"
- @click="Submit(1)"
- v-hasPermi="['agreement:agreementStorage:export']"
- >开票申请
- </el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="info"
- icon="el-icon-download"
- size="mini"
- :disabled="queryParams.billsType != 'invoiceFP' || multiple"
- @click="Submit"
- v-hasPermi="['agreement:agreementStorage:export']"
- >开票确认
- </el-button>
- </el-col>
- <div class="tabSetting">
- <right-toolbar
- :showSearch.sync="showSearch"
- @queryTable="getList"
- ></right-toolbar>
- <div style="margin: 0 12px">
- <el-button
- icon="el-icon-setting"
- size="mini"
- circle
- @click="showSetting = !showSetting"
- ></el-button>
- </div>
- </div>
- </el-row>
- <el-dialog
- title="自定义列显示"
- :visible.sync="showSetting"
- width="700px"
- v-dialogDrag
- >
- <template slot="title">
- <div class="avue-crud__dialog__header">
- <span class="el-dialog__title">
- <span
- style="
- display: inline-block;
- width: 3px;
- height: 20px;
- margin-right: 5px;
- float: left;
- margin-top: 2px;
- "
- ></span>
- </span>
- </div>
- </template>
- <div>配置排序列数据(拖动调整顺序)</div>
- <div style="margin-left: 17px">
- <el-checkbox
- v-model="allCheck"
- label="全选"
- @change="allChecked"
- ></el-checkbox>
- </div>
- <div style="padding: 4px; display: flex; justify-content: center">
- <draggable
- v-model="setRowList"
- group="site"
- animation="300"
- @start="onStart"
- @end="onEnd"
- handle=".indraggable"
- >
- <transition-group>
- <div
- v-for="item in setRowList"
- :key="item.surface"
- class="listStyle"
- >
- <div style="width: 500px" class="indraggable">
- <div class="progress" :style="{ width: item.width + 'px' }">
- <el-checkbox
- :label="item.name"
- v-model="item.checked"
- :true-label="0"
- :false-label="1"
- >{{ item.name }}
- </el-checkbox>
- </div>
- </div>
- <el-input-number
- v-model.number="item.width"
- controls-position="right"
- :min="1"
- :max="500"
- size="mini"
- ></el-input-number>
- </div>
- </transition-group>
- </draggable>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="showSetting = false">取 消</el-button>
- <el-button @click="delRow" type="danger">重 置</el-button>
- <el-button type="primary" @click="save()">确 定</el-button>
- </span>
- </el-dialog>
- <el-table
- :data="chargeList"
- @selection-change="handleSelectionChange"
- show-summary
- :summary-method="listTotal"
- >
- <el-table-column type="selection" width="100" align="center" />
- <el-table-column
- label="序号"
- type="index"
- width="55"
- align="center"
- fixed
- />
- <el-table-column
- v-for="(item, index) in getRowList"
- :key="index"
- :label="item.name"
- :width="item.width"
- :prop="item.label"
- align="center"
- :show-overflow-tooltip="true"
- sortable
- :fixed="item.fixed"
- >
- <template slot-scope="scope">
- <span v-if="item.label == 'srcBillNo'">{{scope.row.srcBillNo}}</span>
- <span v-if="item.label == 'boatName'">{{scope.row.boatName}}</span>
- <span v-if="item.label == 'voyageName'">{{scope.row.voyageName}}</span>
- <span v-if="item.label == 'fMblno'">{{scope.row.fMblno}}</span>
- <span v-if="item.label == 'createTime'">{{(scope.row.createTime).slice(0,10)}}</span>
- <span v-if="item.label == 'fFeeName'">{{scope.row.fFeeName}}</span>
- <span v-if="item.label == 'fSrcdcName'">{{scope.row.fSrcdcName}}</span>
- <span v-if="item.label == 'fAmtdr'">{{scope.row.fAmtdr}}</span>
- <el-input v-model="scope.row.fAmt" @input="amountCheck(scope.row)" v-if="item.label == 'fAmt'"/>
- <span v-if="item.label == 'fFeeunitid'">{{scope.row.fFeeunitid}}</span>
- <span v-if="item.label == 'fQty'">{{scope.row.fQty}}</span>
- <span v-if="item.label == 'fUnitprice'">{{scope.row.fUnitprice}}</span>
- <span v-if="item.label == 'fBusinessType'">{{scope.row.fBusinessType}}</span>
- <span v-if="item.label == 'fBilltype'">{{scope.row.fBilltype}}</span>
- <span v-if="item.label == 'fProductName'">{{scope.row.fProductName}}</span>
- <span v-if="item.label == 'fMarks'">{{scope.row.fMarks}}</span>
- <span v-if="item.label == 'fChargedate'">{{scope.row.fChargedate}}</span>
- <span v-if="item.label == 'fBillingDeadline'">{{scope.row.fBillingDeadline}}</span>
- <span v-if="item.label == 'fBillingDays'">{{scope.row.fBillingDays}}</span>
- <span v-if="item.label == 'fInventoryDays'">{{scope.row.fInventoryDays}}</span>
- <span v-if="item.label == 'fRemarks'">{{scope.row.fRemarks}}</span>
- </template>
- </el-table-column>
- </el-table>
- <pagination
- v-show="total > 0"
- :total="total"
- :page.sync="queryParams.pageNum"
- :limit.sync="queryParams.pageSize"
- @pagination="getList"
- />
- </div>
- </template>
- <script>
- import { getcontrastList, addPreservation} from "@/api/finance/generalLedger";
- import { listFees } from "@/api/basicdata/fees";
- import { listCorps } from "@/api/finance/contrast";
- import print from "print-js";
- import AddOrUpdate from "@/views/viewApproval";
- import ApprovalComments from "@/views/startApproval";
- import { queryUserVal } from "@/api/warehouseBusiness/agreement";
- import Global from "@/layout/components/global";
- import draggable from "vuedraggable";
- import Vue from "vue";
- import Cookies from "js-cookie";
- import { addSet, select } from "@/api/system/set";
- import { getVesselName, listChange } from '@/api/finance/applyForInvoice/feeDetail'
- import { MessageBox } from 'element-ui'
- import store from '@/store'
- Vue.directive("dialogDrag", {
- bind(el, binding, vnode, oldVnode) {
- const dialogHeaderEl = el.querySelector(".el-dialog__header");
- const dragDom = el.querySelector(".el-dialog");
- const enlarge = el.querySelector(".enlarge");
- dialogHeaderEl.style.cursor = "move";
- // 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
- const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null);
- if (enlarge) {
- enlarge.onclick = (e) => {
- dragDom.style.top = "0px";
- dragDom.style.left = "0px";
- };
- }
- dialogHeaderEl.onmousedown = (e) => {
- // 鼠标按下,计算当前元素距离可视区的距离
- const disX = e.clientX - dialogHeaderEl.offsetLeft;
- const disY = e.clientY - dialogHeaderEl.offsetTop;
- // 获取到的值带px 正则匹配替换
- let styL, styT;
- // 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px
- if (sty.left.includes("%")) {
- styL =
- +document.body.clientWidth * (+sty.left.replace(/\%/g, "") / 100);
- styT =
- +document.body.clientHeight * (+sty.top.replace(/\%/g, "") / 100);
- } else {
- styL = +sty.left.replace(/\px/g, "");
- styT = +sty.top.replace(/\px/g, "");
- }
- document.onmousemove = function (e) {
- // 通过事件委托,计算移动的距离
- const l = e.clientX - disX;
- const t = e.clientY - disY;
- // 移动当前元素
- if (t + styT >= 0) {
- dragDom.style.top = `${t + styT}px`;
- }
- dragDom.style.left = `${l + styL}px`;
- // 将此时的位置传出去
- // binding.value({x:e.pageX,y:e.pageY})
- };
- document.onmouseup = function (e) {
- document.onmousemove = null;
- document.onmouseup = null;
- };
- };
- },
- });
- export default {
- name: "Charge",
- data() {
- return {
- doNot:false,
- rules: {
- fCorpid:[{ required: true, message: "客户名称不能为空", trigger: "blur"}],
- fToCorpid: [{ required: true, message: "结算单位不能为空", trigger: "blur" }],
- fBilltype: [{ required: true, message: "单据类型不能为空", trigger: "blur" }]
- },
- vesselOptions:[],
- fDNameOptions: [],
- typevalue: "",
- typeoptions: [
- {
- value: "1",
- label: "仓储",
- },
- {
- value: "2",
- label: "车队",
- },
- {
- value: "3",
- label: "船务",
- }
- ],
- businessTypeOption:[],
- drag: false,
- tableDate: [
- {
- surface: "1",
- label: "srcBillNo",
- name: "来源编号",
- checked: 0,
- width: 100,
- },
- {
- surface: "2",
- label: "boatName",
- name: "船名",
- checked: 0,
- width: 100,
- },
- {
- surface: "3",
- label: "voyageName",
- name: "航次",
- checked: 0,
- width: 100,
- },
- {
- surface: "4",
- label: "fMblno",
- name: "提单号",
- checked: 0,
- width: 100,
- },
- {
- surface: "5",
- label: "createTime",
- name: "业务日期",
- checked: 0,
- width: 100,
- },
- {
- surface: "6",
- label: "fFeeName",
- name: "费用名称",
- checked: 0,
- width: 100,
- },
- {
- surface: "7",
- label: "fSrcdcName",
- name: "收/付",
- checked: 0,
- width: 100,
- },
- {
- surface: "8",
- label: "fAmtdr",
- name: "金额",
- checked: 0,
- width: 100,
- },
- {
- surface: "9",
- label: "fAmt",
- name: "本次金额",
- checked: 0,
- width: 100,
- },
- {
- surface: "10",
- label: "fFeeunitid",
- name: "计价单位",
- checked: 0,
- width: 100,
- },
- {
- surface: "11",
- label: "fQty",
- name: "数量",
- checked: 0,
- width: 100,
- },
- {
- surface: "12",
- label: "fUnitprice",
- name: "单价",
- checked: 0,
- width: 100,
- },
- {
- surface: "13",
- label: "fBusinessType",
- name: "作业类型",
- checked: 0,
- width: 100,
- },
- {
- surface: "14",
- label: "fBilltype",
- name: "业务类型",
- checked: 0,
- width: 100,
- },
- {
- surface: "15",
- label: "fProductName",
- name: "货物品名",
- checked: 0,
- width: 100,
- },
- {
- surface: "16",
- label: "fMarks",
- name: "品牌",
- checked: 0,
- width: 100,
- },
- {
- surface: "17",
- label: "fChargedate",
- name: "计费起始日期",
- checked: 0,
- width: 100,
- },
- {
- surface: "18",
- label: "fBillingDeadline",
- name: "计费截止日期",
- checked: 0,
- width: 100,
- },
- {
- surface: "19",
- label: "fBillingDays",
- name: "计费天数",
- checked: 0,
- width: 100,
- },
- {
- surface: "20",
- label: "fInventoryDays",
- name: "库存天数",
- checked: 0,
- width: 100,
- },
- {
- surface: "21",
- label: "fRemarks",
- name: "备注",
- checked: 0,
- width: 100,
- },
- ],
- setRowList: [],
- getRowList: [],
- //自定义列宽
- allCheck: false,
- showSetting:false,
- Lander: "",
- Operator: "",
- tablefilter: false,
- //打印表
- fWbuOptions: [],
- // 遮罩层
- loading: true,
- selection: "",
- // 选中数组
- ids: [],
- // 非单个禁用
- single: true,
- // 非多个禁用
- multiple: true,
- // 显示搜索条件
- showSearch: true,
- // 总条数
- total: 0,
- moneys:'',
- moneye:'',
- // 财务数据主表格数据
- chargeList: [],
- // 弹出层标题
- title: "",
- // 客户(客户数据)
- fMblnoOptions: [],
- // 主表查询参数
- queryParams: {
- pageNum: 1,
- pageSize: 10,
- fSystemType: Cookies.get("sysType"),
- fCorpid:null,
- fToCorpid:null,
- fMblno:null,
- fDc:null,
- fFeeid:null,
- fReconciliation:null,
- fBilltype:null,
- fBusinessType:null,
- fVslid:null,
- fVoyid:null,
- timeExamine:null,
- createTimeList:null,
- billsType:null
- },
- };
- },
- components: {
- draggable,
- AddOrUpdate,
- ApprovalComments,
- },
- created() {
- this.setRowList = this.tableDate;
- this.getRowList = this.tableDate;
- this.typevalue = Cookies.get("sysType");
- let query = { pageNum: 1, fDc: "D" };
- listFees(query).then((response) => {
- this.fDNameOptions = response.rows;
- });
- // this.getDicts("data_billType").then((response) => {
- // if (response.data) {
- // this.businessTypeOptions = response.data
- // }
- // });
- this.getDicts("st_in_type").then((response) => {
- this.businessTypeOption = response.data;
- });
- this.vessleRemthod()
- this.corpsRemoteMethod()
- // this.getList();
- // this.getRow();
- },
- activated() {
- if(this.$route.query.data){
- listCorps().then((response) => {
- this.fMblnoOptions = response;
- let data = JSON.parse(this.$route.query.data)
- let queryParams = {}
- this.queryParams.fCorpid = data.fCorpid
- queryParams.fCorpid = data.fCorpid
- queryParams.fCorpid = data.fCorpid
- queryParams.fSrcidList = data.fSrcid
- queryParams.fSrcpidList = data.fSrcpid
- queryParams.billsType = data.billsType
- this.queryParams.fId = data.fId
- // let list = queryParams
- for (let item in this.fMblnoOptions){
- if (data.fCorpid == this.fMblnoOptions[item].fName){
- this.doNot = true
- queryParams.fCorpid = this.fMblnoOptions[item].fId
- this.queryParams.fCorpid = this.fMblnoOptions[item].fId
- console.log(queryParams.fCorpid)
- getcontrastList(queryParams).then(response=>{
- console.log(response)
- if(response.rows){
- this.chargeList = response.rows
- }
- })
- }
- }
- });
- }
- },
- methods: {
- //提交按钮
- Submit(value){
- this.$refs["queryForm"].validate((valid) => {
- if (valid) {
- if (this.chargeList.length === 0) {
- return false
- }else{
- if (this.chargeList.length > 1){
- this.queryParams.fMblno = this.chargeList[0].fMblno + '...'
- }else {
- this.queryParams.fMblno = this.chargeList[0].fMblno
- }
- }
- if(value === 1 ){
- for(let item in this.fMblnoOptions){
- if(this.queryParams.fCtrlcorpid == this.fMblnoOptions[item].fId){
- this.queryParams.fCtrlcorpid = this.fMblnoOptions[item].fName
- }
- console.log(this.fMblnoOptions[item].fName)
- }
- }
- let aug = []
- let bug = []
- for (let item in this.selection) {
- for (let li in this.selection) {
- if (item != li) {
- if (this.selection[item].fSrcid == this.selection[li].fSrcid) {
- console.log(this.selection[item], this.selection[li])
- aug.push({
- index: this.selection[item].fSrcid,
- id: item,
- index2: this.selection[li].fSrcid,
- id2: li
- })
- }
- }
- }
- }
- console.log(aug)
- let add =''
- let addold =''
- for(let li in aug){
- for(let item in aug)
- if(aug[item].id == aug[li].id2 && aug[item].id2 == aug[li].id){
- aug.splice(item, 1);
- }
- }
- if(aug.length != 0){
- for (let item in aug){
- addold = parseInt(aug[item].id2)+1
- add += Number(aug[item].id)+1 +'行、'+ addold + '行/'
- }
- MessageBox.confirm("第" + add + "重复,请重新选择",{
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }
- ).then(() => {
- return
- })
- }else {
- this.queryParams.tMblno = this.queryParams.fMblno
- for(let item in this.fMblnoOptions){
- if(this.queryParams.fToCorpid == this.fMblnoOptions[item].fId){
- this.queryParams.fToCorpid = this.fMblnoOptions[item].fName
- }
- }
- let formData = new window.FormData();
- formData.append('tFee',JSON.stringify(this.queryParams))
- formData.append('tFeeDo',JSON.stringify(this.selection))
- formData.append('billsType',this.queryParams.billsType)
- formData.append('tFeeInvoice','')
- addPreservation(formData).then(response=>{
- this.$message.success("操作成功")
- if(this.queryParams.billsType == 'ApplyFP'){
- this.$router.push({path:'/finance/invoiceInformation'})
- }else if(this.queryParams.billsType == 'DZ'){
- this.$router.push({path:'/finance/contrast'})
- }else if(this.queryParams.billsType == 'SF'){
- this.$router.push({path:'/finance/charge'})
- }else if(this.queryParams.billsType == 'FF'){
- this.$router.push({path:'/finance/payment'})
- }else if(this.queryParams.billsType == 'invoiceFP'){
- this.$router.push({path:'/finance/controlOverInvoices/invoice'})
- }
- })
- }
- }
- })
- },
- amountCheck(row){
- if(row.fAmtdr < row.fAmt){
- this.$message.error("本次金额不能大于金额")
- row.fAmt = ''
- }
- },
- //搜索按钮下拉选项搜索数据
- handleCommand(command){
- this.queryParams.billsType = command
- this.getList()
- },
- //获取船名
- vessleRemthod(){
- getVesselName().then(response=>{
- this.vesselOptions = response.rows
- })
- },
- //搜索时间截取时分秒
- timeMethods(){
- this.queryParams.timeExamine[0] = this.queryParams.timeExamine[0]+" 00:00:00"
- this.queryParams.timeExamine[1] = this.queryParams.timeExamine[1]+" 23:59:59"
- },
- changeTime(){
- this.queryParams.createTimeList[0] = this.queryParams.createTimeList[0]+" 00:00:00"
- this.queryParams.createTimeList[1] = this.queryParams.createTimeList[1]+" 23:59:59"
- },
- //导出明细
- handleExportItems() {
- const fIds = this.queryParams.fId;
- if (fIds !== null) {
- this.$confirm("是否确认导出所有计费物资明细数据?", "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(function () {
- return exportWarehousebillsitems(fIds);
- })
- .then((response) => {
- this.download(response.msg);
- });
- } else {
- this.$message("请先保存");
- }
- },
- //列设置全选
- allChecked() {
- if (this.allCheck == true) {
- this.setRowList.map((e) => {
- return (e.checked = 0);
- });
- } else {
- this.setRowList.map((e) => {
- return (e.checked = 1);
- });
- }
- },
- //查询列数据
- getRow() {
- let that = this;
- this.data = {
- tableName: "申请费用",
- userId: Cookies.get("userName"),
- };
- select(this.data).then((res) => {
- if (res.data.length != 0) {
- this.getRowList = res.data.filter((e) => e.checked == 0);
- this.setRowList = res.data;
- this.setRowList = this.setRowList.reduce((res, item) => {
- res.push({
- surface: item.surface,
- label: item.label,
- name: item.name,
- checked: item.checked,
- width: item.width,
- fixed: item.fixed,
- });
- return res;
- }, []);
- }
- });
- },
- //保存列设置
- save() {
- this.showSetting = false;
- this.data = {
- tableName: "收费",
- userId: Cookies.get("userName"),
- sysTableSetList: this.setRowList,
- };
- addSet(this.data).then((res) => {
- this.getRowList = this.setRowList.filter((e) => e.checked == 0);
- });
- },
- //重置列表
- delRow() {
- this.data = {
- tableName: "收费",
- userId: Cookies.get("userName"),
- };
- resetModule(this.data).then((res) => {
- if (res.code == 200) {
- this.showSetting = false;
- this.setRowList = this.tableDate;
- this.getRowList = this.tableDate;
- }
- });
- },
- //开始拖拽事件
- onStart() {
- this.drag = true;
- },
- //拖拽结束事件
- onEnd() {
- this.drag = false;
- },
- //收费页面合计
- listTotal(param) {
- this.total = 0
- const { columns, data } = param;
- const sums = [];
- if(this.selection.length === 0){
- columns.forEach((column, index) => {
- if (index === 0) {
- sums[index] = "合计";
- } else if (column.label == '金额'|| column.label == '本次金额') {
- const values = data.map((item) => Number(item[column.property]));
- if (!values.every((value) => isNaN(value))) {
- sums[index] = values.reduce((prev, curr) => {
- const value = Number(curr);
- if (!isNaN(value)) {
- return prev + curr;
- } else {
- return prev;
- }
- }, 0);
- }
- }
- });
- }else{
- columns.forEach((column, index) => {
- if (index === 0) {
- sums[index] = "合计";
- } else if (column.label == '金额') {
- const values = this.selection.map((selection) => Number(selection[column.property]));
- if (!values.every((value) => isNaN(value))) {
- sums[index] = values.reduce((prev, curr) => {
- const value = Number(curr);
- if (!isNaN(value)) {
- return prev + curr;
- } else {
- return prev;
- }
- }, 0);
- }
- }else if(column.label == '本次金额'){
- const values = this.selection.map((selection) => Number(selection[column.property]));
- if (!values.every((value) => isNaN(value))) {
- sums[index] = values.reduce((prev, curr) => {
- const value = Number(curr);
- if (!isNaN(value)) {
- return prev + curr;
- } else {
- return prev;
- }
- }, 0);
- }
- this.queryParams.fAmtdr = sums[index]
- }
- });
- }
- return sums;
- },
- // 查看按钮
- check(row, status) {
- let res = {
- fId:row.fId,
- Num:status
- }
- this.$router.push({
- path:'/applyForInvoice/feeDetail',
- query: { data: res }
- })
- },
- // 多选框选中数据
- handleSelectionChange(selection) {
- this.selection = selection
- this.totAL = 0;
- this.ids = selection.map((item) => item.fId);
- this.single =
- selection.length !== 1 ||
- selection.map((item) => item.fBillstatus) == 6 ||
- selection.map((item) => item.fBillstatus) == 4;
- this.multiple = !selection.length;
- },
- /** 查询财务数据主列表 */
- getList() {
- this.loading = true;
- getcontrastList(this.queryParams).then((response) => {
- if(this.doNot == true){
- this.chargeList = this.chargeList.concat(response.rows)
- }else {
- this.chargeList = response.rows;
- }
- this.total = response.total;
- this.loading = false;
- });
- },
- // 取消按钮
- cancel() {
- this.getList();
- this.reset();
- },
- // 表单重置
- reset() {
- this.form = {
- fId: null,
- fBillno: null,
- fCtrlcorpid: null,
- fCorpid: null,
- tMblno: null,
- fAmtdr: null,
- fAmtcr: null,
- fBilltype: null,
- fBillstatus: "0",
- fRemarks: null,
- fAccbilldate: null,
- delFlag: null,
- createBy: null,
- fDeptid: null,
- createTime: null,
- updateBy: null,
- updateTime: null,
- };
- this.resetForm("ta");
- },
- /** 搜索按钮操作 */
- handleQuery() {
- this.queryParams.pageNum = 1;
- // this.getList();
- },
- /** 远程模糊查询用户 */
- corpsRemoteMethod(name) {
- if (name == null || name === "") {
- return false;
- }
- let queryParams = { fName: name };
- listCorps(queryParams).then((response) => {
- this.fMblnoOptions = response;
- // this.KHblnoOptions = response;
- });
- },
- /** 重置按钮操作 */
- resetQuery() {
- this.tableFilter = {
- pageNum: 1,
- pageSize: 10,
- fBillno: null,
- fCtrlcorpid: null,
- fCorpid: null,
- timeInterval: null,
- };
- this.handleQuery();
- },
- // 远程模糊查询费用名称
- fWRemoteMethod(name) {
- this.fWbuOptions = [];
- if (name == null || name === "") {
- return false;
- }
- let queryParams = { pageNum: 1, pageSize: 10, fName: name };
- listFees(queryParams).then((response) => {
- this.fWbuOptions = response.rows;
- });
- },
- /** 新增按钮操作 */
- handleAdd() {
- this.$router.push({path:'/applyForInvoice/feeDetail'})
- },
- /** 修改按钮操作 */
- handleUpdate(row,status) {
- let res = {
- fId:row.fId,
- Num:status
- }
- this.$router.push({
- path:'/applyForInvoice/feeDetail',
- query:{ data : res }
- })
- },
- /** 删除按钮操作 */
- handleDelete(row) {
- const fIds = row.fId || this.ids;
- let tips = "";
- if (Cookies.get("sysType") == 1) {
- //大木
- delCharge_s(fIds).then((data) => {
- switch (data.msg) {
- case "0": {
- this.$message.error("当前数据已被其他操作员操作请刷新页面");
- break;
- }
- case "1": {
- tips = "当前主表有数据从表无数据是否删除";
- this.delete_S(fIds, tips);
- break;
- }
- case "2": {
- tips = "当前主表有数据从表有数据是否删除";
- this.delete_S(fIds, tips);
- break;
- }
- default: {
- return this.$message.error("未知错误,无状态");
- }
- }
- });
- } else if (Cookies.get("sysType") == 2) {
- // 车队;
- delCharge_ss(fIds).then((data) => {
- switch (data.msg) {
- case "0": {
- this.$message.error("当前数据已被其他操作员操作请刷新页面");
- break;
- }
- case "1": {
- tips = "当前主表有数据从表无数据是否删除";
- this.delete_S(fIds, tips);
- break;
- }
- case "2": {
- tips = "当前主表有数据从表有数据是否删除";
- this.delete_S(fIds, tips);
- break;
- }
- default: {
- return this.$message.error("未知错误,无状态");
- }
- }
- });
- }
- },
- delete_S(fIds, tips) {
- this.$confirm(tips, "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(function () {
- if (Cookies.get("sysType") == 1) {
- return delCharge(fIds);
- } else if (Cookies.get("sysType") == 2) {
- return delCharges(fIds);
- }
- })
- .then(() => {
- this.getList();
- this.msgSuccess("删除成功");
- });
- },
- /** 导出按钮操作 */
- handleExport() {
- const queryParams = this.queryParams;
- this.$confirm("是否确认导出所有财务数据主数据项?", "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(function () {
- return exportCharge(queryParams);
- })
- .then((response) => {
- this.download(response.msg);
- });
- },
- //清空一行
- deleteRow(index, rows) {
- this.queryParams.fAmtcr = 0;
- this.queryParams.fAmtdr = 0;
- rows.splice(index, 1);
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .tabSetting {
- display: flex;
- justify-content: flex-end;
- }
- .listStyle {
- display: flex;
- border-top: 1px solid #dcdfe6;
- border-left: 1px solid #dcdfe6;
- border-right: 1px solid #dcdfe6;
- }
- .listStyle:last-child {
- border-bottom: 1px solid #dcdfe6;
- }
- .progress {
- display: flex;
- align-items: center;
- padding: 2px;
- background-color: rgba(0, 0, 0, 0.05);
- height: 100%;
- }
- .avue-crud__dialog__header {
- display: -webkit-box;
- display: -ms-flexbox;
- display: flex;
- -webkit-box-align: center;
- -ms-flex-align: center;
- align-items: center;
- -webkit-box-pack: justify;
- -ms-flex-pack: justify;
- justify-content: space-between;
- }
- .el-dialog__title {
- color: rgba(0, 0, 0, 0.85);
- font-weight: 500;
- word-wrap: break-word;
- }
- .avue-crud__dialog__menu {
- padding-right: 20px;
- float: left;
- }
- .avue-crud__dialog__menu i {
- color: #909399;
- font-size: 15px;
- }
- .el-icon-full-screen {
- cursor: pointer;
- }
- .el-icon-full-screen:before {
- content: "\e719";
- }
- </style>
- <style lang="scss">
- .el-table {
- .el-table__body-wrapper {
- z-index: 2;
- }
- }
- </style>
|