Эх сурвалжийг харах

合并审批详情和表单页面

chris 3 жил өмнө
parent
commit
e49d73f9a2

+ 0 - 1
src/views/common/msg.vue

@@ -38,7 +38,6 @@
             return
           }
           that.dataForm = JSON.parse(event.data)
-          console.log('dataForm = ' + that.dataForm)
           // if (!that.visible) {
           //   that.visible = true
           // }

+ 12 - 4
src/views/modules/msg-center/approve-add-or-update.vue

@@ -3,28 +3,36 @@
     <div v-show="businessType === 'warehouse_flow_in'">
       <stock-order-detail ref="stockOrderDetail" @approveFinished="approveFinished"/>
     </div>
+    <div v-show="businessType === 'contract_review'">
+      <contract-detail ref="contractDetail" @approveFinished="approveFinished"/>
+    </div>
   </div>
 </template>
 
 <script>
   import stockOrderDetail from '../warehouse/stock-order-detail'
+  import contractDetail from '../cus/contract-detail'
   export default {
     name: 'approve-add-or-update',
     components: {
-      stockOrderDetail
+      stockOrderDetail, contractDetail
     },
     data () {
       return {
         businessType: 0,
-        businessId: 0
+        businessId: 0,
+        display: false
       }
     },
     methods: {
-      async init (businessType, businessId) {
+      async init (businessType, businessId, display) {
         this.businessType = businessType || ''
         this.businessId = businessId || 0
+        this.display = display
         if (this.businessType === 'warehouse_flow_in') {
-          this.$refs.stockOrderDetail.init(this.businessId, businessType)
+          this.display ? this.$refs.stockOrderDetail.init(this.businessId) : this.$refs.stockOrderDetail.init(this.businessId, businessType)
+        } else {
+          this.$message.error('类型错误,请联系管理员!')
         }
       },
       approveFinished () {

+ 0 - 42
src/views/modules/msg-center/approve-detail.vue

@@ -1,42 +0,0 @@
-<template>
-  <div>
-    <div v-show="businessType === 'warehouse_flow_in'">
-      <stock-order-detail ref="stockOrderDetail"/>
-    </div>
-  </div>
-</template>
-
-<script>
-  import stockOrderDetail from '../warehouse/stock-order-detail'
-  export default {
-    name: 'approve-detail',
-    components: {
-      stockOrderDetail
-    },
-    data () {
-      return {
-        businessType: '',
-        businessId: 0
-      }
-    },
-    methods: {
-      async init (businessType, businessId) {
-        this.businessType = businessType || ''
-        this.businessId = businessId || 0
-        if (this.businessType === 'warehouse_flow_in') {
-          this.$refs.stockOrderDetail.init(this.businessId)
-        }
-      }
-    }
-  }
-</script>
-
-<style scoped>
-.my-line{
-  border-bottom: 1px solid #c0c4cc;
-  margin-bottom: 10px;
-}
-.title{
-  padding: 10px 0 ;
-}
-</style>

+ 7 - 10
src/views/modules/msg-center/approve.vue

@@ -110,13 +110,11 @@
       layout="total, sizes, prev, pager, next, jumper">
     </el-pagination>
     <!-- 弹窗, 新增 / 修改 -->
-    <detail v-if="detailVisible" ref="detail"/>
     <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getApprovalList"/>
   </div>
 </template>
 
 <script>
-  import Detail from './approve-detail'
   import AddOrUpdate from './approve-add-or-update'
   import { getApprovalList } from '@/api/msg'
   import { getCusList } from '@/api/cus'
@@ -124,7 +122,7 @@
   export default {
     name: 'order',
     components: {
-      Detail,
+      // Detail,
       AddOrUpdate
     },
     created () {
@@ -133,7 +131,6 @@
     data () {
       return {
         addOrUpdateVisible: false,
-        detailVisible: false,
         dataForm: {},
         dataList: [],
         pageIndex: 1,
@@ -222,6 +219,10 @@
           }
         })
       },
+      checkUser (row) {
+        let currentUser = this.$store.state.user.name
+        return checkStr(currentUser, row.approver)
+      },
       // 新增 / 修改
       addOrUpdateHandle (businessType, businessId) {
         this.addOrUpdateVisible = true
@@ -229,15 +230,11 @@
           this.$refs.addOrUpdate.init(businessType, businessId)
         })
       },
-      checkUser (row) {
-        let currentUser = this.$store.state.user.name
-        return checkStr(currentUser, row.approver)
-      },
       // 详情
       detailHandle (businessType, businessId) {
-        this.detailVisible = true
+        this.addOrUpdateVisible = true
         this.$nextTick(() => {
-          this.$refs.detail.init(businessType, businessId)
+          this.$refs.addOrUpdate.init(businessType, businessId, true)
         })
       }
     }

+ 0 - 117
src/views/modules/msg-center/approveTo.vue

@@ -1,117 +0,0 @@
-<template>
-  <el-dialog
-    title="审批"
-    width="70%"
-    :close-on-click-modal="false"
-    :visible.sync="visible">
-    <el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="auto">
-      <el-row class="my-row">
-        <el-form-item label="处理意见" prop="remark">
-          <el-input type="textarea" v-model="dataForm.remark" placeholder="处理意见"></el-input>
-        </el-form-item>
-      </el-row>
-      <el-row class="my-row">
-        <upload-component :display="display" :title="'审批附件'" :accept="'*'" :file-obj-list="fileList" @uploadSuccess="uploadSuccess"/>
-      </el-row>
-    </el-form>
-    <span slot="footer" class="dialog-footer">
-      <el-button @click="dataFormSubmit(2)">不同意</el-button>
-      <el-button type="primary" @click="dataFormSubmit(1)">同意</el-button>
-      <el-button type="danger" @click="dataFormSubmit(3)">驳回</el-button>
-    </span>
-  </el-dialog>
-</template>
-
-<script>
-  // import { getcoCode, getReviewType, getreDetail } from '@/api/cus'
-  import UploadComponent from '../common/upload-component'
-  export default {
-    name: 'notice-add-or-update',
-    components: {UploadComponent},
-    data () {
-      return {
-        visible: false,
-        dictType: 'material_type',
-        options: [],
-        options1: [],
-        dataList: [],
-        fileList: [],
-        id: 0,
-        dataForm: {
-          notes: '',
-          attachList: [],
-          busiId: ''
-        },
-        dataRule: {
-          remark: [{ required: true, message: '处理意见不能为空', trigger: 'blur' }]
-        },
-        display: false
-      }
-    },
-    methods: {
-      async init (id, disabled) {
-        this.visible = true
-        this.id = id || 0
-        this.dataForm = {
-          notes: '',
-          attachList: [],
-          busiId: ''
-        }
-        this.dataForm.busiId = id
-      },
-      uploadSuccess (fileList) {
-        this.fileList = fileList
-      },
-      // 表单提交
-      dataFormSubmit (val) {
-        this.$refs['dataForm'].validate((valid) => {
-          if (valid) {
-            // 添加附件
-            let fList = this.fileList
-            if (fList.length > 0) {
-              this.dataForm.attachList = []
-              for (let i = 0; i < fList.length; i++) {
-                this.dataForm.attachList.push({
-                  fileName: fList[i].name,
-                  url: fList[i].url
-                })
-              }
-            }
-            this.$http({
-              url: this.$http.adornUrl(`/biz-service/business/approval`),
-              method: 'post',
-              data: this.$http.adornData({...this.dataForm, approvalType: val})
-            }).then(({data}) => {
-              if (data && data.code === '200') {
-                this.$message({
-                  message: '操作成功',
-                  type: 'success',
-                  duration: 1500,
-                  onClose: () => {
-                    this.visible = false
-                    this.$emit('refreshDataList')
-                  }
-                })
-              } else {
-                this.$message.error(data.msg)
-              }
-            })
-          }
-        })
-      },
-      validateField (type) {
-        this.$refs.dataForm.validateField(type)
-      }
-    }
-  }
-</script>
-
-<style scoped>
-.my-line{
-  border-bottom: 1px solid #c0c4cc;
-  margin-bottom: 10px;
-}
-.title{
-  padding: 10px 0 ;
-}
-</style>

+ 1 - 2
src/views/modules/warehouse/stock-order-detail.vue

@@ -138,12 +138,11 @@
   import EDescItem from '../common/e-desc-item'
   import { getBoundDetails } from '@/api/warehouse'
   import { dealStepData, dealStepLogs } from '@/api/util'
-  import UploadComponent from '../common/upload-component'
   import ApproveComponent from '../common/approve-component'
   export default {
     name: 'stock-order-detail',
     components: {
-      EDesc, EDescItem, UploadComponent, ApproveComponent
+      EDesc, EDescItem, ApproveComponent
     },
     data () {
       return {