index.vue 37 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForms" :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. >
  22. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.typesName }}</span>
  23. <span style="float: right;">{{ item.fName }}</span>
  24. </el-option>
  25. </el-select>
  26. </el-form-item>
  27. <el-form-item label="空重" prop="fUpdateEF">
  28. <el-select
  29. v-model="queryParams.fUpdateEF"
  30. style="width: 240px"
  31. placeholder="请输入空重"
  32. clearable
  33. size="small"
  34. @change="changeUpdateEF"
  35. >
  36. <el-option
  37. v-for="item in this.updateEFOptions"
  38. :key="item.dictValue"
  39. :label="item.dictLabel"
  40. :value="item.dictValue"
  41. />
  42. </el-select>
  43. </el-form-item>
  44. <el-form-item label="状态" prop="fStatus">
  45. <el-select
  46. v-model="queryParams.fStatus"
  47. style="width: 240px"
  48. placeholder="请输入状态"
  49. clearable
  50. @change="changeStatus"
  51. size="small"
  52. >
  53. <el-option
  54. v-for="item in this.cntrstatusOptions"
  55. :key="item.dictValue"
  56. :label="item.dictLabel"
  57. :value="item.dictValue"
  58. />
  59. </el-select>
  60. </el-form-item>
  61. <el-form-item label="时间" prop="fBdate">
  62. <el-date-picker
  63. v-model="queryParams.fBdate"
  64. type="date"
  65. style="width: 240px"
  66. value-format="yyyy-MM-dd"
  67. @change="changeDate"
  68. placeholder="选择日期"
  69. >
  70. </el-date-picker>
  71. </el-form-item>
  72. <el-form-item label="调箱动态" prop="fOpctnstatus">
  73. <el-select
  74. v-model="queryParams.fOpctnstatus"
  75. style="width: 240px"
  76. placeholder="请输入状态"
  77. clearable
  78. @change="changeAction"
  79. size="small"
  80. >
  81. <el-option
  82. v-for="item in this.boxActionOptions"
  83. :key="item.dictValue"
  84. :label="item.dictLabel"
  85. :value="item.dictValue"
  86. />
  87. </el-select>
  88. </el-form-item>
  89. <el-form-item>
  90. <el-button type="cyan" size="mini" @click="determine">提交</el-button>
  91. </el-form-item>
  92. </el-row>
  93. </el-form>
  94. <el-form :model="queryParam" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  95. <el-row>
  96. <el-form-item label="箱号" prop="fNo">
  97. <el-input
  98. v-model="queryParam.fNo"
  99. style="width: 240px"
  100. placeholder="请输入箱号"
  101. clearable
  102. size="small"
  103. >
  104. </el-input>
  105. </el-form-item>
  106. <el-form-item label="箱型" prop="fTypeid">
  107. <el-select
  108. v-model="queryParam.fTypeid"
  109. style="width: 240px"
  110. placeholder="请输入箱型"
  111. clearable
  112. size="small"
  113. >
  114. <el-option
  115. v-for="item in typeOptions"
  116. :key="item.fId"
  117. :label="item.fNo"
  118. :value="item.fId"
  119. />
  120. </el-select>
  121. </el-form-item>
  122. <el-form-item label="尺寸" prop="cntrsize">
  123. <el-select
  124. v-model="queryParam.cntrsize"
  125. style="width: 240px"
  126. placeholder="请输入尺寸"
  127. clearable
  128. size="small"
  129. >
  130. <el-option
  131. v-for="item in CntrsizeOptions"
  132. :key="item.dictValue"
  133. :label="item.dictLabel"
  134. :value="item.dictValue"
  135. />
  136. </el-select>
  137. </el-form-item>
  138. <el-form-item label="箱主" prop="fOwner">
  139. <el-select
  140. v-model="queryParam.fOwner"
  141. style="width: 240px"
  142. placeholder="请输入箱主"
  143. clearable
  144. size="small"
  145. >
  146. <el-option
  147. v-for="dict in ownerOptions"
  148. :key="dict.dictValue"
  149. :label="dict.dictLabel"
  150. :value="dict.dictValue"
  151. />
  152. </el-select>
  153. </el-form-item>
  154. <el-form-item label="空重" prop="fUpdateef">
  155. <el-select
  156. v-model="queryParam.fUpdateef"
  157. style="width: 240px"
  158. placeholder="请输入空重"
  159. clearable
  160. size="small"
  161. >
  162. <el-option
  163. v-for="item in this.updateEFOptions"
  164. :key="item.dictValue"
  165. :label="item.dictLabel"
  166. :value="item.dictValue"
  167. />
  168. </el-select>
  169. </el-form-item>
  170. <el-form-item label="状态" prop="fCntrstatus">
  171. <el-select
  172. v-model="queryParam.fCntrstatus"
  173. style="width: 240px"
  174. placeholder="请选择状态"
  175. clearable
  176. size="small"
  177. >
  178. <el-option
  179. v-for="item in this.cntrstatusOptions"
  180. :key="item.dictValue"
  181. :label="item.dictLabel"
  182. :value="item.dictValue"
  183. />
  184. </el-select>
  185. </el-form-item>
  186. <el-form-item>
  187. <el-button type="cyan" size="mini" @click="search">搜索</el-button>
  188. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  189. </el-form-item>
  190. </el-row>
  191. </el-form>
  192. <el-row :gutter="10" class="mb8">
  193. <!-- <el-button type="cyan" size="mini" @click="determine">提交</el-button>-->
  194. <!-- <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>-->
  195. <!-- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>-->
  196. <!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
  197. <div style="margin: 0 12px;float: right">
  198. <el-tooltip
  199. class="item"
  200. effect="dark"
  201. content="列设置"
  202. placement="top"
  203. >
  204. <el-button
  205. icon="el-icon-setting"
  206. size="mini"
  207. circle
  208. @click="showSetting = !showSetting"
  209. ></el-button>
  210. </el-tooltip>
  211. </div>
  212. </el-row>
  213. <el-dialog title="提示" :visible.sync="showSetting" width="700px" v-dialogDrag>
  214. <div>配置排序列数据(拖动调整顺序)</div>
  215. <div style="margin-left: 17px">
  216. <el-checkbox
  217. v-model="allCheck"
  218. label="全选"
  219. @change="allChecked"
  220. ></el-checkbox>
  221. </div>
  222. <div style="padding: 4px; display: flex; justify-content: center">
  223. <draggable
  224. v-model="setRowList"
  225. group="site"
  226. animation="300"
  227. @start="onStart"
  228. @end="onEnd"
  229. handle=".indraggable"
  230. >
  231. <transition-group>
  232. <div
  233. v-for="item in setRowList"
  234. :key="item.surface"
  235. class="listStyle"
  236. >
  237. <div style="width: 500px" class="indraggable">
  238. <div class="progress" :style="{ width: item.width + 'px' }">
  239. <el-checkbox
  240. :label="item.name"
  241. v-model="item.checked"
  242. :true-label="0"
  243. :false-label="1"
  244. >{{ item.name }}
  245. </el-checkbox>
  246. </div>
  247. </div>
  248. <el-input-number
  249. v-model.number="item.width"
  250. controls-position="right"
  251. :min="1"
  252. :max="500"
  253. size="mini"
  254. ></el-input-number>
  255. </div>
  256. </transition-group>
  257. </draggable>
  258. </div>
  259. <span slot="footer" class="dialog-footer">
  260. <el-button @click="showSetting = false">取 消</el-button>
  261. <el-button @click="delRow" type="danger">重 置</el-button>
  262. <el-button type="primary" @click="save()">确 定</el-button>
  263. </span>
  264. </el-dialog>
  265. <el-table v-loading="loading" :data="corpsList" @selection-change="handleSelectionChange">
  266. <el-table-column type="selection" width="55" align="center"/>
  267. <el-table-column type="index" width="55" label="行号" align="center"/>
  268. <el-table-column
  269. v-for="(item, index) in getRowList"
  270. :key="index"
  271. :label="item.name"
  272. :width="item.width"
  273. :prop="item.label"
  274. align="center"
  275. :show-overflow-tooltip="true"
  276. sortable
  277. >
  278. <template slot-scope="scope">
  279. <el-input v-model="scope.row.fVsl" v-if="item.label == 'fVsl'"/>
  280. <el-input v-model="scope.row.fVoy" v-if="item.label == 'fVoy'"/>
  281. <el-input v-model="scope.row.fMblno" v-if="item.label == 'fMblno'"/>
  282. <el-input v-model="scope.row.remark" v-if="item.label == 'remark'"/>
  283. <span v-if="item.label == 'fNo'">{{scope.row.fNo}}</span>
  284. <span v-if="item.label == 'typeidName'">{{scope.row.typeidName}}</span>
  285. <span v-if="item.label == 'cntrsizeName'">{{scope.row.cntrsizeName}}</span>
  286. <el-input v-model="scope.row.fSealno" v-if="item.label == 'fSealno'"/>
  287. <span v-if="item.label == 'ownerName'">{{scope.row.ownerName}}</span>
  288. <span v-if="item.label == 'fUpdatetime'">{{scope.row.fUpdatetime}}</span>
  289. <span v-if="item.label == 'addressName'">{{scope.row.addressName}}</span>
  290. <span v-if="item.label == 'opctnstatusName'">{{scope.row.opctnstatusName}}</span>
  291. <span v-if="item.label == 'updateEFName'">{{scope.row.updateEFName}}</span>
  292. <span v-if="item.label == 'cntrstatusName'">{{scope.row.cntrstatusName}}</span>
  293. <span v-if="item.label == 'foldSite'">{{scope.row.foldSite}}</span>
  294. <span v-if="item.label == 'foldFUpdateef'">{{scope.row.foldFUpdateef}}</span>
  295. <span v-if="item.label == 'foldFCntrstatus'">{{scope.row.foldFCntrstatus}}</span>
  296. <span v-if="item.label == 'foldtime'">{{scope.row.foldtime}}</span>
  297. <span v-if="item.label == 'fOpctnstatus'">{{scope.row.fOpctnstatus}}</span>
  298. </template>
  299. <!-- <template slot-scope="scope" v-if="item.label == 'fVoy'">-->
  300. <!-- <el-input v-model="scope.row.fVoy"/>-->
  301. <!-- </template>-->
  302. <!-- <template slot-scope="scope" v-if="item.label == 'fMblno'">-->
  303. <!-- <el-input v-model="scope.row.fMblno"/>-->
  304. <!-- </template>-->
  305. <!-- <template slot-scope="scope" v-if="item.label == 'remark'">-->
  306. <!-- <el-input v-model="scope.row.remark"/>-->
  307. <!-- </template>-->
  308. </el-table-column>
  309. <!-- <el-table-column :show-overflow-tooltip="true" label="箱号" align="center" prop="fNo" width="200px"/>-->
  310. <!-- <el-table-column label="箱型" align="center" prop="typeidName" width="100px"/>-->
  311. <!-- <el-table-column :show-overflow-tooltip="true" label="尺寸" align="center" prop="cntrsizeName" width="100px"-->
  312. <!-- />-->
  313. <!-- <el-table-column :show-overflow-tooltip="true" label="箱主" align="center" width="100px" prop="ownerName" />-->
  314. <!-- <el-table-column :show-overflow-tooltip="true" label="原时间" align="center" prop="fUpdatetime" />-->
  315. <!-- <el-table-column :show-overflow-tooltip="true" label="原地点" align="center" prop="addressName" />-->
  316. <!-- <el-table-column :show-overflow-tooltip="true" label="原调箱动态" align="center" prop="" width="100"/>-->
  317. <!-- <el-table-column label="原空重" align="center" prop="updateEFName" />-->
  318. <!-- <el-table-column label="原状态" align="center" prop="cntrstatusName" width="100"/>-->
  319. <!-- <el-table-column label="调入地点" align="center" prop="foldSite" width="100px"/>-->
  320. <!-- <el-table-column label="调入空重" align="center" prop="foldFUpdateef" width="100px"/>-->
  321. <!-- <el-table-column label="调入状态" align="center" prop="foldFCntrstatus" width="100px"/>-->
  322. <!-- <el-table-column label="调入时间" align="center" prop="foldtime" width="100px"/>-->
  323. <!-- <el-table-column label="调箱动态" align="center" prop="fOpctnstatus" width="100px"/>-->
  324. <!-- <el-table-column label="船名" align="center" prop="fVsl" width="100px">-->
  325. <!-- <template slot-scope="scope">-->
  326. <!-- <el-input v-model="scope.row.fVsl"/>-->
  327. <!-- </template>-->
  328. <!-- </el-table-column>-->
  329. <!-- <el-table-column label="航次" align="center" prop="fVoy" width="100px">-->
  330. <!-- <template slot-scope="scope">-->
  331. <!-- <el-input v-model="scope.row.fVoy"/>-->
  332. <!-- </template>-->
  333. <!-- </el-table-column>-->
  334. <!-- <el-table-column label="提单号" align="center" prop="fMblno" width="100px">-->
  335. <!-- <template slot-scope="scope">-->
  336. <!-- <el-input v-model="scope.row.fMblno"/>-->
  337. <!-- </template>-->
  338. <!-- </el-table-column>-->
  339. <!-- <el-table-column label="备注" align="center" prop="remark" width="100px">-->
  340. <!-- <template slot-scope="scope">-->
  341. <!-- <el-input v-model="scope.row.remark"/>-->
  342. <!-- </template>-->
  343. <!-- </el-table-column>-->
  344. <el-table-column label="上传附件" align="center" prop="" width="100px">
  345. <template slot-scope="scope">
  346. <el-button type="primary" size="mini" @click="uploadFile(scope.row)">上传</el-button>
  347. </template>
  348. </el-table-column>
  349. </el-table>
  350. <pagination
  351. v-show="total>0"
  352. :total="total"
  353. :page.sync="queryParams.pageNum"
  354. :limit.sync="queryParams.pageSize"
  355. />
  356. <el-dialog
  357. title="上传附件"
  358. :visible.sync="dialogVisible"
  359. width="80%"
  360. :close-on-click-modal="false"
  361. >
  362. <template slot="title">
  363. <i class="header-icon el-icon-circle-plus" style="font-size: 16px"
  364. ><span
  365. style="font-size: 16px; font-weight: bolder; margin-left: 5px"
  366. >附件上传</span
  367. >
  368. </i>
  369. </template>
  370. <div>
  371. <div
  372. style=" display: flex;justify-content: space-between;margin: 10px 0;"
  373. >
  374. <div>
  375. <el-button
  376. type="primary"
  377. icon="el-icon-plus"
  378. size="mini"
  379. @click="addRelevt"
  380. >添加
  381. </el-button
  382. >
  383. </div>
  384. </div>
  385. </div>
  386. <el-table
  387. :data="relevantAttachments"
  388. ref="table"
  389. tooltip-effect="dark"
  390. border
  391. stripe
  392. style="width: 100%"
  393. height="150"
  394. >
  395. <el-table-column label="序号" type="index" width="80">
  396. </el-table-column>
  397. <el-table-column
  398. prop="fName"
  399. header-align="center"
  400. align="center"
  401. width="250px"
  402. label="附件名称"
  403. >
  404. <template slot-scope="scope">
  405. <el-input
  406. v-model="scope.row.fName"
  407. placeholder="附件名称"
  408. show-word-limit
  409. />
  410. </template>
  411. </el-table-column>
  412. <!-- <el-table-column-->
  413. <!-- prop="createBy"-->
  414. <!-- header-align="center"-->
  415. <!-- align="center"-->
  416. <!-- width="250px"-->
  417. <!-- label="上传人"-->
  418. <!-- >-->
  419. <!-- <template slot-scope="scope">-->
  420. <!-- <el-input-->
  421. <!-- v-model="scope.row.createBy"-->
  422. <!-- disabled-->
  423. <!-- placeholder="上传人"-->
  424. <!-- show-word-limit-->
  425. <!-- />-->
  426. <!-- </template>-->
  427. <!-- </el-table-column>-->
  428. <el-table-column
  429. prop="createTime"
  430. header-align="center"
  431. align="center"
  432. width="250px"
  433. label="上传时间"
  434. >
  435. <template slot-scope="scope">
  436. <el-date-picker
  437. v-model="scope.row.createTime"
  438. type="date"
  439. disabled
  440. placeholder="上传时间"
  441. format="yyyy-MM-dd HH:mm"
  442. value-format="timestamp"
  443. ></el-date-picker>
  444. </template>
  445. </el-table-column>
  446. <el-table-column
  447. prop="fUrl"
  448. header-align="center"
  449. align="center"
  450. width="300px"
  451. label="上传附件"
  452. >
  453. <template slot-scope="scope">
  454. <el-upload
  455. class="upload-demo"
  456. :action="uploadImgUrl"
  457. :on-success="(res,file)=>{handleSucces(scope,res,file)}"
  458. :headers="headers"
  459. style="width:25%;float: left"
  460. :show-file-list="false"
  461. :limit="1"
  462. >
  463. <el-button size="small" type="primary" style="margin-left:20px">点击上传</el-button>
  464. </el-upload>
  465. <el-button size="small" type="primary" @click="checkFile(scope)">查看</el-button>
  466. <el-button size="small" type="primary" @click="deleteFile(scope)">删除</el-button>
  467. </template>
  468. </el-table-column>
  469. <el-table-column header-align="center" align="center" label="操作">
  470. <template slot-scope="scope">
  471. <el-button
  472. @click.native.prevent="deleteRow(scope.$index, relevantAttachments)"
  473. size="small"
  474. >移除
  475. </el-button>
  476. </template>
  477. </el-table-column>
  478. </el-table>
  479. <span slot="footer" class="dialog-footer">
  480. <el-button type="primary" @click="saveFile">确定</el-button>
  481. <el-button type="primary" @click="dialogVisible = false , relevantAttachments = [], file = []"
  482. >取消</el-button>
  483. </span>
  484. </el-dialog>
  485. </div>
  486. </template>
  487. <script>
  488. import { listCorps, addmodify, getaddress } from '@/api/kaihe/containerNews/modifyPage'
  489. import Global from '@/layout/components/global'
  490. import { getType } from '@/api/kaihe/containerNews/boxInformation'
  491. import { getToken } from '@/utils/auth'
  492. import Cookies from 'js-cookie'
  493. import { addSet, resetModule, select } from '@/api/system/set'
  494. import draggable from 'vuedraggable'
  495. import Vue from 'vue'
  496. Vue.directive('dialogDrag', {
  497. bind(el, binding, vnode, oldVnode) {
  498. const dialogHeaderEl = el.querySelector('.el-dialog__header')
  499. const dragDom = el.querySelector('.el-dialog')
  500. const enlarge = el.querySelector('.enlarge')
  501. dialogHeaderEl.style.cursor = 'move'
  502. // 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
  503. const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null)
  504. if(enlarge){
  505. enlarge.onclick = (e) => {
  506. dragDom.style.top = '0px'
  507. dragDom.style.left = '0px'
  508. }
  509. }
  510. dialogHeaderEl.onmousedown = (e) => {
  511. // 鼠标按下,计算当前元素距离可视区的距离
  512. const disX = e.clientX - dialogHeaderEl.offsetLeft
  513. const disY = e.clientY - dialogHeaderEl.offsetTop
  514. // 获取到的值带px 正则匹配替换
  515. let styL, styT
  516. // 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px
  517. if (sty.left.includes('%')) {
  518. styL = +document.body.clientWidth * (+sty.left.replace(/\%/g, '') / 100)
  519. styT = +document.body.clientHeight * (+sty.top.replace(/\%/g, '') / 100)
  520. } else {
  521. styL = +sty.left.replace(/\px/g, '')
  522. styT = +sty.top.replace(/\px/g, '')
  523. }
  524. document.onmousemove = function(e) {
  525. // 通过事件委托,计算移动的距离
  526. const l = e.clientX - disX
  527. const t = e.clientY - disY
  528. // 移动当前元素
  529. if ((t + styT) >= 0){
  530. dragDom.style.top = `${t + styT}px`
  531. }
  532. dragDom.style.left = `${l + styL}px`
  533. // 将此时的位置传出去
  534. // binding.value({x:e.pageX,y:e.pageY})
  535. }
  536. document.onmouseup = function(e) {
  537. document.onmousemove = null
  538. document.onmouseup = null
  539. }
  540. }
  541. }
  542. })
  543. export default {
  544. name: 'boxDistribution',
  545. components: {
  546. draggable
  547. },
  548. data() {
  549. return {
  550. setRowList: [],
  551. getRowList: [],
  552. tableDate: [
  553. {
  554. surface: '1',
  555. label: 'fNo',
  556. name: '箱号',
  557. checked: 0,
  558. fixed: 'left',
  559. width: 100
  560. },
  561. {
  562. surface: '2',
  563. label: 'typeidName',
  564. name: '箱型',
  565. checked: 0,
  566. fixed: 'left',
  567. width: 100
  568. },
  569. {
  570. surface: '3',
  571. label: 'fSealno',
  572. name: '铅封号',
  573. checked: 0,
  574. fixed: 'left',
  575. width: 100
  576. },
  577. {
  578. surface: '4',
  579. label: 'cntrsizeName',
  580. name: '尺寸',
  581. checked: 0,
  582. fixed: 'left',
  583. width: 100
  584. },
  585. {
  586. surface: '5',
  587. label: 'ownerName',
  588. name: '箱主',
  589. checked: 0,
  590. fixed: 'left',
  591. width: 100
  592. },
  593. {
  594. surface: '6',
  595. label: 'fUpdatetime',
  596. name: '原时间',
  597. checked: 0,
  598. fixed: 'left',
  599. width: 100
  600. },
  601. {
  602. surface: '7',
  603. label: 'addressName',
  604. name: '原地点',
  605. checked: 0,
  606. fixed: 'left',
  607. width: 100
  608. },
  609. {
  610. surface: '8',
  611. label: 'opctnstatusName',
  612. name: '原调箱动态',
  613. checked: 0,
  614. fixed: 'left',
  615. width: 100
  616. },
  617. {
  618. surface: '9',
  619. label: 'updateEFName',
  620. name: '原空重',
  621. checked: 0,
  622. width: 100
  623. },
  624. {
  625. surface: '10',
  626. label: 'cntrstatusName',
  627. name: '原状态',
  628. checked: 0,
  629. width: 100
  630. },
  631. {
  632. surface: '11',
  633. label: 'foldSite',
  634. name: '调入地点',
  635. checked: 0,
  636. width: 100
  637. },
  638. {
  639. surface: '12',
  640. label: 'foldFUpdateef',
  641. name: '调入空重',
  642. checked: 0,
  643. width: 100
  644. },
  645. {
  646. surface: '13',
  647. label: 'foldFCntrstatus',
  648. name: '调入状态',
  649. checked: 0,
  650. width: 100
  651. },
  652. {
  653. surface: '14',
  654. label: 'foldtime',
  655. name: '调入时间',
  656. checked: 0,
  657. width: 100
  658. },
  659. {
  660. surface: '15',
  661. label: 'fOpctnstatus',
  662. name: '调箱动态',
  663. checked: 0,
  664. width: 100
  665. },
  666. {
  667. surface: '16',
  668. label: 'fVsl',
  669. name: '船名',
  670. checked: 0,
  671. width: 100
  672. },
  673. {
  674. surface: '17',
  675. label: 'fVoy',
  676. name: '航次',
  677. checked: 0,
  678. width: 100
  679. },
  680. {
  681. surface: '18',
  682. label: 'fMblno',
  683. name: '提单号',
  684. checked: 0,
  685. width: 100
  686. },
  687. {
  688. surface: '19',
  689. label: 'remark',
  690. name: '备注',
  691. checked: 0,
  692. width: 100
  693. }
  694. ],
  695. //自定义列
  696. showSetting: false,
  697. allCheck: false,
  698. uploadImgUrl: process.env.VUE_APP_BASE_API + '/common/upload', // 上传的图片服务器地址
  699. relevantAttachments: [],
  700. headers: { Authorization: 'Bearer ' + getToken() },
  701. //集装箱尺码字典表
  702. CntrsizeOptions: [],
  703. //模糊查询箱类型
  704. typeOptions: [],
  705. //附件上传弹窗
  706. dialogVisible: false,
  707. //调箱动作字典表
  708. boxActionOptions: [],
  709. //集装箱主字典表
  710. ownerOptions: [],
  711. //模糊下拉查询地点
  712. addressOptions: [],
  713. //空重字典表
  714. updateEFOptions: [],
  715. //状态字典表
  716. cntrstatusOptions: [],
  717. // 遮罩层
  718. loading: true,
  719. // 选中数组
  720. ids: [],
  721. // 显示搜索条件
  722. showSearch: true,
  723. // 总条数
  724. total: 0,
  725. // 客户详情表格数据
  726. corpsList: [],
  727. // 查询参数
  728. queryParams: {
  729. fUpdateaddress: null,
  730. fUpdateEF: null,
  731. fStatus: null,
  732. fBdate: null,
  733. fOpctnstatus: null
  734. },
  735. queryParam: {
  736. fNo: null,
  737. fTypeid: null,
  738. cntrsize: null,
  739. fOwner: null,
  740. fUpdateef: null,
  741. fCntrstatus: null
  742. },
  743. select: '',
  744. querDate: [],
  745. file: [],
  746. row: []
  747. }
  748. },
  749. //页面跳转后传递参数
  750. activated() {
  751. let formDate = JSON.parse(this.$route.query.data)
  752. this.querDate = JSON.parse(this.$route.query.data)
  753. if (formDate) {
  754. addmodify(formDate).then(response => {
  755. console.log(response)
  756. this.corpsList = response.rows
  757. this.loading = false
  758. })
  759. }
  760. },
  761. created() {
  762. this.setRowList = this.tableDate;
  763. this.getRowList = this.tableDate;
  764. this.getDicts('f_updateEF').then(response => {
  765. this.updateEFOptions = response.data
  766. })
  767. this.getDicts('f_cntrstatus').then(response => {
  768. this.cntrstatusOptions = response.data
  769. })
  770. this.getDicts('f_owner').then(response => {
  771. this.ownerOptions = response.data
  772. })
  773. this.getDicts('f_opctnstatus').then(response => {
  774. this.boxActionOptions = response.data
  775. })
  776. this.getDicts('f_cntrsize').then(response => {
  777. this.CntrsizeOptions = response.data
  778. })
  779. this.addressMethod()
  780. this.boxTypeMethod()
  781. this.getRow();
  782. },
  783. methods: {
  784. //重置列表
  785. delRow() {
  786. this.data = {
  787. tableName: '修改页面',
  788. userId: Cookies.get('userName')
  789. }
  790. resetModule(this.data).then((res) => {
  791. if (res.code == 200) {
  792. this.showSetting = false
  793. this.setRowList = this.tableDate
  794. this.getRowList = this.tableDate
  795. }
  796. })
  797. },
  798. //列设置全选
  799. allChecked() {
  800. if (this.allCheck == true) {
  801. this.setRowList.map((e) => {
  802. return (e.checked = 0)
  803. })
  804. } else {
  805. this.setRowList.map((e) => {
  806. return (e.checked = 1)
  807. })
  808. }
  809. },
  810. //查询列数据
  811. getRow() {
  812. let that = this
  813. this.data = {
  814. tableName: '修改页面',
  815. userId: Cookies.get('userName')
  816. }
  817. select(this.data).then((res) => {
  818. if (res.data.length != 0) {
  819. this.getRowList = res.data.filter((e) => e.checked == 0)
  820. this.setRowList = res.data
  821. this.setRowList = this.setRowList.reduce((res, item) => {
  822. res.push({
  823. surface: item.surface,
  824. label: item.label,
  825. name: item.name,
  826. checked: item.checked,
  827. width: item.width,
  828. fixed: item.fixed
  829. })
  830. return res
  831. }, [])
  832. }
  833. })
  834. console.log(this.getRowList)
  835. },
  836. //保存列设置
  837. save() {
  838. this.showSetting = false
  839. this.data = {
  840. tableName: '修改页面',
  841. userId: Cookies.get('userName'),
  842. sysTableSetList: this.setRowList
  843. }
  844. addSet(this.data).then((res) => {
  845. this.getRowList = this.setRowList.filter((e) => e.checked == 0)
  846. })
  847. },
  848. //开始拖拽事件
  849. onStart() {
  850. this.drag = true
  851. },
  852. //拖拽结束事件
  853. onEnd() {
  854. this.drag = false
  855. },
  856. saveFile() {
  857. this.row.accessoryList = this.file
  858. this.dialogVisible = false
  859. this.relevantAttachments = []
  860. console.log(this.row)
  861. },
  862. //模糊查询箱类型
  863. boxTypeMethod() {
  864. let queryParams = { pageNum: 1 }
  865. getType().then(response => {
  866. this.typeOptions = response.rows
  867. })
  868. },
  869. deleteRow(index, rows) {
  870. rows.splice(index, 1)
  871. },
  872. // 新增附件上传
  873. addRelevt() {
  874. this.relevantAttachments.push({
  875. fUrl: null,
  876. fName: null,
  877. // createBy: this.form.createBy,
  878. createTime: Date.parse(new Date())
  879. })
  880. },
  881. //附件删除
  882. deleteFile(scope) {
  883. this.relevantAttachments[scope.$index].fName = ''
  884. this.relevantAttachments[scope.$index].fUrl = ''
  885. if (this.relevantAttachments[scope.$index].fUrl === '') {
  886. this.$message.success('删除成功')
  887. } else {
  888. this.$message.error('未知错误,删除失败')
  889. }
  890. },
  891. //附件查看
  892. checkFile(scope) {
  893. if (this.relevantAttachments[scope.$index].fUrl) {
  894. window.open(this.relevantAttachments[scope.$index].fUrl)
  895. } else {
  896. this.$message.error('请上传附件')
  897. }
  898. },
  899. //上传附件
  900. handleSucces(scope, res, file) {
  901. console.log(res)
  902. console.log(this.relevantAttachments[scope.$index])
  903. this.relevantAttachments[scope.$index].fName = res.fileName
  904. this.relevantAttachments[scope.$index].fUrl = res.url
  905. this.file.push({
  906. fName: this.relevantAttachments[scope.$index].fName,
  907. fUrl: this.relevantAttachments[scope.$index].fUrl,
  908. createTime: this.relevantAttachments[scope.$index].createTime
  909. })
  910. if (this.relevantAttachments[scope.$index].fUrl === '') {
  911. this.$message.error('上传失败')
  912. }
  913. {
  914. this.$message.success('上传成功')
  915. }
  916. },
  917. uploadFile(row) {
  918. this.file = []
  919. this.row = row
  920. this.dialogVisible = true
  921. if (row.accessoryList !== null) {
  922. console.log(row.accessoryList)
  923. this.relevantAttachments = row.accessoryList
  924. } else if (this.row.length === 0) {
  925. this.relevantAttachments = []
  926. } else {
  927. this.relevantAttachments = []
  928. }
  929. },
  930. // handleClose(done) {
  931. // this.$confirm('确认关闭?')
  932. // .then(_ => {
  933. // done();
  934. //
  935. // })
  936. // .catch(_ => {});
  937. // },
  938. /** 重置按钮操作 */
  939. resetQuery() {
  940. this.queryParam = {
  941. fNo: '',
  942. fTypeid: '',
  943. cntrsize: '',
  944. fOwner: '',
  945. fUpdateef: '',
  946. fCntrstatus: ''
  947. }
  948. this.search()
  949. },
  950. //搜索
  951. search() {
  952. let querDates = Object.assign(this.querDate, this.queryParam)
  953. console.log(this.queryParam)
  954. addmodify(querDates).then(response => {
  955. this.corpsList = response.rows
  956. })
  957. },
  958. //模糊查询地点
  959. addressMethod() {
  960. let queryParams = { pageNum: 1 }
  961. getaddress(queryParams).then(response => {
  962. this.addressOptions = response.rows
  963. })
  964. },
  965. //提交修改数据
  966. determine() {
  967. let data = []
  968. for (let item in this.select) {
  969. console.log(this.select[item])
  970. for (let li in this.corpsList) {
  971. if (!this.select[item].foldSite) {
  972. this.$message.error('请选择调入地点')
  973. return false
  974. } else if (!this.select[item].fOpctnstatus) {
  975. this.$message.error('请选择调箱动态')
  976. return false
  977. } else {
  978. if (!this.select[item].foldFUpdateef) {
  979. this.select[item].foldFUpdateef = this.corpsList[li].updateEFName
  980. this.$set(this.select[item], 'FUpdateef', this.corpsList[li].fUpdateef)
  981. }
  982. if (!this.select[item].foldFCntrstatus) {
  983. this.select[item].foldFCntrstatus = this.corpsList[li].cntrstatusName
  984. this.$set(this.select[item], 'FCntrstatus', this.corpsList[li].fCntrstatus)
  985. }
  986. }
  987. }
  988. data.push({
  989. fId: this.select[item].fId,
  990. foldSite: this.select[item].fold,
  991. foldFUpdateef: this.select[item].FUpdateef,
  992. foldFCntrstatus: this.select[item].FCntrstatus,
  993. foldtime: this.select[item].foldtime,
  994. fVsl: this.select[item].fVsl,
  995. fVoy: this.select[item].fVoy,
  996. fMblno: this.select[item].fMblno,
  997. fSealno: this.select[item].fSealno,
  998. fOpctnstatus: this.select[item].boxAdjustmentAction,
  999. remark: this.select[item].remark,
  1000. accessoryList: this.file
  1001. })
  1002. }
  1003. let tCntrno = data
  1004. listCorps(tCntrno).then(response => {
  1005. this.$message.success('提交成功')
  1006. // this.$router.push({
  1007. // path: "/containerNews/boxDistribution",
  1008. // });
  1009. console.log(this.corpsList.length)
  1010. if (this.querDate) {
  1011. addmodify(this.querDate).then(response => {
  1012. this.corpsList = response.rows
  1013. this.loading = false
  1014. if (response.rows.length === 0) {
  1015. let view = {
  1016. fullPath: '/containerNews/modifyPage?data=%7B%22typeidName%22%3A%221%22,%22fUpdateaddress%22%3A%22%E5%B1%B1%E4%B8%9C%22%7D',
  1017. hash: '',
  1018. matched: Array(2),
  1019. meta: Object,
  1020. name: 'ModifyPage',
  1021. params: Object,
  1022. path: '/containerNews/modifyPage',
  1023. query: Object,
  1024. title: '修改页面'
  1025. }
  1026. this.$router.push({ path: '/containerNews/boxDistribution' })
  1027. this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => {
  1028. if (this.isActive(view)) {
  1029. this.toLastView(visitedViews, view)
  1030. }
  1031. })
  1032. Global.$emit('removeCache', 'closeSelectedTag', view)
  1033. }
  1034. })
  1035. }
  1036. console.log(this.corpsList.length)
  1037. })
  1038. },
  1039. //地点带入
  1040. bringIn(value, row) {
  1041. if (this.select.length === 0) {
  1042. this.$message.error('请选择行')
  1043. this.queryParams.fUpdateaddress = ''
  1044. } else {
  1045. console.log(this.select)
  1046. for (let item in this.select) {
  1047. for (let li in this.addressOptions) {
  1048. if (this.queryParams.fUpdateaddress == this.addressOptions[li].fId) {
  1049. this.$set(this.select[item], 'foldSite', this.addressOptions[li].fName)
  1050. this.$set(this.select[item], 'fold', this.queryParams.fUpdateaddress)
  1051. console.log(this.select[item].foldSite)
  1052. }
  1053. }
  1054. // this.select[item].foldSite = value
  1055. }
  1056. }
  1057. },
  1058. //空重带入选中列表
  1059. changeUpdateEF() {
  1060. if (this.select.length === 0) {
  1061. this.$message.error('请选择行')
  1062. this.queryParams.fUpdateEF = ''
  1063. } else {
  1064. for (let item in this.select) {
  1065. for (let li in this.updateEFOptions) {
  1066. if (this.queryParams.fUpdateEF == this.updateEFOptions[li].dictValue) {
  1067. this.$set(this.select[item], 'foldFUpdateef', this.updateEFOptions[li].dictLabel)
  1068. this.$set(this.select[item], 'FUpdateef', this.queryParams.fUpdateEF)
  1069. }
  1070. }
  1071. }
  1072. }
  1073. },
  1074. //调箱动作带入选中列表
  1075. changeAction() {
  1076. if (this.select.length === 0) {
  1077. this.$message.error('请选择行')
  1078. this.queryParams.fOpctnstatus = ''
  1079. } else {
  1080. for (let item in this.select) {
  1081. for (let li in this.boxActionOptions) {
  1082. if (this.queryParams.fOpctnstatus == this.boxActionOptions[li].dictValue) {
  1083. this.$set(this.select[item], 'fOpctnstatus', this.boxActionOptions[li].dictLabel)
  1084. this.$set(this.select[item], 'boxAdjustmentAction', this.queryParams.fOpctnstatus)
  1085. }
  1086. }
  1087. }
  1088. }
  1089. },
  1090. //状态带入选中列表
  1091. changeStatus() {
  1092. if (this.select.length === 0) {
  1093. this.$message.error('请选择行')
  1094. this.queryParams.fStatus = ''
  1095. } else {
  1096. for (let item in this.select) {
  1097. for (let li in this.cntrstatusOptions) {
  1098. if (this.queryParams.fStatus == this.cntrstatusOptions[li].dictValue) {
  1099. this.$set(this.select[item], 'foldFCntrstatus', this.cntrstatusOptions[li].dictLabel)
  1100. }
  1101. this.$set(this.select[item], 'FCntrstatus', this.queryParams.fStatus)
  1102. }
  1103. }
  1104. }
  1105. },
  1106. //时间带入选列表
  1107. changeDate() {
  1108. if (this.select.length === 0) {
  1109. this.$message.error('请选择行')
  1110. } else {
  1111. for (let item in this.select) {
  1112. this.$set(this.select[item], 'foldtime', this.queryParams.fBdate)
  1113. }
  1114. }
  1115. },
  1116. //多选框选中
  1117. handleSelectionChange(selection) {
  1118. this.ids = selection.map(item => item.fId)
  1119. this.select = selection
  1120. console.log(this.select)
  1121. }
  1122. }
  1123. }
  1124. </script>
  1125. <style lang="scss" scoped>
  1126. .tabSetting {
  1127. display: flex;
  1128. justify-content: flex-end;
  1129. }
  1130. .listStyle {
  1131. display: flex;
  1132. border-top: 1px solid #dcdfe6;
  1133. border-left: 1px solid #dcdfe6;
  1134. border-right: 1px solid #dcdfe6;
  1135. }
  1136. .listStyle:last-child {
  1137. border-bottom: 1px solid #dcdfe6;
  1138. }
  1139. .progress {
  1140. display: flex;
  1141. align-items: center;
  1142. padding: 2px;
  1143. background-color: rgba(0, 0, 0, 0.05);
  1144. height: 100%;
  1145. }
  1146. </style>