瀏覽代碼

检定完善

xiongchao 3 年之前
父節點
當前提交
2088c5cfc4

+ 17 - 0
src/api/check/checkstandard.js

@@ -69,6 +69,23 @@ export function importCheckStandardOldVersion (parameter) {
   })
 }
 
+/**
+ * add func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function importCheckStandardByUpdate (parameter) {
+  return axios({
+    url: '/check/standards/import/update',
+    method: 'POST',
+    headers: {
+      'Content-Type': 'multipart/form-data;charset=UTF-8'
+    },
+    data: parameter
+  })
+}
+
 /**
  * update func
  * parameter: { }

+ 13 - 26
src/views/check/checkstandard/CheckStandard.vue

@@ -43,6 +43,10 @@
         <a-icon type="upload"/>
         老版本导入
       </a-button>
+      <a-button style="margin-left:8px;" type="primary" @click="doImportByUpdate">
+        <a-icon type="upload"/>
+        修改导入
+      </a-button>
       <a-button
         style="margin-left: 8px"
         v-if="($auth('check-spot-standards-export')||$auth('check-polling-standards-export'))"
@@ -186,40 +190,20 @@ export default {
           dataIndex: 'period',
           width: '100px',
           checked: true,
-          fixed: 'right',
           customRender: (text, record, index) => {
             return text + this.BaseTool.Table.getMapText(this.periodTypeMap, record.periodType)
           }
         },
-        /*{
-          title: '内容',
-          dataIndex: 'requirement',
-          width: '200px'
-        },
         {
-          title: '动作类型',
-          dataIndex: 'actionType',
-          customRender: (text, record, index) => {
-            return this.BaseTool.Table.getMapText(this.actionTypeMap, record.actionType)
-          }
-        },
-        {
-          title: '备注',
-          dataIndex: 'remark',
+          title: '上次执行日期',
+          dataIndex: 'lastDate',
+          fixed: 'right',
+          checked: true,
           width: '200px'
         },
         {
-          title: '是否启用',
-          dataIndex: 'enable',
-          scopedSlots: { customRender: 'enable' }
-        },
-        {
-          title: '创建人名称',
-          dataIndex: 'createdUserName'
-        },*/
-        {
-          title: '创建时间',
-          dataIndex: 'createdTime',
+          title: '预计下次执行日期',
+          dataIndex: 'nextDate',
           checked: true,
           width: '250px'
         },
@@ -359,6 +343,9 @@ export default {
     doImportOldVersion () {
       this.$refs.importModal.base(1)
     },
+    doImportByUpdate () {
+      this.$refs.importModal.base(2)
+    },
     doExport () {
       const parameter = {
         ...this.queryParam

+ 26 - 0
src/views/check/checkstandard/modules/BaseForm.vue

@@ -206,6 +206,30 @@
             </a-select>
           </a-form-item>
         </row-item>-->
+        <row-item>
+          <a-form-item
+            label="上次实际执行日期"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-date-picker
+              style="width: 100%"
+              :format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
+              v-decorator="['lastDate']" />
+          </a-form-item>
+        </row-item>
+        <row-item>
+          <a-form-item
+            label="下次预计执行日期"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-date-picker
+              style="width: 100%"
+              :format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
+              v-decorator="['nextDate']" />
+          </a-form-item>
+        </row-item>
       </row-list>
       <row-list :col="1">
         <row-item>
@@ -478,6 +502,8 @@ export default {
           // 'actionType',
           // 'enable',
           'requirement',
+          'nextDate',
+          'lastDate',
           'remark'
         ])))
       })

+ 4 - 0
src/views/check/checkstandard/modules/Detail.vue

@@ -13,6 +13,8 @@
       <detail-list-item term="检查类型">{{ BaseTool.Object.getField(typeMap,model.type) }}</detail-list-item>
       <detail-list-item term="计划周期">{{ model.period }}{{ BaseTool.Object.getField(periodTypeMap,model.periodType) }}</detail-list-item>
       <detail-list-item term="标准工时">{{ model.standardHours }}</detail-list-item>
+      <detail-list-item term="上次实际日期">{{ model.lastDate }}</detail-list-item>
+      <detail-list-item term="下次预计日期">{{ model.nextDate }}</detail-list-item>
 <!--      <detail-list-item term="动作类型">{{ BaseTool.Object.getField(actionTypeMap,model.actionType) }}</detail-list-item>-->
       <detail-list-item term="部位">{{ model.partName }}</detail-list-item>
 <!--      <detail-list-item term="是否启用"><badge :status="DictCache.COLOR.YES_NO[model.enable]" :text="enableMap[model.enable]"></badge></detail-list-item>-->
