guarantee-lsq пре 2 година
родитељ
комит
7e19b412ec

+ 93 - 0
src/views/repair/application-form/modules/BigRepairForm.vue

@@ -0,0 +1,93 @@
+<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-form-item>
+      <row-item>
+        <a-form-item
+          label="申请原因"
+          :labelCol="BaseTool.Constant.labelCol2"
+          :wrapperCol="BaseTool.Constant.wrapperCol2"
+        >
+          <a-textarea v-decorator="['remark']"/>
+        </a-form-item>
+      </row-item>
+    </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 { applyBigRepair } from '@/api/repair/application-form'
+
+export default {
+  name: 'ReportUpForm',
+  data () {
+    return {
+      model: null,
+      confirmLoading: false,
+      modalTitle: null,
+      form: this.$form.createForm(this),
+      visible: false,
+      chooseType: null,
+      roleType: null,
+      roleUserMap: []
+      // 下拉框ma
+    }
+  },
+  components: {
+
+  },
+  props: {
+  },
+  created () {
+    // 下拉框map
+  },
+  methods: {
+    base (record) {
+      this.visible = true
+      this.model = record
+      const { form: { setFieldsValue } } = this
+      this.$nextTick(() => {
+        setFieldsValue(Object.assign(pick(record, [
+          'id'
+        ])))
+      })
+    },
+    save () {
+      const { form: { validateFieldsAndScroll } } = this
+      this.confirmLoading = true
+      validateFieldsAndScroll((errors, values) => {
+        if (errors) {
+          this.confirmLoading = false
+          return
+        }
+        // 日期处理
+        applyBigRepair(values).then(() => {
+          this.$message.info('操作成功')
+          this.handleCancel()
+        }).catch(() => {
+          this.confirmLoading = false
+        })
+      })
+    },
+    handleCancel () {
+      this.visible = false
+      this.confirmLoading = false
+      this.form.resetFields()
+      this.$emit('ok')
+    }
+  }
+}
+</script>

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

@@ -290,7 +290,7 @@
           <a-button style="margin-left: 8px" type="error">拒绝</a-button>
         </a-popconfirm>
         <a-button v-show=" model.status===10" style="margin-left: 8px" type="primary" @click="recoverPause">挂起解除</a-button>
-        <a-button v-show="model.level!==6 && model.status!==6 && model.status!==14" 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" @click="handleBigRepair">转大修</a-button>
         <a-button v-show="model.status===21" style="margin-left: 8px" type="primary" >大修审核</a-button>
         <a-button style="margin-left: 8px" type="primary" @click="handleCancel">返回</a-button>
       </div>
@@ -329,13 +329,16 @@
     <scheme-library ref="schemeLibrary" @ok="handleOk"/>
     <PlanCheckForm ref="planCheckForm" @ok="handleOk"/>
     <OutStroeForm ref="outStroeForm" @ok="handleOk" />
+    <ReportPauseForm ref="reportPauseForm" @ok="handleOk" />
+    <BigRepairForm ref="bigRepairForm" @ok="handleOk" />
+
   </div>
 </template>
 
 <script>
 // import { stringify } from 'qs'
 import DetailList from '@/components/tools/DetailList'
-import { fetchRepairApplicationForm, approve, receive, receiveRepair, closeRepair, recoverRepair } from '@/api/repair/application-form'
+import { fetchRepairApplicationForm, approve, receive, receiveRepair, closeRepair } from '@/api/repair/application-form'
 import CheckForm from './CheckForm'
 import BaseOutForm from './BaseOutForm'
 import FinishForm from './FinishForm'
@@ -377,6 +380,9 @@ import RepairRecordForm from './RepairRecordForm'
 import ReportUpForm from './ReportUpForm'
 import TicketForm from './TicketForm'
 import LongYanSelectSpareForm from './LongYanSelectSpareForm'
+import ReportPauseForm from './ReportPauseForm'
+import BigRepairForm from './BigRepairForm'
+
 import OutStroeForm from '@/views/store/outstoreform/modules/BaseFormYY.vue'
 const DetailListItem = DetailList.Item
 
@@ -417,7 +423,9 @@ export default {
     ReportUpForm,
     TicketForm,
     LongYanSelectSpareForm,
-    OutStroeForm
+    OutStroeForm,
+    ReportPauseForm,
+    BigRepairForm
   },
   data () {
     return {
@@ -912,11 +920,7 @@ export default {
         this.handleOk()
       })
     },
