loulijun2021
2022-07-15 6caecd26f75979777956dc96e14d6f3b39ce6688
src/views/scgl/sckbg.vue
@@ -2,11 +2,11 @@
  <div>
    <div class="body" style="padding: 0;height: 100%" :style="{height:mainHeight+'px'}">
      <el-tabs ref="elTabs" type="border-card" @tab-click="tabClick">
      <el-tabs ref="elTabs" v-model="activeName" type="border-card" @tab-click="tabClick">
        <el-tab-pane label="生产列表">
          <div style="margin-left: 10px;margin-top:10px;display: flex;justify-content: space-between">
            <div style="display: flex;align-items: center">
              <div style="width: 70px">扫码:</div>
              <div style="width: 90px">扫描条码:</div>
              <el-input
                v-model="form.orderstepqrcode"
                oninput="value=value.replace(/[^0-9a-zA-Z;_]/g,'')"
@@ -163,7 +163,7 @@
                  :value="item.code"
                />
              </el-select>
              <div style="width: 70px;margin-left: 20px">扫码:</div>
              <div style="width: 90px;margin-left: 20px">扫描条码:</div>
              <el-input
                v-model="WXform.orderstepqrcode"
                oninput="value=value.replace(/[^0-9a-zA-Z;_]/g,'')"
@@ -303,7 +303,88 @@
            @pagination="getMesOrderStepSearch"
          />
        </el-tab-pane>
        <el-tab-pane v-if="false" label="工序检验">
          <div style="margin-left: 10px;margin-top:10px;display: flex;flex-direction: column">
            <div style="margin-bottom: 10px;font-size: 14px">
              <i class="el-icon-s-operation" style="color:#42b983; margin-right: 5px" />扫码信息
            </div>
            <div style="display: flex;align-items: center">
              <div style="width: 90px">扫描条码:</div>
              <el-input
                v-model="GXform.orderstepqrcode"
                oninput="value=value.replace(/[^0-9a-zA-Z;_]/g,'')"
                name="GXproduceCode"
                style="width: 300px"
                @keyup.enter.native="val=>enterNative(val,'GXproduceCode')"
              />
            </div>
            <div style="line-height: 40px; display: flex;margin-top: 20px">
              <div style="display: flex;margin-right: 50px">
                <div style="width: 90px">工单编码:</div>
                <div>PX00120012312</div>
              </div>
              <div style="display: flex;">
                <div style="width: 90px">产品编码:</div>
                <div>123-446-789</div>
              </div>
            </div>
            <div style="line-height: 40px; display: flex;">
              <div style="display: flex;margin-right: 50px">
                <div style="width: 90px">产品名称:</div>
                <div>PX00120012312</div>
              </div>
              <div style="display: flex;">
                <div style="width: 90px">产品规格:</div>
                <div>123-446-789</div>
              </div>
            </div>
            <div style="line-height: 40px; display: flex;">
              <div style="display: flex;margin-right: 50px">
                <div style="width: 90px">工序编码:</div>
                <div>PX00120012312</div>
              </div>
              <div style="display: flex;">
                <div style="width: 90px">工序名称:</div>
                <div>123-446-789</div>
              </div>
            </div>
            <div style="margin: 20px 0;font-size: 14px">
              <i class="el-icon-s-operation" style="color:#42b983; margin-right: 5px" />检验标准信息
            </div>
            <div style="display: flex;align-items: center">
              <div style="width: 90px">检验标准:</div>
              <el-select
                v-model="dialogForm.aaa"
                style="width: 200px;"
                placeholder="请选择"
              >
                <el-option
                  v-for="item in ARR"
                  :key="item.code"
                  :label="item.name"
                  :value="item.code"
                />
              </el-select>
              <div style="width: 90px;margin-left: 50px;">检验标准:</div>
              <el-select
                v-model="dialogForm.aaa"
                style="width: 200px;"
                placeholder="请选择"
              >
                <el-option
                  v-for="item in ARR"
                  :key="item.code"
                  :label="item.name"
                  :value="item.code"
                />
              </el-select>
            </div>
            <div style="margin: 20px 0;font-size: 14px">
              <i class="el-icon-s-operation" style="color:#42b983; margin-right: 5px" />检验项信息
            </div>
          </div>
        </el-tab-pane>
      </el-tabs>
    </div>
