소스 검색

回退按钮无效

guarantee-lsq 1 년 전
부모
커밋
4a4926736b

+ 14 - 0
src/views/preparation/preparation/modules/BaseForm.vue

@@ -117,6 +117,20 @@
             </a-tree-select>
           </a-form-item>
         </row-item>
+        <row-item>
+          <a-form-item
+            label="费用金额"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.labelCol"
+          >
+            <a-input-number
+              style="width: 100%"
+              :min="0"
+              :formatter="BaseTool.Amount.formatter"
+              :parser="BaseTool.Amount.parser"
+              v-decorator="['fee']" />
+          </a-form-item>
+        </row-item>
       </row-list>
       <row-list :col="1">
         <row-item>

+ 11 - 3
src/views/preparation/preparation/modules/Detail.vue

@@ -25,6 +25,7 @@
       <a-descriptions-item label="执行结束时间">{{ model.repairEndTime }}</a-descriptions-item>
       <a-descriptions-item label="执行时长">{{ model.repairMinutes }}</a-descriptions-item>
       <a-descriptions-item label="费用预算">{{ model.fee }}</a-descriptions-item>
+      <a-descriptions-item label="费用描述" :span="3"> <span v-html="model.feeContent "></span></a-descriptions-item>
       <a-descriptions-item label="执行描述" :span="3"> <span v-html="model.repairContent "></span></a-descriptions-item>
       <a-descriptions-item label="费用图片" :span="3">
         <div v-if="model.imageList != null && model.imageList.length > 0">
@@ -65,6 +66,7 @@ DictCache.VALUE.REPAIR_PREPARATION_STATUS.SECOND_PROCESSING_VERIFYING === model.
     <assign-form ref="assignForm" @ok="handleCancel" />
     <fee-form ref="feeForm" @ok="handleCancel" />
     <verify-form ref="verifyForm" @ok="handleCancel" />
+    <fee-verify-form ref="feeVerifyForm" @ok="handleCancel" />
     <dispatch-form ref="dispatchForm" @ok="handleCancel" />
     <finish-form ref="finishForm" @ok="handleCancel" />
   </a-card>
@@ -76,6 +78,7 @@ import DispatchForm from './DispatchForm'
 import FeeForm from './FeeForm'
 import FinishForm from './FinishForm'
 import VerifyForm from './VerifyForm'
+import FeeVerifyForm from './FeeVerifyForm'
 import DictCache from '@/utils/dict'
 const DetailListItem = DetailList.Item
 
@@ -87,7 +90,8 @@ export default {
     DispatchForm,
     FeeForm,
     VerifyForm,
-    FinishForm
+    FinishForm,
+    FeeVerifyForm
   },
   data () {
     return {
@@ -128,7 +132,8 @@ export default {
         'applyReason': null,
         'applyVerifyLeaderName': null,
         'receiveVerifyLeaderName': null,
-        'receiveDeptName': null
+        'receiveDeptName': null,
+        'feeContent': null
       }
     }
   },
