bug
jiangping
2023-12-06 1f4e7d0f73a73e7350cf5a1df279d5f30904c5d5
web_standard/src/views/ext/workorderRecordExt.vue
@@ -127,12 +127,12 @@
        </el-table-column> -->
        <el-table-column prop="qualifiedNum" label="合格数量" min-width="100px">
          <template slot-scope="{row}">
            <span class="valid-style">{{ row.qualifiedNum + row.umodel.name }}</span>
            <span class="valid-style">{{ (row.qualifiedNum || 0) + row.umodel.name }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="unqualifiedNum" label="不良数量" min-width="100px">
          <template slot-scope="{row}">
            <span class="unvalid-style">{{ row.unqualifiedNum + row.umodel.name}}</span>
            <span class="unvalid-style">{{ (row.unqualifiedNum||0) + row.umodel.name}}</span>
            <!-- <span :class="row.materialDonetype==0 ? 'valid-style' : ''">{{ row.num + row.umodel.name }}</span> -->
          </template>
        </el-table-column>
@@ -141,7 +141,21 @@
            <span>{{ row.num + row.umodel.name}}</span>
          </template>
        </el-table-column>
        <!-- <el-table-column prop="amodel.code" label="工装器具" min-width="100px"></el-table-column> -->
        <el-table-column prop="duration" label="报工时长" min-width="100px">
          <template slot-scope="{row}">
            <span>{{ timesToStr(row.duration) }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="salaryType" label="计价方式" min-width="100px">
         <template slot-scope="{row}">
                    {{ row.salaryType == 0 ? '计件' : (row.salaryType == 1 ? '计时' : '-') }}
        </template>
        </el-table-column>
        <el-table-column prop="salaryYuan" label="计价工资(元)" min-width="100px">
          <!-- <template slot-scope="{row}">
            <span>{{accDiv(Math.round(row.salaryyuan),100) }}</span>
          </template> -->
        </el-table-column>
        <el-table-column prop="deviceCode" label="设备" show-overflow-tooltip min-width="100px">
          <template slot-scope="{row}">
            <span class="long-title-style" :title="row.deviceCode + ' | ' + row.deviceName">{{ row.deviceCode + ' | ' + row.deviceName}}</span>
@@ -269,12 +283,13 @@
    },
    getSummaries (param) {
      const { columns, data } = param;
      console.log(param);
      const sums = [];
      columns.forEach((column, index) => {
        if (index === 0) {
          sums[index] = '合计';
          return;
        } else if (index === 4 || index === 8 || index === 6 || index === 10) {
        } else if (index === 4 || index === 7) {
          // || index === 8 || index === 9 || index === 16 || index === 17
          sums[index] = '-';
          return;
@@ -287,17 +302,34 @@
          }
          
        });
        if (!values.every(value => isNaN(value))) {
          sums[index] = 0
          values.forEach(item => {
            sums[index] = addPrecision(item, sums[index])
          })
        } else {
          if (index===11) {
            sums[index] = this.timesToStr(sums[index])
          }
        }  else {
          sums[index] = '-';
        }
      });
      return sums
    },
    timesToStr(times) {
      if (times==0||!times) {
        return '-'
      }
      // let sec = times%60
      let lesMin = Math.floor(times/60)
      let min = lesMin%60
      let hours =  Math.floor(lesMin/60)
      return `${hours}时${min}分`
    }
  }
}