gaoluyang
2 天以前 4d3882045d317ddb3c7416f606ac738ca6ec2c01
src/views/productionManagement/productionOrder/index.vue
@@ -13,7 +13,7 @@
            />
            <span class="search_title ml10">项目名称:</span>
            <el-input
               v-model="searchForm.customerName"
               v-model="searchForm.projectName"
               style="width: 240px"
               placeholder="请输入"
               @change="handleQuery"
@@ -46,65 +46,64 @@
<script setup>
import {onMounted, ref} from "vue";
import {
   listCustomer,
} from "@/api/basicData/customerFile.js";
import { ElMessageBox } from "element-plus";
import dayjs from "dayjs";
import {schedulingListPage} from "@/api/productionManagement/productionOrder.js";
const { proxy } = getCurrentInstance();
const tableColumn = ref([
   {
      label: "录入日期",
      prop: "customerName",
      prop: "entryDate",
      width: 120,
   },
   {
      label: "合同号",
      prop: "taxpayerIdentificationNumber",
      prop: "salesContractNo",
      width: 220,
   },
   {
      label: "客户合同号",
      prop: "addressPhone",
      prop: "customerContractNo",
      width: 250,
   },
   {
      label: "客户名称",
      prop: "contactPerson",
      prop: "customerName",
      width: 250,
   },
   {
      label: "项目名称",
      prop: "contactPhone",
      width:150
      prop: "projectName",
      width:300
   },
   {
      label: "产品大类",
      prop: "basicBankAccount",
      width: 220,
      prop: "productCategory",
      width: 160,
   },
   {
      label: "规格型号",
      prop: "bankAccount",
      prop: "specificationModel",
      width: 220,
   },
   {
      label: "单位",
      prop: "bankCode",
      width:220
      prop: "unit",
      width:90
   },
   {
      label: "数量",
      prop: "maintainer",
      prop: "quantity",
   },
   {
      label: "排产数量",
      prop: "maintenanceTime",
      prop: "schedulingNum",
      width: 100,
   },
   {
      label: "完工数量",
      prop: "maintenanceTime",
      prop: "successNum",
      width: 100,
   },
]);
@@ -119,12 +118,10 @@
const data = reactive({
   searchForm: {
      customerName: "",
      entryDate: [
         dayjs().format("YYYY-MM-DD"),
         dayjs().add(1, "day").format("YYYY-MM-DD"),
      ], // 录入日期
      entryDateStart: dayjs().format("YYYY-MM-DD"),
      entryDateEnd: dayjs().add(1, "day").format("YYYY-MM-DD"),
      projectName: "",
      entryDate: [], // 录入日期
      entryDateStart: '',
      entryDateEnd: '',
   },
});
const { searchForm } = toRefs(data);
@@ -142,21 +139,26 @@
};
const changeDaterange = (value) => {
   if (value) {
      searchForm.entryDateStart = dayjs(value[0]).format("YYYY-MM-DD");
      searchForm.entryDateEnd = dayjs(value[1]).format("YYYY-MM-DD");
      searchForm.value.entryDateStart = value[0];
      searchForm.value.entryDateEnd = value[1];
   } else {
      searchForm.entryDateStart = undefined;
      searchForm.entryDateEnd = undefined;
      searchForm.value.entryDateStart = undefined;
      searchForm.value.entryDateEnd = undefined;
   }
   handleQuery();
};
const getList = () => {
   tableLoading.value = true;
   listCustomer({ ...searchForm.value, ...page }).then((res) => {
   // 构造一个新的对象,不包含entryDate字段
   const params = { ...searchForm.value, ...page };
   params.entryDate = undefined
   schedulingListPage(params).then((res) => {
      tableLoading.value = false;
      tableData.value = res.records;
      page.total = res.total;
   });
      tableData.value = res.data.records;
      page.total = res.data.total;
   }).catch(() => {
      tableLoading.value = false;
   })
};
// 导出
@@ -167,7 +169,7 @@
      type: "warning",
   })
      .then(() => {
         proxy.download("/basic/customer/export", {}, "客户档案.xlsx");
         proxy.download("/salesLedger/scheduling/export", {}, "生产订单.xlsx");
      })
      .catch(() => {
         proxy.$modal.msg("已取消");
@@ -175,6 +177,12 @@
};
onMounted(() => {
   searchForm.value.entryDate = [
      dayjs().format("YYYY-MM-DD"),
      dayjs().add(1, "day").format("YYYY-MM-DD"),
   ]
   searchForm.value.entryDateStart = dayjs().format("YYYY-MM-DD")
   searchForm.value.entryDateEnd = dayjs().add(1, "day").format("YYYY-MM-DD")
   getList();
});
</script>