Rap 原分销系统代码Web
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

216 рядки
6.2KB

  1. <template>
  2. <div class="app-container">
  3. <!--搜索-->
  4. <el-form class="mt_15" ref="form" inline size="small">
  5. <el-form-item label="状态">
  6. <el-select v-model.trim="searchParm.status" placeholder="请选择">
  7. <el-option
  8. v-for="item in statusList"
  9. :key="item.value"
  10. :label="item.label"
  11. :value="item.value">
  12. </el-option>
  13. </el-select>
  14. </el-form-item>
  15. <el-form-item label="公司ID">
  16. <el-input v-model.trim="searchParm.companyId" clearable placeholder='公司ID'></el-input>
  17. </el-form-item>
  18. <el-form-item label="买家ID">
  19. <el-input v-model.trim="searchParm.tokenEnum" clearable></el-input>
  20. </el-form-item>
  21. <el-form-item>
  22. <el-button type="primary" @click="goSearch">搜索</el-button>
  23. <el-button type="warning" @click="resetForm">重置</el-button>
  24. </el-form-item>
  25. </el-form>
  26. <!--表格渲染-->
  27. <el-table ref="table" border size="small" :data="list" :header-cell-style="{textAlign:'center'}" :cell-style="{textAlign:'center'}">
  28. <el-table-column label="序号" type="index" width="50" />
  29. <el-table-column label="公司ID" prop="companyId" />
  30. <el-table-column label="买家ID" prop="tokenEnum" />
  31. <el-table-column label="订单来源" prop="fromDetailInfo" />
  32. <el-table-column label="状态" prop="status">
  33. <template slot-scope="scope">
  34. {{ scope.row.status | getStatus}}
  35. </template>
  36. </el-table-column>
  37. <el-table-column label="创建时间" prop="createdAt" />
  38. <el-table-column label="修改时间" prop="updatedAt" />
  39. <el-table-column label="操作" width="220">
  40. <template slot-scope="scope">
  41. <el-button type="info" @click="getBtnById(scope.row.id)">查看</el-button>
  42. </template>
  43. </el-table-column>
  44. </el-table>
  45. <!--分页-->
  46. <div class="mt_15">
  47. <el-pagination
  48. @size-change="handleSizeChange"
  49. @current-change="handleCurrentChange"
  50. :current-page="searchParm.page"
  51. :page-sizes="[10, 20, 30, 40, 50]"
  52. :page-size="searchParm.pageSize"
  53. layout="total, sizes, prev, pager, next, jumper"
  54. :total="total">
  55. </el-pagination>
  56. </div>
  57. <!--详情弹窗-->
  58. <el-dialog :visible.sync="dialogDetailVisible" :title="dialogDetailTitle" center width="45%">
  59. <div class="dialog-content">
  60. <el-form ref="form" size="small" label-width="100px">
  61. <el-form-item label="公司ID" prop="companyId">
  62. <el-input v-model.trim="detailParm.companyId" :disabled="true"></el-input>
  63. </el-form-item>
  64. <el-form-item label="订单来源" prop="fromDetailInfo">
  65. <el-input v-model.trim="detailParm.fromDetailInfo" :disabled="true"></el-input>
  66. </el-form-item>
  67. <el-form-item label="产品信息" prop="cartList" >
  68. <el-input v-model.trim="detailParm.cartList" :disabled="true"></el-input>
  69. </el-form-item>
  70. <el-form-item label="订单收货地址" prop="contactInfo">
  71. <el-input v-model.trim="detailParm.contactInfo" :disabled="true"></el-input>
  72. </el-form-item>
  73. <el-form-item label="买家ID" prop="tokenEnum">
  74. <el-input v-model.trim="detailParm.tokenEnum" :disabled="true"></el-input>
  75. </el-form-item>
  76. <el-form-item label="状态" prop="status">
  77. <!-- <el-input v-model.trim="detailParm.status" :disabled="true"></el-input> -->
  78. <el-select v-model.trim="detailParm.status" disabled placeholder="请选择">
  79. <el-option
  80. v-for="item in statusList"
  81. :key="item.value"
  82. :label="item.label"
  83. :value="item.value">
  84. </el-option>
  85. </el-select>
  86. </el-form-item>
  87. </el-form>
  88. </div>
  89. </el-dialog>
  90. </div>
  91. </template>
  92. <script>
  93. import { getList, getById } from '@/api/group/excelinfo'
  94. export default {
  95. filters: {
  96. getStatus: function (value) {
  97. if(value == 1) {
  98. return '待处理';
  99. } else if (value == 2) {
  100. return '处理成功';
  101. } else {
  102. return '处理失败';
  103. }
  104. }
  105. },
  106. // 数据
  107. data() {
  108. return {
  109. searchParm: {
  110. page: 1,
  111. pageSize: 10,
  112. companyId:null,
  113. sort:'created_at',
  114. order:'desc',
  115. tokenEnum:null,
  116. status:null
  117. },
  118. total:0,
  119. list: [],
  120. dialogDetailVisible: false,
  121. dialogDetailTitle: '详情',
  122. statusList:[{
  123. value: null,
  124. label: '全部'
  125. },
  126. {
  127. value: 1,
  128. label: '待处理'
  129. }, {
  130. value: 2,
  131. label: '处理成功'
  132. }, {
  133. value: 3,
  134. label: '处理失败'
  135. }],
  136. detailParm: {
  137. id: null,
  138. companyId:'',
  139. fromDetailInfo:'',
  140. cartList: '',
  141. contactInfo:'',
  142. tokenEnum:null,
  143. status:null
  144. },
  145. }
  146. },
  147. // 调用
  148. created() {
  149. this.goSearch()
  150. },
  151. //方法
  152. methods: {
  153. resetForm() {
  154. this.searchParm.status = null;
  155. this.searchParm.tokenEnum = null;
  156. this.searchParm.companyId = null;
  157. this.goSearch()
  158. },
  159. // 查询
  160. goSearch() {
  161. this.searchParm.page=1
  162. this.getDataList()
  163. },
  164. // 查看根据id
  165. getBtnById(id){
  166. getById({id}).then(res => {
  167. if(res.code==200) {
  168. this.detailParm.id = res.data.id;
  169. this.detailParm.companyId = res.data.companyId;
  170. this.detailParm.fromDetailInfo = res.data.fromDetailInfo;
  171. this.detailParm.cartList = res.data.cartList;
  172. this.detailParm.contactInfo = res.data.contactInfo;
  173. this.detailParm.tokenEnum = res.data.tokenEnum;
  174. this.detailParm.status = res.data.status;
  175. this.dialogDetailVisible = true
  176. this.$refs.ruleForm.clearValidate()
  177. }
  178. }).catch(err => {
  179. console.log(err)
  180. })
  181. },
  182. // 分页获取表格数据
  183. getDataList(){
  184. getList(this.searchParm).then(res => {
  185. console.log(res)
  186. if(res.code==200) {
  187. console.log(res)
  188. this.list = res.data.list;
  189. this.total = res.data.total;
  190. }
  191. }).catch(err => {
  192. console.log(err)
  193. })
  194. },
  195. // 分页
  196. handleSizeChange(val) {
  197. console.log(`每页 ${val} 条`);
  198. this.searchParm.pageSize = val;
  199. this.getDataList();
  200. },
  201. handleCurrentChange(val) {
  202. console.log(`当前页: ${val}`);
  203. this.searchParm.page = val;
  204. this.getDataList();
  205. }
  206. }
  207. }
  208. </script>
  209. <style rel="stylesheet/scss" lang="scss" scoped>
  210. </style>