|
@@ -22,13 +22,20 @@ $("select[name='category']").on("change", function() {
|
|
|
$("select[name='hairtype']").on("change", function() {
|
|
|
checkBendang($(this))
|
|
|
})
|
|
|
+//人发头套编号 hairnumber
|
|
|
+$("select[name='hairnumber']").change(function(){
|
|
|
+ checkGrade();
|
|
|
+})
|
|
|
//等级
|
|
|
$("select[name='grade']").on("change", function() {
|
|
|
checkColorGrade($(this))
|
|
|
})
|
|
|
//颜色
|
|
|
$("select[name='color']").on("change", function() {
|
|
|
+
|
|
|
+ checkGrade();
|
|
|
checkColorGrade($(this))
|
|
|
+
|
|
|
})
|
|
|
|
|
|
/**
|
|
@@ -87,14 +94,14 @@ function checkColorGrade(that) {
|
|
|
let ysdj = $("select[name='color']:visible").find("option:selected").data('ysdj')
|
|
|
|
|
|
let arr = [1297,1702];
|
|
|
- console.log("执行613检测")
|
|
|
- console.log("类目:"+category_value)
|
|
|
- console.log(!arr.includes(category_value*1))
|
|
|
- console.log("等级:"+grade_value)
|
|
|
- console.log("颜色:"+color_value)
|
|
|
+ // console.log("执行613检测")
|
|
|
+ // console.log("类目:"+category_value)
|
|
|
+ // console.log(!arr.includes(category_value*1))
|
|
|
+ // console.log("等级:"+grade_value)
|
|
|
+ // console.log("颜色:"+color_value)
|
|
|
if(!arr.includes(category_value)){
|
|
|
if (grade_value == 80 && color_value == 44) {
|
|
|
- that.val("")
|
|
|
+ //that.val("")
|
|
|
layx.alert('错误', '当颜色选择是#613时,不可将等级勾选为9A', function(id, button) {
|
|
|
$("select[name='grade']").val(ysdj)
|
|
|
}, { dialogIcon: 'error' });
|
|
@@ -103,3 +110,46 @@ function checkColorGrade(that) {
|
|
|
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+function checkGrade(){
|
|
|
+ let grade = $("select[name='grade']:visible").find("option:selected").val();
|
|
|
+ let color = $("select[name='color']:visible").find("option:selected").data("ysdj");
|
|
|
+ let hairnumber = $("select[name='hairnumber']:visible").find("option:selected").data("ysdj");
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if( color && hairnumber){
|
|
|
+ color = color*1
|
|
|
+ hairnumber = hairnumber*1
|
|
|
+ if(color > 0 && hairnumber > 0){
|
|
|
+ if(color != hairnumber){
|
|
|
+ $("select[name='color']").val(57)
|
|
|
+ $("select[name='hairnumber']").val('')
|
|
|
+ $("select[name='grade'] option[value='80']").prop('selected', true);
|
|
|
+ layx.alert('错误', '颜色设置的等级和人发头套编码设置的等级不一致,请重新选择', function(id, button) {
|
|
|
+
|
|
|
+ }, { dialogIcon: 'error' });
|
|
|
+ return false;
|
|
|
+ }else{
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else if(color){
|
|
|
+ var ysdj = $(this).find("option:selected").data("ysdj");
|
|
|
+ var category = $("select[name='category']").find("option:selected").val();
|
|
|
+ if (category == 126 || category == 127 || category == 128 || category == 130 || category == 133) {
|
|
|
+ if ($(this).find("option:selected").data("ysdj") != 0) {
|
|
|
+ $("select[name='grade'] option[value='" + ysdj + "']").prop('selected', true);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ $("select[name='grade'] option[value='80']").prop('selected', true);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+
|