index.vue 26 KB

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