Jelajahi Sumber

分页套打

xiongchao 3 tahun lalu
induk
melakukan
a91cc47716

+ 67 - 54
src/api/repair/repair-reason.js

@@ -8,13 +8,13 @@ import { stringify } from 'qs'
  * @returns {*}
  */
 export function getRepairReasonPage (parameter) {
-    return axios({
-        url: '/repair/repair-reasons/page?' + stringify(parameter),
-        method: 'get',
-        headers: {
-            'Content-Type': 'application/json;charset=UTF-8'
-        }
-    })
+  return axios({
+    url: '/repair/repair-reasons/page?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
 }
 
 /**
@@ -24,15 +24,15 @@ export function getRepairReasonPage (parameter) {
  * @returns {*}
  */
 export function addRepairReason (parameter) {
-    return axios({
-        url: '/repair/repair-reasons',
-        method: 'POST',
-        headers: {
-            'Accept': 'application/json',
-            'Content-Type': 'application/json;charset=UTF-8'
-        },
-        data: parameter
-    })
+  return axios({
+    url: '/repair/repair-reasons',
+    method: 'POST',
+    headers: {
+      'Accept': 'application/json',
+      'Content-Type': 'application/json;charset=UTF-8'
+    },
+    data: parameter
+  })
 }
 
 /**
@@ -42,11 +42,25 @@ export function addRepairReason (parameter) {
  * @returns {*}
  */
 export function updateRepairReason (parameter) {
-    return axios({
-        url: '/repair/repair-reasons/' + parameter.id,
-        method: 'PUT',
-        data: parameter
-    })
+  return axios({
+    url: '/repair/repair-reasons/' + parameter.id,
+    method: 'PUT',
+    data: parameter
+  })
+}
+
+/**
+ * update func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function finishRepairReason (parameter) {
+  return axios({
+    url: '/repair/repair-reasons/finish/' + parameter.id,
+    method: 'PUT',
+    data: parameter
+  })
 }
 
 /**
@@ -72,13 +86,13 @@ export function queryNumRepairReason (parameter) {
  * @returns {*}
  */
 export function fetchRepairReason (parameter) {
-    return axios({
-        url: '/repair/repair-reasons/' + parameter.id,
-        method: 'get',
-        headers: {
-            'Content-Type': 'application/json;charset=UTF-8'
-        }
-    })
+  return axios({
+    url: '/repair/repair-reasons/' + parameter.id,
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
 }
 
 /**
@@ -88,13 +102,13 @@ export function fetchRepairReason (parameter) {
  * @returns {*}
  */
 export function queryRepairReason (parameter) {
-    return axios({
-        url: '/repair/repair-reasons?' + stringify(parameter),
-        method: 'get',
-        headers: {
-            'Content-Type': 'application/json;charset=UTF-8'
-        }
-    })
+  return axios({
+    url: '/repair/repair-reasons?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
 }
 
 /**
@@ -104,11 +118,11 @@ export function queryRepairReason (parameter) {
  * @returns {*}
  */
 export function deleteRepairReasons (parameter) {
-    return axios({
-        url: '/repair/repair-reasons',
-        method: 'DELETE',
-        data: parameter
-    })
+  return axios({
+    url: '/repair/repair-reasons',
+    method: 'DELETE',
+    data: parameter
+  })
 }
 
 /**
@@ -118,14 +132,13 @@ export function deleteRepairReasons (parameter) {
  * @returns {*}
  */
 export function deleteRepairReason (parameter) {
-    return axios({
-        url: '/repair/repair-reasons/' + parameter.id,
-        method: 'DELETE',
-        data: parameter
-    })
+  return axios({
+    url: '/repair/repair-reasons/' + parameter.id,
+    method: 'DELETE',
+    data: parameter
+  })
 }
 
-
 /**
  * export file
  * parameter: { }
@@ -133,12 +146,12 @@ export function deleteRepairReason (parameter) {
  * @returns {*}
  */
 export function exportRepairReason (parameter) {
-    return axios({
-        url: '/repair/repair-reasons/export?' + stringify(parameter),
-        method: 'get',
-        headers: {
-            'Content-Type': 'application/json;charset=UTF-8'
-        },
-        responseType: 'blob'
-    })
+  return axios({
+    url: '/repair/repair-reasons/export?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    },
+    responseType: 'blob'
+  })
 }

+ 1 - 0
src/utils/dict.js

@@ -117,6 +117,7 @@ DictCache.TYPE = {
   REPAIR_APPLICATION_FORM_SOURCE: 'REPAIR_APPLICATION_FORM_SOURCE', // 报修来源
   REPAIR_APPLICATION_FORM_LEVEL: 'REPAIR_APPLICATION_FORM_LEVEL', // 紧急等级
   REPAIR_APPLICATION_FORM_STATUS: 'REPAIR_APPLICATION_FORM_STATUS', // 报修状态
+  REPAIR_REASON_STATUS: 'REPAIR_REASON_STATUS', // 分析措施状态
   REPAIR_QUESTION: 'REPAIR_QUESTION', // 故障描述
   YES_NO: 'YES_NO', // 是否
   REPAIR_FORM_STATUS: 'REPAIR_FORM_STATUS', // 维修状态

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

@@ -13,7 +13,7 @@
             <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>
             <a-button v-if="$auth('repair-application-forms-finish') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status" style="margin-left: 8px" type="primary" @click="handleFinish()">维修完成</a-button>
-            <a-popconfirm v-if="DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ACCEPTANCE === model.status" title="是否要提交审核该条数据?" @confirm="handleExamine">
+            <a-popconfirm v-if="DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.FINISHED === model.status" title="是否要提交审核该条数据?" @confirm="handleExamine">
               <a-button style="margin-left: 8px" type="primary">提交审核</a-button>
             </a-popconfirm>
             <a-button style="margin-left: 8px" @click="handleCancel">返回</a-button>
@@ -87,30 +87,6 @@
           </div>
         </a-layout-sider>
       </a-layout>
-      <title-divider title="维修项目" width="90px"></title-divider>
-      <div class="table-operator" v-if="$auth('repair-application-forms-finish') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status">
-        <a-button type="primary" @click="handleRepairProjectAdd">
-          <a-icon type="plus"/>
-          添加
-        </a-button>
-      </div>
-      <a-table
-        :data-source="data"
-        :columns="columns"
-        tableLayout="auto"
-        rowKey="id">
-        <span slot="action" slot-scope="record">
-          <template>
-            <a @click="handleView(record)">查看</a>
-            <a-divider type="vertical" />
-            <a @click="handleEdit(record)">修改</a>
-            <a-divider type="vertical" />
-            <a-popconfirm v-if="$auth('repair-application-forms-finish') && ( DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)" title="是否要删除该条数据?" @confirm="batchDelete(record.id)">
-              <a>删除</a>
-            </a-popconfirm>
-          </template>
-        </span>
-      </a-table>
       <title-divider title="备件清单" width="90px"></title-divider>
       <div class="table-operator" v-if="$auth('repair-application-forms-finish') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status">
         <a-button type="primary" @click="handleSpareStoreSelect">

+ 55 - 17
src/views/repair/repair-reason/modules/BaseForm.vue

@@ -3,6 +3,7 @@
     <a-row :gutter="48" slot="extra">
       <a-col :md="48" :sm="48">
         <span class="table-page-search-submitButtons" style="float: right" >
+          <a-button style="margin-left: 8px" type="primary" @click="finish()">完成</a-button>
           <a-button style="margin-left: 8px" type="primary" @click="save()">保存</a-button>
           <a-button style="margin-left: 8px" @click="handleCancel()">返回</a-button>
         </span>
@@ -90,12 +91,14 @@
             <a-checkbox :checked="changeRepairPlan" v-model="changeRepairPlan"></a-checkbox>
           </a-form-item>
         </a-col>
-        <a-col :lg="12" :md="24" :sm="24">
+      </a-row>
+      <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+        <a-col :lg="24" :md="24" :sm="24">
           <a-form-item
             label="内容"
             v-show="changeRepairPlan"
-            :labelCol="BaseTool.Constant.labelCol"
-            :wrapperCol="BaseTool.Constant.wrapperCol"
+            :labelCol="BaseTool.Constant.labelCol2"
+            :wrapperCol="BaseTool.Constant.wrapperCol2"
           >
             <a-textarea
               :auto-size="{ minRows: 5 }"
@@ -112,12 +115,14 @@
             <a-checkbox :checked="changeSparePlan" v-model="changeSparePlan"></a-checkbox>
           </a-form-item>
         </a-col>
-        <a-col :lg="12" :md="24" :sm="24">
+      </a-row>
+      <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+        <a-col :lg="24" :md="24" :sm="24">
           <a-form-item
             label="内容"
             v-show="changeSparePlan"
-            :labelCol="BaseTool.Constant.labelCol"
-            :wrapperCol="BaseTool.Constant.wrapperCol"
+            :labelCol="BaseTool.Constant.labelCol2"
+            :wrapperCol="BaseTool.Constant.wrapperCol2"
           >
             <a-textarea
               :auto-size="{ minRows: 5 }"
@@ -134,12 +139,14 @@
             <a-checkbox :checked="userTeach" v-model="userTeach"></a-checkbox>
           </a-form-item>
         </a-col>
-        <a-col :lg="12" :md="24" :sm="24">
+      </a-row>
+      <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+        <a-col :lg="24" :md="24" :sm="24">
           <a-form-item
             label="内容"
             v-show="userTeach"
-            :labelCol="BaseTool.Constant.labelCol"
-            :wrapperCol="BaseTool.Constant.wrapperCol"
+            :labelCol="BaseTool.Constant.labelCol2"
+            :wrapperCol="BaseTool.Constant.wrapperCol2"
           >
             <a-textarea
               :auto-size="{ minRows: 5 }"
@@ -156,12 +163,14 @@
             <a-checkbox :checked="sbChange" v-model="sbChange"></a-checkbox>
           </a-form-item>
         </a-col>
-        <a-col :lg="12" :md="24" :sm="24">
+      </a-row>
+      <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+        <a-col :lg="24" :md="24" :sm="24">
           <a-form-item
             label="内容"
             v-show="sbChange"
-            :labelCol="BaseTool.Constant.labelCol"
-            :wrapperCol="BaseTool.Constant.wrapperCol"
+            :labelCol="BaseTool.Constant.labelCol2"
+            :wrapperCol="BaseTool.Constant.wrapperCol2"
           >
             <a-textarea
               :auto-size="{ minRows: 5 }"
@@ -178,12 +187,14 @@
             <a-checkbox :checked="otherChange" v-model="otherChange"></a-checkbox>
           </a-form-item>
         </a-col>
-        <a-col :lg="12" :md="24" :sm="24">
+      </a-row>
+      <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+        <a-col :lg="24" :md="24" :sm="24">
           <a-form-item
             label="内容"
             v-show="otherChange"
-            :labelCol="BaseTool.Constant.labelCol"
-            :wrapperCol="BaseTool.Constant.wrapperCol"
+            :labelCol="BaseTool.Constant.labelCol2"
+            :wrapperCol="BaseTool.Constant.wrapperCol2"
           >
             <a-textarea
               :auto-size="{ minRows: 5 }"
@@ -196,7 +207,7 @@
 </template>
 
 <script>
-import { addRepairReason, updateRepairReason } from '@/api/repair/repair-reason'
+import { addRepairReason, updateRepairReason, finishRepairReason} from '@/api/repair/repair-reason'
 import pick from 'lodash.pick'
 
 export default {
@@ -212,6 +223,7 @@ export default {
       sbChange: false,
       otherChange: false,
       addFlag: false,
+      statusMap: {},
       form: this.$form.createForm(this),
       visible: false
       // 下拉框map
@@ -220,6 +232,7 @@ export default {
   props: {},
   created () {
     // 下拉框map
+    this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_REASON_STATUS)
   },
   methods: {
     base (record, repairForm = {}) {
@@ -269,7 +282,8 @@ export default {
           'sbChange',
           'sbChangeContent',
           'otherChange',
-          'otherChangeContent'
+          'otherChangeContent',
+          'status'
         ])))
       })
     },
@@ -312,6 +326,30 @@ export default {
         }
       })
     },
+    finish(){
+      const { form: { validateFieldsAndScroll } } = this
+      this.confirmLoading = true
+      validateFieldsAndScroll((errors, values) => {
+        if (errors) {
+          this.confirmLoading = false
+          return
+        }
+        // 日期处理
+        values.changeRepairPlan = this.changeRepairPlan
+        values.changeSparePlan = this.changeSparePlan
+        values.userTeach = this.userTeach
+        values.sbChange = this.sbChange
+        values.otherChange = this.otherChange
+        values.analyzeTime = this.BaseTool.Date.formatter(values.analyzeTime, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        finishRepairReason(values)
+          .then((res) => {
+            this.confirmLoading = false
+            this.handleCancel()
+          }).catch(() => {
+          this.confirmLoading = false
+        })
+      })
+    },
     handleCancel (values) {
       this.visible = false
       this.confirmLoading = false

+ 1 - 0
src/views/repair/repair-reason/modules/DetailRepairReason.vue

@@ -128,6 +128,7 @@ export default {
     this.periodTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_PLAN_PERIOD_TYPE)
     this.actionTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_PLAN_ACTION_TYPE)
     this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_JOB_STATUS)
+
   },
   methods: {
     base (record) {