whj 11 months ago
parent
commit
1f3c8a101c
1 changed files with 18 additions and 13 deletions
  1. 18 13
      src/views/sb/info/modules/BaseFormMeasure.vue

+ 18 - 13
src/views/sb/info/modules/BaseFormMeasure.vue

@@ -16,7 +16,7 @@
     </a-row>
     </a-row>
     <div>
     <div>
       <div class="tables">
       <div class="tables">
-        <div style="text-align:center;padding-bottom:10px;font-size:32px;">数字工厂检定表</div>
+        <div style="text-align:center;padding-bottom:10px;font-size:32px;">时代思康检定表</div>
         <div style="display:flex; justify-content: space-between;">
         <div style="display:flex; justify-content: space-between;">
           <div> 检定人:{{ username }}</div>
           <div> 检定人:{{ username }}</div>
         </div>
         </div>
@@ -25,14 +25,14 @@
             <tr>
             <tr>
               <th width="100px">序号</th>
               <th width="100px">序号</th>
               <!-- <th width="150px">是否在库</th> -->
               <!-- <th width="150px">是否在库</th> -->
-              <th width="150px">设备名称</th>
+              <!-- <th width="150px">设备名称</th>
               <th width="150px">型号</th>
               <th width="150px">型号</th>
-              <th width="150px">出厂编号</th>
+              <th width="150px">出厂编号</th> -->
               <!-- <th width="150px">是否是子设备</th>-->
               <!-- <th width="150px">是否是子设备</th>-->
               <!-- <th width="150px">设备位置</th> -->
               <!-- <th width="150px">设备位置</th> -->
               <!-- <th width="350px">选择父设备</th> -->
               <!-- <th width="350px">选择父设备</th> -->
               <th width="150px">设备位号</th>
               <th width="150px">设备位号</th>
-              <!-- <th width="150px">检定周期</th> -->
+              <th width="150px">检定周期</th>
               <th width="150px">检定日期</th>
               <th width="150px">检定日期</th>
               <th width="150px">下次检定日期</th>
               <th width="150px">下次检定日期</th>
               <th width="150px">检定单号</th>
               <th width="150px">检定单号</th>
@@ -48,9 +48,9 @@
                 <a-icon slot="checkedChildren" type="check" />
                 <a-icon slot="checkedChildren" type="check" />
                 <a-icon slot="unCheckedChildren" type="close" />
                 <a-icon slot="unCheckedChildren" type="close" />
               </a-switch></td> -->
               </a-switch></td> -->
-              <td>{{ item.sbName }}</td>
+              <!-- <td>{{ item.sbName }}</td>
               <td>{{ item.sbModel }}</td>
               <td>{{ item.sbModel }}</td>
-              <td><div> {{ item.zzh }}</div></td>
+              <td><div> {{ item.zzh }}</div></td> -->
               <!--              <td>
               <!--              <td>
                 <a-switch v-model="item.isChild" >
                 <a-switch v-model="item.isChild" >
                   <a-icon slot="checkedChildren" type="check" />
                   <a-icon slot="checkedChildren" type="check" />
@@ -93,7 +93,9 @@
                   <a-button v-if="item.isChild === 1" type="primary" @click="handleSbNoSelect(item.sbParentId,i)">选择</a-button>
                   <a-button v-if="item.isChild === 1" type="primary" @click="handleSbNoSelect(item.sbParentId,i)">选择</a-button>
                 </div> -->
                 </div> -->
               </td>
               </td>
-              <!-- <td><a-input v-model="item.checkPeriod" suffix="月" /></td> -->
+              <td> {{ item.checkPeriod }}
+                <!-- <a-input v-model="item.checkPeriod" suffix="月" /> -->
+              </td>
               <td>
               <td>
                 <a-date-picker
                 <a-date-picker
                   placeholder="日期"
                   placeholder="日期"
