src/components/makepager/CommonFormTableView.vue
@@ -44,7 +44,7 @@
                  :disabled="!isOperate"
                  @change="
                    (val) => {
                      commonInputChange(val, item.prop, scope.row)
                      commonInputChange(val, item.prop, scope.row,scope)
                    }
                  "
                ></el-input>
@@ -105,7 +105,7 @@
                  style="width: 100%; margin-right: 5px"
                  @change="
                    (val) => {
                      commonInputChange(val, item.prop, scope.row)
                      commonInputChange(val, item.prop, scope.row,scope)
                    }
                  "
                ></el-input-number>
@@ -127,7 +127,7 @@
                  style="width: 100%; margin-right: 5px"
                  @change="
                    (val) => {
                      commonInputChange(val, item.prop, scope.row)
                      commonInputChange(val, item.prop, scope.row,scope)
                    }
                  "
                ></el-input-number>
@@ -137,7 +137,7 @@
                  {{ (scope.row.price&&scope.row.cost)?Number(scope.row.price)-Number(scope.row.cost):'' }}
                </template>
                <template v-if="pageName=='quotation'&&item.prop=='margin'">
                  {{ (scope.row.price&&scope.row.cost)?((Number(scope.row.price)-Number(scope.row.cost))*100/Number(scope.row.cost)).toFixed(2)+'%':'' }}
                  {{ (scope.row.price&&scope.row.cost)?((Number(scope.row.price)-Number(scope.row.cost))*100/Number(scope.row.cost)).toFixed(2):'' }}
                </template>
                <template v-else>
                  {{ scope.row[item.prop] }}
@@ -160,7 +160,7 @@
                style="width: 100%; margin-right: 5px"
                @change="
                  (val) => {
                    commonInputChange(val, item.prop, scope.row)
                    commonInputChange(val, item.prop, scope.row,scope)
                  }
                "
              ></el-input-number>
@@ -407,9 +407,7 @@
    add() {
      this.$emit("addProductClick")
    },
    commonInputChange(val, prop, row) {
      console.log(val, prop)
      console.log(row)
    commonInputChange(val, prop, row,scope) {
      if (prop === "amount") {
        this.tableList.tableData.map((ite) => {
          if (ite.name === row.name) {
@@ -417,6 +415,15 @@
          }
        })
      }
      if(this.pageName=='quotation'&&prop=='cost'&&scope.row.cost){
        let value=scope.row.cost
        let reg2 =
            /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/;
          if (!reg2.test(value)||value==0) {
            this.$message.error("成本单价需要填写大于0的2位小数!")
          }
        this.$forceUpdate()
      }
      this.$emit("inputContent", val, prop, row)
    },
    // 清空