| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210 |
-
- function showSelectProductDialog(pNo) {
- var productNo = pNo||$("#productNo").val();
- if (!productNo) {
- return;
- }
- let reg = new RegExp(/^s.{13}/g);
- if (!reg.test(productNo)) {
- abp.message.warn(`此产品已被弃用,只支持新产品查询使用!`);
- return;
- }
- SaveAjax({
- url: window.appUrl + 'Common/GetNewProductInfo?productNo=' + productNo,
- isValidate: false,
- isAlert: false,
- async: false,
- success: function (res) {
- if (res) {
- let model = res.model;// $("#Model").val();
- let modelNo = getNumByProductNo(productNo, 1);
- let material = res.material;// $("#Material").val();
- let materialNo = getNumByProductNo(productNo, 2);
- let rigidity = res.rigidity;//$("#Rigidity").val();
- let rigidityNo = getNumByProductNo(productNo, 3);
- let surfaceColor = res.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;
- }
- function ProductionOrderStatusFormatter(v, r) {
- var name = $("#hide-ProductionOrderStatus option[value='" + v + "']").text();
- var str = '';
- switch (v) {
- case 1:
- str += '<span class="label label-info">' + name + '</span>';
- break;
- case 2:
- str += '<span class="label label-iwb">' + name + '</span>';
- break;
- case 3:
- str += '<span class="label label-danger">' + name + '</span>';
- break;
- case 4:
- str += '<span class="label label-success">' + name + '</span>';
- if (r.isChecked) {
- str += '<span class="label label-success" style="margin-left:5px"> 已检验 </span>';
- } else {
- str += '<span class="label label-warning" style="margin-left:5px"> 待检验 </span>';
- }
- break;
- case 5:
- str += '<span class="label label-success">' + name + '</span>';
- if (r.isChecked) {
- str += '<span class="label label-success" style="margin-left:5px"> 已检验 </span>';
- } else {
- str += '<span class="label label-warning" style="margin-left:5px"> 待检验 </span>';
- }
- break;
- default:
- str += '<span class="label label-warning">' + name + '</span>';
- break;
- }
- if (r.hasExported) {
- str += '<span class="label label-success" style="margin-left:5px"> 已导出 </span>';
- }
- if (r.isLock == 'Y') {
- str += '<span class="label label-danger" style="margin-left:5px"> 已删除 </span>';
- }
- return str;
- }
|