| | |
| | | :disabled="!isOperate" |
| | | @change=" |
| | | (val) => { |
| | | commonInputChange(val, item.prop, scope.row) |
| | | commonInputChange(val, item.prop, scope.row,scope) |
| | | } |
| | | " |
| | | ></el-input> |
| | |
| | | style="width: 100%; margin-right: 5px" |
| | | @change=" |
| | | (val) => { |
| | | commonInputChange(val, item.prop, scope.row) |
| | | commonInputChange(val, item.prop, scope.row,scope) |
| | | } |
| | | " |
| | | ></el-input-number> |
| | |
| | | style="width: 100%; margin-right: 5px" |
| | | @change=" |
| | | (val) => { |
| | | commonInputChange(val, item.prop, scope.row) |
| | | commonInputChange(val, item.prop, scope.row,scope) |
| | | } |
| | | " |
| | | ></el-input-number> |
| | |
| | | {{ (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] }} |
| | |
| | | style="width: 100%; margin-right: 5px" |
| | | @change=" |
| | | (val) => { |
| | | commonInputChange(val, item.prop, scope.row) |
| | | commonInputChange(val, item.prop, scope.row,scope) |
| | | } |
| | | " |
| | | ></el-input-number> |
| | |
| | | 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) { |
| | |
| | | } |
| | | }) |
| | | } |
| | | 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) |
| | | }, |
| | | // 清空 |