Pārlūkot izejas kodu

Merge branch 'master' of http://192.168.101.4:3000/jiaxiaoqiang/JG-ADMIN-TEMP

jiaxiaoqiang 1 gadu atpakaļ
vecāks
revīzija
573a3cce73
39 mainītis faili ar 2489 papildinājumiem un 461 dzēšanām
  1. 1 1
      .env.development
  2. 3 3
      src/api/bom/index.ts
  3. 15 0
      src/api/material/index.ts
  4. 14 0
      src/api/order/index.ts
  5. 17 0
      src/api/productionLine/index.ts
  6. 5 0
      src/api/productionLine/types.ts
  7. 31 0
      src/api/station/index.ts
  8. 27 0
      src/api/station/types.ts
  9. 2 2
      src/api/workShop/index.ts
  10. 3 2
      src/api/workShop/types.ts
  11. 5 0
      src/common/configs/buttonPermission.ts
  12. 4 0
      src/common/configs/dictDataUtil.ts
  13. 47 0
      src/common/configs/dictDataUtil.ts~
  14. 236 0
      src/components/CommonTable/configs/tableConfig.ts
  15. 6 2
      src/components/CommonTable/index.vue
  16. 24 1
      src/hooks/userCrud.ts
  17. 2 0
      src/store/modules/dictionary.ts
  18. 8 0
      src/views/base/bom/columns.ts
  19. 132 57
      src/views/base/bom/index.vue
  20. 16 0
      src/views/base/craftManagement/process/index.vue
  21. 180 0
      src/views/base/defectMana/index.vue
  22. 61 6
      src/views/base/modeling/factory/index.vue
  23. 115 0
      src/views/base/modeling/production-line/capacity/columns.ts
  24. 6 0
      src/views/base/modeling/production-line/capacity/index.vue
  25. 1 1
      src/views/base/modeling/station/columns.ts
  26. 39 0
      src/views/base/modeling/station/components/columns.ts
  27. 162 0
      src/views/base/modeling/station/components/station-page.vue
  28. 24 3
      src/views/base/modeling/station/index.vue
  29. 0 1
      src/views/device/maintenance/components/record-page.vue
  30. 224 0
      src/views/plan/order/components/order-page.vue
  31. 20 2
      src/views/plan/order/index.vue
  32. 126 0
      src/views/plan/workOrder/components/choice-line-page.vue
  33. 171 0
      src/views/plan/workOrder/components/choice-route-page.vue
  34. 105 0
      src/views/plan/workOrder/components/choice-workshop-page.vue
  35. 82 0
      src/views/plan/workOrder/components/work-order-seq.vue
  36. 396 379
      src/views/plan/workOrder/index.vue
  37. 0 0
      src/views/storage/stock/index.vue
  38. 178 0
      src/views/storage/storage/index.vue
  39. 1 1
      src/views/system/dict/components/dict-item.vue

+ 1 - 1
.env.development

@@ -11,7 +11,7 @@ VITE_APP_BASE_API = '/dev-api'
 # VITE_APP_API_URL = http://vapi.youlai.tech
 # 开发接口地址
 # VITE_APP_API_URL = 'http://192.168.101.4:8078'
-VITE_APP_API_URL = 'http://192.168.101.188:8078'
+VITE_APP_API_URL = 'http://192.168.101.64:8078'
 # VITE_APP_API_URL = 'http://192.168.101.30:8078'  //lup
 #VITE_APP_API_URL = 'http://192.168.101.64:8078'  #hetao
 

+ 3 - 3
src/api/bom/index.ts

@@ -3,14 +3,14 @@ import { AxiosPromise } from "axios";
 import { BomInfo} from "./types";
 
 /**
- * 修改用户
+ * 批量新增BOM单
  *
  * @param id
  * @param data
  */
-export function getList(data: BomInfo) {
+export function batchAddBom(data: any) {
   return request({
-    url: "/api/v1/base/materialBom/list",
+    url: "/api/v1/base/materialBom/batchAdd",
     method: "post",
     data: data,
   });

+ 15 - 0
src/api/material/index.ts

@@ -0,0 +1,15 @@
+import request from "@/utils/request";
+import { AxiosPromise } from "axios";
+
+/**
+ * 获取物料信息
+ *
+ * @param id
+ * @param data
+ */
+export function getMaterialDetails(materialCode: String): AxiosPromise<any> {
+  return request({
+    url: "/api/v1/base/material/getDetails/" + materialCode,
+    method: "get",
+  });
+}

+ 14 - 0
src/api/order/index.ts

@@ -112,3 +112,17 @@ export function importOrder(importData: any) {
     },
   });
 }
+
+export function apsWorkOrder(params: any) {
+  return request({
+    url: "/api/v1/plan/aps/scheduling",
+    method: "post",
+    data: params,
+  });
+}
+export function distributeWorkOrder(workOrderId: any) {
+  return request({
+    url: "/api/v1/plan/aps/distribute/" + workOrderId,
+    method: "get",
+  });
+}

+ 17 - 0
src/api/productionLine/index.ts

@@ -0,0 +1,17 @@
+import request from "@/utils/request";
+import { AxiosPromise } from "axios";
+import { ProductionLineInfo} from "./types";
+
+/**
+ * 修改产线
+ *
+ * @param id
+ * @param data
+ */
+export function updateProductionLine(data: ProductionLineInfo) {
+  return request({
+    url: "/api/v1/base/productionLine/update",
+    method: "post",
+    data: data,
+  });
+}

+ 5 - 0
src/api/productionLine/types.ts

@@ -0,0 +1,5 @@
+export interface ProductionLineInfo {
+  id?:number;
+  code?: string;
+  parentCode?: string;
+}

+ 31 - 0
src/api/station/index.ts

@@ -0,0 +1,31 @@
+import request from "@/utils/request";
+import { AxiosPromise } from "axios";
+import {Station, StationDevice} from "./types";
+
+/**
+ * 修改工位
+ *
+ * @param id
+ * @param data
+ */
+export function updateStation(data: Station) {
+  return request({
+    url: "/api/v1/base/station/update",
+    method: "post",
+    data: data,
+  });
+}
+
+/**
+ * 工位绑定设备
+ *
+ * @param id
+ * @param data
+ */
+export function addStationDevice(data: StationDevice) {
+  return request({
+    url: "/api/v1/base/stationDevice/add",
+    method: "post",
+    data: data,
+  });
+}

+ 27 - 0
src/api/station/types.ts

@@ -0,0 +1,27 @@
+/**
+ *
+ * 工位绑定产线参数
+ *
+ */
+
+export interface Station {
+  id?:number;
+  //工位编码
+  code?: string;
+  //上级产线编码
+  parentCode?: string;
+}
+
+
+/**
+ *
+ * 工位绑定设备参数
+ *
+ */
+
+export interface StationDevice {
+  //工位id
+  stationId?: number;
+  //设备编号
+  deviceNo?: string;
+}

+ 2 - 2
src/api/workShop/index.ts

