charles
2024-07-24 f13d1d01c3c3cbb075e63ae02be54bbb023c13d0
src/views/productManage/silkRegisterForm/addPage.vue
@@ -30,6 +30,7 @@
                type="primary"
                :loading="isAddloading"
                @click="saveClickOne('form')"
                :disabled="title==='查看'"
                >保存</el-button
              >
            </template>
@@ -47,7 +48,7 @@
            label-width="80px"
          >
            <el-form-item label="编号" prop="number" class="form-item">
              <el-input v-model="form.number" :disabled="title=='修改'?true:false" placeholder="请输入"> </el-input>
              <el-input v-model="form.number" :disabled="title=='修改'||title=='查看'?true:false" placeholder="请输入"> </el-input>
            </el-form-item>
            <el-form-item label="落丝时间" prop="finishDate" class="form-item">
              <el-date-picker
@@ -57,6 +58,7 @@
                type="date"
                placeholder="选择日期"
                class="select-width"
                :disabled='title==="查看"'
              >
              </el-date-picker>
            </el-form-item>
@@ -66,6 +68,7 @@
                placeholder="请选择"
                class="select-width"
                @change="getGroupNumber"
                :disabled='title==="查看"'
              >
                <el-option
                  v-for="item in marketList"
@@ -81,6 +84,7 @@
                v-model="form.workshopObj"
                placeholder="请选择"
                class="select-width"
                :disabled='title==="查看"'
                @change="getGroupNumber('workshopObj')">
                <el-option
                  v-for="item in nameList"
@@ -95,6 +99,7 @@
                v-model="form.spec"
                placeholder="请选择"
                class="select-width"
                :disabled='title==="查看"'
              >
                <el-option
                  v-for="item in specList"
@@ -113,6 +118,7 @@
                placeholder="请先选择车间"
                no-data-text="请先选择车间"
                class="select-width"
                :disabled='title==="查看"'
                @change="getGroupNumber()"
              >
                <el-option
@@ -138,6 +144,7 @@
                      placeholder="请输入"
                      show-word-limit
                      class="select-width"
                      :disabled='title==="查看"'
                    ></el-input>
                  </el-form-item>
                </el-col>
@@ -154,6 +161,7 @@
                      @input="inputStart"
                      placeholder="请输入"
                      show-word-limit
                      :disabled='title==="查看"'
                      class="select-width"
                    ></el-input>
                  </el-form-item>
@@ -203,8 +211,8 @@
            type="primary"
            :loading="isAddloading"
            @click="saveClickOne('form')"
            >保存</el-button
          >
            :disabled="title==='查看'"
            >保存</el-button>
          <!-- </template>
          </CommonSearch> -->
        </div>
@@ -268,6 +276,9 @@
                    show-overflow-tooltip
                    :sortable="item.sortable"
                  >
                    <template slot-scope="scope">
                      {{scope.row[item.prop]}}
                    </template>
                  </el-table-column>
                </template>
              </el-table-column>
@@ -288,6 +299,9 @@
                    show-overflow-tooltip
                    :sortable="item.sortable"
                  >
                    <template slot-scope="scope">
                      {{scope.row[item.prop]}}
                    </template>
                  </el-table-column>
                </template>
              </el-table-column>
@@ -297,6 +311,9 @@
                width="100"
                align="center"
              >
                <template slot-scope="scope">
                  {{scope.row[item.prop]}}
                </template>
                <template v-for="(item, i) in tableTwoList.upper">
                  <el-table-column
                    align="center"
@@ -308,6 +325,9 @@
                    show-overflow-tooltip
                    :sortable="item.sortable"
                  >
                    <template slot-scope="scope">
                      {{scope.row[item.prop]}}
                    </template>
                  </el-table-column>
                </template>
              </el-table-column>