@@ -104,6 +106,8 @@ export default {
         'requirement': null,
         'standardHours': null,
         'remark': null,
+        'nextDate': null,
+        'lastDate': null,
         'createdUserId': null,
         'updateUserId': null,
         'updateUserName': null,

+ 14 - 0
src/views/check/checkstandard/modules/DetailSbCheck.vue

@@ -157,6 +157,20 @@ export default {
           title: '标准工时',
           dataIndex: 'standardHours'
         },
+        {
+          title: '上次执行日期',
+          dataIndex: 'lastDate',
+          fixed: 'right',
+          checked: true,
+          width: '250px'
+        },
+        {
+          title: '预计下次执行日期',
+          dataIndex: 'nextDate',
+          fixed: 'right',
+          checked: true,
+          width: '250px'
+        },
         {
           title: '操作',
           key: 'action',

+ 27 - 4
src/views/check/checkstandard/modules/ImportFormAdd.vue

@@ -32,13 +32,13 @@
     </p>
     <template slot="footer">
       <a-button :loading="confirmLoading" v-show="data.length===0" type="primary" @click="save()">确定</a-button>
-      <a-button :loading="confirmLoading" type="primary" @click="handleCancel">关闭</a-button>
+      <a-button type="primary" @click="handleCancel">关闭</a-button>
     </template>
   </a-modal>
 </template>
 
 <script>
-import { importCheckStandard, importCheckStandardOldVersion } from '@/api/check/checkstandard'
+import { importCheckStandard, importCheckStandardOldVersion, importCheckStandardByUpdate } from '@/api/check/checkstandard'
 
 export default {
   name: 'SbModelBomImportForm',
@@ -121,7 +121,7 @@ export default {
         this.fileList.forEach(function (file) {
           formData.append('files', file, file.name)
         })
-        if (this.type !== 1) {
+        if (this.type === 0) {
           importCheckStandard(formData)
             .then((res) => {
               // 循环添加到formData中
@@ -144,7 +144,7 @@ export default {
             }).catch(() => {
               this.confirmLoading = false
             })
-        } else {
+        } else if (this.type === 1) {
           importCheckStandardOldVersion(formData)
             .then((res) => {
               // 循环添加到formData中
@@ -167,6 +167,29 @@ export default {
             }).catch(() => {
               this.confirmLoading = false
             })
+        } else {
+          importCheckStandardByUpdate(formData)
+            .then((res) => {
+              // 循环添加到formData中
+              const resultArr = res.data.split(';')
+              const result = []
+              for (let i = 0; i < resultArr.length; i++) {
+                const r = resultArr[i]
+                if (r.indexOf('成功') === 0) {
+                  result.push({ id: i, name: r, status: '成功' })
+                } else if (r.indexOf('失败') === 0) {
+                  result.push({ id: i, name: r, status: '失败', reason: r.split(':')[2] })
+                }
+              }
+              this.$message.success('导入结束,请查看结果表格')
+              this.data = result
+              // this.handleCancel(values)
+              this.BaseTool.ListForm.clearOneList(this)
+              this.fileList = []
+              this.BaseTool.ListForm.pushOneListAddMore(this, res.data)
+            }).catch(() => {
+              this.confirmLoading = false
+            })
         }
       })
     },

+ 1 - 1
src/views/repair/application-form/modules/DetailRepair.vue

@@ -8,7 +8,7 @@
             <a-button v-if="showSbFlag" style="margin-left: 16px" type="default" @ok="handleOk" @click="handleViewCheck()">保养项目</a-button>
             <a-button v-if="$auth('repair-application-forms-assign') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ALLOCATED === model.status" type="primary" @click="handleAssign">派工</a-button>
             <a-popconfirm v-if="$auth('repair-application-forms-deal') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ALLOCATED === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.ALLOCATED === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)" title="是否要接收?" @confirm="receive">
-              <a-button style="margin-left: 8px" style="margin-left: 16px">接收</a-button>
+              <a-button style="margin-left: 8px">接收</a-button>
             </a-popconfirm>
             <a-button v-if="$auth('repair-application-forms-out') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING >= model.status) && model.type != 2" style="margin-left: 8px" type="primary" @click="handleOut">委外</a-button>
             <a-button v-if="$auth('repair-application-forms-dispatch') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.ALLOCATED === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)" style="margin-left: 8px" type="primary" @click="handleDispatch">转派</a-button>