loulijun2021
2023-09-19 6208ba6872cc54ccbd2b2ff3b67a1a2f054af41d
src/views/scgl/sckbg.vue
@@ -297,7 +297,7 @@
                sortable="custom"
              />
              <el-table-column
                label="未报工数量"
                label="未收料数量"
                width="120"
              >
                <!--                sortable="custom"-->
@@ -865,12 +865,19 @@
            @click="dialogVisibleConfirm"
          >开 工</el-button>
          <el-button
            v-if="dialogTitle==='自制报工'"
            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"
@@ -879,12 +886,19 @@
            @click="dialogVisibleConfirm"
          >发料</el-button>
          <el-button
            v-if="dialogTitle==='外协收料'"
            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>
@@ -1159,6 +1173,7 @@
import QRCode from 'qrcodejs2'
import { getCookie } from '@/utils/auth'
import { handleDatetime2 } from '@/utils/global'
import { LabelBarCode } from '@/api/xtsz'
const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
@@ -1195,8 +1210,8 @@
      WXradioSelected: '', // 工序选中
      form: {
        orderstepqrcode: '', // 扫描的二维码信息
        prop: 'wo_code', // 排序字段
        order: 'asc', // 排序字段
        prop: 'plan_startdate', // 排序字段
        order: 'desc', // 排序字段
        page: 1, // 第几页
        rows: 20 // 每页多少条
      },
@@ -1204,8 +1219,8 @@
      tableData: [],
      WXform: { // 外协表单
        orderstepqrcode: '', // 扫描的二维码信息
        prop: 'wo_code', // 排序字段z
        order: 'asc', // 排序字段
        prop: 'plan_startdate', // 排序字段z
        order: 'desc', // 排序字段
        page: 1, // 第几页
        rows: 20 // 每页多少条
      },
@@ -1252,6 +1267,8 @@
        reportuser: '', // 报工人员
        startqtySum: '', // 不能超过的数值
        inbarcode: '',
        operation: getCookie('navTabId'), // 报工人(收料人)
        remarks: ''// 备注
@@ -1822,6 +1839,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)
@@ -1883,6 +1903,7 @@
    },
    // 对话框关闭事件
    handleClose() {
      this.dialogForm.inbarcode = ''
      this.judgeIsScanningArr = []
      this.form.orderstepqrcode = ''
      this.WXform.orderstepqrcode = ''
@@ -1936,9 +1957,9 @@
    },
    // 对话框确认
    dialogVisibleConfirm() {
      this.$refs.dialogForm.validate(valid => {
      this.$refs.dialogForm.validate(async valid => {
        if (valid) {
          this.$store.state.app.buttonIsDisabled = true
          // this.$store.state.app.buttonIsDisabled = true
          if (this.dialogTitle === '外协发料') {
            if (parseFloat(this.dialogForm.fqty) > parseFloat(this.dialogForm.noreportqty)) {
              return this.$message.info('发料数量不能大于未发数量!')
@@ -1953,6 +1974,7 @@
              taskqty: this.dialogForm.planqty, // 任务数量
              fqty: this.dialogForm.fqty // 发料数量
            }
            this.$store.state.app.buttonIsDisabled = true
            SavaMesOrderStepOut(data).then(res => {
              if (res.code === '200') {
                this.dialogVisible = false
@@ -1975,6 +1997,19 @@
                return this.$message.info('请选择不良原因!')
              }
            }
            this.dialogForm.inbarcode = ''
            if (this.dialogForm.nextstepcode === '') {
              const D = {
                rightcode: '1078',
                partcode: this.dialogForm.partcode,
                qty: this.dialogForm.sqty,
                onelabqty: this.dialogForm.sqty
              }
              const r = await LabelBarCode(D)
              this.dialogForm.inbarcode = r.data[0].labcode
              this.qrForm.partspec = this.dialogForm.partspec
            }
            const data = {
              mesordercode: this.dialogForm.wo_code, // 工单编号
@@ -1986,9 +2021,13 @@
              taskqty: this.dialogForm.planqty, // 任务数量
              sqty: this.dialogForm.sqty, // 收料数量
              remarks: this.dialogForm.remarks, // 备注
              inbarcode: this.dialogForm.inbarcode, // 生产入库条码
              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
@@ -2015,6 +2054,7 @@
              taskqty: this.dialogForm.planqty, // 任务数量
              startqty: this.dialogForm.startqty// 开始数量
            }
            this.$store.state.app.buttonIsDisabled = true
            SavaMesOrderStepStart(data).then(res => {
              if (res.code === '200') {
                this.dialogVisible = false
@@ -2046,6 +2086,23 @@
            this.userTableData = this.userTableData.filter((currentValue, currentIndex, selfArr) => {
              return selfArr.findIndex(item => item.usercode === currentValue.usercode) === currentIndex
            })
            this.dialogForm.inbarcode = ''
            // 当为末道的时候
            if (this.dialogForm.nextstepcode === '') {
              const D = {
                rightcode: '1073',
                partcode: this.dialogForm.partcode,
                qty: this.dialogForm.startqty,
                onelabqty: this.dialogForm.startqty
              }
              const r = await LabelBarCode(D)
              this.dialogForm.inbarcode = r.data[0].labcode
              this.qrForm.partspec = this.dialogForm.partspec
            }
            // console.log(this.userTableData, 1)
            const reportuser = this.userTableData.map(item => item.usercode).join(';')
            const data = {
@@ -2062,10 +2119,13 @@
              // reportqty: this.dialogForm.reportqty, // 报工数量
              reportqty: this.dialogForm.startqty, // 报工数量
              remarks: this.dialogForm.remarks, // 备注
              inbarcode: this.dialogForm.inbarcode, // 生产入库条码
              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
@@ -2098,7 +2158,13 @@
      })
    },
    ZZprint2(username) {
      this.qrForm.qrvalue = this.dialogForm.wo_code + ';' + this.dialogForm.nextstepcode
      if (this.dialogForm.nextstepcode !== '') {
        this.qrForm.qrvalue = this.dialogForm.wo_code + ';' + this.dialogForm.nextstepcode
      } else {
        this.qrForm.qrvalue = this.dialogForm.inbarcode
      }
      // this.qrForm.qrvalue = this.dialogForm.wo_code + ';' + this.dialogForm.nextstepcode
      this.qrForm.startqty = this.dialogForm.startqty
      this.qrForm.wo_code = this.dialogForm.wo_code
      this.qrForm.partcode = this.dialogForm.partcode
@@ -2111,7 +2177,13 @@
      })
    },
    WXprint2(username) {
      this.qrForm.qrvalue = this.dialogForm.wo_code + ';' + this.dialogForm.nextstepcode
      if (this.dialogForm.nextstepcode !== '') {
        this.qrForm.qrvalue = this.dialogForm.wo_code + ';' + this.dialogForm.nextstepcode
      } else {
        this.qrForm.qrvalue = this.dialogForm.inbarcode
      }
      // this.qrForm.qrvalue = this.dialogForm.wo_code + ';' + this.dialogForm.nextstepcode
      this.qrForm.startqty = this.dialogForm.sqty
      this.qrForm.wo_code = this.dialogForm.wo_code
      this.qrForm.partcode = this.dialogForm.partcode