@@ -434,7 +454,8 @@
} from "@/api/productManage/silkRegisterForm.js";
import {
  getCheckDetails,
  saveCheck
  saveCheck,
    getNewCheckDetails
} from "@/api/productManage/silkInspectForm.js";
import pageMixin from "@/components/makepager/pager/mixin/pageMixin";
//import CommonFormTableView from "@/components/makepager/CommonFormTableView";
@@ -545,7 +566,8 @@
            label: "纤度值",
            prop: "fineness",
            inputNumber: true,
            isRequird: true
            isRequird: true,
              noOperate:this.$route.query.title==='查看'
          }, // 销售负责人
          {
            label: "数量",
@@ -655,8 +677,8 @@
          marketProcessOrderNumber: "",
          inspector: "",
        };
        if (this.inspectID) {
          getCheckDetails({ id: id ? id : this.inspectID }).then((response) => {
        if (this.registerId) {
          getNewCheckDetails({ id: id ? id : this.registerId }).then((response) => {
            if (response.code === 200) {
              let config = JSON.parse(
                JSON.stringify(response.data.info ? response.data.info : {})
@@ -683,11 +705,11 @@
                }
                if (round) {
                  for (let j in round) {
                    arr[i][round[j].fineness] = round[j].quantity;
                    arr[i][round[j].fineness.toString()] = round[j].quantity;
                  }
                }
              }
              this.tableTwoList.tableInfomation = arr;
                this.tableTwoList.tableInfomation = arr;
            }
          });
        }
@@ -708,7 +730,7 @@
          let item = {
            label: lowNumber + i * 0.5 + "",
            prop: lowNumber + i * 0.5 + "",
            min: 100,
            min: 50,
            default: true,
          };
          this.tableTwoList.objective.push(item);
@@ -721,7 +743,7 @@
          let item = {
            label: lowStart + i * 0.5 + "",
            prop: lowStart + i * 0.5 + "",
            min: 100,
            min: 50,
            default: true,
          };
          this.tableTwoList.lower.push(item);
@@ -734,7 +756,7 @@
          let item = {
            label: topNumber + i * 0.5 + "",
            prop: topNumber + i * 0.5 + "",
            min: 100,
            min: 50,
            default: true,
          };
          this.tableTwoList.upper.push(item);
@@ -748,7 +770,7 @@
    getSelectDataList() {
      //车间
      getDictList({
        dictType: 1,
        dictType: 2,
      }).then((res) => {
        if (res.code == 200) {
          this.nameList = res.data || [];
@@ -770,7 +792,7 @@
      // });
      //庄口
      getDictList({
        dictType: 0,
        dictType: 1,
      }).then((res) => {
        if (res.code == 200) {
          this.marketList = res.data || [];
@@ -885,14 +907,15 @@
      // } else {
      //     this.is_public = false
      // }
      this.$router.push({
      /*this.$router.push({
        path: "/productManage/silkRegisterForm/addPage",
        query: {
          activeName: this.activeName,
          inspectID: this.inspectID,
          id: this.registerId,
          title:this.title
        },
      });
      });*/
      this.getDetailsData();
      this.keyword = "";
    },
@@ -964,6 +987,7 @@
            }
            for (let i in finenessList) {
              delete finenessList[i].productId;
                finenessList[i].sum=finenessList[i].sum*1;
            }
            this.isAddloading = true;
            const mapFineness=new Map();
@@ -981,10 +1005,11 @@
                   mapFineness.set(item.position,[item]);
               }
            });
            console.log("修改",mapFineness)
            finenessList=[...mapFineness.values()].flat(Infinity);
            let params = {
              finenessList: finenessList,
              ...form,
                finenessList: finenessList,
            };
            // 编辑
            if (this.inspectID) {
@@ -1000,7 +1025,11 @@
                    message: "保存成功!",
                    type: "success",
                  });
                  this.activeName = "second"
                    if(res.data.ID){
                        this.registerId=res.data.ID;
                    }
                  this.activeName = "second";
                    this.getDetailsData();
                  // this.$router.push({
                  //   path: "/productManage/silkRegisterForm",
                  // });
@@ -1042,7 +1071,6 @@
          }
        } else {
          console.log("error submit!!");
          return false;
        }
      });