index.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737
  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="fName">
  10. <el-input
  11. v-model="queryParams.fName"
  12. style="width: 200px"
  13. placeholder="请输入名称"
  14. clearable
  15. size="small"
  16. @keyup.enter.native="handleQuery"
  17. />
  18. </el-form-item>
  19. <el-form-item label="状态" prop="fStatus">
  20. <el-select
  21. v-model="queryParams.fStatus"
  22. style="width: 200px"
  23. placeholder="请选择状态"
  24. clearable
  25. size="small"
  26. @keyup.enter.native="handleQuery"
  27. >
  28. <el-option label="正常" value="T"/>
  29. <el-option label="停用" value="F"/>
  30. </el-select>
  31. </el-form-item>
  32. <el-form-item label="箱种类" prop="fType">
  33. <el-select
  34. v-model="queryParams.fType"
  35. style="width: 200px"
  36. placeholder="请选择箱种类"
  37. clearable
  38. size="small"
  39. filterable
  40. @keyup.enter.native="handleQuery"
  41. >
  42. <el-option
  43. v-for="dict in containerOptions"
  44. :key="dict.dictValue"
  45. :label="dict.dictLabel"
  46. :value="dict.dictValue"
  47. />
  48. </el-select>
  49. </el-form-item>
  50. </el-row>
  51. <div v-show="queryParamsHidden">
  52. <el-row>
  53. <!-- <el-col :span="8">-->
  54. <!-- <el-form-item label="中文名" prop="fName">-->
  55. <!-- <el-input-->
  56. <!-- v-model="queryParams.fName"-->
  57. <!-- placeholder="客户状态"-->
  58. <!-- clearable-->
  59. <!-- size="small"-->
  60. <!-- style="width: 250px"-->
  61. <!-- >-->
  62. <!-- </el-input>-->
  63. <!-- </el-form-item>-->
  64. <!-- </el-col>-->
  65. <el-form-item label="UNCODE">
  66. <el-input
  67. v-model="queryParams.fUncode"
  68. style="width: 200px"
  69. clearable
  70. size="small"
  71. placeholder="请输入UNCODE"
  72. />
  73. </el-form-item>
  74. <el-form-item label="录入人" prop="createBy">
  75. <el-input
  76. v-model="queryParams.createBy"
  77. style="width: 200px"
  78. placeholder="请输入录入人"
  79. clearable
  80. size="small"
  81. @keyup.enter.native="handleQuery"
  82. />
  83. </el-form-item>
  84. <el-form-item label="备注" prop="remark">
  85. <el-input
  86. style="width: 200px"
  87. type="textarea"
  88. clearable
  89. size="small"
  90. v-model="queryParams.remark"
  91. />
  92. </el-form-item>
  93. <el-form-item label="录入区间" prop="cLoadDate">
  94. <el-date-picker
  95. v-model="queryParams.cLoadDate"
  96. type="daterange"
  97. value-format="yyyy-MM-dd"
  98. range-separator="至"
  99. start-placeholder="开始日期"
  100. end-placeholder="结束日期"
  101. style="width: 250px"
  102. >
  103. </el-date-picker>
  104. </el-form-item>
  105. </el-row>
  106. </div>
  107. </el-form>
  108. <el-row :gutter="10" class="mb8">
  109. <el-col :span="1.5">
  110. <el-button
  111. type="success"
  112. icon="el-icon-plus"
  113. size="mini"
  114. @click="handleAdd"
  115. v-hasPermi="['shipping:cntr:add']"
  116. >新增</el-button>
  117. </el-col>
  118. <el-col :span="1.5">
  119. <el-button
  120. type="warning"
  121. icon="el-icon-edit"
  122. size="mini"
  123. :disabled="single"
  124. @click="handleUpdate"
  125. v-hasPermi="['shipping:cntr:edit']"
  126. >修改</el-button>
  127. </el-col>
  128. <el-col :span="1.5">
  129. <el-button
  130. type="danger"
  131. icon="el-icon-delete"
  132. size="mini"
  133. :disabled="multiple"
  134. @click="handleDelete"
  135. v-hasPermi="['shipping:cntr:remove']"
  136. >删除</el-button>
  137. </el-col>
  138. <el-col :span="1.5">
  139. <el-button
  140. type="primary"
  141. icon="el-icon-download"
  142. size="mini"
  143. @click="handleExport"
  144. v-hasPermi="['basicdata:container:import']"
  145. >导入</el-button>
  146. </el-col>
  147. <el-col :span="1.5">
  148. <el-button
  149. type="primary"
  150. icon="el-icon-download"
  151. size="mini"
  152. @click="handleExport"
  153. v-hasPermi="['shipping:cntr:export']"
  154. >导出</el-button>
  155. </el-col>
  156. <el-col :span="1.5">
  157. <el-button
  158. type="info"
  159. icon="el-icon-download"
  160. size="mini"
  161. @click="handleExport"
  162. v-hasPermi="['basicdata:container:list']"
  163. >取消</el-button>
  164. </el-col>
  165. <el-col style="position: absolute;left:75%" :span="5" >
  166. <el-button size="small" @click="queryParamsHidden ? (queryParamsHidden = false) : (queryParamsHidden = true)">{{ queryParamsHidden ? '隐藏' : '更多' }}</el-button>
  167. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  168. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  169. </el-col>
  170. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  171. </el-row>
  172. <el-table v-loading="loading" :data="corpsList" @selection-change="handleSelectionChange">
  173. <el-table-column type="selection" width="55" align="center" />
  174. <el-table-column type="index" width="55" label="行号" align="center" fixed/>
  175. <el-table-column :show-overflow-tooltip="true" label="编号" align="center" prop="fNo" width="100px" fixed/>
  176. <el-table-column label="名称" align="center" prop="fName" width="100px" fixed/>
  177. <el-table-column :show-overflow-tooltip="true" label="箱类型" align="center" prop="typeName" width="100px" fixed/>
  178. <el-table-column :show-overflow-tooltip="true" label="英文名" align="center" width="100px" prop="fEname" fixed/>
  179. <el-table-column :show-overflow-tooltip="true" label="UNCODE" align="center" prop="fUncode" fixed/>
  180. <el-table-column :show-overflow-tooltip="true" label="TEU" align="center" prop="fTeu" />
  181. <el-table-column label="箱容量(立方)" align="center" prop="fCbm" />
  182. <el-table-column label="毛重(T)" align="center" prop="fWeight" />
  183. <el-table-column label="状态" align="center" prop="fStatus" />
  184. <el-table-column label="备注" align="center" prop="remark" />
  185. <el-table-column label="录入人" align="center" prop="createBy" />
  186. <el-table-column label="录入时间" align="center" prop="createTime" width="100">
  187. <template slot-scope="scope">
  188. <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
  189. </template>
  190. </el-table-column>
  191. <el-table-column label="最新修改人" align="center" prop="updateBy" width="100px"/>
  192. <el-table-column label="最新修改时间" align="center" prop="updateTime" width="100">
  193. <template slot-scope="scope">
  194. <span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
  195. </template>
  196. </el-table-column>
  197. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120px" fixed="right">
  198. <template slot-scope="scope">
  199. <el-button
  200. size="mini"
  201. type="text"
  202. icon="el-icon-edit"
  203. @click="handleUpdate(scope.row)"
  204. >查看</el-button>
  205. <el-button
  206. size="mini"
  207. type="text"
  208. icon="el-icon-delete"
  209. @click="handleDelete(scope.row)"
  210. >移除</el-button>
  211. </template>
  212. </el-table-column>
  213. </el-table>
  214. <pagination
  215. v-show="total>0"
  216. :total="total"
  217. :page.sync="queryParams.pageNum"
  218. :limit.sync="queryParams.pageSize"
  219. @pagination="getList"
  220. />
  221. <!-- 添加或修改客户详情对话框 -->
  222. <el-dialog
  223. v-dialogDrag
  224. :fullscreen="dialogFull"
  225. :title="title"
  226. :visible.sync="open"
  227. close-on-click-modal="false"
  228. width="60%"
  229. :close-on-click-modal="false"
  230. append-to-body>
  231. <template slot="title">
  232. <div class="avue-crud__dialog__header">
  233. <span class="el-dialog__title">
  234. <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px"></span>
  235. </span>
  236. <div class="avue-crud__dialog__menu enlarge" @click="full">
  237. <i style="cursor: pointer;display: block;width:12px;height:12px;border:1px solid #909399;border-top:3px solid #909399;margin-top: -3px;"></i>
  238. </div>
  239. </div>
  240. </template>
  241. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  242. <el-row>
  243. <el-col :span="12">
  244. <el-form-item label="箱种类" prop="fType" label-width="100px">
  245. <el-select style="width: 80%" :disabled="doNot" v-model="form.fType" placeholder="请选择箱种类">
  246. <el-option
  247. v-for="dict in containerOptions"
  248. :key="dict.dictValue"
  249. :label="dict.dictLabel"
  250. :value="dict.dictValue"
  251. />
  252. </el-select>
  253. </el-form-item>
  254. </el-col>
  255. <el-col :span="12">
  256. <el-form-item label="UNCODE" prop="fUncode" label-width="100px">
  257. <el-input v-model="form.fUncode" :disabled="doNot" style="width: 80%" placeholder="请输入UNCODE" />
  258. </el-form-item>
  259. </el-col>
  260. </el-row>
  261. <el-row>
  262. <el-col :span="12">
  263. <el-form-item label="编号" prop="fNo" label-width="100px">
  264. <el-input v-model="form.fNo" :disabled="doNot" style="width: 80%" placeholder="请输入编号" />
  265. </el-form-item>
  266. </el-col>
  267. <el-col :span="12">
  268. <el-form-item label="TEU" prop="fTeu" label-width="100px">
  269. <el-input v-model.number="form.fTeu" :disabled="doNot" style="width: 80%" placeholder="请输入TEU" />
  270. </el-form-item>
  271. </el-col>
  272. </el-row>
  273. <el-row>
  274. <el-col :span="12">
  275. <el-form-item label="名称" prop="fName" label-width="100px">
  276. <el-input v-model="form.fName" :disabled="doNot" style="width: 80%" placeholder="请输入名称" />
  277. </el-form-item>
  278. </el-col>
  279. <el-col :span="12">
  280. <el-form-item label="英文名" prop="fEname" label-width="100px">
  281. <el-input v-model="form.fEname" :disabled="doNot" style="width: 80%" placeholder="请输入英文名" />
  282. </el-form-item>
  283. </el-col>
  284. </el-row>
  285. <el-row>
  286. <el-col :span="12">
  287. <el-form-item label="毛重(T)" prop="fWeight" label-width="100px">
  288. <el-input v-model="form.fWeight" :disabled="doNot" style="width: 80%" placeholder="请输入毛重" />
  289. </el-form-item>
  290. </el-col>
  291. <el-col :span="12">
  292. <el-form-item label="容积(立方)" prop="fCbm" label-width="100px" >
  293. <el-input v-model="form.fCbm" :disabled="doNot" style="width: 80%" placeholder="请输入容积" />
  294. </el-form-item>
  295. </el-col>
  296. </el-row>
  297. <el-row>
  298. <!-- <el-col :span="12">-->
  299. <!-- <el-form-item label="箱类型" prop="fEname" label-width="90px">-->
  300. <!-- <el-select v-model="form.fEname" style="width: 80%" placeholder="请输入内容" >-->
  301. <!-- <el-option label="普柜" value=""></el-option>-->
  302. <!-- <el-option label="冻柜" value=""></el-option>-->
  303. <!-- </el-select>-->
  304. <!-- </el-form-item>-->
  305. <!-- </el-col>-->
  306. </el-row>
  307. <el-row>
  308. <el-col :span="12" label-width="100px">
  309. <el-form-item label="尺码值" prop="fCntrsize" label-width="100px">
  310. <el-select
  311. v-model="form.fCntrsize"
  312. :disabled="doNot"
  313. style="width: 80%"
  314. placeholder="请输入内容"
  315. >
  316. <el-option
  317. v-for="item in CntrsizeOptions"
  318. :key="item.dictValue"
  319. :label="item.dictLabel"
  320. :value="item.dictValue"
  321. />
  322. </el-select>
  323. </el-form-item>
  324. </el-col>
  325. <el-col :span="12" label-width="100px">
  326. <el-form-item label="状态" prop="fStatus" label-width="100px">
  327. <el-select v-model="form.fStatus" style="width: 80%" :disabled="doNot" placeholder="请选择状态" >
  328. <el-option label="正常" value="T"/>
  329. <el-option label="停用" value="F"/>
  330. </el-select>
  331. </el-form-item>
  332. </el-col>
  333. </el-row>
  334. <el-row>
  335. <el-col :span="24" >
  336. <el-form-item label="备注" prop="remark" label-width="100px">
  337. <el-input v-model="form.remark" style="width: 100%" :disabled="doNot" placeholder="" />
  338. </el-form-item>
  339. </el-col>
  340. </el-row>
  341. </el-form>
  342. <div slot="footer" class="dialog-footer">
  343. <el-button type="info" round @click="doNot = false">修 改</el-button>
  344. <el-button type="success" round @click="submitForm" :disabled="doNot">保 存</el-button>
  345. <el-button @click="cancel" round>关 闭</el-button>
  346. </div>
  347. </el-dialog>
  348. </div>
  349. </template>
  350. <script>
  351. import { listCorps, getCorps, delCorps, addcontainer, getNo, getName, changeCorpsStatus,exportCorps } from "@/api/kaihe/basicdata/container";
  352. import Vue from 'vue'
  353. import { getyardName, getyardNo } from '@/api/kaihe/basicdata/yard'
  354. Vue.directive('dialogDrag', {
  355. bind(el, binding, vnode, oldVnode) {
  356. const dialogHeaderEl = el.querySelector('.el-dialog__header')
  357. const dragDom = el.querySelector('.el-dialog')
  358. const enlarge = el.querySelector('.enlarge')
  359. dialogHeaderEl.style.cursor = 'move'
  360. // 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
  361. const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null)
  362. if(enlarge){
  363. enlarge.onclick = (e) => {
  364. dragDom.style.top = '0px'
  365. dragDom.style.left = '0px'
  366. }
  367. }
  368. dialogHeaderEl.onmousedown = (e) => {
  369. // 鼠标按下,计算当前元素距离可视区的距离
  370. const disX = e.clientX - dialogHeaderEl.offsetLeft
  371. const disY = e.clientY - dialogHeaderEl.offsetTop
  372. // 获取到的值带px 正则匹配替换
  373. let styL, styT
  374. // 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px
  375. if (sty.left.includes('%')) {
  376. styL = +document.body.clientWidth * (+sty.left.replace(/\%/g, '') / 100)
  377. styT = +document.body.clientHeight * (+sty.top.replace(/\%/g, '') / 100)
  378. } else {
  379. styL = +sty.left.replace(/\px/g, '')
  380. styT = +sty.top.replace(/\px/g, '')
  381. }
  382. document.onmousemove = function(e) {
  383. // 通过事件委托,计算移动的距离
  384. const l = e.clientX - disX
  385. const t = e.clientY - disY
  386. // 移动当前元素
  387. if ((t + styT) >= 0){
  388. dragDom.style.top = `${t + styT}px`
  389. }
  390. dragDom.style.left = `${l + styL}px`
  391. // 将此时的位置传出去
  392. // binding.value({x:e.pageX,y:e.pageY})
  393. }
  394. document.onmouseup = function(e) {
  395. document.onmousemove = null
  396. document.onmouseup = null
  397. }
  398. }
  399. }
  400. })
  401. export default {
  402. name: "container",
  403. components: {
  404. },
  405. data() {
  406. return {
  407. //字典表箱种类
  408. containerOptions:[],
  409. //查看置灰
  410. doNot:true,
  411. //集装箱尺码字典表
  412. CntrsizeOptions:[],
  413. //默认显示第一行
  414. queryParamsHidden:false,
  415. //全屏放大
  416. dialogFull:false,
  417. contactList:[],
  418. // 遮罩层
  419. loading: true,
  420. // 选中数组
  421. ids: [],
  422. // 非单个禁用
  423. single: true,
  424. // 非多个禁用
  425. multiple: true,
  426. // 显示搜索条件
  427. showSearch: true,
  428. // 总条数
  429. total: 0,
  430. // 客户详情表格数据
  431. corpsList: [],
  432. // 弹出层标题
  433. title: "",
  434. // 状态数据字典
  435. statusOptions: [],
  436. // 是否显示弹出层
  437. open: false,
  438. // 客户类别字典
  439. fTypeidOptions: [],
  440. // 结算表票结、月结字典
  441. fStltypeidOptions: [],
  442. // 删除状态字典
  443. delFlagOptions: [],
  444. // 查询参数
  445. queryParams: {
  446. pageNum: 1,
  447. pageSize: 10,
  448. fNo:null,
  449. fName:null,
  450. fStatus:null,
  451. fType:null,
  452. fUncode:null,
  453. createBy:null,
  454. cLoadDate:null,
  455. remark:null
  456. },
  457. // 表单参数
  458. form: {
  459. fType:null,
  460. fUncode:null,
  461. fNo:null,
  462. fTeu:null,
  463. fName:null,
  464. fEname:null,
  465. fWeight:null,
  466. fCbm:null,
  467. fCntrsize:null,
  468. fStatus:'T',
  469. remark:null
  470. },
  471. // 表单校验
  472. rules: {
  473. fNo: [
  474. { required: true, message: "编号不能为空", trigger: "blur" }
  475. ],
  476. fName: [
  477. { required: true, message: "名称不能为空", trigger: "blur" }
  478. ],
  479. fEname: [
  480. { required: true, message: "英文名不能为空", trigger: "blur" }
  481. ],
  482. fTeu: [{ required: true, message: '请输入数字', trigger: 'blur',type:'number'},
  483. ]
  484. }
  485. };
  486. },
  487. created() {
  488. this.getList();
  489. this.getDicts("data_customer_category").then(response => {
  490. this.fTypeidOptions = response.data;
  491. });
  492. this.getDicts("data_stltype_type").then(response => {
  493. this.fStltypeidOptions = response.data;
  494. });
  495. this.getDicts("data_delete_state").then(response => {
  496. this.delFlagOptions = response.data;
  497. });
  498. this.getDicts("sys_normal_disable").then(response => {
  499. this.statusOptions = response.data;
  500. });
  501. this.getDicts("f_type").then(response => {
  502. this.containerOptions = response.data;
  503. });
  504. this.getDicts("f_cntrsize").then(response => {
  505. this.CntrsizeOptions = response.data;
  506. });
  507. },
  508. methods: {
  509. full(){
  510. this.dialogFull = !this.dialogFull
  511. },
  512. // 客户类别默认为客户结算方式默认月结
  513. query() {
  514. this.$set(this.form, "fStltypeid", 1);
  515. },
  516. // 添加行
  517. addRow(tableData,event){
  518. var obj = {}
  519. tableData.push(obj)
  520. },
  521. //删除行
  522. deleteRow(index, rows) {
  523. rows.splice(index, 1);
  524. },
  525. /** 查询客户详情列表 */
  526. getList() {
  527. this.loading = true;
  528. listCorps(this.queryParams).then(response => {
  529. this.corpsList = response.rows;
  530. this.total = response.total;
  531. this.loading = false;
  532. });
  533. },
  534. // 客户类别字典翻译
  535. fTypeidFormat(row, column) {
  536. return this.selectDictLabel(this.fTypeidOptions, row.fTypeid);
  537. },
  538. // 结算表票结、月结字典翻译
  539. fStltypeidFormat(row, column) {
  540. return this.selectDictLabel(this.fStltypeidOptions, row.fStltypeid);
  541. },
  542. // 删除状态字典翻译
  543. delFlagFormat(row, column) {
  544. return this.selectDictLabel(this.delFlagOptions, row.delFlag);
  545. },
  546. // 取消按钮
  547. cancel() {
  548. this.open = false;
  549. this.reset();
  550. },
  551. // 表单重置
  552. reset() {
  553. this.form = {
  554. fType:null,
  555. fUncode:null,
  556. fNo:null,
  557. fTeu:null,
  558. fName:null,
  559. fEname:null,
  560. fWeight:null,
  561. fCbm:null,
  562. fCntrsize:null,
  563. fStatus:'T',
  564. remark:null
  565. };
  566. this.resetForm("form");
  567. },
  568. // 从表重置
  569. contList() {
  570. this.contactList = []
  571. },
  572. // 状态修改
  573. handleStatusChange(row) {
  574. let text = row.fStatus === "0" ? "启用" : "停用";
  575. this.$confirm('确认要"' + text + '""' + row.fName + '"吗?', "警告", {
  576. confirmButtonText: "确定",
  577. cancelButtonText: "取消",
  578. type: "warning"
  579. }).then(function() {
  580. return changeCorpsStatus(row.fId, row.fStatus);
  581. }).then(() => {
  582. this.msgSuccess(text + "成功");
  583. }).catch(function() {
  584. row.fStatus = row.fStatus === "0" ? "1" : "0";
  585. });
  586. },
  587. /** 搜索按钮操作 */
  588. handleQuery() {
  589. this.queryParams.pageNum = 1;
  590. this.getList();
  591. },
  592. /** 重置按钮操作 */
  593. resetQuery() {
  594. this.resetForm("queryForm");
  595. this.handleQuery();
  596. },
  597. // 多选框选中数据
  598. handleSelectionChange(selection) {
  599. this.ids = selection.map(item => item.fId)
  600. this.single = selection.length!==1
  601. this.multiple = !selection.length
  602. },
  603. /** 新增按钮操作 */
  604. handleAdd() {
  605. this.doNot = false
  606. this.reset();
  607. this.query();
  608. this.contList();
  609. this.open = true;
  610. this.title = "添加客户详情";
  611. },
  612. /** 修改按钮操作 */
  613. handleUpdate(row) {
  614. this.doNot = true
  615. this.reset();
  616. const fId = row.fId || this.ids
  617. getCorps(fId).then(response => {
  618. this.form = response.data;
  619. this.form.fType = response.data.fType + ''
  620. this.form.fCntrsize = response.data.fCntrsize + ''
  621. this.open = true;
  622. this.title = "修改客户详情";
  623. });
  624. },
  625. /** 提交按钮 */
  626. submitForm() {
  627. this.$refs["form"].validate(valid => {
  628. if (valid) {
  629. if (this.form.fId != null) {
  630. addcontainer(this.form).then(response => {
  631. this.msgSuccess("修改成功");
  632. this.open = false;
  633. this.getList();
  634. });
  635. } else {
  636. addcontainer(this.form).then(response => {
  637. this.msgSuccess("新增成功");
  638. this.open = false;
  639. this.getList();
  640. });
  641. }
  642. }
  643. });
  644. },
  645. /** 删除按钮操作 */
  646. handleDelete(row) {
  647. const fIds = row.fId || this.ids;
  648. this.$confirm('是否确认删除客户详情编号为"' + fIds + '"的数据项?', "警告", {
  649. confirmButtonText: "确定",
  650. cancelButtonText: "取消",
  651. type: "warning"
  652. }).then(function() {
  653. return delCorps(fIds);
  654. }).then(() => {
  655. this.getList();
  656. this.msgSuccess("删除成功");
  657. })
  658. },
  659. /** 导出按钮操作 */
  660. handleExport() {
  661. const queryParams = this.queryParams;
  662. this.$confirm('是否确认导出所有客户详情数据项?', "警告", {
  663. confirmButtonText: "确定",
  664. cancelButtonText: "取消",
  665. type: "warning"
  666. }).then(function() {
  667. return exportCorps(queryParams);
  668. }).then(response => {
  669. this.download(response.msg);
  670. })
  671. }
  672. }
  673. };
  674. </script>
  675. <style lang="scss">
  676. .avue-crud__dialog__header {
  677. display: -webkit-box;
  678. display: -ms-flexbox;
  679. display: flex;
  680. -webkit-box-align: center;
  681. -ms-flex-align: center;
  682. align-items: center;
  683. -webkit-box-pack: justify;
  684. -ms-flex-pack: justify;
  685. justify-content: space-between;
  686. }
  687. .el-dialog__title {
  688. color: rgba(0,0,0,.85);
  689. font-weight: 500;
  690. word-wrap: break-word;
  691. }
  692. .avue-crud__dialog__menu {
  693. padding-right: 20px;
  694. float: left;
  695. }
  696. .avue-crud__dialog__menu i {
  697. color: #909399;
  698. font-size: 15px;
  699. }
  700. .el-icon-full-screen{
  701. cursor: pointer;
  702. }
  703. .el-icon-full-screen:before {
  704. content: "\e719";
  705. }
  706. </style>