Procházet zdrojové kódy

Merge branch 'master' into Branch_qinhb

# Conflicts:
#	src/common/configs/dictDataUtil.ts
qinhb před 1 rokem
rodič
revize
dbb2e5ca1c

+ 2 - 0
package.json

@@ -51,6 +51,7 @@
     "axios": "^1.6.7",
     "echarts": "^5.5.0",
     "element-plus": "^2.6.0",
+    "html2canvas": "^1.4.1",
     "lodash-es": "^4.17.21",
     "net": "^1.0.2",
     "nprogress": "^0.2.0",
@@ -58,6 +59,7 @@
     "path-to-regexp": "^6.2.1",
     "pinia": "^2.1.7",
     "pinia-plugin-persist": "^1.0.0",
+    "print-js": "^1.6.0",
     "sockjs-client": "1.6.1",
     "sortablejs": "^1.15.2",
     "stompjs": "^2.3.3",

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

@@ -151,3 +151,11 @@ export function saveApplyInfoDetails(params: any) {
     data: params,
   });
 }
+
+export function auditApplyInfoDetails(params: any) {
+  return request({
+    url: "/api/v1/plan/requisition/audit",
+    method: "post",
+    data: params,
+  });
+}

+ 9 - 7
src/common/configs/dictDataUtil.ts

