|  | @@ -1,4 +1,16 @@
 | 
	
		
			
				|  |  |  // 分类表
 | 
	
		
			
				|  |  | +function setTimeoutSync(handle, time) {
 | 
	
		
			
				|  |  | +  return new Promise(function (resolve, reject) {
 | 
	
		
			
				|  |  | +    setTimeout(function () {
 | 
	
		
			
				|  |  | +      if (handle && typeof handle === 'function') {
 | 
	
		
			
				|  |  | +        handle();
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +      resolve();
 | 
	
		
			
				|  |  | +    }, time);
 | 
	
		
			
				|  |  | +  });
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +// 分类表
 | 
	
		
			
				|  |  |  const CLASS_BOOK = (() => {
 | 
	
		
			
				|  |  |    const setting = {
 | 
	
		
			
				|  |  |      header: [{ headerName: '分类', headerWidth: $('#area-spread').width(), dataCode: 'name', dataType: 'String', hAlign: 'left', vAlign: 'center' }],
 | 
	
	
		
			
				|  | @@ -104,6 +116,7 @@ const CLASS_BOOK = (() => {
 | 
	
		
			
				|  |  |    const $upMove = $('#tree-up-move');
 | 
	
		
			
				|  |  |    const $calcPriceIndex = $('#calc-price-index');
 | 
	
		
			
				|  |  |    const $matchSummary = $('#match-summary');
 | 
	
		
			
				|  |  | +  const $batchMatchSummary = $('#batch-match-summary');
 | 
	
		
			
				|  |  |    const $showEmpty = $('#show-empty');
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    // 插入
 | 
	
	
		
			
				|  | @@ -457,6 +470,10 @@ const CLASS_BOOK = (() => {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    }, DEBOUNCE_TIME, { leading: true }));
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +  const doMatchSummary = async (libID, compilationID, areaID) => {
 | 
	
		
			
				|  |  | +    await ajaxPost('/priceInfo/matchSummary', { libID, compilationID, areaID }, 1000 * 60 * 10);
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |    // 匹配总表
 | 
	
		
			
				|  |  |    $matchSummary.click(_.debounce(async () => {
 | 
	
		
			
				|  |  |      $.bootstrapLoading.progressStart('匹配总表', true);
 | 
	
	
		
			
				|  | @@ -464,11 +481,31 @@ const CLASS_BOOK = (() => {
 | 
	
		
			
				|  |  |      try {
 | 
	
		
			
				|  |  |        const matchAll = $('#match-all-input')[0].checked;
 | 
	
		
			
				|  |  |        const areaID = matchAll ? '' : AREA_BOOK.curArea?.ID;
 | 
	
		
			
				|  |  | -      debugger;
 | 
	
		
			
				|  |  | -      await ajaxPost('/priceInfo/matchSummary', { libID, compilationID, areaID }, 1000 * 60 * 10);
 | 
	
		
			
				|  |  | +      await doMatchSummary(libID, compilationID, areaID);
 | 
	
		
			
				|  |  |        setTimeout(() => {
 | 
	
		
			
				|  |  |          $.bootstrapLoading.progressEnd();
 | 
	
		
			
				|  |  |          window.location.reload()
 | 
	
		
			
				|  |  | +      }, 1000)
 | 
	
		
			
				|  |  | +    } catch (error) {
 | 
	
		
			
				|  |  | +      alert(error)
 | 
	
		
			
				|  |  | +      console.log(error);
 | 
	
		
			
				|  |  | +      $.bootstrapLoading.progressEnd();
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +  }, DEBOUNCE_TIME, { leading: true }));
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  // 批量匹配总表
 | 
	
		
			
				|  |  | +  $batchMatchSummary.click(_.debounce(async () => {
 | 
	
		
			
				|  |  | +    $.bootstrapLoading.progressStart('批量匹配总表', true);
 | 
	
		
			
				|  |  | +    try {
 | 
	
		
			
				|  |  | +      const libs = await ajaxPost('/priceInfo/getAllLibs');
 | 
	
		
			
				|  |  | +      for (const lib of libs) {
 | 
	
		
			
				|  |  | +        $("#progress_modal_body").text(`${lib.name},正在匹配总表,请稍后(${libs.indexOf(lib) + 1}/${libs.length})...`);
 | 
	
		
			
				|  |  | +        await doMatchSummary(lib.ID, lib.compilationID, '');
 | 
	
		
			
				|  |  | +        await setTimeoutSync(() => { }, 100);
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +      await setTimeoutSync(() => {
 | 
	
		
			
				|  |  | +        $.bootstrapLoading.progressEnd();
 | 
	
		
			
				|  |  | +        window.location.reload()
 | 
	
		
			
				|  |  |        }, 1000);
 | 
	
		
			
				|  |  |      } catch (error) {
 | 
	
		
			
				|  |  |        alert(error)
 |