Parcourir la source

Merge branch '12.31内部外协分支'

ezhizao_zx il y a 5 mois
Parent
commit
17c52cdf62

+ 8 - 0
src/api/business/outsourcedOrderDetail.js

@@ -27,6 +27,14 @@ export function listDetailForReceipt(query) {
 		params: query
 	})
 }
+// 获取已完成的内部外协从表
+export function listDetailForInterReceipt(query) {
+	return request({
+		url: baseUrl + '/business/outsourceDetail/listDetailForInterReceipt',
+		method: 'get',
+		params: query
+	})
+}
 //获取报工完成的发出单明细
 // 获取已完成的外协单从表
 export function getFinishedOutsourceDetailList(query) {

+ 5 - 13
src/components/Pagination/index.vue

@@ -1,16 +1,8 @@
 <template>
   <div :class="{ 'hidden': hidden }" class="pagination-container">
-    <el-pagination
-      :background="background"
-      v-model:current-page="currentPage"
-      v-model:page-size="pageSize"
-      :layout="layout"
-      :page-sizes="pageSizes"
-      :pager-count="pagerCount"
-      :total="total"
-      @size-change="handleSizeChange"
-      @current-change="handleCurrentChange"
-    />
+    <el-pagination :background="background" v-model:current-page="currentPage" v-model:page-size="pageSize"
+      :layout="layout" :page-sizes="pageSizes" :pager-count="pagerCount" :total="total" @size-change="handleSizeChange"
+      @current-change="handleCurrentChange" />
   </div>
 </template>
 
@@ -33,7 +25,7 @@ const props = defineProps({
   pageSizes: {
     type: Array,
     default() {
-      return [10, 20, 30, 50]
+      return [10, 50, 100, 300]
     }
   },
   // 移动端页码按钮的数量端默认值5
@@ -72,7 +64,7 @@ const pageSize = computed({
   get() {
     return props.limit
   },
-  set(val){
+  set(val) {
     emit('update:limit', val)
   }
 })

+ 3 - 0
src/plugins/auth.js

@@ -56,5 +56,8 @@ export default {
     return roles.every(item => {
       return authRole(item)
     })
+  },
+  isInter() {
+    return useUserStore().supplier.isInnerOutsource
   }
 }

+ 24 - 6
src/router/index.js

@@ -16,12 +16,12 @@ import Layout from '@/layout'
  * roles: ['admin', 'common']       // 访问路由的角色权限
  * permissions: ['a:a:a', 'b:b:b']  // 访问路由的菜单权限
  * meta : {
-    noCache: true                   // 如果设置为true,则不会被 <keep-alive> 缓存(默认 false)
-    title: 'title'                  // 设置该路由在侧边栏和面包屑中展示的名字
-    icon: 'svg-name'                // 设置该路由的图标,对应路径src/assets/icons/svg
-    breadcrumb: false               // 如果设置为false,则不会在breadcrumb面包屑中显示
-    activeMenu: '/system/user'      // 当路由设置了该属性,则会高亮相对应的侧边栏。
-  }
+		noCache: true                   // 如果设置为true,则不会被 <keep-alive> 缓存(默认 false)
+		title: 'title'                  // 设置该路由在侧边栏和面包屑中展示的名字
+		icon: 'svg-name'                // 设置该路由的图标,对应路径src/assets/icons/svg
+		breadcrumb: false               // 如果设置为false,则不会在breadcrumb面包屑中显示
+		activeMenu: '/system/user'      // 当路由设置了该属性,则会高亮相对应的侧边栏。
+	}
  */
 
 // 公共路由
@@ -109,6 +109,7 @@ export const constantRoutes = [
 	{
 		path: '/returnReceipt',
 		component: Layout,
+		outInter: true,
 		//permissions: ['business:outsourcedOrderDetails:query'],
 		children: [
 			{
@@ -122,6 +123,23 @@ export const constantRoutes = [
 			}
 		]
 	},
+	{
+		path: '/interReturnReceipt',
+		component: Layout,
+		isInter: true,
+		children: [{
+			path: 'interReturnReceipt/index',
+			component: () => import('@/views/business/interReturnReceipt/index'),
+			name: 'InterReturnReceipt',
+			meta: {
+				title: '委外收回',
+				icon: 'list',
+				value: {
+					isInter: true
+				}
+			}
+		}]
+	},
 	// {
 	// 	path: '/returnReceiptDetail',
 	// 	component: Layout,

+ 22 - 3
src/store/modules/permission.js

@@ -1,10 +1,11 @@
 import auth from '@/plugins/auth'
 import router, { constantRoutes, dynamicRoutes } from '@/router'
 import { getRouters } from '@/api/menu'
-import Layout from '@/layout/index'
+// import Layout from '@/layout'
 import ParentView from '@/components/ParentView'
 import InnerLink from '@/layout/components/InnerLink'
 
+
 // 匹配views里面所有的.vue文件
 const modules = import.meta.glob('./../../views/**/*.vue')
 
@@ -43,12 +44,21 @@ const usePermissionStore = defineStore(
             const rewriteRoutes = filterAsyncRouter(rdata, false, true)
             const defaultRoutes = filterAsyncRouter(defaultData)
             const asyncRoutes = filterDynamicRoutes(dynamicRoutes)
+            // const interRoutes = filterIsInter(dynamicRoutes)
+            // console.log(sidebarRoutes)
+            // console.log(rewriteRoutes)
+            // console.log(defaultRoutes)
+            // console.log(interRoutes)
+            // console.log(router)
             asyncRoutes.forEach(route => { router.addRoute(route) })
+            // interRoutes.forEach(route => { router.addRoute(route) })
             this.setRoutes(rewriteRoutes)
-            this.setSidebarRouters(constantRoutes.concat(sidebarRoutes))
-            this.setDefaultRoutes(sidebarRoutes)
+            this.setSidebarRouters(constantRoutes.concat(sidebarRoutes).filter(e => auth.isInter() ? true : !e.isInter).filter(e => auth.isInter() ? !e.outInter : true))
+            this.setDefaultRoutes(sidebarRoutes.filter(e => auth.isInter() ? true : !e.isInter).filter(e => auth.isInter() ? !e.outInter : true))
             this.setTopbarRoutes(defaultRoutes)
             resolve(rewriteRoutes)
+          }).catch(err => {
+            console.error(err)
           })
         })
       }
@@ -124,6 +134,15 @@ export function filterDynamicRoutes(routes) {
   return res
 }
 