@@ -4,8 +4,9 @@ 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",
-  dept_list_url:import.meta.env.VITE_APP_BASE_API+"/api/v1/sys/dept/parent/list",
-  post_list_url:import.meta.env.VITE_APP_BASE_API+"/api/v1/sys/post/list",
+  dept_list_url:
+    import.meta.env.VITE_APP_BASE_API + "/api/v1/sys/dept/parent/list",
+  post_list_url: import.meta.env.VITE_APP_BASE_API + "/api/v1/sys/post/list",
 
   TYPE_CODE: {
     //订单类型
@@ -26,8 +27,8 @@ const DictDataUtil = {
     device_maintenance_cycle: "device_maintenance_cycle",
     // 工艺路线类型
     routing_type: "routing_type",
-	//缺陷管理
-	defect_mana: "defect_mana",
+    //缺陷管理
+    defect_mana: "defect_mana",
     //封装方法
     packaging_method: "packaging_method",
     //岗位组
@@ -52,9 +53,10 @@ const DictDataUtil = {
     prepare_data_file: "prepare_data_file",
     //生产准备-工艺文件
     prepare_craft_file: "prepare_craft_file",
-    //领用申请状态
-    requisition_state:"requisition_state",
-  },
+ //   生产计划-工位任务状态
+    station_task_state: "station_task_state",
+//领用申请状态
+    requisition_state:"requisition_state",  },
   EXPAND_FIELD_TABLE: {
     //字段类型
     expand_field_type: "expand_field_type",

+ 487 - 440
src/components/CommonTable/configs/tableConfig.ts

@@ -2,455 +2,502 @@ import { useDictionaryStoreHook } from "@/store";
 const { dicts } = useDictionaryStoreHook();
 import dictDataUtil from "@/common/configs/dictDataUtil";
 export const tableConfig = {
-  MARTERIAL: {
-    url: "/api/v1/base/material",
-    column: [
-      { label: "客户型号", prop: "customervodel", search: true },
-      { label: "生产厂家", prop: "manufacturer", search: true },
-      { label: "物料编码", prop: "materialCode", search: true },
-      { label: "物料名称", prop: "materialName", search: true },
-      { label: "保质期", prop: "qualityGuaranteePeriod", search: true },
+	MARTERIAL: {
+		url: "/api/v1/base/material",
+		column: [
+			{ label: "客户型号", prop: "customervodel", search: true },
+			{ label: "生产厂家", prop: "manufacturer", search: true },
+			{ label: "物料编码", prop: "materialCode", search: true },
+			{ label: "物料名称", prop: "materialName", search: true },
+			{ label: "保质期", prop: "qualityGuaranteePeriod", search: true },
 
-      { label: "筛选规范", prop: "selectionSpec", search: true },
-      { label: "物料规格", prop: "spec", search: true },
-      {
-        label: "适用平台",
-        prop: "applicablePlatformsDictValue",
-        // search: true,
-        // filterable: true,
-        // type: "select",
-        // dataType: "string",
-        // dicData: dicts.applicable_platforms,
-        // props: { label: "dictLabel", value: "dictValue" },
-      },
-      {
-        label: "物料属性",
-        prop: "attributeDictValue",
-        search: true,
-        filterable: true,
-        type: "select",
-        dataType: "string",
-        dicData: dicts.material_properties,
-        props: { label: "dictLabel", value: "dictValue" },
-      },
-      {
-        label: "是否工装",
-        prop: "frock",
-        search: true,
-        filterable: true,
-        type: "radio", //类型为单选框
-        dicData: [
-          {
-            label: "否",
-            value: 0,
-          },
-          {
-            label: "是",
-            value: 1,
-          },
-        ],
-        value: 0,
-      },
-      {
-        label: "质检方案",
-        prop: "inspectDictValue",
-        search: true,
-        filterable: true,
-        type: "select",
-        dataType: "string",
-        dicData: dicts.quality_testing_plan,
-        props: { label: "dictLabel", value: "dictValue" },
-      },
-      {
-        label: "物料级别",
-        prop: "levelDictValue",
-        search: true,
-        filterable: true,
-        type: "select",
-        dataType: "string",
-        dicData: dicts.material_level,
-        props: { label: "dictLabel", value: "dictValue" },
-      },
-      {
-        label: "封装方法",
-        prop: "packageDictValue",
-        search: true,
-        filterable: true,
-        type: "select",
-        dataType: "string",
-        dicData: dicts.packaging_method,
-        props: { label: "dictLabel", value: "dictValue" },
-      },
-      {
-        label: "质量等级",
-        prop: "qualityLevelDictValue",
-        search: true,
-        filterable: true,
-        type: "select",
-        dataType: "string",
-        dicData: dicts.quality_grade,
-        props: { label: "dictLabel", value: "dictValue" },
-      },
-      {
-        label: "选用类型",
-        prop: "selectionDictValue",
-        search: true,
-        filterable: true,
-        type: "select",
-        dataType: "string",
-        dicData: dicts.selection_type,
-        props: { label: "dictLabel", value: "dictValue" },
-      },
-      {
-        label: "阶段",
-        prop: "stageDictValue",
-        search: true,
-        filterable: true,
-        type: "select",
-        dataType: "string",
-        dicData: dicts.stage,
-        props: { label: "dictLabel", value: "dictValue" },
-      },
-      {
-        label: "物料单位",
-        prop: "unitDictValue",
-        search: true,
-        filterable: true,
-        type: "select",
-        dataType: "string",
-        dicData: dicts.danwei_type,
-        props: { label: "dictLabel", value: "dictValue" },
-      },
-      { label: "备注", prop: "remark", type: "textarea", search: true },
-    ],
-  },
+			{ label: "筛选规范", prop: "selectionSpec", search: true },
+			{ label: "物料规格", prop: "spec", search: true },
+			{
+				label: "适用平台",
+				prop: "applicablePlatformsDictValue",
+				// search: true,
+				// filterable: true,
+				// type: "select",
+				// dataType: "string",
+				// dicData: dicts.applicable_platforms,
+				// props: { label: "dictLabel", value: "dictValue" },
+			},
+			{
+				label: "物料属性",
+				prop: "attributeDictValue",
+				search: true,
+				filterable: true,
+				type: "select",
+				dataType: "string",
+				dicData: dicts.material_properties,
+				props: { label: "dictLabel", value: "dictValue" },
+			},
+			{
+				label: "是否工装",
+				prop: "frock",
+				search: true,
+				filterable: true,
+				type: "radio", //类型为单选框
+				dicData: [
+					{
+						label: "否",
+						value: 0,
+					},
+					{
+						label: "是",
+						value: 1,
+					},
+				],
+				value: 0,
+			},
+			{
+				label: "质检方案",
+				prop: "inspectDictValue",
+				search: true,
+				filterable: true,
+				type: "select",
+				dataType: "string",
+				dicData: dicts.quality_testing_plan,
+				props: { label: "dictLabel", value: "dictValue" },
+			},
+			{
+				label: "物料级别",
+				prop: "levelDictValue",
+				search: true,
+				filterable: true,
+				type: "select",
+				dataType: "string",
+				dicData: dicts.material_level,
+				props: { label: "dictLabel", value: "dictValue" },
+			},
+			{
+				label: "封装方法",
+				prop: "packageDictValue",
+				search: true,
+				filterable: true,
+				type: "select",
+				dataType: "string",
+				dicData: dicts.packaging_method,
+				props: { label: "dictLabel", value: "dictValue" },
+			},
+			{
+				label: "质量等级",
+				prop: "qualityLevelDictValue",
+				search: true,
+				filterable: true,
+				type: "select",
+				dataType: "string",
+				dicData: dicts.quality_grade,
+				props: { label: "dictLabel", value: "dictValue" },
+			},
+			{
+				label: "选用类型",
+				prop: "selectionDictValue",
+				search: true,
+				filterable: true,
+				type: "select",
+				dataType: "string",
+				dicData: dicts.selection_type,
+				props: { label: "dictLabel", value: "dictValue" },
+			},
+			{
+				label: "阶段",
+				prop: "stageDictValue",
+				search: true,
+				filterable: true,
+				type: "select",
+				dataType: "string",
+				dicData: dicts.stage,
+				props: { label: "dictLabel", value: "dictValue" },
+			},
+			{
+				label: "物料单位",
+				prop: "unitDictValue",
+				search: true,
+				filterable: true,
+				type: "select",
+				dataType: "string",
+				dicData: dicts.danwei_type,
+				props: { label: "dictLabel", value: "dictValue" },
+			},
+			{ label: "备注", prop: "remark", type: "textarea", search: true },
+		],
+	},
 
-  FACTORY: {
-    url: "/api/v1/base/workShop",
-    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
-      },
-    ],
-  },
+	FACTORY: {
+		url: "/api/v1/base/workShop",
+		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
+			},
+		],
+	},
 
 
-  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
-      },
-    ],
-  },
+	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",
-        }],
+	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
-      },
-    ],
-  },
+			},
+			{
+				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",
-      },
-    ],
-  },
+	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",
+			},
+		],
+	},
 
