Просмотр исходного кода

切换到没有模板的模板分类下,清空设置列表等

MaiXinRong 20 часов назад
Родитель
Сommit
4996814adf
2 измененных файлов с 4 добавлено и 3 удалено
  1. 3 2
      app/public/js/pos_calc_tmpl.js
  2. 1 1
      app/view/template/pos_calc.ejs

+ 3 - 2
app/public/js/pos_calc_tmpl.js

@@ -436,6 +436,7 @@ $(document).ready(() => {
             if (!curTemplate) {
                 $('#detail-user-info').html('');
                 $('#detail-ctrl').hide();
+                detailObj.loadDetail(curTemplate);
             } else {
                 $('#detail-ctrl').hide();
                 if (!curTemplate.col_set) await this.loadTemplateDetail(curTemplate);
@@ -790,12 +791,12 @@ $(document).ready(() => {
             SpreadJsObj.loadSheetData(this.sheet, SpreadJsObj.DataType.Data, this.colSetData);
         }
         reset() {
-            this.colSetData = JSON.parse(JSON.stringify(this.template.col_set));
+            this.colSetData = this.template ? JSON.parse(JSON.stringify(this.template.col_set)) : [];
             SpreadJsObj.loadSheetData(this.sheet, SpreadJsObj.DataType.Data, this.colSetData);
         }
         loadDetail(template) {
             this.template = template;
-            this.readOnly = this.template.used_count > 0;
+            this.readOnly = this.template ? this.template.used_count > 0 : true;
             if (!this.firstShowDone) {
                 this.spread.refresh();
                 this.firstShowDone = true;

+ 1 - 1
app/view/template/pos_calc.ejs

@@ -36,7 +36,7 @@
             <div class="row">
                 <div class="col-3">
                     <div id="folder-spread" class="sjs-height-1"></div>
-                    <div class="bcontent-wrap" id="main-bottom" style="height: 200px;">
+                    <div class="bcontent-wrap" id="main-bottom" style="height: 600px;">
                         <div class="bc-bar mb-1 d-flex">
                             <div class="d-inline-block">
                                 <ul class="nav nav-tabs">