guarantee-lsq 2 anni fa
parent
commit
57136c1352

+ 14 - 0
src/api/repair/application-form.js

@@ -290,6 +290,20 @@ export function receive (parameter) {
   })
 }
 
+/**
+ * finish func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function closeRepair (parameter) {
+  return axios({
+    url: '/repair/application-forms/close/repair',
+    method: 'PUT',
+    data: parameter
+  })
+}
+
 /**
  * approve func
  * parameter: { }

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

@@ -156,6 +156,7 @@ export default {
         }
         values.verifyImages = this.verifyImages
         values.verifyFiles = this.fileList // 维修文件
+        values.category = this.model.category
         // 日期处理
         if (this.model.type === 1) {
           returnRepair(values)

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

@@ -276,6 +276,9 @@
         <a-popconfirm v-if="$auth('repair-application-forms-approve') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ACCEPTANCE === model.status" title="是否要接受?" @confirm="handleApprove">
           <a-button :loading="confirmLoading" style="margin-left: 8px" type="default">接受</a-button>
         </a-popconfirm>
+        <a-popconfirm v-if="DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.FINISHED === model.status" title="是否要关闭工单?" @confirm="handleClose">
+          <a-button :loading="confirmLoading" style="margin-left: 8px" type="default">关闭工单</a-button>
+        </a-popconfirm>
         <a-popconfirm v-if="$auth('repair-application-forms-reback') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ACCEPTANCE === model.status" title="是否要拒绝?" @confirm="handleReturn">
           <a-button style="margin-left: 8px" type="error">拒绝</a-button>
         </a-popconfirm>
@@ -315,7 +318,7 @@
 <script>
 // import { stringify } from 'qs'
 import DetailList from '@/components/tools/DetailList'
-import { fetchRepairApplicationForm, approve, receive, receiveRepair } 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'
@@ -870,6 +873,19 @@ export default {
       receive(this.model).then(() => {
       })
     },
+    handleClose () {
+      // 判断是否具备关闭工单条件
+      if (this.dataReason.length === 0 || this.dataRepairResolve.length === 0) {
+        this.$message.error('维修方案或维修报告不能为空')
+        return
+      }
+      const params = { id: this.model.id, category: this.model.category }
+      alert(this.model.id + this.model.category)
+      closeRepair(params).then(res => {
+        this.$message.info('操作成功')
+        this.handleOk()
+      })
+    },
     batchDeleteFee (id) {
       let ids = []
       if (this.BaseTool.String.isBlank(id)) {