function showSelectProductDialog() {
var productNo = $("#productNo").val();
if (!productNo) {
return;
}
let reg = new RegExp(/^s.{13}/g);
if (!reg.test(productNo)) {
abp.message.warn(`此产品已被弃用,只支持新产品查询使用!`);
return;
}
let model = $("#Model").val();
let modelNo = getNumByProductNo(productNo, 1);
let material = $("#Material").val();
let materialNo = getNumByProductNo(productNo, 2);
let rigidity = $("#Rigidity").val();
let rigidityNo = getNumByProductNo(productNo, 3);
let surfaceColor = $("#SurfaceColor").val();
let surfaceColorNo = getNumByProductNo(productNo, 4);
tmpSearch[0].KeyWords = 's' + modelNo;
if (isFirstEnter) {
initQueryTable();
} else {
$tableProductionOrder.iwbTable('setSearchList', tmpSearch);
$tableProductionOrder.iwbTable('refresh');
$tableProductStore.iwbTable('setSearchList', tmpSearch);
$tableProductStore.iwbTable('refresh');
$tableSemiStore.iwbTable('setSearchList', tmpSearch);
$tableSemiStore.iwbTable('refresh');
}
$('.tool-rc-group').html(
`
`);
$('.tool-rc-group input[name="propType"]').on('change',
function(e) {
let $checkbox = $(this);
let flag = $checkbox.is(':checked');
let $as = $('.tool-rc-group input[name="propType"]');
if (flag) {
$.each($as,
function(i, v) {
if ($(v).data('index') < $checkbox.data('index')) {
$(v).prop("checked", "checked");
}
});
} else {
$.each($as,
function (i, v) {
if ($(v).data('index') > $checkbox.data('index')) {
$(v).prop("checked", false);
}
});
}
searchProductInfo();
e.stopPropagation();
});
$("#modal_queryProductionStore").modal('show');
}
var isFirstEnter = true;
function initQueryTable() {
console.log(tmpSearch)
$tableProductionOrder = LoadTable1(
{
table: $("#tableProductionOrder"),
height: 480,
//isPage: false,
//modal: "modalItem",
//searchForm: "itemSearch",
searchValidate: false,
searchList: tmpSearch,
onlySearchList: true,
});
$tableProductStore = LoadTable1(
{
table: $("#tableProductStore"),
height: 480,
//isPage: false,
//modal: "modalItem",
//searchForm: "itemSearch",
searchValidate: false,
searchList: tmpSearch,
onlySearchList: true,
});
$tableSemiStore = LoadTable1(
{
table: $("#tableSemiStore"),
height: 480,
//isPage: false,
//modal: "modalItem",
//searchForm: "itemSearch",
searchValidate: false,
searchList: tmpSearch,
onlySearchList: true,
});
}
function LoadTable1(option) {
if (!option) {
option = { table: "table" };
}
option.table = option.table ? option.table : "table";
var $table = typeof option.table === 'string' ? $('#' + option.table) : $(option.table);
if ($table.length < 1) {
console.log('没有发现表格:', option.table);
}
$table.iwbTable(option);
return $table;
}
//item
var $tableProductionOrder, $tableProductStore, $tableSemiStore;
var tmpSearch = [
{ KeyWords: "0", KeyField: "ProductNo", FieldType: "1", ExpType: "0" }
];
function searchProductInfo() {
isFirstEnter = false;
let proNo = '';
let $as = $('.tool-rc-group input[name="propType"]');
$.each($as,
function (i, v) {
if ($(v).is(':checked')) {
proNo += $(v).val();
}
});
console.log('proNo', proNo);
tmpSearch[0].KeyWords = 's' + proNo;
$tableProductionOrder.iwbTable('setSearchList', tmpSearch);
$tableProductionOrder.iwbTable('refresh');
$tableProductStore.iwbTable('setSearchList', tmpSearch);
$tableProductStore.iwbTable('refresh');
$tableSemiStore.iwbTable('setSearchList', tmpSearch);
$tableSemiStore.iwbTable('refresh');
}
function getNumByProductNo(pNo, type) {
let result = '';
switch (type) {
case 1:
result = pNo.substr(1, 4);//规格
break;
case 2:
result = pNo.substr(5, 2);//材质
break;
case 3:
result = pNo.substr(7, 2);//硬度
break;
case 4:
result = pNo.substr(9, 3);//表色
break;
default:
break;
}
return result;
}