index.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763
  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:75%" :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. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  158. </el-row>
  159. <el-table v-loading="loading" :data="corpsList" @selection-change="handleSelectionChange">
  160. <el-table-column type="selection" align="center" />
  161. <el-table-column type="index" label="行号" align="center" fixed/>
  162. <el-table-column label="箱号" sortable fixed align="center" prop="fNo" fixed width="120px"/>
  163. <el-table-column label="地点" align="center" sortable prop="addressName" fixed/>
  164. <el-table-column label="箱类型" align="center" sortable prop="typeidName" fixed width="100px"/>
  165. <el-table-column label="箱状态" align="center" sortable prop="cntrstatusName" fixed width="100px"/>
  166. <el-table-column label="空重" align="center" sortable prop="updateEFName" fixed/>
  167. <el-table-column :show-overflow-tooltip="true" label="箱主" align="center" prop="ownerName" />
  168. <el-table-column :show-overflow-tooltip="true" label="箱来源" align="center" prop="sourceName" />
  169. <el-table-column :show-overflow-tooltip="true" label="租赁方式" align="center" prop="rentName" />
  170. <el-table-column :show-overflow-tooltip="true" label="备注" align="center" prop="remark" />
  171. <el-table-column label="录入人" align="center" prop="createBy" />
  172. <el-table-column label="录入时间" align="center" prop="createTime" width="100px">
  173. <template slot-scope="scope">
  174. <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
  175. </template>
  176. </el-table-column>
  177. <el-table-column label="最新修改人" align="center" prop="updateBy" width="100px"/>
  178. <el-table-column label="最新修改时间" align="center" prop="updateTime" width="120px">
  179. <template slot-scope="scope">
  180. <span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
  181. </template>
  182. </el-table-column>
  183. <el-table-column label="操作" align="center" min-width="120px" fixed="right">
  184. <template slot-scope="scope">
  185. <el-button
  186. size="mini"
  187. type="text"
  188. icon="el-icon-edit"
  189. @click="handleUpdate(scope.row)"
  190. >查看</el-button>
  191. <el-button
  192. size="mini"
  193. type="text"
  194. icon="el-icon-delete"
  195. @click="handleDelete(scope.row)"
  196. >移除</el-button>
  197. </template>
  198. </el-table-column>
  199. </el-table>
  200. <pagination
  201. v-show="total>0"
  202. :total="total"
  203. :page.sync="queryParams.pageNum"
  204. :limit.sync="queryParams.pageSize"
  205. @pagination="getList"
  206. />
  207. <!-- 添加或修改客户详情对话框 -->
  208. <el-dialog
  209. v-dialogDrag
  210. :fullscreen="dialogFull"
  211. :title="title"
  212. :visible.sync="open"
  213. close-on-click-modal="false"
  214. width="60%"
  215. :close-on-click-modal="false"
  216. append-to-body>
  217. <template slot="title">
  218. <div class="avue-crud__dialog__header">
  219. <span class="el-dialog__title">
  220. <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px"></span>
  221. </span>
  222. <div class="avue-crud__dialog__menu enlarge" @click="full">
  223. <i style="cursor: pointer;display: block;width:12px;height:12px;border:1px solid #909399;border-top:3px solid #909399;margin-top: -3px;"></i>
  224. </div>
  225. </div>
  226. </template>
  227. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  228. <el-row>
  229. <el-col :span="24">
  230. <el-form-item label="箱类型" prop="fTypeid">
  231. <el-select
  232. style="width: 90%"
  233. v-model="form.fTypeid"
  234. placeholder="请选择箱类型"
  235. clearable
  236. :disabled="doNot"
  237. filterable
  238. :remote-method="boxTypeMethod"
  239. >
  240. <el-option
  241. v-for="item in typeOptions"
  242. :key="item.fId"
  243. :label="item.fNo"
  244. :value="item.fId"
  245. />
  246. </el-select>
  247. </el-form-item>
  248. </el-col>
  249. <el-col :span="12">
  250. <el-form-item label="最新地点" prop="fUpdateaddress">
  251. <el-select
  252. v-model="form.fUpdateaddress"
  253. style="width: 80%"
  254. placeholder="请输入最新地点"
  255. :disabled="doNot"
  256. filterable
  257. :remote-method="addressMethod"
  258. >
  259. <el-option
  260. v-for="item in this.addressOptions"
  261. :key="item.fId"
  262. :label="item.fName"
  263. :value="item.fId">
  264. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.typesName }}</span>
  265. <span style="float: right;">{{ item.fName }}</span>
  266. </el-option>
  267. </el-select>
  268. </el-form-item>
  269. </el-col>
  270. <el-col :span="12">
  271. <el-form-item label="箱主" prop="fOwner">
  272. <el-select
  273. v-model="form.fOwner"
  274. style="width: 80%"
  275. :disabled="doNot"
  276. placeholder="请选择箱主"
  277. >
  278. <el-option
  279. v-for="dict in ownerOptions"
  280. :key="dict.dictValue"
  281. :label="dict.dictLabel"
  282. :value="dict.dictValue"
  283. />
  284. </el-select>
  285. </el-form-item>
  286. </el-col>
  287. </el-row>
  288. <el-row>
  289. <el-col :span="12">
  290. <el-form-item label="箱号" prop="fNo">
  291. <el-input v-model="form.fNo" style="width: 80%" placeholder="请输入箱号" :disabled="doNot" />
  292. </el-form-item>
  293. </el-col>
  294. <el-col :span="12">
  295. <el-form-item label="箱来源" prop="fSource">
  296. <el-select v-model="form.fSource" style="width: 78%" placeholder="请选择箱来源" :disabled="doNot">
  297. <el-option
  298. v-for="dict in sourceOptions"
  299. :key="dict.dictValue"
  300. :label="dict.dictLabel"
  301. :value="dict.dictValue"
  302. />
  303. </el-select>
  304. </el-form-item>
  305. </el-col>
  306. </el-row>
  307. <el-row>
  308. <el-col :span="12">
  309. <el-form-item label="租赁方式" prop="fRent">
  310. <el-select v-model="form.fRent" style="width: 80%" placeholder="请选择租赁方式" :disabled="doNot">
  311. <el-option
  312. v-for="dict in fRentOptions"
  313. :key="dict.dictValue"
  314. :label="dict.dictLabel"
  315. :value="dict.dictValue"
  316. />
  317. </el-select>
  318. </el-form-item>
  319. </el-col>
  320. <el-col :span="12">
  321. <el-form-item label="空重" prop="fUpdateef">
  322. <el-select v-model="form.fUpdateef" style="width: 80%" placeholder="请请选择空重" :disabled="doNot">
  323. <el-option
  324. v-for="dict in updateEFOptions"
  325. :key="dict.dictValue"
  326. :label="dict.dictLabel"
  327. :value="dict.dictValue"
  328. />
  329. </el-select>
  330. </el-form-item>
  331. </el-col>
  332. <el-col :span="12">
  333. <el-form-item label="箱状态" prop="fCntrstatus">
  334. <el-select v-model="form.fCntrstatus" style="width: 80%" placeholder="请选择箱状态" :disabled="doNot">
  335. <el-option
  336. v-for="dict in cntrstatusOptions"
  337. :key="dict.dictValue"
  338. :label="dict.dictLabel"
  339. :value="dict.dictValue"
  340. />
  341. </el-select>
  342. </el-form-item>
  343. </el-col>
  344. </el-row>
  345. <el-row>
  346. <el-col :span="24">
  347. <el-form-item label="备注" prop="remark">
  348. <el-input v-model="form.remark" style="width: 90%" placeholder="请输入备注" :disabled="doNot"/>
  349. </el-form-item>
  350. </el-col>
  351. </el-row>
  352. </el-form>
  353. <div slot="footer" class="dialog-footer">
  354. <el-button type="info" round @click="doNot = false">修 改</el-button>
  355. <el-button type="success" round @click="submitForm" :disabled="doNot">保 存</el-button>
  356. <el-button @click="cancel" round>关 闭</el-button>
  357. </div>
  358. </el-dialog>
  359. </div>
  360. </template>
  361. <script>
  362. import { listCorps, getInforma, delCorps, addboxinformation, getType,getaddress, changeCorpsStatus,exportCorps } from "@/api/kaihe/containerNews/boxInformation";
  363. import {queryUserVal} from "@/api/system/user";
  364. import { isArray } from '@/utils/validate'
  365. import Vue from 'vue'
  366. import { getportinformation } from '@/api/kaihe/basicdata/portinformation'
  367. Vue.directive('dialogDrag', {
  368. bind(el, binding, vnode, oldVnode) {
  369. const dialogHeaderEl = el.querySelector('.el-dialog__header')
  370. const dragDom = el.querySelector('.el-dialog')
  371. const enlarge = el.querySelector('.enlarge')
  372. dialogHeaderEl.style.cursor = 'move'
  373. // 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
  374. const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null)
  375. if(enlarge){
  376. enlarge.onclick = (e) => {
  377. dragDom.style.top = '0px'
  378. dragDom.style.left = '0px'
  379. }
  380. }
  381. dialogHeaderEl.onmousedown = (e) => {
  382. // 鼠标按下,计算当前元素距离可视区的距离
  383. const disX = e.clientX - dialogHeaderEl.offsetLeft
  384. const disY = e.clientY - dialogHeaderEl.offsetTop
  385. // 获取到的值带px 正则匹配替换
  386. let styL, styT
  387. // 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px
  388. if (sty.left.includes('%')) {
  389. styL = +document.body.clientWidth * (+sty.left.replace(/\%/g, '') / 100)
  390. styT = +document.body.clientHeight * (+sty.top.replace(/\%/g, '') / 100)
  391. } else {
  392. styL = +sty.left.replace(/\px/g, '')
  393. styT = +sty.top.replace(/\px/g, '')
  394. }
  395. document.onmousemove = function(e) {
  396. // 通过事件委托,计算移动的距离
  397. const l = e.clientX - disX
  398. const t = e.clientY - disY
  399. // 移动当前元素
  400. if ((t + styT) >= 0){
  401. dragDom.style.top = `${t + styT}px`
  402. }
  403. dragDom.style.left = `${l + styL}px`
  404. // 将此时的位置传出去
  405. // binding.value({x:e.pageX,y:e.pageY})
  406. }
  407. document.onmouseup = function(e) {
  408. document.onmousemove = null
  409. document.onmouseup = null
  410. }
  411. }
  412. }
  413. })
  414. export default {
  415. name: "boxInformation",
  416. components: {
  417. },
  418. data() {
  419. return {
  420. //默认显示第一行
  421. queryParamsHidden:false,
  422. //字典表箱种类
  423. containerOptions:[],
  424. //集装箱主字典表
  425. ownerOptions:[],
  426. //箱来源字典表
  427. sourceOptions:[],
  428. //租赁方式字典表
  429. fRentOptions:[],
  430. //空重字典表
  431. updateEFOptions:[],
  432. //箱状态字典表
  433. cntrstatusOptions:[],
  434. //模糊查询箱类型
  435. typeOptions:[],
  436. //查看置灰
  437. doNot:true,
  438. //模糊下拉查询地点
  439. addressOptions:[],
  440. //全屏放大
  441. dialogFull:false,
  442. contactList:[],
  443. // 遮罩层
  444. loading: true,
  445. // 选中数组
  446. ids: [],
  447. // 非单个禁用
  448. single: true,
  449. // 非多个禁用
  450. multiple: true,
  451. // 显示搜索条件
  452. showSearch: true,
  453. // 总条数
  454. total: 0,
  455. // 客户详情表格数据
  456. corpsList: [],
  457. // 弹出层标题
  458. title: "",
  459. // 状态数据字典
  460. statusOptions: [],
  461. // 是否显示弹出层
  462. open: false,
  463. // 客户类别字典
  464. fTypeidOptions: [],
  465. // 结算表票结、月结字典
  466. fStltypeidOptions: [],
  467. // 删除状态字典
  468. delFlagOptions: [],
  469. // 查询参数
  470. queryParams: {
  471. pageNum: 1,
  472. pageSize: 10,
  473. fNo:null,
  474. fTypeid:null,
  475. fCntrstatus:null,
  476. fOwner:null,
  477. createBy:null,
  478. cLoadDate:null,
  479. remark:null,
  480. },
  481. // 表单参数
  482. form: {
  483. fTypeid:null,
  484. fUpdateaddress:null,
  485. fOwner:null,
  486. fNo:null,
  487. fSource:null,
  488. fRent:null,
  489. fUpdateef:null,
  490. fCntrstatus:null,
  491. remark:null
  492. },
  493. // 表单校验
  494. rules: {
  495. fTypeid: [
  496. { required: true, message: "", trigger: "blur" }
  497. ],
  498. fNo: [
  499. { required: true, message: "箱号不能为空", trigger: "blur" }
  500. ],
  501. fUpdateaddress: [
  502. { required: true, message: "最新地点不能为空", trigger: "blur" }
  503. ],
  504. fOwner:[
  505. { required: true, message: "箱主不能为空", trigger: "blur" }
  506. ],
  507. fUpdateef: [
  508. { required: true, message: "空重不能为空", trigger: "blur" }
  509. ],
  510. fCntrstatus: [
  511. { required: true, message: "箱状态不能为空", trigger: "blur" }
  512. ],
  513. }
  514. };
  515. },
  516. created() {
  517. this.getList();
  518. this.getDicts("f_type").then(response => {
  519. this.containerOptions = response.data;
  520. });
  521. this.getDicts("f_owner").then(response => {
  522. this.ownerOptions = response.data;
  523. });
  524. this.getDicts("f_source").then(response => {
  525. this.sourceOptions = response.data;
  526. });
  527. this.getDicts("f_rent").then(response => {
  528. this.fRentOptions = response.data;
  529. });
  530. this.getDicts("f_updateEF").then(response => {
  531. this.updateEFOptions = response.data;
  532. });
  533. this.getDicts("f_cntrstatus").then(response => {
  534. this.cntrstatusOptions = response.data;
  535. });
  536. this.boxTypeMethod()
  537. this.addressMethod()
  538. },
  539. methods: {
  540. //模糊查询地点
  541. addressMethod(){
  542. let queryParams = { pageNum: 1,};
  543. getaddress(queryParams).then(response=>{
  544. this.addressOptions = response.rows
  545. console.log(response)
  546. })
  547. },
  548. //模糊查询箱类型
  549. boxTypeMethod(){
  550. let queryParams = { pageNum: 1,};
  551. getType(queryParams).then(response =>{
  552. console.log(response)
  553. this.typeOptions = response.rows
  554. })
  555. },
  556. full(){
  557. this.dialogFull = !this.dialogFull
  558. },
  559. /** 查询客户详情列表 */
  560. getList() {
  561. this.loading = true;
  562. listCorps(this.queryParams).then(response => {
  563. this.corpsList = response.rows;
  564. this.total = response.total;
  565. this.loading = false;
  566. });
  567. },
  568. // 客户类别字典翻译
  569. fTypeidFormat(row, column) {
  570. return this.selectDictLabel(this.fTypeidOptions, row.fTypeid);
  571. },
  572. // 结算表票结、月结字典翻译
  573. fStltypeidFormat(row, column) {
  574. return this.selectDictLabel(this.fStltypeidOptions, row.fStltypeid);
  575. },
  576. // 删除状态字典翻译
  577. delFlagFormat(row, column) {
  578. return this.selectDictLabel(this.delFlagOptions, row.delFlag);
  579. },
  580. // 取消按钮
  581. cancel() {
  582. this.open = false;
  583. this.reset();
  584. },
  585. // 表单重置
  586. reset() {
  587. this.form = {
  588. fTypeid:null,
  589. fUpdateaddress:null,
  590. fOwner:null,
  591. fNo:null,
  592. fSource:null,
  593. fRent:null,
  594. fUpdateef:null,
  595. fCntrstatus:null,
  596. remark:null
  597. };
  598. this.resetForm("form");
  599. },
  600. // 从表重置
  601. contList() {
  602. this.contactList = []
  603. },
  604. // 状态修改
  605. handleStatusChange(row) {
  606. let text = row.fStatus === "0" ? "启用" : "停用";
  607. this.$confirm('确认要"' + text + '""' + row.fName + '"吗?', "警告", {
  608. confirmButtonText: "确定",
  609. cancelButtonText: "取消",
  610. type: "warning"
  611. }).then(function() {
  612. return changeCorpsStatus(row.fId, row.fStatus);
  613. }).then(() => {
  614. this.msgSuccess(text + "成功");
  615. }).catch(function() {
  616. row.fStatus = row.fStatus === "0" ? "1" : "0";
  617. });
  618. },
  619. /** 搜索按钮操作 */
  620. handleQuery() {
  621. this.queryParams.pageNum = 1;
  622. this.getList();
  623. },
  624. /** 重置按钮操作 */
  625. resetQuery() {
  626. this.resetForm("queryForm");
  627. this.handleQuery();
  628. },
  629. // 多选框选中数据
  630. handleSelectionChange(selection) {
  631. this.ids = selection.map(item => item.fId)
  632. this.single = selection.length!==1
  633. this.multiple = !selection.length
  634. },
  635. /** 新增按钮操作 */
  636. handleAdd() {
  637. this.doNot = false
  638. this.reset();
  639. this.open = true;
  640. this.title = "添加客户详情";
  641. },
  642. /** 修改按钮操作 */
  643. handleUpdate(row) {
  644. this.doNot = true
  645. this.reset();
  646. const fId = row.fId || this.ids
  647. getInforma(fId).then(response => {
  648. this.form = response.data;
  649. console.log(response.data)
  650. console.log(this.form)
  651. this.form.fUpdateaddress = response.data.addressName
  652. this.open = true;
  653. this.title = "修改客户详情";
  654. });
  655. },
  656. /** 提交按钮 */
  657. submitForm() {
  658. this.$refs["form"].validate(valid => {
  659. if (valid) {
  660. if (this.form.fId != null) {
  661. console.log("111")
  662. addboxinformation(this.form).then(response => {
  663. this.msgSuccess("修改成功");
  664. this.open = false;
  665. this.getList();
  666. });
  667. } else {
  668. addboxinformation(this.form).then(response => {
  669. this.msgSuccess("新增成功");
  670. this.open = false;
  671. this.getList();
  672. });
  673. }
  674. }
  675. });
  676. },
  677. /** 删除按钮操作 */
  678. handleDelete(row) {
  679. const fIds = row.fId || this.ids;
  680. this.$confirm('是否确认删除客户详情编号为"' + fIds + '"的数据项?', "警告", {
  681. confirmButtonText: "确定",
  682. cancelButtonText: "取消",
  683. type: "warning"
  684. }).then(function() {
  685. return delCorps(fIds);
  686. }).then(() => {
  687. this.getList();
  688. this.msgSuccess("删除成功");
  689. })
  690. },
  691. /** 导出按钮操作 */
  692. handleExport() {
  693. const queryParams = this.queryParams;
  694. this.$confirm('是否确认导出所有客户详情数据项?', "警告", {
  695. confirmButtonText: "确定",
  696. cancelButtonText: "取消",
  697. type: "warning"
  698. }).then(function() {
  699. return exportCorps(queryParams);
  700. }).then(response => {
  701. this.download(response.msg);
  702. })
  703. }
  704. }
  705. };
  706. </script>
  707. <style lang="scss">
  708. .avue-crud__dialog__header {
  709. display: -webkit-box;
  710. display: -ms-flexbox;
  711. display: flex;
  712. -webkit-box-align: center;
  713. -ms-flex-align: center;
  714. align-items: center;
  715. -webkit-box-pack: justify;
  716. -ms-flex-pack: justify;
  717. justify-content: space-between;
  718. }
  719. .el-dialog__title {
  720. color: rgba(0,0,0,.85);
  721. font-weight: 500;
  722. word-wrap: break-word;
  723. }
  724. .avue-crud__dialog__menu {
  725. padding-right: 20px;
  726. float: left;
  727. }
  728. .avue-crud__dialog__menu i {
  729. color: #909399;
  730. font-size: 15px;
  731. }
  732. .el-icon-full-screen{
  733. cursor: pointer;
  734. }
  735. .el-icon-full-screen:before {
  736. content: "\e719";
  737. }
  738. </style>