123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689 |
- <template>
- <div class="invoiceApply pagePadding">
- <ex-table
- v-loading="loading"
- v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
- :table="table"
- :data="tableData"
- :columns="columns"
- :page="pageInfo"
- :size="size"
- @page-curr-change="handlePageChange"
- @page-size-change="handleSizeChange"
- @screen-reset="
- pageInfo.curr = 1;
- parmValue.page = 1;
- searchList();
- "
- @screen-submit="
- pageInfo.curr = 1;
- parmValue.page = 1;
- searchList();
- "
- >
- <template #table-header="{}">
- <div style="width: 100%">
- <el-row style="padding: 0 0 10px 80px">
- <el-col :span="24">
- <el-col :span="12" style="width: 470px">
- <el-select
- v-model="code"
- multiple
- filterable
- remote
- :multiple-limit="1"
- reserve-keyword
- :size="searchSize"
- style="width: 100%"
- placeholder="公司名称"
- :remote-method="remoteMethod"
- :loading="selectLoading"
- @change="selectChange"
- >
- <el-option
- v-for="item in activeOptions"
- :key="item.companyNo"
- :label="item.companyName"
- :value="item.companyNo"
- />
- </el-select>
- </el-col>
- <el-col
- :span="4"
- style="width: 66px; float: right"
- >
- <el-button
- :size="searchSize"
- type="primary"
- style="float: right"
- @click="searchList"
- >
- 刷新
- </el-button>
- </el-col>
- <el-col
- :span="4"
- style="width: 66px; float: right"
- >
- <el-button
- type="warning"
- class="fr"
- :size="searchSize"
- @click="restSearch"
- >
- 重置
- </el-button>
- </el-col>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="24">
- <el-col :span="4" style="width: 170px">
- <el-select
- v-model="parmValue.status"
- clearable
- :size="searchSize"
- style="width: 100%"
- placeholder="发票申请状态"
- @change="
- pageInfo.curr = 1;
- parmValue.page = 1;
- searchList();
- "
- >
- <el-option
- v-for="item in statusOptions"
- :key="item.id"
- :label="item.label"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </el-col>
- <el-col :span="7" style="width: 200px; padding: 0 0 0 10px">
- <el-select
- style="width: 100%"
- :size="searchSize"
- v-model="parmValue.type_check"
- clearable
- placeholder="开票类型"
- @change="
- pageInfo.curr = 1;
- parmValue.page = 1;
- searchList();
- "
- >
- <el-option
- v-for="item in billType"
- :key="item.code"
- :label="item.name"
- :value="item.code"
- >
- </el-option>
- </el-select>
- </el-col>
- <el-col :span="6" style="width: 306px; padding: 0 0 0 10px">
- <period-date-picker
- :start="parmValue.starttime"
- :end="parmValue.endtime"
- :type="1"
- :width="'135px'"
- :size="searchSize"
- @timeReturned="timeReturned($event)"
- ></period-date-picker>
- </el-col>
- <el-col :span="3" style="width: 66px; float: right">
- <el-button
- v-if="powers.some((item) => item == '003')"
- :size="searchSize"
- type="success"
- style="float: right"
- @click="openModal('add', '003', '0', '0')"
- >
- 添加
- </el-button>
- </el-col>
- <el-col :span="3" style="width: 54px; float: right">
- <el-button
- :size="searchSize"
- type="primary"
- style="float: right"
- icon="el-icon-search"
- @click="searchList"
- /></el-col>
- </el-col>
- </el-row>
- </div>
- </template>
- <template #status="{ scope }">
- <el-tag
- :type="
- scope.row.status == '0'
- ? 'info'
- : scope.row.status == '5'
- ? 'success'
- : scope.row.status == '2'
- ? 'danger'
- : ''
- "
- size="mini"
- v-text="
- (statusOptions.find((item) => item.id == scope.row.status) || {})
- .label || '--'
- "
- ></el-tag>
- </template>
- <template #type_check="{ scope }">
- <el-tag
- size="mini"
- v-text="
- (billType.find((item) => item.code == scope.row.type_check) || {})
- .name || '--'
- "
- />
- </template>
- <template #operation="{ scope }">
- <el-tooltip
- v-if="powers.some((item) => item == '007')"
- effect="dark"
- content="详情"
- placement="top"
- >
- <i
- class="el-icon-view tb-icon"
- @click="
- openModal(scope.row.id, '007', scope.row.invNo, scope.row.status)
- "
- ></i>
- </el-tooltip>
- <el-tooltip
- v-if="
- (powers.some((item) => item == '005') &&
- scope.row.status === '0') ||
- (powers.some((item) => item == '005') && scope.row.status === '2')
- "
- effect="dark"
- content="修改"
- placement="top"
- >
- <i
- class="el-icon-edit tb-icon"
- @click="
- openModal(scope.row.id, '005', scope.row.invNo, scope.row.status)
- "
- ></i>
- </el-tooltip>
- <el-tooltip
- v-if="
- (powers.some((item) => item == '030') &&
- scope.row.status === '0') ||
- (powers.some((item) => item == '030') && scope.row.status === '2')
- "
- effect="dark"
- content="发起审核流程"
- placement="top"
- >
- <i
- class="el-icon-video-play tb-icon"
- @click="ApplyPay(scope.row.invNo)"
- ></i>
- </el-tooltip>
- <el-tooltip
- v-if="
- powers.some((item) => item == '029') && scope.row.status === '1'
- "
- effect="dark"
- content="财务审核"
- placement="top"
- >
- <i
- class="el-icon-finished tb-icon"
- @click="
- openModal(scope.row.id, '029', scope.row.invNo, scope.row.status)
- "
- ></i>
- </el-tooltip>
- <el-tooltip
- v-if="
- powers.some((item) => item == '036') && scope.row.status === '3'
- "
- effect="dark"
- content="财务开票"
- placement="top"
- >
- <i
- class="el-icon-printer tb-icon"
- @click="
- openModal(scope.row.id, '036', scope.row.invNo, scope.row.status)
- "
- ></i>
- </el-tooltip>
- <el-tooltip
- v-if="
- powers.some((item) => item == '037') && scope.row.status === '4'
- "
- effect="dark"
- content="填写物流"
- placement="top"
- >
- <i
- class="el-icon-truck tb-icon"
- @click="
- openModal(scope.row.id, '037', scope.row.invNo, scope.row.status)
- "
- ></i>
- </el-tooltip>
- <el-tooltip
- v-if="
- (powers.some((item) => item == '027') &&
- scope.row.status === '0') ||
- (powers.some((item) => item == '027') && scope.row.status === '2')
- "
- effect="dark"
- content="申请取消"
- placement="top"
- >
- <i
- class="el-icon-video-pause tb-icon"
- @click="changeStatus(scope.row.invNo)"
- ></i>
- </el-tooltip>
- </template>
- </ex-table>
- <no-auth v-else></no-auth>
- <!-- 弹窗 新增/修改 -->
- <add-edit1
- :id="modelId"
- :show-model="showModel1"
- :is-detail="isDetail"
- :invNo="invNo"
- :status="status"
- @refresh="searchList"
- @cancel="cancel"
- />
- <!-- 财务审核 -->
- <add-edit2
- :id="modelId"
- :show-model="showModel2"
- :is-detail="isDetail"
- :status="status"
- :invNo="invNo"
- @refresh="searchList"
- @cancel="cancel"
- />
- <!-- 财务开票 -->
- <add-edit3
- :id="modelId"
- :show-model="showModel3"
- :is-detail="isDetail"
- :status="status"
- :invNo="invNo"
- @refresh="searchList"
- @cancel="cancel"
- />
- <!-- 填写物流 -->
- <add-edit4
- :id="modelId"
- :show-model="showModel4"
- :is-detail="isDetail"
- :status="status"
- :invNo="invNo"
- @refresh="searchList"
- @cancel="cancel"
- />
- </div>
- </template>
- <script>
- import ExTable from "@/components/ExTableNew.vue";
- import addEdit1 from "./addEdit1";
- import addEdit2 from "./addEdit2";
- import addEdit3 from "./addEdit3";
- import addEdit4 from "./addEdit4";
- import asyncRequest from "@/apis/service/InvoiceSales/invoiceApply";
- import mixinPage from "@/mixins/elPaginationHandle";
- import { mapGetters } from "vuex";
- import PeriodDatePicker from "@/components/PeriodDatePicker";
- import resToken from "@/mixins/resToken";
- export default {
- name: "invoiceApply",
- mixins: [mixinPage, resToken],
- components: {
- ExTable,
- addEdit1,
- addEdit2,
- addEdit3,
- addEdit4,
- PeriodDatePicker,
- },
- computed: {
- //组件SIZE设置
- ...mapGetters(["tablebtnSize", "searchSize", "size"]),
- powers() {
- let tran =
- this.$store.getters.btnList.find(
- (item) => item.menu_route == "invoiceApply"
- ) || {};
- if (tran && tran.action && tran.action.length > 0) {
- return tran.action;
- } else {
- return [];
- }
- },
- },
- data() {
- return {
- showModel1: false,
- showModel2: false,
- showModel3: false,
- showModel4: false,
- isDetail: false,
- invNo: "0",
- status: "0",
- modelId: 0,
- selectLoading: false,
- billType: [
- {
- code: "1",
- name: "确认单开票",
- },
- {
- code: "2",
- name: "资金开票-资金未认领",
- },
- {
- code: "3",
- name: "资金开票-资金已认领",
- },
- ],
- activeOptions: [],
- // 状态
- statusOptions: [
- { id: 0, label: "待发起审核" },
- { id: 1, label: "待财务审核" },
- { id: 2, label: "审核驳回" },
- { id: 3, label: "待财务开票" },
- { id: 4, label: "待填写物流" },
- { id: 5, label: "开票已完成" },
- ],
- name: "",
- code: [],
- loading: true,
- formValue: {
- company: "", // 账户
- page: 1, // 页码
- size: 100, // 每页显示条数
- },
- parmValue: {
- companyNo: "",
- status: "",
- type_check: "",
- starttime: "",
- endtime: "",
- page: 1, // 页码
- size: 15, // 每页显示条数
- },
- // 表格 - 数据
- tableData: [],
- // 表格 - 参数
- table: {
- stripe: true,
- border: true,
- _defaultHeader_: ["setcol"],
- },
- // 表格 - 分页
- pageInfo: {
- size: 15,
- curr: 1,
- total: 0,
- },
- // 表格 - 列参数
- columns: [
- {
- prop: "invNo",
- label: "发票编号",
- width: "180px",
- },
- {
- prop: "inv_in",
- label: "客户企业编码",
- width: "130px",
- },
- {
- prop: "company",
- label: "客户企业名称",
- "min-width": "180px",
- },
- {
- prop: "kp_company",
- label: "销售方开票公司名称",
- "min-width": "180px",
- },
- {
- prop: "inv_value",
- label: "发票额度",
- width: "120px",
- },
- {
- prop: "type_check",
- label: "开票类型",
- _slot_: "type_check",
- width: "150px",
- },
- {
- prop: "apply_name",
- label: "申请人",
- width: "85px",
- },
- {
- prop: "status",
- label: "状态",
- _slot_: "status",
- width: "120px",
- },
- {
- prop: "addtime",
- label: "申请时间",
- sortable: true,
- width: "150px",
- },
- {
- prop: "",
- label: "操作",
- fixed: "right",
- _noset_: true,
- width: "150px",
- _slot_: "operation",
- },
- ],
- };
- },
- mounted() {
- this.searchList();
- },
- methods: {
- async selectChange() {
- let arr = JSON.parse(JSON.stringify(this.code));
- this.parmValue.companyNo = arr.join(",");
- this.parmValue.page = 1;
- await this.searchList();
- },
- restSearch() {
- // 表格 - 分页
- this.pageInfo = {
- size: 15,
- curr: 1,
- total: 0,
- };
- this.parmValue = {
- companyNo: "",
- status: "",
- type_check: "",
- starttime: "",
- endtime: "",
- page: 1, // 页码
- size: 15, // 每页显示条数
- };
- this.searchList();
- },
- async timeReturned(e) {
- if (e.startTime !== "") {
- this.parmValue.starttime = e.startTime;
- } else {
- this.parmValue.starttime = "";
- }
- if (e.endTime !== "") {
- this.parmValue.endtime = e.endTime;
- } else {
- this.parmValue.endtime = "";
- }
- if (this.parmValue.starttime !== "" && this.parmValue.endtime !== "") {
- this.parmValue.page = 1;
- await this.searchList();
- }
- },
- cancel() {
- this.showModel1 = false;
- this.showModel2 = false;
- this.showModel3 = false;
- this.showModel4 = false;
- },
- // 新建/编辑/详情
- openModal(id, isDetail, invNo, status) {
- this.modelId = id;
- this.isDetail = isDetail;
- this.invNo = invNo;
- this.status = status;
- if (isDetail === "003") {
- this.showModel1 = true;
- } else if (isDetail === "005") {
- this.showModel1 = true;
- } else if (isDetail === "007") {
- this.showModel1 = true;
- } else if (isDetail === "029") {
- this.showModel2 = true;
- } else if (isDetail === "036") {
- this.showModel3 = true;
- } else if (isDetail === "037") {
- this.showModel4 = true;
- }
- },
- /**
- * 启用/禁用
- * @param {String} invNo invNo
- */
- async changeStatus(invNo) {
- await this.$confirm(`确定要取消申请?`, {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(async () => {
- const model = {
- invNo: invNo,
- };
- const res = await asyncRequest.delete(model);
- if (res && res.code === 0) {
- this.$notify.success({
- title: "申请取消成功",
- message: "",
- });
- this.searchList();
- } else if (res && res.code >= 100 && res.code <= 104) {
- await this.logout();
- } else {
- this.$message.warning(res.message);
- }
- })
- .catch(() => {
- console.log("取消");
- });
- },
- /**
- * 发起审核流程
- * @param {String} invNo 发票编号
- */
- async ApplyPay(invNo) {
- await this.$confirm(`确定发起审核流程?`, {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(async () => {
- const model = {
- invNo: invNo,
- status: "1",
- };
- const res = await asyncRequest.status(model);
- if (res && res.code === 0) {
- this.$notify.success({
- title: "发起审核流程成功!",
- message: "",
- });
- this.searchList();
- } else if (res && res.code >= 100 && res.code <= 104) {
- await this.logout();
- } else {
- this.$message.warning(res.message);
- }
- })
- .catch(() => {
- console.log("取消");
- });
- },
- // 刷新表格
- async searchList() {
- if (this.parmValue.starttime !== "" && this.parmValue.endtime === "") {
- this.$message.error("结束时间不能为空!");
- return;
- }
- if (this.parmValue.starttime === "" && this.parmValue.endtime !== "") {
- this.$message.error("开始时间不能为空!");
- return;
- }
- this.loading = true;
- const res = await asyncRequest.list(this.parmValue);
- if (res && res.code === 0 && res.data) {
- this.tableData = res.data.list;
- this.pageInfo.total = Number(res.data.count);
- } else if (res && res.code >= 100 && res.code <= 104) {
- await this.logout();
- } else {
- this.tableData = [];
- this.pageInfo.total = 0;
- }
- this.loading = false;
- },
- async remoteMethod(query) {
- this.selectLoading = true;
- if (query !== "") {
- this.activeOptions = [];
- this.formValue.company = query;
- const res = await asyncRequest.clist(this.formValue);
- if (res && res.code === 0 && res.data && res.data.list) {
- this.activeOptions = res.data.list;
- } else if (res && res.code >= 100 && res.code <= 104) {
- await this.logout();
- } else {
- this.$message.warning(res.message);
- }
- } else {
- this.activeOptions = [];
- }
- this.selectLoading = false;
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- </style>
|