index.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  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. import { getToken } from '@/utils/auth'
  66. export default {
  67. name: "boxDistribution",
  68. components: {
  69. },
  70. data() {
  71. return {
  72. //列表样式
  73. tableStyle:{
  74. cellColor: 'dodgerblue', //行内字体颜色
  75. cellCursor:'pointer'
  76. },
  77. //标签名
  78. boxDistributionName:[],
  79. //模糊下拉查询地点
  80. addressOptions:[],
  81. contactList:[],
  82. // 遮罩层
  83. loading: true,
  84. // 选中数组
  85. ids: [],
  86. // 非单个禁用
  87. single: true,
  88. // 非多个禁用
  89. multiple: true,
  90. // 显示搜索条件
  91. showSearch: true,
  92. // 总条数
  93. total: 0,
  94. // 客户详情表格数据
  95. corpsList: [],
  96. // 查询参数
  97. queryParams: {
  98. pageNum: 1,
  99. pageSize: 10,
  100. fUpdateaddress:null,
  101. },
  102. };
  103. },
  104. created() {
  105. this.getList();
  106. this.addressMethod()
  107. },
  108. activated() {
  109. this.getList()
  110. },
  111. methods: {
  112. //列表颜色更改
  113. cellStyle(row, rowIndex){
  114. if(row.columnIndex !== 0 && row.columnIndex !== 1 && row.columnIndex !== 2 ){
  115. return 'color: ' + this.tableStyle.cellColor +
  116. ';cursor' + this.tableStyle.cellCursor;
  117. }
  118. },
  119. //模糊查询地点
  120. addressMethod(){
  121. let queryParams = { pageNum: 1,};
  122. getaddress(queryParams).then(response=>{
  123. this.addressOptions = response.rows
  124. })
  125. },
  126. //点击列表传值跳转
  127. modiEy(row, column, cell, event){
  128. let res = {}
  129. if(column.label =='空' || column.label =='重'){
  130. res = {
  131. updateEFName:column.label,
  132. addressName:row["地点"]
  133. }
  134. }else if(column.label =='好' || column.label =='坏'){
  135. res = {
  136. cntrstatusName:column.label,
  137. addressName:row["地点"]
  138. }
  139. }else{
  140. res = {
  141. typeidName:column.label,
  142. addressName:row["地点"]
  143. }
  144. }
  145. if( column.label == '地点' || column.label == '附件名称' || column.label == '上传附件'){
  146. }else{
  147. // row[column.label] == 0 ||
  148. this.$router.push({
  149. path: "/containerNews/modifyPage",
  150. query: { data: JSON.stringify(res) },
  151. });
  152. }
  153. },
  154. /** 查询客户详情列表 */
  155. getList() {
  156. this.loading = true;
  157. listName().then(response =>{
  158. this.boxDistributionName = response.rows
  159. })
  160. listCorps(this.queryParams).then(response => {
  161. this.corpsList = response.rows;
  162. this.total = response.total;
  163. this.loading = false;
  164. });
  165. },
  166. // 从表重置
  167. contList() {
  168. this.contactList = []
  169. },
  170. // 状态修改
  171. handleStatusChange(row) {
  172. let text = row.fStatus === "0" ? "启用" : "停用";
  173. this.$confirm('确认要"' + text + '""' + row.fName + '"吗?', "警告", {
  174. confirmButtonText: "确定",
  175. cancelButtonText: "取消",
  176. type: "warning"
  177. }).then(function() {
  178. return changeCorpsStatus(row.fId, row.fStatus);
  179. }).then(() => {
  180. this.msgSuccess(text + "成功");
  181. }).catch(function() {
  182. row.fStatus = row.fStatus === "0" ? "1" : "0";
  183. });
  184. },
  185. /** 搜索按钮操作 */
  186. handleQuery() {
  187. this.queryParams.pageNum = 1;
  188. this.getList();
  189. },
  190. /** 重置按钮操作 */
  191. resetQuery() {
  192. this.resetForm("queryForm");
  193. this.handleQuery();
  194. },
  195. // 多选框选中数据
  196. handleSelectionChange(selection) {
  197. this.ids = selection.map(item => item.fId)
  198. this.single = selection.length!==1
  199. this.multiple = !selection.length
  200. },
  201. }
  202. };
  203. </script>
  204. <style lang="scss" scoped>
  205. </style>