纤度登记表模块  获取组别的数据修改为获取车间的组别的接口+入参数据处理
1个文件已修改
117 ■■■■■ 已修改文件
src/views/productManage/silkRegisterForm/addPage.vue 117 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productManage/silkRegisterForm/addPage.vue
@@ -80,6 +80,7 @@
                v-model="form.name"
                placeholder="请选择"
                class="select-width"
                @change="getGroupNumber"
              >
                <el-option
                  v-for="item in nameList"
@@ -110,14 +111,15 @@
            <el-form-item label="组别" prop="workshopGroup" class="form-item">
              <el-select
                v-model="form.workshopGroup"
                placeholder="请选择"
                placeholder="请先选择车间"
                no-data-text="请先选择车间"
                class="select-width"
              >
                <el-option
                  v-for="item in workshopGroupList"
                  :key="item.ID"
                  :label="item.name"
                  :value="item.ID"
                  :key="item"
                  :label="item"
                  :value="item"
                >
                </el-option>
              </el-select>
@@ -319,9 +321,17 @@
              </el-table-column>
              <el-table-column prop="finenessGradeye" label="野纤" width="120">
              </el-table-column>
              <el-table-column prop="finenessGradebig" label="大野" show-overflow-tooltip>
              <el-table-column
                prop="finenessGradebig"
                label="大野"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column prop="finenessGradeSpecial" label="特野" width="120">
              <el-table-column
                prop="finenessGradeSpecial"
                label="特野"
                width="120"
              >
              </el-table-column>
              <el-table-column
                prop="finenessGrade"
@@ -414,10 +424,10 @@
</template>
<script>
// getWorkshopManageList,
import {
  saveRegister,
  getDictList,
  getWorkshopManageList,
  getRegisterDetails,
} from "@/api/productManage/silkRegisterForm.js";
import {
@@ -426,6 +436,7 @@
} from "@/api/productManage/silkInspectForm.js";
import pageMixin from "@/components/makepager/pager/mixin/pageMixin";
import CommonFormTableView from "@/components/makepager/CommonFormTableView";
import { getWorkshopManageGroup } from "@/api/productManage/productRegisterForm.js";
export default {
  name: "silkRegisterAddPage",
  props: {},
@@ -574,10 +585,11 @@
                  JSON.stringify(response.data ? response.data : {})
                );
                this.form = config;
                this.getGroupNumber()
                this.tableList.tableData = config.finenessList
                  ? config.finenessList
                  : [];
                  this.tableData=this.tableList.tableData
                this.tableData = this.tableList.tableData;
              }
            }
          );
@@ -615,27 +627,25 @@
              this.form.finishDate = config.finenessRegister.finishDate;
              this.form.circle = config.finenessRegister.circle;
              this.getTableHeader();
              let arr= response.data.items
                ? response.data.items
                : [];
                for(let i in arr){
                    let round=arr[i].finenessRoundingItems
                    if(arr[i].finenessGrade){
                        if(arr[i].finenessGrade.indexOf('野纤')>-1){
                            arr[i].finenessGradeye=arr[i].finenessGrade
                        }else if(arr[i].finenessGrade.indexOf('大野')>-1){
                            arr[i].finenessGradebig=arr[i].finenessGrade
                        }else if(arr[i].finenessGrade.indexOf('特野')>-1){
                            arr[i].finenessGradeSpecial=arr[i].finenessGrade
                        }
                    }
                    if(round){
                        for(let j in round){
                            arr[i][round[j].fineness]=round[j].quantity
                        }
                    }
              let arr = response.data.items ? response.data.items : [];
              for (let i in arr) {
                let round = arr[i].finenessRoundingItems;
                if (arr[i].finenessGrade) {
                  if (arr[i].finenessGrade.indexOf("野纤") > -1) {
                    arr[i].finenessGradeye = arr[i].finenessGrade;
                  } else if (arr[i].finenessGrade.indexOf("大野") > -1) {
                    arr[i].finenessGradebig = arr[i].finenessGrade;
                  } else if (arr[i].finenessGrade.indexOf("特野") > -1) {
                    arr[i].finenessGradeSpecial = arr[i].finenessGrade;
                  }
                }
              this.tableTwoList.tableInfomation =arr;
                if (round) {
                  for (let j in round) {
                    arr[i][round[j].fineness] = round[j].quantity;
                  }
                }
              }
              this.tableTwoList.tableInfomation = arr;
            }
          });
        }
@@ -711,11 +721,11 @@
        }
      });
      //组别
      getWorkshopManageList().then((res) => {
        if (res.code == 200) {
          this.workshopGroupList = res.data || [];
        }
      });
      // getWorkshopManageList().then((res) => {
      //   if (res.code == 200) {
      //     this.workshopGroupList = res.data || [];
      //   }
      // });
      //庄口
      getDictList({
        dictType: 0,
@@ -724,6 +734,31 @@
          this.marketList = res.data || [];
        }
      });
    },
    getGroupNumber() {
      if (this.form.name) {
        //组别
        let number = "";
        for (let i in this.nameList) {
          if (this.nameList[i].name == this.form.name) {
            number = this.nameList[i].number;
            break;
          }
        }
        getWorkshopManageGroup({ number: number }).then((res) => {
          if (res.code == 200) {
            this.workshopGroupList = [];
            let workshopGroupList = res.data || {};
            if (Object.keys(workshopGroupList).length > 0) {
              for (let i in workshopGroupList) {
                this.workshopGroupList.push(workshopGroupList[i]);
              }
            }
          }
        });
      } else {
        this.workshopGroupList = [];
      }
    },
    inputStart() {
      this.form.circleTwo = this.form.circle + "-" + this.form.totalCircle;
@@ -800,13 +835,13 @@
            sum: "",
          },
        ];
      }else{
        this.form.measureFineness=''
        this.form.twiceChange=''
        this.form.cleanliness=''
        this.form.purity=''
        this.form.marketProcessOrderNumber=''
        this.form.inspector=''
      } else {
        this.form.measureFineness = "";
        this.form.twiceChange = "";
        this.form.cleanliness = "";
        this.form.purity = "";
        this.form.marketProcessOrderNumber = "";
        this.form.inspector = "";
      }
    },
    // 保存
@@ -868,7 +903,7 @@
                    message: "保存成功!",
                    type: "success",
                  });
                  this.getDetailsData()
                  this.getDetailsData();
                }
                this.isAddloading = false;
              })