From 5bdb2202cfeccf25f947689f07c80431000ad615 Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期日, 07 九月 2025 19:04:27 +0800
Subject: [PATCH] 增加新编程序统计;固化程序统计

---
 src/views/statreport/curedprogram.vue      |  226 ++++++++++++++++++++++
 src/api/statreport/curedprogram.js         |   19 +
 src/views/flow/components/TodolistLeft.vue |    8 
 src/views/flow/todolist.vue                |   37 +--
 src/views/statreport/newprogramming.vue    |  240 ++++++++++++++++++++++++
 src/api/statreport/newprogramming.js       |   25 ++
 6 files changed, 528 insertions(+), 27 deletions(-)

diff --git a/src/api/statreport/curedprogram.js b/src/api/statreport/curedprogram.js
new file mode 100644
index 0000000..eff21fe
--- /dev/null
+++ b/src/api/statreport/curedprogram.js
@@ -0,0 +1,19 @@
+/*
+
+ * @Date: 2025-08-24 22:38:05
+ * @LastEditors: yangys
+ * @LastEditTime: 2025-08-24 08:32:12
+ * @FilePath: /mdmweb/src/api/flowmgr/exceptiontask.js
+ */
+import request from '@/axios';
+export const getList = (current, size, params) => {
+  return request({
+    url: '/blade-mdm/statreport/cureprogram/page',
+    method: 'get',
+    params: {
+      ...params,
+      current,
+      size,
+    },
+  })
+};
diff --git a/src/api/statreport/newprogramming.js b/src/api/statreport/newprogramming.js
new file mode 100644
index 0000000..82bb210
--- /dev/null
+++ b/src/api/statreport/newprogramming.js
@@ -0,0 +1,25 @@
+/*
+ * @Date: 2025-08-24 22:38:05
+ * @LastEditors: yangys
+ * @LastEditTime: 2025-08-24 08:32:12
+ * @FilePath: /mdmweb/src/api/flowmgr/exceptiontask.js
+ */
+import request from '@/axios';
+export const getList = (current, size, params) => {
+  return request({
+    url: '/blade-mdm/statreport/newprogramming/page',
+    method: 'get',
+    params: {
+      ...params,
+      current,
+      size,
+    },
+  })
+};
+
+export const getDeptData = () => {
+  return request({
+    url: '/blade-mdm/statreport/newprogramming/deptsData',
+    method: 'get'
+  })
+};
\ No newline at end of file
diff --git a/src/views/flow/components/TodolistLeft.vue b/src/views/flow/components/TodolistLeft.vue
index 76c6764..f8107a5 100644
--- a/src/views/flow/components/TodolistLeft.vue
+++ b/src/views/flow/components/TodolistLeft.vue
@@ -8,7 +8,11 @@
     <basic-container>
         <!--'cureProgramTask', 鍥哄寲缂栧埗涓嶈兘娣诲姞鏂囦欢-->
         <div class="tool" v-show="['programmingTask', 'replaceProgrammingTask','appendProgrammingTask'].includes(row.taskDefinitionKey)">
-            <el-button type="primary" plain @click="addApp">娣诲姞鏂囦欢
+           
+            <!--鏃犲浐鍖栫殑鎯呭喌鎵嶆樉绀鸿寮�鍏�-->
+            <el-switch v-if="row.variables.hasCuredProgram!=='Y'" v-model="programOnMachine" active-text="鐜板満缂栧埗" inactive-text="宸ヨ壓鍛樼紪鍒�" />
+            &nbsp;
+            <el-button type="primary" :disabled="programOnMachine" plain @click="addApp">娣诲姞鏂囦欢
             </el-button>
         </div>
          <el-text type="danger" v-if="row.variables.curedLocked === 'Y'">鍥哄寲绋嬪簭宸查攣瀹氾紝璇疯皑鎱庝娇鐢ㄣ�傞攣瀹氬師鍥狅細{{ remark }}</el-text>
@@ -16,6 +20,7 @@
          <el-text type="primary" v-if="row.processDefinitionKey === 'program-unlock'"><br/>瑙i攣鍘熷洜锛�</el-text>
          <el-text type="warning">{{row.variables.unlockReason}}</el-text>
          <el-text type="danger" v-if="row.variables.hasCuredProgram==='Y' && row.variables.isProcessEditionSame=='N' && row.variables.cureProgramUseable==undefined">宸插浐鍖栫▼搴忓伐搴忕増娆′笉涓�鑷达紝娲惧伐鐗堟:{{row.variables.processEdition}},宸插浐鍖栫増娆★細{{row.variables.curedProcessEdition}}</el-text>
