loulijun2021
2023-02-14 b46bc2dba51a3885a68e4c58316b41a31ea16bb2
src/views/scgl/gdplgb.vue
@@ -2,20 +2,17 @@
  <div>
    <div class="body" :style="{height:mainHeight+'px'}">
      <div class="bodyTopButtonGroup" style="justify-content: space-between">
        <!--        <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">新增</el-button>-->
        <!--        <el-button icon="el-icon-download" @click="upload">导入</el-button>-->
        <el-button icon="el-icon-switch-button" @click="handleClose('close')">批量关单</el-button>
        <el-button icon="el-icon-switch-button" @click="handleClose('noClose')">批量反关单</el-button>
        <el-button v-waves icon="el-icon-switch-button" @click="handleClose('close')">批量关单</el-button>
        <el-button v-waves icon="el-icon-switch-button" @click="handleClose('noClose')">批量反关单</el-button>
      </div>
      <div class="bodyTopFormGroup">
        <el-form
          ref="form"
          :model="form"
          label-width="80px"
          label-width="100px"
          inline
          style="display: flex;justify-content: space-between"
          style="display: flex;"
        >
          <div class="elForm">
            <el-form-item label="工单状态" style=" display: flex;">
@@ -37,37 +34,55 @@
                />
              </el-select>
            </el-form-item>
            <el-form-item label="产品编码" style=" display: flex;">
            <el-form-item v-show="isExpandForm" label="产品编码" style=" display: flex;">
              <el-input v-model="form.partcode" style="width: 200px" placeholder="请输入" />
            </el-form-item>
            <el-form-item label="产品名称" style=" display: flex;">
            <el-form-item v-show="isExpandForm" label="产品名称" style=" display: flex;">
              <el-input v-model="form.partname" style="width: 200px" placeholder="请输入" />
            </el-form-item>
            <el-form-item label="产品规格" style=" display: flex;">
            <el-form-item v-show="isExpandForm" label="产品规格" style=" display: flex;">
              <el-input v-model="form.partspec" style="width: 200px" placeholder="请输入" />
            </el-form-item>
            <el-form-item label="创建人员" style=" display: flex;">
            <el-form-item v-show="isExpandForm" label="创建人员" style=" display: flex;">
              <el-input v-model="form.creatuser" style="width: 200px" placeholder="请输入" />
            </el-form-item>
            <el-form-item label="创建时间" style=" display: flex;">
            <el-form-item v-show="isExpandForm" label="创建时间" style=" display: flex;">
              <el-input v-model="form.createdate" style="width: 200px" placeholder="请输入" />
            </el-form-item>
          </div>
          <div style="display: flex;align-items: start;margin-top: 5px;z-index: 2">
            <el-button type="primary" icon="el-icon-search" @click="search">查询</el-button>
            <el-button type="info" icon="el-icon-refresh" @click="reset">重置</el-button>
          <div class="bodySearchReset" :style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}">
            <el-button v-waves type="primary" icon="el-icon-search" @click="search">查询</el-button>
            <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">重置</el-button>
          </div>
        </el-form>
        <div
          class="bodyTopFormExpand"
        >
          <svg-icon
            v-show="mouseHoverType==='mouseout'"
            style="cursor: pointer"
            :icon-class="!isExpandForm?'doubleDown3':'doubleUp3'"
            @mouseenter="mouseHoverType=$event.type"
          />
          <svg-icon
            v-show="mouseHoverType==='mouseenter'"
            style="cursor: pointer"
            :icon-class="!isExpandForm?'doubleDown':'doubleUp'"
            @click="isExpandForm=!isExpandForm"
            @mouseout="mouseHoverType=$event.type"
          />
        </div>
      </div>
      <div class="elTableDiv">
        <el-table
          ref="multipleTable"
          class="tableFixed"
          :data="tableData"
          :height="tableHeight+'px'"
          :height="isExpandForm?tableHeight:(tableHeight+80)+'px'"
          border
          :row-class-name="tableRowClassName"
          :style="{width: 100+'%',height:tableHeight+'px',}"
          :style="{width: 100+'%',height:isExpandForm?tableHeight:(tableHeight+80)+'px',}"
          highlight-current-row
          :header-cell-style="this.$headerCellStyle"
          :cell-style="this.$cellStyle"
