zck 9 月之前
父节点
当前提交
3836dffb6b
共有 3 个文件被更改,包括 59 次插入16 次删除
  1. 2 2
      src/view/inventory/fabricsummary.vue
  2. 56 13
      src/view/inventory/pickinglist.vue
  3. 1 1
      src/view/performance/chukubaogong.vue

+ 2 - 2
src/view/inventory/fabricsummary.vue

@@ -57,7 +57,7 @@
               </el-pagination>
             </div>
             <div class="dialog-footer" style="text-align: left;margin-right: 60px;">
-			</div>
+			    </div>
           </div>
       </layout-content>
       </layout>
@@ -91,8 +91,8 @@ import {ElMessage} from "element-plus";
 import * as XLSX from 'xlsx';
 import FileSaver from 'file-saver';
 // import { get } from 'scriptjs';
-defineOptions({name: 'Company'})
 import { useUserStore } from '@/pinia/modules/user'
+defineOptions({name: 'Company'})
 //获取用户登录信息
 const userStore = useUserStore()
 const _username = ref('')

+ 56 - 13
src/view/inventory/pickinglist.vue

@@ -2,13 +2,14 @@
   <div>
 	  <layout>
 	    <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>
 		  
@@ -28,7 +29,7 @@
 						  :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
 						  :header-cell-style="{ padding: '0px' }"
 						  :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"
 						  @row-click="tableRowClick" :show-overflow-tooltip="true"
 						  @selection-change="handleSelectionChange">
@@ -50,7 +51,7 @@
 						:row-style="{ height: '20px' }"
 						:cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
 						:header-cell-style="{ padding: '0px' }"
-						:show-overflow-tooltip="true"
+						:show-overflow-tooltip="true" id="dhtable2"
 						highlight-current-row="true"
 						@row-click="listtableclick"
 						@row-dblclick="ysupdateCompanyFunc"
@@ -103,9 +104,11 @@ ReceiptList,
 ReceiptDetail
 } from '@/api/mes/job'
 import {ElMessage} from "element-plus";
+import * as XLSX from 'xlsx';
+import FileSaver from 'file-saver';
 // import { get } from 'scriptjs';
-defineOptions({name: 'Company'})
 import { useUserStore } from '@/pinia/modules/user'
+defineOptions({name: 'Company'})
 //获取用户登录信息
 const userStore = useUserStore()
 const _username = ref('')
@@ -160,16 +163,56 @@ const getReceiptTabs = async () => {
 getReceiptTabs();
 
 const restableData = reactive([])
+const nodedata = ref('')
 //点击左侧树形获取编号
 const handleNodeClick = async (node) => {
 	 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)
-	  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([])
 //表格行点击

+ 1 - 1
src/view/performance/chukubaogong.vue

@@ -533,7 +533,7 @@ const res_bomenterDialog = async() => {
 	    number: item.领用 !== null ? item.领用 : "",
 	    rq: currentDate,
 	    name: "出库",
-		sys_id: _username.value,
+		sys_id: userStore.userInfo.nickName,
 		receipt_number:danhao.value,
 		recipient:linguser.value
 	  }