+         <el-text type="danger" v-if="row.variables.programOnMachine=='Y'">鐜板満缂栧埗</el-text>
         <el-table :data="tableData" border @row-click="showContent" :row-style="{height:'20px'}" :cell-style="{padding:'0px'}" max-height="240" highlight-current-row>
             <!-- <el-table-column prop="machineCode" label="鍔犲伐鏈哄簥">
             </el-table-column> -->
@@ -113,6 +118,7 @@
             codeDiffFileName1: '鍥炰紶鐗堟湰',
             codeDiffFileName2: '涓嬪彂鐗堟湰',
             showContentId: '',
+            programOnMachine:false,//鏄惁鐜板満缂栧埗
             attForm: {
                 att: '',
                 fileType: 'program'
diff --git a/src/views/flow/todolist.vue b/src/views/flow/todolist.vue
index d53595d..8c2579a 100644
--- a/src/views/flow/todolist.vue
+++ b/src/views/flow/todolist.vue
@@ -26,7 +26,7 @@
         <el-drawer title="瀹℃壒" append-to-body v-model="approveBox" size="100%" v-if="approveBox">
             <div class="approve-box">
                 <div class="left">
-                    <TodolistLeft :row="row" @selection-change="selectionChange" />
+                    <TodolistLeft ref="todolistLeft" :row="row" @selection-change="selectionChange" />
                 </div>
                 <div class="right">
                     <TodolistRightTop :row="row" />
@@ -97,24 +97,7 @@
                             { label: '椹冲洖', value: 'N' },
                         ],
                         rules: [{ required: true, message: '璇烽�夋嫨瀹℃壒缁撴灉', trigger: 'blur' }],
