SalesTable.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <template>
  2. <div class="sales">
  3. <h5>销售订单明细</h5>
  4. <slot name="bts">
  5. <div>
  6. <el-button type="primary" size="mini">添加</el-button>
  7. <el-button type="danger" size="mini">删除</el-button>
  8. </div>
  9. </slot>
  10. <div class="table">
  11. <el-table
  12. :data="dataList"
  13. style="width: 100%"
  14. v-bind="tableAttributes"
  15. >
  16. <el-table-column
  17. v-if="isSelection"
  18. type="selection"
  19. width="55"
  20. >
  21. </el-table-column>
  22. <el-table-column
  23. v-if="isIndex"
  24. type="index"
  25. width="50"
  26. >
  27. </el-table-column>
  28. <el-table-column
  29. v-for="(item,index) in column"
  30. :key="index"
  31. v-bind="{...item,...columnAttributes}"
  32. >
  33. <template v-slot="{row}">
  34. <template v-if="item.isInput">
  35. {{ row.prop }}
  36. </template>
  37. <template v-else>
  38. <el-input
  39. v-model.number="row.prop"
  40. class="yinput"
  41. :type="item.type?item.type:'number'"
  42. :placeholder="item.placeholder"
  43. size="mini"
  44. @mousewheel.native.prevent
  45. />
  46. </template>
  47. </template>
  48. </el-table-column>
  49. <el-table-column v-if="isOperation" fixed="left" label="操作" min-width="250" align="center">
  50. <slot>
  51. <template v-slot="{row}">
  52. <el-popconfirm
  53. style="margin-left: 10px"
  54. title="删除?"
  55. @onConfirm="handleDel(row)"
  56. >
  57. <el-button slot="reference" type="text" size="mini">提审</el-button>
  58. </el-popconfirm>
  59. </template>
  60. </slot>
  61. </el-table-column>
  62. </el-table>
  63. </div>
  64. <slot />
  65. <div>
  66. <h5>物流信息</h5>
  67. <div class="diy-table-1">
  68. <el-row>
  69. <el-col :span="6" class="item">
  70. <div class="label">销售政策编号</div>
  71. <div class="value">2222</div>
  72. </el-col>
  73. <el-col :span="6" class="item">
  74. <div class="label">销售政策编号</div>
  75. <div class="value">2222</div>
  76. </el-col>
  77. <el-col :span="6" class="item">
  78. <div class="label">销售政策编号</div>
  79. <div class="value">2222</div>
  80. </el-col>
  81. <el-col :span="6" class="item">
  82. <div class="label">销售政策编号</div>
  83. <div class="value">2222</div>
  84. </el-col>
  85. <el-col :span="6" class="item">
  86. <div class="label">销售政策编号</div>
  87. <div class="value">2222</div>
  88. </el-col>
  89. </el-row>
  90. </div>
  91. <el-timeline :reverse="reverse">
  92. <el-timeline-item
  93. v-for="(activity, index) in activities"
  94. :key="index"
  95. :timestamp="activity.timestamp"
  96. :color="activity.color"
  97. >
  98. {{ activity.content }}
  99. </el-timeline-item>
  100. </el-timeline>
  101. </div>
  102. <slot name="events">
  103. <div>
  104. <el-button type="primary" size="mini">保存</el-button>
  105. <el-button size="mini">重置</el-button>
  106. </div>
  107. </slot>
  108. </div>
  109. </template>
  110. <script>
  111. export default {
  112. name: 'SalesTable',
  113. props: {
  114. isSelection: {
  115. type: Boolean,
  116. default: false
  117. },
  118. isIndex: {
  119. type: Boolean,
  120. default: false
  121. },
  122. isOperation: {
  123. type: Boolean,
  124. default: false
  125. },
  126. tableAttributes: {
  127. type: Object,
  128. default: () => {
  129. return {}
  130. }
  131. },
  132. columnAttributes: {
  133. type: Object,
  134. default: () => {
  135. return {}
  136. }
  137. },
  138. dataList: {
  139. type: Array,
  140. default: () => {
  141. return []
  142. }
  143. }
  144. },
  145. data() {
  146. return {
  147. column: [
  148. {
  149. prop: 'date',
  150. label: '日期'
  151. },
  152. {
  153. prop: 'date',
  154. label: '日期'
  155. },
  156. {
  157. prop: 'date',
  158. label: '日期'
  159. }
  160. ],
  161. activities: [{
  162. content: '活动按期开始',
  163. color: '#0bbd87',
  164. timestamp: '2018-04-15'
  165. }, {
  166. content: '通过审核',
  167. timestamp: '2018-04-13'
  168. }, {
  169. content: '创建成功',
  170. timestamp: '2018-04-11'
  171. }]
  172. }
  173. },
  174. methods: {
  175. handleDel(row) {
  176. console.log(row)
  177. }
  178. }
  179. }
  180. </script>
  181. <style lang="scss" scoped>
  182. .sales {
  183. margin: 20px;
  184. padding: 20px;
  185. box-shadow: 0 0 8px 0 rgb(0 0 0 / 20%);
  186. }
  187. .diy-table-1 {
  188. margin: 20px 0;
  189. }
  190. </style>