loulijun2021
2023-03-20 a1c2af547ceee7a78226cb7f271b9f9cd1854786
src/views/scgl/gd.vue
@@ -20,7 +20,7 @@
          style="display: flex;justify-content: space-between"
        >
          <div class="elForm">
            <el-form-item label-width="70px" label="订单状态" style=" display: flex;">
            <el-form-item label-width="70px" label="工单状态" style=" display: flex;">
              <el-select
                v-model="form.mesorderstus"
                :popper-append-to-body="false"
@@ -37,7 +37,7 @@
                />
              </el-select>
            </el-form-item>
            <el-form-item label="订单编号" style=" display: flex;">
            <el-form-item label="工单编号" style=" display: flex;">
              <el-input v-model="form.mesordercode" placeholder="请输入" style="width: 200px" />
            </el-form-item>
            <el-form-item label="源单单号" style="display: flex;">
@@ -158,7 +158,7 @@
          />
          <el-table-column
            prop="status"
            label="订单状态"
            label="工单状态"
            sortable="custom"
            width="110"
          >
@@ -319,13 +319,8 @@
            <template slot-scope="{row}">
              <div class="operationClass">
                <el-tooltip class="item" effect="dark" content="打印工单" placement="top">
                  <!--                  <i-->
                  <!--                    class="el-icon-tickets"-->
                  <!--                    style="cursor: pointer;color: #42b983;margin-right: 15px"-->
                  <!--                    @click="check(row)"-->
                  <!--                  />-->
                  <i
                    class="el-icon-tickets"
                    class="el-icon-printer"
                    style="cursor: pointer;color: #42b983;margin-right: 15px"
                    @click="handlePrint(row.wo_code)"
                  />
@@ -419,10 +414,13 @@
              <div class="operationClass">
                <el-tooltip class="item" effect="dark" content="打印工序" placement="top">
                  <i
                    class="el-icon-tickets"
                    class="el-icon-printer"
                    style="cursor: pointer;color: #42b983;margin-right: 15px"
                    @click="supplementSmallClick(row)"
                  />
                </el-tooltip>
                <el-tooltip v-del-tab-index class="item" effect="dark" content="预览" placement="top">
                  <i class="el-icon-files" style="cursor: pointer;color:#42b983;" @click="check(row)" />
                </el-tooltip>
              </div>
            </template>
@@ -448,7 +446,7 @@
        label-width="110px"
      >
        <el-form-item
          label="订单状态"
          label="工单状态"
          prop="mesorderstus"
        >
          <el-select
@@ -583,6 +581,7 @@
              style="width: 200px;"
              placeholder="请选择"
              :disabled="dialogForm.routecode===''"
              @change="wkshopcodeChange"
            >
              <el-option
                v-for="item in wkshopArr"
@@ -689,9 +688,19 @@
          <el-button @click="dialogVisibleCancel">取 消</el-button>
          <!--          <el-button v-if="operation==='add'" type="primary" @click="dialogVisibleConfirmPreview('add')">预览</el-button>-->
          <el-button
            v-if="!sumbitBottonIsDisabled"
            v-waves
            type="primary"
            :loading="$store.state.app.buttonIsDisabled"
            :disabled="$store.state.app.buttonIsDisabled"
            @click="dialogVisibleConfirm"
          >确 定</el-button>
          <el-button
            v-if="sumbitBottonIsDisabled"
            v-waves
            type="primary"
            disabled
            @click="dialogVisibleConfirm"
          >确 定</el-button>
        </div>
