| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183 |
- <template>
- <div>
- <basic-container v-show="isShow">
- <avue-crud
- :option="option"
- :table-loading="loading"
- :data="data"
- :page.sync="page"
- :permission="permissionList"
- id="out-table"
- :header-cell-class-name="headerClassName"
- :before-open="beforeOpen"
- v-model="form"
- ref="crud"
- @row-update="rowUpdate"
- @row-save="rowSave"
- @row-del="rowDel"
- @search-change="searchChange"
- @search-reset="searchReset"
- @selection-change="selectionChange"
- @current-change="currentChange"
- @size-change="sizeChange"
- @refresh-change="refreshChange"
- :search.sync="search"
- @resetColumn="resetColumnTwo('crud', 'option', 'optionBack', 314)"
- @saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 314)"
- @on-load="onLoad"
- @expand-change="expandChange"
- >
- <template slot="expand" slot-scope="{ row }">
- <!-- <finstlbillsitems :tableData="row.finStlBillsItemsList" :brfalse="false"></finstlbillsitems> -->
- <avue-crud :data="row.finStlBillsItemsList" :option="itemOption" :cell-style="cellStyle" class="itemTable"></avue-crud>
- </template>
- <tempalte slot="feeCnNameSearch">
- <dic-select
- v-model="search.feeCnName"
- placeholder="费用名称"
- key="id"
- label="cnName"
- res="records"
- url="/blade-los/bfees/list"
- :filterable="true"
- :remote="true"
- dataName="cnName"
- ></dic-select>
- </tempalte>
- <template slot="menuLeft">
- <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
- <el-tab-pane label="草稿" :name="0"></el-tab-pane>
- <el-tab-pane label="处理中" :name="2"></el-tab-pane>
- <el-tab-pane label="已完成" :name="3"></el-tab-pane>
- <el-tab-pane label="已结算" :name="4"></el-tab-pane>
- </el-tabs>
- <el-button type="success" size="small" icon="el-icon-plus" plain @click="newbillFun">新建账单 </el-button>
- <el-button type="danger" size="small" icon="el-icon-delete" plain @click="handleDelete">一键删除 </el-button>
- </template>
- <template slot="menu" slot-scope="{ row }">
- <el-button type="text" size="small" @click="editFun(row)">编辑 </el-button>
- <!--:disabled="saberUserInfo.role_name.indexOf('允许修改他人业务') == -1?saberUserInfo.user_id != row.createUser:false"-->
- <el-button
- type="text"
- size="small"
- v-if="
- saberUserInfo.role_name.indexOf('admin') == -1
- ? saberUserInfo.role_name.indexOf('允许修改他人业务') == -1
- ? saberUserInfo.user_id == row.createUser
- : true
- : true
- "
- :disabled="row.status != 0"
- @click="rowDel(row)"
- >删除
- </el-button>
- </template>
- <template slot-scope="{ row }" slot="billNo">
- <span class="pointerClick" @click="editFun(row)">{{ row.billNo }} </span>
- </template>
- <template slot-scope="{ row }" slot="billStatus">
- <span v-if="row.billStatus == 1" style="color: #7fbb41">是</span>
- <span v-if="row.billStatus == 0" style="color: #d2983c">否</span>
- </template>
- </avue-crud>
- </basic-container>
- <finstlbillsDetails
- ref="finstlbillsDetails"
- v-if="!isShow"
- :editSave="editSave"
- @goBack="goBack"
- @toAddEdit="toAddEdit"
- :key="datekey"
- :pageIds="pageIds"
- >
- </finstlbillsDetails>
- </div>
- </template>
- <script>
- import { finstlbillsList, finstlbillsDetail, finstlbillsSubmit, finstlbillsRemove, finstlbillsitemsList } from "@/api/iosBasicData/finstlbills";
- import { mapGetters } from "vuex";
- import finstlbillsDetails from "@/views/iosBasicData/finstlbills/finstlbillsDetails.vue";
- import { getWorkDicts } from "@/api/system/dictbiz";
- import finstlbillsitems from "@/views/iosBasicData/finstlbills/assembly/finstlbillsitems.vue";
- import dicSelect from "@/components/dicSelect/main";
- export default {
- components: { finstlbillsitems, finstlbillsDetails, dicSelect },
- data() {
- return {
- activeName: 0,
- pageIds: [],
- datekey: Date.now(),
- search: {},
- // 详情页面和列表切换
- isShow: true,
- form: {},
- query: {},
- loading: true,
- page: {
- pageSize: 10,
- currentPage: 1,
- total: 0
- },
- selectionList: [],
- option: {},
- optionBack: {
- height: "auto",
- calcHeight: 30,
- tip: false,
- searchShow: true,
- searchMenuSpan: 6,
- border: true,
- index: true,
- viewBtn: true,
- selection: true,
- dialogClickModal: false,
- menuWidth: 100,
- expand: true,
- rowKey: "id",
- searchIcon: true,
- searchIndex: 3,
- column: [
- {
- label: "客户名称",
- prop: "corpCnName",
- search: true,
- width: "120",
- searchOrder: 1,
- overHidden: true
- },
- {
- label: "MB/L NO",
- prop: "mblno",
- search: true,
- searchOrder: 2,
- overHidden: true
- },
- {
- label: "JOB NO",
- prop: "businessNo",
- width: "120",
- search: true,
- searchOrder: 3,
- overHidden: true
- },
- {
- label: "HB/L NO",
- prop: "hblno",
- search: true,
- searchOrder: 4,
- overHidden: true
- },
- {
- label: "ACCT NO",
- prop: "accountNo",
- width: "100",
- search: true,
- searchOrder: 5,
- overHidden: true
- },
- {
- label: "业务类型",
- prop: "businessType",
- overHidden: true
- },
- {
- label: "单据编号",
- prop: "billNo",
- search: true,
- overHidden: true
- },
- {
- label: "对账日期",
- prop: "billDate",
- overHidden: true,
- width: "150"
- },
- {
- label: "业务开始日期",
- prop: "businessDateStart",
- search: true,
- overHidden: true,
- hide: true,
- searchLabelWidth: "100",
- type: "date",
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss"
- },
- {
- label: "业务结束日期",
- prop: "businessDateEnd",
- search: true,
- overHidden: true,
- hide: true,
- searchLabelWidth: "100",
- type: "date",
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss"
- },
- {
- label: "客户英文名称",
- prop: "corpEnName",
- width: "120",
- overHidden: true
- },
- {
- label: "对账单号",
- prop: "checkNo",
- search: true,
- width: "100",
- searchOrder: 6,
- overHidden: true
- },
- {
- label: "船名",
- prop: "vesselCnName",
- search: true,
- searchOrder: 7,
- overHidden: true
- },
- {
- label: "航次",
- prop: "voyageNo",
- search: true,
- searchOrder: 8,
- overHidden: true
- },
- // {
- // label: "客户是否已签约",
- // prop: "corpIsSigned",
- // width:"120",
- // dicData:[],
- // props: {
- // label: "dictValue",
- // value: "dictKey"
- // },
- // overHidden:true,
- // },
- {
- label: "客户约号",
- prop: "corpArgreementNo",
- overHidden: true
- },
- // {
- // label: "客户账期备注",
- // prop: "corpAccRemarks",
- // width:"120",
- // overHidden:true,
- // },
- {
- label: "业务类型",
- prop: "businessType",
- width: "120",
- overHidden: true,
- type: "select",
- multiple: true,
- dicData: [
- {
- label: "海运出口",
- value: "SE"
- },
- {
- label: "海运进口",
- value: "SI"
- }
- ]
- },
- {
- label: "本位币应收(CNY)",
- prop: "amountDr",
- width: "160"
- },
- {
- label: "本位币应付(CNY)",
- prop: "amountCr",
- width: "160"
- },
- // {
- // label: "综合 USD 应收(USD) - 非 USD 外币转换为 USD",
- // prop: "amountDrUsd",
- // width: "160"
- // },
- // {
- // label: "综合 USD 应付(USD) - 非 USD 外币转换为 USD",
- // prop: "amountCrUsd",
- // width: "160"
- // },
- {
- label: "合计本位币应收(CNY)",
- prop: "amountDrLoc",
- width: "160"
- },
- {
- label: "合计本位币应付(CNY)",
- prop: "amountCrLoc",
- width: "160"
- },
- {
- label: "本位币税后应收(CNY)",
- prop: "amountDrNet",
- width: "160"
- },
- {
- label: "本位币税后应付(CNY)",
- prop: "amountCrNet",
- width: "160"
- },
- // {
- // label: "综合 USD 税后应收(USD) - 非 USD 外币转换为 USD",
- // prop: "amountDrUsdNet",
- // width: "160"
- // },
- // {
- // label: "综合 USD 税后应付(USD) - 非 USD 外币转换为 USD",
- // prop: "amountCrUsdNet",
- // width: "160"
- // },
- {
- label: "合计本位币税后应收(CNY)",
- prop: "amountDrLocNet",
- width: "170"
- },
- {
- label: "合计本位币税后应付(CNY)",
- prop: "amountCrLocNet",
- width: "170"
- },
- {
- label: "业务单据编号",
- prop: "businessNo",
- width: "120",
- overHidden: true
- },
- {
- label: "账单编号",
- prop: "accountNo",
- width: "100",
- overHidden: true
- },
- // {
- // label: "对账单编号",
- // prop: "checkNo",
- // width: "100",
- // overHidden: true,
- // },
- // {
- // label: "业务所在部门",
- // prop: "deptName",
- // width: "120",
- // overHidden: true,
- // },
- // {
- // label: "业务操作",
- // prop: "operatorName",
- // width: "100",
- // overHidden: true,
- // },
- // {
- // label: "业务员",
- // prop: "salesName",
- // overHidden: true,
- // },
- // {
- // label: "费用收付",
- // prop: "dc",
- // search: true,
- // overHidden: true,
- // },
- // {
- // label: "币种",
- // prop: "curCode",
- // overHidden: true,
- // },
- // {
- // label: "中文船名",
- // prop: "vesselCnName",
- // overHidden: true,
- // },
- // {
- // label: "英文船名",
- // prop: "vesselEnName",
- // overHidden: true,
- // },
- // {
- // label: "航次",
- // prop: "voyageNo",
- // overHidden: true,
- // },
- // {
- // label: "财务开始日期",
- // prop: "accountDateFrom",
- // width: "140",
- // overHidden: true,
- // },
- // {
- // label: "财务结束日期",
- // prop: "accountDateTo",
- // width: "140",
- // overHidden: true,
- // },
- // {
- // label: "审核开始日期",
- // prop: "auditDateFrom",
- // width: "140",
- // overHidden: true,
- // },
- // {
- // label: "审核结束日期",
- // prop: "auditDateTo",
- // width: "140",
- // overHidden: true,
- // },
- // {
- // label: "发票号",
- // prop: "invoiceNo",
- // overHidden: true,
- // },
- // {
- // label: "检验检疫 NO",
- // prop: "iqNo",
- // width: "140",
- // overHidden: true,
- // },
- // {
- // label: "费用中文名称",
- // prop: "feeCode",
- // width: "140",
- // overHidden:true,
- // },
- // {
- // label: "费用名称",
- // prop: "feeCnName",
- // searchLabelWidth: "100",
- // width: "140",
- // search: true,
- // overHidden: true,
- // },
- // {
- // label: "费用英文名称",
- // prop: "feeEnName",
- // width: "140",
- // overHidden: true,
- // },
- {
- label: "是否审核",
- prop: "isApproved",
- dicData: [],
- props: {
- label: "dictValue",
- value: "dictKey"
- },
- overHidden: true
- },
- // {
- // label: "是否签收",
- // prop: "isSignfor",
- // dicData: [],
- // props: {
- // label: "dictValue",
- // value: "dictKey"
- // },
- // overHidden: true
- // },
- // {
- // label: "是否对账",
- // prop: "isChecked",
- // dicData: [],
- // props: {
- // label: "dictValue",
- // value: "dictKey"
- // },
- // overHidden: true
- // },
- {
- label: "是否生成对账",
- prop: "billStatus",
- width:100,
- dicData: [],
- props: {
- label: "dictValue",
- value: "dictKey"
- },
- overHidden: true
- },
- // {
- // label: "是否销账",
- // prop: "isCleared",
- // dicData: [],
- // props: {
- // label: "dictValue",
- // value: "dictKey"
- // },
- // overHidden: true
- // },
- // {
- // label: "是否开发票",
- // prop: "isInvoice",
- // dicData: [],
- // props: {
- // label: "dictValue",
- // value: "dictKey"
- // },
- // width: "140",
- // overHidden: true
- // },
- {
- label: "是否含税价计算",
- prop: "isTax",
- dicData: [],
- props: {
- label: "dictValue",
- value: "dictKey"
- },
- width: "140",
- overHidden: true
- },
- // {
- // label: "凭证类型",
- // prop: "voucherType",
- // overHidden: true,
- // },
- // {
- // label: "凭证号",
- // prop: "voucherNo",
- // overHidden: true,
- // },
- // {
- // label: "凭证日期",
- // prop: "voucherDate",
- // overHidden: true,
- // },
- {
- label: "备注",
- prop: "remarks",
- overHidden: true
- }
- ]
- },
- itemOption: {
- height: "300",
- header: false,
- index: true,
- menu:false,
- align: "center",
- column: [
- {
- label: "原业务编号",
- prop: "billNo",
- width: 120,
- overHidden: true
- },
- {
- label: "发票号",
- prop: "invoiceNo",
- width: 80,
- overHidden: true
- },
- {
- label: "结算单位",
- prop: "corpCnName",
- width: 120,
- overHidden: true
- },
- {
- label: "MB/L NO",
- prop: "mblno",
- width: 100,
- overHidden: true
- },
- {
- label: "本次签收CNY",
- prop: "currentStlAmountRMB",
- width: 100,
- overHidden: true
- },
- {
- label: "本次签收USD",
- prop: "currentStlAmountUSD",
- width: 100,
- overHidden: true
- },
- {
- label: "币种",
- prop: "currentStlCurCode",
- width: 60,
- overHidden: true
- },
- {
- label: "汇率",
- prop: "currentStlExrate",
- width: 80,
- overHidden: true
- },
- {
- label: "对账",
- prop: "isChecked",
- width: 60,
- overHidden: true,
- type: "select",
- dicData: [
- {
- label: "否",
- value: 0
- },
- {
- label: "是",
- value: 1
- }
- ]
- },
- {
- label: "签收",
- prop: "isSignfor",
- width: 60,
- overHidden: true,
- type: "select",
- dicData: [
- {
- label: "否",
- value: 0
- },
- {
- label: "是",
- value: 1
- }
- ]
- },
- {
- label: "发票状态",
- prop: "isInvoice",
- width: 80,
- type: "select",
- dicData: [
- {
- label: "待开发票",
- value: 1
- },
- {
- label: "确认开票",
- value: 2
- },
- {
- label: "不开发票",
- value: 3
- }
- ],
- overHidden: true
- },
- {
- label: "ETD",
- prop: "etd",
- width: 100,
- overHidden: true
- },
- {
- label: "账单编号",
- prop: "accBillNo",
- width: 100,
- overHidden: true
- },
- {
- label: "签收人",
- prop: "signforName",
- width: 80,
- overHidden: true
- },
- {
- label: "签收日期",
- prop: "signforDate",
- width: 100,
- overHidden: true
- },
- {
- label: "操作人",
- prop: "operatorName",
- width: 80,
- overHidden: true
- },
- {
- label: "BOOKINGNO",
- prop: "bookingNo",
- width: 100,
- overHidden: true
- },
- {
- label: "HB/L NO",
- prop: "hblno",
- width: 100,
- overHidden: true
- },
- {
- label: "船名",
- prop: "vesselCnName",
- width: 80,
- overHidden: true
- },
- {
- label: "航次",
- prop: "voyageNo",
- width: 80,
- overHidden: true
- },
- {
- label: "发票CNY",
- prop: "currentInvoiceAmountRMB",
- width: 80,
- overHidden: true
- },
- {
- label: "发票USD",
- prop: "currentInvoiceAmountUSD",
- width: 80,
- overHidden: true
- },
- {
- label: "箱量",
- prop: "quantityCntrTypesDescr",
- width: 80,
- overHidden: true
- },
- {
- label: "收付",
- prop: "dc",
- width: 60,
- type: "select",
- dicData: [
- {
- label: "收",
- value: "D"
- },
- {
- label: "付",
- value: "C"
- }
- ],
- overHidden: true
- },
- {
- label: "账单CNY",
- prop: "unsettledAmountRMB",
- width: 100,
- overHidden: true
- },
- {
- label: "账单USD",
- prop: "unsettledAmountUSD",
- width: 100,
- overHidden: true
- },
- {
- label: "已签收CNY",
- prop: "reconciliationAmount",
- width: 100,
- overHidden: true
- },
- {
- label: "已签收USD",
- prop: "reconciliationAmountUsd",
- width: 100,
- overHidden: true
- },
- {
- label: "已结算CNY",
- prop: "stlAmountDr",
- width: 90,
- overHidden: true
- },
- {
- label: "已结算USD",
- prop: "stlAmountDrUSD",
- width: 90,
- overHidden: true
- },
- {
- label: "业务员",
- prop: "srcCnName",
- width: 80,
- overHidden: true
- },
- {
- label: "备注",
- prop: "remarkss",
- width: 120,
- overHidden: true
- }
- ]
- },
- data: [],
- editSave: false, // 编辑保存打印状态
- saberUserInfo: {} // 当前登录人个人信息
- };
- },
- computed: {
- ...mapGetters(["permission"]),
- permissionList() {
- return {
- addBtn: this.vaildData(this.permission.finstlbills_add, false),
- viewBtn: this.vaildData(this.permission.finstlbills_view, false),
- delBtn: this.vaildData(this.permission.finstlbills_delete, false),
- editBtn: this.vaildData(this.permission.finstlbills_edit, false)
- };
- },
- ids() {
- let ids = [];
- this.selectionList.forEach(ele => {
- ids.push(ele.id);
- });
- return ids.join(",");
- }
- },
- async created() {
- // 获取当前登录人个人信息
- this.saberUserInfo = JSON.parse(localStorage.getItem("saber-userInfo")).content;
- this.option = await this.getColumnData(this.getColumnName(314), this.optionBack);
- if (this.$route.query.billId) {
- // 从审批里查看跳进来的
- this.editFun({ id: this.$route.query.billId });
- }
- this.$store.commit("DZZXF_IN_DETAIL");
- this.dictionaryfun(); // 获取字典数据
- },
- activated() {
- if (this.$route.query.id) {
- setTimeout(() => {
- this.editFun({ id: this.$route.query.id });
- }, 200);
- }
- },
- methods: {
- handleClick() {
- this.page.currentPage = 1;
- this.onLoad(this.page, this.query);
- },
- // 展开行
- expandChange(row, expendList) {
- finstlbillsitemsList(1, 20, { pid: row.id }).then(res => {
- console.log(res.data.data.records, 476);
- this.data[row.$index].finStlBillsItemsList = res.data.data.records.map(item => {
- if (item.curCode == "CNY") {
- this.$set(item, "amountRMB", item.amount);
- this.$set(item, "currentInvoiceAmountRMB", item.currentInvoiceAmount);
- this.$set(item, "unsettledAmountRMB", item.unsettledAmount);
- this.$set(item, "stlTtlAmountRMB", item.stlTtlAmount);
- this.$set(item, "currentStlAmountRMB", item.currentStlAmount);
- } else {
- this.$set(item, "amountUSD", item.amount);
- this.$set(item, "currentInvoiceAmountUSD", item.currentInvoiceAmount);
- this.$set(item, "unsettledAmountUSD", item.unsettledAmount);
- this.$set(item, "stlTtlAmountUSD", item.stlTtlAmount);
- this.$set(item, "currentStlAmountUSD", item.currentStlAmount);
- }
- return item;
- });
- });
- },
- // 新建账单
- newbillFun() {
- this.pageIds = [];
- this.isShow = false;
- this.editSave = false;
- // this.$refs.finstlbillsDetails
- },
- toAddEdit() {
- this.datekey = Date.now();
- this.isShow = false;
- this.editSave = false;
- },
- // 编辑
- editFun(row) {
- this.pageIds = [];
- this.data.forEach(item => {
- this.pageIds.push(item.id);
- });
- this.isShow = false;
- this.editSave = true;
- this.$nextTick(() => {
- this.$refs.finstlbillsDetails.finstlbillsDetailfun(row.id);
- });
- },
- // 详情的返回列表
- goBack() {
- // 初始化数据
- this.pageIds = [];
- // this.detailData = this.$options.data().detailData;
- if (JSON.stringify(this.$route.query) != "{}") {
- this.$router.$avueRouter.closeTag();
- this.$router.push({
- path: "/iosBasicData/finstlbills/index"
- });
- }
- this.isShow = true;
- this.onLoad(this.page, this.search);
- },
- // 添加
- rowSave(row, done, loading) {
- finstlbillsSubmit(row).then(
- () => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- done();
- },
- error => {
- loading();
- window.console.log(error);
- }
- );
- },
- // 保存
- rowUpdate(row, index, done, loading) {
- finstlbillsSubmit(row).then(
- () => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- done();
- },
- error => {
- loading();
- console.log(error);
- }
- );
- },
- // 删除
- rowDel(row) {
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- return finstlbillsRemove(row.id);
- })
- .then(() => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- });
- },
- // 批量删除
- handleDelete() {
- if (this.selectionList.length === 0) {
- this.$message.warning("请选择至少一条数据");
- return;
- }
- // 判断是否可以编辑别人业务 true 就没有权限
- if (this.ModifyOthersfun()) return;
- // 已经提交请核的提示不让删除
- let sumArr = [];
- const h = this.$createElement;
- for (let item of this.selectionList) {
- if (item.billStatus == 1) {
- sumArr.push(h("p", `序号${item.$index + 1}的数据已经确认对账请勿删除`));
- }
- }
- if (sumArr.length != 0) {
- this.$confirm("提示", {
- message: h("div", sumArr),
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- });
- return;
- }
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- return finstlbillsRemove(this.ids);
- })
- .then(() => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- this.$refs.crud.toggleSelection();
- });
- },
- // 判断是否可以编辑别人业务
- ModifyOthersfun() {
- let sumArr = [];
- const h = this.$createElement;
- // 判断是否有权限
- if (this.saberUserInfo.role_name.indexOf("允许修改他人业务") != -1) return false;
- // 当前登录人和选择的创建人对比是不是一个人
- for (let item of this.selectionList) {
- if (this.saberUserInfo.user_id != item.createUser) {
- sumArr.push(h("p", `你没有"允许修改他人业务"权限,请重新选择数据`));
- }
- }
- if (sumArr.length != 0) {
- this.$confirm("提示", {
- message: h("div", sumArr),
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).catch(err => {});
- return true;
- }
- },
- // 详情
- beforeOpen(done, type) {
- if (["edit", "view"].includes(type)) {
- finstlbillsDetail(this.form.id).then(res => {
- this.form = res.data.data;
- });
- }
- done();
- },
- searchReset() {
- this.query = {};
- this.onLoad(this.page);
- },
- // 搜索
- searchChange(params, done) {
- this.query = params;
- this.page.currentPage = 1;
- this.onLoad(this.page, params);
- done();
- },
- selectionChange(list) {
- this.selectionList = list;
- },
- selectionClear() {
- this.selectionList = [];
- this.$refs.crud.toggleSelection();
- this.$refs.crud.refreshTable();
- },
- currentChange(currentPage) {
- this.page.currentPage = currentPage;
- },
- sizeChange(pageSize) {
- this.page.pageSize = pageSize;
- },
- refreshChange() {
- this.onLoad(this.page, this.query);
- },
- onLoad(page, params = {}) {
- let obj = {
- ...Object.assign(params, this.query),
- businessType: "CHK",
- status: this.activeName != 4 ? this.activeName : "",
- billStatus: this.activeName == 4 ? 1 : ""
- };
- this.loading = true;
- finstlbillsList(page.currentPage, page.pageSize, obj).then(res => {
- res.data.data.records.forEach(item => {
- item.finStlBillsItemsList = [];
- });
- const data = res.data.data;
- this.page.total = data.total;
- this.data = data.records.map(item => {
- item.isApproved = item.isApproved + "";
- item.isSignfor = item.isSignfor + "";
- item.isChecked = item.isChecked + "";
- item.billStatus = item.billStatus + "";
- item.isCleared = item.isCleared + "";
- item.isInvoice = item.isInvoice + "";
- item.isTax = item.isTax + "";
- item.corpIsSigned = item.corpIsSigned + "";
- return item;
- });
- this.loading = false;
- this.selectionClear();
- });
- },
- // 获取字典数据
- dictionaryfun() {
- // 全部是否
- getWorkDicts("ifInvoice").then(res => {
- this.findObject(this.option.column, "isApproved").dicData = res.data.data;
- this.findObject(this.option.column, "isSignfor").dicData = res.data.data;
- this.findObject(this.option.column, "isCleared").dicData = res.data.data;
- this.findObject(this.option.column, "billStatus").dicData = res.data.data;
- });
- // 对账状态字典
- getWorkDicts("los_check_status").then(res => {
- this.findObject(this.option.column, "isChecked").dicData = res.data.data;
- });
- // 是否开发票
- getWorkDicts("invoice_los").then(res => {
- this.findObject(this.option.column, "isInvoice").dicData = res.data.data;
- });
- // 是否
- getWorkDicts("ifInvoice").then(res => {
- // this.findObject(this.option.column, "corpIsSigned").dicData = res.data.data
- this.findObject(this.option.column, "isTax").dicData = res.data.data;
- });
- },
- //自定义列保存
- async saveColumnTwo(ref, option, optionBack, code) {
- /**
- * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
- * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
- * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
- */
- const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
- if (inSave) {
- this.$message.success("保存成功");
- //关闭窗口
- this.$refs[ref].$refs.dialogColumn.columnBox = false;
- }
- },
- //自定义列重置
- async resetColumnTwo(ref, option, optionBack, code) {
- this[option] = this[optionBack];
- const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
- if (inSave) {
- this.$message.success("重置成功");
- this.$refs[ref].$refs.dialogColumn.columnBox = false;
- }
- },
- // 更改表格颜色
- 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;
- }
- }
- };
- </script>
- <style scoped>
- ::v-deep#out-table .back-one {
- background: #ecf5ff !important;
- text-align: center;
- }
- ::v-deep#out-table .back-two {
- background: #ecf5ff !important;
- text-align: center;
- }
- /deep/ .el-col-md-8 {
- width: 24.33333%;
- }
- .pointerClick {
- cursor: pointer;
- color: #1e9fff;
- }
- ::v-deep .el-table__expanded-cell[class*="cell"] {
- padding: 0px 0px 0px 136px !important;
- }
- </style>
|