小小儁爺
17 小时以前 9fd5c98eb80c80775d43c581cc7155cf0168d26c
src/views/workOrder/workOrderList.vue
@@ -505,6 +505,7 @@
      <div class="elTableDiv">
        <el-table
          ref="tableDataRef2"
          :data="tableDataDetail"
          border
          height="210px"
@@ -513,18 +514,18 @@
          :header-cell-style="this.$headerCellStyle"
          :cell-style="this.$cellStyle"
        >
          <!--          <el-table-column-->
          <!--            width="50"-->
          <!--            type="index"-->
          <!--            prop="序号"-->
          <!--            fixed-->
          <!--          />   -->
          <el-table-column
            width="50"
            prop="seq"
            label="序号"
            type="index"
            prop="序号"
            fixed
          />
          <!--          <el-table-column-->
          <!--            width="50"-->
          <!--            prop="seq"-->
          <!--            label="序号"-->
          <!--            fixed-->
          <!--          />-->
          <el-table-column
            prop="wo_code"
            show-tooltip-when-overflow
@@ -612,24 +613,6 @@
                    @click="pre(row,2)"
                  />
                </el-tooltip>
                <!--                          <el-tooltip class="item" effect="dark" content="打印工序" placement="top">-->
                <!--                            <i-->
                <!--                              v-if="tableDataDetail.length!==row.seq"-->
                <!--                              class="el-icon-printer"-->
                <!--                              :style="{color:$store.state.settings.theme}"-->
                <!--                              style="cursor: pointer;margin-right: 15px"-->
                <!--                              @click="supplementSmallClick(row)"-->
                <!--                            />-->
                <!--                          </el-tooltip>-->
                <!--                          <el-tooltip class="item" effect="dark" content="补打生产入库条码" placement="top">-->
                <!--                            <i-->
                <!--                              v-if="tableDataDetail.length===row.seq"-->
                <!--                              class="  el-icon-camera"-->
                <!--                              :style="{color:$store.state.settings.theme}"-->
                <!--                              style="cursor: pointer;margin-right: 15px"-->
                <!--                              @click="getProductInHouseLabCode(row.wo_code)"-->
                <!--                            />-->
                <!--                          </el-tooltip>-->
              </div>
            </template>
          </el-table-column>
@@ -856,6 +839,7 @@
            class="stepSelectedValueClass"
            style="width: 930px;"
            multiple
            filterable
            placeholder="请选择相对应工序"
            @change="stepSelectedValueChange"
          >
@@ -2560,6 +2544,7 @@
              class="stepSelectedValueClass"
              style="width: 930px;"
              multiple
              filterable
              placeholder="请选择相对应工序"
              @change="val=>stepSelectedValueChangeBatchUpdate(val,index)"
            >
@@ -3004,7 +2989,9 @@
        // do something with the new and old value of stepSelectedValue
        console.log(val, 1)
        console.log(this.stepTableData, 3)
        const arr = JSON.parse(JSON.stringify(this.stepTableData))
        console.log(arr, 33, this.dialogForm.mesqty)
        const arrStepcode = arr.map(i => i.stepcode)
        this.stepTableData = []
        val.forEach(i => {
@@ -3119,7 +3106,8 @@
        if (i.stepdata.length > 0) {
          i.stepdata.forEach(j => {
            j.ratio = parseFloat(j.ratio) > 0 ? parseFloat(j.ratio) : 0
            j.sumqty = Math.round(parseFloat(i.canupdate_qty) * (1 + (parseFloat(j.ratio) > 0 ? parseFloat(j.ratio) / 100 : 0)))
            // j.sumqty = Math.round(parseFloat(i.canupdate_qty) * (1 + (parseFloat(j.ratio) > 0 ? parseFloat(j.ratio) / 100 : 0)))
            j.sumqty = Math.round(parseFloat(this.formData3[index].mesqty) * (1 + (parseFloat(j.ratio) > 0 ? parseFloat(j.ratio) / 100 : 0)))
          })
          this.formData3[index].stepTableData = i.stepdata
          this.formData3[index].stepSelectedValue = i.stepdata.map(j => j.stepcode)
@@ -3178,6 +3166,7 @@
      const flag2 = []
      const data = []
      this.formData3.forEach((i, index) => {
        const islastreport = this.wkshopcodeArr.find(j => j.torg_code === i.wkshopcode).islastreport
        const workListSub = []
        if (i.stepTableData.length > 0) {
          i.stepTableData.forEach((it, j) => {
@@ -3189,10 +3178,12 @@
                isbott: j === 0 ? 'Y' : 'N',
                isend: j === i.stepTableData.length - 1 ? 'Y' : 'N',
                ratio: it.ratio,
                sumqty: it.sumqty
                sumqty: it.sumqty,
                isShow: islastreport === 'N' ? 'Y' : (j === i.stepTableData.length - 1 ? 'Y' : 'N')
              }
            )
          })
          console.log(JSON.parse(JSON.stringify(workListSub)))
          if (this.mesSetting.isOrder) {
            const f = workListSub.every((item, index, array) => {
@@ -3700,7 +3691,8 @@
                stepname: i.stepname,
                stepprice: i.stepprice,
                ratio: parseFloat(i.ratio) > 0 ? parseFloat(i.ratio) : 0,
                sumqty: Math.round(parseFloat(res.canupdate_qty) * (1 + (parseFloat(i.ratio) > 0 ? parseFloat(i.ratio) / 100 : 0)))
                // sumqty: Math.round(parseFloat(res.canupdate_qty) * (1 + (parseFloat(i.ratio) > 0 ? parseFloat(i.ratio) / 100 : 0)))
                sumqty: Math.round(parseFloat(this.dialogForm.mesqty) * (1 + (parseFloat(i.ratio) > 0 ? parseFloat(i.ratio) / 100 : 0)))
              }
            )
          })
@@ -3734,7 +3726,8 @@
                stepname: i.stepname,
                stepprice: i.stepprice,
                ratio: parseFloat(i.ratio) > 0 ? parseFloat(i.ratio) : 0,
                sumqty: Math.round(parseFloat(res.canupdate_qty) * (1 + (parseFloat(i.ratio) > 0 ? parseFloat(i.ratio) / 100 : 0)))
                // sumqty: Math.round(parseFloat(res.canupdate_qty) * (1 + (parseFloat(i.ratio) > 0 ? parseFloat(i.ratio) / 100 : 0)))
                sumqty: Math.round(parseFloat(this.dialogForm.mesqty) * (1 + (parseFloat(i.ratio) > 0 ? parseFloat(i.ratio) / 100 : 0)))
              }
            )
          })
