gaoluyang
6 天以前 3712799f3e0904f28e4268deaa5c5ee291323c38
src/views/productionManagement/productionOrder/index.vue
@@ -1,46 +1,69 @@
<template>
   <div class="app-container">
      <div class="search_form">
         <div>
            <span class="search_title">客户名称:</span>
            <el-input
               v-model="searchForm.customerName"
               style="width: 240px"
      <el-form :model="searchForm"
               :inline="true">
        <el-form-item label="客户名称:">
          <el-input v-model="searchForm.customerName"
               placeholder="请输入"
               @change="handleQuery"
               clearable
               prefix-icon="Search"
            />
            <span class="search_title ml10">项目名称:</span>
            <el-input
               v-model="searchForm.projectName"
               style="width: 240px"
                    style="width: 200px;"
                    @change="handleQuery" />
        </el-form-item>
        <el-form-item label="合同号:">
          <el-input v-model="searchForm.salesContractNo"
               placeholder="请输入"
               @change="handleQuery"
               clearable
               prefix-icon="Search"
            />
            <span class="search_title ml10">录入日期:</span>
            <el-date-picker v-model="searchForm.entryDate" value-format="YYYY-MM-DD" format="YYYY-MM-DD" type="daterange"
                                    placeholder="请选择" clearable @change="changeDaterange" />
            <el-button type="primary" @click="handleQuery" style="margin-left: 10px"
            >搜索</el-button
            >
         </div>
                    style="width: 200px;"
                    @change="handleQuery" />
        </el-form-item>
        <el-form-item label="项目名称:">
          <el-input v-model="searchForm.projectName"
                    placeholder="请输入"
                    clearable
                    prefix-icon="Search"
                    style="width: 200px;"
                    @change="handleQuery" />
        </el-form-item>
        <el-form-item label="产品名称:">
          <el-input v-model="searchForm.productCategory"
                    placeholder="请输入"
                    clearable
                    prefix-icon="Search"
                    style="width: 200px;"
                    @change="handleQuery" />
        </el-form-item>
        <el-form-item label="规格:">
          <el-input v-model="searchForm.specificationModel"
                    placeholder="请输入"
                    clearable
                    prefix-icon="Search"
                    style="width: 200px;"
                    @change="handleQuery" />
        </el-form-item>
        <el-form-item>
          <el-button type="primary"
                     @click="handleQuery">搜索</el-button>
        </el-form-item>
      </el-form>
         <div>
            <el-button @click="handleOut">导出</el-button>
         </div>
      </div>
      <div class="table_list">
         <PIMTable
            rowKey="id"
      <PIMTable rowKey="id"
            :column="tableColumn"
            :tableData="tableData"
            :page="page"
            :tableLoading="tableLoading"
            @pagination="pagination"
         ></PIMTable>
                @pagination="pagination"></PIMTable>
      </div>
    <process-route-item-form v-if="isShowItemModal"
                             v-model:visible="isShowItemModal"
                             :record="record"
                             @completed="getList" />
   </div>
</template>
@@ -48,24 +71,25 @@
import {onMounted, ref} from "vue";
import { ElMessageBox } from "element-plus";
import dayjs from "dayjs";
import {schedulingListPage} from "@/api/productionManagement/productionOrder.js";
  import { productOrderListPage } from "@/api/productionManagement/productionOrder.js";
const { proxy } = getCurrentInstance();
  import ProcessRouteItemForm from "@/views/productionManagement/productionOrder/ProcessRouteItemForm.vue";
const tableColumn = ref([
   {
      label: "录入日期",
      prop: "entryDate",
      label: "生产订单号",
      prop: "npsNo",
      width: 120,
   },
   {
      label: "合同号",
      label: "销售合同号",
      prop: "salesContractNo",
      width: 220,
   },
   {
      label: "客户合同号",
      prop: "customerContractNo",
      width: 250,
      label: "项目名称",
      prop: "projectName",
      width: 300,
   },
   {
      label: "客户名称",
@@ -73,52 +97,30 @@
      width: 250,
   },
   {
      label: "项目名称",
      prop: "projectName",
      width:300
   },
   {
      label: "生产状态",
      prop: "status",
      dataType: "tag",
      formatType: (params) => {
         if (params == '未完成') {
            return "danger";
         } else if (params == '已完成') {
            return "success";
         } else {
            return null;
         }
      },
   },
   {
      label: "产品大类",
      label: "产品名称",
      prop: "productCategory",
      width: 160,
      width: 250,
   },
   {
      label: "规格型号",
      label: "规格",
      prop: "specificationModel",
      width: 220,
      width: 250,
   },
   {
      label: "单位",
      prop: "unit",
      width:90
   },
      dataType: "action",
      label: "操作",
      align: "center",
      fixed: "right",
      width: 200,
      operation: [
   {
      label: "数量",
      prop: "quantity",
          name: "工艺路线",
          type: "text",
          clickFun: row => {
            showRouteItemModal(row);
   },
   {
      label: "排产数量",
      prop: "schedulingNum",
      width: 100,
   },
   {
      label: "完工数量",
      prop: "successNum",
      width: 100,
      ],
   },
]);
const tableData = ref([]);
@@ -132,10 +134,10 @@
const data = reactive({
   searchForm: {
      customerName: "",
      salesContractNo: "",
      projectName: "",
      entryDate: null, // 录入日期
      entryDateStart: undefined,
      entryDateEnd: undefined,
      productCategory: "",
      specificationModel: "",
   },
});
const { searchForm } = toRefs(data);
@@ -146,12 +148,12 @@
   page.current = 1;
   getList();
};
const pagination = (obj) => {
  const pagination = obj => {
   page.current = obj.page;
   page.size = obj.limit;
   getList();
};
const changeDaterange = (value) => {
  const changeDaterange = value => {
   if (value) {
      searchForm.value.entryDateStart = value[0];
      searchForm.value.entryDateEnd = value[1];
@@ -165,14 +167,23 @@
   tableLoading.value = true;
   // 构造一个新的对象,不包含entryDate字段
   const params = { ...searchForm.value, ...page };
   params.entryDate = undefined
   schedulingListPage(params).then((res) => {
    params.entryDate = undefined;
    productOrderListPage(params)
      .then(res => {
      tableLoading.value = false;
      tableData.value = res.data.records;
      page.total = res.data.total;
   }).catch(() => {
      tableLoading.value = false;
   })
      .catch(() => {
        tableLoading.value = false;
      });
  };
  const isShowItemModal = ref(false);
  const record = ref({});
  const showRouteItemModal = row => {
    isShowItemModal.value = true;
    record.value = row;
};
// 导出
@@ -190,6 +201,8 @@
      });
};
  const handleConfirmRoute = () => {};
onMounted(() => {
   getList();
});