guarantee-lsq 2 tahun lalu
induk
melakukan
af4248ba03

+ 107 - 2
src/api/repair/application-form.js

@@ -78,6 +78,21 @@ export function fetchRepairApplicationForm (parameter) {
     }
   })
 }
+/**
+ * fetch single func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function getDispatchUser (parameter) {
+  return axios({
+    url: '/upms/user-depts/repair-manager',
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
 /**
  * fetch single func
  * parameter: { }
@@ -334,7 +349,7 @@ export function closeRepair (parameter) {
 }
 
 /**
- * approve func
+ * 工程师审核报修-通过
  * parameter: { }
  * @param parameter
  * @returns {*}
@@ -364,7 +379,7 @@ export function reportRepair (parameter) {
 }
 
 /**
- * returnRepair func
+ * 工程师审核报修-拒绝
  * parameter: { }
  * @param parameter
  * @returns {*}
@@ -376,3 +391,93 @@ export function returnRepair (parameter) {
     data: parameter
   })
 }
+/**
+ *  区域负责人审核报修-通过
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function verifyPassRepair (parameter) {
+  return axios({
+    url: '/repair/application-forms/verify/mm/pass/' + parameter.id,
+    method: 'PUT',
+    data: parameter
+  })
+}
+/**
+ *  区域负责人审核报修-拒绝
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function verifyRefusedRepair (parameter) {
+  return axios({
+    url: '/repair/application-forms/mm/refused/' + parameter.id,
+    method: 'PUT',
+    data: parameter
+  })
+}
+/**
+ *  生产审核报修-通过
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function verifyProduceRepair (parameter) {
+  return axios({
+    url: '/repair/application-forms/verify/produce/pass/' + parameter.id,
+    method: 'PUT',
+    data: parameter
+  })
+}
+/**
+ *  生产审核报修-拒绝
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function verifyProduceRefusedRepair (parameter) {
+  return axios({
+    url: '/repair/application-forms/verify/produce/refused/' + parameter.id,
+    method: 'PUT',
+    data: parameter
+  })
+}
+/**
+ *  被生产拒绝的单子-再次发起审核
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function applyVerifyRepair (parameter) {
+  return axios({
+    url: '/repair/application-forms/apply/verify/' + parameter.id,
+    method: 'PUT',
+    data: parameter
+  })
+}
+/**
+ *  维修挂起解除
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function recoverRepair (parameter) {
+  return axios({
+    url: '/repair/application-forms/recover/' + parameter.id,
+    method: 'PUT',
+    data: parameter
+  })
+}/**
+ * 申请转大修
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function applyBigRepair (parameter) {
+  return axios({
+    url: '/repair/application-forms/apply/bigRepair/' + parameter.id,
+    method: 'PUT',
+    data: parameter
+  })
+}

+ 1 - 0
src/router/generator-platform-routers.js

@@ -196,6 +196,7 @@ const constantRouterComponents = {
   'RepairCheckForm': () => import('@/views/repair/application-form/RepairCheckForm'),
   // 维修单
   'RepairForm': () => import('@/views/repair/application-form/RepairForm'),
+  'RepairCloseForm': () => import('@/views/repair/application-form/RepairCloseForm'),
   'MRepairForm': () => import('@/views/repair/application-form/MyRepairForm'),
   'MyRepairForm': () => import('@/views/repair/form/MyRepairForm'),
   'WaitRepairForm': () => import('@/views/repair/application-form/WaitRepairForm'),

+ 24 - 6
src/utils/dict.js

@@ -902,11 +902,19 @@ DictCache.VALUE = {
     FINISHED: 6, // 已完成
     REFUSED_REPAIR: 7, // 报修被拒
     REPAIR_FAIL: 8, // 维修上报
-    RECEIVED: 9, // 维修失败,再次派工
-    HANG_UP: 10, // 维修失败,再次派工
-    DISPATCH_REPAIR: 11, // 维修失败,再次派工
-    MM_DISPATCH: 12, // 维修失败,再次派工
-    MM_REPAIR_FAIL: 13 // 维修失败,再次派工
+    RECEIVED: 9, // 	已接单
+    HANG_UP: 10, // 维修挂起
+    DISPATCH_REPAIR: 11, // 维修转派
+    MM_DISPATCH: 12, // 主管派单
+    MM_REPAIR_FAIL: 13, // 工程师报修
+    MM_REPAIR_CLOSE: 14, // 工单关闭
+    CALLER_REPAIR_VERIFYING_ONE: 15, // 报修一审中
+    CALLER_REPAIR_VERIFY_FAIL_ONE: 16, // 计划报修一审被拒
+    CALLER_REPAIR_VERIFYING_TWO: 17, //	计划报修二审中
+    CALLER_REPAIR_VERIFY_FAIL_TWO: 18, // 计划报修二审被拒
+    CALLER_REPAIR_VERIFYING_THREE: 19, // 计划报修三审中
+    CALLER_REPAIR_VERIFY_FAIL_THREE: 20, // 	计划报修三审被拒
+    BIG_REPAIR_VERIFYING: 21 // 大修审核中
   },
   /**
    * 维修状态
@@ -1484,7 +1492,17 @@ DictCache.COLOR = {
     9: 'warning', // 维修转派
     10: 'error', // 维修转派
     11: 'processing', // 转派维修
-    12: 'processing' // 维修转派
+    12: 'warning', // 	主管派单
+    13: 'warning', // 	工程师报修
+    14: 'processing', // 已关闭
+    15: 'warning', // 计划报修一审
+    16: 'error', // 计划报修一审被拒
+    17: 'warning', // 计划报修二审中
+    18: 'error', // 计划报修二审被拒
+    19: 'warning', // 计划报修三审中
+    20: 'error', // 计划报修三审被拒
+    21: 'warning' // 	大修审核中
+
   },
   /**
    * 维修状态

+ 17 - 0
src/views/repair/application-form/RepairCloseForm.vue

@@ -0,0 +1,17 @@
+<template>
+  <RepairForm :search-type="9"/>
+</template>
+
+<script>
+import RepairForm from './RepairForm'
+export default {
+  name: 'RepairCloseForm',
+  components: {
+    RepairForm
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

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

@@ -197,6 +197,22 @@
             </a-select>
           </a-form-item>
         </row-item>
+        <row-item v-if="category === 1">
+          <a-form-item
+            label="审批人"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-select v-decorator="['dispatchUserId', {rules: [{required: true, message: '审批人不能为空'}]}]" placeholder="请选择">
+              <a-select-option
+                v-for="({realName,userId}) in dispatchUserList"
+                :key="userId"
+                :label="realName"
+                :value="userId">{{ realName }}
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+        </row-item>
         <!-- <row-item v-show="category === 1">
           <a-form-item
             label="要求日期"
@@ -415,7 +431,7 @@
 <script>
 import pick from 'lodash.pick'
 import BaseTool from '../../../../utils/tool'
-import { addRepairApplicationForm, updateRepairApplicationForm, getSbPositions } from '@/api/repair/application-form'
+import { addRepairApplicationForm, updateRepairApplicationForm, getSbPositions, getDispatchUser } from '@/api/repair/application-form'
 import PartInfoSelectModal from '@/views/part/info/modules/PartInfoSelectModal'
 import SbInfoSelectModal from '@/views/sb/info/modules/SbInfoSelectModal'
 import { queryUser } from '@/api/upms/user'
@@ -442,6 +458,7 @@ export default {
       sourceMap: {},
       levelMap: {},
       questionMap: {},
+      dispatchUserList: {},
       treeData: [],
       needStop: null,
       needStopMap: {},
@@ -602,6 +619,10 @@ export default {
       queryUser({ status: 1 }).then(res => {
         this.userList = res.data
       })
+      getDispatchUser().then(res => {
+        console.log(res)
+        this.dispatchUserList = res.data
+      })
     },
     save () {
       const { form: { validateFieldsAndScroll } } = this

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

@@ -286,10 +286,11 @@
       </div>
       <div class="btn" v-else>
         <a-button style="margin-left: 8px" type="primary" @click="handleCancel">返回</a-button>
-        <a-button style="margin-left: 8px" type="primary" >报修审核</a-button>
-        <a-button style="margin-left: 8px" type="primary" >再次发起审核</a-button>
-        <a-button style="margin-left: 8px" type="primary" >维修挂起</a-button>
-        <a-button style="margin-left: 8px" type="primary" >转大修</a-button>
+        <a-button v-show="model.status===15 || model.status===17 || model.status === 19 " style="margin-left: 8px" type="primary" @click="handleCheck">审核</a-button>
+        <a-button v-show="model.status===21" style="margin-left: 8px" type="primary" >大修审核</a-button>
+        <a-button v-show="model.status===20" style="margin-left: 8px" type="primary" >再次发起审核</a-button>
+        <a-button v-show="model.status===8" style="margin-left: 8px" type="primary" >维修挂起</a-button>
+        <a-button v-show="model.level!==6 && model.status!==6 && model.status!==14" style="margin-left: 8px" type="primary" >转大修</a-button>
       </div>
     </div>
     <check-form ref="checkForm" @ok="handleOk" />
@@ -319,6 +320,7 @@
     <ticket-form ref="ticketForm" @ok="handleOk" />
     <longYanSelectSpareForm ref="longYanSelectSpareForm" @ok="handleOk"/>
     <scheme-library ref="schemeLibrary" @ok="handleOk"/>
+    <PlanCheckForm ref="planCheckForm" @ok="handleOk"/>
   </div>
 </template>
 
@@ -329,6 +331,7 @@ import { fetchRepairApplicationForm, approve, receive, receiveRepair, closeRepai
 import CheckForm from './CheckForm'
 import BaseOutForm from './BaseOutForm'
 import FinishForm from './FinishForm'
+import PlanCheckForm from './PlanCheckForm'
 import EditForm from './RemarkForm'
 import DispatchForm from './DispatchForm'
 import AssignForm from './AssignForm'
@@ -381,6 +384,7 @@ export default {
     ReasonDetail,
     DetailListItem,
     FinishForm,
+    PlanCheckForm,
     BaseOutForm,
     DispatchForm,
     FeeDetail,
@@ -1316,7 +1320,12 @@ export default {
     },
     inited (viewer) {
       this.$viewer = viewer
+    },
+    handleCheck () {
+      const modal = this.$refs.planCheckForm
+      modal.base(this.model, this.model.status)
     }
+
   }
 }
 </script>

+ 161 - 0
src/views/repair/application-form/modules/PlanCheckForm.vue

@@ -0,0 +1,161 @@
+<template>
+  <a-modal
+    :title="modalTitle"
+    :width="800"
+    :visible="visible"
+    :confirmLoading="confirmLoading"
+    class="ant-modal2"
+    @cancel="handleCancel"
+  >
+    <a-form :form="form">
+
+      <a-form-item v-show="false" >
+        <a-input v-decorator="['id']" type="hidden"/>
+        <a-input v-decorator="['category']" type="hidden"/>
+
+      </a-form-item>
+
+      <row-list :col="1">
+        <row-item>
+          <a-form-item
+            label="审核"
+            :labelCol="BaseTool.Constant.labelCol2"
+            :wrapperCol="BaseTool.Constant.wrapperCol2"
+          >
+            <a-select v-model="check" style="width: 120px" >
+              <a-select-option :value="1">
+                通过
+              </a-select-option>
+              <a-select-option :value="0">
+                拒绝
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+        </row-item>
+      </row-list>
+      <row-list :col="1">
+        <row-item>
+          <a-form-item
+            label="备注"
+            :labelCol="BaseTool.Constant.labelCol2"
+            :wrapperCol="BaseTool.Constant.wrapperCol2"
+          >
+            <a-textarea
+              :rows="4"
+              v-decorator="['remark']"/>
+          </a-form-item>
+        </row-item>
+      </row-list>
+    </a-form>
+    <template slot="footer">
+      <a-button :loading="confirmLoading" type="primary" @click="save()">保存</a-button>
+    </template>
+  </a-modal>
+</template>
+
+<script>
+import pick from 'lodash.pick'
+import {
+  approve,
+  returnRepair,
+  verifyPassRepair,
+  verifyRefusedRepair,
+  verifyProduceRefusedRepair,
+  verifyProduceRepair
+} from '@/api/repair/application-form'
+
+export default {
+  name: 'BaseRepairApplicationForm',
+  data () {
+    return {
+      confirmLoading: false,
+      modalTitle: '审核',
+      form: this.$form.createForm(this),
+      visible: false,
+      check: 1,
+      type: null,
+      // 下拉框map
+      model: null
+    }
+  },
+  components: {
+  },
+  props: {
+  },
+  created () {
+    // 下拉框map
+  },
+  methods: {
+    base (record, type) {
+      this.visible = true
+      this.model = record
+      this.type = type
+      const { form: { setFieldsValue } } = this
+      // 日期处理
+      this.$nextTick(() => {
+        setFieldsValue(Object.assign(pick(record, [
+          'id',
+          'category'
+        ])))
+      })
+    },
+
+    save () {
+      const { form: { validateFieldsAndScroll } } = this
+      this.confirmLoading = true
+      validateFieldsAndScroll((errors, values) => {
+        if (errors) {
+          this.confirmLoading = false
+          return
+        }
+        switch (true) {
+          case this.type === 15 && this.check === 1:
+            approve(values).then(res => {
+              this.$message.success(res.message)
+              this.handleCancel()
+            })
+            break
+          case this.type === 15 && this.check === 0:
+            returnRepair(values).then(res => {
+              this.$message.success(res.message)
+              this.handleCancel()
+            })
+            break
+          case this.type === 17 && this.check === 1:
+            verifyPassRepair(values).then(res => {
+              this.$message.success(res.message)
+              this.handleCancel()
+            })
+            break
+          case this.type === 17 && this.check === 0:
+            verifyRefusedRepair(values).then(res => {
+              this.$message.success(res.message)
+              this.handleCancel()
+            })
+            break
+          case this.type === 19 && this.check === 1:
+            verifyProduceRepair(values).then(res => {
+              this.$message.success(res.message)
+              this.handleCancel()
+            })
+            break
+          case this.type === 19 && this.check === 0:
+            verifyProduceRefusedRepair(values).then(res => {
+              this.$message.success(res.message)
+              this.handleCancel()
+            })
+            break
+        }
+      })
+    },
+    handleCancel () {
+      this.visible = false
+      this.check = 1
+      this.type = null
+      this.confirmLoading = false
+      this.form.resetFields()
+      this.$emit('ok')
+    }
+  }
+}
+</script>