loulijun2021
2023-02-14 b46bc2dba51a3885a68e4c58316b41a31ea16bb2
src/views/scgl/sckbg.vue
@@ -18,11 +18,11 @@
            </div>
            <div v-if="false" style="display: flex;padding-right: 10px">
              <el-button @click="ZZstart">
              <el-button v-waves @click="ZZstart">
                <svg-icon icon-class="start_time" style="margin-right: 2px" />
                开始
              </el-button>
              <el-button @click="ZZreport">
              <el-button v-waves @click="ZZreport">
                <svg-icon icon-class="report_work" style="margin-right: 2px" />
                报工
              </el-button>
@@ -51,6 +51,7 @@
              />
              <el-table-column
                prop="status"
                show-tooltip-when-overflow
                label="状态"
                sortable="custom"
                width="80"
@@ -60,6 +61,8 @@
                  <div v-if="row.status==='ALLO'">已派发</div>
                  <div v-if="row.status==='START'">开工</div>
                  <div v-if="row.status==='CLOSED'">完工</div>
                  <div v-if="row.status==='NOSCHED'">待排程</div>
                  <div v-if="row.status==='SCHED'">已排程</div>
                </template>
              </el-table-column>
              <el-table-column
@@ -74,6 +77,7 @@
                label="产品编码"
                min-width="110"
                sortable="custom"
                show-tooltip-when-overflow
              />
              <el-table-column
                prop="partname"
@@ -105,10 +109,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}">
@@ -117,6 +123,7 @@
              </el-table-column>
              <el-table-column
                prop="good_qty"
                show-tooltip-when-overflow
                label="已报工数量"
                sortable="custom"
                width="160"
@@ -124,6 +131,7 @@
              <el-table-column
                prop="ng_qty"
                label="不良数量"
                show-tooltip-when-overflow
                width="150"
                sortable="custom"
              />
@@ -131,11 +139,13 @@
                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"
              >
@@ -149,6 +159,7 @@
                label="计划完工日期"
                width="150"
                sortable="custom"
                show-tooltip-when-overflow
                fixed="right"
              >
                <template slot-scope="{row}">
@@ -163,8 +174,8 @@
              <!--              >-->
              <!--                <template slot-scope="{row}">-->
              <!--                  <div class="operationClass">-->
              <!--                    <el-button type="text" @click="edit('edit',row)">编辑</el-button>-->
              <!--                    <el-button type="text" @click="del(row)">删除</el-button>-->
              <!--                    <el-button v-waves type="text" @click="edit('edit',row)">编辑</el-button>-->
              <!--                    <el-button v-waves type="text" @click="del(row)">删除</el-button>-->
              <!--                  </div>-->
              <!--                </template>-->
              <!--              </el-table-column>-->
@@ -209,11 +220,11 @@
            </div>
            <div v-if="false" style="display: flex;padding-right: 10px">
              <el-button @click="WXsend">
              <el-button v-waves @click="WXsend">
                <svg-icon icon-class="start_time" style="margin-right: 2px" />
                发料
              </el-button>
              <el-button @click="WXback">
              <el-button v-waves @click="WXback">
                <svg-icon icon-class="report_work" style="margin-right: 2px" />
                收料
              </el-button>
@@ -243,6 +254,7 @@
              <el-table-column
                prop="status"
                label="状态"
                show-tooltip-when-overflow
                sortable="custom"
                width="80"
              >
@@ -263,6 +275,7 @@
              <el-table-column
                prop="partcode"
                label="产品编码"
                show-tooltip-when-overflow
                width="110"
                sortable="custom"
              />
@@ -277,6 +290,7 @@
                prop="stepname"
                label="工序"
                width="120"
                show-tooltip-when-overflow
                sortable="custom"
              />
              <!--              <el-table-column-->
@@ -293,12 +307,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}">
@@ -308,12 +324,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"
              />
@@ -322,10 +340,12 @@
                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"
              >
@@ -337,6 +357,7 @@
              <el-table-column
                prop="plan_enddate"
                label="计划完工日期"
                show-tooltip-when-overflow
                width="150"
                sortable="custom"
                fixed="right"
@@ -353,8 +374,8 @@
              <!--              >-->
              <!--                <template slot-scope="{row}">-->
              <!--                  <div class="operationClass">-->
              <!--                    <el-button type="text" @click="edit('edit',row)">编辑</el-button>-->
              <!--                    <el-button type="text" @click="del(row)">删除</el-button>-->
              <!--                    <el-button v-waves type="text" @click="edit('edit',row)">编辑</el-button>-->
              <!--                    <el-button v-waves type="text" @click="del(row)">删除</el-button>-->
              <!--                  </div>-->
              <!--                </template>-->
              <!--              </el-table-column>-->
