|
@@ -10,6 +10,7 @@
|
|
|
:size="size"
|
|
|
@page-curr-change="handlePageChange"
|
|
|
@page-size-change="handleSizeChange"
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
@screen-reset="
|
|
|
pageInfo.curr = 1;
|
|
|
parmValue.page = 1;
|
|
@@ -24,24 +25,39 @@
|
|
|
<template #table-header="{}">
|
|
|
<div style="width: 100%">
|
|
|
<el-row style="padding: 0 0 0 80px">
|
|
|
- <el-col :span="4" style="width: 301px; padding: 0 0 0px 0px">
|
|
|
+ <el-col :span="4" style="width: 360px; padding: 0 10px 0 0px">
|
|
|
<period-date-picker
|
|
|
- :start="parmValue[mapFields.createStart]"
|
|
|
- :end="parmValue[mapFields.createEnd]"
|
|
|
- :width="'134px'"
|
|
|
+ :start="parmValue.create_start"
|
|
|
+ :end="parmValue.create_end"
|
|
|
+ :width="'164px'"
|
|
|
:size="searchSize"
|
|
|
+ @timeReturned="handleTime"
|
|
|
placeholder="创建"
|
|
|
- @timeReturned="evt => handleTime(evt,'create')"
|
|
|
/>
|
|
|
</el-col>
|
|
|
|
|
|
+ <!-- <el-col :span="3" style="margin-right:10px">
|
|
|
+ <el-select v-model="parmValue.supplier" size="mini" placeholder="供应商企业" style="width:100%"
|
|
|
+ @change=" pageInfo.curr = 1;
|
|
|
+ parmValue.page = 1;
|
|
|
+ searchList();"
|
|
|
+ />
|
|
|
+ </el-col> -->
|
|
|
+
|
|
|
<el-col :span="3" style="margin-right:10px">
|
|
|
+ <el-input v-model="parmValue.reqCode" size="mini" placeholder="需求订单编号" style="width:100%"
|
|
|
+ @change="pageInfo.curr = 1;
|
|
|
+ parmValue.page = 1;
|
|
|
+ searchList();"
|
|
|
+ />
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="4" style="width: 150px;margin-right:10px">
|
|
|
<el-select
|
|
|
- style="width:100%"
|
|
|
:size="searchSize"
|
|
|
- v-model="parmValue[mapFields.status]"
|
|
|
+ v-model="parmValue.invoiceStatus"
|
|
|
clearable
|
|
|
- placeholder="申请状态"
|
|
|
+ placeholder="开票状态"
|
|
|
@change="
|
|
|
pageInfo.curr = 1;
|
|
|
parmValue.page = 1;
|
|
@@ -50,7 +66,7 @@
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in statusList"
|
|
|
- :key="item.id"
|
|
|
+ :key="item.ids"
|
|
|
:label="item.label"
|
|
|
:value="item.id"
|
|
|
>
|
|
@@ -58,23 +74,6 @@
|
|
|
</el-select>
|
|
|
</el-col>
|
|
|
|
|
|
- <el-col :span="4">
|
|
|
- <el-select
|
|
|
- style="width:100%"
|
|
|
- :size="searchSize"
|
|
|
- v-model="parmValue[mapFields.demandCompany]"
|
|
|
- clearable
|
|
|
- placeholder="需求企业"
|
|
|
- @change="
|
|
|
- pageInfo.curr = 1;
|
|
|
- parmValue.page = 1;
|
|
|
- searchList();
|
|
|
- "
|
|
|
- >
|
|
|
- <el-option />
|
|
|
- </el-select>
|
|
|
- </el-col>
|
|
|
-
|
|
|
<el-col :span="3" style="width: 66px; float: right">
|
|
|
<el-button
|
|
|
:size="searchSize"
|
|
@@ -97,47 +96,34 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
|
|
|
- <el-row style="margin-top: 10px">
|
|
|
- <el-col :span="4" style="width: 301px; padding: 0 0 0px 0px">
|
|
|
+ <el-row style="margin-top:10px">
|
|
|
+ <el-col :span="4" style="width: 360px; padding: 0 10px 0 0px">
|
|
|
<period-date-picker
|
|
|
- :start="parmValue[mapFields.openStart]"
|
|
|
- :end="parmValue[mapFields.openEnd]"
|
|
|
- :width="'134px'"
|
|
|
+ :start="parmValue.open_start"
|
|
|
+ :end="parmValue.open_end"
|
|
|
+ :width="'164px'"
|
|
|
:size="searchSize"
|
|
|
- @timeReturned="evt => handleTime(evt,'open')"
|
|
|
+ @timeReturned="() => handleTime(true)"
|
|
|
placeholder="开票"
|
|
|
/>
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="4" style="margin-right:10px">
|
|
|
- <el-input
|
|
|
- clearable
|
|
|
- :size="searchSize"
|
|
|
- placeholder="开票申请编号"
|
|
|
- v-model="parmValue[mapFields.openInviceNo]"
|
|
|
- @change="
|
|
|
- pageInfo.curr = 1;
|
|
|
- parmValue.page = 1;
|
|
|
- searchList();
|
|
|
- "
|
|
|
- />
|
|
|
+ <el-input size="mini" placeholder="发票代码" v-model="parmValue.invoiceCode"
|
|
|
+ @change=" pageInfo.curr = 1;
|
|
|
+ parmValue.page = 1;
|
|
|
+ searchList();" />
|
|
|
</el-col>
|
|
|
|
|
|
- <el-col :span="4" style="margin-right:10px">
|
|
|
- <el-input
|
|
|
- clearable
|
|
|
- :size="searchSize"
|
|
|
- placeholder="需求订单编号"
|
|
|
- v-model="parmValue[mapFields.demandOrderNo]"
|
|
|
- @change="
|
|
|
- pageInfo.curr = 1;
|
|
|
- parmValue.page = 1;
|
|
|
- searchList();
|
|
|
- "
|
|
|
- />
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-input size="mini" placeholder="发票号码" v-model="parmValue.invoiceNum"
|
|
|
+ @change=" pageInfo.curr = 1;
|
|
|
+ parmValue.page = 1;
|
|
|
+ searchList();"
|
|
|
+ />
|
|
|
</el-col>
|
|
|
|
|
|
- <el-col :span="3" style="width: 113px; float: right">
|
|
|
+ <el-col :span="3" style="width:115px;float: right">
|
|
|
<el-button
|
|
|
:size="searchSize"
|
|
|
type="primary"
|
|
@@ -152,55 +138,50 @@
|
|
|
type="warning"
|
|
|
class="fr"
|
|
|
:size="searchSize"
|
|
|
- @click="visible = true"
|
|
|
+ @click="onBatchApprovalInvoice"
|
|
|
>
|
|
|
- 批量审批发票
|
|
|
+ 批量审核发票
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
|
|
|
<el-row style="margin-top:10px">
|
|
|
<el-col :span="4" style="margin-right:10px">
|
|
|
- <el-input v-model="parmValue[mapFields.invoiceCode]" size="mini" placeholder="发票代码" @change="
|
|
|
- pageInfo.curr = 1;
|
|
|
- parmValue.page = 1;
|
|
|
- searchList();
|
|
|
- " />
|
|
|
- </el-col>
|
|
|
-
|
|
|
- <el-col :span="4" style="margin-right:10px">
|
|
|
- <el-input
|
|
|
- clearable
|
|
|
- :size="searchSize"
|
|
|
- placeholder="发票号码"
|
|
|
- v-model="parmValue[mapFields.invoiceNumber]"
|
|
|
- @change="
|
|
|
- pageInfo.curr = 1;
|
|
|
- parmValue.page = 1;
|
|
|
- searchList();
|
|
|
- "
|
|
|
- />
|
|
|
+ <el-select v-model="parmValue.invoice_type" size="mini" placeholder="发票类型" style="width:100%"
|
|
|
+ @change=" pageInfo.curr = 1;
|
|
|
+ parmValue.page = 1;
|
|
|
+ searchList();"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="type in invoiceTypeList"
|
|
|
+ :key="type.value"
|
|
|
+ :value="type.value"
|
|
|
+ :label="type.label"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="4">
|
|
|
- <el-select
|
|
|
- style="width:100%"
|
|
|
- :size="searchSize"
|
|
|
- v-model="parmValue[mapFields.invoiceType]"
|
|
|
- clearable
|
|
|
- placeholder="发票类型"
|
|
|
- @change="
|
|
|
- pageInfo.curr = 1;
|
|
|
- parmValue.page = 1;
|
|
|
- searchList();
|
|
|
- "
|
|
|
- >
|
|
|
- <el-option />
|
|
|
- </el-select>
|
|
|
+ <el-input size="mini" placeholder="发票申请编号" v-model="parmValue.invNo"
|
|
|
+ @change=" pageInfo.curr = 1;
|
|
|
+ parmValue.page = 1;
|
|
|
+ searchList();"
|
|
|
+ />
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
</template>
|
|
|
+
|
|
|
+ <template #invoiceType="{ scope }">
|
|
|
+ <el-tag size="mini">
|
|
|
+ {{(invoiceTypeList.find(({value}) => value === scope.row.invoiceType) || {}).label || '--'}}
|
|
|
+ </el-tag>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template #demandOrder={scope}>{{
|
|
|
+ (scope.row.orderinvoice || {}).reqCode || '--'
|
|
|
+ }}</template>
|
|
|
+
|
|
|
<template #status="{ scope }">
|
|
|
<el-tag
|
|
|
:size="tablebtnSize"
|
|
@@ -214,22 +195,7 @@
|
|
|
"
|
|
|
></el-tag>
|
|
|
</template>
|
|
|
- <template #good_name="{ scope }">
|
|
|
- <span>{{ scope.row.good_name }}</span>
|
|
|
- <span
|
|
|
- v-for="(si, sii) in scope.row.specinfo"
|
|
|
- :key="si.spec_value_id + sii"
|
|
|
- >
|
|
|
- {{ sii == 0 ? "__" : "--" }}{{ si.spec_name }}[{{
|
|
|
- si.spec_value_name
|
|
|
- }}]</span
|
|
|
- >
|
|
|
- </template>
|
|
|
- <template #can="{ scope }">
|
|
|
- <span v-for="(si, sii) in scope.row.can" :key="si.id + sii">
|
|
|
- <span v-if="sii !== 0">_</span>{{ si.name }}</span
|
|
|
- >
|
|
|
- </template>
|
|
|
+
|
|
|
<template #operation="{ scope }">
|
|
|
<el-tooltip
|
|
|
v-if="powers.some((i) => i == '007')"
|
|
@@ -237,79 +203,86 @@
|
|
|
content="详情"
|
|
|
placement="top"
|
|
|
>
|
|
|
- <i class="el-icon-view tb-icon" @click="getRouter('invoiceApplyDetail', scope.row.bargainNo )" />
|
|
|
+ <i
|
|
|
+ class="el-icon-view tb-icon"
|
|
|
+
|
|
|
+ @click="getRouter('bargainListDetail', scope.row.bargainNo )"
|
|
|
+ ></i>
|
|
|
</el-tooltip>
|
|
|
</template>
|
|
|
</ex-table>
|
|
|
- </div>
|
|
|
|
|
|
- <ApprovalModal :visible.sync="visible" />
|
|
|
+ <invoice-modal :visible.sync="visible" @confirm="handleBatchApprovalInvoice" />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
import mixinPage from "@/mixins/elPaginationHandle";
|
|
|
import resToken from "@/mixins/resToken";
|
|
|
-import asyncRequest from "@/apis/service/customerService/invoiceApproval";
|
|
|
+import asyncRequest from "@/apis/service/platformService/invoice";
|
|
|
import companyHelper from "@/mixins/companyHelper"
|
|
|
import { listCol, statusList } from "./columns";
|
|
|
-import ApprovalModal from "./components/approvalModal.vue";
|
|
|
-import { createEmptyStringObject } from '@/utils/static';
|
|
|
import { mapGetters } from "vuex";
|
|
|
+import { invoiceTypeList } from '@/assets/js/statusList';
|
|
|
+import InvoiceModal from "./components/invoice-modal.vue"
|
|
|
|
|
|
-const mapFields = {
|
|
|
- //创建时间开始&结束
|
|
|
- createStart:'createStart',
|
|
|
- createEnd:'createEnd',
|
|
|
- //开票时间开始&结束
|
|
|
- openStart:'openStart',
|
|
|
- openEnd:'openEnd',
|
|
|
- //需求企业
|
|
|
- demandCompany:'demandCompany',
|
|
|
- //发票号码
|
|
|
- invoiceNumber:'invoiceNumber',
|
|
|
- //发票代码
|
|
|
- invoiceCode:'invoiceCode',
|
|
|
- //发票类型
|
|
|
- invoiceType:'invoiceType',
|
|
|
- //开票申请编号
|
|
|
- openInviceNo:'openInviceNo',
|
|
|
- //需求订单编号
|
|
|
- demandOrderNo:'demandOrderNo',
|
|
|
- //申请状态
|
|
|
- status:'status'
|
|
|
-}
|
|
|
|
|
|
-const mapDateFields = {
|
|
|
- create:'创建',
|
|
|
- open:'开票'
|
|
|
-}
|
|
|
+/**
|
|
|
+ * @props
|
|
|
+ create_start 创建开始时间
|
|
|
+ create_end 创建结束时间
|
|
|
+ open_start 开票开始时间
|
|
|
+ open_end 开票结束时间
|
|
|
+ supplier 供应商企业
|
|
|
+ reqCode 需求订单编号
|
|
|
+ invoiceStatus 发票状态
|
|
|
+ invoiceCode 发票代码,
|
|
|
+ invoiceNum 发票号码,
|
|
|
+ invoice_type 发票类型
|
|
|
+ invNo 发票申请编号
|
|
|
+*/
|
|
|
+
|
|
|
|
|
|
export default {
|
|
|
name: "bargainList",
|
|
|
mixins: [mixinPage, resToken, companyHelper],
|
|
|
- components:{ApprovalModal},
|
|
|
+ components:{InvoiceModal},
|
|
|
computed: {
|
|
|
...mapGetters(["tablebtnSize", "searchSize", "size"]),
|
|
|
powers() {
|
|
|
const tran =
|
|
|
- this.$store.getters.btnList.find((item) => item.menu_route == "invoiceApproval") || {};
|
|
|
+ this.$store.getters.btnList.find(
|
|
|
+ (item) => item.menu_route == "invoice"
|
|
|
+ ) || {};
|
|
|
const { action } = tran ?? {};
|
|
|
return action ?? [];
|
|
|
},
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- mapFields,
|
|
|
- visible:false,
|
|
|
+ selected:[],
|
|
|
+ select: "1",
|
|
|
+ s_input: "",
|
|
|
+ invoiceTypeList,
|
|
|
customerCode: [], //客户公司code
|
|
|
statusList,
|
|
|
sitem: null,
|
|
|
loading: false,
|
|
|
- showModel: false,
|
|
|
+ visible: false,
|
|
|
isDetail: false,
|
|
|
modelId: 0,
|
|
|
parmValue: {
|
|
|
- ...createEmptyStringObject(mapFields),
|
|
|
+ create_start:"", // 创建开始时间
|
|
|
+ create_end:"", // 创建结束时间
|
|
|
+ open_start:"", // 开票开始时间
|
|
|
+ open_end:"", // 开票结束时间
|
|
|
+ supplier:"", // 供应商企业
|
|
|
+ reqCode:"", // 需求订单编号
|
|
|
+ invoiceStatus:"", // 发票状态
|
|
|
+ invoiceCode:"", // 发票代码,
|
|
|
+ invoiceNum:"", // 发票号码,
|
|
|
+ invoice_type:"", // 发票类型
|
|
|
+ invNo:"", // 发票申请编号
|
|
|
page: 1, // 页码
|
|
|
size: 15, // 每页显示条数
|
|
|
},
|
|
@@ -339,13 +312,6 @@ export default {
|
|
|
this.parmValue = JSON.parse(back);
|
|
|
console.log(this.parmValue)
|
|
|
const {page,size}=this.parmValue;
|
|
|
- // this.parmValue.start = start || last_start;
|
|
|
- // this.parmValue.end = end || last_end;
|
|
|
-
|
|
|
- // if(this.parmValue.customer_code.length>0){
|
|
|
- // this.customerCode = [this.parmValue.customer_code] ;
|
|
|
- // }
|
|
|
-
|
|
|
this.pageInfo= {
|
|
|
size: size,
|
|
|
curr: page,
|
|
@@ -362,8 +328,38 @@ export default {
|
|
|
}
|
|
|
this.searchList();
|
|
|
},
|
|
|
-
|
|
|
methods: {
|
|
|
+ async handleBatchApprovalInvoice(data){
|
|
|
+ const { code } = await asyncRequest.batch({
|
|
|
+ idArr:this.selected.map(({id}) => id),
|
|
|
+ ...data
|
|
|
+ })
|
|
|
+
|
|
|
+ if(code !== 1) return
|
|
|
+ this.visible = false
|
|
|
+ this.searchList()
|
|
|
+ },
|
|
|
+ onBatchApprovalInvoice(){
|
|
|
+ if(this.selected.length === 0){
|
|
|
+ this.$message.warning('至少选择一张状态为 "待确认" 的发票申请')
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ const isOK = this.selected.every(({status}) => String(status) === "1")
|
|
|
+
|
|
|
+ if(!isOK){
|
|
|
+ this.$message.warning('请选择状态为 "待确认" 的发票申请')
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ this.visible = true
|
|
|
+ // console.log(this.selected)
|
|
|
+ },
|
|
|
+ handleSelectionChange(list) {
|
|
|
+ console.log(list)
|
|
|
+ this.selected = list
|
|
|
+ },
|
|
|
getRouter(toRouter, queryId){
|
|
|
if (toRouter && queryId) {
|
|
|
let model = {
|
|
@@ -392,16 +388,20 @@ export default {
|
|
|
this.select = "1";
|
|
|
this.s_input = "";
|
|
|
this.parmValue = {
|
|
|
- bidsNo: "", // 反馈编号
|
|
|
- infoNo: "", // 竞价单编号
|
|
|
- bargainNo: "", //议价编号
|
|
|
- status: "", // 状态
|
|
|
- start: "",
|
|
|
- end: "",
|
|
|
+ create_start:"", // 创建开始时间
|
|
|
+ create_end:"", // 创建结束时间
|
|
|
+ open_start:"", // 开票开始时间
|
|
|
+ open_end:"", // 开票结束时间
|
|
|
+ supplier:"", // 供应商企业
|
|
|
+ reqCode:"", // 需求订单编号
|
|
|
+ invoiceStatus:"", // 发票状态
|
|
|
+ invoiceCode:"", // 发票代码,
|
|
|
+ invoiceNum:"", // 发票号码,
|
|
|
+ invoice_type:"", // 发票类型
|
|
|
+ invNo:"", // 发票申请编号
|
|
|
page: 1, // 页码
|
|
|
size: 15, // 每页显示条数
|
|
|
- company_name:"",
|
|
|
- };
|
|
|
+ }
|
|
|
// 表格 - 分页
|
|
|
this.pageInfo = {
|
|
|
size: 15,
|
|
@@ -417,68 +417,17 @@ export default {
|
|
|
this.isDetail = isDetail;
|
|
|
this.sitem = sitem;
|
|
|
},
|
|
|
- async deleteById(id, status) {
|
|
|
- await this.$confirm("确定要删除?", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
- }).then(async () => {
|
|
|
- const model = {
|
|
|
- id: id,
|
|
|
- status: status + '' === "1" ? "0" : "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() {
|
|
|
- return
|
|
|
-
|
|
|
- for(const field of Object.keys(mapDateFields)){
|
|
|
- const startField = `${field}Start`
|
|
|
- const endField = `${field}End`
|
|
|
-
|
|
|
- if (
|
|
|
- (this.parmValue[startField] !== "" && this.parmValue[endField] === "") ||
|
|
|
- (this.parmValue[startField] === "" && this.parmValue[endField] !== "")
|
|
|
- ) {
|
|
|
- this.$message.warning(`${mapDateFields[field]}时间区间不完整!`);
|
|
|
- return;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
this.loading = true;
|
|
|
- this.parmValue.bargainNo = this.select === "1" ? this.s_input : "";
|
|
|
- this.parmValue.bidsNo = this.select === "2" ? this.s_input : "";
|
|
|
- this.parmValue.infoNo = this.select === "3" ? this.s_input : "";
|
|
|
- this.parmValue.company_name = this.select === "4" ? this.s_input : "";
|
|
|
-
|
|
|
const res = await asyncRequest.list({
|
|
|
...this.parmValue,
|
|
|
- companyNo: this.currentCompany,
|
|
|
- customer_code: Array.isArray(this.parmValue.customer_code) ? this.parmValue.customer_code[0] : "",
|
|
|
- noRelation: true
|
|
|
+ inv_type: "1"
|
|
|
});
|
|
|
|
|
|
- if (res && res.code === 0 && res.data) {
|
|
|
+ if (res && res.code === 1 && 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;
|
|
@@ -518,9 +467,10 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
// 时间选择事件
|
|
|
- async handleTime(e,prop) {
|
|
|
- const startProp = `${prop}Start`
|
|
|
- const endProp = `${prop}End`
|
|
|
+ async handleTime(e,isOpen = false) {
|
|
|
+ const startProp = isOpen ? "open_start" :"create_start"
|
|
|
+ const endProp = isOpen ? "open_end" : "create_end"
|
|
|
+
|
|
|
if (e.startTime !== "") {
|
|
|
this.parmValue[startProp] = e.startTime;
|
|
|
} else {
|