@@ -805,13 +814,83 @@
          style="display: flex;justify-content: space-between"
        >
          <div class="elForm" style="justify-content: flex-start">
            <!--            <el-form-item-->
            <!--              label="预计开工时间"-->
            <!--              label-width="100px"-->
            <!--              style=" display: flex;font-size: 14px;margin-top: 3px"-->
            <!--            >-->
            <!--              <el-date-picker-->
            <!--                v-model="sourceForm.paystartdate"-->
            <!--                type="daterange"-->
            <!--                range-separator="~"-->
            <!--                class="timeMini"-->
            <!--                size="mini"-->
            <!--                style="width: 200px;display: flex;line-height: 34px;height: 34px;font-size: 14px!important;"-->
            <!--                :clearable="false"-->
            <!--                start-placeholder="开始日期"-->
            <!--                end-placeholder="结束日期"-->
            <!--              />-->
            <!--              &lt;!&ndash;              :picker-options="expireTimeOption"&ndash;&gt;-->
            <!--            </el-form-item>-->
            <!--            <el-form-item-->
            <!--              label="预计完工时间"-->
            <!--              label-width="100px"-->
            <!--              style=" display: flex;font-size: 14px;margin-top: 3px"-->
            <!--            >-->
            <!--              <el-date-picker-->
            <!--                v-model="sourceForm.payenddate"-->
            <!--                type="daterange"-->
            <!--                :clearable="false"-->
            <!--                class="timeMini"-->
            <!--                range-separator="~"-->
            <!--                start-placeholder="开始日期"-->
            <!--                style="width: 200px;display: flex;line-height: 34px ;height: 34px ;font-size: 14px !important;"-->
            <!--                end-placeholder="结束日期"-->
            <!--                size="mini"-->
            <!--              />-->
            <!--            </el-form-item>-->
            <!--            <el-form-item label="工单状态" style=" display: flex;">-->
            <!--              <el-select-->
            <!--                v-model="sourceForm.mesordercode"-->
            <!--                filterable-->
            <!--                :popper-append-to-body="false"-->
            <!--                style="width: 200px"-->
            <!--                placeholder="请选择"-->
            <!--              >-->
            <!--                <el-option-->
            <!--                  v-for="item in erporderstusArr"-->
            <!--                  :key="item.code"-->
            <!--                  :label="item.name"-->
            <!--                  :value="item.code"-->
            <!--                />-->
            <!--              </el-select>-->
            <!--            </el-form-item>-->
            <el-form-item label="工单编号" style=" display: flex;">
              <el-input v-model="sourceForm.sourceorder" placeholder="请输入" style="width: 200px" />
            </el-form-item>
            <el-form-item label="产品编码" style=" display: flex;">
              <el-input v-model="sourceForm.partcode" style="width: 200px" placeholder="请输入" />
            </el-form-item>
            <el-form-item label="产品名称" style=" display: flex;">
              <el-input v-model="sourceForm.partname" style="width: 200px" placeholder="请输入" />
            </el-form-item>
            <el-form-item v-show="isExpandDialog" label="产品规格" style=" display: flex;">
              <el-input v-model="sourceForm.partspec" style="width: 200px" placeholder="请输入" />
            </el-form-item>
            <el-form-item v-show="isExpandDialog" label="创建人员" style=" display: flex;">
              <el-input v-model="sourceForm.creatuser" style="width: 200px" placeholder="请输入" />
            </el-form-item>
            <el-form-item
              label="预计开工时间"
              v-show="isExpandDialog"
              label="创建时间"
              label-width="100px"
              style=" display: flex;font-size: 14px;margin-top: 3px"
            >
              <el-date-picker
                v-model="sourceForm.paystartdate"
                v-model="sourceForm.createdate"
                type="daterange"
                range-separator="~"
                class="timeMini"
