408249787 2 years ago
parent
commit
15ed5f552a

+ 13 - 0
src/api/fill/task.js

@@ -90,6 +90,19 @@ export function dispatchFillGatherTask (parameter) {
     data: parameter
   })
 }
+/**
+ * update func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function VerifyFillGatherTask (parameter) {
+  return axios({
+    url: 'fill/tasks/verify/' + parameter.id,
+    method: 'PUT',
+    data: parameter
+  })
+}
 /**
  * update func
  * parameter: { }

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

@@ -201,6 +201,8 @@ const constantRouterComponents = {
   'FillInfo': () => import('@/views/fill/info/FillInfo'),
   'FillGather': () => import('@/views/fill/gather/FillGather'),
   'FillGatherTask': () => import('@/views/fill/task/FillGatherTask'),
+  'BackFillGatherTask': () => import('@/views/fill/task/BackFillGatherTask'),
+  'VerifyFillGatherTask': () => import('@/views/fill/task/VerifyFillGatherTask'),
   'SbInspectionFill': () => import('@/views/sb/inspection-fill/SbInspectionFill'),
   'MySbInspectionFill': () => import('@/views/sb/inspection-fill/MySbInspectionFill'),
   'ZGSbInspectionFill': () => import('@/views/sb/inspection-fill/ZGSbInspectionFill'),

+ 4 - 2
src/utils/dict.js

@@ -1496,10 +1496,12 @@ DictCache.COLOR = {
   FILL_GATHER_TASK_STATUS: {
     0: 'warning', // 待接单
     1: 'processing', // 巡检中
-    2: 'success', // 巡检完成
+    2: 'warning', // 巡检审核
     3: 'error', // 巡检超时
     4: 'warning', // 巡检延时
-    5: 'warning'// 巡检暂停
+    5: 'warning', // 巡检暂停
+    6: 'success', // 巡检完成
+    7: 'error' // 审核拒绝
   },
   /**
    * 盘点计划状态

+ 17 - 0
src/views/fill/task/BackFillGatherTask.vue

@@ -0,0 +1,17 @@
+<template>
+  <FillGatherTask :status="7"/>
+</template>
+
+<script>
+import FillGatherTask from './FillGatherTask'
+export default {
+  name: 'BackFillGatherTask',
+  components: {
+    FillGatherTask
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 25 - 7
src/views/fill/task/FillGatherTask.vue

@@ -72,28 +72,32 @@
           <template>
             <a @click="handleView(record)">查看</a>
             <operation-button
-              v-show="record.status!== 2"
+              v-show="record.status!== 2 && record.status!== 6"
               @click="handleEdit(record)"
             >填报</operation-button>
+            <operation-button
+              v-show="record.status == 2 || record.status == 7"
+              @click="handleVerify(record)"
+            > 审核</operation-button>
             <operation-button
               v-if="$auth('fill-tasks-dispatch')"
-              v-show="record.status!== 2"
+              v-show="record.status!== 2 && record.status!== 6"
               @click="handleDispatch(record)"
             >转派</operation-button>
             <operation-button
               v-if="$auth('fill-tasks-overtime')"
-              v-show="record.status!== 2"
+              v-show="record.status!== 2 && record.status!== 6"
               @click="handleOvertime(record)"
             >延时</operation-button>
 
             <operation-button
               v-if="$auth('fill-tasks-pause')"
-              v-show="record.status!== 2 && record.status===5"
+              v-show="record.status!== 2 && record.status===5 && record.status!== 6"
               @click="handlePause(record)"
             >取消暂停</operation-button>
             <operation-button
               v-if="$auth('fill-tasks-pause')"
-              v-show="record.status!== 2 && record.status!==5"
+              v-show="record.status!== 2 && record.status!==5 && record.status!== 6"
               @click="handlePause(record)"
             >暂停</operation-button>
             <!-- <operation-button
@@ -109,6 +113,7 @@
     <dispatch-form ref="dispatchModal" @ok="handleOk" />
     <overtime-form ref="overtimeModal" @ok="handleOk" />
     <pause-form ref="pauseModal" @ok="handleOk" />
+    <verify-form ref="verifyModal" @ok="handleOk" />
     <base-form :editor="false" ref="detailModal" @ok="handleOk" />
   </a-card>
 </template>
@@ -119,12 +124,12 @@ import BaseForm from './modules/BaseForm'
 import DispatchForm from './modules/DispatchForm'
 import OvertimeForm from './modules/OvertimeForm'
 import PauseForm from './modules/PauseForm'
+import VerifyForm from './modules/VerifyForm'
 
 import Detail from './modules/Detail'
 import {
   getFillGatherTaskPage,
   deleteFillGatherTasks,
-  pauseFillGatherTask,
   fetchFillGatherTask,
   exportFillGatherTask
 } from '@/api/fill/task'
@@ -136,16 +141,25 @@ export default {
     Ellipsis,
     BaseForm,
     PauseForm,
+    VerifyForm,
     DispatchForm,
     OvertimeForm,
     Detail
   },
+  props: {
+    status: {
+      type: Number,
+      default: null
+    }
+  },
   data () {
     return {
       advanced: false,
       visible: true,
       // 查询参数
-      queryParam: {},
+      queryParam: {
+        status: this.status
+      },
       statusMap: {},
       // 表头
       columns: [
@@ -320,6 +334,10 @@ export default {
       const modal = this.$refs.dispatchModal
       modal.base(record)
     },
+    handleVerify (record) {
+      const modal = this.$refs.verifyModal
+      modal.base(record)
+    },
     handleOvertime (record) {
       const modal = this.$refs.overtimeModal
       modal.base(record)

+ 17 - 0
src/views/fill/task/VerifyFillGatherTask.vue

@@ -0,0 +1,17 @@
+<template>
+  <FillGatherTask :status="2"/>
+</template>
+
+<script>
+import FillGatherTask from './FillGatherTask'
+export default {
+  name: 'VerifyFillGatherTask',
+  components: {
+    FillGatherTask
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 2 - 0
src/views/fill/task/modules/DispatchForm.vue

@@ -102,6 +102,8 @@ export default {
     },
     handleCancel () {
       this.visible = false
+      this.confirmLoading = false
+      this.form.resetFields()
       this.$emit('ok')
     }
 

+ 2 - 0
src/views/fill/task/modules/OvertimeForm.vue

@@ -77,6 +77,8 @@ export default {
     },
     handleCancel () {
       this.visible = false
+      this.confirmLoading = false
+      this.form.resetFields()
       this.$emit('ok')
     }
 

+ 1 - 0
src/views/fill/task/modules/PauseForm.vue

@@ -100,6 +100,7 @@ export default {
     handleCancel () {
       this.visible = false
       this.confirmLoading = false
+      this.form.resetFields()
       this.$emit('ok')
     }
 

+ 101 - 0
src/views/fill/task/modules/VerifyForm.vue

@@ -0,0 +1,101 @@
+<template>
+  <a-modal
+    title="审核"
+    :width="800"
+    :visible="visible"
+    :confirmLoading="confirmLoading"
+    @cancel="handleCancel"
+  >
+    <a-form :form="form">
+      <a-form-item>
+        <a-input v-decorator="['id']" type="hidden"/>
+      </a-form-item>
+      <a-form-item
+        label="审核"
+        :labelCol="BaseTool.Constant.labelCol"
+        :wrapperCol="BaseTool.Constant.wrapperCol"
+      >
+        <a-select v-decorator="['status', {rules: [{required: true, message: '巡检人不能为空'}]}]">
+          <a-select-option label="通过" :value="6">
+            通过
+          </a-select-option>
+          <a-select-option label="拒绝" :value="7">
+            拒绝
+          </a-select-option>
+        </a-select>
+      </a-form-item>
+      <a-form-item
+        label="备注"
+        :labelCol="BaseTool.Constant.labelCol"
+        :wrapperCol="BaseTool.Constant.wrapperCol"
+      >
+        <a-textarea
+          v-decorator="['recordJson']">
+        </a-textarea>
+      </a-form-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 { VerifyFillGatherTask } from '@/api/fill/task'
+import RowList from '@/components/custom/RowList.vue'
+
+export default {
+  components: { RowList },
+  name: 'BaseFillGather',
+  data () {
+    return {
+      confirmLoading: false,
+      form: this.$form.createForm(this),
+      visible: false
+      // 下拉框map
+    }
+  },
+  created () {
+    this.getUser()
+  },
+  methods: {
+    base (record) {
+      this.visible = true
+      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
+        }
+        console.log(values)
+        VerifyFillGatherTask(values).then(res => {
+          this.$message.success('审核成功!')
+          this.handleCancel()
+        })
+        // 日期处理
+      })
+    },
+    handleCancel () {
+      this.visible = false
+      this.confirmLoading = false
+      this.form.resetFields()
+      this.$emit('ok')
+    }
+
+  }
+}
+</script>
+<style lang="less" scoped>
+</style>