| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- 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(
- `<label style=" margin-right: 10px; font-size: 1.5rem;" class="iwb-checkbox"><input name="propType" data-index="1" type="checkbox" disabled checked value="${
- modelNo}" /><span></span>规格:(${model})</label>
- <label style=" margin-right: 10px; font-size: 1.5rem;" class="iwb-checkbox"><input name="propType" data-index="2" type="checkbox" value="${
- materialNo}" /><span></span>材质:(${material})</label>
- <label style=" margin-right: 10px; font-size: 1.5rem;" class="iwb-checkbox"><input name="propType" data-index="3" type="checkbox" value="${
- rigidityNo}" /><span></span>硬度:(${rigidity})</label>
- <label style=" margin-right: 10px; font-size: 1.5rem;" class="iwb-checkbox"><input name="propType" data-index="4" type="checkbox" value="${
- surfaceColorNo}" /><span></span>表色:(${surfaceColor})</label >`);
- $('.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;
- }
|