小小儁爺
2024-10-31 73a92318e604724359ea65c5c232a0c818632e77
1.入库记录  新增删除功能
已修改2个文件
146 ■■■■ 文件已修改
src/api/ReportManager.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/statistic/storageRecord.vue 137 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/ReportManager.js
@@ -162,6 +162,15 @@
  })
}
// 入库记录删除
export function DeleteStorageRecord(data) {
  return request({
    url: 'ReportManager/DeleteStorageRecord',
    method: 'post',
    data
  })
}
// 入库记录导出
export function StorageRecordExcelSearch(data) {
  return request({
src/views/statistic/storageRecord.vue
@@ -1,7 +1,8 @@
<template>
  <div>
    <div class="body" :style="{height:mainHeight+'px'}">
      <div class="bodyTopButtonGroup">
      <div class="bodyTopButtonGroup" style="justify-content: space-between">
        <el-button v-waves :disabled="multipleSelection.length===0" type="danger" icon="el-icon-delete" @click="del">删除</el-button>
        <el-button v-waves type="primary" icon="el-icon-download" @click="download">导出</el-button>
      </div>
@@ -17,22 +18,6 @@
            <el-form-item label="入库单号" style="display: flex;">
              <el-input v-model="form.hbillno" placeholder="请输入" style="width: 200px" />
            </el-form-item>
            <!--            <el-form-item label="车间名称" style=" display: flex;">-->
            <!--              <el-select-->
            <!--                v-model="form.hbillno"-->
            <!--                filterable-->
            <!--                :popper-append-to-body="false"-->
            <!--                style="width: 200px"-->
            <!--                placeholder="请选择"-->
            <!--              >-->
            <!--                <el-option-->
            <!--                  v-for="item in xxxx1"-->
            <!--                  :key="item.torg_code"-->
            <!--                  :label="item.torg_name"-->
            <!--                  :value="item.torg_code"-->
            <!--                />-->
            <!--              </el-select>-->
            <!--            </el-form-item>-->
            <el-form-item label="销售单号" style=" display: flex;">
              <el-input v-model="form.sono" placeholder="请输入" style="width: 200px" />
            </el-form-item>
@@ -63,7 +48,6 @@
                  :value="item.code"
                />
              </el-select>
              <!--              <el-input v-model="form.stockcode" style="width: 200px" placeholder="请输入" />-->
            </el-form-item>
            <el-form-item v-show="isExpandForm" label="单据日期" style="display: flex;align-items: center">
              <el-date-picker
@@ -77,9 +61,6 @@
                start-placeholder="开始日期"
                end-placeholder="结束日期"
              />
              <!--              font-size: 14px!important;-->
              <!--              :picker-options="expireTimeOption"-->
            </el-form-item>
          </div>
          <div
@@ -122,7 +103,13 @@
          :header-cell-style="this.$headerCellStyle"
          :cell-style="this.$cellStyle"
          @sort-change="sortChange"
          @selection-change="handleSelectionChange"
        >
          <el-table-column
            type="selection"
            width="50"
            fixed
          />
          <el-table-column
            prop="rowNum"
            width="50"
@@ -246,7 +233,31 @@
            width="160"
            sortable="custom"
          />
          <el-table-column
            label="操作"
            width="120"
            fixed="right"
          >
            <template slot-scope="{row}">
              <div class="operationClass">
                <!--                <el-tooltip class="item" effect="dark" content="编辑" placement="top">-->
                <!--                  <i-->
                <!--                    v-if="row.leve!==0"-->
                <!--                    class="el-icon-edit-outline"-->
                <!--                    :style="{color:$store.state.settings.theme}"-->
                <!--                    @click="edit('edit',row)"-->
                <!--                  />-->
                <!--                </el-tooltip>-->
                <el-tooltip v-del-tab-index 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>
      <!--分页-->
@@ -309,6 +320,7 @@
import ImportPicker from '@/components/ImportPicker'
import { handleDatetime, validateCode } from '@/utils/global'
import {
  DeleteStorageRecord,
  GroupSalaryReportSearchUser, StorageRecordExcelSearch, StorageRecordSearch
} from '@/api/ReportManager'
import elDragDialog from '@/directive/el-drag-dialog'
@@ -371,7 +383,9 @@
      title_value: '数据导入 / 点检部位',
      code: '4',
      shows: false
      shows: false,
      multipleSelection: []
    }
  },
@@ -514,25 +528,62 @@
      //   this.dialogForm.SupUnit = row.parent_id
      // })
    },
    handleSelectionChange(val) {
      this.multipleSelection = val
    },
    // 删除按钮
    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.getStorageRecordSearch()
      //     }
      //   })
      // }).catch(() => {
      //   this.$message.info('已取消删除')
      // })
    del(row) {
      this.$confirm('是否确认删除?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        let data = []
        if (row.create_date) { // 说明点击的时 单行删除
          data = [
            {
              'hbillno': row.hbillno,
              'salecode': row.salecode,
              'mo_no': row.mo_no,
              'wocode': row.wocode,
              'partcode': row.partcode,
              'qty': row.qty,
              'wkshop_code': row.wkshp_code,
              'stockcode': row.stockcode,
              'inbarcode': row.inbarcode,
              'step_code': row.step_code,
              'style': row.style
            }
          ]
        } else { // 说明是批量删除
          this.multipleSelection.forEach(row => {
            data.push({
              'hbillno': row.hbillno,
              'salecode': row.salecode,
              'mo_no': row.mo_no,
              'wocode': row.wocode,
              'partcode': row.partcode,
              'qty': row.qty,
              'wkshop_code': row.wkshp_code,
              'stockcode': row.stockcode,
              'inbarcode': row.inbarcode,
              'step_code': row.step_code,
              'style': row.style
            })
          })
        }
        DeleteStorageRecord(data).then(res => {
          if (res.code === '200') {
            this.$message.success('删除成功!')
            if (this.form.page > 1 && this.tableData.length === 1) {
              this.form.page--
            }
            this.getStorageRecordSearch()
          }
        })
      }).catch(() => {
        this.$message.info('已取消删除')
      })
    },
    // 对话框关闭事件
    handleClose() {
@@ -584,6 +635,10 @@
</script>
<style scoped lang="scss">
::v-deep .el-icon-delete{
  margin-right: 0 !important;
}
::v-deep .el-select__caret {
  display: flex;
  align-items: center;