-    recoverPause () {
-      recoverRepair({ id: this.model.id }).then(res => {
-        this.$message.info('操作成功')
-      })
-    },
+
     batchDeleteFee (id) {
       let ids = []
       if (this.BaseTool.String.isBlank(id)) {
@@ -966,6 +970,9 @@ export default {
       const modal = this.$refs.resolveBaseForm
       modal.base({ repairId: this.model.id, repairNo: this.model.no, errorContent: this.model.content, sbId: this.model.sbId })
     },
+    recoverPause () {
+      this.$refs.reportPauseForm.base(this.model)
+    },
     handleAddRepairResolves () {
       const modal = this.$refs.schemeLibrary
       modal.base(this.model)
@@ -1028,6 +1035,10 @@ export default {
       this.visible = false
       modal.base(null, this.model)
     },
+    handleBigRepair () {
+      const modal = this.$refs.bigRepairForm
+      modal.base(this.model)
+    },
     handleEditReason (record) {
       fetchRepairReason({ id: record.id }).then(res => {
         const modal = this.$refs.reasonForm

+ 121 - 0
src/views/repair/application-form/modules/ReportPauseForm.vue

@@ -0,0 +1,121 @@
+<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-form-item>
+      <row-item>
+        <a-form-item
+          label="派工对象"
+          :labelCol="BaseTool.Constant.labelCol"
+          :wrapperCol="BaseTool.Constant.wrapperCol"
+        >
+          <a-select
+            v-decorator="['repairUserId']"
+            placeholder="请选择">
+            <a-select-option
+              v-for="item in roleUserMap"
+              :key="item.userId"
+              :label="item.realName"
+              :value="item.userId">{{ item.realName }}
+            </a-select-option>
+          </a-select>
+        </a-form-item>
+      </row-item>
+    </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 { recoverRepair } from '@/api/repair/application-form'
+import { queryRepairUser } from '@/api/upms/user-dept'
+
+export default {
+  name: 'ReportUpForm',
+  data () {
+    return {
+      model: null,
+      confirmLoading: false,
+      modalTitle: null,
+      form: this.$form.createForm(this),
+      visible: false,
+      chooseType: null,
+      roleType: null,
+      roleUserMap: []
+      // 下拉框ma
+    }
+  },
+  components: {
+
+  },
+  props: {
+  },
+  created () {
+    // 下拉框map
+  },
+  methods: {
+    base (record) {
+      this.visible = true
+      this.model = record
+      const params = { roleType: record.roleType, deptId: record.repairDeptId, queryType: 2 }
+      this.getUsers(params)
+      const { form: { setFieldsValue } } = this
+      this.$nextTick(() => {
+        setFieldsValue(Object.assign(pick(record, [
+          'id',
+          'remark',
+          'repairUserId'
+        ])))
+      })
+    },
+    getUsers (params) {
+      queryRepairUser(params).then(res => {
+        this.roleUserMap = res.data
+      })
+    },
+    save () {
+      const { form: { validateFieldsAndScroll } } = this
+      this.confirmLoading = true
+      validateFieldsAndScroll((errors, values) => {
+        if (errors) {
+          this.confirmLoading = false
+          return
+        }
+        // 日期处理
+        this.model.reportLeaderId = values.reportLeaderId
+        if (this.model.reportHandleType === 1) { // 维修上报处理
+          // 维修上报处理
+          if (this.model.roleType === 2 || this.model.roleType === 3) {
+            this.model.repairUserId = values.reportLeaderId
+          } else {
+            this.model.dispatchUserId = values.reportLeaderId
+          }
+        }
+        recoverRepair(values).then(() => {
+          this.$message.info('操作成功')
+          this.handleCancel()
+        }).catch(() => {
+          this.confirmLoading = false
+        })
+      })
+    },
+    handleCancel (values) {
+      this.visible = false
+      this.confirmLoading = false
+      this.form.resetFields()
+      this.$emit('ok')
+    }
+  }
+}
+</script>

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

@@ -85,7 +85,7 @@
             <a-textarea v-decorator="['remark']"/>
           </a-form-item>
         </row-item>
-        <row-item v-show="(visibleReport&&model.reportHandleType===1) || (!visibleReport&&model.reportHandleType===3)">
+        <row-item v-show="(visibleReport&&model.reportHandleType===2) || (!visibleReport&&model.reportHandleType===3)">
           <a-form-item
             label="上报原因"
             :labelCol="BaseTool.Constant.labelCol2"