浏览代码

feat: 退押金编辑

zh 2 年之前
父节点
当前提交
109a258c19
共有 2 个文件被更改,包括 67 次插入70 次删除
  1. 10 1
      src/api/engin_deposit/refund_list.js
  2. 57 69
      src/views/deposit_home/components/refund_list-detail.vue

+ 10 - 1
src/api/engin_deposit/refund_list.js

@@ -23,6 +23,15 @@ export function getDepositManageDetail(params) {
     params
   })
 }
+// 编辑退押
+export function editManageExamine(data) {
+  return request({
+    url: '/deposit-manage/edit',
+    method: 'post',
+    data
+  })
+}
+
 // 审批退押
 export function getDepositManageExamine(data) {
   return request({
@@ -107,4 +116,4 @@ export function reviewData(params) {
     method: 'post',
     data: params
   })
-}
+}

+ 57 - 69
src/views/deposit_home/components/refund_list-detail.vue

@@ -82,12 +82,12 @@
               detailList.examineStatus == 'SAVE'
                 ? '保存'
                 : detailList.examineStatus == 'WAIT'
-                  ? '待审核'
-                  : detailList.examineStatus == 'OK'
-                    ? '通过'
-                    : detailList.examineStatus == 'FAIL'
-                      ? '不通过'
-                      : '关闭'
+                ? '待审核'
+                : detailList.examineStatus == 'OK'
+                ? '通过'
+                : detailList.examineStatus == 'FAIL'
+                ? '不通过'
+                : '关闭'
             }}
           </div>
         </el-col>
@@ -143,21 +143,13 @@
         <el-col :xs="24" :sm="24" :lg="8" class="item">
           <div class="label">实际使用单位</div>
           <div class="value">
-            <el-input
-              v-model="detailList.realUseUnit"
-              :readonly="detailList.examineStatus !== 'WAIT'"
-              placeholder="请输入实际使用单位"
-            />
+            <el-input v-model="detailList.realUseUnit" placeholder="请输入实际使用单位" />
           </div>
         </el-col>
         <el-col :xs="24" :sm="24" :lg="8" class="item">
           <div class="label">实际安装地址</div>
           <div class="value">
-            <el-input
-              v-model="detailList.realInstallAddress"
-              :readonly="detailList.examineStatus !== 'WAIT'"
-              placeholder="请输入实际安装地址"
-            />
+            <el-input v-model="detailList.realInstallAddress" placeholder="请输入实际安装地址" />
           </div>
         </el-col>
         <el-col :xs="24" :sm="24" :lg="8" class="item">
@@ -169,11 +161,7 @@
         <el-col :xs="24" :sm="24" :lg="8" class="item">
           <div class="label">购买单位</div>
           <div class="value">
-            <el-input
-              v-model="detailList.refBuyUnitName"
-              :readonly="detailList.examineStatus !== 'WAIT'"
-              placeholder="请输入购买单位"
-            />
+            <el-input v-model="detailList.refBuyUnitName" placeholder="请输入购买单位" />
           </div>
         </el-col>
         <!-- <el-col :xs="24" :sm="24" :lg="8" class="item">
@@ -193,31 +181,20 @@
           <div class="label">备注</div>
           <!-- <div class="value">{{ detailList.remark }}</div> -->
           <div class="value">
-            <el-input
-              v-model="detailList.remark"
-              :readonly="detailList.examineStatus !== 'WAIT'"
-              placeholder="请输入内容"
-            />
+            <el-input v-model="detailList.remark" placeholder="请输入内容" />
           </div>
         </el-col>
         <el-col v-if="!isCustomer" :xs="24" :sm="24" :lg="24" class="item">
           <div class="label">格力内部备注</div>
           <!-- <div class="value">{{  detailList.geLiInerNote}}</div> -->
           <div class="value">
-            <el-input
-              v-model="detailList.geLiInerNote"
-              placeholder="请输入格力内部备注"
-            />
+            <el-input v-model="detailList.geLiInerNote" placeholder="请输入格力内部备注" />
           </div>
         </el-col>
         <el-col v-if="!isCustomer" :xs="24" :sm="24" :lg="24" class="item">
           <div class="label">格力内部资料备注</div>
           <div class="value">
-            <el-input
-              v-model="detailList.geLiInnerDataNote"
-              :readonly="detailList.examineStatus !== 'WAIT'"
-              placeholder="请输入格力内部资料备注"
-            />
+            <el-input v-model="detailList.geLiInnerDataNote" placeholder="请输入格力内部资料备注" />
           </div>
         </el-col>
         <el-col v-if="!isCustomer" :xs="24" :sm="24" :lg="24" class="item">
@@ -775,11 +752,11 @@
                 fit="cover"
                 :preview-src-list="[imageURL + scope.row.fileUrl]"
               />
-              <img v-if="checkFileType(scope.row.fileUrl) == 'word'" class="file" src="@/assets/common/word.png">
-              <img v-if="checkFileType(scope.row.fileUrl) == 'excel'" class="file" src="@/assets/common/excel.png">
-              <img v-if="checkFileType(scope.row.fileUrl) == 'ppt'" class="file" src="@/assets/common/ppt.png">
-              <img v-if="checkFileType(scope.row.fileUrl) == 'pdf'" class="file" src="@/assets/common/pdf.png">
-              <img v-if="checkFileType(scope.row.fileUrl) == 'file'" class="file aaa" src="@/assets/common/zip.jpeg">
+              <img v-if="checkFileType(scope.row.fileUrl) == 'word'" class="file" src="@/assets/common/word.png" />
+              <img v-if="checkFileType(scope.row.fileUrl) == 'excel'" class="file" src="@/assets/common/excel.png" />
+              <img v-if="checkFileType(scope.row.fileUrl) == 'ppt'" class="file" src="@/assets/common/ppt.png" />
+              <img v-if="checkFileType(scope.row.fileUrl) == 'pdf'" class="file" src="@/assets/common/pdf.png" />
+              <img v-if="checkFileType(scope.row.fileUrl) == 'file'" class="file aaa" src="@/assets/common/zip.jpeg" />
             </template>
           </el-table-column>
           <el-table-column align="left" label="下载文件名称" prop="fileName" min-width="160" show-overflow-tooltip>
