index.vue 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080
  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. start-placeholder="开始日期"
  90. end-placeholder="结束日期"
  91. style="width: 250px"
  92. >
  93. </el-date-picker>
  94. </el-form-item>
  95. </el-row>
  96. </div>
  97. </el-form>
  98. <el-row :gutter="10" class="mb8">
  99. <el-col :span="1.5">
  100. <el-button
  101. type="success"
  102. icon="el-icon-plus"
  103. size="mini"
  104. @click="handleAdd"
  105. v-hasPermi="['shipping:cntrno:add']"
  106. >新增</el-button>
  107. </el-col>
  108. <el-col :span="1.5">
  109. <el-button
  110. type="warning"
  111. icon="el-icon-edit"
  112. size="mini"
  113. :disabled="single"
  114. @click="handleUpdate"
  115. v-hasPermi="['shipping:cntrno:updateTCntrno']"
  116. >修改</el-button>
  117. </el-col>
  118. <el-col :span="1.5">
  119. <el-button
  120. type="danger"
  121. icon="el-icon-delete"
  122. size="mini"
  123. :disabled="multiple"
  124. @click="handleDelete"
  125. v-hasPermi="['shipping:cntrno:remove']"
  126. >删除</el-button>
  127. </el-col>
  128. <el-col :span="1.5">
  129. <el-button
  130. type="primary"
  131. icon="el-icon-download"
  132. size="mini"
  133. @click="handleExport"
  134. >导入</el-button>
  135. </el-col>
  136. <el-col :span="1.5">
  137. <el-button
  138. type="primary"
  139. icon="el-icon-download"
  140. size="mini"
  141. @click="handleExport"
  142. >导出</el-button>
  143. </el-col>
  144. <el-col :span="1.5">
  145. <el-button
  146. type="info"
  147. icon="el-icon-download"
  148. size="mini"
  149. @click="handleExport"
  150. >取消</el-button>
  151. </el-col>
  152. <el-col style="position: absolute;left:70%" :span="5" >
  153. <el-button size="small" @click="queryParamsHidden ? (queryParamsHidden = false) : (queryParamsHidden = true)">{{ queryParamsHidden ? '隐藏' : '更多' }}</el-button>
  154. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  155. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  156. </el-col>
  157. <div class="tabSetting">
  158. <right-toolbar
  159. :showSearch.sync="showSearch"
  160. @queryTable="getList"
  161. ></right-toolbar>
  162. <div style="margin: 0 12px">
  163. <el-button
  164. icon="el-icon-setting"
  165. size="mini"
  166. circle
  167. @click="showSetting = !showSetting"
  168. ></el-button>
  169. </div>
  170. </div>
  171. </el-row>
  172. <el-dialog title="提示" :visible.sync="showSetting" width="700px" v-dialogDrag>
  173. <template slot="title">
  174. <div class="avue-crud__dialog__header">
  175. <span class="el-dialog__title">
  176. <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px"></span>
  177. </span>
  178. </div>
  179. </template>
  180. <div>配置排序列数据(拖动调整顺序)</div>
  181. <div style="margin-left: 17px">
  182. <el-checkbox
  183. v-model="allCheck"
  184. label="全选"
  185. @change="allChecked"
  186. ></el-checkbox>
  187. </div>
  188. <div style="padding: 4px; display: flex; justify-content: center">
  189. <draggable
  190. v-model="setRowList"
  191. group="site"
  192. animation="300"
  193. @start="onStart"
  194. @end="onEnd"
  195. handle=".indraggable"
  196. >
  197. <transition-group>
  198. <div
  199. v-for="item in setRowList"
  200. :key="item.surface"
  201. class="listStyle"
  202. >
  203. <div style="width: 500px" class="indraggable">
  204. <div class="progress" :style="{ width: item.width + 'px' }">
  205. <el-checkbox
  206. :label="item.name"
  207. v-model="item.checked"
  208. :true-label="0"
  209. :false-label="1"
  210. >{{ item.name }}
  211. </el-checkbox>
  212. </div>
  213. </div>
  214. <el-input-number
  215. v-model.number="item.width"
  216. controls-position="right"
  217. :min="1"
  218. :max="500"
  219. size="mini"
  220. ></el-input-number>
  221. </div>
  222. </transition-group>
  223. </draggable>
  224. </div>
  225. <span slot="footer" class="dialog-footer">
  226. <el-button @click="showSetting = false">取 消</el-button>
  227. <el-button @click="delRow" type="danger">重 置</el-button>
  228. <el-button type="primary" @click="save()">确 定</el-button>
  229. </span>
  230. </el-dialog>
  231. <el-table v-loading="loading" :data="corpsList" @selection-change="handleSelectionChange">
  232. <el-table-column type="selection" align="center" />
  233. <el-table-column type="index" label="行号" align="center" fixed="left"/>
  234. <el-table-column
  235. v-for="(item, index) in getRowList"
  236. :key="index"
  237. :label="item.name"
  238. :width="item.width"
  239. :prop="item.label"
  240. align="center"
  241. :fixed="item.fixed"
  242. :show-overflow-tooltip="true"
  243. sortable
  244. >
  245. <template slot-scope="scope">
  246. <span v-if="item.label == 'fNo'">{{scope.row.fNo}}</span>
  247. <span v-if="item.label == 'typeidName'">{{scope.row.typeidName}}</span>
  248. <span v-if="item.label == 'addressName'">{{scope.row.addressName}}</span>
  249. <span v-if="item.label == 'ownerName'">{{scope.row.ownerName}}</span>
  250. <span v-if="item.label == 'sourceName'">{{scope.row.sourceName}}</span>
  251. <span v-if="item.label == 'cntrstatusName'">{{scope.row.cntrstatusName}}</span>
  252. <span v-if="item.label == 'rentName'">{{scope.row.rentName}}</span>
  253. <span v-if="item.label == 'updateEFName'">{{scope.row.updateEFName}}</span>
  254. <span v-if="item.label == 'remark'">{{scope.row.remark}}</span>
  255. <span v-if="item.label == 'createBy'">{{scope.row.createBy}}</span>
  256. <span v-if="item.label == 'createTime'">{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
  257. <span v-if="item.label == 'updateBy'">{{scope.row.updateBy}}</span>
  258. <span v-if="item.label == 'updateTime'">{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
  259. </template>
  260. </el-table-column>
  261. <!-- <el-table-column label="箱号" sortable fixed align="center" prop="fNo" fixed width="120px"/>-->
  262. <!-- <el-table-column label="箱类型" align="center" sortable prop="typeidName" fixed width="100px"/>-->
  263. <!-- <el-table-column label="地点" align="center" sortable prop="addressName" fixed/>-->
  264. <!-- <el-table-column :show-overflow-tooltip="true" label="箱主" align="center" prop="ownerName" />-->
  265. <!-- <el-table-column :show-overflow-tooltip="true" label="箱来源" align="center" prop="sourceName" />-->
  266. <!-- <el-table-column label="箱状态" align="center" sortable prop="cntrstatusName" fixed width="100px"/>-->
  267. <!-- <el-table-column :show-overflow-tooltip="true" label="租赁方式" align="center" prop="rentName" />-->
  268. <!-- <el-table-column label="空重" align="center" sortable prop="updateEFName" fixed/>-->
  269. <!-- <el-table-column :show-overflow-tooltip="true" label="备注" align="center" prop="remark" />-->
  270. <!-- <el-table-column label="录入人" align="center" prop="createBy" />-->
  271. <!-- <el-table-column label="录入时间" align="center" prop="createTime" width="100px">-->
  272. <!-- <template slot-scope="scope">-->
  273. <!-- <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>-->
  274. <!-- </template>-->
  275. <!-- </el-table-column>-->
  276. <!-- <el-table-column label="最新修改人" align="center" prop="updateBy" width="100px"/>-->
  277. <!-- <el-table-column label="最新修改时间" align="center" prop="updateTime" width="120px">-->
  278. <!-- <template slot-scope="scope">-->
  279. <!-- <span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>-->
  280. <!-- </template>-->
  281. <!-- </el-table-column>-->
  282. <el-table-column label="操作" align="center" min-width="120px" fixed="right">
  283. <template slot-scope="scope">
  284. <el-button
  285. size="mini"
  286. type="text"
  287. icon="el-icon-edit"
  288. v-hasPermi="['shipping:cntrno:updateTCntrno']"
  289. @click="handleUpdate(scope.row)"
  290. >查看</el-button>
  291. <el-button
  292. size="mini"
  293. type="text"
  294. icon="el-icon-delete"
  295. v-hasPermi="['shipping:cntrno:remove']"
  296. @click="handleDelete(scope.row)"
  297. >移除</el-button>
  298. </template>
  299. </el-table-column>
  300. </el-table>
  301. <pagination
  302. v-show="total>0"
  303. :total="total"
  304. :page.sync="queryParams.pageNum"
  305. :limit.sync="queryParams.pageSize"
  306. @pagination="getList"
  307. />
  308. <!-- 添加或修改客户详情对话框 -->
  309. <el-dialog
  310. v-dialogDrag
  311. :fullscreen="dialogFull"
  312. :title="title"
  313. :visible.sync="open"
  314. close-on-click-modal="false"
  315. width="60%"
  316. :close-on-click-modal="false"
  317. append-to-body>
  318. <template slot="title">
  319. <div class="avue-crud__dialog__header">
  320. <span class="el-dialog__title">
  321. <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px"></span>
  322. </span>
  323. <div class="avue-crud__dialog__menu enlarge" @click="full">
  324. <i style="cursor: pointer;display: block;width:12px;height:12px;border:1px solid #909399;border-top:3px solid #909399;margin-top: -3px;"></i>
  325. </div>
  326. </div>
  327. </template>
  328. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  329. <el-row>
  330. <el-col :span="12">
  331. <el-form-item label="箱号" prop="fNo">
  332. <el-input v-model="form.fNo" style="width: 80%" placeholder="请输入箱号" :disabled="doNot" />
  333. </el-form-item>
  334. </el-col>
  335. <el-col :span="12">
  336. <el-form-item label="箱类型" prop="fTypeid">
  337. <el-select
  338. style="width: 80%"
  339. v-model="form.fTypeid"
  340. placeholder="请选择箱类型"
  341. clearable
  342. :disabled="doNot"
  343. filterable
  344. :remote-method="boxTypeMethod"
  345. >
  346. <el-option
  347. v-for="item in typeOptions"
  348. :key="item.fId"
  349. :label="item.fNo"
  350. :value="item.fId"
  351. />
  352. </el-select>
  353. </el-form-item>
  354. </el-col>
  355. <el-col :span="12">
  356. <el-form-item label="最新地点" prop="fUpdateaddress">
  357. <el-select
  358. v-model="form.fUpdateaddress"
  359. style="width: 80%"
  360. placeholder="请输入最新地点"
  361. :disabled="doNot"
  362. filterable
  363. :remote-method="addressMethod"
  364. >
  365. <el-option
  366. v-for="item in this.addressOptions"
  367. :key="item.fId"
  368. :label="item.fName"
  369. :value="item.fId">
  370. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.typesName }}</span>
  371. <span style="float: right;">{{ item.fName }}</span>
  372. </el-option>
  373. </el-select>
  374. </el-form-item>
  375. </el-col>
  376. <el-col :span="12">
  377. <el-form-item label="箱主" prop="fOwner">
  378. <el-select
  379. v-model="form.fOwner"
  380. style="width: 80%"
  381. :disabled="doNot"
  382. placeholder="请选择箱主"
  383. >
  384. <el-option
  385. v-for="dict in ownerOptions"
  386. :key="dict.dictValue"
  387. :label="dict.dictLabel"
  388. :value="dict.dictValue"
  389. />
  390. </el-select>
  391. </el-form-item>
  392. </el-col>
  393. </el-row>
  394. <el-row>
  395. <el-col :span="12">
  396. <el-form-item label="箱来源" prop="fSource">
  397. <el-select v-model="form.fSource" style="width: 80%" placeholder="请选择箱来源" :disabled="doNot">
  398. <el-option
  399. v-for="dict in sourceOptions"
  400. :key="dict.dictValue"
  401. :label="dict.dictLabel"
  402. :value="dict.dictValue"
  403. />
  404. </el-select>
  405. </el-form-item>
  406. </el-col>
  407. <el-col :span="12">
  408. <el-form-item label="箱状态" prop="fCntrstatus">
  409. <el-select v-model="form.fCntrstatus" style="width: 80%" placeholder="请选择箱状态" :disabled="doNot">
  410. <el-option
  411. v-for="dict in cntrstatusOptions"
  412. :key="dict.dictValue"
  413. :label="dict.dictLabel"
  414. :value="dict.dictValue"
  415. />
  416. </el-select>
  417. </el-form-item>
  418. </el-col>
  419. </el-row>
  420. <el-row>
  421. <el-col :span="12">
  422. <el-form-item label="租赁方式" prop="fRent">
  423. <el-select v-model="form.fRent" style="width: 80%" placeholder="请选择租赁方式" :disabled="doNot">
  424. <el-option
  425. v-for="dict in fRentOptions"
  426. :key="dict.dictValue"
  427. :label="dict.dictLabel"
  428. :value="dict.dictValue"
  429. />
  430. </el-select>
  431. </el-form-item>
  432. </el-col>
  433. <el-col :span="12">
  434. <el-form-item label="空重" prop="fUpdateef">
  435. <el-select v-model="form.fUpdateef" style="width: 80%" placeholder="请选择空重" :disabled="doNot">
  436. <el-option
  437. v-for="dict in updateEFOptions"
  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-row>
  446. <el-row>
  447. <el-col :span="24">
  448. <el-form-item label="备注" prop="remark">
  449. <el-input
  450. v-model="form.remark"
  451. style="width: 91%"
  452. placeholder="请输入备注"
  453. :disabled="doNot"
  454. type="textarea"
  455. :autosize="{ minRows: 2}"
  456. />
  457. </el-form-item>
  458. </el-col>
  459. </el-row>
  460. </el-form>
  461. <div slot="footer" class="dialog-footer">
  462. <el-button type="info" round @click="doNot = false">修 改</el-button>
  463. <el-button type="success" round @click="submitForm" :disabled="doNot">保 存</el-button>
  464. <el-button @click="cancel" round>关 闭</el-button>
  465. </div>
  466. </el-dialog>
  467. </div>
  468. </template>
  469. <script>
  470. import { listCorps, getInforma, delCorps, addboxinformation, getType,getaddress, changeCorpsStatus,exportCorps } from "@/api/kaihe/containerNews/boxInformation";
  471. import draggable from "vuedraggable";
  472. import Vue from 'vue'
  473. import Cookies from 'js-cookie'
  474. import { addSet, resetModule, select } from '@/api/system/set'
  475. Vue.directive('dialogDrag', {
  476. bind(el, binding, vnode, oldVnode) {
  477. const dialogHeaderEl = el.querySelector('.el-dialog__header')
  478. const dragDom = el.querySelector('.el-dialog')
  479. const enlarge = el.querySelector('.enlarge')
  480. dialogHeaderEl.style.cursor = 'move'
  481. // 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
  482. const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null)
  483. if(enlarge){
  484. enlarge.onclick = (e) => {
  485. dragDom.style.top = '0px'
  486. dragDom.style.left = '0px'
  487. }
  488. }
  489. dialogHeaderEl.onmousedown = (e) => {
  490. // 鼠标按下,计算当前元素距离可视区的距离
  491. const disX = e.clientX - dialogHeaderEl.offsetLeft
  492. const disY = e.clientY - dialogHeaderEl.offsetTop
  493. // 获取到的值带px 正则匹配替换
  494. let styL, styT
  495. // 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px
  496. if (sty.left.includes('%')) {
  497. styL = +document.body.clientWidth * (+sty.left.replace(/\%/g, '') / 100)
  498. styT = +document.body.clientHeight * (+sty.top.replace(/\%/g, '') / 100)
  499. } else {
  500. styL = +sty.left.replace(/\px/g, '')
  501. styT = +sty.top.replace(/\px/g, '')
  502. }
  503. document.onmousemove = function(e) {
  504. // 通过事件委托,计算移动的距离
  505. const l = e.clientX - disX
  506. const t = e.clientY - disY
  507. // 移动当前元素
  508. if ((t + styT) >= 0){
  509. dragDom.style.top = `${t + styT}px`
  510. }
  511. dragDom.style.left = `${l + styL}px`
  512. // 将此时的位置传出去
  513. // binding.value({x:e.pageX,y:e.pageY})
  514. }
  515. document.onmouseup = function(e) {
  516. document.onmousemove = null
  517. document.onmouseup = null
  518. }
  519. }
  520. }
  521. })
  522. export default {
  523. name: "boxInformation",
  524. components: {
  525. draggable
  526. },
  527. data() {
  528. return {
  529. setRowList: [],
  530. getRowList: [],
  531. tableDate: [
  532. {
  533. surface: "1",
  534. label: "fNo",
  535. name: "箱号",
  536. fixed:"left",
  537. checked: 0,
  538. width: 120,
  539. },
  540. {
  541. surface: "2",
  542. label: "typeidName",
  543. name: "箱类型",
  544. fixed:"left",
  545. checked: 0,
  546. width: 120,
  547. },
  548. {
  549. surface: "3",
  550. label: "addressName",
  551. name: "地点",
  552. fixed:"left",
  553. checked: 0,
  554. width: 120,
  555. },
  556. {
  557. surface: "4",
  558. label: "ownerName",
  559. name: "箱主",
  560. fixed:"left",
  561. checked: 0,
  562. width: 120,
  563. },
  564. {
  565. surface: "5",
  566. label: "sourceName",
  567. name: "箱来源",
  568. fixed:"left",
  569. checked: 0,
  570. width: 120,
  571. },
  572. {
  573. surface: "6",
  574. label: "cntrstatusName",
  575. name: "箱状态",
  576. fixed:"left",
  577. checked: 0,
  578. width: 120,
  579. },
  580. {
  581. surface: "7",
  582. label: "rentName",
  583. name: "租赁方式",
  584. checked: 0,
  585. width: 120,
  586. },
  587. {
  588. surface: "8",
  589. label: "updateEFName",
  590. name: "空重",
  591. checked: 0,
  592. width: 120,
  593. },
  594. {
  595. surface: "9",
  596. label: "remark",
  597. name: "备注",
  598. checked: 0,
  599. width: 120,
  600. },
  601. {
  602. surface: "10",
  603. label: "createBy",
  604. name: "录入人",
  605. checked: 0,
  606. width: 120,
  607. },
  608. {
  609. surface: "11",
  610. label: "createTime",
  611. name: "录入时间",
  612. checked: 0,
  613. width: 120,
  614. },
  615. {
  616. surface: "12",
  617. label: "updateBy",
  618. name: "最新修改人",
  619. checked: 0,
  620. width: 120,
  621. },
  622. {
  623. surface: "13",
  624. label: "updateTime",
  625. name: "最新修改时间",
  626. checked: 0,
  627. width: 120,
  628. },
  629. ],
  630. //自定义列宽
  631. allCheck: false,
  632. showSetting:false,
  633. //默认显示第一行
  634. queryParamsHidden:false,
  635. //字典表箱种类
  636. containerOptions:[],
  637. //集装箱主字典表
  638. ownerOptions:[],
  639. //箱来源字典表
  640. sourceOptions:[],
  641. //租赁方式字典表
  642. fRentOptions:[],
  643. //空重字典表
  644. updateEFOptions:[],
  645. //箱状态字典表
  646. cntrstatusOptions:[],
  647. //模糊查询箱类型
  648. typeOptions:[],
  649. //查看置灰
  650. doNot:true,
  651. //模糊下拉查询地点
  652. addressOptions:[],
  653. //全屏放大
  654. dialogFull:false,
  655. contactList:[],
  656. // 遮罩层
  657. loading: true,
  658. // 选中数组
  659. ids: [],
  660. // 非单个禁用
  661. single: true,
  662. // 非多个禁用
  663. multiple: true,
  664. // 显示搜索条件
  665. showSearch: true,
  666. // 总条数
  667. total: 0,
  668. // 客户详情表格数据
  669. corpsList: [],
  670. // 弹出层标题
  671. title: "",
  672. // 状态数据字典
  673. statusOptions: [],
  674. // 是否显示弹出层
  675. open: false,
  676. // 客户类别字典
  677. fTypeidOptions: [],
  678. // 结算表票结、月结字典
  679. fStltypeidOptions: [],
  680. // 删除状态字典
  681. delFlagOptions: [],
  682. // 查询参数
  683. queryParams: {
  684. pageNum: 1,
  685. pageSize: 10,
  686. fNo:null,
  687. fTypeid:null,
  688. fCntrstatus:null,
  689. fOwner:null,
  690. createBy:null,
  691. cLoadDate:null,
  692. remark:null,
  693. },
  694. // 表单参数
  695. form: {
  696. fTypeid:null,
  697. fUpdateaddress:null,
  698. fOwner:null,
  699. fNo:null,
  700. fSource:null,
  701. fRent:null,
  702. fUpdateef:null,
  703. fCntrstatus:null,
  704. remark:null
  705. },
  706. // 表单校验
  707. rules: {
  708. fTypeid: [
  709. { required: true, message: "", trigger: "blur" }
  710. ],
  711. fNo: [
  712. { required: true, message: "箱号不能为空", trigger: "blur" }
  713. ],
  714. fUpdateaddress: [
  715. { required: true, message: "最新地点不能为空", trigger: "blur" }
  716. ],
  717. fOwner:[
  718. { required: true, message: "箱主不能为空", trigger: "blur" }
  719. ],
  720. fUpdateef: [
  721. { required: true, message: "空重不能为空", trigger: "blur" }
  722. ],
  723. fCntrstatus: [
  724. { required: true, message: "箱状态不能为空", trigger: "blur" }
  725. ],
  726. }
  727. };
  728. },
  729. created() {
  730. this.setRowList = this.tableDate;
  731. this.getRowList = this.tableDate;
  732. this.getList();
  733. this.getDicts("f_type").then(response => {
  734. this.containerOptions = response.data;
  735. });
  736. this.getDicts("f_owner").then(response => {
  737. this.ownerOptions = response.data;
  738. });
  739. this.getDicts("f_source").then(response => {
  740. this.sourceOptions = response.data;
  741. });
  742. this.getDicts("f_rent").then(response => {
  743. this.fRentOptions = response.data;
  744. });
  745. this.getDicts("f_updateEF").then(response => {
  746. this.updateEFOptions = response.data;
  747. });
  748. this.getDicts("f_cntrstatus").then(response => {
  749. this.cntrstatusOptions = response.data;
  750. });
  751. this.boxTypeMethod()
  752. this.addressMethod()
  753. this.getRow()
  754. },
  755. methods: {
  756. //重置列表
  757. delRow() {
  758. this.data = {
  759. tableName: "箱信息",
  760. userId: Cookies.get("userName"),
  761. };
  762. resetModule(this.data).then((res) => {
  763. if (res.code == 200) {
  764. this.showSetting = false;
  765. this.setRowList = this.tableDate;
  766. console.log(this.setRowList)
  767. this.getRowList = this.tableDate;
  768. }
  769. });
  770. },
  771. //列设置全选
  772. allChecked() {
  773. if (this.allCheck == true) {
  774. this.setRowList.map((e) => {
  775. return (e.checked = 0);
  776. });
  777. } else {
  778. this.setRowList.map((e) => {
  779. return (e.checked = 1);
  780. });
  781. }
  782. },
  783. //查询列数据
  784. getRow() {
  785. let that = this;
  786. this.data = {
  787. tableName: "箱信息",
  788. userId: Cookies.get("userName"),
  789. };
  790. select(this.data).then((res) => {
  791. if (res.data.length != 0) {
  792. this.getRowList = res.data.filter((e) => e.checked == 0);
  793. this.setRowList = res.data;
  794. this.setRowList = this.setRowList.reduce((res, item) => {
  795. res.push({
  796. surface: item.surface,
  797. label: item.label,
  798. name: item.name,
  799. checked: item.checked,
  800. width: item.width,
  801. fixed: item.fixed
  802. });
  803. return res;
  804. }, []);
  805. }
  806. });
  807. console.log(this.getRowList)
  808. },
  809. //保存列设置
  810. save() {
  811. this.showSetting = false;
  812. this.data = {
  813. tableName: "箱信息",
  814. userId: Cookies.get("userName"),
  815. sysTableSetList: this.setRowList,
  816. };
  817. addSet(this.data).then((res) => {
  818. this.getRowList = this.setRowList.filter((e) => e.checked == 0);
  819. });
  820. },
  821. //开始拖拽事件
  822. onStart() {
  823. this.drag = true;
  824. },
  825. //拖拽结束事件
  826. onEnd() {
  827. this.drag = false;
  828. },
  829. //模糊查询地点
  830. addressMethod(){
  831. let queryParams = { pageNum: 1,};
  832. getaddress(queryParams).then(response=>{
  833. this.addressOptions = response.rows
  834. })
  835. },
  836. //模糊查询箱类型
  837. boxTypeMethod(){
  838. let queryParams = { pageNum: 1,};
  839. getType(queryParams).then(response =>{
  840. this.typeOptions = response.rows
  841. })
  842. },
  843. full(){
  844. this.dialogFull = !this.dialogFull
  845. },
  846. /** 查询客户详情列表 */
  847. getList() {
  848. this.loading = true;
  849. listCorps(this.queryParams).then(response => {
  850. this.corpsList = response.rows;
  851. this.total = response.total;
  852. this.loading = false;
  853. });
  854. },
  855. // 客户类别字典翻译
  856. fTypeidFormat(row, column) {
  857. return this.selectDictLabel(this.fTypeidOptions, row.fTypeid);
  858. },
  859. // 结算表票结、月结字典翻译
  860. fStltypeidFormat(row, column) {
  861. return this.selectDictLabel(this.fStltypeidOptions, row.fStltypeid);
  862. },
  863. // 删除状态字典翻译
  864. delFlagFormat(row, column) {
  865. return this.selectDictLabel(this.delFlagOptions, row.delFlag);
  866. },
  867. // 取消按钮
  868. cancel() {
  869. this.open = false;
  870. this.reset();
  871. },
  872. // 表单重置
  873. reset() {
  874. this.form = {
  875. fTypeid:null,
  876. fUpdateaddress:null,
  877. fOwner:null,
  878. fNo:null,
  879. fSource:null,
  880. fRent:null,
  881. fUpdateef:null,
  882. fCntrstatus:null,
  883. remark:null
  884. };
  885. this.resetForm("form");
  886. },
  887. // 从表重置
  888. contList() {
  889. this.contactList = []
  890. },
  891. // 状态修改
  892. handleStatusChange(row) {
  893. let text = row.fStatus === "0" ? "启用" : "停用";
  894. this.$confirm('确认要"' + text + '""' + row.fName + '"吗?', "警告", {
  895. confirmButtonText: "确定",
  896. cancelButtonText: "取消",
  897. type: "warning"
  898. }).then(function() {
  899. return changeCorpsStatus(row.fId, row.fStatus);
  900. }).then(() => {
  901. this.msgSuccess(text + "成功");
  902. }).catch(function() {
  903. row.fStatus = row.fStatus === "0" ? "1" : "0";
  904. });
  905. },
  906. /** 搜索按钮操作 */
  907. handleQuery() {
  908. this.queryParams.pageNum = 1;
  909. this.getList();
  910. },
  911. /** 重置按钮操作 */
  912. resetQuery() {
  913. this.queryParams = {
  914. fNo:null,
  915. fTypeid:null,
  916. fCntrstatus:null,
  917. fOwner:null,
  918. createBy:null,
  919. cLoadDate:null,
  920. remark:null,
  921. },
  922. this.resetForm("queryForm");
  923. this.handleQuery();
  924. },
  925. // 多选框选中数据
  926. handleSelectionChange(selection) {
  927. this.ids = selection.map(item => item.fId)
  928. this.single = selection.length!==1
  929. this.multiple = !selection.length
  930. },
  931. /** 新增按钮操作 */
  932. handleAdd() {
  933. this.doNot = false
  934. this.reset();
  935. this.open = true;
  936. this.title = "添加客户详情";
  937. },
  938. /** 修改按钮操作 */
  939. handleUpdate(row) {
  940. this.doNot = true
  941. this.reset();
  942. const fId = row.fId || this.ids
  943. getInforma(fId).then(response => {
  944. this.form = response.data;
  945. this.form.fUpdateaddress = response.data.addressName
  946. this.open = true;
  947. this.title = "修改客户详情";
  948. });
  949. },
  950. /** 提交按钮 */
  951. submitForm() {
  952. this.$refs["form"].validate(valid => {
  953. if (valid) {
  954. if (this.form.fId != null) {
  955. addboxinformation(this.form).then(response => {
  956. this.msgSuccess("修改成功");
  957. this.open = false;
  958. this.getList();
  959. });
  960. } else {
  961. addboxinformation(this.form).then(response => {
  962. this.msgSuccess("新增成功");
  963. this.open = false;
  964. this.getList();
  965. });
  966. }
  967. }
  968. });
  969. },
  970. /** 删除按钮操作 */
  971. handleDelete(row) {
  972. const fIds = row.fId || this.ids;
  973. this.$confirm('是否确认删除客户详情编号为"' + fIds + '"的数据项?', "警告", {
  974. confirmButtonText: "确定",
  975. cancelButtonText: "取消",
  976. type: "warning"
  977. }).then(function() {
  978. return delCorps(fIds);
  979. }).then(() => {
  980. this.getList();
  981. this.msgSuccess("删除成功");
  982. })
  983. },
  984. /** 导出按钮操作 */
  985. handleExport() {
  986. const queryParams = this.queryParams;
  987. this.$confirm('是否确认导出所有客户详情数据项?', "警告", {
  988. confirmButtonText: "确定",
  989. cancelButtonText: "取消",
  990. type: "warning"
  991. }).then(function() {
  992. return exportCorps(queryParams);
  993. }).then(response => {
  994. this.download(response.msg);
  995. })
  996. }
  997. }
  998. };
  999. </script>
  1000. <style lang="scss" scoped>
  1001. .avue-crud__dialog__header {
  1002. display: -webkit-box;
  1003. display: -ms-flexbox;
  1004. display: flex;
  1005. -webkit-box-align: center;
  1006. -ms-flex-align: center;
  1007. align-items: center;
  1008. -webkit-box-pack: justify;
  1009. -ms-flex-pack: justify;
  1010. justify-content: space-between;
  1011. }
  1012. .el-dialog__title {
  1013. color: rgba(0,0,0,.85);
  1014. font-weight: 500;
  1015. word-wrap: break-word;
  1016. }
  1017. .avue-crud__dialog__menu {
  1018. padding-right: 20px;
  1019. float: left;
  1020. }
  1021. .avue-crud__dialog__menu i {
  1022. color: #909399;
  1023. font-size: 15px;
  1024. }
  1025. .el-icon-full-screen{
  1026. cursor: pointer;
  1027. }
  1028. .el-icon-full-screen:before {
  1029. content: "\e719";
  1030. }
  1031. .tabSetting {
  1032. display: flex;
  1033. justify-content: flex-end;
  1034. }
  1035. .listStyle {
  1036. display: flex;
  1037. border-top: 1px solid #dcdfe6;
  1038. border-left: 1px solid #dcdfe6;
  1039. border-right: 1px solid #dcdfe6;
  1040. }
  1041. .listStyle:last-child {
  1042. border-bottom: 1px solid #dcdfe6;
  1043. }
  1044. .progress {
  1045. display: flex;
  1046. align-items: center;
  1047. padding: 2px;
  1048. background-color: rgba(0, 0, 0, 0.05);
  1049. height: 100%;
  1050. }
  1051. </style>