@@ -409,18 +430,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="产品名称"
@@ -429,6 +453,7 @@
              <el-table-column
                prop="stepname"
                label="工序"
                show-tooltip-when-overflow
                min-width="120"
                sortable="custom"
              />
@@ -436,6 +461,7 @@
                prop="plan_qty"
                label="任务数量"
                width="110"
                show-tooltip-when-overflow
                sortable="custom"
              />
              <el-table-column
@@ -443,11 +469,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
@@ -455,6 +483,7 @@
                label="已报废数量"
                width="120"
                sortable="custom"
                show-tooltip-when-overflow
              />
              <el-table-column
                label="操作"
@@ -463,7 +492,7 @@
              >
                <template slot-scope="{row}">
                  <div class="operationClass">
                    <el-button type="text" @click="repairHandle(row)">维修处理</el-button>
                    <el-button v-waves type="text" @click="repairHandle(row)">维修处理</el-button>
                  </div>
                </template>
              </el-table-column>
@@ -486,6 +515,7 @@
    </div>
    <el-dialog
      v-el-drag-dialog
      :title="dialogTitle"
      :visible.sync="dialogVisible"
      width="850px"
@@ -637,8 +667,8 @@
          <el-input v-model="dialogForm.remarks" type="textarea" style="width: 200px;" />
        </el-form-item>
        <div v-if="dialogTitle==='自制报工'">
          <i class="el-icon-s-operation" style="color:#42b983;" /> 人员列表
          <el-button type="primary" style="margin: 10px 0" @click="userAdd">增行</el-button>
          <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" /> 人员列表
          <el-button v-waves type="primary" style="margin: 10px 0" @click="userAdd">增行</el-button>
          <el-table
            ref="userTableDataRef"
            :data="userTableData"
@@ -660,6 +690,7 @@
            <el-table-column
              prop="username"
              label="人员名称"
              show-tooltip-when-overflow
            >
              <template slot-scope="{row}">
                <div v-if="row.isVisible===0">{{ row.username }}</div>
@@ -686,9 +717,9 @@
            >
              <template slot-scope="{row}">
                <div class="operationClass">
                  <el-button v-if="row.isVisible===0" type="text" @click="userDel(row)">删除</el-button>
                  <el-button v-if="row.isVisible===1&&!userIsSave" type="text" @click="userSave(row)">保存</el-button>
                  <el-button v-if="row.isVisible===1" type="text" @click="userCancel(row)">取消</el-button>
                  <el-button v-if="row.isVisible===0" v-waves type="text" @click="userDel(row)">删除</el-button>
                  <el-button v-if="row.isVisible===1&&!userIsSave" v-waves type="text" @click="userSave(row)">保存</el-button>
                  <el-button v-if="row.isVisible===1" v-waves type="text" @click="userCancel(row)">取消</el-button>
                </div>
              </template>
            </el-table-column>
@@ -856,17 +887,62 @@
      </el-form>
      <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-waves @click="dialogVisibleCancel">取 消</el-button>
          <el-button
            v-if="dialogTitle==='自制开始'"
            v-waves
            :loading="$store.state.app.buttonIsDisabled"
            :disabled="$store.state.app.buttonIsDisabled"
            type="primary"
            @click="dialogVisibleConfirm"
          >开 工</el-button>
          <el-button
            v-if="dialogTitle==='自制报工'&&dialogForm.nextstepname===''"
            v-waves
            :loading="$store.state.app.buttonIsDisabled"
            :disabled="$store.state.app.buttonIsDisabled"
            type="primary"
            @click="dialogVisibleConfirm"
          >提交/打印</el-button>
          <el-button
            v-if="dialogTitle==='自制报工'&&dialogForm.nextstepname!==''"
            v-waves
            :loading="$store.state.app.buttonIsDisabled"
            :disabled="$store.state.app.buttonIsDisabled"
            type="primary"
            @click="dialogVisibleConfirm"
          >提交</el-button>
          <el-button
            v-if="dialogTitle==='外协发料'"
            v-waves
            :loading="$store.state.app.buttonIsDisabled"
            :disabled="$store.state.app.buttonIsDisabled"
            type="primary"
            @click="dialogVisibleConfirm"
          >发料</el-button>
          <el-button
            v-if="dialogTitle==='外协收料'&&dialogForm.nextstepname===''"
            v-waves
            :loading="$store.state.app.buttonIsDisabled"
            :disabled="$store.state.app.buttonIsDisabled"
            type="primary"
            @click="dialogVisibleConfirm"
          >收料/打印</el-button>
          <el-button
            v-if="dialogTitle==='外协收料'&&dialogForm.nextstepname!==''"
            v-waves
            :loading="$store.state.app.buttonIsDisabled"
            :disabled="$store.state.app.buttonIsDisabled"
            type="primary"
            @click="dialogVisibleConfirm"
          >收料</el-button>
        </div>
      </span>
    </el-dialog>
    <!--打印预览页面  小标签-->
    <el-dialog
      v-el-drag-dialog
      title="预览"
      :visible.sync="dialogVisible2"
      width="1140"
