dispatchTable.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <template>
  2. <div>
  3. <el-table
  4. class="mt-10"
  5. :data="tableData"
  6. style="width: 100%"
  7. size="mini"
  8. border
  9. @row-click="rowClick">
  10. <el-table-column
  11. type="selection"
  12. width="55">
  13. </el-table-column>
  14. <el-table-column
  15. prop="billno"
  16. label="发货单号">
  17. </el-table-column>
  18. <el-table-column
  19. prop="sonum"
  20. label="订单号">
  21. </el-table-column>
  22. <el-table-column
  23. prop="enterprisename"
  24. label="企业名称">
  25. </el-table-column>
  26. <el-table-column
  27. prop="recheckby"
  28. label="收货人">
  29. </el-table-column>
  30. <el-table-column
  31. prop="contactsphonenumber"
  32. label="收货人联系电话">
  33. </el-table-column>
  34. <el-table-column
  35. prop="province"
  36. label="省市县">
  37. <template slot-scope="scope" v-if="scope.row.province">
  38. {{`${scope.row.province}-${scope.row.city}-${scope.row.county}`}}
  39. </template>
  40. </el-table-column>
  41. <el-table-column
  42. prop="address"
  43. label="地址">
  44. </el-table-column>
  45. <el-table-column
  46. v-if="type === 'edit'"
  47. label="操作"
  48. width="90">
  49. <template slot-scope="scope">
  50. <el-button type="text" @click="deleteDisBill(scope.row)" size="small">删 除</el-button>
  51. </template>
  52. </el-table-column>
  53. </el-table>
  54. </div>
  55. </template>
  56. <script>
  57. export default {
  58. props:['needQuery','type'],
  59. data() {
  60. return {
  61. tableData: []
  62. }
  63. },
  64. components:{
  65. },
  66. mounted () {
  67. this.needQuery?this.listData():''
  68. },
  69. methods:{
  70. async deleteDisBill (row) {
  71. if (this.needQuery) {
  72. const res = await this.$api.requested({
  73. "id": "20221122133404",
  74. "content": {
  75. "sa_logisticsid":this.$route.query.id,
  76. "sa_logistics_itemsids":[row.sa_logistics_itemsid]
  77. }
  78. })
  79. this.tool.showMessage(res,()=>{
  80. this.listData()
  81. })
  82. } else {
  83. this.tableData = this.tableData.filter(e=>{
  84. return e.sa_dispatchid !== row.sa_dispatchid
  85. })
  86. }
  87. },
  88. async listData(){
  89. const res = await this.$api.requested({
  90. "id": 20221122133004,
  91. "content": {
  92. "sa_logisticsid": this.$route.query.id,
  93. "pageNumber":1,
  94. "pageSize":100,
  95. "where": {
  96. "condition": ""
  97. }
  98. }
  99. })
  100. this.tableData = res.data
  101. res.data.length > 0?this.rowClick(res.data[0]):''
  102. },
  103. rowClick (row) {
  104. this.$emit('rowClick',row)
  105. }
  106. }
  107. }
  108. </script>