|
@@ -1,40 +1,20 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<basic-container v-show="show" class="page-crad">
|
|
|
- <avue-crud
|
|
|
- ref="crud"
|
|
|
- :option="option"
|
|
|
- :data="dataList"
|
|
|
- v-model="form"
|
|
|
- :page.sync="page"
|
|
|
- :search.sync="search"
|
|
|
- :table-loading="loading"
|
|
|
- :cell-style="cellStyle"
|
|
|
- @selection-change="selectionChange"
|
|
|
- @search-change="searchChange"
|
|
|
- @current-change="currentChange"
|
|
|
- @size-change="sizeChange"
|
|
|
- @refresh-change="refreshChange"
|
|
|
- @on-load="onLoad"
|
|
|
- @search-criteria-switch="searchCriteriaSwitch"
|
|
|
- @saveColumn="saveColumn"
|
|
|
- @resetColumn="resetColumn"
|
|
|
- >
|
|
|
+ <avue-crud ref="crud" :option="option" :data="dataList" v-model="form" :page.sync="page" :search.sync="search"
|
|
|
+ :table-loading="loading" :cell-style="cellStyle" @selection-change="selectionChange"
|
|
|
+ @search-change="searchChange" @current-change="currentChange" @size-change="sizeChange"
|
|
|
+ @refresh-change="refreshChange" @on-load="onLoad" @search-criteria-switch="searchCriteriaSwitch"
|
|
|
+ @saveColumn="saveColumn" @resetColumn="resetColumn">
|
|
|
+ <template slot="menuLeft">
|
|
|
+ <el-button type="primary" size="small" icon="el-icon-bottom" @click.stop="openExport()">导出
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
<template slot="cnameSearch">
|
|
|
- <el-select
|
|
|
- v-model="search.goodsId"
|
|
|
- filterable
|
|
|
- clearable
|
|
|
- remote
|
|
|
- :remote-method="cnameMethod"
|
|
|
- @clear="cnameClear"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="(item, index) in goodsOption"
|
|
|
- :label="item.cname"
|
|
|
- :value="item.id"
|
|
|
- :key="index"
|
|
|
- ></el-option>
|
|
|
+ <el-select v-model="search.goodsId" filterable clearable remote :remote-method="cnameMethod"
|
|
|
+ @clear="cnameClear">
|
|
|
+ <el-option v-for="(item, index) in goodsOption" :label="item.cname" :value="item.id" :key="index">
|
|
|
+ </el-option>
|
|
|
</el-select>
|
|
|
</template>
|
|
|
</avue-crud>
|
|
@@ -46,7 +26,7 @@
|
|
|
import option from "./config/mainList.json";
|
|
|
import {getList as goodsSelect} from "@/api/basicData/commodityType";
|
|
|
import {getStockList} from "@/api/officeSupplies/stock";
|
|
|
-
|
|
|
+import { getToken } from "@/util/auth";
|
|
|
export default {
|
|
|
name: "index",
|
|
|
data() {
|
|
@@ -171,6 +151,26 @@ export default {
|
|
|
selectionChange(list) {
|
|
|
this.selection = list;
|
|
|
},
|
|
|
+ openExport() {
|
|
|
+ let params = { ...this.search }
|
|
|
+ if (params.businesDate && params.businesDate.length > 0) {
|
|
|
+ params = {
|
|
|
+ ...params,
|
|
|
+ beginInDate: params.businesDate[0] + ' 00:00:00',
|
|
|
+ endInDate: params.businesDate[1] + ' 23:59:59',
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ params = {
|
|
|
+ ...params,
|
|
|
+ beginInDate: '',
|
|
|
+ endInDate: '',
|
|
|
+ }
|
|
|
+ }
|
|
|
+ window.open(
|
|
|
+ `/api/trade-purchase/stock/ListExport?${this.website.tokenHeader
|
|
|
+ }=${getToken()}&cname=${params.cname}&beginInDate=${params.beginInDate}&endInDate=${params.endInDate}`
|
|
|
+ );
|
|
|
+ },
|
|
|
cnameMethod(name) {
|
|
|
if (name) {
|
|
|
goodsSelect(1, 20, {cname: name}).then(res => {
|
|
@@ -192,5 +192,4 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
-
|
|
|
</style>
|