index.vue 50 KB

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