小小儁爺
2026-05-15 df418a35e80167ae120e5840d6ff8d19676ee399
1.报告记录删除功能
已修改3个文件
120 ■■■■ 文件已修改
src/api/ReportManager.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/components/Navbar.vue 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/statistic/reportList.vue 65 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/ReportManager.js
@@ -18,6 +18,14 @@
  })
}
export function DeleteMesOrderStepReport(data) {
  return request({
    url: 'ReportManager/DeleteMesOrderStepReport',
    method: 'post',
    data
  })
}
// 入库记录导出
export function StorageRecordExcelSearch(data) {
  return request({
src/layout/components/Navbar.vue
@@ -268,7 +268,7 @@
    // Vue.prototype.$ButtonData = JSON.parse(localStorage.getItem('ButtonData'))
  },
  mounted() {
    this.getHubConnectionBuilder()
    // this.getHubConnectionBuilder()
  },
  computed: {
    ...mapGetters([
@@ -313,27 +313,36 @@
    // 建立hub连接
    async getHubConnectionBuilder() {
      const url = 'http://121.196.36.24:8048/chatHub'
      // 本地开发
      // if (process.env.NODE_ENV === 'development') {
      //   url = 'http://121.196.36.24:8048/chatHub'
      // } else { // 生产环境(关键!!!用相对路径,避免跨域/协议错误)
      //   url = '/chatHub'
      // }
      this.signalr = new signalR.HubConnectionBuilder().withUrl(url, {
        // skipNegotiation: true,
        // transport: signalR.HttpTransportType.WebSockets
        withCredentials: false, // 跨域需要
        skipNegotiation: true,
        transport: signalR.HttpTransportType.WebSockets
      }).configureLogging(signalR.LogLevel.Information).build()
      await this.signalr.start().then(() => {
        if (window.Notification) {
          if (Notification.permission === 'granted') {
            console.log('允许通知')
          } else if (Notification.permission !== 'denied') {
            console.log('需要通知权限')
            Notification.requestPermission((permission) => {
              console.log('权限通知', permission)
            })
          } else if (Notification.permission === 'denied') {
            // console.log('拒绝通知')
          }
        } else {
          console.error('浏览器不支持Notification')
        }
        // console.log('连接成功')
        // if (window.Notification) {
        //   if (Notification.permission === 'granted') {
        //     console.log('允许通知')
        //   } else if (Notification.permission !== 'denied') {
        //     console.log('需要通知权限')
        //     Notification.requestPermission((permission) => {
        //       console.log('权限通知', permission)
        //     })
        //   } else if (Notification.permission === 'denied') {
        //     console.log('拒绝通知')
        //   }
        // } else {
        //   console.error('浏览器不支持Notification')
        // }
        console.log('连接成功')
      })
      this.signalr.off('SendCustomUserMessage')
@@ -341,7 +350,7 @@
        this.$notify({ offset: 80, type: 'warning', title: '消息提醒', message: res })
        this.$store.state.settings.isDot = true
      })
      await this.signalr.invoke('AddUser', localStorage.getItem('account'))
      await this.signalr.invoke('AddUser', localStorage.getItem('usercode'))
    },
    systemSetting() {
src/views/statistic/reportList.vue
@@ -275,6 +275,24 @@
            sortable="custom"
          />
          <el-table-column
            label="操作"
            width="80"
            fixed="right"
          >
            <template slot-scope="{row}">
              <div class="operationClass">
                <el-tooltip class="item" effect="dark" content="删除记录" placement="top">
                  <i
                    class="el-icon-delete"
                    :style="{color:$store.state.settings.theme}"
                    @click="del(row)"
                  />
                </el-tooltip>
              </div>
            </template>
          </el-table-column>
        </el-table>
      </div>
      <!--分页-->
@@ -337,6 +355,7 @@
import ImportPicker from '@/components/ImportPicker'
import { handleDatetime, validateCode } from '@/utils/global'
import {
  DeleteMesOrderStepReport,
  GroupSalaryReportSearchUser, MesOrderStepReportExcelSearch, MesOrderStepReportSearch
} from '@/api/ReportManager'
import elDragDialog from '@/directive/el-drag-dialog'
@@ -553,23 +572,35 @@
    },
    // 删除按钮
    async del(row) {
      // this.$confirm('是否确认删除?', '提示', {
      //   confirmButtonText: '确定',
      //   cancelButtonText: '取消',
      //   type: 'warning'
      // }).then(() => {
      //   DeleteOrganization({ orgid: row.code }).then(res => {
      //     if (res.code === '200') {
      //       this.$message.success('删除成功!')
      //       if (this.form.page > 1 && this.tableData.length === 1) {
      //         this.form.page--
      //       }
      //       this.getMesOrderStepReportSearch()
      //     }
      //   })
      // }).catch(() => {
      //   this.$message.info('已取消删除')
      // })
      this.$confirm('是否确认删除?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        const data = {
          'id': row.id,
          'sbid': row.sbid,
          'wocode': row.wo_code,
          'stepcode': row.step_code,
          'stype': row.steptype,
          'goodqty': row.report_qty,
          'ngqty': row.ng_qty,
          'laborbadqty': row.laborbad_qty,
          'materielbadqty': row.materielbad_qty,
          'verify': row.verify
        }
        DeleteMesOrderStepReport(data).then(res => {
          if (res.code === '200') {
            this.$message.success('删除成功!')
            if (this.form.page > 1 && this.tableData.length === 1) {
              this.form.page--
            }
            this.getMesOrderStepReportSearch()
          }
        })
      }).catch(() => {
        this.$message.info('已取消删除')
      })
    },
    // 对话框关闭事件
    handleClose() {