@@ -823,55 +902,6 @@
              />
              <!--              :picker-options="expireTimeOption"-->
            </el-form-item>
            <el-form-item
              label="预计完工时间"
              label-width="100px"
              style=" display: flex;font-size: 14px;margin-top: 3px"
            >
              <el-date-picker
                v-model="sourceForm.payenddate"
                type="daterange"
                :clearable="false"
                class="timeMini"
                range-separator="~"
                start-placeholder="开始日期"
                style="width: 200px;display: flex;line-height: 34px ;height: 34px ;font-size: 14px !important;"
                end-placeholder="结束日期"
                size="mini"
              />
            </el-form-item>
            <el-form-item label="订单状态" style=" display: flex;">
              <el-select
                v-model="sourceForm.erporderstus"
                filterable
                :popper-append-to-body="false"
                style="width: 200px"
                placeholder="请选择"
              >
                <el-option
                  v-for="item in erporderstusArr"
                  :key="item.code"
                  :label="item.name"
                  :value="item.code"
                />
              </el-select>
            </el-form-item>
            <el-form-item v-show="isExpandDialog" label="订单编号" style=" display: flex;">
              <el-input v-model="sourceForm.erpordercode" placeholder="请输入" style="width: 200px" />
            </el-form-item>
            <el-form-item v-show="isExpandDialog" label="产品编码" style=" display: flex;">
              <el-input v-model="sourceForm.partcode" style="width: 200px" placeholder="请输入" />
            </el-form-item>
            <el-form-item v-show="isExpandDialog" label="产品名称" style=" display: flex;">
              <el-input v-model="sourceForm.partname" style="width: 200px" placeholder="请输入" />
            </el-form-item>
            <el-form-item v-show="isExpandDialog" label="产品规格" style=" display: flex;">
              <el-input v-model="sourceForm.partspec" style="width: 200px" placeholder="请输入" />
            </el-form-item>
            <el-form-item v-show="isExpandDialog" label="创建人员" style=" display: flex;">
              <el-input v-model="sourceForm.creatuser" style="width: 200px" placeholder="请输入" />
            </el-form-item>
          </div>
@@ -904,14 +934,15 @@
      <div class="elTableDiv">
        <el-table
          :data="sourceTableData"
          :height="isExpandDialog?(tableHeight+60)+'px':(tableHeight+140)+'px'"
          :height="isExpandDialog?(tableHeight+60)+'px':(tableHeight+100)+'px'"
          border
          :row-class-name="tableRowClassName"
          :style="{width: 100+'%',height:isExpandDialog?(tableHeight+60)+'px':(tableHeight+140)+'px',}"
          :style="{width: 100+'%',height:isExpandDialog?(tableHeight+60)+'px':(tableHeight+100)+'px',}"
          highlight-current-row
          :header-cell-style="this.$headerCellStyle"
          :cell-style="this.$cellStyle"
          @sort-change="sourceSortChange"
          @row-click="getCurrentRowSource"
        >
          <!--          <el-table-column-->
          <!--            type="selection"-->
@@ -926,8 +957,8 @@
                v-model="radioSelectedId"
                :label="row.id"
                style="color: transparent;padding-left: 10px;"
                @change.native="getCurrentRowSource(row.id)"
              />
              <!--              @change.native="getCurrentRowSource(row.id)"-->
            </template>
          </el-table-column>
          <el-table-column
@@ -936,40 +967,50 @@
            fixed
            label="序号"
          />
          <!--          <el-table-column-->
          <!--            prop="status"-->
          <!--            label="工单状态"-->
          <!--            show-tooltip-when-overflow-->
          <!--            sortable="custom"-->
          <!--            width="110"-->
          <!--          >-->
          <!--            <template slot-scope="{row}">-->
          <!--              <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==='CLOSED'">已关闭</div>-->
          <!--            </template>-->
          <!--          </el-table-column>-->
          <el-table-column
            prop="status"
            label="订单状态"
            sortable="custom"
            width="110"
          >
            <template slot-scope="{row}">
              <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==='CLOSED'">已关闭</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="wo"
            label="订单编号"
            sortable="custom"
            label="工单编号"
            prop="wo_code"
            show-tooltip-when-overflow
            min-width="150"
          />
            sortable="custom"
          >
            <!--            <template slot-scope="{row}">-->
            <!--              <div v-if="row.m_po">{{ row.m_po }}</div>-->
            <!--              <div v-else>{{ row.wo_code }}</div>-->
            <!--            </template>-->
          </el-table-column>
          <el-table-column
            prop="partcode"
            label="产品编码"
            sortable="custom"
            show-tooltip-when-overflow
            min-width="150"
          />
          <el-table-column
            prop="partname"
            label="产品名称"
            sortable="custom"
            show-tooltip-when-overflow
            min-width="150"
          />
          <el-table-column
            prop="partspec"
            label="产品规格"
            show-tooltip-when-overflow
            sortable="custom"
            min-width="110"
          >
