|
@@ -21,11 +21,20 @@
|
|
|
<a-col :md="6" :sm="8">
|
|
|
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
|
|
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
|
|
|
+ <a-button type="primary" icon="download" @click="exportExcel" style="margin-left: 8px">导出</a-button>
|
|
|
+ <JsonExcel
|
|
|
+ :fetch="getExportDataList"
|
|
|
+ :fields="exportFields"
|
|
|
+ :header="exportTitle"
|
|
|
+ name="采购数量.xls"
|
|
|
+ style="display:none"
|
|
|
+ >
|
|
|
+ <!-- 上面可以自定义自己的样式,还可以引用其他组件button -->
|
|
|
+ <a-button type="primary" icon="download" ref="realExportExcel">导出</a-button>
|
|
|
+
|
|
|
+ </JsonExcel>
|
|
|
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
|
|
|
- <a @click="handleToggleSearch" style="margin-left: 8px">
|
|
|
- {{ toggleSearchStatus ? '收起' : '展开' }}
|
|
|
- <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
|
|
|
- </a>
|
|
|
+
|
|
|
</span>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
@@ -48,9 +57,9 @@
|
|
|
<a-row style="marginTop:20px;">
|
|
|
<a-col :md="24" :sm="12">
|
|
|
<span style="float: right;" class="table-operator">
|
|
|
- <a-button type="primary" icon="download" @click="handleExportXls('采购数量')">导出</a-button>
|
|
|
- <a-button type="primary" @click="print" icon="printer" style="margin:0 10px;">打印</a-button>
|
|
|
- <a-button type="primary" @click="backFabricLossTable" icon="rollback">取消</a-button>
|
|
|
+
|
|
|
+ <a-button type="primary" @click="backFabricLossTable" icon="rollback">关闭</a-button>
|
|
|
+
|
|
|
</span>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
@@ -62,12 +71,16 @@
|
|
|
<script>
|
|
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
|
|
import JEllipsis from '@/components/jeecg/JEllipsis'
|
|
|
+import JsonExcel from 'vue-json-excel'
|
|
|
export default {
|
|
|
name: 'PurchaseAmountModal', // 采购数量 弹框
|
|
|
mixins: [JeecgListMixin],
|
|
|
- components: { JEllipsis },
|
|
|
+ components: { JEllipsis ,JsonExcel},
|
|
|
data() {
|
|
|
return {
|
|
|
+ exportTitle:"采购数量",
|
|
|
+
|
|
|
+
|
|
|
// 表头
|
|
|
purchaseAmountColumns: [
|
|
|
{
|
|
@@ -188,6 +201,20 @@ export default {
|
|
|
item.iquantityNSettle = parseFloat(iquantityNSettle.toFixed(4));
|
|
|
return [item];
|
|
|
|
|
|
+ },
|
|
|
+ // 获取导出json定义
|
|
|
+ exportFields(){
|
|
|
+ var ret = {};
|
|
|
+ this.purchaseAmountColumns.forEach((record,index)=>{
|
|
|
+ if (record.title != "序号"){
|
|
|
+ if (record.title != "入库单号")
|
|
|
+ ret[record.title] = record.dataIndex;
|
|
|
+ else
|
|
|
+ ret[record.title] = record.dataIndex+"_ex";
|
|
|
+ }
|
|
|
+
|
|
|
+ });
|
|
|
+ return ret;
|
|
|
}
|
|
|
},
|
|
|
created() {},
|
|
@@ -206,6 +233,7 @@ export default {
|
|
|
// 弹框查询按钮
|
|
|
searchQuery() {
|
|
|
this.purchaseAmountData = this.allDataList.filter(e=> this.queryParam.ccode == null || e.ccode.toLowerCase().indexOf(this.queryParam.ccode.toLowerCase())>-1);
|
|
|
+
|
|
|
},
|
|
|
// 重置
|
|
|
searchReset() {
|
|
@@ -229,6 +257,15 @@ export default {
|
|
|
></a-table>
|
|
|
)
|
|
|
},
|
|
|
+ // 导出excel
|
|
|
+ exportExcel(){
|
|
|
+ this.$refs.realExportExcel.$el.click();
|
|
|
+ },
|
|
|
+ // 生成导出数据
|
|
|
+ getExportDataList(){
|
|
|
+ this.purchaseAmountData.forEach((item,index)=>{item["ccode_ex"]=" "+item["ccode"]});
|
|
|
+ return this.purchaseAmountData;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|