廖井涛
2025-03-28 1f97acdb370414caa5303563f6c653a70a0e542b
north-glass-erp/northglass-erp/src/views/pp/reportingWorks/AddReportingWork.vue
@@ -104,7 +104,7 @@
        layer= res.data.layer
        //添加补片状态列
        let column = {field: 'patchStatusOther', width: 90,title: res.data.title}
        let column = {field: 'patchStatusOther', width: 90,title: t('reportingWorks.patchCondition')}
        gridOptions.columns.push(column)
        const s01Values = [];
@@ -138,8 +138,6 @@
          button.name=t('basicData.review')
          titleUploadData.value.qualityInspector=user.user.userName
        }
        gridOptions.toolbarConfig.buttons.push(button)
      }
     // getQuantity()
@@ -341,6 +339,13 @@
    },
    {field: 'completed', width: 90, title:t('reportingWorks.completed'),},
    {field: 'onceBroken', width: 90, title: t('reportingWorks.onceBroken'),},
    {
      field: 'reviewed_state',
      title: t('processCard.reviewedState'),
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      filterMethod: filterChanged
    },
  ],
//表单验证
@@ -356,7 +361,7 @@
          }else if((row.completedQuantity*1+brokenNum*1)>row.quantity*1){
            return new Error((`${row.completedQuantity}+${brokenNum}>${row.quantity}`))
          }else  if(row.quantity_card<row.completedQuantity){
            return new Error("完工数不能大于流程卡数量")
            return new Error(t('reportingWorks.pleaseNumber10'))
          }
          const completedNum =
              (row.completedQuantity === undefined || row.completedQuantity===null || row.completedQuantity==='') ? 0 : row.completedQuantity
@@ -415,7 +420,7 @@
    const $grid = xGrid.value
    if ($grid) {
      switch (code) {
        case 'saveReportingWork':  {
        case 'saveReportingWork':  {//保存
          const errMap = await $grid.validate(true)
          if (errMap) {
            ElMessage.error(t('basicData.msg.checkoutLose'))
@@ -433,7 +438,7 @@
          saveReportingWork(1,'save')
          break
        }
        case 'update':  {
        case 'update':  {//修改
          //根据补片状态判断是否能修改
          // request.post(`/reportingWork/getPatchCondition/${route.query.reportingWorkId}`).then(async (res) => {
          //   if (res.code == 200) {
@@ -475,7 +480,7 @@
      }
    }
  },
  menuClick({menu, row, column}) {
  menuClick({menu, row, column}) {//右键菜单
    const $grid = xGrid.value
    if ($grid) {
      switch (menu.code) {
@@ -874,6 +879,7 @@
    return item.saveFlag === 0
  })
  let process = titleUploadData.value.thisProcess
  //暂时取消
  for(let item of uniqueByOrderNum){
    if(!checkSameNumForId(notFinishList,item.order_number ) && (process=='夹胶' || process=='中空' || process=='包装' ||process=='打胶和粘框')){
      ElMessage.error(`${t('reportingWorks.pleaseCheckTheOrderNumber1')}':'
@@ -945,13 +951,15 @@
    reviewState = 'review'
  }
  request.post(`/reportingWork/updateReportingWork/${reviewState}`,requestData).then(res =>{
    if (res.code == 200){
    if (res.code == 200 && res.data===true){
      ElMessage.success(t('reportingWorks.successfulModificationOfWorkApplication'))
      router.push({path:'/main/reportingWorks/AddReportingWork',
        query:{
          processId:titleUploadData.value.processId,
          random:Math.random()}
      })
    } else {
      ElMessage.warning(t('reportingWorks.changeFailed'))
    }
  })
}
@@ -1098,7 +1106,7 @@
      //设备下拉框
      titleSelectJson.value.deviceType = res.data.device
      //班组下拉框
      titleSelectJson.value.teamsType = res.data.teams
      //titleSelectJson.value.teamsType = res.data.teams
      //当前流程卡工序
      titleSelectJson.value.thisProcessType = res.data.thisProcess
      //历史班组
@@ -1149,7 +1157,20 @@
      //绑定下方表格
      detail.value = res.data.Detail
      xGrid.value.reloadData(detail.value)
      // 使用map方法来处理每个对象
      let modifiedCollection = detail.value.map(item => {
        if (item.reviewed_state === 1) {
          return { ...item, reviewed_state: "已审核" };
        }
        else if (item.reviewed_state === 0) {
          return { ...item, reviewed_state: "未审核" };
        }
        else {
          // 其他情况保持不变
          return item;
        }
      });
      xGrid.value.reloadData(modifiedCollection)
    } else {
      ElMessage.warning(res.msg)
    }
@@ -1317,8 +1338,8 @@
</script>
<template>
  <div style="height: 100%;width: 100%">
    <div id="head" style="height: 5%;width: 100%;margin-bottom: 5px">
  <div  style="width: 100%;height: 100%">
    <div class="head">
      <el-input :disabled="inputDisabled" v-if="titleUploadData.reportingWorkId" v-model="titleUploadData.reportingWorkId" :placeholder="$t('reportingWorks.reportingWorkId')" style="width: 200px" />
      <el-input :disabled="inputDisabled" v-model="titleUploadData.processId" :placeholder="$t('processCard.processId')" style="width: 200px" @keyup.enter.native="getWork();getQuantity()"/>
      &nbsp;
@@ -1342,7 +1363,7 @@
      &nbsp;
      <label>{{technologicalProcess}}</label>
    </div>
    <div style="background-color: white;margin-bottom: 5px;height: 17%;width: 100%">
    <div class="head1">
      <el-row>
        <el-col :span="2">
          <el-text>{{$t('order.orderId')}}:</el-text>
@@ -1478,12 +1499,11 @@
      </el-row>
    </div>
    <div class="main-div-customer" style="width: 100%;height: 70%">
    <div class="main-table">
      <vxe-grid
          ref="xGrid"
          class="mytable-scrollbar"
          :row-class-name="changeRowClass"
          max-height="100%"
          height="100%"
          size="small"
          v-bind="gridOptions"
@@ -1507,6 +1527,7 @@
      </vxe-grid>
    </div>
      <el-dialog
          @opened="openedBrokenTable"
          :before-close="checkClose"
@@ -1610,12 +1631,24 @@
        </vxe-grid>
      </el-dialog>
    </div>
  </div>
</template>
<style scoped>
.head{
  width: 100%;
  height: 35px;
}
.head1{
  width: 100%;
  height: 105px;
  background-color: white;
}
.main-table{
  width: 100%;
  height: calc(100% - 135px);
}
.processCard {
  width: 140px;