小小儁爺
5 天以前 52ff813beef33faeaf1d9ace4cc596a6baa9b480
1.生产执行 新增 报工调整批量改价数据
已修改4个文件
161 ■■■■■ 文件已修改
src/api/WorkOrder.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/Pagination/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/produce/reportCorrect.vue 148 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/workOrder/workOrderList.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/WorkOrder.js
@@ -355,3 +355,12 @@
    method: 'get'
  })
}
// 生产执行,报工调整批量改价数据提交
export function MesOrderStepPriceBatchUpdateSeave(data) {
  return request({
    url: 'WorkOrder/MesOrderStepPriceBatchUpdateSeave',
    method: 'post',
    data
  })
}
src/components/Pagination/index.vue
@@ -36,7 +36,7 @@
    pageSizes: {
      type: Array,
      default() {
        return [10, 20, 50, 100]
        return [10, 20, 50, 100, 500, 2000]
      }
    },
    layout: {
src/views/produce/reportCorrect.vue
@@ -2,7 +2,11 @@
  <div>
    <div class="body" :style="{height:mainHeight+'px'}">
      <div class="bodyTopFormGroup" style="margin-top: 10px;">
      <div class="bodyTopButtonGroup" style="justify-content: space-between">
        <el-button v-waves type="warning" icon="el-icon-edit" @click="batchUpdate">批量修改工价</el-button>
      </div>
      <div class="bodyTopFormGroup">
        <el-form
          ref="form"
          :model="form"
@@ -39,7 +43,22 @@
            <el-form-item v-show="isExpandForm" label="产品规格" style=" display: flex;">
              <el-input v-model="form.partspec" placeholder="请输入" style="width: 200px" />
            </el-form-item>
            <el-form-item v-show="isExpandForm" label="工序名称" style=" display: flex;">
              <el-select
                v-model="form.stepcode"
                filterable
                :popper-append-to-body="false"
                style="width: 200px"
                placeholder="请选择"
              >
                <el-option
                  v-for="item in stepCodeArr"
                  :key="item.stepcode"
                  :label="item.stepname"
                  :value="item.stepcode"
                />
              </el-select>
            </el-form-item>
            <el-form-item v-show="isExpandForm" label="报工人员" style=" display: flex;">
              <el-input v-model="form.reportuser" placeholder="请输入" style="width: 200px" />
            </el-form-item>
@@ -191,6 +210,13 @@
              {{ row.steptype === 'Z' ? '自制' : '外协' }}
            </template>
          </el-table-column>
          <el-table-column
            prop="step_price"
            label="工序工价"
            show-overflow-tooltip
            sortable="custom"
            min-width="110"
          />
          <el-table-column
            prop="wx_name"
            label="供应商"
@@ -464,6 +490,48 @@
      </span>
    </el-dialog>
    <el-dialog
      v-el-drag-dialog
      title="批量工价调整"
      :visible.sync="batchUpdateDialogVisible"
      width="1080px"
      :close-on-click-modal="false"
      top="15vh"
      @closed="batchUpdateHandleClose"
      @close="batchUpdateHandleClose"
    >
      <div style="display: flex;align-items: center">
        <div>
          修改为:
        </div>
        <el-input-number
          v-model="stepPriceEdit"
          size="medium"
          :precision="2"
          :step="0.1"
          :max="10"
          :min="0"
          style="margin: 0 10px 5px"
        />
        <div>
          元 / 件
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <div class="footerButton">
          <el-button v-waves @click="batchUpdateDialogVisibleCancel">取 消</el-button>
          <el-button
            v-waves
            type="primary"
            :loading="$store.state.app.buttonIsDisabled"
            :disabled="$store.state.app.buttonIsDisabled"
            @click="batchUpdateDialogVisibleConfirm"
          >确 定</el-button>
        </div>
      </span>
    </el-dialog>
  </div>
</template>
@@ -472,8 +540,12 @@
import { handleDatetime } from '@/utils/global'
import elDragDialog from '@/directive/el-drag-dialog'
import waves from '@/directive/waves'
import { DefectPermissions, PrentOrganizationNoCompany } from '@/api/GeneralBasicData'
import { MesOrderStepModelSearch, MesOrderStepUpdateSeave, MesOrderStepVerifySearch } from '@/api/WorkOrder'
import { DefectPermissions, PrentOrganizationNoCompany, StepData } from '@/api/GeneralBasicData'
import {
  MesOrderStepModelSearch, MesOrderStepPriceBatchUpdateSeave,
  MesOrderStepUpdateSeave,
  MesOrderStepVerifySearch
} from '@/api/WorkOrder'
export default {
  name: 'ReportCorrect',
@@ -495,7 +567,7 @@
        partspec: '', // 产品规格
        reportuser: '', // 报工人员
        reportdate: '', // 报工时间
        stepcode: '',
        prop: 'report_date', // 排序字段
        order: 'desc', // 排序字段
        page: 1, // 第几页
@@ -541,7 +613,10 @@
        report_qty: [
          { required: true, message: '请输入合格数量', trigger: ['blur', 'change'] }
        ]
      }
      },
      stepCodeArr: [], // 下拉工序集合
      batchUpdateDialogVisible: false,
      stepPriceEdit: 0
    }
  },
