index.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-row>
  5. <el-form-item label="地点" prop="fUpdateaddress">
  6. <el-input style="width: 240px" v-model="queryParams.fUpdateaddress" placeholder="请输入或选择地点" clearable size="small">
  7. </el-input>
  8. </el-form-item>
  9. <el-form-item label="箱型" prop="fNo">
  10. <el-input
  11. v-model="queryParams.fNo"
  12. style="width: 240px"
  13. placeholder="请输入箱号"
  14. clearable
  15. size="small"
  16. @keyup.enter.native="handleQuery"
  17. />
  18. </el-form-item>
  19. </el-row>
  20. </el-form>
  21. <el-row :gutter="10" class="mb8">
  22. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  23. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  24. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  25. </el-row>
  26. <el-table @cell-click="modiEy" v-loading="loading" :data="corpsList" @selection-change="handleSelectionChange">
  27. <el-table-column type="selection" width="55" align="center" />
  28. <el-table-column type="index" width="55" label="行号" align="center" />
  29. <el-table-column
  30. v-for="(item,index) in boxDistributionName"
  31. :key="item.index"
  32. :label="item"
  33. :value="item.index"
  34. :prop="item"
  35. >
  36. </el-table-column>
  37. </el-table>
  38. <pagination
  39. v-show="total>0"
  40. :total="total"
  41. :page.sync="queryParams.pageNum"
  42. :limit.sync="queryParams.pageSize"
  43. @pagination="getList"
  44. />
  45. </div>
  46. </template>
  47. <script>
  48. import { listCorps, listName, getCorps, delCorps, changeCorpsStatus,exportCorps } from "@/api/kaihe/containerNews/boxDistribution";
  49. export default {
  50. name: "boxDistribution",
  51. components: {
  52. },
  53. data() {
  54. return {
  55. //标签名
  56. boxDistributionName:[],
  57. contactList:[],
  58. // 遮罩层
  59. loading: true,
  60. // 选中数组
  61. ids: [],
  62. // 非单个禁用
  63. single: true,
  64. // 非多个禁用
  65. multiple: true,
  66. // 显示搜索条件
  67. showSearch: true,
  68. // 总条数
  69. total: 0,
  70. // 客户详情表格数据
  71. corpsList: [],
  72. // 查询参数
  73. queryParams: {
  74. pageNum: 1,
  75. pageSize: 10,
  76. fUpdateaddress:null,
  77. },
  78. };
  79. },
  80. created() {
  81. this.getList();
  82. },
  83. activated() {
  84. this.getList()
  85. },
  86. methods: {
  87. modiEy(row, column, cell, event){
  88. let res = {}
  89. if(column.label =='空' || column.label =='重'){
  90. res = {
  91. updateEFName:column.label,
  92. fUpdateaddress:row["地点"]
  93. }
  94. }else if(column.label =='好' || column.label =='坏'){
  95. res = {
  96. cntrstatusName:column.label,
  97. fUpdateaddress:row["地点"]
  98. }
  99. }else{
  100. res = {
  101. typeidName:column.label,
  102. fUpdateaddress:row["地点"]
  103. }
  104. }
  105. if(row[column.label] != 0){
  106. this.$router.push({
  107. path: "/containerNews/modifyPage",
  108. query: { data: JSON.stringify(res) },
  109. });
  110. }
  111. },
  112. /** 查询客户详情列表 */
  113. getList() {
  114. this.loading = true;
  115. listName().then(response =>{
  116. this.boxDistributionName = response.rows
  117. })
  118. listCorps(this.queryParams).then(response => {
  119. this.corpsList = response.rows;
  120. this.total = response.total;
  121. this.loading = false;
  122. });
  123. },
  124. // 从表重置
  125. contList() {
  126. this.contactList = []
  127. },
  128. // 状态修改
  129. handleStatusChange(row) {
  130. let text = row.fStatus === "0" ? "启用" : "停用";
  131. this.$confirm('确认要"' + text + '""' + row.fName + '"吗?', "警告", {
  132. confirmButtonText: "确定",
  133. cancelButtonText: "取消",
  134. type: "warning"
  135. }).then(function() {
  136. return changeCorpsStatus(row.fId, row.fStatus);
  137. }).then(() => {
  138. this.msgSuccess(text + "成功");
  139. }).catch(function() {
  140. row.fStatus = row.fStatus === "0" ? "1" : "0";
  141. });
  142. },
  143. /** 搜索按钮操作 */
  144. handleQuery() {
  145. this.queryParams.pageNum = 1;
  146. this.getList();
  147. },
  148. /** 重置按钮操作 */
  149. resetQuery() {
  150. this.resetForm("queryForm");
  151. this.handleQuery();
  152. },
  153. // 多选框选中数据
  154. handleSelectionChange(selection) {
  155. this.ids = selection.map(item => item.fId)
  156. this.single = selection.length!==1
  157. this.multiple = !selection.length
  158. },
  159. }
  160. };
  161. </script>
  162. <style lang="scss">
  163. </style>