loulijun2021
2022-12-20 b58dc818feacbfc6bf01453b0db8ad3306c8d6dd
src/views/scgl/sckbg.vue
@@ -31,6 +31,8 @@
          <el-divider />
          <div class="elTableDiv">
            <el-table
              ref="tableDataRef"
              class="tableFixed"
              :data="tableData"
              :height="isIpad? (tableHeight+50):tableHeight"
              border
@@ -49,6 +51,7 @@
              />
              <el-table-column
                prop="status"
                show-tooltip-when-overflow
                label="状态"
                sortable="custom"
                width="80"
@@ -72,6 +75,7 @@
                label="产品编码"
                min-width="110"
                sortable="custom"
                show-tooltip-when-overflow
              />
              <el-table-column
                prop="partname"
@@ -103,10 +107,12 @@
                label="任务数量"
                width="110"
                sortable="custom"
                show-tooltip-when-overflow
              />
              <el-table-column
                label="未报工数量"
                width="120"
                show-tooltip-when-overflow
              >
                <!--                sortable="custom"-->
                <template slot-scope="{row}">
@@ -115,6 +121,7 @@
              </el-table-column>
              <el-table-column
                prop="good_qty"
                show-tooltip-when-overflow
                label="已报工数量"
                sortable="custom"
                width="160"
@@ -122,6 +129,7 @@
              <el-table-column
                prop="ng_qty"
                label="不良数量"
                show-tooltip-when-overflow
                width="150"
                sortable="custom"
              />
