approve-add-or-update.vue 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <template>
  2. <div>
  3. <div v-show="businessType === 'warehouse_flow_in'|| this.businessType === 'warehouse_flow_out'">
  4. <stock-order-detail ref="stockOrderDetail" @approveFinished="approveFinished"/>
  5. </div>
  6. <div v-show="businessType === 'contract_review'">
  7. <contract-detail ref="contractDetail" @approveFinished="approveFinished"/>
  8. </div>
  9. <div v-show="businessType === 'sale_order_flow'">
  10. <order-detail ref="orderDetail" @approveFinished="approveFinished"/>
  11. </div>
  12. <div v-show="businessType === 'sale_purchase_flow'">
  13. <purchase-detail ref="purchaseDetail" @approveFinished="approveFinished"/>
  14. </div>
  15. <div v-show="businessType === 'wh_template_record_flow'">
  16. <template-out-detail ref="templateOutDetail" @approveFinished="approveFinished"/>
  17. </div>
  18. <div v-show="businessType === 'pro_product_flow'">
  19. <product-detail ref="productDetail" @approveFinished="approveFinished"/>
  20. </div>
  21. <div v-show="businessType === 'pro_technology_flow'">
  22. <craft-detail ref="craftDetail" @approveFinished="approveFinished"/>
  23. </div>
  24. </div>
  25. </template>
  26. <script>
  27. import stockOrderDetail from '../warehouse/stock-order-detail'
  28. import contractDetail from '../cus/contract-detail'
  29. import orderDetail from '../order/order-detail'
  30. import purchaseDetail from '../sale/purchase-detail'
  31. import templateOutDetail from '../warehouse/template-delivery-detail'
  32. import productDetail from '../tech/product-detail'
  33. import craftDetail from '../tech/crafts-detail'
  34. export default {
  35. name: 'approve-add-or-update',
  36. components: {
  37. stockOrderDetail, contractDetail, orderDetail, purchaseDetail, templateOutDetail, productDetail, craftDetail
  38. },
  39. data () {
  40. return {
  41. businessType: 0,
  42. businessId: 0,
  43. display: false
  44. }
  45. },
  46. methods: {
  47. async init (businessType, businessId, display) {
  48. this.businessType = businessType || ''
  49. this.businessId = businessId || 0
  50. this.display = display
  51. if (this.businessType === 'warehouse_flow_in' || this.businessType === 'warehouse_flow_out') {
  52. this.display ? this.$refs.stockOrderDetail.init(this.businessId) : this.$refs.stockOrderDetail.init(this.businessId, businessType)
  53. } else if (this.businessType === 'contract_review') {
  54. this.display ? this.$refs.contractDetail.init(this.businessId) : this.$refs.contractDetail.init(this.businessId, businessType)
  55. } else if (this.businessType === 'sale_order_flow') {
  56. this.display ? this.$refs.orderDetail.init(this.businessId) : this.$refs.orderDetail.init(this.businessId, businessType)
  57. } else if (this.businessType === 'sale_purchase_flow') {
  58. this.display ? this.$refs.purchaseDetail.init(this.businessId) : this.$refs.purchaseDetail.init(this.businessId, businessType)
  59. } else if (this.businessType === 'wh_template_record_flow') {
  60. this.display ? this.$refs.templateOutDetail.init(this.businessId) : this.$refs.templateOutDetail.init(this.businessId, businessType)
  61. } else if (this.businessType === 'pro_product_flow') {
  62. this.display ? this.$refs.productDetail.init(this.businessId) : this.$refs.productDetail.init(this.businessId, businessType)
  63. } else if (this.businessType === 'pro_technology_flow') {
  64. this.display ? this.$refs.craftDetail.init(this.businessId) : this.$refs.craftDetail.init(this.businessId, businessType)
  65. } else {
  66. this.$message.error('流程类别不支持,请联系管理员!')
  67. }
  68. },
  69. approveFinished () {
  70. this.$emit('refreshDataList')
  71. }
  72. }
  73. }
  74. </script>
  75. <style scoped>
  76. .my-line{
  77. border-bottom: 1px solid #c0c4cc;
  78. margin-bottom: 10px;
  79. }
  80. .title{
  81. padding: 10px 0 ;
  82. }
  83. </style>