huminmin
5 天以前 dada35abe48b4c59210fda4a8e7f1373d302dd2a
src/views/productionManagement/productionReporting/index.vue
@@ -2,25 +2,22 @@
   <div class="app-container">
      <div class="search_form">
         <el-form :model="searchForm" :inline="true">
            <el-form-item label="客户名称:">
               <el-input v-model="searchForm.customerName" placeholder="请输入" clearable prefix-icon="Search"
            <el-form-item label="报工人员名称:">
               <el-input v-model="searchForm.nickName" placeholder="请输入" clearable prefix-icon="Search"
                              style="width: 200px;"
                              @change="handleQuery" />
            </el-form-item>
            <el-form-item label="项目名称:">
               <el-input v-model="searchForm.projectName" placeholder="请输入" clearable prefix-icon="Search"
            <el-form-item label="工单号:">
               <el-input v-model="searchForm.workOrderNo" placeholder="请输入" clearable prefix-icon="Search"
                              style="width: 200px;"
                              @change="handleQuery" />
            </el-form-item>
            <el-form-item label="排产日期:">
               <el-date-picker v-model="searchForm.entryDate" value-format="YYYY-MM-DD" format="YYYY-MM-DD" type="daterange"
                                       placeholder="请选择" clearable @change="changeDaterange" />
            </el-form-item>
            <el-form-item label="状态:">
               <el-select v-model="searchForm.status" placeholder="请选择状态" style="width: 140px" clearable>
                  <el-option label="待生产" :value="1"></el-option>
                  <el-option label="已报工" :value="3"></el-option>
                  <el-option label="生产中" :value="2"></el-option>
            <el-form-item label="工单状态:">
               <el-select v-model="searchForm.workOrderStatus" placeholder="请选择工单状态" style="width: 140px" clearable>
                  <el-option label="待确认" :value="1"></el-option>
            <el-option label="待生产" :value="2"></el-option>
            <el-option label="生产中" :value="3"></el-option>
            <el-option label="已生产" :value="4"></el-option>
               </el-select>
            </el-form-item>
            <el-form-item>
@@ -141,17 +138,18 @@
import dayjs from "dayjs";
import {
   productionReportUpdate,
   workListPage,
   workListPageById
} from "@/api/productionManagement/productionReporting.js";
import {
  productionProductMainListPage,
} from "@/api/productionManagement/production_product_main.js";
import {userListNoPageByTenantId} from "@/api/system/user.js";
const data = reactive({
   searchForm: {
      staffName: "",
      entryDate: null, // 录入日期
      entryDateStart: undefined,
      entryDateEnd: undefined,
    nickName: "",
    workOrderNo: "",
    workOrderStatus: "",
   },
});
const { searchForm } = toRefs(data);
@@ -159,13 +157,23 @@
const expandData = ref([]);
const userList = ref([])
const tableColumn = ref([
  {
    label: "报工单号",
    prop: "productNo",
    width: 120,
  },
  {
    label: "报工人员",
    prop: "nickName",
    width: 120,
  },
  {
    label: "工单编号",
    prop: "workOrderNo",
    width: 120,
  },
   {
      type: "expand",
      dataType: "slot",
      slot: "expand",
   },
   {
      label: "状态",
      label: "报工状态",
      prop: "status",
      dataType: "tag",
      formatData: (params) => {
@@ -187,68 +195,54 @@
         }
      },
   },
   {
      label: "排产日期",
      prop: "schedulingDate",
      width: 120,
   },
   {
      label: "排产人",
      prop: "schedulingUserName",
   },
   {
      label: "合同号",
      prop: "salesContractNo",
      width: 200,
   },
   {
      label: "客户合同号",
      prop: "customerContractNo",
      width: 200,
   },
   {
      label: "客户名称",
      prop: "customerName",
      width: 200,
   },
   {
      label: "项目名称",
      prop: "projectName",
      width:300
   },
   {
      label: "产品大类",
      prop: "productCategory",
      width: 150,
   },
   {
      label: "规格型号",
      prop: "specificationModel",
      width: 150,
   },
   {
      label: "单位",
      prop: "unit",
   },
   {
      label: "工序",
      prop: "process",
   },
   {
      label: "排产数量",
      prop: "schedulingNum",
      width: 100,
   },
   {
      label: "生产数量",
      prop: "finishedNum",
      width: 100,
   },
   {
      label: "待生产数量",
      prop: "pendingFinishNum",
      width: 100,
   },
  {
    label: "工单状态",
    prop: "workOrderStatus",
    dataType: "tag",
    formatData: (params) => {
      switch (params) {
        case "1":
          return "待确认";
        case "2":
          return "待生产";
        case "3":
          return "生产中";
        case "4":
          return "已生产";
        default:
          return "";
      }
    },
    formatType: (params) => {
      switch (params) {
        case "1":
          return "primary";
        case "2":
          return "info";
        case "3":
          return "warning";
        case "4":
          return "success";
        default:
          return "";
      }
    },
  },
  {
    dataType: "action",
    label: "操作",
    align: "center",
    fixed: "right",
    width: 200,
    operation: [
      {
        name: "查看",
        type: "text",
        clickFun: (row) => {
        }
      },
    ]
  }
]);
const tableData = ref([]);
const selectedRows = ref([]);
@@ -288,7 +282,7 @@
   const params = { ...searchForm.value, ...page };
   params.entryDate = undefined
   expandedRowKeys.value = []
   workListPage(params).then(res => {
   productionProductMainListPage(params).then(res => {
      tableLoading.value = false;
      tableData.value = res.data.records.map(item => ({
         ...item,