ezhizao_zx 5 月之前
父节点
当前提交
03186d6218

+ 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) {

+ 9 - 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'      // 当路由设置了该属性,则会高亮相对应的侧边栏。
+	}
  */
 
 // 公共路由
@@ -123,6 +123,9 @@ export const constantRoutes = [
 		]
 	},
 	// {
+
+	// },
+	// {
 	// 	path: '/returnReceiptDetail',
 	// 	component: Layout,
 	// 	//permissions: ['business:outsourcedOrderDetails:query'],

+ 21 - 0
src/store/modules/permission.js

@@ -4,6 +4,22 @@ import { getRouters } from '@/api/menu'
 import Layout from '@/layout/index'
 import ParentView from '@/components/ParentView'
 import InnerLink from '@/layout/components/InnerLink'
+const interRouter = {
+  path: '/interReturnReceipt',
+  component: Layout,
+  children: [{
+    path: 'interReturnReceipt/index',
+    component: () => import('@/views/business/interReturnReceipt/index'),
+    name: 'InterReturnReceipt',
+    meta: {
+      title: '内部收回单',
+      icon: 'list',
+      value: {
+        isInter: true
+      }
+    }
+  }]
+}
 
 // 匹配views里面所有的.vue文件
 const modules = import.meta.glob('./../../views/**/*.vue')
@@ -43,6 +59,11 @@ const usePermissionStore = defineStore(
             const rewriteRoutes = filterAsyncRouter(rdata, false, true)
             const defaultRoutes = filterAsyncRouter(defaultData)
             const asyncRoutes = filterDynamicRoutes(dynamicRoutes)
+            console.log(sidebarRoutes)
+            console.log(rewriteRoutes)
+            console.log(defaultRoutes)
+            console.log(asyncRoutes)
+            console.log(router)
             asyncRoutes.forEach(route => { router.addRoute(route) })
             this.setRoutes(rewriteRoutes)
             this.setSidebarRouters(constantRoutes.concat(sidebarRoutes))

+ 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>

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

@@ -0,0 +1,333 @@
+<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;
+      loading.value = false;
+    });
+  } else {
+    form.value.supplierName = getTenant().tenantName;
+  }
+};
+
+/** 取消按钮 */
+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: [],
+  };
+  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++) {
+    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,
+      };
+      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,
+    };
+    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>

+ 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()
   });