+export function filterIsInter(routes) {
+  // console.log(auth.isInter())
+  // if (auth.isInter() == 1) {
+  //   return routes.filter(e => e.isInter)
+  // } else {
+  //   return []
+  // }
+}
+
 export const loadView = (view) => {
   let res;
   for (const path in modules) {

+ 6 - 2
src/store/modules/user.js

@@ -9,7 +9,8 @@ const useUserStore = defineStore('user', {
     name: '',
     avatar: '',
     roles: [],
-    permissions: []
+    permissions: [],
+    supplier: {}
   }),
   actions: {
     // 根据助记码,获取外协商
@@ -33,7 +34,7 @@ const useUserStore = defineStore('user', {
       return new Promise((resolve, reject) => {
         login(username, password, code, uuid)
           .then((res) => {
-            console.log(res)
+            // console.log(res)
             setToken(res.token)
             this.token = res.token
             resolve()
@@ -60,6 +61,7 @@ const useUserStore = defineStore('user', {
         getInfo()
           .then((res) => {
             const user = res.user
+            const supplier = res.supplier
             const avatar = user.avatar == '' || user.avatar == null ? defAva : import.meta.env.VITE_APP_BASE_API + user.avatar
 
             if (res.roles && res.roles.length > 0) {
@@ -72,6 +74,8 @@ const useUserStore = defineStore('user', {
             this.user = user
             this.name = user.userName
             this.avatar = avatar
+            this.supplier = supplier
+            // console.log(res)
             resolve(res)
           })
           .catch((error) => {

+ 115 - 0
src/views/business/interReturnReceipt/DialogOutsourceDetails.vue

@@ -0,0 +1,115 @@
+<template>
+	<el-dialog title="添加收回明细" v-model="visible" width="800px" height="400px" @close="close" append-to-body draggable>
+		<el-form ref="dialogForm" :model="queryParams" :inline="true" style="padding-top: 16px">
+			<el-form-item label="产品描述:" prop="productDescription" label-width="104">
+				<el-input v-model.trim="queryParams.productDescription" type="text" @keydown.enter.prevent style="width: 160px"
+					placeholder="请输入产品描述" :clearable="true" @keyup.enter="handleSearch" />
+			</el-form-item>
+			<el-form-item label="箱号:" prop="newCarrier" label-width="104">
+				<el-input v-model.trim="queryParams.newCarrier" type="text" @keydown.enter.prevent style="width: 160px"
+					placeholder="请输入箱号" :clearable="true" @keyup.enter="handleSearch" />
+			</el-form-item>
+			<el-form-item label-width="20px">
+				<el-button type="info" icon="Search" @click="handleSearch">搜索</el-button>
+			</el-form-item>
+		</el-form>
+
+		<el-table ref="dialogTable" :data="dataList" size="small" v-loading="loading" border height="370px"
+			@selection-change="handleSelectionChange">
+			<el-table-column type="selection" width="40" align="center" />
+			<el-table-column type="index" label="行号" width="50" align="center" />
+			<el-table-column label="批次号" align="center" prop="lotCode" width="96" />
+			<el-table-column label="产品描述" align="center" prop="productDescription" />
+			<el-table-column label="箱号" align="center" prop="newCarrier" width="220">
+			</el-table-column>
+		</el-table>
+		<!-- 分页 -->
+		<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+			v-model:limit="queryParams.pageSize" @pagination="getList" />
+		<template #footer>
+			<div class="dialog-footer">
+				<el-button type="primary" icon="Check" :disabled="selections.length === 0" @click="handleMultipleSelected">
+					确 定
+				</el-button>
+				<el-button type="danger" icon="Close" @click="close">取 消</el-button>
+			</div>
+		</template>
+	</el-dialog>
+</template>
+<script setup>
+import { listDetailForInterReceipt } from '@/api/business/outsourcedOrderDetail'
+const { proxy } = getCurrentInstance()
+const total = ref(0)
+const props = defineProps({
+	multipleSelected: {
+		type: Function,
+		default: null
+	}
+})
+
+const { multipleSelected } = toRefs(props)
+const dataList = ref([])
+const visible = ref(false)
+const loading = ref(false)
+const queryParams = ref({
+	existingOutsourceDetailIds: [],
+	productDescription: '',
+	pageNum: 1,
+	pageSize: 10
+})
+const selections = ref([])
+
+/**
+ * 对话框打开 事件
+ */
+function open(existingOutsourceDetailIds) {
+	visible.value = true
+	queryParams.value.existingOutsourceDetailIds = existingOutsourceDetailIds
+	getList()
+}
+
+/**
+ * 对话框关闭 事件
+ */
+function close() {
+	proxy.$refs.dialogForm.resetFields()
+	proxy.$refs.dialogTable.clearSelection()
+	queryParams.value.pageNum = 1
+	visible.value = false
+}
+
+/**
+ * 加载数据
+ */
+function getList() {
+	loading.value = true
+	listDetailForInterReceipt(queryParams.value).then((res) => {
+		dataList.value = res.rows
+		total.value = res.total
+		loading.value = false
+	})
+}
+
+/**
+ * 列表checkbox列选择 事件
+ */
+function handleSelectionChange(selection) {
+	selections.value = selection
+}
+
+/**  搜索 事件 */
+function handleSearch() {
+	getList()
+}
+/** 多选事件 */
+function handleMultipleSelected() {
+	if (multipleSelected.value) {
+		multipleSelected.value(selections.value)
+	}
+	close()
+}
+
+defineExpose({
+	open
+})
+</script>

+ 340 - 0
src/views/business/interReturnReceipt/form.vue

@@ -0,0 +1,340 @@
+<template>
+  <el-drawer title="外协单信息" :with-header="false" v-model="visible" direction="rtl" size="100%">
+    <div class="form-container column-container">
+      <div class="form-btns-container">
+        <span class="title-label">
+          <el-icon>
+            <Document />
+          </el-icon>
+          <span>收回单信息</span>
+        </span>
+        <el-button-group>
+          <el-button v-if="editStatus && submitStatus" type="success" @click="saveForm">
+            保存
+          </el-button>
+          <el-button v-if="editStatus && submitStatus" type="primary" @click="submitForm">
+            提交
+          </el-button>
+          <el-button v-if="!editStatus" type="primary" icon="Finished" @click="cancel">
+            确定
+          </el-button>
+        </el-button-group>
+
+        <div class="close-btn" @click="cancel">
+          <i class="fa fa-times" aria-hidden="true" />
+          <!-- <span>关闭</span> -->
+        </div>
+      </div>
+      <el-form ref="formRef" class="master-container" :model="form" v-loading="loading" label-width="120px">
+        <el-row :gutter="20">
+          <el-col :span="6">
+            <el-form-item label="单据号" prop="formCode">
+              <el-input v-model="form.formCode" readonly />
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="表单日期" prop="formDate">
+              <el-date-picker v-if="editStatus && submitStatus" v-model="form.formDate" type="date"
+                value-format="YYYY-MM-DD" style="width: 100%">
+              </el-date-picker>
+              <el-input v-model="form.formDate" v-else readonly />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="备注" prop="remark">
+              <el-input v-model.trim="form.remark" v-if="editStatus && submitStatus" />
+              <el-input v-model="form.remark" v-else readonly />
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <!-- 渲染数据区 -->
+      <div class="form-details-btns-container">
+        <el-button type="primary" icon="Plus" v-if="editStatus && submitStatus"
+          @click="handleShowDialogOutSourceDetails">
+          添加收回明细
+        </el-button>
+      </div>
+      <div class="el-table-container">
+        <div class="el-table-inner-container">
+          <el-table v-loading="loading" :data="form.details" size="small" border height="100%">
+            <el-table-column label="行号" type="index" align="center" width="48" />
+            <el-table-column label="批次号" align="center" prop="lotCode" width="104" />
+            <el-table-column label="产品描述" align="center" prop="productDescription" width="320" />
+            <el-table-column label="产品数量" align="center" prop="productNum" width="96" />
+            <el-table-column label="箱号" align="center" prop="newCarrier" width="320">
+              <template #default="scope">
+                {{ scope.row.newCarrier }} {{ scope.row.unbind == 1 ? "(已解绑)" : "" }}
+              </template>
+            </el-table-column>
+            <el-table-column label="外协工序" align="center" prop="processAlias" width="320" />
+            <el-table-column label="收回数量" align="center" prop="receiptNum" width="104" />
+            <el-table-column label="备注" align="center" prop="remark">
+              <template #default="scope">
+                <el-input v-model.trim="scope.row.remark" v-if="editStatus && submitStatus" />
+                <el-input v-model="scope.row.remark" v-else readonly />
+              </template>
+            </el-table-column>
+            <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="64">
+              <template #default="scope">
+                <el-button v-if="editStatus && submitStatus" link type="danger" icon="Delete"
+                  @click="handleDeletedDetails(scope.row)">
+                  删除
+                </el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+      </div>
+    </div>
+
+    <!-- 外协商选择 -->
+    <dialog-outsource-details ref="dialogOutsourceDetailsRef"
+      :multiple-selected="handleMultipleSelectedOutsourceDetails" />
+  </el-drawer>
+</template>
+<script setup>
+import {
+  getReceipt,
+  addReceipt,
+  updateReceipt,
+  checkFurnace
+} from "@/api/business/returnReceipt";
+import dialogOutsourceDetails from "./DialogOutsourceDetails";
+import { getTenant } from "@/utils/auth";
+const emit = defineEmits(["handleSaveSuccess"]);
+const { proxy } = getCurrentInstance();
+/** 表单抽屉 页变量 */
+const loading = ref(false);
+const visible = ref(false);
+const editStatus = ref(true);
+const submitStatus = ref(true);
+const webHost = import.meta.env.VITE_APP_BASE_API;
+const form = ref({});
+
+/****************************  方法区  ****************************/
+/** 打开抽屉 */
+const open = (row) => {
+  reset();
+  visible.value = true;
+  if (row) {
+    editStatus.value = row.editStatus == false ? row.editStatus : true;
+    submitStatus.value = row.isSubmit == 0 ? true : false;
+    loading.value = true;
+    getReceipt(row.id).then((response) => {
+      form.value = response.data;
+      console.log(form.value)
+      loading.value = false;
+    });
+  } else {
+    form.value.supplierName = getTenant().tenantName;
+    form.value.category = 1
+  }
+};
+
+/** 取消按钮 */
+const cancel = () => {
+  visible.value = false;
+  reset();
+};
+
+/** 表单重置 */
+const reset = () => {
+  form.value = {
+    id: null,
+    formCode: "",
+    formDate: proxy.parseTime(new Date(), "{y}-{m}-{d}"),
+    supplierId: "0",
+    supplierName: "",
+    remark: "",
+    details: [],
+    detailInfo: [],
+  };
+  editStatus.value = true
+  submitStatus.value = true
+  proxy.resetForm("formRef");
+};
+/***************************** 外协明细对话框相关 *****************************/
+// 打开外协明细选择对话框
+const handleShowDialogOutSourceDetails = () => {
+  const outsourceDetailIds =
+    form.value.details && form.value.details.length > 0
+      ? form.value.details.map((item) => item.outsourceDetailId)
+      : [];
+  proxy.$refs.dialogOutsourceDetailsRef.open(outsourceDetailIds);
+};
+// 外协明细选择带回
+const handleMultipleSelectedOutsourceDetails = (selection) => {
+  for (let i = 0; i < selection.length; i++) {
+    // console.log(selection[i])
+    for (
+      let j = 0;
+      j < selection[i].outsourcedOrderDetailProcessList.length;
+      j++
+    ) {
+      //存进数据库的内容
+      const newDetail = {
+        outsourceDetailId: selection[i].id,
+        productDescription: selection[i].productDescription,
+        lotCode: selection[i].lotCode,
+        lotId: selection[i].lotId,
+        dayworkId: selection[i].dayworkId,
+        productId: selection[i].productId,
+        productNum: selection[i].productNum,
+        receiptNum:
+          selection[i].outsourcedOrderDetailProcessList[j].qualifiedNum,
+        originalCarrier: selection[i].originalCarrier,
+        originalCarrierCount: selection[i].originalCarrierCount,
+        newCarrier: selection[i].newCarrier,
+        newCarrierCount: selection[i].newCarrierCount,
+        processNames: selection[i].processNames,
+        remark: "",
+        technologicalProcessId:
+          selection[i].outsourcedOrderDetailProcessList[j]
+            .technologicalProcessId,
+        technologyVersion:
+          selection[i].outsourcedOrderDetailProcessList[j].technologyVersion,
+        technologicalProcessDetailId:
+          selection[i].outsourcedOrderDetailProcessList[j]
+            .technologicalProcessDetailId,
+        processId: selection[i].outsourcedOrderDetailProcessList[j].processId,
+        processAlias:
+          selection[i].outsourcedOrderDetailProcessList[j].processAlias,
+        processCode:
+          selection[i].outsourcedOrderDetailProcessList[j].processCode,
+        processStepNumber:
+          selection[i].outsourcedOrderDetailProcessList[j].processStepNumber,
+        unbind: selection[i].unbind
+      };
+      form.value.detailInfo.push(newDetail);
+    }
+    //页面显示内容,一个批次一行
+    const detail = {
+      outsourceDetailId: selection[i].id,
+      productDescription: selection[i].productDescription,
+      lotCode: selection[i].lotCode,
+      productNum: selection[i].productNum,
+      receiptNum:
+        selection[i].outsourcedOrderDetailProcessList[
+          selection[i].outsourcedOrderDetailProcessList.length - 1
+        ].qualifiedNum,
+      newCarrier: selection[i].newCarrier,
+      remark: "",
+      processAlias: selection[i].processNames,
+      unbind: selection[i].unbind
+    };
+    form.value.details.push(detail);
+  }
+};
+
+/** 提交按钮 */
+function submitForm() {
+  proxy.$refs["formRef"].validate(async (valid) => {
+    if (valid) {
+      var flag = true;
+      if (form.value.details.length == 0) {
+        flag = false;
+        proxy.$modal.msgError("收回明细不能为空");
+      }
+      // if (form.value.details.findIndex(v => v.newCarrier == null || v.newCarrier == '') >= 0) {
+      //   flag = false
+      //   proxy.$modal.msgError("收回明细中载具箱号不能为空")
+      // }
+      // for (let i = 0; i < form.value.details.length; i++) {
+      // 	if (form.value.details[i].receiptNum <= 0) {
+      // 		flag = false;
+      // 		proxy.$modal.msgError("第" + (i + 1) + "行收回数量应大于0");
+      // 		return;
+      // 	}
+      // 	}
+
+      // 判断是否按炉结算
+      const checkRes = await checkFurnace(form.value.details);
+      if (!checkRes.data) {
+        flag = false
+        proxy.$modal.msgError(checkRes.msg)
+      }
+      if (flag) {
+        form.value.isSubmit = 1;
+        handleChangeRemark();
+        if (form.value.id != null) {
+          updateReceipt(form.value).then((response) => {
+            proxy.$modal.msgSuccess("修改成功");
+            visible.value = false;
+            emit("handleSaveSuccess");
+          });
+        } else {
+          addReceipt(form.value).then((response) => {
+            proxy.$modal.msgSuccess("提交成功");
+            visible.value = false;
+            emit("handleSaveSuccess");
+          });
+        }
+      }
+    }
+  });
+}
+/** 保存按钮 */
+function saveForm() {
+  proxy.$refs["formRef"].validate((valid) => {
+    if (valid) {
+      var flag = true;
+      if (form.value.details.length == 0) {
+        flag = false;
+        proxy.$modal.msgError("收回明细不能为空");
+      }
+      // if (form.value.details.findIndex(v => v.newCarrier == null || v.newCarrier == '') >= 0) {
+      //   flag = false
+      //   proxy.$modal.msgError("收回明细中载具箱号不能为空")
+      // }
+      if (flag) {
+        form.value.isSubmit = 0;
+        handleChangeRemark();
+        if (form.value.id != null) {
+          updateReceipt(form.value).then((response) => {
+            proxy.$modal.msgSuccess("修改成功");
+            visible.value = false;
+            emit("handleSaveSuccess");
+          });
+        } else {
+          addReceipt(form.value).then((response) => {
+            proxy.$modal.msgSuccess("保存成功");
+            visible.value = false;
+            emit("handleSaveSuccess");
+          });
+        }
+      }
+    }
+  });
+}
+//添加备注
+function handleChangeRemark() {
+  for (let i = 0; i < form.value.details.length; i++) {
+    form.value.detailInfo.forEach((element) => {
+      if (form.value.details[i].lotCode == element.lotCode) {
+        element.remark = form.value.details[i].remark;
+      }
+    });
+  }
+}
+
+//删除收回明细
+function handleDeletedDetails(row) {
+  //前端同时操作form.value的两个集合
+  form.value.details.splice(form.value.details.indexOf(row), 1);
+  var index = []
+  for (let i = 0; i < form.value.detailInfo.length; i++) {
+    if (form.value.detailInfo[i].lotCode == row.lotCode) {
+      index.push(i)
+    }
+  }
+  for (let i = index.length - 1; i >= 0; i--) {
+    form.value.detailInfo.splice(index[i], 1);
+  }
+}
+
+/** 暴露给父组件的方法 */
+defineExpose({
+  open,
+});
+</script>

+ 209 - 0
src/views/business/interReturnReceipt/index.vue

@@ -0,0 +1,209 @@
+<template>
+  <div class="page-container column-container">
+    <!-- 搜索区 -->
+    <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-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>
+      <el-form-item>
+        <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
+        <el-button icon="Refresh" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <!-- 功能按钮区 -->
+    <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="warning" icon="Download" :disabled="ids.length != 1" @click="handlePrint">
+        打印
+      </el-button>
+      <el-button type="warning" icon="Download" :disabled="ids.length != 1" @click="handleExport">
+        导出
+      </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-column type="selection" width="48" align="center" />
+          <el-table-column label="收回单号" align="center" prop="formCode" width="120" />
+          <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="remark" />
+          <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120">
+            <template #default="scope">
+              <el-button v-if="scope.row.isAudit == 1" link type="primary" icon="View"
+                @click="handleShowFormDialog(scope.row)">
+                查看
+              </el-button>
+              <el-button v-if="scope.row.isSubmit == 0 && scope.row.isAudit == 0" link type="warning" icon="Edit"
+                @click="handleShowFormDialog(scope.row)">
+                编辑
+              </el-button>
+              <el-button link v-if="scope.row.isSubmit == 1 && scope.row.isAudit == 0" icon="Close" type="danger"
+                @click="handleCancelSubmit(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" />
+
+    <!-- 表单 -->
+    <receipt-form ref="receiptRef" @handleSaveSuccess="getList" />
+  </div>
+</template>
+
+<script setup name="InterReturnReceipt">
+import {
+  listReceipt,
+  delReceipt,
+  printReturnReceipt,
+  exportReturn,
+  updateReceiptSubmitStatus
+} from "@/api/business/returnReceipt";
+import receiptForm from "./form";
+const { proxy } = getCurrentInstance();
+
+const dataList = ref([]);
+const loading = ref(true);
+const ids = ref([]);
+const total = ref(0);
+/** 查询对象 */
+const queryParams = ref({
+  pageNum: 1,
+  pageSize: 10,
+  formCode: null,
+  formDate: null,
+  startTime: null,
+  endTime: null,
+  category: 1
+});
+
+/***********************  方法区  ****************************/
+
+/** 查询外协单主
+带箱方式,是整单的。如果换新箱子,明细中,都需要更换箱子列表 */
+function getList() {
+  loading.value = true;
+  listReceipt(queryParams.value).then((response) => {
+    dataList.value = response.rows;
+    total.value = response.total;
+    loading.value = false;
+  });
+}
+
+/** 搜索按钮操作 */
+function handleQuery() {
+  queryParams.value.pageNum = 1;
+  getList();
+}
+
+/** 重置按钮操作 */
+function resetQuery() {
+  queryParams.value = ref({
+    pageNum: 1,
+    pageSize: 10,
+    formCode: null,
+    formDate: null,
+    startTime: null,
+    endTime: null,
+    categroy: 1
+  });
+  handleQuery();
+}
+/**复选框选中数据 */
+function handleSelectionChange(selection) {
+  ids.value = selection.map((item) => item.id);
+}
+/** 修改按钮操作 */
+function handleShowFormDialog(row) {
+  if (row != null && row.isAudit == 1) {
+    row.editStatus = false;
+  }
+  proxy.$refs.receiptRef.open(row ? row : null);
+}
+/** 导出按钮操作 */
+function handleExport() {
+  exportReturn({ id: ids.value[0] });
+}
+/** 删除按钮操作 */
+function handleDelete() {
+  const _ids = ids.value;
+  let tempList = []
+  let flag = true;
+  for (let i = 0; i < ids.value.length; i++) {
+    for (let j = 0; j < dataList.value.length; j++) {
+      if (dataList.value[j].id == ids.value[i]) {
+        tempList.push(dataList.value[j])
+      }
+    }
+  }
+  tempList.forEach(item => {
+    if (item.isAudit == 1) {
+      flag = false;
+    }
+  })
+  console.log(tempList)
+  if (flag) {
+    proxy.$modal
+      .confirm("是否确认删除选中的数据项?")
+      .then(function () {
+        return delReceipt(_ids);
+      })
+      .then(() => {
+        getList();
+        proxy.$modal.msgSuccess("删除成功!");
+      })
+      .catch(() => { });
+  } else {
+    proxy.$modal.msgError("所选的数据项包含已确认的收回单,不能删除!");
+  }
+}
+
+/** 打印按钮操作 */
+function handlePrint() {
+  printReturnReceipt({ id: ids.value[0] });
+}
+//取消提交
+function handleCancelSubmit(row) {
+  updateReceiptSubmitStatus({ id: row.id }).then((response) => {
+    proxy.$modal.msgSuccess("修改成功");
+    getList()
+  });
+}
+
+// /** 导出按钮操作 */
+// function handleExport() {
+//   proxy.download(
+//     "business/returnReceipt/export",
+//     {
+//       ...queryParams.value,
+//     },
+//     `order_${new Date().getTime()}.xlsx`
+//   );
+// }
+getList();
+</script>

+ 7 - 2
src/views/business/outsourcedOrderDetails/index.vue

@@ -50,7 +50,7 @@
 						<template #default="scope">
 							<div v-if="scope.row.isFirstProcess === 0">{{ scope.row.newCarrierName }}</div>
 							<el-button v-else link type="primary" @click="handleChoiceCarrier(scope.row)">{{ scope.row.newCarrierName
-			== '' ? '请选择载具' : scope.row.newCarrierName }}</el-button>
+								== '' ? '请选择载具' : scope.row.newCarrierName }}</el-button>
 						</template>
 					</el-table-column>
 					<el-table-column label="收回状态" align="center" prop="returnStatus" width="80">
@@ -87,7 +87,7 @@
 							</el-tooltip>
 						</template>
 					</el-table-column>
-					<el-table-column label="操作" align="center" width="104">
+					<el-table-column v-if="notInter()" label="操作" align="center" width="104">
 						<template #default="scope">
 							<template v-if="scope.row.editStatus">
 								<el-button type="success" icon="Finished" circle @click="handleSaveRow(scope.row)" />
@@ -110,6 +110,7 @@
 <script setup>
 import { listProcess, editOutsourcedOrderDetailProcess, getLastProcessQualifitedNum } from '@/api/business/outsourcedOrderDetailProcess.js'
 import CarrierChoiceDialog from '../dialog/CarrierChoiceDialog.vue';
+import auth from '@/plugins/auth'
 const { proxy } = getCurrentInstance()
 /** 字典数组区 */
 const { is_report } = proxy.useDict('is_report')
@@ -158,6 +159,10 @@ const getList = () => {
 		}
 	})
 }
+
+const notInter = () => {
+	return !auth.isInter()
+}
 //获取当前时间
 function getNowDate() {
 	var nowDate = new Date();

+ 3 - 0
src/views/business/returnReceipt/form.vue

@@ -111,6 +111,7 @@ const form = ref({});
 /****************************  方法区  ****************************/
 /** 打开抽屉 */
 const open = (row) => {
+  console.log(row)
   reset();
   visible.value = true;
   if (row) {
@@ -144,6 +145,8 @@ const reset = () => {
     details: [],
     detailInfo: [],
   };
+  editStatus.value = true
+  submitStatus.value = true
   proxy.resetForm("formRef");
 };
 /***************************** 外协明细对话框相关 *****************************/

+ 48 - 127
src/views/business/returnReceipt/index.vue

@@ -1,45 +1,20 @@
 <template>
   <div class="page-container column-container">
     <!-- 搜索区 -->
-    <el-form
-      class="list-search-container"
-      :model="queryParams"
-      ref="queryRef"
-      :inline="true"
-      style="margin-right: 0px"
-    >
+    <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="表单日期:">
-        <el-date-picker
-          v-model="queryParams.startTime"
-          type="date"
-          style="width: 144px"
-          value-format="YYYY-MM-DD"
-          placeholder="选择起始日期"
-          clearable
-        />
+        <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-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
-        >
+        <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
         <el-button icon="Refresh" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
@@ -49,94 +24,43 @@
       <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 type="danger" icon="Delete" :disabled="ids.length == 0" @click="handleDelete">
         删除
       </el-button>
-      <el-button
-        type="warning"
-        icon="Download"
-        :disabled="ids.length != 1"
-        @click="handlePrint"
-      >
+      <el-button type="warning" icon="Download" :disabled="ids.length != 1" @click="handlePrint">
         打印
       </el-button>
-      <el-button
-        type="warning"
-        icon="Download"
-        :disabled="ids.length != 1"
-        @click="handleExport"
-      >
+      <el-button type="warning" icon="Download" :disabled="ids.length != 1" @click="handleExport">
         导出
       </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
-            label="收回单号"
-            align="center"
-            prop="formCode"
-            width="120"
-          />
-          <el-table-column
-            label="收回日期"
-            align="center"
-            prop="formDate"
-            width="120"
-          >
+          <el-table-column label="收回单号" align="center" prop="formCode" width="120" />
+          <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="remark" />
-          <el-table-column
-            label="操作"
-            align="center"
-            class-name="small-padding fixed-width"
-            width="120"
-          >
+          <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120">
             <template #default="scope">
-              <el-button
-                v-if="scope.row.isAudit == 1"
-                link
-                type="primary"
-                icon="View"
-                @click="handleShowFormDialog(scope.row)"
-              >
+              <el-button v-if="scope.row.isAudit == 1" link type="primary" icon="View"
+                @click="handleShowFormDialog(scope.row)">
                 查看
               </el-button>
-              <el-button
-              v-if="scope.row.isSubmit == 0 &&scope.row.isAudit == 0"
-                link
-                type="warning"
-                icon="Edit"
-                @click="handleShowFormDialog(scope.row)"
-              >
+              <el-button v-if="scope.row.isSubmit == 0 && scope.row.isAudit == 0" link type="warning" icon="Edit"
+                @click="handleShowFormDialog(scope.row)">
                 编辑
               </el-button>
-              <el-button
-              link
-            v-if="scope.row.isSubmit == 1 &&scope.row.isAudit == 0"
-            icon="Close"
-            type="danger"
-            @click="handleCancelSubmit(scope.row)"
-          >
-            取消提交
-          </el-button>
+              <el-button link v-if="scope.row.isSubmit == 1 && scope.row.isAudit == 0" icon="Close" type="danger"
+                @click="handleCancelSubmit(scope.row)">
+                取消提交
+              </el-button>
             </template>
           </el-table-column>
         </el-table>
@@ -144,13 +68,8 @@
     </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-form ref="receiptRef" @handleSaveSuccess="getList" />
@@ -180,6 +99,7 @@ const queryParams = ref({
   formDate: null,
   startTime: null,
   endTime: null,
+  categroy: 0
 });
 
 /***********************  方法区  ****************************/
@@ -210,6 +130,7 @@ function resetQuery() {
     formDate: null,
     startTime: null,
     endTime: null,
+    category: 0
   });
   handleQuery();
 }
@@ -219,7 +140,7 @@ function handleSelectionChange(selection) {
 }
 /** 修改按钮操作 */
 function handleShowFormDialog(row) {
-  if (row !=null &&row.isAudit == 1) {
+  if (row != null && row.isAudit == 1) {
     row.editStatus = false;
   }
   proxy.$refs.receiptRef.open(row ? row : null);
@@ -233,33 +154,33 @@ function handleDelete() {
   const _ids = ids.value;
   let tempList = []
   let flag = true;
-  for(let i = 0;i<ids.value.length;i++) {
-    for(let j =0;j<dataList.value.length;j++) {
-      if(dataList.value[j].id == ids.value[i]) {
+  for (let i = 0; i < ids.value.length; i++) {
+    for (let j = 0; j < dataList.value.length; j++) {
+      if (dataList.value[j].id == ids.value[i]) {
         tempList.push(dataList.value[j])
       }
     }
   }
   tempList.forEach(item => {
-    if(item.isAudit == 1) {
+    if (item.isAudit == 1) {
       flag = false;
     }
   })
   console.log(tempList)
-  if(flag) {
-  proxy.$modal
-    .confirm("是否确认删除选中的数据项?")
-    .then(function () {
-      return delReceipt(_ids);
-    })
-    .then(() => {
-      getList();
-      proxy.$modal.msgSuccess("删除成功!");
-    })
-    .catch(() => {});
-}else{
-  proxy.$modal.msgError("所选的数据项包含已确认的收回单,不能删除!");
-}
+  if (flag) {
+    proxy.$modal
+      .confirm("是否确认删除选中的数据项?")
+      .then(function () {
+        return delReceipt(_ids);
+      })
+      .then(() => {
+        getList();
+        proxy.$modal.msgSuccess("删除成功!");
+      })
+      .catch(() => { });
+  } else {
+    proxy.$modal.msgError("所选的数据项包含已确认的收回单,不能删除!");
+  }
 }
 
 /** 打印按钮操作 */
@@ -268,7 +189,7 @@ function handlePrint() {
 }
 //取消提交
 function handleCancelSubmit(row) {
-  updateReceiptSubmitStatus({id:row.id}).then((response) => {
+  updateReceiptSubmitStatus({ id: row.id }).then((response) => {
     proxy.$modal.msgSuccess("修改成功");
     getList()
   });

+ 105 - 110
src/views/business/returnReceiptDetail/form.vue

@@ -3,7 +3,9 @@
 		<div class="form-container column-container">
 			<div class="form-btns-container">
 				<span class="title-label">
-					<el-icon><Document /></el-icon>
+					<el-icon>
+						<Document />
+					</el-icon>
 					<span>收回明细</span>
 				</span>
 				<!-- <el-button-group>
@@ -20,15 +22,11 @@
 				<el-row :gutter="20">
 					<el-col :span="6">
 						<el-form-item label="收回日期" prop="formDate">
-							<el-input v-model="form.formDate" v-if="detailInfo.returnReceiptDetailList && detailInfo.returnReceiptDetailList.length > 0 && detailInfo.returnReceiptDetailList[0].auditNum > 0" readonly />
-							<el-date-picker
-							   v-else
-								v-model="form.formDate"
-								type="date"
-								:clearable="false"
-								value-format="YYYY-MM-DD"
-								style="width: 100%"
-							>
+							<el-input v-model="form.formDate"
+								v-if="detailInfo.returnReceiptDetailList && detailInfo.returnReceiptDetailList.length > 0 && detailInfo.returnReceiptDetailList[0].auditNum > 0"
+								readonly />
+							<el-date-picker v-else v-model="form.formDate" type="date" :clearable="false" value-format="YYYY-MM-DD"
+								style="width: 100%">
 							</el-date-picker>
 						</el-form-item>
 					</el-col>
@@ -37,34 +35,29 @@
 			<!-- 渲染数据区 -->
 			<div class="el-table-container">
 				<div class="el-table-inner-container">
-					<el-table v-loading="loading" :data="receiptDetailList" size="small" border height="100%" :span-method="rowSpanMethod">
+					<el-table v-loading="loading" :data="receiptDetailList" size="small" border height="100%"
+						:span-method="rowSpanMethod">
 						<el-table-column label="行号" type="index" align="center" width="48" />
 						<el-table-column label="批次号" align="center" prop="lotCode" width="104" />
 						<el-table-column label="产品描述" align="center" prop="productDescription" width="320" />
 						<el-table-column label="外协数量" align="center" prop="productNum" width="96" />
-						<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" prop="processAlias" width="150" />
-						<el-table-column label="收回数量" align="center" prop="receiptNum" width="104"/>
+						<el-table-column label="收回数量" align="center" prop="receiptNum" width="104" />
 						<el-table-column label="备注" align="center" prop="remark">
 							<template #default="scope">
-								<el-input v-model="scope.row.remark" v-if="detailInfo.returnReceiptDetailList && detailInfo.returnReceiptDetailList.length > 0 && detailInfo.returnReceiptDetailList[0].auditNum > 0" readonly/>
-									<el-input v-model="scope.row.remark" v-else />
-								</template>
+								<el-input v-model="scope.row.remark"
+									v-if="detailInfo.returnReceiptDetailList && detailInfo.returnReceiptDetailList.length > 0 && detailInfo.returnReceiptDetailList[0].auditNum > 0"
+									readonly />
+								<el-input v-model="scope.row.remark" v-else />
+							</template>
 						</el-table-column>
 						<el-table-column label="操作" align="center" width="104">
-							<el-button :disabled="detailInfo.returnReceiptDetailList && detailInfo.returnReceiptDetailList.length > 0 && detailInfo.returnReceiptDetailList[0].auditNum > 0"  type="primary" :loading="isSubmitting" icon="Bell" @click="handleAddReceiptDetail()">收回</el-button>
-					</el-table-column>
+							<el-button
+								:disabled="detailInfo.returnReceiptDetailList && detailInfo.returnReceiptDetailList.length > 0 && detailInfo.returnReceiptDetailList[0].auditNum > 0"
+								type="primary" :loading="isSubmitting" icon="Bell" @click="handleAddReceiptDetail()">收回</el-button>
+						</el-table-column>
 					</el-table>
 				</div>
 			</div>
@@ -72,8 +65,8 @@
 	</el-drawer>
 </template>
 <script setup>
-import {getOrderDetailProcess} from '@/api/business/outsourcedOrderDetailProcess'
-import {addReceiptDetail,getReturnReceiptDetail} from '@/api/business/returnReceiptDetail'
+import { getOrderDetailProcess } from '@/api/business/outsourcedOrderDetailProcess'
+import { addReceiptDetail, getReturnReceiptDetail } from '@/api/business/returnReceiptDetail'
 import { getTenant } from '@/utils/auth'
 const emit = defineEmits(['handleSaveSuccess'])
 const { proxy } = getCurrentInstance()
@@ -93,23 +86,23 @@ const form = ref({})
 const open = (row) => {
 	reset()
 	visible.value = true
-    detailInfo.value = row
+	detailInfo.value = row
 	//没有发出收回单
-	if (row.returnReceiptDetailList.length ==0) {
+	if (row.returnReceiptDetailList.length == 0) {
 		loading.value = true
 		getOrderDetailProcess(row).then((response) => {
 			receiptDetailList.value = response.data
 			loading.value = false
-			spanProps.value = ['lotCode','productDescription','productNum','originalCarrier','newCarrier'];
+			spanProps.value = ['lotCode', 'productDescription', 'productNum', 'originalCarrier', 'newCarrier'];
 			spanPropGroup(receiptDetailList.value)
 		})
 	}
 	else {
 		console.log(row)
-		getReturnReceiptDetail({id:row.id}).then(res => {
+		getReturnReceiptDetail({ id: row.id }).then(res => {
 			receiptDetailList.value = res.data
 			loading.value = false
-			spanProps.value = ['lotCode','productDescription','productNum','originalCarrier','newCarrier'];
+			spanProps.value = ['lotCode', 'productDescription', 'productNum', 'originalCarrier', 'newCarrier'];
 			spanPropGroup(receiptDetailList.value)
 		})
 	}
@@ -121,98 +114,100 @@ const cancel = () => {
 }
 
 /***************************** 外协明细对话框相关 *****************************/
-	/** 表单重置 */
+/** 表单重置 */
 const reset = () => {
 	form.value = {
 		formDate: proxy.parseTime(new Date(), '{y}-{m}-{d}'),
 	}
+	// editStatus.value = true
+	// submitStatus.value = true
 	proxy.resetForm('formRef')
 }
 let rowSpansMap = new Map(); //存需要开始合并的行号,向下合并多少行
 
 const spanPropGroup = (data) => {
-  let oldRow = null; //需要合并的行
-  rowSpansMap = new Map(); //重置Map
-  oldRow = data[0]; //默认第0行为需要合并的行
-  rowSpansMap.set(0, 1); //第0行,向下合并一行(其实就是自己单独一行)
-  let spanRow = 0; //记录需要开始合并的行号
-  for (let i = 1; i < data.length; i++) {
-    const item = data[i];
-    let isSame = true;
-    //遍历需要判断的属性判断对应值是否全部相等
-    for (let j = 0; j < spanProps.value.length; j++) {
-      const prop = spanProps.value[j];
-      //只要有一个属性值不相等则记录新的需要合并的行号
-      if (item[prop] != oldRow[prop]) {
-        oldRow = item;
-        rowSpansMap.set(i, 1);
-        spanRow = i;
-        isSame = false;
-        break;
-      }
-    }
-    //如果所有属性值相同则所需要合并的行数+1
-    if (isSame) {
-      let span = rowSpansMap.get(spanRow);
-      rowSpansMap.set(spanRow, span + 1);
-    }
-  }
+	let oldRow = null; //需要合并的行
+	rowSpansMap = new Map(); //重置Map
+	oldRow = data[0]; //默认第0行为需要合并的行
+	rowSpansMap.set(0, 1); //第0行,向下合并一行(其实就是自己单独一行)
+	let spanRow = 0; //记录需要开始合并的行号
+	for (let i = 1; i < data.length; i++) {
+		const item = data[i];
+		let isSame = true;
+		//遍历需要判断的属性判断对应值是否全部相等
+		for (let j = 0; j < spanProps.value.length; j++) {
+			const prop = spanProps.value[j];
+			//只要有一个属性值不相等则记录新的需要合并的行号
+			if (item[prop] != oldRow[prop]) {
+				oldRow = item;
+				rowSpansMap.set(i, 1);
+				spanRow = i;
+				isSame = false;
+				break;
+			}
+		}
+		//如果所有属性值相同则所需要合并的行数+1
+		if (isSame) {
+			let span = rowSpansMap.get(spanRow);
+			rowSpansMap.set(spanRow, span + 1);
+		}
+	}
 };
- 
-const rowSpanMethod =({ row, column, rowIndex, columnIndex }) => {
-  //采样值5-9列所对应的行不需要合并
-  if (columnIndex != 6 && columnIndex != 7 && columnIndex != 8) {
-    //根据当前行号从map中获取开始合并的行根据当前行号从map中获取开始合并的行号,向下合并多少行
-    const span = rowSpansMap.get(rowIndex);
-    if (span != null) {
-      return {
-        rowspan: span, //向下合并span行
-        colspan: 1,
-      };
-    } else {
-      return {
-        rowspan: 0,
-        colspan: 0,
-      };
-    }
-  }
+
+const rowSpanMethod = ({ row, column, rowIndex, columnIndex }) => {
+	//采样值5-9列所对应的行不需要合并
+	if (columnIndex != 6 && columnIndex != 7 && columnIndex != 8) {
+		//根据当前行号从map中获取开始合并的行根据当前行号从map中获取开始合并的行号,向下合并多少行
+		const span = rowSpansMap.get(rowIndex);
+		if (span != null) {
+			return {
+				rowspan: span, //向下合并span行
+				colspan: 1,
+			};
+		} else {
+			return {
+				rowspan: 0,
+				colspan: 0,
+			};
+		}
+	}
 };
 /** 提交按钮 */
 function handleAddReceiptDetail() {
 	proxy.$refs['formRef'].validate((valid) => {
 		if (valid) {
-			if(isSubmitting.value) {
+			if (isSubmitting.value) {
 				return
 			}
-			isSubmitting.value = true	
-			if(detailInfo.value.returnReceiptDetailList.length ==0) {
+			isSubmitting.value = true
+			if (detailInfo.value.returnReceiptDetailList.length == 0) {
 				let detailList = []
-				for(let i = 0;i<receiptDetailList.value.length;i++) {
+				for (let i = 0; i < receiptDetailList.value.length; i++) {
 					const newDetail = {
-					outsourceDetailId: receiptDetailList.value[i].detailId,
-					productDescription:  receiptDetailList.value[i].productDescription,
-					lotCode: receiptDetailList.value[i].lotCode,
-					lotId:receiptDetailList.value[i].lotId,
-					dayworkId: receiptDetailList.value[i].dayworkId,
-					productId: receiptDetailList.value[i].productId,
-					productNum: receiptDetailList.value[i].productNum,
-					receiptNum: receiptDetailList.value[i].receiptNum,
-					originalCarrier: receiptDetailList.value[i].originalCarrier,
-					originalCarrierCount: receiptDetailList.value[i].originalCarrierCount,
-					newCarrier:receiptDetailList.value[i].newCarrier,
-					newCarrierCount:receiptDetailList.value[i].newCarrierCount,
-					remark: receiptDetailList.value[i].remark,
-					technologicalProcessId:receiptDetailList.value[i].technologicalProcessId,
-					technologyVersion:receiptDetailList.value[i].technologyVersion,
-					technologicalProcessDetailId:receiptDetailList.value[i].technologicalProcessDetailId,
-					processId:receiptDetailList.value[i].processId,
-					processAlias:receiptDetailList.value[i].processAlias,
-					processCode:receiptDetailList.value[i].processCode,
-					processStepNumber:receiptDetailList.value[i].processStepNumber,
-					formDate:form.value.formDate,
-					supplierId:receiptDetailList.value[i].supplierId,
-					supplierName:receiptDetailList.value[i].supplierName
-			}
+						outsourceDetailId: receiptDetailList.value[i].detailId,
+						productDescription: receiptDetailList.value[i].productDescription,
+						lotCode: receiptDetailList.value[i].lotCode,
+						lotId: receiptDetailList.value[i].lotId,
+						dayworkId: receiptDetailList.value[i].dayworkId,
+						productId: receiptDetailList.value[i].productId,
+						productNum: receiptDetailList.value[i].productNum,
+						receiptNum: receiptDetailList.value[i].receiptNum,
+						originalCarrier: receiptDetailList.value[i].originalCarrier,
+						originalCarrierCount: receiptDetailList.value[i].originalCarrierCount,
+						newCarrier: receiptDetailList.value[i].newCarrier,
+						newCarrierCount: receiptDetailList.value[i].newCarrierCount,
+						remark: receiptDetailList.value[i].remark,
+						technologicalProcessId: receiptDetailList.value[i].technologicalProcessId,
+						technologyVersion: receiptDetailList.value[i].technologyVersion,
+						technologicalProcessDetailId: receiptDetailList.value[i].technologicalProcessDetailId,
+						processId: receiptDetailList.value[i].processId,
+						processAlias: receiptDetailList.value[i].processAlias,
+						processCode: receiptDetailList.value[i].processCode,
+						processStepNumber: receiptDetailList.value[i].processStepNumber,
+						formDate: form.value.formDate,
+						supplierId: receiptDetailList.value[i].supplierId,
+						supplierName: receiptDetailList.value[i].supplierName
+					}
 					detailList.push(newDetail)
 				}
 				console.log(detailList)
@@ -222,7 +217,7 @@ function handleAddReceiptDetail() {
 					visible.value = false
 					emit('handleSaveSuccess')
 				})
-			}else {
+			} else {
 				addReceiptDetail(receiptDetailList.value).then((response) => {
 					proxy.$modal.msgSuccess('添加成功')
 					isSubmitting.value = false;