提交 d13b0cda authored 作者: huaxinzhu's avatar huaxinzhu

起批量校验

上级 f5541a03
......@@ -91,7 +91,8 @@
</el-table-column>
<el-table-column align="center" prop="" label="起订量" >
<template slot-scope="scope">
<el-input size="mini" style="width:90%" v-model.number="scope.row.quantity" placeholder="起订量" ></el-input>
<el-input size="mini" style="width:90%" v-model.number="scope.row.quantity" placeholder="起订量"
@input="oninput(scope.$index,scope.row,1)"></el-input>
</template>
</el-table-column>
<el-table-column align="center" prop="" label="价格" >
......@@ -319,6 +320,7 @@
<template slot-scope="scope">
<el-input size="mini" v-for="(iten,inde) in scope.row.ladder" :key="inde" style="width:90%"
v-model.number="scope.row.ladder[inde].quantity" placeholder="请输入"
@input="oninput2(scope.$index,inde,scope.row.ladder[inde])"
class="custom-el-input-con"></el-input>
</template>
</el-table-column>
......@@ -361,6 +363,7 @@
<script>
import { UploadImg } from '@/api/module/goods';
import { debounce } from "@/utils";
export default {
name: 'goodsparameter',
props: {
......@@ -411,6 +414,12 @@ export default {
pos0: "",
pos1: "",
},
scopeIndex: 0,
scopeRow: {},
specIndex: 0,
scopeIndex2: 0,
scopeRow2: {},
} // return end
},
watch:{
......@@ -455,6 +464,42 @@ export default {
this.$bus.$off('customPriceSpec')
},
methods: {
oninput(a,b,type) {
this.scopeIndex = a;
this.scopeRow = b;
this.debounceOninput();
},
// 单规格
debounceOninput: debounce(function(){
if (this.scopeIndex > 0) {
if(this.scopeRow.quantity <= this.parameterdata.ladder[this.scopeIndex - 1].quantity) {
this.$message({type: "warning",message: "当前数量应该比前一个数量值大"});
}
}
},500),
// 多规格
oninput2(a,b,c) {
this.specIndex = a;
this.scopeIndex2 = b;
this.scopeRow2 = c;
this.debounceOninput2();
},
debounceOninput2: debounce(function(){
console.log(333,this.specIndex)
console.log(444,this.scopeIndex2)
console.log(555,this.scopeRow2)
console.log(666,this.parameterdata.specs_group)
// if (this.scopeIndex > 0) {
// if(this.scopeRow.quantity <= this.parameterdata.ladder[this.scopeIndex - 1].quantity) {
// this.$message({type: "warning",message: "当前数量应该比前一个数量值大"});
// }
// }
if(this.scopeIndex2 > 0) {
if(this.scopeRow2.quantity <= this.parameterdata.specs_group[this.specIndex].ladder[this.scopeIndex2-1].quantity) {
this.$message({type: "warning",message: "当前数量应该比前一个数量值大"});
}
}
},500),
/** 初始化 商品售价 数据 */
initInfo() {
this.orgGoodsPam = {};
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论