@@ -99,6 +114,7 @@
            fixed
          />
          <el-table-column
            show-tooltip-when-overflow
            prop="status"
            label="订单状态"
            sortable="custom"
@@ -108,6 +124,8 @@
              <div v-if="row.status==='NEW'">新工单</div>
              <!--              <div v-if="row.status==='CREATING'">执行中</div>-->
              <!--              <div v-if="row.status==='CREATED'">已关闭</div>-->
              <div v-if="row.status==='NOSCHED'">未排程</div>
              <div v-if="row.status==='SCHED'">已排程</div>
              <div v-if="row.status==='ALLO'">已派发</div>
              <div v-if="row.status==='START'">开工</div>
              <div v-if="row.status==='CLOSED'">完工</div>
@@ -115,6 +133,7 @@
          </el-table-column>
          <el-table-column
            prop="wo_code"
            show-tooltip-when-overflow
            label="工单编号"
            sortable="custom"
            min-width="160"
@@ -122,12 +141,19 @@
          <el-table-column
            prop="m_po"
            label="源单单号"
            show-tooltip-when-overflow
            sortable="custom"
            min-width="160"
          />
          >
            <template slot-scope="{row}">
              <div v-if="row.m_po">{{ row.m_po }}</div>
              <div v-else>/</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="wotype"
            label="单据类型"
            show-tooltip-when-overflow
            sortable="custom"
            min-width="120"
          >
@@ -141,18 +167,21 @@
            prop="partcode"
            label="产品编码"
            sortable="custom"
            show-tooltip-when-overflow
            min-width="120"
          />
          <el-table-column
            prop="partname"
            min-width="150"
            label="产品名称"
            show-tooltip-when-overflow
            sortable="custom"
          />
          <el-table-column
            prop="partspec"
            label="产品规格"
            sortable="custom"
            show-tooltip-when-overflow
            width="110"
          >
            <template slot-scope="{row}">
@@ -164,28 +193,48 @@
            prop="plan_qty"
            label="任务数量"
            sortable="custom"
            show-tooltip-when-overflow
            width="110"
          />
          <el-table-column
            prop="good_qty"
            label="合格数量"
            show-tooltip-when-overflow
            sortable="custom"
            width="110"
          />
          >
            <template slot-scope="{row}">
              <div v-if="row.good_qty">{{ row.good_qty }}</div>
              <div v-else>/</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="ng_qty"
            label="不良数量"
            show-tooltip-when-overflow
            sortable="custom"
            width="110"
          />
          >
            <template slot-scope="{row}">
              <div v-if="row.ng_qty">{{ row.ng_qty }}</div>
              <div v-else>/</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="bad_qty"
            label="报废数量"
            show-tooltip-when-overflow
            sortable="custom"
            width="110"
          />
          >
            <template slot-scope="{row}">
              <div v-if="row.bad_qty">{{ row.bad_qty }}</div>
              <div v-else>/</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="wkshp_name"
            show-tooltip-when-overflow
            label="生产车间"
            sortable="custom"
            width="120"
@@ -220,6 +269,7 @@
          <el-table-column
            prop="plan_startdate"
            label="计划开始时间"
            show-tooltip-when-overflow
            sortable="custom"
            width="160"
          >
@@ -233,6 +283,7 @@
            label="计划结束时间"
            sortable="custom"
            width="160"
            show-tooltip-when-overflow
          >
            <template slot-scope="{row}">
              <div v-if="row.plan_enddate">{{ row.plan_enddate }}</div>
@@ -243,6 +294,7 @@
            prop="piroque"
            label="工单等级"
            sortable="custom"
            show-tooltip-when-overflow
            width="120"
          >
            <template slot-scope="{row}">