@@ -649,8 +730,6 @@
<script>
import Pagination from '@/components/Pagination'
import { AddUpdateOrganization, DeleteOrganization, OrganizationSearch, PrentOrganization } from '@/api/jcsz'
import { getCookie } from '@/utils/auth'
import $ from 'jquery'
import {
  MesOrderGroupSelectUser,
@@ -667,8 +746,7 @@
  SavaMesOrderStepStart,
  SavaMesOrderStepReport
} from '@/api/scgl'
import { urlAddRandomNo, webapp_ws_ajax_run } from '@/utils/grwebapp'
import { MesOrderPrintSearch1 } from '@/api/utils'
import { urlAddRandomNo, webapp_urlprotocol_startup, webapp_ws_ajax_run, webapp_ws_autoupdate } from '@/utils/grwebapp'
const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
@@ -712,9 +790,8 @@
      total: 10,
      tableData: [],
      WXform: { // 外协表单
        // PO202206280001_4;Step01
        orderstepqrcode: '', // 扫描的二维码信息
        prop: 'wo_code', // 排序字段
        prop: 'wo_code', // 排序字段z
        order: 'asc', // 排序字段
        page: 1, // 第几页
        rows: 20 // 每页多少条
@@ -774,7 +851,6 @@
      UserTotal: 0,
      Userform: {},
      userIsSave: false, // 此人员是否可保持
      // operation: '',
      dialogFormRules: {
        outuser: [
          { required: true, message: '请选择发料人员', trigger: ['blur', 'change'] }
@@ -806,6 +882,14 @@
        startqty: [
          { required: true, message: '请输入报工数量', trigger: ['blur', 'change'] }
        ]
      },
      activeName: '',
      GXform: { // 工序
        orderstepqrcode: '' // 扫描的二维码信息
        // prop: 'wo_code', // 排序字段z
        // order: 'asc', // 排序字段
        // page: 1, // 第几页
        // rows: 20 // 每页多少条
      }
    }
@@ -821,6 +905,8 @@
    this.$nextTick(() => {
      $("input[name='produceCode']")[0].focus()
    })
    // webapp_urlprotocol_startup()
    webapp_ws_autoupdate(true)
  },
  methods: {
    async getMesOrderStepSearch() {
@@ -887,6 +973,11 @@
          // this.form.orderstepqrcode = ''
        })
      }
      if (this.$refs.elTabs.currentName === '2') {
        this.$nextTick(() => {
          $("input[name='GXproduceCode']")[0].focus()
        })
      }
    },
    // 扫码键盘回车事件
    async enterNative(val, belong) {
@@ -897,12 +988,12 @@
      // 收料:code="200"  count=3
      // 走列表形式 code="200"  count=4
      if (belong === 'produceCode') {
        const orderstepqrcode = this.form.orderstepqrcode
        const data = {
          OperType: 'ZZ',
          orderstepqrcode: this.form.orderstepqrcode,
          orderstepqrcode: orderstepqrcode,
          SelectType: ''
        }
        console.log(this.form.orderstepqrcode, 21)
        const res = await MesOrderStepStart(data)
        if (res.code === '200' && res.count === 0) {
          await this.ZZstart(res.data)
@@ -912,9 +1003,10 @@
        }
      }
      if (belong === 'WXproduceCode') {
        const orderstepqrcode = this.WXform.orderstepqrcode
        const data = {
          OperType: 'WX',
          orderstepqrcode: this.WXform.orderstepqrcode,
          orderstepqrcode: orderstepqrcode,
          SelectType: this.WXSelected// OUT、IN
        }
        const res = await MesOrderStepStart(data)
@@ -924,6 +1016,10 @@
        if (res.code === '200' && res.count === 3) {
          await this.WXback(res.data)
        }
      }
      if (belong === 'GXproduceCode') {
        console.log('GXproduceCode')
      }
    },
    // 查询
@@ -1245,12 +1341,12 @@
              inuser: this.dialogForm.inuser, // 发料人员
              taskqty: this.dialogForm.planqty, // 任务数量
              sqty: this.dialogForm.sqty, // 收料数量
              ngqty: this.dialogForm.noputqty, // 不良数量
              ngqty: this.dialogForm.noputqty === '' ? 0 : this.dialogForm.noputqty, // 不良数量
              badcode: this.dialogForm.badcode.length < 1 ? '' : this.dialogForm.badcode.join(';')// 不良原因
            }
            SavaMesOrderStepIn(data).then(res => {
              if (res.code === '200') {
                // this.WXprint()
                this.WXprint()
                this.$message.success('收料成功!')
                this.dialogVisible = false
                this.tabClick()
@@ -1272,7 +1368,6 @@
            }
            SavaMesOrderStepStart(data).then(res => {
              if (res.code === '200') {
                // this.WXprint()
                this.$message.success('开工成功!')
                this.dialogVisible = false
                this.tabClick()
@@ -1310,12 +1405,12 @@
              startqty: this.dialogForm.reportqty, // 开工数量
              // reportqty: this.dialogForm.reportqty, // 报工数量
              reportqty: this.dialogForm.startqty, // 报工数量
              ngqty: this.dialogForm.noputqty, // 不良数量
              ngqty: this.dialogForm.noputqty === '' ? 0 : this.dialogForm.noputqty, // 不良数量
              badcode: this.dialogForm.badcode.length < 1 ? '' : this.dialogForm.badcode.join(';')// 不良原因
            }
            SavaMesOrderStepReport(data).then(res => {
              if (res.code === '200') {
                // this.ZZprint()
                this.ZZprint()
                this.$message.success('报工成功!')
                this.dialogVisible = false
                this.tabClick()