@@ -979,20 +1020,30 @@
            </template>
          </el-table-column>
          <el-table-column
            prop="qty"
            label="订单数量"
            prop="plan_qty"
            label="任务数量"
            width="150"
            show-tooltip-when-overflow
            sortable="custom"
          />
          <el-table-column
            prop="relse_qty"
            label="已下单数量"
            prop="bad_qty"
            label="报废数量"
            width="150"
            show-tooltip-when-overflow
            sortable="custom"
          />
          <!--          <el-table-column-->
          <!--            prop="relse_qty"-->
          <!--            show-tooltip-when-overflow-->
          <!--            label="已下单数量"-->
          <!--            width="150"-->
          <!--            sortable="custom"-->
          <!--          />-->
          <el-table-column
            prop="wkshp_name"
            label="生产车间"
            show-tooltip-when-overflow
            sortable="custom"
            width="150"
          >
@@ -1002,46 +1053,50 @@
            </template>
          </el-table-column>
          <el-table-column
            prop="planstartdate"
            prop="plan_startdate"
            label="预计开工时间"
            show-tooltip-when-overflow
            sortable="custom"
            width="130"
          >
            <template slot-scope="{row}">
              <div v-if="row.planstartdate">{{ row.planstartdate.substring(0, 11) }}</div>
              <div v-if="row.plan_startdate">{{ row.plan_startdate.substring(0, 11) }}</div>
              <div v-else>/</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="planenddate"
            prop="plan_enddate"
            label="预计完工时间"
            show-tooltip-when-overflow
            sortable="custom"
            width="130"
          >
            <template slot-scope="{row}">
              <div v-if="row.planenddate">{{ row.planenddate.substring(0, 11) }}</div>
              <div v-if="row.plan_enddate">{{ row.plan_enddate.substring(0, 11) }}</div>
              <div v-else>/</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="createuser"
            prop="lm_user"
            label="创建人员"
            show-tooltip-when-overflow
            sortable="custom"
            width="150"
          >
            <template slot-scope="{row}">
              <div v-if="row.createuser">{{ row.createuser }}</div>
              <div v-if="row.lm_user">{{ row.lm_user }}</div>
              <div v-else>/</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="createdate"
            prop="lm_date"
            label="创建时间"
            show-tooltip-when-overflow
            width="130"
            sortable="custom"
          >
            <template slot-scope="{row}">
              <div v-if="row.createdate">{{ row.createdate.substring(0, 11) }}</div>
              <div v-if="row.lm_date">{{ row.lm_date.substring(0, 11) }}</div>
              <div v-else>/</div>
            </template>
          </el-table-column>
@@ -1053,7 +1108,7 @@
          <!--            <template slot-scope="{row}">-->
          <!--              <div class="operationClass">-->
          <!--                <el-tooltip class="item" effect="dark" content="下达" placement="top">-->
          <!--                  &lt;!&ndash;                <el-button type="text" @click="edit('edit',row)">下达</el-button>&ndash;&gt;-->
          <!--                  &lt;!&ndash;                <el-button  type="text" @click="edit('edit',row)">下达</el-button>&ndash;&gt;-->
          <!--                  <i-->
          <!--                    class="el-icon-bottom"-->
          <!--                    style="color:#42b983;cursor: pointer;margin-left: 5px"-->
@@ -1073,7 +1128,7 @@
        align="right"
        layout="total,prev, pager, next,sizes"
        popper-class="select_bottom"
        @pagination="getErpOrderSearch"
        @pagination="getMesBadOrderSearch"
      />
      <span slot="footer" class="dialog-footer">
        <div class="footerButton">
