ezhizao_zx 5 月之前
父节点
当前提交
daafcf188c

+ 5 - 0
src/plugins/tab.js

@@ -1,4 +1,5 @@
 import useTagsViewStore from '@/store/modules/tagsView'
+import useQueryStore from '@/store/modules/query'
 import router from '@/router'
 
 export default {
@@ -28,12 +29,14 @@ export default {
   // 关闭当前tab页签,打开新页签
   closeOpenPage(obj) {
     useTagsViewStore().delView(router.currentRoute.value)
+    useQueryStore().checkClean(obj || router.currentRoute.value)
     if (obj !== undefined) {
       return router.push(obj)
     }
   },
   // 关闭指定tab页签
   closePage(obj) {
+    useQueryStore().checkClean(obj || router.currentRoute.value)
     if (obj === undefined) {
       return useTagsViewStore()
         .delView(router.currentRoute.value)
@@ -45,6 +48,7 @@ export default {
   },
   // 关闭所有tab页签
   closeAllPage() {
+    useQueryStore().allClean()
     return useTagsViewStore().delAllViews()
   },
   // 关闭左侧tab页签
@@ -57,6 +61,7 @@ export default {
   },
   // 关闭其他tab页签
   closeOtherPage(obj) {
+    useQueryStore().otherClean(obj || router.currentRoute.value)
     return useTagsViewStore().delOthersViews(obj || router.currentRoute.value)
   },
   // 打开tab页签

+ 25 - 0
src/store/modules/query.js

@@ -0,0 +1,25 @@
+const queryStore = defineStore('query', {
+  state: () => ({
+    searchInterReturnReceipt: null
+  }),
+  actions: {
+    setSearchInterReturnReceipt(value) {
+      this.searchInterReturnReceipt = value
+    },
+    checkClean(obj) {
+      console.log(obj)
+      if (obj.name == 'InterReturnReceipt') {
+        this.searchInterReturnReceipt = null
+      }
+    },
+    allClean(obj) {
+      this.searchInterReturnReceipt = null
+    },
+    otherClean(obj) {
+      if (obj.name != 'InterReturnReceipt') {
+        this.searchInterReturnReceipt = null
+      }
+    }
+  }
+});
+export default queryStore;

+ 8 - 1
src/views/business/interReturnReceipt/index.vue

@@ -9,7 +9,7 @@
       <el-form-item label="表单日期:">
         <el-date-picker v-model="queryParams.startTime" type="date" style="width: 144px" value-format="YYYY-MM-DD"
           placeholder="选择起始日期" clearable />
-        <span style="margin: 0 4px">~</span>
+        <span style="margin: 0 4px"></span>
         <el-date-picker v-model="queryParams.endTime" type="date" style="width: 144px" value-format="YYYY-MM-DD"
           placeholder="选择结束日期" clearable />
       </el-form-item>
@@ -86,6 +86,7 @@ import {
 } from "@/api/business/returnReceipt";
 import receiptForm from "./form";
 const { proxy } = getCurrentInstance();
+import queryStore from "@/store/modules/query";
 
 const dataList = ref([]);
 const loading = ref(true);
@@ -108,6 +109,10 @@ const queryParams = ref({
 带箱方式,是整单的。如果换新箱子,明细中,都需要更换箱子列表 */
 function getList() {
   loading.value = true;
+  const listQueryParams = queryStore().searchInterReturnReceipt;
+  if (listQueryParams != null) {
+    queryParams.value = listQueryParams;
+  }
   listReceipt(queryParams.value).then((response) => {
     dataList.value = response.rows;
     total.value = response.total;
@@ -118,6 +123,8 @@ function getList() {
 /** 搜索按钮操作 */
 function handleQuery() {
   queryParams.value.pageNum = 1;
+  const listQueryParams = JSON.parse(JSON.stringify(queryParams.value));
+  queryStore().setSearchInterReturnReceipt(listQueryParams);
   getList();
 }
 

+ 20 - 46
src/views/business/outsourcedOrder/index.vue

@@ -3,32 +3,15 @@
 		<!-- 搜索区 -->
 		<el-form class="list-search-container" :model="queryParams" ref="queryRef" :inline="true" style="margin-right: 0px">
 			<el-form-item label="单据号:" prop="formCode">
-				<el-input
-					v-model="queryParams.formCode"
-					placeholder="请输入单据号"
-					style="width: 144px"
-					clearable
-					@keyup.enter="handleQuery"
-				/>
+				<el-input v-model="queryParams.formCode" placeholder="请输入单据号" style="width: 144px" clearable
+					@keyup.enter="handleQuery" />
 			</el-form-item>
 			<el-form-item label="表单日期:" prop="formDate">
-				<el-date-picker
-					v-model="queryParams.formStartDate"
-					type="date"
-					style="width: 144px"
-					value-format="YYYY-MM-DD"
-					placeholder="选择起始日期"
-					clearable
-				/>
-				<span style="margin: 0 4px">~</span>
-				<el-date-picker
-					v-model="queryParams.formEndDate"
-					type="date"
-					style="width: 144px"
-					value-format="YYYY-MM-DD"
-					placeholder="选择结束日期"
-					clearable
-				/>
+				<el-date-picker v-model="queryParams.formStartDate" type="date" style="width: 144px" value-format="YYYY-MM-DD"
+					placeholder="选择起始日期" clearable />
+				<span style="margin: 0 4px">到</span>
+				<el-date-picker v-model="queryParams.formEndDate" type="date" style="width: 144px" value-format="YYYY-MM-DD"
+					placeholder="选择结束日期" clearable />
 			</el-form-item>
 			<el-form-item label="结算方式:" prop="settlementType">
 				<el-select v-model="queryParams.settlementType" style="width: 104px" clearable placeholder="请选择">
@@ -88,21 +71,12 @@
 		</div>
 
 		<!-- 分页 -->
-		<pagination
-			v-show="total > 0"
-			:total="total"
-			v-model:page="queryParams.pageNum"
-			v-model:limit="queryParams.pageSize"
-			@pagination="getList"
-		/>
+		<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+			v-model:limit="queryParams.pageSize" @pagination="getList" />
 
 		<!-- 表单 -->
-		<order-form
-			ref="orderRef"
-			:delivery-method="delivery_method"
-			:settlement-type="settlement_type"
-			:packaging-method="packaging_method"
-		/>
+		<order-form ref="orderRef" :delivery-method="delivery_method" :settlement-type="settlement_type"
+			:packaging-method="packaging_method" />
 	</div>
 </template>
 
@@ -153,15 +127,15 @@ function handleQuery() {
 /** 重置按钮操作 */
 function resetQuery() {
 	queryParams.value = ref({
-	pageNum: 1,
-	pageSize: 10,
-	formCode: null,
-	formDate: null,
-	productDescription: null,
-	settlementType: null,
-	deliveryMethod: null,
-	packagingMethod: null
-})
+		pageNum: 1,
+		pageSize: 10,
+		formCode: null,
+		formDate: null,
+		productDescription: null,
+		settlementType: null,
+		deliveryMethod: null,
+		packagingMethod: null
+	})
 	handleQuery()
 }
 

+ 48 - 79
src/views/business/returnReceiptDetail/index.vue

@@ -3,41 +3,19 @@
 		<!-- 搜索区 -->
 		<el-form class="list-search-container" :model="queryParams" ref="queryRef" :inline="true" style="margin-right: 0px">
 			<el-form-item label="批次号:" prop="lotCode">
-				<el-input
-					v-model="queryParams.lotCode"
-					placeholder="请输入批次号"
-					style="width: 144px"
-					clearable
-					@keyup.enter="handleQuery"
-				/>
+				<el-input v-model="queryParams.lotCode" placeholder="请输入批次号" style="width: 144px" clearable
+					@keyup.enter="handleQuery" />
 			</el-form-item>
-            <el-form-item label="产品描述:" prop="productDescription">
-				<el-input
-					v-model="queryParams.productDescription"
-					placeholder="请输入产品描述"
-					style="width: 144px"
-					clearable
-					@keyup.enter="handleQuery"
-				/>
+			<el-form-item label="产品描述:" prop="productDescription">
+				<el-input v-model="queryParams.productDescription" placeholder="请输入产品描述" style="width: 144px" clearable
+					@keyup.enter="handleQuery" />
 			</el-form-item>
-			<el-form-item label="收回日期:" >
-				<el-date-picker
-					v-model="queryParams.startTime"
-					type="date"
-					style="width: 144px"
-					value-format="YYYY-MM-DD"
-					placeholder="选择起始日期"
-					clearable
-				/>
-				<span style="margin: 0 4px">~</span>
-				<el-date-picker
-					v-model="queryParams.endTime"
-					type="date"
-					style="width: 144px"
-					value-format="YYYY-MM-DD"
-					placeholder="选择结束日期"
-					clearable
-				/>
+			<el-form-item label="收回日期:">
+				<el-date-picker v-model="queryParams.startTime" type="date" style="width: 144px" value-format="YYYY-MM-DD"
+					placeholder="选择起始日期" clearable />
+				<span style="margin: 0 4px">到</span>
+				<el-date-picker v-model="queryParams.endTime" type="date" style="width: 144px" value-format="YYYY-MM-DD"
+					placeholder="选择结束日期" clearable />
 			</el-form-item>
 			<el-form-item>
 				<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
@@ -48,61 +26,52 @@
 		<!-- 功能按钮区 -->
 		<!-- <div class="list-btns-container">
 			<el-button type="primary" icon="Plus" @click="handleShowFormDialog(null)"> 新增 </el-button> -->
-			<!-- <el-button type="danger" icon="Delete" :disabled="ids.length == 0" @click="handleDelete"> 删除 </el-button>
+		<!-- <el-button type="danger" icon="Delete" :disabled="ids.length == 0" @click="handleDelete"> 删除 </el-button>
 		</div> -->
 		<!-- 渲染数据区 -->
 		<div class="el-table-container">
 			<div class="el-table-inner-container">
-				<el-table v-loading="loading" :data="dataList" size="small" border height="100%"  @selection-change="handleSelectionChange">
+				<el-table v-loading="loading" :data="dataList" size="small" border height="100%"
+					@selection-change="handleSelectionChange">
 					<el-table-column type="selection" width="48" align="center" />
-                    <el-table-column type="index" label="行号" width="50" align="center"/>
+					<el-table-column type="index" label="行号" width="50" align="center" />
 					<el-table-column label="批次号" align="center" prop="lotCode" width="120" />
-                    <el-table-column label="产品描述" align="center" prop="productDescription" />
+					<el-table-column label="产品描述" align="center" prop="productDescription" />
 					<el-table-column label="收回日期" align="center" prop="formDate" width="120">
 						<template #default="scope">
 							{{ parseTime(scope.row.formDate, '{y}-{m}-{d}') }}
 						</template>
 					</el-table-column>
-                    <el-table-column
-							label ='原箱号'
-							align="center"
-							prop="originalCarrier"
-							width="320"
-						/>
-						<el-table-column
-							label="新箱号"
-							align="center"
-							prop="newCarrier"
-							width="320"
-						/>
+					<el-table-column label='原箱号' align="center" prop="originalCarrier" width="320" />
+					<el-table-column label="新箱号" align="center" prop="newCarrier" width="320" />
 					<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="160">
 						<template #default="scope">
-                            <el-button v-if="scope.row.returnReceiptDetailList && scope.row.returnReceiptDetailList.length > 0 && scope.row.returnReceiptDetailList[0].auditNum > 0" link type="primary" icon="View" @click="handleShowFormDialog(scope.row)"> 查看 </el-button>
-                            <el-button v-else link type="warning" icon="Edit" @click="handleShowFormDialog(scope.row)"> 编辑 </el-button>
-                            <el-button  v-if="scope.row.returnReceiptDetailList.length > 0 && scope.row.returnReceiptDetailList[0].auditNum == 0" link type="danger" icon="Delete" @click="handleDeleteDetail(scope.row)"> 取消收回 </el-button>
-                        </template>
+							<el-button
+								v-if="scope.row.returnReceiptDetailList && scope.row.returnReceiptDetailList.length > 0 && scope.row.returnReceiptDetailList[0].auditNum > 0"
+								link type="primary" icon="View" @click="handleShowFormDialog(scope.row)"> 查看 </el-button>
+							<el-button v-else link type="warning" icon="Edit" @click="handleShowFormDialog(scope.row)"> 编辑
+							</el-button>
+							<el-button
+								v-if="scope.row.returnReceiptDetailList.length > 0 && scope.row.returnReceiptDetailList[0].auditNum == 0"
+								link type="danger" icon="Delete" @click="handleDeleteDetail(scope.row)"> 取消收回 </el-button>
+						</template>
 					</el-table-column>
 				</el-table>
 			</div>
 		</div>
 
 		<!-- 分页 -->
-		<pagination
-			v-show="total > 0"
-			:total="total"
-			v-model:page="queryParams.pageNum"
-			v-model:limit="queryParams.pageSize"
-			@pagination="getList"
-		/>
-         <!-- 表单 -->
+		<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+			v-model:limit="queryParams.pageSize" @pagination="getList" />
+		<!-- 表单 -->
 		<receipt-detail-form ref="receiptDetailRef" @handleSaveSuccess="getList" />
 	</div>
-   
+
 </template>
 
 <script setup name="ReceiptDetail">
 import { getFinishedOutsourceDetailList } from '@/api/business/outsourcedOrderDetail'
-import {delReceiptDetail} from '@/api/business/returnReceiptDetail'
+import { delReceiptDetail } from '@/api/business/returnReceiptDetail'
 import receiptDetailForm from './form'
 import { getTenant } from '@/utils/auth'
 const { proxy } = getCurrentInstance()
@@ -118,9 +87,9 @@ const queryParams = ref({
 	pageSize: 10,
 	formCode: null,
 	formDate: null,
-	startTime:null,
-	endTime:null,
-    supplierName:null
+	startTime: null,
+	endTime: null,
+	supplierName: null
 })
 
 /***********************  方法区  ****************************/
@@ -129,7 +98,7 @@ const queryParams = ref({
 带箱方式,是整单的。如果换新箱子,明细中,都需要更换箱子列表 */
 function getList() {
 	loading.value = true
-    queryParams.value.supplierName = getTenant().tenantName
+	queryParams.value.supplierName = getTenant().tenantName
 	getFinishedOutsourceDetailList(queryParams.value).then((response) => {
 		dataList.value = response.rows
 		total.value = response.total
@@ -145,14 +114,14 @@ function handleQuery() {
 
 /** 重置按钮操作 */
 function resetQuery() {
-	queryParams.value= ref({
-	pageNum: 1,
-	pageSize: 10,
-	formCode: null,
-	formDate: null,
-	startTime:null,
-	endTime:null
-})
+	queryParams.value = ref({
+		pageNum: 1,
+		pageSize: 10,
+		formCode: null,
+		formDate: null,
+		startTime: null,
+		endTime: null
+	})
 	handleQuery()
 }
 /**复选框选中数据 */
@@ -165,7 +134,7 @@ function handleShowFormDialog(row) {
 }
 /** 删除按钮操作 */
 function handleDelete() {
-	const _ids =ids.value
+	const _ids = ids.value
 	proxy.$modal
 		.confirm('是否确认删除选中的数据项?')
 		.then(function () {
@@ -175,10 +144,10 @@ function handleDelete() {
 			getList()
 			proxy.$modal.msgSuccess('删除成功!')
 		})
-		.catch(() => {})
+		.catch(() => { })
 }
 function handleDeleteDetail(row) {
-    proxy.$modal
+	proxy.$modal
 		.confirm('是否取消收回明细?')
 		.then(function () {
 			return delReceiptDetail(row.id)
@@ -187,7 +156,7 @@ function handleDeleteDetail(row) {
 			getList()
 			proxy.$modal.msgSuccess('取消成功!')
 		})
-		.catch(() => {})
+		.catch(() => { })
 }
 
 /** 导出按钮操作 */