浏览代码

Merge branch 'master' into Branch_qinhb

qinhb 1 年之前
父节点
当前提交
9418510710

+ 19 - 9
src/api/order/index.ts

@@ -16,15 +16,6 @@ export function getOrderPage(
     data: queryParams,
   });
 }
-export function queryOrderList(
-    queryParams: object
-): AxiosPromise<PageResult<any[]>> {
-  return request({
-    url: "/api/v1/plan/order/list",
-    method: "post",
-    data: queryParams,
-  });
-}
 
 /**
  * 获取用户表单详情
@@ -136,6 +127,15 @@ export function distributeWorkOrder(workOrderId: any) {
   });
 }
 
+// 工位任务状态统计
+export function getStatistics(data: Object) {
+  return request({
+    url: "/api/v1/plan/task/statistics",
+    method: "post",
+    data: data,
+  });
+}
+
 export function queryApplyInfoDetails(params: any) {
   return request({
     url: "/api/v1/plan/requisition/queryInfoDetails",
@@ -159,3 +159,13 @@ export function auditApplyInfoDetails(params: any) {
     data: params,
   });
 }
+
+export function queryOrderList(
+  queryParams: object
+): AxiosPromise<PageResult<any[]>> {
+  return request({
+    url: "/api/v1/plan/order/list",
+    method: "post",
+    data: queryParams,
+  });
+}

+ 4 - 1
src/components/Upload/SingleUpload.vue

@@ -40,7 +40,10 @@ const imgUrl = useVModel(props, "modelValue", emit);
  */
 async function uploadFile(options: UploadRequestOptions): Promise<any> {
   const res = await uploadFileApi(options.file);
-  imgUrl.value = import.meta.env.VITE_APP_UPLOAD_URL + res.data;
+  //绝对路径
+  // imgUrl.value = import.meta.env.VITE_APP_UPLOAD_URL + res.data;
+  //使用相对路径
+  imgUrl.value = res.data;
 }
 
 /**

+ 19 - 2
src/views/base/craftManagement/route/index.vue

@@ -22,6 +22,23 @@
       </template>
 
 	  <!-- :disabled="row.usable == '1' ? false : true" -->
+		<template #menu-right="{}">
+		  <el-dropdown split-button
+		    >导入
+		    <template #dropdown>
+		      <el-dropdown-menu>
+		        <el-dropdown-item
+		          @click="downloadTemplate('/api/v1/op/route/template')"
+		        >
+		          <i-ep-download />下载模板
+		        </el-dropdown-item>
+		        <el-dropdown-item @click="importExcelData">
+		          <i-ep-top />导入数据
+		        </el-dropdown-item>
+		      </el-dropdown-menu>
+		    </template>
+		  </el-dropdown>
+		</template>
       <template #menu="{ row }">
         <el-button
           link
@@ -94,7 +111,7 @@ const uploadFinished = () => {
 };
 const importExcelData = () => {
   if (uploadRef.value) {
-    uploadRef.value.show("/api/v1/plan/order/import");
+    uploadRef.value.show("/api/v1/op/route/import");
   }
 };
 
@@ -220,7 +237,7 @@ option.value = Object.assign(option.value, {
     // 在产品那边绑定了工艺路线才是已绑定
     {
       label: "路线状态",
-      prop: "used",
+      prop: "usable",
       addDisplay: false,
       editDisplay: false,
       slot: true,

+ 42 - 18
src/views/plan/schedule/index.vue

@@ -16,7 +16,7 @@
       @current-change="dataList"
       @selection-change="selectionChange"
     >
-      <template #menu-left="{ size }">
+      <template #menu-left>
         <div id="charts"></div>
       </template>
     </avue-crud>
@@ -28,6 +28,8 @@ import { useCrud } from "@/hooks/userCrud";
 import dictDataUtil from "@/common/configs/dictDataUtil";
 
 import { useDictionaryStoreHook } from "@/store";
+import { getStatistics } from "@/api/order/index";
+import * as echarts from "echarts";
 
 // 数据字典相关
 const { dicts } = useDictionaryStoreHook();
@@ -44,8 +46,41 @@ const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等
 
 const crudRef = ref(null); //crudRef.value 获取avue-crud对象
 
+const charts = ref(null);
+
 onMounted(() => {
+  charts.value = echarts.init(document.getElementById("charts"));
+
   dataList();
+
+  getStatistics(search.value).then((res) => {
+    const { data } = res;
+    const { value, key } = data;
+    charts.value.setOption({
+      title: {
+        text: "任务状态统计图",
+        left: "center",
+      },
+      xAxis: {
+        data: key,
+      },
+      yAxis: {},
+      series: [
+        {
+          type: "bar",
+          data: value,
+          itemStyle: {
+            barBorderRadius: 5,
+            borderWidth: 1,
+            borderType: "solid",
+            borderColor: "#73c0de",
+            shadowColor: "#5470c6",
+            shadowBlur: 3,
+          },
+        },
+      ],
+    });
+  });
 });
 
 // 设置表格列或者其他自定义的option
@@ -73,15 +108,7 @@ option.value = Object.assign(option.value, {
       prop: "workOrderCode",
       search: true,
     },
-    {
-      label: "工单名称",
-      prop: "workOrderName",
-    },
-    {
-      label: "产线编码",
-      prop: "productLineCode",
-      search: true,
-    },
+
     {
       label: "产线名称",
       prop: "productLineName",
@@ -95,10 +122,7 @@ option.value = Object.assign(option.value, {
       prop: "materialCode",
       search: true,
     },
-    {
-      label: "工单名称",
-      prop: "workOrderName",
-    },
+
     {
       label: "工序编码",
       prop: "operationCode",
@@ -129,17 +153,17 @@ option.value = Object.assign(option.value, {
       label: "计划结束时间",
       prop: "planStartEnd",
     },
-    {
-      label: "修改时间",
-      prop: "updated",
-    },
   ],
 });
 </script>
 
 <style lang="scss" scoped>
+:deep(.avue-crud__left) {
+  width: 100%;
+}
 #charts {
   width: 100%;
   height: 300px;
+  border: 1px solid #ccc;
 }
 </style>