@@ -3915,6 +3908,10 @@
          if (this.mesSetting.route && !this.dialogForm.routecode) {
            return this.$message.error('请选择工艺路线!')
          }
          const islastreport = this.wkshopcodeArr.find(i => i.torg_code === this.dialogForm.wkshopcode).islastreport
          // console.log(islastreport === 'N', islastreport)
          const workListSub = []
          this.stepTableData.forEach((i, j) => {
            workListSub.push(
@@ -3925,7 +3922,8 @@
                isbott: j === 0 ? 'Y' : 'N',
                isend: j === this.stepTableData.length - 1 ? 'Y' : 'N',
                ratio: i.ratio,
                sumqty: i.sumqty
                sumqty: i.sumqty,
                isShow: islastreport === 'N' ? 'Y' : (j === this.stepTableData.length - 1 ? 'Y' : 'N')
              }
            )
          })
@@ -3942,7 +3940,7 @@
              return this.$message.error('有序报工情况下,超报比例后道工序不能大于前道工序!')
            }
          }
          console.log(isNaN(this.dialogForm.mesqty - this.dialogForm.mesqtyinit))
          // console.log(isNaN(this.dialogForm.mesqty - this.dialogForm.mesqtyinit))
          const data = {
            wostatus: this.dialogForm.mesorderstus, // 工单状态
            wocode: this.dialogForm.mesordercode, // 工单号
@@ -3961,6 +3959,8 @@
            routecode: this.dialogForm.routecode,
            workListSub
          }
          // console.log(JSON.parse(JSON.stringify(data)))
          this.$store.state.app.buttonIsDisabled = true
          AddUpdateMesOrder(data, this.operation === 'add' ? 'Add' : 'Update').then(res => {
@@ -4009,6 +4009,7 @@
        }
        this.isIpad = window.innerHeight < 769 && window.innerWidth < 1367
        this.$refs.tableDataRef.doLayout()
        this.$refs.tableDataRef2.doLayout()
      })
    },
    // 工艺路线放大镜点击
@@ -4043,8 +4044,13 @@
      MesOrderPrintSearch(data2).then(res2 => {
        if (res2.code === '200') {
          this.dialogVisibleApprove = true
          let res3 = []
          if (row.islastreport === 'Y') {
            res3 = res2.data.recordset.filter(i => i.isshow === 'Y')
          } else {
            res3 = res2.data.recordset
          }
          const res3 = res2.data.recordset
          // this.tableDataPrint = res3
          this.tableDataPrint = this.chunkArray(res3, 8)
@@ -4455,6 +4461,11 @@
      }
      const { data: res } = await UpdateMesOrderStepSearch(data)
      this.tableDataDetail = res.stepdata
      // if (row.islastreport === 'Y') {
      //   this.tableDataDetail = res.stepdata.filter(i => i.isend === 'Y')
      // } else {
      //   this.tableDataDetail = res.stepdata
      // }
    },
    // 工序删除
    stepDel(row) {
@@ -4530,7 +4541,7 @@
    getSummaries(param) {
      const { columns, data } = param
      const sums = []
      const i = 9
      const i = 11
      columns.forEach((column, index) => {
        if (index === i) {
          sums[index] = '总数'
@@ -4552,6 +4563,7 @@
      this.$nextTick(() => {
        this.$refs.tableDataRef.doLayout()
        this.$refs.tableDataRef2.doLayout()
      })
      return sums
    }
@@ -4569,10 +4581,22 @@
$main_color: #42b983;
.stepSelectedValueClass {
  ::v-deep input {
    //min-height: 34px !important;
    height: 68px !important;
  //::v-deep input {
  //  //min-height: 34px !important;
  //  height: 98px !important;
  //}
  ::v-deep .el-input__inner{
    height: 120px!important;
  }
  ::v-deep .el-select__tags>span{
    display: flex ;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}
.dialogVisibleRoute {