@@ -155,9 +160,12 @@ export default {
     // 审核 - 主管 - 负责人 - 收件负责人
     handleVerify () {
       // 派单审核
-      if (this.model.status === DictCache.VALUE.REPAIR_PREPARATION_STATUS.APPLY_LEADER_VERIFY_SUCCESS) {
+      if (this.model.status === DictCache.VALUE.REPAIR_PREPARATION_STATUS.APPLY_LEADER_VERIFY_SUCCESS) { // 执行主管派单
         const modal = this.$refs.dispatchForm
         modal.base({ id: this.model.id })
+      } else if (this.model.status === DictCache.VALUE.REPAIR_PREPARATION_STATUS.FIRST_PROCESSING_VERIFYING) { // 申请费用审核
+        const modal = this.$refs.feeVerifyForm
+        modal.base({ id: this.model.id, fee: this.model.fee })
       } else { // 其他审核
         const modal = this.$refs.verifyForm
         modal.base({ status: this.model.status, id: this.model.id })

+ 12 - 12
src/views/preparation/preparation/modules/FeeForm.vue

@@ -12,12 +12,12 @@
         <a-input v-decorator="['id']" type="hidden"/>
       </a-form-item>
 
-      <row-list :col="2">
+      <row-list :col="1">
         <row-item>
           <a-form-item
             label="费用金额"
-            :labelCol="BaseTool.Constant.labelCol"
-            :wrapperCol="BaseTool.Constant.wrapperCol"
+            :labelCol="BaseTool.Constant.labelCol2"
+            :wrapperCol="BaseTool.Constant.labelCol2"
           >
             <a-input-number
               style="width: 100%"
@@ -27,6 +27,15 @@
               v-decorator="['fee', {rules: [{required: true, message: '费用预算不能为空'}]}]" />
           </a-form-item>
         </row-item>
+        <row-item>
+          <a-form-item
+            label="费用描述"
+            :labelCol="BaseTool.Constant.labelCol2"
+            :wrapperCol="BaseTool.Constant.wrapperCol2"
+          >
+            <a-textarea v-decorator="['feeContent']"/>
+          </a-form-item>
+        </row-item>
       </row-list>
       <row-list :col="1">
         <row-item>
@@ -65,15 +74,6 @@
             </a-upload>
           </a-form-item>
         </row-item>
-        <!--        <row-item>
-          <a-form-item
-            label="维修描述"
-            :labelCol="BaseTool.Constant.labelCol2"
-            :wrapperCol="BaseTool.Constant.wrapperCol2"
-          >
-            <a-textarea v-decorator="['repairContent']"/>
-          </a-form-item>
-        </row-item>-->
       </row-list>
     </a-form>
     <template slot="footer">

+ 136 - 0
src/views/preparation/preparation/modules/FeeVerifyForm.vue

@@ -0,0 +1,136 @@
+<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-list :col="1">
+        <row-item>
+          <a-form-item
+            label="费用审核"
+            :labelCol="BaseTool.Constant.labelCol2"
+            :wrapperCol="BaseTool.Constant.wrapperCol2"
+          >
+            <a-radio-group v-model="verifyStatus" @change="changeOpinion">
+              <a-radio :value="1">通过</a-radio>
+              <a-radio :value="2">拒绝</a-radio>
+              <a-radio :value="3">回退</a-radio>
+            </a-radio-group>
+          </a-form-item>
+        </row-item>
+        <row-item>
+          <a-form-item
+            label="费用预算"
+            :labelCol="BaseTool.Constant.labelCol2"
+            :wrapperCol="BaseTool.Constant.wrapperCol2"
+          >
+            <a-input
+              v-decorator="['fee', {rules: [{required: true, message: '费用预算不能为空'}]}]" />
+          </a-form-item>
+        </row-item>
+        <row-item>
+          <a-form-item
+            label="备注"
+            :labelCol="BaseTool.Constant.labelCol2"
+            :wrapperCol="BaseTool.Constant.wrapperCol2"
+          >
+            <a-textarea
+              :rows="4"
+              v-model="verifyRemark"/>
+          </a-form-item>
+        </row-item>
+      </row-list>
+    </a-form>
+    <template slot="footer">
+      <a-popconfirm title="确认要提交?" @confirm="save()">
+        <a-button :loading="confirmLoading" type="primary" >提交</a-button>
+      </a-popconfirm>
+    </template>
+  </a-modal>
+</template>
+
+<script>
+import pick from 'lodash.pick'
+import { handleVerifyByDTO } from '@/api/preparation/preparation'
+export default {
+  name: 'FeeVerifyForm',
+  data () {
+    return {
+      confirmLoading: false,
+      modalTitle: null,
+      form: this.$form.createForm(this),
+      visible: false,
+      verifyStatus: 1,
+      // 下拉框map
+      model: null,
+      verifyRemark: '通过'
+    }
+  },
+  components: {
+  },
+  props: {
+  },
+  created () {
+  },
+  methods: {
+    changeOpinion (e) {
+      const val = e.target.value
+      if (val === 1) {
+        this.verifyRemark = '通过'
+      } else if (val === 2) {
+        this.verifyRemark = '拒绝'
+      } else if (val === 3) {
+        this.verifyRemark = '回退'
+      }
+    },
+    base (record) {
+      this.visible = true
+      this.model = record
+      this.modalTitle = '费用审核'
+      const { form: { setFieldsValue } } = this
+      this.$nextTick(() => {
+        setFieldsValue(Object.assign(pick(record, [
+          'id',
+          'fee'
+        ])))
+      })
+    },
+    save () {
+      const { form: { validateFieldsAndScroll } } = this
+      this.confirmLoading = true
+      validateFieldsAndScroll((errors, values) => {
+        if (errors && this.verifyStatus === 1) {
+          this.confirmLoading = false
+          return
+        }
+        // 具体处理
+        values.verifyStatus = this.verifyStatus
+        values.verifyRemark = this.verifyRemark
+        console.log(values)
+        handleVerifyByDTO(values)
+          .then(() => {
+            this.handleCancel(values)
+          }).catch(() => {
+            this.confirmLoading = false
+          })
+      })
+    },
+    handleCancel (values) {
+      this.visible = false
+      this.confirmLoading = false
+      this.form.resetFields()
+      if (this.BaseTool.Object.isNotBlank(values)) {
+        this.$emit('ok')
+      }
+    }
+
+  }
+}
+</script>