index.vue 49 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609
  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="fNo">
  6. <el-input style="width: 200px" v-model="queryParams.fNo" placeholder="请输入箱号" clearable size="small">
  7. </el-input>
  8. </el-form-item>
  9. <el-form-item label="箱类型" prop="fTypeid">
  10. <el-select
  11. v-model="queryParams.fTypeid"
  12. style="width: 200px"
  13. placeholder="请输入名称"
  14. clearable
  15. size="small"
  16. filterable
  17. :remote-method="boxTypeMethod"
  18. >
  19. <el-option
  20. v-for="item in typeOptions"
  21. :key="item.fId"
  22. :label="item.fNo"
  23. :value="item.fId"
  24. />
  25. </el-select>
  26. </el-form-item>
  27. <el-form-item label="箱状态" prop="fCntrstatus">
  28. <el-select
  29. v-model="queryParams.fCntrstatus"
  30. style="width: 200px"
  31. placeholder="请输入或选择"
  32. clearable
  33. size="small"
  34. @keyup.enter.native="handleQuery"
  35. >
  36. <el-option
  37. v-for="dict in cntrstatusOptions"
  38. :key="dict.dictValue"
  39. :label="dict.dictLabel"
  40. :value="dict.dictValue"
  41. />
  42. </el-select>
  43. </el-form-item>
  44. <el-form-item label="租贷公司" prop="fOwner">
  45. <el-select
  46. v-model="queryParams.fOwner"
  47. style="width: 200px"
  48. placeholder="请输入或选择"
  49. clearable
  50. size="small"
  51. @keyup.enter.native="handleQuery"
  52. >
  53. <el-option
  54. v-for="dict in ownerOptions"
  55. :key="dict.dictValue"
  56. :label="dict.dictLabel"
  57. :value="dict.dictValue"
  58. />
  59. </el-select>
  60. </el-form-item>
  61. </el-row>
  62. <div v-show="queryParamsHidden">
  63. <el-row>
  64. <el-form-item label="录入人" prop="createBy">
  65. <el-input
  66. v-model="queryParams.createBy"
  67. style="width: 200px"
  68. placeholder="请输入电话"
  69. clearable
  70. size="small"
  71. @keyup.enter.native="handleQuery"
  72. />
  73. </el-form-item>
  74. <el-form-item label="备注" prop="remark">
  75. <el-input
  76. style="width: 200px"
  77. type="textarea"
  78. clearable
  79. size="small"
  80. v-model="queryParams.remark"
  81. />
  82. </el-form-item>
  83. <el-form-item label="录入区间" prop="cLoadDate">
  84. <el-date-picker
  85. v-model="queryParams.cLoadDate"
  86. type="daterange"
  87. value-format="yyyy-MM-dd"
  88. range-separator="至"
  89. @change="timeMethods"
  90. start-placeholder="开始日期"
  91. end-placeholder="结束日期"
  92. style="width: 250px"
  93. >
  94. </el-date-picker>
  95. </el-form-item>
  96. </el-row>
  97. </div>
  98. </el-form>
  99. <el-row :gutter="10" class="mb8">
  100. <el-col :span="1.5">
  101. <el-button
  102. type="success"
  103. icon="el-icon-plus"
  104. size="mini"
  105. @click="handleAdd"
  106. v-hasPermi="['shipping:cntrno:add']"
  107. >新增
  108. </el-button>
  109. </el-col>
  110. <el-col :span="1.5">
  111. <el-button
  112. type="warning"
  113. icon="el-icon-edit"
  114. size="mini"
  115. :disabled="single"
  116. @click="handleUpdate"
  117. v-hasPermi="['shipping:cntrno:updateTCntrno']"
  118. >修改
  119. </el-button>
  120. </el-col>
  121. <el-col :span="1.5">
  122. <el-button
  123. type="danger"
  124. icon="el-icon-delete"
  125. size="mini"
  126. :disabled="multiple"
  127. @click="handleDelete"
  128. v-hasPermi="['shipping:cntrno:remove']"
  129. >删除
  130. </el-button>
  131. </el-col>
  132. <el-col :span="1.5">
  133. <!-- <el-button-->
  134. <!-- type="primary"-->
  135. <!-- icon="el-icon-download"-->
  136. <!-- size="mini"-->
  137. <!-- @click="handleExport"-->
  138. <!-- >导入</el-button>-->
  139. <el-button
  140. size="mini"
  141. icon="el-icon-download"
  142. type="primary"
  143. @click="dialogVisible = true"
  144. >导入
  145. </el-button
  146. >
  147. </el-col>
  148. <el-col :span="1.5">
  149. <el-button
  150. type="primary"
  151. icon="el-icon-download"
  152. size="mini"
  153. @click="downLoad"
  154. >下载模板
  155. </el-button>
  156. </el-col>
  157. <el-col :span="1.5">
  158. <el-button
  159. type="primary"
  160. icon="el-icon-download"
  161. size="mini"
  162. @click="handleExport"
  163. >导出
  164. </el-button>
  165. </el-col>
  166. <!-- <el-col :span="1.5">-->
  167. <!-- <el-button-->
  168. <!-- type="info"-->
  169. <!-- icon="el-icon-download"-->
  170. <!-- size="mini"-->
  171. <!-- @click="handleExport"-->
  172. <!-- >取消-->
  173. <!-- </el-button>-->
  174. <!-- </el-col>-->
  175. <el-col :span="1.5">
  176. <el-upload
  177. :action="uploadUrl"
  178. :auto-upload="true"
  179. accept=".xls,.xlsx"
  180. :on-success="(res, file) => { importBoxDynamics( res, file); }"
  181. :headers="headers"
  182. :show-file-list="false"
  183. >
  184. <el-button size="mini" type="primary" icon="el-icon-plus">导入箱动态</el-button>
  185. </el-upload>
  186. </el-col>
  187. <el-col :span="1.5">
  188. <el-button size="mini" type="primary" icon="el-icon-download" @click="downloadBoxTemplate">下载箱动态模板</el-button>
  189. </el-col>
  190. <el-col style="position: absolute;left:70%" :span="5">
  191. <el-button size="small" @click="queryParamsHidden ? (queryParamsHidden = false) : (queryParamsHidden = true)">
  192. {{ queryParamsHidden ? '隐藏' : '更多' }}
  193. </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. </el-col>
  197. <div class="tabSetting">
  198. <right-toolbar
  199. :showSearch.sync="showSearch"
  200. @queryTable="getList"
  201. ></right-toolbar>
  202. <div style="margin: 0 12px">
  203. <el-button
  204. icon="el-icon-setting"
  205. size="mini"
  206. circle
  207. @click="showSetting = !showSetting"
  208. ></el-button>
  209. </div>
  210. </div>
  211. </el-row>
  212. <el-dialog title="提示" :visible.sync="showSetting" width="700px" v-dialogDrag>
  213. <template slot="title">
  214. <div class="avue-crud__dialog__header">
  215. <span class="el-dialog__title">
  216. <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px"
  217. ></span>
  218. </span>
  219. </div>
  220. </template>
  221. <div>配置排序列数据(拖动调整顺序)</div>
  222. <div style="margin-left: 17px">
  223. <el-checkbox
  224. v-model="allCheck"
  225. label="全选"
  226. @change="allChecked"
  227. ></el-checkbox>
  228. </div>
  229. <div style="padding: 4px; display: flex; justify-content: center">
  230. <draggable
  231. v-model="setRowList"
  232. group="site"
  233. animation="300"
  234. @start="onStart"
  235. @end="onEnd"
  236. handle=".indraggable"
  237. >
  238. <transition-group>
  239. <div
  240. v-for="item in setRowList"
  241. :key="item.surface"
  242. class="listStyle"
  243. >
  244. <div style="width: 500px" class="indraggable">
  245. <div class="progress" :style="{ width: item.width + 'px' }">
  246. <el-checkbox
  247. :label="item.name"
  248. v-model="item.checked"
  249. :true-label="0"
  250. :false-label="1"
  251. >{{ item.name }}
  252. </el-checkbox>
  253. </div>
  254. </div>
  255. <el-input-number
  256. v-model.number="item.width"
  257. controls-position="right"
  258. :min="1"
  259. :max="500"
  260. size="mini"
  261. ></el-input-number>
  262. </div>
  263. </transition-group>
  264. </draggable>
  265. </div>
  266. <span slot="footer" class="dialog-footer">
  267. <el-button @click="showSetting = false">取 消</el-button>
  268. <el-button @click="delRow" type="danger">重 置</el-button>
  269. <el-button type="primary" @click="save()">确 定</el-button>
  270. </span>
  271. </el-dialog>
  272. <el-table v-loading="loading" :data="corpsList" @selection-change="handleSelectionChange">
  273. <el-table-column type="selection" align="center"/>
  274. <el-table-column type="index" label="行号" align="center" fixed="left"/>
  275. <el-table-column
  276. v-for="(item, index) in getRowList"
  277. :key="index"
  278. :label="item.name"
  279. :width="item.width"
  280. :prop="item.label"
  281. align="center"
  282. :fixed="item.fixed"
  283. :show-overflow-tooltip="true"
  284. sortable
  285. >
  286. <template slot-scope="scope">
  287. <span v-if="item.label == 'createTime'">{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
  288. <span v-else-if="item.label == 'updateTime'">{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
  289. <span v-else>{{scope.row[item.label]}}</span>
  290. </template>
  291. </el-table-column>
  292. <!-- <el-table-column label="箱号" sortable fixed align="center" prop="fNo" fixed width="120px"/>-->
  293. <!-- <el-table-column label="箱类型" align="center" sortable prop="typeidName" fixed width="100px"/>-->
  294. <!-- <el-table-column label="地点" align="center" sortable prop="addressName" fixed/>-->
  295. <!-- <el-table-column :show-overflow-tooltip="true" label="箱主" align="center" prop="ownerName" />-->
  296. <!-- <el-table-column :show-overflow-tooltip="true" label="箱来源" align="center" prop="sourceName" />-->
  297. <!-- <el-table-column label="箱状态" align="center" sortable prop="cntrstatusName" fixed width="100px"/>-->
  298. <!-- <el-table-column :show-overflow-tooltip="true" label="租赁方式" align="center" prop="rentName" />-->
  299. <!-- <el-table-column label="空重" align="center" sortable prop="updateEFName" fixed/>-->
  300. <!-- <el-table-column :show-overflow-tooltip="true" label="备注" align="center" prop="remark" />-->
  301. <!-- <el-table-column label="录入人" align="center" prop="createBy" />-->
  302. <!-- <el-table-column label="录入时间" align="center" prop="createTime" width="100px">-->
  303. <!-- <template slot-scope="scope">-->
  304. <!-- <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>-->
  305. <!-- </template>-->
  306. <!-- </el-table-column>-->
  307. <!-- <el-table-column label="最新修改人" align="center" prop="updateBy" width="100px"/>-->
  308. <!-- <el-table-column label="最新修改时间" align="center" prop="updateTime" width="120px">-->
  309. <!-- <template slot-scope="scope">-->
  310. <!-- <span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>-->
  311. <!-- </template>-->
  312. <!-- </el-table-column>-->
  313. <el-table-column label="操作" align="center" min-width="120px" fixed="right">
  314. <template slot-scope="scope">
  315. <el-button
  316. size="mini"
  317. type="text"
  318. icon="el-icon-edit"
  319. v-hasPermi="['shipping:cntrno:updateTCntrno']"
  320. @click="handleUpdate(scope.row)"
  321. >查看
  322. </el-button>
  323. <el-button
  324. size="mini"
  325. type="text"
  326. icon="el-icon-delete"
  327. v-hasPermi="['shipping:cntrno:remove']"
  328. @click="handleDelete(scope.row)"
  329. >移除
  330. </el-button>
  331. </template>
  332. </el-table-column>
  333. </el-table>
  334. <pagination
  335. v-show="total>0"
  336. :total="total"
  337. :page.sync="queryParams.pageNum"
  338. :limit.sync="queryParams.pageSize"
  339. @pagination="getList"
  340. />
  341. <!-- 添加或修改客户详情对话框 -->
  342. <el-dialog
  343. v-dialogDrag
  344. :fullscreen="dialogFull"
  345. :title="title"
  346. :visible.sync="open"
  347. close-on-click-modal="false"
  348. width="60%"
  349. :close-on-click-modal="false"
  350. append-to-body
  351. >
  352. <template slot="title">
  353. <div class="avue-crud__dialog__header">
  354. <span class="el-dialog__title">
  355. <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px"
  356. ></span>
  357. </span>
  358. <div class="avue-crud__dialog__menu enlarge" @click="full">
  359. <i
  360. style="cursor: pointer;display: block;width:12px;height:12px;border:1px solid #909399;border-top:3px solid #909399;margin-top: -3px;"
  361. ></i>
  362. </div>
  363. </div>
  364. </template>
  365. <el-form ref="form" :model="form" :rules="rules" label-width="100px">
  366. <el-row>
  367. <el-col :span="12">
  368. <el-form-item label="箱号" prop="fNo">
  369. <el-input v-model="form.fNo" style="width: 80%" placeholder="请输入箱号" :disabled="doNot"/>
  370. </el-form-item>
  371. </el-col>
  372. <el-col :span="12">
  373. <el-form-item label="箱类型" prop="fTypeid">
  374. <el-select
  375. style="width: 80%"
  376. v-model="form.fTypeid"
  377. placeholder="请选择箱类型"
  378. clearable
  379. :disabled="doNot"
  380. filterable
  381. :remote-method="boxTypeMethod"
  382. >
  383. <el-option
  384. v-for="item in typeOptions"
  385. :key="item.fId"
  386. :label="item.fNo"
  387. :value="item.fId"
  388. />
  389. </el-select>
  390. </el-form-item>
  391. </el-col>
  392. <el-col :span="12">
  393. <el-form-item label="最新地点" prop="fUpdateaddress">
  394. <el-select
  395. v-model="form.fUpdateaddress"
  396. style="width: 80%"
  397. placeholder="请输入最新地点"
  398. :disabled="doNot"
  399. filterable
  400. :remote-method="addressMethod"
  401. >
  402. <el-option
  403. v-for="item in this.addressOptions"
  404. :key="item.fId"
  405. :label="item.fName"
  406. :value="item.fId"
  407. >
  408. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.typesName }}</span>
  409. <span style="float: right;">{{ item.fName }}</span>
  410. </el-option>
  411. </el-select>
  412. </el-form-item>
  413. </el-col>
  414. <el-col :span="12">
  415. <el-form-item label="租贷公司" prop="fOwner">
  416. <el-select
  417. v-model="form.fOwner"
  418. style="width: 80%"
  419. :disabled="doNot"
  420. placeholder="请选择租贷公司"
  421. >
  422. <el-option
  423. v-for="dict in ownerOptions"
  424. :key="dict.dictValue"
  425. :label="dict.dictLabel"
  426. :value="dict.dictValue"
  427. />
  428. </el-select>
  429. </el-form-item>
  430. </el-col>
  431. </el-row>
  432. <el-row>
  433. <el-col :span="12">
  434. <el-form-item label="箱来源" prop="fSource">
  435. <el-select v-model="form.fSource" style="width: 80%" placeholder="请选择箱来源" :disabled="doNot">
  436. <el-option
  437. v-for="dict in sourceOptions"
  438. :key="dict.dictValue"
  439. :label="dict.dictLabel"
  440. :value="dict.dictValue"
  441. />
  442. </el-select>
  443. </el-form-item>
  444. </el-col>
  445. <el-col :span="12">
  446. <el-form-item label="箱状态" prop="fCntrstatus">
  447. <el-select v-model="form.fCntrstatus" style="width: 80%" placeholder="请选择箱状态" :disabled="doNot">
  448. <el-option
  449. v-for="dict in cntrstatusOptions"
  450. :key="dict.dictValue"
  451. :label="dict.dictLabel"
  452. :value="dict.dictValue"
  453. />
  454. </el-select>
  455. </el-form-item>
  456. </el-col>
  457. </el-row>
  458. <el-row>
  459. <el-col :span="12">
  460. <el-form-item label="租赁方式" prop="fRent">
  461. <el-select v-model="form.fRent" style="width: 80%" placeholder="请选择租赁方式" :disabled="doNot">
  462. <el-option
  463. v-for="dict in fRentOptions"
  464. :key="dict.dictValue"
  465. :label="dict.dictLabel"
  466. :value="dict.dictValue"
  467. />
  468. </el-select>
  469. </el-form-item>
  470. </el-col>
  471. <el-col :span="12">
  472. <el-form-item label="空重" prop="fUpdateef">
  473. <el-select v-model="form.fUpdateef" style="width: 80%" placeholder="请选择空重" :disabled="doNot">
  474. <el-option
  475. v-for="dict in updateEFOptions"
  476. :key="dict.dictValue"
  477. :label="dict.dictLabel"
  478. :value="dict.dictValue"
  479. />
  480. </el-select>
  481. </el-form-item>
  482. </el-col>
  483. <el-col :span="12">
  484. <el-form-item label="造箱时间" prop="fBuildBoxTime">
  485. <el-date-picker
  486. style="width: 80%"
  487. v-model="form.fBuildBoxTime"
  488. type="date"
  489. value-format="yyyy-MM-dd"
  490. :disabled="doNot"
  491. placeholder="选择日期">
  492. </el-date-picker>
  493. </el-form-item>
  494. </el-col>
  495. <el-col :span="12">
  496. <el-form-item label="箱龄(年)" prop="fBoxTurtleYear">
  497. <el-date-picker
  498. style="width: 80%"
  499. v-model="form.fBoxTurtleYear"
  500. type="year"
  501. :disabled="doNot"
  502. value-format="yyyy"
  503. placeholder="选择年">
  504. </el-date-picker>
  505. </el-form-item>
  506. </el-col>
  507. <el-col :span="12">
  508. <el-form-item label="箱龄(月)" prop="fBoxTurtleMonth">
  509. <span>
  510. <el-select v-model="form.fBoxTurtleMonth" slot="prepend" style="width: 80%;" placeholder="请选择" :disabled="doNot">
  511. <el-option
  512. v-for="(item,index) in month"
  513. :key="index"
  514. :label="item.label"
  515. :value="item.value"></el-option>
  516. </el-select>
  517. </span>
  518. </el-form-item>
  519. </el-col>
  520. <el-col :span="12">
  521. <el-form-item label="合同协议号" prop="fPactDealHorn">
  522. <el-input v-model="form.fPactDealHorn" style="width: 80%" placeholder="请输入合同协议号" :disabled="doNot"/>
  523. </el-form-item>
  524. </el-col>
  525. </el-row>
  526. <el-row>
  527. <el-col :span="12">
  528. <el-form-item label="箱公司" prop="fBoxLord">
  529. <el-input v-model="form.fBoxLord" style="width: 80%" placeholder="请输入箱公司" :disabled="doNot"/>
  530. </el-form-item>
  531. </el-col>
  532. <el-col :span="12">
  533. <el-form-item label="备注" prop="remark">
  534. <el-input
  535. v-model="form.remark"
  536. style="width: 91%"
  537. placeholder="请输入备注"
  538. :disabled="doNot"
  539. type="textarea"
  540. :autosize="{ minRows: 2}"
  541. />
  542. </el-form-item>
  543. </el-col>
  544. </el-row>
  545. </el-form>
  546. <div slot="footer" class="dialog-footer">
  547. <el-button type="info" round @click="doNot = false">修 改</el-button>
  548. <el-button type="success" round @click="submitForm" :disabled="doNot">保 存</el-button>
  549. <el-button @click="cancel" round>关 闭</el-button>
  550. </div>
  551. </el-dialog>
  552. <el-dialog
  553. title="提示"
  554. :visible.sync="dialogVisible"
  555. width="30%"
  556. >
  557. <span>是否已下载模板文件?</span>
  558. <span slot="footer" class="dialog-footer" style="display: flex;justify-content: flex-end">
  559. <el-button @click="downloadTemplate" style="margin-right: 10px">否</el-button>
  560. <el-upload
  561. class="upload-demo"
  562. :action="uploadImgUrl"
  563. :auto-upload="true"
  564. :on-success="(res, file) => { handleSucces( res, file); }"
  565. :headers="headers"
  566. :show-file-list="false"
  567. >
  568. <el-button @click="dialogVisible = false" type="primary">是</el-button>
  569. </el-upload>
  570. </span>
  571. </el-dialog>
  572. <el-dialog
  573. title="导入想信息"
  574. :close-on-press-escape="false"
  575. :close-on-click-modal="false"
  576. :visible.sync="boxTable"
  577. width="75%"
  578. >
  579. <el-table
  580. :data="boxLeadIn"
  581. style="width: 100%"
  582. >
  583. <el-table-column prop="fNo" label="箱号" align="center">
  584. <template slot-scope="scope">
  585. <el-input v-model="scope.row.fNo" style="width: 80%" placeholder="请输入箱号"/>
  586. </template>
  587. </el-table-column>
  588. <el-table-column prop="fTypeid" label="箱类型" align="center">
  589. <template slot-scope="scope">
  590. <el-select
  591. style="width: 80%"
  592. v-model="scope.row.fTypeid"
  593. placeholder="请选择箱类型"
  594. clearable
  595. filterable
  596. :remote-method="boxTypeMethod"
  597. >
  598. <el-option
  599. v-for="item in typeOptions"
  600. :key="item.fId"
  601. :label="item.fNo"
  602. :value="item.fId"
  603. />
  604. </el-select>
  605. </template>
  606. </el-table-column>
  607. <el-table-column prop="fUpdateaddress" label="最新地点" align="center">
  608. <template slot-scope="scope">
  609. <el-select
  610. v-model="scope.row.fUpdateaddress"
  611. style="width: 80%"
  612. placeholder="请输入最新地点"
  613. filterable
  614. :remote-method="addressMethod"
  615. >
  616. <el-option
  617. v-for="item in addressOptions"
  618. :key="item.fId"
  619. :label="item.fName"
  620. :value="item.fId"
  621. >
  622. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.typesName }}</span>
  623. <span style="float: right;">{{ item.fName }}</span>
  624. </el-option>
  625. </el-select>
  626. </template>
  627. </el-table-column>
  628. <el-table-column prop="fOwner" label="租贷公司" align="center">
  629. <template slot-scope="scope">
  630. <el-select
  631. v-model="scope.row.fOwner"
  632. style="width: 80%"
  633. placeholder="请选择租贷公司"
  634. >
  635. <el-option
  636. v-for="dict in ownerOptions"
  637. :key="dict.dictValue"
  638. :label="dict.dictLabel"
  639. :value="dict.dictValue"
  640. />
  641. </el-select>
  642. </template>
  643. </el-table-column>
  644. <el-table-column prop="fSource" label="箱来源" align="center">
  645. <template slot-scope="scope">
  646. <el-select v-model="scope.row.fSource" style="width: 80%" placeholder="请选择箱来源">
  647. <el-option
  648. v-for="dict in sourceOptions"
  649. :key="dict.dictValue"
  650. :label="dict.dictLabel"
  651. :value="dict.dictValue"
  652. />
  653. </el-select>
  654. </template>
  655. </el-table-column>
  656. <el-table-column prop="fCntrstatus" label="箱状态" align="center">
  657. <template slot-scope="scope">
  658. <el-select v-model="scope.row.fCntrstatus" style="width: 80%" placeholder="请选择箱状态">
  659. <el-option
  660. v-for="dict in cntrstatusOptions"
  661. :key="dict.dictValue"
  662. :label="dict.dictLabel"
  663. :value="dict.dictValue"
  664. />
  665. </el-select>
  666. </template>
  667. </el-table-column>
  668. <el-table-column prop="fUpdateef" label="空重" align="center">
  669. <template slot-scope="scope">
  670. <el-select v-model="scope.row.fUpdateef" style="width: 80%" placeholder="请选择空重">
  671. <el-option
  672. v-for="dict in updateEFOptions"
  673. :key="dict.dictValue"
  674. :label="dict.dictLabel"
  675. :value="dict.dictValue"
  676. />
  677. </el-select>
  678. </template>
  679. </el-table-column>
  680. <el-table-column label="操作" align="center">
  681. <template slot-scope="scope">
  682. <el-button
  683. size="mini"
  684. type="text"
  685. icon="el-icon-delete"
  686. @click="deleteRow(scope.$index, boxLeadIn)"
  687. >删除</el-button>
  688. </template>
  689. </el-table-column>
  690. </el-table>
  691. <span slot="footer" class="dialog-footer">
  692. <el-button @click="boxTable = false">取 消</el-button>
  693. <el-button type="primary" @click="boxSubmission">提 交</el-button>
  694. </span>
  695. </el-dialog>
  696. <el-dialog
  697. title="导入箱动态"
  698. :visible.sync="importDynamicsopen"
  699. :show-close="false"
  700. width="80%">
  701. <el-table
  702. :data="tableData"
  703. style="width: 100%">
  704. <el-table-column
  705. prop="opctnstatusName"
  706. label="箱动态"
  707. :show-overflow-tooltip="true"
  708. align="center">
  709. </el-table-column>
  710. <el-table-column
  711. prop="fNo"
  712. align="center"
  713. :show-overflow-tooltip="true"
  714. label="箱号">
  715. </el-table-column>
  716. <el-table-column
  717. prop="updateEFName"
  718. align="center"
  719. :show-overflow-tooltip="true"
  720. label="空重">
  721. </el-table-column>
  722. <el-table-column
  723. prop="fUpdatetime"
  724. align="center"
  725. :show-overflow-tooltip="true"
  726. label="动态日期">
  727. </el-table-column>
  728. <el-table-column
  729. prop="fVsl"
  730. align="center"
  731. :show-overflow-tooltip="true"
  732. label="船名">
  733. </el-table-column>
  734. <el-table-column
  735. prop="fVoy"
  736. align="center"
  737. :show-overflow-tooltip="true"
  738. label="航次">
  739. </el-table-column>
  740. <el-table-column
  741. prop="fBoxWeight"
  742. align="center"
  743. :show-overflow-tooltip="true"
  744. label="重量">
  745. </el-table-column>
  746. <el-table-column
  747. prop="addressName"
  748. align="center"
  749. :show-overflow-tooltip="true"
  750. label="堆放地点">
  751. </el-table-column>
  752. <el-table-column
  753. prop="fMblno"
  754. align="center"
  755. :show-overflow-tooltip="true"
  756. label="提单号">
  757. </el-table-column>
  758. <el-table-column
  759. prop="fSealno"
  760. align="center"
  761. :show-overflow-tooltip="true"
  762. label="铅封号">
  763. </el-table-column>
  764. <el-table-column
  765. prop="cntrstatusName"
  766. align="center"
  767. :show-overflow-tooltip="true"
  768. label="是否箱损">
  769. </el-table-column>
  770. <el-table-column
  771. prop="remark"
  772. align="center"
  773. :show-overflow-tooltip="true"
  774. label="箱损描述">
  775. </el-table-column>
  776. <el-table-column
  777. prop="portName"
  778. align="center"
  779. :show-overflow-tooltip="true"
  780. label="地点类型">
  781. </el-table-column>
  782. </el-table>
  783. <span slot="footer" class="dialog-footer">
  784. <el-button @click="importDynamicsopen = false">取 消</el-button>
  785. <el-button type="primary" @click="confirmLeadingIn">确 定</el-button>
  786. </span>
  787. </el-dialog>
  788. </div>
  789. </template>
  790. <script>
  791. import {
  792. listCorps,
  793. getInforma,
  794. delCorps,
  795. addboxinformation,
  796. getType,
  797. getaddress,
  798. changeCorpsStatus,
  799. exportCorps,
  800. getImport,
  801. getDown,
  802. batch,
  803. downloadBox,
  804. leadingIn
  805. } from '@/api/kaihe/containerNews/boxInformation'
  806. import draggable from 'vuedraggable'
  807. import Vue from 'vue'
  808. import Cookies from 'js-cookie'
  809. import { addSet, resetModule, select } from '@/api/system/set'
  810. import { getToken } from '@/utils/auth'
  811. Vue.directive('dialogDrag', {
  812. bind(el, binding, vnode, oldVnode) {
  813. const dialogHeaderEl = el.querySelector('.el-dialog__header')
  814. const dragDom = el.querySelector('.el-dialog')
  815. const enlarge = el.querySelector('.enlarge')
  816. dialogHeaderEl.style.cursor = 'move'
  817. // 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
  818. const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null)
  819. if (enlarge) {
  820. enlarge.onclick = (e) => {
  821. dragDom.style.top = '0px'
  822. dragDom.style.left = '0px'
  823. }
  824. }
  825. dialogHeaderEl.onmousedown = (e) => {
  826. // 鼠标按下,计算当前元素距离可视区的距离
  827. const disX = e.clientX - dialogHeaderEl.offsetLeft
  828. const disY = e.clientY - dialogHeaderEl.offsetTop
  829. // 获取到的值带px 正则匹配替换
  830. let styL, styT
  831. // 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px
  832. if (sty.left.includes('%')) {
  833. styL = +document.body.clientWidth * (+sty.left.replace(/\%/g, '') / 100)
  834. styT = +document.body.clientHeight * (+sty.top.replace(/\%/g, '') / 100)
  835. } else {
  836. styL = +sty.left.replace(/\px/g, '')
  837. styT = +sty.top.replace(/\px/g, '')
  838. }
  839. document.onmousemove = function(e) {
  840. // 通过事件委托,计算移动的距离
  841. const l = e.clientX - disX
  842. const t = e.clientY - disY
  843. // 移动当前元素
  844. if ((t + styT) >= 0) {
  845. dragDom.style.top = `${t + styT}px`
  846. }
  847. dragDom.style.left = `${l + styL}px`
  848. // 将此时的位置传出去
  849. // binding.value({x:e.pageX,y:e.pageY})
  850. }
  851. document.onmouseup = function(e) {
  852. document.onmousemove = null
  853. document.onmouseup = null
  854. }
  855. }
  856. }
  857. })
  858. export default {
  859. name: 'boxInformation',
  860. components: {
  861. draggable
  862. },
  863. data() {
  864. return {
  865. boxLeadIn: [],
  866. importDynamicsopen:false,
  867. month:[
  868. {label:'一月',value:'1'},
  869. {label:'二月',value:'2'},
  870. {label:'三月',value:'3'},
  871. {label:'四月',value:'4'},
  872. {label:'五月',value:'5'},
  873. {label:'六月',value:'6'},
  874. {label:'七月',value:'7'},
  875. {label:'八月',value:'8'},
  876. {label:'九月',value:'9'},
  877. {label:'十月',value:'10'},
  878. {label:'十一月',value:'11'},
  879. {label:'十二月',value:'12'},
  880. ],
  881. dialogVisible: false,
  882. boxTable: false,
  883. headers: {
  884. Authorization: 'Bearer ' + getToken()
  885. },
  886. uploadImgUrl: process.env.VUE_APP_BASE_API + '/shipping/cntrno/importCreate', // 上传的图片服务器地址
  887. uploadUrl: process.env.VUE_APP_BASE_API + '/shipping/cntrno/importAirForceStation', // 导入箱动态服务器地址
  888. setRowList: [],
  889. getRowList: [],
  890. tableData: [],
  891. tableDate: [
  892. {
  893. surface: '1',
  894. label: 'fNo',
  895. name: '箱号',
  896. fixed: 'left',
  897. checked: 0,
  898. width: 120
  899. },
  900. {
  901. surface: '2',
  902. label: 'typeidName',
  903. name: '箱类型',
  904. fixed: 'left',
  905. checked: 0,
  906. width: 120
  907. },
  908. {
  909. surface: '3',
  910. label: 'addressName',
  911. name: '地点',
  912. fixed: 'left',
  913. checked: 0,
  914. width: 120
  915. },
  916. {
  917. surface: '4',
  918. label: 'ownerName',
  919. name: '租贷公司',
  920. fixed: 'left',
  921. checked: 0,
  922. width: 120
  923. },
  924. {
  925. surface: '5',
  926. label: 'sourceName',
  927. name: '箱来源',
  928. fixed: 'left',
  929. checked: 0,
  930. width: 120
  931. },
  932. {
  933. surface: '6',
  934. label: 'cntrstatusName',
  935. name: '箱状态',
  936. fixed: 'left',
  937. checked: 0,
  938. width: 120
  939. },
  940. {
  941. surface: '7',
  942. label: 'rentName',
  943. name: '租赁方式',
  944. checked: 0,
  945. width: 120
  946. },
  947. {
  948. surface: '8',
  949. label: 'updateEFName',
  950. name: '空重',
  951. checked: 0,
  952. width: 120
  953. },
  954. {
  955. surface: '9',
  956. label: 'remark',
  957. name: '备注',
  958. checked: 0,
  959. width: 120
  960. },
  961. {
  962. surface: '10',
  963. label: 'createBy',
  964. name: '录入人',
  965. checked: 0,
  966. width: 120
  967. },
  968. {
  969. surface: '11',
  970. label: 'createTime',
  971. name: '录入时间',
  972. checked: 0,
  973. width: 120
  974. },
  975. {
  976. surface: '12',
  977. label: 'updateBy',
  978. name: '最新修改人',
  979. checked: 0,
  980. width: 120
  981. },
  982. {
  983. surface: '13',
  984. label: 'updateTime',
  985. name: '最新修改时间',
  986. checked: 0,
  987. width: 120
  988. },{
  989. surface: '14',
  990. label: 'fBuildBoxTime',
  991. name: '造箱时间',
  992. checked: 0,
  993. width: 120
  994. },{
  995. surface: '15',
  996. label: 'fBoxTurtleYear',
  997. name: '箱龄(年)',
  998. checked: 0,
  999. width: 120
  1000. },{
  1001. surface: '16',
  1002. label: 'fBoxTurtleMonth',
  1003. name: '箱龄(月)',
  1004. checked: 0,
  1005. width: 120
  1006. },{
  1007. surface: '17',
  1008. label: 'fPactDealHorn',
  1009. name: '合同协议号',
  1010. checked: 0,
  1011. width: 120
  1012. },{
  1013. surface: '18',
  1014. label: 'fBoxLord',
  1015. name: '箱公司',
  1016. checked: 0,
  1017. width: 120
  1018. }
  1019. ],
  1020. //自定义列宽
  1021. allCheck: false,
  1022. showSetting: false,
  1023. //默认显示第一行
  1024. queryParamsHidden: false,
  1025. //字典表箱种类
  1026. containerOptions: [],
  1027. //集装箱主字典表
  1028. ownerOptions: [],
  1029. //箱来源字典表
  1030. sourceOptions: [],
  1031. //租赁方式字典表
  1032. fRentOptions: [],
  1033. //空重字典表
  1034. updateEFOptions: [],
  1035. //箱状态字典表
  1036. cntrstatusOptions: [],
  1037. //模糊查询箱类型
  1038. typeOptions: [],
  1039. //查看置灰
  1040. doNot: true,
  1041. //模糊下拉查询地点
  1042. addressOptions: [],
  1043. //全屏放大
  1044. dialogFull: false,
  1045. contactList: [],
  1046. // 遮罩层
  1047. loading: true,
  1048. // 选中数组
  1049. ids: [],
  1050. // 非单个禁用
  1051. single: true,
  1052. // 非多个禁用
  1053. multiple: true,
  1054. // 显示搜索条件
  1055. showSearch: true,
  1056. // 总条数
  1057. total: 0,
  1058. // 客户详情表格数据
  1059. corpsList: [],
  1060. // 弹出层标题
  1061. title: '',
  1062. // 状态数据字典
  1063. statusOptions: [],
  1064. // 是否显示弹出层
  1065. open: false,
  1066. // 客户类别字典
  1067. fTypeidOptions: [],
  1068. // 结算表票结、月结字典
  1069. fStltypeidOptions: [],
  1070. // 删除状态字典
  1071. delFlagOptions: [],
  1072. // 查询参数
  1073. queryParams: {
  1074. pageNum: 1,
  1075. pageSize: 10,
  1076. fNo: null,
  1077. fTypeid: null,
  1078. fCntrstatus: null,
  1079. fOwner: null,
  1080. createBy: null,
  1081. cLoadDate: null,
  1082. remark: null
  1083. },
  1084. // 表单参数
  1085. form: {
  1086. fTypeid: null,
  1087. fUpdateaddress: null,
  1088. fOwner: null,
  1089. fNo: null,
  1090. fSource: null,
  1091. fRent: null,
  1092. fUpdateef: null,
  1093. fCntrstatus: null,
  1094. remark: null
  1095. },
  1096. // 表单校验
  1097. rules: {
  1098. fTypeid: [
  1099. { required: true, message: '', trigger: 'blur' }
  1100. ],
  1101. fNo: [
  1102. { required: true, message: '箱号不能为空', trigger: 'blur' }
  1103. ],
  1104. fUpdateaddress: [
  1105. { required: true, message: '最新地点不能为空', trigger: 'blur' }
  1106. ],
  1107. fOwner: [
  1108. { required: true, message: '租贷公司不能为空', trigger: 'blur' }
  1109. ],
  1110. fUpdateef: [
  1111. { required: true, message: '空重不能为空', trigger: 'blur' }
  1112. ],
  1113. fPactDealHorn: [
  1114. { required: true, message: '合同协议号不能为空', trigger: 'blur' }
  1115. ],
  1116. fBoxLord: [
  1117. { required: true, message: '箱公司不能为空', trigger: 'blur' }
  1118. ],
  1119. fCntrstatus: [
  1120. { required: true, message: '箱状态不能为空', trigger: 'blur' }
  1121. ]
  1122. }
  1123. }
  1124. },
  1125. created() {
  1126. this.setRowList = this.tableDate
  1127. this.getRowList = this.tableDate
  1128. this.getList()
  1129. this.getDicts('f_type').then(response => {
  1130. this.containerOptions = response.data
  1131. })
  1132. this.getDicts('f_owner').then(response => {
  1133. this.ownerOptions = response.data
  1134. })
  1135. this.getDicts('f_source').then(response => {
  1136. this.sourceOptions = response.data
  1137. })
  1138. this.getDicts('f_rent').then(response => {
  1139. this.fRentOptions = response.data
  1140. })
  1141. this.getDicts('f_updateEF').then(response => {
  1142. this.updateEFOptions = response.data
  1143. })
  1144. this.getDicts('f_cntrstatus').then(response => {
  1145. this.cntrstatusOptions = response.data
  1146. })
  1147. this.boxTypeMethod()
  1148. this.addressMethod()
  1149. this.getRow()
  1150. },
  1151. methods: {
  1152. deleteRow(index, rows) {
  1153. rows.splice(index, 1);
  1154. },
  1155. timeMethods() {
  1156. this.queryParams.cLoadDate[0] = this.queryParams.cLoadDate[0] + ' 00:00:00'
  1157. this.queryParams.cLoadDate[1] = this.queryParams.cLoadDate[1] + ' 23:59:59'
  1158. },
  1159. downloadTemplate() {
  1160. this.dialogVisible = false
  1161. this.$message({
  1162. type: 'info',
  1163. message: '请先下载模板文件'
  1164. })
  1165. },
  1166. downLoad() {
  1167. this.$confirm('是否下载模板文件?', '提示', {
  1168. confirmButtonText: '确定',
  1169. cancelButtonText: '取消',
  1170. type: 'warning'
  1171. })
  1172. .then(function() {
  1173. return getDown()
  1174. })
  1175. .then((response) => {
  1176. this.download(response.msg)
  1177. this.$message({
  1178. type: 'success',
  1179. message: '操作成功!'
  1180. })
  1181. })
  1182. .catch(() => {
  1183. this.$message({
  1184. type: 'error',
  1185. message: '操作失败!'
  1186. })
  1187. })
  1188. },
  1189. //确认导入箱动态
  1190. confirmLeadingIn(){
  1191. leadingIn({tCntrno:this.tableData}).then(res=>{
  1192. this.importDynamicsopen = false
  1193. this.$message({
  1194. type: 'success',
  1195. message: '操作成功!'
  1196. })
  1197. })
  1198. },
  1199. importBoxDynamics(file, fileList){
  1200. console.log(file)
  1201. if (file.code === 200){
  1202. this.importDynamicsopen = true
  1203. this.tableData = file.data
  1204. }else if (file.code === 500) {
  1205. this.$message.error(file.msg);
  1206. }
  1207. },
  1208. downloadBoxTemplate(){
  1209. downloadBox().then(res=>{
  1210. this.download(res.msg)
  1211. })
  1212. },
  1213. //附件上传
  1214. handleSucces(file, fileList) {
  1215. console.log(fileList)
  1216. console.log(file)
  1217. if (file.code == 200) {
  1218. this.boxTable = true
  1219. this.boxLeadIn = file.data
  1220. for (let item in this.boxLeadIn){
  1221. if (this.boxLeadIn[item].fUpdateaddress){
  1222. this.boxLeadIn[item].fUpdateaddress = Number(this.boxLeadIn[item].fUpdateaddress)
  1223. }
  1224. }
  1225. } else {
  1226. this.$message.error(file.msg)
  1227. }
  1228. },
  1229. //箱信息提交
  1230. boxSubmission() {
  1231. for (let item in this.boxLeadIn) {
  1232. let i = Number(item)+1
  1233. if (!this.boxLeadIn[item].fNo) {
  1234. return this.$message.error('第' + i + '行箱号不能为空')
  1235. }
  1236. if (!this.boxLeadIn[item].fTypeid) {
  1237. return this.$message.error('第' + i + '行箱类型不能为空')
  1238. }
  1239. if (!this.boxLeadIn[item].fUpdateaddress) {
  1240. return this.$message.error('第' + i + '行最新地点不能为空')
  1241. }
  1242. if (!this.boxLeadIn[item].fOwner) {
  1243. return this.$message.error('第' + i + '行租贷公司不能为空')
  1244. }
  1245. if (!this.boxLeadIn[item].fSource) {
  1246. return this.$message.error('第' + i + '行箱来源不能为空')
  1247. }
  1248. if (!this.boxLeadIn[item].fCntrstatus) {
  1249. return this.$message.error('第' + i + '行箱状态不能为空')
  1250. }
  1251. if (!this.boxLeadIn[item].fUpdateef) {
  1252. return this.$message.error('第' + i + '行空重不能为空')
  1253. }
  1254. for (let li in this.boxLeadIn){
  1255. if (item != li){
  1256. let i = Number(item)+1
  1257. let e = Number(li)+1
  1258. if (this.boxLeadIn[item].fNo == this.boxLeadIn[li].fNo){
  1259. return this.$message.error('第' + i + '行和第' + e + '行箱号重复')
  1260. }
  1261. }
  1262. }
  1263. }
  1264. this.boxTable = false
  1265. let formDatae = new window.FormData()
  1266. formDatae.append('tCntrno', JSON.stringify(this.boxLeadIn))
  1267. batch(formDatae).then(res =>{
  1268. console.log(res)
  1269. if (res.code === 200){
  1270. if(res.msg == '操作成功'){
  1271. this.$message.success('提交成功');
  1272. }else {
  1273. this.$message.error(res.data);
  1274. }
  1275. }
  1276. })
  1277. },
  1278. //重置列表
  1279. delRow() {
  1280. this.data = {
  1281. tableName: '箱信息',
  1282. userId: Cookies.get('userName')
  1283. }
  1284. resetModule(this.data).then((res) => {
  1285. if (res.code == 200) {
  1286. this.showSetting = false
  1287. this.setRowList = this.tableDate
  1288. console.log(this.setRowList)
  1289. this.getRowList = this.tableDate
  1290. }
  1291. })
  1292. },
  1293. //列设置全选
  1294. allChecked() {
  1295. if (this.allCheck == true) {
  1296. this.setRowList.map((e) => {
  1297. return (e.checked = 0)
  1298. })
  1299. } else {
  1300. this.setRowList.map((e) => {
  1301. return (e.checked = 1)
  1302. })
  1303. }
  1304. },
  1305. //查询列数据
  1306. getRow() {
  1307. let that = this
  1308. this.data = {
  1309. tableName: '箱信息',
  1310. userId: Cookies.get('userName')
  1311. }
  1312. select(this.data).then((res) => {
  1313. if (res.data.length != 0) {
  1314. this.getRowList = res.data.filter((e) => e.checked == 0)
  1315. this.setRowList = res.data
  1316. this.setRowList = this.setRowList.reduce((res, item) => {
  1317. res.push({
  1318. surface: item.surface,
  1319. label: item.label,
  1320. name: item.name,
  1321. checked: item.checked,
  1322. width: item.width,
  1323. fixed: item.fixed
  1324. })
  1325. return res
  1326. }, [])
  1327. }
  1328. })
  1329. console.log(this.getRowList)
  1330. },
  1331. //保存列设置
  1332. save() {
  1333. this.showSetting = false
  1334. this.data = {
  1335. tableName: '箱信息',
  1336. userId: Cookies.get('userName'),
  1337. sysTableSetList: this.setRowList
  1338. }
  1339. addSet(this.data).then((res) => {
  1340. this.getRowList = this.setRowList.filter((e) => e.checked == 0)
  1341. })
  1342. },
  1343. //开始拖拽事件
  1344. onStart() {
  1345. this.drag = true
  1346. },
  1347. //拖拽结束事件
  1348. onEnd() {
  1349. this.drag = false
  1350. },
  1351. //模糊查询地点
  1352. addressMethod() {
  1353. let queryParams = { pageNum: 1 }
  1354. getaddress(queryParams).then(response => {
  1355. this.addressOptions = response.rows
  1356. })
  1357. },
  1358. //模糊查询箱类型
  1359. boxTypeMethod() {
  1360. let queryParams = { pageNum: 1 }
  1361. getType(queryParams).then(response => {
  1362. this.typeOptions = response.rows
  1363. })
  1364. },
  1365. full() {
  1366. this.dialogFull = !this.dialogFull
  1367. },
  1368. /** 查询客户详情列表 */
  1369. getList() {
  1370. this.loading = true
  1371. listCorps(this.queryParams).then(response => {
  1372. this.corpsList = response.rows
  1373. this.total = response.total
  1374. this.loading = false
  1375. })
  1376. },
  1377. // 客户类别字典翻译
  1378. fTypeidFormat(row, column) {
  1379. return this.selectDictLabel(this.fTypeidOptions, row.fTypeid)
  1380. },
  1381. // 结算表票结、月结字典翻译
  1382. fStltypeidFormat(row, column) {
  1383. return this.selectDictLabel(this.fStltypeidOptions, row.fStltypeid)
  1384. },
  1385. // 删除状态字典翻译
  1386. delFlagFormat(row, column) {
  1387. return this.selectDictLabel(this.delFlagOptions, row.delFlag)
  1388. },
  1389. // 取消按钮
  1390. cancel() {
  1391. this.open = false
  1392. this.reset()
  1393. },
  1394. // 表单重置
  1395. reset() {
  1396. this.form = {
  1397. fTypeid: null,
  1398. fUpdateaddress: null,
  1399. fOwner: null,
  1400. fNo: null,
  1401. fSource: null,
  1402. fRent: null,
  1403. fUpdateef: null,
  1404. fCntrstatus: null,
  1405. remark: null
  1406. }
  1407. this.resetForm('form')
  1408. },
  1409. // 从表重置
  1410. contList() {
  1411. this.contactList = []
  1412. },
  1413. // 状态修改
  1414. handleStatusChange(row) {
  1415. let text = row.fStatus === '0' ? '启用' : '停用'
  1416. this.$confirm('确认要"' + text + '""' + row.fName + '"吗?', '警告', {
  1417. confirmButtonText: '确定',
  1418. cancelButtonText: '取消',
  1419. type: 'warning'
  1420. }).then(function() {
  1421. return changeCorpsStatus(row.fId, row.fStatus)
  1422. }).then(() => {
  1423. this.msgSuccess(text + '成功')
  1424. }).catch(function() {
  1425. row.fStatus = row.fStatus === '0' ? '1' : '0'
  1426. })
  1427. },
  1428. /** 搜索按钮操作 */
  1429. handleQuery() {
  1430. this.queryParams.pageNum = 1
  1431. this.getList()
  1432. },
  1433. /** 重置按钮操作 */
  1434. resetQuery() {
  1435. this.queryParams = {
  1436. fNo: null,
  1437. fTypeid: null,
  1438. fCntrstatus: null,
  1439. fOwner: null,
  1440. createBy: null,
  1441. cLoadDate: null,
  1442. remark: null
  1443. },
  1444. this.resetForm('queryForm')
  1445. this.handleQuery()
  1446. },
  1447. // 多选框选中数据
  1448. handleSelectionChange(selection) {
  1449. this.ids = selection.map(item => item.fId)
  1450. this.single = selection.length !== 1
  1451. this.multiple = !selection.length
  1452. },
  1453. /** 新增按钮操作 */
  1454. handleAdd() {
  1455. this.doNot = false
  1456. this.reset()
  1457. this.open = true
  1458. this.title = '添加客户详情'
  1459. },
  1460. /** 修改按钮操作 */
  1461. handleUpdate(row) {
  1462. this.doNot = true
  1463. this.reset()
  1464. const fId = row.fId || this.ids
  1465. getInforma(fId).then(response => {
  1466. this.form = response.data
  1467. this.form.fUpdateaddress = response.data.addressName
  1468. this.open = true
  1469. this.title = '修改客户详情'
  1470. })
  1471. },
  1472. /** 提交按钮 */
  1473. submitForm() {
  1474. this.$refs['form'].validate(valid => {
  1475. if (valid) {
  1476. if (this.form.fId != null) {
  1477. addboxinformation(this.form).then(response => {
  1478. this.msgSuccess('修改成功')
  1479. this.open = false
  1480. this.getList()
  1481. })
  1482. } else {
  1483. addboxinformation(this.form).then(response => {
  1484. this.msgSuccess('新增成功')
  1485. this.open = false
  1486. this.getList()
  1487. })
  1488. }
  1489. }
  1490. })
  1491. },
  1492. /** 删除按钮操作 */
  1493. handleDelete(row) {
  1494. const fIds = row.fId || this.ids
  1495. this.$confirm('是否确认删除客户详情编号为"' + fIds + '"的数据项?', '警告', {
  1496. confirmButtonText: '确定',
  1497. cancelButtonText: '取消',
  1498. type: 'warning'
  1499. }).then(function() {
  1500. return delCorps(fIds)
  1501. }).then(() => {
  1502. this.getList()
  1503. this.msgSuccess('删除成功')
  1504. })
  1505. },
  1506. /** 导出按钮操作 */
  1507. handleExport() {
  1508. const queryParams = this.queryParams
  1509. this.$confirm('是否确认导出所有箱信息数据项?', '警告', {
  1510. confirmButtonText: '确定',
  1511. cancelButtonText: '取消',
  1512. type: 'warning'
  1513. }).then(function() {
  1514. return exportCorps(queryParams)
  1515. }).then(response => {
  1516. this.download(response.msg)
  1517. })
  1518. }
  1519. }
  1520. }
  1521. </script>
  1522. <style lang="scss" scoped>
  1523. .avue-crud__dialog__header {
  1524. display: -webkit-box;
  1525. display: -ms-flexbox;
  1526. display: flex;
  1527. -webkit-box-align: center;
  1528. -ms-flex-align: center;
  1529. align-items: center;
  1530. -webkit-box-pack: justify;
  1531. -ms-flex-pack: justify;
  1532. justify-content: space-between;
  1533. }
  1534. .el-dialog__title {
  1535. color: rgba(0, 0, 0, .85);
  1536. font-weight: 500;
  1537. word-wrap: break-word;
  1538. }
  1539. .avue-crud__dialog__menu {
  1540. padding-right: 20px;
  1541. float: left;
  1542. }
  1543. .avue-crud__dialog__menu i {
  1544. color: #909399;
  1545. font-size: 15px;
  1546. }
  1547. .el-icon-full-screen {
  1548. cursor: pointer;
  1549. }
  1550. .el-icon-full-screen:before {
  1551. content: "\e719";
  1552. }
  1553. .tabSetting {
  1554. display: flex;
  1555. justify-content: flex-end;
  1556. }
  1557. .listStyle {
  1558. display: flex;
  1559. border-top: 1px solid #dcdfe6;
  1560. border-left: 1px solid #dcdfe6;
  1561. border-right: 1px solid #dcdfe6;
  1562. }
  1563. .listStyle:last-child {
  1564. border-bottom: 1px solid #dcdfe6;
  1565. }
  1566. .progress {
  1567. display: flex;
  1568. align-items: center;
  1569. padding: 2px;
  1570. background-color: rgba(0, 0, 0, 0.05);
  1571. height: 100%;
  1572. }
  1573. </style>