-  USERS: {
-    url: "/api/v1/sys/employeeSkill/users",
-    column: [
-      {
-        label: "员工编码",
-        prop: "employeeCode",
-        search: true,
-      },
-      {
-        label: "用户id",
-        prop: "id",
-        /*display:false,*/
-      },
-      {
-        label: "用户名",
-        prop: "userName",
-        search: true,
-        width: '120',
-      },
-      {
-        label: "用户电话",
-        prop: "phone",
-        search: true,
-      },
+	MARTERIAL_BOM: {
+		url: "/api/v1/base/materialBom/list",
+		column: [
+			{
+				label: "物料编码",
+				prop: "materialCode",
+				hide: true
+			},
 
-      { label: "部门", prop: "deptName", overHidden: true,
-        disabled:true, },
-      { label: "所属机构", prop: "institution", width: 130,overHidden: true,search: true ,
-        search: true,
-        filterable: true,
-        type: "select",
-        width: 100,overHidden: true,
-        dicUrl:dictDataUtil.dept_list_url,
-        dicMethod:"post",
-        props: { label: "deptName", value: "id" },
-        disabled:true,
+			{
+				label: "物料名称",
+				prop: "materialName",
+				overHidden: true,
+				hide: true
+			},
 
-      },
-    ],
-  },
+			{
+				label: "物料编码",
+				prop: "bomMaterialCode",
+			},
+			{
+				label: "物料名称",
+				prop: "bomMaterialName",
+				overHidden: true,
+			},
+			{
+				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,
+			},
+		],
+	},
 
-};
+	USERS: {
+		url: "/api/v1/sys/employeeSkill/users",
+		column: [
+			{
+				label: "员工编码",
+				prop: "employeeCode",
+				search: true,
+			},
+			{
+				label: "用户id",
+				prop: "id",
+				/*display:false,*/
+			},
+			{
+				label: "用户名",
+				prop: "userName",
+				search: true,
+				width: '120',
+			},
+			{
+				label: "用户电话",
+				prop: "phone",
+				search: true,
+			},
+
+			{
+				label: "部门", prop: "deptName", overHidden: true,
+				disabled: true,
+			},
+			{
+				label: "所属机构", prop: "institution",
+				search: true,
+				filterable: true,
+				type: "select",
+				width: 100, overHidden: true,
+				dicUrl: dictDataUtil.dept_list_url,
+				dicMethod: "post",
+				props: { label: "deptName", value: "id" },
+				disabled: true,
+
+			},
+		],
+	},
+
+};

+ 22 - 7
src/components/CommonTable/index.vue