@@ -255,11 +307,13 @@
          <el-table-column
            prop="lm_user"
            label="创建人员"
            show-tooltip-when-overflow
            sortable="custom"
            width="120"
          />
          <el-table-column
            prop="lm_date"
            show-tooltip-when-overflow
            label="创建时间"
            width="160"
            sortable="custom"
@@ -313,19 +367,20 @@
<script>
import Pagination from '@/components/Pagination'
import { AddUpdateOrganization, DeleteOrganization, OrganizationSearch, PrentOrganization } from '@/api/jcsz'
import { getCookie } from '@/utils/auth'
import ImportPicker from '@/components/ImportPicker'
import { validateCode } from '@/utils/global'
import { MesOrderBitchAntiClosedSeave, MesOrderBitchClosedSearch, MesOrderBitchClosedSeave } from '@/api/scgl'
import waves from '@/directive/waves'
export default {
  name: 'Zzjg',
  components: {
    Pagination, ImportPicker
  },
  directives: { waves },
  data() {
    return {
      mouseHoverType: 'mouseout',
      isExpandForm: false,
      mainHeight: 0,
      tableHeight: 0,
      form: {
@@ -428,40 +483,50 @@
            data.push({ wo_code: item.wo_code })
          }
        })
        this.$confirm('是否确认批量关单?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          MesOrderBitchClosedSeave({ dt: data }).then(res => {
            if (res.code === '200') {
              this.$message.success('批量关单成功!')
              this.$refs.multipleTable.clearSelection()
            }
        if (data.length > 0) {
          this.$confirm('是否确认批量关单?', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }).then(() => {
            MesOrderBitchClosedSeave(data).then(res => {
              if (res.code === '200') {
                this.$message.success('批量关单成功!')
                this.$refs.multipleTable.clearSelection()
                this.getMesOrderBitchClosedSearch()
              }
            })
          }).catch(() => {
            this.$message.info('已取消批量关单!')
          })
        }).catch(() => {
          this.$message.info('已取消批量关单!')
        })
        } else if (data.length === 0) {
          this.$message.info('无符合可关闭的工单!')
        }
      } else if (val === 'noClose') {
        this.multipleSelection.forEach(item => {
          if (item.status === 'CLOSED') {
            data.push({ wo_code: item.wo_code })
          }
        })
        this.$confirm('是否确认批量反关单?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          MesOrderBitchAntiClosedSeave({ dt: data }).then(res => {
            if (res.code === '200') {
              this.$message.success('批量反关单成功!')
              this.$refs.multipleTable.clearSelection()
            }
        if (data.length > 0) {
          this.$confirm('是否确认批量反关单?', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }).then(() => {
            MesOrderBitchAntiClosedSeave(data).then(res => {
              if (res.code === '200') {
                this.$message.success('批量反关单成功!')
                this.$refs.multipleTable.clearSelection()
                this.getMesOrderBitchClosedSearch()
              }
            })
          }).catch(() => {
            this.$message.info('已取消批量反关单!')
          })
        }).catch(() => {
          this.$message.info('已取消批量反关单!')
        })
        } else if (data.length === 0) {
          this.$message.info('无符合可反关闭的工单!')
        }
      }
    },
@@ -469,7 +534,8 @@
    getHeight() {
      this.$nextTick(() => {
        this.mainHeight = window.innerHeight - 85
        this.tableHeight = this.mainHeight - 240
        this.tableHeight = this.mainHeight - 295
        this.$refs.multipleTable.doLayout()
      })
    },
    tableRowClassName({ row, rowIndex }) {
@@ -580,6 +646,15 @@
  align-items: center;
  justify-content: center;
}
.tableFixed{
  ::v-deep .el-table__fixed-right{
    height: 100% !important;
  }
  ::v-deep .el-table__fixed{
    height: 100% !important;
  }
}
</style>
<style>