@@ -935,14 +1011,15 @@
      </div>
      <span slot="footer" class="dialog-footer">
        <div class="footerButton">
          <el-button @click="dialogVisible2 = false">取 消</el-button>
          <el-button v-print="printObj2" type="primary">确 定</el-button>
          <el-button v-waves @click="dialogVisible2 = false">取 消</el-button>
          <el-button v-waves v-print="printObj2" type="primary">确 定</el-button>
        </div>
      </span>
    </el-dialog>
    <!--    不良处理列表对话框-->
    <el-dialog
      v-el-drag-dialog
      title="维修处理"
      :visible.sync="badDialogVisible"
      width="990px"
@@ -1002,7 +1079,7 @@
      </el-form>
      <div style="margin-bottom:20px">
        <i class="el-icon-s-operation" style="color:#42b983;" /> 不良信息明细:
        <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" /> 不良信息明细:
      </div>
      <div class="elTableDiv">
        <el-table
@@ -1086,11 +1163,11 @@
          >
            <template slot-scope="{row}">
              <div class="operationClass">
                <el-button v-if="row.isVisible===0" type="text" @click="badEdit(row)">编辑</el-button>
                <el-button v-if="row.isVisible===0" type="text" @click="badDel(row)">删除</el-button>
                <el-button v-if="row.isVisible===0" v-waves type="text" @click="badEdit(row)">编辑</el-button>
                <el-button v-if="row.isVisible===0" v-waves type="text" @click="badDel(row)">删除</el-button>
                <el-button v-if="row.isVisible===1" type="text" @click="badSave(row)">确认</el-button>
                <el-button v-if="row.isVisible===1" type="text" @click="badCancel(row)">取消</el-button>
                <el-button v-if="row.isVisible===1" v-waves type="text" @click="badSave(row)">确认</el-button>
                <el-button v-if="row.isVisible===1" v-waves type="text" @click="badCancel(row)">取消</el-button>
              </div>
            </template>
          </el-table-column>
@@ -1099,8 +1176,14 @@
      </div>
      <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 v-waves @click="badDialogVisibleCancel">取 消</el-button>
          <el-button
            v-waves
            type="primary"
            :loading="$store.state.app.buttonIsDisabled"
            :disabled="$store.state.app.buttonIsDisabled"
            @click="badDialogVisibleConfirm "
          >保 存/打 印</el-button>
        </div>
      </span>
    </el-dialog>
@@ -1130,6 +1213,8 @@
import QRCode from 'qrcodejs2'
import { getCookie } from '@/utils/auth'
import { handleDatetime2 } from '@/utils/global'
import elDragDialog from '@/directive/el-drag-dialog'
import waves from '@/directive/waves'
const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
@@ -1137,6 +1222,7 @@
  components: {
    Pagination
  },
  directives: { elDragDialog, waves },
  data() {
    const validateName = (rule, value, callback) => {
      if (!value) {
@@ -1320,7 +1406,7 @@
      OperationArr: [], // 人员数组
      sendButtonIsDisabled: false, // 下达按钮是否可点击
      judgeIsScanningArr: [], // 判断是否扫码数组
      countJudgeIsScanningInput: 0// 判断扫码框的个数
      countJudgeIsScanningInput: 0 // 判断扫码框的个数
    }
  },
  watch: {
@@ -1793,6 +1879,9 @@
    },
    // 用户添加
    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)
@@ -1923,11 +2012,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('发料失败!')
              }
@@ -1958,16 +2049,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('收料失败!')
              }
@@ -1984,11 +2076,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('开工失败!')
              }
@@ -2033,17 +2127,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('报工失败!')
              }
@@ -2129,13 +2223,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
        }
      })
    },
@@ -2148,7 +2245,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)
      })