@@ -552,6 +627,7 @@
    this.getMesOrderStepVerifySearch()
    this.getDefectPermissions()
    this.getPrentOrganizationNoCompany()
    this.getStepData()
  },
  created() {
  },
@@ -562,8 +638,60 @@
    this.getMesOrderStepVerifySearch()
    this.getDefectPermissions()
    this.getPrentOrganizationNoCompany()
    this.getStepData()
  },
  methods: {
    // 批量修改工序
    batchUpdate() {
      // this.$confirm('是否确认修改?', '提示', {
      //   confirmButtonText: '确定',
      //   cancelButtonText: '取消',
      //   type: 'warning'
      // }).then(() => {
      //
      // }).catch(() => {
      //   this.$notify.info('已取消修改!')
      // })
      this.batchUpdateDialogVisible = true
    },
    batchUpdateDialogVisibleCancel() {
      this.batchUpdateDialogVisible = false
    },
    batchUpdateDialogVisibleConfirm() {
      this.$confirm('是否确认修改?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        const data = []
        // "id": "string",
        //   "price": "string",
        //   "type": "string"
        // data = this.tableData.map(i =>  {  id:i.id price:i.step_price, type:i.steptype})
        this.tableData.forEach(i => {
          data.push({
            id: i.id, price: this.stepPriceEdit, type: i.style
          })
        })
        MesOrderStepPriceBatchUpdateSeave(data).then(res => {
          if (res.code === '200') {
            this.batchUpdateDialogVisible = false
            this.$message.success('修改成功!')
            this.getMesOrderStepVerifySearch()
          }
        })
      }).catch(() => {
        this.$notify.info('已取消修改!')
      })
    },
    batchUpdateHandleClose() {
      this.stepPriceEdit = 0
    },
    // 获取工序基础资料
    async getStepData() {
      const { data: res } = await StepData()
      this.stepCodeArr = res
    },
    async getPrentOrganizationNoCompany() {
      const { data: res } = await PrentOrganizationNoCompany()
      this.wkshopcodeArr = res
@@ -585,6 +713,7 @@
        partname: this.form.partname,
        partspec: this.form.partspec,
        reportuser: this.form.reportuser,
        stepcode: this.form.stepcode,
        reportdate: tempDate,
        prop: this.form.prop, // 排序字段
@@ -618,6 +747,7 @@
      this.form.partspec = ''
      this.form.reportuser = ''
      this.form.reportdate = ''
      this.form.stepcode = ''
      this.getMesOrderStepVerifySearch()
    },
@@ -744,7 +874,7 @@
    getHeight() {
      this.$nextTick(() => {
        this.mainHeight = window.innerHeight - 85
        this.tableHeight = this.mainHeight - 205
        this.tableHeight = this.mainHeight - 255
        this.$refs.tableDataRef.doLayout()
      })
    }
@@ -789,4 +919,8 @@
  align-items: center;
}
::v-deep .el-input--medium >input{
  height: 36px !important;
}
</style>
src/views/workOrder/workOrderList.vue
@@ -857,6 +857,7 @@
            class="stepSelectedValueClass"
            style="width: 930px;"
            multiple
            filterable
            placeholder="请选择相对应工序"
            @change="stepSelectedValueChange"
          >
@@ -2561,6 +2562,7 @@
              class="stepSelectedValueClass"
              style="width: 930px;"
              multiple
              filterable
              placeholder="请选择相对应工序"
              @change="val=>stepSelectedValueChangeBatchUpdate(val,index)"
            >