index.vue 6.2 KB

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