@@ -49,16 +49,31 @@ const props = defineProps({
 
 const isShowTable = ref(false);
 
-const startSelect = () => {
+const startSelect = (param) => {
+  if (param) {
+    commonConfig.value.params = param;
+  }
+  dataList();
   isShowTable.value = true;
 };
 
 // 传入一个url,后面不带/
-const { url, form, data, option, search, page, toDeleteIds, Methords, Utils, } =
-  useCrud({
-    src: tableConfig[props.tableType].url,
-  });
-const { dataList, createRow, updateRow, deleteRow , searchChange, resetChange} = Methords; //增删改查
+const {
+  url,
+  form,
+  data,
+  option,
+  search,
+  page,
+  toDeleteIds,
+  Methords,
+  Utils,
+  commonConfig,
+} = useCrud({
+  src: tableConfig[props.tableType].url,
+});
+const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
+  Methords; //增删改查
 const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
 
 const crudRef = ref(null); //crudRef.value 获取avue-crud对象
@@ -73,7 +88,7 @@ onMounted(() => {
     addBtn: false,
     column: tableConfig[props.tableType].column,
   });
-  dataList();
+  // dataList();
 });
 watch(
   () => props.tableType,

+ 13 - 4
src/hooks/userCrud.ts

@@ -3,6 +3,7 @@ import { PageOption } from "@smallwei/avue";
 import { ElMessageBox, ElMessage } from "element-plus";
 import { useUserStoreHook } from "@/store/modules/user";
 import { checkPerm } from "@/directive/permission";
+import { configs } from "@typescript-eslint/eslint-plugin";
 
 interface UseCrudConfig {
   // 模块的url,用来进行增删改查
@@ -20,7 +21,7 @@ interface UseCrudConfig {
   index?: number;
   // 用于中断操作
   loading?: () => void;
-  // 查询参数 一般用search的值就可以了
+  // 额外查询参数 一般用search的值就可以了
   params?: object;
   // 是否是编辑,如果是编辑调用更新,否则调用新增
   isEdit?: boolean;
@@ -28,7 +29,7 @@ interface UseCrudConfig {
 
 export const useCrud = (config?: UseCrudConfig) => {
   const url = ref(config?.src);
-
+  const commonConfig = ref(config);
   /** 表格配置属性 */
   const option = ref({
     searchIcon: true,
@@ -109,11 +110,18 @@ export const useCrud = (config?: UseCrudConfig) => {
             pageNo: page.value.currentPage,
             pageSize: page.value.pageSize,
             ...search.value,
+            ...(commonConfig.value?.params ?? {}),
           },
         });
         if (res?.data) {
-          data.value = res?.data?.records || [];
-          page.value.total = res?.data?.totalCount || 0;
+		  if(res?.data instanceof Array){
+			 data.value = res?.data || [] 
+			 page.value.total = res?.data?.length || 0
+		  }else{
+			data.value = res?.data?.records || [];
+			page.value.total = res?.data?.totalCount || 0;  
+		  }
+          
         }
         config?.done && config?.done();
       } catch (err) {
@@ -341,5 +349,6 @@ export const useCrud = (config?: UseCrudConfig) => {
     toDeleteIds,
     Methords,
     Utils,
+    commonConfig,
   };
 };

+ 66 - 0
src/utils/common.ts

@@ -0,0 +1,66 @@
+import html2canvas from "html2canvas";
+import printJS from "print-js";
+
+/**
+ * html转图片
+ * @param printContent 传入一个ref
+ * @param callback
+ */
+export const htmlToCanvas = (
+  printContent: HTMLElement,
+  callback: (url: string) => void
+) => {
+  // // 获取dom 宽度 高度
+  // const width = printContent.clientWidth;
+  // const height = printContent.clientHeight;
+  // // 创建一个canvas节点
+  // const canvas = document.createElement("canvas");
+  //
+  // const scale = 1; // 定义任意放大倍数,支持小数;越大,图片清晰度越高,生成图片越慢。
+  // canvas.width = width * scale; // 定义canvas 宽度 * 缩放
+  // canvas.height = height * scale; // 定义canvas高度 *缩放
+  // canvas.style.width = width * scale + "px";
+  // canvas.style.height = height * scale + "px";
+  // canvas.getContext("2d").scale(scale, scale); // 获取context,设置scale
+  //
+  // const scrollTop =
+  //   document.documentElement.scrollTop || document.body.scrollTop; // 获取滚动轴滚动的长度
+  // const scrollLeft =
+  //   document.documentElement.scrollLeft || document.body.scrollLeft; // 获取水平滚动轴的长度
+
+  html2canvas(printContent)
+    .then((canvas) => {
+      const url = canvas.toDataURL("image/png");
+      callback(url);
+    })
+    .catch((err) => {
+      console.error(err);
+    });
+};
+
+/**
+ * 用printJs打印图片
+ * @param url
+ * @param callback
+ */
+export const printImg = (url: string) => {
+  printJS({
+    printable: url,
+    type: "image",
+    documentTitle: "", // 标题
+    style: "@page{size:auto;margin: 1cm ;}", // 去除页眉页脚
+  });
+};
+
+/**
+ * html转图片打印
+ * @param dom
+ * @param callback
+ */
+export const html2CanvasPrint = (dom: HTMLElement, callback?: () => {}) => {
+  //1、html转图片
+  htmlToCanvas(dom, (url: string) => {
+    //2、打印图片
+    printImg(url);
+  });
+};

+ 7 - 6
src/views/base/craftManagement/route/components/bottomTable.vue

@@ -72,7 +72,8 @@ const crudRef = ref(null); //crudRef.value 获取avue-crud对象
 
 const startCreat = () => {
   if (props.tableType === "wuliaocaiji") {
-    commonTableRef.value && commonTableRef.value.startSelect();
+	  //根据物料编码获取对应的物料BOM
+    commonTableRef.value && commonTableRef.value.startSelect({ materialCode: "1202010000005" });
   } else {
     crudRef.value && crudRef.value.rowAdd();
   }
@@ -92,14 +93,14 @@ const onSortChange = () => {
 
 // ============公共弹窗table选择相关,物料采集等使用===============
 const commonTableRef = ref({});
-const commonTableType = ref("MARTERIAL");
+const commonTableType = ref("MARTERIAL_BOM");
 const onSelectedFinish = (itemValue) => {
   crudRef.value && crudRef.value.rowAdd();
   if (props.tableType === "wuliaocaiji") {
-    form.value.itemName = itemValue.materialName;
-    form.value.itemCode = itemValue.materialCode;
-    form.value.itemModel = itemValue.spec;
-    form.value.num = 1;
+    form.value.itemName = itemValue.bomMaterialName;
+    form.value.itemCode = itemValue.bomMaterialCode;
+    form.value.itemModel = itemValue.bomMaterialAttribute;
+    form.value.num = itemValue.bomMaterialNumber;
     form.value.traceType = "S";
     form.value.unit = itemValue.unitDictValue;
   }

+ 3 - 2
src/views/base/craftManagement/route/components/processComponent.vue

@@ -146,6 +146,7 @@ const clickToolCom = (com, index) => {
     ElMessage.warning("请先保存组件!!!");
     return;
   }
+  tipTitle = '编辑'+com.compentName
   selectIndex.value = index;
   currentCom.value = com;
   if (com.compentType === "mingpai" || com.compentType === "duomeiticaiji") {
@@ -173,9 +174,9 @@ const getNameClass = (index) => {
 };
 
 // 底部table ===============
-const tipTitle = ref("编辑物料采集");
+let tipTitle = ref("编辑物料采集");
 const bottomTableRef = ref({});
-const tableType = ref("MARTERIAL");
+const tableType = ref("MARTERIAL_BOM");
 
 const creatNewData = () => {
   bottomTableRef.value && bottomTableRef.value.startCreat();

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 154 - 0
src/views/demo/printDemo.vue


+ 179 - 106
src/views/plan/requisition/index.vue

@@ -45,7 +45,7 @@
             link
             size="small"
             @click="openDialog(2,row)"
-        ><i-ep-edit />编辑</el-button>
+        ><i-ep-edit />{{row.state === '0' ? '编辑' : '流程'}}</el-button>
       </template>
     </avue-crud>
     <el-dialog
@@ -54,15 +54,19 @@
         width="75%"
         @close="dialog.visible = false"
     >
-      <div class="card-container">
-        <el-card style="width: 70%" shadow="always" id="print-page">
+      <template #header="{ close, titleId, titleClass }">
+        <el-button v-if="dialogType === 1"  type="primary" @click="printPage" size="small">打印</el-button>
+      </template>
+      <div class="card-container" >
+        <el-card style="width: 70%" shadow="always">
+          <div ref="toPrintRef">
             <el-row style="text-align: center;">
               <el-col :span="24"><el-text tag="b">零、部(组)件领用单</el-text></el-col>
             </el-row>
           <el-row>
             <el-col :span="14" ></el-col>
             <el-col :span="5" ><el-text tag="p" v-if="form.applyCode">{{form.applyCode}}</el-text></el-col>
-            <el-col :span="5"><el-button v-if="dialogType === 1" type="primary" @click="printPage" size="small">打印</el-button></el-col>
+            <el-col :span="5"></el-col>
           </el-row>
           <el-row style="width: 100%;height: 30px;"></el-row>
           <el-row>
@@ -116,6 +120,11 @@
                 <el-input v-else v-model="row.remark"/>
               </template>
             </el-table-column>
+            <el-table-column label="操作" align="remark" v-if="form.state === '0'">
+              <template v-slot="{row,index}">
+                <el-button type="danger" @click="minusItem(row)" icon="el-icon-minus" style="margin-left:15px;width:25px;height:25px;" circle />
+              </template>
+            </el-table-column>
           </el-table>
           <el-row>
             <el-col :span="2" ><el-text tag="p">领用人:</el-text></el-col>
@@ -127,6 +136,7 @@
             <el-col :span="2" ><el-text tag="p">批准:</el-text></el-col>
             <el-col :span="4" ><el-text tag="p" >{{form.approveUser}}</el-text></el-col>
           </el-row>
+          </div>
         </el-card>
 
         <el-card style="width: 28%" shadow="always">
@@ -138,9 +148,11 @@
               <el-timeline-item center type="success" placement="top">
                 <el-card>
                   <h4>申请</h4>
-                  <el-form ref="maintenanceInfoForm2" size="small" :model="form" label-width="auto" style="max-width: 400px" :rules="rules2">
+                  <el-form ref="maintenanceInfoForm2" size="small" :model="form" label-width="auto" style="max-width: 400px">
                     <el-form-item label="领用人员" prop="auditUser">
+                      <el-text tag="p" v-if="dialogType === 1 || form.state > 0">{{form.applyUser}}</el-text>
                       <el-select
+                          v-else
                           size="small"
                           filterable
                           v-model="form.applyUser"
@@ -153,8 +165,10 @@
                             :value="option.userName" />
                       </el-select>
                     </el-form-item>
-                    <el-form-item label="审核人员">
+                    <el-form-item label="审核人员" v-if="form.state === '0'">
+                      <el-text tag="p" v-if="dialogType === 1 || form.state > 0">{{form.auditUser}}</el-text>
                       <el-select
+                          v-else
                           size="small"
                           filterable
                           v-model="form.auditUser"
@@ -167,38 +181,39 @@
                             :value="option.userName" />
                       </el-select>
                     </el-form-item>
+                    <el-form-item label="申请时间"  v-if="form.state > 0">
+                      <el-text tag="p">{{form.created}}</el-text>
+                    </el-form-item>
                     <el-form-item style="margin-left: 28%" v-if="dialogType !==1">
-                      <el-button type="primary" @click="saveForm(1)">申 请</el-button>
-                      <el-button type="success" @click="saveForm(0)">保 存</el-button>
+                      <el-button type="primary" @click="saveForm(1)" v-if="form.state === '0'">申 请</el-button>
+                      <el-button type="success" @click="saveForm(0)" v-if="form.state === '0'">保 存</el-button>
                     </el-form-item>
                   </el-form>
                 </el-card>
               </el-timeline-item>
-              <el-timeline-item center placement="top"  type='primary'>
+              <el-timeline-item center placement="top"  :type="form.state > 1 ? 'success' : 'primary'">
                 <el-card>
                   <h4>审核</h4>
-                  <el-form v-if="form.state >= 1"  size="small" :model="form" label-width="auto" style="max-width: 400px" :rules="rules2">
-                    <el-form-item label="领用人员" prop="auditUser">
-                      <el-select
-                          size="small"
-                          v-model="form.orderCode"
-                          placeholder="请选择领用人员"
-                          clearable
-                          @change="changeOrder" >
-                        <el-option
-                            v-for="option in userList"
-                            :key="option.userName"
-                            :label="option.nickName"
-                            :value="option.userName" />
-                      </el-select>
+                  <el-form v-if="form.state >= 1"  size="small" :model="form" label-width="auto" style="max-width: 400px">
+                    <el-form-item label="审核人员" prop="auditUser">
+                      <el-text tag="p">{{form.auditUser}}</el-text>
                     </el-form-item>
-                    <el-form-item label="审核人员">
+                    <el-form-item label="处理结果">
+                      <el-text tag="p" v-if="dialogType === 1 || form.state !== '1'">{{form.auditState === 0 ? "通过" : "未通过"}}</el-text>
+                      <el-text tag="p" v-else-if="form.auditUser !== username">{{form.auditState ? form.auditState === 0 ? "通过" : "未通过" : "待审核"}}</el-text>
+                      <el-radio-group v-else v-model="form.auditState">
+                        <el-radio :value=0>通过</el-radio>
+                        <el-radio :value=1>不通过</el-radio>
+                      </el-radio-group>
+                    </el-form-item>
+                    <el-form-item label="会签人员" v-if="dialogType !== 1 && form.state === '1' && form.auditUser === username">
                       <el-select
                           size="small"
-                          v-model="form.orderCode"
-                          placeholder="请选择审核人员"
-                          clearable
-                          @change="changeOrder" >
+                          filterable
+                          multiple
+                          v-model="form.countersignUsers"
+                          placeholder="请选择会签人员"
+                          clearable>
                         <el-option
                             v-for="option in userList"
                             :key="option.userName"
@@ -206,34 +221,33 @@
                             :value="option.userName" />
                       </el-select>
                     </el-form-item>
+                    <el-form-item label="审核时间" v-if="form.audit && form.audit.time">
+                      <el-text tag="p" >{{form.audit.time}}</el-text>
+                    </el-form-item>
                     <el-form-item style="margin-left: 35%">
-                      <el-button type="primary" @click="saveForm(2)">审 核</el-button>
+                      <el-button type="primary" @click="saveForm(2)"  v-if="dialogType !== 1 && form.state === '1' && form.auditUser === username">审 核</el-button>
                     </el-form-item>
                   </el-form>
                 </el-card>
               </el-timeline-item>
-              <el-timeline-item center placement="top" type="info">
+              <el-timeline-item center placement="top" :type="form.state > 3 ? 'success' : 'primary'">
                 <el-card>
                   <h4>会签</h4>
-                  <el-form v-if="form.state >= 3"  size="small" :model="form" label-width="auto" style="max-width: 400px" :rules="rules2">
-                    <el-form-item label="领用人员" prop="auditUser">
-                      <el-select
-                          size="small"
-                          v-model="form.orderCode"
-                          placeholder="请选择领用人员"
-                          clearable >
-                        <el-option
-                            v-for="option in userList"
-                            :key="option.userName"
-                            :label="option.nickName"
-                            :value="option.userName" />
-                      </el-select>
+                  <el-form v-if="form.state >= 3"  size="small" :model="form" label-width="auto" style="max-width: 400px">
+                    <el-form-item v-for="item of form.countersign" label="会签人员:">
+                      <el-text tag="p" >{{item.user}}--</el-text>
+                      <el-text tag="p" v-if="dialogType === 1  ||  item.user !== username">{{item.state === -1 ? '未审核' : item.state === 0 ? '通过' : '未通过'}}</el-text>
+                      <el-text tag="p" v-else-if="item.state !== -1 && item.user === username">{{item.state === 0 ? '通过' : '未通过'}}</el-text>
+                      <el-radio-group v-model="form.countersignState" v-if="dialogType !== 1  && item.state === -1 && item.user === username">
+                        <el-radio :value=0>通过</el-radio>
+                        <el-radio :value=1>不通过</el-radio>
+                      </el-radio-group>
                     </el-form-item>
-                    <el-form-item label="审核人员">
+                    <el-form-item label="批准人员" v-if="dialogType !== 1  && form.countersignOk && form.state === '3'">
                       <el-select
                           size="small"
-                          v-model="form.auditUser"
-                          placeholder="请选择审核人员"
+                          v-model="form.approveUser"
+                          placeholder="请选择批准人员"
                           clearable >
                         <el-option
                             v-for="option in userList"
@@ -242,49 +256,35 @@
                             :value="option.userName" />
                       </el-select>
                     </el-form-item>
-                    <el-form-item label="申请时间" v-if="form.created">
-                      {{form.created}}
+                    <el-form-item label="通过时间" v-if="form.countersignInfo && form.countersignInfo.time">
+                      <el-text tag="p" >{{form.countersignInfo.time}}</el-text>
                     </el-form-item>
                     <el-form-item style="margin-left: 35%">
-                      <el-button type="primary" @click="saveForm(3)">审 核</el-button>
+                      <el-button type="primary" v-if="dialogType !== 1 && form.state === '3' && form.countersignUser.includes(username) && form.countersignBtn" @click="saveForm(3)">审 核</el-button>
                     </el-form-item>
                   </el-form>
                 </el-card>
               </el-timeline-item>
-              <el-timeline-item center placement="top" type="info">
+              <el-timeline-item center placement="top" :type="form.state > 5 ? 'success' : 'primary'">
                 <el-card>
                   <h4>批准</h4>
-                  <el-form v-if="form.state >= 5" size="small" :model="form" label-width="auto" style="max-width: 400px" :rules="rules2">
-                    <el-form-item label="领用人员" prop="auditUser">
-                      <el-select
-                          size="small"
-                          v-model="form.orderCode"
-                          placeholder="请选择领用人员"
-                          clearable
-                          @change="changeOrder" >
-                        <el-option
-                            v-for="option in userList"
-                            :key="option.userName"
-                            :label="option.nickName"
-                            :value="option.userName" />
-                      </el-select>
+                  <el-form v-if="form.state >= 5" size="small" :model="form" label-width="auto" style="max-width: 400px">
+                    <el-form-item label="审批人" v-if="form.state > 5">
+                      <el-text tag="p">{{form.approve.user}}</el-text>
                     </el-form-item>
-                    <el-form-item label="审核人员">
-                      <el-select
-                          size="small"
-                          v-model="form.orderCode"
-                          placeholder="请选择审核人员"
-                          clearable
-                          @change="changeOrder" >
-                        <el-option
-                            v-for="option in userList"
-                            :key="option.userName"
-                            :label="option.nickName"
-                            :value="option.userName" />
-                      </el-select>
+                    <el-form-item label="审批结果">
+                      <el-text tag="p" v-if="dialogType === 1 || form.state === '6' || form.state === '7'">{{form.state === '5' ?  '待审批' : form.state === '6' ? '通过' : '未通过'}}</el-text>
+                      <el-text tag="p" v-else-if="form.approveUser !== username">待审批</el-text>
+                      <el-radio-group v-else v-model="form.approveState">
+                        <el-radio :value=0>通过</el-radio>
+                        <el-radio :value=1>不通过</el-radio>
+                      </el-radio-group>
+                    </el-form-item>
+                    <el-form-item label="审批时间" v-if="form.state > 5">
+                      <el-text tag="p">{{form.approve.time}}</el-text>
                     </el-form-item>
                     <el-form-item style="margin-left: 35%">
-                      <el-button type="primary" @click="saveForm(3)">审 核</el-button>
+                      <el-button type="primary" @click="saveForm(4)" v-if="dialogType !== 1 && form.state === '5' && form.approveUser === username">审 核</el-button>
                     </el-form-item>
                   </el-form>
                 </el-card>
@@ -298,10 +298,12 @@
 </template>
 
 <script setup>
+import { useUserStoreHook } from "@/store/index";
 import { ref, getCurrentInstance } from "vue";
+import { html2CanvasPrint } from "@/utils/common";
 import { useCrud } from "@/hooks/userCrud";
 import dictDataUtil from "@/common/configs/dictDataUtil";
-import {queryApplyInfoDetails,queryOrderList,saveApplyInfoDetails} from "@/api/order"
+import {queryApplyInfoDetails,queryOrderList,saveApplyInfoDetails,auditApplyInfoDetails} from "@/api/order"
 import {getUserList} from "@/api/system/user"
 import { useCommonStoreHook } from "@/store";
 const { isShowTable, tableType } = toRefs(useCommonStoreHook());
@@ -310,6 +312,8 @@ const test = () => {
   tableType.value = tableType.value == 1 ? 2 : 1;
 };
 
+// 1.定义ref
+const toPrintRef = ref(null);
 // 传入一个url,后面不带/
 const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
   useCrud({
@@ -318,8 +322,10 @@ const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
 const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } = Methords; //增删改查
 const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
 const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
-
-
+const { username } = useUserStoreHook().user;
+const minusItem =(row)=>{
+  tableDataList.value = tableDataList.value.filter(item=>item.id !== row.id)
+}
 const changeOrder =(val)=>{
   queryApplyInfoDetails({orderCode: val}).then((data)=>{
     tableDataList.value = data.data
@@ -327,6 +333,8 @@ const changeOrder =(val)=>{
 }
 const saveForm = (type) =>{
   let state = type;
+  let step = null;
+  let nextUsers = ""
   if(type === 1 || type === 0){
     if(tableDataList.value.length === 0){
       ElMessage.error("当前没有申请的物料信息")
@@ -342,13 +350,65 @@ const saveForm = (type) =>{
         return;
       }
     }
+    if(!form.value.applyUser){
+      ElMessage.error("领用人员不能为空")
+      return;
+    }
     if(!form.value.auditUser){
       ElMessage.error("审核人员不能为空")
       return;
     }
+    const params = {...form.value,'state': state,details: tableDataList.value}
+    saveApplyInfoDetails(params).then((data)=>{
+      if(data.code === '200'){
+        ElMessage.success(data.msg)
+        dialog.visible = false
+        dataList()
+      }else{
+        ElMessage.error(data.msg)
+      }
+    })
+    return;
   }
-  const params = {...form.value,'state': state,details: tableDataList.value}
-  saveApplyInfoDetails(params).then((data)=>{
+  step = "audit";
+  if(type === 2){
+    if(form.value.auditState != undefined){
+      if(form.value.auditState === 0 && form.value.countersignUsers.length === 0){
+        ElMessage.error("会签人员不能为空")
+        return;
+      }
+    }else{
+      if(!form.value.auditState){
+        ElMessage.error("请选择处理结果")
+        return;
+      }
+    }
+    nextUsers = form.value.countersignUsers.join(",")
+    state = form.value.auditState
+  }
+  if(type === 3){
+    step = "countersign";
+    if(!form.value.approveUser && form.value.countersignOk){
+      ElMessage.error("请选择审批人员")
+      return;
+    }
+    if(form.value.countersignState === undefined){
+      ElMessage.error("请选择处理结果")
+      return;
+    }
+    nextUsers = form.value.approveUser
+    state = form.value.countersignState
+  }
+  if(type === 4){
+    step = "approve";
+    if(form.value.approveState === undefined){
+      ElMessage.error("请选择处理结果")
+      return;
+    }
+    state = form.value.approveState
+  }
+  const params = {id: form.value.id,'state': state,currentStep: step,nextUser: nextUsers}
+  auditApplyInfoDetails(params).then((data)=>{
     if(data.code === '200'){
       ElMessage.success(data.msg)
       dialog.visible = false
@@ -370,42 +430,56 @@ const dialog = reactive({
 const tableDataList = ref([])
 const openDialog = (type,row)=>{
   dialogType.value = type
+  tableDataList.value = []
+  form.value = {}
   form.value.sendOrg = "周转库";
   form.value.applyOrg = "制造中心"
+  form.value.state = "0"
   if(type !== 0){
     queryApplyInfoDetails({applyCode: row.applyCode}).then((data)=>{
       tableDataList.value = data.data
     })
     form.value = row
   }
+  form.value.countersign = []
+  if(row && row.flowInfo){
+    let json = JSON.parse(row.flowInfo)
+    let auditInfo = json.audit
+    if(auditInfo){
+      form.value.audit =auditInfo.info
+      form.value.auditState = form.value.audit.state
+    }
+    if(row.countersignUser){
+      form.value.countersignUsers = row.countersignUser.split(",")
+    }
+    form.value.countersignBtn = false
+    if(json.countersign){
+      form.value.countersign = json.countersign.list
+      form.value.countersignInfo = json.countersign.info
+      //当断当前是否最后一个
+      let isOk = true
+      for(let obj of form.value.countersign){
+        if(obj.state === -1 && obj.user === username){
+          form.value.countersignBtn = true
+        }
+        if(obj.user !== username && obj.state === -1){
+          isOk = false
+        }
+      }
+      form.value.countersignOk = isOk;
+    }
+    if(json.approve){
+      form.value.approve = json.approve.info
+    }
+    form.value.approveUser = row.approveUser
+  }
   dialog.visible = true
   getUserList({}).then((data)=>{
     userList.value = data.data
   })
 }
 const printPage = ()=>{
-
-  let wpt = document.querySelector('#print-page');//表格id
-  const printWindow = window.open('', '_blank');
-  const printContent = wpt.innerHTML;
-  printWindow.document.write(`
-        <html>
-          <head>
-            <title>打印表格</title>
-            <style>
-              body { margin: 0; padding: 0; }
-
-            </style>
-          </head>
-          <body>
-            ${printContent}
-          </body>
-        </html>
-      `);
-  printWindow.document.close();
-  printWindow.focus();
-  printWindow.print();
-  printWindow.close();
+  html2CanvasPrint(toPrintRef.value);
 }
 // 设置表格列或者其他自定义的option
 option.value = Object.assign(option.value, {
@@ -432,7 +506,6 @@ option.value = Object.assign(option.value, {
     {
       label: "领用单位",
       prop: "applyOrg",
-      search: true,
       width: 150,
       overHidden: true,
     },

+ 145 - 0
src/views/plan/schedule/index.vue

@@ -0,0 +1,145 @@
+<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 }">
+        <div id="charts"></div>
+      </template>
+    </avue-crud>
+  </div>
+</template>
+<script setup>
+import { ref } from "vue";
+import { useCrud } from "@/hooks/userCrud";
+import dictDataUtil from "@/common/configs/dictDataUtil";
+
+import { useDictionaryStoreHook } from "@/store";
+
+// 数据字典相关
+const { dicts } = useDictionaryStoreHook();
+
+// 传入一个url,后面不带/
+const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
+  useCrud({
+    src: "/api/v1/plan/task",
+  });
+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对象
+
+onMounted(() => {
+  dataList();
+});
+
+// 设置表格列或者其他自定义的option
+option.value = Object.assign(option.value, {
+  selection: true,
+  menu: false,
+  addBtn: false,
+  filterBtn: false,
+  searchShowBtn: false,
+  columnBtn: false,
+  gridBtn: false,
+  column: [
+    {
+      label: "序列号",
+      prop: "seqNo",
+      search: true,
+    },
+    {
+      label: "工位名称",
+      prop: "stationName",
+      search: true,
+    },
+    {
+      label: "工单编码",
+      prop: "workOrderCode",
+      search: true,
+    },
+    {
+      label: "工单名称",
+      prop: "workOrderName",
+    },
+    {
+      label: "产线编码",
+      prop: "productLineCode",
+      search: true,
+    },
+    {
+      label: "产线名称",
+      prop: "productLineName",
+    },
+    {
+      label: "工艺路线名称",
+      prop: "routeName",
+    },
+    {
+      label: "物料编号",
+      prop: "materialCode",
+      search: true,
+    },
+    {
+      label: "工单名称",
+      prop: "workOrderName",
+    },
+    {
+      label: "工序编码",
+      prop: "operationCode",
+      search: true,
+    },
+    {
+      label: "工序名称",
+      prop: "operationName",
+    },
+
+    {
+      label: "状态",
+      prop: "state",
+      type: "select",
+      search: true,
+      dicUrl:
+        dictDataUtil.request_url + dictDataUtil.TYPE_CODE.station_task_state,
+      props: {
+        label: "dictLabel",
+        value: "dictValue",
+      },
+    },
+    {
+      label: "计划开始时间",
+      prop: "planStartWhen",
+    },
+    {
+      label: "计划结束时间",
+      prop: "planStartEnd",
+    },
+    {
+      label: "修改时间",
+      prop: "updated",
+    },
+  ],
+});
+</script>
+
+<style lang="scss" scoped>
+#charts {
+  width: 100%;
+  height: 300px;
+}
+</style>

+ 0 - 13
src/views/system/user/index.vue

@@ -32,19 +32,6 @@
                 <el-option label="禁用" value=1 />
               </el-select>
             </el-form-item>
-
-<!--            <el-form-item label="创建时间">
-              <el-date-picker
-                class="!w-[240px]"
-                v-model="dateTimeRange"
-                type="daterange"
-                range-separator="~"
-                start-placeholder="开始时间"
-                end-placeholder="截止时间"
-                value-format="YYYY-MM-DD"
-              />
-            </el-form-item>-->
-
             <el-form-item>
               <el-button type="primary" @click="handleQuery"
                 ><i-ep-search />搜索</el-button