zhangjie 1 year ago
parent
commit
98810b895b
1 changed files with 13 additions and 3 deletions
  1. 13 3
      src/modules/base/components/ModifyPrintTemplate.vue

+ 13 - 3
src/modules/base/components/ModifyPrintTemplate.vue

@@ -71,6 +71,7 @@
             v-for="field in signDatas.table"
             :key="field.code"
             v-model="field.enable"
+            :disabled="field.code === 'studentSign'"
             @change="signFieldChange"
             >{{ field.name }}</el-checkbox
           >
@@ -130,8 +131,8 @@
                   :step="1"
                   step-strictly
                   :controls="false"
-                  style="width: 100%"
                 ></el-input-number>
+                <span class="ml-1">%</span>
               </template>
             </el-table-column>
           </el-table>
@@ -244,8 +245,11 @@ export default {
       if (this.signTableDatas.some((item) => !item.rate)) {
         return callback(new Error("请完成设置"));
       }
-      if (calcSum(this.signTableDatas.map((item) => item.rate)) !== 100) {
-        return callback(new Error("宽度总和需要等于100"));
+      const rateSum = calcSum(this.signTableDatas.map((item) => item.rate));
+      if (rateSum !== 100) {
+        return callback(
+          new Error(`宽度总和需要等于100,当前总和为 ${rateSum}`)
+        );
       }
       return callback();
     };
@@ -352,6 +356,12 @@ export default {
       this.signDatas.table = this.SIGN_DATA.table.map((item) => {
         return { ...item, rate: undefined, enable: false };
       });
+      this.signDatas.table.push({
+        code: "studentSign",
+        name: "签名",
+        rate: undefined,
+        enable: true,
+      });
     },
     initEditFieldData(data) {
       const displayRange = data.displayRange