-                    },/*
-                    {
-                        label: '鍙戦�佺粰',
-                        prop: 'assignee',
-                        type: 'select',
-                        props: {
-                            label: 'name',
-                            value: 'id',
-                        },
-                        display: true,
-                        filterable: true,
-                        span: 24,
-                        disabled: false,
-                        dicData: [
-
-                        ],
-                       
-                    },*/
+                    },
                     {
                         label: '鍙戦�佺粰',
                         prop: 'assignee',
@@ -137,7 +120,6 @@
                         span: 24,
                         prop: 'comment',
                         type: 'textarea',
-                        // rules: [{ required: true, message: '璇疯緭鍏ュ鎵规剰瑙�', trigger: 'blur' }],
                         rules: [
                             {
                             validator: (rule, value, callback) => {
@@ -783,17 +765,20 @@
             //console.log('handleAction', row, index);
         },
         handleSubmit(form, done) {
-            if(this.row.taskDefinitionKey === 'programmingTask') {
-                // if(this.applist.length !== 1) {
-                //     done();
-                //     return this.$message.success('璇烽�夋嫨1涓▼搴�');
-                // }
+            
+            
+            //this.$alert(this.$refs.todolistLeft.programOnMachine)
+            //done();
+            //return;
+            let programOnMachine = 'N'
+            if(this.row.taskDefinitionKey==='programmingTask'){
+                programOnMachine = this.$refs.todolistLeft.programOnMachine?'Y':'N';
             }
             approve({
                 ...this.formApprove,
                 taskId: this.row.taskId,
                 processInstanceId: this.row.processInstanceId,
-                // programIds: this.row.taskDefinitionKey === 'programmingTask' ? this.applist.map(v => v.id).join(',') : '',
+                programOnMachine: programOnMachine
             }).then(res => {
                 if(res.data.code !== 200) {
                     this.$message.error(res.data.msg);
diff --git a/src/views/statreport/curedprogram.vue b/src/views/statreport/curedprogram.vue
new file mode 100644
index 0000000..4ccc90d
--- /dev/null
+++ b/src/views/statreport/curedprogram.vue
@@ -0,0 +1,226 @@
+<!--
+
+ * @Date: 2025-06-18 09:17:09
+ * @LastEditors: gaoshp
+ * @LastEditTime: 2025-08-17 08:46:49
+ * @FilePath: /mdmweb/src/views/flowmgr/processQuery2.vue
+-->
+<template>
+    <basic-container>
+        <avue-crud :option="option" :table-loading="loading" :search="query" :data="data" :rowKey="processInstanceId" v-model:page="page" ref="crud"
+            @search-change="searchChange" @search-reset="searchReset" @current-change="currentChange"
+            @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad"
+            @selection-change="selectionChange">
+        </avue-crud>
+
+    </basic-container>
+</template>
+
+<script>
+import { getList } from '@/api/statreport/curedprogram.js';
+import { getDeptData} from '@/api/statreport/newprogramming.js';
+import { exportBlobPost } from '@/api/common';
+import NProgress from 'nprogress';
+import { downloadFile } from '@/utils/util';
+import 'nprogress/nprogress.css';
+
+export default {
+    data() {
+        return {
+            viewRow: {},
+            page: {
+                pageSize: 10,
+                currentPage: 1,
+                total: 0,
+            },
+            //form: {endMonth:'2025-08'},
+            query: {endMonth: this.$dayjs().format('YYYY-MM-DD')},
+            loading: true,
+            data: [],
+            option: {
+                addBtn: false,
+                editBtn: false,
+                delBtn: false,
+                viewBtn: false,
+                columnBtn: false,
+                tip: false,
+                searchShow: true,
+                searchMenuSpan: 7,
+                searchEnter:true,
+                dialogWidth: '70%',
+                // tree: true,
+                border: true,
+                index: true,
+                selection: false,
+                //menuWidth: 100,
+                menu: false,
+                labelWidth: 90,
+                //menuSpan: 6,
+                dialogClickModal: false,
+                column: [
+                    
+                    {
+                        label: "鏈堜唤",
+                        prop: "endMonth",
+                        search: true,
+                        type: "month",
+                        hide:true,
+                        valueFormat: 'YYYY-MM-DD'
+                    },
+                    {
+                        label: "閮ㄩ棬",
+                        prop: "deptIds",
+                        search: true,
+                        type: "select",
+                        multiple:true,
+                        hide:true,
+                        disabled:true,
+                        dicData:[{label:'a',value:1}]
+                    },
+                    
+                     {
+                        label: '闆剁粍浠跺彿',
+                        prop: 'drawingNo',
+                        width: 160
+                    },
+                    {
+                        label: '宸ュ簭鍙�',
+                        prop: 'processNo',
+                        width: 80
+                    },
+                    {
+                        label: '宸ュ簭鐗堟',
+                        prop: 'processEdition',
+                        width: 83
+                    },
+                   
+					{
+                        label: '浜у搧鍨嬪彿',
+                        prop: 'productModel',
+                        width: 100
+                    },
+                    {
+                        label: '鏈哄簥',
+                        prop: 'machineCode',
+                        width: 200
+                    },
+                    {
+                        label: '缂栧埗',
+                        prop: 'actProgrammerName',
+                    },
+                    {
+                        label: '鏍″',
+                        prop: 'actCheckerName',
+                    },
+                    {
+                        label: '瀹℃牳',
+                        prop: 'actSeniorName',
+                    },
+                    {
+                        label: '瀹℃牳鏃堕棿',
+                        prop: 'endTime',
+                    },
+                ],
+            },
+            
+            selectedList: [],
+            dialogVisible: false,
+           
+        }
+    },
+    mounted() {
+        getDeptData().then(res => {
+            this.option.column[1].dicData = res.data.data;
+        }, () => {
+            this.data = [];
+        }).catch(err => {
+            this.data = [];
+        });
+    
+    },
+    methods: {
+        
+        selectionChange(list) {
+            console.log('selectionChange', list);
+            this.selectedList = list;
+        },
+        
+        searchChange(params, done) {
+            let data = {}
+            this.query = params;
+            this.page.currentPage = 1;
+            params.createTimeBegin = params?.createTime?.[0] || '';
+            params.createTimeEnd = params?.createTime?.[1] || '';
+            console.log(params);
+            data = {
+                endMonth: params.endMonth,
+                createTimeBegin: params.createTimeBegin || undefined,
+                createTimeEnd: params.createTimeEnd || undefined,
+                deptIds: params.deptIds,
+                myProcessName: params.myProcessName || undefined
+            }
+            this.query = data
+            this.onLoad(this.page, data);
+            done();
+        },
+        searchReset() {
+            let data = {}
+            this.query = data;
+            this.page.currentPage = 1;
+            data = {
+                endMonth: params.endMonth,
+                createTimeBegin: params.createTimeBegin,
+                createTimeEnd: params.createTimeEnd,
+                keyword: params.keyword || '',
+                myProcessName: params.myProcessName || ''
+            }
+            this.onLoad(this.page, data);
+            done();
+        },
+        currentChange(currentPage) {
+            this.page.currentPage = currentPage;
+            // this.onLoad();
+        },
+        sizeChange(pageSize) {
+            this.page.pageSize = pageSize;
+        },
+        refreshChange() {
+            this.onLoad(this.page, this.query);
+        },
+        /** * 椤甸潰鍔犺浇鏃惰幏鍙栨暟鎹�
+         */
+        onLoad(page, params = {}) {
+            console.log('onLoad', page, params);
+            const data = {
+                ...this.query,
+                deptIds: params.deptIds,
+                createTimeBegin: params.createTimeBegin,
+                createTimeEnd: params.createTimeEnd,
+            };
+            this.loading = true;
+            getList(page.currentPage, page.pageSize, Object.assign(data, params)).then(res => {
+                const data = res.data.data
+                this.page.total = data.total;
+                this.data = data.records.map(v=> {
+                    return {
+                        ...v,
+                    }
+                });
+                this.loading = false;
+            }, () => {
+                this.data = [];
+                this.loading = false;
+            }).catch(err => {
+                this.data = [];
+                this.loading = false;
+            });
+        }
+    }
+};
+</script>
+
+<style lang="scss">
+.margin0 {
+    margin: 0
+}
+</style>
\ No newline at end of file
diff --git a/src/views/statreport/newprogramming.vue b/src/views/statreport/newprogramming.vue
new file mode 100644
index 0000000..ff9f104
--- /dev/null
+++ b/src/views/statreport/newprogramming.vue
@@ -0,0 +1,240 @@
+<!--
+
+ * @Date: 2025-06-18 09:17:09
+ * @LastEditors: gaoshp
+ * @LastEditTime: 2025-08-17 08:46:49
+ * @FilePath: /mdmweb/src/views/flowmgr/processQuery2.vue
+-->
+<template>
+    <basic-container>
+        <avue-crud :option="option" :table-loading="loading" :search="query" :data="data" v-model:page="page" ref="crud"
+            @search-change="searchChange" @search-reset="searchReset" @current-change="currentChange"
+            @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad"
+            @selection-change="selectionChange">
+            <!--v-model:search="search"
+            <template #search="{ size }">
+                <el-tag>鏍囬</el-tag>
+                <el-input placeholder="鑷畾涔夎緭鍏ユ"
+                            :size="size"
+                            style="width: 200px"
+                            v-model:value="search.slot"></el-input>
+            </template> -->
+        </avue-crud>
+
+    </basic-container>
+</template>
+
+<script>
+import { getList ,getDeptData} from '@/api/statreport/newprogramming.js';
+
+import { exportBlobPost } from '@/api/common';
+import NProgress from 'nprogress';
+import { downloadFile } from '@/utils/util';
+import 'nprogress/nprogress.css';
+
+export default {
+    data() {
+        return {
+            //search:{}, 鑷畾涔夐噰鐢�
+            //tableData: [],
+            viewRow: {},
+            page: {
+                pageSize: 10,
+                currentPage: 1,
+                total: 0,
+            },
+            //form: {endMonth:'2025-08'},
+            query: {endMonth: this.$dayjs().format('YYYY-MM-DD')},
+            loading: true,
+            data: [],
+            option: {
+                addBtn: false,
+                editBtn: false,
+                delBtn: false,
+                viewBtn: false,
+                columnBtn: false,
+                tip: false,
+                searchShow: true,
+                searchMenuSpan: 7,
+                searchEnter:true,
+                dialogWidth: '70%',
+                // tree: true,
+                border: true,
+                index: true,
+                selection: false,
+                //menuWidth: 100,
+                menu: false,
+                labelWidth: 90,
+                //menuSpan: 6,
+                dialogClickModal: false,
+                column: [
+                    
+                    {
+                        label: "鏈堜唤",
+                        prop: "endMonth",
+                        search: true,
+                        type: "month",
+                        hide:true,
+                        valueFormat: 'YYYY-MM-DD'
+                    },
+                    {
+                        label: "閮ㄩ棬",
+                        prop: "deptIds",
+                        search: true,
+                        type: "select",
+                        multiple:true,
+                        hide:true,
+                        disabled:true,
+                        dicData:[{label:'a',value:1}]
+                    },
+                     {
+                        label: '闆剁粍浠跺彿',
+                        prop: 'drawingNo',
+                        width: 160
+                    },
+                    {
+                        label: '宸ュ簭鍙�',
+                        prop: 'processNo',
+                        width: 80
+                    },
+                    {
+                        label: '宸ュ簭鐗堟',
+                        prop: 'processEdition',
+                        width: 83
+                    },
+                   
+					{
+                        label: '浜у搧鍨嬪彿',
+                        prop: 'productModel',
+                        width: 100
+                    },
+                    {
+                        label: '鏈哄簥',
+                        prop: 'machineCode',
+                        width: 200
+                    },
+                    {
+                        label: '缂栧埗',
+                        prop: 'actProgrammerName',
+                    },
+                    {
+                        label: '鏍″',
+                        prop: 'actCheckerName',
+                    },
+                    {
+                        label: '瀹℃牳',
+                        prop: 'actSeniorName',
+                    },
+                    {
+                        label: '瀹℃牳鏃堕棿',
+                        prop: 'endTime',
+                    },
+                ],
+            },
+            
+            selectedList: [],
+            dialogVisible: false,
+           
+        }
+    },
+    mounted() {
+        //this.option.column[0].disabled = true;
+        //this.option.column[0].value = '2025-08-31';
+        
+        getDeptData().then(res => {
+            this.option.column[1].dicData = res.data.data;
+        }, () => {
+            this.data = [];
+        }).catch(err => {
+            this.data = [];
+        });
+    
+    },
+    methods: {
+        
+        
+        selectionChange(list) {
+            console.log('selectionChange', list);
+            this.selectedList = list;
+        },
+        
+        searchChange(params, done) {
+            let data = {}
+            this.query = params;
+            this.page.currentPage = 1;
+            console.log('searchChange', params);
+            params.createTimeBegin = params?.createTime?.[0] || '';
+            params.createTimeEnd = params?.createTime?.[1] || '';
+            console.log(params);
+            data = {
+                endMonth: params.endMonth,
+                createTimeBegin: params.createTimeBegin || undefined,
+                createTimeEnd: params.createTimeEnd || undefined,
+                deptIds: params.deptIds,
+                myProcessName: params.myProcessName || undefined
+            }
+            this.query = data
+            this.onLoad(this.page, data);
+            done();
+        },
+        searchReset() {
+            let data = {}
+            this.query = data;
+            this.page.currentPage = 1;
+            data = {
+                endMonth: params.endMonth,
+                createTimeBegin: params.createTimeBegin,
+                createTimeEnd: params.createTimeEnd,
+                keyword: params.keyword || '',
+                myProcessName: params.myProcessName || ''
+            }
+            this.onLoad(this.page, data);
+            done();
+        },
+        currentChange(currentPage) {
+            this.page.currentPage = currentPage;
+            // this.onLoad();
+        },
+        sizeChange(pageSize) {
+            this.page.pageSize = pageSize;
+        },
+        refreshChange() {
+            this.onLoad(this.page, this.query);
+        },
+        /** * 椤甸潰鍔犺浇鏃惰幏鍙栨暟鎹�
+         */
+        onLoad(page, params = {}) {
+            console.log('onLoad', page, params);
+            const data = {
+                ...this.query,
+                deptIds: params.deptIds,
+                createTimeBegin: params.createTimeBegin,
+                createTimeEnd: params.createTimeEnd,
+            };
+            this.loading = true;
+            getList(page.currentPage, page.pageSize, Object.assign(data, params)).then(res => {
+                const data = res.data.data
+                this.page.total = data.total;
+                this.data = data.records.map(v=> {
+                    return {
+                        ...v,
+                    }
+                });
+                this.loading = false;
+            }, () => {
+                this.data = [];
+                this.loading = false;
+            }).catch(err => {
+                this.data = [];
+                this.loading = false;
+            });
+        }
+    }
+};
+</script>
+
+<style lang="scss">
+.margin0 {
+    margin: 0
+}
+</style>
\ No newline at end of file

--
Gitblit v1.9.3