approve-add-or-update.vue 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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" @onChose="onChose"/>
  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. onChose () {
  48. this.$emit('onChose')
  49. },
  50. async init (businessType, businessId, display) {
  51. this.businessType = businessType || ''
  52. this.businessId = businessId || 0
  53. this.display = display
  54. if (this.businessType === 'warehouse_flow_in' || this.businessType === 'warehouse_flow_out') {
  55. this.display ? this.$refs.stockOrderDetail.init(this.businessId) : this.$refs.stockOrderDetail.init(this.businessId, businessType)
  56. } else if (this.businessType === 'contract_review') {
  57. this.display ? this.$refs.contractDetail.init(this.businessId) : this.$refs.contractDetail.init(this.businessId, businessType)
  58. } else if (this.businessType === 'sale_order_flow') {
  59. this.display ? this.$refs.orderDetail.init(this.businessId) : this.$refs.orderDetail.init(this.businessId, businessType)
  60. } else if (this.businessType === 'sale_purchase_flow') {
  61. this.display ? this.$refs.purchaseDetail.init(this.businessId) : this.$refs.purchaseDetail.init(this.businessId, businessType)
  62. } else if (this.businessType === 'wh_template_record_flow') {
  63. this.display ? this.$refs.templateOutDetail.init(this.businessId) : this.$refs.templateOutDetail.init(this.businessId, businessType)
  64. } else if (this.businessType === 'pro_product_flow') {
  65. this.display ? this.$refs.productDetail.init(this.businessId) : this.$refs.productDetail.init(this.businessId, businessType)
  66. } else if (this.businessType === 'pro_technology_flow') {
  67. this.display ? this.$refs.craftDetail.init(this.businessId) : this.$refs.craftDetail.init(this.businessId, businessType)
  68. } else {
  69. this.$message.error('流程类别不支持,请联系管理员!')
  70. }
  71. },
  72. approveFinished () {
  73. this.$emit('refreshDataList')
  74. }
  75. }
  76. }
  77. </script>
  78. <style scoped>
  79. .my-line{
  80. border-bottom: 1px solid #c0c4cc;
  81. margin-bottom: 10px;
  82. }
  83. .title{
  84. padding: 10px 0 ;
  85. }
  86. </style>