@@ -102,13 +104,13 @@
                   v-model="item.lastDate" />
                   v-model="item.lastDate" />
                 <a-button type="primary" @click="handlePace(item.lastDate,'lastDate')">同步</a-button>
                 <a-button type="primary" @click="handlePace(item.lastDate,'lastDate')">同步</a-button>
               </td>
               </td>
-              <!-- <td>{{ validity(item.lastDate,item.checkPeriod) }}</td> -->
-              <td>  <a-date-picker
+              <td>{{ validity(item.lastDate,item.checkPeriod,item) }}</td>
+              <!-- <td>  <a-date-picker
                       placeholder="日期"
                       placeholder="日期"
                       style="width: 150px"
                       style="width: 150px"
                       :format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
                       :format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
                       v-model="item.youXiaoDate" />
                       v-model="item.youXiaoDate" />
-                <a-button type="primary" @click="handlePace(item.youXiaoDate,'youXiaoDate')">同步</a-button></td>
+                <a-button type="primary" @click="handlePace(item.youXiaoDate,'youXiaoDate')">同步</a-button></td> -->
 
 
               <td><a-input style="width: 150px" v-model="item.no" /><a-button type="primary" @click="handlePace(item.no,'no')">同步</a-button></td>
               <td><a-input style="width: 150px" v-model="item.no" /><a-button type="primary" @click="handlePace(item.no,'no')">同步</a-button></td>
               <td><a-input style="width: 150px" v-model="item.requirement" /><a-button type="primary" @click="handlePace(item.requirement,'requirement')">同步</a-button></td>
               <td><a-input style="width: 150px" v-model="item.requirement" /><a-button type="primary" @click="handlePace(item.requirement,'requirement')">同步</a-button></td>
@@ -223,14 +225,17 @@ export default {
 
 
   },
   },
   methods: {
   methods: {
-    validity (lastDate, checkPeriod) {
+    validity (lastDate, checkPeriod, record) {
       if (lastDate === '') return ''
       if (lastDate === '') return ''
       lastDate = this.BaseTool.Date.formatter(lastDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN).split('-')
       lastDate = this.BaseTool.Date.formatter(lastDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN).split('-')
       lastDate[1] = (parseInt(lastDate[1]) + parseInt(checkPeriod)) % 12
       lastDate[1] = (parseInt(lastDate[1]) + parseInt(checkPeriod)) % 12
       lastDate[0] = +lastDate[0] + Math.floor((parseInt(lastDate[1]) + parseInt(checkPeriod)) / 12)
       lastDate[0] = +lastDate[0] + Math.floor((parseInt(lastDate[1]) + parseInt(checkPeriod)) / 12)
       if (lastDate[1] === 0) {
       if (lastDate[1] === 0) {
         lastDate[1] = 12
         lastDate[1] = 12
+      } else if (lastDate[1] > 0 && lastDate[1] < 10) {
+        lastDate[1] = '0' + lastDate[1]
       }
       }
+      record.youXiaoDate = lastDate.join('-')
       return lastDate.join('-')
       return lastDate.join('-')
     },
     },
     base (record, type) {
     base (record, type) {
@@ -241,7 +246,7 @@ export default {
         const data = {
         const data = {
           sbName: item.name,
           sbName: item.name,
           sbModel: item.model,
           sbModel: item.model,
-          // checkPeriod: item.checkPeriod || 0,
+          checkPeriod: item.checkPeriod || 0,
           isChild: item.isChild,
           isChild: item.isChild,
           parentSbName: item.parentSbName,
           parentSbName: item.parentSbName,
           sbParentId: item.parentId,
           sbParentId: item.parentId,
@@ -404,7 +409,7 @@ export default {
           const data = {
           const data = {
             sbName: item.name,
             sbName: item.name,
             sbModel: item.model,
             sbModel: item.model,
-            // checkPeriod: item.checkPeriod || 0,
+            checkPeriod: item.checkPeriod || 0,
             isChild: item.isChild,
             isChild: item.isChild,
             parentSbName: item.parentSbName,
             parentSbName: item.parentSbName,
             sbParentId: item.parentId,
             sbParentId: item.parentId,