index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  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
  11. @input="bringIn"
  12. size="small"
  13. filterable
  14. :remote-method="addressMethod"
  15. >
  16. <el-option
  17. v-for="item in this.addressOptions"
  18. :key="item.fId"
  19. :label="item.fName"
  20. :value="item.fId">
  21. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.typesName }}</span>
  22. <span style="float: right;">{{ item.fName }}</span>
  23. </el-option>
  24. </el-select>
  25. </el-form-item>
  26. <el-form-item label="空重" prop="fUpdateEF">
  27. <el-select
  28. v-model="queryParams.fUpdateEF"
  29. style="width: 240px"
  30. placeholder="请输入名称"
  31. clearable
  32. size="small"
  33. @change="changeUpdateEF"
  34. >
  35. <el-option
  36. v-for="item in this.updateEFOptions"
  37. :key="item.dictValue"
  38. :label="item.dictLabel"
  39. :value="item.dictValue"/>
  40. </el-select>
  41. </el-form-item>
  42. <el-form-item label="状态" prop="fStatus">
  43. <el-select
  44. v-model="queryParams.fStatus"
  45. style="width: 240px"
  46. placeholder="请输入名称"
  47. clearable
  48. @change="changeStatus"
  49. size="small"
  50. >
  51. <el-option
  52. v-for="item in this.cntrstatusOptions"
  53. :key="item.dictValue"
  54. :label="item.dictLabel"
  55. :value="item.dictValue"/>
  56. </el-select>
  57. <el-form-item label="时间" prop="fBdate">
  58. <el-date-picker
  59. v-model="queryParams.fBdate"
  60. type="date"
  61. value-format="yyyy-MM-dd"
  62. @change="changeDate"
  63. placeholder="选择日期">
  64. </el-date-picker>
  65. </el-form-item>
  66. </el-form-item>
  67. <el-form-item>
  68. <el-button type="cyan" size="mini" @click="determine">提交</el-button>
  69. </el-form-item>
  70. </el-row>
  71. <el-row>
  72. <el-form-item label="箱号" prop="fNo">
  73. <el-input
  74. v-model="queryParams.fNo"
  75. style="width: 240px"
  76. placeholder="请输入名称"
  77. clearable
  78. size="small"/>
  79. </el-form-item>
  80. <el-form-item>
  81. <el-button type="cyan" size="mini" @click="search">搜索</el-button>
  82. </el-form-item>
  83. </el-row>
  84. </el-form>
  85. <el-row :gutter="10" class="mb8">
  86. <!-- <el-button type="cyan" size="mini" @click="determine">提交</el-button>-->
  87. <!-- <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>-->
  88. <!-- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>-->
  89. <!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
  90. </el-row>
  91. <el-table v-loading="loading" :data="corpsList" @selection-change="handleSelectionChange">
  92. <el-table-column type="selection" width="55" align="center" />
  93. <el-table-column type="index" width="55" label="行号" align="center" />
  94. <el-table-column :show-overflow-tooltip="true" label="箱号" align="center" prop="fNo" width="200px"/>
  95. <el-table-column label="箱型" align="center" prop="typeidName" width="100px"/>
  96. <el-table-column :show-overflow-tooltip="true" label="尺寸" align="center" prop="cntrsizeName" width="100px"
  97. />
  98. <el-table-column :show-overflow-tooltip="true" label="箱主" align="center" width="100px" prop="ownerName" />
  99. <el-table-column :show-overflow-tooltip="true" label="原时间" align="center" prop="fUpdatetime" />
  100. <el-table-column :show-overflow-tooltip="true" label="原地点" align="center" prop="addressName" />
  101. <el-table-column label="原空重" align="center" prop="updateEFName" />
  102. <el-table-column label="原状态" align="center" prop="cntrstatusName" width="100"/>
  103. <el-table-column label="调入地点" align="center" prop="foldSite" width="100px"/>
  104. <el-table-column label="调入空重" align="center" prop="foldFUpdateef" width="100px"/>
  105. <el-table-column label="调入状态" align="center" prop="foldFCntrstatus" width="100px"/>
  106. <el-table-column label="调入时间" align="center" prop="foldtime" width="100px"/>
  107. <el-table-column label="船名" align="center" prop="fVsl" width="100px"/>
  108. <el-table-column label="航次" align="center" prop="fVoy" width="100px"/>
  109. <el-table-column label="提单号" align="center" prop="fMblno" width="100px"/>
  110. </el-table>
  111. <pagination
  112. v-show="total>0"
  113. :total="total"
  114. :page.sync="queryParams.pageNum"
  115. :limit.sync="queryParams.pageSize"
  116. />
  117. </div>
  118. </template>
  119. <script>
  120. import { listCorps, addmodify,getaddress} from "@/api/kaihe/containerNews/modifyPage";
  121. import Global from '@/layout/components/global'
  122. export default {
  123. name: "boxDistribution",
  124. components: {
  125. },
  126. data() {
  127. return {
  128. //模糊下拉查询地点
  129. addressOptions:[],
  130. //空重字典表
  131. updateEFOptions:[],
  132. //状态字典表
  133. cntrstatusOptions:[],
  134. // 遮罩层
  135. loading: true,
  136. // 选中数组
  137. ids: [],
  138. // 显示搜索条件
  139. showSearch: true,
  140. // 总条数
  141. total: 0,
  142. // 客户详情表格数据
  143. corpsList: [],
  144. // 查询参数
  145. queryParams: {
  146. // pageNum: 1,
  147. // pageSize: 10,
  148. // fUpdateaddress:null,
  149. // fUpdateEF:null,
  150. // fStatus:null,
  151. // fBdate:null,
  152. fNo:null,
  153. },
  154. select:'',
  155. querDate:[],
  156. };
  157. },
  158. //页面跳转后传递参数
  159. activated() {
  160. let formDate = JSON.parse(this.$route.query.data)
  161. this.querDate = JSON.parse(this.$route.query.data)
  162. if(formDate){
  163. addmodify(formDate).then(response =>{
  164. this.corpsList = response.rows
  165. this.loading = false;
  166. })
  167. }
  168. },
  169. created() {
  170. this.getDicts("f_updateEF").then(response => {
  171. this.updateEFOptions = response.data;
  172. });
  173. this.getDicts("f_cntrstatus").then(response => {
  174. this.cntrstatusOptions = response.data;
  175. });
  176. this.addressMethod()
  177. },
  178. methods: {
  179. //搜索
  180. search(){
  181. let querDates = Object.assign(this.querDate ,this.queryParams)
  182. addmodify(querDates).then(response=>{
  183. this.corpsList = response.rows
  184. })
  185. },
  186. //模糊查询地点
  187. addressMethod(){
  188. let queryParams = { pageNum: 1,};
  189. getaddress(queryParams).then(response=>{
  190. this.addressOptions = response.rows
  191. })
  192. },
  193. //提交修改数据
  194. determine(){
  195. let data = []
  196. for(let item in this.select) {
  197. for(let li in this.corpsList) {
  198. if (this.corpsList[li].fId == this.select[item].fId) {
  199. if (!this.select[item].foldSite) {
  200. this.select[item].foldSite = this.corpsList[li].fUpdateaddress
  201. }
  202. if (!this.select[item].foldFUpdateef) {
  203. this.select[item].foldFUpdateef = this.corpsList[li].updateEFName
  204. this.$set(this.select[item],'FUpdateef',this.corpsList[li].fUpdateef)
  205. }
  206. if (!this.select[item].foldFCntrstatus) {
  207. this.select[item].foldFCntrstatus = this.corpsList[li].cntrstatusName
  208. this.$set(this.select[item],'FCntrstatus',this.corpsList[li].fCntrstatus)
  209. }
  210. if (!this.select[item].foldtime) {
  211. this.select[item].foldtime = this.corpsList[li].fUpdatetime
  212. }
  213. this.select[item].fVsl = this.corpsList[li].fVsl
  214. this.select[item].fVoy = this.corpsList[li].fVoy
  215. this.select[item].fMblno = this.corpsList[li].fMblno
  216. }
  217. }
  218. data.push({
  219. fId: this.select[item].fId,
  220. foldSite: this.select[item].fold,
  221. foldFUpdateef: this.select[item].FUpdateef,
  222. foldFCntrstatus: this.select[item].FCntrstatus,
  223. foldtime: this.select[item].foldtime,
  224. fVsl: this.select[item].fVsl,
  225. fVoy:this.select[item].fVoy,
  226. fMblno:this.select[item].fMblno,
  227. })
  228. }
  229. let tCntrno = data
  230. listCorps(tCntrno).then(response =>{
  231. this.$message.success("提交成功")
  232. // this.$router.push({
  233. // path: "/containerNews/boxDistribution",
  234. // });
  235. let view = {
  236. fullPath: "/containerNews/modifyPage?data=%7B%22typeidName%22%3A%221%22,%22fUpdateaddress%22%3A%22%E5%B1%B1%E4%B8%9C%22%7D",
  237. hash: "",
  238. matched: Array(2),
  239. meta: Object,
  240. name: "ModifyPage",
  241. params: Object,
  242. path: "/containerNews/modifyPage",
  243. query: Object,
  244. title: "修改页面"
  245. }
  246. this.$router.push({ path: '/containerNews/boxDistribution'})
  247. this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => {
  248. if (this.isActive(view)) {
  249. this.toLastView(visitedViews, view)
  250. }
  251. })
  252. Global.$emit("removeCache", "closeSelectedTag", view);
  253. })
  254. },
  255. //地点带入
  256. bringIn(value,row){
  257. for(let item in this.select){
  258. for(let li in this.addressOptions){
  259. if(this.queryParams.fUpdateaddress == this.addressOptions[li].fId){
  260. this.$set(this.select[item],'foldSite',this.addressOptions[li].fName)
  261. this.$set(this.select[item],'fold',this.queryParams.fUpdateaddress)
  262. }
  263. }
  264. // this.select[item].foldSite = value
  265. }
  266. },
  267. //空重带入选中列表
  268. changeUpdateEF(){
  269. for(let item in this.select){
  270. for(let li in this.updateEFOptions){
  271. if(this.queryParams.fUpdateEF == this.updateEFOptions[li].dictValue){
  272. this.$set(this.select[item],'foldFUpdateef',this.updateEFOptions[li].dictLabel)
  273. this.$set(this.select[item],'FUpdateef',this.queryParams.fUpdateEF)
  274. }
  275. }
  276. }
  277. },
  278. //状态带入选中列表
  279. changeStatus(){
  280. for(let item in this.select) {
  281. for (let li in this.cntrstatusOptions) {
  282. if(this.queryParams.fStatus == this.cntrstatusOptions[li].dictValue)
  283. this.$set(this.select[item], 'foldFCntrstatus', this.cntrstatusOptions[li].dictLabel)
  284. this.$set(this.select[item], 'FCntrstatus', this.queryParams.fStatus)
  285. }
  286. }
  287. },
  288. //时间带入选列表
  289. changeDate(){
  290. for(let item in this.select){
  291. this.$set(this.select[item],'foldtime',this.queryParams.fBdate)
  292. }
  293. },
  294. //多选框选中
  295. handleSelectionChange(selection) {
  296. this.ids = selection.map(item => item.fId)
  297. this.select = selection
  298. },
  299. }
  300. };
  301. </script>
  302. <style lang="scss">
  303. </style>