@@ -3,14 +3,14 @@ import { AxiosPromise } from "axios";
 import { WorkShopInfo} from "./types";
 
 /**
- * 修改用户
+ * 修改车间
  *
  * @param id
  * @param data
  */
 export function updateWorkShop(data: WorkShopInfo) {
   return request({
-    url: "/api/v1/base/materialBom/list",
+    url: "/api/v1/base/workShop/update",
     method: "post",
     data: data,
   });

+ 3 - 2
src/api/workShop/types.ts

@@ -1,4 +1,5 @@
 export interface WorkShopInfo {
-  id?: number;
-  parentId?: number;
+  id?:number;
+  code?: string;
+  parentCode?: string;
 }

+ 5 - 0
src/common/configs/buttonPermission.ts

@@ -45,6 +45,7 @@ const ButtonPermKeys = {
     CATALOG: "plan",
     MENUS: {
       order: "plan:order",
+      workOrder: "plan:workOrder",
     },
     BTNS: {
       order_add: "plan:order:add",
@@ -52,6 +53,10 @@ const ButtonPermKeys = {
       order_del: "plan:order:del",
       order_import: "plan:order:import",
       order_export: "plan:order:export",
+      work_order_add: "plan:workOrder:add",
+      work_order_edit: "plan:workOrder:edit",
+      work_order_del: "plan:workOrder:del",
+      work_order_aps: "plan:workOrder:aps",
     },
   },
   //设备管理

+ 4 - 0
src/common/configs/dictDataUtil.ts

@@ -9,6 +9,8 @@ const DictDataUtil = {
     plan_order_type: "plan_order_type",
     //订单优先级
     plan_order_priority: "plan_order_priority",
+    //工单状态
+    plan_work_order_state: "plan_work_order_state",
     //订单状态
     plan_order_state: "plan_order_state",
     //设备类型
@@ -21,6 +23,8 @@ const DictDataUtil = {
     device_maintenance_cycle: "device_maintenance_cycle",
     // 工艺路线类型
     routing_type: "routing_type",
+	//缺陷管理
+	defect_mana: "defect_mana",
     //封装方法
     packaging_method: "packaging_method",
     //岗位组

+ 47 - 0
src/common/configs/dictDataUtil.ts~

@@ -0,0 +1,47 @@
+// 所有的字典类型typeCode都要在这里面写。
+
+const DictDataUtil = {
+  request_url:
+    import.meta.env.VITE_APP_BASE_API + "/api/v1/sys/dictData/queryByType/",
+  dept_tree_url: import.meta.env.VITE_APP_BASE_API + "/api/v1/sys/dept/orgTree",
+  TYPE_CODE: {
+    //订单类型
+    plan_order_type: "plan_order_type",
+    //订单优先级
+    plan_order_priority: "plan_order_priority",
+    //订单状态
+    plan_order_state: "plan_order_state",
+    //设备类型
+    device_type: "device_type",
+    //设备状态
+    device_status: "device_status",
+    //设备运行状态
+    device_run_status: "device_run_status",
+    //设备维护频率
+    device_maintenance_cycle: "device_maintenance_cycle",
+    // 工艺路线类型
+    routing_type: "routing_type",
+    //封装方法
+    packaging_method: "packaging_method",
+    //岗位组
+    post_group: "post_group",
+    //岗位类别
+    post_type: "post_type",
+    //仓库类型
+    warehouse_type: "warehouse_type",
+    //货位类型
+    storage_location_type: "storage_location_type"
+  },
+  EXPAND_FIELD_TABLE: {
+    //字段类型
+    expand_field_type: "expand_field_type",
+    //映射表列表
+    expand_table_list: "expand_field_table",
+    //订单计划表
+    plan_order_info: "plan_order_info",
+    //映射字段列表
+    expand_field_list: "expand_field_list",
+  },
+};
+
+export default DictDataUtil;

+ 236 - 0
src/components/CommonTable/configs/tableConfig.ts

@@ -176,4 +176,240 @@ export const tableConfig = {
   },
 
 
+  PRODUCTIONLINE: {
+    url: "/api/v1/base/productionLine",
+    column: [
+      {
+        label: "产线名称",
+        prop: "name",
+        search: true,
+        rules: [{
+          required: true,
+          message: "请填写产线名称",
+          trigger: "blur"
+        }],
+      },
+      {
+        label: "产线负责人",
+        prop: "manager",
+        rules: [{
+          required: true,
+          message: "请选择产线负责人",
+          trigger: "blur"
+        }],
+        type: 'select',
+        dicUrl:import.meta.env.VITE_APP_BASE_API+"/api/v1/sys/user/list",
+        dicMethod:"post",
+        props: {
+          label: "userName", // 下拉菜单显示的字段
+          value: "userName" // 下拉菜单值的字段
+        },
+      },
+      {
+        label: "产线位置",
+        prop: "position",
+      },
+      {
+        label: "所属车间",
+        prop: "workShopName",
+        display:false
+      },
+      {
+        label: "产线描述",
+        prop: "remark",
+      },
+      {
+        label: "创建人",
+        prop: "creator",
+        display:false
+      },
+      {
+        label: "创建时间",
+        prop: "created",
+        display:false
+      },
+    ],
+  },
+
+  STATION: {
+    url: "/api/v1/base/station",
+    column: [
+      {
+        label: "工位编号",
+        prop: "stationCode",
+        search: true,
+        rules: [{
+          required: true,
+          message: "请填写工位编号",
+          trigger: "blur"
+        }],
+      },
+      {
+        label: "工位名称",
+        prop: "name",
+        search: true,
+        rules: [{
+          required: true,
+          message: "请填写工位名称",
+          trigger: "blur"
+        }],
+      },
+      {
+        label: "工位类型",
+        prop: "stationDictValue",
+        search: true,
+        rules: [{
+          required: true,
+          message: "请选择工位类型",
+          trigger: "blur"
+        }],
+        type: 'select',
+        dicData:dicts.station_type,
+        searchClearable: false, //可清空的输入框,默认为true
+        filterable: true, //添加filterable属性即可启用搜索功能
+        props: {
+          label: "dictLabel", // 下拉菜单显示的字段
+          value: "dictValue" // 下拉菜单值的字段
+        },
+      },
+      {
+        label: "工位操作方式",
+        prop: "operateDictValue",
+        rules: [{
+          required: true,
+          message: "请选择工位方式",
+          trigger: "blur"
+        }],
+        type: 'select',
+        dicData:dicts.station_operate_type,
+        props: {
+          label: "dictLabel", // 下拉菜单显示的字段
+          value: "dictValue" // 下拉菜单值的字
+        },
+      },
+      {
+        label: "工位负责人",
+        prop: "manager",
+        rules: [{
+          required: true,
+          message: "请选择工位负责人",
+          trigger: "blur"
+        }],
+        type: 'select',
+        dicUrl:import.meta.env.VITE_APP_BASE_API+"/api/v1/sys/user/list",
+        dicMethod:"post",
+        props: {
+          label: "userName", // 下拉菜单显示的字段
+          value: "userName" // 下拉菜单值的字段
+        },
+      },
+      {
+        label: "所属产线",
+        prop: "productionLineName",
+        display:false
+      },
+      {
+        label: "工位地址",
+        prop: "position",
+        rules: [{
+          required: true,
+          message: "请填写工位地址",
+          trigger: "blur"
+        }],
+      },
+      {
+        label: "工位IP地址",
+        prop: "stationIp",
+        rules: [{
+          required: true,
+          message: "请填写工位IP地址",
+          trigger: "blur",
+        }],
+
+      },
+      {
+        label: "工位描述",
+        prop: "remark",
+        type: 'textarea',
+        span: 24,
+      },
+      {
+        label: "创建人",
+        prop: "creator",
+        display:false
+      },
+      {
+        label: "创建时间",
+        prop: "created",
+        display:false
+      },
+    ],
+  },
+
+
+  DEVICE: {
+    url: "/api/v1/device",
+    column: [
+      {
+        label: "设备编号",
+        prop: "deviceNo",
+        search: true,
+        width: '120',
+        rules: [
+          {
+            required: true,
+            message: "设备编号不能为空",
+            trigger: "trigger",
+          },
+        ],
+      },
+      {
+        label: "设备名称",
+        prop: "deviceName",
+        search: true,
+        width: '120',
+        rules: [
+          {
+            required: true,
+            message: "设备名称不能为空",
+            trigger: "trigger",
+          },
+        ],
+      },
+      {
+        label: "设备类型",
+        prop: "deviceType",
+        type: "select",
+        search: true,
+        width: '100',
+        dicData:
+          dicts.device_type,
+        props: {
+          label: "dictLabel",
+          value: "dictValue",
+        },
+      },
+      {
+        label: "负责人",
+        width: '100',
+        prop: "head",
+      },
+      {
+        label: "设备位置",
+        width: '150',
+        prop: "devicePosition",
+      },
+      {
+        label: "规格",
+        width: '150',
+        prop: "specifications",
+      },
+      {
+        label: "品牌",
+        width: '150',
+        prop: "brand",
+      },
+    ],
+  },
+
 };

+ 6 - 2
src/components/CommonTable/index.vue

@@ -16,6 +16,10 @@
       @row-save="createRow"
       @row-update="updateRow"
       @row-del="deleteRow"
+      @search-change="searchChange"
+      @search-reset="resetChange"
+      @size-change="dataList"
+      @current-change="dataList"
       @selection-change="selectionChange"
     />
 
@@ -50,11 +54,11 @@ const startSelect = () => {
 };
 
 // 传入一个url,后面不带/
-const { url, form, data, option, search, page, toDeleteIds, Methords, Utils } =
+const { url, form, data, option, search, page, toDeleteIds, Methords, Utils, } =
   useCrud({
     src: tableConfig[props.tableType].url,
   });
-const { dataList, createRow, updateRow, deleteRow } = Methords; //增删改查
+const { dataList, createRow, updateRow, deleteRow , searchChange, resetChange} = Methords; //增删改查
 const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
 
 const crudRef = ref(null); //crudRef.value 获取avue-crud对象

+ 24 - 1
src/hooks/userCrud.ts

@@ -121,7 +121,30 @@ export const useCrud = (config?: UseCrudConfig) => {
         config?.done && config?.done();
       }
     },
-
+    dataNoPageList: async (config?: UseCrudConfig) => {
+      handleSearchData();
+      try {
+        const res = await request({
+          url: `${url.value}/list`,
+          method: "post",
+          data: {
+            ...search.value,
+          },
+        });
+        if (res?.data) {
+          data.value = res?.data || [];
+        }
+        for (let i = 0; i < data.value.length; i++) {
+          data.value[i].$cellEdit=true;
+        }
+        console.info(data);
+        config?.done && config?.done();
+      } catch (err) {
+        config?.loading && config?.loading();
+      } finally {
+        config?.done && config?.done();
+      }
+    },
     createRow: (row: any, done: () => void, loading: () => void) => {
       save({ row: row, done: done, loading: loading });
     },

+ 2 - 0
src/store/modules/dictionary.ts

@@ -16,6 +16,7 @@ export const useDictionaryStore = defineStore("dictionaryStore", {
       "packaging_method",
       "quality_grade",
       "selection_type",
+      "device_type",
       "stage",
       "danwei_type",
       "process_type",
@@ -39,5 +40,6 @@ export const useDictionaryStore = defineStore("dictionaryStore", {
 });
 
 export function useDictionaryStoreHook() {
+	// console.log('dicts:',useDictionaryStore(store))
   return useDictionaryStore(store);
 }

+ 8 - 0
src/views/base/bom/columns.ts

@@ -25,10 +25,18 @@ export const columns = [
   {
     label: "物料属性",
     prop: "bomMaterialAttribute",
+    type: 'select',
+    dicData:dicts.material_properties,
+    props: { label: "dictLabel", value: "dictValue" },
   },
   {
     label: "物料数量",
     prop: "bomMaterialNumber",
+    min:0,
+    slot:true,
+    cell: true,
+    type: "number",
+    precision: 2,
   },
 
 

+ 132 - 57
src/views/base/bom/index.vue

@@ -1,41 +1,45 @@
 <template>
   <div class="mainContentBox">
+    <!--{{dataDetail}}-->
+    <!--{{dicts}}-->
+    <div class="detail">
+      <div class="title-detail">物料名称:{{dataDetail.materialCode}}</div>
+      <div class="title-detail">物料编码:{{dataDetail.materialName}}</div>
+      <div class="title-detail">物料属性:{{dataDetail.attributeDictLabel}}</div>
+    </div>
     <avue-crud
       ref="crudRef"
       v-model:search="search"
       v-model="form"
       :data="data"
       :option="option"
-      v-model:page="page"
       @row-update="updateRow"
       @row-del="deleteRow"
       @search-change="searchChange"
       @search-reset="resetChange"
-      @size-change="dataBomList"
-      @current-change="dataBomList"
       @selection-change="selectionChange"
     >
       <template #menu-left="{ size }">
         <el-button
-          type="danger"
+          type="primary"
           icon="el-icon-plus"
           @click="openMaterial"
           >新增</el-button
         ></template>
-        <template #menu="{row,index,type}">
-          <el-button @click="binding(row)"
-                     icon="el-icon-link"
-                     text
-                     type="primary"
-          >BOM</el-button>
-        </template>
+
         <CommonTable
           ref="ctableRef"
-          tableTitle="绑定子项"
+          tableTitle="物料选择"
           tableType="BOM"
           @selected-sure="onSelectedFinish"
         />
+      <template #footer>
+        <div class="detail-footer">
+          <el-button type="primary" @click="onSelected"> 保存 </el-button>
+          <el-button @click="routeBack">取消</el-button>
 
+        </div>
+      </template>
       <template #menu-right="{}">
         <el-dropdown split-button
           >导入
@@ -52,17 +56,11 @@
             </el-dropdown-menu>
           </template>
         </el-dropdown>
-        <el-button
-          class="ml-3"
-          @click="exportData('/api/v1/plan/order/export')"
-        >
-          <template #icon> <i-ep-download /> </template>导出
-        </el-button>
       </template>
     </avue-crud>
     <CommonTable
       ref="ctableRef"
-      tableTitle="绑定子项"
+      tableTitle="BOM添加"
       tableType="MARTERIAL"
       @selected-sure="onSelectedFinish"
     />
@@ -78,30 +76,33 @@ import { useCommonStoreHook, useDictionaryStoreHook } from "../../../store/index
 import {
   getList,
 } from "@/api/bom";
+import {
+  getMaterialDetails,
+} from "@/api/material";
+
+import {
+  batchAddBom,
+} from "@/api/bom";
 const { isShowTable, tableType } = toRefs(useCommonStoreHook());
 // 数据字典相关
 const { dicts } = useDictionaryStoreHook();
 const router = useRouter();
 const route = useRoute();
+
+const dataDetail=ref({});
 const test = () => {
   isShowTable.value = true;
   tableType.value = tableType.value == 1 ? 2 : 1;
 };
-
 const openMaterial=()=>{
   if (ctableRef.value) {
     ctableRef.value.startSelect();
   }
 }
 const formData=ref({});
-const dataBomList=()=>{
-  formData.materialCode=route.params.materialCode;
-  getList(formData).then((data: any) => {
-    ElMessage({
-      message: data.msg,
-      type: "success",
-    });
-  });
+const dataBomLists=()=>{
+  search.value.materialCode=route.value.materialCode;
+  dataNoPageList();
 }
 
 const ctableRef = ref(null);
@@ -111,16 +112,47 @@ const binding = (row) => {
     ctableRef.value.startSelect();
   }
 };
-const dialog = reactive({
-  title: "绑定子项",
-  visible: false,
-});
+const onSelected=()=>{
+  for(var i=0;i<data.value.length;i++){
+    if(data.value[i].bomMaterialNumber<=0){
+      ElMessage({
+        message: data.value[i].bomMaterialName+"数量不能为0",
+        type: "error",
+      });
+      return;
+    }
+  }
+  if(data.value.length===0){
+    ElMessage({
+      message: "物料记录不能为空!",
+      type: "error",
+    });
+    return;
+  }
+  batchAddBom(data.value).then(
+    (data: any)=>{
+      if(data.code==="200") {
+        ElMessage({
+          message: data.msg,
+          type: "success",
+        });
+        router.back();
+      }
+      else {
+        ElMessage({
+          message: data.msg,
+          type: "error",
+        });
+      }
+    }
+  );
+}
 // 传入一个url,后面不带/
 const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
   useCrud({
     src: "/api/v1/base/materialBom",
   });
-const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
+const { dataNoPageList,createRow, updateRow, deleteRow, searchChange, resetChange } =
   Methords; //增删改查
 const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
 const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
@@ -136,16 +168,10 @@ const crudRef = ref(null); //crudRef.value 获取avue-crud对象
 
 onMounted(() => {
   // console.log("crudRef", crudRef)
-  formData.materialCode=route.params.materialCode;
-  getList(formData).then((data: any) => {
-    ElMessage({
-      message: data.msg,
-      type: "success",
-    });
-    // 上传完成后的刷新操作
-    page.currentPage = 1;
-    dataList();
-  });
+  search.value.materialCode=route.params.materialCode;
+  queryMaterialDetail();
+  dataNoPageList();
+
 });
 
 /**
@@ -154,8 +180,7 @@ onMounted(() => {
 const uploadRef = ref(null);
 const uploadFinished = () => {
   // 上传完成后的刷新操作
-  page.currentPage = 1;
-  dataList();
+  dataNoPageList();
 };
 const importExcelData = () => {
   if (uploadRef.value) {
@@ -166,20 +191,70 @@ const importExcelData = () => {
 // 设置表格列或者其他自定义的option
 option.value = Object.assign(option.value, {
   selection: true,
+  addBtn: false,
+  viewBtn: false,
+  editBtn:false,
+  saveBtn:false,
+  cellBtn: true,
   column: columns,
 });
-
+const routeBack =()=>{
+  router.back();
+}
 const onSelectedFinish = (selectedValue) => {
- /* formData.id=selectedValue.id;
-  formData.parentId=factory.value.id;
-  updateWorkShop(formData).then((data: any) => {
-    ElMessage({
-      message: data.msg,
-      type: "success",
-    });
-    // 上传完成后的刷新操作
-    page.currentPage = 1;
-    dataList();
-  });*/
+  for(var i=0;i<data.value.length;i++){
+    if(data.value[i].bomMaterialCode===selectedValue.materialCode){
+      ElMessage({
+        message: data.value[i].bomMaterialName+"已经添加过了",
+        type: "error",
+      });
+      return;
+    }
+  }
+  const bom=ref({
+    materialCode:route.params.materialCode,
+    bomMaterialCode:selectedValue.materialCode,
+    bomMaterialName:selectedValue.materialName,
+    bomMaterialAttribute:selectedValue.attributeDictValue,
+    bomMaterialNumber:0,
+    $cellEdit:true,
+  });
+  data.value.push(bom.value);
+};
+const queryMaterialDetail = () => {
+  getMaterialDetails(route.params.materialCode).then(
+
+    ({ data }) => {
+      dataDetail.value=data;
+      dicts.material_properties;
+      for(var i=0;i<dicts.material_properties.length;i++){
+        if(data.attributeDictValue===dicts.material_properties[i].dictValue){
+          dataDetail.value.attributeDictLabel=dicts.material_properties[i].dictLabel;
+        }
+      }
+
+    }
+  );
 };
 </script>
+<style type="text/css">
+  .title-detail{
+    width: 30%;
+    height: 50px;
+    line-height: 50px;
+    margin: 25px 20px 25px 0;
+    float: left;
+  }
+  .detail{
+    margin: 0 auto;
+    width: 100%;
+  }
+  .avue-crud{
+    float: left;
+  }
+  .detail-footer{
+    float: right;
+    margin-top:15px;
+  }
+
+</style>

+ 16 - 0
src/views/base/craftManagement/process/index.vue

@@ -302,6 +302,7 @@ option.value = Object.assign(option.value, {
       label: "是否可跳过",
       prop: "skipped",
       span: 8,
+	  hide: true,
       type: "switch",
       dicData: switchOp,
       value: 0,
@@ -309,6 +310,7 @@ option.value = Object.assign(option.value, {
     {
       label: "是否禁用",
       prop: "enabled",
+	  hide: true,
       span: 8,
       type: "switch",
       dicData: switchOp,
@@ -318,6 +320,7 @@ option.value = Object.assign(option.value, {
       label: "是否外协",
       prop: "externalCooperation",
       span: 8,
+	  hide: true,
       type: "switch",
       dicData: switchOp,
       value: 0,
@@ -326,6 +329,7 @@ option.value = Object.assign(option.value, {
       label: "是否首检",
       prop: "firstCheck",
       span: 8,
+	  hide: true,
       type: "switch",
       dicData: switchOp,
       value: 0,
@@ -334,6 +338,7 @@ option.value = Object.assign(option.value, {
       label: "是否巡检",
       prop: "inspection",
       span: 8,
+	  hide: true,
       type: "switch",
       dicData: switchOp,
       value: 0,
@@ -342,6 +347,7 @@ option.value = Object.assign(option.value, {
       label: "是否自检",
       prop: "selfCheck",
       span: 8,
+	  hide: true,
       type: "switch",
       dicData: switchOp,
       value: 0,
@@ -350,6 +356,7 @@ option.value = Object.assign(option.value, {
       label: "是否工艺数量",
       prop: "common",
       span: 8,
+	  hide: true,
       type: "switch",
       dicData: switchOp,
       value: 0,
@@ -358,6 +365,7 @@ option.value = Object.assign(option.value, {
       label: "是否分批",
       prop: "batch",
       span: 8,
+	  hide: true,
       type: "switch",
       dicData: switchOp,
       value: 0,
@@ -366,6 +374,7 @@ option.value = Object.assign(option.value, {
       label: "是否合批",
       prop: "merge",
       span: 8,
+	  hide: true,
       type: "switch",
       dicData: switchOp,
       value: 0,
@@ -374,12 +383,14 @@ option.value = Object.assign(option.value, {
       label: "合批数量",
       prop: "mergeNum",
       span: 5,
+	  hide: true,
       value: 0,
     },
     {
       label: "是否委外",
       prop: "outsourcing",
       span: 8,
+	  hide: true,
       type: "switch",
       dicData: switchOp,
       value: 0,
@@ -388,6 +399,7 @@ option.value = Object.assign(option.value, {
       label: "分批数量",
       prop: "batchNum",
       span: 5,
+	  hide: true,
       value: 0,
       // slot:true, // 自定义列
     },
@@ -395,12 +407,14 @@ option.value = Object.assign(option.value, {
       label: "外协时间",
       prop: "outTime",
       span: 5,
+	  hide: true,
       value: 0,
       // slot:true, // 自定义列
     },
     {
       label: "前置时间",
       prop: "forceTime",
+	  hide: true,
       span: 6,
       value: 0,
       rules: [
@@ -415,12 +429,14 @@ option.value = Object.assign(option.value, {
     {
       label: "工序描述",
       prop: "operationDesc",
+	  hide: true,
       span: 24,
       type: "textarea",
     },
     {
       label: "备注",
       prop: "remark",
+	  hide: true,
       span: 24,
       type: "textarea",
     },

+ 180 - 0
src/views/base/defectMana/index.vue

@@ -0,0 +1,180 @@
+<template>
+  <div class="mainContentBox">
+    <avue-crud
+      ref="crudRef"
+      v-model:search="search"
+      v-model="form"
+      :data="data"
+      :option="option"
+      v-model:page="page"
+      @row-save="createRow"
+      @row-update="updateRow"
+      @row-del="deleteRow"
+      @search-change="searchChange"
+      @search-reset="resetChange"
+      @size-change="dataList"
+      @current-change="dataList"
+      @selection-change="selectionChange"
+    >
+      <template #menu-left="{ size }">
+        <el-button
+          :disabled="toDeleteIds.length < 1"
+          type="danger"
+          icon="el-icon-delete"
+          :size="size"
+          @click="multipleDelete"
+          >删除</el-button
+        >
+      </template>
+      <!-- <template #menu-right="{}">
+        <el-dropdown split-button
+          >导入
+          <template #dropdown>
+            <el-dropdown-menu>
+              <el-dropdown-item
+                @click="downloadTemplate('/api/v1/plan/order/template')"
+              >
+                <i-ep-download />下载模板
+              </el-dropdown-item>
+              <el-dropdown-item @click="importExcelData">
+                <i-ep-top />导入数据
+              </el-dropdown-item>
+            </el-dropdown-menu>
+          </template>
+        </el-dropdown>
+        <el-button
+          class="ml-3"
+          @click="exportData('/api/v1/plan/order/export')"
+        >
+          <template #icon> <i-ep-download /> </template>导出
+        </el-button>
+      </template> -->
+    </avue-crud>
+    <ExcelUpload ref="uploadRef" @finished="uploadFinished" />
+  </div>
+</template>
+<script setup>
+import { ref, getCurrentInstance } from "vue";
+import { useCrud } from "@/hooks/userCrud";
+import dictDataUtil from "@/common/configs/dictDataUtil";
+import ButtonPermKeys from "@/common/configs/buttonPermission";
+import { useCommonStoreHook, useDictionaryStoreHook } from "@/store";
+
+// 数据字典相关
+const { dicts } = useDictionaryStoreHook();
+
+// 传入一个url,后面不带/
+const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
+  useCrud({
+    src: "/api/v1/op/baseBug",
+  });
+const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
+  Methords; //增删改查
+const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
+const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
+// checkBtnPerm(ButtonPermKeys.PLAN.BTNS.order_add) :permission="permission"
+// const permission = reactive({
+//   delBtn: checkPerm(buttonPermission.PLAN.BTNS.order_del),
+//   addBtn: checkPerm(buttonPermission.PLAN.BTNS.order_add),
+//   editBtn: checkPerm(buttonPermission.PLAN.BTNS.order_edit),
+//   menu: true,
+// });
+
+const crudRef = ref(null); //crudRef.value 获取avue-crud对象
+
+onMounted(() => {
+  // console.log("crudRef", crudRef)
+  dataList();
+});
+
+/**
+ * 上传excel相关
+ */
+const uploadRef = ref(null);
+const uploadFinished = () => {
+  // 上传完成后的刷新操作
+  page.currentPage = 1;
+  dataList();
+};
+const importExcelData = () => {
+  if (uploadRef.value) {
+    uploadRef.value.show("/api/v1/plan/order/import");
+  }
+};
+
+// 设置表格列或者其他自定义的option
+const switchOp = [
+  {
+    label: "",
+    value: 0,
+  },
+  {
+    label: "",
+    value: 1,
+  },
+];
+option.value = Object.assign(option.value, {
+  selection: true,
+  column: [
+	{
+	  label: "缺陷类型",
+	  prop: "bugType",
+	  minWidth: 200,
+	  search: true,
+	  overHidden: true,
+	  rules: [
+	    {
+	      required: true,
+	      message: "缺陷类型不能为空",
+	      trigger: "change",
+	    },
+	  ],
+	  type: "select",
+	  dicUrl: dictDataUtil.request_url + dictDataUtil.TYPE_CODE.defect_mana,
+	  props: {
+	    label: "dictLabel",
+	    value: "dictValue",
+	  },
+	},
+    {
+      label: "缺陷编码",
+      prop: "bugCode",
+      span: 12,
+      search: true,
+      rules: [
+        {
+          required: true,
+          message: "缺陷编码不能为空",
+          trigger: "blur",
+        },
+      ],
+    },
+    {
+      label: "缺陷名称",
+      prop: "bugName",
+      span: 12,
+      search: true,
+      rules: [
+        {
+          required: true,
+          message: "缺陷名称不能为空",
+          trigger: "blur",
+        },
+      ],
+    },
+	{
+      label: "备注",
+      prop: "remark",
+      span: 12,
+      search: true,
+      rules: [
+        {
+          required: false,
+          message: "备注不能为空",
+          trigger: "blur",
+        },
+      ],
+    }
+  ],
+});
+</script>

+ 61 - 6
src/views/base/modeling/factory/index.vue

@@ -1,5 +1,3 @@
-
-
 <template>
   <div class="mainContentBox">
     <avue-crud
@@ -44,6 +42,18 @@
         tableType="FACTORY"
         @selected-sure="onSelectedFinish"
       />
+    <CommonTable
+      ref="workShopRef"
+      tableTitle="绑定子项"
+      tableType="PRODUCTIONLINE"
+      @selected-sure="onSelectedLineFinish"
+    />
+    <CommonTable
+      ref="productionLineRef"
+      tableTitle="绑定子项"
+      tableType="STATION"
+      @selected-sure="onSelectedStationFinish"
+    />
 
     <ExcelUpload ref="uploadRef" @finished="uploadFinished" />
   </div>
@@ -57,14 +67,30 @@
   import {
     updateWorkShop,
   } from "@/api/workShop";
+
+  import {
+    updateProductionLine,
+  } from "@/api/productionLine";
+  import {
+    updateStation,
+  } from "@/api/station";
   // 公共弹窗相关
   const ctableRef = ref(null);
+  const workShopRef=ref(null);
+  const productionLineRef=ref(null);
   const factory=ref({});
   const binding = (row) => {
     factory.value=row;
-    if (ctableRef.value) {
+    if (row.level==="first") {
       ctableRef.value.startSelect();
     }
+    if(row.level==="second"){
+      workShopRef.value.startSelect();
+    }
+    if(row.level==="third"){
+      productionLineRef.value.startSelect();
+    }
+
   };
   const dialog = reactive({
     title: "绑定子项",
@@ -116,8 +142,8 @@
     menuWidth: 320,
     border: true,
     index: true,
-    rowKey: 'id',
-    rowParentKey: 'parentId',
+    rowKey: 'code',
+    rowParentKey: 'parentCode',
     column: [
       {
         label: "厂区名称",
@@ -177,8 +203,9 @@
 
 
   const onSelectedFinish = (selectedValue) => {
+    formData.code=selectedValue.code;
+    formData.parentCode=factory.value.code;
     formData.id=selectedValue.id;
-    formData.parentId=factory.value.id;
     updateWorkShop(formData).then((data: any) => {
       ElMessage({
         message: data.msg,
@@ -189,6 +216,34 @@
       dataList();
     });
   };
+  const onSelectedLineFinish = (selectedValue) => {
+    formData.code=selectedValue.code;
+    formData.parentCode=factory.value.code;
+    formData.id=selectedValue.id;
+    updateProductionLine(formData).then((data: any) => {
+      ElMessage({
+        message: data.msg,
+        type: "success",
+      });
+      // 上传完成后的刷新操作
+      page.currentPage = 1;
+      dataList();
+    });
+  };
+  const onSelectedStationFinish = (selectedValue) => {
+    formData.code=selectedValue.code;
+    formData.parentCode=factory.value.code;
+    formData.id=selectedValue.id;
+    updateStation(formData).then((data: any) => {
+      ElMessage({
+        message: data.msg,
+        type: "success",
+      });
+      // 上传完成后的刷新操作
+      page.currentPage = 1;
+      dataList();
+    });
+  };
 </script>
 
 

+ 115 - 0
src/views/base/modeling/production-line/capacity/columns.ts

@@ -0,0 +1,115 @@
+import { useDictionaryStoreHook } from "@/store";
+const { dicts } = useDictionaryStoreHook();
+export const columns = [
+  {
+    label: "物料编号",
+    prop: "materialCode",
+    search: true,
+    rules: [{
+      required: true,
+      message: "请选择物料编号",
+      trigger: "blur"
+    }],
+  },
+  {
+    label: "产能",
+    prop: "capacity",
+    search: true,
+    rules: [{
+      required: true,
+      message: "请填写产能",
+      trigger: "blur"
+    }],
+  },
+  {
+    label: "工位类型",
+    prop: "stationDictValue",
+    search: true,
+    rules: [{
+      required: true,
+      message: "请选择工位类型",
+      trigger: "blur"
+    }],
+    type: 'select',
+    dicData:dicts.station_type,
+    searchClearable: false, //可清空的输入框,默认为true
+    filterable: true, //添加filterable属性即可启用搜索功能
+    props: {
+      label: "dictLabel", // 下拉菜单显示的字段
+      value: "dictValue" // 下拉菜单值的字段
+    },
+  },
+  {
+    label: "工位操作方式",
+    prop: "operateDictValue",
+    rules: [{
+      required: true,
+      message: "请选择工位方式",
+      trigger: "blur"
+    }],
+    type: 'select',
+    dicData:dicts.station_operate_type,
+    props: {
+      label: "dictLabel", // 下拉菜单显示的字段
+      value: "dictValue" // 下拉菜单值的字
+    },
+  },
+  {
+    label: "工位负责人",
+    prop: "manager",
+    rules: [{
+      required: true,
+      message: "请选择工位负责人",
+      trigger: "blur"
+    }],
+    type: 'select',
+    dicUrl:import.meta.env.VITE_APP_BASE_API+"/api/v1/sys/user/list",
+    dicMethod:"post",
+    props: {
+      label: "userName", // 下拉菜单显示的字段
+      value: "userName" // 下拉菜单值的字段
+    },
+  },
+  {
+    label: "所属产线",
+    prop: "productionLineName",
+    display:false
+  },
+  {
+    label: "工位地址",
+    prop: "position",
+    rules: [{
+      required: true,
+      message: "请填写工位地址",
+      trigger: "blur"
+    }],
+  },
+  {
+    label: "工位IP地址",
+    prop: "stationIp",
+    rules: [{
+      required: true,
+      message: "请填写工位IP地址",
+      trigger: "blur",
+    }],
+
+  },
+  {
+    label: "工位描述",
+    prop: "remark",
+    type: 'textarea',
+    span: 24,
+  },
+  {
+    label: "创建人",
+    prop: "creator",
+    display:false
+  },
+  {
+    label: "创建时间",
+    prop: "created",
+    display:false
+  },
+]
+
+

+ 6 - 0
src/views/base/modeling/production-line/capacity/index.vue

@@ -0,0 +1,6 @@
+<template>
+  <avue-form ref="formRef"
+             :option="option"
+             v-model="form"
+             @submit="handleSubmit"></avue-form>
+</template>

+ 1 - 1
src/views/base/modeling/station/columns.ts

@@ -3,7 +3,7 @@ const { dicts } = useDictionaryStoreHook();
 export const columns = [
   {
     label: "工位编号",
-    prop: "stationCode",
+    prop: "code",
     search: true,
     rules: [{
       required: true,

+ 39 - 0
src/views/base/modeling/station/components/columns.ts

@@ -0,0 +1,39 @@
+import { useDictionaryStoreHook } from "@/store";
+const { dicts } = useDictionaryStoreHook();
+export const columns = [
+  {
+    label: "设备编号",
+    prop: "deviceNo",
+    search: true,
+    rules: [{
+      required: true,
+      message: "请填写工位编号",
+      trigger: "blur"
+    }],
+  },
+  {
+    label: "设备名称",
+    prop: "deviceName",
+    search: true,
+  },
+  {
+    label: "设备类型",
+    prop: "device_type",
+    search: true,
+    rules: [{
+      required: true,
+      message: "请选择工位类型",
+      trigger: "blur"
+    }],
+    type: 'select',
+    dicData:dicts.device_type,
+    searchClearable: false, //可清空的输入框,默认为true
+    filterable: true, //添加filterable属性即可启用搜索功能
+    props: {
+      label: "dictLabel", // 下拉菜单显示的字段
+      value: "dictValue" // 下拉菜单值的字段
+    },
+  },
+]
+
+

+ 162 - 0
src/views/base/modeling/station/components/station-page.vue

@@ -0,0 +1,162 @@
+<template>
+  <div class="mainContentBox">
+    <avue-crud
+      ref="crudRef"
+      v-model:search="search"
+      v-model="form"
+      :data="data"
+      :option="option"
+      v-model:page="page"
+      @row-save="deviceList"
+      @row-update="updateRow"
+      @row-del="deleteRow"
+      @search-change="searchChange"
+      @search-reset="resetChange"
+      @size-change="dataList"
+      @current-change="dataList"
+      @selection-change="selectionChange"
+    >
+      <template #menu-left="{ size }">
+        <el-button
+          type="primary"
+          icon="el-icon-plus"
+          @click="deviceList"
+        >新增</el-button
+        >
+        <el-button
+          :disabled="toDeleteIds.length < 1"
+          type="danger"
+          icon="el-icon-delete"
+          :size="size"
+          @click="multipleDelete"
+        >删除</el-button
+        >
+      </template>
+    </avue-crud>
+    <CommonTable
+      ref="ctableRef"
+      tableTitle="设备列表"
+      tableType="DEVICE"
+      @selected-sure="onSelectedFinish"
+    />
+  </div>
+</template>
+<script setup lang="ts">
+  import { ref, getCurrentInstance } from "vue";
+  import { useCrud } from "@/hooks/userCrud";
+  import ButtonPermKeys from "@/common/configs/buttonPermission";
+  import { useCommonStoreHook } from "@/store";
+
+  const { isShowTable, tableType } = toRefs(useCommonStoreHook());
+  import { useDictionaryStoreHook } from "@/store";
+  import { columns } from "./columns";
+  import {
+    addStationDevice,
+  } from "@/api/station";
+  const test = () => {
+    isShowTable.value = true;
+    tableType.value = tableType.value == 1 ? 2 : 1;
+  };
+
+  // 传入一个url,后面不带/
+  const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
+    useCrud({
+      src: "/api/v1/base/stationDevice",
+    });
+  const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
+    Methords; //增删改查
+  const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
+  const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
+  // checkBtnPerm(ButtonPermKeys.PLAN.BTNS.order_add) :permission="permission"
+  // const permission = reactive({
+  //   delBtn: checkPerm(buttonPermission.PLAN.BTNS.order_del),
+  //   addBtn: checkPerm(buttonPermission.PLAN.BTNS.order_add),
+  //   editBtn: checkPerm(buttonPermission.PLAN.BTNS.order_edit),
+  //   menu: true,
+  // });
+  function rowSave(form,done,loading) {
+    console.info(form);
+    createRow(form,done,loading);
+
+  }
+  const crudRef = ref(null); //crudRef.value 获取avue-crud对象
+
+  onMounted(() => {
+    // console.log("crudRef", crudRef)
+    dataList();
+  });
+
+  /**
+   * 上传excel相关
+   */
+  const uploadRef = ref(null);
+  const uploadFinished = () => {
+    // 上传完成后的刷新操作
+    page.currentPage = 1;
+    dataList();
+  };
+  const importExcelData = () => {
+    if (uploadRef.value) {
+      uploadRef.value.show("/api/v1/base/stationDevice");
+    }
+  };
+  const ctableRef=ref(null);
+  const deviceList=()=>{
+    ctableRef.value.startSelect();
+  }
+
+  // 设置表格列或者其他自定义的option
+  option.value = Object.assign(option.value, {
+    selection: true,
+    column: columns,
+    saveBtn:false,
+    delBtn: false,
+    editBtn: false,
+    addBtn: false,
+    viewBtn: false,
+    menu: false,
+  });
+  const props = defineProps({
+    stationId: {
+      type: Number,
+      default: () => {
+        return 0;
+      }
+    }
+  })
+
+  watch?.(
+    () => props.stationId,
+    (newVal: string) => {
+      alert(newVal)
+      search.value.stationId = newVal
+      dataList()
+    }
+  );
+  const onSelectedFinish=(selectedValue)=>{
+    const selectDevice=ref({
+      deviceNo: selectedValue.deviceNo,
+      stationId:props.stationId,
+  });
+    console.info(selectDevice);
+    addStationDevice(selectDevice.value).then(
+      (data:any)=>{
+        if(data.code==="200") {
+          ElMessage({
+            message: data.msg,
+            type: "success",
+          });
+          router.back();
+        }
+        else {
+          ElMessage({
+            message: data.msg,
+            type: "error",
+          });
+        }
+      }
+    );
+
+  }
+</script>
+

+ 24 - 3
src/views/base/modeling/station/index.vue

@@ -26,9 +26,22 @@
         >删除</el-button
         >
       </template>
-
+      <template #menu="{row,index,type}">
+        <el-button @click="binding(row)"
+                   icon="el-icon-link"
+                   text
+                   type="primary"
+        >设备</el-button>
+      </template>
     </avue-crud>
-
+    <el-dialog
+      v-model="dialog.visible"
+      :title="dialog.title"
+      width="900px"
+      @close="dialog.visible = false"
+    >
+      <station-page  :stationId="stationDevice.id"/>
+    </el-dialog>
   </div>
 </template>
 <script setup="ts">
@@ -87,7 +100,15 @@
       uploadRef.value.show("/api/v1/base/station");
     }
   };
-
+  const dialog = reactive({
+    title: "设备绑定",
+    visible: false,
+  });
+  const stationDevice=ref(null);
+  const binding=(row)=>{
+    dialog.visible=true;
+    stationDevice.value=row;
+  }
   // 设置表格列或者其他自定义的option
   option.value = Object.assign(option.value, {
     selection: true,

+ 0 - 1
src/views/device/maintenance/components/record-page.vue

@@ -48,7 +48,6 @@ const props = defineProps({
 watch?.(
     () => props.maintenanceId,
     (newVal: string) => {
-      alert(newVal)
       search.value.maintenanceId = newVal
       dataList()
     }

+ 224 - 0
src/views/plan/order/components/order-page.vue

@@ -0,0 +1,224 @@
+<template>
+  <div class="mainContentBox">
+    <avue-crud
+        ref="crudRef"
+        v-model:search="search"
+        v-model="form"
+        :data="data"
+        :option="option"
+        v-model:page="page"
+        @row-click="rowClick"
+        @search-change="searchChange"
+        @search-reset="resetChange"
+        @size-change="dataList"
+        @current-change="dataList"
+    >
+    </avue-crud>
+  </div>
+</template>
+<script setup>
+import {defineProps, ref} from "vue";
+import { useCrud } from "@/hooks/userCrud";
+
+import { useCommonStoreHook } from "@/store";
+import dictDataUtil from "@/common/configs/dictDataUtil";
+const { isShowTable, tableType } = toRefs(useCommonStoreHook());
+const test = () => {
+  isShowTable.value = true;
+  tableType.value = tableType.value == 1 ? 2 : 1;
+};
+// 传入一个url,后面不带/
+const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
+  useCrud({
+    src: "/api/v1/plan/order",
+  });
+const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } = Methords; //增删改查
+const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
+const { checkBtnPerm, downloadTemplate } = Utils; //按钮权限等工具
+
+const crudRef = ref(null); //crudRef.value 获取avue-crud对象
+const emit = defineEmits(["orderInfo"])
+const rowClick = (row)=>{
+  emit("orderInfo", row)
+}
+const props = defineProps({
+  queryType: {
+    type: String,
+    default: () => {
+      return "0";
+    }
+  }
+})
+// 设置表格列或者其他自定义的option
+option.value = Object.assign(option.value, {
+  delBtn: false,
+  selection: false,
+  search: false,
+  editBtn: false,
+  addBtn: false,
+  viewBtn: false,
+  menu: false,
+  column: [
+    {
+      label: "订单编号",
+      prop: "orderCode",
+      search: true,
+      width: "125",
+      display: false,
+    },
+    {
+      label: "订单名称",
+      prop: "orderName",
+      search: true,
+      width: "100",
+    },
+    {
+      label: "ERP号",
+      prop: "erpCode",
+      search: true,
+      width: "100",
+    },
+    {
+      label: "产品编码",
+      prop: "materialCode",
+      search: true,
+      width: "100",
+    },
+    {
+      label: "产品名称",
+      prop: "materialName",
+      search: true,
+      width: "100",
+    },
+    {
+      label: "产品规格",
+      width: "100",
+      prop: "materialModel",
+    },
+    {
+      label: "订单状态",
+      prop: "orderState",
+      display: false,
+      width: "100",
+      type: "select", //类型为下拉选择框
+      dicUrl:
+          dictDataUtil.request_url + dictDataUtil.TYPE_CODE.plan_order_state,
+      props: {
+        label: "dictLabel",
+        value: "dictValue",
+      },
+      searchClearable: false, //可清空的输入框,默认为true
+      filterable: true, //添加filterable属性即可启用搜索功能
+    },
+    {
+      label: "订单类型",
+      prop: "orderType",
+      type: "select", //类型为下拉选择框
+      width: "100",
+      dicUrl: dictDataUtil.request_url + dictDataUtil.TYPE_CODE.plan_order_type,
+      props: {
+        label: "dictLabel",
+        value: "dictValue",
+      },
+      searchClearable: false, //可清空的输入框,默认为true
+      filterable: true, //添加filterable属性即可启用搜索功能
+    },
+    {
+      label: "订单数量",
+      prop: "orderNum",
+      type: "number",
+      width: "100",
+      min: 1,
+      max: 99999,
+    },
+    {
+      label: "排产数量",
+      prop: "scheduledNum",
+      width: "100",
+      display: false,
+    },
+    {
+      label: "优先级",
+      prop: "priority",
+      width: "100",
+      type: "select", //类型为下拉选择框
+      dicUrl:
+          dictDataUtil.request_url + dictDataUtil.TYPE_CODE.plan_order_priority,
+      props: {
+        label: "dictLabel",
+        value: "dictValue",
+      },
+      searchClearable: false, //可清空的输入框,默认为true
+      filterable: true, //添加filterable属性即可启用搜索功能
+    },
+    {
+      label: "交付日期",
+      prop: "deliverTime",
+      type: "date",
+      width: "100",
+      format: "YYYY-MM-DD", //前端展示格式
+      valueFormat: "YYYY-MM-DD", //设置后端接收的日期格式
+    },
+    {
+      label: "所属公司",
+      prop: "companyId",
+      width: "100",
+      type: "select", //类型为下拉选择框
+      dicUrl: import.meta.env.VITE_APP_BASE_API + "/api/v1/sys/dept/orgList",
+      props: {
+        label: "deptName",
+        value: "id",
+      },
+    },
+    {
+      label: "项目号",
+      width: "100",
+      prop: "projectCode",
+    },
+    {
+      label: "绑定铭牌",
+      prop: "nameplated",
+      width: "100",
+      type: "radio", //类型为单选框
+      dicData: [
+        {
+          label: "否",
+          value: 0,
+        },
+        {
+          label: "是",
+          value: 1,
+        },
+      ],
+      value: 0,
+    },
+    {
+      label: "备注",
+      prop: "remark",
+      width: "100",
+      minRows: 2, //最小行/最小值
+      type: "textarea", //类型为多行文本域框
+      maxlength: 512, //最大输入长度
+    },
+    {
+      label: "创建时间",
+      prop: "created",
+      width: "140",
+      overHidden: true,
+      type: "datetime",
+      valueFormat: "yyyy-MM-dd HH:mm:ss",
+    },
+    {
+      label: "创建人",
+      prop: "creator",
+      width: 80,
+      overHidden: true,
+    },
+  ],
+});
+
+onMounted(() => {
+  search.value.queryType = props.queryType
+  dataList();
+});
+</script>

+ 20 - 2
src/views/plan/order/index.vue

@@ -1,6 +1,7 @@
 <template>
   <div class="mainContentBox">
     <avue-crud
+        ref="crudRef"
       :option="option"
       v-model:page="page"
       v-model:search="search"
@@ -37,6 +38,17 @@
           <template #icon> <i-ep-download /> </template>导出
         </el-button>
       </template>
+      <template #menu="{size,row,index}">
+        <el-button
+            v-hasPerm="[buttonPermission.PLAN.BTNS.order_edit]"
+            v-if="row.orderState === '0' ||  row.orderState === '1' ||  row.orderState === '2'"
+            type="primary"
+            link
+            size="small"
+            @click="handleEdit(row,0)"
+        ><i-ep-edit />编辑
+        </el-button>
+      </template>
     </avue-crud>
 
     <el-dialog
@@ -101,6 +113,7 @@ import {
   updateOrder,
   getExpandAlias,
 } from "@/api/order";
+import {ref} from "vue";
 
 // 弹窗对象
 const dialog = reactive({
@@ -127,10 +140,12 @@ const permission = reactive({
   editBtn: checkPerm(buttonPermission.PLAN.BTNS.order_edit),
   menu: true,
 });
+const crudRef = ref(null); //crudRef.value 获取avue-crud对象
 option.value = {
   border: true,
   searchIndex: 3,
   searchIcon: true,
+  editBtn: false,
   //searchSpan: 4,
   searchMenuSpan: 8,
   align: "center",
@@ -145,7 +160,7 @@ option.value = {
       label: "订单编号",
       prop: "orderCode",
       search: true,
-      width: "100",
+      width: "125",
       display: false,
     },
     {
@@ -241,7 +256,7 @@ option.value = {
       prop: "orderNum",
       type: "number",
       width: "100",
-      min: 0,
+      min: 1,
       max: 99999,
       rules: [
         {
@@ -459,6 +474,9 @@ const downloadTemplate = () => {
     downFile(response);
   });
 };
+const handleEdit = (row, index) =>{
+  crudRef.value && crudRef.value.rowEdit(row, index);
+}
 /** 弹窗提交 */
 const handleSubmit = () => {
   importOrder(importData).then((data: any) => {

+ 126 - 0
src/views/plan/workOrder/components/choice-line-page.vue

@@ -0,0 +1,126 @@
+<template>
+  <div class="mainContentBox">
+    <avue-crud
+        ref="crudRef"
+        v-model:search="search"
+        v-model="form"
+        :data="data"
+        :option="option"
+        v-model:page="page"
+        @row-click="rowClick"
+        @search-change="searchChange"
+        @search-reset="resetChange"
+        @size-change="dataList"
+        @current-change="dataList"
+    >
+    </avue-crud>
+  </div>
+</template>
+<script setup>
+import {defineProps, ref} from "vue";
+import { useCrud } from "@/hooks/userCrud";
+
+import { useCommonStoreHook } from "@/store";
+import dictDataUtil from "@/common/configs/dictDataUtil";
+const { isShowTable, tableType } = toRefs(useCommonStoreHook());
+const test = () => {
+  isShowTable.value = true;
+  tableType.value = tableType.value == 1 ? 2 : 1;
+};
+
+const props = defineProps({
+  parentCode: {
+    type: String,
+    default: () => {
+      return '';
+    }
+  },
+  materialCode: {
+    type: String,
+    default: () => {
+      return '';
+    }
+  }
+})
+// 传入一个url,后面不带/
+const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
+  useCrud({
+    src: "/api/v1/base/productionLine",
+  });
+const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } = Methords; //增删改查
+const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
+const { checkBtnPerm, downloadTemplate } = Utils; //按钮权限等工具
+
+const crudRef = ref(null); //crudRef.value 获取avue-crud对象
+const emit = defineEmits(["lineInfo"])
+const rowClick = (row)=>{
+  emit("lineInfo", row)
+}
+// 设置表格列或者其他自定义的option
+option.value = Object.assign(option.value, {
+  delBtn: false,
+  selection: false,
+  search: false,
+  editBtn: false,
+  addBtn: false,
+  viewBtn: false,
+  menu: false,
+  column: [
+    {
+      label: "产线名称",
+      prop: "name",
+      search: true,
+      rules: [{
+        required: true,
+        message: "请填写产线名称",
+        trigger: "blur"
+      }],
+    },
+    {
+      label: "产线负责人",
+      prop: "manager",
+      rules: [{
+        required: true,
+        message: "请选择产线负责人",
+        trigger: "blur"
+      }],
+      type: 'select',
+      dicUrl:import.meta.env.VITE_APP_BASE_API+"/api/v1/sys/user/list",
+      dicMethod:"post",
+      props: {
+        label: "userName", // 下拉菜单显示的字段
+        value: "userName" // 下拉菜单值的字段
+      },
+    },
+    {
+      label: "产线位置",
+      prop: "position",
+    },
+    {
+      label: "所属车间",
+      prop: "workShopName",
+      display:false
+    },
+    {
+      label: "产线描述",
+      prop: "remark",
+    },
+    {
+      label: "创建人",
+      prop: "creator",
+      display:false
+    },
+    {
+      label: "创建时间",
+      prop: "created",
+      display:false
+    },
+  ],
+});
+
+onMounted(() => {
+  search.value.parentCode = props.parentCode
+  search.value.materialCode = props.materialCode
+  dataList();
+});
+</script>

+ 171 - 0
src/views/plan/workOrder/components/choice-route-page.vue

@@ -0,0 +1,171 @@
+<template>
+  <div class="mainContentBox">
+    <avue-crud
+        ref="crudRef"
+        v-model:search="search"
+        v-model="form"
+        :data="data"
+        :option="option"
+        v-model:page="page"
+        @row-click="rowClick"
+        @search-change="searchChange"
+        @search-reset="resetChange"
+        @size-change="dataList"
+        @current-change="dataList"
+    >
+    </avue-crud>
+  </div>
+</template>
+<script setup>
+import {defineProps, ref} from "vue";
+import { useCrud } from "@/hooks/userCrud";
+import { useCommonStoreHook } from "@/store";
+import dictDataUtil from "@/common/configs/dictDataUtil";
+const { isShowTable, tableType } = toRefs(useCommonStoreHook());
+const test = () => {
+  isShowTable.value = true;
+  tableType.value = tableType.value == 1 ? 2 : 1;
+};
+const props = defineProps({
+  materialCode: {
+    type: String,
+    default: () => {
+      return '';
+    }
+  }
+})
+// 传入一个url,后面不带/
+const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
+  useCrud({
+    src: "/api/v1/op/route",
+  });
+const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } = Methords; //增删改查
+const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
+const { checkBtnPerm, downloadTemplate } = Utils; //按钮权限等工具
+const crudRef = ref(null); //crudRef.value 获取avue-crud对象
+const emit = defineEmits(["routeInfo"])
+const rowClick = (row)=>{
+  emit("routeInfo", row)
+}
+
+// 设置表格列或者其他自定义的option
+option.value = Object.assign(option.value, {
+  delBtn: false,
+  selection: false,
+  search: false,
+  editBtn: false,
+  addBtn: false,
+  viewBtn: false,
+  menu: false,
+  column: [
+    {
+      label: "工艺编号",
+      prop: "processRouteCode",
+      search: true,
+      width: 150,
+      addDisplay: false,
+      editDisabled: true,
+      overHidden: true,
+    },
+    {
+      label: "工艺名称",
+      prop: "processRouteName",
+      width: 150,
+      search: true,
+      overHidden: true,
+    },
+    {
+      label: "工艺类型",
+      prop: "processRouteType",
+      minWidth: 100,
+      overHidden: true,
+      type: "select",
+      dicUrl: dictDataUtil.request_url + dictDataUtil.TYPE_CODE.routing_type,
+      props: {
+        label: "dictLabel",
+        value: "dictValue",
+      },
+    },
+    {
+      label: "产品名称",
+      prop: "prodtName",
+      overHidden: true,
+      width: 150,
+    },
+    {
+      label: "产品编号",
+      prop: "prodtCode",
+      overHidden: true,
+      width: 150,
+      disabled: true,
+    },
+    {
+      label: "产品型号",
+      prop: "prodtModel",
+      overHidden: true,
+      minWidth: 200,
+    },
+    // 在产品那边绑定了工艺路线才是已绑定
+    {
+      label: "路线状态",
+      prop: "used",
+      width: 100,
+      type: "radio",
+      dicData: [
+        {
+          label: "已绑定",
+          value: 1,
+        },
+        {
+          label: "未绑定",
+          value: 0,
+        },
+      ],
+    },
+    {
+      label: "启用状态",
+      prop: "enabled",
+      width: 100,
+      type: "radio",
+      dicData: [
+        {
+          label: "未启用",
+          value: 1,
+        },
+        {
+          label: "启用",
+          value: 0,
+        },
+      ],
+      value: 0,
+    },
+    {
+      label: "版本",
+      prop: "processRouteVersion",
+      addDisplay: false,
+      editDisplay: false,
+    },
+    {
+      label: "创建人",
+      prop: "createBy",
+      addDisplay: false,
+      editDisplay: false,
+      overHidden: true,
+    },
+    {
+      label: "创建时间",
+      prop: "createWhen",
+      addDisplay: false,
+      editDisplay: false,
+      width: 150,
+      overHidden: true,
+    },
+  ],
+});
+
+onMounted(() => {
+  search.value.prodtCode = props.materialCode
+  search.value.enabled = "0"
+  dataList();
+});
+</script>

+ 105 - 0
src/views/plan/workOrder/components/choice-workshop-page.vue

@@ -0,0 +1,105 @@
+<template>
+  <div class="mainContentBox">
+    <avue-crud
+        ref="crudRef"
+        v-model:search="search"
+        v-model="form"
+        :data="data"
+        :option="option"
+        v-model:page="page"
+        @row-click="rowClick"
+        @search-change="searchChange"
+        @search-reset="resetChange"
+        @size-change="dataList"
+        @current-change="dataList"
+    >
+    </avue-crud>
+  </div>
+</template>
+<script setup>
+import { ref } from "vue";
+import { useCrud } from "@/hooks/userCrud";
+
+import { useCommonStoreHook } from "@/store";
+import dictDataUtil from "@/common/configs/dictDataUtil";
+const { isShowTable, tableType } = toRefs(useCommonStoreHook());
+const test = () => {
+  isShowTable.value = true;
+  tableType.value = tableType.value == 1 ? 2 : 1;
+};
+// 传入一个url,后面不带/
+const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
+  useCrud({
+    src: "/api/v1/base/workShop",
+  });
+const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } = Methords; //增删改查
+const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
+const { checkBtnPerm, downloadTemplate } = Utils; //按钮权限等工具
+
+const crudRef = ref(null); //crudRef.value 获取avue-crud对象
+const emit = defineEmits(["workShopInfo"])
+const rowClick = (row)=>{
+  emit("workShopInfo", row)
+}
+
+// 设置表格列或者其他自定义的option
+option.value = Object.assign(option.value, {
+  delBtn: false,
+  selection: false,
+  search: false,
+  editBtn: false,
+  addBtn: false,
+  viewBtn: false,
+  menu: false,
+  column: [
+    {
+      label: "车间名称",
+      prop: "name",
+      search: true,
+    },
+    {
+      label: "车间负责人",
+      prop: "manager",
+      rules: [{
+        required: true,
+        message: "请选择厂区负责人",
+        trigger: "blur"
+      }],
+      type: 'select',
+      dicUrl:import.meta.env.VITE_APP_BASE_API+"/api/v1/sys/user/list",
+      dicMethod:"post",
+      props: {
+        label: "userName", // 下拉菜单显示的字段
+        value: "userName" // 下拉菜单值的字段
+      },
+    },
+    {
+      label: "车间位置",
+      prop: "position",
+    },
+    {
+      label: "所属工厂",
+      prop: "factoryName",
+      display:false
+    },
+    {
+      label: "车间描述",
+      prop: "remark",
+    },
+    {
+      label: "创建人",
+      prop: "creator",
+      display:false
+    },
+    {
+      label: "创建时间",
+      prop: "created",
+      display:false
+    },
+  ],
+});
+
+onMounted(() => {
+  dataList();
+});
+</script>

+ 82 - 0
src/views/plan/workOrder/components/work-order-seq.vue

@@ -0,0 +1,82 @@
+<template>
+  <div class="mainContentBox">
+    <avue-crud
+        ref="crudRef"
+        v-model:search="search"
+        v-model="form"
+        :data="data"
+        :option="option"
+        v-model:page="page"
+        @search-change="searchChange"
+        @search-reset="resetChange"
+        @size-change="dataList"
+        @current-change="dataList"
+    >
+    </avue-crud>
+  </div>
+</template>
+<script setup>
+import {defineProps, ref} from "vue";
+import { useCrud } from "@/hooks/userCrud";
+import { useCommonStoreHook } from "@/store";
+import dictDataUtil from "@/common/configs/dictDataUtil";
+const { isShowTable, tableType } = toRefs(useCommonStoreHook());
+const test = () => {
+  isShowTable.value = true;
+  tableType.value = tableType.value == 1 ? 2 : 1;
+};
+const props = defineProps({
+  workOrderId: {
+    type: String,
+    default: () => {
+      return 0;
+    }
+  }
+})
+// 传入一个url,后面不带/
+const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
+  useCrud({
+    src: "/api/v1/plan/seq",
+  });
+const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } = Methords; //增删改查
+const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
+const { checkBtnPerm, downloadTemplate } = Utils; //按钮权限等工具
+const crudRef = ref(null); //crudRef.value 获取avue-crud对象
+
+// 设置表格列或者其他自定义的option
+option.value = Object.assign(option.value, {
+  delBtn: false,
+  selection: false,
+  search: false,
+  editBtn: false,
+  addBtn: false,
+  viewBtn: false,
+  menu: false,
+  column: [
+    {
+      label: "序列号",
+      prop: "seqNo",
+      search: true,
+      overHidden: true,
+    },
+    {
+      label: "铭牌号",
+      prop: "nameplateNo",
+      search: true,
+      overHidden: true,
+    },
+    {
+      label: "状态",
+      prop: "state",
+      minWidth: 100,
+      type: "select",
+      dicData: [{label: '正常',value: 0},{label: '冻结',value: 1},{label: '完成',value: 2}],
+    },
+  ],
+});
+
+onMounted(() => {
+  search.value.workOrderId = props.workOrderId
+  dataList();
+});
+</script>

+ 396 - 379
src/views/plan/workOrder/index.vue

@@ -1,499 +1,516 @@
 <template>
   <div class="mainContentBox">
     <avue-crud
-      :option="option"
-      v-model:page="page"
-      v-model:search="search"
-      :table-loading="loading"
-      :permission="permission"
-      @search-change="handleQuery"
-      @search-reset="resetQuery"
-      @size-change="handleQuery"
-      @current-change="handleQuery"
-      @row-save="rowSave"
-      @row-update="rowUpdate"
-      @row-del="rowDel"
-      :data="pageData"
+        ref="crudRef"
+        v-model:search="search"
+        v-model="form"
+        :data="data"
+        :option="option"
+        v-model:page="page"
+        :permission="permission"
+        @row-save="createRow"
+        @row-update="updateRow"
+        @row-del="deleteRow"
+        @search-change="searchChange"
+        @search-reset="resetChange"
+        @size-change="dataList"
+        @current-change="dataList"
+        @selection-change="selectionChange"
     >
-      <template #menu-right="{}">
-        <el-dropdown split-button v-hasPerm="['plan:order:import']"
-          >导入
-          <template #dropdown>
-            <el-dropdown-menu>
-              <el-dropdown-item @click="downloadTemplate">
-                <i-ep-download />下载模板
-              </el-dropdown-item>
-              <el-dropdown-item @click="openDialog('obj-import')">
-                <i-ep-top />导入数据
-              </el-dropdown-item>
-            </el-dropdown-menu>
-          </template>
-        </el-dropdown>
+      <template #menu-left="{ size }">
         <el-button
-          class="ml-3"
-          v-hasPerm="['plan:order:export']"
-          @click="handleExport"
+          :disabled="toDeleteIds.length < 1"
+          type="danger"
+          icon="el-icon-delete"
+          :size="size"
+          @click="multipleDelete"
+          >删除</el-button
         >
-          <template #icon> <i-ep-download /> </template>导出
+        <el-button
+            :disabled="toDeleteIds.length < 1"
+            type="primary"
+            icon="el-icon-primary"
+            :size="size"
+            @click="aps1"
+        >批量排程</el-button
+        >
+      </template>
+      <template #menu="{size,row,index}">
+        <el-button
+            v-hasPerm="[buttonPermission.PLAN.BTNS.work_order_edit]"
+            v-if="row.workOrderState === '0' ||  row.workOrderState === '1' ||  row.workOrderState === '2'"
+            type="primary"
+            link
+            size="small"
+            @click="handleEdit(row,0)"
+        ><i-ep-edit />编辑
         </el-button>
+        <el-button @click="aps(row.id)"
+                   icon="el-icon-setting"
+                   text
+                   v-hasPerm="[buttonPermission.PLAN.BTNS.work_order_aps]"
+                   v-if="row.workOrderState === '0' ||  row.workOrderState === '1' ||  row.workOrderState === '2'"
+                   type="primary"
+                   :size="size">排程</el-button>
+          <el-button
+              icon="el-icon-setting"
+              text
+              v-if="row.workOrderState === '2'"
+              @click="distribute(row.id)"
+              type="primary"
+              v-hasPerm="[buttonPermission.PLAN.BTNS.work_order_aps]"
+              :size="size">下发</el-button>
+        <el-button
+            icon="el-icon-setting"
+            text
+            v-if="row.workOrderState !== '0' && row.workOrderState !== '1'"
+            @click="dialog4.visible = true"
+            type="primary"
+            :size="size">流水</el-button>
       </template>
     </avue-crud>
+    <el-dialog
+        v-model="dialog.visible"
+        :title="dialog.title"
+        width="80%"
+        @close="dialog.visible = false"
+    >
+      <order-page queryType="1"  @orderInfo="orderInfo"/>
+    </el-dialog>
 
     <el-dialog
-      v-model="dialog.visible"
-      :title="dialog.title"
-      width="500px"
-      @close="closeDialog"
+        v-model="dialog1.visible"
+        :title="dialog1.title"
+        width="80%"
+        @close="dialog1.visible = false"
+    >
+      <choice-route-page :material-code="form.materialCode" @routeInfo="routeInfo"/>
+    </el-dialog>
+
+    <el-dialog
+        v-model="dialog2.visible"
+        :title="dialog2.title"
+        width="80%"
+        @close="dialog2.visible = false"
+    >
+      <choice-workshop-page  @workShopInfo="workShopInfo"/>
+    </el-dialog>
+
+    <el-dialog
+        v-model="dialog3.visible"
+        :title="dialog3.title"
+        width="80%"
+        @close="dialog3.visible = false"
+    >
+      <choice-line-page :parentCode="form.workshopCode" :materialCode="form.materialCode" @lineInfo="lineInfo"/>
+    </el-dialog>
+
+    <el-dialog
+        v-model="dialog4.visible"
+        :title="dialog4.title"
+        width="950px"
+        @close="dialog4.visible = false"
+    >
+      <work-order-seq :workOrderId="form.id"/>
+    </el-dialog>
+
+    <el-dialog
+        v-model="dialog5.visible"
+        :title="dialog5.title"
+        width="450px"
+        @close="dialog5.visible = false"
     >
       <el-form
-        v-if="dialog.type === 'obj-import'"
-        :model="importData"
-        label-width="100px"
-      >
-        <el-form-item label="Excel文件">
-          <el-upload
-            ref="uploadRef"
-            action=""
-            drag
-            accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
-            :limit="1"
-            :auto-upload="false"
-            :file-list="importData.fileList"
-            :on-change="handleFileChange"
-            :on-exceed="handleFileExceed"
-          >
-            <el-icon class="el-icon--upload">
-              <i-ep-upload-filled />
-            </el-icon>
-            <div class="el-upload__text">
-              将文件拖到此处,或
-              <em>点击上传</em>
-            </div>
-            <template #tip>
-              <div style="color: red">文件类型: xls/xlsx</div>
-            </template>
-          </el-upload>
-        </el-form-item>
+          ref="dataFormRef"
+          :model="formData"
+          :rules="rules"
+          label-width="150px">
+      <el-form-item label="排程时间" prop="apsTime">
+        <el-date-picker
+            v-model="formData.apsTime"
+            type="date"
+            :picker-options="pickerOptions"
+            placeholder="请选择时间"
+            format="YYYY/MM/DD"
+            value-format="YYYY-MM-DD"
+        />
+
+<!--        <el-input width="250px" v-model="formData.apsTime" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD"/>-->
+      </el-form-item>
+      <el-form-item label="排程类型" prop="apsModel">
+        <el-radio-group v-model="formData.apsModel">
+          <el-radio :value="0">排产</el-radio>
+<!--          <el-radio :value="1">停用</el-radio>-->
+        </el-radio-group>
+      </el-form-item>
       </el-form>
-      <!-- 弹窗底部操作按钮 -->
       <template #footer>
         <div class="dialog-footer">
           <el-button type="primary" @click="handleSubmit">确 定</el-button>
-          <el-button @click="closeDialog">取 消</el-button>
+          <el-button @click="dialog5.visible = false">取 消</el-button>
         </div>
       </template>
+
     </el-dialog>
   </div>
 </template>
-<script setup lang="ts">
-import { checkPerm } from "@/directive/permission";
-import type { UploadInstance } from "element-plus";
-import { genFileId } from "element-plus";
-import dictDataUtil from "@/common/configs/dictDataUtil";
+<script setup>
+import { ref, getCurrentInstance } from "vue";
+import { useCrud } from "@/hooks/userCrud";
 import buttonPermission from "@/common/configs/buttonPermission";
-import {
-  addOrder,
-  deleteOrders,
-  downloadTemplateApi,
-  exportOrder,
-  getOrderPage,
-  importOrder,
-  updateOrder,
-  getExpandAlias,
-} from "@/api/order";
-
-// 弹窗对象
+import {apsWorkOrder,distributeWorkOrder} from "@/api/order"
+import { useCommonStoreHook } from "@/store";
+import dictDataUtil from "@/common/configs/dictDataUtil";
+import ChoiceRoutePage from "./components/choice-route-page.vue";
+import ChoiceWorkshopPage from "./components/choice-workshop-page.vue";
+import WorkOrderSeq from "./components/work-order-seq.vue";
+import { checkPerm } from "@/directive/permission";
+const { isShowTable, tableType } = toRefs(useCommonStoreHook());
+const test = () => {
+  isShowTable.value = true;
+  tableType.value = tableType.value == 1 ? 2 : 1;
+};
+const permission = reactive({
+  delBtn: checkPerm(buttonPermission.PLAN.BTNS.work_order_del),
+  addBtn: checkPerm(buttonPermission.PLAN.BTNS.work_order_add),
+  editBtn: checkPerm(buttonPermission.PLAN.BTNS.work_order_edit),
+  menu: true,
+});
 const dialog = reactive({
+  title: "订单选择",
+  visible: false,
+});
+const dialog1 = reactive({
+  title: "工艺选择",
   visible: false,
-  type: "order-form",
-  width: 800,
-  title: "",
 });
-const search = ref({});
-const option = ref({});
-const pageData = ref([]);
-const form = ref({});
-const page = ref({ total: 0, currentPage: 1, pageSize: 10 });
-const loading = ref(false);
-const uploadRef = ref<UploadInstance>(); // 上传组件
-// 导入数据
-const importData = reactive({
-  file: undefined,
-  fileList: [],
+const dialog2 = reactive({
+  title: "车间选择",
+  visible: false,
 });
-const permission = reactive({
-  delBtn: checkPerm(buttonPermission.PLAN.BTNS.order_del),
-  addBtn: checkPerm(buttonPermission.PLAN.BTNS.order_add),
-  editBtn: checkPerm(buttonPermission.PLAN.BTNS.order_edit),
-  menu: true,
+const dialog3 = reactive({
+  title: "产线选择",
+  visible: false,
 });
-option.value = {
-  border: true,
-  searchIndex: 3,
-  searchIcon: true,
-  searchMenuSpan: 8,
-  align: "center",
-  menuAlign: "center",
-  search: true,
-  refreshBtn: false,
-  from: {
-    width: "300",
-  },
+const dialog4 = reactive({
+  title: "工单流水",
+  visible: false,
+});
+const dialog5 = reactive({
+  title: "排程确认",
+  visible: false,
+});
+const pickerOptions = ref({
+  disabledDate(time) {
+    return time.getTime() < Date.now() - 8.64e7;
+  }
+})
+const aps =(id)=>{
+  formData.workOrderIds = [id]
+  dialog5.visible = true
+}
+const distribute = (id)=>{
+  ElMessageBox.confirm("当前操作不可逆,确定下发工单吗?")
+      .then(() => {
+        distributeWorkOrder(id).then((data)=>{
+          ElMessage.success(data.msg);
+          dataList()
+        })
+      })
+      .catch(() => {
+        // catch error
+      });
+}
+const handleEdit = (row, index) =>{
+  crudRef.value && crudRef.value.rowEdit(row, index);
+}
+const aps1 =()=>{
+  formData.workOrderIds = toDeleteIds
+  dialog5.visible = true
+}
+const dataFormRef = ref(ElForm);
+
+const formData = reactive({
+  apsTime: null,
+  apsModel: 0,
+  workOrderId: 0
+});
+
+const rules = reactive({
+  apsTime: [{ required: true, message: "排程时间不能为空", trigger: "blur" }],
+  apsModel: [{ required: true, message: "排程类型不能为空", trigger: "blur" }],
+});
+const handleSubmit =()=>{
+  dataFormRef.value.validate((isValid) => {
+    if (isValid) {
+      apsWorkOrder(formData).then((data)=>{
+        if(data.code === '200'){
+          ElMessage.success(data.msg);
+          dialog5.visible = false
+          dataList()
+        }else{
+          ElMessage.error(data.msg);
+        }
+      })
+    }
+  });
+}
+const orderInfo = (value) => {
+  form.value.orderCode = value.orderCode
+  form.value.orderName = value.orderName
+  form.value.materialCode = value.materialCode
+  form.value.materialName = value.materialName
+  form.value.materialModel = value.materialModel
+  form.value.priority = value.priority
+  dialog.visible = false
+}
+const lineInfo = (value) => {
+  form.value.productLineId = value.id
+  form.value.productLineName = value.name
+  dialog3.visible = false
+}
+const workShopInfo = (value) => {
+  form.value.workshopName = value.id
+  form.value.workshopCode = value.code
+  form.value.workshopName = value.name
+  dialog2.visible = false
+}
+const routeInfo = (value) => {
+  form.value.processRouteId = value.id
+  form.value.processRouteCode = value.processRouteCode
+  form.value.processRouteName = value.processRouteName
+  dialog1.visible = false
+}
+// 传入一个url,后面不带/
+const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
+  useCrud({
+    src: "/api/v1/plan/workOrder",
+  });
+const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } = Methords; //增删改查
+const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
+const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
+
+const crudRef = ref(null); //crudRef.value 获取avue-crud对象
+
+// 设置表格列或者其他自定义的option
+option.value = Object.assign(option.value, {
+  delBtn: false,
+  selection: true,
+  editBtn: false,
   column: [
     {
-      label: "订单编号",
-      prop: "orderCode",
+      label: "单编号",
+      prop: "workOrderCode",
       search: true,
-      width: "100",
       display: false,
+      width: 125,
     },
     {
-      label: "订单名称",
-      prop: "orderName",
+      label: "订单编号",
+      prop: "orderCode",
       search: true,
-      width: "100",
+      width: 125,
       rules: [
         {
           required: true,
-          message: "订单名称不能为空",
+          message: "订单编号不能为空",
           trigger: "trigger",
         },
       ],
+      click: ({ value, column }) => {
+        if(column.boxType){
+          dialog.visible = true
+        }
+      },
     },
     {
-      label: "ERP号",
-      prop: "erpCode",
+      label: "订单名称",
+      prop: "orderName",
       search: true,
-      width: "100",
-      rules: [
-        {
-          required: true,
-          message: "订单编号不能为空",
-          trigger: "trigger",
-        },
-      ],
+      disabled: true,
+      width: 120,
     },
     {
-      label: "产品编码",
-      prop: "materialCode",
+      label: "产品编号",
+      width: 120,
       search: true,
-      width: "100",
-      rules: [
-        {
-          required: true,
-          message: "订单编号不能为空",
-          trigger: "trigger",
-        },
-      ],
-      focus: ({ value, column }) => {
-        //todo
-      },
+      disabled: true,
+      prop: "materialCode",
     },
     {
       label: "产品名称",
-      prop: "materialName",
+      width: 120,
       search: true,
-      width: "100",
+      disabled: true,
+      prop: "materialName",
     },
     {
       label: "产品规格",
-      width: "100",
+      width: 120,
+      search: true,
+      overHidden: true,
+      disabled: true,
       prop: "materialModel",
     },
     {
-      label: "订单状态",
-      prop: "orderState",
+      label: "优先级",
+      prop: "priority",
       display: false,
-      width: "100",
+      width: "80",
       type: "select", //类型为下拉选择框
       dicUrl:
-        dictDataUtil.request_url + dictDataUtil.TYPE_CODE.plan_order_state,
+          dictDataUtil.request_url + dictDataUtil.TYPE_CODE.plan_order_priority,
       props: {
         label: "dictLabel",
         value: "dictValue",
       },
-      searchClearable: false, //可清空的输入框,默认为true
-      filterable: true, //添加filterable属性即可启用搜索功能
     },
     {
-      label: "订单类型",
-      prop: "orderType",
+      label: "状态",
+      prop: "workOrderState",
+      width: "80",
+      display: false,
       type: "select", //类型为下拉选择框
-      width: "100",
-      dicUrl: dictDataUtil.request_url + dictDataUtil.TYPE_CODE.plan_order_type,
+      dicUrl:
+          dictDataUtil.request_url + dictDataUtil.TYPE_CODE.plan_work_order_state,
       props: {
         label: "dictLabel",
         value: "dictValue",
       },
-      searchClearable: false, //可清空的输入框,默认为true
-      filterable: true, //添加filterable属性即可启用搜索功能
+    },
+    {
+      label: "工艺路线",
+      prop: "processRouteName",
+      width: 120,
+      overHidden: true,
       rules: [
         {
           required: true,
-          message: "订单类型不能为空",
+          message: "工艺路线不能为空",
           trigger: "trigger",
         },
       ],
+      click: ({ value, column }) => {
+        if(column.boxType){
+          if(!form.value.materialCode){
+            ElMessage({
+              message: "请先选择订单",
+              type: "warning",
+            })
+            return;
+          }
+          dialog1.visible = true
+        }
+      },
     },
     {
-      label: "订单数量",
-      prop: "orderNum",
-      type: "number",
-      width: "100",
-      min: 0,
-      max: 99999,
+      label: "生产车间",
+      prop: "workshopName",
+      width: 120,
+      overHidden: true,
       rules: [
         {
           required: true,
-          message: "订单数量不能为空",
+          message: "生产车间不能为空",
           trigger: "trigger",
         },
       ],
+      click: ({ value, column }) => {
+        if(column.boxType){
+          dialog2.visible = true
+        }
+      },
     },
     {
-      label: "排产数量",
-      prop: "scheduledNum",
-      width: "100",
-      display: false,
-    },
-    {
-      label: "优先级",
-      prop: "priority",
-      width: "100",
-      type: "select", //类型为下拉选择框
-      dicUrl:
-        dictDataUtil.request_url + dictDataUtil.TYPE_CODE.plan_order_priority,
-      props: {
-        label: "dictLabel",
-        value: "dictValue",
-      },
-      searchClearable: false, //可清空的输入框,默认为true
-      filterable: true, //添加filterable属性即可启用搜索功能
+      label: "产线名称",
+      prop: "productLineName",
+      width: 120,
+      overHidden: true,
       rules: [
         {
           required: true,
-          message: "订单类型不能为空",
+          message: "产线名称不能为空",
           trigger: "trigger",
         },
       ],
+      click: ({ value, column }) => {
+        if(column.boxType){
+          if(!form.value.workshopCode){
+            ElMessage({
+              message: "请先选择生产车间",
+              type: "warning",
+            })
+            return;
+          }
+          dialog3.visible = true
+        }
+      },
+    },
+    {
+      label: "开始时间",
+      prop: "planStartWhen",
+      width: 180,
+      overHidden: true,
+      display: false,
+    },
+    {
+      label: "结束时间",
+      prop: "planStartEnd",
+      width: 180,
+      display: false,
+      overHidden: true,
     },
     {
-      label: "交付日期",
-      prop: "deliverTime",
-      type: "date",
-      width: "100",
-      format: "YYYY-MM-DD", //前端展示格式
-      valueFormat: "YYYY-MM-DD", //设置后端接收的日期格式
+      label: "工单数量",
+      prop: "planNum",
+      width: 85,
+      type: "number",
+      min: 1,
+      max: 99999,
       rules: [
         {
           required: true,
-          message: "请选择交付日期",
+          message: "工单数量不能为空",
           trigger: "trigger",
         },
       ],
     },
     {
-      label: "所属公司",
-      prop: "companyId",
-      width: "100",
-    },
-    {
-      label: "项目号",
-      width: "100",
-      prop: "projectCode",
+      label: "完成数量",
+      width: 85,
+      display: false,
+      prop: "completeNum",
+
     },
     {
-      label: "绑定铭牌",
-      prop: "nameplated",
-      width: "100",
-      type: "radio", //类型为单选框
-      dicData: [
-        {
-          label: "否",
-          value: 0,
-        },
-        {
-          label: "是",
-          value: 1,
-        },
-      ],
-      value: 0,
+      label: "下线数量",
+      width: 85,
+      display: false,
+      prop: "beforeNum",
     },
     {
-      label: "备注",
-      prop: "remark",
-      width: "100",
-      minRows: 2, //最小行/最小值
-      type: "textarea", //类型为多行文本域框
-      maxlength: 512, //最大输入长度
+      label: "报废数量",
+      width: 85,
+      display: false,
+      prop: "scrapNum",
     },
     {
       label: "创建时间",
-      prop: "created",
-      width: "140",
-      overHidden: true,
+      width: 180,
       display: false,
-      type: "datetime",
-      valueFormat: "yyyy-MM-dd HH:mm:ss",
+      prop: "created",
     },
     {
       label: "创建人",
-      prop: "creator",
+      width: 90,
       display: false,
-      width: 80,
-      overHidden: true,
+      prop: "creator",
     },
   ],
-};
-
-const queryExpandAlias = () => {
-  getExpandAlias(dictDataUtil.EXPAND_FIELD_TABLE.plan_order_info).then(
-    (data: any) => {
-      if (data.data) {
-        data.data.forEach((item: any) => {
-          option.value.column.push({
-            label: item.label,
-            prop: item.field,
-            width: "100",
-          });
-        });
-      }
-    }
-  );
-};
+});
 
-const handleQuery = (params, done) => {
-  console.log(JSON.stringify(option.value.column));
-  loading.value = true;
-  const querySearch = {
-    pageSize: page.value.pageSize,
-    pageNo: page.value.currentPage,
-    ...params,
-  };
-  getOrderPage(querySearch)
-    .then(({ data }) => {
-      pageData.value = data.records;
-      page.value.total = data.totalCount;
-      page.value.currentPage = data.pageNo;
-      page.value.pageSize = data.pageSize;
-    })
-    .finally(() => {
-      loading.value = false;
-      if (done) {
-        done();
-      }
-    });
-};
-const resetQuery = () => {};
-const rowSave = (form, done, loading) => {
-  loading();
-  addOrder(form).then((data: any) => {
-    ElMessage({
-      message: data.msg,
-      type: "success",
-    });
-    done();
-    handleQuery(null, null);
-  });
-};
-const rowUpdate = (form, index, done, loading) => {
-  loading();
-  updateOrder(form).then((data: any) => {
-    ElMessage({
-      message: data.msg,
-      type: "success",
-    });
-    done();
-    handleQuery(null, null);
-  });
-};
-const rowDel = (form: any, index) => {
-  ElMessageBox.confirm("当前操作会删除数据,你确认要继续吗?")
-    .then(() => {
-      deleteOrders([form.id])
-        .then((data: any) => {
-          ElMessage({
-            message: data.msg,
-            type: "success",
-          });
-          handleQuery(null, null);
-        })
-        .finally(() => {});
-    })
-    .catch(() => {
-      // catch error
-    });
-};
-const openDialog = (type) => {
-  dialog.visible = true;
-  dialog.type = type;
-  if (dialog.type === "obj-import") {
-    // 导入弹窗
-    dialog.title = "数据导入";
-    dialog.width = 600;
-  }
-};
-const closeDialog = () => {
-  dialog.visible = false;
-  if (dialog.type === "obj-import") {
-    importData.file = undefined;
-    importData.fileList = [];
-  }
-};
-const downloadTemplate = () => {
-  downloadTemplateApi().then((response) => {
-    downFile(response);
-  });
-};
-/** 弹窗提交 */
-const handleSubmit = () => {
-  importOrder(importData).then((data: any) => {
-    ElMessage({
-      message: data.msg,
-      type: "success",
-    });
-    dialog.visible = false;
-    handleQuery(null, null);
-  });
-};
-/** Excel文件 Change */
-const handleFileChange = (file) => {
-  importData.file = file.raw;
-};
-/** 文件下载 */
-const downFile = (response: any) => {
-  const fileData = response.data;
-  const fileName = decodeURI(
-    response.headers["content-disposition"].split(";")[1].split("=")[1]
-  );
-  const fileType =
-    "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8";
-  const blob = new Blob([fileData], { type: fileType });
-  const downloadUrl = window.URL.createObjectURL(blob);
-  const downloadLink = document.createElement("a");
-  downloadLink.href = downloadUrl;
-  downloadLink.download = fileName;
-  document.body.appendChild(downloadLink);
-  downloadLink.click();
-  document.body.removeChild(downloadLink);
-  window.URL.revokeObjectURL(downloadUrl);
-};
-/** Excel文件 Exceed  */
-const handleFileExceed = (files) => {
-  uploadRef.value!.clearFiles();
-  const file = files[0];
-  file.uid = genFileId();
-  uploadRef.value!.handleStart(file);
-  importData.file = file;
-};
-/** 导出 */
-const handleExport = () => {
-  exportOrder(search.value).then((response: any) => {
-    downFile(response);
-  });
-};
-onMounted?.(() => {
-  queryExpandAlias();
-  handleQuery(null, null);
+onMounted(() => {
+  // console.log("crudRef", crudRef)
+  dataList();
 });
 </script>

src/views/base/modeling/storage/index.vue → src/views/storage/stock/index.vue


+ 178 - 0
src/views/storage/storage/index.vue

@@ -0,0 +1,178 @@
+<template>
+  <div class="mainContentBox">
+    <avue-crud
+        ref="crudRef"
+        v-model:search="search"
+        v-model="form"
+        :data="data"
+        :option="option"
+        v-model:page="page"
+        @row-save="createRow"
+        @row-update="updateRow"
+        @row-del="deleteRow"
+        @search-change="searchChange"
+        @search-reset="resetChange"
+        @size-change="dataList"
+        @current-change="dataList"
+        @selection-change="selectionChange"
+    >
+      <template #menu-left="{ size }">
+        <el-button
+          :disabled="toDeleteIds.length < 1"
+          type="danger"
+          icon="el-icon-delete"
+          :size="size"
+          @click="multipleDelete"
+          >删除</el-button
+        >
+      </template>
+    </avue-crud>
+    <ExcelUpload ref="uploadRef" @finished="uploadFinished" />
+  </div>
+</template>
+<script setup>
+import { ref, getCurrentInstance } from "vue";
+import { useCrud } from "@/hooks/userCrud";
+import ButtonPermKeys from "@/common/configs/buttonPermission";
+
+import { useCommonStoreHook } from "@/store";
+import dictDataUtil from "@/common/configs/dictDataUtil";
+const { isShowTable, tableType } = toRefs(useCommonStoreHook());
+const test = () => {
+  isShowTable.value = true;
+  tableType.value = tableType.value == 1 ? 2 : 1;
+};
+
+// 传入一个url,后面不带/
+const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
+  useCrud({
+    src: "/api/v1/wms/position",
+  });
+const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } = Methords; //增删改查
+const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
+const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
+
+const crudRef = ref(null); //crudRef.value 获取avue-crud对象
+
+// 设置表格列或者其他自定义的option
+option.value = Object.assign(option.value, {
+  delBtn: false,
+  selection: true,
+  column: [
+    {
+      label: "仓库编码",
+      prop: "type",
+      type: "select",
+      search: true,
+      editDisabled: true,
+      dicUrl:
+          dictDataUtil.request_url +
+          dictDataUtil.TYPE_CODE.warehouse_type,
+      props: {
+        label: "dictLabel",
+        value: "dictValue",
+      },
+      rules: [
+        {
+          required: true,
+          message: "仓库编码不能为空",
+          trigger: "trigger",
+        },
+      ],
+    },
+    {
+      label: "货区",
+      prop: "area",
+      rules: [
+        {
+          required: true,
+          message: "货区不能为空",
+          trigger: "trigger",
+        },
+      ],
+    },
+    {
+      label: "货位",
+      prop: "coordinate",
+      search: true,
+      rules: [
+        {
+          required: true,
+          message: "货位不能为空",
+          trigger: "trigger",
+        },
+      ],
+    },
+    {
+      label: "层数",
+      prop: "layer",
+      type: "number",
+      rules: [
+        {
+          required: true,
+          message: "层数不能为空",
+          trigger: "trigger",
+        },
+      ],
+    },
+    {
+      label: "货位类型",
+      prop: "materialType",
+      type: "select",
+      dicUrl:
+          dictDataUtil.request_url +
+          dictDataUtil.TYPE_CODE.storage_location_type,
+      props: {
+        label: "dictLabel",
+        value: "dictValue",
+      },
+      rules: [
+        {
+          required: true,
+          message: "货位类型不能为空",
+          trigger: "trigger",
+        },
+      ],
+    },
+    {
+      label: "状态",
+      prop: "enable",
+      type: "select",
+      dicData: [{label: '启用' , value: 0},{label: '禁用' , value: 1}],
+      html: true,
+      formatter: (val) => {
+        if (val.state === 0) {
+          return '<b class="el-tag el-tag--success el-tag--light">启用</b>';
+        }
+        return '<b class="el-tag el-tag--danger el-tag--light">禁用</b>';
+      },
+      rules: [
+        {
+          required: true,
+          message: "状态不能为空",
+          trigger: "trigger",
+        },
+      ],
+    },
+  ],
+});
+
+onMounted(() => {
+  // console.log("crudRef", crudRef)
+  dataList();
+});
+/**
+ * 上传excel相关
+ */
+const uploadRef = ref(null);
+const uploadFinished = () => {
+  // 上传完成后的刷新操作
+  page.currentPage = 1;
+  dataList();
+};
+const importExcelData = () => {
+  if (uploadRef.value) {
+    uploadRef.value.show("/api/v1/device/import");
+  }
+};
+</script>

+ 1 - 1
src/views/system/dict/components/dict-item.vue

@@ -221,7 +221,7 @@ onMounted?.(() => {
       <template #header>
         <el-button
           v-hasPerm="[ButtonPermKeys.SYSTEM.BTNS.dict_add]"
-          type="success"
+          type="primary"
           @click="openDialog()"
           ><i-ep-plus />新增</el-button
         >