loulijun2021
2023-02-02 6ad65ff10ec1d2004119b75e1f4c539e2a86659e
src/views/scgl/zdpc.vue
@@ -8,10 +8,10 @@
          :model="formTop"
          label-width="100px"
          inline
          style="display: flex;justify-content: space-between"
          style="display: flex;"
        >
          <div class="elForm">
            <el-form-item label-width="70px" label="车间编码" style=" display: flex;">
            <el-form-item label="车间编码" style=" display: flex;">
              <el-input v-model="formTop.workshop" placeholder="请输入" style="width: 200px" />
            </el-form-item>
            <el-form-item label="生产工单号" style=" display: flex;">
@@ -24,9 +24,9 @@
              <el-input v-model="formTop.partname" placeholder="请输入" style="width: 200px" />
            </el-form-item>
          </div>
          <div class="bodySearchReset" :style="{marginLeft:$store.state.app.sidebar.opened?'5%':'10%'}">
            <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
@@ -71,6 +71,7 @@
          />
          <el-table-column
            prop="AdvaSchePiroQue"
            show-tooltip-when-overflow
            label="优先级"
            width="90"
            sortable="custom"
@@ -112,6 +113,7 @@
            prop="AdvaSchePartSpec"
            label="产品规格"
            width="110"
            show-tooltip-when-overflow
            sortable="custom"
          >
            <template slot-scope="{row}">
@@ -122,6 +124,7 @@
          <el-table-column
            prop="AdvaScheQty"
            label="数量"
            show-tooltip-when-overflow
            width="110"
            sortable="custom"
          />
@@ -129,11 +132,13 @@
            prop="AdvaScheEndDate"
            label="要求交付时间"
            sortable="custom"
            show-tooltip-when-overflow
            width="160"
          />
          <el-table-column
            prop="AdvaScheStus"
            label="排程状态"
            show-tooltip-when-overflow
            width="110"
            sortable="custom"
          >
@@ -145,6 +150,7 @@
          <el-table-column
            prop="AdvaScheBotProcName"
            label="排程工序"
            show-tooltip-when-overflow
            width="110"
            sortable="custom"
          />
@@ -153,6 +159,7 @@
            label="计划排程时间"
            width="160"
            sortable="custom"
            show-tooltip-when-overflow
          >
            <template slot-scope="{row}">
              <div v-if="row.AdvaSchePCStartDate">{{ row.AdvaSchePCStartDate }}</div>
@@ -181,10 +188,11 @@
            ref="form"
            :model="formBottom"
            inline
            style="display: flex;justify-content: space-between"
            label-width="100px"
            style="display: flex;"
          >
            <div class="elForm">
              <el-form-item label-width="70px" label="排程日期" style=" display: flex;">
              <el-form-item label="排程日期" style=" display: flex;">
                <el-date-picker
                  v-model="formBottom.scheDate"
                  type="daterange"
@@ -205,13 +213,13 @@
                  <el-option value="Y" label="时间优先" />
                </el-select>
              </el-form-item>
              <el-form-item label="时间刻度(分钟)" style=" display: flex;">
              <el-form-item label="时间刻度(分钟)" label-width="110" style=" display: flex;">
                <el-select v-model.number="formBottom.scale" style="width: 120px;">
                  <el-option v-for="item in scaleList" :key="item" :value="item" :label="item" />
                </el-select>
              </el-form-item>
              <el-form-item label="换型时间(分钟)" style=" display: flex;">
              <el-form-item label="换型时间(分钟)" label-width="110" style=" display: flex;">
                <el-input
                  id="scale"
                  v-model="formBottom.times"
@@ -227,14 +235,16 @@
                </span>
              </el-form-item>
            </div>
            <div class="bodySearchReset" :style="{marginLeft:$store.state.app.sidebar.opened?'5%':'10%'}">
            <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-document-remove"
                @click="click_schedule"
              >预排
              </el-button>
              <el-button
                v-waves
                type="primary"
                icon="el-icon-document-checked"
                @click="click_yes"
@@ -287,7 +297,7 @@
                </div>
                <div class="speed">
                  <!--                  <el-tooltip class="item" effect="dark" content="查看" placement="top">-->
                  <!--                    <el-button type="text" size="mini" @click="look(data)">-->
                  <!--                    <el-button v-waves type="text" size="mini" @click="look(data)">-->
                  <!--                      <i class="el-icon-document size i-color"  />-->
                  <!--                    </el-button>-->
                  <!--                  </el-tooltip>-->
@@ -314,6 +324,7 @@
import dayjs from 'dayjs'
import { AdvancedSchedulingSearch, OnclickAdvancedSchedulingDevice, SubmitAlreadyScheduling } from '@/api/scgl'
import { handleDatetime } from '@/utils/global'
import waves from '@/directive/waves'
const scaleList = `30,60,240,360`.split(',').map(n => parseInt(n))
const timeList = `0,30,60,120,240,480`.split(',').map(n => parseInt(n))
@@ -323,6 +334,7 @@
  components: {
    Pagination, Test
  },
  directives: { waves },
  data() {
    return {
      mouseHoverType: 'mouseout',
@@ -1036,13 +1048,14 @@
    // 时间/设备优先排程
    click_schedule() {
      const timestamp = new Date().toLocaleDateString()
      if (new Date(this.formBottom.scheDate[0]) < new Date(timestamp)) {
        this.$message.error('排程时间不可以小于当前时间!')
      if (new Date(this.formBottom.scheDate[1]) < new Date(timestamp)) {
        this.$message.error('排程日期不可以小于当前时间!')
        return false
      }
      this.nitialize()// 手动过滤所有设备已排程
      console.log(this.facility_data, 67890)
      // console.log(this.facility_data, 67890)
      if (this.bm_data != '' && this.formBottom.types == 'N') { // 设备优先
        this.fun_time()
        this.change_num(this.bm_data)