fill-order-detail.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <template id="fill-order-detail">
  2. <el-dialog :visible.sync="edit.visible" width="20%" title="订单详情">
  3. <div>
  4. <el-table :data="goods_list" border v-loading="loading" size="small" style="margin-bottom: 15px;"
  5. >
  6. <el-table-column prop="id" width="80" label="ID"></el-table-column>
  7. <el-table-column label="商品信息" width="150">
  8. <template slot-scope="scope">
  9. <com-image style="float: left;margin-right: 5px;" mode="aspectFill"
  10. :src="scope.row.goods.cover_pic"></com-image>
  11. <div>{{scope.row.goods.name}}</div>
  12. </template>
  13. </el-table-column>
  14. <el-table-column label="拿货数量" prop="num">
  15. </el-table-column>
  16. <el-table-column label="总价" prop="price">
  17. </el-table-column>
  18. <el-table-column label="商品售价" prop="sale_price">
  19. </el-table-column>
  20. <el-table-column label="补货奖励" prop="fill_price">
  21. </el-table-column>
  22. </el-table>
  23. </div>
  24. </el-dialog>
  25. </template>
  26. <script>
  27. Vue.component('fill-order-detail', {
  28. template: '#fill-order-detail',
  29. props: {
  30. value: {
  31. type: Boolean,
  32. default: false
  33. },
  34. order_id: {
  35. type: Number,
  36. default: 0
  37. }
  38. },
  39. data() {
  40. return {
  41. loading:false,
  42. edit: {
  43. visible: false
  44. }
  45. ,goods_list:[],
  46. }
  47. },
  48. mounted() {
  49. console.log(this.order_id)
  50. },
  51. watch: {
  52. value() {
  53. if (this.value) {
  54. this.edit.visible = true;
  55. this.loadDetail(this.order_id)
  56. }
  57. }
  58. ,
  59. 'edit.visible'() {
  60. if (!this.edit.visible) {
  61. this.editCancel();
  62. }
  63. }
  64. },
  65. methods: {
  66. loadDetail(order_id) {
  67. this.loading = true;
  68. let params = {
  69. r: 'cloud-stock-two/order/fill-order-detail',
  70. order_id: order_id
  71. };
  72. request({
  73. params: params,
  74. method: 'get',
  75. }).then(e => {
  76. this.loading=false;
  77. if (e.data.code == 0) {
  78. this.goods_list = e.data.data.list;
  79. } else {
  80. this.$message.error(e.data.msg);
  81. }
  82. }).catch(e => {
  83. });
  84. },
  85. editCancel(){
  86. this.$emit('input', false);
  87. },
  88. }
  89. });
  90. </script>