@@ -1116,12 +1171,14 @@
                <el-form-item label="产品编码:" class="formContent">
                  {{ formApprove.partcode }}
                </el-form-item>
                <el-form-item label="产品名称:" class="formContent">
                  {{ formApprove.partname }}
                </el-form-item>
                <el-form-item label="产品规格:" class="formContent">
                  {{ formApprove.partspec }}
                </el-form-item>
                <el-form-item label="产品名称:" class="formContent" style="width: 100%;">
                  {{ formApprove.partname }}
                  <!--                  王力-5寸H型单曲合页(加彩款)左上页金工件-->
                </el-form-item>
                <el-form-item label="工单数量:" class="formContent">
                  {{ formApprove.plan_qty }}
                </el-form-item>
@@ -1375,6 +1432,68 @@
          </div>
          <div
            v-if="printSize===2"
            class="printSize2"
            style="display: flex;width: 220px;height: 130px;border: 1px solid #000;text-align: center;font-size: 12px"
          >
            <div style="width: 70px;display: flex;flex-direction: column;border-right: 1px solid #000">
              <div
                style="display: flex;height: 60%;border-bottom:1px solid #000;
              justify-content: center;align-items: center;position: relative"
              >
                <div
                  id="qrCode2"
                  ref="qrCodeDiv2"
                  style="overflow-y: hidden;height:71%;position: absolute;left: 7px;"
                />
              </div>
              <div
                style="display: flex;height:  20%;justify-content: flex-start;border-bottom:1px solid #000;align-items: center"
              >
                <div style="margin-left: 3px; ">数量:{{ qrForm.startqty }}</div>
              </div>
              <div style="display: flex;height:  20%;justify-content: flex-start;align-items: center;">
                <div style="margin-left: 3px; ">操作:{{ qrForm.operator }}</div>
              </div>
            </div>
            <div style="width:150px;display: flex;flex-direction: column">
              <div
                style="display: flex;height: 20%;border-bottom:1px solid #000;justify-content: flex-start;align-items: center;text-align: left"
              >
                <div style="margin-left: 3px;">编号:{{ qrForm.wo_code }}</div>
              </div>
              <div
                style="display: flex;height: 20%;border-bottom:1px solid #000;justify-content: flex-start;align-items: center ;text-align: left"
              >
                <div style="margin-left: 3px;">产品编码:{{ qrForm.partcode }}</div>
              </div>
              <div
                style="display: flex;height: 20%;border-bottom:1px solid #000 ;justify-content: flex-start;align-items: center;text-align: left"
              >
                <div style="margin-left: 3px;">产品名称:{{ qrForm.partname }}</div>
              </div>
              <div
                style="display: flex;height: 20%;border-bottom:1px solid #000 ;justify-content: flex-start;align-items: center;text-align: left"
              >
                <div style="margin-left: 3px;">下道工序:{{ qrForm.nextstepname }}</div>
              </div>
              <div style="display: flex;height: 20%;justify-content: flex-start;align-items: center;text-align: left">
                <div style=" margin-left: 3px;">时间: {{ qrForm.operatorTime }}</div>
                <!--                <div>{{ qrForm.operatorTime?qrForm.operatorTime.substring(5):'' }}</div>-->
                <!--                <div>{{ qrForm.operatorTime }}</div>-->
              </div>
            </div>
          </div>
          <div
            v-if="printSize===5"
            style="display: flex;width: 140px;height: 80px;border: 1px solid #000;text-align: center;font-size: 10px;"
          >
