buyQuote.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <template>
  2. <div class="contentList">
  3. <Input v-model="typesearchFilter.name" placeholder="请输入标题名称" style="width: 480px"></Input>
  4. <el-button type="primary" @click="changePage(1)">查询</el-button>
  5. <el-table v-loading="loading" :data="tabData.data" style="width: 100%; margin-top: 2em" border>
  6. <el-table-column label="序号" type="index" width="70" align="center"></el-table-column>
  7. <el-table-column label="发布时间" width="160" align="center">
  8. <template #default="scope">
  9. {{ moment(scope.row.addTime).format('yyyy-MM-DD hh:mm:ss') || '暂无' }}
  10. </template>
  11. </el-table-column>
  12. <el-table-column label="联系人" width="100" prop="contactName" align="center"></el-table-column>
  13. <el-table-column label="联系电话" width="120" prop="contactCell" align="center"></el-table-column>
  14. <el-table-column label="信息标题" prop="name" width="200"></el-table-column>
  15. <el-table-column label="状态" align="center" width="100">
  16. <template #default="scope">
  17. <Tag color="orange" v-if="scope.row.status == 4">{{ publishStatus(scope.row.status) }}</Tag>
  18. <Tag color="green" v-if="scope.row.status == 3">{{ publishStatus(scope.row.status) }}</Tag>
  19. <Tag color="red" v-if="scope.row.status == 2">{{ publishStatus(scope.row.status) }}</Tag>
  20. <Tag color="blue" v-if="scope.row.status == 1">{{ publishStatus(scope.row.status) }}</Tag>
  21. <Tag color="skyblue" v-if="scope.row.status == 5">{{ publishStatus(scope.row.status) }}</Tag>
  22. </template>
  23. </el-table-column>
  24. <el-table-column label="牛只分类" width="200">
  25. <template #default="scope">
  26. {{ scope.row.classifyOneName }}/{{ scope.row.classifyTwoName }}/{{ scope.row.classifyThreeName }}
  27. </template>
  28. </el-table-column>
  29. <el-table-column label="牛只规格重量" prop="weight" min-width="120">
  30. <template #default="scope">
  31. <Tag color="blue">{{ scope.row.weight }}</Tag>
  32. </template>
  33. </el-table-column>
  34. <el-table-column prop="buyPrice" label="意向价格" align="center" min-width="120">
  35. <template #default="scope">
  36. <b style="color: red">{{ scope.row.price }}</b>
  37. </template>
  38. </el-table-column>
  39. <el-table-column label="销售数量" min-width="120" align="center">
  40. <template #default="scope">
  41. {{ scope.row.count }}
  42. </template>
  43. </el-table-column>
  44. <el-table-column label="牛只图片" align="center" width="120">
  45. <template #default="scope">
  46. <img :src="scope.row.imageUrl" style="width: 100%" />
  47. </template>
  48. </el-table-column>
  49. <el-table-column label="发布天数" align="center" width="100" prop="validDays"></el-table-column>
  50. <el-table-column label="操作" fixed="right" width="120">
  51. <template #default="scope">
  52. <!--按钮-->
  53. <!-- <el-button type="danger" size="small" @click="delContent(scope.row.id)">删除</el-button> -->
  54. <el-button type="primary" @click="showDetail(scope.row.id)">查看报价</el-button>
  55. </template>
  56. </el-table-column>
  57. </el-table>
  58. <div class="page_style">
  59. <Page :total="tabData.total" :model-value="currentPage" show-elevator show-total @on-change="changePage" />
  60. </div>
  61. <el-dialog v-model="dialogTableVisible" v-loading="tableLoading" title="报价列表" width="90%">
  62. <el-table :data="tableData" border>
  63. <el-table-column property="contactName" label="报价人" width="150" />
  64. <el-table-column property="contactPhone" label="联系方式" width="150" />
  65. <el-table-column property="round" label="报价轮数" />
  66. <el-table-column property="quotePrice" label="报价金额(元/公斤)" />
  67. <el-table-column property="quoteCount" label="报价数量(头)" />
  68. <el-table-column property="addTime" label="报价时间">
  69. <template #default="scope">
  70. {{ moment(scope.row.addTime).format('yyyy-MM-DD hh:mm:ss') || '暂无' }}
  71. </template>
  72. </el-table-column>
  73. <el-table-column property="quotePriceRound2" label="二轮报价金额(元/公斤)">
  74. <template #default="scope">
  75. {{ scope.row.quotePriceRound2 || '无' }}
  76. </template>
  77. </el-table-column>
  78. <el-table-column property="quoteCountRound2" label="二轮报价数量(头)">
  79. <template #default="scope">
  80. {{ scope.row.quoteCountRound2 || '无' }}
  81. </template>
  82. </el-table-column>
  83. <el-table-column property="addTimeRound2" label="二轮报价时间">
  84. <template #default="scope">
  85. {{ scope.row.addTimeRound2 ? moment(scope.row.addTimeRound2).format('yyyy-MM-DD hh:mm:ss') : '无' }}
  86. </template>
  87. </el-table-column>
  88. <el-table-column property="validTime" label="报价有效期(天)" />
  89. <el-table-column property="status" label="状态">
  90. <template #default="scope">
  91. {{ quoteStatus(scope.row.status) }}
  92. </template>
  93. </el-table-column>
  94. </el-table>
  95. </el-dialog>
  96. </div>
  97. </template>
  98. <script setup>
  99. import { defineComponent, ref, reactive, onMounted } from 'vue'
  100. import { Modal } from 'view-ui-plus'
  101. import { publishStatus, quoteStatus } from '@/utils/system/filters'
  102. import moment from 'moment'
  103. import { cow } from '@/request/api'
  104. let typesearchFilter = reactive({ limit: 10, offset: 0, type: 2, hasQuote: 1 })
  105. let tabData = ref({})
  106. const loading = ref(false)
  107. //获取列表内容
  108. async function getData() {
  109. loading.value = true
  110. await cow.getCattleDealPageByAdminAndType(typesearchFilter).then(res => {
  111. if (res.code == 101) {
  112. tabData.value = res || {}
  113. }
  114. })
  115. loading.value = false
  116. }
  117. let currentPage = ref(1)
  118. //更改页码
  119. function changePage(page) {
  120. if (tabData.value.limit) {
  121. typesearchFilter.offset = (page - 1) * tabData.value.limit //更新偏移量
  122. currentPage.value = page //切换当前页码
  123. getData() //获取广告数据
  124. }
  125. }
  126. const tableData = ref([])
  127. let dialogTableVisible = ref(false)
  128. let tableLoading = ref(false)
  129. async function showDetail(id) {
  130. tableLoading.value = true
  131. dialogTableVisible.value = true
  132. await cow.quoteList({ cattleDealId: id, limit: 1000 }).then(res => {
  133. tableData.value = res.data
  134. })
  135. tableLoading.value = false
  136. }
  137. onMounted(() => {
  138. getData()
  139. })
  140. </script>
  141. <style lang="scss" scoped>
  142. .contentList {
  143. padding: 1em;
  144. .page_style {
  145. text-align: right;
  146. margin-top: 1em;
  147. background-color: var(--system-container-background);
  148. }
  149. }
  150. </style>