@@ -129,16 +137,18 @@
                prop="bad_qty"
                label="已报废数量"
                width="120"
                show-tooltip-when-overflow
                sortable="custom"
              />
              <el-table-column
                prop="plan_startdate"
                label="计划开工日期"
                show-tooltip-when-overflow
                width="150"
                sortable="custom"
              >
                <template slot-scope="{row}">
                  <div v-if="row.plan_startdate">{{ row.plan_startdate.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>
@@ -147,10 +157,11 @@
                label="计划完工日期"
                width="150"
                sortable="custom"
                show-tooltip-when-overflow
                fixed="right"
              >
                <template slot-scope="{row}">
                  <div v-if="row.plan_startdate">{{ row.plan_startdate.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>
@@ -220,6 +231,8 @@
          <el-divider />
          <div class="elTableDiv">
            <el-table
              ref="tableDataRef"
              class="tableFixed"
              :data="WXtableData"
              :height="isIpad? (tableHeight+50):tableHeight"
              border
@@ -239,6 +252,7 @@
              <el-table-column
                prop="status"
                label="状态"
                show-tooltip-when-overflow
                sortable="custom"
                width="80"
              >
@@ -259,6 +273,7 @@
              <el-table-column
                prop="partcode"
                label="产品编码"
                show-tooltip-when-overflow
                width="110"
                sortable="custom"
              />
@@ -273,6 +288,7 @@
                prop="stepname"
                label="工序"
                width="120"
                show-tooltip-when-overflow
                sortable="custom"
              />
              <!--              <el-table-column-->
@@ -289,12 +305,14 @@
              <el-table-column
                prop="plan_qty"
                label="任务数量"
                show-tooltip-when-overflow
                width="110"
                sortable="custom"
              />
              <el-table-column
                label="未报工数量"
                label="未收料数量"
                width="120"
                show-tooltip-when-overflow
              >
                <!--                sortable="custom"-->
                <template slot-scope="{row}">
@@ -304,12 +322,14 @@
              <el-table-column
                prop="good_qty"
                label="已收料数量"
                show-tooltip-when-overflow
                sortable="custom"
                width="160"
              />
              <el-table-column
                prop="ng_qty"
                label="不良数量"
                show-tooltip-when-overflow
                width="150"
                sortable="custom"
              />
@@ -318,27 +338,30 @@
                label="已报废数量"
                min-width="120"
                sortable="custom"
                show-tooltip-when-overflow
              />
              <el-table-column
                prop="plan_startdate"
                label="计划开工日期"
                show-tooltip-when-overflow
                width="150"
                sortable="custom"
              >
                <template slot-scope="{row}">
                  <div v-if="row.plan_startdate">{{ row.plan_startdate.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="plan_enddate"
                label="计划完工日期"
                show-tooltip-when-overflow
                width="150"
                sortable="custom"
                fixed="right"
              >
                <template slot-scope="{row}">
                  <div v-if="row.plan_startdate">{{ row.plan_startdate.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>
@@ -386,6 +409,8 @@
          <el-divider />
          <div class="elTableDiv">
            <el-table
              ref="tableDataRef"
              class="tableFixed"
              :data="badTableData"
              :height="isIpad? (tableHeight+50):tableHeight"
              border
@@ -403,18 +428,21 @@
                fixed
              />
              <el-table-column
                show-tooltip-when-overflow
                prop="wo_code"
                label="工单号"
                min-width="160"
                sortable="custom"
              />
              <el-table-column
                show-tooltip-when-overflow
                prop="partcode"
                label="产品编码"
                min-width="110"
                sortable="custom"
              />
              <el-table-column
                show-tooltip-when-overflow
                prop="partname"
                min-width="160"
                label="产品名称"
@@ -423,6 +451,7 @@
              <el-table-column
                prop="stepname"
                label="工序"
                show-tooltip-when-overflow
                min-width="120"
                sortable="custom"
              />
@@ -430,6 +459,7 @@
                prop="plan_qty"
                label="任务数量"
                width="110"
                show-tooltip-when-overflow
                sortable="custom"
              />
              <el-table-column
@@ -437,11 +467,13 @@
                label="已报工数量"
                sortable="custom"
                min-width="160"
                show-tooltip-when-overflow
              />
              <el-table-column
                prop="ng_qty"
                label="不良数量"
                width="150"
                show-tooltip-when-overflow
                sortable="custom"
              />
              <el-table-column
@@ -449,6 +481,7 @@
                label="已报废数量"
                width="120"
                sortable="custom"
                show-tooltip-when-overflow
              />
              <el-table-column
                label="操作"
@@ -600,6 +633,7 @@
            placeholder="请选择"
            :disabled="parseFloat(dialogForm.noputqty)===0||dialogForm.noputqty.trim()===''"
            multiple
            collapse-tags
          >
            <el-option
              v-for="item in badArr"
@@ -633,8 +667,10 @@
          <i class="el-icon-s-operation" style="color:#42b983;" /> 人员列表
          <el-button type="primary" style="margin: 10px 0" @click="userAdd">增行</el-button>
          <el-table
            ref="userTableDataRef"
            :data="userTableData"
            border
            class="tableFixed"
            :row-class-name="tableRowClassName"
            :header-cell-style="this.$headerCellStyle"
            :cell-style="this.$cellStyle"
@@ -651,6 +687,7 @@
            <el-table-column
              prop="username"
              label="人员名称"
              show-tooltip-when-overflow
            >
              <template slot-scope="{row}">
                <div v-if="row.isVisible===0">{{ row.username }}</div>
@@ -815,6 +852,7 @@
            v-model="dialogForm.badcode"
            style="width: 200px;"
            multiple
            collapse-tags
            :disabled="parseFloat(dialogForm.noputqty)===0||dialogForm.noputqty.trim()===''"
            placeholder="请选择"
          >
@@ -847,10 +885,48 @@
      <span slot="footer" class="dialog-footer">
        <div class="footerButton">
          <el-button @click="dialogVisibleCancel">取 消</el-button>
          <el-button v-if="dialogTitle==='自制开始'" type="primary" @click="dialogVisibleConfirm">开 工</el-button>
          <el-button v-if="dialogTitle==='自制报工'" type="primary" @click="dialogVisibleConfirm">提交/打印</el-button>
          <el-button v-if="dialogTitle==='外协发料'" type="primary" @click="dialogVisibleConfirm">发料</el-button>
          <el-button v-if="dialogTitle==='外协收料'" type="primary" @click="dialogVisibleConfirm">收料/打印</el-button>
          <el-button
            v-if="dialogTitle==='自制开始'"
            :loading="$store.state.app.buttonIsDisabled"
            :disabled="$store.state.app.buttonIsDisabled"
            type="primary"
            @click="dialogVisibleConfirm"
          >开 工</el-button>
          <el-button
            v-if="dialogTitle==='自制报工'&&dialogForm.nextstepname===''"
            :loading="$store.state.app.buttonIsDisabled"
            :disabled="$store.state.app.buttonIsDisabled"
            type="primary"
            @click="dialogVisibleConfirm"
          >提交/打印</el-button>
          <el-button
            v-if="dialogTitle==='自制报工'&&dialogForm.nextstepname!==''"
            :loading="$store.state.app.buttonIsDisabled"
            :disabled="$store.state.app.buttonIsDisabled"
            type="primary"
            @click="dialogVisibleConfirm"
          >提交</el-button>
          <el-button
            v-if="dialogTitle==='外协发料'"
            :loading="$store.state.app.buttonIsDisabled"
            :disabled="$store.state.app.buttonIsDisabled"
            type="primary"
            @click="dialogVisibleConfirm"
          >发料</el-button>
          <el-button
            v-if="dialogTitle==='外协收料'&&dialogForm.nextstepname===''"
            :loading="$store.state.app.buttonIsDisabled"
            :disabled="$store.state.app.buttonIsDisabled"
            type="primary"
            @click="dialogVisibleConfirm"
          >收料/打印</el-button>
          <el-button
            v-if="dialogTitle==='外协收料'&&dialogForm.nextstepname!==''"
            :loading="$store.state.app.buttonIsDisabled"
            :disabled="$store.state.app.buttonIsDisabled"
            type="primary"
            @click="dialogVisibleConfirm"
          >收料</el-button>
        </div>
      </span>
    </el-dialog>
@@ -877,7 +953,9 @@
            >
              <div id="qrCode2" ref="qrCodeDiv2" style="overflow-y: hidden;height:60px;position: absolute;left: 14px;" />
            </div>
            <div style="display: flex;height: 30px;justify-content: flex-start;border-bottom:1px solid #000;align-items: center">
            <div
              style="display: flex;height: 30px;justify-content: flex-start;border-bottom:1px solid #000;align-items: center"
            >
              <div style="margin-left: 5px;width: 28px">数量:</div>
              {{ qrForm.startqty }}
            </div>
@@ -1088,7 +1166,12 @@
      <span slot="footer" class="dialog-footer">
        <div class="footerButton">
          <el-button @click="badDialogVisibleCancel">取 消</el-button>
          <el-button type="primary" @click="badDialogVisibleConfirm ">保 存/打 印</el-button>
          <el-button
            type="primary"
            :loading="$store.state.app.buttonIsDisabled"
            :disabled="$store.state.app.buttonIsDisabled"
            @click="badDialogVisibleConfirm "
          >保 存/打 印</el-button>
        </div>
      </span>
    </el-dialog>
@@ -1308,7 +1391,7 @@
      OperationArr: [], // 人员数组
      sendButtonIsDisabled: false, // 下达按钮是否可点击
      judgeIsScanningArr: [], // 判断是否扫码数组
      countJudgeIsScanningInput: 0// 判断扫码框的个数
      countJudgeIsScanningInput: 0 // 判断扫码框的个数
    }
  },
  watch: {
@@ -1776,9 +1859,14 @@
      })
      this.ZZuserArr = [...this.ZZuserArr].filter(x => [...this.userTableData].every(y => y.usercode !== x.usercode))
      this.$refs.tableDataRef.doLayout()
    },
    // 用户添加
    userAdd() {
      if (this.userTableData.find(i => i.isVisible === 1)) {
        return this.$message.info('请先保存当前行信息!')
      }
      let number = Math.random() * Math.random()// 作为删除时的标识符
      number = number === 0 ? (10 + Math.random()) : number
      console.log(this.userTableData, 6)
@@ -1909,11 +1997,13 @@
              taskqty: this.dialogForm.planqty, // 任务数量
              fqty: this.dialogForm.fqty // 发料数量
            }
            this.$store.state.app.buttonIsDisabled = true
            SavaMesOrderStepOut(data).then(res => {
              if (res.code === '200') {
                this.$message.success('发料成功!')
                this.dialogVisible = false
                this.$message.success('发料成功!')
                this.tabClick()
                this.$store.state.app.buttonIsDisabled = false
              } else {
                this.$message.error('发料失败!')
              }
@@ -1944,16 +2034,17 @@
              ngqty: this.dialogForm.noputqty === '' ? 0 : this.dialogForm.noputqty, // 不良数量
              badcode: this.dialogForm.badcode.length < 1 ? '' : this.dialogForm.badcode.join(';')// 不良原因
            }
            this.$store.state.app.buttonIsDisabled = true
            SavaMesOrderStepIn(data).then(res => {
              if (res.code === '200') {
                this.dialogVisible = false
                this.$message.success('收料成功!')
                if (this.dialogForm.nextstepcode === '') {
                  this.WXprint2(this.OperationArr.find(item => item.usercode === this.dialogForm.inuser).username)
                  this.dialogVisible2 = true
                }
                this.dialogVisible = false
                this.tabClick()
                this.$store.state.app.buttonIsDisabled = false
              } else {
                this.$message.error('收料失败!')
              }
@@ -1970,11 +2061,13 @@
              taskqty: this.dialogForm.planqty, // 任务数量
              startqty: this.dialogForm.startqty// 开始数量
            }
            this.$store.state.app.buttonIsDisabled = true
            SavaMesOrderStepStart(data).then(res => {
              if (res.code === '200') {
                this.$message.success('开工成功!')
                this.dialogVisible = false
                this.$message.success('开工成功!')
                this.tabClick()
                this.$store.state.app.buttonIsDisabled = false
              } else {
                this.$message.error('开工失败!')
              }
@@ -2019,17 +2112,17 @@
              ngqty: this.dialogForm.noputqty === '' ? 0 : this.dialogForm.noputqty, // 不良数量
              badcode: this.dialogForm.badcode.length < 1 ? '' : this.dialogForm.badcode.join(';')// 不良原因
            }
            this.$store.state.app.buttonIsDisabled = true
            SavaMesOrderStepReport(data).then(res => {
              if (res.code === '200') {
                this.dialogVisible = false
                this.$message.success('报工成功!')
                if (this.dialogForm.nextstepcode === '') {
                  this.ZZprint2(this.OperationArr.find(item => item.usercode === this.dialogForm.operation).username)
                  this.dialogVisible2 = true
                }
                this.dialogVisible = false
                this.tabClick()
                this.$store.state.app.buttonIsDisabled = false
              } else {
                this.$message.error('报工失败!')
              }
@@ -2098,6 +2191,7 @@
        if (window.innerHeight < 769) {
          this.tableHeight = this.tableHeight - 50
        }
        this.$refs.tableDataRef.doLayout()
      })
    },
@@ -2114,13 +2208,16 @@
      const data = {
        Data: this.badTableDataDialog
      }
      this.$store.state.app.buttonIsDisabled = true
      EditOrderNgStepSeave(data, this.badDialogForm.operation).then(res => {
        if (res.code === '200' || res.code === '301') {
          this.getBadList()
          this.badDialogVisible = false
          this.badPrint(this.OperationArr.find(item => item.usercode === this.badDialogForm.operation).username)
          this.dialogVisible2 = true
          return this.$message.success('保存成功!')
          this.$message.success('保存成功!')
          this.$store.state.app.buttonIsDisabled = false
        }
      })
    },
@@ -2133,7 +2230,7 @@
      this.qrForm.nextstepname = this.badDialogForm.nextstepname
      this.qrForm.operator = username
      this.qrForm.operatorTime = handleDatetime2(new Date())
      console.log(this.qrForm, 22)
      this.$nextTick(() => {
        this.bindQRCode(this.qrForm.qrvalue)
      })
@@ -2145,7 +2242,7 @@
      this.badTableDataDialog = []
      this.judgeIsScanningArr = []
    },
    async  getMesOrderSelectUserAll() {
    async getMesOrderSelectUserAll() {
      const { data: res } = await MesOrderSelectUser({ usercode: '' })
      this.OperationArr = res
    },
@@ -2428,6 +2525,15 @@
  margin-bottom: 0;
}
.tableFixed {
  ::v-deep .el-table__fixed-right {
    height: 100% !important;
  }
  ::v-deep .el-table__fixed {
    height: 100% !important;
  }
}
</style>
<style>