@@ -1557,6 +1676,46 @@
      </span>
    </el-dialog>
    <el-dialog
      title="文件预览"
      :visible.sync="dialogVisibleCheck"
      width="800px"
      :close-on-click-modal="false"
      top="15vh"
      @closed="handleCloseCheck"
      @close="handleCloseCheck"
    >
      <el-form label-width="80px">
        <el-form-item label="文件版本">
          <el-select
            v-model="sopSelectValue"
            style="width: 200px"
            placeholder="请选择"
            filterable
            :popper-append-to-body="false"
          >
            <el-option
              v-for="item in sopSelectArr"
              :key="item.id"
              :label="item.define_name"
              :value="item.id"
            />
          </el-select>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <div class="footerButton">
          <el-button @click="dialogVisibleCancelCheck">返 回</el-button>
          <el-button
            type="primary"
            @click="dialogVisibleConfirmCheck"
          >预 览</el-button>
        </div>
      </span>
    </el-dialog>
  </div>
</template>
@@ -1565,8 +1724,8 @@
import {
  AddUpdateMesOrder,
  ClosedMesOrder,
  DeleteMesOrder, ErpOrderSearch,
  MesOrderSearch, PartSelectRoute, RouteSelectWkshop, SearchWorkStep,
  DeleteMesOrder, ErpOrderSearch, MesBadOrderSearch,
  MesOrderSearch, PartSelectRoute, RouteSelectWkshop, SearchWorkStep, SearchWorkStepSopList, SelectRouteOrWkshop,
  SelectRouteStep
} from '@/api/scgl'
import { InventoryFileAssociationRoute, PartSelect, SaveInventoryFile } from '@/api/zzmx'
@@ -1576,6 +1735,7 @@
import { urlAddRandomNo, webapp_ws_ajax_run, webapp_ws_autoupdate } from '@/utils/grwebapp'
import QRCode from 'qrcodejs2'
import $ from 'jquery'
import { SystemSopView } from '@/api/xtsz'
export default {
  name: 'GD',
@@ -1655,7 +1815,7 @@
      operation: '',
      dialogFormRules: {
        mesorderstus: [
          { required: true, message: '请选择订单状态', trigger: ['blur', 'change'] }
          { required: true, message: '请选择工单状态', trigger: ['blur', 'change'] }
        ],
        partcode: [
          { required: true, message: '请选择产品信息', trigger: ['blur', 'change'] }
@@ -1757,17 +1917,18 @@
      dialogVisibleSource: false,
      sourceTableData: [],
      sourceForm: {
        erporderstus: '', // 订单状态码
        erpordercode: '', // 订单编号
        mesordercode: '', // 工单状态码
        sourceorder: '', // 工单编号
        partcode: '', // 产品编码
        partname: '', // 产品名称
        partspec: '', // 产品规格
        creatuser: '', // 创建人员
        // paystartdate: '', // 交付时间
        paystartdate: '', // 预计开工时间
        payenddate: '', // 预计完工时间
        // paystartdate: '', // 预计开工时间
        // payenddate: '', // 预计完工时间
        createdate: '', // 创建时间
        prop: 'createdate', // 排序字段
        prop: 'lm_date', // 排序字段
        order: 'desc', // 排序字段
        page: 1, // 第几页
        rows: 20 // 每页多少条
@@ -1785,10 +1946,11 @@
      defaultroute_codeArr: '', // 默认工艺路线数组
      projectTableData: [], // 设备列表
      tableDataDetail: [], // 点击工单表的行 显示详细信息
      printSize: 1,
      printSize: 2,
      printSizeSelectArr: [// 宽*高
        { code: 0, name: '80*50' },
        { code: 1, name: '78*60' }
        { code: 1, name: '78*60' },
        { code: 2, name: '60*40' }
        // { code: 2, name: '50*60' },
        // { code: 3, name: '50*40' },
        // { code: 4, name: '50*80' },
@@ -1798,7 +1960,13 @@
        disabledDate(time) {
          return time.getTime() < Date.now() - 8.64e7
        }
      }
      },
      /* 文件预览部分*/
      dialogVisibleCheck: false,
      sopSelectArr: [], // sop下拉选项数组
      sopSelectValue: '', // sop下拉选中值
      sumbitBottonIsDisabled: false
    }
  },
  created() {
@@ -1855,7 +2023,7 @@
      const { data: res1 } = await PartSelect()
      this.partArr = res1
    },
    // 订单状态改变时
    // 工单状态改变时
    erporderstusChange(val) {
      this.form.mesorderstus = val
    },
@@ -1882,7 +2050,7 @@
      }
      this.sourceForm.order = order
      this.sourceForm.prop = prop
      this.getErpOrderSearch()
      this.getMesBadOrderSearch()
    },
    // 查询
    search() {
@@ -1906,6 +2074,20 @@
    // 单选框选中获取当前行信息
    getCurrentRow(wo_code) {
      this.radioSelected = wo_code
    },
    // 生产车间值改变时
    wkshopcodeChange(val) {
      const data = {
        partcode: this.dialogForm.partcode,
        routecode: this.dialogForm.routecode,
        wkshopcode: val
      }
      SelectRouteOrWkshop(data).then((res) => {
        // console.log(res, 1)
      }).catch(err => {
        // console.log(err, 2)
        this.sumbitBottonIsDisabled = true
      })
    },
    // 新增按钮
    async add(operation) {
@@ -1935,6 +2117,8 @@
      }
      this.dialogForm.wkshopcode = ''
      this.sumbitBottonIsDisabled = false
    },
    // 工艺路线值改变
    async routecodeChange(val) {
@@ -1946,18 +2130,34 @@
      const { data: res2 } = await RouteSelectWkshop(data)
      this.wkshopArr = res2
      this.dialogForm.wkshopcode = ''
      this.sumbitBottonIsDisabled = false
    },
    // 工序任务
    // 预览
    async check(row) {
      const { data: res } = await SearchWorkStep({ wo_code: row.wo_code })
      this.taskTableData = res
      if (this.taskTableData.length === 0) {
        return this.$message.info('无生产任务数据!')
      this.dialogVisibleCheck = true
      const data = {
        partcode: row.partcode,
        routecode: this.tableData.find(i => i.wo_code === this.radioSelected).route_code,
        stepcode: row.stepcode
      }
      this.dialogForm.mesordercode = res[0].wo_code
      this.dialogVisibleTask = true
      const { data: res } = await SearchWorkStepSopList(data)
      this.sopSelectArr = res
      this.sopSelectValue = res[0].id
    },
    // 预览关闭
    handleCloseCheck() {
      this.sopSelectValue = ''
    },
    // 预览返回
    dialogVisibleCancelCheck() {
      this.dialogVisibleCheck = false
    },
    // 预览新开浏览器页签
    async dialogVisibleConfirmCheck() {
      const { data: res } = await SystemSopView({ id: this.sopSelectValue, filepath: this.sopSelectArr.find(i => i.id === this.sopSelectValue).file_path })
      window.open(res)
    },
    dialogVisibleBack() {
      this.dialogVisibleTask = false
    },
@@ -2091,6 +2291,7 @@
      this.dialogForm.orderlev = '' // 工单等级
      this.$refs.dialogForm.clearValidate()
      this.sumbitBottonIsDisabled = false
    },
    // 对话框取消
    dialogVisibleCancel() {
@@ -2268,8 +2469,8 @@
      } else {
        new QRCode(this.$refs['qrCodeDiv' + seq], {
          text: text,
          width: size === 'big' ? 90 : 60,
          height: size === 'big' ? 90 : 60,
          width: size === 'big' ? 90 : 45,
          height: size === 'big' ? 90 : 45,
          // colorDark: '#333333', // 二维码颜色
          colorDark: '#000', // 二维码颜色
          colorLight: '#ffffff', // 二维码背景色
@@ -2322,6 +2523,10 @@
          this.$nextTick(() => {
            console.log(this.qrForm.qrvalue, 3333)
            this.bindQRCode2(this.qrForm.qrvalue)
            const div = document.getElementById('qrCode2')
            // 这么多代码只需要这一句实现我们所需要的功能,定位div滚动条位置在底部,scrollHeight计算出div的高度,再scrollTop 设置滚动条的高度为多少
            div.scrollTop = div.scrollHeight // 滚动条位于最底部
            // div.scrollTop = 0 // 滚动条位于最顶部
          })
        }
      })
