소스 검색

Merge branch 'master' of http://62.234.61.92:3000/wjm/mec-cloud_IntelligentManufacturing_CLIENT

ZYZ 1 년 전
부모
커밋
6363a45146

+ 11 - 0
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/controller/BpmExecuteProcessController.java

@@ -126,4 +126,15 @@ public class BpmExecuteProcessController extends BaseController {
         return AjaxResult.success(PreExecutionToolClass.getNodeFormInfos(nodeForm));
     }
 
+
+    /**
+     * 化纤项目查询流程执行任务列表
+     */
+    // @PreAuthorize("@ss.hasPermi('system:process:list')")
+    @GetMapping("/chemicalFibreList")
+    public TableDataInfo ChemicalFibreList(BpmExecuteProcess bpmExecuteProcess) throws Exception {
+        startPage();
+        return getDataTable(bpmExecuteProcessService.selectChemicalFibreBpmExecuteProcessList(bpmExecuteProcess));
+    }
+
 }

+ 11 - 0
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/entity/BpmExecuteProcess.java

@@ -89,6 +89,9 @@ public class BpmExecuteProcess extends BaseEntityPlus implements Serializable {
     @Excel(name = "流程类型")
     private String taskProcessType;
 
+    /** 产线编号 */
+    private String taskProductionLineNo;
+
     public Long getId() {
         return id;
     }
@@ -193,6 +196,14 @@ public class BpmExecuteProcess extends BaseEntityPlus implements Serializable {
         this.taskProcessName = taskProcessName;
     }
 
+    public String getTaskProductionLineNo() {
+        return taskProductionLineNo;
+    }
+
+    public void setTaskProductionLineNo(String taskProductionLineNo) {
+        this.taskProductionLineNo = taskProductionLineNo;
+    }
+
     @Override
     public String toString() {
         final StringBuilder sb = new StringBuilder("BpmExecuteProcess{");

+ 11 - 0
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/mapper/BpmExecuteProcessMapper.java

@@ -196,4 +196,15 @@ public interface BpmExecuteProcessMapper {
      * @return
      */
     public int updateProcessStateByKey(String taskKey);
+
+    /**
+     * (化纤项目)根据当前用户登陆信息得到当前可执行流程
+     */
+    List<CommonEntity> queryChemicalFibreExecuteProcessEnd(@Param("objectMap") Map<String, Object> objectMap);
+
+    /**
+     * (化纤项目)根据当前用户登陆信息得到当前可执行流程
+     */
+    List<CommonEntity> queryChemicalFibreExecuteProcess(@Param("objectMap") Map<String, Object> objectMap);
+
 }

+ 10 - 0
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/IBpmExecuteProcessService.java

@@ -120,6 +120,7 @@ public interface IBpmExecuteProcessService {
      * 通过formKeys查询表单信息
      *
      * @param
+     * @param formKeys
      * @return
      */
     List<CommonEntity> getFromInfoByFormKeys(String[] formKeys);
@@ -137,4 +138,13 @@ public interface IBpmExecuteProcessService {
      * @return
      */
     public int updateProcessStateByKey(String taskProcessState, String taskKey);
+
+    /**
+     * 查询流程执行任务列表
+     *
+     * @param bpmExecuteProcess 流程执行任务
+     * @return 流程执行任务集合
+     */
+    List<CommonEntity> selectChemicalFibreBpmExecuteProcessList(BpmExecuteProcess bpmExecuteProcess) throws Exception;
+
 }

+ 89 - 0
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/impl/BpmExecuteProcessServiceImpl.java

@@ -371,6 +371,95 @@ public class BpmExecuteProcessServiceImpl implements IBpmExecuteProcessService {
         return runBpmExecuteProcessMapper.updateProcessStateByKey(taskKey);
     }
 
+    @Override
+    public List<CommonEntity> selectChemicalFibreBpmExecuteProcessList(BpmExecuteProcess bpmExecuteProcess) throws Exception {
+        // 得到当前执行管道的列表关联信息
+        //Map<String, Object> params = new HashMap<>();
+        //params.put("isEnablePaging", "false");  // 不弃启用分页
+        //params.put("dictType", "plan_execution_data"); // 排需要的必要参数
+        //ResponseEntity tenantDict = sending.sendGetTenantDict(params);
+        SysDictData dictData = new SysDictData();
+        dictData.setDictType("plan_execution_data");
+        List<SysDictData> dictDataList = sending.sendGetTenantDict(dictData);
+        //if (tenantDict.getStatusCodeValue() == 200) {
+        if (StringUtils.isNotEmpty(dictDataList)) {
+            Map<String, Object> objectMap = new HashMap<>();  // 查询执行管道的参数
+            objectMap.putAll(convertEntityToMap(bpmExecuteProcess));
+
+            if (!bpmExecuteProcess.getTaskProcessType().equals("1")) {  // 审批类型
+                dictDataList.forEach(item -> {
+                    objectMap.put(item.getDictLabel(), item.getDictValue());
+                });
+            }
+            if (bpmExecuteProcess.getTaskProcessState() == 3L) {
+                // 首先根据当前登陆用户得到他可以执行的所有节点
+                List<CommonEntity> commonEntities;
+                if (bpmExecuteProcess.getTaskProcessType().equals("1")) {  //审批类型
+                    commonEntities = runBpmExecuteProcessMapper.queryExecuteProcessApprovalEnd(objectMap);
+                } else {
+                    // 完成展示数据
+                    System.err.println("数据:"+objectMap.toString());
+                    commonEntities = runBpmExecuteProcessMapper.queryChemicalFibreExecuteProcessEnd(objectMap);
+                }
+
+
+                if (bpmExecuteProcess.getTaskProcessType().equals("1")) {
+                    // 审批类型得到当前节点前所执行过的日志
+                    commonEntities.forEach(item -> {
+                        List<BpmExecuteNodeLog> bpmExecuteNodeLogList = iBpmExecuteNodeLogService.selectBpmExecuteNodeLogList(new BpmExecuteNodeLog(item.getResultMap().get("bepTaskKey").toString()));
+                        item.getResultMap().put("nodeLog", bpmExecuteNodeLogList);
+                    });
+                }
+                return commonEntities;
+                // 进行中展示数据列表
+            } else {
+                List<SysRole> sysRoles = SecurityUtils.getLoginUser().getUser().getRoles();
+                List<String> roles = new ArrayList<>();
+                if (sysRoles.size() != 0) {
+                    roles.addAll(sysRoles.stream().map(SysRole::getRoleKey).collect(Collectors.toList()));
+                }
+                // 根据当前的用户id得到可以执行的流程节点
+                objectMap.put("userId", SecurityUtils.getUserId());
+                // 得到当前发起请求的用户角色列表
+                objectMap.put("taskRealRoleList", roles);
+                // 首先根据当前登陆用户得到他可以执行的所有节点
+                List<CommonEntity> commonEntities;
+                if (bpmExecuteProcess.getTaskProcessType().equals("1")) {
+                    commonEntities = runBpmExecuteProcessMapper.queryExecuteApproveProcess(objectMap);
+                } else {
+                    // 进行中展示数据列表
+                    commonEntities = runBpmExecuteProcessMapper.queryChemicalFibreExecuteProcess(objectMap);
+                }
+                // 0 工业类型 1 审批类型
+                if (bpmExecuteProcess.getTaskProcessType().equals("1")) {
+                    // 审批类型得到当前节点前所执行过的日志
+                    commonEntities.forEach(item -> {
+                        List<BpmExecuteNodeLog> bpmExecuteNodeLogList = iBpmExecuteNodeLogService.selectBpmExecuteNodeLogList(new BpmExecuteNodeLog(item.getResultMap().get("bepTaskKey").toString()));
+                        item.getResultMap().put("nodeLog", bpmExecuteNodeLogList);
+                    });
+                } else if (bpmExecuteProcess.getTaskProcessType().equals("0")) {
+                    // 查询异常脚本信息
+                    List<CommonEntity> commonEntities1 = bpmExecuteNodeMiddleService.addExceptionScript(commonEntities);
+                    commonEntities.forEach(item -> {
+                        String keyName = item.getResultMap().get("benTaskNodeKey").toString();
+                        String taskKey = item.getResultMap().get("bepTaskKey").toString();
+                        item.getResultMap().putAll(
+                                commonEntities1.stream()
+                                        .filter(ctem ->
+                                                ctem.getResultMap().get("benTaskNodeKey").equals(keyName)
+                                                        && ctem.getResultMap().get("bepTaskKey").equals(taskKey))
+                                        .findFirst()
+                                        .get()
+                                        .getResultMap()
+                        );
+                    });
+                }
+                return commonEntities;
+            }
+        }
+        return null;
+    }
+
     // 将实体对象转换为Map的方法
     public static Map<String, Object> convertEntityToMap(Object entity) {
         Map<String, Object> map = new HashMap<>();

+ 168 - 0
zkqy-process-execution/src/main/resources/mapper/bpm/dispersed/BpmExecuteProcessMapper.xml

@@ -667,5 +667,173 @@
     </update>
 
 
+    <select id="queryChemicalFibreExecuteProcessEnd" resultMap="retMap">
+        select
+        bep.id as bep_id,
+        bep.task_key as bep_task_key,
+        bep.task_key as bpm_execute_process_task_key,
+        plan.${planName} as bep_task_name,
+        plan.production_line_no as bep_task_production_line_no,
+        bep.task_plan_key as bep_task_plan_key,
+        bep.task_plan_key as bpm_execute_process_task_plan_key,
+        bep.task_node_key as bep_task_node_key,
+        bep.task_node_next_key as bep_task_node_next_key,
+        bep.task_node_next_key as bpm_execute_process_task_node_next_key,
+        bep.task_process_type as bep_task_process_type,
+        bep.task_process_key as bep_task_process_key,
+        bep.task_process_xml_content as bep_task_process_xml_content,
+        bep.task_process_state as bep_task_process_state,
+        bep.task_process_note as bep_task_process_note,
+        bep.del_flag as bep_del_flag,
+        bep.remark as bep_remark,
+        ben.id as ben_id,
+        ben.task_process_key as ben_task_process_key,
+        ben.task_node_key as ben_task_node_key,
+        ben.task_node_name as ben_task_node_name,
+        ben.task_node_form_key as ben_task_node_form_key,
+        ben.task_node_form_type as ben_task_node_form_type,
+        ben.task_node_type as ben_task_node_type,
+        ben.task_node_before as ben_task_node_before,
+        ben.task_node_after as ben_task_node_after,
+        ben.task_node_role_permission as ben_task_node_role_permission,
+        ben.task_remark as ben_task_remark,
+        ben.task_node_number as ben_task_node_number,
+        ben.task_node_weight as ben_task_node_weight,
+        ben.task_node_state as ben_task_node_state,
+        ben.task_priority as ben_task_priority,
+        ben.task1 as ben_task1,
+        ben.task2 as ben_task2,
+        ben.task3 as ben_task3,
+        ben.task4 as ben_task4,
+        ben.task5 as ben_task5,
+        ben.del_flag as ben_del_flag,
+        ben.create_by_id as ben_create_by_id,
+        ben.create_by as ben_create_by,
+        ben.create_time as ben_create_time,
+        benm.id as benm_id,
+        benm.task_node_key as benm_task_node_key,
+        benm.task_virtually_role as benm_task_virtually_role,
+        benm.task_real_role as benm_task_real_role,
+        benm.task_execute_user_no as benm_task_execute_user_no,
+        benm.task_artificial_script_key as benm_task_artificial_script_key,
+        benm.task_automatic_script_trigger_type as benm_task_automatic_script_trigger_type
+        from
+        {DBNAME}.bpm_execute_process as bep
+        inner join {DBNAME}.bpm_execute_node as ben on
+        ben.task_process_key = bep.task_key
+        and ben.task_node_key = bep.task_node_next_key
+        join {DBNAME}.bpm_execute_node_middle as benm on
+        benm.task_node_key = ben.task_node_key
+        and benm.task_process_key = bep.task_key
+        join {DBNAME}.${planTableName} as plan on
+        plan.${planID} = bep.task_plan_key
+        where bep.task_process_state = 3
+        <if test="taskProcessType != null">and bep.task_process_type = #{taskProcessType}</if>
+        <if test="taskProductionLineNo != null and taskProductionLineNo != ''">and plan.production_line_no = #{taskProductionLineNo} </if>
+        <if test="taskName != null  and taskName != ''">
+            and CONCAT(
+            IFNULL( bep.task_key, '' ),
+            IFNULL( bep.task_name, '' ),
+            IFNULL( bep.task_node_key, '' ),
+            IFNULL( bep.task_node_next_key, '' ),
+            IFNULL( bep.task_process_key, '' ),
+            IFNULL( bep.task_process_note, '' ),
+            IFNULL( plan.${planName}, '' ),
+            IFNULL( PLAN.production_line_no,'')) LIKE concat('%', #{taskName}, '%')
+        </if>
+        order by ben.create_time desc
+    </select>
+
+    <select id="queryChemicalFibreExecuteProcess" resultMap="retMap">
+        select
+        bep.id as bep_id,
+        bep.task_key as bep_task_key,
+        bep.task_key as bpm_execute_process_task_key,
+        plan.${planName} as bep_task_name,
+        plan.production_line_no as bep_task_production_line_no,
+        bep.task_plan_key as bep_task_plan_key,
+        bep.task_plan_key as bpm_execute_process_task_plan_key,
+        bep.task_node_key as bep_task_node_key,
+        bep.task_node_next_key as bep_task_node_next_key,
+        bep.task_node_next_key as bpm_execute_process_task_node_next_key,
+        bep.task_process_type as bep_task_process_type,
+        bep.task_process_key as bep_task_process_key,
+        bep.task_process_xml_content as bep_task_process_xml_content,
+        bep.task_process_state as bep_task_process_state,
+        bep.task_process_note as bep_task_process_note,
+        bep.del_flag as bep_del_flag,
+        bep.remark as bep_remark,
+        ben.id as ben_id,
+        ben.task_process_key as ben_task_process_key,
+        ben.task_node_key as ben_task_node_key,
+        ben.task_node_name as ben_task_node_name,
+        ben.task_node_form_key as ben_task_node_form_key,
+        ben.task_node_form_type as ben_task_node_form_type,
+        ben.task_node_type as ben_task_node_type,
+        ben.task_node_before as ben_task_node_before,
+        ben.task_node_after as ben_task_node_after,
+        ben.task_node_role_permission as ben_task_node_role_permission,
+        ben.task_remark as ben_task_remark,
+        ben.task_node_number as ben_task_node_number,
+        ben.task_node_weight as ben_task_node_weight,
+        ben.task_node_state as ben_task_node_state,
+        ben.task_priority as ben_task_priority,
+        ben.task1 as ben_task1,
+        ben.task2 as ben_task2,
+        ben.task3 as ben_task3,
+        ben.task4 as ben_task4,
+        ben.task5 as ben_task5,
+        ben.del_flag as ben_del_flag,
+        ben.create_by_id as ben_create_by_id,
+        ben.create_by as ben_create_by,
+        ben.create_time as ben_create_time,
+        benm.id as benm_id,
+        benm.task_node_key as benm_task_node_key,
+        benm.task_virtually_role as benm_task_virtually_role,
+        benm.task_real_role as benm_task_real_role,
+        benm.task_execute_user_no as benm_task_execute_user_no,
+        benm.task_artificial_script_key as benm_task_artificial_script_key,
+        benm.task_automatic_script_trigger_type as benm_task_automatic_script_trigger_type
+        from
+        {DBNAME}.bpm_execute_process as bep
+        inner join {DBNAME}.bpm_execute_node as ben on
+        ben.task_process_key = bep.task_key
+        and ben.task_node_key = bep.task_node_next_key
+        join {DBNAME}.bpm_execute_node_middle as benm on
+        benm.task_node_key = ben.task_node_key
+        and benm.task_process_key = bep.task_key
+        join {DBNAME}.${planTableName} as plan on
+        plan.${planID} = bep.task_plan_key
+        where
+        bep.task_node_next_key in (select task_node_key
+        from {DBNAME}.bpm_execute_node_middle
+        where
+        FIND_IN_SET(#{userId}, task_execute_user_no) > 0
+        <if test="taskRealRoleList != null and taskRealRoleList.size() > 0">
+            OR
+            <foreach collection="taskRealRoleList" item="role" separator=" OR ">
+                FIND_IN_SET(#{role}, task_real_role) > 0
+            </foreach>
+        </if>
+        )
+        <if test="taskProcessState != null">and bep.task_process_state = #{taskProcessState}</if>
+        <if test="taskProcessType != null">and bep.task_process_type = #{taskProcessType}</if>
+        <if test="taskProductionLineNo != null and taskProductionLineNo != ''">and plan.production_line_no = #{taskProductionLineNo}</if>
+        <if test="taskName != null  and taskName != ''">
+            and CONCAT(
+            IFNULL( bep.task_key, '' ),
+            IFNULL( bep.task_name, '' ),
+            IFNULL( bep.task_node_key, '' ),
+            IFNULL( bep.task_node_next_key, '' ),
+            IFNULL( bep.task_process_key, '' ),
+            IFNULL( bep.task_process_note, '' ),
+            IFNULL( plan.${planName}, '' ),
+            IFNULL( plan.production_line_no,'')) LIKE concat('%', #{taskName}, '%')
+        </if>
+        order by ben.create_time desc
+    </select>
+
+
+
 </mapper>
 

+ 4 - 4
zkqy-system/src/main/resources/mapper/system/SysMenuMapper.xml

@@ -77,8 +77,8 @@
 		from sys_menu m
 		left join sys_tenant_menu tm on tm.menu_id = m.menu_id
 		where tm.tenant_id = #{tenantId}
-		and m.menu_name not in ('数据引擎','流程引擎','表单引擎','移动端引擎')
-		and parent_id not in (select menu_id from  sys_menu where menu_name in ('数据引擎','流程引擎','表单引擎','移动端引擎'))
+		and m.menu_name not in ('数据引擎','流程引擎','表单引擎','移动端引擎','后台管理')
+		and parent_id not in (select menu_id from  sys_menu where menu_name in ('数据引擎','流程引擎','表单引擎','移动端引擎','后台管理'))
 		<if test="menu.menuName != null and menu.menuName != ''">
 			AND m.menu_name like concat('%', #{menu.menuName}, '%')
 		</if>
@@ -100,8 +100,8 @@
 		from sys_tenant_menu tm
 		left join sys_menu m on tm.menu_id = m.menu_id
 		where m.menu_type in ('M', 'C') and m.status = 0 and tm.tenant_id = #{tenantId}
-		and m.menu_name not in ('数据引擎','流程引擎','表单引擎','移动端引擎')
-		and parent_id not in (select menu_id from  sys_menu where menu_name in ('数据引擎','流程引擎','表单引擎','移动端引擎'))
+		and m.menu_name not in ('数据引擎','流程引擎','表单引擎','移动端引擎','后台管理')
+		and parent_id not in (select menu_id from  sys_menu where menu_name in ('数据引擎','流程引擎','表单引擎','移动端引擎','后台管理'))
 		order by m.parent_id, m.order_num
 	</select>
 	

+ 9 - 0
zkqy-ui/src/api/bpmprocess/run/executeProcess.js

@@ -52,6 +52,15 @@ export function processList(query) {
     baseURL: process.env.VUE_APP_BASE_API4,
   })
 }
+// 执行管道列表数据  带产线信息
+export function chemicalFibreList(query) {
+  return request({
+    url: '/system/execute/process/chemicalFibreList',
+    method: 'get',
+    params: query,
+    baseURL: process.env.VUE_APP_BASE_API4,
+  })
+}
 
 // 运行节点
 export function runProcessNodeExecution(data) {

+ 884 - 0
zkqy-ui/src/views/bussiness/processMange_line.vue

@@ -0,0 +1,884 @@
+<template>
+  <div class="process-mange-wrap">
+    <!-- <el-card shadow="always" :body-style="{ padding: '20px' }"> -->
+    <el-row>
+      <el-col :xs="24" :md="8" :xl="8" class="col">
+        <div class="statistic-wrap">
+          <div class="discription">
+            <span class="title">已完成</span>
+            <span class="sub-title">已经完成的生产任务数</span>
+          </div>
+          <span class="data">{{ doneNum }}</span>
+        </div>
+      </el-col>
+      <el-col :xs="24" :md="8" :xl="8" class="col">
+        <div class="statistic-wrap">
+          <div class="discription">
+            <span class="title">进行中</span>
+            <span class="sub-title">正在进行的生产任务数</span>
+          </div>
+          <span class="data">{{ doingNum }}</span>
+        </div>
+      </el-col>
+      <!-- <el-col :xs="24" :md="8" :xl="8" class="col">
+        <div class="statistic-wrap">
+          <div class="discription">
+            <span class="title">完成</span>
+            <span class="sub-title">已经完成的管道</span>
+          </div>
+          <span class="data">0</span>
+        </div>
+      </el-col> -->
+    </el-row>
+    <!-- </el-card> -->
+    <div class="main-area">
+      <div class="show-header">
+        <h3 class="header">管道列表</h3>
+        <div class="search-list">
+          <div class="select">
+            <span class="label">产线 :</span>
+            <el-select
+              v-model="productLine"
+              value-key=""
+              placeholder="请选择产线"
+              clearable
+              filterable
+              @change="getList"
+            >
+              <el-option
+                v-for="item in productLineList"
+                :key="item.productionLineNo"
+                :label="item.productionLineName"
+                :value="item.productionLineNo"
+              >
+              </el-option>
+            </el-select>
+          </div>
+          <div class="search-tab">
+            <el-radio-group v-model="taskType" v-show="false">
+              <el-radio-button :label="1">我的处理</el-radio-button>
+              <el-radio-button :label="2">其他处理</el-radio-button>
+            </el-radio-group>
+            <el-radio-group
+              class="btn-list-two"
+              v-model="queryParams.taskProcessState"
+              @change="getList"
+            >
+              <el-radio-button label="3">已完成</el-radio-button>
+              <el-radio-button label="0">进行中</el-radio-button>
+              <!-- <el-radio-button label="">所有</el-radio-button> -->
+            </el-radio-group>
+          </div>
+          <div class="search-input">
+            <el-input
+              placeholder="请输入..."
+              v-model="queryString"
+              @keyup.enter.native="getList"
+            >
+              <el-button
+                slot="append"
+                icon="el-icon-search"
+                @click="getList"
+              ></el-button>
+            </el-input>
+          </div>
+        </div>
+      </div>
+      <div class="show-body">
+        <!--    流程任务列表    -->
+        <el-table :data="tableData" v-loading="loading" border stripe>
+          <el-table-column type="selection" width="55" align="center" />
+          <el-table-column type="index" width="50" align="center" />
+          <el-table-column
+            v-for="col in newColumn"
+            :prop="col.prop"
+            :key="col.prop"
+            :label="col.label"
+            align="center"
+          >
+            <template slot-scope="scope">
+              <span v-if="col.prop == 'benCreateTime'">{{
+                scope.row.benCreateTime.replace("T", " ")
+              }}</span>
+              <span v-else-if="col.prop == 'bepTaskProcessType'">{{
+                getDictLabel(scope.row.bepTaskProcessType, dict.type.bpm_type)
+              }}</span>
+              <span v-else-if="col.prop == 'benTaskNodeState'">{{
+                scope.row.benTaskNodeState == "0" ? "未执行" : "已执行"
+              }}</span>
+              <span v-else-if="col.prop == 'bepTaskProcessState'">{{
+                getDictLabel(
+                  scope.row.bepTaskProcessState,
+                  dict.type.task_process_state
+                )
+              }}</span>
+              <span v-else>{{ scope.row[col.prop] }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="操作" align="center">
+            <template slot-scope="scope">
+              <div class="excute-wrap">
+                <el-button
+                  type="warning"
+                  plain
+                  size="small"
+                  class="mr10 mb5"
+                  v-show="scope.row.bepTaskProcessState == '0'"
+                  @click="opneExecuteNode(scope.row)"
+                >
+                  运行
+                </el-button>
+                <el-dropdown>
+                  <el-button type="warning" plain size="small">
+                    处理<i class="el-icon-arrow-down el-icon--right"></i>
+                  </el-button>
+                  <el-dropdown-menu
+                    v-if="
+                      scope.row.exceptionScriptList &&
+                      scope.row.exceptionScriptList.length
+                    "
+                    slot="dropdown"
+                  >
+                    <!-- <el-dropdown-item>
+                      <el-button
+                        size="mini"
+                        type="text"
+                        icon="el-icon-edit"
+                        @click="excuteHandler(scope.row)"
+                        v-hasPermi="['system:user:edit']"
+                      >处理
+                      </el-button>
+                    </el-dropdown-item> -->
+                    <el-dropdown-item>
+                      <el-dropdown size="mini">
+                        <el-button
+                          size="mini"
+                          type="text"
+                          icon="el-icon-d-arrow-right"
+                          >触发异常
+                        </el-button>
+                        <el-dropdown-menu slot="dropdown">
+                          <el-dropdown-item
+                            v-for="item in scope.row.exceptionScriptList"
+                            :key="item.id"
+                          >
+                            <el-button
+                              @click="exceptionTrigger(scope.row, item)"
+                              size="mini"
+                              type="text"
+                              >{{ item.scriptName }}
+                            </el-button>
+                          </el-dropdown-item>
+                        </el-dropdown-menu>
+                      </el-dropdown>
+                    </el-dropdown-item>
+                  </el-dropdown-menu>
+                </el-dropdown>
+              </div>
+            </template>
+          </el-table-column>
+        </el-table>
+
+        <!--    分页    -->
+        <pagination
+          v-show="total > 0"
+          :total="total"
+          :page.sync="queryParams.pageNum"
+          :limit.sync="queryParams.pageSize"
+          @pagination="getList"
+        />
+      </div>
+
+      <div class="show-window">
+        <!-- 运行节点弹窗 -->
+
+        <el-dialog :title="nodeTitle" :visible.sync="open">
+          <!--  <el-form label-width="100px" :model="commonData">
+            <h1>这里会引入当前节点需要处理的表单</h1>
+          </el-form> -->
+          <!-- <k-form-build
+            v-if="formType == 'dragForm'"
+            class="formBuild"
+            ref="addFromRef"
+            :dynamicData="dynamicData"
+            :defaultValue="defaultValue"
+            :value="jsonData"
+          /> -->
+
+          <component
+            :is="myForm"
+            :formData="formData"
+            :row="row"
+            ref="myFormRef"
+            v-if="myForm"
+          ></component>
+
+          <!-- <Sorting ref="myFormRef" :formData="formData" :row="row"></Sorting> -->
+          <!-- <PhysicalInspection
+            :formData="formData"
+            :row="row"
+          ></PhysicalInspection> -->
+
+          <span slot="footer" class="dialog-footer">
+            <el-button @click="closeExecuteNode">取消</el-button>
+            <el-button type="primary" @click="executeNode">确认运行</el-button>
+          </span>
+        </el-dialog>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import {
+  processList,
+  runProcessNodeExecution,
+  getProcessNodeFormTemplate,
+  getProcessNodeFormInfoData,
+  chemicalFibreList,
+} from "@/api/bpmprocess/run/executeProcess";
+import { queryDropDownBoxData } from "@/api/dragform/form";
+import { triggerExceptionNode } from "@/api/bpmprocess/process";
+
+import getNodeSequence from "@/utils/bpmn/getNodeSequence";
+import GY02 from "./dialogCompments/GongYi/GY02.vue";
+import ZL01 from "./dialogCompments/ZhiLiang/ZL1.vue";
+import { getForm } from "@/api/dragform/form";
+import DialogTemplate from "@/views/dialogTemplate/components/index.vue";
+
+// 弹窗表单组件
+import GY01 from "./dialogCompments/GongYi/GY01.vue";
+import GY03 from "./dialogCompments/GongYi/GY03.vue";
+import CG1 from "./dialogCompments/test-component/CaiGou/CG1.vue";
+import CG02 from "./dialogCompments/test-component/CaiGou/CG02.vue";
+import KC01 from "./dialogCompments/test-component/KuCun/KC1.vue";
+import KC02 from "./dialogCompments/test-component/KuCun/KC02.vue";
+import GY06 from "./dialogCompments/GongYi/GY06.vue";
+import KB01 from "./dialogCompments/KongBai/KB01.vue"; //空白提示组件
+import SC01 from "./dialogCompments/ShengChan/SC01.vue";
+
+import Loading from "./dialogCompments/Edu/Loading.vue";
+import Processing from "./dialogCompments/Edu/Processing.vue";
+import Assemble from "./dialogCompments/Edu/Assemble.vue";
+import Detection from "./dialogCompments/Edu/Detection.vue";
+import WareHousing from "./dialogCompments/Edu/WareHousing.vue";
+
+//Mec组件
+import AssignEmployees from "./dialogCompments/Mec/AssignEmployees.vue";
+import Notes from "./dialogCompments/Mec/Notes.vue";
+import Print from "./dialogCompments/Mec/Print.vue";
+import NodeShow from "./dialogCompments/Mec/NodeShow.vue";
+import RecordQuality from "./dialogCompments/Mec/RecordQuality.vue";
+import ProductionProcesses from "./dialogCompments/Mec/ProductionProcesses.vue";
+import PersonalDistribution from "./dialogCompments/Mec/PersonalDistribution.vue";
+import RecordSplitData from "./dialogCompments/Mec/RecordSplitData.vue";
+import EditFinishTime from "./dialogCompments/Mec/EditFinishTime.vue";
+import EditQualityCard from "./dialogCompments/Mec/EditQualityCard.vue";
+import FinishTask from "./dialogCompments/Mec/FinishTask.vue";
+import QualityControlCardSubCardProcessing from "./dialogCompments/Mec/QualityControlCardSubCardProcessing.vue";
+import ScrapDisposition from "./dialogCompments/Mec/ScrapDisposition.vue";
+
+import QRCode from "./dialogCompments/Mec/QRCode.vue";
+import Inspect from "./dialogCompments/GongYi/Inspect.vue";
+
+// 物理指标
+import PhysicalInspection from "./dialogCompments/GongYi/PhysicalInspection.vue";
+// 外观指标
+import AppearanceInspection from "./dialogCompments/GongYi/AppearanceInspection.vue";
+//
+import Sorting from "./dialogCompments/GongYi/Sorting.vue";
+import UpSilk from "./dialogCompments/GongYi/UpSilk.vue";
+export default {
+  name: "processMange",
+  props: [],
+  components: {
+    GY01,
+    DialogTemplate,
+    CG1,
+    CG02,
+    KC01,
+    GY06,
+    GY03,
+    KC02,
+    GY02,
+    KB01,
+    SC01,
+    ZL01,
+    NodeShow,
+    AssignEmployees,
+    Notes,
+    Print,
+    RecordQuality,
+    ProductionProcesses,
+    PersonalDistribution,
+    RecordSplitData,
+    EditFinishTime,
+    EditQualityCard,
+    FinishTask,
+    QualityControlCardSubCardProcessing,
+    ScrapDisposition,
+    QRCode,
+    Inspect,
+    Loading,
+    Processing,
+    Assemble,
+    Detection,
+    WareHousing,
+    PhysicalInspection,
+    AppearanceInspection,
+    Sorting, //分拣
+    UpSilk, //上丝
+  },
+  dicts: ["bpm_type", "task_process_state"],
+  data() {
+    return {
+      productLine: "", //产线
+      productLineList: [], //产线数据
+      doneNum: 0, //已完成数
+      doingNum: 0, //进行中数
+      row: {}, //当前操作行数据
+      myForm: "", //自定义表单组件名
+      // 节点弹窗title
+      nodeTitle: "节点弹窗",
+      open: false,
+      // 节点弹窗对应的formData
+      commonData: {},
+      taskType: 1,
+      queryString: "",
+      taskStatus: "",
+      tableData: [], //表格数据
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        taskProcessState: "0",
+        taskProcessType: 0,
+      },
+      total: 0,
+      columns: [
+        {
+          prop: "bepTaskKey",
+          label: "任务编号",
+        },
+        {
+          prop: "bepTaskName",
+          label: "任务名称",
+        },
+        // {
+        //   prop: "bepTaskProcessType",
+        //   label: "任务流程类型",
+        // },
+        {
+          prop: "bepTaskProcessState",
+          label: "任务流程状态",
+        },
+        {
+          prop: "productionLineName",
+          label: "产线",
+        },
+        {
+          prop: "benTaskNodeName",
+          label: "节点名称",
+        },
+        {
+          prop: "benTaskNodeType",
+          label: "节点类型",
+        },
+        {
+          prop: "benTaskNodeState",
+          label: "节点状态",
+        },
+        {
+          prop: "benCreateBy",
+          label: "创建人",
+        },
+        {
+          prop: "benCreateTime",
+          label: "创建时间",
+        },
+      ],
+      formType: "", //表单类型 dragForm:拖拽表单 composeForm:工艺组合表单   designForm:定制表单
+      // k-form-build 数据
+      dynamicData: {},
+      tableName: "",
+      defaultValue: {},
+      jsonData: {},
+      // 拖拽数据
+      taskInfo: {},
+      groupKey: "",
+      subCount: {},
+      tableCount: {},
+      subTableName: "",
+
+      // 弹窗表单渲染数据
+      formData: {},
+      backExceptionTaskList: ["GY06"], //特殊回退表单组件列表
+      loading: true,
+    };
+  },
+  computed: {
+    newColumn() {
+      if (this.queryParams.taskProcessState == "3") {
+        return [
+          {
+            prop: "bepTaskKey",
+            label: "任务编号",
+          },
+          {
+            prop: "bepTaskName",
+            label: "任务名称",
+          },
+          // {
+          //   prop: "bepTaskProcessType",
+          //   label: "任务流程类型",
+          // },
+          {
+            prop: "productionLineName",
+            label: "产线",
+          },
+          {
+            prop: "bepTaskProcessState",
+            label: "任务流程状态",
+          },
+          {
+            prop: "benCreateBy",
+            label: "创建人",
+          },
+          {
+            prop: "benCreateTime",
+            label: "创建时间",
+          },
+        ];
+      } else {
+        return this.columns;
+      }
+    },
+  },
+  mounted() {
+    this.getOptionData(); //获取下拉框数据
+    this.getList();
+    this.getDoneNumber();
+    this.getDoingNumber();
+  },
+  methods: {
+    // 获取下拉框数据
+    async getOptionData() {
+      let payLoad = [
+        {
+          basicMap: {
+            tableName: "production_line",
+          },
+        },
+      ];
+      let res = await queryDropDownBoxData(payLoad);
+      if (res.code == 200) {
+        this.productLineList = res.data.resultMap.production_line;
+      } else {
+        this.$message.error("网络异常,请稍后再试");
+      }
+    },
+    // 获取列表数据
+    getList() {
+      this.loading = true;
+      chemicalFibreList({
+        ...this.queryParams,
+        taskName: this.queryString,
+        taskProductionLineNo: this.productLine,
+      }).then((res) => {
+        if (res.code == 200) {
+          this.tableData = res.rows.map((item) => item.resultMap);
+          this.tableData.forEach((item) => {
+            item.productionLineName = this.productLineList.find(
+              (i) => i.productLineNo == item.productLineNo
+            ).productionLineName;
+          });
+          this.total = res.total;
+        } else {
+          this.$message.error("网络异常,请稍后再试");
+        }
+        this.loading = false;
+      });
+    },
+    getDoneNumber() {
+      let params = {
+        pageNum: 1,
+        pageSize: 10,
+        taskProcessState: "3",
+        taskProcessType: 0,
+        taskProductionLineNo: this.productLine,
+      };
+      chemicalFibreList(params).then((res) => {
+        if (res.code == 200) {
+          this.doneNum = res.total;
+        } else {
+          this.$message.error("网络异常,请稍后再试");
+        }
+      });
+    },
+    getDoingNumber() {
+      let params = {
+        pageNum: 1,
+        pageSize: 10,
+        taskProcessState: "0",
+        taskProcessType: 0,
+        taskProductionLineNo: this.productLine,
+      };
+      chemicalFibreList(params).then((res) => {
+        if (res.code == 200) {
+          this.doingNum = res.total;
+        } else {
+          this.$message.error("网络异常,请稍后再试");
+        }
+      });
+    },
+    // 获取表单数据
+    async getFormData() {
+      let formData = {};
+      // switch (this.formType) {
+      //   case "dragForm":
+      //     try {
+      //       formData = await this.$refs.addFromRef.getData();
+      //     } catch (error) {
+      //       console.log(error);
+      //       this.$message.error("表单校验异常,请稍后重试");
+      //       return {};
+      //     }
+      //     break;
+      //   case "designForm":
+      //     let temp = await this.$refs.myFormRef.getFormData();
+      //     if (!temp.flag) {
+      //       this.$message.error(temp.msg);
+      //       return {};
+      //     } else {
+      //       formData = temp.data;
+      //     }
+      //     break;
+      //   default:
+      //     break;
+      // }
+      let temp = await this.$refs.myFormRef?.getFormData();
+      console.log("temp", temp);
+      if (!temp?.flag) {
+        if (!temp) {
+          //没有表单
+          // formData.flag = true;
+        } else {
+          //表单数据不合法
+          this.$message.error(temp.msg);
+          return false;
+        }
+      } else {
+        formData = temp.data;
+      }
+      return formData;
+    },
+    // 重置弹窗数据
+    resetDialogForm() {
+      this.formType = ""; //表单类型 dragForm:拖拽表单 composeForm:工艺组合表单   designForm:定制表单
+      // k-form-build 数据
+      this.dynamicData = {};
+      this.defaultValue = {};
+      this.jsonData = {};
+    },
+    // 打开运行节点弹窗
+    async opneExecuteNode(row) {
+      this.resetDialogForm();
+      console.log(row);
+      this.nodeTitle = row.benTaskNodeName;
+      // let preFix = row.benTaskNodeName.split("-")[0];
+      let preFix = row.benTaskNodeFormKey;
+      let {
+        benTaskNodeFormKey,
+        benTaskNodeFormType,
+        bepTaskPlanKey,
+        bepTaskKey,
+        bepTaskNodeKey,
+        benTaskProcessKey,
+        benmTaskAutomaticScriptTriggerType,
+        bepTaskNodeNextKey,
+      } = row;
+      // 新的运行逻辑
+      let payLoad = {
+        taskNodeKey: bepTaskNodeNextKey,
+        taskProcessKey: benTaskProcessKey,
+        taskAutomaticScriptTriggerType: benmTaskAutomaticScriptTriggerType,
+        taskPlanKey: bepTaskPlanKey,
+      };
+
+      // let formData = await getProcessNodeFormTemplate(payLoad);
+      // console.log(formData);
+      // if (benTaskNodeFormKey) {
+      //   if (benTaskNodeFormType == "dragForm") {
+      //     let templateInfo = formData.data[0]?.template;
+      //     //拖拽表单
+      //     this.formType = "dragForm";
+      //     this.jsonData = JSON.parse(templateInfo.dfVueTemplate);
+      //     this.tableName = templateInfo.dfTableName;
+      //     if (Object.keys(JSON.parse(templateInfo.dfFormSql)).length) {
+      //       this.dynamicData = JSON.parse(templateInfo.dfFormSql);
+      //     }
+      //     // await this.getDragFormInfo(benTaskNodeFormKey);
+      //   } else if (benTaskNodeFormType == "composeForm") {
+      //     //工艺组合表单
+      //     this.formType = "composeForm";
+      //     this.groupKey = benTaskNodeFormKey;
+      //     let queryPayload = {
+      //       row,
+      //       groupKey: benTaskNodeFormKey,
+      //     };
+      //     this.$nextTick(() => {
+      //       this.$refs.dialogRef.getLists(queryPayload);
+      //     });
+      //   }
+      // } else if (preFix) {
+      //   //定制表单
+      //   this.formType = "designForm";
+      //   this.myForm = preFix;
+      // }
+      //定制表单
+      this.formType = "designForm";
+      this.myForm = preFix;
+      let res = await getProcessNodeFormInfoData(payLoad);
+      if (res.code == 200) {
+        this.formData = res.data;
+      } else {
+        this.$message.error("网络异常,请稍后再试");
+      }
+
+      this.row = row; //记录当前行数据
+      // if (!this.formType) return; //没有表单,直接掉运行逻辑
+      this.open = true; // 打开弹窗
+      this.$nextTick(() => {
+        // this.$refs.myFormRef?.resetForm();
+      });
+      // 根据当前节点绑定的表单信息查询对应的表单进行展示
+    },
+    // 运行节点按钮 确认运行回调
+    async executeNode() {
+      let { benTaskNodeKey, bepTaskProcessXmlContent, implementationName } =
+        this.row;
+      let { nodeId, nextNodeId } = this.getNextNodeKey(
+        benTaskNodeKey,
+        bepTaskProcessXmlContent
+      );
+      // 只有完成状态的可以运行
+      if (this.formType == "composeForm") {
+        let res = this.$refs.dialogRef.getComposeFormData();
+        if (!res.isSuccess) {
+          this.$message.warning("非完成状态节点不能运行!");
+          return;
+        }
+      }
+      // return;
+      let formData = await this.getFormData();
+      if (!formData) return;
+      formData.taskPlanKey = this.row.bepTaskPlanKey;
+      let payLoad = {
+        taskProcessKey: this.row.bepTaskKey, //当前任务流程编码
+        taskNodeKey: nodeId, //当前执行节点唯一编码
+        nextNodeKey: nextNodeId, //下一节点编码
+        implementationName: this.row.benmTaskAutomaticScriptTriggerType, //当前节点绑定的脚本名
+        // taskProcessXmlContent: this.row.bepTaskProcessXmlContent, //当前流程xml
+        tableName: this.tableName,
+        formDataMapString: JSON.stringify(formData), //自定义表单组件收集的表单数据
+        taskNodeType: this.backExceptionTaskList.includes(
+          this.row.benTaskNodeFormKey
+        )
+          ? "backExceptionTask"
+          : this.row.benTaskNodeType,
+      };
+      let fileXML = new File(
+        [this.row.bepTaskProcessXmlContent],
+        this.row.bepTaskKey + ".bpmn",
+        {
+          type: "text/bpmn",
+        }
+      );
+      const subformData = new FormData();
+      subformData.append("fileXML", fileXML);
+      for (let key in payLoad) {
+        subformData.append(key, payLoad[key] == null ? "" : payLoad[key]);
+      }
+      runProcessNodeExecution(subformData).then((res) => {
+        if (res.code == 200) {
+          this.$message.success("运行成功!");
+          this.getList();
+          this.getDoneNumber();
+          this.getDoingNumber();
+          this.open = false;
+        }
+      });
+    },
+    // 获取拖拽表单数据
+    async getDragFormInfo(fid) {
+      try {
+        let res = await getForm(fid);
+        console.log(res);
+        if (res.code == 200) {
+          this.jsonData = JSON.parse(res.data.dfVueTemplate);
+          this.tableName = res.data.dfTableName;
+          if (res.data.dfFormSql) {
+            this.dynamicData = JSON.parse(res.data.dfFormSql);
+            console.log(this.dynamicData);
+          }
+        } else {
+          console.log(res);
+          throw new Error(res);
+        }
+      } catch (error) {
+        console.log(error);
+        this.$message.error("网络异常,请稍后再试");
+      }
+    },
+    // 关闭运行节点弹窗
+    closeExecuteNode(row) {
+      this.open = false;
+    },
+    // 获取下一个节点的nodekey
+    getNextNodeKey(nodeKey, xmlStr) {
+      let xmlObj = this.xmlStr2XmlObj(xmlStr);
+      let nodeSequence = getNodeSequence(xmlObj);
+      return nodeSequence.find((item) => item.nodeId == nodeKey) || {};
+    },
+    // xml字符串转xml对象
+    xmlStr2XmlObj(xmlStr) {
+      var xmlObj = {};
+      if (document.all) {
+        var xmlDom = new ActiveXObject("Microsoft.XMLDOM");
+        xmlDom.loadXML(xmlStr);
+        xmlObj = xmlDom;
+      } else {
+        xmlObj = new DOMParser().parseFromString(xmlStr, "text/xml");
+      }
+      return xmlObj;
+    },
+    // 触发异常回调
+    exceptionTrigger(row, scriptData) {
+      // console.log(taskNodeType);
+      let _this = this;
+      this.$modal
+        .confirm("是否确认触发<" + scriptData.scriptName + ">异常?")
+        .then(function (val) {
+          console.log(val);
+          // 发送触发异常节点的请求
+          let payLoad = {
+            taskProcessKey: row.bepTaskKey,
+            taskNodeKey: row.benTaskNodeKey,
+            sysBpmNodeScriptVO: scriptData,
+            taskNodeType: row.benTaskNodeType,
+          };
+          // 异常节点抛异常  需要下一个节点key
+          if (row.benTaskNodeType == "exceptionTask") {
+            let { nodeId, nextNodeId } = _this.getNextNodeKey(
+              row.benTaskNodeKey,
+              row.bepTaskProcessXmlContent
+            );
+
+            payLoad.taskNextNodeKey = nextNodeId;
+          }
+          triggerExceptionNode(payLoad).then((res) => {
+            console.log(res);
+            if (res.code == 200) {
+              _this.$message.success("触发成功");
+              _this.open = false;
+              _this.getList();
+            } else {
+              _this.$message.error("触发失败请稍后再试");
+            }
+          });
+        })
+        .catch((err) => {
+          console.log(err);
+          _this.open = false;
+          _this.$message.info("取消成功");
+        });
+    },
+    // 获取字典对应label
+    getDictLabel(value, dictLsit = []) {
+      return dictLsit.find((item) => {
+        return item.value == value;
+      })?.label;
+    },
+  },
+};
+</script>
+
+<style scoped lang="scss">
+.process-mange-wrap {
+  background-color: #f2f3f8;
+  padding: 20px;
+
+  .col {
+    background-color: #fff;
+    border-right: 1px solid #ebedf2;
+    /* margin-right: 3px; */
+    .statistic-wrap {
+      /* // height: 70px; */
+      box-sizing: border-box;
+      display: flex;
+      align-items: center;
+      padding: 10px 17px;
+      justify-content: space-between;
+
+      .discription {
+        display: flex;
+        flex-direction: column;
+
+        .title {
+          line-height: 20px;
+          font-size: 18px;
+          font-weight: 700;
+          margin-bottom: 5px;
+        }
+
+        .sub-title {
+          font-size: 14px;
+        }
+      }
+
+      .data {
+        font-size: 20px;
+        font-weight: 700;
+      }
+    }
+  }
+
+  .main-area {
+    margin-top: 30px;
+    box-shadow: 0 1px 15px 1px rgb(69 65 78 / 8%);
+    background-color: #fff;
+
+    .show-header {
+      border-bottom: 1px solid #ebedf2;
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+      padding: 0px 20px 0px 20px;
+      height: 70px;
+
+      /* .header {
+      } */
+
+      .search-list {
+        display: flex;
+        .select {
+          .label {
+            margin-right: 10px;
+          }
+        }
+        .search-tab {
+          margin-right: 20px;
+
+          .btn-list-two {
+            margin-left: 10px;
+          }
+        }
+      }
+    }
+
+    .show-body {
+      padding: 25px;
+    }
+  }
+}
+</style>

+ 21 - 247
zkqy-ui/src/views/index.vue

@@ -49,56 +49,14 @@
       </el-col>
     </el-row> -->
     <div class="info-content">
-      <!-- <div class="header" @click="toPersonalCenter"> -->
-      <!-- <img :src="avatar" class="user-avatar" /> -->
-      <!-- </div> -->
-      <!-- <div class="name">{{ nickName }}</div> -->
-      <!-- <div class="tenant-name">{{ tenantName }}</div> -->
-      <!-- <div class="date">{{ date }}</div> -->
-      <!-- <div class="title">欢迎登录Mec OS 工业应用操作系统</div> -->
-      <!-- <div class="title">欢迎登录Mec OS 化纤行业生产管理系统</div> -->
-      <div class="echarts1">
-        <div class="pieChart" ref="pieChart"></div>
-        <div
-          :class="'describe' + (parseInt(index) + 1)"
-          v-for="(item, index) in processList"
-          :key="index"
-        >
-          <P class="text">{{ item.name }}</P>
-          <P class="num">{{ item.value }}</P>
-        </div>
-      </div>
-      <div class="echarts2">
-        <div class="lineChart" ref="lineChart"></div>
-      </div>
-      <div class="echarts3">
-        <p class="title">操作日志</p>
-        <div class="text">
-          <span class="peo">操作人</span>
-          <span class="add">ip</span>
-        </div>
-        <div class="swiper-container">
-          <div class="swiper-scrollbar"></div>
-          <div class="swiper-wrapper">
-            <div
-              class="swiper-slide"
-              v-for="(item, index) in swiperList"
-              :key="index"
-            >
-              <div>
-                <span class="name">{{ item.operName }}</span>
-                <span class="ip">{{ item.operIp }}</span>
-              </div>
-            </div>
-          </div>
-        </div>
-      </div>
-      <div class="echarts4">
-        <div class="gaugeChart" ref="gaugeChart"></div>
-      </div>
-      <div class="echarts5">
-        <div class="barChart" ref="barChart"></div>
+      <div class="header" @click="toPersonalCenter">
+        <img :src="avatar" class="user-avatar" />
       </div>
+      <div class="name">{{ nickName }}</div>
+      <div class="tenant-name">{{ tenantName }}</div>
+      <div class="date">{{ date }}</div>
+      <!-- <div class="title">欢迎登录Mec OS 工业应用操作系统</div> -->
+      <div class="title mt20">欢迎登录{{ title }}</div>
     </div>
   </div>
 </template>
@@ -107,53 +65,11 @@
 import { formatDate } from "@/utils";
 import { getToken } from "@/utils/auth";
 import { mapGetters, mapState } from "vuex";
-import "swiper/css/swiper.css";
-import Swiper from "swiper";
-import {
-  getTask,
-  getPipeline,
-  getOperation,
-  getMaterial,
-  getLogin,
-} from "@/api/homePage/index";
 
 export default {
   name: "Index",
   data() {
     return {
-      chartObj: {
-        myChart1: null,
-        myChart2: null,
-        myChart3: null,
-        myChart4: null,
-      },
-      processList: [],
-      swiperList: [
-        /* {
-          name: "111",
-          ip: "192.168.1.1"
-        },
-        {
-          name: "222",
-          ip: "192.168.1.2"
-        },
-        {
-          name: "333",
-          ip: "192.168.1.3"
-        },
-        {
-          name: "444",
-          ip: "192.168.1.4"
-        },
-        {
-          name: "555",
-          ip: "192.168.1.5"
-        },
-        {
-          name: "666",
-          ip: "192.168.1.6"
-        }, */
-      ],
       // 用户导入参数
       upload: {
         // 是否显示弹出层(用户导入)
@@ -173,15 +89,6 @@ export default {
       version: "3.8.5",
     };
   },
-  mounted() {
-    // 初始化 echarts
-    this.initChart1();
-    this.initChart2();
-    this.initChart3();
-    this.initChart4();
-
-    this.initData();
-  },
   methods: {
     initData() {
       //任务统计
@@ -631,6 +538,9 @@ export default {
       return formatDate(new Date());
     },
   },
+  created() {
+    this.title = window.sessionStorage.getItem("title") || "生产协同管理系统";
+  },
 };
 </script>
 
@@ -638,153 +548,16 @@ export default {
 .home {
   position: relative;
   width: 100%;
-  /* height: 500px; */
-  background-color: #eff2f7;
+  height: 500px;
   .info-content {
-    width: 100%;
-    height: 100%;
+    position: absolute;
+    left: 50%;
+    top: 30%;
+    transform: translateX(-50%);
     display: flex;
-    flex-direction: row;
-    flex-wrap: wrap;
-    .echarts1 {
-      position: relative;
-      width: 20%;
-      height: 280px;
-      margin: auto;
-      padding: 20px 15px;
-      box-shadow: 10px 10px 5px #e0e0e0;
-      background-color: #fff;
-      border-radius: 10px;
-      .pieChart {
-        width: 100%;
-        height: 100%;
-      }
-      .describe1 {
-        .text {
-          position: absolute;
-          left: 50px;
-          top: 90px;
-        }
-        .num {
-          position: absolute;
-          font-size: 20px;
-          color: black;
-          left: 63px;
-          top: 55px;
-        }
-      }
-      .describe2 {
-        .text {
-          position: absolute;
-          left: 157px;
-          top: 90px;
-        }
-        .num {
-          position: absolute;
-          font-size: 20px;
-          color: black;
-          left: 170px;
-          top: 55px;
-        }
-      }
-    }
-    .echarts2 {
-      width: 76%;
-      height: 280px;
-      margin: auto;
-      padding: 20px 15px;
-      box-shadow: 10px 10px 5px #e0e0e0;
-      background-color: #fff;
-      border-radius: 10px;
-      margin-right: 30px;
-      .lineChart {
-        width: 100%;
-        height: 100%;
-      }
-    }
-    .echarts3 {
-      width: 23%;
-      height: 200px;
-      margin: auto;
-      padding: 20px 15px;
-      box-shadow: 10px 10px 5px #e0e0e0;
-      background-color: #fff;
-      border-radius: 10px;
-      margin-top: 20px;
-      p {
-        margin: 0;
-      }
-      .title {
-        font-size: 16px;
-        color: "#696969";
-      }
-      .text {
-        display: flex;
-        flex-direction: row;
-        margin-top: 10px;
-        .peo {
-          font-size: 14px;
-          color: black;
-          font-weight: bold;
-          margin-left: 20px;
-          margin-right: 120px;
-        }
-        .add {
-          font-size: 14px;
-          color: black;
-          font-weight: bold;
-        }
-      }
-      .swiper-container {
-        display: flex;
-        flex-direction: row;
-        flex-wrap: wrap;
-        width: 90%;
-        height: 80px;
-        /* overflow: auto; */
-        margin-top: 10px;
-        .name {
-          text-align: center;
-          font-size: 16px;
-          margin-left: 2px;
-          margin-right: 59px;
-        }
-        .ip {
-          text-align: center;
-          font-size: 16px;
-        }
-      }
-    }
-    .echarts4 {
-      width: 20%;
-      height: 200px;
-      margin: auto;
-      padding: 20px 15px;
-      box-shadow: 10px 10px 5px #e0e0e0;
-      background-color: #fff;
-      border-radius: 10px;
-      margin-top: 20px;
-      .gaugeChart {
-        width: 100%;
-        height: 100%;
-      }
-    }
-    .echarts5 {
-      width: 53%;
-      height: 200px;
-      margin: auto;
-      padding: 20px 15px;
-      box-shadow: 10px 10px 5px #e0e0e0;
-      background-color: #fff;
-      border-radius: 10px;
-      margin-top: 20px;
-      margin-right: 30px;
-      .barChart {
-        width: 100%;
-        height: 100%;
-      }
-    }
-    /* .header {
+    flex-direction: column;
+    align-items: center;
+    .header {
       white-space: nowrap;
       margin-bottom: 5px;
       cursor: pointer;
@@ -792,7 +565,7 @@ export default {
         width: 160px;
         border-radius: 50%;
       }
-    } */
+    }
     .name {
       font-size: 30px;
       margin-bottom: 5px;
@@ -804,7 +577,8 @@ export default {
       margin-bottom: 10px;
     }
     .title {
-      font-size: 16px;
+      // font-size: 16px;
+      font-size: 20px;
     }
   }
 }

+ 869 - 0
zkqy-ui/src/views/index_chart.vue

@@ -0,0 +1,869 @@
+<template>
+  <div class="app-container home">
+    <!-- <el-row :gutter="20"></el-row>
+    <el-row :gutter="20"></el-row>
+    <el-divider/>
+
+    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+      <el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers"
+                 :action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading"
+                 :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
+        <div class="el-upload__tip text-center" slot="tip">
+          <div class="el-upload__tip" slot="tip">
+            <el-checkbox v-model="upload.updateSupport"/>
+            是否更新已经存在的用户数据
+          </div>
+          <span>仅允许导入xls、xlsx格式文件。</span>
+          <el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline"
+                   @click="importTemplate">下载模板
+          </el-link>
+        </div>
+      </el-upload>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitFileForm">确 定</el-button>
+        <el-button @click="upload.open = false">取 消</el-button>
+      </div>
+    </el-dialog>
+
+    <button @click="upload.open = true">上传文件</button>
+    <el-row :gutter="20">
+      <el-col :xs="24" :sm="24" :md="12" :lg="8"></el-col>
+      <el-col :xs="24" :sm="24" :md="12" :lg="8">
+        <el-card class="update-log">
+          <div slot="header" class="clearfix">
+            <span>更新日志</span>
+          </div>
+          <el-collapse accordion> 123123</el-collapse>
+        </el-card>
+      </el-col>
+
+      <el-col :xs="24" :sm="24" :md="12" :lg="8">
+        <el-card class="update-log">
+          <div slot="header" class="clearfix">
+            <span>捐赠支持</span>
+          </div>
+          <div class="body"></div>
+        </el-card>
+      </el-col>
+    </el-row> -->
+    <div class="info-content">
+      <!-- <div class="header" @click="toPersonalCenter"> -->
+      <!-- <img :src="avatar" class="user-avatar" /> -->
+      <!-- </div> -->
+      <!-- <div class="name">{{ nickName }}</div> -->
+      <!-- <div class="tenant-name">{{ tenantName }}</div> -->
+      <!-- <div class="date">{{ date }}</div> -->
+      <!-- <div class="title">欢迎登录Mec OS 工业应用操作系统</div> -->
+      <!-- <div class="title">欢迎登录Mec OS 化纤行业生产管理系统</div> -->
+      <div class="echarts1">
+        <div class="pieChart" ref="pieChart"></div>
+        <div
+          :class="'describe' + (parseInt(index) + 1)"
+          v-for="(item, index) in processList"
+          :key="index"
+        >
+          <P class="text">{{ item.name }}</P>
+          <P class="num">{{ item.value }}</P>
+        </div>
+      </div>
+      <div class="echarts2">
+        <div class="lineChart" ref="lineChart"></div>
+      </div>
+      <div class="echarts3">
+        <p class="title">操作日志</p>
+        <div class="text">
+          <span class="peo">操作人</span>
+          <span class="add">ip</span>
+        </div>
+        <div class="swiper-container">
+          <div class="swiper-scrollbar"></div>
+          <div class="swiper-wrapper">
+            <div
+              class="swiper-slide"
+              v-for="(item, index) in swiperList"
+              :key="index"
+            >
+              <div>
+                <span class="name">{{ item.operName }}</span>
+                <span class="ip">{{ item.operIp }}</span>
+              </div>
+            </div>
+          </div>
+        </div>
+      </div>
+      <div class="echarts4">
+        <div class="gaugeChart" ref="gaugeChart"></div>
+      </div>
+      <div class="echarts5">
+        <div class="barChart" ref="barChart"></div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import { formatDate } from "@/utils";
+import { getToken } from "@/utils/auth";
+import { mapGetters, mapState } from "vuex";
+import "swiper/css/swiper.css";
+import Swiper from "swiper";
+import {
+  getTask,
+  getPipeline,
+  getOperation,
+  getMaterial,
+  getLogin,
+} from "@/api/homePage/index";
+
+export default {
+  name: "Index",
+  data() {
+    return {
+      chartObj: {
+        myChart1: null,
+        myChart2: null,
+        myChart3: null,
+        myChart4: null,
+      },
+      processList: [],
+      swiperList: [
+        /* {
+          name: "111",
+          ip: "192.168.1.1"
+        },
+        {
+          name: "222",
+          ip: "192.168.1.2"
+        },
+        {
+          name: "333",
+          ip: "192.168.1.3"
+        },
+        {
+          name: "444",
+          ip: "192.168.1.4"
+        },
+        {
+          name: "555",
+          ip: "192.168.1.5"
+        },
+        {
+          name: "666",
+          ip: "192.168.1.6"
+        }, */
+      ],
+      // 用户导入参数
+      upload: {
+        // 是否显示弹出层(用户导入)
+        open: false,
+        // 弹出层标题(用户导入)
+        title: "",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 设置上传的请求头部
+        headers: { Authorization: "Bearer " + getToken() },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API3 + "common/importDataInfo",
+      },
+      // 版本号
+      version: "3.8.5",
+    };
+  },
+  mounted() {
+    // 初始化 echarts
+    this.initChart1();
+    this.initChart2();
+    this.initChart3();
+    this.initChart4();
+
+    this.initData();
+  },
+  methods: {
+    initData() {
+      //任务统计
+      getTask().then((response) => {
+        if (response.code == 200) {
+          this.processList = response.data;
+          //   console.log(this.processList);
+          this.chartObj.myChart1.setOption({
+            series: [
+              {
+                data: response.data,
+              },
+            ],
+          });
+        } else {
+          console.log(response);
+          this.$message.error("获取数据失败");
+        }
+      });
+
+      //管道统计
+      getPipeline().then((response) => {
+        if (response.code == 200) {
+          //  console.log(response.data);
+          //  console.log(response.data[0].date);
+          let xAxisData = response.data[0].date;
+          xAxisData = xAxisData.map(function (dateStr) {
+            var date = new Date(dateStr);
+            return date.getMonth() + 1 + "月" + date.getDate() + "日";
+          });
+          let loginList = response.data.map((item) => item.name);
+          this.chartObj.myChart2.setOption({
+            legend: {
+              data: loginList,
+            },
+            xAxis: {
+              data: xAxisData,
+            },
+            series: response.data,
+          });
+        } else {
+          console.log(response);
+          this.$message.error("获取数据失败");
+        }
+      });
+
+      //操作日志
+      getOperation().then((response) => {
+        if (response.code == 200) {
+          this.swiperList = response.data;
+          this.$nextTick(() => {
+            var swiper = new Swiper(".swiper-container", {
+              direction: "vertical",
+              loop: true,
+              autoplay: {
+                delay: 1000,
+                disableOnInteraction: false,
+              },
+              scrollbar: {
+                el: ".swiper-scrollbar",
+              },
+              slidesPerView: 3,
+              freeMode: true,
+              // spaceBetween: 1,
+            });
+          });
+        } else {
+          console.log(response);
+          this.$message.error("获取数据失败");
+        }
+      });
+
+      //原材料统计
+      getMaterial().then((response) => {
+        if (response.code == 200) {
+          //  console.log(response.data);
+          let tabularList = response.data;
+          //  tabularList.push({ name: "多表数量", value: 30 });
+          let labelList = response.data.map((item) => item.name);
+          this.chartObj.myChart3.setOption({
+            yAxis: {
+              data: labelList,
+            },
+            series: [
+              {
+                data: response.data,
+              },
+            ],
+          });
+        } else {
+          console.log(response);
+          this.$message.error("获取数据失败");
+        }
+      });
+
+      //用户登录统计
+      getLogin().then((response) => {
+        if (response.code == 200) {
+          let modelData = response.data;
+          //  console.log(modelData);
+          this.chartObj.myChart4?.setOption({
+            series: [
+              {
+                data: [modelData],
+              },
+            ],
+          });
+        } else {
+          console.log(response);
+          this.$message.error("获取数据失败");
+        }
+      });
+    },
+
+    initChart1() {
+      this.chartObj.myChart1 = this.$echarts.init(this.$refs.pieChart);
+      let option = {
+        color: ["#9370db", "#ffd700", "#00ccff", "#ff6600", "#ff9900"],
+        title: {
+          text: "任务统计",
+          left: "left",
+          textStyle: {
+            fontSize: 16,
+            fontWeight: "normal",
+            color: "#696969",
+          },
+        },
+        tooltip: {
+          trigger: "item",
+        },
+        legend: {
+          left: "60%",
+          top: "60%",
+        },
+        series: [
+          {
+            // name: 'Access From',
+            type: "pie",
+            radius: ["40%", "100%"],
+            avoidLabelOverlap: false,
+            itemStyle: {
+              // borderRadius: 10,
+              borderColor: "#fff",
+              borderWidth: 2,
+            },
+            right: "40%",
+            top: "50%",
+            data: [
+              { value: 10, name: "工艺流" },
+              { value: 20, name: "审批流" },
+            ],
+            label: {
+              show: false,
+              position: "center",
+            },
+            labelLine: {
+              show: false,
+            },
+            emphasis: {
+              label: {
+                show: true,
+                fontSize: 20,
+                fontWeight: "bold",
+              },
+            },
+          },
+        ],
+      };
+      this.chartObj.myChart1.setOption(option);
+    },
+
+    initChart2() {
+      this.chartObj.myChart2 = this.$echarts.init(this.$refs.lineChart);
+      let option = {
+        color: ["#FF88E0", "#9FE080"],
+        title: {
+          text: "管道统计",
+          textStyle: {
+            fontSize: 16,
+            fontWeight: "normal",
+            color: "#696969",
+          },
+        },
+        tooltip: {
+          trigger: "axis",
+        },
+        legend: {
+          data: ["在产生产任务", "完成数量"],
+        },
+        grid: {
+          left: "3%",
+          right: "4%",
+          top: "20%",
+          bottom: "0%",
+          containLabel: true,
+        },
+        xAxis: {
+          type: "category",
+          boundaryGap: false,
+          data: [
+            "01\nMon",
+            "02\nTue",
+            "03\nWed",
+            "04\nThu",
+            "05\nFri",
+            "06\nSat",
+            "07\nSun",
+            "08\nMon",
+            "09\nTue",
+            "10\nWed",
+            "11\nThu",
+            "12\nFri",
+            "13\nSat",
+            "14\nSun",
+            "15\nMon",
+            "16\nTue",
+            "17\nWed",
+            "18\nThu",
+            "19\nFri",
+            "20\nSat",
+            "21\nSun",
+            "22\nMon",
+            "23\nTue",
+            "24\nWed",
+            "25\nThu",
+            "26\nFri",
+            "27\nSat",
+            "28\nSun",
+            "29\nMon",
+            "30\nTue",
+          ],
+        },
+        yAxis: {
+          type: "value",
+        },
+        series: [
+          {
+            name: "客户端",
+            type: "line",
+            smooth: true,
+            data: [
+              10, 23, 42, 13, 30, 25, 40, 30, 42, 55, 40, 28, 20, 30, 45, 25,
+              20, 30, 40, 33, 35, 40, 46, 31, 13, 34, 20, 10, 36, 43,
+            ],
+          },
+          {
+            name: "工具端",
+            type: "line",
+            smooth: true,
+            data: [
+              20, 30, 29, 40, 55, 33, 30, 26, 36, 45, 50, 34, 38, 25, 28, 43,
+              16, 30, 45, 52, 40, 46, 33, 57, 50, 33, 40, 59, 56, 56,
+            ],
+          },
+        ],
+      };
+      this.chartObj.myChart2.setOption(option);
+    },
+
+    initChart3() {
+      this.chartObj.myChart3 = this.$echarts.init(this.$refs.gaugeChart);
+      let option = {
+        color: ["#00ccff", "#ff6600", "#ff9900", "#9370db", "#ffd700"],
+        title: {
+          text: "原材料统计",
+          left: "left",
+          textStyle: {
+            fontSize: 16,
+            fontWeight: "normal",
+            color: "#696969",
+          },
+        },
+        tooltip: {
+          trigger: "axis",
+          axisPointer: {
+            type: "shadow",
+          },
+        },
+        grid: {
+          left: "0%",
+          right: "3%",
+          top: "20%",
+          bottom: "0%",
+          containLabel: true,
+        },
+        xAxis: {
+          type: "value",
+          nameLocation: "middle",
+          nameTextStyle: {
+            align: "center",
+          },
+          splitLine: {
+            show: false,
+          },
+        },
+
+        yAxis: {
+          type: "category",
+          data: ["总数", "入库数量", "出库数量"],
+          inverse: true, // 使类目从右向左排列
+        },
+
+        series: [
+          {
+            type: "bar",
+            barWidth: "18",
+            orientation: "horizontal",
+            data: [
+              { value: 88, name: "表单" },
+              { value: 66, name: "表格" },
+              { value: 33, name: "三级联动" },
+            ],
+            showBackground: true,
+            backgroundStyle: {
+              color: "#F0F8FF",
+            },
+          },
+        ],
+      };
+      this.chartObj.myChart3.setOption(option);
+    },
+
+    initChart4() {
+      this.chartObj.myChart4 = this.$echarts.init(this.$refs.barChart);
+      let option = {
+        color: ["#5D84FE"],
+        title: {
+          text: "用户登录统计",
+          textStyle: {
+            fontSize: 16,
+            fontWeight: "normal",
+            color: "#696969",
+          },
+        },
+        tooltip: {
+          trigger: "axis",
+          axisPointer: {
+            type: "shadow",
+          },
+        },
+        xAxis: {
+          type: "category",
+          data: [
+            "1月",
+            "2月",
+            "3月",
+            "4月",
+            "5月",
+            "6月",
+            "7月",
+            "8月",
+            "9月",
+            "10月",
+            "11月",
+            "12月",
+          ],
+        },
+        yAxis: {
+          type: "value",
+          min: 0,
+          max: 100,
+          interval: 20,
+          splitLine: {
+            show: false, // 关闭y轴的水平分割线
+          },
+        },
+        grid: {
+          left: "5%",
+          right: "5%",
+          top: "30%",
+          bottom: "0%",
+          containLabel: true,
+        },
+        series: [
+          {
+            data: [0],
+            type: "bar",
+            barWidth: "30", // 设置柱体宽度
+            showBackground: true,
+            backgroundStyle: {
+              color: "#E8EFFF",
+            },
+          },
+        ],
+      };
+      this.chartObj.myChart4.setOption(option);
+    },
+
+    /** 导入按钮操作 */
+    handleImport() {
+      this.upload.title = "用户导入";
+      this.upload.open = true;
+    },
+    /** 下载模板操作 */
+    importTemplate() {
+      this.download(
+        "system/user/importTemplate",
+        {},
+        `user_template_${new Date().getTime()}.xlsx`
+      );
+    },
+    // 文件上传中处理
+    handleFileUploadProgress(event, file, fileList) {
+      this.upload.isUploading = true;
+    },
+    // 文件上传成功处理
+    handleFileSuccess(response, file, fileList) {
+      this.upload.open = false;
+      this.upload.isUploading = false;
+      this.$refs.upload.clearFiles();
+      this.$alert(
+        "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
+          response.msg +
+          "</div>",
+        "导入结果",
+        { dangerouslyUseHTMLString: true }
+      );
+      this.getList();
+    },
+    // 提交上传文件
+    submitFileForm() {
+      this.$refs.upload.submit();
+    },
+    goTarget(href) {
+      window.open(href, "_blank");
+    },
+
+    toPersonalCenter() {
+      this.$router.push("/user/profile");
+    },
+  },
+  computed: {
+    ...mapState({
+      username: (state) => state.user.name,
+      owner: (state) => state.user?.tenant.owner,
+      tenantName: (state) => state.user?.tenant.tenantName,
+      nickName: (state) => state.user?.nickName,
+    }),
+
+    ...mapGetters(["avatar"]),
+    date: () => {
+      return formatDate(new Date());
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.home {
+  position: relative;
+  width: 100%;
+  /* height: 500px; */
+  background-color: #eff2f7;
+  .info-content {
+    width: 100%;
+    height: 100%;
+    display: flex;
+    flex-direction: row;
+    flex-wrap: wrap;
+    .echarts1 {
+      position: relative;
+      width: 20%;
+      height: 280px;
+      margin: auto;
+      padding: 20px 15px;
+      box-shadow: 10px 10px 5px #e0e0e0;
+      background-color: #fff;
+      border-radius: 10px;
+      .pieChart {
+        width: 100%;
+        height: 100%;
+      }
+      .describe1 {
+        .text {
+          position: absolute;
+          left: 50px;
+          top: 90px;
+        }
+        .num {
+          position: absolute;
+          font-size: 20px;
+          color: black;
+          left: 63px;
+          top: 55px;
+        }
+      }
+      .describe2 {
+        .text {
+          position: absolute;
+          left: 157px;
+          top: 90px;
+        }
+        .num {
+          position: absolute;
+          font-size: 20px;
+          color: black;
+          left: 170px;
+          top: 55px;
+        }
+      }
+    }
+    .echarts2 {
+      width: 76%;
+      height: 280px;
+      margin: auto;
+      padding: 20px 15px;
+      box-shadow: 10px 10px 5px #e0e0e0;
+      background-color: #fff;
+      border-radius: 10px;
+      margin-right: 30px;
+      .lineChart {
+        width: 100%;
+        height: 100%;
+      }
+    }
+    .echarts3 {
+      width: 23%;
+      height: 200px;
+      margin: auto;
+      padding: 20px 15px;
+      box-shadow: 10px 10px 5px #e0e0e0;
+      background-color: #fff;
+      border-radius: 10px;
+      margin-top: 20px;
+      p {
+        margin: 0;
+      }
+      .title {
+        font-size: 16px;
+        color: "#696969";
+      }
+      .text {
+        display: flex;
+        flex-direction: row;
+        margin-top: 10px;
+        .peo {
+          font-size: 14px;
+          color: black;
+          font-weight: bold;
+          margin-left: 20px;
+          margin-right: 120px;
+        }
+        .add {
+          font-size: 14px;
+          color: black;
+          font-weight: bold;
+        }
+      }
+      .swiper-container {
+        display: flex;
+        flex-direction: row;
+        flex-wrap: wrap;
+        width: 90%;
+        height: 80px;
+        /* overflow: auto; */
+        margin-top: 10px;
+        .name {
+          text-align: center;
+          font-size: 16px;
+          margin-left: 2px;
+          margin-right: 59px;
+        }
+        .ip {
+          text-align: center;
+          font-size: 16px;
+        }
+      }
+    }
+    .echarts4 {
+      width: 20%;
+      height: 200px;
+      margin: auto;
+      padding: 20px 15px;
+      box-shadow: 10px 10px 5px #e0e0e0;
+      background-color: #fff;
+      border-radius: 10px;
+      margin-top: 20px;
+      .gaugeChart {
+        width: 100%;
+        height: 100%;
+      }
+    }
+    .echarts5 {
+      width: 53%;
+      height: 200px;
+      margin: auto;
+      padding: 20px 15px;
+      box-shadow: 10px 10px 5px #e0e0e0;
+      background-color: #fff;
+      border-radius: 10px;
+      margin-top: 20px;
+      margin-right: 30px;
+      .barChart {
+        width: 100%;
+        height: 100%;
+      }
+    }
+    /* .header {
+      white-space: nowrap;
+      margin-bottom: 5px;
+      cursor: pointer;
+      .user-avatar {
+        width: 160px;
+        border-radius: 50%;
+      }
+    } */
+    .name {
+      font-size: 30px;
+      margin-bottom: 5px;
+    }
+    .tenant-name {
+      font-size: 20px;
+    }
+    .date {
+      margin-bottom: 10px;
+    }
+    .title {
+      font-size: 16px;
+    }
+  }
+}
+.home {
+  blockquote {
+    padding: 10px 20px;
+    margin: 0 0 20px;
+    font-size: 17.5px;
+    /* border-left: 5px solid #eee; */
+  }
+
+  hr {
+    margin-top: 20px;
+    margin-bottom: 20px;
+    border: 0;
+    border-top: 1px solid #eee;
+  }
+
+  .col-item {
+    margin-bottom: 20px;
+  }
+
+  ul {
+    padding: 0;
+    margin: 0;
+  }
+
+  font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
+  font-size: 13px;
+  color: #676a6c;
+  overflow-x: hidden;
+
+  ul {
+    list-style-type: none;
+  }
+
+  h4 {
+    margin-top: 0px;
+  }
+
+  h2 {
+    margin-top: 10px;
+    font-size: 26px;
+    font-weight: 100;
+  }
+
+  p {
+    margin-top: 10px;
+
+    b {
+      font-weight: 700;
+    }
+  }
+
+  .update-log {
+    ol {
+      display: block;
+      list-style-type: decimal;
+      margin-block-start: 1em;
+      margin-block-end: 1em;
+      margin-inline-start: 0;
+      margin-inline-end: 0;
+      padding-inline-start: 40px;
+    }
+  }
+}
+</style>

+ 40 - 3
zkqy-ui/src/views/orderMange/index.vue

@@ -415,6 +415,7 @@
                   <el-select
                     v-model="scope.row.productNo"
                     placeholder=""
+                    :filter-method="(val) => mySelectFilter(val, scope.row)"
                     clearable
                     filterable
                     @change="
@@ -438,7 +439,7 @@
                   </el-select>
                 </template>
               </el-table-column>
-              <el-table-column prop="productType" label="规格">
+              <el-table-column prop="productType" label="类型">
               </el-table-column>
               <el-table-column prop="productNumber" label="数量/kg">
                 <template slot-scope="scope">
@@ -846,6 +847,7 @@ export default {
         craftMark: "", //包装/贴唛
         shippingMethod: "", //运输方式
       },
+      allProductionOptions: [], //所有产品选项
       productionOptions: [],
       customerOptions: [],
       productionTableData: [
@@ -1037,6 +1039,37 @@ export default {
     }),
   },
   methods: {
+    // 自定义筛选方法
+    mySelectFilter(value, row) {
+      console.log(value);
+      // row.productNo = value;
+      if (value) {
+        let target = this.productionOptions.find((item) =>
+          item.productName.includes(value)
+        );
+        console.log(target);
+        if (target) {
+          this.productionOptions = [target];
+          //找到
+          return true;
+        } else {
+          //前100个没找到
+          // 在全部列表中查找
+          target = this.allProductionOptions.find((item) =>
+            item.productName.includes(value)
+          );
+          console.log(target);
+          if (target) {
+            this.productionOptions = [target];
+            return true;
+          } else {
+            return false;
+          }
+        }
+      } else {
+        this.productionOptions = this.allProductionOptions.slice(0, 100);
+      }
+    },
     // 出库单回调
     async myPrintOutBoundHandler(row, data) {
       console.log("row", row);
@@ -1059,6 +1092,7 @@ export default {
     // 产品名称改变
     handleProductChange(productNo, row) {
       if (!productNo) {
+        this.productionOptions = this.allProductionOptions.slice(0, 100);
         return;
       }
       row.productName = this.productionOptions.find(
@@ -1067,6 +1101,7 @@ export default {
       row.productType = this.productionOptions.find(
         (item) => item.productNo == productNo
       )?.productType;
+      this.productionOptions = this.allProductionOptions.slice(0, 100);
     },
     // 订单类型改变回调
     orderTypeChange(type) {
@@ -1213,7 +1248,9 @@ export default {
         let res = await queryDropDownBoxData(payLoad);
         if (res.code == 200) {
           let { production, customer } = res.data.resultMap;
-          this.productionOptions = production || [];
+          this.allProductionOptions = production || [];
+          this.productionOptions =
+            this.allProductionOptions.slice(0, 100) || [];
           this.customerOptions = customer || [];
         } else {
           throw Error("获取下拉框数据失败");
@@ -2792,7 +2829,7 @@ export default {
                 </tr>
                 <tr align="center">
                     <td width="150px">品名</td>
-                    <td width="150px">规格</td>
+                    <td width="150px">类型</td>
                     <td width="150px">数量/kg</td>
                     <td width="150px">单价</td>
                     <td width="150px">金额</td>