@@ -789,11 +766,9 @@
           </el-table-column>
           <el-table-column align="center" label="操作" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-button
-                type="text"
-                class="textColor"
-                @click="downLoadFn(scope.row.fileUrl, scope.row.fileName)"
-              >下载</el-button>
+              <el-button type="text" class="textColor" @click="downLoadFn(scope.row.fileUrl, scope.row.fileName)"
+                >下载</el-button
+              >
             </template>
           </el-table-column>
         </el-table>
@@ -984,19 +959,19 @@
                     fit="cover"
                     :preview-src-list="[imageURL + scope.row.fileUrl]"
                   />
-                  <img v-if="checkFileType(scope.row.fileUrl) == 'word'" class="file" src="@/assets/common/word.png">
+                  <img v-if="checkFileType(scope.row.fileUrl) == 'word'" class="file" src="@/assets/common/word.png" />
                   <img
                     v-if="checkFileType(scope.row.fileUrl) == 'excel'"
                     class="file"
                     src="@/assets/common/excel.png"
-                  >
-                  <img v-if="checkFileType(scope.row.fileUrl) == 'ppt'" class="file" src="@/assets/common/ppt.png">
-                  <img v-if="checkFileType(scope.row.fileUrl) == 'pdf'" class="file" src="@/assets/common/pdf.png">
+                  />
+                  <img v-if="checkFileType(scope.row.fileUrl) == 'ppt'" class="file" src="@/assets/common/ppt.png" />
+                  <img v-if="checkFileType(scope.row.fileUrl) == 'pdf'" class="file" src="@/assets/common/pdf.png" />
                   <img
                     v-if="checkFileType(scope.row.fileUrl) == 'file'"
                     class="file aaa"
                     src="@/assets/common/zip.jpeg"
-                  >
+                  />
                 </template>
               </el-table-column>
               <el-table-column align="left" label="下载文件名称" prop="fileName" min-width="160" show-overflow-tooltip>
@@ -1006,11 +981,9 @@
               </el-table-column>
               <el-table-column align="center" label="操作" min-width="160" show-overflow-tooltip>
                 <template slot-scope="scope">
-                  <el-button
-                    type="text"
-                    class="textColor"
-                    @click="downLoadFn(scope.row.fileUrl, scope.row.fileName)"
-                  >下载</el-button>
+                  <el-button type="text" class="textColor" @click="downLoadFn(scope.row.fileUrl, scope.row.fileName)"
+                    >下载</el-button
+                  >
                 </template>
               </el-table-column>
             </el-table>
@@ -1066,23 +1039,18 @@
         </div>
       </div>
     </div>
-    <br>
+    <br />
     <!-- 按钮 -->
     <!-- detailList.examineStatus != 'OK' || detailList.examineStatus != 'FAIL' -->
     <div class="btn-group clearfix">
       <div class="fl">
-        <el-button
-          v-if="detailList.examineStatus == 'WAIT'"
-          type="primary"
-          size="small"
-          @click="adoptFn"
-        >审批通过</el-button>
-        <el-button
-          v-if="detailList.examineStatus == 'WAIT'"
-          type="primary"
-          size="small"
-          @click="rejectFn"
-        >审批驳回</el-button>
+        <el-button v-if="title == '详情'" type="primary" size="small" @click="handleEdit">保存</el-button>
+        <el-button v-if="detailList.examineStatus == 'WAIT'" type="primary" size="small" @click="adoptFn"
+          >审批通过</el-button
+        >
+        <el-button v-if="detailList.examineStatus == 'WAIT'" type="primary" size="small" @click="rejectFn"
+          >审批驳回</el-button
+        >
         <el-button v-if="detailList.examineStatus == 'OK'" type="primary" size="small" @click="saveFn">保存</el-button>
       </div>
     </div>
@@ -1096,7 +1064,9 @@ import { mapGetters } from 'vuex'
 import {
   getDepositManageDetail,
   getDepositManageExamine,
-  getDepositManageEdit } from '@/api/engin_deposit/refund_list'
+  editManageExamine,
+  getDepositManageEdit
+} from '@/api/engin_deposit/refund_list'
 import { computeDiff } from '@/api/engin_deposit.js'
 
 export default {
@@ -1429,6 +1399,23 @@ export default {
       // this.goBack();
       // this.$emit("updateList");
     },
+    handleEdit() {
+      const data = {
+        ...this.detailList,
+        checkBy: this.checkBy,
+        // checkDate: this.checkDate,
+        isRefundDeposit: this.isRefundDeposit,
+        checkNote: this.checkNote,
+        examineResult: 1
+      }
+
+      editManageExamine(data).then(res => {
+        this.$successMsg('编辑成功')
+
+        this.goBack()
+        this.$emit('updateList')
+      })
+    },
     async getData(data) {
       const res = await getDepositManageDetail(data)
       console.log(res)
@@ -1469,6 +1456,7 @@ export default {
         this.title = '详情'
       }
     },
+
     goBack() {
       this.$emit('setShowPage', 0)
     }