@@ -2345,8 +2550,8 @@
    bindQRCode2(text) {
      new QRCode(this.$refs.qrCodeDiv2, {
        text: text,
        width: 60,
        height: 60,
        width: this.printSize !== 2 ? 60 : 55,
        height: this.printSize !== 2 ? 60 : 55,
        colorDark: '#000', // 二维码颜色
        colorLight: '#ffffff', // 二维码背景色
        correctLevel: QRCode.CorrectLevel.L// 容错率,L/M/H
@@ -2358,30 +2563,31 @@
        return this.$message.info('工单类型为报废补单情况下可选择!')
      }
      this.getErpOrderSearch()
      this.getMesBadOrderSearch()
      this.dialogVisibleSource = true
    },
    async getErpOrderSearch() {
      let tempDate2 = this.sourceForm.paystartdate
      if (tempDate2.length > 0) {
        tempDate2 = handleDatetime(tempDate2[0]) + '~' + handleDatetime(tempDate2[1])
      }
    async getMesBadOrderSearch() {
      // let tempDate2 = this.sourceForm.paystartdate
      // if (tempDate2.length > 0) {
      //   tempDate2 = handleDatetime(tempDate2[0]) + '~' + handleDatetime(tempDate2[1])
      // }
      let tempDate = this.sourceForm.payenddate
      let tempDate = this.sourceForm.createdate
      if (tempDate.length > 0) {
        tempDate = handleDatetime(tempDate[0]) + '~' + handleDatetime(tempDate[1])
      }
      const data = {
        erporderstus: this.sourceForm.erporderstus, // 订单状态码
        erpordercode: this.sourceForm.erpordercode, // 订单编号
        mesordercode: this.sourceForm.mesordercode, // 工单状态码
        sourceorder: this.sourceForm.sourceorder, // 工单编号
        partcode: this.sourceForm.partcode, // 产品编码
        partname: this.sourceForm.partname, // 产品名称
        partspec: this.sourceForm.partspec, // 产品规格
        paystartdate: tempDate2, // 交付时间
        payenddate: tempDate, // 交付时间
        // paystartdate: tempDate2, // 交付时间
        // payenddate: tempDate, // 交付时间
        creatuser: this.sourceForm.creatuser, // 创建人员
        createdate: tempDate, // 创建时间
        prop: this.sourceForm.prop, // 排序字段
        order: this.sourceForm.order, // 排序字段
@@ -2390,16 +2596,17 @@
      }
      const res = await ErpOrderSearch(data)
      this.sourceTableData = res.data.filter(item => item.status !== 'NEW')
      const res = await MesBadOrderSearch(data)
      this.sourceTableData = res.data
      this.sourceFormTotal = res.count
    },
    // 单选框选中获取当前行信息
    getCurrentRowSource(id) {
      this.radioSelectedId = id
    getCurrentRowSource(row, event, column) {
      this.radioSelectedId = row.id
      this.dialogForm.mesqty = row.bad_qty
    },
    sourceSearch() {
      this.getErpOrderSearch()
      this.getMesBadOrderSearch()
    },
    sourceReset() {
      this.sourceForm.erporderstus = ''
@@ -2411,7 +2618,7 @@
      this.sourceForm.payenddate = ''
      this.sourceForm.creatuser = ''
      this.sourceForm.createdate = ''
      this.getErpOrderSearch()
      this.getMesBadOrderSearch()
    },
    dialogVisibleSourceClose() {
      this.radioSelectedId = ''
@@ -2436,7 +2643,7 @@
      console.log(this.radioSelectedId)
      this.sourceTableData.forEach(item => {
        if (item.id === this.radioSelectedId) {
          this.dialogForm.sourceorder = item.wo
          this.dialogForm.sourceorder = item.wo_code
          this.dialogForm.partcode = item.partcode
          this.dialogForm.partspec = item.partspec
        }