|
@@ -2,13 +2,14 @@
|
|
|
<div>
|
|
<div>
|
|
|
<layout>
|
|
<layout>
|
|
|
<layout-header>
|
|
<layout-header>
|
|
|
-<!-- <div class="">
|
|
|
|
|
- <el-input v-model="add_searchInfo" placeholder="请输入入库或出库单号模糊查询" @input="handleInput"
|
|
|
|
|
- @keyup.enter="add_onSubmit" id="searchInput" style="width: 340px;height: 50px;margin-left: 10px;">
|
|
|
|
|
- </el-input>
|
|
|
|
|
- <el-button type="primary" @click="Reporting_onSubmit" icon="view" style="height: 50px;font-size: 20px;">查看记录</el-button>
|
|
|
|
|
- <el-button type="primary" icon="reading" @click="details_onSubmit" style="height: 50px;font-size: 20px;">出库退还记录</el-button>
|
|
|
|
|
- </div> -->
|
|
|
|
|
|
|
+ <el-form>
|
|
|
|
|
+ <el-form-item>
|
|
|
|
|
+ <el-input v-model="searchInfo" placeholder="搜索订单编号、单号、物料或款号" @keyup.enter="handleSearch()" style="width: 230px;" />
|
|
|
|
|
+ <el-button type="primary" icon="Search" class="search" @click="handleSearch" />
|
|
|
|
|
+ <el-button type="primary" icon="Download" @click="exportToExcel" style="margin: 5px;float: right;">导出出库单Excel</el-button>
|
|
|
|
|
+ <el-button type="primary" icon="Download" @click="exportToExcel2" style="margin: 5px;float: right;">导出出库单(详情)Excel</el-button>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
</layout-header>
|
|
</layout-header>
|
|
|
<layout>
|
|
<layout>
|
|
|
|
|
|
|
@@ -28,7 +29,7 @@
|
|
|
:cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
:cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
|
:header-cell-style="{ padding: '0px' }"
|
|
:header-cell-style="{ padding: '0px' }"
|
|
|
:data="restableData" border row-key="ID" size="small"
|
|
:data="restableData" border row-key="ID" size="small"
|
|
|
- :cell-class-name="tableDataCellClass"
|
|
|
|
|
|
|
+ :cell-class-name="tableDataCellClass" id="dhtable"
|
|
|
highlight-current-row="true" @row-dblclick="updateCompanyFunc"
|
|
highlight-current-row="true" @row-dblclick="updateCompanyFunc"
|
|
|
@row-click="tableRowClick" :show-overflow-tooltip="true"
|
|
@row-click="tableRowClick" :show-overflow-tooltip="true"
|
|
|
@selection-change="handleSelectionChange">
|
|
@selection-change="handleSelectionChange">
|
|
@@ -50,7 +51,7 @@
|
|
|
:row-style="{ height: '20px' }"
|
|
:row-style="{ height: '20px' }"
|
|
|
:cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
:cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
|
:header-cell-style="{ padding: '0px' }"
|
|
:header-cell-style="{ padding: '0px' }"
|
|
|
- :show-overflow-tooltip="true"
|
|
|
|
|
|
|
+ :show-overflow-tooltip="true" id="dhtable2"
|
|
|
highlight-current-row="true"
|
|
highlight-current-row="true"
|
|
|
@row-click="listtableclick"
|
|
@row-click="listtableclick"
|
|
|
@row-dblclick="ysupdateCompanyFunc"
|
|
@row-dblclick="ysupdateCompanyFunc"
|
|
@@ -103,9 +104,11 @@ ReceiptList,
|
|
|
ReceiptDetail
|
|
ReceiptDetail
|
|
|
} from '@/api/mes/job'
|
|
} from '@/api/mes/job'
|
|
|
import {ElMessage} from "element-plus";
|
|
import {ElMessage} from "element-plus";
|
|
|
|
|
+import * as XLSX from 'xlsx';
|
|
|
|
|
+import FileSaver from 'file-saver';
|
|
|
// import { get } from 'scriptjs';
|
|
// import { get } from 'scriptjs';
|
|
|
-defineOptions({name: 'Company'})
|
|
|
|
|
import { useUserStore } from '@/pinia/modules/user'
|
|
import { useUserStore } from '@/pinia/modules/user'
|
|
|
|
|
+defineOptions({name: 'Company'})
|
|
|
//获取用户登录信息
|
|
//获取用户登录信息
|
|
|
const userStore = useUserStore()
|
|
const userStore = useUserStore()
|
|
|
const _username = ref('')
|
|
const _username = ref('')
|
|
@@ -160,16 +163,56 @@ const getReceiptTabs = async () => {
|
|
|
getReceiptTabs();
|
|
getReceiptTabs();
|
|
|
|
|
|
|
|
const restableData = reactive([])
|
|
const restableData = reactive([])
|
|
|
|
|
+const nodedata = ref('')
|
|
|
//点击左侧树形获取编号
|
|
//点击左侧树形获取编号
|
|
|
const handleNodeClick = async (node) => {
|
|
const handleNodeClick = async (node) => {
|
|
|
restableData.splice(0, restableData.length);//清空表格
|
|
restableData.splice(0, restableData.length);//清空表格
|
|
|
|
|
+ nodedata.value = node.label;
|
|
|
// 获取点击的节点的月份
|
|
// 获取点击的节点的月份
|
|
|
- const month = node.label;
|
|
|
|
|
- const response = await ReceiptList({mouth:month});
|
|
|
|
|
|
|
+ const response = await ReceiptList({order:'',mouth:nodedata.value,page:page.value,limit:pageSize.value});
|
|
|
console.log(response)
|
|
console.log(response)
|
|
|
- restableData.splice(0,response.length,...response.data);
|
|
|
|
|
|
|
+ restableData.splice(0,response.length,...response.data.table);
|
|
|
|
|
+ total.value = response.data.total;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+const searchInfo = ref('')
|
|
|
|
|
+ //查询按钮
|
|
|
|
|
+const handleSearch = async ()=>{
|
|
|
|
|
+ restableData.splice(0, restableData.length);//清空表格
|
|
|
|
|
+ //订单信息数据查询【接口】
|
|
|
|
|
+ const response = await ReceiptList({order:searchInfo.value,mouth:nodedata.value,page:page.value,limit:pageSize.value});
|
|
|
|
|
+ console.log(response)
|
|
|
|
|
+ restableData.splice(0,response.length,...response.data.table);
|
|
|
|
|
+ total.value = response.data.total;
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+const exportToExcel = ()=>{
|
|
|
|
|
+ const el = document.getElementById('dhtable');
|
|
|
|
|
+ // 文件名
|
|
|
|
|
+ const filename = '出入库单号.xlsx';
|
|
|
|
|
+ const wb = XLSX.utils.table_to_book(el, { raw: true });
|
|
|
|
|
+ const wbout = XLSX.write(wb, { bookType: 'xlsx', bookSST: true, type: 'array' });
|
|
|
|
|
+ try {
|
|
|
|
|
+ FileSaver.saveAs(new Blob([wbout], { type: 'application/octet-stream' }), filename);
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ console.log(e);
|
|
|
|
|
+ }
|
|
|
|
|
+ return wbout;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const exportToExcel2 = ()=>{
|
|
|
|
|
+ const el = document.getElementById('dhtable2');
|
|
|
|
|
+ // 文件名
|
|
|
|
|
+ const filename = '出入库单号(详情).xlsx';
|
|
|
|
|
+ const wb = XLSX.utils.table_to_book(el, { raw: true });
|
|
|
|
|
+ const wbout = XLSX.write(wb, { bookType: 'xlsx', bookSST: true, type: 'array' });
|
|
|
|
|
+ try {
|
|
|
|
|
+ FileSaver.saveAs(new Blob([wbout], { type: 'application/octet-stream' }), filename);
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ console.log(e);
|
|
|
|
|
+ }
|
|
|
|
|
+ return wbout;
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
const listtableData = reactive([])
|
|
const listtableData = reactive([])
|
|
|
//表格行点击
|
|
//表格行点击
|